UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

32,492 lines • 1.22 MB
function __vite_inject_css__(css, id, forceLightDom){  if (typeof document==='undefined') return;  var shadow=!forceLightDom&&typeof window!=='undefined'&&window.__efpShadowDOMStyleParent;  var parent=shadow||document.head;  var s=document.createElement('style');  s.setAttribute('data-chunk-style', id);  s.appendChild(document.createTextNode(css));  parent.appendChild(s);  if (shadow) (window.__efpStyleElements||(window.__efpStyleElements=[])).push(s);}
(function() {
	try {
		var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
		e.SENTRY_RELEASE = { id: "3.39.1" };
		var t = new e.Error().stack;
		t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "ec4849ab-3a8f-4e0a-917c-5c0ae74b86d3", e._sentryDebugIdIdentifier = "sentry-dbid-ec4849ab-3a8f-4e0a-917c-5c0ae74b86d3");
	} catch {}
})();
import { r as e, t } from "./rolldown-runtime-BOCG9HEF.js";
import { A as n, B as r, Bt as i, C as a, G as o, H as s, I as c, J as l, K as u, L as d, M as f, Q as p, R as m, U as h, V as g, W as _, Y as v, _ as y, a as b, c as x, ct as S, d as C, dt as w, f as T, ft as E, h as D, it as O, j as k, l as A, m as j, n as ee, nt as te, ot as ne, p as re, s as M, st as ie, t as ae, v as N, w as oe, y as se } from "./i18n-BVE2kS7w.js";
import { s as ce } from "./efp-debug-init-DfQX41Dz.js";
import { t as le } from "./react-CM7l092i.js";
import { t as ue } from "./jsx-runtime-BGutO_I9.js";
import { n as de, r as P, t as fe } from "./loadImage-B-6VhOfG.js";
import { t as pe } from "./is-webview-BoQ3VPRe.js";
import { t as me } from "./scheduler-CYuaS4GW.js";
import { $ as he, $t as ge, A as _e, At as ve, B as ye, Bt as be, C as xe, Ct as Se, D as Ce, Dt as we, E as Te, Et as Ee, F as De, Ft as Oe, G as ke, Gt as Ae, H as je, Ht as Me, I as Ne, It as Pe, J as Fe, Jt as Ie, K as Le, Kt as Re, L as ze, Lt as Be, M as Ve, Mt as He, N as Ue, Nt as We, O as Ge, Ot as Ke, P as qe, Pt as Je, Q as F, Qt as Ye, R as Xe, Rt as Ze, S as Qe, Sn as $e, St as et, T as tt, Tt as nt, U as rt, Ut as it, V as at, Vt as ot, W as st, Wt as ct, X as lt, Xt as ut, Y as dt, Yt as ft, Z as pt, Zt as mt, _ as ht, _n as gt, _t, a as vt, an as yt, at as bt, b as xt, bn as St, bt as Ct, cn as wt, ct as Tt, d as Et, dn as Dt, dt as Ot, en as kt, et as At, f as jt, fn as Mt, ft as Nt, g as Pt, gn as Ft, gt as It, h as Lt, hn as Rt, ht as zt, i as Bt, in as Vt, it as Ht, j as Ut, jt as Wt, k as Gt, kt as Kt, l as qt, ln as Jt, lt as Yt, m as Xt, mn as Zt, mt as Qt, nn as $t, nt as en, o as tn, on as nn, ot as rn, p as an, pn as on, pt as sn, q as cn, qt as ln, r as un, rn as dn, rt as fn, s as pn, sn as mn, st as hn, tn as gn, tt as _n, u as vn, un as yn, ut as bn, v as xn, vn as I, vt as Sn, w as Cn, wt as wn, x as Tn, xn as En, xt as Dn, y as On, yn as kn, yt as An, z as jn, zt as Mn } from "./debug-context-CxXzVYRx.js";
import { t as Nn } from "./classnames-4Iik8FC_.js";
import { t as Pn } from "./Button-DDJ9HcfI.js";
//#region ../../node_modules/.pnpm/resize-observer@1.0.4/node_modules/resize-observer/lib/ContentRect.js
var Fn = /* @__PURE__ */ t(((e) => {
	Object.defineProperty(e, "__esModule", { value: !0 }), e.ContentRect = function(e) {
		if ("getBBox" in e) {
			var t = e.getBBox();
			return Object.freeze({
				height: t.height,
				left: 0,
				top: 0,
				width: t.width
			});
		} else {
			var n = window.getComputedStyle(e);
			return Object.freeze({
				height: parseFloat(n.height || "0"),
				left: parseFloat(n.paddingLeft || "0"),
				top: parseFloat(n.paddingTop || "0"),
				width: parseFloat(n.width || "0")
			});
		}
	};
})), In = /* @__PURE__ */ t(((e) => {
	Object.defineProperty(e, "__esModule", { value: !0 });
	var t = Fn();
	e.ResizeObservation = function() {
		function e(e) {
			this.target = e, this.$$broadcastWidth = this.$$broadcastHeight = 0;
		}
		return Object.defineProperty(e.prototype, "broadcastWidth", {
			get: function() {
				return this.$$broadcastWidth;
			},
			enumerable: !0,
			configurable: !0
		}), Object.defineProperty(e.prototype, "broadcastHeight", {
			get: function() {
				return this.$$broadcastHeight;
			},
			enumerable: !0,
			configurable: !0
		}), e.prototype.isActive = function() {
			var e = t.ContentRect(this.target);
			return !!e && (e.width !== this.broadcastWidth || e.height !== this.broadcastHeight);
		}, e;
	}();
})), Ln = /* @__PURE__ */ t(((e) => {
	Object.defineProperty(e, "__esModule", { value: !0 });
	var t = Fn();
	e.ResizeObserverEntry = function() {
		function e(e) {
			this.target = e, this.contentRect = t.ContentRect(e);
		}
		return e;
	}();
})), Rn = /* @__PURE__ */ t(((e) => {
	Object.defineProperty(e, "__esModule", { value: !0 });
	var t = In(), n = Ln(), r = [], i = function() {
		function e(e) {
			this.$$observationTargets = [], this.$$activeTargets = [], this.$$skippedTargets = [];
			var t = s(e);
			if (t) throw TypeError(t);
			this.$$callback = e;
		}
		return e.prototype.observe = function(e) {
			var n = c("observe", e);
			if (n) throw TypeError(n);
			l(this.$$observationTargets, e) >= 0 || (this.$$observationTargets.push(new t.ResizeObservation(e)), a(this));
		}, e.prototype.unobserve = function(e) {
			var t = c("unobserve", e);
			if (t) throw TypeError(t);
			var n = l(this.$$observationTargets, e);
			n < 0 || (this.$$observationTargets.splice(n, 1), this.$$observationTargets.length === 0 && o(this));
		}, e.prototype.disconnect = function() {
			this.$$observationTargets = [], this.$$activeTargets = [], o(this);
		}, e;
	}();
	e.ResizeObserver = i;
	function a(e) {
		r.indexOf(e) < 0 && (r.push(e), v());
	}
	function o(e) {
		var t = r.indexOf(e);
		t >= 0 && (r.splice(t, 1), b());
	}
	function s(e) {
		if (e === void 0) return "Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.";
		if (typeof e != "function") return "Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.";
	}
	function c(e, t) {
		if (t === void 0) return "Failed to execute '" + e + "' on 'ResizeObserver': 1 argument required, but only 0 present.";
		if (!(t && t.nodeType === window.Node.ELEMENT_NODE)) return "Failed to execute '" + e + "' on 'ResizeObserver': parameter 1 is not of type 'Element'.";
	}
	function l(e, t) {
		for (var n = 0; n < e.length; n += 1) if (e[n].target === t) return n;
		return -1;
	}
	var u = function(e) {
		r.forEach(function(t) {
			t.$$activeTargets = [], t.$$skippedTargets = [], t.$$observationTargets.forEach(function(n) {
				n.isActive() && (h(n.target) > e ? t.$$activeTargets.push(n) : t.$$skippedTargets.push(n));
			});
		});
	}, d = function() {
		return r.some(function(e) {
			return !!e.$$activeTargets.length;
		});
	}, f = function() {
		return r.some(function(e) {
			return !!e.$$skippedTargets.length;
		});
	}, p = function() {
		var e = Infinity;
		return r.forEach(function(t) {
			if (t.$$activeTargets.length) {
				var r = [];
				t.$$activeTargets.forEach(function(t) {
					var i = new n.ResizeObserverEntry(t.target);
					r.push(i), t.$$broadcastWidth = i.contentRect.width, t.$$broadcastHeight = i.contentRect.height;
					var a = h(t.target);
					a < e && (e = a);
				}), t.$$callback(r, t), t.$$activeTargets = [];
			}
		}), e;
	}, m = function() {
		var e = new window.ErrorEvent("ResizeLoopError", { message: "ResizeObserver loop completed with undelivered notifications." });
		window.dispatchEvent(e);
	}, h = function(e) {
		for (var t = 0; e.parentNode;) e = e.parentNode, t += 1;
		return t;
	}, g = function() {
		var e = 0;
		for (u(e); d();) e = p(), u(e);
		f() && m();
	}, _, v = function() {
		_ || y();
	}, y = function() {
		_ = window.requestAnimationFrame(function() {
			g(), y();
		});
	}, b = function() {
		_ && !r.some(function(e) {
			return !!e.$$observationTargets.length;
		}) && (window.cancelAnimationFrame(_), _ = void 0);
	};
	e.install = function() {
		return window.ResizeObserver = i;
	};
})), L = /* @__PURE__ */ e(le(), 1), zn = "button, input, select, textarea, a, [contenteditable=\"true\"], [draggable=\"false\"]";
function Bn(e) {
	return !!(e != null && e.closest(zn));
}
//#endregion
//#region ../ui/src/components/Draggable/Draggable.tsx
var R = ue(), Vn = ({ children: e, className: t, style: n }) => {
	let [r, i] = (0, L.useState)({
		x: 0,
		y: 0
	}), [a, o] = (0, L.useState)(!1), [s, c] = (0, L.useState)({
		x: 0,
		y: 0
	}), l = (0, L.useRef)(null), u = (e) => {
		Bn(e.target) || (o(!0), c({
			x: e.clientX - r.x,
			y: e.clientY - r.y
		}), e.preventDefault());
	}, d = (e) => {
		if (!a) return;
		let t = e.clientX - s.x, n = e.clientY - s.y;
		i({
			x: t,
			y: n
		});
	}, f = () => {
		g();
	}, p = (e) => {
		if (Bn(e.target)) return;
		let t = e.touches[0];
		o(!0), c({
			x: t.clientX - r.x,
			y: t.clientY - r.y
		});
	}, m = (e) => {
		if (!a) return;
		let t = e.touches[0], n = t.clientX - s.x, r = t.clientY - s.y;
		i({
			x: n,
			y: r
		});
	}, h = () => {
		g();
	}, g = () => {
		if (!l.current) return;
		let e = l.current.getBoundingClientRect(), t = window.innerWidth, n = window.innerHeight, r = e.width / 4, a = e.height / 4, s = Math.max(0, 0 - e.left), c = Math.max(0, e.right - t), u = Math.max(0, 0 - e.top), d = Math.max(0, e.bottom - n);
		(s > r || c > r || u > a || d > a) && i({
			x: 0,
			y: 0
		}), o(!1);
	};
	return (0, L.useEffect)(() => {
		if (a) return document.addEventListener("mousemove", d), document.addEventListener("mouseup", f), document.addEventListener("touchmove", m, { passive: !1 }), document.addEventListener("touchend", h), () => {
			document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", f), document.removeEventListener("touchmove", m), document.removeEventListener("touchend", h);
		};
	}, [a, s]), /* @__PURE__ */ (0, R.jsx)("div", {
		ref: l,
		className: t,
		style: {
			...n,
			transform: `translate(${r.x}px, ${r.y}px)`,
			cursor: a ? "grabbing" : "grab"
		},
		onMouseDown: u,
		onTouchStart: p,
		children: e
	});
};
//#endregion
//#region ../geometry/src/lib/angles.ts
function Hn(e) {
	return e * Math.PI / 180;
}
function Un(e) {
	return e * 180 / Math.PI;
}
function Wn(e, t) {
	return {
		x: Math.cos(t) * e,
		y: Math.sin(t) * e
	};
}
function Gn(e) {
	let t = 2 * Math.PI, n = e % t;
	return n <= -Math.PI ? n += t : n > Math.PI && (n -= t), n;
}
function Kn(e, t) {
	return Gn(e - t);
}
//#endregion
//#region ../geometry/src/lib/point.ts
var qn = .1, Jn = class e {
	constructor(e = 0, t = 0, n = 0) {
		this.isPoint = !0, this.x = void 0, this.y = void 0, this.z = void 0, this.x = e, this.y = t, this.z = n;
	}
	get width() {
		return this.x;
	}
	get height() {
		return this.y;
	}
	set(e, t, n = this.z) {
		return this.x = e, this.y = t, this.z = n, this;
	}
	copy(e) {
		var t;
		return this.set(e.x, e.y, (t = e.z) == null ? 0 : t);
	}
	clone(t) {
		return (t == null ? new e() : t).set(this.x, this.y, this.z);
	}
	equals(e) {
		var t;
		return this.x === e.x && this.y === e.y && this.z === ((t = e.z) == null ? 0 : t);
	}
	distanceTo(e) {
		return Yn(this, e);
	}
	lerp(e, t, n) {
		return Xn(this, e, t, n);
	}
	rotate(e, t, n) {
		return $n(this, e, t, n);
	}
	shift(e, t, n) {
		return er(this, e, t, n);
	}
	angleBetween(e, t) {
		return tr(this, e, t);
	}
	add(e, t) {
		return Zn(this, e, t);
	}
	multiply(e, t) {
		return Qn(this, e, t);
	}
};
function Yn(e, t) {
	let n = e.x - t.x, r = e.y - t.y;
	return Math.sqrt(n * n + r * r);
}
function Xn(e, t, n, r) {
	var i, a;
	let o = (i = e.z) == null ? 0 : i, s = (a = t.z) == null ? 0 : a;
	return (r == null ? new Jn() : r).set(e.x + (t.x - e.x) * n, e.y + (t.y - e.y) * n, o + (s - o) * n);
}
function Zn(e, t, n) {
	var r, i;
	let a = typeof t == "number", o = a ? t : t.x, s = a ? t : t.y, c = a || (r = t.z) == null ? 0 : r;
	return (n == null ? new Jn() : n).set(e.x + o, e.y + s, ((i = e.z) == null ? 0 : i) + c);
}
function Qn(e, t, n) {
	var r, i;
	let a = typeof t == "number", o = a ? t : t.x, s = a ? t : t.y, c = a || (r = t.z) == null ? 1 : r;
	return (n == null ? new Jn() : n).set(e.x * o, e.y * s, ((i = e.z) == null ? 0 : i) * c);
}
function $n(e, t, n, r) {
	var i;
	let a = Math.cos(t), o = Math.sin(t), s = e.x - n.x, c = e.y - n.y;
	return (r == null ? new Jn() : r).set(n.x + s * a - c * o, n.y + s * o + c * a, (i = e.z) == null ? 0 : i);
}
function er(e, t, n, r) {
	return Zn(e, Wn(t, n), r);
}
function tr(e, t, n) {
	let r = Math.atan2(t.y - e.y, t.x - e.x);
	return Math.atan2(n.y - e.y, n.x - e.x) - r;
}
//#endregion
//#region ../geometry/src/lib/mesh.ts
var nr = class e {
	constructor(e = [], t = []) {
		this.isMesh = !0, this._vertices = [], this._indices = [], this._bounds = new Er(), this._planar = !0, this.set(e, t);
	}
	get vertices() {
		return this._vertices;
	}
	get indices() {
		return this._indices;
	}
	get bounds() {
		return this._bounds;
	}
	get isPlanar() {
		return this._planar;
	}
	set(e, t) {
		return this._vertices = e.map((e) => {
			var t;
			return new Jn(e.x, e.y, (t = e.z) == null ? 0 : t);
		}), this._indices = t, this._planar = ir(this._vertices), this._bounds = rr(this), this;
	}
	static merge(...e) {
		return ar(e);
	}
	translate(t, n) {
		return or(this, t, n == null ? new e() : n);
	}
	scale(t, n = this._bounds.center, r) {
		return sr(this, t, n, r == null ? new e() : r);
	}
	rotate(t, n = this._bounds.center, r) {
		return cr(this, t, n, r == null ? new e() : r);
	}
};
function rr(e) {
	if (e.vertices.length === 0) return new Er();
	let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity;
	for (let a of e.vertices) t = Math.min(t, a.x), n = Math.min(n, a.y), r = Math.max(r, a.x), i = Math.max(i, a.y);
	return Er.fromMinMax({
		x: t,
		y: n
	}, {
		x: r,
		y: i
	});
}
function ir(e) {
	if (e.length === 0) return !0;
	let t = e[0].z;
	for (let n = 1; n < e.length; n++) if (Math.abs(e[n].z - t) > .1) return !1;
	return !0;
}
function ar(e, t) {
	let n = [], r = [], i = 0;
	for (let t of e) {
		for (let e of t.vertices) n.push(e);
		for (let [e, n, a] of t.indices) r.push([
			e + i,
			n + i,
			a + i
		]);
		i += t.vertices.length;
	}
	return (t == null ? new nr() : t).set(n, r);
}
function or(e, t, n) {
	var r;
	let i = (r = t.z) == null ? 0 : r, a = e.vertices.map((e) => {
		var n;
		return {
			x: e.x + t.x,
			y: e.y + t.y,
			z: ((n = e.z) == null ? 0 : n) + i
		};
	});
	return (n == null ? new nr() : n).set(a, e.indices);
}
function sr(e, t, n = rr(e).center, r) {
	let i = typeof t == "number" ? t : t.x, a = typeof t == "number" ? t : t.y, o = e.vertices.map((e) => {
		var t;
		return {
			x: n.x + (e.x - n.x) * i,
			y: n.y + (e.y - n.y) * a,
			z: (t = e.z) == null ? 0 : t
		};
	});
	return (r == null ? new nr() : r).set(o, e.indices);
}
function cr(e, t, n = rr(e).center, r) {
	let i = Math.cos(t), a = Math.sin(t), o = e.vertices.map((e) => {
		var t;
		let r = e.x - n.x, o = e.y - n.y;
		return {
			x: n.x + r * i - o * a,
			y: n.y + r * a + o * i,
			z: (t = e.z) == null ? 0 : t
		};
	});
	return (r == null ? new nr() : r).set(o, e.indices);
}
//#endregion
//#region ../geometry/src/lib/polygon.ts
var lr = class e {
	constructor(e = [], t = [], n = 0) {
		this.isPolygon = !0, this._vertices = [], this._indices = [], this._elevation = void 0, this._bounds = new Er(), this._elevation = n, this.set(e, t);
	}
	static fromConvexRing(t, n = 0) {
		if (t.length < 3) return new e([], [], n);
		let r = [];
		for (let e = 1; e <= t.length - 2; e++) r.push([
			0,
			e,
			e + 1
		]);
		return new e(t, r, n);
	}
	static merge(...t) {
		var n, r;
		return ar(t, new e([], [], (n = (r = t[0]) == null ? void 0 : r.elevation) == null ? 0 : n));
	}
	get vertices() {
		return this._vertices;
	}
	get indices() {
		return this._indices;
	}
	get elevation() {
		return this._elevation;
	}
	get bounds() {
		return this._bounds;
	}
	get area() {
		return ur(this);
	}
	containsPoint(e, t) {
		return dr(this, e, t);
	}
	translate(t, n) {
		return or(this, t, n == null ? new e([], [], this._elevation) : n);
	}
	scale(t, n = this._bounds.center, r) {
		return sr(this, t, n, r == null ? new e([], [], this._elevation) : r);
	}
	rotate(t, n = this._bounds.center, r) {
		return cr(this, t, n, r == null ? new e([], [], this._elevation) : r);
	}
	set(e, t, n = this._elevation) {
		return this._vertices = e.map((e) => ({
			x: e.x,
			y: e.y
		})), this._indices = t, this._elevation = n, this._bounds = rr(this), this;
	}
};
function ur(e) {
	let t = 0;
	for (let [n, r, i] of e.indices) {
		let a = e.vertices[n], o = e.vertices[r], s = e.vertices[i];
		t += Math.abs((o.x - a.x) * (s.y - a.y) - (s.x - a.x) * (o.y - a.y)) / 2;
	}
	return t;
}
function dr(e, t, n) {
	var r;
	let i = (r = n == null ? void 0 : n.areaTolerance) == null ? .01 : r;
	for (let [n, r, a] of e.indices) {
		let o = e.vertices[n], s = e.vertices[r], c = e.vertices[a], l = Math.abs((s.x - o.x) * (c.y - o.y) - (c.x - o.x) * (s.y - o.y)) / 2;
		if (l === 0) continue;
		let u = i * l, d = (t.x - s.x) * (o.y - s.y) - (o.x - s.x) * (t.y - s.y), f = (t.x - c.x) * (s.y - c.y) - (s.x - c.x) * (t.y - c.y), p = (t.x - o.x) * (c.y - o.y) - (c.x - o.x) * (t.y - o.y);
		if (!((d < -u || f < -u || p < -u) && (d > u || f > u || p > u))) return !0;
	}
	return !1;
}
//#endregion
//#region ../geometry/src/lib/rect.ts
var fr = (e) => {
	var t;
	return (t = e.rotation) == null ? 0 : t;
}, pr = (e) => {
	var t;
	return (t = e.elevation) == null ? 0 : t;
}, mr = class e {
	constructor(e, t, n = 0, r = 0) {
		this.isRect = !0, this._center = new Jn(), this._size = new Jn(), this._rotation = 0, this._elevation = 0, this.set(e.x, e.y, t.x, t.y, n, r);
	}
	static fromMinMax(t, n, r = 0, i = 0) {
		return new e({
			x: (t.x + n.x) / 2,
			y: (t.y + n.y) / 2
		}, {
			x: Math.abs(n.x - t.x),
			y: Math.abs(n.y - t.y)
		}, r, i);
	}
	get center() {
		return this._center;
	}
	get size() {
		return this._size;
	}
	get rotation() {
		return this._rotation;
	}
	get elevation() {
		return this._elevation;
	}
	corners() {
		return hr(this);
	}
	get bounds() {
		return gr(this);
	}
	toPolygon() {
		return _r(this);
	}
	containsPoint(e) {
		return vr(this, e);
	}
	translate(e, t) {
		return yr(this, e, t);
	}
	rotate(e, t) {
		return br(this, e, t);
	}
	scale(e, t = this._center, n) {
		return xr(this, e, t, n);
	}
	intersectLine(e) {
		return wr(e, this);
	}
	clone(t) {
		return (t == null ? new e(this._center, this._size) : t).set(this._center.x, this._center.y, this._size.x, this._size.y, this._rotation, this._elevation);
	}
	set(e, t, n, r, i, a) {
		return this._center.set(e, t), this._size.set(n, r), this._rotation = i, this._elevation = a, this;
	}
};
function hr(e) {
	let t = e.size.x / 2, n = e.size.y / 2, r = fr(e), i = Math.cos(r), a = Math.sin(r), o = e.center.x, s = e.center.y, c = (e, t) => new Jn(o + e * i - t * a, s + e * a + t * i);
	return [
		c(-t, -n),
		c(t, -n),
		c(t, n),
		c(-t, n)
	];
}
function gr(e) {
	return Er.fromUnion(...hr(e).map((e) => Er.fromMinMax(e, e)));
}
function _r(e) {
	return lr.fromConvexRing(hr(e), pr(e));
}
function vr(e, t) {
	let n = -fr(e), r = Math.cos(n), i = Math.sin(n), a = t.x - e.center.x, o = t.y - e.center.y, s = a * r - o * i, c = a * i + o * r;
	return Math.abs(s) <= e.size.x / 2 && Math.abs(c) <= e.size.y / 2;
}
function yr(e, t, n) {
	let r = e.center.x + t.x, i = e.center.y + t.y;
	return n ? n.set(r, i, e.size.x, e.size.y, fr(e), pr(e)) : new mr({
		x: r,
		y: i
	}, e.size, fr(e), pr(e));
}
function br(e, t, n) {
	return n ? n.set(e.center.x, e.center.y, e.size.x, e.size.y, fr(e) + t, pr(e)) : new mr(e.center, e.size, fr(e) + t, pr(e));
}
function xr(e, t, n = e.center, r) {
	let i = typeof t == "number" ? t : t.x, a = typeof t == "number" ? t : t.y, o = n.x + (e.center.x - n.x) * i, s = n.y + (e.center.y - n.y) * a, c = e.size.x * i, l = e.size.y * a;
	return r ? r.set(o, s, c, l, fr(e), pr(e)) : new mr({
		x: o,
		y: s
	}, {
		x: c,
		y: l
	}, fr(e), pr(e));
}
//#endregion
//#region ../geometry/src/lib/intersections.ts
function Sr(e, t, n = qn) {
	var r, i;
	if (e.elevation != null && t.elevation != null && Math.abs(e.elevation - t.elevation) > n) return null;
	let { x: a, y: o } = e.p0, { x: s, y: c } = e.p1, { x: l, y: u } = t.p0, { x: d, y: f } = t.p1, p = (a - s) * (u - f) - (o - c) * (l - d);
	if (p === 0) return null;
	let m = ((a - l) * (u - f) - (o - u) * (l - d)) / p, h = ((a - l) * (o - c) - (o - u) * (a - s)) / p, g = Xn(e.p0, e.p1, m);
	return g.z = (r = (i = e.elevation) == null ? t.elevation : i) == null ? 0 : r, {
		point: g,
		onLine1: m >= 0 && m <= 1,
		onLine2: h >= 0 && h <= 1
	};
}
function Cr(e, t, n) {
	let r = Sr(e, t, n);
	return r != null && r.onLine1 && r.onLine2 ? r.point : null;
}
function wr(e, t, n = qn) {
	var r, i;
	if (e.elevation != null && t.elevation != null && Math.abs(e.elevation - t.elevation) > n) return [];
	let a = (r = (i = e.elevation) == null ? t.elevation : i) == null ? 0 : r, o = hr(t), s = [];
	for (let t = 0; t < 4; t++) {
		let r = Cr(e, {
			p0: o[t],
			p1: o[(t + 1) % 4]
		}, n);
		r && (r.z = a, s.push(r));
	}
	return s;
}
//#endregion
//#region ../geometry/src/lib/box.ts
function* Tr(e) {
	for (let t of e) yield t.min, yield t.max;
}
var Er = class e {
	constructor(e = 0, t = 0, n = 0, r = 0) {
		this.isBox = !0, this._min = new Jn(), this._max = new Jn(), this._center = new Jn(), this._size = new Jn(), this.set(e, t, e + n, t + r);
	}
	get min() {
		return this._min;
	}
	get max() {
		return this._max;
	}
	get center() {
		return this._center;
	}
	get size() {
		return this._size;
	}
	get area() {
		return Dr(this);
	}
	isEmpty() {
		return Or(this);
	}
	static fromMinMax(t, n) {
		return new e(t.x, t.y, n.x - t.x, n.y - t.y);
	}
	static fromCenter(t, n) {
		return new e(t.x - n.x / 2, t.y - n.y / 2, n.x, n.y);
	}
	static fromUnion(...t) {
		return e.fromPoints(Tr(t));
	}
	static fromPoints(t) {
		let n = Infinity, r = Infinity, i = -Infinity, a = -Infinity;
		for (let e of t) e.x < n && (n = e.x), e.y < r && (r = e.y), e.x > i && (i = e.x), e.y > a && (a = e.y);
		return n === Infinity ? new e() : e.fromMinMax({
			x: n,
			y: r
		}, {
			x: i,
			y: a
		});
	}
	static fromSvg(t) {
		return new e(t.x.baseVal.value, t.y.baseVal.value, t.width.baseVal.value, t.height.baseVal.value);
	}
	intersects(e) {
		return kr(this, e);
	}
	contains(e) {
		return Ar(this, e);
	}
	containsPoint(e) {
		return jr(this, e);
	}
	equals(e) {
		return Mr(this, e);
	}
	intersection(e, t) {
		return Nr(this, e, t);
	}
	translate(e, t) {
		return Pr(this, e, t);
	}
	expand(e, t) {
		return Fr(this, e, t);
	}
	scale(e, t = this._center, n) {
		return Ir(this, e, t, n);
	}
	intersectLine(e) {
		return wr(e, this);
	}
	clone(t) {
		return (t == null ? new e() : t).set(this._min.x, this._min.y, this._max.x, this._max.y);
	}
	set(e, t, n, r) {
		let i = Math.min(e, n), a = Math.min(t, r), o = Math.max(e, n), s = Math.max(t, r);
		return this._min.set(i, a), this._max.set(o, s), this._center.set((i + o) / 2, (a + s) / 2), this._size.set(o - i, s - a), this;
	}
};
function Dr(e) {
	return (e.max.x - e.min.x) * (e.max.y - e.min.y);
}
function Or(e) {
	return e.min.x === e.max.x && e.min.y === e.max.y;
}
function kr(e, t) {
	return e.min.x <= t.max.x && e.max.x >= t.min.x && e.min.y <= t.max.y && e.max.y >= t.min.y;
}
function Ar(e, t) {
	return t.min.x >= e.min.x && t.max.x <= e.max.x && t.min.y >= e.min.y && t.max.y <= e.max.y;
}
function jr(e, t) {
	return t.x >= e.min.x && t.x <= e.max.x && t.y >= e.min.y && t.y <= e.max.y;
}
function Mr(e, t) {
	return e.min.x === t.min.x && e.min.y === t.min.y && e.max.x === t.max.x && e.max.y === t.max.y;
}
function Nr(e, t, n) {
	let r = Math.max(e.min.x, t.min.x), i = Math.max(e.min.y, t.min.y), a = Math.min(e.max.x, t.max.x), o = Math.min(e.max.y, t.max.y);
	return a < r || o < i ? null : (n == null ? new Er() : n).set(r, i, a, o);
}
function Pr(e, t, n) {
	let r = typeof t == "number" ? t : t.x, i = typeof t == "number" ? t : t.y;
	return (n == null ? new Er() : n).set(e.min.x + r, e.min.y + i, e.max.x + r, e.max.y + i);
}
function Fr(e, t, n) {
	let r = typeof t == "number", i = r ? t : t.x, a = r ? t : t.y, o = e.min.x - i, s = e.max.x + i, c = e.min.y - a, l = e.max.y + a;
	return s < o && (o = s = (o + s) / 2), l < c && (c = l = (c + l) / 2), (n == null ? new Er() : n).set(o, c, s, l);
}
function Ir(e, t, n = {
	x: (e.min.x + e.max.x) / 2,
	y: (e.min.y + e.max.y) / 2
}, r) {
	let i = typeof t == "number" ? t : t.x, a = typeof t == "number" ? t : t.y;
	return (r == null ? new Er() : r).set(n.x + (e.min.x - n.x) * i, n.y + (e.min.y - n.y) * a, n.x + (e.max.x - n.x) * i, n.y + (e.max.y - n.y) * a);
}
//#endregion
//#region ../geometry/src/lib/geo.ts
var Lr = 6371e3;
function Rr(e, t) {
	let n = Hn(e.lat), r = Hn(t.lat), i = Hn(t.lat - e.lat), a = Hn(t.lng - e.lng), o = Math.sin(i / 2) * Math.sin(i / 2) + Math.cos(n) * Math.cos(r) * Math.sin(a / 2) * Math.sin(a / 2);
	return Lr * (2 * Math.atan2(Math.sqrt(o), Math.sqrt(1 - o)));
}
function zr(e, t) {
	let n = Hn(e.lat), r = Hn(t.lat), i = Hn(t.lng - e.lng), a = Math.sin(i) * Math.cos(r), o = Math.cos(n) * Math.sin(r) - Math.sin(n) * Math.cos(r) * Math.cos(i);
	return (Un(Math.atan2(a, o)) + 360) % 360;
}
function Br(e, t, n) {
	let r = t / Lr, i = Hn(n), a = Hn(e.lat), o = Hn(e.lng), s = Math.asin(Math.sin(a) * Math.cos(r) + Math.cos(a) * Math.sin(r) * Math.cos(i)), c = o + Math.atan2(Math.sin(i) * Math.sin(r) * Math.cos(a), Math.cos(r) - Math.sin(a) * Math.sin(s));
	return {
		lat: Un(s),
		lng: Un(Gn(c))
	};
}
function Vr(e, t, n) {
	let r = n.local.x - t.local.x, i = n.local.y - t.local.y, a = Math.sqrt(r * r + i * i), o = e.x - t.local.x, s = e.y - t.local.y, c = Math.sqrt(o * o + s * s), l = Un(Math.atan2(i, r)), u = Un(Math.atan2(s, o)) - l, d = (a === 0 ? 0 : c / a) * Rr(t.geo, n.geo), f = zr(t.geo, n.geo);
	return Br(t.geo, d, f + u);
}
function Hr(e, t, n) {
	let r = Rr(t.geo, n.geo), i = zr(t.geo, n.geo), a = Rr(t.geo, e), o = zr(t.geo, e) - i, s = r === 0 ? 0 : a / r, c = n.local.x - t.local.x, l = n.local.y - t.local.y, u = Math.sqrt(c * c + l * l), d = Math.atan2(l, c), f = Wn(u * s, d + Hn(o));
	return {
		x: t.local.x + f.x,
		y: t.local.y + f.y
	};
}
//#endregion
//#region ../geometry/src/lib/line.ts
function Ur(e) {
	return Yn(e.p0, e.p1);
}
function Wr(e, t) {
	return Xn(e.p0, e.p1, .5, t);
}
function Gr(e, t) {
	return Math.atan2(t.y - e.y, t.x - e.x);
}
function Kr(e, t, n) {
	var r;
	let i = e.p0.x, a = e.p0.y, o = e.p1.x, s = e.p1.y, c = t.x, l = t.y, u = o - i, d = s - a, f = u * u + d * d, p;
	f === 0 ? p = 0 : (p = ((c - i) * u + (l - a) * d) / f, p = p < 0 ? 0 : p > 1 ? 1 : p);
	let m = (n == null ? new Jn() : n).set(i + u * p, a + d * p, (r = e.elevation) == null ? 0 : r), h = Yn({
		x: c,
		y: l
	}, m);
	return {
		projected: m,
		t: p,
		distance: h
	};
}
//#endregion
//#region ../geometry/src/index.ts
function qr(e) {
	return "isBox" in e;
}
function Jr(e) {
	return "isRect" in e;
}
function Yr(e) {
	return "isPolygon" in e;
}
function Xr(e) {
	return "isMesh" in e;
}
//#endregion
//#region ../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js
var Zr = /* @__PURE__ */ t(((e, t) => {
	t.exports = {
		aliceblue: [
			240,
			248,
			255
		],
		antiquewhite: [
			250,
			235,
			215
		],
		aqua: [
			0,
			255,
			255
		],
		aquamarine: [
			127,
			255,
			212
		],
		azure: [
			240,
			255,
			255
		],
		beige: [
			245,
			245,
			220
		],
		bisque: [
			255,
			228,
			196
		],
		black: [
			0,
			0,
			0
		],
		blanchedalmond: [
			255,
			235,
			205
		],
		blue: [
			0,
			0,
			255
		],
		blueviolet: [
			138,
			43,
			226
		],
		brown: [
			165,
			42,
			42
		],
		burlywood: [
			222,
			184,
			135
		],
		cadetblue: [
			95,
			158,
			160
		],
		chartreuse: [
			127,
			255,
			0
		],
		chocolate: [
			210,
			105,
			30
		],
		coral: [
			255,
			127,
			80
		],
		cornflowerblue: [
			100,
			149,
			237
		],
		cornsilk: [
			255,
			248,
			220
		],
		crimson: [
			220,
			20,
			60
		],
		cyan: [
			0,
			255,
			255
		],
		darkblue: [
			0,
			0,
			139
		],
		darkcyan: [
			0,
			139,
			139
		],
		darkgoldenrod: [
			184,
			134,
			11
		],
		darkgray: [
			169,
			169,
			169
		],
		darkgreen: [
			0,
			100,
			0
		],
		darkgrey: [
			169,
			169,
			169
		],
		darkkhaki: [
			189,
			183,
			107
		],
		darkmagenta: [
			139,
			0,
			139
		],
		darkolivegreen: [
			85,
			107,
			47
		],
		darkorange: [
			255,
			140,
			0
		],
		darkorchid: [
			153,
			50,
			204
		],
		darkred: [
			139,
			0,
			0
		],
		darksalmon: [
			233,
			150,
			122
		],
		darkseagreen: [
			143,
			188,
			143
		],
		darkslateblue: [
			72,
			61,
			139
		],
		darkslategray: [
			47,
			79,
			79
		],
		darkslategrey: [
			47,
			79,
			79
		],
		darkturquoise: [
			0,
			206,
			209
		],
		darkviolet: [
			148,
			0,
			211
		],
		deeppink: [
			255,
			20,
			147
		],
		deepskyblue: [
			0,
			191,
			255
		],
		dimgray: [
			105,
			105,
			105
		],
		dimgrey: [
			105,
			105,
			105
		],
		dodgerblue: [
			30,
			144,
			255
		],
		firebrick: [
			178,
			34,
			34
		],
		floralwhite: [
			255,
			250,
			240
		],
		forestgreen: [
			34,
			139,
			34
		],
		fuchsia: [
			255,
			0,
			255
		],
		gainsboro: [
			220,
			220,
			220
		],
		ghostwhite: [
			248,
			248,
			255
		],
		gold: [
			255,
			215,
			0
		],
		goldenrod: [
			218,
			165,
			32
		],
		gray: [
			128,
			128,
			128
		],
		green: [
			0,
			128,
			0
		],
		greenyellow: [
			173,
			255,
			47
		],
		grey: [
			128,
			128,
			128
		],
		honeydew: [
			240,
			255,
			240
		],
		hotpink: [
			255,
			105,
			180
		],
		indianred: [
			205,
			92,
			92
		],
		indigo: [
			75,
			0,
			130
		],
		ivory: [
			255,
			255,
			240
		],
		khaki: [
			240,
			230,
			140
		],
		lavender: [
			230,
			230,
			250
		],
		lavenderblush: [
			255,
			240,
			245
		],
		lawngreen: [
			124,
			252,
			0
		],
		lemonchiffon: [
			255,
			250,
			205
		],
		lightblue: [
			173,
			216,
			230
		],
		lightcoral: [
			240,
			128,
			128
		],
		lightcyan: [
			224,
			255,
			255
		],
		lightgoldenrodyellow: [
			250,
			250,
			210
		],
		lightgray: [
			211,
			211,
			211
		],
		lightgreen: [
			144,
			238,
			144
		],
		lightgrey: [
			211,
			211,
			211
		],
		lightpink: [
			255,
			182,
			193
		],
		lightsalmon: [
			255,
			160,
			122
		],
		lightseagreen: [
			32,
			178,
			170
		],
		lightskyblue: [
			135,
			206,
			250
		],
		lightslategray: [
			119,
			136,
			153
		],
		lightslategrey: [
			119,
			136,
			153
		],
		lightsteelblue: [
			176,
			196,
			222
		],
		lightyellow: [
			255,
			255,
			224
		],
		lime: [
			0,
			255,
			0
		],
		limegreen: [
			50,
			205,
			50
		],
		linen: [
			250,
			240,
			230
		],
		magenta: [
			255,
			0,
			255
		],
		maroon: [
			128,
			0,
			0
		],
		mediumaquamarine: [
			102,
			205,
			170
		],
		mediumblue: [
			0,
			0,
			205
		],
		mediumorchid: [
			186,
			85,
			211
		],
		mediumpurple: [
			147,
			112,
			219
		],
		mediumseagreen: [
			60,
			179,
			113
		],
		mediumslateblue: [
			123,
			104,
			238
		],
		mediumspringgreen: [
			0,
			250,
			154
		],
		mediumturquoise: [
			72,
			209,
			204
		],
		mediumvioletred: [
			199,
			21,
			133
		],
		midnightblue: [
			25,
			25,
			112
		],
		mintcream: [
			245,
			255,
			250
		],
		mistyrose: [
			255,
			228,
			225
		],
		moccasin: [
			255,
			228,
			181
		],
		navajowhite: [
			255,
			222,
			173
		],
		navy: [
			0,
			0,
			128
		],
		oldlace: [
			253,
			245,
			230
		],
		olive: [
			128,
			128,
			0
		],
		olivedrab: [
			107,
			142,
			35
		],
		orange: [
			255,
			165,
			0
		],
		orangered: [
			255,
			69,
			0
		],
		orchid: [
			218,
			112,
			214
		],
		palegoldenrod: [
			238,
			232,
			170
		],
		palegreen: [
			152,
			251,
			152
		],
		paleturquoise: [
			175,
			238,
			238
		],
		palevioletred: [
			219,
			112,
			147
		],
		papayawhip: [
			255,
			239,
			213
		],
		peachpuff: [
			255,
			218,
			185
		],
		peru: [
			205,
			133,
			63
		],
		pink: [
			255,
			192,
			203
		],
		plum: [
			221,
			160,
			221
		],
		powderblue: [
			176,
			224,
			230
		],
		purple: [
			128,
			0,
			128
		],
		rebeccapurple: [
			102,
			51,
			153
		],
		red: [
			255,
			0,
			0
		],
		rosybrown: [
			188,
			143,
			143
		],
		royalblue: [
			65,
			105,
			225
		],
		saddlebrown: [
			139,
			69,
			19
		],
		salmon: [
			250,
			128,
			114
		],
		sandybrown: [
			244,
			164,
			96
		],
		seagreen: [
			46,
			139,
			87
		],
		seashell: [
			255,
			245,
			238
		],
		sienna: [
			160,
			82,
			45
		],
		silver: [
			192,
			192,
			192
		],
		skyblue: [
			135,
			206,
			235
		],
		slateblue: [
			106,
			90,
			205
		],
		slategray: [
			112,
			128,
			144
		],
		slategrey: [
			112,
			128,
			144
		],
		snow: [
			255,
			250,
			250
		],
		springgreen: [
			0,
			255,
			127
		],
		steelblue: [
			70,
			130,
			180
		],
		tan: [
			210,
			180,
			140
		],
		teal: [
			0,
			128,
			128
		],
		thistle: [
			216,
			191,
			216
		],
		tomato: [
			255,
			99,
			71
		],
		turquoise: [
			64,
			224,
			208
		],
		violet: [
			238,
			130,
			238
		],
		wheat: [
			245,
			222,
			179
		],
		white: [
			255,
			255,
			255
		],
		whitesmoke: [
			245,
			245,
			245
		],
		yellow: [
			255,
			255,
			0
		],
		yellowgreen: [
			154,
			205,
			50
		]
	};
})), Qr = /* @__PURE__ */ t(((e, t) => {
	t.exports = function(e) {
		return !e || typeof e == "string" ? !1 : e instanceof Array || Array.isArray(e) || e.length >= 0 && (e.splice instanceof Function || Object.getOwnPropertyDescriptor(e, e.length - 1) && e.constructor.name !== "String");
	};
})), $r = /* @__PURE__ */ t(((e, t) => {
	var n = Qr(), r = Array.prototype.concat, i = Array.prototype.slice, a = t.exports = function(e) {
		for (var t = [], a = 0, o = e.length; a < o; a++) {
			var s = e[a];
			n(s) ? t = r.call(t, i.call(s)) : t.push(s);
		}
		return t;
	};
	a.wrap = function(e) {
		return function() {
			return e(a(arguments));
		};
	};
})), ei = /* @__PURE__ */ t(((e, t) => {
	var n = Zr(), r = $r(), i = Object.hasOwnProperty, a = Object.create(null);
	for (var o in n) i.call(n, o) && (a[n[o]] = o);
	var s = t.exports = {
		to: {},
		get: {}
	};
	s.get = function(e) {
		var t = e.substring(0, 3).toLowerCase(), n, r;
		switch (t) {
			case "hsl":
				n = s.get.hsl(e), r = "hsl";
				break;
			case "hwb":
				n = s.get.hwb(e), r = "hwb";
				break;
			default:
				n = s.get.rgb(e), r = "rgb";
				break;
		}
		return n ? {
			model: r,
			value: n
		} : null;
	}, s.get.rgb = function(e) {
		if (!e) return null;
		var t = /^#([a-f0-9]{3,4})$/i, r = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i, a = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, o = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, s = /^(\w+)$/, l = [
			0,
			0,
			0,
			1
		], u, d, f;
		if (u = e.match(r)) {
			for (f = u[2], u = u[1], d = 0; d < 3; d++) {
				var p = d * 2;
				l[d] = parseInt(u.slice(p, p + 2), 16);
			}
			f && (l[3] = parseInt(f, 16) / 255);
		} else if (u = e.match(t)) {
			for (u = u[1], f = u[3], d = 0; d < 3; d++) l[d] = parseInt(u[d] + u[d], 16);
			f && (l[3] = parseInt(f + f, 16) / 255);
		} else if (u = e.match(a)) {
			for (d = 0; d < 3; d++) l[d] = parseInt(u[d + 1], 0);
			u[4] && (u[5] ? l[3] = parseFloat(u[4]) * .01 : l[3] = parseFloat(u[4]));
		} else if (u = e.match(o)) {
			for (d = 0; d < 3; d++) l[d] = Math.round(parseFloat(u[d + 1]) * 2.55);
			u[4] && (u[5] ? l[3] = parseFloat(u[4]) * .01 : l[3] = parseFloat(u[4]));
		} else if (u = e.match(s)) return u[1] === "transparent" ? [
			0,
			0,
			0,
			0
		] : i.call(n, u[1]) ? (l = n[u[1]], l[3] = 1, l) : null;
		else return null;
		for (d = 0; d < 3; d++) l[d] = c(l[d], 0, 255);
		return l[3] = c(l[3], 0, 1), l;
	}, s.get.hsl = function(e) {
		if (!e) return null;
		var t = e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);
		if (t) {
			var n = parseFloat(t[4]);
			return [
				(parseFloat(t[1]) % 360 + 360) % 360,
				c(parseFloat(t[2]), 0, 100),
				c(parseFloat(t[3]), 0, 100),
				c(isNaN(n) ? 1 : n, 0, 1)
			];
		}
		return null;
	}, s.get.hwb = function(e) {
		if (!e) return null;
		var t = e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);
		if (t) {
			var n = parseFloat(t[4]);
			return [
				(parseFloat(t[1]) % 360 + 360) % 360,
				c(parseFloat(t[2]), 0, 100),
				c(parseFloat(t[3]), 0, 100),
				c(isNaN(n) ? 1 : n, 0, 1)
			];
		}
		return null;
	}, s.to.hex = function() {
		var e = r(arguments);
		return "#" + l(e[0]) + l(e[1]) + l(e[2]) + (e[3] < 1 ? l(Math.round(e[3] * 255)) : "");
	}, s.to.rgb = function() {
		var e = r(arguments);
		return e.length < 4 || e[3] === 1 ? "rgb(" + Math.round(e[0]) + ", " + Math.round(e[1]) + ", " + Math.round(e[2]) + ")" : "rgba(" + Math.round(e[0]) + ", " + Math.round(e[1]) + ", " + Math.round(e[2]) + ", " + e[3] + ")";
	}, s.to.rgb.percent = function() {
		var e = r(arguments), t = Math.round(e[0] / 255 * 100), n = Math.round(e[1] / 255 * 100), i = Math.round(e[2] / 255 * 100);
		return e.length < 4 || e[3] === 1 ? "rgb(" + t + "%, " + n + "%, " + i + "%)" : "rgba(" + t + "%, " + n + "%, " + i + "%, " + e[3] + ")";
	}, s.to.hsl = function() {
		var e = r(arguments);
		return e.length < 4 || e[3] === 1 ? "hsl(" + e[0] + ", " + e[1] + "%, " + e[2] + "%)" : "hsla(" + e[0] + ", " + e[1] + "%, " + e[2] + "%, " + e[3] + ")";
	}, s.to.hwb = function() {
		var e = r(arguments), t = "";
		return e.length >= 4 && e[3] !== 1 && (t = ", " + e[3]), "hwb(" + e[0] + ", " + e[1] + "%, " + e[2] + "%" + t + ")";
	}, s.to.keyword = function(e) {
		return a[e.slice(0, 3)];
	};
	function c(e, t, n) {
		return Math.min(Math.max(t, e), n);
	}
	function l(e) {
		var t = Math.round(e).toString(16).toUpperCase();
		return t.length < 2 ? "0" + t : t;
	}
})), ti = /* @__PURE__ */ t(((e, t) => {
	t.exports = {
		aliceblue: [
			240,
			248,
			255
		],
		antiquewhite: [
			250,
			235,
			215
		],
		aqua: [
			0,
			255,
			255
		],
		aquamarine: [
			127,
			255,
			212
		],
		azure: [
			240,
			255,
			255
		],
		beige: [
			245,
			245,
			220
		],
		bisque: [
			255,
			228,
			196
		],
		black: [
			0,
			0,
			0
		],
		blanchedalmond: [
			255,
			235,
			205
		],
		blue: [
			0,
			0,
			255
		],
		blueviolet: [
			138,
			43,
			226
		],
		brown: [
			165,
			42,
			42
		],
		burlywood: [
			222,
			184,
			135
		],
		cadetblue: [
			95,
			158,
			160
		],
		chartreuse: [
			127,
			255,
			0
		],
		chocolate: [
			210,
			105,
			30
		],
		coral: [
			255,
			127,
			80
		],
		cornflowerblue: [
			100,
			149,
			237
		],
		cornsilk: [
			255,
			248,
			220
		],
		crimson: [
			220,
			20,
			60
		],
		cyan: [
			0,
			255,
			255
		],
		darkblue: [
			0,
			0,
			139
		],
		darkcyan: [
			0,
			139,
			139
		],
		darkgoldenrod: [
			184,
			134,
			11
		],
		darkgray: [
			169,
			169,
			169
		],
		darkgreen: [
			0,
			100,
			0
		],
		darkgrey: [
			169,
			169,
			169
		],
		darkkhaki: [
			189,
			183,
			107
		],
		darkmagenta: [
			139,
			0,
			139
		],
		darkolivegreen: [
			85,
			107,
			47
		],
		darkorange: [
			255,
			140,
			0
		],
		darkorchid: [
			153,
			50,
			204
		],
		darkred: [
			139,
			0,
			0
		],
		darksalmon: [
			233,
			150,
			122
		],
		darkseagreen: [
			143,
			188,
			143
		],
		darkslateblue: [
			72,
			61,
			139
		],
		darkslategray: [
			47,
			79,
			79
		],
		darkslategrey: [
			47,
			79,
			79
		],
		darkturquoise: [
			0,
			206,
			209
		],
		darkviolet: [
			148,
			0,
			211
		],
		deeppink: [
			255,
			20,
			147
		],
		deepskyblue: [
			0,
			191,
			255
		],
		dimgray: [
			105,
			105,
			105
		],
		dimgrey: [
			105,
			105,
			105
		],
		dodgerblue: [
			30,
			144,
			255
		],
		firebrick: [
			178,
			34,
			34
		],
		floralwhite: [
			255,
			250,
			240
		],
		forestgreen: [
			34,
			139,
			34
		],
		fuchsia: [
			255,
			0,
			255
		],
		gainsboro: [
			220,
			220,
			220
		],
		ghostwhite: [
			248,
			248,
			255
		],
		gold: [
			255,
			215,
			0
		],
		goldenrod: [
			218,
			165,
			32
		],
		gray: [
			128,
			128,
			128
		],
		green: [
			0,
			128,
			0
		],
		greenyellow: [
			173,
			255,
			47
		],
		grey: [
			128,
			128,
			128
		],
		honeydew: [
			240,
			255,
			240
		],
		hotpink: [
			255,
			105,
			180
		],
		indianred: [
			205,
			92,
			92
		],
		indigo: [
			75,
			0,
			130
		],
		ivory: [
			255,
			255,
			240
		],
		khaki: [
			240,
			230,
			140
		],
		lavender: [
			230,
			230,
			250
		],
		lavenderblush: [
			255,
			240,
			245
		],
		lawngreen: [
			124,
			252,
			0
		],
		lemonchiffon: [
			255,
			250,
			205
		],
		lightblue: [
			173,
			216,
			230
		],
		lightcoral: [
			240,
			128,
			128
		],
		lightcyan: [
			224,
			255,
			255
		],
		lightgoldenrodyellow: [
			250,
			250,
			210
		],
		lightgray: [
			211,
			211,
			211
		],
		lightgreen: [
			144,
			238,
			144
		],
		lightgrey: [
			211,
			211,
			211
		],
		lightpink: [
			255,
			182,
			193
		],
		lightsalmon: [
			255,
			160,
			122
		],
		lightseagreen: [
			32,
			178,
			170
		],
		lightskyblue: [
			135,
			206,
			250
		],
		lightslategray: [
			119,
			136,
			153
		],
		lightslategrey: [
			119,
			136,
			153
		],
		lightsteelblue: [
			176,
			196,
			222
		],
		lightyellow: [
			255,
			255,
			224
		],
		lime: [
			0,
			255,
			0
		],
		limegreen: [
			50,
			205,
			50
		],
		linen: [
			250,
			240,
			230
		],
		magenta: [
			255,
			0,
			255
		],
		maroon: [
			128,
			0,
			0
		],
		mediumaquamarine: [
			102,
			205,
			170
		],
		mediumblue: [
			0,
			0,
			205
		],
		mediumorchid: [
			186,
			85,
			211
		],
		mediumpurple: [
			147,
			112,
			219
		],
		mediumseagreen: [
			60,
			179,
			113
		],
		mediumslateblue: [
			123,
			104,
			238
		],
		mediumspringgreen: [
			0,
			250,
			154
		],
		mediumturquoise: [
			72,
			209,
			204
		],
		mediumvioletred: [
			199,
			21,
			133
		],
		midnightblue: [
			25,
			25,
			112
		],
		mintcream: [
			245,
			255,
			250
		],
		mistyrose: [
			255,
			228,
			225
		],
		moccasin: [
			255,
			228,
			181
		],
		navajowhite: [
			255,
			222,
			173
		],
		navy: [
			0,
			0,
			128
		],
		oldlace: [
			253,
			245,
			230
		],
		olive: [
			128,
			128,
			0
		],
		olivedrab: [
			107,
			142,
			35
		],
		orange: [
			255,
			165,
			0
		],
		orangered: [
			255,
			69,
			0
		],
		orchid: [
			218,
			112,
			214
		],
		palegoldenrod: [
			238,
			232,
			170
		],
		palegreen: [
			152,
			251,
			152
		],
		paleturquoise: [
			175,
			238,
			238
		],
		palevioletred: [
			219,
			112,
			147
		],
		papayawhip: [
			255,
			239,
			213
		],
		peachpuff: [
			255,
			218,
			185
		],
		peru: [
			205,
			133,
			63
		],
		pink: [
			255,
			192,
			203
		],
		plum: [
			221,
			160,
			221
		],
		powderblue: [
			176,
			224,
			230
		],
		purple: [
			128,
			0,
			128
		],
		rebeccapurple: [
			102,
			51,
			153
		],
		red: [
			255,
			0,
			0
		],
		rosybrown: [
			188,
			143,
			143
		],
		royalblue: [
			65,
			105,
			225
		],
		saddlebrown: [
			139,
			69,
			19
		],
		salmon: [
			250,
			128,
			114
		],
		sandybrown: [
			244,
			164,
			96
		],
		seagreen: [
			46,
			139,
			87
		],
		seashell: [
			255,
			245,
			238
		],
		sienna: [
			160,
			82,
			45
		],
		silver: [
			192,
			192,
			192
		],
		skyblue: [
			135,
			206,
			235
		],
		slateblue: [
			106,
			90,
			205
		],
		slategray: [
			112,
			128,
			144
		],
		slategrey: [
			112,
			128,
			144
		],
		snow: [
			255,
			250,
			250
		],
		springgreen: [
			0,
			255,
			127
		],
		steelblue: [
			70,
			130,
			180
		],
		tan: [
			210,
			180,
			140
		],
		teal: [
			0,
			128,
			128
		],
		thistle: [
			216,
			191,
			216
		],
		tomato: [
			255,
			99,
			71
		],
		turquoise: [
			64,
			224,
			208
		],
		violet: [
			238,
			130,
			238
		],
		wheat: [
			245,
			222,
			179
		],
		white: [
			255,
			255,
			255
		],
		whitesmoke: [
			245,
			245,
			245
		],
		yellow: [
			255,
			255,
			0
		],
		yellowgreen: [
			154,
			205,
			50
		]
	};
})), ni = /* @__PURE__ */ t(((e, t) => {
	var n = ti(), r = {};
	for (var i in n) n.hasOwnProperty(i) && (r[n[i]] = i);
	var a = t.exports = {
		rgb: {
			channels: 3,
			labels: "rgb"
		},
		hsl: {
			channels: 3,
			labels: "hsl"
		},
		hsv: {
			channels: 3,
			labels: "hsv"
		},
		hwb: {
			channels: 3,
			labels: "hwb"
		},
		cmyk: {
			channels: 4,
			labels: "cmyk"
		},
		xyz: {
			channels: 3,
			labels: "xyz"
		},
		lab: {
			channels: 3,
			labels: "lab"
		},
		lch: {
			channels: 3,
			labels: "lch"
		},
		hex: {
			channels: 1,
			labels: ["hex"]
		},
		keyword: {
			channels: 1,
			labels: ["keyword"]
		},
		ansi16: {
			channels: 1,
			labels: ["ansi16"]
		},
		ansi256: {
			channels: 1,
			labels: ["ansi256"]
		},
		hcg: {
			channels: 3,
			labels: [
				"h",
				"c",
				"g"
			]
		},
		apple: {
			channels: 3,
			labels: [
				"r16",
				"g16",
				"b16"
			]
		},
		gray: {
			channels: 1,
			labels: ["gray"]
		}
	};
	for (var o in a) if (a.hasOwnProperty(o)) {
		if (!("channels" in a[o])) throw Error("missing channels property: " + o);
		if (!("labels" in a[o])) throw Error("missing channel labels property: " + o);
		if (a[o].labels.length !== a[o].channels) throw Error("channel and label counts mismatch: " + o);
		var s = a[o].channels, c = a[o].labels;
		delete a[o].channels, delete a[o].labels, Object.defineProperty(a[o], "channels", { value: s }), Object.defineProperty(a[o], "labels", { value: c });
	}
	a.rgb.hsl = function(e) {
		var t = e[0] / 255, n = e[1] / 255, r = e[2] / 255, i = Math.min(t, n, r), a = Math.max(t, n, r), o = a - i, s, c, l;
		return a === i ? s = 0 : t === a ? s = (n - r) / o : n === a ? s = 2 + (r - t) / o : r === a && (s = 4 + (t - n) / o), s = Math.min(s * 60, 360), s < 0 && (s += 360), l = (i + a) / 2, c = a === i ? 0 : l <= .5 ? o / (a + i) : o / (2 - a - i), [
			s,
			c * 100,
			l * 100
		];
	}, a.rgb.hsv = function(e) {
		var t, n, r, i, a, o = e[0] / 255, s = e[1] / 255, c = e[2] / 255, l = Math.max(o, s, c), u = l - Math.min(o, s, c), d = function(e) {
			return (l - e) / 6 / u + 1 / 2;
		};
		return u === 0 ? i = a = 0 : (a = u / l, t = d(o), n = d(s), r = d(c), o === l ? i = r - n : s === l ? i = 1 / 3 + t - r : c === l && (i = 2 / 3 + n - t), i < 0 ? i += 1 : i > 1 && --i), [
			i * 360,
			a * 100,
			l * 100
		];
	}, a.rgb.hwb = function(e) {
		var t = e[0], n = e[1], r = e[2], i = a.rgb.hsl(e)[0], o = 1 / 255 * Math.min(t, Math.min(n, r));
		return r = 1 - 1 / 255 * Math.max(t, Math.max(n, r)), [
			i,
			o * 100,
			r * 100
		];
	}, a.rgb.cmyk = function(e) {
		var t = e[0] / 255, n = e[1] / 255, r = e[2] / 255, i, a, o, s = Math.min(1 - t, 1 - n, 1 - r);
		return i = (1 - t - s) / (1 - s) || 0, a = (1 - n - s) / (1 - s) || 0, o = (1 - r - s) / (1 - s) || 0, [
			i * 100,
			a * 100,
			o * 100,
			s * 100
		];
	};
	function l(e, t) {
		return (e[0] - t[0]) ** 2 + (e[1] - t[1]) ** 2 + (e[2] - t[2]) ** 2;
	}
	a.rgb.keyword = function(e) {
		var t = r[e];
		if (t) return t;
		var i = Infinity, a;
		for (var o in n) if (n.hasOwnProperty(o)) {
			var s = n[o], c = l(e, s);
			c < i && (i = c, a = o);
		}
		return a;
	}, a.keyword.rgb = function(e) {
		return n[e];
	}, a.rgb.xyz = function(e) {
		var t = e[0] / 255, n = e[1] / 255, r = e[2] / 255;
		t = t > .04045 ? ((t + .055) / 1.055) ** 2.4 : t / 12.92, n = n > .04045 ? ((n + .055) / 1.055) ** 2.4 : n / 12.92, r = r > .04045 ? ((r + .055) / 1.055) ** 2.4 : r / 12.92;
		var i = t * .4124 + n * .3576 + r * .1805, a = t * .2126 + n * .7152 + r * .0722, o = t * .0193 + n * .1192 + r * .9505;
		return [
			i * 100,
			a * 100,
			o * 100
		];
	}, a.rgb.lab = function(e) {
		var t = a.rgb.xyz(e), n = t[0], r = t[1], i = t[2], o, s, c;
		return n /= 95.047, r /= 100, i /= 108.883, n = n > .008856 ? n ** (1 / 3) : 7.787 * n + 16 / 116, r = r > .008856 ? r ** (1 / 3) : 7.787 * r + 16 / 116, i = i > .008856 ? i ** (1 / 3) : 7.787 * i + 16 / 116, o = 116 * r - 16, s = 500 * (n - r), c = 200 * (r - i), [
			o,
			s,
			c
		];
	}, a.hsl.rgb = function(e) {
		var t = e[0] / 360, n = e[1] / 100, r = e[2] / 100, i, a, o, s, c;
		if (n === 0) return c = r * 255, [
			c,
			c,
			c
		];
		a = r < .5 ? r * (1 + n) : r + n - r * n, i = 2 * r - a, s = [
			0,
			0,
			0
		];
		for (var l = 0; l < 3; l++) o = t + 1 / 3 * -(l - 1), o < 0 && o++, o > 1 && o--, c = 6 * o < 1 ? i + (a - i) * 6 * o : 2 * o < 1 ? a : 3 * o < 2 ? i + (a - i) * (2 / 3 - o) * 6 : i, s[l] = c * 255;
		return s;
	}, a.hsl.hsv = function(e) {
		var t = e[0], n = e[1] / 100, r = e[2] / 100, i = n, a = Math.max(r, .01), o, s;
		return r *= 2, n *= r <= 1 ? r : 2 - r, i *= a <= 1 ? a : 2 - a, s = (r + n) / 2, o = r === 0 ? 2 * i / (a + i) : 2 * n / (r + n), [
			t,
			o * 100,
			s * 100
		];
	}, a.hsv.rgb = function(e) {
		var t = e[0] / 60, n = e[1] / 100, r = e[2] / 100, i = Math.floor(t) % 6, a = t - Math.floor(t), o = 255 * r * (1 - n), s = 255 * r * (1 - n * a), c = 255 * r * (1 - n * (1 - a));
		switch (r *= 255, i) {
			case 0: return [
				r,
				c,
				o
			];
			case 1: return [
				s,
				r,
				o
			];
			case 2: return [
				o,
				r,
				c
			];
			case 3: return [
				o,
				s,
				r
			];
			case 4: return [
				c,
				o,
				r
			];
			case 5: return [
				r,
				o,
				s
			];
		}
	}, a.hsv.hsl = function(e) {
		var t = e[0], n = e[1] / 100, r = e[2] / 100, i = Math.max(r, .01), a, o, s = (2 - n) * r;
		return a = (2 - n) * i, o = n * i, o /= a <= 1 ? a : 2 - a, o = o || 0, s /= 2, [
			t,
			o * 100,
			s * 100
		];
	}, a.hwb.rgb = function(e) {
		var t = e[0] / 360, n = e[1] / 100, r = e[2] / 100, i = n + r, a, o, s, c;
		i > 1 && (n /= i, r /= i), a = Math.floor(6 * t), o = 1 - r, s = 6 * t - a, a & 1 && (s = 1 - s), c = n + s * (o - n);
		var l, u, d;
		switch (a) {
			default:
			case 6:
			case 0:
				l = o, u = c, d = n;
				break;
			case 1:
				l = c, u = o, d = n;
				break;
			case 2:
				l = n, u = o, d = c;
				break;
			case 3:
				l = n, u = c, d = o;
				break;
			case 4:
				l = c, u = n, d = o;
				break;
			case 5:
				l = o, u = n, d = c;
				break;
		}
		return [
			l * 255,
			u * 255,
			d * 255
		];
	}, a.cmyk.rgb = function(e) {
		var t = e[0] / 100, n = e[1] / 100, r = e[2] / 100, i = e[3] / 100, a = 1 - Math.min(1, t * (1 - i) + i), o = 1 - Math.min(1, n * (1 - i) + i), s = 1 - Math.min(1, r * (1 - i) + i);
		return [
			a * 255,
			o * 255,
			s * 255
		];
	}, a.xyz.rgb = function(e) {
		var t = e[0] / 100, n = e[1] / 100, r = e[2] / 100, i = t * 3.2406 + n * -1.5372 + r * -.4986, a = t * -.9689 + n * 1.8758 + r * .0415, o = t * .0557 + n * -.204 + r * 1.057;
		return i = i > .0031308 ? 1.055 * i ** (1 / 2.4) - .055 : i * 12.92, a = a > .0031308 ? 1.055 * a ** (1 / 2.4) - .055 : a * 12.92, o = o > .0031308 ? 1.055 * o ** (1 / 2.4) - .055 : o * 12.92, i = Math.min(Math.max(0, i), 1), a = Math.min(Math.max(0, a), 1), o = Math.min(Math.max(0, o), 1), [
			i * 255,
			a * 255,
			o * 255
		];
	}, a.xyz.lab = function(e) {
		var t = e[0], n = e[1], r = e[2], i, a, o;
		return t /= 95.047, n /= 100, r /= 108.883, t = t > .008856 ? t ** (1 / 3) : 7.787 * t + 16 / 116, n = n > .008856 ? n ** (1 / 3) : 7.787 * n + 16 / 116, r = r > .008856 ? r ** (1 / 3) : 7.787 * r + 16 / 116, i = 116 * n - 16, a = 500 * (t - n), o = 200 * (n - r), [
			i,
			a,
			o
		];
	}, a.lab.xyz = function(e) {
		var t = e[0], n = e[1], r = e[2], i, a = (t + 16) / 116, o;
		i = n / 500 + a, o = a - r / 200;
		var s = a ** 3, c = i ** 3, l = o ** 3;
		return a = s > .008856 ? s : (a - 16 / 116) / 7.787, i = c > .008856 ? c : (i - 16 / 116) / 7.787, o = l > .008856 ? l : (o - 16 / 116) / 7.787, i *= 95.047, a *= 100, o *= 108.883, [
			i,
			a,
			o
		];
	}, a.lab.lch = function(e) {
		var t = e[0], n = e[1], r = e[2], i = Math.atan2(r, n) * 360 / 2 / Math.PI, a;
		return i < 0 && (i += 360), a = Math.sqrt(n * n + r * r), [
			t,
			a,
			i
		];
	}, a.lch.lab = function(e) {
		var t = e[0], n = e[1], r = e[2], i, a, o = r / 360 * 2 * Math.PI;
		return i = n * Math.cos(o), a = n * Math.sin(o), [
			t,
			i,
			a
		];
	}, a.rgb.ansi16 = function(e) {
		var t = e[0], n = e[1], r = e[2], i = 1 in arguments ? arguments[1] : a.rgb.hsv(e)[2];
		if (i = Math.round(i / 50), i === 0) return 30;
		var o = 30 + (Math.round(r / 255) << 2 | Math.round(n / 255) << 1 | Math.round(t / 255));
		return i === 2 && (o += 60), o;
	}, a.hsv.ansi16 = function(e) {
		return a.rgb.ansi16(a.hsv.rgb(e), e[2]);
	}, a.rgb.ansi256 = function(e) {
		var t = e[0], n = e[1], r = e[2];
		return t === n && n === r ? t < 8 ? 16 : t > 248 ? 231 : Math.round((t - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(t / 255 * 5) + 6 * Math.round(n / 255 * 5) + Math.round(r / 255 * 5);
	}, a.ansi16.rgb = function(e) {
		var t = e % 10;
		if (t === 0 || t === 7) return e > 50 && (t += 3.5), t = t / 10.5 * 255, [
			t,
			t,
			t
		];
		var n = (~~(e > 50) + 1) * .5;
		return [
			(t & 1) * n * 255,
			(t >> 1 & 1) * n * 255,
			(t >> 2 & 1) * n * 255
		];
	}, a.ansi256.rgb = function(e) {
		if (e >= 232) {
			var t = (e - 232) * 10 + 8;
			return [
				t,
				t,
				t
			];
		}
		e -= 16;
		var n;
		return [
			Math.floor(e / 36) / 5 * 255,
			Math.floor((n = e % 36) / 6) / 5 * 255,
			n % 6 / 5 * 255
		];
	}, a.rgb.hex = function(e) {
		var t = (((Math.round(e[0]) & 255) << 16) + ((Math.round(e[1]) & 255) << 8) + (Math.round(e[2]) & 255)).toString(16).toUpperCase();
		return "000000".substring(t.length) + t;
	}, a.hex.rgb = function(e) {
		var t = e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
		if (!t) return [
			0,
			0,
			0
		];
		var n = t[0];
		t[0].length === 3 && (n = n.split("").map(function(e) {
			return e + e;
		}).join(""));
		var r = parseInt(n, 16);
		return [
			r >> 16 & 255,
			r >> 8 & 255,
			r & 255
		];
	}, a.rgb.hcg = function(e) {
		var t = e[0] / 255, n = e[1] / 255, r = e[2] / 255, i = Math.max(Math.max(t, n), r), a = Math.min(Math.min(t, n), r), o = i - a, s = o < 1 ? a / (1 - o) : 0, c = o <= 0 ? 0 : i === t ? (n - r) / o % 6 : i === n ? 2 + (r - t) / o : 4 + (t - n) / o + 4;
		return c /= 6, c %= 1, [
			c * 360,
			o * 100,
			s * 100
		];
	}, a.hsl.hcg = function(e) {
		var t = e[1] / 100, n = e[2] / 100, r = 1, i = 0;
		return r = n < .5 ? 2 * t * n : 2 * t * (1 - n), r < 1 && (i = (n - .5 * r) / (1 - r)), [
			e[0],
			r * 100,
			i * 100
		];
	}, a.hsv.hcg = function(e) {
		var t = e[1] / 100, n = e[2] / 100, r = t * n, i = 0;
		return r < 1 && (i = (n - r) / (1 - r)), [
			e[0],
			r * 100,
			i * 100
		];
	}, a.hcg.rgb = function(e) {
		var t = e[0] / 360, n = e[1] / 100, r = e[2] / 100;
		if (n === 0) return [
			r * 255,
			r * 255,
			r * 255
		];
		var i = [
			0,
			0,
			0
		], a = t % 1 * 6, o = a % 1, s = 1 - o, c = 0;
		switch (Math.floor(a)) {
			case 0:
				i[0] = 1, i[1] = o, i[2] = 0;
				break;
			case 1:
				i[0] = s, i[1] = 1, i[2] = 0;
				break;
			case 2:
				i[0] = 0, i[1] = 1, i[2] = o;
				break;
			case 3:
				i[0] = 0, i[1] = s, i[2] = 1;
				break;
			case 4:
				i[0] = o, i[1] = 0, i[2] = 1;
				break;
			default: i[0] = 1, i[1] = 0, i[2] = s;
		}
		return c = (1 - n) * r, [
			(n * i[0] + c) * 255,
			(n * i[1] + c) * 255,
			(n * i[2] + c) * 255
		];
	}, a.hcg.hsv = function(e) {
		var t = e[1] / 100, n = t + e[2] / 100 * (1 - t), r = 0;
		return n > 0 && (r = t / n), [
			e[0],
			r * 100,
			n * 100
		];
	}, a.hcg.hsl = function(e) {
		var t = e[1] / 100, n = e[2] / 100 * (1 - t) + .5 * t, r = 0;
		return n > 0 && n < .5 ? r = t / (2 * n) : n >= .5 && n < 1 && (r = t / (2 * (1 - n))), [
			e[0],
			r * 100,
			n * 100
		];
	}, a.hcg.hwb = function(e) {
		var t = e[1] / 100, n = t + e[2] / 100 * (1 - t);
		return [
			e[0],
			(n - t) * 100,
			(1 - n) * 100
		];
	}, a.hwb.hcg = function(e) {
		var t = e[1] / 100, n = 1 - e[2] / 100, r = n - t, i = 0;
		return r < 1 && (i = (n - r) / (1 - r)), [
			e[0],
			r * 100,
			i * 100
		];
	}, a.apple.rgb = function(e) {
		return [
			e[0] / 65535 * 255,
			e[1] / 65535 * 255,
			e[2] / 65535 * 255
		];
	}, a.rgb.apple = function(e) {
		return [
			e[0] / 255 * 65535,
			e[1] / 255 * 65535,
			e[2] / 255 * 65535
		];
	}, a.gray.rgb = function(e) {
		return [
			e[0] / 100 * 255,
			e[0] / 100 * 255,
			e[0] / 100 * 255
		];
	}, a.gray.hsl = a.gray.hsv = function(e) {
		return [
			0,
			0,
			e[0]
		];
	}, a.gray.hwb = function(e) {
		return [
			0,
			100,
			e[0]
		];
	}, a.gray.cmyk = function(e) {
		return [
			0,
			0,
			0,
			e[0]
		];
	}, a.gray.lab = function(e) {
		return [
			e[0],
			0,
			0
		];
	}, a.gray.hex = function(e) {
		var t = Math.round(e[0] / 100 * 255) & 255, n = ((t << 16) + (t << 8) + t).toString(16).toUpperCase();
		return "000000".substring(n.length) + n;
	}, a.rgb.gray = function(e) {
		return [(e[0] + e[1] + e[2]) / 3 / 255 * 100];
	};
})), ri = /* @__PURE__ */ t(((e, t) => {
	var n = ni();
	function r() {
		for (var e = {}, t = Object.keys(n), r = t.length, i = 0; i < r; i++) e[t[i]] = {
			distance: -1,
			parent: null
		};
		return e;
	}
	function i(e) {
		var t = r(), i = [e];
		for (t[e].distance = 0; i.length;) for (var a = i.pop(), o = Object.keys(n[a]), s = o.length, c = 0; c < s; c++) {
			var l = o[c], u = t[l];
			u.distance === -1 && (u.distance = t[a].distance + 1, u.parent = a, i.unshift(l));
		}
		return t;
	}
	function a(e, t) {
		return function(n) {
			return t(e(n));
		};
	}
	function o(e, t) {
		for (var r = [t[e].parent, e], i = n[t[e].parent][e], o = t[e].parent; t[o].parent;) r.unshift(t[o].parent), i = a(n[t[o].parent][o], i), o = t[o].parent;
		return i.conversion = r, i;
	}
	t.exports = function(e) {
		for (var t = i(e), n = {}, r = Object.keys(t), a = r.length, s = 0; s < a; s++) {
			var c = r[s];
			t[c].parent !== null && (n[c] = o(c, t));
		}
		return n;
	};
})), ii = /* @__PURE__ */ t(((e, t) => {
	var n = ni(), r = ri(), i = {}, a = Object.keys(n);
	function o(e) {
		var t = function(t) {
			return t == null ? t : (arguments.length > 1 && (t = Array.prototype.slice.call(arguments)), e(t));
		};
		return "conversion" in e && (t.conversion = e.conversion), t;
	}
	function s(e) {
		var t = function(t) {
			if (t == null) return t;
			arguments.length > 1 && (t = Array.prototype.slice.call(arguments));
			var n = e(t);
			if (typeof n == "object") for (var r = n.length, i = 0; i < r; i++) n[i] = Math.round(n[i]);
			return n;
		};
		return "conversion" in e && (t.conversion = e.conversion), t;
	}
	a.forEach(function(e) {
		i[e] = {}, Object.defineProperty(i[e], "channels", { value: n[e].channels }), Object.defineProperty(i[e], "labels", { value: n[e].labels });
		var t = r(e);
		Object.keys(t).forEach(function(n) {
			var r = t[n];
			i[e][n] = s(r), i[e][n].raw = o(r);
		});
	}), t.exports = i;
})), ai = /* @__PURE__ */ t(((e, t) => {
	var n = ei(), r = ii(), i = [].slice, a = [
		"keyword",
		"gray",
		"hex"
	], o = {};
	Object.keys(r).forEach(function(e) {
		o[i.call(r[e].labels).sort().join("")] = e;
	});
	var s = {};
	function c(e, t) {
		if (!(this instanceof c)) return new c(e, t);
		if (t && t in a && (t = null), t && !(t in r)) throw Error("Unknown model: " + t);
		var l, u;
		if (e == null) this.model = "rgb", this.color = [
			0,
			0,
			0
		], this.valpha = 1;
		else if (e instanceof c) this.model = e.model, this.color = e.color.slice(), this.valpha = e.valpha;
		else if (typeof e == "string") {
			var d = n.get(e);
			if (d === null) throw Error("Unable to parse color from string: " + e);
			this.model = d.model, u = r[this.model].channels, this.color = d.value.slice(0, u), this.valpha = typeof d.value[u] == "number" ? d.value[u] : 1;
		} else if (e.length) {
			this.model = t || "rgb", u = r[this.model].channels;
			var f = i.call(e, 0, u);
			this.color = m(f, u), this.valpha = typeof e[u] == "number" ? e[u] : 1;
		} else if (typeof e == "number") e &= 16777215, this.model = "rgb", this.color = [
			e >> 16 & 255,
			e >> 8 & 255,
			e & 255
		], this.valpha = 1;
		else {
			this.valpha = 1;
			var p = Object.keys(e);
			"alpha" in e && (p.splice(p.indexOf("alpha"), 1), this.valpha = typeof e.alpha == "number" ? e.alpha : 0);
			var h = p.sort().join("");
			if (!(h in o)) throw Error("Unable to parse color from object: " + JSON.stringify(e));
			this.model = o[h];
			var g = r[this.model].labels, _ = [];
			for (l = 0; l < g.length; l++) _.push(e[g[l]]);
			this.color = m(_);
		}
		if (s[this.model]) for (u = r[this.model].channels, l = 0; l < u; l++) {
			var v = s[this.model][l];
			v && (this.color[l] = v(this.color[l]));
		}
		this.valpha = Math.max(0, Math.min(1, this.valpha)), Object.freeze && Object.freeze(this);
	}
	c.prototype = {
		toString: function() {
			return this.string();
		},
		toJSON: function() {
			return this[this.model]();
		},
		string: function(e) {
			var t = this.model in n.to ? this : this.rgb();
			t = t.round(typeof e == "number" ? e : 1);
			var r = t.valpha === 1 ? t.color : t.color.concat(this.valpha);
			return n.to[t.model](r);
		},
		percentString: function(e) {
			var t = this.rgb().round(typeof e == "number" ? e : 1), r = t.valpha === 1 ? t.color : t.color.concat(this.valpha);
			return n.to.rgb.percent(r);
		},
		array: function() {
			return this.valpha === 1 ? this.color.slice() : this.color.concat(this.valpha);
		},
		object: function() {
			for (var e = {}, t = r[this.model].channels, n = r[this.model].labels, i = 0; i < t; i++) e[n[i]] = this.color[i];
			return this.valpha !== 1 && (e.alpha = this.valpha), e;
		},
		unitArray: function() {
			var e = this.rgb().color;
			return e[0] /= 255, e[1] /= 255, e[2] /= 255, this.valpha !== 1 && e.push(this.valpha), e;
		},
		unitObject: function() {
			var e = this.rgb().object();
			return e.r /= 255, e.g /= 255, e.b /= 255, this.valpha !== 1 && (e.alpha = this.valpha), e;
		},
		round: function(e) {
			return e = Math.max(e || 0, 0), new c(this.color.map(u(e)).concat(this.valpha), this.model);
		},
		alpha: function(e) {
			return arguments.length ? new c(this.color.concat(Math.max(0, Math.min(1, e))), this.model) : this.valpha;
		},
		red: d("rgb", 0, f(255)),
		green: d("rgb", 1, f(255)),
		blue: d("rgb", 2, f(255)),
		hue: d([
			"hsl",
			"hsv",
			"hsl",
			"hwb",
			"hcg"
		], 0, function(e) {
			return (e % 360 + 360) % 360;
		}),
		saturationl: d("hsl", 1, f(100)),
		lightness: d("hsl", 2, f(100)),
		saturationv: d("hsv", 1, f(100)),
		value: d("hsv", 2, f(100)),
		chroma: d("hcg", 1, f(100)),
		gray: d("hcg", 2, f(100)),
		white: d("hwb", 1, f(100)),
		wblack: d("hwb", 2, f(100)),
		cyan: d("cmyk", 0, f(100)),
		magenta: d("cmyk", 1, f(100)),
		yellow: d("cmyk", 2, f(100)),
		black: d("cmyk", 3, f(100)),
		x: d("xyz", 0, f(100)),
		y: d("xyz", 1, f(100)),
		z: d("xyz", 2, f(100)),
		l: d("lab", 0, f(100)),
		a: d("lab", 1),
		b: d("lab", 2),
		keyword: function(e) {
			return arguments.length ? new c(e) : r[this.model].keyword(this.color);
		},
		hex: function(e) {
			return arguments.length ? new c(e) : n.to.hex(this.rgb().round().color);
		},
		rgbNumber: function() {
			var e = this.rgb().color;
			return (e[0] & 255) << 16 | (e[1] & 255) << 8 | e[2] & 255;
		},
		luminosity: function() {
			for (var e = this.rgb().color, t = [], n = 0; n < e.length; n++) {
				var r = e[n] / 255;
				t[n] = r <= .03928 ? r / 12.92 : ((r + .055) / 1.055) ** 2.4;
			}
			return .2126 * t[0] + .7152 * t[1] + .0722 * t[2];
		},
		contrast: function(e) {
			var t = this.luminosity(), n = e.luminosity();
			return t > n ? (t + .05) / (n + .05) : (n + .05) / (t + .05);
		},
		level: function(e) {
			var t = this.contrast(e);
			return t >= 7.1 ? "AAA" : t >= 4.5 ? "AA" : "";
		},
		isDark: function() {
			var e = this.rgb().color;
			return (e[0] * 299 + e[1] * 587 + e[2] * 114) / 1e3 < 128;
		},
		isLight: function() {
			return !this.isDark();
		},
		negate: function() {
			for (var e = this.rgb(), t = 0; t < 3; t++) e.color[t] = 255 - e.color[t];
			return e;
		},
		lighten: function(e) {
			var t = this.hsl();
			return t.color[2] += t.color[2] * e, t;
		},
		darken: function(e) {
			var t = this.hsl();
			return t.color[2] -= t.color[2] * e, t;
		},
		saturate: function(e) {
			var t = this.hsl();
			return t.color[1] += t.color[1] * e, t;
		},
		desaturate: function(e) {
			var t = this.hsl();
			return t.color[1] -= t.color[1] * e, t;
		},
		whiten: function(e) {
			var t = this.hwb();
			return t.color[1] += t.color[1] * e, t;
		},
		blacken: function(e) {
			var t = this.hwb();
			return t.color[2] += t.color[2] * e, t;
		},
		grayscale: function() {
			var e = this.rgb().color, t = e[0] * .3 + e[1] * .59 + e[2] * .11;
			return c.rgb(t, t, t);
		},
		fade: function(e) {
			return this.alpha(this.valpha - this.valpha * e);
		},
		opaquer: function(e) {
			return this.alpha(this.valpha + this.valpha * e);
		},
		rotate: function(e) {
			var t = this.hsl(), n = t.color[0];
			return n = (n + e) % 360, n = n < 0 ? 360 + n : n, t.color[0] = n, t;
		},
		mix: function(e, t) {
			if (!e || !e.rgb) throw Error("Argument to \"mix\" was not a Color instance, but rather an instance of " + typeof e);
			var n = e.rgb(), r = this.rgb(), i = t === void 0 ? .5 : t, a = 2 * i - 1, o = n.alpha() - r.alpha(), s = ((a * o === -1 ? a : (a + o) / (1 + a * o)) + 1) / 2, l = 1 - s;
			return c.rgb(s * n.red() + l * r.red(), s * n.green() + l * r.green(), s * n.blue() + l * r.blue(), n.alpha() * i + r.alpha() * (1 - i));
		}
	}, Object.keys(r).forEach(function(e) {
		if (a.indexOf(e) === -1) {
			var t = r[e].channels;
			c.prototype[e] = function() {
				if (this.model === e) return new c(this);
				if (arguments.length) return new c(arguments, e);
				var n = typeof arguments[t] == "number" ? t : this.valpha;
				return new c(p(r[this.model][e].raw(this.color)).concat(n), e);
			}, c[e] = function(n) {
				return typeof n == "number" && (n = m(i.call(arguments), t)), new c(n, e);
			};
		}
	});
	function l(e, t) {
		return Number(e.toFixed(t));
	}
	function u(e) {
		return function(t) {
			return l(t, e);
		};
	}
	function d(e, t, n) {
		return e = Array.isArray(e) ? e : [e], e.forEach(function(e) {
			(s[e] || (s[e] = []))[t] = n;
		}), e = e[0], function(r) {
			var i;
			return arguments.length ? (n && (r = n(r)), i = this[e](), i.color[t] = r, i) : (i = this[e]().color[t], n && (i = n(i)), i);
		};
	}
	function f(e) {
		return function(t) {
			return Math.max(0, Math.min(e, t));
		};
	}
	function p(e) {
		return Array.isArray(e) ? e : [e];
	}
	function m(e, t) {
		for (var n = 0; n < t; n++) typeof e[n] != "number" && (e[n] = 0);
		return e;
	}
	t.exports = c;
})), oi = {
	svg: "http://www.w3.org/2000/svg",
	xhtml: "http://www.w3.org/1999/xhtml",
	xlink: "http://www.w3.org/1999/xlink",
	xml: "http://www.w3.org/XML/1998/namespace",
	xmlns: "http://www.w3.org/2000/xmlns/"
};
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespace.js
function si(e) {
	var t = e += "", n = t.indexOf(":");
	return n >= 0 && (t = e.slice(0, n)) !== "xmlns" && (e = e.slice(n + 1)), oi.hasOwnProperty(t) ? {
		space: oi[t],
		local: e
	} : e;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/creator.js
function ci(e) {
	return function() {
		var t = this.ownerDocument, n = this.namespaceURI;
		return n === "http://www.w3.org/1999/xhtml" && t.documentElement.namespaceURI === "http://www.w3.org/1999/xhtml" ? t.createElement(e) : t.createElementNS(n, e);
	};
}
function li(e) {
	return function() {
		return this.ownerDocument.createElementNS(e.space, e.local);
	};
}
function ui(e) {
	var t = si(e);
	return (t.local ? li : ci)(t);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selector.js
function di() {}
function fi(e) {
	return e == null ? di : function() {
		return this.querySelector(e);
	};
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/select.js
function pi(e) {
	typeof e != "function" && (e = fi(e));
	for (var t = this._groups, n = t.length, r = Array(n), i = 0; i < n; ++i) for (var a = t[i], o = a.length, s = r[i] = Array(o), c, l, u = 0; u < o; ++u) (c = a[u]) && (l = e.call(c, c.__data__, u, a)) && ("__data__" in c && (l.__data__ = c.__data__), s[u] = l);
	return new to(r, this._parents);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/array.js
function mi(e) {
	return e == null ? [] : Array.isArray(e) ? e : Array.from(e);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selectorAll.js
function hi() {
	return [];
}
function gi(e) {
	return e == null ? hi : function() {
		return this.querySelectorAll(e);
	};
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectAll.js
function _i(e) {
	return function() {
		return mi(e.apply(this, arguments));
	};
}
function vi(e) {
	e = typeof e == "function" ? _i(e) : gi(e);
	for (var t = this._groups, n = t.length, r = [], i = [], a = 0; a < n; ++a) for (var o = t[a], s = o.length, c, l = 0; l < s; ++l) (c = o[l]) && (r.push(e.call(c, c.__data__, l, o)), i.push(c));
	return new to(r, i);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/matcher.js
function yi(e) {
	return function() {
		return this.matches(e);
	};
}
function bi(e) {
	return function(t) {
		return t.matches(e);
	};
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChild.js
var xi = Array.prototype.find;
function Si(e) {
	return function() {
		return xi.call(this.children, e);
	};
}
function Ci() {
	return this.firstElementChild;
}
function wi(e) {
	return this.select(e == null ? Ci : Si(typeof e == "function" ? e : bi(e)));
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChildren.js
var Ti = Array.prototype.filter;
function Ei() {
	return Array.from(this.children);
}
function Di(e) {
	return function() {
		return Ti.call(this.children, e);
	};
}
function Oi(e) {
	return this.selectAll(e == null ? Ei : Di(typeof e == "function" ? e : bi(e)));
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/filter.js
function ki(e) {
	typeof e != "function" && (e = yi(e));
	for (var t = this._groups, n = t.length, r = Array(n), i = 0; i < n; ++i) for (var a = t[i], o = a.length, s = r[i] = [], c, l = 0; l < o; ++l) (c = a[l]) && e.call(c, c.__data__, l, a) && s.push(c);
	return new to(r, this._parents);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sparse.js
function Ai(e) {
	return Array(e.length);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/enter.js
function ji() {
	return new to(this._enter || this._groups.map(Ai), this._parents);
}
function Mi(e, t) {
	this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = t;
}
Mi.prototype = {
	constructor: Mi,
	appendChild: function(e) {
		return this._parent.insertBefore(e, this._next);
	},
	insertBefore: function(e, t) {
		return this._parent.insertBefore(e, t);
	},
	querySelector: function(e) {
		return this._parent.querySelector(e);
	},
	querySelectorAll: function(e) {
		return this._parent.querySelectorAll(e);
	}
};
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/constant.js
function Ni(e) {
	return function() {
		return e;
	};
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/data.js
function Pi(e, t, n, r, i, a) {
	for (var o = 0, s, c = t.length, l = a.length; o < l; ++o) (s = t[o]) ? (s.__data__ = a[o], r[o] = s) : n[o] = new Mi(e, a[o]);
	for (; o < c; ++o) (s = t[o]) && (i[o] = s);
}
function Fi(e, t, n, r, i, a, o) {
	var s, c, l = /* @__PURE__ */ new Map(), u = t.length, d = a.length, f = Array(u), p;
	for (s = 0; s < u; ++s) (c = t[s]) && (f[s] = p = o.call(c, c.__data__, s, t) + "", l.has(p) ? i[s] = c : l.set(p, c));
	for (s = 0; s < d; ++s) p = o.call(e, a[s], s, a) + "", (c = l.get(p)) ? (r[s] = c, c.__data__ = a[s], l.delete(p)) : n[s] = new Mi(e, a[s]);
	for (s = 0; s < u; ++s) (c = t[s]) && l.get(f[s]) === c && (i[s] = c);
}
function Ii(e) {
	return e.__data__;
}
function Li(e, t) {
	if (!arguments.length) return Array.from(this, Ii);
	var n = t ? Fi : Pi, r = this._parents, i = this._groups;
	typeof e != "function" && (e = Ni(e));
	for (var a = i.length, o = Array(a), s = Array(a), c = Array(a), l = 0; l < a; ++l) {
		var u = r[l], d = i[l], f = d.length, p = Ri(e.call(u, u && u.__data__, l, r)), m = p.length, h = s[l] = Array(m), g = o[l] = Array(m);
		n(u, d, h, g, c[l] = Array(f), p, t);
		for (var _ = 0, v = 0, y, b; _ < m; ++_) if (y = h[_]) {
			for (_ >= v && (v = _ + 1); !(b = g[v]) && ++v < m;);
			y._next = b || null;
		}
	}
	return o = new to(o, r), o._enter = s, o._exit = c, o;
}
function Ri(e) {
	return typeof e == "object" && "length" in e ? e : Array.from(e);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/exit.js
function zi() {
	return new to(this._exit || this._groups.map(Ai), this._parents);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/join.js
function Bi(e, t, n) {
	var r = this.enter(), i = this, a = this.exit();
	return typeof e == "function" ? (r = e(r), r && (r = r.selection())) : r = r.append(e + ""), t != null && (i = t(i), i && (i = i.selection())), n == null ? a.remove() : n(a), r && i ? r.merge(i).order() : i;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/merge.js
function Vi(e) {
	for (var t = e.selection ? e.selection() : e, n = this._groups, r = t._groups, i = n.length, a = r.length, o = Math.min(i, a), s = Array(i), c = 0; c < o; ++c) for (var l = n[c], u = r[c], d = l.length, f = s[c] = Array(d), p, m = 0; m < d; ++m) (p = l[m] || u[m]) && (f[m] = p);
	for (; c < i; ++c) s[c] = n[c];
	return new to(s, this._parents);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/order.js
function Hi() {
	for (var e = this._groups, t = -1, n = e.length; ++t < n;) for (var r = e[t], i = r.length - 1, a = r[i], o; --i >= 0;) (o = r[i]) && (a && o.compareDocumentPosition(a) ^ 4 && a.parentNode.insertBefore(o, a), a = o);
	return this;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sort.js
function Ui(e) {
	e || (e = Wi);
	function t(t, n) {
		return t && n ? e(t.__data__, n.__data__) : !t - !n;
	}
	for (var n = this._groups, r = n.length, i = Array(r), a = 0; a < r; ++a) {
		for (var o = n[a], s = o.length, c = i[a] = Array(s), l, u = 0; u < s; ++u) (l = o[u]) && (c[u] = l);
		c.sort(t);
	}
	return new to(i, this._parents).order();
}
function Wi(e, t) {
	return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/call.js
function Gi() {
	var e = arguments[0];
	return arguments[0] = this, e.apply(null, arguments), this;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/nodes.js
function Ki() {
	return Array.from(this);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/node.js
function qi() {
	for (var e = this._groups, t = 0, n = e.length; t < n; ++t) for (var r = e[t], i = 0, a = r.length; i < a; ++i) {
		var o = r[i];
		if (o) return o;
	}
	return null;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/size.js
function Ji() {
	let e = 0;
	for (let t of this) ++e;
	return e;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/empty.js
function Yi() {
	return !this.node();
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/each.js
function Xi(e) {
	for (var t = this._groups, n = 0, r = t.length; n < r; ++n) for (var i = t[n], a = 0, o = i.length, s; a < o; ++a) (s = i[a]) && e.call(s, s.__data__, a, i);
	return this;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/attr.js
function Zi(e) {
	return function() {
		this.removeAttribute(e);
	};
}
function Qi(e) {
	return function() {
		this.removeAttributeNS(e.space, e.local);
	};
}
function $i(e, t) {
	return function() {
		this.setAttribute(e, t);
	};
}
function ea(e, t) {
	return function() {
		this.setAttributeNS(e.space, e.local, t);
	};
}
function ta(e, t) {
	return function() {
		var n = t.apply(this, arguments);
		n == null ? this.removeAttribute(e) : this.setAttribute(e, n);
	};
}
function na(e, t) {
	return function() {
		var n = t.apply(this, arguments);
		n == null ? this.removeAttributeNS(e.space, e.local) : this.setAttributeNS(e.space, e.local, n);
	};
}
function ra(e, t) {
	var n = si(e);
	if (arguments.length < 2) {
		var r = this.node();
		return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n);
	}
	return this.each((t == null ? n.local ? Qi : Zi : typeof t == "function" ? n.local ? na : ta : n.local ? ea : $i)(n, t));
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/window.js
function ia(e) {
	return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/style.js
function aa(e) {
	return function() {
		this.style.removeProperty(e);
	};
}
function oa(e, t, n) {
	return function() {
		this.style.setProperty(e, t, n);
	};
}
function sa(e, t, n) {
	return function() {
		var r = t.apply(this, arguments);
		r == null ? this.style.removeProperty(e) : this.style.setProperty(e, r, n);
	};
}
function ca(e, t, n) {
	return arguments.length > 1 ? this.each((t == null ? aa : typeof t == "function" ? sa : oa)(e, t, n == null ? "" : n)) : la(this.node(), e);
}
function la(e, t) {
	return e.style.getPropertyValue(t) || ia(e).getComputedStyle(e, null).getPropertyValue(t);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/property.js
function ua(e) {
	return function() {
		delete this[e];
	};
}
function da(e, t) {
	return function() {
		this[e] = t;
	};
}
function fa(e, t) {
	return function() {
		var n = t.apply(this, arguments);
		n == null ? delete this[e] : this[e] = n;
	};
}
function pa(e, t) {
	return arguments.length > 1 ? this.each((t == null ? ua : typeof t == "function" ? fa : da)(e, t)) : this.node()[e];
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/classed.js
function ma(e) {
	return e.trim().split(/^|\s+/);
}
function ha(e) {
	return e.classList || new ga(e);
}
function ga(e) {
	this._node = e, this._names = ma(e.getAttribute("class") || "");
}
ga.prototype = {
	add: function(e) {
		this._names.indexOf(e) < 0 && (this._names.push(e), this._node.setAttribute("class", this._names.join(" ")));
	},
	remove: function(e) {
		var t = this._names.indexOf(e);
		t >= 0 && (this._names.splice(t, 1), this._node.setAttribute("class", this._names.join(" ")));
	},
	contains: function(e) {
		return this._names.indexOf(e) >= 0;
	}
};
function _a(e, t) {
	for (var n = ha(e), r = -1, i = t.length; ++r < i;) n.add(t[r]);
}
function va(e, t) {
	for (var n = ha(e), r = -1, i = t.length; ++r < i;) n.remove(t[r]);
}
function ya(e) {
	return function() {
		_a(this, e);
	};
}
function ba(e) {
	return function() {
		va(this, e);
	};
}
function xa(e, t) {
	return function() {
		(t.apply(this, arguments) ? _a : va)(this, e);
	};
}
function Sa(e, t) {
	var n = ma(e + "");
	if (arguments.length < 2) {
		for (var r = ha(this.node()), i = -1, a = n.length; ++i < a;) if (!r.contains(n[i])) return !1;
		return !0;
	}
	return this.each((typeof t == "function" ? xa : t ? ya : ba)(n, t));
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/text.js
function Ca() {
	this.textContent = "";
}
function wa(e) {
	return function() {
		this.textContent = e;
	};
}
function Ta(e) {
	return function() {
		var t = e.apply(this, arguments);
		this.textContent = t == null ? "" : t;
	};
}
function Ea(e) {
	return arguments.length ? this.each(e == null ? Ca : (typeof e == "function" ? Ta : wa)(e)) : this.node().textContent;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/html.js
function Da() {
	this.innerHTML = "";
}
function Oa(e) {
	return function() {
		this.innerHTML = e;
	};
}
function ka(e) {
	return function() {
		var t = e.apply(this, arguments);
		this.innerHTML = t == null ? "" : t;
	};
}
function Aa(e) {
	return arguments.length ? this.each(e == null ? Da : (typeof e == "function" ? ka : Oa)(e)) : this.node().innerHTML;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/raise.js
function ja() {
	this.nextSibling && this.parentNode.appendChild(this);
}
function Ma() {
	return this.each(ja);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/lower.js
function Na() {
	this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
}
function Pa() {
	return this.each(Na);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/append.js
function Fa(e) {
	var t = typeof e == "function" ? e : ui(e);
	return this.select(function() {
		return this.appendChild(t.apply(this, arguments));
	});
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/insert.js
function Ia() {
	return null;
}
function La(e, t) {
	var n = typeof e == "function" ? e : ui(e), r = t == null ? Ia : typeof t == "function" ? t : fi(t);
	return this.select(function() {
		return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null);
	});
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/remove.js
function Ra() {
	var e = this.parentNode;
	e && e.removeChild(this);
}
function za() {
	return this.each(Ra);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/clone.js
function Ba() {
	var e = this.cloneNode(!1), t = this.parentNode;
	return t ? t.insertBefore(e, this.nextSibling) : e;
}
function Va() {
	var e = this.cloneNode(!0), t = this.parentNode;
	return t ? t.insertBefore(e, this.nextSibling) : e;
}
function Ha(e) {
	return this.select(e ? Va : Ba);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/datum.js
function Ua(e) {
	return arguments.length ? this.property("__data__", e) : this.node().__data__;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/on.js
function Wa(e) {
	return function(t) {
		e.call(this, t, this.__data__);
	};
}
function Ga(e) {
	return e.trim().split(/^|\s+/).map(function(e) {
		var t = "", n = e.indexOf(".");
		return n >= 0 && (t = e.slice(n + 1), e = e.slice(0, n)), {
			type: e,
			name: t
		};
	});
}
function Ka(e) {
	return function() {
		var t = this.__on;
		if (t) {
			for (var n = 0, r = -1, i = t.length, a; n < i; ++n) a = t[n], (!e.type || a.type === e.type) && a.name === e.name ? this.removeEventListener(a.type, a.listener, a.options) : t[++r] = a;
			++r ? t.length = r : delete this.__on;
		}
	};
}
function qa(e, t, n) {
	return function() {
		var r = this.__on, i, a = Wa(t);
		if (r) {
			for (var o = 0, s = r.length; o < s; ++o) if ((i = r[o]).type === e.type && i.name === e.name) {
				this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = a, i.options = n), i.value = t;
				return;
			}
		}
		this.addEventListener(e.type, a, n), i = {
			type: e.type,
			name: e.name,
			value: t,
			listener: a,
			options: n
		}, r ? r.push(i) : this.__on = [i];
	};
}
function Ja(e, t, n) {
	var r = Ga(e + ""), i, a = r.length, o;
	if (arguments.length < 2) {
		var s = this.node().__on;
		if (s) {
			for (var c = 0, l = s.length, u; c < l; ++c) for (i = 0, u = s[c]; i < a; ++i) if ((o = r[i]).type === u.type && o.name === u.name) return u.value;
		}
		return;
	}
	for (s = t ? qa : Ka, i = 0; i < a; ++i) this.each(s(r[i], t, n));
	return this;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/dispatch.js
function Ya(e, t, n) {
	var r = ia(e), i = r.CustomEvent;
	typeof i == "function" ? i = new i(t, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(t, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(t, !1, !1)), e.dispatchEvent(i);
}
function Xa(e, t) {
	return function() {
		return Ya(this, e, t);
	};
}
function Za(e, t) {
	return function() {
		return Ya(this, e, t.apply(this, arguments));
	};
}
function Qa(e, t) {
	return this.each((typeof t == "function" ? Za : Xa)(e, t));
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/iterator.js
function* $a() {
	for (var e = this._groups, t = 0, n = e.length; t < n; ++t) for (var r = e[t], i = 0, a = r.length, o; i < a; ++i) (o = r[i]) && (yield o);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/index.js
var eo = [null];
function to(e, t) {
	this._groups = e, this._parents = t;
}
function no() {
	return new to([[document.documentElement]], eo);
}
function ro() {
	return this;
}
to.prototype = no.prototype = {
	constructor: to,
	select: pi,
	selectAll: vi,
	selectChild: wi,
	selectChildren: Oi,
	filter: ki,
	data: Li,
	enter: ji,
	exit: zi,
	join: Bi,
	merge: Vi,
	selection: ro,
	order: Hi,
	sort: Ui,
	call: Gi,
	nodes: Ki,
	node: qi,
	size: Ji,
	empty: Yi,
	each: Xi,
	attr: ra,
	style: ca,
	property: pa,
	classed: Sa,
	text: Ea,
	html: Aa,
	raise: Ma,
	lower: Pa,
	append: Fa,
	insert: La,
	remove: za,
	clone: Ha,
	datum: Ua,
	on: Ja,
	dispatch: Qa,
	[Symbol.iterator]: $a
};
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/select.js
function io(e) {
	return typeof e == "string" ? new to([[document.querySelector(e)]], [document.documentElement]) : new to([[e]], eo);
}
//#endregion
//#region src/data/index.ts
var z = i(), ao = /* @__PURE__ */ t(((e, t) => {
	var n = function(e) {
		return r(e) && !i(e);
	};
	function r(e) {
		return !!e && typeof e == "object";
	}
	function i(e) {
		var t = Object.prototype.toString.call(e);
		return t === "[object RegExp]" || t === "[object Date]" || o(e);
	}
	var a = typeof Symbol == "function" && Symbol.for ? Symbol.for("react.element") : 60103;
	function o(e) {
		return e.$$typeof === a;
	}
	function s(e) {
		return Array.isArray(e) ? [] : {};
	}
	function c(e, t) {
		return t.clone !== !1 && t.isMergeableObject(e) ? g(s(e), e, t) : e;
	}
	function l(e, t, n) {
		return e.concat(t).map(function(e) {
			return c(e, n);
		});
	}
	function u(e, t) {
		if (!t.customMerge) return g;
		var n = t.customMerge(e);
		return typeof n == "function" ? n : g;
	}
	function d(e) {
		return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(t) {
			return Object.propertyIsEnumerable.call(e, t);
		}) : [];
	}
	function f(e) {
		return Object.keys(e).concat(d(e));
	}
	function p(e, t) {
		try {
			return t in e;
		} catch {
			return !1;
		}
	}
	function m(e, t) {
		return p(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t));
	}
	function h(e, t, n) {
		var r = {};
		return n.isMergeableObject(e) && f(e).forEach(function(t) {
			r[t] = c(e[t], n);
		}), f(t).forEach(function(i) {
			m(e, i) || (p(e, i) && n.isMergeableObject(t[i]) ? r[i] = u(i, n)(e[i], t[i], n) : r[i] = c(t[i], n));
		}), r;
	}
	function g(e, t, r) {
		r = r || {}, r.arrayMerge = r.arrayMerge || l, r.isMergeableObject = r.isMergeableObject || n, r.cloneUnlessOtherwiseSpecified = c;
		var i = Array.isArray(t);
		return i === Array.isArray(e) ? i ? r.arrayMerge(e, t, r) : h(e, t, r) : c(t, r);
	}
	g.all = function(e, t) {
		if (!Array.isArray(e)) throw Error("first argument should be an array");
		return e.reduce(function(e, n) {
			return g(e, n, t);
		}, {});
	}, t.exports = g;
}));
//#endregion
//#region src/data/fp-payloads.ts
function oo() {
	let e = i().fpSvgJsRef;
	if (!e) throw Error("No drawing in the config (fpSvgJsRef is not set)");
	return ne(e);
}
function so(e) {
	let t = i().fpSvgLayerJsRefs[e];
	if (t && ie(t)) return ne(t);
	let n = oo();
	if (e === "" || e === n.__fpDefaultLayer) return n;
}
function co(e = "") {
	var t;
	return (t = so(e)) == null ? void 0 : t.__fp;
}
function lo(e = "") {
	var t;
	return (t = so(e)) == null ? void 0 : t.__fpPaths;
}
function uo() {
	var e;
	let t = i().wfDataJsRef;
	return !t || !ie(t) || (e = ne(t).__wfData) == null ? null : e;
}
//#endregion
//#region src/tools/settings.ts
var fo = /* @__PURE__ */ e(ao(), 1), po, mo = class {
	constructor() {
		this.boothLabelColor = "#fff", this.boothBorderColor = "#fff", this.backgroundColor = "#ebebeb", this.boothBorderWidth = void 0, this.heatmapColors = [
			"#FDE7C7",
			"#FDDBAE",
			"#FDC48D",
			"#FCB37C",
			"#FCA26D",
			"#F67B5B",
			"#EB483E",
			"#E03143",
			"#6C0022"
		], this.maxZoom = void 0;
	}
}, ho = new class extends mo {
	constructor(...e) {
		super(...e), this.EXPO = window.__efpEvent, this.borderless = !1, this.wayfinding = !1, this.colors = { booths: {
			default: "#41b6e7",
			defaultHold: "#48484A",
			defaultSold: "#41b6e7",
			seectedLight: null,
			selected: "#fb3e59",
			selectedBorder: null,
			wayfinding: {
				selected: "#0088D6",
				selectedBorder: null
			},
			empty: "#aaaaaa"
		} };
	}
}();
ho.EXPO.startsWith("sxsw2024") ? (ho.colors.booths.selected = "#FF6400", ho.colors.booths.seectedLight = "#808080") : ho.EXPO === "whxdubai2026" ? (ho.colors.booths.selected = "#2B66FE", ho.maxZoom = 450) : ho.EXPO === "whxlabs2026" ? ho.colors.booths.selected = "#2B66FE" : (ho.EXPO === "wineparis2026" || ho.EXPO === "rdemo2025") && (ho.maxZoom = 450);
var go = window.__settings, _o = (po = oo().__fpSettings) == null ? {} : po;
ho = (0, fo.default)(ho, go == null ? _o : go), ho = (0, fo.default)(ho, _o);
var vo = ho;
//#endregion
//#region src/utils/extractMetaFromString.ts
function yo(e) {
	let t = e.split("$$");
	if (t.length !== 2) return {
		text: e,
		meta: {}
	};
	let [n, r] = t;
	return {
		text: n,
		meta: r.split(",").reduce((e, t) => {
			let [n, r] = t.split(":");
			if (n) {
				var i;
				e[n.trim()] = (i = r == null ? void 0 : r.trim()) == null ? "" : i;
			}
			return e;
		}, {})
	};
}
//#endregion
//#region src/data/svg.ts
var bo = /* @__PURE__ */ new Map();
function xo(e, t = "") {
	if (bo.has(t)) return bo.get(t);
	let n = new DOMParser().parseFromString(e, "image/svg+xml").documentElement;
	n.firstChild.tagName === "parsererror" && P.error("Parsed svg with error: ", So);
	let r = /* @__PURE__ */ new Map();
	return io(n).selectAll("style").each(function() {
		let e = this.textContent, t = /\.([a-z0-9.]+)\s*{[^}]*fill\s*:\s*([^};]+);[^}]*}/gi, n;
		for (; (n = t.exec(e)) !== null;) {
			let e = n[1], t = n[2];
			r.set(e, t);
		}
	}), io(n).selectAll("*[class]").each(function() {
		let e = this;
		e.style.fill = r.get(e.className.baseVal);
	}), No(n), bo.set(t, n), n;
}
var So = xo(co()), Co = oo().__viewbox, wo = io(So).select("rect#VIEWBOX").node(), To = So.viewBox.baseVal, Eo = new Er(To.x, To.y, To.width, To.height), Do, Oo = !1;
Co ? (Do = new Er(Co.x, Co.y, Co.width, Co.height), Oo = !0, wo == null || wo.remove()) : wo ? (Do = Er.fromSvg(wo), Oo = !0, wo.remove()) : Do = Eo.scale(1.1), io(So).attr("width", Eo.size.width), io(So).attr("height", Eo.size.height), P.log("svgArea", Do, "svgViewBox", Eo), vo.wayfinding = !!(!z.hideDirections && uo());
var ko = oo().__fpLayersMode ? io(So).selectAll("[data-floor]").nodes().map((e) => (e.remove(), {
	name: e.dataset.floor,
	rect: Er.fromSvg(e)
})).sort() : [];
function Ao(e, t) {
	let n = jo(e, t), r = n.positions.map((e) => [e[0], Math.abs(e[1])]), i = [];
	for (let e of n.cells) i.push([
		r[e[0]],
		r[e[1]],
		r[e[2]]
	]);
	return i;
}
var jo = (e, t = "") => {
	var n;
	return ((n = lo(t)) == null ? lo() : n)[e];
}, Mo = (e = "") => typeof e == "string" ? bo.has(e) ? bo.get(e) : co(e) ? xo(co(e), e) : bo.get("") : e.rootParent ? bo.has(e.rootParent.name) ? bo.get(e.rootParent.name) : co(e.rootParent.name) ? xo(co(e.rootParent.name), e.rootParent.name) : bo.get("") : co(e.name) ? xo(co(e.name), e.name) : bo.get("");
function No(e) {
	io(e).selectAll("[id], [data-name]").each(function() {
		let e = this, t = {}, n = e.getAttribute("data-name");
		if (n && n.includes("$$")) {
			let { meta: e } = yo(n);
			t = {
				...t,
				...e
			};
		}
		let r = e.getAttribute("id");
		if (r && r.includes("$$")) {
			let { meta: e } = yo(r);
			t = {
				...t,
				...e
			};
		}
		e.setAttribute("data-meta", JSON.stringify(t));
	});
}
//#endregion
//#region src/tools/id.ts
var Po = 1e6;
function Fo() {
	return ++Po;
}
//#endregion
//#region src/tools/slug.ts
var Io = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
	(function(n, r, i) {
		typeof e == "object" ? (t.exports = i(), t.exports.default = i()) : typeof define == "function" && define.amd ? define(i) : r[n] = i();
	})("slugify", e, function() {
		var e = JSON.parse("{\"$\":\"dollar\",\"%\":\"percent\",\"&\":\"and\",\"<\":\"less\",\">\":\"greater\",\"|\":\"or\",\"¢\":\"cent\",\"£\":\"pound\",\"¤\":\"currency\",\"¥\":\"yen\",\"©\":\"(c)\",\"ª\":\"a\",\"®\":\"(r)\",\"º\":\"o\",\"À\":\"A\",\"Á\":\"A\",\"Â\":\"A\",\"Ã\":\"A\",\"Ä\":\"A\",\"Å\":\"A\",\"Æ\":\"AE\",\"Ç\":\"C\",\"È\":\"E\",\"É\":\"E\",\"Ê\":\"E\",\"Ë\":\"E\",\"Ì\":\"I\",\"Í\":\"I\",\"Î\":\"I\",\"Ï\":\"I\",\"Ð\":\"D\",\"Ñ\":\"N\",\"Ò\":\"O\",\"Ó\":\"O\",\"Ô\":\"O\",\"Õ\":\"O\",\"Ö\":\"O\",\"Ø\":\"O\",\"Ù\":\"U\",\"Ú\":\"U\",\"Û\":\"U\",\"Ü\":\"U\",\"Ý\":\"Y\",\"Þ\":\"TH\",\"ß\":\"ss\",\"à\":\"a\",\"á\":\"a\",\"â\":\"a\",\"ã\":\"a\",\"ä\":\"a\",\"å\":\"a\",\"æ\":\"ae\",\"ç\":\"c\",\"è\":\"e\",\"é\":\"e\",\"ê\":\"e\",\"ë\":\"e\",\"ì\":\"i\",\"í\":\"i\",\"î\":\"i\",\"ï\":\"i\",\"ð\":\"d\",\"ñ\":\"n\",\"ò\":\"o\",\"ó\":\"o\",\"ô\":\"o\",\"õ\":\"o\",\"ö\":\"o\",\"ø\":\"o\",\"ù\":\"u\",\"ú\":\"u\",\"û\":\"u\",\"ü\":\"u\",\"ý\":\"y\",\"þ\":\"th\",\"ÿ\":\"y\",\"Ā\":\"A\",\"ā\":\"a\",\"Ă\":\"A\",\"ă\":\"a\",\"Ą\":\"A\",\"ą\":\"a\",\"Ć\":\"C\",\"ć\":\"c\",\"Č\":\"C\",\"č\":\"c\",\"Ď\":\"D\",\"ď\":\"d\",\"Đ\":\"DJ\",\"đ\":\"dj\",\"Ē\":\"E\",\"ē\":\"e\",\"Ė\":\"E\",\"ė\":\"e\",\"Ę\":\"e\",\"ę\":\"e\",\"Ě\":\"E\",\"ě\":\"e\",\"Ğ\":\"G\",\"ğ\":\"g\",\"Ģ\":\"G\",\"ģ\":\"g\",\"Ĩ\":\"I\",\"ĩ\":\"i\",\"Ī\":\"i\",\"ī\":\"i\",\"Į\":\"I\",\"į\":\"i\",\"İ\":\"I\",\"ı\":\"i\",\"Ķ\":\"k\",\"ķ\":\"k\",\"Ļ\":\"L\",\"ļ\":\"l\",\"Ľ\":\"L\",\"ľ\":\"l\",\"Ł\":\"L\",\"ł\":\"l\",\"Ń\":\"N\",\"ń\":\"n\",\"Ņ\":\"N\",\"ņ\":\"n\",\"Ň\":\"N\",\"ň\":\"n\",\"Ō\":\"O\",\"ō\":\"o\",\"Ő\":\"O\",\"ő\":\"o\",\"Œ\":\"OE\",\"œ\":\"oe\",\"Ŕ\":\"R\",\"ŕ\":\"r\",\"Ř\":\"R\",\"ř\":\"r\",\"Ś\":\"S\",\"ś\":\"s\",\"Ş\":\"S\",\"ş\":\"s\",\"Š\":\"S\",\"š\":\"s\",\"Ţ\":\"T\",\"ţ\":\"t\",\"Ť\":\"T\",\"ť\":\"t\",\"Ũ\":\"U\",\"ũ\":\"u\",\"Ū\":\"u\",\"ū\":\"u\",\"Ů\":\"U\",\"ů\":\"u\",\"Ű\":\"U\",\"ű\":\"u\",\"Ų\":\"U\",\"ų\":\"u\",\"Ŵ\":\"W\",\"ŵ\":\"w\",\"Ŷ\":\"Y\",\"ŷ\":\"y\",\"Ÿ\":\"Y\",\"Ź\":\"Z\",\"ź\":\"z\",\"Ż\":\"Z\",\"ż\":\"z\",\"Ž\":\"Z\",\"ž\":\"z\",\"Ə\":\"E\",\"ƒ\":\"f\",\"Ơ\":\"O\",\"ơ\":\"o\",\"Ư\":\"U\",\"ư\":\"u\",\"Lj\":\"LJ\",\"lj\":\"lj\",\"Nj\":\"NJ\",\"nj\":\"nj\",\"Ș\":\"S\",\"ș\":\"s\",\"Ț\":\"T\",\"ț\":\"t\",\"ə\":\"e\",\"˚\":\"o\",\"Ά\":\"A\",\"Έ\":\"E\",\"Ή\":\"H\",\"Ί\":\"I\",\"Ό\":\"O\",\"Ύ\":\"Y\",\"Ώ\":\"W\",\"ΐ\":\"i\",\"Α\":\"A\",\"Β\":\"B\",\"Γ\":\"G\",\"Δ\":\"D\",\"Ε\":\"E\",\"Ζ\":\"Z\",\"Η\":\"H\",\"Θ\":\"8\",\"Ι\":\"I\",\"Κ\":\"K\",\"Λ\":\"L\",\"Μ\":\"M\",\"Ν\":\"N\",\"Ξ\":\"3\",\"Ο\":\"O\",\"Π\":\"P\",\"Ρ\":\"R\",\"Σ\":\"S\",\"Τ\":\"T\",\"Υ\":\"Y\",\"Φ\":\"F\",\"Χ\":\"X\",\"Ψ\":\"PS\",\"Ω\":\"W\",\"Ϊ\":\"I\",\"Ϋ\":\"Y\",\"ά\":\"a\",\"έ\":\"e\",\"ή\":\"h\",\"ί\":\"i\",\"ΰ\":\"y\",\"α\":\"a\",\"β\":\"b\",\"γ\":\"g\",\"δ\":\"d\",\"ε\":\"e\",\"ζ\":\"z\",\"η\":\"h\",\"θ\":\"8\",\"ι\":\"i\",\"κ\":\"k\",\"λ\":\"l\",\"μ\":\"m\",\"ν\":\"n\",\"ξ\":\"3\",\"ο\":\"o\",\"π\":\"p\",\"ρ\":\"r\",\"ς\":\"s\",\"σ\":\"s\",\"τ\":\"t\",\"υ\":\"y\",\"φ\":\"f\",\"χ\":\"x\",\"ψ\":\"ps\",\"ω\":\"w\",\"ϊ\":\"i\",\"ϋ\":\"y\",\"ό\":\"o\",\"ύ\":\"y\",\"ώ\":\"w\",\"Ё\":\"Yo\",\"Ђ\":\"DJ\",\"Є\":\"Ye\",\"І\":\"I\",\"Ї\":\"Yi\",\"Ј\":\"J\",\"Љ\":\"LJ\",\"Њ\":\"NJ\",\"Ћ\":\"C\",\"Џ\":\"DZ\",\"А\":\"A\",\"Б\":\"B\",\"В\":\"V\",\"Г\":\"G\",\"Д\":\"D\",\"Е\":\"E\",\"Ж\":\"Zh\",\"З\":\"Z\",\"И\":\"I\",\"Й\":\"J\",\"К\":\"K\",\"Л\":\"L\",\"М\":\"M\",\"Н\":\"N\",\"О\":\"O\",\"П\":\"P\",\"Р\":\"R\",\"С\":\"S\",\"Т\":\"T\",\"У\":\"U\",\"Ф\":\"F\",\"Х\":\"H\",\"Ц\":\"C\",\"Ч\":\"Ch\",\"Ш\":\"Sh\",\"Щ\":\"Sh\",\"Ъ\":\"U\",\"Ы\":\"Y\",\"Ь\":\"\",\"Э\":\"E\",\"Ю\":\"Yu\",\"Я\":\"Ya\",\"а\":\"a\",\"б\":\"b\",\"в\":\"v\",\"г\":\"g\",\"д\":\"d\",\"е\":\"e\",\"ж\":\"zh\",\"з\":\"z\",\"и\":\"i\",\"й\":\"j\",\"к\":\"k\",\"л\":\"l\",\"м\":\"m\",\"н\":\"n\",\"о\":\"o\",\"п\":\"p\",\"р\":\"r\",\"с\":\"s\",\"т\":\"t\",\"у\":\"u\",\"ф\":\"f\",\"х\":\"h\",\"ц\":\"c\",\"ч\":\"ch\",\"ш\":\"sh\",\"щ\":\"sh\",\"ъ\":\"u\",\"ы\":\"y\",\"ь\":\"\",\"э\":\"e\",\"ю\":\"yu\",\"я\":\"ya\",\"ё\":\"yo\",\"ђ\":\"dj\",\"є\":\"ye\",\"і\":\"i\",\"ї\":\"yi\",\"ј\":\"j\",\"љ\":\"lj\",\"њ\":\"nj\",\"ћ\":\"c\",\"ѝ\":\"u\",\"џ\":\"dz\",\"Ґ\":\"G\",\"ґ\":\"g\",\"Ғ\":\"GH\",\"ғ\":\"gh\",\"Қ\":\"KH\",\"қ\":\"kh\",\"Ң\":\"NG\",\"ң\":\"ng\",\"Ү\":\"UE\",\"ү\":\"ue\",\"Ұ\":\"U\",\"ұ\":\"u\",\"Һ\":\"H\",\"һ\":\"h\",\"Ә\":\"AE\",\"ә\":\"ae\",\"Ө\":\"OE\",\"ө\":\"oe\",\"Ա\":\"A\",\"Բ\":\"B\",\"Գ\":\"G\",\"Դ\":\"D\",\"Ե\":\"E\",\"Զ\":\"Z\",\"Է\":\"E'\",\"Ը\":\"Y'\",\"Թ\":\"T'\",\"Ժ\":\"JH\",\"Ի\":\"I\",\"Լ\":\"L\",\"Խ\":\"X\",\"Ծ\":\"C'\",\"Կ\":\"K\",\"Հ\":\"H\",\"Ձ\":\"D'\",\"Ղ\":\"GH\",\"Ճ\":\"TW\",\"Մ\":\"M\",\"Յ\":\"Y\",\"Ն\":\"N\",\"Շ\":\"SH\",\"Չ\":\"CH\",\"Պ\":\"P\",\"Ջ\":\"J\",\"Ռ\":\"R'\",\"Ս\":\"S\",\"Վ\":\"V\",\"Տ\":\"T\",\"Ր\":\"R\",\"Ց\":\"C\",\"Փ\":\"P'\",\"Ք\":\"Q'\",\"Օ\":\"O''\",\"Ֆ\":\"F\",\"և\":\"EV\",\"ء\":\"a\",\"آ\":\"aa\",\"أ\":\"a\",\"ؤ\":\"u\",\"إ\":\"i\",\"ئ\":\"e\",\"ا\":\"a\",\"ب\":\"b\",\"ة\":\"h\",\"ت\":\"t\",\"ث\":\"th\",\"ج\":\"j\",\"ح\":\"h\",\"خ\":\"kh\",\"د\":\"d\",\"ذ\":\"th\",\"ر\":\"r\",\"ز\":\"z\",\"س\":\"s\",\"ش\":\"sh\",\"ص\":\"s\",\"ض\":\"dh\",\"ط\":\"t\",\"ظ\":\"z\",\"ع\":\"a\",\"غ\":\"gh\",\"ف\":\"f\",\"ق\":\"q\",\"ك\":\"k\",\"ل\":\"l\",\"م\":\"m\",\"ن\":\"n\",\"ه\":\"h\",\"و\":\"w\",\"ى\":\"a\",\"ي\":\"y\",\"ً\":\"an\",\"ٌ\":\"on\",\"ٍ\":\"en\",\"َ\":\"a\",\"ُ\":\"u\",\"ِ\":\"e\",\"ْ\":\"\",\"٠\":\"0\",\"١\":\"1\",\"٢\":\"2\",\"٣\":\"3\",\"٤\":\"4\",\"٥\":\"5\",\"٦\":\"6\",\"٧\":\"7\",\"٨\":\"8\",\"٩\":\"9\",\"پ\":\"p\",\"چ\":\"ch\",\"ژ\":\"zh\",\"ک\":\"k\",\"گ\":\"g\",\"ی\":\"y\",\"۰\":\"0\",\"۱\":\"1\",\"۲\":\"2\",\"۳\":\"3\",\"۴\":\"4\",\"۵\":\"5\",\"۶\":\"6\",\"۷\":\"7\",\"۸\":\"8\",\"۹\":\"9\",\"฿\":\"baht\",\"ა\":\"a\",\"ბ\":\"b\",\"გ\":\"g\",\"დ\":\"d\",\"ე\":\"e\",\"ვ\":\"v\",\"ზ\":\"z\",\"თ\":\"t\",\"ი\":\"i\",\"კ\":\"k\",\"ლ\":\"l\",\"მ\":\"m\",\"ნ\":\"n\",\"ო\":\"o\",\"პ\":\"p\",\"ჟ\":\"zh\",\"რ\":\"r\",\"ს\":\"s\",\"ტ\":\"t\",\"უ\":\"u\",\"ფ\":\"f\",\"ქ\":\"k\",\"ღ\":\"gh\",\"ყ\":\"q\",\"შ\":\"sh\",\"ჩ\":\"ch\",\"ც\":\"ts\",\"ძ\":\"dz\",\"წ\":\"ts\",\"ჭ\":\"ch\",\"ხ\":\"kh\",\"ჯ\":\"j\",\"ჰ\":\"h\",\"Ṣ\":\"S\",\"ṣ\":\"s\",\"Ẁ\":\"W\",\"ẁ\":\"w\",\"Ẃ\":\"W\",\"ẃ\":\"w\",\"Ẅ\":\"W\",\"ẅ\":\"w\",\"ẞ\":\"SS\",\"Ạ\":\"A\",\"ạ\":\"a\",\"Ả\":\"A\",\"ả\":\"a\",\"Ấ\":\"A\",\"ấ\":\"a\",\"Ầ\":\"A\",\"ầ\":\"a\",\"Ẩ\":\"A\",\"ẩ\":\"a\",\"Ẫ\":\"A\",\"ẫ\":\"a\",\"Ậ\":\"A\",\"ậ\":\"a\",\"Ắ\":\"A\",\"ắ\":\"a\",\"Ằ\":\"A\",\"ằ\":\"a\",\"Ẳ\":\"A\",\"ẳ\":\"a\",\"Ẵ\":\"A\",\"ẵ\":\"a\",\"Ặ\":\"A\",\"ặ\":\"a\",\"Ẹ\":\"E\",\"ẹ\":\"e\",\"Ẻ\":\"E\",\"ẻ\":\"e\",\"Ẽ\":\"E\",\"ẽ\":\"e\",\"Ế\":\"E\",\"ế\":\"e\",\"Ề\":\"E\",\"ề\":\"e\",\"Ể\":\"E\",\"ể\":\"e\",\"Ễ\":\"E\",\"ễ\":\"e\",\"Ệ\":\"E\",\"ệ\":\"e\",\"Ỉ\":\"I\",\"ỉ\":\"i\",\"Ị\":\"I\",\"ị\":\"i\",\"Ọ\":\"O\",\"ọ\":\"o\",\"Ỏ\":\"O\",\"ỏ\":\"o\",\"Ố\":\"O\",\"ố\":\"o\",\"Ồ\":\"O\",\"ồ\":\"o\",\"Ổ\":\"O\",\"ổ\":\"o\",\"Ỗ\":\"O\",\"ỗ\":\"o\",\"Ộ\":\"O\",\"ộ\":\"o\",\"Ớ\":\"O\",\"ớ\":\"o\",\"Ờ\":\"O\",\"ờ\":\"o\",\"Ở\":\"O\",\"ở\":\"o\",\"Ỡ\":\"O\",\"ỡ\":\"o\",\"Ợ\":\"O\",\"ợ\":\"o\",\"Ụ\":\"U\",\"ụ\":\"u\",\"Ủ\":\"U\",\"ủ\":\"u\",\"Ứ\":\"U\",\"ứ\":\"u\",\"Ừ\":\"U\",\"ừ\":\"u\",\"Ử\":\"U\",\"ử\":\"u\",\"Ữ\":\"U\",\"ữ\":\"u\",\"Ự\":\"U\",\"ự\":\"u\",\"Ỳ\":\"Y\",\"ỳ\":\"y\",\"Ỵ\":\"Y\",\"ỵ\":\"y\",\"Ỷ\":\"Y\",\"ỷ\":\"y\",\"Ỹ\":\"Y\",\"ỹ\":\"y\",\"–\":\"-\",\"‘\":\"'\",\"’\":\"'\",\"“\":\"\\\"\",\"”\":\"\\\"\",\"„\":\"\\\"\",\"†\":\"+\",\"•\":\"*\",\"…\":\"...\",\"₠\":\"ecu\",\"₢\":\"cruzeiro\",\"₣\":\"french franc\",\"₤\":\"lira\",\"₥\":\"mill\",\"₦\":\"naira\",\"₧\":\"peseta\",\"₨\":\"rupee\",\"₩\":\"won\",\"₪\":\"new shequel\",\"₫\":\"dong\",\"€\":\"euro\",\"₭\":\"kip\",\"₮\":\"tugrik\",\"₯\":\"drachma\",\"₰\":\"penny\",\"₱\":\"peso\",\"₲\":\"guarani\",\"₳\":\"austral\",\"₴\":\"hryvnia\",\"₵\":\"cedi\",\"₸\":\"kazakhstani tenge\",\"₹\":\"indian rupee\",\"₺\":\"turkish lira\",\"₽\":\"russian ruble\",\"₿\":\"bitcoin\",\"℠\":\"sm\",\"™\":\"tm\",\"∂\":\"d\",\"∆\":\"delta\",\"∑\":\"sum\",\"∞\":\"infinity\",\"♥\":\"love\",\"元\":\"yuan\",\"円\":\"yen\",\"﷼\":\"rial\",\"ﻵ\":\"laa\",\"ﻷ\":\"laa\",\"ﻹ\":\"lai\",\"ﻻ\":\"la\"}"), t = JSON.parse("{\"bg\":{\"Й\":\"Y\",\"Ц\":\"Ts\",\"Щ\":\"Sht\",\"Ъ\":\"A\",\"Ь\":\"Y\",\"й\":\"y\",\"ц\":\"ts\",\"щ\":\"sht\",\"ъ\":\"a\",\"ь\":\"y\"},\"de\":{\"Ä\":\"AE\",\"ä\":\"ae\",\"Ö\":\"OE\",\"ö\":\"oe\",\"Ü\":\"UE\",\"ü\":\"ue\",\"ß\":\"ss\",\"%\":\"prozent\",\"&\":\"und\",\"|\":\"oder\",\"∑\":\"summe\",\"∞\":\"unendlich\",\"♥\":\"liebe\"},\"es\":{\"%\":\"por ciento\",\"&\":\"y\",\"<\":\"menor que\",\">\":\"mayor que\",\"|\":\"o\",\"¢\":\"centavos\",\"£\":\"libras\",\"¤\":\"moneda\",\"₣\":\"francos\",\"∑\":\"suma\",\"∞\":\"infinito\",\"♥\":\"amor\"},\"fr\":{\"%\":\"pourcent\",\"&\":\"et\",\"<\":\"plus petit\",\">\":\"plus grand\",\"|\":\"ou\",\"¢\":\"centime\",\"£\":\"livre\",\"¤\":\"devise\",\"₣\":\"franc\",\"∑\":\"somme\",\"∞\":\"infini\",\"♥\":\"amour\"},\"pt\":{\"%\":\"porcento\",\"&\":\"e\",\"<\":\"menor\",\">\":\"maior\",\"|\":\"ou\",\"¢\":\"centavo\",\"∑\":\"soma\",\"£\":\"libra\",\"∞\":\"infinito\",\"♥\":\"amor\"},\"uk\":{\"И\":\"Y\",\"и\":\"y\",\"Й\":\"Y\",\"й\":\"y\",\"Ц\":\"Ts\",\"ц\":\"ts\",\"Х\":\"Kh\",\"х\":\"kh\",\"Щ\":\"Shch\",\"щ\":\"shch\",\"Г\":\"H\",\"г\":\"h\"},\"vi\":{\"Đ\":\"D\",\"đ\":\"d\"},\"da\":{\"Ø\":\"OE\",\"ø\":\"oe\",\"Å\":\"AA\",\"å\":\"aa\",\"%\":\"procent\",\"&\":\"og\",\"|\":\"eller\",\"$\":\"dollar\",\"<\":\"mindre end\",\">\":\"større end\"},\"nb\":{\"&\":\"og\",\"Å\":\"AA\",\"Æ\":\"AE\",\"Ø\":\"OE\",\"å\":\"aa\",\"æ\":\"ae\",\"ø\":\"oe\"},\"it\":{\"&\":\"e\"},\"nl\":{\"&\":\"en\"},\"sv\":{\"&\":\"och\",\"Å\":\"AA\",\"Ä\":\"AE\",\"Ö\":\"OE\",\"å\":\"aa\",\"ä\":\"ae\",\"ö\":\"oe\"}}");
		function n(n, r) {
			if (typeof n != "string") throw Error("slugify: string argument expected");
			r = typeof r == "string" ? { replacement: r } : r || {};
			var i = t[r.locale] || {}, a = r.replacement === void 0 ? "-" : r.replacement, o = r.trim === void 0 || r.trim, s = n.normalize().split("").reduce(function(t, n) {
				var o = i[n];
				return o === void 0 && (o = e[n]), o === void 0 && (o = n), o === a && (o = " "), t + o.replace(r.remove || /[^\w\s$*_+~.()'"!\-:@]+/g, "");
			}, "");
			return r.strict && (s = s.replace(/[^A-Za-z0-9\s]/g, "")), o && (s = s.trim()), s = s.replace(/\s+/g, a), r.lower && (s = s.toLowerCase()), s;
		}
		return n.extend = function(t) {
			Object.assign(e, t);
		}, n;
	});
})))(), 1), Lo = /* @__PURE__ */ new Set();
function Ro(e) {
	let t = 0, n = (0, Io.default)(e, {
		remove: /[*+~.()'"!:@]/g,
		lower: !0
	}), r;
	do
		r = n + (t++ > 0 || !n ? t : "");
	while (Lo.has(r));
	return Lo.add(r), r;
}
//#endregion
//#region src/utils/urlEncoding.ts
function zo(e) {
	if (!e || e.length === 0) return "";
	let t = e.map((e) => encodeURIComponent(e.trim())).join(",");
	return P.log("URLEncoding: encoding string array:", {
		original: e,
		encoded: t
	}), t;
}
function Bo(e) {
	if (!e) return [];
	try {
		let t = e.split(",").map((e) => decodeURIComponent(e.trim())).filter(Boolean);
		return P.log("URLEncoding: decoding string array:", {
			encoded: e,
			decoded: t
		}), t;
	} catch (t) {
		return P.warn("URLEncoding: failed to decode string array:", e, t), [];
	}
}
function Vo(e) {
	if (!e) return null;
	let t = encodeURIComponent(e.trim());
	return P.log("URLEncoding: encoding string:", {
		original: e,
		encoded: t
	}), t;
}
function Ho(e) {
	if (!e) return null;
	try {
		let t = decodeURIComponent(e.trim());
		return P.log("URLEncoding: decoding string:", {
			encoded: e,
			decoded: t
		}), t;
	} catch (t) {
		return P.warn("URLEncoding: failed to decode string:", e, t), null;
	}
}
function Uo(e) {
	return e.map((e) => e.toLowerCase());
}
function Wo(e) {
	return e ? e.toLowerCase() : null;
}
//#endregion
//#region src/utils/index.ts
function Go(e) {
	return e * parseFloat(getComputedStyle(document.documentElement).fontSize);
}
function Ko(e, t) {
	let n = [];
	for (let r = 0; r < e.length; r += t) n.push(e.slice(r, r + t));
	return n;
}
function qo(e) {
	e.sort(function(e, t) {
		var n = e.name.toLowerCase(), r = t.name.toLowerCase();
		return n < r ? -1 : +(n > r);
	});
}
var Jo = document.createElement("canvas"), Yo = !!(Jo.getContext("webgl") || Jo.getContext("experimental-webgl"));
if (!Yo) {
	let e = document.createElement("div");
	e.innerHTML = "<!--no webgl-->", document.body.appendChild(e);
}
function Xo(e) {
	for (var t = e.length, n, r; t !== 0;) r = Math.floor(Math.random() * t), --t, n = e[t], e[t] = e[r], e[r] = n;
	return e;
}
//#endregion
//#region src/utils/areLayersEnabled.ts
function Zo() {
	return !!oo().__fpLayers;
}
//#endregion
//#region src/utils/entity-storage.ts
var Qo = {};
function $o(e) {
	return `${vo.EXPO}-${e}`;
}
function es(e) {
	return e;
}
function ts(e) {
	return e === "bookmarked" ? {
		exhibitors: [],
		events: [],
		speakers: [],
		booths: []
	} : {
		exhibitors: [],
		events: []
	};
}
function ns(e, t) {
	if (typeof t != "object" || !t) return P.log(`Invalid ${e} data in localStorage - using defaults`), ts(e);
	if (Array.isArray(t)) {
		let n = e === "bookmarked" ? {
			exhibitors: t,
			events: [],
			speakers: [],
			booths: []
		} : {
			exhibitors: t,
			events: []
		};
		return P.log(`Migrated ${e} data from array to object format`), is(e, n), n;
	}
	if (e === "bookmarked") {
		let n = t, r = { ...n };
		return "speakers" in r || (r.speakers = []), "booths" in r || (r.booths = []), (!n.speakers || !n.booths) && (P.log(`Migrated ${e} data (added speakers or booths field)`), is(e, r)), r;
	}
	return e === "visited" ? t : (P.log(`Unsupported ${e} data format - using defaults`), ts(e));
}
function rs(e) {
	if (Qo[e]) return Qo[e];
	let t = ts(e);
	if (!A) return P.warn(`localStorage unavailable — using default for ${e}`), Qo[e] = t, t;
	let n = $o(e), r = es(e), i = null;
	try {
		var a;
		i = (a = localStorage.getItem(n)) == null ? localStorage.getItem(r) : a;
	} catch (t) {
		P.warn(`localStorage access error for ${e}`, t);
	}
	if (!i) return Qo[e] = t, t;
	try {
		let t = ns(e, JSON.parse(i));
		return Qo[e] = t, t;
	} catch (n) {
		return P.error(`Error parsing ${e} data`, n), Qo[e] = t, t;
	}
}
function is(e, t) {
	if (!A) return;
	let n = $o(e);
	try {
		localStorage.setItem(n, JSON.stringify(t)), Qo[e] = t;
		let r = {
			exhibitors: t.exhibitors.length,
			events: t.events.length
		};
		t.speakers && (r.speakers = t.speakers.length), t.booths && (r.booths = t.booths.length), P.log(`save${e[0].toUpperCase() + e.slice(1)}ToLocalStorage`, r);
	} catch (t) {
		P.error(`Failed to save ${e} data`, t);
	}
}
//#endregion
//#region src/store/BoothStore.ts
var as, os, ss, cs, ls, us, ds, fs, ps, ms, hs, gs, _s, vs, ys, bs, xs, Ss;
function Cs(e, t, n, r) {
	n && Object.defineProperty(e, t, {
		enumerable: n.enumerable,
		configurable: n.configurable,
		writable: n.writable,
		value: n.initializer ? n.initializer.call(r) : void 0
	});
}
function ws(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var Ts = (hs = j({ keepAlive: !0 }), gs = j({ keepAlive: !0 }), _s = j({ keepAlive: !0 }), vs = j({ keepAlive: !0 }), ys = j({ keepAlive: !0 }), bs = class {
	get boothById() {
		return new Map(this.booths.map((e) => [e.id, e]));
	}
	get boothByExternalId() {
		return new Map(this.booths.map((e) => [e.externalId, e]));
	}
	get boothByName() {
		return new Map(this.booths.map((e) => [e.name.toLowerCase(), e]));
	}
	get boothBySlug() {
		return new Map(this.booths.map((e) => [e.slug, e]));
	}
	get borderWidth() {
		if (vo.boothBorderWidth) return vo.boothBorderWidth;
		if (vo.EXPO === "groomexpo") return .4;
		let e = this.booths.filter((e) => e.rect).map((e) => e.rect.size.width + e.rect.size.height);
		return e.reduce((e, t) => e + t, 0) / e.length / 80;
	}
	constructor(e) {
		this.rootStore = void 0, Cs(this, "booths", xs, this), Cs(this, "highlightedByExternalIds", Ss, this), this.rootStore = e;
	}
	get bookmarked() {
		return this.booths.filter((e) => e.bookmarkedDirectly);
	}
	getNearestBooth(e) {
		var t = null;
		let n = this.booths.map((t) => ({
			lineLength: Yn(e, t.rect.center),
			name: t.name
		})).sort((e, t) => e.lineLength - t.lineLength)[0];
		return t = this.booths.find((e) => e.name === n.name), t;
	}
	getBoothAtPoint(e) {
		return this.booths.find((t) => t.rect.containsPoint(e));
	}
	findBooth(e) {
		return this.boothByExternalId.get(e) || this.boothByName.get(e.toLowerCase()) || this.boothBySlug.get(e);
	}
	replaceBookmarked(e) {
		let t = (e || []).map((e) => this.boothById.get(e)).filter((e) => e), n = new Set(t), r = this.bookmarked.filter((e) => !n.has(e));
		for (let e of r) e.bookmarkedDirectly = !1;
		for (let e of t) e.bookmarkedDirectly = !0;
	}
}, xs = ws(bs.prototype, "booths", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return [];
	}
}), Ss = ws(bs.prototype, "highlightedByExternalIds", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return [];
	}
}), ws(bs.prototype, "boothById", [hs], Object.getOwnPropertyDescriptor(bs.prototype, "boothById"), bs.prototype), ws(bs.prototype, "boothByExternalId", [gs], Object.getOwnPropertyDescriptor(bs.prototype, "boothByExternalId"), bs.prototype), ws(bs.prototype, "boothByName", [_s], Object.getOwnPropertyDescriptor(bs.prototype, "boothByName"), bs.prototype), ws(bs.prototype, "boothBySlug", [vs], Object.getOwnPropertyDescriptor(bs.prototype, "boothBySlug"), bs.prototype), ws(bs.prototype, "borderWidth", [ys], Object.getOwnPropertyDescriptor(bs.prototype, "borderWidth"), bs.prototype), ws(bs.prototype, "bookmarked", [j], Object.getOwnPropertyDescriptor(bs.prototype, "bookmarked"), bs.prototype), ws(bs.prototype, "replaceBookmarked", [C], Object.getOwnPropertyDescriptor(bs.prototype, "replaceBookmarked"), bs.prototype), bs), Es = (as = j({ keepAlive: !0 }), os = j({ keepAlive: !0 }), ss = j({ keepAlive: !0 }), cs = j({ keepAlive: !0 }), ls = j({ keepAlive: !0 }), us = j({ keepAlive: !0 }), ds = j({ keepAlive: !0 }), fs = class {
	constructor() {
		this.store = void 0, this.id = void 0, this.name = void 0, this.externalId = void 0, this.title = void 0, this.rect = void 0, this.borderWidth = void 0, this.borderColor = void 0, this.noLabels = void 0, this.rotate = void 0, this.elevation = void 0, this.paths = void 0, this.pathsWithRect = void 0, this.slug = void 0, this.error = void 0, this.description = void 0, this.exhibitors = void 0, this.labelColor = void 0, this.schedule = void 0, this.poiTypeId = void 0, this.poiType = void 0, this.poiIcon = void 0, this.meta = void 0, Cs(this, "layer", ps, this), Cs(this, "bookmarkedDirectly", ms, this);
	}
	get bookmarked() {
		var e;
		return $.disableBookmarked ? !1 : (e = this.schedule) != null && e.some((e) => e.bookmarked) ? !0 : this.exhibitors.length > 0 ? !!this.exhibitors.find((e) => e.bookmarked) : this.bookmarkedDirectly;
	}
	get uiState() {
		return this.store.rootStore.uiState;
	}
	get fullName() {
		let e = this.meta ? Object.entries(this.meta).filter(([e]) => !e.startsWith("_")).map(([e, t]) => `${e} ${t}`).join(" ") : "";
		return `${this.name} ${e}`.replace(/\s+/g, " ").trim();
	}
	get visible() {
		var e, t;
		return (e = (t = this.layer) == null ? void 0 : t.visible) == null || e;
	}
	get hover() {
		return this.uiState.hoveredBooths.has(this);
	}
	get selected() {
		return this.uiState.selectedBooths.has(this);
	}
	get skipDim() {
		return this.uiState.highlightedBooths.has(this.id.toString());
	}
}, ps = ws(fs.prototype, "layer", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: null
}), ms = ws(fs.prototype, "bookmarkedDirectly", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), ws(fs.prototype, "bookmarked", [as], Object.getOwnPropertyDescriptor(fs.prototype, "bookmarked"), fs.prototype), ws(fs.prototype, "uiState", [os], Object.getOwnPropertyDescriptor(fs.prototype, "uiState"), fs.prototype), ws(fs.prototype, "fullName", [ss], Object.getOwnPropertyDescriptor(fs.prototype, "fullName"), fs.prototype), ws(fs.prototype, "visible", [cs], Object.getOwnPropertyDescriptor(fs.prototype, "visible"), fs.prototype), ws(fs.prototype, "hover", [ls], Object.getOwnPropertyDescriptor(fs.prototype, "hover"), fs.prototype), ws(fs.prototype, "selected", [us], Object.getOwnPropertyDescriptor(fs.prototype, "selected"), fs.prototype), ws(fs.prototype, "skipDim", [ds], Object.getOwnPropertyDescriptor(fs.prototype, "skipDim"), fs.prototype), fs), Ds = class extends Es {
	constructor(...e) {
		super(...e), this.buyUrl = void 0, this.reserveUrl = void 0, this.type = void 0, this.status = void 0, this.price = void 0, this.entity = {
			type: "booth",
			variant: "regular"
		}, this.size = void 0, this.availColor = void 0, this.soldColor = void 0, this.holdColor = void 0, this.onHold = void 0, this.reserved = void 0, this.shapes = void 0;
	}
}, Os = class extends Es {
	constructor(...e) {
		super(...e), this.color = void 0, this.shapes = void 0, this.entity = {
			type: "booth",
			variant: "special"
		};
	}
}, ks = /* @__PURE__ */ e(ai(), 1), As = /* @__PURE__ */ new Map(), js = [];
function Ms(e) {
	As.clear(), js.length = 0;
	for (let n of z.booths || []) {
		var t;
		let { text: r, meta: i } = yo(n.name), a = n.special ? new Os() : new Ds();
		Object.assign(a, n), a.meta = i, a.slug = Ro(a.name), As.set(a.name.toLowerCase(), a), Fs(a);
		let o = a;
		o.exhibitors = [];
		for (let r of (t = n.exhibitors) == null ? [] : t) {
			let t = e.exhibitorStore.exhibitorById.get(r);
			t && (o.exhibitors.push(t), t.booths.push(o));
		}
		a.schedule = e.eventStore.eventItems.filter((e) => e.boothId === a.id), a.name = r, js.push(a);
	}
	js.sort((e, t) => e.name.localeCompare(t.name, void 0, {
		sensitivity: "base",
		numeric: !0
	}));
	for (let t of e.exhibitorStore.exhibitors) qo(t.booths);
	e.boothStore.booths = js, P.log("initBooths", e.boothStore.booths.length), Ns(e);
}
function Ns(e) {
	let t = (rs("bookmarked").booths || []).filter((t) => {
		let n = e.boothStore.boothById.get(t);
		return n && n.exhibitors.length === 0;
	});
	e.boothStore.replaceBookmarked(t), T(() => {
		let t = rs("bookmarked"), n = e.boothStore.booths.filter((e) => e.exhibitors.length === 0 && e.bookmarkedDirectly).map((e) => e.id);
		is("bookmarked", {
			exhibitors: t.exhibitors,
			events: t.events,
			speakers: t.speakers,
			booths: n
		});
	});
}
function Ps(e, t) {
	let n = t.name, { boothStore: r, layerStore: i } = e, a = [], o = Zo(), s = io(Mo(t)).selectAll(`[data-layer='${n}'] > [data-tagname='efp-booth'], [data-layer='${n}'] > g[id^=b], [data-layer='${n}'] > rect[id^=b]`).nodes();
	for (let t of s) {
		let s = t.closest("svg > [data-layer]").getAttribute("data-layer");
		if (!s) continue;
		let d, f = !1;
		t.tagName === "rect" ? d = t : (d = Array.from(t.children).find((e) => e.tagName === "rect"), f = d === t.firstElementChild);
		let p = t.id || t.getAttribute("data-name");
		if (!p) {
			P.error("SVG booth element has neither id nor data-name:", t);
			continue;
		}
		let m = p.substring(1).toLowerCase(), h = As.get(m), g = h instanceof Ds ? h : null, _ = h instanceof Os ? h : null;
		if (h ? a.push(h) : (P.error("SVG booth rect not found in the event data:", m), h = g = new Ds(), h.id = Fo(), h.name = m.toUpperCase(), h.slug = Ro(m), h.error = !0, h.exhibitors = [], As.set(m, h), a.push(h)), h.layer = o ? i.layers.find((e) => e.name === s) : null, h.borderColor = (d == null ? void 0 : d.getAttribute("stroke")) || (d == null ? void 0 : d.style.stroke) || vo.boothBorderColor || "#FFFFFF", h.borderWidth = parseFloat((d == null ? void 0 : d.getAttribute("stroke-width")) || (d == null ? void 0 : d.style.strokeWidth)), isNaN(h.borderWidth) && (h.borderWidth = r.borderWidth), !$.heatmap) h.labelColor = d == null ? void 0 : d.getAttribute("data-label-color");
		else {
			let t = e.heatmapStore.getTotalClicksByBooth(h), n = (0, ks.default)(e.heatmapStore.getColorByClicks(t));
			h.labelColor = n.darken(.3).isLight() ? "#555" : "#fff";
		}
		if (h.rect = d ? Er.fromSvg(d) : null, h.elevation = parseFloat(d == null ? void 0 : d.dataset.elev) || 0, h.noLabels = !!(d != null && d.dataset.nolabel) || (d == null ? void 0 : d.id.startsWith("no")), g) g.availColor = t.getAttribute("data-avail-color") || (d == null ? void 0 : d.getAttribute("data-avail-color")) || g.availColor, g.soldColor = t.getAttribute("data-sold-color") || (d == null ? void 0 : d.getAttribute("data-sold-color")) || g.soldColor, g.holdColor = t.getAttribute("data-hold-color") || (d == null ? void 0 : d.getAttribute("data-hold-color")) || g.holdColor, g.size = z.dimensionless ? null : g.size || t.getAttribute("data-size"), g.status === "reserved" ? g.reserved = !0 : g.status === "onhold" && (g.onHold = !0);
		else if (_) {
			var c, l;
			_.color = (parseInt((c = d.getAttribute("data-poi-type")) == null ? "" : c) > 0 ? (l = d.style) == null ? void 0 : l.fill : t.getAttribute("data-color") || d.getAttribute("data-color")) || _.color;
		}
		let v = d == null ? void 0 : d.getAttribute("transform");
		if (v) {
			let e = v.match(/translate\(([-0-9.]+) ([-0-9.]+)\) rotate\(([-0-9.]+)\)/);
			if (e) {
				let t = parseFloat(e[3]);
				h.rotate = Hn(t);
			} else {
				let e = v.match(/rotate\(([-0-9.]+).*\)/);
				if (e) {
					let t = parseFloat(e[1]);
					h.rotate = Hn(t);
				} else {
					let e = v.match(/matrix\(\s*([-0-9.]+)\s*(?:,|\s)\s*([-0-9.]+)\s*(?:,|\s)\s*([-0-9.]+)\s*(?:,|\s)\s*([-0-9.]+)\s*(?:,|\s)\s*([-0-9.]+)\s*(?:,|\s)\s*([-0-9.]+)\s*\)/);
					e && (h.rotate = Math.asin(parseFloat(e[2])));
				}
			}
			if (Math.abs(Un(h.rotate)) > 180) {
				h.rotate += Hn(90);
				let e = h.rect;
				h.rect = new Er(e.center.x - e.size.height / 2, e.center.y - e.size.width / 2, e.size.height, e.size.width);
			}
		}
		if (t.tagName === "g") {
			h.paths = [], h.pathsWithRect = f;
			let e = [];
			for (let r of io(t).selectAll("path, rect").nodes()) if (r.tagName === "path") {
				var u;
				let t = r;
				if (t.tagName !== "path") continue;
				let i = parseInt((u = t.getAttribute("data-index")) == null ? "" : u), a = !!t.getAttribute("data-unblinking");
				h.paths.push({
					index: i,
					color: t.style.fill,
					unblinking: a
				}), d || e.push(...Ao(i, n));
			}
			if (e.length) {
				let t = e.flatMap((e) => e.map((e) => ({
					x: e[0],
					y: e[1]
				})));
				h.rect = Er.fromPoints(t), h.noLabels = !0;
			}
		}
	}
	let d = a.filter((e) => e.rect ? !0 : (P.error("event data booth not found in SVG:", e.name, e), !1));
	for (let e of d) e.store = r;
	return d;
}
function Fs(e) {
	vo.EXPO === "cbresupplypartner" && e instanceof Ds && !e.availColor && e.type && (e.type.indexOf("Premium A - 2m height restriction Passport") === -1 ? e.type.indexOf("No free-standing") === -1 ? e.type.endsWith("Passport") ? e.availColor = "#939393" : e.type.startsWith("Premium A - 2m") ? e.availColor = "#FF9E4E" : e.type.startsWith("Premium A - 4m") ? e.availColor = "#EA4335" : e.type.startsWith("Premium B - 2m") ? e.availColor = "#523BC0" : e.type.startsWith("Premium C - 2.4m") && (e.availColor = "#3ECC78") : e.availColor = "#BA3DC8" : e.availColor = "#939393");
}
//#endregion
//#region src/store/CategoryStore.ts
var Is, Ls;
function Rs(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var zs = (Is = j({ keepAlive: !0 }), Ls = class {
	get categoryById() {
		return new Map(this.categories.map((e) => [e.id, e]));
	}
	get seminarsCategory() {
		return this.categories.find((e) => e.slug === "seminars");
	}
	constructor(e) {
		this.rootStore = void 0, this.categories = [], this.rootStore = e;
	}
}, Rs(Ls.prototype, "categoryById", [Is], Object.getOwnPropertyDescriptor(Ls.prototype, "categoryById"), Ls.prototype), Rs(Ls.prototype, "seminarsCategory", [j], Object.getOwnPropertyDescriptor(Ls.prototype, "seminarsCategory"), Ls.prototype), Ls), Bs = class {
	constructor() {
		this.store = void 0, this.id = void 0, this.name = void 0, this.slug = void 0, this.sponsorship = void 0, this.exhibitors = void 0, this.entity = { type: "category" };
	}
};
//#endregion
//#region src/store/init/init-categories.ts
function Vs(e) {
	let { categoryStore: t, exhibitorStore: n } = e;
	for (let e of z.categories || []) {
		let r = new Bs();
		Object.assign(r, e), r.exhibitors = [], r.slug = Ro(r.name);
		for (let t of z.exhibitors || []) if (t.categories.filter((t) => t === e.id)[0]) {
			let e = n.exhibitorById.get(t.id);
			e.categories.push(r), r.exhibitors.push(e);
		}
		r.store = t, t.categories.push(r);
	}
	P.log("initCategories", t.categories.length);
}
//#endregion
//#region src/store/EventStore.ts
var Hs, Us, Ws, Gs;
function Ks(e, t, n, r) {
	n && Object.defineProperty(e, t, {
		enumerable: n.enumerable,
		configurable: n.configurable,
		writable: n.writable,
		value: n.initializer ? n.initializer.call(r) : void 0
	});
}
function qs(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var Js = (Gs = class {
	constructor(e) {
		this.rootStore = void 0, this.eventItems = [], this.rootStore = e;
	}
	findByNameOrSlug(e) {
		return this.eventItems.find((t) => t.name === e || t.slug === e || t.externalId === e);
	}
	get bookmarked() {
		return this.eventItems.filter((e) => e.bookmarked);
	}
	get visited() {
		return this.eventItems.filter((e) => e.visited);
	}
	get tracks() {
		let e = /* @__PURE__ */ new Map();
		return this.eventItems.forEach((t) => {
			t.tracks.forEach((t) => {
				e.set(t.id, t);
			});
		}), Array.from(e.values()).sort((e, t) => e.name.localeCompare(t.name));
	}
	getEventsByTrack(e) {
		return this.eventItems.filter((t) => t.tracks.some((t) => t.id === e));
	}
	getEventsBySpeaker(e) {
		return this.eventItems.filter((t) => t.speakers.some((t) => t.id === e));
	}
	get venues() {
		let e = /* @__PURE__ */ new Map();
		return this.eventItems.forEach((t) => {
			if (t.boothId) {
				let n = this.rootStore.boothStore.booths.find((e) => e.id === t.boothId);
				n && e.set(n.id, n);
			}
		}), Array.from(e.values()).sort((e, t) => e.name.localeCompare(t.name));
	}
	getEventsByVenue(e) {
		return this.eventItems.filter((t) => t.boothId === e);
	}
	get pastEvents() {
		let e = /* @__PURE__ */ new Date();
		return this.eventItems.filter((t) => new Date(t.endDate) < e);
	}
	get futureEvents() {
		let e = /* @__PURE__ */ new Date();
		return this.eventItems.filter((t) => new Date(t.startDate) > e);
	}
	get liveEvents() {
		let e = /* @__PURE__ */ new Date();
		return this.eventItems.filter((t) => {
			let n = new Date(t.startDate), r = new Date(t.endDate);
			return n <= e && e <= r;
		});
	}
	get todayEvents() {
		let e = /* @__PURE__ */ new Date();
		return e.setHours(0, 0, 0, 0), this.eventItems.filter((t) => {
			let n = new Date(t.startDate);
			return n.setHours(0, 0, 0, 0), n.getTime() === e.getTime();
		});
	}
	get tomorrowEvents() {
		let e = /* @__PURE__ */ new Date();
		return e.setDate(e.getDate() + 1), e.setHours(0, 0, 0, 0), this.eventItems.filter((t) => {
			let n = new Date(t.startDate);
			return n.setHours(0, 0, 0, 0), n.getTime() === e.getTime();
		});
	}
	replaceBookmarked(e) {
		let t = (e || []).map((e) => this.eventItems.find((t) => t.id === e)).filter((e) => e), n = new Set(t), r = this.bookmarked.filter((e) => !n.has(e));
		for (let e of r) e.bookmarked = !1;
		for (let e of t) e.bookmarked = !0;
	}
	replaceVisited(e) {
		let t = (e || []).map((e) => this.eventItems.find((t) => t.id === e)).filter((e) => e), n = new Set(t), r = this.visited.filter((e) => !n.has(e));
		for (let e of r) e.visited = !1;
		for (let e of t) e.visited = !0;
	}
}, qs(Gs.prototype, "bookmarked", [j], Object.getOwnPropertyDescriptor(Gs.prototype, "bookmarked"), Gs.prototype), qs(Gs.prototype, "visited", [j], Object.getOwnPropertyDescriptor(Gs.prototype, "visited"), Gs.prototype), qs(Gs.prototype, "tracks", [j], Object.getOwnPropertyDescriptor(Gs.prototype, "tracks"), Gs.prototype), qs(Gs.prototype, "venues", [j], Object.getOwnPropertyDescriptor(Gs.prototype, "venues"), Gs.prototype), qs(Gs.prototype, "pastEvents", [j], Object.getOwnPropertyDescriptor(Gs.prototype, "pastEvents"), Gs.prototype), qs(Gs.prototype, "futureEvents", [j], Object.getOwnPropertyDescriptor(Gs.prototype, "futureEvents"), Gs.prototype), qs(Gs.prototype, "liveEvents", [j], Object.getOwnPropertyDescriptor(Gs.prototype, "liveEvents"), Gs.prototype), qs(Gs.prototype, "todayEvents", [j], Object.getOwnPropertyDescriptor(Gs.prototype, "todayEvents"), Gs.prototype), qs(Gs.prototype, "tomorrowEvents", [j], Object.getOwnPropertyDescriptor(Gs.prototype, "tomorrowEvents"), Gs.prototype), qs(Gs.prototype, "replaceBookmarked", [C], Object.getOwnPropertyDescriptor(Gs.prototype, "replaceBookmarked"), Gs.prototype), qs(Gs.prototype, "replaceVisited", [C], Object.getOwnPropertyDescriptor(Gs.prototype, "replaceVisited"), Gs.prototype), Gs), Ys = (Hs = class {
	constructor(e, t, n, r, i, a, o, s, c = [], l = [], u = { type: "event" }) {
		this.id = e, this.externalId = t, this.boothId = n, this.name = r, this.description = i, this.startDate = a, this.endDate = o, this.logoFile = s, this.speakers = c, this.tracks = l, this.entity = u, this.slug = void 0, Ks(this, "bookmarked", Us, this), Ks(this, "visited", Ws, this), this.slug = Ro(r || `event-${e}`);
	}
	get isEnded() {
		return this.endDate && new Date(this.endDate).getTime() < (/* @__PURE__ */ new Date()).getTime();
	}
	get hasSpeakers() {
		return this.speakers.length > 0;
	}
	get hasTracks() {
		return this.tracks.length > 0;
	}
	get primaryTrack() {
		return this.tracks.length > 0 ? this.tracks[0] : null;
	}
	get speakerNames() {
		return this.speakers.map((e) => e.name).join(", ");
	}
	get trackNames() {
		return this.tracks.map((e) => e.name).join(", ");
	}
}, Us = qs(Hs.prototype, "bookmarked", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), Ws = qs(Hs.prototype, "visited", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), Hs);
//#endregion
//#region src/store/init/init-events.ts
function Xs(e) {
	var t;
	(t = z.events) == null || t.forEach((t) => {
		let n = (t.speakers || []).map((t) => e.speakerStore.addSpeaker({ ...t })), r = new Ys(t.id, t.externalId || t.id.toString(), t.boothId, t.name || `Event ${t.id}`, t.description || "", t.startDate, t.endDate, t.logoFile, n, t.tracks || []);
		e.eventStore.eventItems.push(r);
	}), P.log("initEvents", e.eventStore.eventItems.length), P.log("initSpeakers", e.speakerStore.speakersMap.size), Qs(e.eventStore), Zs(e.eventStore);
}
function Zs(e) {
	let t = rs("visited");
	e.replaceVisited(t.events), T(() => {
		is("visited", {
			exhibitors: rs("visited").exhibitors,
			events: e.visited.map((e) => e.id)
		});
	});
}
function Qs(e) {
	let t = rs("bookmarked");
	e.replaceBookmarked(t.events), T(() => {
		var t;
		let n = rs("bookmarked");
		is("bookmarked", {
			exhibitors: n.exhibitors,
			events: (t = e.bookmarked) == null ? void 0 : t.map((e) => e.id),
			speakers: n.speakers,
			booths: n.booths
		});
	});
}
//#endregion
//#region src/utils/lz-utils.ts
var $s = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
	var n = (function() {
		var e = String.fromCharCode, t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$", r = {};
		function i(e, t) {
			if (!r[e]) {
				r[e] = {};
				for (var n = 0; n < e.length; n++) r[e][e.charAt(n)] = n;
			}
			return r[e][t];
		}
		var a = {
			compressToBase64: function(e) {
				if (e == null) return "";
				var n = a._compress(e, 6, function(e) {
					return t.charAt(e);
				});
				switch (n.length % 4) {
					default:
					case 0: return n;
					case 1: return n + "===";
					case 2: return n + "==";
					case 3: return n + "=";
				}
			},
			decompressFromBase64: function(e) {
				return e == null ? "" : e == "" ? null : a._decompress(e.length, 32, function(n) {
					return i(t, e.charAt(n));
				});
			},
			compressToUTF16: function(t) {
				return t == null ? "" : a._compress(t, 15, function(t) {
					return e(t + 32);
				}) + " ";
			},
			decompressFromUTF16: function(e) {
				return e == null ? "" : e == "" ? null : a._decompress(e.length, 16384, function(t) {
					return e.charCodeAt(t) - 32;
				});
			},
			compressToUint8Array: function(e) {
				for (var t = a.compress(e), n = new Uint8Array(t.length * 2), r = 0, i = t.length; r < i; r++) {
					var o = t.charCodeAt(r);
					n[r * 2] = o >>> 8, n[r * 2 + 1] = o % 256;
				}
				return n;
			},
			decompressFromUint8Array: function(t) {
				if (t == null) return a.decompress(t);
				for (var n = Array(t.length / 2), r = 0, i = n.length; r < i; r++) n[r] = t[r * 2] * 256 + t[r * 2 + 1];
				var o = [];
				return n.forEach(function(t) {
					o.push(e(t));
				}), a.decompress(o.join(""));
			},
			compressToEncodedURIComponent: function(e) {
				return e == null ? "" : a._compress(e, 6, function(e) {
					return n.charAt(e);
				});
			},
			decompressFromEncodedURIComponent: function(e) {
				return e == null ? "" : e == "" ? null : (e = e.replace(/ /g, "+"), a._decompress(e.length, 32, function(t) {
					return i(n, e.charAt(t));
				}));
			},
			compress: function(t) {
				return a._compress(t, 16, function(t) {
					return e(t);
				});
			},
			_compress: function(e, t, n) {
				if (e == null) return "";
				var r, i, a = {}, o = {}, s = "", c = "", l = "", u = 2, d = 3, f = 2, p = [], m = 0, h = 0, g;
				for (g = 0; g < e.length; g += 1) if (s = e.charAt(g), Object.prototype.hasOwnProperty.call(a, s) || (a[s] = d++, o[s] = !0), c = l + s, Object.prototype.hasOwnProperty.call(a, c)) l = c;
				else {
					if (Object.prototype.hasOwnProperty.call(o, l)) {
						if (l.charCodeAt(0) < 256) {
							for (r = 0; r < f; r++) m <<= 1, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++;
							for (i = l.charCodeAt(0), r = 0; r < 8; r++) m = m << 1 | i & 1, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++, i >>= 1;
						} else {
							for (i = 1, r = 0; r < f; r++) m = m << 1 | i, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++, i = 0;
							for (i = l.charCodeAt(0), r = 0; r < 16; r++) m = m << 1 | i & 1, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++, i >>= 1;
						}
						u--, u == 0 && (u = 2 ** f, f++), delete o[l];
					} else for (i = a[l], r = 0; r < f; r++) m = m << 1 | i & 1, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++, i >>= 1;
					u--, u == 0 && (u = 2 ** f, f++), a[c] = d++, l = String(s);
				}
				if (l !== "") {
					if (Object.prototype.hasOwnProperty.call(o, l)) {
						if (l.charCodeAt(0) < 256) {
							for (r = 0; r < f; r++) m <<= 1, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++;
							for (i = l.charCodeAt(0), r = 0; r < 8; r++) m = m << 1 | i & 1, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++, i >>= 1;
						} else {
							for (i = 1, r = 0; r < f; r++) m = m << 1 | i, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++, i = 0;
							for (i = l.charCodeAt(0), r = 0; r < 16; r++) m = m << 1 | i & 1, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++, i >>= 1;
						}
						u--, u == 0 && (u = 2 ** f, f++), delete o[l];
					} else for (i = a[l], r = 0; r < f; r++) m = m << 1 | i & 1, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++, i >>= 1;
					u--, u == 0 && (u = 2 ** f, f++);
				}
				for (i = 2, r = 0; r < f; r++) m = m << 1 | i & 1, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++, i >>= 1;
				for (;;) if (m <<= 1, h == t - 1) {
					p.push(n(m));
					break;
				} else h++;
				return p.join("");
			},
			decompress: function(e) {
				return e == null ? "" : e == "" ? null : a._decompress(e.length, 32768, function(t) {
					return e.charCodeAt(t);
				});
			},
			_decompress: function(t, n, r) {
				var i = [], a = 4, o = 4, s = 3, c = "", l = [], u, d, f, p, m, h, g, _ = {
					val: r(0),
					position: n,
					index: 1
				};
				for (u = 0; u < 3; u += 1) i[u] = u;
				for (f = 0, m = 2 ** 2, h = 1; h != m;) p = _.val & _.position, _.position >>= 1, _.position == 0 && (_.position = n, _.val = r(_.index++)), f |= +(p > 0) * h, h <<= 1;
				switch (f) {
					case 0:
						for (f = 0, m = 2 ** 8, h = 1; h != m;) p = _.val & _.position, _.position >>= 1, _.position == 0 && (_.position = n, _.val = r(_.index++)), f |= +(p > 0) * h, h <<= 1;
						g = e(f);
						break;
					case 1:
						for (f = 0, m = 2 ** 16, h = 1; h != m;) p = _.val & _.position, _.position >>= 1, _.position == 0 && (_.position = n, _.val = r(_.index++)), f |= +(p > 0) * h, h <<= 1;
						g = e(f);
						break;
					case 2: return "";
				}
				for (i[3] = g, d = g, l.push(g);;) {
					if (_.index > t) return "";
					for (f = 0, m = 2 ** s, h = 1; h != m;) p = _.val & _.position, _.position >>= 1, _.position == 0 && (_.position = n, _.val = r(_.index++)), f |= +(p > 0) * h, h <<= 1;
					switch (g = f) {
						case 0:
							for (f = 0, m = 2 ** 8, h = 1; h != m;) p = _.val & _.position, _.position >>= 1, _.position == 0 && (_.position = n, _.val = r(_.index++)), f |= +(p > 0) * h, h <<= 1;
							i[o++] = e(f), g = o - 1, a--;
							break;
						case 1:
							for (f = 0, m = 2 ** 16, h = 1; h != m;) p = _.val & _.position, _.position >>= 1, _.position == 0 && (_.position = n, _.val = r(_.index++)), f |= +(p > 0) * h, h <<= 1;
							i[o++] = e(f), g = o - 1, a--;
							break;
						case 2: return l.join("");
					}
					if (a == 0 && (a = 2 ** s, s++), i[g]) c = i[g];
					else if (g === o) c = d + d.charAt(0);
					else return null;
					l.push(c), i[o++] = d + c.charAt(0), a--, d = c, a == 0 && (a = 2 ** s, s++);
				}
			}
		};
		return a;
	})();
	typeof define == "function" && define.amd ? define(function() {
		return n;
	}) : t !== void 0 && t != null ? t.exports = n : typeof angular < "u" && angular != null && angular.module("LZString", []).factory("LZString", function() {
		return n;
	});
})))(), 1);
function ec(e) {
	let t = $s.default.compressToUint8Array(e);
	return btoa(String.fromCharCode(...t)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, ".");
}
function tc(e) {
	return e = e.replace(/-/g, "+").replace(/_/g, "/").replace(/\./g, "="), $s.default.decompressFromBase64(e);
}
var nc = {
	compress: ec,
	decompress: tc
}, rc = new URL(window.location.href), ic = null, ac = rc.searchParams.get("__data");
if (ac) ic = JSON.parse(ac).exhibitors[0];
else {
	let e = rc.searchParams.get("__lzdata");
	if (e) {
		let t = nc.decompress(e);
		ic = JSON.parse(t).exhibitors[0];
	}
}
var oc = ic, sc = "rt";
function cc() {
	return new URLSearchParams(E(window.location.search)).get(sc);
}
function lc() {
	let e = cc();
	return e || (e = sessionStorage.getItem(sc)), e;
}
function uc(e, t) {
	let n = new URL(e, "https://app.expofp.com/");
	for (let [e, r] of Object.entries(t)) n.searchParams.set(e, r);
	return n.href;
}
//#endregion
//#region src/store/ExhibitorStore.ts
var dc, fc, pc, mc, hc, gc, _c, vc, yc, bc, xc, Sc, Cc, wc, Tc;
function Ec(e, t, n, r) {
	n && Object.defineProperty(e, t, {
		enumerable: n.enumerable,
		configurable: n.configurable,
		writable: n.writable,
		value: n.initializer ? n.initializer.call(r) : void 0
	});
}
function Dc(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var Oc = /*#__PURE__*/ function(e) {
	return e[e.Unasked = 0] = "Unasked", e[e.Accepted = 1] = "Accepted", e[e.Rejected = 2] = "Rejected", e[e.Undecided = 3] = "Undecided", e;
}({}), kc = (_c = j({ keepAlive: !0 }), vc = j({ keepAlive: !0 }), yc = j({ keepAlive: !0 }), bc = j({ keepAlive: !0 }), xc = j({ keepAlive: !0 }), Sc = class {
	constructor(e) {
		this.rootStore = void 0, this.exhibitors = [], this.timeout = void 0, Ec(this, "highlightedByExternalIds", Cc, this), Ec(this, "rebookingStateChangeRequested", wc, this), Ec(this, "rebookingStateSaved", Tc, this), this.rootStore = e;
	}
	get exhibitorById() {
		return new Map(this.exhibitors.map((e) => [e.id, e]));
	}
	get exhibitorByExternalId() {
		return new Map(this.exhibitors.map((e) => [e.externalId, e]));
	}
	get exhibitorByName() {
		return new Map(this.exhibitors.map((e) => [e.name.toLowerCase(), e]));
	}
	get exhibitorBySlug() {
		return new Map(this.exhibitors.map((e) => [e.slug, e]));
	}
	get bookmarked() {
		return this.exhibitors.filter((e) => e.bookmarked);
	}
	get visited() {
		return this.exhibitors.filter((e) => e.visited);
	}
	get advertised() {
		return this.exhibitors.filter((e) => {
			var t;
			return e.advertise && ((t = e.logo) == null ? void 0 : t.url);
		});
	}
	replaceBookmarked(e) {
		if (!Array.isArray(e)) return;
		let t = (e || []).map((e) => this.exhibitorById.get(e)).filter((e) => e), n = new Set(t), r = this.bookmarked.filter((e) => !n.has(e));
		for (let e of r) e.bookmarked = !1;
		for (let e of t) e.bookmarked = !0;
	}
	replaceVisited(e) {
		if (!Array.isArray(e)) return;
		let t = (e || []).map((e) => this.exhibitorById.get(e)).filter((e) => e), n = new Set(t), r = this.visited.filter((e) => !n.has(e));
		for (let e of r) e.visited = !1;
		for (let e of t) e.visited = !0;
	}
	setRebookingState(e, t, n) {
		clearTimeout(this.timeout), this.rebookingStateChangeRequested = !1, e.rebookingState = t, e.rebookingNote = n;
		let r = uc("api/v1/set-rebooking-state", {
			rt: lc(),
			expoKey: this.rootStore.fp.eventId
		});
		fetch(r, {
			method: "POST",
			headers: { "Content-Type": "application/json" },
			body: JSON.stringify({
				expoKey: vo.EXPO,
				exhibitorId: e.id,
				rebookingState: t,
				rebookingNote: n
			})
		}).then((t) => {
			t.ok && (this.rebookingStateSaved = !0), !t.ok && !de && (e.rebookingState = Oc.Unasked, this.rebookingStateSaved = !1);
		}).catch(() => {
			e.rebookingState = Oc.Unasked, this.rebookingStateSaved = !1;
		}).finally(() => {
			this.rebookingStateChangeRequested = !0, this.timeout = setTimeout(() => {
				this.rebookingStateChangeRequested = !1;
			}, 5e3);
		});
	}
	findExhibitor(e) {
		return this.exhibitorByExternalId.get(e) || this.exhibitorByName.get(e.toLowerCase()) || this.exhibitorBySlug.get(e);
	}
}, Cc = Dc(Sc.prototype, "highlightedByExternalIds", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return [];
	}
}), wc = Dc(Sc.prototype, "rebookingStateChangeRequested", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), Tc = Dc(Sc.prototype, "rebookingStateSaved", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), Dc(Sc.prototype, "exhibitorById", [_c], Object.getOwnPropertyDescriptor(Sc.prototype, "exhibitorById"), Sc.prototype), Dc(Sc.prototype, "exhibitorByExternalId", [vc], Object.getOwnPropertyDescriptor(Sc.prototype, "exhibitorByExternalId"), Sc.prototype), Dc(Sc.prototype, "exhibitorByName", [yc], Object.getOwnPropertyDescriptor(Sc.prototype, "exhibitorByName"), Sc.prototype), Dc(Sc.prototype, "exhibitorBySlug", [bc], Object.getOwnPropertyDescriptor(Sc.prototype, "exhibitorBySlug"), Sc.prototype), Dc(Sc.prototype, "bookmarked", [j], Object.getOwnPropertyDescriptor(Sc.prototype, "bookmarked"), Sc.prototype), Dc(Sc.prototype, "visited", [j], Object.getOwnPropertyDescriptor(Sc.prototype, "visited"), Sc.prototype), Dc(Sc.prototype, "advertised", [xc], Object.getOwnPropertyDescriptor(Sc.prototype, "advertised"), Sc.prototype), Dc(Sc.prototype, "replaceBookmarked", [C], Object.getOwnPropertyDescriptor(Sc.prototype, "replaceBookmarked"), Sc.prototype), Dc(Sc.prototype, "replaceVisited", [C], Object.getOwnPropertyDescriptor(Sc.prototype, "replaceVisited"), Sc.prototype), Dc(Sc.prototype, "setRebookingState", [C], Object.getOwnPropertyDescriptor(Sc.prototype, "setRebookingState"), Sc.prototype), Sc), Ac = (dc = class {
	constructor() {
		this.store = void 0, this.id = void 0, this.name = void 0, this.externalId = void 0, Ec(this, "featured", fc, this), this.advertise = void 0, this.description = void 0, this.address = void 0, this.address2 = void 0, this.city = void 0, this.state = void 0, this.zip = void 0, this.country = void 0, this.phone1 = void 0, this.website = void 0, this.facebook = void 0, this.instagram = void 0, this.linkedin = void 0, this.twitter = void 0, this.googlePlus = void 0, this.xing = void 0, this.youtube = void 0, this.email = void 0, this.privateEmail = void 0, this.customButtonTitle = void 0, this.customButtonUrl = void 0, this.customButton2Title = void 0, this.customButton2Url = void 0, this.customButton3Title = void 0, this.customButton3Url = void 0, this.leadingImageUrl = void 0, this.leadingImageLinkUrl = void 0, this.videoUrl = void 0, this.order = void 0, this.logo = void 0, this.logoInBooth = void 0, this.logoAspectRatio = void 0, this.gallery = void 0, this.marketMaterials = void 0, this.slug = void 0, Ec(this, "bookmarked", pc, this), Ec(this, "visited", mc, this), Ec(this, "rebookingState", hc, this), Ec(this, "rebookingNote", gc, this), this.booths = void 0, this.categories = void 0, this.schedule = void 0, this.entity = { type: "exhibitor" };
	}
}, fc = Dc(dc.prototype, "featured", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: null
}), pc = Dc(dc.prototype, "bookmarked", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: null
}), mc = Dc(dc.prototype, "visited", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: null
}), hc = Dc(dc.prototype, "rebookingState", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: null
}), gc = Dc(dc.prototype, "rebookingNote", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: null
}), dc);
//#endregion
//#region src/store/init/init-exhibitors.ts
function jc(e) {
	let { exhibitorStore: t } = e, n = [...z.exhibitors || []];
	if (oc) {
		let e = n.findIndex((e) => e.id === oc.id);
		e === -1 ? n.push(oc) : n.splice(e, 1, oc);
	}
	n.sort((e, t) => Number(t.featured) - Number(e.featured));
	for (let e of n) {
		let n = new Ac();
		Object.assign(n, e), n.slug = Ro(n.name), n.rebookingState = n.rebookingState || Oc.Unasked, n.categories = [], n.booths = [], n.store = t, t.exhibitors.push(n), n.schedule = null;
	}
	P.log("initExhibitors", t.exhibitors.length), Mc(t), Nc(t);
}
function Mc(e) {
	let t = rs("bookmarked");
	e.replaceBookmarked(t.exhibitors), T(() => {
		var t;
		let n = rs("bookmarked");
		is("bookmarked", {
			exhibitors: (t = e.bookmarked) == null ? void 0 : t.map((e) => e.id),
			events: n.events,
			speakers: n.speakers,
			booths: n.booths
		});
	});
}
function Nc(e) {
	let t = rs("visited");
	e.replaceVisited(t.exhibitors), T(() => {
		let t = rs("visited");
		is("visited", {
			exhibitors: e.visited.map((e) => e.id),
			events: t.events
		});
	});
}
//#endregion
//#region src/components/Map/drawing/config/canvases.ts
function Pc(e, t, n, r, i = 1, a) {
	let o = e ? e.width / e.height : 1, s = t * r * i, c = n * r * i;
	t / n > o ? s = c * o : c = s / o;
	let l = document.createElement("canvas"), u = l.getContext("2d");
	return l.width = s, l.height = c, l.id = e.id, a === "horizontal" ? (u.scale(-1, 1), u.translate(-s, 0)) : a === "vertical" && (u.scale(1, -1), u.translate(0, -c)), u.drawImage(e, 0, 0, s, c), l;
}
function Fc(e, t = "#c8248b", n = e * .4, r, i, a, o = "#000") {
	r = r || 95, i = i || 95;
	let s = document.createElement("canvas"), c = s.getContext("2d");
	s.width = r * n, s.height = i * n, c.scale(n, n);
	let l = r / 2, u = i / 2;
	return c.translate(l - 35, a ? 0 : u - 35), c.beginPath(), c.fillStyle = "#FFFFFF", c.moveTo(0, 35), c.bezierCurveTo(0, 54.329966, 15.670034, 70, 35, 70), c.bezierCurveTo(54.329966, 70, 70, 54.329966, 70, 35), c.bezierCurveTo(70, 15.670034, 54.329966, 0, 35, 0), c.bezierCurveTo(15.670034, 0, 0, 15.670034, 0, 35), c.fill(), c.beginPath(), c.fillStyle = t, c.moveTo(10, 35), c.bezierCurveTo(10, 48.807119, 21.192881, 60, 35, 60), c.bezierCurveTo(48.807119, 60, 60, 48.807119, 60, 35), c.bezierCurveTo(60, 21.192881, 48.807119, 10, 35, 10), c.bezierCurveTo(21.192881, 10, 10, 21.192881, 10, 35), c.fill(), a && (c.textAlign = "center", c.textBaseline = "alphabetic", c.lineJoin = "round", c.strokeStyle = "#fff", c.fillStyle = o, c.font = qc(38), c.lineWidth = 6, c.strokeText(a, 35, 108, r), c.fillText(a, 35, 108, r)), s;
}
function Ic(e, t = "#c8248b", n = e * .5) {
	let r = 70 * n, i = 100 * n, a = document.createElement("canvas"), o = a.getContext("2d");
	return a.width = r, a.height = i, o.scale(n, n), o.beginPath(), o.fillStyle = "rgb(255, 255, 255)", o.moveTo(32.6, 97.8), o.bezierCurveTo(24.4, 81.5, 0, 57, 0, 32.6), o.bezierCurveTo(0, 14.6, 14.6, 0, 32.6, 0), o.bezierCurveTo(50.5, 0, 65.2, 14.6, 65.2, 32.6), o.bezierCurveTo(65.2, 57, 40.7, 81.5, 32.6, 97.8), o.fill(), o.beginPath(), o.fillStyle = t, o.moveTo(32.6, 91.1), o.bezierCurveTo(25.2, 76.3, 3.1, 54.2, 3.1, 32.1), o.bezierCurveTo(3.1, 15.9, 16.3, 2.6, 32.6, 2.6), o.bezierCurveTo(48.8, 2.6, 62, 15.9, 62, 32.1), o.bezierCurveTo(62, 54.2, 39.9, 76.3, 32.6, 91.1), o.fill(), o.beginPath(), o.fillStyle = "rgb(255, 255, 255)", o.moveTo(16.2, 32.6), o.bezierCurveTo(16.2, 41.6, 23.5, 48.9, 32.5, 48.9), o.bezierCurveTo(41.5, 48.9, 48.8, 41.6, 48.8, 32.6), o.bezierCurveTo(48.8, 23.6, 41.5, 16.3, 32.5, 16.3), o.bezierCurveTo(23.5, 16.3, 16.2, 23.6, 16.2, 32.6), o.fill(), a;
}
function Lc(e, t = "#c8248b", n = e * .4) {
	let r = 95 * n, i = 95 * n, a = document.createElement("canvas"), o = a.getContext("2d");
	return a.width = r, a.height = i, o.scale(n, n), o.beginPath(), o.arc(47, 47, 25, 0, 2 * Math.PI), o.fillStyle = t, o.fill(), o.beginPath(), o.fillStyle = t, o.moveTo(75, 27), o.lineTo(95, 47), o.lineTo(75, 67), o.lineTo(80, 47), o.closePath(), o.fill(), a;
}
function Rc(e, t = "#ff4343", n = e * .5) {
	let r = 77 * n, i = 116 * n, a = document.createElement("canvas"), o = a.getContext("2d");
	return a.width = r, a.height = i, o.scale(n, n), o.scale(n, n), o.beginPath(), o.fillStyle = "#FFFFFF", o.moveTo(68.303, 57.335), o.bezierCurveTo(77.894, 39.304, 70.649, 15.785, 50.95, 8.04), o.bezierCurveTo(30.727, 0, 8.375, 11.837, 3.207, 32.831), o.bezierCurveTo(0, 46.185, 6.644, 57.323, 13.131, 68.211), o.fill(), o.beginPath(), o.fillStyle = t, o.moveTo(51.565, 35.459), o.bezierCurveTo(51.565, 43.256, 45.201, 49.575, 37.354, 49.575), o.bezierCurveTo(29.516, 49.575, 23.159, 43.256, 23.159, 35.459), o.bezierCurveTo(23.159, 27.668, 29.516, 21.345, 37.354, 21.345), o.bezierCurveTo(45.201, 21.345, 51.565, 27.668, 51.565, 35.459), o.closePath(), o.fill(), o.beginPath(), o.moveTo(68.303, 57.335), o.bezierCurveTo(77.894, 39.304, 70.649, 15.785, 50.95, 8.04), o.bezierCurveTo(30.727, 0, 8.375, 11.837, 3.207, 32.831), o.bezierCurveTo(0, 46.185, 6.644, 57.323, 13.131, 68.211), o.lineTo(13.131, 68.211), o.lineTo(13.131, 68.211), o.bezierCurveTo(13.921, 69.533, 14.698, 70.829, 15.454, 72.137), o.bezierCurveTo(19.465, 79.158, 23.533, 86.12, 27.571, 93.086), o.lineTo(27.571, 93.086), o.bezierCurveTo(30.098, 97.421, 32.611, 101.756, 35.116, 106.077), o.bezierCurveTo(36.128, 107.868, 38.934, 107.868, 39.945, 106.077), o.bezierCurveTo(49.387, 90.003, 58.708, 74.029, 68.031, 57.951), o.bezierCurveTo(68.15, 57.743, 68.24, 57.543, 68.303, 57.335), o.closePath(), o.moveTo(60.103, 60.395), o.lineTo(63.201, 55.041), o.lineTo(63.201, 55.041), o.bezierCurveTo(73.31, 36.735, 61.285, 11.614, 39.04, 11.17), o.bezierCurveTo(19.388, 10.714, 2.759, 29.479, 9.386, 49.013), o.bezierCurveTo(10.726, 52.998, 12.657, 56.9, 14.84, 60.721), o.bezierCurveTo(15.041, 58.454, 15.938, 56.258, 17.589, 54.586), o.bezierCurveTo(19.708, 52.425, 22.216, 50.638, 24.996, 49.283), o.bezierCurveTo(28.252, 52.249, 32.595, 54.051, 37.354, 54.051), o.bezierCurveTo(42.123, 54.051, 46.47, 52.249, 49.73, 49.283), o.bezierCurveTo(52.505, 50.638, 55.017, 52.425, 57.135, 54.586), o.bezierCurveTo(58.701, 56.188, 59.701, 58.245, 60.103, 60.395), o.closePath(), o.fill("evenodd"), o.beginPath(), o.moveTo(29.024, 104.982), o.bezierCurveTo(29.024, 103.626, 27.923, 102.527, 26.57, 102.527), o.bezierCurveTo(25.214, 102.527, 24.114, 103.626, 24.114, 104.982), o.bezierCurveTo(24.114, 111.395, 30.347, 116.838, 37.444, 116.838), o.bezierCurveTo(44.54, 116.838, 50.771, 111.395, 50.771, 104.982), o.bezierCurveTo(50.771, 103.626, 49.666, 102.527, 48.317, 102.527), o.bezierCurveTo(46.961, 102.527, 45.855, 103.626, 45.855, 104.982), o.bezierCurveTo(45.855, 108.193, 42.352, 111.956, 37.444, 111.956), o.bezierCurveTo(32.528, 111.956, 29.024, 108.193, 29.024, 104.982), o.closePath(), o.fill(), a;
}
document.createElement("canvas").getContext("2d");
function zc(e, t, n, r, i) {
	let a = t / 2, o = r + i, s = n - i;
	e.beginPath(), e.moveTo(a, s), e.bezierCurveTo(a - r * .55, o + r * .8, a - r, o + r * .35, a - r, o), e.bezierCurveTo(a - r, o - r * .72, a - r * .45, o - r, a, o - r), e.bezierCurveTo(a + r * .45, o - r, a + r, o - r * .72, a + r, o), e.bezierCurveTo(a + r, o + r * .35, a + r * .55, o + r * .8, a, s), e.closePath();
}
var Bc = "#ffffff", Vc = 93 / 81, Hc = 125 / 90;
function Uc(e, t, n, r, i, a) {
	let o = e, s = e * t, c = document.createElement("canvas"), l = c.getContext("2d");
	c.width = o * n, c.height = s * n, l.scale(n, n);
	let u = o * r;
	return zc(l, o, s, u, i), l.fillStyle = a, l.strokeStyle = Bc, l.lineWidth = i, l.lineJoin = "round", l.fill(), l.stroke(), {
		canvas: c,
		ctx: l,
		cx: o / 2,
		cy: u + i,
		r: u
	};
}
function Wc(e) {
	return e.getContext("2d").getImageData(0, 0, e.width, e.height);
}
function Gc(e, t, n, r) {
	let { canvas: i, ctx: a, cx: o, cy: s } = Uc(t, Vc, n, .37, 2, r);
	if (e) {
		let r = Pc(e, t * .42, t * .42, n), i = r.getContext("2d");
		i.globalCompositeOperation = "source-in", i.fillStyle = Bc, i.fillRect(0, 0, r.width, r.height);
		let c = r.width / n, l = r.height / n;
		a.drawImage(r, o - c / 2, s - l / 2, c, l);
	}
	return Wc(i);
}
function Kc(e, t, n) {
	let { canvas: r, ctx: i, cx: a, cy: o, r: s } = Uc(e, Hc, t, .38, 3, n);
	return i.beginPath(), i.arc(a, o, s * .34, 0, 2 * Math.PI), i.fillStyle = Bc, i.fill(), Wc(r);
}
function qc(e, t = 500, n = "normal") {
	let r = getComputedStyle(document.body).getPropertyValue(c), i = "Oswald, -apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif";
	return `${n} ${t} ${e}px ${r ? `${r}, ${i}` : i}`;
}
//#endregion
//#region src/utils/color-gradient.ts
function Jc(e, t, n, r) {
	if (r.length === 0) return "transparent";
	let i = r.map((e) => (0, ks.default)(e)), a = Math.max(0, Math.min((e - t) / (n - t) || 0, 1)), o = Math.sqrt(a) * (i.length - 1), s = Math.min(Math.floor(o), i.length - 1), c = i[s], l = i[Math.min(s + 1, i.length - 1)], u = o - s;
	return c.mix(l, u).hex();
}
//#endregion
//#region src/store/HeatmapStore.ts
var Yc, Xc;
function Zc(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var Qc = (Yc = j({ keepAlive: !0 }), Xc = class {
	constructor() {
		this.heatmapData = {}, this.forceTrack = null;
	}
	get minAndMaxClicks() {
		let { booths: e = [], exhibitors: t = [], yah: n = [] } = this.heatmapData, r = [
			...e,
			...t,
			...n
		];
		if (r.length === 0) return {
			min: 0,
			max: 0
		};
		let { min: i, max: a } = ((e) => e.reduce((e, t) => (t.viewCount > e.max && (e.max = t.viewCount), t.viewCount < e.min && (e.min = t.viewCount), e), {
			min: e[0].viewCount,
			max: e[0].viewCount
		}))(r);
		return {
			min: i,
			max: a
		};
	}
	getClicksByType(e) {
		return e instanceof Bs ? -1 : e instanceof Ac || e instanceof $c ? this.getClicksByItem(e) : e instanceof Ys ? 0 : this.getClicksByItem(e);
	}
	getClicksByItem(e) {
		if (e instanceof Ac) {
			var t;
			return ((t = this.heatmapData) == null || (t = t.exhibitors) == null || (t = t.find((t) => t.id === e.id)) == null ? void 0 : t.viewCount) || 0;
		}
		if (e instanceof Es) {
			var n;
			return ((n = this.heatmapData) == null || (n = n.booths) == null || (n = n.find((t) => t.id === e.id)) == null ? void 0 : n.viewCount) || 0;
		}
		if (e instanceof $c) {
			var r;
			return ((r = this.heatmapData) == null || (r = r.yah) == null || (r = r.find((t) => t.id === e.id)) == null ? void 0 : r.viewCount) || 0;
		}
		return 0;
	}
	getTotalClicksByBooth(e) {
		let t = this.getClicksByItem(e);
		for (let n of e.exhibitors) {
			let e = this.getClicksByItem(n);
			t += e;
		}
		return t;
	}
	getColorByClicks(e) {
		let { min: t, max: n } = this.minAndMaxClicks;
		return Jc(e, t, n, vo.heatmapColors);
	}
	getHeatmapColorForBooth(e) {
		let t = this.getTotalClicksByBooth(e);
		return (0, ks.default)(this.getColorByClicks(t));
	}
}, Zc(Xc.prototype, "minAndMaxClicks", [Yc], Object.getOwnPropertyDescriptor(Xc.prototype, "minAndMaxClicks"), Xc.prototype), Xc), $c = class {
	constructor(e, t, n, r, i, a) {
		this.id = e, this.name = t, this.viewCount = n, this.x = r, this.y = i, this.z = a, this.entity = { type: "heatmap-yah" };
	}
};
//#endregion
//#region src/store/init/init-heatmap.ts
function el(e) {
	if (window.__heatmapData) e.heatmapStore.heatmapData = window.__heatmapData;
	else if (window.__heatmapDataYah) {
		e.heatmapStore.heatmapData.yah = window.__heatmapDataYah.yah.map((e) => {
			let t = new $c();
			return t.id = e.id, t.name = e.name, t.viewCount = e.viewCount, t.x = e.x, t.y = e.y, t.z = e.z, t;
		});
		let t = e.heatmapStore.heatmapData.yah.map((t) => {
			let n = e.heatmapStore.getColorByClicks(t.viewCount), r = e.uiState.devicePixelRatio, i = Fc(r, n, void 0, 95, 120, t.viewCount.toString()), a = i.toDataURL();
			return {
				name: t.id.toString(),
				scale: 1,
				width: i.width,
				height: i.height,
				content: a
			};
		}), n = e.heatmapStore.heatmapData.yah.map((e) => ({
			id: e.id.toString(),
			x: e.x,
			y: e.y,
			z: e.z,
			position: "lefttop",
			icon: e.id.toString(),
			selectedIcon: e.id.toString()
		}));
		e.routeStore.setMarkers({
			markers: n,
			icons: t
		}), e.selectSearch(" ");
	}
}
//#endregion
//#region ../../node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/dispatch.js
var tl = { value: () => {} };
function nl() {
	for (var e = 0, t = arguments.length, n = {}, r; e < t; ++e) {
		if (!(r = arguments[e] + "") || r in n || /[\s.]/.test(r)) throw Error("illegal type: " + r);
		n[r] = [];
	}
	return new rl(n);
}
function rl(e) {
	this._ = e;
}
function il(e, t) {
	return e.trim().split(/^|\s+/).map(function(e) {
		var n = "", r = e.indexOf(".");
		if (r >= 0 && (n = e.slice(r + 1), e = e.slice(0, r)), e && !t.hasOwnProperty(e)) throw Error("unknown type: " + e);
		return {
			type: e,
			name: n
		};
	});
}
rl.prototype = nl.prototype = {
	constructor: rl,
	on: function(e, t) {
		var n = this._, r = il(e + "", n), i, a = -1, o = r.length;
		if (arguments.length < 2) {
			for (; ++a < o;) if ((i = (e = r[a]).type) && (i = al(n[i], e.name))) return i;
			return;
		}
		if (t != null && typeof t != "function") throw Error("invalid callback: " + t);
		for (; ++a < o;) if (i = (e = r[a]).type) n[i] = ol(n[i], e.name, t);
		else if (t == null) for (i in n) n[i] = ol(n[i], e.name, null);
		return this;
	},
	copy: function() {
		var e = {}, t = this._;
		for (var n in t) e[n] = t[n].slice();
		return new rl(e);
	},
	call: function(e, t) {
		if ((i = arguments.length - 2) > 0) for (var n = Array(i), r = 0, i, a; r < i; ++r) n[r] = arguments[r + 2];
		if (!this._.hasOwnProperty(e)) throw Error("unknown type: " + e);
		for (a = this._[e], r = 0, i = a.length; r < i; ++r) a[r].value.apply(t, n);
	},
	apply: function(e, t, n) {
		if (!this._.hasOwnProperty(e)) throw Error("unknown type: " + e);
		for (var r = this._[e], i = 0, a = r.length; i < a; ++i) r[i].value.apply(t, n);
	}
};
function al(e, t) {
	for (var n = 0, r = e.length, i; n < r; ++n) if ((i = e[n]).name === t) return i.value;
}
function ol(e, t, n) {
	for (var r = 0, i = e.length; r < i; ++r) if (e[r].name === t) {
		e[r] = tl, e = e.slice(0, r).concat(e.slice(r + 1));
		break;
	}
	return n != null && e.push({
		name: t,
		value: n
	}), e;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.js
function sl(e, t, n) {
	e.prototype = t.prototype = n, n.constructor = e;
}
function cl(e, t) {
	var n = Object.create(e.prototype);
	for (var r in t) n[r] = t[r];
	return n;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.js
function ll() {}
var ul = .7, dl = 1 / ul, fl = "\\s*([+-]?\\d+)\\s*", pl = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", ml = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", hl = /^#([0-9a-f]{3,8})$/, gl = RegExp(`^rgb\\(${fl},${fl},${fl}\\)$`), _l = RegExp(`^rgb\\(${ml},${ml},${ml}\\)$`), vl = RegExp(`^rgba\\(${fl},${fl},${fl},${pl}\\)$`), yl = RegExp(`^rgba\\(${ml},${ml},${ml},${pl}\\)$`), bl = RegExp(`^hsl\\(${pl},${ml},${ml}\\)$`), xl = RegExp(`^hsla\\(${pl},${ml},${ml},${pl}\\)$`), Sl = {
	aliceblue: 15792383,
	antiquewhite: 16444375,
	aqua: 65535,
	aquamarine: 8388564,
	azure: 15794175,
	beige: 16119260,
	bisque: 16770244,
	black: 0,
	blanchedalmond: 16772045,
	blue: 255,
	blueviolet: 9055202,
	brown: 10824234,
	burlywood: 14596231,
	cadetblue: 6266528,
	chartreuse: 8388352,
	chocolate: 13789470,
	coral: 16744272,
	cornflowerblue: 6591981,
	cornsilk: 16775388,
	crimson: 14423100,
	cyan: 65535,
	darkblue: 139,
	darkcyan: 35723,
	darkgoldenrod: 12092939,
	darkgray: 11119017,
	darkgreen: 25600,
	darkgrey: 11119017,
	darkkhaki: 12433259,
	darkmagenta: 9109643,
	darkolivegreen: 5597999,
	darkorange: 16747520,
	darkorchid: 10040012,
	darkred: 9109504,
	darksalmon: 15308410,
	darkseagreen: 9419919,
	darkslateblue: 4734347,
	darkslategray: 3100495,
	darkslategrey: 3100495,
	darkturquoise: 52945,
	darkviolet: 9699539,
	deeppink: 16716947,
	deepskyblue: 49151,
	dimgray: 6908265,
	dimgrey: 6908265,
	dodgerblue: 2003199,
	firebrick: 11674146,
	floralwhite: 16775920,
	forestgreen: 2263842,
	fuchsia: 16711935,
	gainsboro: 14474460,
	ghostwhite: 16316671,
	gold: 16766720,
	goldenrod: 14329120,
	gray: 8421504,
	green: 32768,
	greenyellow: 11403055,
	grey: 8421504,
	honeydew: 15794160,
	hotpink: 16738740,
	indianred: 13458524,
	indigo: 4915330,
	ivory: 16777200,
	khaki: 15787660,
	lavender: 15132410,
	lavenderblush: 16773365,
	lawngreen: 8190976,
	lemonchiffon: 16775885,
	lightblue: 11393254,
	lightcoral: 15761536,
	lightcyan: 14745599,
	lightgoldenrodyellow: 16448210,
	lightgray: 13882323,
	lightgreen: 9498256,
	lightgrey: 13882323,
	lightpink: 16758465,
	lightsalmon: 16752762,
	lightseagreen: 2142890,
	lightskyblue: 8900346,
	lightslategray: 7833753,
	lightslategrey: 7833753,
	lightsteelblue: 11584734,
	lightyellow: 16777184,
	lime: 65280,
	limegreen: 3329330,
	linen: 16445670,
	magenta: 16711935,
	maroon: 8388608,
	mediumaquamarine: 6737322,
	mediumblue: 205,
	mediumorchid: 12211667,
	mediumpurple: 9662683,
	mediumseagreen: 3978097,
	mediumslateblue: 8087790,
	mediumspringgreen: 64154,
	mediumturquoise: 4772300,
	mediumvioletred: 13047173,
	midnightblue: 1644912,
	mintcream: 16121850,
	mistyrose: 16770273,
	moccasin: 16770229,
	navajowhite: 16768685,
	navy: 128,
	oldlace: 16643558,
	olive: 8421376,
	olivedrab: 7048739,
	orange: 16753920,
	orangered: 16729344,
	orchid: 14315734,
	palegoldenrod: 15657130,
	palegreen: 10025880,
	paleturquoise: 11529966,
	palevioletred: 14381203,
	papayawhip: 16773077,
	peachpuff: 16767673,
	peru: 13468991,
	pink: 16761035,
	plum: 14524637,
	powderblue: 11591910,
	purple: 8388736,
	rebeccapurple: 6697881,
	red: 16711680,
	rosybrown: 12357519,
	royalblue: 4286945,
	saddlebrown: 9127187,
	salmon: 16416882,
	sandybrown: 16032864,
	seagreen: 3050327,
	seashell: 16774638,
	sienna: 10506797,
	silver: 12632256,
	skyblue: 8900331,
	slateblue: 6970061,
	slategray: 7372944,
	slategrey: 7372944,
	snow: 16775930,
	springgreen: 65407,
	steelblue: 4620980,
	tan: 13808780,
	teal: 32896,
	thistle: 14204888,
	tomato: 16737095,
	turquoise: 4251856,
	violet: 15631086,
	wheat: 16113331,
	white: 16777215,
	whitesmoke: 16119285,
	yellow: 16776960,
	yellowgreen: 10145074
};
sl(ll, Dl, {
	copy(e) {
		return Object.assign(new this.constructor(), this, e);
	},
	displayable() {
		return this.rgb().displayable();
	},
	hex: Cl,
	formatHex: Cl,
	formatHex8: wl,
	formatHsl: Tl,
	formatRgb: El,
	toString: El
});
function Cl() {
	return this.rgb().formatHex();
}
function wl() {
	return this.rgb().formatHex8();
}
function Tl() {
	return Bl(this).formatHsl();
}
function El() {
	return this.rgb().formatRgb();
}
function Dl(e) {
	var t, n;
	return e = (e + "").trim().toLowerCase(), (t = hl.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? Ol(t) : n === 3 ? new Ml(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? kl(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? kl(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = gl.exec(e)) ? new Ml(t[1], t[2], t[3], 1) : (t = _l.exec(e)) ? new Ml(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = vl.exec(e)) ? kl(t[1], t[2], t[3], t[4]) : (t = yl.exec(e)) ? kl(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = bl.exec(e)) ? zl(t[1], t[2] / 100, t[3] / 100, 1) : (t = xl.exec(e)) ? zl(t[1], t[2] / 100, t[3] / 100, t[4]) : Sl.hasOwnProperty(e) ? Ol(Sl[e]) : e === "transparent" ? new Ml(NaN, NaN, NaN, 0) : null;
}
function Ol(e) {
	return new Ml(e >> 16 & 255, e >> 8 & 255, e & 255, 1);
}
function kl(e, t, n, r) {
	return r <= 0 && (e = t = n = NaN), new Ml(e, t, n, r);
}
function Al(e) {
	return e instanceof ll || (e = Dl(e)), e ? (e = e.rgb(), new Ml(e.r, e.g, e.b, e.opacity)) : new Ml();
}
function jl(e, t, n, r) {
	return arguments.length === 1 ? Al(e) : new Ml(e, t, n, r == null ? 1 : r);
}
function Ml(e, t, n, r) {
	this.r = +e, this.g = +t, this.b = +n, this.opacity = +r;
}
sl(Ml, jl, cl(ll, {
	brighter(e) {
		return e = e == null ? dl : dl ** +e, new Ml(this.r * e, this.g * e, this.b * e, this.opacity);
	},
	darker(e) {
		return e = e == null ? ul : ul ** +e, new Ml(this.r * e, this.g * e, this.b * e, this.opacity);
	},
	rgb() {
		return this;
	},
	clamp() {
		return new Ml(Ll(this.r), Ll(this.g), Ll(this.b), Il(this.opacity));
	},
	displayable() {
		return -.5 <= this.r && this.r < 255.5 && -.5 <= this.g && this.g < 255.5 && -.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
	},
	hex: Nl,
	formatHex: Nl,
	formatHex8: Pl,
	formatRgb: Fl,
	toString: Fl
}));
function Nl() {
	return `#${Rl(this.r)}${Rl(this.g)}${Rl(this.b)}`;
}
function Pl() {
	return `#${Rl(this.r)}${Rl(this.g)}${Rl(this.b)}${Rl((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
}
function Fl() {
	let e = Il(this.opacity);
	return `${e === 1 ? "rgb(" : "rgba("}${Ll(this.r)}, ${Ll(this.g)}, ${Ll(this.b)}${e === 1 ? ")" : `, ${e})`}`;
}
function Il(e) {
	return isNaN(e) ? 1 : Math.max(0, Math.min(1, e));
}
function Ll(e) {
	return Math.max(0, Math.min(255, Math.round(e) || 0));
}
function Rl(e) {
	return e = Ll(e), (e < 16 ? "0" : "") + e.toString(16);
}
function zl(e, t, n, r) {
	return r <= 0 ? e = t = n = NaN : n <= 0 || n >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new Hl(e, t, n, r);
}
function Bl(e) {
	if (e instanceof Hl) return new Hl(e.h, e.s, e.l, e.opacity);
	if (e instanceof ll || (e = Dl(e)), !e) return new Hl();
	if (e instanceof Hl) return e;
	e = e.rgb();
	var t = e.r / 255, n = e.g / 255, r = e.b / 255, i = Math.min(t, n, r), a = Math.max(t, n, r), o = NaN, s = a - i, c = (a + i) / 2;
	return s ? (o = t === a ? (n - r) / s + (n < r) * 6 : n === a ? (r - t) / s + 2 : (t - n) / s + 4, s /= c < .5 ? a + i : 2 - a - i, o *= 60) : s = c > 0 && c < 1 ? 0 : o, new Hl(o, s, c, e.opacity);
}
function Vl(e, t, n, r) {
	return arguments.length === 1 ? Bl(e) : new Hl(e, t, n, r == null ? 1 : r);
}
function Hl(e, t, n, r) {
	this.h = +e, this.s = +t, this.l = +n, this.opacity = +r;
}
sl(Hl, Vl, cl(ll, {
	brighter(e) {
		return e = e == null ? dl : dl ** +e, new Hl(this.h, this.s, this.l * e, this.opacity);
	},
	darker(e) {
		return e = e == null ? ul : ul ** +e, new Hl(this.h, this.s, this.l * e, this.opacity);
	},
	rgb() {
		var e = this.h % 360 + (this.h < 0) * 360, t = isNaN(e) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < .5 ? n : 1 - n) * t, i = 2 * n - r;
		return new Ml(Gl(e >= 240 ? e - 240 : e + 120, i, r), Gl(e, i, r), Gl(e < 120 ? e + 240 : e - 120, i, r), this.opacity);
	},
	clamp() {
		return new Hl(Ul(this.h), Wl(this.s), Wl(this.l), Il(this.opacity));
	},
	displayable() {
		return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
	},
	formatHsl() {
		let e = Il(this.opacity);
		return `${e === 1 ? "hsl(" : "hsla("}${Ul(this.h)}, ${Wl(this.s) * 100}%, ${Wl(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`;
	}
}));
function Ul(e) {
	return e = (e || 0) % 360, e < 0 ? e + 360 : e;
}
function Wl(e) {
	return Math.max(0, Math.min(1, e || 0));
}
function Gl(e, t, n) {
	return (e < 60 ? t + (n - t) * e / 60 : e < 180 ? n : e < 240 ? t + (n - t) * (240 - e) / 60 : t) * 255;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/constant.js
var Kl = (e) => () => e;
//#endregion
//#region ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/color.js
function ql(e, t) {
	return function(n) {
		return e + n * t;
	};
}
function Jl(e, t, n) {
	return e **= +n, t = t ** +n - e, n = 1 / n, function(r) {
		return (e + r * t) ** +n;
	};
}
function Yl(e) {
	return (e = +e) == 1 ? Xl : function(t, n) {
		return n - t ? Jl(t, n, e) : Kl(isNaN(t) ? n : t);
	};
}
function Xl(e, t) {
	var n = t - e;
	return n ? ql(e, n) : Kl(isNaN(e) ? t : e);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/rgb.js
var Zl = (function e(t) {
	var n = Yl(t);
	function r(e, t) {
		var r = n((e = jl(e)).r, (t = jl(t)).r), i = n(e.g, t.g), a = n(e.b, t.b), o = Xl(e.opacity, t.opacity);
		return function(t) {
			return e.r = r(t), e.g = i(t), e.b = a(t), e.opacity = o(t), e + "";
		};
	}
	return r.gamma = e, r;
})(1);
//#endregion
//#region ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/number.js
function Ql(e, t) {
	return e = +e, t = +t, function(n) {
		return e * (1 - n) + t * n;
	};
}
//#endregion
//#region ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/string.js
var $l = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, eu = new RegExp($l.source, "g");
function tu(e) {
	return function() {
		return e;
	};
}
function nu(e) {
	return function(t) {
		return e(t) + "";
	};
}
function ru(e, t) {
	var n = $l.lastIndex = eu.lastIndex = 0, r, i, a, o = -1, s = [], c = [];
	for (e += "", t += ""; (r = $l.exec(e)) && (i = eu.exec(t));) (a = i.index) > n && (a = t.slice(n, a), s[o] ? s[o] += a : s[++o] = a), (r = r[0]) === (i = i[0]) ? s[o] ? s[o] += i : s[++o] = i : (s[++o] = null, c.push({
		i: o,
		x: Ql(r, i)
	})), n = eu.lastIndex;
	return n < t.length && (a = t.slice(n), s[o] ? s[o] += a : s[++o] = a), s.length < 2 ? c[0] ? nu(c[0].x) : tu(t) : (t = c.length, function(e) {
		for (var n = 0, r; n < t; ++n) s[(r = c[n]).i] = r.x(e);
		return s.join("");
	});
}
//#endregion
//#region ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/decompose.js
var iu = 180 / Math.PI, au = {
	translateX: 0,
	translateY: 0,
	rotate: 0,
	skewX: 0,
	scaleX: 1,
	scaleY: 1
};
function ou(e, t, n, r, i, a) {
	var o, s, c;
	return (o = Math.sqrt(e * e + t * t)) && (e /= o, t /= o), (c = e * n + t * r) && (n -= e * c, r -= t * c), (s = Math.sqrt(n * n + r * r)) && (n /= s, r /= s, c /= s), e * r < t * n && (e = -e, t = -t, c = -c, o = -o), {
		translateX: i,
		translateY: a,
		rotate: Math.atan2(t, e) * iu,
		skewX: Math.atan(c) * iu,
		scaleX: o,
		scaleY: s
	};
}
//#endregion
//#region ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/parse.js
var su;
function cu(e) {
	let t = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(e + "");
	return t.isIdentity ? au : ou(t.a, t.b, t.c, t.d, t.e, t.f);
}
function lu(e) {
	return e == null || (su || (su = document.createElementNS("http://www.w3.org/2000/svg", "g")), su.setAttribute("transform", e), !(e = su.transform.baseVal.consolidate())) ? au : (e = e.matrix, ou(e.a, e.b, e.c, e.d, e.e, e.f));
}
//#endregion
//#region ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/index.js
function uu(e, t, n, r) {
	function i(e) {
		return e.length ? e.pop() + " " : "";
	}
	function a(e, r, i, a, o, s) {
		if (e !== i || r !== a) {
			var c = o.push("translate(", null, t, null, n);
			s.push({
				i: c - 4,
				x: Ql(e, i)
			}, {
				i: c - 2,
				x: Ql(r, a)
			});
		} else (i || a) && o.push("translate(" + i + t + a + n);
	}
	function o(e, t, n, a) {
		e === t ? t && n.push(i(n) + "rotate(" + t + r) : (e - t > 180 ? t += 360 : t - e > 180 && (e += 360), a.push({
			i: n.push(i(n) + "rotate(", null, r) - 2,
			x: Ql(e, t)
		}));
	}
	function s(e, t, n, a) {
		e === t ? t && n.push(i(n) + "skewX(" + t + r) : a.push({
			i: n.push(i(n) + "skewX(", null, r) - 2,
			x: Ql(e, t)
		});
	}
	function c(e, t, n, r, a, o) {
		if (e !== n || t !== r) {
			var s = a.push(i(a) + "scale(", null, ",", null, ")");
			o.push({
				i: s - 4,
				x: Ql(e, n)
			}, {
				i: s - 2,
				x: Ql(t, r)
			});
		} else (n !== 1 || r !== 1) && a.push(i(a) + "scale(" + n + "," + r + ")");
	}
	return function(t, n) {
		var r = [], i = [];
		return t = e(t), n = e(n), a(t.translateX, t.translateY, n.translateX, n.translateY, r, i), o(t.rotate, n.rotate, r, i), s(t.skewX, n.skewX, r, i), c(t.scaleX, t.scaleY, n.scaleX, n.scaleY, r, i), t = n = null, function(e) {
			for (var t = -1, n = i.length, a; ++t < n;) r[(a = i[t]).i] = a.x(e);
			return r.join("");
		};
	};
}
var du = uu(cu, "px, ", "px)", "deg)"), fu = uu(lu, ", ", ")", ")"), pu = 0, mu = 0, hu = 0, gu = 1e3, _u, vu, yu = 0, bu = 0, xu = 0, Su = typeof performance == "object" && performance.now ? performance : Date, Cu = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) {
	setTimeout(e, 17);
};
function wu() {
	return bu || (Cu(Tu), bu = Su.now() + xu);
}
function Tu() {
	bu = 0;
}
function Eu() {
	this._call = this._time = this._next = null;
}
Eu.prototype = Du.prototype = {
	constructor: Eu,
	restart: function(e, t, n) {
		if (typeof e != "function") throw TypeError("callback is not a function");
		n = (n == null ? wu() : +n) + (t == null ? 0 : +t), !this._next && vu !== this && (vu ? vu._next = this : _u = this, vu = this), this._call = e, this._time = n, Mu();
	},
	stop: function() {
		this._call && (this._call = null, this._time = Infinity, Mu());
	}
};
function Du(e, t, n) {
	var r = new Eu();
	return r.restart(e, t, n), r;
}
function Ou() {
	wu(), ++pu;
	for (var e = _u, t; e;) (t = bu - e._time) >= 0 && e._call.call(void 0, t), e = e._next;
	--pu;
}
function ku() {
	bu = (yu = Su.now()) + xu, pu = mu = 0;
	try {
		Ou();
	} finally {
		pu = 0, ju(), bu = 0;
	}
}
function Au() {
	var e = Su.now(), t = e - yu;
	t > gu && (xu -= t, yu = e);
}
function ju() {
	for (var e, t = _u, n, r = Infinity; t;) t._call ? (r > t._time && (r = t._time), e = t, t = t._next) : (n = t._next, t._next = null, t = e ? e._next = n : _u = n);
	vu = e, Mu(r);
}
function Mu(e) {
	pu || (mu && (mu = clearTimeout(mu)), e - bu > 24 ? (e < Infinity && (mu = setTimeout(ku, e - Su.now() - xu)), hu && (hu = clearInterval(hu))) : (hu || (yu = Su.now(), hu = setInterval(Au, gu)), pu = 1, Cu(ku)));
}
//#endregion
//#region ../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timeout.js
function Nu(e, t, n) {
	var r = new Eu();
	return t = t == null ? 0 : +t, r.restart((n) => {
		r.stop(), e(n + t);
	}, t, n), r;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/schedule.js
var Pu = nl("start", "end", "cancel", "interrupt"), Fu = [];
function Iu(e, t, n, r, i, a) {
	var o = e.__transition;
	if (!o) e.__transition = {};
	else if (n in o) return;
	Bu(e, n, {
		name: t,
		index: r,
		group: i,
		on: Pu,
		tween: Fu,
		time: a.time,
		delay: a.delay,
		duration: a.duration,
		ease: a.ease,
		timer: null,
		state: 0
	});
}
function Lu(e, t) {
	var n = zu(e, t);
	if (n.state > 0) throw Error("too late; already scheduled");
	return n;
}
function Ru(e, t) {
	var n = zu(e, t);
	if (n.state > 3) throw Error("too late; already running");
	return n;
}
function zu(e, t) {
	var n = e.__transition;
	if (!n || !(n = n[t])) throw Error("transition not found");
	return n;
}
function Bu(e, t, n) {
	var r = e.__transition, i;
	r[t] = n, n.timer = Du(a, 0, n.time);
	function a(e) {
		n.state = 1, n.timer.restart(o, n.delay, n.time), n.delay <= e && o(e - n.delay);
	}
	function o(a) {
		var l, u, d, f;
		if (n.state !== 1) return c();
		for (l in r) if (f = r[l], f.name === n.name) {
			if (f.state === 3) return Nu(o);
			f.state === 4 ? (f.state = 6, f.timer.stop(), f.on.call("interrupt", e, e.__data__, f.index, f.group), delete r[l]) : +l < t && (f.state = 6, f.timer.stop(), f.on.call("cancel", e, e.__data__, f.index, f.group), delete r[l]);
		}
		if (Nu(function() {
			n.state === 3 && (n.state = 4, n.timer.restart(s, n.delay, n.time), s(a));
		}), n.state = 2, n.on.call("start", e, e.__data__, n.index, n.group), n.state === 2) {
			for (n.state = 3, i = Array(d = n.tween.length), l = 0, u = -1; l < d; ++l) (f = n.tween[l].value.call(e, e.__data__, n.index, n.group)) && (i[++u] = f);
			i.length = u + 1;
		}
	}
	function s(t) {
		for (var r = t < n.duration ? n.ease.call(null, t / n.duration) : (n.timer.restart(c), n.state = 5, 1), a = -1, o = i.length; ++a < o;) i[a].call(e, r);
		n.state === 5 && (n.on.call("end", e, e.__data__, n.index, n.group), c());
	}
	function c() {
		for (var i in n.state = 6, n.timer.stop(), delete r[t], r) return;
		delete e.__transition;
	}
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/interrupt.js
function Vu(e, t) {
	var n = e.__transition, r, i, a = !0, o;
	if (n) {
		for (o in t = t == null ? null : t + "", n) {
			if ((r = n[o]).name !== t) {
				a = !1;
				continue;
			}
			i = r.state > 2 && r.state < 5, r.state = 6, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", e, e.__data__, r.index, r.group), delete n[o];
		}
		a && delete e.__transition;
	}
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/interrupt.js
function Hu(e) {
	return this.each(function() {
		Vu(this, e);
	});
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/tween.js
function Uu(e, t) {
	var n, r;
	return function() {
		var i = Ru(this, e), a = i.tween;
		if (a !== n) {
			r = n = a;
			for (var o = 0, s = r.length; o < s; ++o) if (r[o].name === t) {
				r = r.slice(), r.splice(o, 1);
				break;
			}
		}
		i.tween = r;
	};
}
function Wu(e, t, n) {
	var r, i;
	if (typeof n != "function") throw Error();
	return function() {
		var a = Ru(this, e), o = a.tween;
		if (o !== r) {
			i = (r = o).slice();
			for (var s = {
				name: t,
				value: n
			}, c = 0, l = i.length; c < l; ++c) if (i[c].name === t) {
				i[c] = s;
				break;
			}
			c === l && i.push(s);
		}
		a.tween = i;
	};
}
function Gu(e, t) {
	var n = this._id;
	if (e += "", arguments.length < 2) {
		for (var r = zu(this.node(), n).tween, i = 0, a = r.length, o; i < a; ++i) if ((o = r[i]).name === e) return o.value;
		return null;
	}
	return this.each((t == null ? Uu : Wu)(n, e, t));
}
function Ku(e, t, n) {
	var r = e._id;
	return e.each(function() {
		var e = Ru(this, r);
		(e.value || (e.value = {}))[t] = n.apply(this, arguments);
	}), function(e) {
		return zu(e, r).value[t];
	};
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/interpolate.js
function qu(e, t) {
	var n;
	return (typeof t == "number" ? Ql : t instanceof Dl ? Zl : (n = Dl(t)) ? (t = n, Zl) : ru)(e, t);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attr.js
function Ju(e) {
	return function() {
		this.removeAttribute(e);
	};
}
function Yu(e) {
	return function() {
		this.removeAttributeNS(e.space, e.local);
	};
}
function Xu(e, t, n) {
	var r, i = n + "", a;
	return function() {
		var o = this.getAttribute(e);
		return o === i ? null : o === r ? a : a = t(r = o, n);
	};
}
function Zu(e, t, n) {
	var r, i = n + "", a;
	return function() {
		var o = this.getAttributeNS(e.space, e.local);
		return o === i ? null : o === r ? a : a = t(r = o, n);
	};
}
function Qu(e, t, n) {
	var r, i, a;
	return function() {
		var o, s = n(this), c;
		return s == null ? void this.removeAttribute(e) : (o = this.getAttribute(e), c = s + "", o === c ? null : o === r && c === i ? a : (i = c, a = t(r = o, s)));
	};
}
function $u(e, t, n) {
	var r, i, a;
	return function() {
		var o, s = n(this), c;
		return s == null ? void this.removeAttributeNS(e.space, e.local) : (o = this.getAttributeNS(e.space, e.local), c = s + "", o === c ? null : o === r && c === i ? a : (i = c, a = t(r = o, s)));
	};
}
function ed(e, t) {
	var n = si(e), r = n === "transform" ? fu : qu;
	return this.attrTween(e, typeof t == "function" ? (n.local ? $u : Qu)(n, r, Ku(this, "attr." + e, t)) : t == null ? (n.local ? Yu : Ju)(n) : (n.local ? Zu : Xu)(n, r, t));
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attrTween.js
function td(e, t) {
	return function(n) {
		this.setAttribute(e, t.call(this, n));
	};
}
function nd(e, t) {
	return function(n) {
		this.setAttributeNS(e.space, e.local, t.call(this, n));
	};
}
function rd(e, t) {
	var n, r;
	function i() {
		var i = t.apply(this, arguments);
		return i !== r && (n = (r = i) && nd(e, i)), n;
	}
	return i._value = t, i;
}
function id(e, t) {
	var n, r;
	function i() {
		var i = t.apply(this, arguments);
		return i !== r && (n = (r = i) && td(e, i)), n;
	}
	return i._value = t, i;
}
function ad(e, t) {
	var n = "attr." + e;
	if (arguments.length < 2) return (n = this.tween(n)) && n._value;
	if (t == null) return this.tween(n, null);
	if (typeof t != "function") throw Error();
	var r = si(e);
	return this.tween(n, (r.local ? rd : id)(r, t));
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/delay.js
function od(e, t) {
	return function() {
		Lu(this, e).delay = +t.apply(this, arguments);
	};
}
function sd(e, t) {
	return t = +t, function() {
		Lu(this, e).delay = t;
	};
}
function cd(e) {
	var t = this._id;
	return arguments.length ? this.each((typeof e == "function" ? od : sd)(t, e)) : zu(this.node(), t).delay;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/duration.js
function ld(e, t) {
	return function() {
		Ru(this, e).duration = +t.apply(this, arguments);
	};
}
function ud(e, t) {
	return t = +t, function() {
		Ru(this, e).duration = t;
	};
}
function dd(e) {
	var t = this._id;
	return arguments.length ? this.each((typeof e == "function" ? ld : ud)(t, e)) : zu(this.node(), t).duration;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/ease.js
function fd(e, t) {
	if (typeof t != "function") throw Error();
	return function() {
		Ru(this, e).ease = t;
	};
}
function pd(e) {
	var t = this._id;
	return arguments.length ? this.each(fd(t, e)) : zu(this.node(), t).ease;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/easeVarying.js
function md(e, t) {
	return function() {
		var n = t.apply(this, arguments);
		if (typeof n != "function") throw Error();
		Ru(this, e).ease = n;
	};
}
function hd(e) {
	if (typeof e != "function") throw Error();
	return this.each(md(this._id, e));
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/filter.js
function gd(e) {
	typeof e != "function" && (e = yi(e));
	for (var t = this._groups, n = t.length, r = Array(n), i = 0; i < n; ++i) for (var a = t[i], o = a.length, s = r[i] = [], c, l = 0; l < o; ++l) (c = a[l]) && e.call(c, c.__data__, l, a) && s.push(c);
	return new Gd(r, this._parents, this._name, this._id);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/merge.js
function _d(e) {
	if (e._id !== this._id) throw Error();
	for (var t = this._groups, n = e._groups, r = t.length, i = n.length, a = Math.min(r, i), o = Array(r), s = 0; s < a; ++s) for (var c = t[s], l = n[s], u = c.length, d = o[s] = Array(u), f, p = 0; p < u; ++p) (f = c[p] || l[p]) && (d[p] = f);
	for (; s < r; ++s) o[s] = t[s];
	return new Gd(o, this._parents, this._name, this._id);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/on.js
function vd(e) {
	return (e + "").trim().split(/^|\s+/).every(function(e) {
		var t = e.indexOf(".");
		return t >= 0 && (e = e.slice(0, t)), !e || e === "start";
	});
}
function yd(e, t, n) {
	var r, i, a = vd(t) ? Lu : Ru;
	return function() {
		var o = a(this, e), s = o.on;
		s !== r && (i = (r = s).copy()).on(t, n), o.on = i;
	};
}
function bd(e, t) {
	var n = this._id;
	return arguments.length < 2 ? zu(this.node(), n).on.on(e) : this.each(yd(n, e, t));
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/remove.js
function xd(e) {
	return function() {
		var t = this.parentNode;
		for (var n in this.__transition) if (+n !== e) return;
		t && t.removeChild(this);
	};
}
function Sd() {
	return this.on("end.remove", xd(this._id));
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/select.js
function Cd(e) {
	var t = this._name, n = this._id;
	typeof e != "function" && (e = fi(e));
	for (var r = this._groups, i = r.length, a = Array(i), o = 0; o < i; ++o) for (var s = r[o], c = s.length, l = a[o] = Array(c), u, d, f = 0; f < c; ++f) (u = s[f]) && (d = e.call(u, u.__data__, f, s)) && ("__data__" in u && (d.__data__ = u.__data__), l[f] = d, Iu(l[f], t, n, f, l, zu(u, n)));
	return new Gd(a, this._parents, t, n);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selectAll.js
function wd(e) {
	var t = this._name, n = this._id;
	typeof e != "function" && (e = gi(e));
	for (var r = this._groups, i = r.length, a = [], o = [], s = 0; s < i; ++s) for (var c = r[s], l = c.length, u, d = 0; d < l; ++d) if (u = c[d]) {
		for (var f = e.call(u, u.__data__, d, c), p, m = zu(u, n), h = 0, g = f.length; h < g; ++h) (p = f[h]) && Iu(p, t, n, h, f, m);
		a.push(f), o.push(u);
	}
	return new Gd(a, o, t, n);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selection.js
var Td = no.prototype.constructor;
function Ed() {
	return new Td(this._groups, this._parents);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/style.js
function Dd(e, t) {
	var n, r, i;
	return function() {
		var a = la(this, e), o = (this.style.removeProperty(e), la(this, e));
		return a === o ? null : a === n && o === r ? i : i = t(n = a, r = o);
	};
}
function Od(e) {
	return function() {
		this.style.removeProperty(e);
	};
}
function kd(e, t, n) {
	var r, i = n + "", a;
	return function() {
		var o = la(this, e);
		return o === i ? null : o === r ? a : a = t(r = o, n);
	};
}
function Ad(e, t, n) {
	var r, i, a;
	return function() {
		var o = la(this, e), s = n(this), c = s + "";
		return s == null && (c = s = (this.style.removeProperty(e), la(this, e))), o === c ? null : o === r && c === i ? a : (i = c, a = t(r = o, s));
	};
}
function jd(e, t) {
	var n, r, i, a = "style." + t, o = "end." + a, s;
	return function() {
		var c = Ru(this, e), l = c.on, u = c.value[a] == null ? s || (s = Od(t)) : void 0;
		(l !== n || i !== u) && (r = (n = l).copy()).on(o, i = u), c.on = r;
	};
}
function Md(e, t, n) {
	var r = (e += "") == "transform" ? du : qu;
	return t == null ? this.styleTween(e, Dd(e, r)).on("end.style." + e, Od(e)) : typeof t == "function" ? this.styleTween(e, Ad(e, r, Ku(this, "style." + e, t))).each(jd(this._id, e)) : this.styleTween(e, kd(e, r, t), n).on("end.style." + e, null);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/styleTween.js
function Nd(e, t, n) {
	return function(r) {
		this.style.setProperty(e, t.call(this, r), n);
	};
}
function Pd(e, t, n) {
	var r, i;
	function a() {
		var a = t.apply(this, arguments);
		return a !== i && (r = (i = a) && Nd(e, a, n)), r;
	}
	return a._value = t, a;
}
function Fd(e, t, n) {
	var r = "style." + (e += "");
	if (arguments.length < 2) return (r = this.tween(r)) && r._value;
	if (t == null) return this.tween(r, null);
	if (typeof t != "function") throw Error();
	return this.tween(r, Pd(e, t, n == null ? "" : n));
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/text.js
function Id(e) {
	return function() {
		this.textContent = e;
	};
}
function Ld(e) {
	return function() {
		var t = e(this);
		this.textContent = t == null ? "" : t;
	};
}
function Rd(e) {
	return this.tween("text", typeof e == "function" ? Ld(Ku(this, "text", e)) : Id(e == null ? "" : e + ""));
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/textTween.js
function zd(e) {
	return function(t) {
		this.textContent = e.call(this, t);
	};
}
function Bd(e) {
	var t, n;
	function r() {
		var r = e.apply(this, arguments);
		return r !== n && (t = (n = r) && zd(r)), t;
	}
	return r._value = e, r;
}
function Vd(e) {
	var t = "text";
	if (arguments.length < 1) return (t = this.tween(t)) && t._value;
	if (e == null) return this.tween(t, null);
	if (typeof e != "function") throw Error();
	return this.tween(t, Bd(e));
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/transition.js
function Hd() {
	for (var e = this._name, t = this._id, n = qd(), r = this._groups, i = r.length, a = 0; a < i; ++a) for (var o = r[a], s = o.length, c, l = 0; l < s; ++l) if (c = o[l]) {
		var u = zu(c, t);
		Iu(c, e, n, l, o, {
			time: u.time + u.delay + u.duration,
			delay: 0,
			duration: u.duration,
			ease: u.ease
		});
	}
	return new Gd(r, this._parents, e, n);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/end.js
function Ud() {
	var e, t, n = this, r = n._id, i = n.size();
	return new Promise(function(a, o) {
		var s = { value: o }, c = { value: function() {
			--i === 0 && a();
		} };
		n.each(function() {
			var n = Ru(this, r), i = n.on;
			i !== e && (t = (e = i).copy(), t._.cancel.push(s), t._.interrupt.push(s), t._.end.push(c)), n.on = t;
		}), i === 0 && a();
	});
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/index.js
var Wd = 0;
function Gd(e, t, n, r) {
	this._groups = e, this._parents = t, this._name = n, this._id = r;
}
function Kd(e) {
	return no().transition(e);
}
function qd() {
	return ++Wd;
}
var Jd = no.prototype;
Gd.prototype = Kd.prototype = {
	constructor: Gd,
	select: Cd,
	selectAll: wd,
	selectChild: Jd.selectChild,
	selectChildren: Jd.selectChildren,
	filter: gd,
	merge: _d,
	selection: Ed,
	transition: Hd,
	call: Jd.call,
	nodes: Jd.nodes,
	node: Jd.node,
	size: Jd.size,
	empty: Jd.empty,
	each: Jd.each,
	on: bd,
	attr: ed,
	attrTween: ad,
	style: Md,
	styleTween: Fd,
	text: Rd,
	textTween: Vd,
	remove: Sd,
	tween: Gu,
	delay: cd,
	duration: dd,
	ease: pd,
	easeVarying: hd,
	end: Ud,
	[Symbol.iterator]: Jd[Symbol.iterator]
};
//#endregion
//#region ../../node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/quad.js
function Yd(e) {
	return ((e *= 2) <= 1 ? e * e : --e * (2 - e) + 1) / 2;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js
function Xd(e) {
	return ((e *= 2) <= 1 ? e * e * e : (e -= 2) * e * e + 2) / 2;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/transition.js
var Zd = {
	time: null,
	delay: 0,
	duration: 250,
	ease: Xd
};
function Qd(e, t) {
	for (var n; !(n = e.__transition) || !(n = n[t]);) if (!(e = e.parentNode)) throw Error(`transition ${t} not found`);
	return n;
}
function $d(e) {
	var t, n;
	e instanceof Gd ? (t = e._id, e = e._name) : (t = qd(), (n = Zd).time = wu(), e = e == null ? null : e + "");
	for (var r = this._groups, i = r.length, a = 0; a < i; ++a) for (var o = r[a], s = o.length, c, l = 0; l < s; ++l) (c = o[l]) && Iu(c, e, t, l, o, n || Qd(c, t));
	return new Gd(r, this._parents, e, t);
}
no.prototype.interrupt = Hu, no.prototype.transition = $d;
//#endregion
//#region ../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/brush.js
var { abs: ef, max: tf, min: nf } = Math;
["w", "e"].map(rf), ["n", "s"].map(rf), [
	"n",
	"w",
	"e",
	"s",
	"nw",
	"ne",
	"sw",
	"se"
].map(rf);
function rf(e) {
	return { type: e };
}
//#endregion
//#region ../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.js
function af(e, t, n) {
	this.k = e, this.x = t, this.y = n;
}
af.prototype = {
	constructor: af,
	scale: function(e) {
		return e === 1 ? this : new af(this.k * e, this.x, this.y);
	},
	translate: function(e, t) {
		return e === 0 & t === 0 ? this : new af(this.k, this.x + this.k * e, this.y + this.k * t);
	},
	apply: function(e) {
		return [e[0] * this.k + this.x, e[1] * this.k + this.y];
	},
	applyX: function(e) {
		return e * this.k + this.x;
	},
	applyY: function(e) {
		return e * this.k + this.y;
	},
	invert: function(e) {
		return [(e[0] - this.x) / this.k, (e[1] - this.y) / this.k];
	},
	invertX: function(e) {
		return (e - this.x) / this.k;
	},
	invertY: function(e) {
		return (e - this.y) / this.k;
	},
	rescaleX: function(e) {
		return e.copy().domain(e.range().map(this.invertX, this).map(e.invert, e));
	},
	rescaleY: function(e) {
		return e.copy().domain(e.range().map(this.invertY, this).map(e.invert, e));
	},
	toString: function() {
		return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
	}
};
var of = new af(1, 0, 0);
sf.prototype = af.prototype;
function sf(e) {
	for (; !e.__zoom;) if (!(e = e.parentNode)) return of;
	return e.__zoom;
}
//#endregion
//#region src/utils/is-pathway-layer.ts
function cf(e) {
	return e.toLowerCase().includes(v);
}
//#endregion
//#region src/engine/canvases.ts
var lf = /* @__PURE__ */ new Map();
function uf(e, t) {
	let n = t.toUpperCase();
	if (!lf.has(n)) {
		let r = document.createElement("canvas"), i = e * 2 * devicePixelRatio + 2;
		r.width = i, r.height = i;
		let a = r.getContext("2d");
		a.fillStyle = t, a.beginPath(), a.arc(i / 2, i / 2, e * devicePixelRatio, 0, 2 * Math.PI), a.fill(), lf.set(n, r);
	}
	return lf.get(n);
}
var df = /* @__PURE__ */ new Map();
function ff(e, t) {
	let n = e;
	if (df.has(n)) return df.get(n);
	let r = e, i = r * 1.4, a = Math.ceil(r * t), o = Math.ceil(i * t), s = document.createElement("canvas");
	s.width = a, s.height = o;
	let c = s.getContext("2d");
	return c.scale(t, t), c.fillStyle = "#fdbf2b", c.strokeStyle = "#fff", c.lineWidth = 4 / t, c.beginPath(), c.moveTo(0, 0), c.lineTo(0, i), c.lineTo(r / 2, i - r / 2), c.lineTo(r, i), c.lineTo(r, 0), c.lineTo(0, 0), c.fill(), c.stroke(), df.set(n, s), s;
}
function pf(e, t, n, r, i = 1, a, o) {
	let s = n * i, c = r * i;
	return new mr({
		x: e,
		y: t
	}, {
		x: s,
		y: c
	}, a, o);
}
//#endregion
//#region src/engine/fonts.ts
var mf = `${k}fonts/oswald-v17-cyrillic_latin-500.woff`, hf = `${k}fonts/oswald-v17-cyrillic_latin-300.woff`;
function gf() {
	var e;
	let t = i();
	return (e = t.customCssFonts) != null && e.length ? t.customCssFonts : [];
}
//#endregion
//#region src/engine/defs.ts
function _f(e, t) {
	return yf(Er.fromSvg(e), t);
}
function vf(e, t) {
	if (!e) throw Error("Create ShapeDef: mesh is not provided");
	let n = e.positions.map((e) => {
		var t;
		return {
			x: e[0],
			y: Math.abs(e[1]),
			z: (t = e[2]) == null ? 0 : t
		};
	}), r = e.cells;
	return yf(new nr(n, r), t);
}
function yf(e, t = "#000") {
	if (!e || !(qr(e) || Jr(e) || Yr(e) || Xr(e))) throw Error("Invalid shape definition");
	return {
		shape: e,
		color: t
	};
}
function bf(e, t, n) {
	if (!e) throw Error("Image source is not provided");
	return {
		source: e,
		bounds: t,
		...n
	};
}
function xf(e, t, n, r, i) {
	if (e.length === 0) throw Error("Invalid text lines");
	return {
		lines: e,
		bounds: t,
		padding: n,
		alignment: r,
		...i
	};
}
function Sf(e, t, n, r = [void 0, void 0]) {
	let [i, a] = e, o = [{
		text: i.join("\n"),
		fontUrl: r[0] || mf,
		color: t,
		fontSize: n
	}];
	return a.length && o.push({
		text: a.join("\n"),
		fontUrl: r[1] || hf,
		color: t,
		fontSize: n
	}), o;
}
function Cf(e, t, n) {
	if (!e) throw Error("Layer name is required");
	return t || (t = []), {
		name: e,
		children: t,
		...n
	};
}
function wf(e, t, n) {
	let r = t instanceof Er ? t : Er.fromSvg(t);
	return {
		rootLayer: Cf("root", e),
		background: n,
		viewbox: r
	};
}
function Tf(e, t = "#000", n = 1.5) {
	let r = uf(n, t);
	return bf(r, new mr(e.center, {
		x: r.width,
		y: r.height
	}, e.rotation, e.elevation));
}
//#endregion
//#region src/utils/loadBlob.ts
async function Ef(e) {
	try {
		let t = await fetch(e, {
			mode: "cors",
			credentials: "omit"
		});
		if (!t.ok) return null;
		let n = await t.blob();
		return n.type.startsWith("image/") ? n : null;
	} catch {
		return null;
	}
}
//#endregion
//#region src/utils/rasterize-svg.ts
function Df(e) {
	return e.type.startsWith("image/svg+xml");
}
async function Of(e) {
	let t = URL.createObjectURL(e);
	try {
		let e = await fe(t);
		if (!(e != null && e.naturalWidth) || !e.naturalHeight) return null;
		let n = document.createElement("canvas");
		n.width = e.naturalWidth, n.height = e.naturalHeight;
		let r = n.getContext("2d");
		return r ? (r.drawImage(e, 0, 0), n) : null;
	} finally {
		URL.revokeObjectURL(t);
	}
}
async function kf(e) {
	let t = await Of(e);
	return t ? Af(t) : null;
}
function Af(e) {
	return new Promise((t) => {
		try {
			e.toBlob((e) => t(e), "image/png");
		} catch {
			t(null);
		}
	});
}
//#endregion
//#region src/utils/loadLayerImages.ts
async function jf(e) {
	let t = /* @__PURE__ */ new Map(), n = (e) => {
		let n = t.get(e);
		return n || (n = Mf(e), t.set(e, n)), n;
	};
	return (await Promise.all(e.map(async (e) => {
		var t, r, i;
		let a = (t = e.getAttribute("xlink:href")) == null ? e.getAttribute("href") : t, o = a ? await n(a) : null;
		return o ? {
			bounds: {
				x: e.x.animVal.value,
				y: e.y.animVal.value,
				width: e.width.animVal.value,
				height: e.height.animVal.value,
				angle: (r = (i = e.transform) == null || (i = i.animVal[0]) == null ? void 0 : i.angle) == null ? 0 : r
			},
			source: o,
			booth: null
		} : null;
	}))).filter((e) => e !== null);
}
async function Mf(e) {
	let t = await Ef(e);
	return t ? Df(t) ? kf(t) : t : null;
}
async function Nf(e) {
	var t;
	let n = [], r = [], i = [], a = io(Mo(e)).select(`[data-layer="${e.name}"]`), o = a.selectAll(":scope > *:not([data-tagname='efp-booth']):not(g[data-is-editable='false']) path, :scope > path").nodes(), s = a.selectAll(":scope g[data-layer] > g[data-is-editable='false'] path, :scope > g[data-is-editable='false'] path, :scope > path[data-tagname='ptext']").nodes(), c = Q.layerStore.mode === $F.Default ? "" : ((t = e.rootParent) == null ? void 0 : t.name) || e.name;
	for (let e of o) {
		let t = +e.getAttribute("data-index"), r;
		e.tagName === "path" && t !== -1 ? r = Pf({
			color: e.style.fill,
			index: t
		}, c) : e.tagName === "rect" && (r = _f(e)), r && n.push(r);
	}
	for (let e of s) {
		let t = +e.getAttribute("data-index"), n;
		e.tagName === "path" && t !== -1 ? n = Pf({
			color: e.style.fill,
			index: t
		}, c) : e.tagName === "rect" && (n = _f(e)), n && r.push(n);
	}
	return i.push({
		name: "bg",
		children: n
	}), i.push({
		name: "fg",
		children: r
	}), Promise.resolve({
		name: e.name,
		children: i.filter((e) => e.children.length)
	});
}
function Pf(e, t) {
	if (e.index === -1 || Number.isNaN(e.index)) return;
	(!e.color || e.color === "none") && (e.color = "transparent");
	let n = vf(jo(parseInt(e.index.toString()), t), e.color);
	return n.unblinking = e.unblinking, n;
}
//#endregion
//#region ../renderer/src/utils/math.ts
function Ff(e, t, n) {
	return Math.min(Math.max(e, t), n);
}
function If(e, t) {
	return (e % t + t) % t;
}
function Lf(e, t) {
	let n = e.elements, r = t * 4;
	return Math.hypot(n[r], n[r + 1], n[r + 2]);
}
//#endregion
//#region ../renderer/src/controls/zoom-to.ts
function Rf(e) {
	let { target: t, space: n, bearing: r, region: i, padding: a = 0, maxZoom: o } = e, s = Bf(t, n), c = gr({
		center: s.center,
		size: s.size,
		rotation: r
	}), { width: l, height: u } = c.size;
	if (l <= 0 || u <= 0 || i.width <= 0 || i.height <= 0) return;
	let d = 1 - 2 * a, f = Math.min(i.width * d / l, i.height * d / u), p = o === void 0 ? f : Math.min(f, o);
	if (!(p > 0)) return;
	let m = new Jn(-i.offsetX / p, -i.offsetY / p).rotate(r, Vf);
	return {
		center: {
			x: c.center.x + m.x,
			y: c.center.y + m.y
		},
		zoom: p
	};
}
function zf(e, t, n, r, i) {
	if (!e) return {
		width: t * r,
		height: n * r,
		offsetX: 0,
		offsetY: 0
	};
	let a = i != null && i.enabled ? i.fullWidth / i.width : 1, o = i != null && i.enabled ? i.fullWidth / 2 - i.offsetX : t / 2, s = i != null && i.enabled ? i.fullHeight / 2 - i.offsetY : n / 2;
	return {
		width: e.size.width / a * r,
		height: e.size.height / a * r,
		offsetX: (e.center.x - o) / a * r,
		offsetY: (e.center.y - s) / a * r
	};
}
function Bf(e, t) {
	let n = t.planToWorld({
		...e.min,
		z: 0
	}), r = t.planToWorld({
		...e.max,
		z: 0
	});
	return Er.fromMinMax(n, r);
}
var Vf = {
	x: 0,
	y: 0
}, Hf = class {
	constructor(e) {
		this.context = e, this.withInvalidate = (e) => (this.context.invalidate(), e());
	}
	async zoomTo(e, t) {
		let { controls: n, camera: r, space: i, view: a, width: o, height: s, dpr: c } = this.context;
		if (!n || !r) return;
		let l = Rf({
			target: e,
			space: i,
			bearing: Uf(n),
			region: zf(t == null ? void 0 : t.within, o, s, c, a()),
			padding: t == null ? void 0 : t.padding,
			maxZoom: t == null ? void 0 : t.maxZoom
		});
		if (!l) return;
		let u = !(t != null && t.immediate);
		await this.withInvalidate(() => Promise.all([n.moveTo(l.center.x, l.center.y, 0, u), n.dollyTo(r.zoomFactorToDistance(l.zoom), u)]));
	}
	zoomBy(e, t) {
		let { controls: n, camera: r } = this.context;
		return !n || !r ? Kf : this.withInvalidate(() => n.dollyTo(r.zoomFactorToDistance(r.zoomFactor * e), !(t != null && t.immediate)));
	}
	panTo(e, t) {
		let { controls: n, space: r } = this.context;
		if (!n) return Kf;
		let i = Wf(r, e);
		return this.withInvalidate(() => n.moveTo(i.x, i.y, i.z, !(t != null && t.immediate)));
	}
	panBy(e, t) {
		let { controls: n, space: r } = this.context;
		if (!n) return Kf;
		let i = Wf(r, qf, Yf), a = Wf(r, e), o = n.getTarget(Xf);
		return this.withInvalidate(() => n.moveTo(o.x + a.x - i.x, o.y + a.y - i.y, o.z + a.z - i.z, !(t != null && t.immediate)));
	}
	rollTo(e, t) {
		let { controls: n } = this.context;
		if (!n) return Kf;
		let r = Kn(-Hn(e), n.azimuthAngle);
		return this.withInvalidate(() => n.rotateAzimuthTo(n.azimuthAngle + r, !(t != null && t.immediate)));
	}
	rollBy(e, t) {
		let { controls: n } = this.context;
		return n ? this.withInvalidate(() => n.rotateAzimuthTo(n.azimuthAngle - Hn(e), !(t != null && t.immediate))) : Kf;
	}
	pitchTo(e, t) {
		let { controls: n } = this.context;
		return n ? this.withInvalidate(() => n.rotatePolarTo(Hn(e), !(t != null && t.immediate))) : Kf;
	}
	pitchBy(e, t) {
		let { controls: n } = this.context;
		return n ? this.withInvalidate(() => n.rotatePolarTo(n.polarAngle + Hn(e), !(t != null && t.immediate))) : Kf;
	}
	async reset(e = Gf, t) {
		let { controls: n, camera: r } = this.context;
		if (!n || !r) return;
		let i = !(t != null && t.immediate), a = [];
		e.pan && a.push(n.moveTo(0, 0, 0, i)), e.zoom && a.push(n.dollyTo(r.zoomFactorToDistance(1), i)), e.roll && a.push(n.normalizeRotations().rotateAzimuthTo(0, i)), e.pitch && a.push(n.rotatePolarTo(n.minPolarAngle, i)), await this.withInvalidate(() => Promise.all(a));
	}
};
function Uf(e) {
	return If(-e.azimuthAngle, 2 * Math.PI);
}
function Wf(e, t, n = Jf) {
	return e.planToWorld({
		x: t.x,
		y: t.y,
		z: 0
	}, n);
}
var Gf = {
	pan: !0,
	zoom: !0,
	roll: !0,
	pitch: !0
}, Kf = Promise.resolve(), qf = {
	x: 0,
	y: 0
}, Jf = new I(), Yf = new I(), Xf = new I();
//#endregion
//#region ../../node_modules/.pnpm/react-use-measure@2.1.7_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-use-measure/dist/index.js
function Zf(e, t) {
	let n;
	return (...r) => {
		window.clearTimeout(n), n = window.setTimeout(() => e(...r), t);
	};
}
function Qf({ debounce: e, scroll: t, polyfill: n, offsetSize: r } = {
	debounce: 0,
	scroll: !1,
	offsetSize: !1
}) {
	let i = n || (typeof window > "u" ? class {} : window.ResizeObserver);
	if (!i) throw Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");
	let [a, o] = (0, L.useState)({
		left: 0,
		top: 0,
		width: 0,
		height: 0,
		bottom: 0,
		right: 0,
		x: 0,
		y: 0
	}), s = (0, L.useRef)({
		element: null,
		scrollContainers: null,
		resizeObserver: null,
		lastBounds: a,
		orientationHandler: null
	}), c = e ? typeof e == "number" ? e : e.scroll : null, l = e ? typeof e == "number" ? e : e.resize : null, u = (0, L.useRef)(!1);
	(0, L.useEffect)(() => (u.current = !0, () => void (u.current = !1)));
	let [d, f, p] = (0, L.useMemo)(() => {
		let e = () => {
			if (!s.current.element) return;
			let { left: e, top: t, width: n, height: i, bottom: a, right: c, x: l, y: d } = s.current.element.getBoundingClientRect(), f = {
				left: e,
				top: t,
				width: n,
				height: i,
				bottom: a,
				right: c,
				x: l,
				y: d
			};
			s.current.element instanceof HTMLElement && r && (f.height = s.current.element.offsetHeight, f.width = s.current.element.offsetWidth), Object.freeze(f), u.current && !rp(s.current.lastBounds, f) && o(s.current.lastBounds = f);
		};
		return [
			e,
			l ? Zf(e, l) : e,
			c ? Zf(e, c) : e
		];
	}, [
		o,
		r,
		c,
		l
	]);
	function m() {
		s.current.scrollContainers && (s.current.scrollContainers.forEach((e) => e.removeEventListener("scroll", p, !0)), s.current.scrollContainers = null), s.current.resizeObserver && (s.current.resizeObserver.disconnect(), s.current.resizeObserver = null), s.current.orientationHandler && ("orientation" in screen && "removeEventListener" in screen.orientation ? screen.orientation.removeEventListener("change", s.current.orientationHandler) : "onorientationchange" in window && window.removeEventListener("orientationchange", s.current.orientationHandler));
	}
	function h() {
		s.current.element && (s.current.resizeObserver = new i(p), s.current.resizeObserver.observe(s.current.element), t && s.current.scrollContainers && s.current.scrollContainers.forEach((e) => e.addEventListener("scroll", p, {
			capture: !0,
			passive: !0
		})), s.current.orientationHandler = () => {
			p();
		}, "orientation" in screen && "addEventListener" in screen.orientation ? screen.orientation.addEventListener("change", s.current.orientationHandler) : "onorientationchange" in window && window.addEventListener("orientationchange", s.current.orientationHandler));
	}
	return ep(p, !!t), $f(f), (0, L.useEffect)(() => {
		m(), h();
	}, [
		t,
		p,
		f
	]), (0, L.useEffect)(() => m, []), [
		(e) => {
			!e || e === s.current.element || (m(), s.current.element = e, s.current.scrollContainers = tp(e), h());
		},
		a,
		d
	];
}
function $f(e) {
	(0, L.useEffect)(() => {
		let t = e;
		return window.addEventListener("resize", t), () => void window.removeEventListener("resize", t);
	}, [e]);
}
function ep(e, t) {
	(0, L.useEffect)(() => {
		if (t) {
			let t = e;
			return window.addEventListener("scroll", t, {
				capture: !0,
				passive: !0
			}), () => void window.removeEventListener("scroll", t, !0);
		}
	}, [e, t]);
}
function tp(e) {
	let t = [];
	if (!e || e === document.body) return t;
	let { overflow: n, overflowX: r, overflowY: i } = window.getComputedStyle(e);
	return [
		n,
		r,
		i
	].some((e) => e === "auto" || e === "scroll") && t.push(e), [...t, ...tp(e.parentElement)];
}
var np = [
	"x",
	"y",
	"top",
	"bottom",
	"left",
	"right",
	"width",
	"height"
], rp = (e, t) => np.every((n) => e[n] === t[n]);
me();
function ip({ ref: e, children: t, fallback: n, resize: r, style: i, gl: a, events: o = vn, eventSource: s, eventPrefix: c, shadows: l, linear: u, flat: d, legacy: f, orthographic: p, frameloop: m, dpr: h, performance: g, raycaster: _, camera: v, scene: y, onPointerMissed: b, onCreated: x, ...S }) {
	L.useMemo(() => jt(Ge), []);
	let C = Lt(), [w, T] = Qf({
		scroll: !0,
		debounce: {
			scroll: 50,
			resize: 0
		},
		...r
	}), E = L.useRef(null), D = L.useRef(null);
	L.useImperativeHandle(e, () => E.current);
	let O = xn(b), [k, A] = L.useState(!1), [j, ee] = L.useState(!1);
	if (k) throw k;
	if (j) throw j;
	let te = L.useRef(null);
	return ht(() => {
		let e = E.current;
		if (T.width > 0 && T.height > 0 && e) {
			te.current || (te.current = Et(e));
			async function n() {
				await te.current.configure({
					gl: a,
					scene: y,
					events: o,
					shadows: l,
					linear: u,
					flat: d,
					legacy: f,
					orthographic: p,
					frameloop: m,
					dpr: h,
					performance: g,
					raycaster: _,
					camera: v,
					size: T,
					onPointerMissed: (...e) => O.current == null ? void 0 : O.current(...e),
					onCreated: (e) => {
						e.events.connect == null || e.events.connect(s ? an(s) ? s.current : s : D.current), c && e.setEvents({ compute: (e, t) => {
							let n = e[c + "X"], r = e[c + "Y"];
							t.pointer.set(n / t.size.width * 2 - 1, -(r / t.size.height) * 2 + 1), t.raycaster.setFromCamera(t.pointer, t.camera);
						} }), x == null || x(e);
					}
				}), te.current.render(/*#__PURE__*/ (0, R.jsx)(C, { children: /*#__PURE__*/ (0, R.jsx)(tn, {
					set: ee,
					children: /*#__PURE__*/ (0, R.jsx)(L.Suspense, {
						fallback: /*#__PURE__*/ (0, R.jsx)(vt, { set: A }),
						children: t == null ? null : t
					})
				}) }));
			}
			n();
		}
	}), L.useEffect(() => {
		let e = E.current;
		if (e) return () => Xt(e);
	}, []), /*#__PURE__*/ (0, R.jsx)("div", {
		ref: D,
		style: {
			position: "relative",
			width: "100%",
			height: "100%",
			overflow: "hidden",
			pointerEvents: s ? "none" : "auto",
			...i
		},
		...S,
		children: /*#__PURE__*/ (0, R.jsx)("div", {
			ref: w,
			style: {
				width: "100%",
				height: "100%"
			},
			children: /*#__PURE__*/ (0, R.jsx)("canvas", {
				ref: E,
				style: { display: "block" },
				children: n
			})
		})
	});
}
function ap(e) {
	return /*#__PURE__*/ (0, R.jsx)(Tn, { children: /*#__PURE__*/ (0, R.jsx)(ip, { ...e }) });
}
//#endregion
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/typeof.js
function op(e) {
	"@babel/helpers - typeof";
	return op = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
		return typeof e;
	} : function(e) {
		return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
	}, op(e);
}
//#endregion
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/toPrimitive.js
function sp(e, t) {
	if (op(e) != "object" || !e) return e;
	var n = e[Symbol.toPrimitive];
	if (n !== void 0) {
		var r = n.call(e, t || "default");
		if (op(r) != "object") return r;
		throw TypeError("@@toPrimitive must return a primitive value.");
	}
	return (t === "string" ? String : Number)(e);
}
//#endregion
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/toPropertyKey.js
function cp(e) {
	var t = sp(e, "string");
	return op(t) == "symbol" ? t : t + "";
}
//#endregion
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/defineProperty.js
function B(e, t, n) {
	return (t = cp(t)) in e ? Object.defineProperty(e, t, {
		value: n,
		enumerable: !0,
		configurable: !0,
		writable: !0
	}) : e[t] = n, e;
}
//#endregion
//#region ../../node_modules/.pnpm/camera-controls@https+++codeload.github.com+expofp+camera-controls+tar.gz+328d0e5819e52_605dcce904b96fcb9a647074f58e6666/node_modules/camera-controls/dist/camera-controls.module.js
var lp, up, dp = {
	LEFT: 1,
	RIGHT: 2,
	MIDDLE: 4
}, V = Object.freeze({
	NONE: 0,
	ROTATE_AZIMUTH: 1,
	ROTATE_POLAR: 2,
	ROTATE: 3,
	TRUCK: 4,
	SCREEN_PAN: 8,
	OFFSET: 16,
	DOLLY: 32,
	ZOOM: 64,
	TOUCH_ROTATE_AZIMUTH: 128,
	TOUCH_ROTATE_POLAR: 256,
	TOUCH_ROTATE: 384,
	TOUCH_TRUCK: 512,
	TOUCH_SCREEN_PAN: 1024,
	TOUCH_OFFSET: 2048,
	TOUCH_DOLLY: 4096,
	TOUCH_ZOOM: 8192,
	TOUCH_DOLLY_TRUCK: 4608,
	TOUCH_DOLLY_SCREEN_PAN: 5120,
	TOUCH_DOLLY_OFFSET: 6144,
	TOUCH_DOLLY_ROTATE: 4480,
	TOUCH_ZOOM_TRUCK: 8704,
	TOUCH_ZOOM_OFFSET: 10240,
	TOUCH_ZOOM_SCREEN_PAN: 9216,
	TOUCH_ZOOM_ROTATE: 8576
}), fp = {
	NONE: 0,
	IN: 1,
	OUT: -1
};
function pp(e) {
	return e.isPerspectiveCamera;
}
function mp(e) {
	return e.isOrthographicCamera;
}
var hp = Math.PI * 2, gp = Math.PI / 2, _p = 1e-5, vp = Math.PI / 180;
function yp(e, t, n) {
	return Math.max(t, Math.min(n, e));
}
function bp(e, t = _p) {
	return Math.abs(e) < t;
}
function xp(e, t, n = _p) {
	return bp(e - t, n);
}
function Sp(e, t) {
	return Math.round(e / t) * t;
}
function Cp(e) {
	return isFinite(e) ? e : e < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;
}
function wp(e) {
	return Math.abs(e) < Number.MAX_VALUE ? e : e * Infinity;
}
function Tp(e, t, n, r, i = Infinity, a) {
	r = Math.max(1e-4, r);
	let o = 2 / r, s = o * a, c = 1 / (1 + s + .48 * s * s + .235 * s * s * s), l = e - t, u = t, d = i * r;
	l = yp(l, -d, d), t = e - l;
	let f = (n.value + o * l) * a;
	n.value = (n.value - o * f) * c;
	let p = t + (l + f) * c;
	return u - e > 0 == p > u && (p = u, n.value = (p - u) / a), p;
}
function Ep(e, t, n, r, i = Infinity, a, o) {
	r = Math.max(1e-4, r);
	let s = 2 / r, c = s * a, l = 1 / (1 + c + .48 * c * c + .235 * c * c * c), u = t.x, d = t.y, f = t.z, p = e.x - u, m = e.y - d, h = e.z - f, g = u, _ = d, v = f, y = i * r, b = y * y, x = p * p + m * m + h * h;
	if (x > b) {
		let e = Math.sqrt(x);
		p = p / e * y, m = m / e * y, h = h / e * y;
	}
	u = e.x - p, d = e.y - m, f = e.z - h;
	let S = (n.x + s * p) * a, C = (n.y + s * m) * a, w = (n.z + s * h) * a;
	n.x = (n.x - s * S) * l, n.y = (n.y - s * C) * l, n.z = (n.z - s * w) * l, o.x = u + (p + S) * l, o.y = d + (m + C) * l, o.z = f + (h + w) * l;
	let T = g - e.x, E = _ - e.y, D = v - e.z, O = o.x - g, k = o.y - _, A = o.z - v;
	return T * O + E * k + D * A > 0 && (o.x = g, o.y = _, o.z = v, n.x = (o.x - g) / a, n.y = (o.y - _) / a, n.z = (o.z - v) / a), o;
}
function Dp(e, t) {
	t.set(0, 0), e.forEach((e) => {
		t.x += e.clientX, t.y += e.clientY;
	}), t.x /= e.length, t.y /= e.length;
}
function Op(e, t) {
	return mp(e) ? (console.warn(`${t} is not supported in OrthographicCamera`), !0) : !1;
}
var kp = class {
	constructor() {
		B(this, "_listeners", {});
	}
	addEventListener(e, t) {
		let n = this._listeners;
		n[e] === void 0 && (n[e] = []), n[e].indexOf(t) === -1 && n[e].push(t);
	}
	hasEventListener(e, t) {
		let n = this._listeners;
		return n[e] !== void 0 && n[e].indexOf(t) !== -1;
	}
	removeEventListener(e, t) {
		let n = this._listeners[e];
		if (n !== void 0) {
			let e = n.indexOf(t);
			e !== -1 && n.splice(e, 1);
		}
	}
	removeAllEventListeners(e) {
		if (!e) {
			this._listeners = {};
			return;
		}
		Array.isArray(this._listeners[e]) && (this._listeners[e].length = 0);
	}
	dispatchEvent(e) {
		let t = this._listeners[e.type];
		if (t !== void 0) {
			e.target = this;
			let n = t.slice(0);
			for (let t = 0, r = n.length; t < r; t++) n[t].call(this, e);
		}
	}
}, Ap = "0.0.0-semantic-release", jp = 1 / 8, Mp = [
	"rotateAzimuth",
	"rotatePolar",
	"truck",
	"dolly",
	"zoom",
	"offset"
], Np = /Mac/.test((lp = globalThis) == null || (lp = lp.navigator) == null ? void 0 : lp.platform), H;
function Pp() {
	return H;
}
var Fp, Ip, Lp, Rp, zp, Bp, Vp, Hp, Up, Wp, Gp, Kp, qp, Jp, Yp, Xp, Zp, Qp, $p, em, tm, nm, rm = class e extends kp {
	static install(e) {
		H = e.THREE, Fp = Object.freeze(new H.Vector3(0, 0, 0)), Ip = Object.freeze(new H.Vector3(0, 1, 0)), Lp = Object.freeze(new H.Vector3(0, 0, 1)), Rp = new H.Vector2(), zp = new H.Vector3(), Bp = new H.Vector3(), Vp = new H.Vector3(), Hp = new H.Vector3(), Up = new H.Vector3(), Wp = new H.Vector3(), Gp = new H.Vector3(), Kp = new H.Vector3(), qp = new H.Vector3(), Jp = new H.Spherical(), Yp = new H.Spherical(), Xp = new H.Box3(), Zp = new H.Box3(), Qp = new H.Sphere(), $p = new H.Quaternion(), em = new H.Quaternion(), tm = new H.Matrix4(), nm = new H.Raycaster();
	}
	static get ACTION() {
		return V;
	}
	set verticalDragToForward(e) {
		console.warn("camera-controls: `verticalDragToForward` was removed. Use `mouseButtons.left = CameraControls.ACTION.SCREEN_PAN` instead.");
	}
	constructor(t, n) {
		super(), B(this, "minPolarAngle", 0), B(this, "maxPolarAngle", Math.PI), B(this, "minAzimuthAngle", -Infinity), B(this, "maxAzimuthAngle", Infinity), B(this, "minDistance", 2 ** -52), B(this, "maxDistance", Infinity), B(this, "infinityDolly", !1), B(this, "minZoom", .01), B(this, "maxZoom", Infinity), B(this, "maxSpeed", Infinity), B(this, "azimuthRotateSpeed", 1), B(this, "polarRotateSpeed", 1), B(this, "dollySpeed", 1), B(this, "dollyDragInverted", !1), B(this, "truckSpeed", 2), B(this, "dollyToCursor", !1), B(this, "dragToOffset", !1), B(this, "boundaryFriction", 0), B(this, "restThreshold", .01), B(this, "colliderMeshes", []), B(this, "mouseButtons", void 0), B(this, "touches", void 0), B(this, "cancel", () => {}), B(this, "lockPointer", void 0), B(this, "unlockPointer", void 0), B(this, "_enabled", !0), B(this, "_camera", void 0), B(this, "_yAxisUpSpace", void 0), B(this, "_yAxisUpSpaceInverse", void 0), B(this, "_state", V.NONE), B(this, "_domElement", void 0), B(this, "_viewport", null), B(this, "_target", void 0), B(this, "_targetEnd", void 0), B(this, "_focalOffset", void 0), B(this, "_focalOffsetEnd", void 0), B(this, "_spherical", void 0), B(this, "_sphericalEnd", void 0), B(this, "_lastDistance", void 0), B(this, "_zoom", void 0), B(this, "_zoomEnd", void 0), B(this, "_lastZoom", void 0), B(this, "_cameraUp0", void 0), B(this, "_target0", void 0), B(this, "_position0", void 0), B(this, "_zoom0", void 0), B(this, "_focalOffset0", void 0), B(this, "_dollyControlCoord", void 0), B(this, "_changedDolly", 0), B(this, "_changedZoom", 0), B(this, "_nearPlaneCorners", void 0), B(this, "_hasRested", !0), B(this, "_boundary", void 0), B(this, "_boundaryEnclosesCamera", !1), B(this, "_needsUpdate", !0), B(this, "_updatedLastTime", !1), B(this, "_elementRect", new DOMRect()), B(this, "_isDragging", !1), B(this, "_dragNeedsUpdate", !0), B(this, "_activePointers", []), B(this, "_lockedPointer", null), B(this, "_interactiveArea", new DOMRect(0, 0, 1, 1)), B(this, "_isUserControllingRotate", !1), B(this, "_isUserControllingDolly", !1), B(this, "_isUserControllingTruck", !1), B(this, "_isUserControllingOffset", !1), B(this, "_isUserControllingZoom", !1), B(this, "_lastDollyDirection", fp.NONE), B(this, "_thetaVelocity", { value: 0 }), B(this, "_phiVelocity", { value: 0 }), B(this, "_radiusVelocity", { value: 0 }), B(this, "_targetVelocity", new H.Vector3()), B(this, "_focalOffsetVelocity", new H.Vector3()), B(this, "_zoomVelocity", { value: 0 }), B(this, "_smoothTime", {}), B(this, "_controlSmoothTime", {}), B(this, "_truckInternal", (e, t, n, r) => {
			let i, a;
			if (pp(this._camera)) {
				let n = zp.copy(this._camera.position).sub(this._target), r = this._camera.getEffectiveFOV() * vp, o = n.length() * Math.tan(r * .5);
				i = this.truckSpeed * e * o / this._elementRect.height, a = this.truckSpeed * t * o / this._elementRect.height;
			} else if (mp(this._camera)) {
				let n = this._camera;
				i = this.truckSpeed * e * (n.right - n.left) / n.zoom / this._elementRect.width, a = this.truckSpeed * t * (n.top - n.bottom) / n.zoom / this._elementRect.height;
			} else return;
			r ? (n ? this.setFocalOffset(this._focalOffsetEnd.x + i, this._focalOffsetEnd.y, this._focalOffsetEnd.z, !0) : this.truck(i, 0, !0), this.forward(-a, !0)) : n ? this.setFocalOffset(this._focalOffsetEnd.x + i, this._focalOffsetEnd.y + a, this._focalOffsetEnd.z, !0) : this.truck(i, a, !0);
		}), B(this, "_rotateInternal", (e, t, n) => {
			let r = (n & (V.ROTATE_AZIMUTH | V.TOUCH_ROTATE_AZIMUTH)) !== 0, i = (n & (V.ROTATE_POLAR | V.TOUCH_ROTATE_POLAR)) !== 0, a = r ? hp * this.azimuthRotateSpeed * e / this._elementRect.height : 0, o = i ? hp * this.polarRotateSpeed * t / this._elementRect.height : 0;
			this.rotate(a, o, !0);
		}), B(this, "_dollyInternal", (e, t, n) => {
			let r = .95 ** (-e * this.dollySpeed), i = this._sphericalEnd.radius, a = this._sphericalEnd.radius * r, o = yp(a, this.minDistance, this.maxDistance), s = o - a;
			this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(a, !0) : (this.infinityDolly && !this.dollyToCursor && this.dollyInFixed(s, !0), this._dollyToNoClamp(o, !0)), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? a : o) - i, this._dollyControlCoord.set(t, n)), this._lastDollyDirection = Math.sign(-e);
		}), B(this, "_zoomInternal", (e, t, n) => {
			let r = .95 ** (e * this.dollySpeed), i = this._zoom, a = this._zoom * r;
			this.zoomTo(a, !0), this.dollyToCursor && (this._changedZoom += a - i, this._dollyControlCoord.set(t, n));
		}), H === void 0 && console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."), this._camera = t, this._yAxisUpSpace = new H.Quaternion().setFromUnitVectors(this._camera.up, Ip), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = V.NONE, this.smoothTime = .25, this.controlSmoothTime = .125, this._target = new H.Vector3(), this._targetEnd = this._target.clone(), this._focalOffset = new H.Vector3(), this._focalOffsetEnd = this._focalOffset.clone(), this._spherical = new H.Spherical().setFromVector3(zp.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)), this._sphericalEnd = this._spherical.clone(), this._lastDistance = this._spherical.radius, this._zoom = this._camera.zoom, this._zoomEnd = this._zoom, this._lastZoom = this._zoom, this._nearPlaneCorners = [
			new H.Vector3(),
			new H.Vector3(),
			new H.Vector3(),
			new H.Vector3()
		], this._updateNearPlaneCorners(), this._boundary = new H.Box3(new H.Vector3(-Infinity, -Infinity, -Infinity), new H.Vector3(Infinity, Infinity, Infinity)), this._cameraUp0 = this._camera.up.clone(), this._target0 = this._target.clone(), this._position0 = this._camera.position.clone(), this._zoom0 = this._zoom, this._focalOffset0 = this._focalOffset.clone(), this._dollyControlCoord = new H.Vector2(), this.mouseButtons = {
			left: V.ROTATE,
			middle: V.DOLLY,
			right: V.TRUCK,
			wheel: pp(this._camera) ? V.DOLLY : mp(this._camera) ? V.ZOOM : V.NONE
		}, this.touches = {
			one: V.TOUCH_ROTATE,
			two: pp(this._camera) ? V.TOUCH_DOLLY_TRUCK : mp(this._camera) ? V.TOUCH_ZOOM_TRUCK : V.NONE,
			three: V.TOUCH_TRUCK
		};
		let r = new H.Vector2(), i = new H.Vector2(), a = new H.Vector2(), o = (e) => {
			if (!this._enabled || !this._domElement) return;
			if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
				let t = this._domElement.getBoundingClientRect(), n = e.clientX / t.width, r = e.clientY / t.height;
				if (n < this._interactiveArea.left || n > this._interactiveArea.right || r < this._interactiveArea.top || r > this._interactiveArea.bottom) return;
			}
			let t = e.pointerType === "mouse" ? (e.buttons & dp.LEFT) === dp.LEFT ? dp.LEFT : (e.buttons & dp.MIDDLE) === dp.MIDDLE ? dp.MIDDLE : (e.buttons & dp.RIGHT) === dp.RIGHT ? dp.RIGHT : null : null;
			if (t !== null) {
				let e = this._findPointerByMouseButton(t);
				e && this._disposePointer(e);
			}
			if ((e.buttons & dp.LEFT) === dp.LEFT && this._lockedPointer) return;
			let n = {
				pointerId: e.pointerId,
				clientX: e.clientX,
				clientY: e.clientY,
				deltaX: 0,
				deltaY: 0,
				mouseButton: t
			};
			this._activePointers.push(n), this._domElement.ownerDocument.removeEventListener("pointermove", s, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this._domElement.ownerDocument.addEventListener("pointermove", s, { passive: !1 }), this._domElement.ownerDocument.addEventListener("pointerup", c), this._isDragging = !0, f(e);
		}, s = (e) => {
			e.cancelable && e.preventDefault();
			let t = e.pointerId, n = this._lockedPointer || this._findPointerById(t);
			if (n) {
				if (n.clientX = e.clientX, n.clientY = e.clientY, n.deltaX = e.movementX, n.deltaY = e.movementY, this._state = 0, e.pointerType === "touch") switch (this._activePointers.length) {
					case 1:
						this._state = this.touches.one;
						break;
					case 2:
						this._state = this.touches.two;
						break;
					case 3:
						this._state = this.touches.three;
						break;
				}
				else (!this._isDragging && this._lockedPointer || this._isDragging && (e.buttons & dp.LEFT) === dp.LEFT) && (this._state |= this.mouseButtons.left), this._isDragging && (e.buttons & dp.MIDDLE) === dp.MIDDLE && (this._state |= this.mouseButtons.middle), this._isDragging && (e.buttons & dp.RIGHT) === dp.RIGHT && (this._state |= this.mouseButtons.right);
				p();
			}
		}, c = (e) => {
			let t = this._findPointerById(e.pointerId);
			if (!(t && t === this._lockedPointer)) {
				if (t && this._disposePointer(t), e.pointerType === "touch") switch (this._activePointers.length) {
					case 0:
						this._state = V.NONE;
						break;
					case 1:
						this._state = this.touches.one;
						break;
					case 2:
						this._state = this.touches.two;
						break;
					case 3:
						this._state = this.touches.three;
						break;
				}
				else this._state = V.NONE;
				m();
			}
		}, l = -1, u = (e) => {
			if (!this._domElement || !this._enabled || this.mouseButtons.wheel === V.NONE) return;
			if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
				let t = this._domElement.getBoundingClientRect(), n = e.clientX / t.width, r = e.clientY / t.height;
				if (n < this._interactiveArea.left || n > this._interactiveArea.right || r < this._interactiveArea.top || r > this._interactiveArea.bottom) return;
			}
			if (e.preventDefault(), this.dollyToCursor || (this.mouseButtons.wheel & V.ROTATE) !== 0 || this.mouseButtons.wheel === V.TRUCK) {
				let e = performance.now();
				l - e < 1e3 && this._getClientRect(this._elementRect), l = e;
			}
			let t = Np ? -1 : -3, n = e.deltaMode === 1 && !e.ctrlKey ? e.deltaY / t : e.deltaY / (t * 10), r = this.dollyToCursor ? (e.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, i = this.dollyToCursor ? (e.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0, a = e.ctrlKey ? this.touches.two : this.mouseButtons.wheel;
			switch (a) {
				case V.ROTATE:
				case V.ROTATE_AZIMUTH:
				case V.ROTATE_POLAR:
					this._rotateInternal(e.deltaX, e.deltaY, a), this._isUserControllingRotate = !0;
					break;
				case V.TRUCK:
					this._truckInternal(e.deltaX, e.deltaY, !1, !1), this._isUserControllingTruck = !0;
					break;
				case V.SCREEN_PAN:
					this._truckInternal(e.deltaX, e.deltaY, !1, !0), this._isUserControllingTruck = !0;
					break;
				case V.OFFSET:
					this._truckInternal(e.deltaX, e.deltaY, !0, !1), this._isUserControllingOffset = !0;
					break;
				case V.DOLLY:
				case V.TOUCH_DOLLY:
				case V.TOUCH_DOLLY_ROTATE:
				case V.TOUCH_DOLLY_TRUCK:
				case V.TOUCH_DOLLY_SCREEN_PAN:
				case V.TOUCH_DOLLY_OFFSET:
					this._dollyInternal(-n, r, i), this._isUserControllingDolly = !0;
					break;
				case V.ZOOM:
				case V.TOUCH_ZOOM:
				case V.TOUCH_ZOOM_ROTATE:
				case V.TOUCH_ZOOM_TRUCK:
				case V.TOUCH_ZOOM_SCREEN_PAN:
				case V.TOUCH_ZOOM_OFFSET:
					this._zoomInternal(-n, r, i), this._isUserControllingZoom = !0;
					break;
			}
			this.dispatchEvent({ type: "control" });
		}, d = (t) => {
			if (!(!this._domElement || !this._enabled)) {
				if (this.mouseButtons.right === e.ACTION.NONE) {
					let e = t instanceof PointerEvent ? t.pointerId : 0, n = this._findPointerById(e);
					n && this._disposePointer(n), this._domElement.ownerDocument.removeEventListener("pointermove", s, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c);
					return;
				}
				t.preventDefault();
			}
		}, f = (e) => {
			if (this._enabled) {
				if (Dp(this._activePointers, Rp), this._getClientRect(this._elementRect), r.copy(Rp), i.copy(Rp), this._activePointers.length >= 2) {
					let e = Rp.x - this._activePointers[1].clientX, t = Rp.y - this._activePointers[1].clientY, n = Math.sqrt(e * e + t * t);
					a.set(0, n);
					let r = (this._activePointers[0].clientX + this._activePointers[1].clientX) * .5, o = (this._activePointers[0].clientY + this._activePointers[1].clientY) * .5;
					i.set(r, o);
				}
				if (this._state = 0, !e) this._lockedPointer && (this._state |= this.mouseButtons.left);
				else if ("pointerType" in e && e.pointerType === "touch") switch (this._activePointers.length) {
					case 1:
						this._state = this.touches.one;
						break;
					case 2:
						this._state = this.touches.two;
						break;
					case 3:
						this._state = this.touches.three;
						break;
				}
				else !this._lockedPointer && (e.buttons & dp.LEFT) === dp.LEFT && (this._state |= this.mouseButtons.left), (e.buttons & dp.MIDDLE) === dp.MIDDLE && (this._state |= this.mouseButtons.middle), (e.buttons & dp.RIGHT) === dp.RIGHT && (this._state |= this.mouseButtons.right);
				(this._state & (V.ROTATE | V.TOUCH_ROTATE)) !== 0 && (this._sphericalEnd.theta = this._spherical.theta, this._sphericalEnd.phi = this._spherical.phi, this._thetaVelocity.value = 0, this._phiVelocity.value = 0), (this._state & (V.TRUCK | V.SCREEN_PAN | V.TOUCH_TRUCK | V.TOUCH_SCREEN_PAN)) !== 0 && (this._targetEnd.copy(this._target), this._targetVelocity.set(0, 0, 0)), (this._state & (V.DOLLY | V.TOUCH_DOLLY)) !== 0 && (this._sphericalEnd.radius = this._spherical.radius, this._radiusVelocity.value = 0), (this._state & (V.ZOOM | V.TOUCH_ZOOM)) !== 0 && (this._zoomEnd = this._zoom, this._zoomVelocity.value = 0), (this._state & (V.OFFSET | V.TOUCH_OFFSET)) !== 0 && (this._focalOffsetEnd.copy(this._focalOffset), this._focalOffsetVelocity.set(0, 0, 0)), this.dispatchEvent({ type: "controlstart" });
			}
		}, p = () => {
			if (!this._enabled || !this._dragNeedsUpdate) return;
			this._dragNeedsUpdate = !1, Dp(this._activePointers, Rp);
			let e = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, t = e ? -e.deltaX : i.x - Rp.x, n = e ? -e.deltaY : i.y - Rp.y;
			if (i.copy(Rp), (this._state & (V.ROTATE | V.TOUCH_ROTATE)) !== 0 && (this._rotateInternal(t, n, this._state), this._isUserControllingRotate = !0), (this._state & V.DOLLY) === V.DOLLY || (this._state & V.ZOOM) === V.ZOOM) {
				let e = this.dollyToCursor ? (r.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, t = this.dollyToCursor ? (r.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0, i = this.dollyDragInverted ? -1 : 1;
				(this._state & V.DOLLY) === V.DOLLY ? (this._dollyInternal(i * n * jp, e, t), this._isUserControllingDolly = !0) : (this._zoomInternal(i * n * jp, e, t), this._isUserControllingZoom = !0);
			}
			if ((this._state & (V.TOUCH_DOLLY | V.TOUCH_ZOOM)) !== 0) {
				let e = Rp.x - this._activePointers[1].clientX, t = Rp.y - this._activePointers[1].clientY, n = Math.sqrt(e * e + t * t), r = a.y - n;
				a.set(0, n);
				let o = this.dollyToCursor ? (i.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, s = this.dollyToCursor ? (i.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
				(this._state & V.TOUCH_DOLLY) === 0 ? (this._zoomInternal(r * jp, o, s), this._isUserControllingZoom = !0) : (this._dollyInternal(r * jp, o, s), this._isUserControllingDolly = !0);
			}
			(this._state & (V.TRUCK | V.TOUCH_TRUCK)) !== 0 && (this._truckInternal(t, n, !1, !1), this._isUserControllingTruck = !0), (this._state & (V.SCREEN_PAN | V.TOUCH_SCREEN_PAN)) !== 0 && (this._truckInternal(t, n, !1, !0), this._isUserControllingTruck = !0), (this._state & (V.OFFSET | V.TOUCH_OFFSET)) !== 0 && (this._truckInternal(t, n, !0, !1), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
		}, m = () => {
			Dp(this._activePointers, Rp), i.copy(Rp), this._dragNeedsUpdate = !1, (this._activePointers.length === 0 || this._activePointers.length === 1 && this._activePointers[0] === this._lockedPointer) && (this._isDragging = !1), this._activePointers.length === 0 && this._domElement && (this._domElement.ownerDocument.removeEventListener("pointermove", s, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this.dispatchEvent({ type: "controlend" }));
		};
		this.lockPointer = () => {
			!this._enabled || !this._domElement || (this.cancel(), this._lockedPointer = {
				pointerId: -1,
				clientX: 0,
				clientY: 0,
				deltaX: 0,
				deltaY: 0,
				mouseButton: null
			}, this._activePointers.push(this._lockedPointer), this._domElement.ownerDocument.removeEventListener("pointermove", s, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this._domElement.requestPointerLock(), this._domElement.ownerDocument.addEventListener("pointerlockchange", h), this._domElement.ownerDocument.addEventListener("pointerlockerror", g), this._domElement.ownerDocument.addEventListener("pointermove", s, { passive: !1 }), this._domElement.ownerDocument.addEventListener("pointerup", c), f());
		}, this.unlockPointer = () => {
			var e, t, n;
			this._lockedPointer !== null && (this._disposePointer(this._lockedPointer), this._lockedPointer = null), (e = this._domElement) == null || e.ownerDocument.exitPointerLock(), (t = this._domElement) == null || t.ownerDocument.removeEventListener("pointerlockchange", h), (n = this._domElement) == null || n.ownerDocument.removeEventListener("pointerlockerror", g), this.cancel();
		};
		let h = () => {
			this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement || this.unlockPointer();
		}, g = () => {
			this.unlockPointer();
		};
		this._addAllEventListeners = (e) => {
			this._domElement = e, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", o), this._domElement.addEventListener("pointercancel", c), this._domElement.addEventListener("wheel", u, { passive: !1 }), this._domElement.addEventListener("contextmenu", d);
		}, this._removeAllEventListeners = () => {
			this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", o), this._domElement.removeEventListener("pointercancel", c), this._domElement.removeEventListener("wheel", u, { passive: !1 }), this._domElement.removeEventListener("contextmenu", d), this._domElement.ownerDocument.removeEventListener("pointermove", s, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this._domElement.ownerDocument.removeEventListener("pointerlockchange", h), this._domElement.ownerDocument.removeEventListener("pointerlockerror", g));
		}, this.cancel = () => {
			this._state !== V.NONE && (this._state = V.NONE, this._activePointers.length = 0, m());
		}, n && this.connect(n), this.update(0);
	}
	get camera() {
		return this._camera;
	}
	set camera(e) {
		this._camera = e, this.updateCameraUp(), this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0;
	}
	get enabled() {
		return this._enabled;
	}
	set enabled(e) {
		this._enabled = e, this._domElement && (e ? (this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none") : (this.cancel(), this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = ""));
	}
	get active() {
		return !this._hasRested;
	}
	get currentAction() {
		return this._state;
	}
	get distance() {
		return this._spherical.radius;
	}
	set distance(e) {
		this._spherical.radius === e && this._sphericalEnd.radius === e || (this._spherical.radius = e, this._sphericalEnd.radius = e, this._needsUpdate = !0);
	}
	get azimuthAngle() {
		return this._spherical.theta;
	}
	set azimuthAngle(e) {
		this._spherical.theta === e && this._sphericalEnd.theta === e || (this._spherical.theta = e, this._sphericalEnd.theta = e, this._needsUpdate = !0);
	}
	get polarAngle() {
		return this._spherical.phi;
	}
	set polarAngle(e) {
		this._spherical.phi === e && this._sphericalEnd.phi === e || (this._spherical.phi = e, this._sphericalEnd.phi = e, this._needsUpdate = !0);
	}
	get boundaryEnclosesCamera() {
		return this._boundaryEnclosesCamera;
	}
	set boundaryEnclosesCamera(e) {
		this._boundaryEnclosesCamera = e, this._needsUpdate = !0;
	}
	set interactiveArea(e) {
		this._interactiveArea.width = yp(e.width, 0, 1), this._interactiveArea.height = yp(e.height, 0, 1), this._interactiveArea.x = yp(e.x, 0, 1 - this._interactiveArea.width), this._interactiveArea.y = yp(e.y, 0, 1 - this._interactiveArea.height);
	}
	addEventListener(e, t) {
		super.addEventListener(e, t);
	}
	removeEventListener(e, t) {
		super.removeEventListener(e, t);
	}
	rotate(e, t, n = !1) {
		return this.rotateTo(this._sphericalEnd.theta + e, this._sphericalEnd.phi + t, n);
	}
	rotateAzimuthTo(e, t = !1) {
		return this.rotateTo(e, this._sphericalEnd.phi, t);
	}
	rotatePolarTo(e, t = !1) {
		return this.rotateTo(this._sphericalEnd.theta, e, t);
	}
	rotateTo(e, t, n = !1) {
		this._isUserControllingRotate = !1;
		let r = yp(e, this.minAzimuthAngle, this.maxAzimuthAngle), i = yp(t, this.minPolarAngle, this.maxPolarAngle);
		this._sphericalEnd.theta = r, this._sphericalEnd.phi = i, this._sphericalEnd.makeSafe(), this._needsUpdate = !0, n || (this._spherical.theta = this._sphericalEnd.theta, this._spherical.phi = this._sphericalEnd.phi);
		let a = !n || xp(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && xp(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold);
		return this._createOnRestPromise(a);
	}
	dolly(e, t = !1) {
		return this.dollyTo(this._sphericalEnd.radius - e, t);
	}
	dollyTo(e, t = !1) {
		return this._isUserControllingDolly = !1, this._lastDollyDirection = fp.NONE, this._changedDolly = 0, this._dollyToNoClamp(yp(e, this.minDistance, this.maxDistance), t);
	}
	_dollyToNoClamp(e, t = !1) {
		let n = this._sphericalEnd.radius;
		if (this.colliderMeshes.length >= 1) {
			let t = this._collisionTest(), r = xp(t, this._spherical.radius);
			if (!(n > e) && r) return Promise.resolve();
			this._sphericalEnd.radius = Math.min(e, t);
		} else this._sphericalEnd.radius = e;
		this._needsUpdate = !0, t || (this._spherical.radius = this._sphericalEnd.radius);
		let r = !t || xp(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
		return this._createOnRestPromise(r);
	}
	dollyInFixed(e, t = !1) {
		this._targetEnd.add(this._getCameraDirection(Hp).multiplyScalar(e)), t || this._target.copy(this._targetEnd);
		let n = !t || xp(this._target.x, this._targetEnd.x, this.restThreshold) && xp(this._target.y, this._targetEnd.y, this.restThreshold) && xp(this._target.z, this._targetEnd.z, this.restThreshold);
		return this._createOnRestPromise(n);
	}
	zoom(e, t = !1) {
		return this.zoomTo(this._zoomEnd + e, t);
	}
	zoomTo(e, t = !1) {
		this._isUserControllingZoom = !1, this._zoomEnd = yp(e, this.minZoom, this.maxZoom), this._needsUpdate = !0, t || (this._zoom = this._zoomEnd);
		let n = !t || xp(this._zoom, this._zoomEnd, this.restThreshold);
		return this._changedZoom = 0, this._createOnRestPromise(n);
	}
	pan(e, t, n = !1) {
		return console.warn("`pan` has been renamed to `truck`"), this.truck(e, t, n);
	}
	truck(e, t, n = !1) {
		this._camera.updateMatrix(), Up.setFromMatrixColumn(this._camera.matrix, 0), Wp.setFromMatrixColumn(this._camera.matrix, 1), Up.multiplyScalar(e), Wp.multiplyScalar(-t);
		let r = zp.copy(Up).add(Wp), i = Bp.copy(this._targetEnd).add(r);
		return this.moveTo(i.x, i.y, i.z, n);
	}
	forward(e, t = !1) {
		zp.setFromMatrixColumn(this._camera.matrix, 0), zp.crossVectors(this._camera.up, zp), zp.multiplyScalar(e);
		let n = Bp.copy(this._targetEnd).add(zp);
		return this.moveTo(n.x, n.y, n.z, t);
	}
	elevate(e, t = !1) {
		return zp.copy(this._camera.up).multiplyScalar(e), this.moveTo(this._targetEnd.x + zp.x, this._targetEnd.y + zp.y, this._targetEnd.z + zp.z, t);
	}
	moveTo(e, t, n, r = !1) {
		this._isUserControllingTruck = !1;
		let i = zp.set(e, t, n).sub(this._targetEnd);
		this._encloseToBoundary(this._targetEnd, i, this.boundaryFriction), this._needsUpdate = !0, r || this._target.copy(this._targetEnd);
		let a = !r || xp(this._target.x, this._targetEnd.x, this.restThreshold) && xp(this._target.y, this._targetEnd.y, this.restThreshold) && xp(this._target.z, this._targetEnd.z, this.restThreshold);
		return this._createOnRestPromise(a);
	}
	lookInDirectionOf(e, t, n, r = !1) {
		let i = zp.set(e, t, n).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);
		return this.setPosition(i.x, i.y, i.z, r);
	}
	fitToBox(e, t, { cover: n = !1, paddingLeft: r = 0, paddingRight: i = 0, paddingBottom: a = 0, paddingTop: o = 0 } = {}) {
		let s = [], c = e.isBox3 ? Xp.copy(e) : Xp.setFromObject(e);
		c.isEmpty() && (console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"), Promise.resolve());
		let l = Sp(this._sphericalEnd.theta, gp), u = Sp(this._sphericalEnd.phi, gp);
		s.push(this.rotateTo(l, u, t));
		let d = zp.setFromSpherical(this._sphericalEnd).normalize(), f = $p.setFromUnitVectors(d, Lp), p = xp(Math.abs(d.y), 1);
		p && f.multiply(em.setFromAxisAngle(Ip, l)), f.multiply(this._yAxisUpSpaceInverse);
		let m = Zp.makeEmpty();
		Bp.copy(c.min).applyQuaternion(f), m.expandByPoint(Bp), Bp.copy(c.min).setX(c.max.x).applyQuaternion(f), m.expandByPoint(Bp), Bp.copy(c.min).setY(c.max.y).applyQuaternion(f), m.expandByPoint(Bp), Bp.copy(c.max).setZ(c.min.z).applyQuaternion(f), m.expandByPoint(Bp), Bp.copy(c.min).setZ(c.max.z).applyQuaternion(f), m.expandByPoint(Bp), Bp.copy(c.max).setY(c.min.y).applyQuaternion(f), m.expandByPoint(Bp), Bp.copy(c.max).setX(c.min.x).applyQuaternion(f), m.expandByPoint(Bp), Bp.copy(c.max).applyQuaternion(f), m.expandByPoint(Bp), m.min.x -= r, m.min.y -= a, m.max.x += i, m.max.y += o, f.setFromUnitVectors(Lp, d), p && f.premultiply(em.invert()), f.premultiply(this._yAxisUpSpace);
		let h = m.getSize(zp), g = m.getCenter(Bp).applyQuaternion(f);
		if (pp(this._camera)) {
			let e = this.getDistanceToFitBox(h.x, h.y, h.z, n);
			s.push(this.moveTo(g.x, g.y, g.z, t)), s.push(this.dollyTo(e, t)), s.push(this.setFocalOffset(0, 0, 0, t));
		} else if (mp(this._camera)) {
			let e = this._camera, r = e.right - e.left, i = e.top - e.bottom, a = n ? Math.max(r / h.x, i / h.y) : Math.min(r / h.x, i / h.y);
			s.push(this.moveTo(g.x, g.y, g.z, t)), s.push(this.zoomTo(a, t)), s.push(this.setFocalOffset(0, 0, 0, t));
		}
		return Promise.all(s);
	}
	fitToSphere(t, n) {
		let r = [], i = "isObject3D" in t ? e.createBoundingSphere(t, Qp) : Qp.copy(t);
		if (r.push(this.moveTo(i.center.x, i.center.y, i.center.z, n)), pp(this._camera)) {
			let e = this.getDistanceToFitSphere(i.radius);
			r.push(this.dollyTo(e, n));
		} else if (mp(this._camera)) {
			let e = this._camera.right - this._camera.left, t = this._camera.top - this._camera.bottom, a = 2 * i.radius, o = Math.min(e / a, t / a);
			r.push(this.zoomTo(o, n));
		}
		return r.push(this.setFocalOffset(0, 0, 0, n)), Promise.all(r);
	}
	setLookAt(e, t, n, r, i, a, o = !1) {
		this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = fp.NONE, this._changedDolly = 0;
		let s = Bp.set(r, i, a), c = zp.set(e, t, n);
		this._targetEnd.copy(s), c.sub(s), bp(c.x) && (c.x = 0), bp(c.y) && (c.y = 0), bp(c.z) && (c.z = 0), this._sphericalEnd.setFromVector3(c.applyQuaternion(this._yAxisUpSpace)), this._needsUpdate = !0, o || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
		let l = !o || xp(this._target.x, this._targetEnd.x, this.restThreshold) && xp(this._target.y, this._targetEnd.y, this.restThreshold) && xp(this._target.z, this._targetEnd.z, this.restThreshold) && xp(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && xp(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && xp(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
		return this._createOnRestPromise(l);
	}
	lerp(e, t, n, r = !1) {
		this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = fp.NONE, this._changedDolly = 0;
		let i = zp.set(...e.target);
		if ("spherical" in e) Jp.set(...e.spherical);
		else {
			let t = Bp.set(...e.position);
			Jp.setFromVector3(t.sub(i).applyQuaternion(this._yAxisUpSpace));
		}
		let a = Vp.set(...t.target);
		if ("spherical" in t) Yp.set(...t.spherical);
		else {
			let e = Bp.set(...t.position);
			Yp.setFromVector3(e.sub(a).applyQuaternion(this._yAxisUpSpace));
		}
		this._targetEnd.copy(i.lerp(a, n));
		let o = Yp.theta - Jp.theta, s = Yp.phi - Jp.phi, c = Yp.radius - Jp.radius;
		this._sphericalEnd.set(Jp.radius + c * n, Jp.phi + s * n, Jp.theta + o * n), this._needsUpdate = !0, r || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
		let l = !r || xp(this._target.x, this._targetEnd.x, this.restThreshold) && xp(this._target.y, this._targetEnd.y, this.restThreshold) && xp(this._target.z, this._targetEnd.z, this.restThreshold) && xp(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && xp(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && xp(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
		return this._createOnRestPromise(l);
	}
	lerpLookAt(e, t, n, r, i, a, o, s, c, l, u, d, f, p = !1) {
		return this.lerp({
			position: [
				e,
				t,
				n
			],
			target: [
				r,
				i,
				a
			]
		}, {
			position: [
				o,
				s,
				c
			],
			target: [
				l,
				u,
				d
			]
		}, f, p);
	}
	setPosition(e, t, n, r = !1) {
		return this.setLookAt(e, t, n, this._targetEnd.x, this._targetEnd.y, this._targetEnd.z, r);
	}
	setTarget(e, t, n, r = !1) {
		let i = this.getPosition(zp), a = this.setLookAt(i.x, i.y, i.z, e, t, n, r);
		return this._sphericalEnd.phi = yp(this._sphericalEnd.phi, this.minPolarAngle, this.maxPolarAngle), a;
	}
	setFocalOffset(e, t, n, r = !1) {
		this._isUserControllingOffset = !1, this._focalOffsetEnd.set(e, t, n), this._needsUpdate = !0, r || this._focalOffset.copy(this._focalOffsetEnd);
		let i = !r || xp(this._focalOffset.x, this._focalOffsetEnd.x, this.restThreshold) && xp(this._focalOffset.y, this._focalOffsetEnd.y, this.restThreshold) && xp(this._focalOffset.z, this._focalOffsetEnd.z, this.restThreshold);
		return this._createOnRestPromise(i);
	}
	setOrbitPoint(e, t, n) {
		this._camera.updateMatrixWorld(), Up.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), Wp.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), Gp.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
		let r = zp.set(e, t, n), i = r.distanceTo(this._camera.position), a = r.sub(this._camera.position);
		Up.multiplyScalar(a.x), Wp.multiplyScalar(a.y), Gp.multiplyScalar(a.z), zp.copy(Up).add(Wp).add(Gp), zp.z += i, this.dollyTo(i, !1), this.setFocalOffset(-zp.x, zp.y, -zp.z, !1), this.moveTo(e, t, n, !1);
	}
	setBoundary(e) {
		if (!e) {
			this._boundary.min.set(-Infinity, -Infinity, -Infinity), this._boundary.max.set(Infinity, Infinity, Infinity), this._needsUpdate = !0;
			return;
		}
		this._boundary.copy(e), this._boundary.clampPoint(this._targetEnd, this._targetEnd), this._needsUpdate = !0;
	}
	setViewport(e, t, n, r) {
		if (e === null) {
			this._viewport = null;
			return;
		}
		this._viewport = this._viewport || new H.Vector4(), typeof e == "number" ? this._viewport.set(e, t, n, r) : this._viewport.copy(e);
	}
	getDistanceToFitBox(e, t, n, r = !1) {
		if (Op(this._camera, "getDistanceToFitBox")) return this._spherical.radius;
		let i = e / t, a = this._camera.getEffectiveFOV() * vp, o = this._camera.aspect;
		return ((r ? i > o : i < o) ? t : e / o) * .5 / Math.tan(a * .5) + n * .5;
	}
	getDistanceToFitSphere(e) {
		if (Op(this._camera, "getDistanceToFitSphere")) return this._spherical.radius;
		let t = this._camera.getEffectiveFOV() * vp, n = Math.atan(Math.tan(t * .5) * this._camera.aspect) * 2, r = 1 < this._camera.aspect ? t : n;
		return e / Math.sin(r * .5);
	}
	getTarget(e, t = !0) {
		return (e && e.isVector3 ? e : new H.Vector3()).copy(t ? this._targetEnd : this._target);
	}
	getPosition(e, t = !0) {
		return (e && e.isVector3 ? e : new H.Vector3()).setFromSpherical(t ? this._sphericalEnd : this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(t ? this._targetEnd : this._target);
	}
	getSpherical(e, t = !0) {
		return (e || new H.Spherical()).copy(t ? this._sphericalEnd : this._spherical);
	}
	getFocalOffset(e, t = !0) {
		return (e && e.isVector3 ? e : new H.Vector3()).copy(t ? this._focalOffsetEnd : this._focalOffset);
	}
	normalizeRotations() {
		return this._sphericalEnd.theta = (this._sphericalEnd.theta % hp + hp) % hp, this._sphericalEnd.theta > Math.PI && (this._sphericalEnd.theta -= hp), this._spherical.theta += hp * Math.round((this._sphericalEnd.theta - this._spherical.theta) / hp), this;
	}
	stop() {
		this._focalOffset.copy(this._focalOffsetEnd), this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd), this._zoom = this._zoomEnd;
	}
	reset(e = !1) {
		if (!xp(this._camera.up.x, this._cameraUp0.x) || !xp(this._camera.up.y, this._cameraUp0.y) || !xp(this._camera.up.z, this._cameraUp0.z)) {
			this._camera.up.copy(this._cameraUp0);
			let e = this.getPosition(zp);
			this.updateCameraUp(), this.setPosition(e.x, e.y, e.z);
		}
		let t = [
			this.setLookAt(this._position0.x, this._position0.y, this._position0.z, this._target0.x, this._target0.y, this._target0.z, e),
			this.setFocalOffset(this._focalOffset0.x, this._focalOffset0.y, this._focalOffset0.z, e),
			this.zoomTo(this._zoom0, e)
		];
		return Promise.all(t);
	}
	saveState() {
		this._cameraUp0.copy(this._camera.up), this.getTarget(this._target0), this.getPosition(this._position0), this._zoom0 = this._zoom, this._focalOffset0.copy(this._focalOffset);
	}
	updateCameraUp() {
		this._yAxisUpSpace.setFromUnitVectors(this._camera.up, Ip), this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert();
	}
	applyCameraUp() {
		let e = zp.subVectors(this._target, this._camera.position).normalize(), t = Bp.crossVectors(e, this._camera.up);
		this._camera.up.crossVectors(t, e).normalize(), this._camera.updateMatrixWorld();
		let n = this.getPosition(zp);
		this.updateCameraUp(), this.setPosition(n.x, n.y, n.z);
	}
	update(e) {
		let t = this._sphericalEnd.theta - this._spherical.theta, n = this._sphericalEnd.phi - this._spherical.phi, r = this._sphericalEnd.radius - this._spherical.radius, i = Kp.subVectors(this._targetEnd, this._target), a = qp.subVectors(this._focalOffsetEnd, this._focalOffset), o = this._zoomEnd - this._zoom;
		if (bp(t)) this._thetaVelocity.value = 0, this._spherical.theta = this._sphericalEnd.theta;
		else {
			let t = this._isUserControllingRotate ? this._controlSmoothTime.rotateAzimuth : this._smoothTime.rotateAzimuth;
			this._spherical.theta = Tp(this._spherical.theta, this._sphericalEnd.theta, this._thetaVelocity, t, Infinity, e), this._needsUpdate = !0;
		}
		if (bp(n)) this._phiVelocity.value = 0, this._spherical.phi = this._sphericalEnd.phi;
		else {
			let t = this._isUserControllingRotate ? this._controlSmoothTime.rotatePolar : this._smoothTime.rotatePolar;
			this._spherical.phi = Tp(this._spherical.phi, this._sphericalEnd.phi, this._phiVelocity, t, Infinity, e), this._needsUpdate = !0;
		}
		if (bp(r)) this._radiusVelocity.value = 0, this._spherical.radius = this._sphericalEnd.radius;
		else {
			let t = this._isUserControllingDolly ? this._controlSmoothTime.dolly : this._smoothTime.dolly;
			this._spherical.radius = Tp(this._spherical.radius, this._sphericalEnd.radius, this._radiusVelocity, t, this.maxSpeed, e), this._needsUpdate = !0;
		}
		if (bp(i.x) && bp(i.y) && bp(i.z) ? (this._targetVelocity.set(0, 0, 0), this._target.copy(this._targetEnd)) : (Ep(this._target, this._targetEnd, this._targetVelocity, this._getTargetSmoothTime(), this.maxSpeed, e, this._target), this._needsUpdate = !0), bp(a.x) && bp(a.y) && bp(a.z)) this._focalOffsetVelocity.set(0, 0, 0), this._focalOffset.copy(this._focalOffsetEnd);
		else {
			let t = this._isUserControllingOffset ? this._controlSmoothTime.offset : this._smoothTime.offset;
			Ep(this._focalOffset, this._focalOffsetEnd, this._focalOffsetVelocity, t, this.maxSpeed, e, this._focalOffset), this._needsUpdate = !0;
		}
		if (bp(o)) this._zoomVelocity.value = 0, this._zoom = this._zoomEnd;
		else {
			let t = this._isUserControllingZoom ? this._controlSmoothTime.zoom : this._smoothTime.zoom;
			this._zoom = Tp(this._zoom, this._zoomEnd, this._zoomVelocity, t, Infinity, e);
		}
		if (this.dollyToCursor) {
			if (pp(this._camera) && this._changedDolly !== 0) {
				let e = this._spherical.radius - this._lastDistance, t = this._camera, n = this._getCameraDirection(Hp), r = zp.copy(n).cross(t.up).normalize();
				r.lengthSq() === 0 && (r.x = 1);
				let i = Bp.crossVectors(r, n), a = this._sphericalEnd.radius * Math.tan(t.getEffectiveFOV() * vp * .5), o = (this._sphericalEnd.radius - e - this._sphericalEnd.radius) / this._sphericalEnd.radius, s = Vp.copy(this._targetEnd).add(r.multiplyScalar(this._dollyControlCoord.x * a * t.aspect)).add(i.multiplyScalar(this._dollyControlCoord.y * a)), c = zp.copy(this._targetEnd).lerp(s, o), l = this._lastDollyDirection === fp.IN && this._spherical.radius <= this.minDistance, u = this._lastDollyDirection === fp.OUT && this.maxDistance <= this._spherical.radius;
				if (this.infinityDolly && (l || u)) {
					this._sphericalEnd.radius -= e, this._spherical.radius -= e;
					let t = Bp.copy(n).multiplyScalar(-e);
					c.add(t);
				}
				this._boundary.clampPoint(c, c);
				let d = Bp.subVectors(c, this._targetEnd);
				this._targetEnd.copy(c), this._target.add(d), this._changedDolly -= e, bp(this._changedDolly) && (this._changedDolly = 0);
			} else if (mp(this._camera) && this._changedZoom !== 0) {
				let e = this._zoom - this._lastZoom, t = this._camera, n = zp.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (t.near + t.far) / (t.near - t.far)).unproject(t), r = Bp.set(0, 0, -1).applyQuaternion(t.quaternion), i = Vp.copy(n).add(r.multiplyScalar(-n.dot(t.up))), a = -(this._zoom - e - this._zoom) / this._zoom, o = this._getCameraDirection(Hp), s = this._targetEnd.dot(o), c = zp.copy(this._targetEnd).lerp(i, a), l = c.dot(o), u = o.multiplyScalar(l - s);
				c.sub(u), this._boundary.clampPoint(c, c);
				let d = Bp.subVectors(c, this._targetEnd);
				this._targetEnd.copy(c), this._target.add(d), this._changedZoom -= e, bp(this._changedZoom) && (this._changedZoom = 0);
			}
		}
		this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
		let s = this._collisionTest();
		this._spherical.radius = Math.min(this._spherical.radius, s), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), zp.copy(this._target), this._camera.parent && this._camera.parent.localToWorld(zp), this._camera.lookAt(zp), (!bp(this._focalOffset.x) || !bp(this._focalOffset.y) || !bp(this._focalOffset.z)) && (this._camera.matrix.compose(this._camera.position, this._camera.quaternion, this._camera.scale), Up.setFromMatrixColumn(this._camera.matrix, 0), Wp.setFromMatrixColumn(this._camera.matrix, 1), Gp.setFromMatrixColumn(this._camera.matrix, 2), Up.multiplyScalar(this._focalOffset.x), Wp.multiplyScalar(-this._focalOffset.y), Gp.multiplyScalar(this._focalOffset.z), zp.copy(Up).add(Wp).add(Gp), this._camera.position.add(zp), this._camera.updateMatrixWorld()), this._boundaryEnclosesCamera && this._encloseToBoundary(this._camera.position.copy(this._target), zp.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse), 1);
		let c = this._needsUpdate;
		return c && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : c ? (this.dispatchEvent({ type: "update" }), bp(t, this.restThreshold) && bp(n, this.restThreshold) && bp(r, this.restThreshold) && bp(i.x, this.restThreshold) && bp(i.y, this.restThreshold) && bp(i.z, this.restThreshold) && bp(a.x, this.restThreshold) && bp(a.y, this.restThreshold) && bp(a.z, this.restThreshold) && bp(o, this.restThreshold) && !this._hasRested && (this._hasRested = !0, this.dispatchEvent({ type: "rest" }))) : !c && this._updatedLastTime && this.dispatchEvent({ type: "sleep" }), this._lastDistance = this._spherical.radius, this._lastZoom = this._zoom, this._updatedLastTime = c, this._needsUpdate = !1, c;
	}
	toJSON() {
		return JSON.stringify({
			enabled: this._enabled,
			minDistance: this.minDistance,
			maxDistance: Cp(this.maxDistance),
			minZoom: this.minZoom,
			maxZoom: Cp(this.maxZoom),
			minPolarAngle: this.minPolarAngle,
			maxPolarAngle: Cp(this.maxPolarAngle),
			minAzimuthAngle: Cp(this.minAzimuthAngle),
			maxAzimuthAngle: Cp(this.maxAzimuthAngle),
			smoothTime: this._smoothTime,
			controlSmoothTime: this._controlSmoothTime,
			dollySpeed: this.dollySpeed,
			truckSpeed: this.truckSpeed,
			dollyToCursor: this.dollyToCursor,
			target: this._targetEnd.toArray(),
			position: zp.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),
			zoom: this._zoomEnd,
			focalOffset: this._focalOffsetEnd.toArray(),
			target0: this._target0.toArray(),
			position0: this._position0.toArray(),
			zoom0: this._zoom0,
			focalOffset0: this._focalOffset0.toArray()
		});
	}
	fromJSON(e, t = !1) {
		let n = JSON.parse(e);
		this.enabled = n.enabled, this.minDistance = n.minDistance, this.maxDistance = wp(n.maxDistance), this.minZoom = n.minZoom, this.maxZoom = wp(n.maxZoom), this.minPolarAngle = n.minPolarAngle, this.maxPolarAngle = wp(n.maxPolarAngle), this.minAzimuthAngle = wp(n.minAzimuthAngle), this.maxAzimuthAngle = wp(n.maxAzimuthAngle), this.smoothTime = n.smoothTime, this.controlSmoothTime = n.controlSmoothTime, this.dollySpeed = n.dollySpeed, this.truckSpeed = n.truckSpeed, this.dollyToCursor = n.dollyToCursor, this._target0.fromArray(n.target0), this._position0.fromArray(n.position0), this._zoom0 = n.zoom0, this._focalOffset0.fromArray(n.focalOffset0), this.moveTo(n.target[0], n.target[1], n.target[2], t), Jp.setFromVector3(zp.fromArray(n.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)), this.rotateTo(Jp.theta, Jp.phi, t), this.dollyTo(Jp.radius, t), this.zoomTo(n.zoom, t), this.setFocalOffset(n.focalOffset[0], n.focalOffset[1], n.focalOffset[2], t), this._needsUpdate = !0;
	}
	connect(e) {
		if (this._domElement) {
			console.warn("camera-controls is already connected.");
			return;
		}
		e.setAttribute("data-camera-controls-version", Ap), this._addAllEventListeners(e), this._getClientRect(this._elementRect);
	}
	disconnect() {
		this.cancel(), this._removeAllEventListeners(), this._domElement && (this._domElement.removeAttribute("data-camera-controls-version"), this._domElement = void 0);
	}
	dispose() {
		this.removeAllEventListeners(), this.disconnect();
	}
	_getTargetDirection(e) {
		return e.setFromSpherical(this._spherical).divideScalar(this._spherical.radius).applyQuaternion(this._yAxisUpSpaceInverse);
	}
	_getCameraDirection(e) {
		return this._getTargetDirection(e).negate();
	}
	_findPointerById(e) {
		return this._activePointers.find((t) => t.pointerId === e);
	}
	_findPointerByMouseButton(e) {
		return this._activePointers.find((t) => t.mouseButton === e);
	}
	_disposePointer(e) {
		this._activePointers.splice(this._activePointers.indexOf(e), 1);
	}
	_encloseToBoundary(e, t, n) {
		let r = t.lengthSq();
		if (r === 0) return e;
		let i = Bp.copy(t).add(e), a = this._boundary.clampPoint(i, Vp).sub(i), o = a.lengthSq();
		if (o === 0) return e.add(t);
		if (o === r) return e;
		if (n === 0) return e.add(t).add(a);
		{
			let r = 1 + n * o / t.dot(a);
			return e.add(Bp.copy(t).multiplyScalar(r)).add(a.multiplyScalar(1 - n));
		}
	}
	_updateNearPlaneCorners() {
		if (pp(this._camera)) {
			let e = this._camera, t = e.near, n = e.getEffectiveFOV() * vp, r = Math.tan(n * .5) * t, i = r * e.aspect;
			this._nearPlaneCorners[0].set(-i, -r, 0), this._nearPlaneCorners[1].set(i, -r, 0), this._nearPlaneCorners[2].set(i, r, 0), this._nearPlaneCorners[3].set(-i, r, 0);
		} else if (mp(this._camera)) {
			let e = this._camera, t = 1 / e.zoom, n = e.left * t, r = e.right * t, i = e.top * t, a = e.bottom * t;
			this._nearPlaneCorners[0].set(n, i, 0), this._nearPlaneCorners[1].set(r, i, 0), this._nearPlaneCorners[2].set(r, a, 0), this._nearPlaneCorners[3].set(n, a, 0);
		}
	}
	_collisionTest() {
		let e = Infinity;
		if (!(this.colliderMeshes.length >= 1) || Op(this._camera, "_collisionTest")) return e;
		let t = this._getTargetDirection(Hp);
		tm.lookAt(Fp, t, this._camera.up);
		for (let n = 0; n < 4; n++) {
			let r = Bp.copy(this._nearPlaneCorners[n]);
			r.applyMatrix4(tm);
			let i = Vp.addVectors(this._target, r);
			nm.set(i, t), nm.far = this._spherical.radius + 1;
			let a = nm.intersectObjects(this.colliderMeshes);
			a.length !== 0 && a[0].distance < e && (e = a[0].distance);
		}
		return e;
	}
	_getClientRect(e) {
		if (!this._domElement) return;
		let t = this._domElement.getBoundingClientRect();
		return e.x = t.left, e.y = t.top, this._viewport ? (e.x += this._viewport.x, e.y += t.height - this._viewport.w - this._viewport.y, e.width = this._viewport.z, e.height = this._viewport.w) : (e.width = t.width, e.height = t.height), e;
	}
	_createOnRestPromise(e) {
		return e ? Promise.resolve() : (this._hasRested = !1, this.dispatchEvent({ type: "transitionstart" }), new Promise((e) => {
			let t = () => {
				this.removeEventListener("rest", t), e();
			};
			this.addEventListener("rest", t);
		}));
	}
	_addAllEventListeners(e) {}
	_removeAllEventListeners() {}
	get smoothTime() {
		return this._smoothTime;
	}
	set smoothTime(e) {
		this._applySmoothTime(this._smoothTime, e);
	}
	get controlSmoothTime() {
		return this._controlSmoothTime;
	}
	set controlSmoothTime(e) {
		this._applySmoothTime(this._controlSmoothTime, e);
	}
	get draggingSmoothTime() {
		return console.warn(".draggingSmoothTime has been deprecated. use controlSmoothTime instead."), this._controlSmoothTime;
	}
	set draggingSmoothTime(e) {
		console.warn(".draggingSmoothTime has been deprecated. use controlSmoothTime instead."), this._applySmoothTime(this._controlSmoothTime, e);
	}
	_getTargetSmoothTime() {
		return this._isUserControllingTruck ? this._controlSmoothTime.truck : this._smoothTime.truck;
	}
	_applySmoothTime(e, t) {
		if (t != null) if (typeof t == "number") e.rotateAzimuth = e.rotatePolar = e.truck = e.dolly = e.zoom = e.offset = t;
		else {
			t.rotate !== void 0 && (e.rotateAzimuth = e.rotatePolar = t.rotate);
			for (let n of Mp) t[n] !== void 0 && (e[n] = t[n]);
		}
	}
	get dampingFactor() {
		return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."), 0;
	}
	set dampingFactor(e) {
		console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.");
	}
	get draggingDampingFactor() {
		return console.warn(".draggingDampingFactor has been deprecated. use controlSmoothTime (in seconds) instead."), 0;
	}
	set draggingDampingFactor(e) {
		console.warn(".draggingDampingFactor has been deprecated. use controlSmoothTime (in seconds) instead.");
	}
	static createBoundingSphere(e, t = new H.Sphere()) {
		let n = t, r = n.center;
		Xp.makeEmpty(), e.traverseVisible((e) => {
			e.isMesh && Xp.expandByObject(e);
		}), Xp.getCenter(r);
		let i = 0;
		return e.traverseVisible((e) => {
			if (!e.isMesh) return;
			let t = e;
			if (!t.geometry) return;
			let n = t.geometry.clone();
			n.applyMatrix4(t.matrixWorld);
			let a = n.attributes.position;
			for (let e = 0, t = a.count; e < t; e++) zp.fromBufferAttribute(a, e), i = Math.max(i, r.distanceToSquared(zp));
		}), n.radius = Math.sqrt(i), n;
	}
};
function im(e, t, n, r, i, a, o, s, c, l) {
	let u = r * o + i * s + a * c;
	return Math.abs(u) < 1e-12 ? null : (l - (e * o + t * s + n * c)) / u;
}
var am = 1e-7, om = /Mac/.test((up = globalThis) == null || (up = up.navigator) == null ? void 0 : up.platform);
function sm(e, t, n) {
	if (e === t) return n < e ? 0 : 1;
	let r = yp((n - e) / (t - e), 0, 1);
	return r * r * (3 - 2 * r);
}
var cm = class extends rm {
	constructor(e, t) {
		super(e, t), B(this, "dollyToCursorHorizonAngle", 6 * vp), B(this, "_targetPlaneNormal", void 0), B(this, "_targetPlaneConstant", 0), B(this, "_warnedTruck", !1), B(this, "_targetFollowsDolly", !1), B(this, "_normal", void 0), B(this, "_endCamera", void 0), B(this, "_forward", void 0), B(this, "_right", void 0), B(this, "_up", void 0), B(this, "_cursorDir", void 0), B(this, "_movedCamera", void 0), B(this, "_rayOrigin", void 0), B(this, "_bearing", void 0), B(this, "_truckShift", void 0), B(this, "_anchorShift", void 0), B(this, "_newTarget", void 0);
		let n = Pp();
		this._targetPlaneNormal = new n.Vector3(), this._normal = new n.Vector3(), this._endCamera = new n.Vector3(), this._forward = new n.Vector3(), this._right = new n.Vector3(), this._up = new n.Vector3(), this._cursorDir = new n.Vector3(), this._movedCamera = new n.Vector3(), this._rayOrigin = new n.Vector3(), this._bearing = new n.Vector3(), this._truckShift = new n.Vector3(), this._anchorShift = new n.Vector3(), this._newTarget = new n.Vector3(), this._updateTargetPlaneNormal(), this._targetPlaneConstant = this._targetEnd.dot(this._targetPlaneNormal);
		let r = this._truckInternal;
		this._truckInternal = (e, t, n, i) => {
			!n && !i && (this._warnedTruck || (console.warn("MapControls: TRUCK panning drifts the target off the plane; coercing to SCREEN_PAN. Bind SCREEN_PAN instead of TRUCK."), this._warnedTruck = !0), i = !0), n || (this._targetFollowsDolly = !1), r(e, t, n, i);
		};
		let i = this._dollyInternal;
		this._dollyInternal = (e, t, n) => {
			let r = this._camera;
			if (this.dollyToCursor && !this.infinityDolly && pp(r)) {
				let i = .95 ** (-e * this.dollySpeed), a = this._sphericalEnd.radius, o = yp(a * i, this.minDistance, this.maxDistance) / a;
				this._updateTargetPlaneNormal();
				let s = this._normal.copy(this._targetPlaneNormal), c = this._targetPlaneConstant, l = this._endCamera.setFromSpherical(this._sphericalEnd).applyQuaternion(this._yAxisUpSpaceInverse).add(this._targetEnd), u = this._forward.subVectors(this._targetEnd, l).normalize(), d = u.dot(s);
				if (d > -1e-7) this._dollyToNoClamp(yp(a * i, this.minDistance, this.maxDistance), !0);
				else {
					let i = this._right.crossVectors(u, r.up);
					i.lengthSq() < am && i.setFromMatrixColumn(r.matrixWorld, 0), i.normalize();
					let f = this._up.crossVectors(i, u).normalize(), p = Math.tan(r.getEffectiveFOV() * vp * .5), m = p * r.aspect, h = this._cursorDir.copy(u).addScaledVector(i, t * m).addScaledVector(f, n * p).normalize(), g = -h.dot(s), _ = Math.sin(this.dollyToCursorHorizonAngle), v = sm(Math.sin(.5 * this.dollyToCursorHorizonAngle), _, g), y = this._bearing.copy(h).addScaledVector(s, g);
					y.lengthSq() > am && y.normalize();
					let b = Math.abs(e) * (om ? 10 : 30), x = a * p, S = this.truckSpeed * b * x / this._elementRect.height, C = this._truckShift.copy(y).multiplyScalar(Math.sign(1 - o) * S), w = this._anchorShift.set(0, 0, 0), T = a;
					if (v > 0) {
						let e = im(l.x, l.y, l.z, h.x, h.y, h.z, s.x, s.y, s.z, c);
						if (e !== null && e > 0) {
							let t = this._movedCamera.copy(l).addScaledVector(h, e * (1 - o));
							T = (c - t.dot(s)) / d, w.copy(t).addScaledVector(u, T).sub(this._targetEnd);
						} else v = 0;
					}
					let E = this._truckShift, D;
					v >= 1 ? (E.copy(w), D = T) : v <= 0 ? (E.copy(C), D = a) : (E.copy(C).lerp(w, v), D = a + (T - a) * v);
					let O = this._newTarget.copy(this._targetEnd).add(E);
					this._boundary.clampPoint(O, O), this._dollyToNoClamp(yp(D, this.minDistance, this.maxDistance), !0), this._targetEnd.copy(O);
				}
				this._isUserControllingTruck = !0, this._targetFollowsDolly = !0, this._changedDolly = 0, this._lastDollyDirection = Math.sign(-e), this._needsUpdate = !0;
				return;
			}
			this._targetFollowsDolly = !1, i(e, t, n);
		};
		let a = this._zoomInternal;
		this._zoomInternal = (e, t, n) => {
			let r = this._camera;
			if (this.dollyToCursor && !this.infinityDolly && mp(r)) {
				let i = .95 ** (e * this.dollySpeed), a = this._zoomEnd, o = yp(a * i, this.minZoom, this.maxZoom);
				this._updateTargetPlaneNormal();
				let s = this._normal.copy(this._targetPlaneNormal), c = this._targetPlaneConstant, l = this._endCamera.setFromSpherical(this._sphericalEnd).applyQuaternion(this._yAxisUpSpaceInverse).add(this._targetEnd), u = this._forward.subVectors(this._targetEnd, l).normalize(), d = this._right.crossVectors(u, r.up);
				d.lengthSq() < am && d.setFromMatrixColumn(r.matrixWorld, 0), d.normalize();
				let f = this._up.crossVectors(d, u).normalize(), p = -u.dot(s), m = Math.sin(this.dollyToCursorHorizonAngle), h = sm(Math.sin(.5 * this.dollyToCursorHorizonAngle), m, p), g = (r.top - r.bottom) / a, _ = 1 - a / o, v = this._bearing.copy(u).addScaledVector(s, p);
				v.lengthSq() > am && v.normalize();
				let y = Math.abs(e) * (om ? 10 : 30), b = this.truckSpeed * y * g / this._elementRect.height, x = this._truckShift.copy(v).multiplyScalar(Math.sign(_) * b), S = this._anchorShift.set(0, 0, 0);
				if (h > 0) {
					let e = (r.right + r.left) * .5, i = (r.top + r.bottom) * .5, o = (r.right - r.left) * .5 / a, p = g * .5, m = this._rayOrigin.copy(l).addScaledVector(d, e + t * o).addScaledVector(f, i + n * p), v = im(m.x, m.y, m.z, u.x, u.y, u.z, s.x, s.y, s.z, c);
					v === null ? h = 0 : S.copy(m).addScaledVector(u, v).sub(this._targetEnd).multiplyScalar(_);
				}
				let C = this._truckShift;
				h >= 1 ? C.copy(S) : h <= 0 ? C.copy(x) : C.copy(x).lerp(S, h);
				let w = this._newTarget.copy(this._targetEnd).add(C);
				this._boundary.clampPoint(w, w), this.zoomTo(o, !0), this._targetEnd.copy(w), this._isUserControllingTruck = !0, this._targetFollowsDolly = !0, this._needsUpdate = !0;
				return;
			}
			this._targetFollowsDolly = !1, a(e, t, n);
		};
	}
	_getTargetSmoothTime() {
		return this._targetFollowsDolly && this._isUserControllingTruck ? mp(this._camera) ? this._isUserControllingZoom ? this._controlSmoothTime.zoom : this._smoothTime.zoom : this._isUserControllingDolly ? this._controlSmoothTime.dolly : this._smoothTime.dolly : super._getTargetSmoothTime();
	}
	_updateTargetPlaneNormal() {
		this._targetPlaneNormal.copy(this._camera.up).normalize();
	}
	setTargetPlane(e) {
		this._targetPlaneConstant = e;
	}
	getTargetPlane() {
		return this._targetPlaneConstant;
	}
}, U = Qe(), lm = {
	Box3: Ve,
	MathUtils: { clamp: Sn.clamp },
	Matrix4: Ct,
	Quaternion: ot,
	Raycaster: ft,
	Sphere: nn,
	Spherical: mn,
	Vector2: gt,
	Vector3: I,
	Vector4: kn
};
cm.install({ THREE: lm }), jt({ CameraControlsImpl: cm });
function um(e) {
	var t, n;
	let r = (0, U.c)(50), i, a, o, s, c, l, u, d, f, p, m, h, g, _;
	r[0] === e ? (i = r[1], a = r[2], o = r[3], s = r[4], c = r[5], l = r[6], u = r[7], d = r[8], f = r[9], p = r[10], m = r[11], h = r[12], g = r[13], _ = r[14]) : ({ref: h, camera: i, domElement: a, makeDefault: o, onControlStart: l, onControl: s, onControlEnd: c, onTransitionStart: f, onUpdate: p, onWake: m, onRest: u, onSleep: d, regress: g, ..._} = e, r[0] = e, r[1] = i, r[2] = a, r[3] = o, r[4] = s, r[5] = c, r[6] = l, r[7] = u, r[8] = d, r[9] = f, r[10] = p, r[11] = m, r[12] = h, r[13] = g, r[14] = _);
	let v = xt(bm), y = xt(ym), b = xt(vm), x = xt(_m), S = xt(gm), C = xt(hm), w = un(), T = (t = i) == null ? v : t, E = (n = a) == null ? y.domElement : n, D;
	r[15] === T ? D = r[16] : (D = () => xm(T), r[15] = T, r[16] = D);
	let [O, k] = (0, L.useState)(D), [A, j] = (0, L.useState)(T);
	A !== T && (j(T), k((e) => Object.assign(e, { camera: T })));
	let ee;
	r[17] !== O || r[18] !== T || r[19] !== y || r[20] !== w ? (ee = (e, t) => {
		if (O.update(Math.min(t, Cm)) || y.info.render.frame == 0) {
			let e = T.position.toArray().map(mm), t = O.getTarget(wm).toArray().map(pm), { theta: n, phi: r, radius: i } = O.getSpherical(Tm), a = [
				Un(n),
				Un(r),
				i
			].map(fm), o = [T.near, T.far].map(dm);
			w("camera", {
				position: e,
				target: t,
				spherical: a,
				clippingPlanes: o
			});
		}
	}, r[17] = O, r[18] = T, r[19] = y, r[20] = w, r[21] = ee) : ee = r[21], Pt(ee, -1);
	let te, ne;
	r[22] !== O || r[23] !== E ? (te = () => {
		O.connect(E);
		let e = () => O.cancel();
		return E.addEventListener("touchcancel", e), () => {
			E.removeEventListener("touchcancel", e), O.disconnect();
		};
	}, ne = [E, O], r[22] = O, r[23] = E, r[24] = te, r[25] = ne) : (te = r[24], ne = r[25]), (0, L.useEffect)(te, ne);
	let re, M;
	r[26] !== O || r[27] !== b || r[28] !== s || r[29] !== c || r[30] !== l || r[31] !== u || r[32] !== d || r[33] !== f || r[34] !== p || r[35] !== m || r[36] !== C || r[37] !== g ? (re = () => {
		let e = function() {
			b(), g && C.regress();
		}, t = (t) => {
			e(), l == null || l(t);
		}, n = (t) => {
			e(), s == null || s(t);
		}, r = (e) => {
			c == null || c(e);
		}, i = (t) => {
			e(), f == null || f(t);
		}, a = (t) => {
			e(), p == null || p(t);
		}, o = (t) => {
			e(), m == null || m(t);
		}, h = (e) => {
			u == null || u(e);
		}, _ = (e) => {
			d == null || d(e);
		};
		return O.addEventListener("controlstart", t), O.addEventListener("control", n), O.addEventListener("controlend", r), O.addEventListener("transitionstart", i), O.addEventListener("update", a), O.addEventListener("wake", o), O.addEventListener("rest", h), O.addEventListener("sleep", _), () => {
			O.removeEventListener("controlstart", t), O.removeEventListener("control", n), O.removeEventListener("controlend", r), O.removeEventListener("transitionstart", i), O.removeEventListener("update", a), O.removeEventListener("wake", o), O.removeEventListener("rest", h), O.removeEventListener("sleep", _);
		};
	}, M = [
		O,
		b,
		g,
		C,
		l,
		s,
		c,
		f,
		p,
		m,
		u,
		d
	], r[26] = O, r[27] = b, r[28] = s, r[29] = c, r[30] = l, r[31] = u, r[32] = d, r[33] = f, r[34] = p, r[35] = m, r[36] = C, r[37] = g, r[38] = re, r[39] = M) : (re = r[38], M = r[39]), (0, L.useEffect)(re, M);
	let ie, ae;
	r[40] !== O || r[41] !== S || r[42] !== o || r[43] !== x ? (ie = () => {
		if (o) {
			let e = S().controls;
			return x({ controls: O }), () => x({ controls: e });
		}
	}, ae = [
		o,
		O,
		x,
		S
	], r[40] = O, r[41] = S, r[42] = o, r[43] = x, r[44] = ie, r[45] = ae) : (ie = r[44], ae = r[45]), (0, L.useEffect)(ie, ae);
	let N;
	return r[46] !== O || r[47] !== h || r[48] !== _ ? (N = /* @__PURE__ */ (0, R.jsx)("primitive", {
		ref: h,
		object: O,
		..._
	}), r[46] = O, r[47] = h, r[48] = _, r[49] = N) : N = r[49], N;
}
function dm(e) {
	return +e.toFixed(2);
}
function fm(e) {
	return +e.toFixed(2);
}
function pm(e) {
	return +e.toFixed(2);
}
function mm(e) {
	return +e.toFixed(2);
}
function hm(e) {
	return e.performance;
}
function gm(e) {
	return e.get;
}
function _m(e) {
	return e.set;
}
function vm(e) {
	return e.invalidate;
}
function ym(e) {
	return e.gl;
}
function bm(e) {
	return e.camera;
}
function xm(e) {
	let t = new cm(e), { NONE: n } = Sm;
	return t.mouseButtons = {
		left: n,
		middle: n,
		right: n,
		wheel: n
	}, t.touches = {
		one: n,
		two: n,
		three: n
	}, t;
}
var Sm = cm.ACTION, Cm = 1 / 30, wm = new I(), Tm = new mn();
//#endregion
//#region ../renderer/src/types/guards.ts
function Em(e) {
	return e.shape !== void 0;
}
function Dm(e) {
	return e.source !== void 0;
}
function Om(e) {
	return e.lines !== void 0;
}
function km(e) {
	return e.points !== void 0;
}
function Am(e) {
	return e.url !== void 0;
}
function jm(e) {
	return e.children !== void 0;
}
function Mm(e) {
	return e[0] !== void 0 && jm(e[0]);
}
function Nm(e) {
	return e[0] !== void 0 && Em(e[0]);
}
function Pm(e) {
	return e[0] !== void 0 && Dm(e[0]);
}
function Fm(e) {
	return e[0] !== void 0 && Om(e[0]);
}
function Im(e) {
	return e[0] !== void 0 && km(e[0]);
}
function Lm(e) {
	return e[0] !== void 0 && Am(e[0]);
}
//#endregion
//#region ../renderer/src/update/store.ts
var Rm = /* @__PURE__ */ new WeakMap();
function zm(...e) {
	for (let t of e) Um(t);
}
function Bm(e, t) {
	return Hm(e).listeners.add(t), () => {
		let n = Rm.get(e);
		n && n.listeners.delete(t);
	};
}
function Vm(e) {
	var t;
	let n = Hm(e);
	return ((t = n.childrenSnapshot) == null ? void 0 : t.version) !== n.version && (n.childrenSnapshot = {
		version: n.version,
		snapshot: [...e.children]
	}), n.childrenSnapshot.snapshot;
}
function Hm(e) {
	let t = Rm.get(e);
	return t || (t = {
		version: 0,
		listeners: /* @__PURE__ */ new Set()
	}, Rm.set(e, t)), t;
}
function Um(e) {
	let t = Rm.get(e);
	if (t) {
		t.version++;
		for (let e of t.listeners) e();
	}
}
//#endregion
//#region ../renderer/src/update/slot-writers.ts
var Wm = /* @__PURE__ */ new WeakMap();
function Gm(e, t, n) {
	var r;
	function i() {
		t(), n();
	}
	let a = (r = Wm.get(e)) == null ? /* @__PURE__ */ new Set() : r;
	return a.add(i), Wm.set(e, a), () => {
		a.delete(i);
	};
}
function Km(e) {
	let t = Wm.get(e);
	if (t) for (let e of [...t]) e();
}
function qm(e) {
	if (e) for (let t of e) jm(t) ? zm(t) : Km(t);
}
//#endregion
//#region ../renderer/src/utils/logging.ts
var Jm = /* @__PURE__ */ e(ce(), 1), Ym = "efp:renderer";
function Xm(e) {
	let t = (0, Jm.default)(e ? `${Ym}:${e}` : Ym);
	t.log = (...e) => console.info(...e);
	let n = t.extend("debug");
	n.log = (...e) => console.debug(...e);
	let r = t.extend("warn");
	r.log = (...e) => console.warn(...e);
	let i = t.extend("error");
	return i.log = (...e) => console.error(...e), {
		debug: n,
		info: t,
		warn: r,
		error: i
	};
}
function Zm(e, t) {
	function n(e) {
		let r = e.name;
		Mm(e.children) ? (console.groupCollapsed(r), e.children.forEach((e) => n(e)), console.groupEnd()) : t(r);
	}
	t.enabled && n(e.rootLayer);
}
//#endregion
//#region ../renderer/src/events/def-culling.ts
function Qm(e, t, n) {
	var r, i;
	let a = (r = t == null ? void 0 : t[0]) == null ? .5 : r, o = (i = t == null ? void 0 : t[1]) == null ? .5 : i, s = Math.max(a, 1 - a) * e.size.x, c = Math.max(o, 1 - o) * e.size.y;
	return th.set(e.center.x, e.center.y, e.elevation), n.set(th, Math.hypot(s, c)), n;
}
function $m(e, t) {
	return Om(e) ? !t.intersectsSphere(Qm(e.bounds, void 0, nh)) : Dm(e) ? !t.intersectsSphere(Qm(e.bounds, e.origin, nh)) : !1;
}
function eh(e, t, n = new cn()) {
	return rh.multiplyMatrices(e.projectionMatrix, e.matrixWorldInverse).multiply(t), n.setFromProjectionMatrix(rh, e.coordinateSystem);
}
var th = new I(), nh = new nn(), rh = new Ct(), ih = Xm("layout"), ah = (0, L.createContext)(void 0);
function oh(e, t) {
	let n = (0, U.c)(5), r = (0, L.use)(ah), i, a;
	n[0] !== t || n[1] !== e || n[2] !== r ? (i = () => {
		if (!r) return;
		let n = t.filter(sh);
		if ((e.onScale || e.onRoll) && n.push(e), n.length) return r.register(n);
	}, a = [
		r,
		e,
		t
	], n[0] = t, n[1] = e, n[2] = r, n[3] = i, n[4] = a) : (i = n[3], a = n[4]), (0, L.useEffect)(i, a);
}
function sh(e) {
	return (e.onScale !== void 0 || e.onRoll !== void 0) && !jm(e);
}
function ch(e, t, n = 0) {
	let r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new WeakMap(), o = /* @__PURE__ */ new WeakMap(), s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), u, d = t, f = n, p = {
		pixelSize: d,
		roll: f
	};
	function m(e, t) {
		if (e.onScale && i.get(e) !== d) {
			let n = e.onScale(p);
			i.set(e, d), n != null && n.length && t(n);
		}
		if (e.onRoll && a.get(e) !== f) {
			let n = e.onRoll(p);
			a.set(e, f), n != null && n.length && t(n);
		}
	}
	function h(e) {
		o.set(e, e.hidden === !0), qm([e]);
	}
	function g(e) {
		for (let t of e) {
			if (jm(t)) {
				h(t);
				continue;
			}
			let e = o.get(t);
			e !== void 0 && e !== (t.hidden === !0) ? (c.delete(t), l.delete(t), s.add(t)) : (s.delete(t), l.delete(t), c.add(t));
		}
	}
	function _(e, t) {
		let n = performance.now(), i = s.size + c.size + l.size, a = 0;
		for (let e of r) for (let n of e) n[t] && (a++, m(n, g));
		let o = s.size + c.size + l.size;
		o > i && (u != null || (u = {
			defs: 0,
			drains: 0,
			writeMs: 0
		}), u.defs += o - i), ih.debug(`${e}: ran ${a} ${t} handlers in ${(performance.now() - n).toFixed(2)}ms, ${o} defs to write (${s.size} visibility flips)`);
	}
	return {
		get pixelSize() {
			return d;
		},
		get roll() {
			return f;
		},
		get hasWork() {
			return s.size > 0 || c.size > 0 || l.size > 0;
		},
		register(t) {
			r.add(t);
			let n = !1;
			for (let e of t) o.has(e) || o.set(e, e.hidden === !0), m(e, (e) => {
				for (let t of e) h(t);
				n = !0;
			});
			return n && e(), () => {
				r.delete(t);
				for (let e of t) s.delete(e), c.delete(e), l.delete(e);
			};
		},
		applyScale(e) {
			d = e, p.pixelSize = e, _(`pxToSvgScale ${+e.toFixed(3)}`, "onScale");
		},
		applyRoll(e) {
			f = e, p.roll = e, _(`roll ${+e.toFixed(3)}`, "onRoll");
		},
		drain(e, t = -1) {
			if (s.size === 0 && c.size === 0 && l.size === 0) return !1;
			let n = performance.now(), r = 0, i = () => r > 0 && t > 0 && performance.now() - n >= t;
			for (let t of [s, c]) for (let n of t) {
				if (i()) break;
				if (r++, t.delete(n), e !== void 0 && $m(n, e)) {
					l.add(n);
					continue;
				}
				h(n);
			}
			for (let e of l) {
				if (i()) break;
				r++, l.delete(e), h(e);
			}
			let a = s.size + c.size + l.size;
			return u && (u.drains++, u.writeMs += performance.now() - n, a === 0 && (ih.debug(`wrote ${u.defs} defs over ${u.drains} frames in ${u.writeMs.toFixed(2)}ms`), u = void 0)), a > 0;
		}
	};
}
//#endregion
//#region ../renderer/src/space/camera-handle.ts
var lh = (0, L.createContext)(void 0);
function uh() {
	return (0, L.use)(lh);
}
function dh(e, t) {
	let n = fh(e, ph), r = (e) => n > 0 && e > 0 ? n / e : 1;
	return {
		get zoomFactor() {
			return r(t());
		},
		zoomFactorToDistance(e) {
			return e > 0 ? n / e : n;
		},
		distanceToZoomFactor: r
	};
}
function fh(e, t) {
	return e <= 0 ? 0 : e / 2 / Math.tan(Hn(t) / 2);
}
var ph = 36.87;
//#endregion
//#region ../renderer/src/space/canvas-size.ts
function mh() {
	let e = (0, U.c)(4), t = xt(_h), n = xt(gh), r = xt(hh), i;
	return e[0] !== r || e[1] !== n || e[2] !== t ? (i = {
		width: t,
		height: n,
		dpr: r
	}, e[0] = r, e[1] = n, e[2] = t, e[3] = i) : i = e[3], i;
}
function hh(e) {
	return e.viewport.dpr;
}
function gh(e) {
	return e.size.height;
}
function _h(e) {
	return e.size.width;
}
//#endregion
//#region ../renderer/src/space/camera-kind.ts
function vh(e) {
	return e.isPerspectiveCamera === !0;
}
function yh(e) {
	return e.isOrthographicCamera === !0;
}
function bh(e) {
	return vh(e) || yh(e);
}
//#endregion
//#region ../renderer/src/space/Space.ts
var xh = Xm("space");
function Sh() {
	return (0, L.use)(Th);
}
var Ch = class {
	constructor(e) {
		this.matrix = new Ct(), this.matrixInverse = new Ct(), this._scale = 1, this._isExternal = !1, this.width = 0, this.height = 0, e && this.refit(e);
	}
	get scale() {
		return this._scale;
	}
	get isExternal() {
		return this._isExternal;
	}
	refit(e) {
		if (this.width = e.width, this.height = e.height, this._isExternal = this.validateStaticTransform(e.staticTransform), this._isExternal) this.matrix.fromArray(e.staticTransform);
		else {
			let t = wh(e.viewbox, this.width * e.dpr, this.height * e.dpr), { x: n, y: r } = e.viewbox.center;
			this.matrix.makeTranslation(-n * t, -r * t, 0).scale(new I(t, t, t));
		}
		this.matrix.premultiply(Dh), this.matrixInverse.copy(this.matrix).invert(), this._scale = Math.sqrt(Lf(this.matrix, 0) * Lf(this.matrix, 1));
	}
	planToWorld(e, t = new I()) {
		var n;
		return t.set(e.x, e.y, (n = e.z) == null ? 0 : n).applyMatrix4(this.matrix);
	}
	worldToPlan(e, t = new Jn()) {
		return Ph.set(e.x, e.y, e.z).applyMatrix4(this.matrixInverse), t.set(Ph.x, Ph.y, Ph.z), t;
	}
	canvasToNdc(e, t = new gt()) {
		if (this.width <= 0 || this.height <= 0) return xh.warn("canvasToNdc: the canvas has no size"), t.set(0, 0);
		let n = e.x / this.width * 2 - 1, r = -(e.y / this.height) * 2 + 1;
		return t.set(Ff(n, -1, 1), Ff(r, -1, 1));
	}
	ndcToCanvas(e, t = new Jn()) {
		return t.set((e.x + 1) / 2 * this.width, (1 - e.y) / 2 * this.height, 0);
	}
	rayToPlan(e, t = new Jn()) {
		if (jh.copy(e).applyMatrix4(this.matrixInverse), jh.intersectPlane(kh, Ph)) return t.set(Ph.x, Ph.y, 0);
	}
	ndcToPlan(e, t, n) {
		return Eh(Ah, e, t), this.rayToPlan(Ah.ray, n);
	}
	planToNdc(e, t, n = new gt()) {
		if (this.planToWorld(e, Fh), Ih.set(Fh.x, Fh.y, Fh.z, 1).applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix), !(Ih.w <= 0)) return n.set(Ih.x / Ih.w, Ih.y / Ih.w);
	}
	canvasToPlan(e, t, n) {
		return this.ndcToPlan(this.canvasToNdc(e, Mh), t, n);
	}
	planToCanvas(e, t, n) {
		let r = this.planToNdc(e, t, Lh);
		if (r) return this.ndcToCanvas(r, n);
	}
	validateStaticTransform(e) {
		return e === void 0 ? !1 : e.length === 16 ? !0 : (xh.warn(`staticTransform must be 16 elements long, got ${e.length}`), !1);
	}
};
function wh(e, t, n) {
	let { width: r, height: i } = e.size;
	return r <= 0 || i <= 0 || t <= 0 || n <= 0 ? 1 : Math.min(t / r, n / i);
}
var Th = (0, L.createContext)(new Ch());
function Eh(e, t, n) {
	if (bh(n)) {
		e.setFromCamera(Nh.set(t.x, t.y), n);
		return;
	}
	e.ray.origin.set(t.x, t.y, -1).unproject(n), e.ray.direction.set(t.x, t.y, 1).unproject(n).sub(e.ray.origin).normalize();
}
var Dh = new Ct().makeScale(1, 1, -1), Oh = new Ct().makeScale(1, -1, 1), kh = new Oe(new I(0, 0, 1), 0), Ah = new ft(), jh = new Ie(), Mh = new gt(), Nh = new gt(), Ph = new I(), Fh = new I(), Ih = new kn(), Lh = new gt();
//#endregion
//#region ../renderer/src/controls/hooks.ts
function Rh() {
	var e;
	return (e = xt(zh)) == null ? void 0 : e;
}
function zh(e) {
	return e.controls;
}
function Bh(e) {
	let t = (0, U.c)(7), n = xt(Hh), r = xt(Vh), i;
	t[0] !== e || t[1] !== n ? (i = () => {
		var t;
		let r = n().controls;
		if (r) return (t = e(r)) == null ? void 0 : t;
	}, t[0] = e, t[1] = n, t[2] = i) : i = t[2];
	let a;
	t[3] !== e || t[4] !== n || t[5] !== r ? (a = [
		e,
		n,
		r
	], t[3] = e, t[4] = n, t[5] = r, t[6] = a) : a = t[6], (0, L.useEffect)(i, a);
}
function Vh(e) {
	return e.controls;
}
function Hh(e) {
	return e.get;
}
function Uh(e) {
	let t = (0, U.c)(2), n;
	t[0] === e ? n = t[1] : (n = (t) => (t.addEventListener("sleep", e), () => t.removeEventListener("sleep", e)), t[0] = e, t[1] = n), Bh(n);
}
function Wh(e) {
	let t = (0, U.c)(2), n;
	t[0] === e ? n = t[1] : (n = (t) => (t.addEventListener("control", e), () => t.removeEventListener("control", e)), t[0] = e, t[1] = n), Bh(n);
}
function Gh() {
	let e = (0, U.c)(5), t = Rh(), n = uh(), r = Sh(), i = (0, L.use)(ah), a;
	return e[0] !== n || e[1] !== t || e[2] !== r || e[3] !== i ? (a = () => Kh({
		controls: t,
		camera: n,
		space: r,
		targets: i
	}), e[0] = n, e[1] = t, e[2] = r, e[3] = i, e[4] = a) : a = e[4], a;
}
function Kh(e) {
	var t, n;
	let { controls: r, camera: i, space: a, targets: o } = e, s = (t = o == null ? void 0 : o.pixelSize) == null ? 1 : t;
	return r ? (r.getTarget(Jh), {
		center: a.worldToPlan(Jh, new Jn()),
		zoom: (n = i == null ? void 0 : i.zoomFactor) == null ? 1 : n,
		roll: Un(Uf(r)),
		pitch: Un(r.polarAngle),
		pixelSize: s
	}) : {
		...qh(),
		pixelSize: s
	};
}
function qh() {
	return {
		center: new Jn(),
		zoom: 1,
		roll: 0,
		pitch: 0,
		pixelSize: 1
	};
}
var Jh = new I();
function Yh() {
	let e = (0, U.c)(11), t = xt(Zh), n = xt(Xh), r = Rh(), i = uh(), a = Sh(), { width: o, height: s, dpr: c } = mh(), l;
	e[0] === t ? l = e[1] : (l = () => t().camera.view, e[0] = t, e[1] = l);
	let u;
	return e[2] !== i || e[3] !== r || e[4] !== c || e[5] !== s || e[6] !== n || e[7] !== a || e[8] !== l || e[9] !== o ? (u = new Hf({
		controls: r,
		camera: i,
		space: a,
		view: l,
		width: o,
		height: s,
		dpr: c,
		invalidate: n
	}), e[2] = i, e[3] = r, e[4] = c, e[5] = s, e[6] = n, e[7] = a, e[8] = l, e[9] = o, e[10] = u) : u = e[10], u;
}
function Xh(e) {
	return e.invalidate;
}
function Zh(e) {
	return e.get;
}
//#endregion
//#region ../renderer/src/controls/handlers/Inertia.tsx
function Qh(e) {
	var t, n, r, i;
	let a = (0, U.c)(17), o = (t = e.minSampleMs) == null ? ag : t, s = (n = e.durationMs) == null ? og : n, c = (r = e.speedThreshold) == null ? sg : r, l = (i = e.ease) == null ? eg : i, u = xt($h), d;
	a[0] !== s || a[1] !== l || a[2] !== o || a[3] !== c ? (d = () => new tg({
		minSampleMs: o,
		durationMs: s,
		speedThreshold: c,
		ease: l
	}), a[0] = s, a[1] = l, a[2] = o, a[3] = c, a[4] = d) : d = a[4];
	let [f] = (0, L.useState)(d), p, m;
	a[5] !== s || a[6] !== l || a[7] !== f || a[8] !== o || a[9] !== c ? (p = () => {
		f.configure({
			minSampleMs: o,
			durationMs: s,
			speedThreshold: c,
			ease: l
		});
	}, m = [
		f,
		o,
		s,
		c,
		l
	], a[5] = s, a[6] = l, a[7] = f, a[8] = o, a[9] = c, a[10] = p, a[11] = m) : (p = a[10], m = a[11]), (0, L.useEffect)(p, m);
	let h;
	a[12] === f ? h = a[13] : (h = (e) => (f.connect(e), () => f.disconnect()), a[12] = f, a[13] = h), Bh(h);
	let g;
	return a[14] !== f || a[15] !== u ? (g = (e, t) => {
		f.update(t) && u();
	}, a[14] = f, a[15] = u, a[16] = g) : g = a[16], Pt(g, ng), null;
}
function $h(e) {
	return e.invalidate;
}
function eg(e) {
	return 2 ** (10 * (e - 1));
}
var tg = class {
	constructor(e) {
		this.minSampleMs = void 0, this.durationMs = void 0, this.speedThreshold = void 0, this.ease = void 0, this.controls = void 0, this.samples = [], this.target = new I(), this.delta = new I(), this.velocity = new I(), this.active = !1, this.elapsedMs = 0, this.prevFactor = 1, this.onControlStart = () => {
			this.active = !1, this.samples.length = 0;
		}, this.onControl = () => {
			let e = this.controls;
			if (!e) return;
			let t = performance.now();
			e.getTarget(this.target, !1), this.samples.push({
				t,
				target: this.target.clone()
			});
			let n = t - rg;
			for (; this.samples.length && this.samples[0].t < n;) this.samples.shift();
		}, this.onControlEnd = () => {
			let e = this.controls;
			if (!e) return;
			let t = performance.now(), n = t - this.minSampleMs;
			for (let r = this.samples.length - 1; r >= 0; r--) {
				let i = this.samples[r];
				if (i.t >= n && r !== 0) continue;
				let a = t - i.t;
				if (a <= 0 || (e.getTarget(this.target, !1), this.velocity.subVectors(this.target, i.target).divideScalar(a), this.velocity.z = 0, this.velocity.length() <= this.speedThreshold)) return;
				this.elapsedMs = 0, this.prevFactor = 1, this.active = !0;
				return;
			}
		}, this.minSampleMs = e.minSampleMs, this.durationMs = e.durationMs, this.speedThreshold = e.speedThreshold, this.ease = e.ease;
	}
	configure(e) {
		e.minSampleMs !== void 0 && (this.minSampleMs = e.minSampleMs), e.durationMs !== void 0 && (this.durationMs = e.durationMs), e.speedThreshold !== void 0 && (this.speedThreshold = e.speedThreshold), e.ease !== void 0 && (this.ease = e.ease);
	}
	connect(e) {
		this.controls && this.disconnect(), this.controls = e, e.addEventListener("controlstart", this.onControlStart), e.addEventListener("control", this.onControl), e.addEventListener("controlend", this.onControlEnd);
	}
	disconnect() {
		let e = this.controls;
		e && (this.active = !1, this.samples.length = 0, e.removeEventListener("controlstart", this.onControlStart), e.removeEventListener("control", this.onControl), e.removeEventListener("controlend", this.onControlEnd), this.controls = void 0);
	}
	update(e) {
		let t = this.controls;
		if (!this.active || !t) return !1;
		let n = e * 1e3;
		this.elapsedMs += n;
		let r = Math.min(1, this.elapsedMs / this.durationMs), i = this.ease(1 - r), a = (i + this.prevFactor) * .5;
		return this.prevFactor = i, t.getTarget(this.target, !1), this.delta.copy(this.velocity).multiplyScalar(a * n), this.target.add(this.delta), t.moveTo(this.target.x, this.target.y, this.target.z, !1), (i <= ig || r >= 1) && (this.active = !1), !0;
	}
}, ng = -2, rg = 300, ig = .02, ag = 50, og = 1e3, sg = .08;
//#endregion
//#region ../renderer/src/controls/handlers/Pan.tsx
function cg(e) {
	var t;
	let n = (0, U.c)(4), r = (t = e.inertia) == null || t;
	if (Bh(lg), r === !1) return null;
	let i;
	n[0] === r ? i = n[1] : (i = r === !0 ? {} : r, n[0] = r, n[1] = i);
	let a;
	return n[2] === i ? a = n[3] : (a = /* @__PURE__ */ (0, R.jsx)(Qh, { ...i }), n[2] = i, n[3] = a), a;
}
function lg(e) {
	return e.mouseButtons.left = Sm.SCREEN_PAN, e.touches.one = Sm.TOUCH_SCREEN_PAN, () => {
		e.mouseButtons.left = Sm.NONE, e.touches.one = Sm.NONE;
	};
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/input/input-consts.js
var ug;
(function(e) {
	e[e.Start = 1] = "Start", e[e.Move = 2] = "Move", e[e.End = 4] = "End", e[e.Cancel = 8] = "Cancel";
})(ug || (ug = {}));
var dg;
(function(e) {
	e[e.None = 0] = "None", e[e.Left = 1] = "Left", e[e.Right = 2] = "Right", e[e.Up = 4] = "Up", e[e.Down = 8] = "Down", e[e.Horizontal = 3] = "Horizontal", e[e.Vertical = 12] = "Vertical", e[e.All = 15] = "All";
})(dg || (dg = {}));
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/recognizer/recognizer-state.js
var fg;
(function(e) {
	e[e.Possible = 1] = "Possible", e[e.Began = 2] = "Began", e[e.Changed = 4] = "Changed", e[e.Ended = 8] = "Ended", e[e.Recognized = 8] = "Recognized", e[e.Cancelled = 16] = "Cancelled", e[e.Failed = 32] = "Failed";
})(fg || (fg = {}));
var pg = "auto", mg = "manipulation", hg = "none", gg = "pan-x", _g = "pan-y";
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/touchaction/clean-touch-actions.js
function vg(e) {
	if (e.includes("none")) return hg;
	let t = e.includes(gg), n = e.includes(_g);
	return t && n ? hg : t || n ? t ? gg : _g : e.includes("manipulation") ? mg : pg;
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/touchaction/touchaction.js
var yg = class {
	constructor(e, t) {
		this.actions = "", this.manager = e, this.set(t);
	}
	set(e) {
		e === "compute" && (e = this.compute()), this.manager.element && (this.manager.element.style.touchAction = e, this.actions = e);
	}
	update() {
		this.set(this.manager.options.touchAction);
	}
	compute() {
		let e = [];
		for (let t of this.manager.recognizers) t.options.enable && (e = e.concat(t.getTouchAction()));
		return vg(e.join(" "));
	}
};
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/utils/split-str.js
function bg(e) {
	return e.trim().split(/\s+/g);
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/utils/event-listeners.js
function xg(e, t, n) {
	if (e) for (let r of bg(t)) e.addEventListener(r, n, !1);
}
function Sg(e, t, n) {
	if (e) for (let r of bg(t)) e.removeEventListener(r, n, !1);
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/utils/get-window-for-element.js
function Cg(e) {
	return (e.ownerDocument || e).defaultView;
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/utils/has-parent.js
function wg(e, t) {
	let n = e;
	for (; n;) {
		if (n === t) return !0;
		n = n.parentNode;
	}
	return !1;
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/input/get-center.js
function Tg(e) {
	let t = e.length;
	if (t === 1) return {
		x: Math.round(e[0].clientX),
		y: Math.round(e[0].clientY)
	};
	let n = 0, r = 0, i = 0;
	for (; i < t;) n += e[i].clientX, r += e[i].clientY, i++;
	return {
		x: Math.round(n / t),
		y: Math.round(r / t)
	};
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/input/simple-clone-input-data.js
function Eg(e) {
	let t = [], n = 0;
	for (; n < e.pointers.length;) t[n] = {
		clientX: Math.round(e.pointers[n].clientX),
		clientY: Math.round(e.pointers[n].clientY)
	}, n++;
	return {
		timeStamp: Date.now(),
		pointers: t,
		center: Tg(t),
		deltaX: e.deltaX,
		deltaY: e.deltaY
	};
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/input/get-distance.js
function Dg(e, t) {
	let n = t.x - e.x, r = t.y - e.y;
	return Math.sqrt(n * n + r * r);
}
function Og(e, t) {
	let n = t.clientX - e.clientX, r = t.clientY - e.clientY;
	return Math.sqrt(n * n + r * r);
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/input/get-angle.js
function kg(e, t) {
	let n = t.x - e.x, r = t.y - e.y;
	return Math.atan2(r, n) * 180 / Math.PI;
}
function Ag(e, t) {
	let n = t.clientX - e.clientX, r = t.clientY - e.clientY;
	return Math.atan2(r, n) * 180 / Math.PI;
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/input/get-direction.js
function jg(e, t) {
	return e === t ? dg.None : Math.abs(e) >= Math.abs(t) ? e < 0 ? dg.Left : dg.Right : t < 0 ? dg.Up : dg.Down;
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/input/get-delta-xy.js
function Mg(e, t) {
	let n = t.center, r = e.offsetDelta, i = e.prevDelta, a = e.prevInput;
	return (t.eventType === ug.Start || (a == null ? void 0 : a.eventType) === ug.End) && (i = e.prevDelta = {
		x: (a == null ? void 0 : a.deltaX) || 0,
		y: (a == null ? void 0 : a.deltaY) || 0
	}, r = e.offsetDelta = {
		x: n.x,
		y: n.y
	}), {
		deltaX: i.x + (n.x - r.x),
		deltaY: i.y + (n.y - r.y)
	};
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/input/get-velocity.js
function Ng(e, t, n) {
	return {
		x: t / e || 0,
		y: n / e || 0
	};
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/input/get-scale.js
function Pg(e, t) {
	return Og(t[0], t[1]) / Og(e[0], e[1]);
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/input/get-rotation.js
function Fg(e, t) {
	return Ag(t[1], t[0]) - Ag(e[1], e[0]);
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/input/compute-interval-input-data.js
function Ig(e, t) {
	let n = e.lastInterval || t, r = t.timeStamp - n.timeStamp, i, a, o, s;
	if (t.eventType !== ug.Cancel && (r > 25 || n.velocity === void 0)) {
		let c = t.deltaX - n.deltaX, l = t.deltaY - n.deltaY, u = Ng(r, c, l);
		a = u.x, o = u.y, i = Math.abs(u.x) > Math.abs(u.y) ? u.x : u.y, s = jg(c, l), e.lastInterval = t;
	} else i = n.velocity, a = n.velocityX, o = n.velocityY, s = n.direction;
	t.velocity = i, t.velocityX = a, t.velocityY = o, t.direction = s;
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/input/compute-input-data.js
function Lg(e, t) {
	let { session: n } = e, { pointers: r } = t, { length: i } = r;
	n.firstInput || (n.firstInput = Eg(t)), i > 1 && !n.firstMultiple ? n.firstMultiple = Eg(t) : i === 1 && (n.firstMultiple = !1);
	let { firstInput: a, firstMultiple: o } = n, s = o ? o.center : a.center, c = t.center = Tg(r);
	t.timeStamp = Date.now(), t.deltaTime = t.timeStamp - a.timeStamp, t.angle = kg(s, c), t.distance = Dg(s, c);
	let { deltaX: l, deltaY: u } = Mg(n, t);
	t.deltaX = l, t.deltaY = u, t.offsetDirection = jg(t.deltaX, t.deltaY);
	let d = Ng(t.deltaTime, t.deltaX, t.deltaY);
	t.overallVelocityX = d.x, t.overallVelocityY = d.y, t.overallVelocity = Math.abs(d.x) > Math.abs(d.y) ? d.x : d.y, t.scale = o ? Pg(o.pointers, r) : 1, t.rotation = o ? Fg(o.pointers, r) : 0, t.maxPointers = n.prevInput ? t.pointers.length > n.prevInput.maxPointers ? t.pointers.length : n.prevInput.maxPointers : t.pointers.length;
	let f = e.element;
	return wg(t.srcEvent.target, f) && (f = t.srcEvent.target), t.target = f, Ig(n, t), t;
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/input/input-handler.js
function Rg(e, t, n) {
	let r = n.pointers.length, i = n.changedPointers.length, a = t & ug.Start && r - i === 0, o = t & (ug.End | ug.Cancel) && r - i === 0;
	n.isFirst = !!a, n.isFinal = !!o, a && (e.session = {}), n.eventType = t;
	let s = Lg(e, n);
	e.emit("hammer.input", s), e.recognize(s), e.session.prevInput = s;
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/input/input.js
var zg = class {
	constructor(e) {
		this.evEl = "", this.evWin = "", this.evTarget = "", this.domHandler = (e) => {
			this.manager.options.enable && this.handler(e);
		}, this.manager = e, this.element = e.element, this.target = e.options.inputTarget || e.element;
	}
	callback(e, t) {
		Rg(this.manager, e, t);
	}
	init() {
		xg(this.element, this.evEl, this.domHandler), xg(this.target, this.evTarget, this.domHandler), xg(Cg(this.element), this.evWin, this.domHandler);
	}
	destroy() {
		Sg(this.element, this.evEl, this.domHandler), Sg(this.target, this.evTarget, this.domHandler), Sg(Cg(this.element), this.evWin, this.domHandler);
	}
}, Bg = {
	pointerdown: ug.Start,
	pointermove: ug.Move,
	pointerup: ug.End,
	pointercancel: ug.Cancel,
	pointerout: ug.Cancel
}, Vg = "pointerdown", Hg = "pointermove pointerup pointercancel", Ug = class extends zg {
	constructor(e) {
		super(e), this.evEl = Vg, this.evWin = Hg, this.store = this.manager.session.pointerEvents = [], this.init();
	}
	handler(e) {
		let { store: t } = this, n = !1, r = Bg[e.type], i = e.pointerType, a = i === "touch", o = t.findIndex((t) => t.pointerId === e.pointerId);
		r & ug.Start && (e.buttons || a) ? o < 0 && (t.push(e), o = t.length - 1) : r & (ug.End | ug.Cancel) && (n = !0), !(o < 0) && (t[o] = e, this.callback(r, {
			pointers: t,
			changedPointers: [e],
			eventType: r,
			pointerType: i,
			srcEvent: e
		}), n && t.splice(o, 1));
	}
}, Wg = [
	"",
	"webkit",
	"Moz",
	"MS",
	"ms",
	"o"
];
function Gg(e, t) {
	let n = t[0].toUpperCase() + t.slice(1);
	for (let r of Wg) {
		let i = r ? r + n : t;
		if (i in e) return i;
	}
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/manager.js
var Kg = 1, qg = 2, Jg = {
	touchAction: "compute",
	enable: !0,
	inputTarget: null,
	cssProps: {
		userSelect: "none",
		userDrag: "none",
		touchCallout: "none",
		tapHighlightColor: "rgba(0,0,0,0)"
	}
}, Yg = class {
	constructor(e, t) {
		this.options = {
			...Jg,
			...t,
			cssProps: {
				...Jg.cssProps,
				...t.cssProps
			},
			inputTarget: t.inputTarget || e
		}, this.handlers = {}, this.session = {}, this.recognizers = [], this.oldCssProps = {}, this.element = e, this.input = new Ug(this), this.touchAction = new yg(this, this.options.touchAction), this.toggleCssProps(!0);
	}
	set(e) {
		return Object.assign(this.options, e), e.touchAction && this.touchAction.update(), e.inputTarget && (this.input.destroy(), this.input.target = e.inputTarget, this.input.init()), this;
	}
	stop(e) {
		this.session.stopped = e ? qg : Kg;
	}
	recognize(e) {
		let { session: t } = this;
		if (t.stopped) return;
		this.session.prevented && e.srcEvent.preventDefault();
		let n, { recognizers: r } = this, { curRecognizer: i } = t;
		(!i || i && i.state & fg.Recognized) && (i = t.curRecognizer = null);
		let a = 0;
		for (; a < r.length;) n = r[a], t.stopped !== qg && (!i || n === i || n.canRecognizeWith(i)) ? n.recognize(e) : n.reset(), !i && n.state & (fg.Began | fg.Changed | fg.Ended) && (i = t.curRecognizer = n), a++;
	}
	get(e) {
		let { recognizers: t } = this;
		for (let n = 0; n < t.length; n++) if (t[n].options.event === e) return t[n];
		return null;
	}
	add(e) {
		if (Array.isArray(e)) {
			for (let t of e) this.add(t);
			return this;
		}
		let t = this.get(e.options.event);
		return t && this.remove(t), this.recognizers.push(e), e.manager = this, this.touchAction.update(), e;
	}
	remove(e) {
		if (Array.isArray(e)) {
			for (let t of e) this.remove(t);
			return this;
		}
		let t = typeof e == "string" ? this.get(e) : e;
		if (t) {
			let { recognizers: e } = this, n = e.indexOf(t);
			n !== -1 && (e.splice(n, 1), this.touchAction.update());
		}
		return this;
	}
	on(e, t) {
		if (!e || !t) return;
		let { handlers: n } = this;
		for (let r of bg(e)) n[r] = n[r] || [], n[r].push(t);
	}
	off(e, t) {
		if (!e) return;
		let { handlers: n } = this;
		for (let r of bg(e)) t ? n[r] && n[r].splice(n[r].indexOf(t), 1) : delete n[r];
	}
	emit(e, t) {
		let n = this.handlers[e] && this.handlers[e].slice();
		if (!n || !n.length) return;
		let r = t;
		r.type = e, r.preventDefault = function() {
			t.srcEvent.preventDefault();
		};
		let i = 0;
		for (; i < n.length;) n[i](r), i++;
	}
	destroy() {
		this.toggleCssProps(!1), this.handlers = {}, this.session = {}, this.input.destroy(), this.element = null;
	}
	toggleCssProps(e) {
		let { element: t } = this;
		if (t) {
			for (let [n, r] of Object.entries(this.options.cssProps)) {
				let i = Gg(t.style, n);
				e ? (this.oldCssProps[i] = t.style[i], t.style[i] = r) : t.style[i] = this.oldCssProps[i] || "";
			}
			e || (this.oldCssProps = {});
		}
	}
}, Xg = 1;
function Zg() {
	return Xg++;
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/recognizer/state-str.js
function Qg(e) {
	return e & fg.Cancelled ? "cancel" : e & fg.Ended ? "end" : e & fg.Changed ? "move" : e & fg.Began ? "start" : "";
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/hammerjs/recognizer/recognizer.js
var $g = class {
	constructor(e) {
		this.options = e, this.id = Zg(), this.state = fg.Possible, this.simultaneous = {}, this.requireFail = [];
	}
	set(e) {
		return Object.assign(this.options, e), this.manager.touchAction.update(), this;
	}
	recognizeWith(e) {
		if (Array.isArray(e)) {
			for (let t of e) this.recognizeWith(t);
			return this;
		}
		let t;
		if (typeof e == "string") {
			if (t = this.manager.get(e), !t) throw Error(`Cannot find recognizer ${e}`);
		} else t = e;
		let { simultaneous: n } = this;
		return n[t.id] || (n[t.id] = t, t.recognizeWith(this)), this;
	}
	dropRecognizeWith(e) {
		if (Array.isArray(e)) {
			for (let t of e) this.dropRecognizeWith(t);
			return this;
		}
		let t;
		return t = typeof e == "string" ? this.manager.get(e) : e, t && delete this.simultaneous[t.id], this;
	}
	requireFailure(e) {
		if (Array.isArray(e)) {
			for (let t of e) this.requireFailure(t);
			return this;
		}
		let t;
		if (typeof e == "string") {
			if (t = this.manager.get(e), !t) throw Error(`Cannot find recognizer ${e}`);
		} else t = e;
		let { requireFail: n } = this;
		return n.indexOf(t) === -1 && (n.push(t), t.requireFailure(this)), this;
	}
	dropRequireFailure(e) {
		if (Array.isArray(e)) {
			for (let t of e) this.dropRequireFailure(t);
			return this;
		}
		let t;
		if (t = typeof e == "string" ? this.manager.get(e) : e, t) {
			let e = this.requireFail.indexOf(t);
			e > -1 && this.requireFail.splice(e, 1);
		}
		return this;
	}
	hasRequireFailures() {
		return !!this.requireFail.find((e) => e.options.enable);
	}
	canRecognizeWith(e) {
		return !!this.simultaneous[e.id];
	}
	emit(e) {
		if (!e) return;
		let { state: t } = this;
		t < fg.Ended && this.manager.emit(this.options.event + Qg(t), e), this.manager.emit(this.options.event, e), e.additionalEvent && this.manager.emit(e.additionalEvent, e), t >= fg.Ended && this.manager.emit(this.options.event + Qg(t), e);
	}
	tryEmit(e) {
		this.canEmit() ? this.emit(e) : this.state = fg.Failed;
	}
	canEmit() {
		let e = 0;
		for (; e < this.requireFail.length;) {
			if (!(this.requireFail[e].state & (fg.Failed | fg.Possible))) return !1;
			e++;
		}
		return !0;
	}
	recognize(e) {
		let t = { ...e };
		if (!this.options.enable) {
			this.reset(), this.state = fg.Failed;
			return;
		}
		this.state & (fg.Recognized | fg.Cancelled | fg.Failed) && (this.state = fg.Possible), this.state = this.process(t), this.state & (fg.Began | fg.Changed | fg.Ended | fg.Cancelled) && this.tryEmit(t);
	}
	getEventNames() {
		return [this.options.event];
	}
	reset() {}
}, e_ = class extends $g {
	attrTest(e) {
		let t = this.options.pointers;
		return t === 0 || e.pointers.length === t;
	}
	process(e) {
		let { state: t } = this, { eventType: n } = e, r = t & (fg.Began | fg.Changed), i = this.attrTest(e);
		return r && (n & ug.Cancel || !i) ? t | fg.Cancelled : r || i ? n & ug.End ? t | fg.Ended : t & fg.Began ? t | fg.Changed : fg.Began : fg.Failed;
	}
}, t_ = class extends e_ {
	constructor() {
		super(...arguments), this.wheelSession = null, this.wheelSessionUnsubscribe = null, this.handleWheelSessionEvent = (e) => {
			e.device === "trackpad" && this.handleTrackpadEvent(e);
		};
	}
	set(e) {
		let { wheelSession: t, ...n } = e;
		if (t && t !== this.wheelSession) {
			var r;
			(r = this.wheelSessionUnsubscribe) == null || r.call(this), this.wheelSessionUnsubscribe = null, this.wheelSession = t;
		}
		return super.set(n), this.updateWheelSessionSubscription(), this;
	}
	getTrackpadInput(e, t = {}) {
		var n, r;
		let { srcEvent: i } = e, a = (n = t.deltaX) == null ? e.deltaX : n, o = (r = t.deltaY) == null ? e.deltaY : r, s = jg(a, o), c = i;
		return {
			pointers: [c, c],
			changedPointers: [c, c],
			pointerType: "trackpad",
			srcEvent: c,
			eventType: e.eventType,
			timeStamp: e.timeStamp,
			deltaTime: e.deltaTime,
			center: e.center,
			deltaX: a,
			deltaY: o,
			angle: Math.atan2(o, a) * 180 / Math.PI,
			distance: Math.sqrt(a * a + o * o),
			scale: 1,
			rotation: 0,
			direction: s,
			offsetDirection: s,
			velocity: e.velocity,
			velocityX: e.velocityX,
			velocityY: e.velocityY,
			overallVelocity: e.overallVelocity,
			overallVelocityX: e.overallVelocityX,
			overallVelocityY: e.overallVelocityY,
			maxPointers: 2,
			target: i.target || this.manager.element,
			additionalEvent: "",
			...t
		};
	}
	updateWheelSessionSubscription() {
		let e = !!(this.wheelSession && this.options.enable && this.options.trackpad && this.options.pointers === 2);
		e && !this.wheelSessionUnsubscribe ? this.wheelSessionUnsubscribe = this.wheelSession.on(this.handleWheelSessionEvent) : !e && this.wheelSessionUnsubscribe && (this.wheelSessionUnsubscribe(), this.wheelSessionUnsubscribe = null);
	}
}, n_ = [
	"",
	"start",
	"move",
	"end",
	"cancel",
	"up",
	"down",
	"left",
	"right"
], r_ = class extends t_ {
	constructor(e = {}) {
		super({
			enable: !0,
			pointers: 1,
			event: "pan",
			threshold: 10,
			direction: dg.All,
			trackpad: !1,
			...e
		}), this.trackpadGesture = !1, this.pX = null, this.pY = null;
	}
	getTouchAction() {
		let { options: { direction: e } } = this, t = [];
		return e & dg.Horizontal && t.push(_g), e & dg.Vertical && t.push(gg), t;
	}
	getEventNames() {
		return n_.map((e) => this.options.event + e);
	}
	directionTest(e) {
		let { options: t } = this, n = !0, { distance: r } = e, { direction: i } = e, a = e.deltaX, o = e.deltaY;
		return i & t.direction || (t.direction & dg.Horizontal ? (i = a === 0 ? dg.None : a < 0 ? dg.Left : dg.Right, n = a !== this.pX, r = Math.abs(e.deltaX)) : (i = o === 0 ? dg.None : o < 0 ? dg.Up : dg.Down, n = o !== this.pY, r = Math.abs(e.deltaY))), e.direction = i, n && r > t.threshold && !!(i & t.direction);
	}
	attrTest(e) {
		return super.attrTest(e) && (!!(this.state & fg.Began) || !(this.state & fg.Began) && this.directionTest(e));
	}
	emit(e) {
		this.pX = e.deltaX, this.pY = e.deltaY;
		let t = dg[e.direction].toLowerCase();
		t && (e.additionalEvent = this.options.event + t), super.emit(e);
	}
	handleTrackpadEvent(e) {
		e.isFirst && (this.trackpadGesture = !e.srcEvent.ctrlKey), this.trackpadGesture && (this.recognize(this.getTrackpadInput(e, {
			deltaX: -e.deltaX,
			deltaY: -e.deltaY,
			velocity: -e.velocity,
			velocityX: -e.velocityX,
			velocityY: -e.velocityY,
			overallVelocity: -e.overallVelocity,
			overallVelocityX: -e.overallVelocityX,
			overallVelocityY: -e.overallVelocityY
		})), e.isFinal && (this.trackpadGesture = !1));
	}
}, i_ = [
	"",
	"start",
	"move",
	"end",
	"cancel"
], a_ = class extends e_ {
	constructor(e = {}) {
		super({
			enable: !0,
			event: "rotate",
			threshold: 0,
			pointers: 2,
			...e
		});
	}
	getTouchAction() {
		return [hg];
	}
	getEventNames() {
		return i_.map((e) => this.options.event + e);
	}
	attrTest(e) {
		return super.attrTest(e) && (Math.abs(e.rotation) > this.options.threshold || !!(this.state & fg.Began));
	}
}, o_ = class {
	constructor(e, t, n) {
		this.element = e, this.callback = t, this.options = n;
	}
	listen(e, t) {
		t ? this.element.addEventListener(e, this.handleEvent, { passive: !1 }) : this.element.removeEventListener(e, this.handleEvent);
	}
}, s_ = (typeof navigator < "u" && navigator.userAgent ? navigator.userAgent.toLowerCase() : "").indexOf("firefox") !== -1, c_ = 40, l_ = .25, u_ = class extends o_ {
	constructor(e, t, n) {
		var r;
		if (n.enable = (r = n.enable) != null && r, super(e, t, n), this.handleEvent = (e) => {
			var t, n;
			if (!this.options.enable) return;
			let r = e.deltaY;
			globalThis.WheelEvent && (s_ && e.deltaMode === globalThis.WheelEvent.DOM_DELTA_PIXEL && (r /= globalThis.devicePixelRatio), e.deltaMode === globalThis.WheelEvent.DOM_DELTA_LINE && (r *= c_)), e.shiftKey && r && (r *= l_), this.callback({
				type: "wheel",
				center: {
					x: e.clientX,
					y: e.clientY
				},
				delta: -r,
				device: (t = (n = this.options.wheelSession) == null ? void 0 : n.device) == null ? "unknown" : t,
				srcEvent: e,
				pointerType: "mouse",
				target: e.target
			});
		}, n.enable) {
			var i;
			this.wheelSessionUnsubscribe = (i = this.options.wheelSession) == null ? void 0 : i.on(() => {}), this.listen("wheel", !0);
		}
	}
	destroy() {
		var e;
		this.listen("wheel", !1), (e = this.wheelSessionUnsubscribe) == null || e.call(this), this.wheelSessionUnsubscribe = void 0;
	}
	enableEventType(e, t) {
		if (e === "wheel" && this.options.enable !== t) {
			if (this.options.enable = t, t && !this.wheelSessionUnsubscribe) {
				var n;
				this.wheelSessionUnsubscribe = (n = this.options.wheelSession) == null ? void 0 : n.on(() => {});
			}
			if (this.listen("wheel", t), !t) {
				var r;
				(r = this.wheelSessionUnsubscribe) == null || r.call(this), this.wheelSessionUnsubscribe = void 0;
			}
		}
	}
}, d_ = 4.000244140625, f_ = 40, p_ = 0, m_ = 1, h_ = 40, g_ = 40, __ = 120, v_ = {
	classificationDelay: 32,
	endDelay: 80
}, y_ = class {
	constructor(e, t = {}) {
		var n;
		this.subscriptions = /* @__PURE__ */ new Map(), this.session = null, this.classificationTimer = null, this.endTimer = null, this.pressedControlKeys = /* @__PURE__ */ new Set(), this.listeningForControlKeys = !1, this.handleEvent = (e) => {
			if (!this.hasSubscribers) return "unknown";
			let t = x_(e, this.pressedControlKeys.size > 0), n = this.session;
			if (n && t.timeStamp - n.lastTimeStamp >= this.options.endDelay) {
				if (this.end(), !this.hasSubscribers) return "unknown";
				n = null;
			}
			n ? (this.scheduleEnd(), this.addSample(n, t)) : (n = this.startPendingSession(t), this.scheduleEnd());
			let { device: r } = n;
			return r === "unknown" && (r = S_(n.samples, !1), r !== "unknown" && this.begin(n, r)), r;
		}, this.finishClassification = () => {
			if (this.classificationTimer = null, !this.session || this.session.device !== "unknown") return;
			let e = this.session, t = S_(e.samples, !0);
			this.begin(e, t === "unknown" ? "mouse" : t);
		}, this.end = () => {
			if (!this.session) return;
			if (this.session.device === "unknown") {
				let e = this.session, t = S_(e.samples, !0);
				this.begin(e, t === "unknown" ? "mouse" : t);
			}
			if (!this.session) return;
			let e = this.session;
			this.emit(ug.End, e.lastEvent), this.reset();
		}, this.handleKeyDown = (e) => {
			e.key === "Control" && this.pressedControlKeys.add(e.code || e.key);
		}, this.handleKeyUp = (e) => {
			e.key === "Control" && (e.code ? this.pressedControlKeys.delete(e.code) : this.pressedControlKeys.clear());
		}, this.handleWindowBlur = () => {
			this.pressedControlKeys.clear();
		}, this.element = e, this.options = {
			...v_,
			...t
		}, (n = this.element) == null || n.addEventListener("wheel", this.handleEvent, { passive: !0 });
	}
	get hasSubscribers() {
		return this.subscriptions.size > 0;
	}
	get device() {
		var e, t;
		return (e = (t = this.session) == null ? void 0 : t.device) == null ? "unknown" : e;
	}
	on(e) {
		let t = { listener: e };
		return this.subscriptions.set(e, t), this.updateControlKeyEventListeners(), () => {
			this.subscriptions.get(e) === t && this.off(e);
		};
	}
	off(e) {
		this.subscriptions.delete(e), this.updateControlKeyEventListeners(), this.hasSubscribers || this.reset();
	}
	cancel() {
		let e = this.session;
		e && e.device !== "unknown" && this.emit(ug.Cancel, e.lastEvent), this.reset();
	}
	destroy() {
		var e;
		this.cancel(), this.subscriptions.clear(), this.updateControlKeyEventListeners(), (e = this.element) == null || e.removeEventListener("wheel", this.handleEvent);
	}
	startPendingSession(e) {
		let t = {
			samples: [e],
			device: "unknown",
			firstTimeStamp: e.timeStamp,
			lastTimeStamp: e.timeStamp,
			totalDeltaX: e.deltaX,
			totalDeltaY: e.deltaY,
			velocityX: 0,
			velocityY: 0,
			lastEvent: e.event
		};
		return this.session = t, this.classificationTimer = globalThis.setTimeout(this.finishClassification, this.options.classificationDelay), t;
	}
	addSample(e, t) {
		if (e.samples.push(t), e.lastTimeStamp = t.timeStamp, e.lastEvent = t.event, e.totalDeltaX += t.deltaX, e.totalDeltaY += t.deltaY, e.device !== "unknown") {
			let n = e.samples[e.samples.length - 2], r = t.timeStamp - n.timeStamp;
			e.velocityX = r > 0 ? t.deltaX / r : 0, e.velocityY = r > 0 ? t.deltaY / r : 0, this.emit(ug.Move, t.event, {
				velocityX: e.velocityX,
				velocityY: e.velocityY
			});
		}
	}
	begin(e, t) {
		e.device = t, this.clearClassificationTimer(), this.emit(ug.Start, e.samples[0].event);
		let n = e.lastTimeStamp - e.firstTimeStamp;
		e.velocityX = n > 0 ? e.totalDeltaX / n : 0, e.velocityY = n > 0 ? e.totalDeltaY / n : 0, this.emit(ug.Move, e.lastEvent, {
			velocityX: e.velocityX,
			velocityY: e.velocityY
		});
	}
	scheduleEnd() {
		this.clearEndTimer(), this.endTimer = globalThis.setTimeout(this.end, this.options.endDelay);
	}
	emit(e, t, n) {
		var r, i;
		let a = this.session;
		if (!a || a.device === "unknown") return;
		let o = e === ug.Start, s = e === ug.End || e === ug.Cancel, c = o ? a.firstTimeStamp : a.lastTimeStamp, l = o ? 0 : Math.max(0, c - a.firstTimeStamp), u = o ? 0 : a.totalDeltaX, d = o ? 0 : a.totalDeltaY, f = l > 0 ? u / l : 0, p = l > 0 ? d / l : 0, m = o ? 0 : (r = n == null ? void 0 : n.velocityX) == null ? a.velocityX : r, h = o ? 0 : (i = n == null ? void 0 : n.velocityY) == null ? a.velocityY : i, g = {
			eventType: e,
			device: a.device,
			srcEvent: t,
			timeStamp: c,
			center: {
				x: t.clientX,
				y: t.clientY
			},
			deltaX: u,
			deltaY: d,
			deltaTime: l,
			velocity: Math.abs(m) > Math.abs(h) ? m : h,
			velocityX: m,
			velocityY: h,
			overallVelocity: Math.abs(f) > Math.abs(p) ? f : p,
			overallVelocityX: f,
			overallVelocityY: p,
			isFirst: o,
			isFinal: s
		};
		for (let { listener: e } of [...this.subscriptions.values()]) e(g);
	}
	reset() {
		this.clearClassificationTimer(), this.clearEndTimer(), this.session = null;
	}
	clearClassificationTimer() {
		this.classificationTimer !== null && (globalThis.clearTimeout(this.classificationTimer), this.classificationTimer = null);
	}
	clearEndTimer() {
		this.endTimer !== null && (globalThis.clearTimeout(this.endTimer), this.endTimer = null);
	}
	updateControlKeyEventListeners() {
		let e = this.hasSubscribers, t = b_();
		!t || e === this.listeningForControlKeys || (this.listeningForControlKeys = e, e ? (t.addEventListener("keydown", this.handleKeyDown, !0), t.addEventListener("keyup", this.handleKeyUp, !0), t.addEventListener("blur", this.handleWindowBlur)) : (t.removeEventListener("keydown", this.handleKeyDown, !0), t.removeEventListener("keyup", this.handleKeyUp, !0), t.removeEventListener("blur", this.handleWindowBlur), this.pressedControlKeys.clear()));
	}
};
function b_() {
	var e;
	return typeof window < "u" ? window : (e = globalThis.document) == null ? void 0 : e.defaultView;
}
function x_(e, t) {
	let n = e.deltaX, r = e.deltaY;
	return e.deltaMode === m_ && (n *= f_, r *= f_), {
		event: e,
		timeStamp: e.timeStamp,
		deltaX: n,
		deltaY: r,
		isControlKeyDown: t
	};
}
function S_(e, t) {
	return e.some(({ event: e, isControlKeyDown: t }) => e.ctrlKey && !t) ? "trackpad" : e.some(({ event: e }) => e.deltaMode !== p_) || e.some(C_) || e.every(({ event: e }) => {
		let t = e.wheelDelta;
		return t !== void 0 && Math.abs(t) % 40 == 0;
	}) ? "mouse" : e.some(({ deltaX: e }) => e !== 0) || e.length > 1 && w_(e) ? "trackpad" : t ? "mouse" : "unknown";
}
function C_({ event: e, deltaX: t, deltaY: n }) {
	if (t !== 0 || n === 0) return !1;
	let r = Math.abs(n / d_);
	if (Number.isInteger(r)) return !0;
	let i = e.wheelDelta;
	return typeof i == "number" && i !== 0 && i % __ === 0;
}
function w_(e) {
	for (let t = 0; t < e.length; t++) {
		let n = e[t];
		if (Math.abs(n.deltaX) > g_ || Math.abs(n.deltaY) > g_ || t > 0 && n.timeStamp - e[t - 1].timeStamp > h_) return !1;
	}
	return !0;
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/inputs/move-input.js
var T_ = [
	"mousedown",
	"mousemove",
	"mouseup",
	"mouseover",
	"mouseout",
	"mouseenter",
	"mouseleave"
], E_ = class extends o_ {
	constructor(e, t, n) {
		super(e, t, {
			enable: !0,
			...n
		}), this.handleEvent = (e) => {
			this.handleOverEvent(e), this.handleOutEvent(e), this.handleEnterEvent(e), this.handleLeaveEvent(e), this.handleMoveEvent(e);
		}, this.pressed = !1;
		let { enable: r = !1 } = this.options;
		this.enableMoveEvent = r, this.enableLeaveEvent = r, this.enableEnterEvent = r, this.enableOutEvent = r, this.enableOverEvent = r, r && T_.forEach((e) => this.listen(e, !0));
	}
	destroy() {
		T_.forEach((e) => this.listen(e, !1));
	}
	enableEventType(e, t) {
		switch (e) {
			case "pointermove":
				this.enableMoveEvent !== t && (this.enableMoveEvent = t, this.listen("mousedown", t), this.listen("mousemove", t), this.listen("mouseup", t));
				break;
			case "pointerover":
				this.enableOverEvent !== t && (this.enableOverEvent = t, this.listen("mouseover", t));
				break;
			case "pointerout":
				this.enableOutEvent !== t && (this.enableOutEvent = t, this.listen("mouseout", t));
				break;
			case "pointerenter":
				this.enableEnterEvent !== t && (this.enableEnterEvent = t, this.listen("mouseenter", t));
				break;
			case "pointerleave":
				this.enableLeaveEvent !== t && (this.enableLeaveEvent = t, this.listen("mouseleave", t));
				break;
			default:
		}
	}
	handleOverEvent(e) {
		this.enableOverEvent && e.type === "mouseover" && this._emit("pointerover", e);
	}
	handleOutEvent(e) {
		this.enableOutEvent && e.type === "mouseout" && this._emit("pointerout", e);
	}
	handleEnterEvent(e) {
		this.enableEnterEvent && e.type === "mouseenter" && this._emit("pointerenter", e);
	}
	handleLeaveEvent(e) {
		this.enableLeaveEvent && e.type === "mouseleave" && this._emit("pointerleave", e);
	}
	handleMoveEvent(e) {
		if (this.enableMoveEvent) switch (e.type) {
			case "mousedown":
				e.button >= 0 && (this.pressed = !0);
				break;
			case "mousemove":
				e.buttons === 0 && (this.pressed = !1), this.pressed || this._emit("pointermove", e);
				break;
			case "mouseup":
				this.pressed = !1;
				break;
			default:
		}
	}
	_emit(e, t) {
		this.callback({
			type: e,
			center: {
				x: t.clientX,
				y: t.clientY
			},
			srcEvent: t,
			pointerType: "mouse",
			target: t.target
		});
	}
}, D_ = ["keydown", "keyup"], O_ = class extends o_ {
	constructor(e, t, n) {
		super(e, t, {
			enable: !0,
			tabIndex: 0,
			...n
		}), this.handleEvent = (e) => {
			let t = e.target || e.srcElement;
			t.tagName === "INPUT" && t.type === "text" || t.tagName === "TEXTAREA" || (this.enableDownEvent && e.type === "keydown" && this.callback({
				type: "keydown",
				srcEvent: e,
				key: e.key,
				target: e.target
			}), this.enableUpEvent && e.type === "keyup" && this.callback({
				type: "keyup",
				srcEvent: e,
				key: e.key,
				target: e.target
			}));
		};
		let { enable: r = !1 } = this.options;
		this.enableDownEvent = r, this.enableUpEvent = r, e.tabIndex = this.options.tabIndex, e.style.outline = "none", r && D_.forEach((e) => this.listen(e, !0));
	}
	destroy() {
		D_.forEach((e) => this.listen(e, !1));
	}
	enableEventType(e, t) {
		e === "keydown" && this.enableDownEvent !== t && (this.enableDownEvent = t, this.listen(e, t)), e === "keyup" && this.enableUpEvent !== t && (this.enableUpEvent = t, this.listen(e, t));
	}
}, k_ = class extends o_ {
	constructor(e, t, n) {
		var r;
		n.enable = (r = n.enable) != null && r, super(e, t, n), this.handleEvent = (e) => {
			this.options.enable && this.callback({
				type: "contextmenu",
				center: {
					x: e.clientX,
					y: e.clientY
				},
				srcEvent: e,
				pointerType: "mouse",
				target: e.target
			});
		}, n.enable && this.listen("contextmenu", !0);
	}
	destroy() {
		this.listen("contextmenu", !1);
	}
	enableEventType(e, t) {
		e === "contextmenu" && this.options.enable !== t && (this.options.enable = t, this.listen("contextmenu", t));
	}
}, A_ = 1, j_ = 2, M_ = 4, N_ = {
	pointerdown: A_,
	pointermove: j_,
	pointerup: M_,
	mousedown: A_,
	mousemove: j_,
	mouseup: M_
}, P_ = 0, F_ = 1, I_ = 2, L_ = 1, R_ = 2, z_ = 4;
function B_(e) {
	let t = N_[e.srcEvent.type];
	if (!t) return null;
	let { buttons: n, button: r } = e.srcEvent, i = !1, a = !1, o = !1;
	return t === j_ ? (i = !!(n & L_), a = !!(n & z_), o = !!(n & R_)) : (i = r === P_, a = r === F_, o = r === I_), {
		leftButton: i,
		middleButton: a,
		rightButton: o
	};
}
function V_(e, t) {
	let n = e.center;
	if (!n) return null;
	let r = t.getBoundingClientRect(), i = r.width / t.offsetWidth || 1, a = r.height / t.offsetHeight || 1;
	return {
		center: n,
		offsetCenter: {
			x: (n.x - r.left - t.clientLeft) / i,
			y: (n.y - r.top - t.clientTop) / a
		}
	};
}
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/utils/event-registrar.js
var H_ = {
	srcElement: "root",
	priority: 0
}, U_ = class {
	constructor(e, t) {
		this.handleEvent = (e) => {
			if (this.isEmpty()) return;
			let t = this._normalizeEvent(e), n = e.srcEvent.target;
			for (; n && n !== t.rootElement;) {
				if (this._emit(t, n), t.handled) return;
				n = n.parentNode;
			}
			this._emit(t, "root");
		}, this.eventManager = e, this.recognizerName = t, this.handlers = [], this.handlersByElement = /* @__PURE__ */ new Map(), this._active = !1;
	}
	isEmpty() {
		return !this._active;
	}
	add(e, t, n, r = !1, i = !1) {
		let { handlers: a, handlersByElement: o } = this, s = {
			...H_,
			...n
		}, c = o.get(s.srcElement);
		c || (c = [], o.set(s.srcElement, c));
		let l = {
			type: e,
			handler: t,
			srcElement: s.srcElement,
			priority: s.priority
		};
		r && (l.once = !0), i && (l.passive = !0), a.push(l), this._active = this._active || !l.passive;
		let u = c.length - 1;
		for (; u >= 0 && !(c[u].priority >= l.priority);) u--;
		c.splice(u + 1, 0, l);
	}
	remove(e, t) {
		let { handlers: n, handlersByElement: r } = this;
		for (let i = n.length - 1; i >= 0; i--) {
			let a = n[i];
			if (a.type === e && a.handler === t) {
				n.splice(i, 1);
				let e = r.get(a.srcElement);
				e.splice(e.indexOf(a), 1), e.length === 0 && r.delete(a.srcElement);
			}
		}
		this._active = n.some((e) => !e.passive);
	}
	_emit(e, t) {
		let n = this.handlersByElement.get(t);
		if (n) {
			let t = !1, r = () => {
				e.handled = !0;
			}, i = () => {
				e.handled = !0, t = !0;
			}, a = [];
			for (let o = 0; o < n.length; o++) {
				let { type: s, handler: c, once: l } = n[o];
				if (c({
					...e,
					type: s,
					stopPropagation: r,
					stopImmediatePropagation: i
				}), l && a.push(n[o]), t) break;
			}
			for (let e = 0; e < a.length; e++) {
				let { type: t, handler: n } = a[e];
				this.remove(t, n);
			}
		}
	}
	_normalizeEvent(e) {
		let t = this.eventManager.getElement();
		return {
			...e,
			...B_(e),
			...V_(e, t),
			preventDefault: () => {
				e.srcEvent.preventDefault();
			},
			stopImmediatePropagation: null,
			stopPropagation: null,
			handled: !1,
			rootElement: t
		};
	}
};
//#endregion
//#region ../../node_modules/.pnpm/mjolnir.js@3.1.0/node_modules/mjolnir.js/dist/event-manager.js
function W_(e) {
	if ("recognizer" in e) return e;
	let t, n = Array.isArray(e) ? [...e] : [e];
	return t = typeof n[0] == "function" ? new (n.shift())(n.shift() || {}) : n.shift(), {
		recognizer: t,
		recognizeWith: typeof n[0] == "string" ? [n[0]] : n[0],
		requireFailure: typeof n[1] == "string" ? [n[1]] : n[1]
	};
}
var G_ = class {
	constructor(e = null, t = {}) {
		if (this._onBasicInput = (e) => {
			this.manager.emit(e.srcEvent.type, e);
		}, this._onOtherEvent = (e) => {
			this.manager.emit(e.type, e);
		}, this.options = {
			recognizers: [],
			events: {},
			touchAction: "compute",
			tabIndex: 0,
			cssProps: {},
			...t
		}, this.events = /* @__PURE__ */ new Map(), this.element = e, this.wheelSession = new y_(e), e) {
			this.manager = new Yg(e, this.options);
			for (let e of this.options.recognizers) {
				let { recognizer: t, recognizeWith: n, requireFailure: r } = W_(e);
				this.manager.add(t), n && t.recognizeWith(n), r && t.requireFailure(r);
			}
			this.manager.on("hammer.input", this._onBasicInput), this.wheelInput = new u_(e, this._onOtherEvent, {
				enable: !1,
				wheelSession: this.wheelSession
			}), this.moveInput = new E_(e, this._onOtherEvent, { enable: !1 }), this.keyInput = new O_(e, this._onOtherEvent, {
				enable: !1,
				tabIndex: t.tabIndex
			}), this.contextmenuInput = new k_(e, this._onOtherEvent, { enable: !1 }), this.on(this.options.events);
		}
	}
	getElement() {
		return this.element;
	}
	destroy() {
		if (!this.element) {
			this.wheelSession.destroy();
			return;
		}
		this.wheelInput.destroy(), this.wheelSession.destroy(), this.moveInput.destroy(), this.keyInput.destroy(), this.contextmenuInput.destroy(), this.manager.destroy();
	}
	on(e, t, n) {
		this._addEventHandler(e, t, n, !1);
	}
	once(e, t, n) {
		this._addEventHandler(e, t, n, !0);
	}
	watch(e, t, n) {
		this._addEventHandler(e, t, n, !1, !0);
	}
	off(e, t) {
		this._removeEventHandler(e, t);
	}
	emit(e) {
		var t;
		(t = this.manager) == null || t.emit(e.type, e);
	}
	_toggleRecognizer(e, t) {
		var n, r, i, a;
		let { manager: o } = this;
		if (!o) return;
		let s = o.get(e);
		s && (s.set({
			enable: t,
			wheelSession: this.wheelSession
		}), o.touchAction.update()), (n = this.wheelInput) == null || n.enableEventType(e, t), (r = this.moveInput) == null || r.enableEventType(e, t), (i = this.keyInput) == null || i.enableEventType(e, t), (a = this.contextmenuInput) == null || a.enableEventType(e, t);
	}
	_addEventHandler(e, t, n, r, i) {
		if (typeof e != "string") {
			n = t;
			for (let [t, a] of Object.entries(e)) this._addEventHandler(t, a, n, r, i);
			return;
		}
		let { manager: a, events: o } = this;
		if (!a) return;
		let s = o.get(e);
		if (!s) {
			let t = this._getRecognizerName(e) || e;
			s = new U_(this, t), o.set(e, s), a && a.on(e, s.handleEvent);
		}
		s.add(e, t, n, r, i), s.isEmpty() || this._toggleRecognizer(s.recognizerName, !0);
	}
	_removeEventHandler(e, t) {
		if (typeof e != "string") {
			for (let [t, n] of Object.entries(e)) this._removeEventHandler(t, n);
			return;
		}
		let { events: n } = this, r = n.get(e);
		if (r && (r.remove(e, t), r.isEmpty())) {
			let { recognizerName: e } = r, t = !1;
			for (let r of n.values()) if (r.recognizerName === e && !r.isEmpty()) {
				t = !0;
				break;
			}
			t || this._toggleRecognizer(e, !1);
		}
	}
	_getRecognizerName(e) {
		var t;
		return (t = this.manager.recognizers.find((t) => t.getEventNames().includes(e))) == null ? void 0 : t.options.event;
	}
};
//#endregion
//#region ../renderer/src/controls/gestures.ts
function K_(e, t) {
	let n = (0, U.c)(5), r = xt(q_), i, a;
	n[0] !== r || n[1] !== t || n[2] !== e ? (i = () => {
		let n = J_(r);
		return n.on(e, t), () => {
			n.off(e, t), Y_(r);
		};
	}, a = [
		r,
		e,
		t
	], n[0] = r, n[1] = t, n[2] = e, n[3] = i, n[4] = a) : (i = n[3], a = n[4]), (0, L.useEffect)(i, a);
}
function q_(e) {
	return e.gl.domElement;
}
function J_(e) {
	let t = Z_.get(e);
	if (t) return t.refs++, t.manager;
	let n = new G_(e, { recognizers: [a_, [
		r_,
		{
			event: "pitch",
			pointers: 2
		},
		"rotate"
	]] });
	return Z_.set(e, {
		manager: n,
		refs: 1
	}), n;
}
function Y_(e) {
	let t = Z_.get(e);
	t && (--t.refs > 0 || (Z_.delete(e), t.manager.destroy()));
}
function X_(e) {
	return {
		x: e.offsetX,
		y: e.offsetY
	};
}
var Z_ = /* @__PURE__ */ new WeakMap();
//#endregion
//#region ../renderer/src/controls/handlers/Pitch.tsx
function Q_() {
	let e = (0, U.c)(10), t = Rh(), [n] = (0, L.useState)($_), r;
	e[0] === n ? r = e[1] : (r = (e) => (e.mouseButtons.right = e.mouseButtons.right | Sm.ROTATE_POLAR, () => {
		e.mouseButtons.right = e.mouseButtons.right & ~Sm.ROTATE_POLAR, n.end(e);
	}), e[0] = n, e[1] = r), Bh(r);
	let i;
	e[2] === n ? i = e[3] : (i = (e) => n.start(e), e[2] = n, e[3] = i);
	let a = i, o;
	e[4] !== t || e[5] !== n ? (o = (e) => {
		t && n.move(e, t);
	}, e[4] = t, e[5] = n, e[6] = o) : o = e[6];
	let s = o, c;
	e[7] !== t || e[8] !== n ? (c = () => n.end(t), e[7] = t, e[8] = n, e[9] = c) : c = e[9];
	let l = c;
	return K_("pitchstart", a), K_("pitch", s), K_("pitchend", l), null;
}
function $_() {
	return new ev();
}
var ev = class {
	constructor() {
		this.verdict = {}, this.lastPoints = void 0, this.prevTwoFingerAction = void 0, this.p0 = new gt(), this.p1 = new gt();
	}
	start(e) {
		let t = iv(e);
		t.length === 2 && (this.p0.copy(X_(t[0])), this.p1.copy(X_(t[1])), this.lastPoints = [new gt().copy(this.p0), new gt().copy(this.p1)], nv(this.p0.sub(this.p1)) && (this.verdict.isValid = !1));
	}
	move(e, t) {
		let n = this.lastPoints;
		if (!n) return;
		let r = iv(e);
		if (r.length !== 2 || (this.p0.copy(X_(r[0])).sub(n[0]), this.p1.copy(X_(r[1])).sub(n[1]), !tv(this.p0, this.p1, e.timeStamp, this.verdict))) return;
		this.prevTwoFingerAction === void 0 && (this.prevTwoFingerAction = t.touches.two, t.touches.two = Sm.NONE), n[0].add(this.p0), n[1].add(this.p1);
		let i = Hn((this.p0.y + this.p1.y) / 2 * av);
		t.rotatePolarTo(t.polarAngle + i, !1);
	}
	end(e) {
		e && this.prevTwoFingerAction && (e.touches.two = this.prevTwoFingerAction), this.prevTwoFingerAction = void 0, this.verdict = {}, this.lastPoints = void 0;
	}
};
function tv(e, t, n, r) {
	return r.isValid = rv(e, t, n, r), r.isValid === !0;
}
function nv(e) {
	return Math.abs(e.y) > Math.abs(e.x);
}
function rv(e, t, n, r) {
	if (r.isValid !== void 0) return r.isValid;
	let i = e.length() >= ov, a = t.length() >= ov;
	if (!i && !a) return;
	if (!i || !a) return r.firstMove != null || (r.firstMove = n), n - r.firstMove < sv && void 0;
	let o = e.y > 0 == t.y > 0;
	return nv(e) && nv(t) && o;
}
function iv(e) {
	return e.pointers.slice().sort((e, t) => e.pointerId - t.pointerId);
}
var av = -.5, ov = 2, sv = 100;
//#endregion
//#region ../renderer/src/controls/handlers/Roll.tsx
function cv(e) {
	var t;
	let n = (0, U.c)(10), r = (t = e.threshold) == null ? hv : t, i = xt(dv), a = Rh(), o = Sh(), [s] = (0, L.useState)(uv);
	Bh(lv);
	let c;
	n[0] === s ? c = n[1] : (c = (e) => s.start(e), n[0] = s, n[1] = c);
	let l = c, u;
	n[2] !== a || n[3] !== s || n[4] !== i || n[5] !== o || n[6] !== r ? (u = (e) => {
		a && s.move(e, r, {
			controls: a,
			camera: i().camera,
			space: o
		});
	}, n[2] = a, n[3] = s, n[4] = i, n[5] = o, n[6] = r, n[7] = u) : u = n[7];
	let d = u, f;
	n[8] === s ? f = n[9] : (f = () => s.end(), n[8] = s, n[9] = f);
	let p = f;
	return K_("rotatestart", l), K_("rotate", d), K_("rotateend", p), null;
}
function lv(e) {
	return e.mouseButtons.right = e.mouseButtons.right | Sm.ROTATE_AZIMUTH, () => {
		e.mouseButtons.right = e.mouseButtons.right & ~Sm.ROTATE_AZIMUTH;
	};
}
function uv() {
	return new fv();
}
function dv(e) {
	return e.get;
}
var fv = class {
	constructor() {
		this.isRolling = !1, this.startVector = void 0, this.minDiameter = 0, this.prevAngle = 0, this.vector = new gt(), this.p0 = new gt(), this.p1 = new gt(), this.pivotPlan = new Jn(), this.pivotWorld = new I(), this.targetWorld = new I(), this.cameraPosition = new I(), this.cameraForward = new I(), this.rotation = new Ct();
	}
	start(e) {
		let { pointers: t } = e;
		this.p0.copy(X_(t[0])), this.p1.copy(X_(t[1])), this.startVector = new gt().copy(this.p0).sub(this.p1), this.minDiameter = this.startVector.length();
	}
	move(e, t, n) {
		let { controls: r } = n, { pointers: i } = e;
		if (!this.isRolling) {
			if (i.length !== 2 || (this.p0.copy(X_(i[0])), this.p1.copy(X_(i[1])), this.vector.copy(this.p0).sub(this.p1), this.belowThreshold(t))) return;
			this.isRolling = !0, this.prevAngle = e.rotation;
		}
		let a = -Hn(e.rotation - this.prevAngle);
		this.prevAngle = e.rotation, !(Math.abs(a) < mv) && this.setPivot(e.offsetCenter, n) && (this.rotation.makeRotationZ(a), this.cameraPosition.sub(this.pivotWorld).applyMatrix4(this.rotation).add(this.pivotWorld), this.cameraForward.applyMatrix4(this.rotation), this.targetWorld.copy(this.cameraPosition).add(this.cameraForward), r.setLookAt(this.cameraPosition.x, this.cameraPosition.y, this.cameraPosition.z, this.targetWorld.x, this.targetWorld.y, this.targetWorld.z, !1));
	}
	end() {
		this.isRolling = !1, this.startVector = void 0, this.minDiameter = 0;
	}
	belowThreshold(e) {
		this.minDiameter = Math.min(this.minDiameter, this.vector.length());
		let t = this.startVector;
		return t ? Un(this.vector.angleTo(t)) < pv(this.minDiameter, e) : !1;
	}
	setPivot(e, t) {
		let { controls: n, camera: r, space: i } = t;
		return i.canvasToPlan(e, r, this.pivotPlan) ? (i.planToWorld(this.pivotPlan, this.pivotWorld), n.getPosition(this.cameraPosition), n.getTarget(this.targetWorld), this.cameraForward.copy(this.targetWorld).sub(this.cameraPosition), !0) : !1;
	}
};
function pv(e, t) {
	return t / (Math.PI * e) * 360;
}
var mv = .001, hv = 25;
//#endregion
//#region ../renderer/src/controls/handlers/Zoom.tsx
function gv() {
	return Bh(_v), null;
}
function _v(e) {
	return e.mouseButtons.wheel = Sm.DOLLY, e.touches.two = Sm.TOUCH_DOLLY_SCREEN_PAN, () => {
		e.mouseButtons.wheel = Sm.NONE, e.touches.two = Sm.NONE;
	};
}
//#endregion
//#region ../renderer/src/controls/Controls.tsx
function vv(e) {
	var t, n, r, i;
	let a = (0, U.c)(18), o = (0, L.useRef)(null), s;
	if (a[0] !== e.config) {
		var c;
		s = (c = e.config) == null ? {} : c, a[0] = e.config, a[1] = s;
	} else s = a[1];
	let l = s, u = (t = l.pan) == null || t, d = (n = l.zoom) == null || n, f = (r = l.roll) == null ? bv : r, p = (i = l.pitch) == null ? bv : i, m, h;
	a[2] === Symbol.for("react.memo_cache_sentinel") ? (m = () => {
		o.current.rotateTo(0, 0);
	}, h = [], a[2] = m, a[3] = h) : (m = a[2], h = a[3]), (0, L.useEffect)(m, h);
	let g;
	a[4] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ (0, R.jsx)(um, {
		ref: o,
		makeDefault: !0,
		events: !0,
		dollyToCursor: !0,
		controlSmoothTime: {
			rotate: 0,
			truck: 0
		}
	}), a[4] = g) : g = a[4];
	let _;
	a[5] === u ? _ = a[6] : (_ = u !== !1 && /* @__PURE__ */ (0, R.jsx)(cg, { ...yv(u) }), a[5] = u, a[6] = _);
	let v;
	a[7] === d ? v = a[8] : (v = d !== !1 && /* @__PURE__ */ (0, R.jsx)(gv, {}), a[7] = d, a[8] = v);
	let y;
	a[9] === f ? y = a[10] : (y = f !== !1 && /* @__PURE__ */ (0, R.jsx)(cv, { ...yv(f) }), a[9] = f, a[10] = y);
	let b;
	a[11] === p ? b = a[12] : (b = p !== !1 && /* @__PURE__ */ (0, R.jsx)(Q_, {}), a[11] = p, a[12] = b);
	let x;
	return a[13] !== _ || a[14] !== v || a[15] !== y || a[16] !== b ? (x = /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [
		g,
		_,
		v,
		y,
		b
	] }), a[13] = _, a[14] = v, a[15] = y, a[16] = b, a[17] = x) : x = a[17], x;
}
function yv(e) {
	return typeof e == "object" ? e : {};
}
var bv = !1;
//#endregion
//#region ../renderer/src/debug/debug-chunk.ts
function xv() {
	return Cv != null || (Cv = import("./DebugTools-C-4QnINH.js")), Cv;
}
async function Sv() {
	await xv();
}
var Cv, wv = (0, L.lazy)(() => import("./DebugTools-C-4QnINH.js").then((e) => ({ default: e.DebugTools })));
function Tv(e) {
	let t = (0, U.c)(7), n, r, i;
	t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({debugEnabled: i, children: r, ...n} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i), i && (0, L.use)(xv());
	let a;
	return t[4] !== n || t[5] !== r ? (a = /* @__PURE__ */ (0, R.jsx)(ap, {
		...n,
		children: r
	}), t[4] = n, t[5] = r, t[6] = a) : a = t[6], a;
}
function Ev(e) {
	let t = (0, U.c)(2), { enabled: n, children: r } = e;
	if (!n) return r;
	let i;
	return t[0] === r ? i = t[1] : (i = /* @__PURE__ */ (0, R.jsx)(L.Suspense, {
		fallback: null,
		children: /* @__PURE__ */ (0, R.jsx)(wv, { children: r })
	}), t[0] = r, t[1] = i), i;
}
//#endregion
//#region ../renderer/src/events/pointer.ts
function Dv(e, t) {
	let n = (0, U.c)(19), r = Sh(), i = t && e.onClick !== void 0, a = t && e.onPointerMove !== void 0, o = t && e.onPointerOut !== void 0, s;
	n[0] !== e || n[1] !== r ? (s = function(t) {
		return (n) => Ov(e, t, n, r);
	}, n[0] = e, n[1] = r, n[2] = s) : s = n[2];
	let c = s, l;
	n[3] === t ? l = n[4] : (l = () => t ? void 0 : !1, n[3] = t, n[4] = l);
	let u;
	n[5] !== c || n[6] !== i ? (u = i ? c("onClick") : void 0, n[5] = c, n[6] = i, n[7] = u) : u = n[7];
	let d;
	n[8] !== c || n[9] !== a ? (d = a ? c("onPointerMove") : void 0, n[8] = c, n[9] = a, n[10] = d) : d = n[10];
	let f;
	n[11] !== c || n[12] !== o ? (f = o ? c("onPointerOut") : void 0, n[11] = c, n[12] = o, n[13] = f) : f = n[13];
	let p;
	return n[14] !== l || n[15] !== u || n[16] !== d || n[17] !== f ? (p = {
		raycast: l,
		onClick: u,
		onPointerMove: d,
		onPointerOut: f
	}, n[14] = l, n[15] = u, n[16] = d, n[17] = f, n[18] = p) : p = n[18], p;
}
function Ov(e, t, n, r) {
	let i = e[t];
	if (!i || t === "onClick" && Nv(n)) return;
	let a = Av(n);
	a && i({
		def: a,
		point: r.worldToPlan(n.point),
		stopPropagation: () => n.stopPropagation(),
		nativeEvent: n.nativeEvent
	});
}
function kv(e, t) {
	return Fv.set(e, t), () => {
		Fv.get(e) === t && Fv.delete(e);
	};
}
function Av(e) {
	var t;
	return (t = Fv.get(e.object)) == null ? void 0 : t(e);
}
function jv(e, t, n) {
	let [r] = e.intersectObject(t, !0);
	return r ? n.worldToPlan(r.point) : Mv(e.ray, n);
}
function Mv(e, t) {
	var n;
	return (n = t.rayToPlan(e)) == null ? t.worldToPlan(e.origin) : n;
}
function Nv(e) {
	return e.delta * e.delta > Pv;
}
var Pv = 15, Fv = /* @__PURE__ */ new WeakMap();
//#endregion
//#region ../renderer/src/events/PointerMissed.tsx
function Iv(e) {
	let t = (0, U.c)(12), { onPointerMissed: n } = e, r = xt(zv), i = xt(Rv), a = xt(Lv), o = Sh(), s;
	t[0] !== n || t[1] !== r || t[2] !== i || t[3] !== o ? (s = (e) => {
		e.type === "click" && (n == null || n({
			point: jv(r, i, o),
			nativeEvent: e
		}));
	}, t[0] = n, t[1] = r, t[2] = i, t[3] = o, t[4] = s) : s = t[4];
	let c = (0, L.useEffectEvent)(s), l = n !== void 0, u;
	t[5] !== c || t[6] !== l || t[7] !== a ? (u = () => (a({ onPointerMissed: l ? c : void 0 }), () => a({ onPointerMissed: void 0 })), t[5] = c, t[6] = l, t[7] = a, t[8] = u) : u = t[8];
	let d;
	return t[9] !== l || t[10] !== a ? (d = [l, a], t[9] = l, t[10] = a, t[11] = d) : d = t[11], (0, L.useEffect)(u, d), null;
}
function Lv(e) {
	return e.set;
}
function Rv(e) {
	return e.scene;
}
function zv(e) {
	return e.raycaster;
}
//#endregion
//#region ../renderer/src/external/external-camera.ts
function Bv(e, t) {
	let n = Vv.fromArray(t).multiply(Dh), r = n.elements;
	Uv.set(r[0], r[4], r[8], r[1], r[5], r[9], r[3], r[7], r[11]), Wv.set(-r[12], -r[13], -r[15]).applyMatrix3(Uv.invert()), Hv.copy(n).invert(), Gv.set(0, 0, 1).applyMatrix4(Hv), Kv.set(0, 0, -1).applyMatrix4(Hv);
	let i = Gv.distanceToSquared(Wv) <= Kv.distanceToSquared(Wv) ? 1 : -1;
	i === 1 ? qv.copy(Kv).sub(Gv).normalize() : qv.copy(Gv).sub(Kv).normalize(), Jv.set(0, 1, i).applyMatrix4(Hv), Yv.set(0, -1, i).applyMatrix4(Hv), Zv.copy(Jv).sub(Yv).normalize(), Xv.copy(Wv).add(qv), e.matrixWorld.lookAt(Wv, Xv, Zv), e.matrixWorld.setPosition(Wv), e.matrixWorldInverse.copy(e.matrixWorld).invert(), e.projectionMatrix.multiplyMatrices(n, e.matrixWorld), e.projectionMatrixInverse.copy(e.projectionMatrix).invert();
}
var Vv = new Ct(), Hv = new Ct(), Uv = new An(), Wv = new I(), Gv = new I(), Kv = new I(), qv = new I(), Jv = new I(), Yv = new I(), Xv = new I(), Zv = new I();
//#endregion
//#region ../renderer/src/external/external-events.ts
function Qv(e) {
	let t = vn(e);
	return {
		...t,
		connect(e) {
			var n, r;
			(n = t.connect) == null || n.call(t, (r = e.parentElement) == null ? e : r);
		},
		compute(e, t) {
			t.pointer.set(e.offsetX / t.size.width * 2 - 1, -(e.offsetY / t.size.height) * 2 + 1), Eh(t.raycaster, t.pointer, t.camera), t.raycaster.camera = t.camera;
		}
	};
}
//#endregion
//#region ../renderer/src/external/ExternalCanvas.tsx
var $v = Xm("external");
function ey(e) {
	let t = (0, U.c)(15), { gl: n, requestFrame: r, onFrame: i, children: a } = e, o = (0, L.useRef)(void 0), s;
	t[0] === r ? s = t[1] : (s = () => r(), t[0] = r, t[1] = s);
	let c = (0, L.useEffectEvent)(s), l;
	t[2] === i ? l = t[3] : (l = (e) => i(e), t[2] = i, t[3] = l);
	let u = (0, L.useEffectEvent)(l), d;
	t[4] !== c || t[5] !== n || t[6] !== u ? (d = () => {
		let e = ty(n, c, u);
		return o.current = e, () => {
			o.current = void 0, e == null || e.dispose();
		};
	}, t[4] = c, t[5] = n, t[6] = u, t[7] = d) : d = t[7];
	let f;
	t[8] === n ? f = t[9] : (f = [n], t[8] = n, t[9] = f), (0, L.useEffect)(d, f);
	let p;
	t[10] === a ? p = t[11] : (p = () => {
		var e;
		(e = o.current) == null || e.render(/* @__PURE__ */ (0, R.jsx)(L.StrictMode, { children: a }));
	}, t[10] = a, t[11] = p);
	let m;
	return t[12] !== a || t[13] !== n ? (m = [n, a], t[12] = a, t[13] = n, t[14] = m) : m = t[14], (0, L.useEffect)(p, m), null;
}
function ty(e, t, n) {
	let r = e.canvas;
	if (!(r instanceof HTMLCanvasElement)) {
		$v.warn("external mode needs a context bound to an HTMLCanvasElement");
		return;
	}
	jt(Ge);
	let i = new De();
	i.matrixAutoUpdate = !1, i.matrixWorldAutoUpdate = !1, i.manual = !0;
	let a = new Te({
		canvas: r,
		context: e
	});
	a.autoClear = !1;
	let o = a.setSize.bind(a);
	a.setSize = (e, t) => o(e, t, !1), a.forceContextLoss = () => void 0;
	let s = () => {
		let e = r.getBoundingClientRect();
		return {
			width: e.width,
			height: e.height,
			top: e.top,
			left: e.left
		};
	}, c = Et(r), l = !1, u = !1, d, f, p;
	return c.configure({
		gl: a,
		flat: !0,
		camera: i,
		frameloop: "never",
		events: Qv,
		size: s(),
		dpr: window.devicePixelRatio
	}).then(() => {
		var e, o, m;
		if (l) return;
		let h = (e = pn.get(r)) == null ? void 0 : e.store;
		h && (h.setState({ invalidate: () => {
			l || t();
		} }), (o = (m = h.getState().events).connect) == null || o.call(m, r), f = n((e) => {
			l || (Bv(i, e), a.resetState(), qt(performance.now(), !0, h.getState()));
		}), typeof ResizeObserver == "function" && (p = new ResizeObserver(() => {
			if (l) return;
			let e = s();
			h.getState().setSize(e.width, e.height, e.top, e.left), h.getState().setDpr(window.devicePixelRatio);
		}), p.observe(r)), u = !0, d !== void 0 && c.render(d), t());
	}), {
		render(e) {
			d = e, u && c.render(e);
		},
		dispose() {
			l = !0, p == null || p.disconnect(), f == null || f(), c.unmount();
		}
	};
}
//#endregion
//#region ../renderer/src/space/layout-measure.ts
function ny(e, t, n, r) {
	var i;
	if (!(n > 0) || !(t.scale > 0)) return;
	if (r) {
		let i = oy(e, r.distance);
		return i > 0 ? i / n / t.scale : void 0;
	}
	let a = ay(e, t);
	if (!a) return;
	let o = (i = t.planToNdc(a, e, fy)) == null ? void 0 : i.y;
	if (o === void 0) return;
	let s = t.ndcToPlan(fy.set(-1, o), e, uy), c = t.ndcToPlan(fy.set(1, o), e, dy);
	if (!s || !c) return;
	let l = Math.hypot(c.x - s.x, c.y - s.y);
	if (l > 0) return l / n;
}
function ry(e, t, n, r, i) {
	if (i) return Uf(i);
	let a = ay(e, t);
	if (!a) return;
	py.multiplyMatrices(e.projectionMatrix, e.matrixWorldInverse).multiply(t.matrix);
	let o = py.elements, s = my.set(a.x, a.y, 0, 1).applyMatrix4(py), c = (o[0] * s.w - s.x * o[3]) * n, l = -(o[1] * s.w - s.y * o[3]) * r;
	if (!(c === 0 && l === 0)) return If(-Math.atan2(l, c), 2 * Math.PI);
}
function iy(e, t) {
	return Math.abs(e - t) >= sy;
}
function ay(e, t) {
	return cy.origin.setFromMatrixPosition(e.matrixWorld), e.getWorldDirection(cy.direction), t.rayToPlan(cy, ly);
}
function oy(e, t) {
	let n = e.projectionMatrix.elements[0];
	return n > 0 ? vh(e) ? 2 * t / n : yh(e) ? 2 / n : NaN : NaN;
}
var sy = 1e-4, cy = new Ie(), ly = new Jn(), uy = new Jn(), dy = new Jn(), fy = new gt(), py = new Ct(), my = new kn(), hy = 3;
function gy(e) {
	let t = (0, U.c)(14), { children: n } = e, r = xt(yy), i = xt(vy), a = xt(_y), o = Rh(), s = Sh(), c;
	t[0] !== r || t[1] !== i.domElement.height || t[2] !== i.domElement.width || t[3] !== a || t[4] !== s ? (c = () => {
		var e, t;
		return ch(a, (e = ny(r, s, i.domElement.width)) == null ? 1 : e, (t = ry(r, s, i.domElement.width, i.domElement.height)) == null ? 0 : t);
	}, t[0] = r, t[1] = i.domElement.height, t[2] = i.domElement.width, t[3] = a, t[4] = s, t[5] = c) : c = t[5];
	let [l] = (0, L.useState)(c), u;
	t[6] !== o || t[7] !== a || t[8] !== s || t[9] !== l ? (u = (e) => {
		let t = e.camera, { width: n, height: r } = e.gl.domElement, i = ny(t, s, n, o);
		i !== void 0 && iy(i, l.pixelSize) && l.applyScale(i);
		let c = ry(t, s, n, r, o);
		if (c !== void 0 && c !== l.roll && l.applyRoll(c), !l.hasWork) return;
		let u = eh(e.camera, s.matrix, by);
		l.drain(u, hy) && a();
	}, t[6] = o, t[7] = a, t[8] = s, t[9] = l, t[10] = u) : u = t[10], Pt(u);
	let d;
	return t[11] !== n || t[12] !== l ? (d = /* @__PURE__ */ (0, R.jsx)(ah, {
		value: l,
		children: n
	}), t[11] = n, t[12] = l, t[13] = d) : d = t[13], d;
}
function _y(e) {
	return e.invalidate;
}
function vy(e) {
	return e.gl;
}
function yy(e) {
	return e.camera;
}
var by = new cn();
//#endregion
//#region ../renderer/src/core/shader-source.ts
function xy(e, t) {
	return Ty(e, (e) => `${t}\n${e}`);
}
function Sy(e, t) {
	return Ty(e, (e) => `${e}\n${t}`);
}
function Cy(e, t, n) {
	let r = e.indexOf(t);
	if (r < 0) throw Error(`shader-source: the shader has no "${t}" to rewrite.`);
	return e.slice(0, r) + n + e.slice(r + t.length);
}
function wy(e) {
	let t = "#include <tonemapping_fragment>", n = "#if defined( TONE_MAPPING )";
	return e.includes(t) ? t : e.includes(n) ? n : void 0;
}
function Ty(e, t) {
	let n = Ey.exec(e);
	if (!n) throw Error("shader-source: the shader has no \"void main()\" to inject into.");
	let r = n[0];
	return e.slice(0, n.index) + t(r) + e.slice(n.index + r.length);
}
var Ey = /void\s+main\s*\(\s*(?:void)?\s*\)\s*\{/;
//#endregion
//#region ../renderer/src/objects/layer/layer-context.ts
function Dy() {
	return (0, L.use)(jy);
}
function Oy() {
	return (0, L.use)(My);
}
function ky(e) {
	for (let t of e) if (t.dim !== void 0) return t.dim;
	return 0;
}
function Ay(e, t) {
	let n = e.map((e) => Bm(e, t));
	return () => {
		for (let e of n) e();
	};
}
var jy = (0, L.createContext)([]), My = (0, L.createContext)(!1);
//#endregion
//#region ../renderer/src/objects/materials/effects/ao/ambient-occlusion-pass.ts
function Ny() {
	return {
		uDepth: { value: null },
		uNoise: { value: Py() },
		uProjection: { value: new Ct() },
		uUnprojection: { value: new Ct() },
		uTexel: { value: new gt(1, 1) },
		uNoiseScale: { value: new gt(1, 1) },
		uRadius: { value: 1 },
		uTaps: { value: 16 },
		uKernel: { value: Fy() }
	};
}
function Py() {
	let e = new Float32Array(16 * zy);
	for (let t = 0; t < 16; t++) {
		let n = 2 * Math.PI * Iy(t * By);
		e[t * zy] = Math.cos(n), e[t * zy + 1] = Math.sin(n), e[t * zy + 2] = 0, e[t * zy + 3] = 1;
	}
	let t = new ye(e, 4, 4, ct, Le);
	return t.minFilter = Ke, t.magFilter = Ke, t.wrapS = Ye, t.wrapT = Ye, t.needsUpdate = !0, t;
}
function Fy() {
	let e = [];
	for (let t = 0; t < 16; t++) {
		let n = 2 * Math.PI * Iy(Vy + t * Hy), r = Iy(Vy + t * Uy), i = Math.sqrt(1 - r * r), a = Wy + (1 - Wy) * ((t + 1) / 16) ** 2;
		e.push(new I(Math.cos(n) * i * a, Math.sin(n) * i * a, r * a));
	}
	return e;
}
function Iy(e) {
	return e - Math.floor(e);
}
var Ly = "\n  varying vec2 vUv;\n\n  void main() {\n    vUv = uv;\n    gl_Position = vec4(position.xy, 0.0, 1.0);\n  }\n", Ry = "\n  uniform sampler2D uDepth;\n  uniform sampler2D uNoise;\n  uniform mat4 uProjection;\n  uniform mat4 uUnprojection;\n  uniform vec2 uTexel;\n  uniform vec2 uNoiseScale;\n  uniform float uRadius;\n  uniform int uTaps;\n  uniform vec3 uKernel[16];\n  varying vec2 vUv;\n\n  const float AO_BIAS = 0.02;\n\n  // Where the grazing fade starts and ends, as the absolute dot of the normal against the view\n  // direction: fully faded about seventeen degrees from edge on, fully open by about forty. See the\n  // fade at the end of main.\n  const float AO_GRAZING_MIN = 0.30;\n  const float AO_GRAZING_MAX = 0.64;\n\n  // How far apart the two neighbors of an axis have to be before blendAxis takes the nearer one\n  // outright. Measured as a share of their sum. Larger crosses over more gently and softens a\n  // silhouette. Smaller sharpens the silhouette and brings the normal jump back.\n  const float AO_CROSSOVER = 0.45;\n\n  float depthAt(vec2 uv) {\n    return texture2D(uDepth, uv).x;\n  }\n\n  vec3 viewAt(vec2 uv, float depth) {\n    vec4 clip = vec4(uv * 2. - 1., depth * 2. - 1., 1.);\n    vec4 view = uUnprojection * clip;\n    return view.xyz / view.w;\n  }\n\n  vec3 blendAxis(vec3 back, vec3 forward, float backApart, float forwardApart) {\n    // Positive when the backward neighbor is the worse of the two, which moves the result toward\n    // the forward one. Normalized by the sum, so AO_CROSSOVER is a share rather than a depth.\n    float ratio = (backApart - forwardApart) / max(backApart + forwardApart, 1e-6);\n    return mix(back, forward, smoothstep(-AO_CROSSOVER, AO_CROSSOVER, ratio));\n  }\n\n  vec3 normalAt(vec2 uv, vec3 here, float depth) {\n    vec2 stepX = vec2(uTexel.x, 0.);\n    vec2 stepY = vec2(0., uTexel.y);\n    float left = depthAt(uv - stepX);\n    float right = depthAt(uv + stepX);\n    float down = depthAt(uv - stepY);\n    float up = depthAt(uv + stepY);\n\n    // blendAxis leans toward the neighbor that stays on this surface rather than switching to it. A\n    // hard pick makes a face turned side on jump: both depth differences are large and nearly equal\n    // there, so a small camera rotation crosses the comparison and the normal jumps with it. The\n    // smoothstep over their difference crosses that middle continuously.\n    vec3 alongX = blendAxis(here - viewAt(uv - stepX, left), viewAt(uv + stepX, right) - here,\n                            abs(depth - left), abs(right - depth));\n    vec3 alongY = blendAxis(here - viewAt(uv - stepY, down), viewAt(uv + stepY, up) - here,\n                            abs(depth - down), abs(up - depth));\n\n    vec3 normal = normalize(cross(alongX, alongY));\n    // A surface the camera sees faces the camera, and view space looks down -z. The flip matters in\n    // external mode, where the host's projection can mirror an axis and turn the cross product with\n    // it. The wrong side samples the hemisphere behind the surface.\n    return normal.z < 0. ? -normal : normal;\n  }\n\n  float occlusionTap(vec3 here, vec3 at) {\n    vec4 clip = uProjection * vec4(at, 1.);\n    // At or behind the eye, where the perspective divide has no answer. Orthographic keeps w at 1,\n    // so this costs a comparison there and nothing else.\n    if (clip.w <= 0.) return 0.;\n    vec2 uv = clip.xy / clip.w * .5 + .5;\n    // Screen space sees only what is on screen. A tap off the edge has no depth of its own, and\n    // clamped sampling answers with the border texel's depth, so the tap contributes nothing.\n    if (uv.x < 0. || uv.x > 1. || uv.y < 0. || uv.y > 1.) return 0.;\n    float stored = depthAt(uv);\n    // The prepass clears to the far plane, so a tap over open background lands there. This rejects\n    // that tap rather than darkening an edge.\n    if (stored >= 1.) return 0.;\n    float storedZ = viewAt(uv, stored).z;\n    // Nothing in front of the tap: this surface is open in that direction.\n    if (storedZ < at.z + uRadius * AO_BIAS) return 0.;\n    return smoothstep(0., 1., uRadius / abs(here.z - storedZ));\n  }\n\n  void main() {\n    float depth = depthAt(vUv);\n    // Nothing here, or nothing to reach with. The prepass clears to the far plane. A radius of zero\n    // puts every tap on the fragment itself, where the divide by its distance has no answer.\n    if (depth >= 1. || uRadius <= 0.) {\n      gl_FragColor = vec4(0., 0., 0., 1.);\n      return;\n    }\n\n    vec3 here = viewAt(vUv, depth);\n    vec3 normal = normalAt(vUv, here, depth);\n\n    // The tile's own rotation, turned into a basis around the normal. One kernel becomes a\n    // different kernel per pixel, with no second kernel to upload.\n    vec3 rotation = vec3(texture2D(uNoise, vUv * uNoiseScale).xy, 0.);\n    vec3 tangent = cross(normal, rotation);\n    // Degenerate only where the rotation lies along the normal, which is a wall seen edge on. The\n    // fallback is degenerate only where the normal is the view axis, the case this one covers, so\n    // between them there is always a tangent.\n    if (dot(tangent, tangent) < 1e-6) tangent = cross(normal, vec3(0., 0., 1.));\n    tangent = normalize(tangent);\n    mat3 orient = mat3(tangent, cross(normal, tangent), normal);\n\n    float occluded = 0.;\n    for (int tap = 0; tap < 16; tap++) {\n      // GLSL ES 1.00 on the old Android WebViews this SDK reaches needs a constant loop bound, and\n      // the break is what skips the taps.\n      if (tap >= uTaps) break;\n      occluded += occlusionTap(here, here + orient * uKernel[tap] * uRadius);\n    }\n\n    // The average divides by what the loop walked, not by what the kernel holds. The floor stops a\n    // tap count of zero from dividing by nothing. No control offers zero, and a stale upload can\n    // still hold it.\n    float term = occluded / max(float(uTaps), 1.);\n\n    // The fade drops the term where the surface turns edge on to the camera, because the normal\n    // that oriented this kernel stops being reliable there. A face turned nearly side on gives\n    // normalAt two neighbors that disagree by almost the same amount. A small camera rotation then\n    // still moves the normal, and the term moves with it.\n    //\n    // The fragment sits in view space here, where the camera is the origin, so its own direction is\n    // the view vector. The dot of that against the normal says how square on the surface is: one\n    // face on, zero edge on. Taken as an absolute value, since a normal reconstructed at a depth\n    // discontinuity can come back pointing away.\n    //\n    // An ordinary wall under this plan's camera reads about 0.82 square on at a 55 degree pitch.\n    // That is well clear of the band, so walls keep their full term.\n    float facing = abs(dot(normal, normalize(here)));\n    gl_FragColor = vec4(term * smoothstep(AO_GRAZING_MIN, AO_GRAZING_MAX, facing), 0., 0., 1.);\n  }\n", zy = 4, By = .6180339887498949, Vy = .5, Hy = .7548776662466927, Uy = .5698402909980532, Wy = .1;
//#endregion
//#region ../renderer/src/objects/materials/effects/ao/blur-pass.ts
function Gy(e) {
	return {
		uOcclusion: { value: null },
		uDepth: { value: null },
		uTexel: { value: new gt(1, 1) },
		uBlur: e.aoBlur
	};
}
var Ky = .05, qy = `
  uniform sampler2D uOcclusion;
  uniform sampler2D uDepth;
  uniform vec2 uTexel;
  uniform int uBlur;
  varying vec2 vUv;

  const float AO_EDGE = ${Ky};

  void main() {
    float depth = texture2D(uDepth, vUv).x;
    // Symmetric at any side, and this texel alone at side 1.
    float center = float(uBlur - 1) * .5;
    float occluded = 0.;
    float total = 0.;
    // GLSL ES 1.00 on the old Android WebViews this SDK reaches needs constant loop bounds, and the
    // break is what skips the fetches.
    for (int y = 0; y < 4; y++) {
      if (y >= uBlur) break;
      for (int x = 0; x < 4; x++) {
        if (x >= uBlur) break;
        vec2 at = vUv + (vec2(float(x), float(y)) - center) * uTexel;
        // Depth-aware, so occlusion does not bleed across the edge between a wall and whatever
        // stands behind it. Stored depth is not linear, so the difference is a share of the range
        // still ahead of this texel.
        float stored = texture2D(uDepth, at).x;
        float apart = abs(stored - depth) / max(1. - depth, 1e-6);
        float weight = 1. - smoothstep(0., AO_EDGE, apart);
        occluded += texture2D(uOcclusion, at).r * weight;
        total += weight;
      }
    }

    // Nothing around this texel describes the surface it is on, so there is no term to write and no
    // total to divide by. Open, which a lit read of it leaves alone.
    if (total <= 0.) {
      gl_FragColor = vec4(0., 0., 0., 1.);
      return;
    }
    gl_FragColor = vec4(occluded / total, 0., 0., 1.);
  }
`;
//#endregion
//#region ../renderer/src/objects/materials/effects/ao/ambient-occlusion-patch.ts
function Jy(e, t) {
	if (e.fragmentShader.includes(nb)) return;
	let n = wy(e.fragmentShader);
	if (!n) throw Error("applyAmbientOcclusion: the shader has no output chain to darken before.");
	let r = xy(e.fragmentShader, rb).replace(n, `${ib}\n${n}`);
	e.uniforms[Yy] = t.aoMap, e.uniforms[Xy] = t.aoDepth, e.uniforms[Zy] = t.aoActive, e.uniforms[Qy] = t.aoGuard, e.uniforms[$y] = t.aoStrength, e.uniforms[eb] = t.aoViewport, e.uniforms[tb] = t.shadowColor, e.fragmentShader = r;
}
var Yy = "uAoMap", Xy = "uAoDepth", Zy = "uAoActive", Qy = "uAoGuard", $y = "uAoStrength", eb = "uAoViewport", tb = "uAoColor", nb = "vec3 ambientOcclusion(", rb = `
  uniform sampler2D ${Yy};
  uniform sampler2D ${Xy};
  uniform float ${Zy};
  uniform float ${Qy};
  uniform float ${$y};
  uniform vec2 ${eb};
  uniform vec3 ${tb};

  const float AO_EDGE = ${Ky};

  ${nb}vec3 rgb, float depth) {
    // A frame that skipped the passes shades correctly rather than sampling a stale texture.
    if (${Zy} < .5) return rgb;

    // The guard band undone. Every pass ran on a frustum (1 + g) wider than this one. This
    // fragment's place in the AO texture is its ndc shrunk by that factor.
    vec2 uv = ((gl_FragCoord.xy / ${eb}) * 2. - 1.) / (1. + ${Qy}) * .5 + .5;

    // Whether the term measured the surface this fragment shades. Stored depth is not linear, so
    // the difference is a share of the range still ahead of this fragment.
    float stored = texture2D(${Xy}, uv).x;
    float apart = abs(stored - depth) / max(1. - depth, 1e-6);
    float weight = 1. - smoothstep(0., AO_EDGE, apart);
    // Nothing here describes the surface this fragment is on, a translucent one most of all. There
    // is no term to apply and no second fetch worth taking.
    if (weight <= 0.) return rgb;

    return mix(rgb, ${tb}, ${$y} * texture2D(${Yy}, uv).r * weight);
  }
`, ib = "\n  gl_FragColor.rgb = ambientOcclusion(gl_FragColor.rgb, gl_FragCoord.z);\n";
//#endregion
//#region ../renderer/src/objects/materials/effects/ao/index.ts
function ab() {
	return {
		aoMap: { value: null },
		aoDepth: { value: null },
		aoActive: { value: 0 },
		aoGuard: { value: ob.guard },
		aoStrength: { value: ob.strength },
		aoBlur: { value: ob.blur },
		aoViewport: { value: new gt(1, 1) },
		enabled: ob.enabled,
		radius: ob.radius,
		taps: ob.taps,
		occluders: /* @__PURE__ */ new Set()
	};
}
var ob = {
	enabled: !0,
	radius: 12,
	strength: .5,
	blur: 4,
	taps: 16,
	guard: .15
};
//#endregion
//#region ../renderer/src/objects/materials/effects/color-dim.ts
function sb() {
	let e = (0, U.c)(6), t = Dy(), n = xt(cb), r;
	e[0] === Symbol.for("react.memo_cache_sentinel") ? (r = { value: 0 }, e[0] = r) : r = e[0];
	let i = (0, L.useRef)(r), a;
	e[1] === Symbol.for("react.memo_cache_sentinel") ? (a = () => (e) => lb(e, i.current), e[1] = a) : a = e[1];
	let [o] = (0, L.useState)(a), s, c;
	return e[2] !== t || e[3] !== n ? (s = () => {
		let e = function() {
			let e = pb(ky(t));
			i.current.value !== e && (i.current.value = e, n());
		};
		return e(), Ay(t, e);
	}, c = [t, n], e[2] = t, e[3] = n, e[4] = s, e[5] = c) : (s = e[4], c = e[5]), (0, L.useEffect)(s, c), o;
}
function cb(e) {
	return e.invalidate;
}
function lb(e, t) {
	let n = e.fragmentShader;
	if (!n.includes("instanceDim") || n.includes(_b)) return !1;
	let r = wy(n);
	if (!r) throw Error("applyDim: the shader has no output chain to dim before.");
	return e.uniforms[gb] = t, e.fragmentShader = xy(n, vb).replace(r, `${yb}\n${r}`), !0;
}
function ub(e, t) {
	let n = [], r = [];
	for (let i of e) (db(i.dim, t) ? n : r).push(i);
	return n.length === 0 || r.length === 0 ? e : [...n, ...r];
}
function db(e, t) {
	return e === void 0 ? t : e > 0;
}
function fb(e) {
	return e === void 0 ? -1 : pb(e);
}
function pb(e) {
	return Math.min(Math.max(e, 0), 1);
}
var mb = "instanceDim", hb = { vertex: { [mb]: "float" } }, gb = "uDim", _b = "vec4 dimColor(", vb = `
  uniform float ${gb};

  const vec3 grayWeights = vec3(0.299, 0.587, 0.114);
  const float darkenFactor = pow(2., 2.2); // Gamma corrected

  ${_b}vec4 col, float amount) {
    vec3 gray = vec3(dot(grayWeights, col.rgb));
    return vec4(mix(col.rgb, gray / darkenFactor, amount), col.a);
  }
`, yb = `
  gl_FragColor = dimColor(gl_FragColor, ${mb} < 0. ? ${gb} : ${mb});
`;
//#endregion
//#region ../renderer/src/objects/materials/effects/contact-shadow.ts
function bb(e, t) {
	if (e.fragmentShader.includes(Db)) return;
	let n = wy(e.fragmentShader);
	if (!n) throw Error("applyContactShadow: the shader has no output chain to darken before.");
	let r = Cy(xy(e.vertexShader, jb), Ab, `${Ab}\n${Mb}`), i = xy(e.fragmentShader, Nb).replace(n, `${Pb}\n${n}`);
	e.uniforms[Cb] = t.shadowDistance, e.uniforms[wb] = t.shadowStrength, e.uniforms[Tb] = t.shadowColor, e.uniforms[Eb] = t.planFromWorld, e.vertexShader = r, e.fragmentShader = i;
}
function xb() {
	return {
		shadowDistance: { value: Sb.distance },
		shadowStrength: { value: Sb.strength },
		shadowColor: { value: new Xe(Sb.color) },
		shadowHex: Sb.color,
		planFromWorld: { value: new Ct() }
	};
}
var Sb = {
	distance: 3,
	strength: .35,
	color: "#4a5260"
}, Cb = "uShadowDistance", wb = "uShadowStrength", Tb = "uShadowColor", Eb = "uPlanFromWorld", Db = "vec3 contactShadow(", Ob = "vHeight", kb = "worldPosition", Ab = "#include <worldpos_vertex>", jb = `
  #define DISTANCE
  uniform mat4 ${Eb};
  varying float ${Ob};
`, Mb = `
  ${Ob} = (${Eb} * ${kb}).z;
`, Nb = `
  uniform float ${Cb};
  uniform float ${wb};
  uniform vec3 ${Tb};
  varying float ${Ob};

  ${Db}vec3 rgb, float height) {
    float lit = clamp(height / max(${Cb}, 1e-4), 0., 1.);
    return mix(rgb, ${Tb}, ${wb} * (1. - lit));
  }
`, Pb = `
  gl_FragColor.rgb = contactShadow(gl_FragColor.rgb, ${Ob});
`;
//#endregion
//#region ../renderer/src/objects/materials/effects/effects-context.ts
function Fb() {
	return {
		...ab(),
		...xb()
	};
}
function Ib() {
	return (0, L.use)(Lb);
}
var Lb = (0, L.createContext)(Fb()), Rb = {
	blending: 5,
	blendSrc: 204,
	blendSrcAlpha: 201,
	blendDst: 205,
	blendDstAlpha: 205,
	side: 2,
	depthFunc: 3,
	depthWrite: !1,
	polygonOffset: !0,
	polygonOffsetFactor: -1,
	polygonOffsetUnits: -4,
	forceSinglePass: !0
}, zb = {
	depthTest: !1,
	transparent: !0
}, Bb = Xm("color-material");
function Vb(e) {
	var t;
	let n = (0, U.c)(18), r = (t = e.color) == null ? "white" : t, i = e.solid === !0, a = Oy(), o, s;
	n[0] !== a || n[1] !== i ? (o = () => {
		i && a && Bb.warn("overlay has no effect on a solid batch, so it is ignored.");
	}, s = [i, a], n[0] = a, n[1] = i, n[2] = o, n[3] = s) : (o = n[2], s = n[3]), (0, L.useEffect)(o, s);
	let c = sb(), l = Ib(), u;
	n[4] !== c || n[5] !== l || n[6] !== e.onBeforeCompile || n[7] !== i ? (u = () => {
		let t = e.onBeforeCompile;
		return (e) => {
			t == null || t(e), i && (bb(e, l), Jy(e, l)), c(e);
		};
	}, n[4] = c, n[5] = l, n[6] = e.onBeforeCompile, n[7] = i, n[8] = u) : u = n[8];
	let [d] = (0, L.useState)(u);
	if (i) {
		var f;
		let t = (f = e.translucent) != null && f, i = !t, a;
		return n[9] !== r || n[10] !== d || n[11] !== i || n[12] !== t ? (a = /* @__PURE__ */ (0, R.jsx)("meshLambertMaterial", {
			...Rb,
			color: r,
			depthWrite: !0,
			polygonOffset: !1,
			transparent: t,
			forceSinglePass: i,
			onBeforeCompile: d
		}), n[9] = r, n[10] = d, n[11] = i, n[12] = t, n[13] = a) : a = n[13], a;
	}
	let p = a ? zb : null, m;
	return n[14] !== r || n[15] !== d || n[16] !== p ? (m = /* @__PURE__ */ (0, R.jsx)("meshBasicMaterial", {
		...Rb,
		...p,
		color: r,
		onBeforeCompile: d
	}), n[14] = r, n[15] = d, n[16] = p, n[17] = m) : m = n[17], m;
}
//#endregion
//#region ../renderer/src/objects/Background.tsx
function Hb(e) {
	let t = (0, U.c)(4), [n] = (0, L.useState)(Ub), r;
	t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ (0, R.jsx)("planeGeometry", { args: [2, 2] }), t[0] = r) : r = t[0];
	let i;
	return t[1] !== n || t[2] !== e.color ? (i = /* @__PURE__ */ (0, R.jsxs)("mesh", {
		name: "background",
		renderOrder: 0,
		frustumCulled: !1,
		children: [r, /* @__PURE__ */ (0, R.jsx)(Vb, {
			color: e.color,
			onBeforeCompile: n
		})]
	}), t[1] = n, t[2] = e.color, t[3] = i) : i = t[3], i;
}
function Ub() {
	return Wb;
}
function Wb(e) {
	e.vertexShader = e.vertexShader.replace("#include <project_vertex>", "gl_Position = vec4(transformed.xy, 1.0, 1.0);"), e.fragmentShader = xy(e.fragmentShader, `const float ${mb} = -1.0;`);
}
//#endregion
//#region ../renderer/src/objects/images/texture-budget.ts
var Gb = Xm("texture-budget"), Kb = 4, qb = 4 / 3, Jb = 1024 * 1024, Yb = .001;
function Xb(e, t) {
	return e * t * Kb * qb;
}
var Zb = class {
	constructor(e) {
		this.memoryLimitMb = void 0, this.atlases = /* @__PURE__ */ new Set(), this.listeners = /* @__PURE__ */ new Set(), this.factor = 1, this.memoryLimitMb = e;
	}
	isActive() {
		return !!this.memoryLimitMb;
	}
	setMemoryLimit(e) {
		if (e === this.memoryLimitMb) return;
		let t = this.isActive();
		this.memoryLimitMb = e, this.isActive() === t ? this.recompute() : (this.factor = this.computeResizeFactor(), this.notify());
	}
	register(e) {
		this.atlases.add(e), this.recompute();
	}
	unregister(e) {
		this.atlases.delete(e) && this.recompute();
	}
	getResizeFactor() {
		return this.factor;
	}
	subscribe(e) {
		return this.listeners.add(e), () => {
			this.listeners.delete(e);
		};
	}
	recompute() {
		let e = this.computeResizeFactor();
		Math.abs(e - this.factor) < Yb || (this.factor = e, this.notify());
	}
	notify() {
		for (let e of this.listeners) e();
	}
	computeResizeFactor() {
		if (!this.memoryLimitMb) return 1;
		let e = 0, t = 0;
		for (let n of this.atlases) {
			let r = Xb(n.width, n.height);
			n.resizable ? e += r : t += r;
		}
		if (e === 0) return Gb.debug("no resizable atlases, atlases will not be scaled"), 1;
		let n = this.memoryLimitMb * Jb - t;
		if (n <= 0) return Gb.debug("memory limit too low to resize textures, atlases will not be scaled"), 1;
		let r = Math.sqrt(n / e);
		return r >= 1 ? 1 : (Gb.debug("resize factor: %s (budget %d bytes, resizable %d bytes)", r.toFixed(3), n, e), r);
	}
}, Qb = (0, L.createContext)(new Zb());
function $b(e, t) {
	let n = (0, U.c)(15), r, i;
	n[0] === e ? (r = n[1], i = n[2]) : (r = (t) => e.subscribe(t), i = () => e.isActive(), n[0] = e, n[1] = r, n[2] = i);
	let a = (0, L.useSyncExternalStore)(r, i), o, s;
	n[3] === e ? (o = n[4], s = n[5]) : (o = (t) => e.subscribe(t), s = () => e.getResizeFactor(), n[3] = e, n[4] = o, n[5] = s);
	let c = (0, L.useSyncExternalStore)(o, s), l;
	n[6] !== a || n[7] !== t.image || n[8] !== t.resizable || n[9] !== e ? (l = () => {
		if (!a) return;
		let n = {
			width: t.image.width,
			height: t.image.height,
			resizable: t.resizable
		};
		return e.register(n), () => e.unregister(n);
	}, n[6] = a, n[7] = t.image, n[8] = t.resizable, n[9] = e, n[10] = l) : l = n[10];
	let u;
	return n[11] !== a || n[12] !== t || n[13] !== e ? (u = [
		e,
		t,
		a
	], n[11] = a, n[12] = t, n[13] = e, n[14] = u) : u = n[14], (0, L.useEffect)(l, u), t.resizable ? c : 1;
}
//#endregion
//#region ../renderer/src/core/typed-array.ts
function ex(e, t) {
	let n = e.constructor, r = new n(t);
	return r.set(e.subarray(0, t)), r;
}
//#endregion
//#region ../renderer/src/core/SquareDataTexture.ts
var tx = Xm("square-data-texture");
function nx(e, t) {
	return Math.max(t, Math.ceil(Math.sqrt(e / t)) * t);
}
function rx(e, t, n, r) {
	t === 3 && (tx.warn("\"channels\" cannot be 3. Set to 4. More info: https://github.com/mrdoob/three.js/pull/23228"), t = 4);
	let i = nx(r, n), a = new e(i * i * t), o = e.name.includes("Float"), s = e.name.includes("Uint"), c = o ? Le : s ? Rt : At, l;
	switch (t) {
		case 1:
			l = o ? ut : mt;
			break;
		case 2:
			l = o ? Re : ln;
			break;
		default:
			l = o ? ct : Ae;
			break;
	}
	return {
		array: a,
		size: i,
		type: c,
		format: l
	};
}
var ix = class extends ye {
	get data() {
		return this._data;
	}
	constructor(e, t, n, r, i, a) {
		t === 3 && (t = 4);
		let { array: o, format: s, size: c, type: l } = rx(e, t, n, r);
		super(o, c, c, s, l), this.partialUpdate = !0, this.maxUpdateCalls = Infinity, this._utils = null, this._needsUpdate = !1, this._lastWidth = null, this._data = void 0, this._channels = void 0, this._pixelsPerInstance = void 0, this._stride = void 0, this._rowToUpdate = void 0, this._rowRanges = [], this._uniformMap = void 0, this._fetchUniformsInFragmentShader = void 0, this._data = o, this._channels = t, this._pixelsPerInstance = n, this._stride = n * t, this._rowToUpdate = Array(c), this._uniformMap = i, this._fetchUniformsInFragmentShader = a, this.needsUpdate = !0;
	}
	resize(e) {
		let t = nx(e, this._pixelsPerInstance);
		if (t === this.image.width) return;
		this._rowToUpdate.length = t;
		let n = ex(this._data, t * t * this._channels);
		this.dispose(), this.image = {
			data: n,
			height: t,
			width: t
		}, this._data = n;
	}
	enqueueUpdate(e) {
		if (this._needsUpdate = !0, !this.partialUpdate) return;
		let t = this.image.width / this._pixelsPerInstance, n = Math.floor(e / t);
		this._rowToUpdate[n] = !0;
	}
	update(e) {
		let t = e.properties.get(this), n = this.version > 0 && t.__version !== this.version, r = this._lastWidth !== null && this._lastWidth !== this.image.width;
		if (!this._needsUpdate || !t.__webglTexture || n || r) {
			this._lastWidth = this.image.width, this._needsUpdate = !1;
			return;
		}
		if (this._needsUpdate = !1, !this.partialUpdate) {
			this.needsUpdate = !0;
			return;
		}
		let i = this.collectDirtyRanges();
		i !== 0 && (i > this.maxUpdateCalls ? this.needsUpdate = !0 : this.updateRows(t.__webglTexture, e, i), this._rowToUpdate.fill(!1));
	}
	setUniformAt(e, t, n) {
		let { offset: r, size: i } = this._uniformMap.get(t), a = this._stride;
		i === 1 ? this._data[e * a + r] = n : n.toArray(this._data, e * a + r);
	}
	getUniformAt(e, t, n) {
		let { offset: r, size: i } = this._uniformMap.get(t), a = this._stride;
		return i === 1 ? this._data[e * a + r] : n.fromArray(this._data, e * a + r);
	}
	getUniformsGLSL(e, t) {
		return {
			vertex: this.getUniformsVertexGLSL(e, t),
			fragment: this.getUniformsFragmentGLSL(e, t)
		};
	}
	copy(e) {
		super.copy(e), this.partialUpdate = e.partialUpdate, this.maxUpdateCalls = e.maxUpdateCalls, this._channels = e._channels, this._pixelsPerInstance = e._pixelsPerInstance, this._stride = e._stride, this._rowToUpdate = [...e._rowToUpdate], this._uniformMap = e._uniformMap, this._fetchUniformsInFragmentShader = e._fetchUniformsInFragmentShader;
		let t = e._data.slice(), { width: n, height: r } = e.image;
		return this.source = new yt({
			data: t,
			width: n,
			height: r
		}), this._data = t, this.needsUpdate = !0, this;
	}
	clone() {
		let e = this.image.width, t = this.constructor;
		return new t(this._data.constructor, this._channels, this._pixelsPerInstance, e * e / this._pixelsPerInstance, this._uniformMap, this._fetchUniformsInFragmentShader).copy(this);
	}
	collectDirtyRanges() {
		let e = this._rowToUpdate, t = this._rowRanges, n = 0;
		for (let a = 0, o = e.length; a < o; a++) {
			var r, i;
			if (!e[a]) continue;
			let s = a;
			for (; a < o && e[a];) a++;
			let c = (i = t[r = n]) == null ? t[r] = {
				row: 0,
				count: 0
			} : i;
			c.row = s, c.count = a - s, n++;
		}
		return n;
	}
	updateRows(e, t, n) {
		var r;
		let i = t.state, a = t.getContext();
		this._utils != null || (this._utils = new Ce(a, t.extensions));
		let o = this._utils.convert(this.format), s = this._utils.convert(this.type), { data: c, width: l } = this.image, u = this._channels;
		i.bindTexture(a.TEXTURE_2D, e);
		let d = jn.getPrimaries(jn.workingColorSpace), f = this.colorSpace === "" ? null : jn.getPrimaries(this.colorSpace), p = this.colorSpace === "" || d === f ? a.NONE : a.BROWSER_DEFAULT_WEBGL;
		a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL, this.flipY), a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha), a.pixelStorei(a.UNPACK_ALIGNMENT, this.unpackAlignment), a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL, p);
		for (let e = 0; e < n; e++) {
			let { row: t, count: n } = this._rowRanges[e];
			a.texSubImage2D(a.TEXTURE_2D, 0, 0, t, l, n, o, s, c, t * l * u);
		}
		(r = this.onUpdate) == null || r.call(this, this);
	}
	getUniformsVertexGLSL(e, t) {
		if (this._fetchUniformsInFragmentShader) return {
			declarations: `varying float ${ax}${t};`,
			body: `${ax}${t} = ${t};`
		};
		let n = this.texelsFetchGLSL(e, t), r = this.getFromTexelsGLSL(), { assignVarying: i, declareVarying: a } = this.getVarying();
		return {
			declarations: `
        uniform highp sampler2D ${e};
        ${a}`,
			body: `
        ${n}
        ${r}
        ${i}`
		};
	}
	getUniformsFragmentGLSL(e, t) {
		if (!this._fetchUniformsInFragmentShader) {
			let { declareVarying: e, getVarying: t } = this.getVarying();
			return {
				declarations: e,
				body: t
			};
		}
		let n = this.texelsFetchGLSL(e, `${ax}${t}`), r = this.getFromTexelsGLSL();
		return {
			declarations: `
        uniform highp sampler2D ${e};
        varying float ${ax}${t};`,
			body: `
        ${n}
        ${r}`
		};
	}
	texelsFetchGLSL(e, t) {
		let n = this._pixelsPerInstance, r = `
      int size = textureSize(${e}, 0).x;
      int j = int(${t}) * ${n};
      int x = j % size;
      int y = j / size;
    `;
		for (let t = 0; t < n; t++) r += `vec4 ${ox}${t} = texelFetch(${e}, ivec2(x + ${t}, y), 0);\n`;
		return r;
	}
	getFromTexelsGLSL() {
		let e = this._uniformMap, t = "";
		for (let [n, { type: r, offset: i, size: a }] of e) {
			let e = Math.floor(i / this._channels), o = (t = 0) => `${ox}${e + t}`;
			if (r === "mat3") t += `mat3 ${n} = mat3(${o()}.rgb, vec3(${o()}.a, ${o(1)}.rg), vec3(${o(1)}.ba, ${o(2)}.r));`;
			else if (r === "mat4") t += `mat4 ${n} = mat4(${o()}, ${o(1)}, ${o(2)}, ${o(3)});`;
			else {
				let e = this.getUniformComponents(i, a);
				t += `${r} ${n} = ${o()}.${e};`;
			}
			t += "\n";
		}
		return t;
	}
	getVarying() {
		let e = this._uniformMap, t = "", n = "", r = "";
		for (let [i, { type: a }] of e) t += `varying ${a} ${ax}${i};\n`, n += `${ax}${i} = ${i};\n`, r += `${a} ${i} = ${ax}${i};\n`;
		return {
			declareVarying: t,
			assignVarying: n,
			getVarying: r
		};
	}
	getUniformComponents(e, t) {
		let n = e % this._channels, r = "";
		for (let e = 0; e < t; e++) r += sx[n + e];
		return r;
	}
}, ax = "efp_f", ox = "efp_texel", sx = [
	"r",
	"g",
	"b",
	"a"
], cx = class {
	constructor() {
		this.texture = null, this.declared = {}, this.key = "";
	}
	get shaderKey() {
		return this.key;
	}
	add(e, t) {
		let n = {
			...this.declared.vertex,
			...e.vertex
		}, r = {
			...this.declared.fragment,
			...e.fragment
		}, i = lx({
			vertex: n,
			fragment: r
		}), a = new ix(Float32Array, i.channels, i.pixelsPerInstance, t, i.uniformMap, i.fetchInFragmentShader), o = this.texture;
		o && (mx(o, a, px(this.declared), t), o.dispose()), this.texture = a, this.declared = {
			vertex: n,
			fragment: r
		}, this.key = fx(this.declared);
	}
	get(e, t, n) {
		return this.require().getUniformAt(e, t, n);
	}
	set(e, t, n) {
		let r = this.require();
		r.setUniformAt(e, t, n), r.enqueueUpdate(e);
	}
	resize(e) {
		var t;
		(t = this.texture) == null || t.resize(e);
	}
	patchShader(e, t, n = "") {
		let r = this.texture;
		if (!r) return !1;
		let i = r.getUniformsGLSL(gx, t);
		return e.uniforms[gx] = { value: r }, e.vertexShader = Sy(xy(e.vertexShader, i.vertex.declarations), `${i.vertex.body}\n${n}`), e.fragmentShader = Sy(xy(e.fragmentShader, i.fragment.declarations), `${i.fragment.body}\n${n}`), !0;
	}
	copyFrom(e) {
		this.declared = {
			vertex: { ...e.declared.vertex },
			fragment: { ...e.declared.fragment }
		}, this.key = e.key, this.texture = e.texture ? e.texture.clone() : null;
	}
	dispose() {
		var e;
		(e = this.texture) == null || e.dispose();
	}
	require() {
		if (!this.texture) throw Error("InstanceUniforms: declare uniforms with \"addUniforms\" before reading or writing them.");
		return this.texture;
	}
};
function lx(e) {
	var t, n;
	let r = (t = e.vertex) == null ? {} : t, i = (n = e.fragment) == null ? {} : n, a = [], o = 0, s = !0;
	for (let e in r) {
		let t = r[e], n = dx(t);
		o += n, a.push({
			name: e,
			type: t,
			size: n
		}), s = !1;
	}
	for (let e in i) {
		if (r[e]) continue;
		let t = i[e], n = dx(t);
		o += n, a.push({
			name: e,
			type: t,
			size: n
		});
	}
	a.sort((e, t) => t.size - e.size);
	let c = /* @__PURE__ */ new Map(), l = [];
	for (let { name: e, size: t, type: n } of a) c.set(e, {
		offset: ux(t, l),
		size: t,
		type: n
	});
	return {
		channels: Math.min(o, 4),
		pixelsPerInstance: Math.ceil(o / 4),
		uniformMap: c,
		fetchInFragmentShader: s
	};
}
function ux(e, t) {
	if (e < 4) {
		for (let n = 0; n < t.length; n++) if (t[n] + e <= 4) {
			let r = n * 4 + t[n];
			return t[n] += e, r;
		}
	}
	let n = t.length * 4;
	for (let n = e; n > 0; n -= 4) t.push(n);
	return n;
}
function dx(e) {
	switch (e) {
		case "float": return 1;
		case "vec2": return 2;
		case "vec3": return 3;
		case "vec4": return 4;
		case "mat3": return 9;
		case "mat4": return 16;
		default: throw Error(`InstanceUniforms: invalid uniform type "${String(e)}".`);
	}
}
function fx(e) {
	let t = (e, t = {}) => Object.entries(t).map(([t, n]) => `${e}${t}:${n}`);
	return [...t("v", e.vertex), ...t("f", e.fragment)].join(",");
}
function px(e) {
	return {
		...e.vertex,
		...e.fragment
	};
}
function mx(e, t, n, r) {
	for (let i in n) {
		let a = hx(n[i]);
		for (let n = 0; n < r; n++) t.setUniformAt(n, i, e.getUniformAt(n, i, a));
	}
}
function hx(e) {
	switch (e) {
		case "vec2": return new gt();
		case "vec3": return new I();
		case "vec4": return new kn();
		case "mat3": return new An();
		case "mat4": return new Ct();
		default: return;
	}
}
var gx = "uniformsTexture", _x = class {
	constructor() {
		this.list = {
			ids: /* @__PURE__ */ new Float32Array(),
			count: 0
		}, this.frustum = new cn(), this.cameraPos = new I(), this.forward = new I();
	}
	performFrustumCulling(e, t, n, r) {
		return this.list.ids.length < t.capacity && (this.list.ids = new Float32Array(t.capacity)), this.list.count = 0, t.addedInstancesCount === 0 || this.frustumCulling(e, t, n, r), this.list;
	}
	frustumCulling(e, t, n, r) {
		let i = e.sortObjects, a = e.perObjectFrustumCulled;
		if (!a && !i) {
			this.updateIndexArray(t);
			return;
		}
		if (i && (Sx.copy(e.matrixWorld).invert(), this.cameraPos.setFromMatrixPosition(n.matrixWorld).applyMatrix4(Sx), this.forward.set(0, 0, -1).transformDirection(n.matrixWorld).transformDirection(Sx)), a ? (xx.multiplyMatrices(n.projectionMatrix, n.matrixWorldInverse).multiply(e.matrixWorld), this.frustum.setFromProjectionMatrix(xx), this.linearCulling(e, t, n)) : this.updateRenderList(e, t, n), i) {
			let t = e.customSort, n = Tx;
			t === null ? n.sort(r.transparent ? bx : yx) : t(n);
			let i = this.list.ids, a = n.length;
			for (let e = 0; e < a; e++) i[e] = n[e].index;
			this.list.count = a, n.length = 0;
		}
	}
	updateIndexArray(e) {
		let t = this.list.ids, n = e.addedInstancesCount, r = 0;
		for (let i = 0; i < n; i++) e.getVisibleAt(i) && (t[r++] = i);
		this.list.count = r;
	}
	updateRenderList(e, t, n) {
		let r = t.addedInstancesCount;
		for (let i = 0; i < r; i++) t.getVisibleAt(i) && vx(this.depthOf(this.instanceSphere(e, i, n, wx)), i);
	}
	linearCulling(e, t, n) {
		let r = this.list.ids, i = t.addedInstancesCount, a = e.sortObjects, o = 0;
		for (let s = 0; s < i; s++) {
			if (!t.getVisibleAt(s)) continue;
			let i = this.instanceSphere(e, s, n, wx);
			this.frustum.intersectsSphere(i) && (a ? vx(this.depthOf(i), s) : r[o++] = s);
		}
		a || (this.list.count = o);
	}
	instanceSphere(e, t, n, r) {
		return e.getBoundingSphereAt(t, r);
	}
	depthOf(e) {
		return Cx.subVectors(e.center, this.cameraPos).dot(this.forward);
	}
};
function vx(e, t) {
	var n, r;
	let i = (r = Ex[n = Tx.length]) == null ? Ex[n] = {
		depth: e,
		index: t
	} : r;
	i.depth = e, i.index = t, Tx.push(i);
}
function yx(e, t) {
	return e.depth - t.depth;
}
function bx(e, t) {
	return t.depth - e.depth;
}
var xx = new Ct(), Sx = new Ct(), Cx = new I(), wx = new nn(), Tx = [], Ex = [], Dx = "\n  uniform highp sampler2D indexTexture;\n\n  // The id this draw’s instance holds. A mutable global rather than a local of main, so the\n  // fetches below can read it; main assigns it before anything else runs.\n  float instanceIndex;\n\n  // Resolves a draw to the instance it should read. The culling pass writes the surviving ids into\n  // indexTexture in draw order, so gl_InstanceID addresses it directly.\n  float getIndirectIndex( int id ) {\n    int size = textureSize( indexTexture, 0 ).x;\n    return texelFetch( indexTexture, ivec2( id % size, id / size ), 0 ).r;\n  }\n\n  #ifdef USE_INSTANCING_MATRIX_INDIRECT\n\n    uniform highp sampler2D matricesTexture;\n\n    mat4 getInstancedMatrix() {\n      int size = textureSize( matricesTexture, 0 ).x;\n      int j = int( instanceIndex ) * 4;\n      int x = j % size;\n      int y = j / size;\n      vec4 v1 = texelFetch( matricesTexture, ivec2( x, y ), 0 );\n      vec4 v2 = texelFetch( matricesTexture, ivec2( x + 1, y ), 0 );\n      vec4 v3 = texelFetch( matricesTexture, ivec2( x + 2, y ), 0 );\n      vec4 v4 = texelFetch( matricesTexture, ivec2( x + 3, y ), 0 );\n      return mat4( v1, v2, v3, v4 );\n    }\n\n  #else\n\n    // No transforms written, so nothing to sample: a mesh placing its instances some other way — a\n    // line batch, by two endpoints — allocates no matrices texture at all, and the transform chunks\n    // that read this go on compiling.\n    mat4 getInstancedMatrix() {\n      return mat4( 1.0 );\n    }\n\n  #endif\n", Ox = "\n  instanceIndex = getIndirectIndex( gl_InstanceID );\n  mat4 instanceMatrix = getInstancedMatrix();\n", kx = "\n  uniform highp sampler2D colorsTexture;\n\n  vec4 getColorTexture() {\n    int size = textureSize( colorsTexture, 0 ).x;\n    int j = int( instanceIndex );\n    int x = j % size;\n    int y = j / size;\n    return texelFetch( colorsTexture, ivec2( x, y ), 0 );\n  }\n", Ax = "\n  vColor = vec4( 1.0 );\n\n  #ifdef USE_COLOR\n    vColor *= color;\n  #endif\n\n  vColor *= getColorTexture();\n", jx = !1;
function Mx() {
	if (jx) return;
	jx = !0;
	let e = xe;
	e.instanced_color_vertex = Ax, e.project_vertex = Ix(e.project_vertex), e.worldpos_vertex = Ix(e.worldpos_vertex), e.defaultnormal_vertex = Ix(e.defaultnormal_vertex);
}
function Nx(e, t) {
	let n = e.onBeforeCompile, r = e.customProgramCacheKey, i = () => `${!!t.matricesTexture}_${!!t.colorsTexture}_${t.uniforms.shaderKey}`;
	return e.customProgramCacheKey = () => `efp_${i()}_${r.call(e)}`, e.onBeforeCompile = (r, i) => {
		Px(r, t), n.call(e, r, i);
	}, () => {
		e.onBeforeCompile = n, e.customProgramCacheKey = r;
	};
}
function Px(e, t) {
	e.defines = {
		...e.defines,
		USE_INSTANCING_INDIRECT: ""
	}, e.uniforms.indexTexture = { value: t.indexTexture }, t.matricesTexture && (e.defines.USE_INSTANCING_MATRIX_INDIRECT = "", e.uniforms.matricesTexture = { value: t.matricesTexture }), t.uniforms.patchShader(e, "instanceIndex"), e.vertexShader = xy(e.vertexShader, Dx), e.vertexShader = Sy(e.vertexShader, Ox), Fx(e, t.colorsTexture);
}
function Fx(e, t) {
	var n;
	let r = e.vertexShader.includes("<color_vertex>") && e.fragmentShader.includes("<color_pars_fragment>");
	if (!t || !r) return;
	let i = (n = e.defines) == null ? e.defines = {} : n;
	i.USE_INSTANCING_COLOR_INDIRECT = "", i.USE_COLOR_ALPHA = "", e.uniforms.colorsTexture = { value: t }, e.vertexShader = xy(e.vertexShader, kx), e.vertexShader = e.vertexShader.replace("<color_vertex>", "<instanced_color_vertex>");
}
function Ix(e) {
	return e.replace("#ifdef USE_INSTANCING", "#if defined USE_INSTANCING || defined USE_INSTANCING_INDIRECT");
}
//#endregion
//#region ../renderer/src/core/instanced/Instances.ts
var Lx = /*#__PURE__*/ function(e) {
	return e[e.Free = 0] = "Free", e[e.Hidden = 1] = "Hidden", e[e.Visible = 2] = "Visible", e;
}(Lx || {}), Rx = class {
	constructor(e, t) {
		this.instanceStates = void 0, this.freeIds = [], this.onResize = void 0, this._activeInstancesCount = 0, this._addedInstancesCount = 0, this.onResize = t, this.instanceStates = Array(e).fill(Lx.Free);
	}
	get capacity() {
		return this.instanceStates.length;
	}
	get instancesCount() {
		return this._activeInstancesCount;
	}
	get addedInstancesCount() {
		return this._addedInstancesCount;
	}
	addInstances(e, t) {
		let n = this.freeIds;
		if (n.length > 0) {
			let r = -1, i = Math.min(n.length, e), a = n.length - i;
			for (let e = n.length - 1; e >= a; e--) {
				let i = n[e];
				i > r && (r = i), this.addInstance(i, t);
			}
			n.length -= i, e -= i, this._addedInstancesCount = Math.max(r + 1, this._addedInstancesCount);
		}
		let r = this._addedInstancesCount, i = r + e;
		this.setAddedInstancesCount(i);
		for (let e = r; e < i; e++) this.addInstance(e, t);
	}
	removeInstances(...e) {
		let t = this.freeIds;
		for (let n of e) n < this._addedInstancesCount && this.getActiveAt(n) && (this.instanceStates[n] = Lx.Free, t.push(n), this._activeInstancesCount--);
		for (let e = this._addedInstancesCount - 1; e >= 0 && !this.getActiveAt(e); e--) this._addedInstancesCount--;
	}
	getVisibleAt(e) {
		return this.instanceStates[e] === Lx.Visible;
	}
	setVisibleAt(e, t) {
		this.instanceStates[e] !== Lx.Free && (this.instanceStates[e] = t ? Lx.Visible : Lx.Hidden);
	}
	getActiveAt(e) {
		return this.instanceStates[e] !== Lx.Free;
	}
	copyFrom(e) {
		this._activeInstancesCount = e._activeInstancesCount, this._addedInstancesCount = e._addedInstancesCount, this.instanceStates = e.instanceStates.slice(), this.freeIds.length = 0, this.freeIds.push(...e.freeIds);
	}
	setAddedInstancesCount(e) {
		if (e < this._addedInstancesCount) {
			this._addedInstancesCount = e;
			return;
		}
		let t = this.capacity;
		if (e > t) {
			let n = t + (t >> 1) + 512;
			for (; n < e;) n += (n >> 1) + 512;
			this.resize(n);
		}
		this._addedInstancesCount = e;
	}
	addInstance(e, t) {
		this._activeInstancesCount++, this.instanceStates[e] = Lx.Visible, t == null || t(e);
	}
	resize(e) {
		let t = this.instanceStates.length;
		this.instanceStates.length = e, this.instanceStates.fill(Lx.Free, t), this.onResize(e);
	}
}, zx = class {
	constructor() {
		this.raycastOnlyFrustum = !0;
	}
	raycast(e, t, n, r, i) {
		!e.material || t.addedInstancesCount === 0 || this.intersectsMesh(e, r) && this.raycastInstances(e, t, n, r, i);
	}
	intersectsMesh(e, t) {
		return e.boundingSphere === null && e.computeBoundingSphere(), Hx.copy(e.boundingSphere).applyMatrix4(e.matrixWorld), t.ray.intersectsSphere(Hx);
	}
	raycastInstances(e, t, n, r, i) {
		let a = this.raycastOnlyFrustum && e.perObjectFrustumCulled && n !== null, o = a ? n.count : t.addedInstancesCount;
		for (let s = 0; s < o; s++) this.checkObjectIntersection(e, t, a ? n.ids[s] : s, r, i);
	}
	prepareInstance(e, t) {
		return Bx.geometry = e.geometry, Bx.material = e.material, Bx.matrixWorld.multiplyMatrices(e.matrixWorld, e.getMatrixAt(t, Vx)), Bx;
	}
	checkObjectIntersection(e, t, n, r, i) {
		if (!t.getVisibleAt(n)) return;
		let a = i.length;
		this.prepareInstance(e, n).raycast(r, i);
		for (let t = a; t < i.length; t++) i[t].object = e, i[t].instanceId = n;
	}
}, Bx = new Dn(), Vx = new Ct(), Hx = new nn();
//#endregion
//#region ../renderer/src/core/instanced/InstancedMesh.ts
Mx();
var Ux = class extends Dn {
	constructor(e = {}) {
		super(), this.count = 0, this.isInstancedMesh = !0, this.instanceMatrix = new lt(/* @__PURE__ */ new Float32Array(), 16), this.instanceColor = null, this.morphTexture = null, this.customSort = null, this.perObjectFrustumCulled = !0, this.sortObjects = !1, this.boundingBox = null, this.boundingSphere = null, this.raycasting = new zx(), this.culling = new _x(), this.indexTexture = void 0, this.matricesTexture = null, this.colorsTexture = null, this.uniforms = new cx(), this.instances = void 0, this.drawList = null, this._unpatchMaterial = null;
		let t = e.capacity && e.capacity > 0 ? e.capacity : Gx;
		this.instances = new Rx(t, (e) => this.resizeCapacity(e)), this.indexTexture = new ix(Float32Array, 1, 1, t);
	}
	get capacity() {
		return this.instances.capacity;
	}
	get instancesCount() {
		return this.instances.instancesCount;
	}
	addUniforms(e) {
		this.uniforms.add(e, this.capacity), this.materialsNeedUpdate();
	}
	getUniformAt(e, t, n) {
		return this.uniforms.get(e, t, n);
	}
	setUniformAt(e, t, n) {
		this.uniforms.set(e, t, n);
	}
	addInstances(e, t) {
		return this.instances.addInstances(e, (e) => {
			this.resetInstance(e), t == null || t(e);
		}), this;
	}
	removeInstances(...e) {
		return this.instances.removeInstances(...e), this.invalidateBounds(), this;
	}
	getVisibleAt(e) {
		return this.instances.getVisibleAt(e);
	}
	setVisibleAt(e, t) {
		this.instances.setVisibleAt(e, t), this.drawList = null;
	}
	getMatrixAt(e, t = Kx) {
		return this.matricesTexture ? t.fromArray(this.matricesTexture.data, e * 16) : t.identity();
	}
	setMatrixAt(e, t) {
		this.matricesTexture || this.initMatricesTexture();
		let n = this.matricesTexture;
		return t.toArray(n.data, e * 16), n.enqueueUpdate(e), this.invalidateBounds(), this;
	}
	getColorAt(e, t = qx) {
		if (!this.colorsTexture) return t.setScalar(1);
		let n = this.colorsTexture.data;
		return t.fromArray(n, e * 4);
	}
	setColorAt(e, t) {
		this.colorsTexture || this.initColorsTexture();
		let n = this.colorsTexture.data;
		return (typeof t == "object" ? t : qx.set(t)).toArray(n, e * 4), this.colorsTexture.enqueueUpdate(e), this;
	}
	computeBoundingBox() {
		let e = this.instances.addedInstancesCount;
		this.boundingBox != null || (this.boundingBox = new Ve()), this.boundingBox.makeEmpty();
		for (let t = 0; t < e; t++) this.instances.getActiveAt(t) && this.boundingBox.union(this.getBoundingBoxAt(t, Jx));
	}
	computeBoundingSphere() {
		let e = this.instances.addedInstancesCount;
		this.boundingSphere != null || (this.boundingSphere = new nn()), this.boundingSphere.makeEmpty();
		for (let t = 0; t < e; t++) this.instances.getActiveAt(t) && this.boundingSphere.union(this.getBoundingSphereAt(t, Yx));
	}
	getBoundingSphereAt(e, t) {
		let n = this.geometry;
		return n.boundingSphere || n.computeBoundingSphere(), t.copy(n.boundingSphere).applyMatrix4(this.getMatrixAt(e));
	}
	getBoundingBoxAt(e, t) {
		let n = this.geometry;
		return n.boundingBox || n.computeBoundingBox(), t.copy(n.boundingBox).applyMatrix4(this.getMatrixAt(e));
	}
	dispose() {
		var e, t;
		this.dispatchEvent({ type: "dispose" }), this.indexTexture.dispose(), (e = this.matricesTexture) == null || e.dispose(), (t = this.colorsTexture) == null || t.dispose(), this.uniforms.dispose();
	}
	resetInstance(e) {
		this.matricesTexture && this.setMatrixAt(e, Kx.identity());
	}
	patchMaterial(e) {
		return Nx(e, {
			indexTexture: this.indexTexture,
			matricesTexture: this.matricesTexture,
			colorsTexture: this.colorsTexture,
			uniforms: this.uniforms
		});
	}
	invalidateBounds() {
		this.boundingBox = null, this.boundingSphere = null, this.drawList = null;
	}
	onBeforeRender(e, t, n, r, i, a) {
		var o, s, c;
		super.onBeforeRender(e, t, n, r, i, a), this._unpatchMaterial = this.patchMaterial(i);
		let l = this.culling.performFrustumCulling(this, this.instances, n, i);
		this.indexTexture.data.set(l.ids.subarray(0, l.count));
		let u = this.indexTexture.image.width;
		for (let e = 0; e < l.count; e += u) this.indexTexture.enqueueUpdate(e);
		this.drawList = l, this.count = l.count, this.count !== 0 && (this.indexTexture.update(e), (o = this.matricesTexture) == null || o.update(e), (s = this.colorsTexture) == null || s.update(e), (c = this.uniforms.texture) == null || c.update(e));
	}
	onAfterRender(e, t, n, r, i, a) {
		var o;
		super.onAfterRender(e, t, n, r, i, a), (o = this._unpatchMaterial) == null || o.call(this), this._unpatchMaterial = null;
	}
	onBeforeShadow(e, t, n, r, i, a, o) {
		this.onBeforeRender(e, t, r, i, a, o);
	}
	onAfterShadow(e, t, n, r, i, a, o) {
		this.onAfterRender(e, t, r, i, a, o), this.drawList = null;
	}
	clone(e) {
		let t = this.constructor;
		return new t({ capacity: this.capacity }).copy(this, e);
	}
	copy(e, t) {
		return super.copy(e, t), this.geometry = e.geometry.clone(), this.instances.copyFrom(e.instances), this.drawList = null, this.indexTexture = e.indexTexture.clone(), this.matricesTexture = e.matricesTexture ? e.matricesTexture.clone() : null, this.colorsTexture = e.colorsTexture ? e.colorsTexture.clone() : null, this.uniforms.copyFrom(e.uniforms), e.boundingBox && (this.boundingBox = e.boundingBox.clone()), e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()), this;
	}
	raycast(e, t) {
		this.raycasting.raycast(this, this.instances, this.drawList, e, t);
	}
	resizeCapacity(e) {
		var t;
		if (this.indexTexture.resize(e), (t = this.matricesTexture) == null || t.resize(e), this.colorsTexture) {
			let t = this.colorsTexture.data.length;
			this.colorsTexture.resize(e), this.colorsTexture.data.fill(1, t);
		}
		this.uniforms.resize(e);
	}
	initMatricesTexture() {
		this.matricesTexture = new ix(Float32Array, 4, 4, this.capacity);
		let e = this.matricesTexture.data;
		for (let t = 0; t < e.length; t += 16) e[t] = 1, e[t + 5] = 1, e[t + 10] = 1, e[t + 15] = 1;
		this.materialsNeedUpdate();
	}
	initColorsTexture() {
		this.colorsTexture = new ix(Float32Array, 4, 1, this.capacity), this.colorsTexture.colorSpace = jn.workingColorSpace, this.colorsTexture.data.fill(1), this.materialsNeedUpdate();
	}
	materialsNeedUpdate() {
		let e = this.material;
		if (Array.isArray(e)) for (let t of e) t.needsUpdate = !0;
		else e.needsUpdate = !0;
	}
}, Wx = jt(Ux), Gx = 1e3, Kx = new Ct(), qx = new Xe(), Jx = new Ve(), Yx = new nn(), Xx = class extends zx {
	prepareInstance(e, t) {
		let n = e.getMatrixAt(t, $x), r = Lf(e.matrixWorld, 0);
		eS.setFromMatrixPosition(n).applyMatrix4(e.matrixWorld), Qx.matrixWorld.makeScale(r * Lf(n, 0), r * Lf(n, 1), 1).setPosition(eS);
		let i = n.elements;
		Zx.rotation = Math.atan2(i[1], i[0]);
		let a = e.getAnchorAt(t, tS);
		return Qx.center.set(a.x + .5, .5 - a.y), Qx;
	}
}, Zx = new yn(), Qx = new Jt(Zx), $x = new Ct(), eS = new I(), tS = new gt(), nS = "anchorOffset", rS = { vertex: { [nS]: "vec2" } };
function iS(e) {
	let t = cS.get(e);
	if (t) return t;
	let n = { value: 0 };
	return cS.set(e, n), n;
}
function aS(e) {
	let t = e.onBeforeCompile, n = e.customProgramCacheKey;
	return e.customProgramCacheKey = () => `efp_sprite_${n.call(e)}`, e.onBeforeCompile = (n, r) => {
		n.uniforms[sS] = iS(e), oS(n), t.call(e, n, r);
	}, () => {
		e.onBeforeCompile = t, e.customProgramCacheKey = n;
	};
}
function oS(e) {
	let t = e.vertexShader;
	return !t.includes("vec2 anchorOffset") || !t.includes(lS) ? !1 : (e.vertexShader = Cy(`uniform float ${sS};\n${dS}\n${t}`, lS, uS), !0);
}
var sS = "spriteReferenceDepth", cS = /* @__PURE__ */ new WeakMap(), lS = "#include <project_vertex>", uS = `
  vec4 mvPosition = modelViewMatrix * instanceMatrix[ 3 ];

  vec3 local = vec3( position.xy - ${nS}, 0.0 );
  vec2 offset = ( instanceMatrix * vec4( local, 0.0 ) ).xy;
  float planToWorld = length( modelMatrix[ 0 ].xyz );

  mvPosition.xy += offset.xy * planToWorld * spriteDepthScale( mvPosition.z );
  gl_Position = projectionMatrix * mvPosition;
`, dS = `
float spriteDepthScale( const in float viewZ ) {
  bool isPerspective = projectionMatrix[ 2 ][ 3 ] == -1.0;
  if ( !isPerspective || ${sS} <= 0.0 ) return 1.0;

  return -viewZ / ${sS};
}
`;
//#endregion
//#region ../renderer/src/core/sprites/BatchedSprites.ts
function fS(e) {
	return e.isBatchedSprites === !0;
}
var pS = jt(class extends Ux {
	constructor(e = {}) {
		super(e), this.isBatchedSprites = !0, this.geometry = gS, this.raycasting = new Xx(), this.addUniforms(rS);
	}
	getAnchorAt(e, t = _S) {
		return this.getUniformAt(e, nS, t);
	}
	setAnchorAt(e, t, n) {
		this.setUniformAt(e, nS, _S.set(t, n)), this.invalidateBounds();
	}
	getBoundingSphereAt(e, t) {
		let n = this.getMatrixAt(e, vS);
		return t.center.setFromMatrixPosition(n), t.radius = mS(this.getAnchorAt(e, _S)) * n.getMaxScaleOnAxis(), t;
	}
	onBeforeRender(e, t, n, r, i, a) {
		iS(i).value = hS(n, this.matrixWorld), super.onBeforeRender(e, t, n, r, i, a);
	}
	patchMaterial(e) {
		let t = aS(e), n = super.patchMaterial(e);
		return () => {
			n(), t();
		};
	}
	resetInstance(e) {
		super.resetInstance(e), this.setAnchorAt(e, 0, 0);
	}
});
function mS(e) {
	return Math.hypot(.5 + Math.abs(e.x), .5 + Math.abs(e.y));
}
function hS(e, t) {
	let n = yS.setFromMatrixColumn(e.matrixWorld, 2).normalize().negate(), r = bS.setFromMatrixColumn(t, 2).normalize(), i = n.dot(r);
	if (i === 0) return 0;
	let a = xS.setFromMatrixPosition(e.matrixWorld), o = SS.setFromMatrixPosition(t).sub(a).dot(r) / i;
	return o > 0 ? o : 0;
}
var gS = new Pe(1, 1), _S = new gt(), vS = new Ct(), yS = new I(), bS = new I(), xS = new I(), SS = new I();
//#endregion
//#region ../renderer/src/objects/containers/hooks.ts
function CS(e, t, n) {
	let r = (0, U.c)(20), [i] = (0, L.useState)(e), a = Dy(), o = ES(), s = (0, L.useRef)(t), c;
	r[0] === t ? c = r[1] : (c = () => {
		s.current = t;
	}, r[0] = t, r[1] = c), (0, L.useEffect)(c);
	let l, u;
	r[2] !== a || r[3] !== i || r[4] !== t || r[5] !== o ? (l = () => {
		i.setPaintOrder(t, ky(a) > 0), o();
	}, u = [
		i,
		t,
		a,
		o
	], r[2] = a, r[3] = i, r[4] = t, r[5] = o, r[6] = l, r[7] = u) : (l = r[6], u = r[7]), (0, L.useEffect)(l, u);
	let d, f;
	r[8] !== a || r[9] !== i || r[10] !== o ? (d = () => {
		let e = ky(a) > 0;
		return Ay(a, () => {
			let t = ky(a) > 0;
			t !== e && (e = t, i.setPaintOrder(s.current, t), o());
		});
	}, f = [
		i,
		a,
		o
	], r[8] = a, r[9] = i, r[10] = o, r[11] = d, r[12] = f) : (d = r[11], f = r[12]), (0, L.useEffect)(d, f);
	let p, m;
	r[13] === i ? (p = r[14], m = r[15]) : (p = () => kv(i.mesh, (e) => i.defFromHit(e)), m = [i], r[13] = i, r[14] = p, r[15] = m), (0, L.useEffect)(p, m);
	let h, g;
	return r[16] !== i || r[17] !== n ? (h = () => {
		if (n) return i.setKindMismatchHandler(n), () => i.setKindMismatchHandler(void 0);
	}, g = [i, n], r[16] = i, r[17] = n, r[18] = h, r[19] = g) : (h = r[18], g = r[19]), (0, L.useEffect)(h, g), i;
}
function wS(e, t, n) {
	let r = (0, U.c)(6), i = (0, L.useRef)(-1), a = ES(), o, s;
	return r[0] !== e || r[1] !== t || r[2] !== a || r[3] !== n ? (o = () => {
		let r = e.claim(t, n);
		return i.current = r, Km(t), a(), () => {
			e.release(r), i.current = -1, a();
		};
	}, s = [
		e,
		t,
		n,
		a
	], r[0] = e, r[1] = t, r[2] = a, r[3] = n, r[4] = o, r[5] = s) : (o = r[4], s = r[5]), (0, L.useEffect)(o, s), i;
}
function TS(e, t, n, r) {
	let i = (0, U.c)(21), a = n == null ? DS : n, o = ES(), s = (0, L.useRef)(OS), c;
	i[0] !== t || i[1] !== o ? (c = (e) => Bm(t, () => {
		s.current(), o(), e();
	}), i[0] = t, i[1] = o, i[2] = c) : c = i[2];
	let l = (0, L.useSyncExternalStore)(c, a), u = wS(e, t, l), d;
	i[3] !== e || i[4] !== t || i[5] !== a || i[6] !== l || i[7] !== u || i[8] !== r ? (d = function() {
		let n = u.current;
		if (n < 0 || !Object.is(a(), l)) return;
		let i = !t.hidden;
		e.setVisibleAt(n, i), e.setDimAt(n, t.dim), i && r(n);
	}, i[3] = e, i[4] = t, i[5] = a, i[6] = l, i[7] = u, i[8] = r, i[9] = d) : d = i[9];
	let f = d, p;
	i[10] === f ? p = i[11] : (p = () => {
		s.current = f;
	}, i[10] = f, i[11] = p), (0, L.useEffect)(p);
	let m, h;
	i[12] !== t || i[13] !== o ? (m = () => Gm(t, () => s.current(), o), h = [t, o], i[12] = t, i[13] = o, i[14] = m, i[15] = h) : (m = i[14], h = i[15]), (0, L.useEffect)(m, h);
	let g;
	i[16] === t ? g = i[17] : (g = () => {
		Km(t);
	}, i[16] = t, i[17] = g);
	let _;
	i[18] !== t || i[19] !== l ? (_ = [t, l], i[18] = t, i[19] = l, i[20] = _) : _ = i[20], (0, L.useEffect)(g, _);
}
function ES() {
	let e = (0, U.c)(2), t = On(), n;
	e[0] === t ? n = e[1] : (n = () => () => t.getState().invalidate(), e[0] = t, e[1] = n);
	let [r] = (0, L.useState)(n);
	return r;
}
var DS = () => null, OS = () => void 0, kS = /* @__PURE__ */ new WeakMap(), AS = 0;
function jS(e) {
	let t = kS.get(e);
	return t === void 0 && (t = `def-${AS++}`, kS.set(e, t)), t;
}
//#endregion
//#region ../../node_modules/.pnpm/colord@2.9.3/node_modules/colord/index.mjs
var MS = {
	grad: .9,
	turn: 360,
	rad: 360 / (2 * Math.PI)
}, NS = function(e) {
	return typeof e == "string" ? e.length > 0 : typeof e == "number";
}, PS = function(e, t, n) {
	return t === void 0 && (t = 0), n === void 0 && (n = 10 ** t), Math.round(n * e) / n + 0;
}, FS = function(e, t, n) {
	return t === void 0 && (t = 0), n === void 0 && (n = 1), e > n ? n : e > t ? e : t;
}, IS = function(e) {
	return (e = isFinite(e) ? e % 360 : 0) > 0 ? e : e + 360;
}, LS = function(e) {
	return {
		r: FS(e.r, 0, 255),
		g: FS(e.g, 0, 255),
		b: FS(e.b, 0, 255),
		a: FS(e.a)
	};
}, RS = function(e) {
	return {
		r: PS(e.r),
		g: PS(e.g),
		b: PS(e.b),
		a: PS(e.a, 3)
	};
}, zS = /^#([0-9a-f]{3,8})$/i, BS = function(e) {
	var t = e.toString(16);
	return t.length < 2 ? "0" + t : t;
}, VS = function(e) {
	var t = e.r, n = e.g, r = e.b, i = e.a, a = Math.max(t, n, r), o = a - Math.min(t, n, r), s = o ? a === t ? (n - r) / o : a === n ? 2 + (r - t) / o : 4 + (t - n) / o : 0;
	return {
		h: 60 * (s < 0 ? s + 6 : s),
		s: a ? o / a * 100 : 0,
		v: a / 255 * 100,
		a: i
	};
}, HS = function(e) {
	var t = e.h, n = e.s, r = e.v, i = e.a;
	t = t / 360 * 6, n /= 100, r /= 100;
	var a = Math.floor(t), o = r * (1 - n), s = r * (1 - (t - a) * n), c = r * (1 - (1 - t + a) * n), l = a % 6;
	return {
		r: 255 * [
			r,
			s,
			o,
			o,
			c,
			r
		][l],
		g: 255 * [
			c,
			r,
			r,
			s,
			o,
			o
		][l],
		b: 255 * [
			o,
			o,
			c,
			r,
			r,
			s
		][l],
		a: i
	};
}, US = function(e) {
	return {
		h: IS(e.h),
		s: FS(e.s, 0, 100),
		l: FS(e.l, 0, 100),
		a: FS(e.a)
	};
}, WS = function(e) {
	return {
		h: PS(e.h),
		s: PS(e.s),
		l: PS(e.l),
		a: PS(e.a, 3)
	};
}, GS = function(e) {
	return HS((n = (t = e).s, {
		h: t.h,
		s: (n *= ((r = t.l) < 50 ? r : 100 - r) / 100) > 0 ? 2 * n / (r + n) * 100 : 0,
		v: r + n,
		a: t.a
	}));
	var t, n, r;
}, KS = function(e) {
	return {
		h: (t = VS(e)).h,
		s: (i = (200 - (n = t.s)) * (r = t.v) / 100) > 0 && i < 200 ? n * r / 100 / (i <= 100 ? i : 200 - i) * 100 : 0,
		l: i / 2,
		a: t.a
	};
	var t, n, r, i;
}, qS = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, JS = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, YS = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, XS = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, ZS = {
	string: [
		[function(e) {
			var t = zS.exec(e);
			return t ? (e = t[1]).length <= 4 ? {
				r: parseInt(e[0] + e[0], 16),
				g: parseInt(e[1] + e[1], 16),
				b: parseInt(e[2] + e[2], 16),
				a: e.length === 4 ? PS(parseInt(e[3] + e[3], 16) / 255, 2) : 1
			} : e.length === 6 || e.length === 8 ? {
				r: parseInt(e.substr(0, 2), 16),
				g: parseInt(e.substr(2, 2), 16),
				b: parseInt(e.substr(4, 2), 16),
				a: e.length === 8 ? PS(parseInt(e.substr(6, 2), 16) / 255, 2) : 1
			} : null : null;
		}, "hex"],
		[function(e) {
			var t = YS.exec(e) || XS.exec(e);
			return t ? t[2] !== t[4] || t[4] !== t[6] ? null : LS({
				r: Number(t[1]) / (t[2] ? 100 / 255 : 1),
				g: Number(t[3]) / (t[4] ? 100 / 255 : 1),
				b: Number(t[5]) / (t[6] ? 100 / 255 : 1),
				a: t[7] === void 0 ? 1 : Number(t[7]) / (t[8] ? 100 : 1)
			}) : null;
		}, "rgb"],
		[function(e) {
			var t = qS.exec(e) || JS.exec(e);
			if (!t) return null;
			var n, r;
			return GS(US({
				h: (n = t[1], r = t[2], r === void 0 && (r = "deg"), Number(n) * (MS[r] || 1)),
				s: Number(t[3]),
				l: Number(t[4]),
				a: t[5] === void 0 ? 1 : Number(t[5]) / (t[6] ? 100 : 1)
			}));
		}, "hsl"]
	],
	object: [
		[function(e) {
			var t = e.r, n = e.g, r = e.b, i = e.a, a = i === void 0 ? 1 : i;
			return NS(t) && NS(n) && NS(r) ? LS({
				r: Number(t),
				g: Number(n),
				b: Number(r),
				a: Number(a)
			}) : null;
		}, "rgb"],
		[function(e) {
			var t = e.h, n = e.s, r = e.l, i = e.a, a = i === void 0 ? 1 : i;
			return !NS(t) || !NS(n) || !NS(r) ? null : GS(US({
				h: Number(t),
				s: Number(n),
				l: Number(r),
				a: Number(a)
			}));
		}, "hsl"],
		[function(e) {
			var t = e.h, n = e.s, r = e.v, i = e.a, a = i === void 0 ? 1 : i;
			return !NS(t) || !NS(n) || !NS(r) ? null : HS(function(e) {
				return {
					h: IS(e.h),
					s: FS(e.s, 0, 100),
					v: FS(e.v, 0, 100),
					a: FS(e.a)
				};
			}({
				h: Number(t),
				s: Number(n),
				v: Number(r),
				a: Number(a)
			}));
		}, "hsv"]
	]
}, QS = function(e, t) {
	for (var n = 0; n < t.length; n++) {
		var r = t[n][0](e);
		if (r) return [r, t[n][1]];
	}
	return [null, void 0];
}, $S = function(e) {
	return typeof e == "string" ? QS(e.trim(), ZS.string) : typeof e == "object" && e ? QS(e, ZS.object) : [null, void 0];
}, eC = function(e, t) {
	var n = KS(e);
	return {
		h: n.h,
		s: FS(n.s + 100 * t, 0, 100),
		l: n.l,
		a: n.a
	};
}, tC = function(e) {
	return (299 * e.r + 587 * e.g + 114 * e.b) / 1e3 / 255;
}, nC = function(e, t) {
	var n = KS(e);
	return {
		h: n.h,
		s: n.s,
		l: FS(n.l + 100 * t, 0, 100),
		a: n.a
	};
}, rC = function() {
	function e(e) {
		this.parsed = $S(e)[0], this.rgba = this.parsed || {
			r: 0,
			g: 0,
			b: 0,
			a: 1
		};
	}
	return e.prototype.isValid = function() {
		return this.parsed !== null;
	}, e.prototype.brightness = function() {
		return PS(tC(this.rgba), 2);
	}, e.prototype.isDark = function() {
		return tC(this.rgba) < .5;
	}, e.prototype.isLight = function() {
		return tC(this.rgba) >= .5;
	}, e.prototype.toHex = function() {
		return e = RS(this.rgba), t = e.r, n = e.g, r = e.b, a = (i = e.a) < 1 ? BS(PS(255 * i)) : "", "#" + BS(t) + BS(n) + BS(r) + a;
		var e, t, n, r, i, a;
	}, e.prototype.toRgb = function() {
		return RS(this.rgba);
	}, e.prototype.toRgbString = function() {
		return e = RS(this.rgba), t = e.r, n = e.g, r = e.b, (i = e.a) < 1 ? "rgba(" + t + ", " + n + ", " + r + ", " + i + ")" : "rgb(" + t + ", " + n + ", " + r + ")";
		var e, t, n, r, i;
	}, e.prototype.toHsl = function() {
		return WS(KS(this.rgba));
	}, e.prototype.toHslString = function() {
		return e = WS(KS(this.rgba)), t = e.h, n = e.s, r = e.l, (i = e.a) < 1 ? "hsla(" + t + ", " + n + "%, " + r + "%, " + i + ")" : "hsl(" + t + ", " + n + "%, " + r + "%)";
		var e, t, n, r, i;
	}, e.prototype.toHsv = function() {
		return e = VS(this.rgba), {
			h: PS(e.h),
			s: PS(e.s),
			v: PS(e.v),
			a: PS(e.a, 3)
		};
		var e;
	}, e.prototype.invert = function() {
		return iC({
			r: 255 - (e = this.rgba).r,
			g: 255 - e.g,
			b: 255 - e.b,
			a: e.a
		});
		var e;
	}, e.prototype.saturate = function(e) {
		return e === void 0 && (e = .1), iC(eC(this.rgba, e));
	}, e.prototype.desaturate = function(e) {
		return e === void 0 && (e = .1), iC(eC(this.rgba, -e));
	}, e.prototype.grayscale = function() {
		return iC(eC(this.rgba, -1));
	}, e.prototype.lighten = function(e) {
		return e === void 0 && (e = .1), iC(nC(this.rgba, e));
	}, e.prototype.darken = function(e) {
		return e === void 0 && (e = .1), iC(nC(this.rgba, -e));
	}, e.prototype.rotate = function(e) {
		return e === void 0 && (e = 15), this.hue(this.hue() + e);
	}, e.prototype.alpha = function(e) {
		return typeof e == "number" ? iC({
			r: (t = this.rgba).r,
			g: t.g,
			b: t.b,
			a: e
		}) : PS(this.rgba.a, 3);
		var t;
	}, e.prototype.hue = function(e) {
		var t = KS(this.rgba);
		return typeof e == "number" ? iC({
			h: e,
			s: t.s,
			l: t.l,
			a: t.a
		}) : PS(t.h);
	}, e.prototype.isEqual = function(e) {
		return this.toHex() === iC(e).toHex();
	}, e;
}(), iC = function(e) {
	return e instanceof rC ? e : new rC(e);
}, aC = [], oC = function(e) {
	e.forEach(function(e) {
		aC.indexOf(e) < 0 && (e(rC, ZS), aC.push(e));
	});
};
//#endregion
//#region ../../node_modules/.pnpm/colord@2.9.3/node_modules/colord/plugins/names.mjs
function sC(e, t) {
	var n = {
		white: "#ffffff",
		bisque: "#ffe4c4",
		blue: "#0000ff",
		cadetblue: "#5f9ea0",
		chartreuse: "#7fff00",
		chocolate: "#d2691e",
		coral: "#ff7f50",
		antiquewhite: "#faebd7",
		aqua: "#00ffff",
		azure: "#f0ffff",
		whitesmoke: "#f5f5f5",
		papayawhip: "#ffefd5",
		plum: "#dda0dd",
		blanchedalmond: "#ffebcd",
		black: "#000000",
		gold: "#ffd700",
		goldenrod: "#daa520",
		gainsboro: "#dcdcdc",
		cornsilk: "#fff8dc",
		cornflowerblue: "#6495ed",
		burlywood: "#deb887",
		aquamarine: "#7fffd4",
		beige: "#f5f5dc",
		crimson: "#dc143c",
		cyan: "#00ffff",
		darkblue: "#00008b",
		darkcyan: "#008b8b",
		darkgoldenrod: "#b8860b",
		darkkhaki: "#bdb76b",
		darkgray: "#a9a9a9",
		darkgreen: "#006400",
		darkgrey: "#a9a9a9",
		peachpuff: "#ffdab9",
		darkmagenta: "#8b008b",
		darkred: "#8b0000",
		darkorchid: "#9932cc",
		darkorange: "#ff8c00",
		darkslateblue: "#483d8b",
		gray: "#808080",
		darkslategray: "#2f4f4f",
		darkslategrey: "#2f4f4f",
		deeppink: "#ff1493",
		deepskyblue: "#00bfff",
		wheat: "#f5deb3",
		firebrick: "#b22222",
		floralwhite: "#fffaf0",
		ghostwhite: "#f8f8ff",
		darkviolet: "#9400d3",
		magenta: "#ff00ff",
		green: "#008000",
		dodgerblue: "#1e90ff",
		grey: "#808080",
		honeydew: "#f0fff0",
		hotpink: "#ff69b4",
		blueviolet: "#8a2be2",
		forestgreen: "#228b22",
		lawngreen: "#7cfc00",
		indianred: "#cd5c5c",
		indigo: "#4b0082",
		fuchsia: "#ff00ff",
		brown: "#a52a2a",
		maroon: "#800000",
		mediumblue: "#0000cd",
		lightcoral: "#f08080",
		darkturquoise: "#00ced1",
		lightcyan: "#e0ffff",
		ivory: "#fffff0",
		lightyellow: "#ffffe0",
		lightsalmon: "#ffa07a",
		lightseagreen: "#20b2aa",
		linen: "#faf0e6",
		mediumaquamarine: "#66cdaa",
		lemonchiffon: "#fffacd",
		lime: "#00ff00",
		khaki: "#f0e68c",
		mediumseagreen: "#3cb371",
		limegreen: "#32cd32",
		mediumspringgreen: "#00fa9a",
		lightskyblue: "#87cefa",
		lightblue: "#add8e6",
		midnightblue: "#191970",
		lightpink: "#ffb6c1",
		mistyrose: "#ffe4e1",
		moccasin: "#ffe4b5",
		mintcream: "#f5fffa",
		lightslategray: "#778899",
		lightslategrey: "#778899",
		navajowhite: "#ffdead",
		navy: "#000080",
		mediumvioletred: "#c71585",
		powderblue: "#b0e0e6",
		palegoldenrod: "#eee8aa",
		oldlace: "#fdf5e6",
		paleturquoise: "#afeeee",
		mediumturquoise: "#48d1cc",
		mediumorchid: "#ba55d3",
		rebeccapurple: "#663399",
		lightsteelblue: "#b0c4de",
		mediumslateblue: "#7b68ee",
		thistle: "#d8bfd8",
		tan: "#d2b48c",
		orchid: "#da70d6",
		mediumpurple: "#9370db",
		purple: "#800080",
		pink: "#ffc0cb",
		skyblue: "#87ceeb",
		springgreen: "#00ff7f",
		palegreen: "#98fb98",
		red: "#ff0000",
		yellow: "#ffff00",
		slateblue: "#6a5acd",
		lavenderblush: "#fff0f5",
		peru: "#cd853f",
		palevioletred: "#db7093",
		violet: "#ee82ee",
		teal: "#008080",
		slategray: "#708090",
		slategrey: "#708090",
		aliceblue: "#f0f8ff",
		darkseagreen: "#8fbc8f",
		darkolivegreen: "#556b2f",
		greenyellow: "#adff2f",
		seagreen: "#2e8b57",
		seashell: "#fff5ee",
		tomato: "#ff6347",
		silver: "#c0c0c0",
		sienna: "#a0522d",
		lavender: "#e6e6fa",
		lightgreen: "#90ee90",
		orange: "#ffa500",
		orangered: "#ff4500",
		steelblue: "#4682b4",
		royalblue: "#4169e1",
		turquoise: "#40e0d0",
		yellowgreen: "#9acd32",
		salmon: "#fa8072",
		saddlebrown: "#8b4513",
		sandybrown: "#f4a460",
		rosybrown: "#bc8f8f",
		darksalmon: "#e9967a",
		lightgoldenrodyellow: "#fafad2",
		snow: "#fffafa",
		lightgrey: "#d3d3d3",
		lightgray: "#d3d3d3",
		dimgray: "#696969",
		dimgrey: "#696969",
		olivedrab: "#6b8e23",
		olive: "#808000"
	}, r = {};
	for (var i in n) r[n[i]] = i;
	var a = {};
	e.prototype.toName = function(t) {
		if (!(this.rgba.a || this.rgba.r || this.rgba.g || this.rgba.b)) return "transparent";
		var i, o, s = r[this.toHex()];
		if (s) return s;
		if (t != null && t.closest) {
			var c = this.toRgb(), l = Infinity, u = "black";
			if (!a.length) for (var d in n) a[d] = new e(n[d]).toRgb();
			for (var f in n) {
				var p = (i = c, o = a[f], (i.r - o.r) ** 2 + (i.g - o.g) ** 2 + (i.b - o.b) ** 2);
				p < l && (l = p, u = f);
			}
			return u;
		}
	}, t.string.push([function(t) {
		var r = t.toLowerCase(), i = r === "transparent" ? "#0000" : n[r];
		return i ? new e(i).toRgb() : null;
	}, "name"]);
}
//#endregion
//#region ../renderer/src/utils/colors.ts
oC([sC]);
function cC(e) {
	let t = iC(typeof e == "string" ? e : `#${e.toString(16).padStart(6, "0")}`);
	if (t.isValid()) return t.toRgb();
}
function lC(e) {
	var t, n;
	return ((t = (n = cC(e)) == null ? void 0 : n.a) == null ? 1 : t) < 1;
}
//#endregion
//#region ../renderer/src/objects/containers/mesh-writes.ts
function uC(e) {
	if (!qr(e) && !Jr(e)) return gC.makeTranslation(0, 0, "elevation" in e ? e.elevation : 0);
	let t = "elevation" in e ? e.elevation : 0, n = "rotation" in e ? e.rotation : 0;
	return pC.set(e.center.x, e.center.y, t), mC.setFromAxisAngle(xC, n), hC.set(e.size.x, e.size.y, 1), gC.compose(pC, mC, hC);
}
function dC(e, t, n) {
	return e.getMatrixAt(t, _C), _C.equals(n) ? !1 : (e.setMatrixAt(t, n), !0);
}
function fC(e, t, n, r) {
	let i = cC(n.color);
	return i ? (vC.setRGB(i.r / 255, i.g / 255, i.b / 255, kt), yC.set(vC.r, vC.g, vC.b, i.a), e.getColorAt(t, bC), bC.equals(yC) ? !1 : (e.setColorAt(t, yC), !0)) : (r.warn(`Invalid color: ${String(n.color)} %O`, n), !1);
}
var pC = new I(), mC = new ot(), hC = new I(), gC = new Ct(), _C = new Ct(), vC = new Xe(), yC = new kn(), bC = new kn(), xC = new I(0, 0, 1), SC = class {
	constructor(e = {}) {
		var t;
		this.customSort = (e) => {
			let t = this.orderBySlot;
			e.sort((e, n) => {
				var r, i;
				return this.sortDirection * (((r = t[e.index]) == null ? 0 : r) - ((i = t[n.index]) == null ? 0 : i));
			});
		}, this.layerDefs = [], this.layerDimmed = !1, this.dimmedBySlot = [], this.orderByDef = /* @__PURE__ */ new WeakMap(), this.orderBySlot = [], this.slotByDef = /* @__PURE__ */ new Map(), this.defBySlot = /* @__PURE__ */ new Map(), this.schema = void 0, this.sortDirection = void 0, this.boundMesh = void 0, this.kindMismatchHandler = void 0, this.schema = (t = e.schema) == null ? hb : t, this.sortDirection = e.reverse ? -1 : 1;
	}
	get mesh() {
		return this.boundMesh;
	}
	bind(e) {
		!e || this.boundMesh || (this.boundMesh = e, e.addUniforms(this.schema));
	}
	claim(e, t) {
		var n;
		let r = this.addInstance(t);
		return this.slotByDef.set(e, r), this.defBySlot.set(r, e), this.orderBySlot[r] = (n = this.orderByDef.get(e)) == null ? 0 : n, this.dimmedBySlot[r] = db(e.dim, this.layerDimmed), r;
	}
	release(e) {
		this.removeInstance(e), this.orderBySlot[e] = 0, this.dimmedBySlot[e] = void 0;
		let t = this.defBySlot.get(e);
		t && (this.slotByDef.delete(t), this.defBySlot.delete(e));
	}
	defAt(e) {
		return e === void 0 ? void 0 : this.defBySlot.get(e);
	}
	defFromHit(e) {
		return this.defAt(e.instanceId);
	}
	setKindMismatchHandler(e) {
		this.kindMismatchHandler = e;
	}
	reportKindMismatch() {
		var e;
		(e = this.kindMismatchHandler) == null || e.call(this);
	}
	setVisibleAt(e, t) {
		this.mesh.setVisibleAt(e, t);
	}
	setDimAt(e, t) {
		this.writeDim(e, fb(t));
		let n = db(t, this.layerDimmed);
		this.layerDefs.length === 0 || this.dimmedBySlot[e] === n || this.applyOrder();
	}
	writeDim(e, t) {
		this.mesh.setUniformAt(e, mb, t);
	}
	setPaintOrder(e, t) {
		this.layerDefs = e, this.layerDimmed = t, this.applyOrder();
	}
	applyOrder() {
		let e = ub(this.layerDefs, this.layerDimmed);
		for (let t = 0; t < e.length; t++) {
			let n = e[t];
			this.orderByDef.set(n, t);
			let r = this.slotOf(n);
			r !== void 0 && (this.orderBySlot[r] = t, this.dimmedBySlot[r] = db(n.dim, this.layerDimmed));
		}
	}
	slotOf(e) {
		return this.slotByDef.get(e);
	}
};
//#endregion
//#region ../renderer/src/objects/materials/TextureMaterial.tsx
function CC(e) {
	let t = (0, U.c)(7), { map: n, uvOffset: r } = e, i = sb(), a = Oy(), o;
	t[0] !== i || t[1] !== r ? (o = function(e) {
		i(e), r && (e.vertexShader = e.vertexShader.replace("#include <uv_vertex>", `
        #include <uv_vertex>
        vMapUv = uv * ${r}.zw + ${r}.xy;
      `.trim()));
	}, t[0] = i, t[1] = r, t[2] = o) : o = t[2];
	let s = o, c = a ? zb : null, l;
	return t[3] !== n || t[4] !== s || t[5] !== c ? (l = /* @__PURE__ */ (0, R.jsx)("meshBasicMaterial", {
		...Rb,
		...c,
		blendSrc: 201,
		map: n,
		onBeforeCompile: s
	}), t[3] = n, t[4] = s, t[5] = c, t[6] = l) : l = t[6], l;
}
//#endregion
//#region ../../node_modules/.pnpm/maxrects-packer@2.7.3/node_modules/maxrects-packer/dist/maxrects-packer.mjs
var wC = class {
	constructor(e = 0, t = 0, n = 0, r = 0, i = !1, a = void 0) {
		this.oversized = !1, this._rot = !1, this._allowRotation = void 0, this._dirty = 0, this._width = e, this._height = t, this._x = n, this._y = r, this._data = {}, this._rot = i, this._allowRotation = a;
	}
	static Collide(e, t) {
		return e.collide(t);
	}
	static Contain(e, t) {
		return e.contain(t);
	}
	area() {
		return this.width * this.height;
	}
	collide(e) {
		return e.x < this.x + this.width && e.x + e.width > this.x && e.y < this.y + this.height && e.y + e.height > this.y;
	}
	contain(e) {
		return e.x >= this.x && e.y >= this.y && e.x + e.width <= this.x + this.width && e.y + e.height <= this.y + this.height;
	}
	get width() {
		return this._width;
	}
	set width(e) {
		e !== this._width && (this._width = e, this._dirty++);
	}
	get height() {
		return this._height;
	}
	set height(e) {
		e !== this._height && (this._height = e, this._dirty++);
	}
	get x() {
		return this._x;
	}
	set x(e) {
		e !== this._x && (this._x = e, this._dirty++);
	}
	get y() {
		return this._y;
	}
	set y(e) {
		e !== this._y && (this._y = e, this._dirty++);
	}
	get rot() {
		return this._rot;
	}
	set rot(e) {
		if (this._allowRotation !== !1 && this._rot !== e) {
			let t = this.width;
			this.width = this.height, this.height = t, this._rot = e, this._dirty++;
		}
	}
	get allowRotation() {
		return this._allowRotation;
	}
	set allowRotation(e) {
		this._allowRotation !== e && (this._allowRotation = e, this._dirty++);
	}
	get data() {
		return this._data;
	}
	set data(e) {
		e === null || e === this._data || (this._data = e, typeof e == "object" && e.hasOwnProperty("allowRotation") && (this._allowRotation = e.allowRotation), this._dirty++);
	}
	get dirty() {
		return this._dirty > 0;
	}
	setDirty(e = !0) {
		this._dirty = e ? this._dirty + 1 : 0;
	}
}, TC = class {
	constructor() {
		this._dirty = 0;
	}
	get dirty() {
		return this._dirty > 0 || this.rects.some((e) => e.dirty);
	}
	setDirty(e = !0) {
		if (this._dirty = e ? this._dirty + 1 : 0, !e) for (let e of this.rects) e.setDirty && e.setDirty(!1);
	}
}, EC = class e extends TC {
	constructor(e = OC, t = OC, n = 0, r = {}) {
		super(), this.maxWidth = e, this.maxHeight = t, this.padding = n, this.freeRects = [], this.rects = [], this.verticalExpand = !1, this.options = {
			smart: !0,
			pot: !0,
			square: !0,
			allowRotation: !1,
			tag: !1,
			exclusiveTag: !0,
			border: 0,
			logic: kC.MAX_EDGE
		}, this.options = Object.assign(Object.assign({}, this.options), r), this.width = this.options.smart ? 0 : e, this.height = this.options.smart ? 0 : t, this.border = this.options.border ? this.options.border : 0, this.freeRects.push(new wC(this.maxWidth + this.padding - this.border * 2, this.maxHeight + this.padding - this.border * 2, this.border, this.border)), this.stage = new wC(this.width, this.height);
	}
	add(...e) {
		let t, n;
		if (e.length === 1) {
			if (typeof e[0] != "object") throw Error("MacrectsBin.add(): Wrong parameters");
			n = e[0];
			let t = n.data && n.data.tag ? n.data.tag : n.tag ? n.tag : void 0;
			if (this.options.tag && this.options.exclusiveTag && this.tag !== t) return;
		} else {
			if (t = e.length > 2 ? e[2] : null, this.options.tag && this.options.exclusiveTag && (t && this.tag !== t.tag || !t && this.tag)) return;
			n = new wC(e[0], e[1]), n.data = t, n.setDirty(!1);
		}
		let r = this.place(n);
		return r && this.rects.push(r), r;
	}
	repack() {
		let e = [];
		this.reset(), this.rects.sort((e, t) => {
			let n = Math.max(t.width, t.height) - Math.max(e.width, e.height);
			return n === 0 && e.hash && t.hash ? e.hash > t.hash ? -1 : 1 : n;
		});
		for (let t of this.rects) this.place(t) || e.push(t);
		for (let t of e) this.rects.splice(this.rects.indexOf(t), 1);
		return e.length > 0 ? e : void 0;
	}
	reset(e = !1, t = !1) {
		e && (this.data && delete this.data, this.tag && delete this.tag, this.rects = [], t && (this.options = {
			smart: !0,
			pot: !0,
			square: !0,
			allowRotation: !1,
			tag: !1,
			border: 0
		})), this.width = this.options.smart ? 0 : this.maxWidth, this.height = this.options.smart ? 0 : this.maxHeight, this.border = this.options.border ? this.options.border : 0, this.freeRects = [new wC(this.maxWidth + this.padding - this.border * 2, this.maxHeight + this.padding - this.border * 2, this.border, this.border)], this.stage = new wC(this.width, this.height), this._dirty = 0;
	}
	clone() {
		let t = new e(this.maxWidth, this.maxHeight, this.padding, this.options);
		for (let e of this.rects) t.add(e);
		return t;
	}
	place(e) {
		let t = e.data && e.data.tag ? e.data.tag : e.tag ? e.tag : void 0;
		if (this.options.tag && this.options.exclusiveTag && this.tag !== t) return;
		let n, r;
		if (r = e.hasOwnProperty("_allowRotation") && e.allowRotation !== void 0 ? e.allowRotation : this.options.allowRotation, n = this.findNode(e.width + this.padding, e.height + this.padding, r), n) {
			this.updateBinSize(n);
			let t = this.freeRects.length, r = 0;
			for (; r < t;) this.splitNode(this.freeRects[r], n) && (this.freeRects.splice(r, 1), t--, r--), r++;
			return this.pruneFreeList(), this.verticalExpand = this.width > this.height, e.x = n.x, e.y = n.y, e.rot === void 0 && (e.rot = !1), e.rot = n.rot ? !e.rot : e.rot, this._dirty++, e;
		} else if (!this.verticalExpand) {
			if (this.updateBinSize(new wC(e.width + this.padding, e.height + this.padding, this.width + this.padding - this.border, this.border)) || this.updateBinSize(new wC(e.width + this.padding, e.height + this.padding, this.border, this.height + this.padding - this.border))) return this.place(e);
		} else if (this.updateBinSize(new wC(e.width + this.padding, e.height + this.padding, this.border, this.height + this.padding - this.border)) || this.updateBinSize(new wC(e.width + this.padding, e.height + this.padding, this.width + this.padding - this.border, this.border))) return this.place(e);
	}
	findNode(e, t, n) {
		let r = Number.MAX_VALUE, i, a, o;
		for (let s in this.freeRects) a = this.freeRects[s], a.width >= e && a.height >= t && (i = this.options.logic === kC.MAX_AREA ? a.width * a.height - e * t : Math.min(a.width - e, a.height - t), i < r && (o = new wC(e, t, a.x, a.y), r = i)), n && a.width >= t && a.height >= e && (i = this.options.logic === kC.MAX_AREA ? a.width * a.height - t * e : Math.min(a.height - e, a.width - t), i < r && (o = new wC(t, e, a.x, a.y, !0), r = i));
		return o;
	}
	splitNode(e, t) {
		if (!e.collide(t)) return !1;
		if (t.x < e.x + e.width && t.x + t.width > e.x) {
			if (t.y > e.y && t.y < e.y + e.height) {
				let n = new wC(e.width, t.y - e.y, e.x, e.y);
				this.freeRects.push(n);
			}
			if (t.y + t.height < e.y + e.height) {
				let n = new wC(e.width, e.y + e.height - (t.y + t.height), e.x, t.y + t.height);
				this.freeRects.push(n);
			}
		}
		if (t.y < e.y + e.height && t.y + t.height > e.y) {
			if (t.x > e.x && t.x < e.x + e.width) {
				let n = new wC(t.x - e.x, e.height, e.x, e.y);
				this.freeRects.push(n);
			}
			if (t.x + t.width < e.x + e.width) {
				let n = new wC(e.x + e.width - (t.x + t.width), e.height, t.x + t.width, e.y);
				this.freeRects.push(n);
			}
		}
		return !0;
	}
	pruneFreeList() {
		let e = 0, t = 0, n = this.freeRects.length;
		for (; e < n;) {
			t = e + 1;
			let r = this.freeRects[e];
			for (; t < n;) {
				let i = this.freeRects[t];
				if (i.contain(r)) {
					this.freeRects.splice(e, 1), e--, n--;
					break;
				}
				r.contain(i) && (this.freeRects.splice(t, 1), t--, n--), t++;
			}
			e++;
		}
	}
	updateBinSize(e) {
		if (!this.options.smart || this.stage.contain(e)) return !1;
		let t = Math.max(this.width, e.x + e.width - this.padding + this.border), n = Math.max(this.height, e.y + e.height - this.padding + this.border);
		if (this.options.allowRotation) {
			let r = Math.max(this.width, e.x + e.height - this.padding + this.border), i = Math.max(this.height, e.y + e.width - this.padding + this.border);
			r * i < t * n && (t = r, n = i);
		}
		return this.options.pot && (t = 2 ** Math.ceil(Math.log(t) * Math.LOG2E), n = 2 ** Math.ceil(Math.log(n) * Math.LOG2E)), this.options.square && (t = n = Math.max(t, n)), t > this.maxWidth + this.padding || n > this.maxHeight + this.padding ? !1 : (this.expandFreeRects(t + this.padding, n + this.padding), this.width = this.stage.width = t, this.height = this.stage.height = n, !0);
	}
	expandFreeRects(e, t) {
		this.freeRects.forEach((n, r) => {
			n.x + n.width >= Math.min(this.width + this.padding - this.border, e) && (n.width = e - n.x - this.border), n.y + n.height >= Math.min(this.height + this.padding - this.border, t) && (n.height = t - n.y - this.border);
		}, this), this.freeRects.push(new wC(e - this.width - this.padding, t - this.border * 2, this.width + this.padding - this.border, this.border)), this.freeRects.push(new wC(e - this.border * 2, t - this.height - this.padding, this.border, this.height + this.padding - this.border)), this.freeRects = this.freeRects.filter((e) => !(e.width <= 0 || e.height <= 0 || e.x < this.border || e.y < this.border)), this.pruneFreeList();
	}
}, DC = class e extends TC {
	constructor(...e) {
		if (super(), this.rects = [], e.length === 1) {
			if (typeof e[0] != "object") throw Error("OversizedElementBin: Wrong parameters");
			let t = e[0];
			this.rects = [t], this.width = t.width, this.height = t.height, this.data = t.data, t.oversized = !0;
		} else {
			this.width = e[0], this.height = e[1], this.data = e.length > 2 ? e[2] : null;
			let t = new wC(this.width, this.height);
			t.oversized = !0, t.data = this.data, this.rects.push(t);
		}
		this.freeRects = [], this.maxWidth = this.width, this.maxHeight = this.height, this.options = {
			smart: !1,
			pot: !1,
			square: !1
		};
	}
	add() {}
	reset(e = !1) {}
	repack() {}
	clone() {
		return new e(this.rects[0]);
	}
}, OC = 4096, kC;
(function(e) {
	e[e.MAX_AREA = 0] = "MAX_AREA", e[e.MAX_EDGE = 1] = "MAX_EDGE";
})(kC || (kC = {}));
var AC = class {
	constructor(e = OC, t = OC, n = 0, r = {}) {
		this.width = e, this.height = t, this.padding = n, this.options = {
			smart: !0,
			pot: !0,
			square: !1,
			allowRotation: !1,
			tag: !1,
			exclusiveTag: !0,
			border: 0,
			logic: kC.MAX_EDGE
		}, this._currentBinIndex = 0, this.bins = [], this.options = Object.assign(Object.assign({}, this.options), r);
	}
	add(...e) {
		if (e.length === 1) {
			if (typeof e[0] != "object") throw Error("MacrectsPacker.add(): Wrong parameters");
			let t = e[0];
			if (t.width > this.width || t.height > this.height) this.bins.push(new DC(t));
			else if (!this.bins.slice(this._currentBinIndex).find((e) => e.add(t) !== void 0)) {
				let e = new EC(this.width, this.height, this.padding, this.options), n = t.data && t.data.tag ? t.data.tag : t.tag ? t.tag : void 0;
				this.options.tag && n && (e.tag = n), e.add(t), this.bins.push(e);
			}
			return t;
		} else {
			let t = new wC(e[0], e[1]);
			if (e.length > 2 && (t.data = e[2]), t.width > this.width || t.height > this.height) this.bins.push(new DC(t));
			else if (!this.bins.slice(this._currentBinIndex).find((e) => e.add(t) !== void 0)) {
				let e = new EC(this.width, this.height, this.padding, this.options);
				this.options.tag && t.data.tag && (e.tag = t.data.tag), e.add(t), this.bins.push(e);
			}
			return t;
		}
	}
	addArray(e) {
		if (!this.options.tag || this.options.exclusiveTag) this.sort(e, this.options.logic).forEach((e) => this.add(e));
		else {
			if (e.length === 0) return;
			e.sort((e, t) => {
				let n = e.data && e.data.tag ? e.data.tag : e.tag ? e.tag : void 0, r = t.data && t.data.tag ? t.data.tag : t.tag ? t.tag : void 0;
				return r === void 0 ? -1 : n === void 0 ? 1 : r > n ? -1 : 1;
			});
			let t, n = 0;
			if (!this.bins.slice(this._currentBinIndex).find((r, i) => {
				let a = r.clone();
				for (let i = n; i < e.length; i++) {
					let o = e[i], s = o.data && o.data.tag ? o.data.tag : o.tag ? o.tag : void 0;
					if (i === 0 && (t = s), s !== t) return t = s, this.sort(e.slice(n, i), this.options.logic).forEach((e) => r.add(e)), n = i, this.addArray(e.slice(i)), !0;
					if (s === void 0) return this.sort(e.slice(i), this.options.logic).forEach((e) => this.add(e)), n = e.length, !0;
					if (a.add(o) === void 0) return this.sort(e.slice(n, i), this.options.logic).forEach((e) => r.add(e)), n = i, !1;
				}
				return this.sort(e.slice(n), this.options.logic).forEach((e) => r.add(e)), !0;
			})) {
				let t = e[n], r = new EC(this.width, this.height, this.padding, this.options), i = t.data && t.data.tag ? t.data.tag : t.tag ? t.tag : void 0;
				this.options.tag && this.options.exclusiveTag && i && (r.tag = i), this.bins.push(r), r.add(t), n++, this.addArray(e.slice(n));
			}
		}
	}
	reset() {
		this.bins = [], this._currentBinIndex = 0;
	}
	repack(e = !0) {
		if (e) {
			let e = [];
			for (let t of this.bins) if (t.dirty) {
				let n = t.repack();
				n && e.push(...n);
			}
			this.addArray(e);
			return;
		}
		if (!this.dirty) return;
		let t = this.rects;
		this.reset(), this.addArray(t);
	}
	next() {
		return this._currentBinIndex = this.bins.length, this._currentBinIndex;
	}
	load(e) {
		e.forEach((e, t) => {
			if (e.maxWidth > this.width || e.maxHeight > this.height) this.bins.push(new DC(e.width, e.height, {}));
			else {
				let n = new EC(this.width, this.height, this.padding, e.options);
				n.freeRects.splice(0), e.freeRects.forEach((e, t) => {
					n.freeRects.push(new wC(e.width, e.height, e.x, e.y));
				}), n.width = e.width, n.height = e.height, e.tag && (n.tag = e.tag), this.bins[t] = n;
			}
		}, this);
	}
	save() {
		let e = [];
		return this.bins.forEach(((t) => {
			let n = {
				width: t.width,
				height: t.height,
				maxWidth: t.maxWidth,
				maxHeight: t.maxHeight,
				freeRects: [],
				rects: [],
				options: t.options
			};
			t.tag && (n = Object.assign(Object.assign({}, n), { tag: t.tag })), t.freeRects.forEach((e) => {
				n.freeRects.push({
					x: e.x,
					y: e.y,
					width: e.width,
					height: e.height
				});
			}), e.push(n);
		})), e;
	}
	sort(e, t = kC.MAX_EDGE) {
		return e.slice().sort((e, n) => {
			let r = t === kC.MAX_EDGE ? Math.max(n.width, n.height) - Math.max(e.width, e.height) : n.width * n.height - e.width * e.height;
			return r === 0 && e.hash && n.hash ? e.hash > n.hash ? -1 : 1 : r;
		});
	}
	get currentBinIndex() {
		return this._currentBinIndex;
	}
	get dirty() {
		return this.bins.some((e) => e.dirty);
	}
	get rects() {
		let e = [];
		for (let t of this.bins) e.push(...t.rects);
		return e;
	}
};
//#endregion
//#region ../renderer/src/objects/images/pack-sources.ts
function jC(e) {
	return typeof e.slice == "function";
}
function MC(e) {
	return !("getContext" in e);
}
function NC(e, t) {
	if (typeof OffscreenCanvas < "u") return new OffscreenCanvas(e, t);
	let n = document.createElement("canvas");
	return n.width = e, n.height = t, n;
}
function PC(e, t, n = NC) {
	let r = Math.max(1, Math.floor(t)), i = e.map((e) => e ? {
		width: e.width,
		height: e.height,
		tiles: 0
	} : {
		width: 0,
		height: 0,
		tiles: 0
	}), a = [], o = [];
	for (let t = 0; t < e.length; t++) {
		let n = e[t];
		(!n || MC(n) ? a : o).push(t);
	}
	let s = new AC(r, r, FC, { pot: !1 });
	return {
		atlases: [...IC(s, e, a, i, r, n, !0), ...IC(s, e, o, i, r, n, !1)],
		reports: i
	};
}
var FC = 1;
function IC(e, t, n, r, i, a, o) {
	let s = [];
	for (let e of n) {
		let { width: t, height: n } = r[e];
		t <= 0 || n <= 0 || s.push({
			width: t,
			height: n,
			x: 0,
			y: 0,
			hash: `${e}`,
			data: { index: e }
		});
	}
	e.reset(), e.addArray(s);
	let c = s.filter((e) => e.oversized);
	c.length > 0 && e.addArray(c.flatMap((e) => LC(e, r[e.data.index], i)));
	let l = e.bins.filter((e) => !e.rects.some((e) => e.oversized)), u = l.map((e) => ({
		...RC(e, t, r, a),
		resizable: o
	}));
	for (let e of l) for (let t of e.rects) r[t.data.index].tiles++;
	return u;
}
function LC(e, t, n) {
	let r = Math.ceil(t.width / n), i = Math.ceil(t.height / n), a = [];
	for (let o = 0; o < i; o++) {
		let i = o * n, s = Math.min(n, t.height - i);
		for (let c = 0; c < r; c++) {
			let r = c * n, l = Math.min(n, t.width - r);
			a.push({
				width: l,
				height: s,
				x: 0,
				y: 0,
				hash: `${e.hash}:${c},${o}`,
				data: {
					index: e.data.index,
					source: {
						x: r,
						y: i,
						width: l,
						height: s
					}
				}
			});
		}
	}
	return a;
}
function RC(e, t, n, r) {
	let i = r(e.width, e.height), a = zC(i);
	if (!a) throw Error(`pack-sources: no 2d context for a ${e.width}x${e.height} atlas`);
	let o = [];
	for (let r of e.rects) {
		let { index: i, source: s } = r.data, { width: c, height: l } = n[i], u = s == null ? {
			x: 0,
			y: 0,
			width: c,
			height: l
		} : s, d = t[i];
		if (!d) continue;
		a.drawImage(d, u.x, u.y, u.width, u.height, r.x, r.y, r.width, r.height);
		let f = {
			u0: r.x / e.width,
			v0: r.y / e.height,
			u1: (r.x + r.width) / e.width,
			v1: (r.y + r.height) / e.height
		};
		o.push(s ? {
			index: i,
			uv: f,
			source: s
		} : {
			index: i,
			uv: f
		});
	}
	return {
		canvas: i,
		placements: o
	};
}
function zC(e) {
	return "convertToBlob" in e, e.getContext("2d");
}
//#endregion
//#region ../renderer/src/objects/images/worker/atlas-worker.ts?worker&inline
var BC = "(function(){var e=class{constructor(e=0,t=0,n=0,r=0,i=!1,a=void 0){this.oversized=!1,this._rot=!1,this._allowRotation=void 0,this._dirty=0,this._width=e,this._height=t,this._x=n,this._y=r,this._data={},this._rot=i,this._allowRotation=a}static Collide(e,t){return e.collide(t)}static Contain(e,t){return e.contain(t)}area(){return this.width*this.height}collide(e){return e.x<this.x+this.width&&e.x+e.width>this.x&&e.y<this.y+this.height&&e.y+e.height>this.y}contain(e){return e.x>=this.x&&e.y>=this.y&&e.x+e.width<=this.x+this.width&&e.y+e.height<=this.y+this.height}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._dirty++)}get height(){return this._height}set height(e){e!==this._height&&(this._height=e,this._dirty++)}get x(){return this._x}set x(e){e!==this._x&&(this._x=e,this._dirty++)}get y(){return this._y}set y(e){e!==this._y&&(this._y=e,this._dirty++)}get rot(){return this._rot}set rot(e){if(this._allowRotation!==!1&&this._rot!==e){let t=this.width;this.width=this.height,this.height=t,this._rot=e,this._dirty++}}get allowRotation(){return this._allowRotation}set allowRotation(e){this._allowRotation!==e&&(this._allowRotation=e,this._dirty++)}get data(){return this._data}set data(e){e===null||e===this._data||(this._data=e,typeof e==`object`&&e.hasOwnProperty(`allowRotation`)&&(this._allowRotation=e.allowRotation),this._dirty++)}get dirty(){return this._dirty>0}setDirty(e=!0){this._dirty=e?this._dirty+1:0}},t=class{constructor(){this._dirty=0}get dirty(){return this._dirty>0||this.rects.some(e=>e.dirty)}setDirty(e=!0){if(this._dirty=e?this._dirty+1:0,!e)for(let e of this.rects)e.setDirty&&e.setDirty(!1)}},n=class n extends t{constructor(t=i,n=i,r=0,o={}){super(),this.maxWidth=t,this.maxHeight=n,this.padding=r,this.freeRects=[],this.rects=[],this.verticalExpand=!1,this.options={smart:!0,pot:!0,square:!0,allowRotation:!1,tag:!1,exclusiveTag:!0,border:0,logic:a.MAX_EDGE},this.options=Object.assign(Object.assign({},this.options),o),this.width=this.options.smart?0:t,this.height=this.options.smart?0:n,this.border=this.options.border?this.options.border:0,this.freeRects.push(new e(this.maxWidth+this.padding-this.border*2,this.maxHeight+this.padding-this.border*2,this.border,this.border)),this.stage=new e(this.width,this.height)}add(...t){let n,r;if(t.length===1){if(typeof t[0]!=`object`)throw Error(`MacrectsBin.add(): Wrong parameters`);r=t[0];let e=r.data&&r.data.tag?r.data.tag:r.tag?r.tag:void 0;if(this.options.tag&&this.options.exclusiveTag&&this.tag!==e)return}else{if(n=t.length>2?t[2]:null,this.options.tag&&this.options.exclusiveTag&&(n&&this.tag!==n.tag||!n&&this.tag))return;r=new e(t[0],t[1]),r.data=n,r.setDirty(!1)}let i=this.place(r);return i&&this.rects.push(i),i}repack(){let e=[];this.reset(),this.rects.sort((e,t)=>{let n=Math.max(t.width,t.height)-Math.max(e.width,e.height);return n===0&&e.hash&&t.hash?e.hash>t.hash?-1:1:n});for(let t of this.rects)this.place(t)||e.push(t);for(let t of e)this.rects.splice(this.rects.indexOf(t),1);return e.length>0?e:void 0}reset(t=!1,n=!1){t&&(this.data&&delete this.data,this.tag&&delete this.tag,this.rects=[],n&&(this.options={smart:!0,pot:!0,square:!0,allowRotation:!1,tag:!1,border:0})),this.width=this.options.smart?0:this.maxWidth,this.height=this.options.smart?0:this.maxHeight,this.border=this.options.border?this.options.border:0,this.freeRects=[new e(this.maxWidth+this.padding-this.border*2,this.maxHeight+this.padding-this.border*2,this.border,this.border)],this.stage=new e(this.width,this.height),this._dirty=0}clone(){let e=new n(this.maxWidth,this.maxHeight,this.padding,this.options);for(let t of this.rects)e.add(t);return e}place(t){let n=t.data&&t.data.tag?t.data.tag:t.tag?t.tag:void 0;if(this.options.tag&&this.options.exclusiveTag&&this.tag!==n)return;let r,i;if(i=t.hasOwnProperty(`_allowRotation`)&&t.allowRotation!==void 0?t.allowRotation:this.options.allowRotation,r=this.findNode(t.width+this.padding,t.height+this.padding,i),r){this.updateBinSize(r);let e=this.freeRects.length,n=0;for(;n<e;)this.splitNode(this.freeRects[n],r)&&(this.freeRects.splice(n,1),e--,n--),n++;return this.pruneFreeList(),this.verticalExpand=this.width>this.height,t.x=r.x,t.y=r.y,t.rot===void 0&&(t.rot=!1),t.rot=r.rot?!t.rot:t.rot,this._dirty++,t}else if(!this.verticalExpand){if(this.updateBinSize(new e(t.width+this.padding,t.height+this.padding,this.width+this.padding-this.border,this.border))||this.updateBinSize(new e(t.width+this.padding,t.height+this.padding,this.border,this.height+this.padding-this.border)))return this.place(t)}else if(this.updateBinSize(new e(t.width+this.padding,t.height+this.padding,this.border,this.height+this.padding-this.border))||this.updateBinSize(new e(t.width+this.padding,t.height+this.padding,this.width+this.padding-this.border,this.border)))return this.place(t)}findNode(t,n,r){let i=Number.MAX_VALUE,o,s,c;for(let l in this.freeRects)s=this.freeRects[l],s.width>=t&&s.height>=n&&(o=this.options.logic===a.MAX_AREA?s.width*s.height-t*n:Math.min(s.width-t,s.height-n),o<i&&(c=new e(t,n,s.x,s.y),i=o)),r&&s.width>=n&&s.height>=t&&(o=this.options.logic===a.MAX_AREA?s.width*s.height-n*t:Math.min(s.height-t,s.width-n),o<i&&(c=new e(n,t,s.x,s.y,!0),i=o));return c}splitNode(t,n){if(!t.collide(n))return!1;if(n.x<t.x+t.width&&n.x+n.width>t.x){if(n.y>t.y&&n.y<t.y+t.height){let r=new e(t.width,n.y-t.y,t.x,t.y);this.freeRects.push(r)}if(n.y+n.height<t.y+t.height){let r=new e(t.width,t.y+t.height-(n.y+n.height),t.x,n.y+n.height);this.freeRects.push(r)}}if(n.y<t.y+t.height&&n.y+n.height>t.y){if(n.x>t.x&&n.x<t.x+t.width){let r=new e(n.x-t.x,t.height,t.x,t.y);this.freeRects.push(r)}if(n.x+n.width<t.x+t.width){let r=new e(t.x+t.width-(n.x+n.width),t.height,n.x+n.width,t.y);this.freeRects.push(r)}}return!0}pruneFreeList(){let e=0,t=0,n=this.freeRects.length;for(;e<n;){t=e+1;let r=this.freeRects[e];for(;t<n;){let i=this.freeRects[t];if(i.contain(r)){this.freeRects.splice(e,1),e--,n--;break}r.contain(i)&&(this.freeRects.splice(t,1),t--,n--),t++}e++}}updateBinSize(e){if(!this.options.smart||this.stage.contain(e))return!1;let t=Math.max(this.width,e.x+e.width-this.padding+this.border),n=Math.max(this.height,e.y+e.height-this.padding+this.border);if(this.options.allowRotation){let r=Math.max(this.width,e.x+e.height-this.padding+this.border),i=Math.max(this.height,e.y+e.width-this.padding+this.border);r*i<t*n&&(t=r,n=i)}return this.options.pot&&(t=2**Math.ceil(Math.log(t)*Math.LOG2E),n=2**Math.ceil(Math.log(n)*Math.LOG2E)),this.options.square&&(t=n=Math.max(t,n)),t>this.maxWidth+this.padding||n>this.maxHeight+this.padding?!1:(this.expandFreeRects(t+this.padding,n+this.padding),this.width=this.stage.width=t,this.height=this.stage.height=n,!0)}expandFreeRects(t,n){this.freeRects.forEach((e,r)=>{e.x+e.width>=Math.min(this.width+this.padding-this.border,t)&&(e.width=t-e.x-this.border),e.y+e.height>=Math.min(this.height+this.padding-this.border,n)&&(e.height=n-e.y-this.border)},this),this.freeRects.push(new e(t-this.width-this.padding,n-this.border*2,this.width+this.padding-this.border,this.border)),this.freeRects.push(new e(t-this.border*2,n-this.height-this.padding,this.border,this.height+this.padding-this.border)),this.freeRects=this.freeRects.filter(e=>!(e.width<=0||e.height<=0||e.x<this.border||e.y<this.border)),this.pruneFreeList()}},r=class n extends t{constructor(...t){if(super(),this.rects=[],t.length===1){if(typeof t[0]!=`object`)throw Error(`OversizedElementBin: Wrong parameters`);let e=t[0];this.rects=[e],this.width=e.width,this.height=e.height,this.data=e.data,e.oversized=!0}else{this.width=t[0],this.height=t[1],this.data=t.length>2?t[2]:null;let n=new e(this.width,this.height);n.oversized=!0,n.data=this.data,this.rects.push(n)}this.freeRects=[],this.maxWidth=this.width,this.maxHeight=this.height,this.options={smart:!1,pot:!1,square:!1}}add(){}reset(e=!1){}repack(){}clone(){return new n(this.rects[0])}};let i=4096;var a;(function(e){e[e.MAX_AREA=0]=`MAX_AREA`,e[e.MAX_EDGE=1]=`MAX_EDGE`})(a||(a={}));var o=class{constructor(e=i,t=i,n=0,r={}){this.width=e,this.height=t,this.padding=n,this.options={smart:!0,pot:!0,square:!1,allowRotation:!1,tag:!1,exclusiveTag:!0,border:0,logic:a.MAX_EDGE},this._currentBinIndex=0,this.bins=[],this.options=Object.assign(Object.assign({},this.options),r)}add(...t){if(t.length===1){if(typeof t[0]!=`object`)throw Error(`MacrectsPacker.add(): Wrong parameters`);let e=t[0];if(e.width>this.width||e.height>this.height)this.bins.push(new r(e));else if(!this.bins.slice(this._currentBinIndex).find(t=>t.add(e)!==void 0)){let t=new n(this.width,this.height,this.padding,this.options),r=e.data&&e.data.tag?e.data.tag:e.tag?e.tag:void 0;this.options.tag&&r&&(t.tag=r),t.add(e),this.bins.push(t)}return e}else{let i=new e(t[0],t[1]);if(t.length>2&&(i.data=t[2]),i.width>this.width||i.height>this.height)this.bins.push(new r(i));else if(!this.bins.slice(this._currentBinIndex).find(e=>e.add(i)!==void 0)){let e=new n(this.width,this.height,this.padding,this.options);this.options.tag&&i.data.tag&&(e.tag=i.data.tag),e.add(i),this.bins.push(e)}return i}}addArray(e){if(!this.options.tag||this.options.exclusiveTag)this.sort(e,this.options.logic).forEach(e=>this.add(e));else{if(e.length===0)return;e.sort((e,t)=>{let n=e.data&&e.data.tag?e.data.tag:e.tag?e.tag:void 0,r=t.data&&t.data.tag?t.data.tag:t.tag?t.tag:void 0;return r===void 0?-1:n===void 0?1:r>n?-1:1});let t,r=0;if(!this.bins.slice(this._currentBinIndex).find((n,i)=>{let a=n.clone();for(let i=r;i<e.length;i++){let o=e[i],s=o.data&&o.data.tag?o.data.tag:o.tag?o.tag:void 0;if(i===0&&(t=s),s!==t)return t=s,this.sort(e.slice(r,i),this.options.logic).forEach(e=>n.add(e)),r=i,this.addArray(e.slice(i)),!0;if(s===void 0)return this.sort(e.slice(i),this.options.logic).forEach(e=>this.add(e)),r=e.length,!0;if(a.add(o)===void 0)return this.sort(e.slice(r,i),this.options.logic).forEach(e=>n.add(e)),r=i,!1}return this.sort(e.slice(r),this.options.logic).forEach(e=>n.add(e)),!0})){let t=e[r],i=new n(this.width,this.height,this.padding,this.options),a=t.data&&t.data.tag?t.data.tag:t.tag?t.tag:void 0;this.options.tag&&this.options.exclusiveTag&&a&&(i.tag=a),this.bins.push(i),i.add(t),r++,this.addArray(e.slice(r))}}}reset(){this.bins=[],this._currentBinIndex=0}repack(e=!0){if(e){let e=[];for(let t of this.bins)if(t.dirty){let n=t.repack();n&&e.push(...n)}this.addArray(e);return}if(!this.dirty)return;let t=this.rects;this.reset(),this.addArray(t)}next(){return this._currentBinIndex=this.bins.length,this._currentBinIndex}load(t){t.forEach((t,i)=>{if(t.maxWidth>this.width||t.maxHeight>this.height)this.bins.push(new r(t.width,t.height,{}));else{let r=new n(this.width,this.height,this.padding,t.options);r.freeRects.splice(0),t.freeRects.forEach((t,n)=>{r.freeRects.push(new e(t.width,t.height,t.x,t.y))}),r.width=t.width,r.height=t.height,t.tag&&(r.tag=t.tag),this.bins[i]=r}},this)}save(){let e=[];return this.bins.forEach((t=>{let n={width:t.width,height:t.height,maxWidth:t.maxWidth,maxHeight:t.maxHeight,freeRects:[],rects:[],options:t.options};t.tag&&(n=Object.assign(Object.assign({},n),{tag:t.tag})),t.freeRects.forEach(e=>{n.freeRects.push({x:e.x,y:e.y,width:e.width,height:e.height})}),e.push(n)})),e}sort(e,t=a.MAX_EDGE){return e.slice().sort((e,n)=>{let r=t===a.MAX_EDGE?Math.max(n.width,n.height)-Math.max(e.width,e.height):n.width*n.height-e.width*e.height;return r===0&&e.hash&&n.hash?e.hash>n.hash?-1:1:r})}get currentBinIndex(){return this._currentBinIndex}get dirty(){return this.bins.some(e=>e.dirty)}get rects(){let e=[];for(let t of this.bins)e.push(...t.rects);return e}};function s(e){return!(`getContext`in e)}function c(e,t){if(typeof OffscreenCanvas<`u`)return new OffscreenCanvas(e,t);let n=document.createElement(`canvas`);return n.width=e,n.height=t,n}function l(e,t,n=c){let r=Math.max(1,Math.floor(t)),i=e.map(e=>e?{width:e.width,height:e.height,tiles:0}:{width:0,height:0,tiles:0}),a=[],l=[];for(let t=0;t<e.length;t++){let n=e[t];(!n||s(n)?a:l).push(t)}let f=new o(r,r,u,{pot:!1});return{atlases:[...d(f,e,a,i,r,n,!0),...d(f,e,l,i,r,n,!1)],reports:i}}let u=1;function d(e,t,n,r,i,a,o){let s=[];for(let e of n){let{width:t,height:n}=r[e];t<=0||n<=0||s.push({width:t,height:n,x:0,y:0,hash:`${e}`,data:{index:e}})}e.reset(),e.addArray(s);let c=s.filter(e=>e.oversized);c.length>0&&e.addArray(c.flatMap(e=>f(e,r[e.data.index],i)));let l=e.bins.filter(e=>!e.rects.some(e=>e.oversized)),u=l.map(e=>({...p(e,t,r,a),resizable:o}));for(let e of l)for(let t of e.rects)r[t.data.index].tiles++;return u}function f(e,t,n){let r=Math.ceil(t.width/n),i=Math.ceil(t.height/n),a=[];for(let o=0;o<i;o++){let i=o*n,s=Math.min(n,t.height-i);for(let c=0;c<r;c++){let r=c*n,l=Math.min(n,t.width-r);a.push({width:l,height:s,x:0,y:0,hash:`${e.hash}:${c},${o}`,data:{index:e.data.index,source:{x:r,y:i,width:l,height:s}}})}}return a}function p(e,t,n,r){let i=r(e.width,e.height),a=m(i);if(!a)throw Error(`pack-sources: no 2d context for a ${e.width}x${e.height} atlas`);let o=[];for(let r of e.rects){let{index:i,source:s}=r.data,{width:c,height:l}=n[i],u=s==null?{x:0,y:0,width:c,height:l}:s,d=t[i];if(!d)continue;a.drawImage(d,u.x,u.y,u.width,u.height,r.x,r.y,r.width,r.height);let f={u0:r.x/e.width,v0:r.y/e.height,u1:(r.x+r.width)/e.width,v1:(r.y+r.height)/e.height};o.push(s?{index:i,uv:f,source:s}:{index:i,uv:f})}return{canvas:i,placements:o}}function m(e){return`convertToBlob`in e,e.getContext(`2d`)}async function h(e,t){let n=v(e);n.packing=!0;let r=await Promise.all(n.decoding);if(y.delete(e),n.canceled)return _(r),null;let{atlases:i,reports:a}=l(r,t),o=i.map(e=>({bitmap:e.canvas.transferToImageBitmap(),placements:e.placements,resizable:e.resizable}));return _(r),{type:`packed`,id:e,atlases:o,reports:a}}function g(e){let t=y.get(e);t&&(t.canceled=!0,!t.packing&&(y.delete(e),Promise.all(t.decoding).then(_)))}function _(e){for(let t of e)t&&`close`in t&&t.close()}function v(e){let t=y.get(e);return t||(t={decoding:[],canceled:!1,packing:!1},y.set(e,t)),t}let y=new Map,b=self;b.onmessage=e=>{let t=e.data;if(t.type===`sources`){let e=v(t.id);for(let n of t.sources)e.decoding.push(createImageBitmap(n).catch(()=>null));return}if(t.type===`cancel`){g(t.id);return}let{id:n}=t;h(n,t.maxDimension).then(e=>{e&&b.postMessage(e,e.atlases.map(e=>e.bitmap))},e=>{y.delete(n),b.postMessage({type:`failed`,id:n,message:String(e)})})}})();", VC = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", BC], { type: "text/javascript;charset=utf-8" });
function HC(e) {
	let t;
	try {
		if (t = VC && (self.URL || self.webkitURL).createObjectURL(VC), !t) throw "";
		let n = new Worker(t, { name: e == null ? void 0 : e.name });
		return n.addEventListener("error", () => {
			(self.URL || self.webkitURL).revokeObjectURL(t);
		}), n;
	} catch {
		return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(BC), { name: e == null ? void 0 : e.name });
	}
}
//#endregion
//#region ../renderer/src/objects/images/worker/client.ts
function UC(e, t, n = {}) {
	let { signal: r, createWorker: i = YC } = n;
	return new Promise((n, a) => {
		if (r != null && r.aborted) {
			a(XC());
			return;
		}
		let o;
		try {
			o = WC(i);
		} catch (e) {
			a(ZC(e));
			return;
		}
		let s = ++ew, c = (e) => {
			r == null || r.removeEventListener("abort", l), QC.delete(s), e();
		}, l = () => {
			c(() => {
				qC(o, s), a(XC());
			});
		};
		QC.set(s, (e) => {
			c(() => {
				e.type === "failed" ? a(Error(e.message)) : n({
					atlases: e.atlases,
					reports: e.reports
				});
			});
		}), r == null || r.addEventListener("abort", l);
		try {
			for (let t = 0; t < e.length; t += 25) JC(o, {
				type: "sources",
				id: s,
				sources: e.slice(t, t + 25)
			});
			JC(o, {
				type: "pack",
				id: s,
				maxDimension: t
			});
		} catch (e) {
			c(() => {
				qC(o, s), a(ZC(e));
			});
		}
	});
}
function WC(e) {
	if ($C) return $C.worker;
	let t = {
		worker: e(),
		produced: !1
	};
	return t.worker.onmessage = (e) => {
		let n = e.data, r = QC.get(n.id);
		if (r) {
			n.type === "packed" && n.atlases.length > 0 && (t.produced = !0), r(n);
			return;
		}
		if (n.type === "packed") for (let e of n.atlases) e.bitmap.close();
	}, t.worker.onerror = (e) => {
		GC(t), KC(e.message || "atlas-worker: failed to start");
	}, t.worker.onmessageerror = () => {
		GC(t), KC("atlas-worker: a reply could not be read");
	}, $C = t, t.worker;
}
function GC(e) {
	$C === e && ($C = null), e.produced || e.worker.terminate();
}
function KC(e) {
	for (let [t, n] of [...QC]) n({
		type: "failed",
		id: t,
		message: e
	});
}
function qC(e, t) {
	try {
		JC(e, {
			type: "cancel",
			id: t
		});
	} catch {}
}
function JC(e, t) {
	e.postMessage(t);
}
function YC() {
	return new HC();
}
function XC() {
	return /* @__PURE__ */ Error("atlas-worker: the pack was abandoned");
}
function ZC(e) {
	return e instanceof Error ? e : Error(String(e));
}
var QC = /* @__PURE__ */ new Map(), $C = null, ew = 0, tw = Xm("atlas-packer"), nw = 1e3;
async function rw(e, t, n = {}) {
	let r = performance.now(), { createCanvas: i = NC, signal: a } = n, o = sw(e), s = o.map((e) => e.source), c = iw(s), l = null;
	if (c === "worker") try {
		l = await aw(o, s, t, a);
	} catch (e) {
		if (a != null && a.aborted) throw e;
		tw.warn("the worker could not pack, packing inline instead %O", e), c = "inline";
	}
	l != null || (l = await ow(o, s, t, i, a));
	let u = (performance.now() - r).toFixed(1);
	return tw.debug("packed defs: %d, sources: %d, atlases: %d, tier: %s (%sms)", l.reduce((e, t) => e + t.images.length, 0), o.length, l.length, c, u), l;
}
function iw(e) {
	return typeof Worker == "function" && typeof OffscreenCanvas < "u" && e.every(jC) ? "worker" : "inline";
}
async function aw(e, t, n, r) {
	let { atlases: i, reports: a } = await UC(t, n, { signal: r });
	if (r != null && r.aborted) {
		for (let e of i) e.bitmap.close();
		throw Error("atlas-packer: the pack was aborted");
	}
	return lw(e, a), i.map((t) => ({
		image: t.bitmap,
		resizable: t.resizable,
		images: cw(t.placements, e, a)
	}));
}
async function ow(e, t, n, r, i) {
	let a = await uw(t);
	if (i != null && i.aborted) throw dw(t, a), Error("atlas-packer: the pack was aborted");
	let { atlases: o, reports: s } = PC(a, n, r);
	return dw(t, a), lw(e, s), o.map((t) => ({
		image: t.canvas,
		resizable: t.resizable,
		images: cw(t.placements, e, s)
	}));
}
function sw(e) {
	let t = /* @__PURE__ */ new Map();
	for (let n of e) {
		let e = t.get(n.source);
		e || (e = {
			source: n.source,
			defs: [],
			bounds: {
				width: 0,
				height: 0
			}
		}, t.set(n.source, e)), e.defs.push(n);
		let { width: r, height: i } = n.bounds.size;
		r * i > e.bounds.width * e.bounds.height && (e.bounds = {
			width: r,
			height: i
		});
	}
	return [...t.values()];
}
function cw(e, t, n) {
	let r = [];
	for (let { index: i, uv: a, source: o } of e) {
		let { width: e, height: s } = n[i], c = {
			width: e,
			height: s
		};
		for (let e of t[i].defs) r.push(o ? {
			def: e,
			uv: a,
			source: o,
			size: c
		} : {
			def: e,
			uv: a,
			size: c
		});
	}
	return r;
}
function lw(e, t) {
	for (let n = 0; n < e.length; n++) {
		let r = e[n], { width: i, height: a, tiles: o } = t[n];
		if (o === 0) {
			tw.warn("skipping source with no pixels (%dx%d) %O", i, a, r.source);
			continue;
		}
		o > 1 && tw.warn("source %dx%d exceeds the atlas limit, split into %d tiles", i, a, o);
		let s = r.bounds.width * r.bounds.height;
		if (s <= 0) continue;
		let c = i * a / s;
		c <= nw || tw.warn("over-sampled source: %dx%d px drawn into %sx%s units — %d px per unit², limit %d", i, a, Number(r.bounds.width.toFixed(2)), Number(r.bounds.height.toFixed(2)), Math.round(c), nw);
	}
}
async function uw(e) {
	return Promise.all(e.map((e) => fw(e).catch(() => null)));
}
function dw(e, t) {
	for (let n = 0; n < t.length; n++) {
		let r = t[n];
		r && jC(e[n]) && "close" in r && r.close();
	}
}
async function fw(e) {
	return jC(e) ? createImageBitmap(e) : e;
}
//#endregion
//#region ../renderer/src/objects/images/image-container.ts
var pw = "uvOffset", mw = class extends SC {
	constructor(e) {
		super({ schema: hw }), this.args = void 0, this.args = [{ capacity: Math.max(1, e) }];
	}
	get facesCamera() {
		return fS(this.mesh);
	}
	addInstance(e) {
		let t = -1;
		this.mesh.addInstances(1, (e) => {
			t = e;
		});
		let { u0: n, v0: r, u1: i, v1: a } = e.uv;
		return this.mesh.setUniformAt(t, pw, gw.set(n, r, i - n, a - r)), t;
	}
	removeInstance(e) {
		this.mesh.removeInstances(e);
	}
}, hw = { vertex: {
	[pw]: "vec4",
	...hb.vertex
} }, gw = new kn(), _w = (0, L.memo)(function(e) {
	let t = (0, U.c)(6), { def: n, packed: r, container: i } = e, a;
	t[0] === r ? a = t[1] : (a = () => r, t[0] = r, t[1] = a);
	let o;
	return t[2] !== i || t[3] !== n || t[4] !== r ? (o = (e) => {
		let t = bw(r);
		vw(i, e, n, t), yw(i, e, n, t), !!n.screenSpace !== i.facesCamera && i.reportKindMismatch();
	}, t[2] = i, t[3] = n, t[4] = r, t[5] = o) : o = t[5], TS(i, n, a, o), null;
});
function vw(e, t, n, r) {
	let i = uC(n.bounds);
	if (e.facesCamera) {
		r && i.scale(ww.set(r.width, r.height, 1));
		let e = i.elements[13];
		i.premultiply(Oh), i.elements[13] = e;
	} else {
		var a;
		let [e, t] = (a = n.origin) == null ? xw : a, o = e - .5, s = t - .5;
		i.multiply(Sw.makeTranslation(-o, -s, 0)), r && i.multiply(Cw.makeScale(r.width, r.height, 1).setPosition(r.x, r.y, 0));
	}
	dC(e.mesh, t, i);
}
function yw(e, t, n, r) {
	var i;
	let a = e.mesh;
	if (!fS(a)) return;
	let [o, s] = (i = n.origin) == null ? xw : i, c = o - .5, l = s - .5;
	r && (c = (c - r.x) / r.width, l = (l - r.y) / r.height), a.getAnchorAt(t, Tw), !(Tw.x === c && Tw.y === l) && a.setAnchorAt(t, c, l);
}
function bw(e) {
	let { source: t, size: n } = e;
	if (!t || n.width <= 0 || n.height <= 0) return;
	let r = t.x / n.width, i = t.y / n.height, a = (t.x + t.width) / n.width, o = (t.y + t.height) / n.height;
	return {
		width: a - r,
		height: o - i,
		x: (r + a) / 2 - .5,
		y: (i + o) / 2 - .5
	};
}
var xw = [.5, .5], Sw = new Ct(), Cw = new Ct(), ww = new I(), Tw = new gt(), Ew = Xm("images");
function Dw(e) {
	var t;
	let n = (0, U.c)(21), { defs: r, maxAtlasSize: i, createCanvas: a } = e, o = (t = e.mounted) == null ? r.length : t, s = xt(kw), c = xt(Ow), l = i == null ? s.capabilities.maxTextureSize : i, [u, d] = (0, L.useState)(r);
	Fw(u, r) || d(r);
	let [f, p] = (0, L.useState)(Vw), m, h;
	n[0] !== a || n[1] !== c || n[2] !== l || n[3] !== u ? (m = () => {
		let e = new AbortController(), t = !1;
		return rw(u, l, {
			createCanvas: a,
			signal: e.signal
		}).then((n) => {
			if (e.signal.aborted) {
				Lw(n);
				return;
			}
			t = !0, p((e) => ({
				defs: u,
				atlases: n,
				generation: e.generation + 1
			})), c();
		}, (t) => {
			e.signal.aborted || Ew.error("atlas pack failed %O", t);
		}), () => {
			t || e.abort();
		};
	}, h = [
		u,
		l,
		a,
		c
	], n[0] = a, n[1] = c, n[2] = l, n[3] = u, n[4] = m, n[5] = h) : (m = n[4], h = n[5]), (0, L.useEffect)(m, h);
	let g;
	n[6] === f.atlases ? g = n[7] : (g = () => () => Lw(f.atlases), n[6] = f.atlases, n[7] = g);
	let _;
	n[8] === f ? _ = n[9] : (_ = [f], n[8] = f, n[9] = _), (0, L.useEffect)(g, _);
	let v;
	if (n[10] !== r || n[11] !== o || n[12] !== f.atlases || n[13] !== f.generation) {
		let e;
		n[15] !== r || n[16] !== o || n[17] !== f.generation ? (e = (e) => /* @__PURE__ */ (0, R.jsx)(Aw, {
			atlas: e,
			defs: r,
			mounted: o
		}, Iw(e, f.generation)), n[15] = r, n[16] = o, n[17] = f.generation, n[18] = e) : e = n[18], v = f.atlases.map(e), n[10] = r, n[11] = o, n[12] = f.atlases, n[13] = f.generation, n[14] = v;
	} else v = n[14];
	let y;
	return n[19] === v ? y = n[20] : (y = /* @__PURE__ */ (0, R.jsx)(R.Fragment, { children: v }), n[19] = v, n[20] = y), y;
}
function Ow(e) {
	return e.invalidate;
}
function kw(e) {
	return e.gl;
}
function Aw(e) {
	var t;
	let n = (0, U.c)(32), { atlas: r, defs: i } = e, a = (t = e.mounted) == null ? r.images.length : t, o;
	n[0] === r.image ? o = n[1] : (o = () => Bw(r.image), n[0] = r.image, n[1] = o);
	let [s] = (0, L.useState)(o), c = xt(jw), l = $b((0, L.use)(Qb), r), u;
	n[2] === Symbol.for("react.memo_cache_sentinel") ? (u = {}, n[2] = u) : u = n[2];
	let d = (0, L.useRef)(u), f, p;
	n[3] !== c || n[4] !== s ? (f = () => (c(), () => s.dispose()), p = [s, c], n[3] = c, n[4] = s, n[5] = f, n[6] = p) : (f = n[5], p = n[6]), (0, L.useEffect)(f, p);
	let m;
	n[7] !== r.image || n[8] !== l || n[9] !== c || n[10] !== s ? (m = () => {
		Rw(s, r.image, d, l), c();
	}, n[7] = r.image, n[8] = l, n[9] = c, n[10] = s, n[11] = m) : m = n[11];
	let h;
	n[12] !== r || n[13] !== l || n[14] !== c || n[15] !== s ? (h = [
		s,
		r,
		l,
		c
	], n[12] = r, n[13] = l, n[14] = c, n[15] = s, n[16] = h) : h = n[16], (0, L.useEffect)(m, h);
	let g, _;
	n[17] === Symbol.for("react.memo_cache_sentinel") ? (g = () => {
		let e = d.current;
		return () => zw(e);
	}, _ = [], n[17] = g, n[18] = _) : (g = n[17], _ = n[18]), (0, L.useEffect)(g, _);
	let v;
	n[19] === r.images ? v = n[20] : (v = () => Nw(r.images), n[19] = r.images, n[20] = v);
	let [y, b] = (0, L.useState)(v), x;
	n[21] === r.images ? x = n[22] : (x = function() {
		b(() => Nw(r.images));
	}, n[21] = r.images, n[22] = x);
	let S = x, C;
	n[23] !== r.images || n[24] !== i || n[25] !== a || n[26] !== y || n[27] !== S || n[28] !== s ? (C = Pw.map((e, t) => {
		let n = y[e];
		return n.length === 0 ? null : /* @__PURE__ */ (0, R.jsx)(Mw, {
			kind: e,
			placements: n,
			defs: i,
			mounted: a,
			capacity: r.images.length,
			texture: s,
			renderOrder: t,
			onKindMismatch: S
		}, e);
	}), n[23] = r.images, n[24] = i, n[25] = a, n[26] = y, n[27] = S, n[28] = s, n[29] = C) : C = n[29];
	let w;
	return n[30] === C ? w = n[31] : (w = /* @__PURE__ */ (0, R.jsx)(R.Fragment, { children: C }), n[30] = C, n[31] = w), w;
}
function jw(e) {
	return e.invalidate;
}
function Mw(e) {
	var t;
	let n = (0, U.c)(16), { kind: r, placements: i, defs: a, capacity: o, texture: s, renderOrder: c, onKindMismatch: l } = e, u = (t = e.mounted) == null ? i.length : t, d;
	n[0] === o ? d = n[1] : (d = () => new mw(o), n[0] = o, n[1] = d);
	let f = CS(d, a, l), p;
	n[2] !== f || n[3] !== r || n[4] !== c || n[5] !== s ? (p = r === "sprite" ? /* @__PURE__ */ (0, R.jsx)(pS, {
		args: f.args,
		ref: (e) => f.bind(e),
		sortObjects: !0,
		customSort: f.customSort,
		perObjectFrustumCulled: !0,
		renderOrder: c,
		children: /* @__PURE__ */ (0, R.jsx)(CC, {
			map: s,
			uvOffset: pw
		})
	}) : /* @__PURE__ */ (0, R.jsxs)(Wx, {
		args: f.args,
		ref: (e) => f.bind(e),
		sortObjects: !0,
		customSort: f.customSort,
		perObjectFrustumCulled: !0,
		renderOrder: c,
		children: [/* @__PURE__ */ (0, R.jsx)("planeGeometry", {}), /* @__PURE__ */ (0, R.jsx)(CC, {
			map: s,
			uvOffset: pw
		})]
	}), n[2] = f, n[3] = r, n[4] = c, n[5] = s, n[6] = p) : p = n[6];
	let m = p, h;
	if (n[7] !== f || n[8] !== u || n[9] !== i) {
		let e;
		n[11] === f ? e = n[12] : (e = (e) => /* @__PURE__ */ (0, R.jsx)(_w, {
			def: e.def,
			packed: e,
			container: f
		}, `${jS(e.def)}:${e.uv.u0}:${e.uv.v0}`), n[11] = f, n[12] = e), h = i.slice(0, u).map(e), n[7] = f, n[8] = u, n[9] = i, n[10] = h;
	} else h = n[10];
	let g;
	return n[13] !== m || n[14] !== h ? (g = /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [m, h] }), n[13] = m, n[14] = h, n[15] = g) : g = n[15], g;
}
function Nw(e) {
	let t = [], n = [];
	for (let r of e) (r.def.screenSpace === !0 ? n : t).push(r);
	return {
		flat: t,
		sprite: n
	};
}
var Pw = ["flat", "sprite"];
function Fw(e, t) {
	if (e.length !== t.length) return !1;
	let n = new Set(e);
	return t.every((e) => n.has(e));
}
function Iw(e, t) {
	let n = e.images[0], r = n.source ? `:${n.source.x},${n.source.y}` : "";
	return `${t}:${jS(n.def)}:${n.uv.u0}:${n.uv.v0}${r}`;
}
function Lw(e) {
	for (let t of e) "close" in t.image && t.image.close();
}
function Rw(e, t, n, r) {
	var i, a, o;
	let s = n.current;
	if (r >= 1) {
		e.image !== t && (zw(s), e.image = t, e.needsUpdate = !0);
		return;
	}
	let c = Math.max(1, Math.round(t.width * r)), l = Math.max(1, Math.round(t.height * r)), u = (i = s.canvas) == null ? s.canvas = NC(c, l) : i;
	u.width = c, u.height = l;
	let d = zC(u);
	if (!d) {
		zw(s), e.image = t, e.needsUpdate = !0;
		return;
	}
	d.drawImage(t, 0, 0, c, l), (a = s.bitmap) == null || a.close(), s.bitmap = "transferToImageBitmap" in u ? u.transferToImageBitmap() : void 0, e.image = (o = s.bitmap) == null ? u : o, e.needsUpdate = !0;
}
function zw(e) {
	var t;
	(t = e.bitmap) == null || t.close(), e.bitmap = void 0;
}
function Bw(e) {
	let t = new Ne(e);
	return t.colorSpace = kt, t.flipY = !1, t.premultiplyAlpha = !0, t.generateMipmaps = !0, t;
}
var Vw = {
	defs: [],
	atlases: [],
	generation: 0
};
tt.line = {
	worldUnits: { value: 1 },
	linewidth: { value: 1 },
	resolution: { value: new gt() },
	dashOffset: { value: 0 },
	dashScale: { value: 1 },
	dashSize: { value: 1 },
	gapSize: { value: 1 }
}, Cn.line = {
	uniforms: on.merge([
		tt.common,
		tt.fog,
		tt.line
	]),
	vertexShader: "\n		#include <common>\n		#include <color_pars_vertex>\n		#include <fog_pars_vertex>\n		#include <logdepthbuf_pars_vertex>\n		#include <clipping_planes_pars_vertex>\n\n		uniform float linewidth;\n		uniform vec2 resolution;\n\n		attribute vec3 instanceStart;\n		attribute vec3 instanceEnd;\n\n		attribute vec3 instanceColorStart;\n		attribute vec3 instanceColorEnd;\n\n		#ifdef WORLD_UNITS\n\n			varying vec4 worldPos;\n			varying vec3 worldStart;\n			varying vec3 worldEnd;\n\n			#ifdef USE_DASH\n\n				varying vec2 vUv;\n\n			#endif\n\n		#else\n\n			varying vec2 vUv;\n\n		#endif\n\n		#ifdef USE_DASH\n\n			uniform float dashScale;\n			attribute float instanceDistanceStart;\n			attribute float instanceDistanceEnd;\n			varying float vLineDistance;\n\n		#endif\n\n		float trimSegmentAlpha( const in vec4 start, const in vec4 end ) {\n\n			// compute the interpolation factor needed to trim the segment so it terminates\n			// between the camera plane and the near plane\n\n			// conservative estimate of the near plane\n			float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n			float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\n			// we need different nearEstimate formula for reversed and default depth buffer\n			// a is positive with a reversed depth buffer so it can be used for controlling the code flow\n			float nearEstimate = ( a > 0.0 ) ? ( - b / ( a + 1.0 ) ) : ( - 0.5 * b / a );\n\n			return ( nearEstimate - start.z ) / ( end.z - start.z );\n\n		}\n\n		void main() {\n\n			#ifdef USE_COLOR\n\n				vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n			#endif\n\n			float aspect = resolution.x / resolution.y;\n\n			// camera space\n			vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n			vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n			#ifdef USE_DASH\n\n				float lineDistanceStart = dashScale * instanceDistanceStart;\n				float lineDistanceEnd = dashScale * instanceDistanceEnd;\n\n			#endif\n\n			#ifdef WORLD_UNITS\n\n				worldStart = start.xyz;\n				worldEnd = end.xyz;\n\n			#else\n\n				vUv = uv;\n\n			#endif\n\n			// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n			// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n			// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n			// perhaps there is a more elegant solution -- WestLangley\n\n			bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n			if ( perspective ) {\n\n				if ( start.z < 0.0 && end.z >= 0.0 ) {\n\n					float alpha = trimSegmentAlpha( start, end );\n					end.xyz = mix( start.xyz, end.xyz, alpha );\n\n					#ifdef USE_DASH\n\n						lineDistanceEnd = mix( lineDistanceStart, lineDistanceEnd, alpha );\n\n					#endif\n\n				} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n					float alpha = trimSegmentAlpha( end, start );\n					start.xyz = mix( end.xyz, start.xyz, alpha );\n\n					#ifdef USE_DASH\n\n						lineDistanceStart = mix( lineDistanceEnd, lineDistanceStart, alpha );\n\n					#endif\n\n				}\n\n			}\n\n			#ifdef USE_DASH\n\n				vLineDistance = ( position.y < 0.5 ) ? lineDistanceStart : lineDistanceEnd;\n				vUv = uv;\n\n			#endif\n\n			// clip space\n			vec4 clipStart = projectionMatrix * start;\n			vec4 clipEnd = projectionMatrix * end;\n\n			// ndc space\n			vec3 ndcStart = clipStart.xyz / clipStart.w;\n			vec3 ndcEnd = clipEnd.xyz / clipEnd.w;\n\n			// direction\n			vec2 dir = ndcEnd.xy - ndcStart.xy;\n\n			// account for clip-space aspect ratio\n			dir.x *= aspect;\n			dir = normalize( dir );\n\n			#ifdef WORLD_UNITS\n\n				vec3 worldDir = normalize( end.xyz - start.xyz );\n				vec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) );\n				vec3 worldUp = normalize( cross( worldDir, tmpFwd ) );\n				vec3 worldFwd = cross( worldDir, worldUp );\n				worldPos = position.y < 0.5 ? start: end;\n\n				// height offset\n				float hw = linewidth * 0.5;\n				worldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp;\n\n				// don't extend the line if we're rendering dashes because we\n				// won't be rendering the endcaps\n				#ifndef USE_DASH\n\n					// cap extension\n					worldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir;\n\n					// add width to the box\n					worldPos.xyz += worldFwd * hw;\n\n					// endcaps\n					if ( position.y > 1.0 || position.y < 0.0 ) {\n\n						worldPos.xyz -= worldFwd * 2.0 * hw;\n\n					}\n\n				#endif\n\n				// project the worldpos\n				vec4 clip = projectionMatrix * worldPos;\n\n				// shift the depth of the projected points so the line\n				// segments overlap neatly\n				vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;\n				clip.z = clipPose.z * clip.w;\n\n			#else\n\n				vec2 offset = vec2( dir.y, - dir.x );\n				// undo aspect ratio adjustment\n				dir.x /= aspect;\n				offset.x /= aspect;\n\n				// sign flip\n				if ( position.x < 0.0 ) offset *= - 1.0;\n\n				// endcaps\n				if ( position.y < 0.0 ) {\n\n					offset += - dir;\n\n				} else if ( position.y > 1.0 ) {\n\n					offset += dir;\n\n				}\n\n				// adjust for linewidth\n				offset *= linewidth;\n\n				// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n				offset /= resolution.y;\n\n				// select end\n				vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n				// back to clip space\n				offset *= clip.w;\n\n				clip.xy += offset;\n\n			#endif\n\n			gl_Position = clip;\n\n			vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n			#include <logdepthbuf_vertex>\n			#include <clipping_planes_vertex>\n			#include <fog_vertex>\n\n		}\n		",
	fragmentShader: "\n		uniform vec3 diffuse;\n		uniform float opacity;\n		uniform float linewidth;\n\n		#ifdef USE_DASH\n\n			uniform float dashOffset;\n			uniform float dashSize;\n			uniform float gapSize;\n\n		#endif\n\n		varying float vLineDistance;\n\n		#ifdef WORLD_UNITS\n\n			varying vec4 worldPos;\n			varying vec3 worldStart;\n			varying vec3 worldEnd;\n\n			#ifdef USE_DASH\n\n				varying vec2 vUv;\n\n			#endif\n\n		#else\n\n			varying vec2 vUv;\n\n		#endif\n\n		#include <common>\n		#include <color_pars_fragment>\n		#include <fog_pars_fragment>\n		#include <logdepthbuf_pars_fragment>\n		#include <clipping_planes_pars_fragment>\n\n		vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {\n\n			float mua;\n			float mub;\n\n			vec3 p13 = p1 - p3;\n			vec3 p43 = p4 - p3;\n\n			vec3 p21 = p2 - p1;\n\n			float d1343 = dot( p13, p43 );\n			float d4321 = dot( p43, p21 );\n			float d1321 = dot( p13, p21 );\n			float d4343 = dot( p43, p43 );\n			float d2121 = dot( p21, p21 );\n\n			float denom = d2121 * d4343 - d4321 * d4321;\n\n			float numer = d1343 * d4321 - d1321 * d4343;\n\n			mua = numer / denom;\n			mua = clamp( mua, 0.0, 1.0 );\n			mub = ( d1343 + d4321 * ( mua ) ) / d4343;\n			mub = clamp( mub, 0.0, 1.0 );\n\n			return vec2( mua, mub );\n\n		}\n\n		void main() {\n\n			float alpha = opacity;\n			vec4 diffuseColor = vec4( diffuse, alpha );\n\n			#include <clipping_planes_fragment>\n\n			#ifdef USE_DASH\n\n				if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n				if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n			#endif\n\n			#ifdef WORLD_UNITS\n\n				// Find the closest points on the view ray and the line segment\n				vec3 rayEnd = normalize( worldPos.xyz ) * 1e5;\n				vec3 lineDir = worldEnd - worldStart;\n				vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );\n\n				vec3 p1 = worldStart + lineDir * params.x;\n				vec3 p2 = rayEnd * params.y;\n				vec3 delta = p1 - p2;\n				float len = length( delta );\n				float norm = len / linewidth;\n\n				#ifndef USE_DASH\n\n					#ifdef USE_ALPHA_TO_COVERAGE\n\n						float dnorm = fwidth( norm );\n						alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );\n\n					#else\n\n						if ( norm > 0.5 ) {\n\n							discard;\n\n						}\n\n					#endif\n\n				#endif\n\n			#else\n\n				#ifdef USE_ALPHA_TO_COVERAGE\n\n					// artifacts appear on some hardware if a derivative is taken within a conditional\n					float a = vUv.x;\n					float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n					float len2 = a * a + b * b;\n					float dlen = fwidth( len2 );\n\n					if ( abs( vUv.y ) > 1.0 ) {\n\n						alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n					}\n\n				#else\n\n					if ( abs( vUv.y ) > 1.0 ) {\n\n						float a = vUv.x;\n						float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n						float len2 = a * a + b * b;\n\n						if ( len2 > 1.0 ) discard;\n\n					}\n\n				#endif\n\n			#endif\n\n			#include <logdepthbuf_fragment>\n			#include <color_fragment>\n\n			gl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n			#include <tonemapping_fragment>\n			#include <colorspace_fragment>\n			#include <fog_fragment>\n			#include <premultiplied_alpha_fragment>\n\n		}\n		"
};
var Hw = class extends $t {
	constructor(e) {
		super({
			type: "LineMaterial",
			uniforms: on.clone(Cn.line.uniforms),
			vertexShader: Cn.line.vertexShader,
			fragmentShader: Cn.line.fragmentShader,
			clipping: !0
		}), this.isLineMaterial = !0, this.setValues(e);
	}
	get color() {
		return this.uniforms.diffuse.value;
	}
	set color(e) {
		this.uniforms.diffuse.value = e;
	}
	get worldUnits() {
		return "WORLD_UNITS" in this.defines;
	}
	set worldUnits(e) {
		e === !0 !== this.worldUnits && (this.needsUpdate = !0), e === !0 ? this.defines.WORLD_UNITS = "" : delete this.defines.WORLD_UNITS;
	}
	get linewidth() {
		return this.uniforms.linewidth.value;
	}
	set linewidth(e) {
		this.uniforms.linewidth && (this.uniforms.linewidth.value = e);
	}
	get dashed() {
		return "USE_DASH" in this.defines;
	}
	set dashed(e) {
		e === !0 !== this.dashed && (this.needsUpdate = !0), e === !0 ? this.defines.USE_DASH = "" : delete this.defines.USE_DASH;
	}
	get dashScale() {
		return this.uniforms.dashScale.value;
	}
	set dashScale(e) {
		this.uniforms.dashScale.value = e;
	}
	get dashSize() {
		return this.uniforms.dashSize.value;
	}
	set dashSize(e) {
		this.uniforms.dashSize.value = e;
	}
	get dashOffset() {
		return this.uniforms.dashOffset.value;
	}
	set dashOffset(e) {
		this.uniforms.dashOffset.value = e;
	}
	get gapSize() {
		return this.uniforms.gapSize.value;
	}
	set gapSize(e) {
		this.uniforms.gapSize.value = e;
	}
	get opacity() {
		return this.uniforms.opacity.value;
	}
	set opacity(e) {
		this.uniforms && (this.uniforms.opacity.value = e);
	}
	get resolution() {
		return this.uniforms.resolution.value;
	}
	set resolution(e) {
		this.uniforms.resolution.value.copy(e);
	}
	get alphaToCoverage() {
		return "USE_ALPHA_TO_COVERAGE" in this.defines;
	}
	set alphaToCoverage(e) {
		this.defines && (e === !0 !== this.alphaToCoverage && (this.needsUpdate = !0), e === !0 ? this.defines.USE_ALPHA_TO_COVERAGE = "" : delete this.defines.USE_ALPHA_TO_COVERAGE);
	}
}, Uw = new Ve(), Ww = new I(), Gw = class extends pt {
	constructor() {
		super(), this.isLineSegmentsGeometry = !0, this.type = "LineSegmentsGeometry", this.setIndex([
			0,
			2,
			1,
			2,
			3,
			1,
			2,
			4,
			3,
			4,
			5,
			3,
			4,
			6,
			5,
			6,
			7,
			5
		]), this.setAttribute("position", new ke([
			-1,
			2,
			0,
			1,
			2,
			0,
			-1,
			1,
			0,
			1,
			1,
			0,
			-1,
			0,
			0,
			1,
			0,
			0,
			-1,
			-1,
			0,
			1,
			-1,
			0
		], 3)), this.setAttribute("uv", new ke([
			-1,
			2,
			1,
			2,
			-1,
			1,
			1,
			1,
			-1,
			-1,
			1,
			-1,
			-1,
			-2,
			1,
			-2
		], 2));
	}
	applyMatrix4(e) {
		let t = this.attributes.instanceStart, n = this.attributes.instanceEnd;
		return t !== void 0 && (t.applyMatrix4(e), n.applyMatrix4(e), t.needsUpdate = !0), this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this;
	}
	setPositions(e) {
		let t;
		e instanceof Float32Array ? t = e : Array.isArray(e) && (t = new Float32Array(e));
		let n = new F(t, 6, 1);
		return this.setAttribute("instanceStart", new en(n, 3, 0)), this.setAttribute("instanceEnd", new en(n, 3, 3)), this.instanceCount = this.attributes.instanceStart.count, this.computeBoundingBox(), this.computeBoundingSphere(), this;
	}
	setColors(e) {
		let t;
		e instanceof Float32Array ? t = e : Array.isArray(e) && (t = new Float32Array(e));
		let n = new F(t, 6, 1);
		return this.setAttribute("instanceColorStart", new en(n, 3, 0)), this.setAttribute("instanceColorEnd", new en(n, 3, 3)), this;
	}
	fromWireframeGeometry(e) {
		return this.setPositions(e.attributes.position.array), this;
	}
	fromEdgesGeometry(e) {
		return this.setPositions(e.attributes.position.array), this;
	}
	fromMesh(e) {
		return this.fromWireframeGeometry(new $e(e.geometry)), this;
	}
	fromLineSegments(e) {
		let t = e.geometry;
		return this.setPositions(t.attributes.position.array), this;
	}
	computeBoundingBox() {
		this.boundingBox === null && (this.boundingBox = new Ve());
		let e = this.attributes.instanceStart, t = this.attributes.instanceEnd;
		e !== void 0 && t !== void 0 && (this.boundingBox.setFromBufferAttribute(e), Uw.setFromBufferAttribute(t), this.boundingBox.union(Uw));
	}
	computeBoundingSphere() {
		this.boundingSphere === null && (this.boundingSphere = new nn()), this.boundingBox === null && this.computeBoundingBox();
		let e = this.attributes.instanceStart, t = this.attributes.instanceEnd;
		if (e !== void 0 && t !== void 0) {
			let n = this.boundingSphere.center;
			this.boundingBox.getCenter(n);
			let r = 0;
			for (let i = 0, a = e.count; i < a; i++) Ww.fromBufferAttribute(e, i), r = Math.max(r, n.distanceToSquared(Ww)), Ww.fromBufferAttribute(t, i), r = Math.max(r, n.distanceToSquared(Ww));
			this.boundingSphere.radius = Math.sqrt(r), isNaN(this.boundingSphere.radius) && console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.", this);
		}
	}
	toJSON() {}
}, Kw = class extends _x {
	instanceSphere(e, t, n, r) {
		let i = super.instanceSphere(e, t, n, r);
		return i.radius += this.drawnMargin(e, t, n, i), i;
	}
	drawnMargin(e, t, n, r) {
		var i;
		let a = e.material, o = e.getWidthAt(t), s = o < 0 ? a.linewidth : o;
		if (s <= 0) return 0;
		if (a.worldUnits) return s / 2;
		if (a.resolution.x === 0) return 0;
		Jw.copy(r.center).applyMatrix4(e.matrixWorld);
		let c = (i = n.near) == null ? 0 : i, l = Yw.setFromMatrixPosition(n.matrixWorld).distanceTo(Jw);
		return qw(n, Math.max(c, l + r.radius), s, a);
	}
};
function qw(e, t, n, r) {
	let i = r.resolution;
	return Xw.set(0, 0, -t, 1).applyMatrix4(e.projectionMatrix), Xw.multiplyScalar(1 / Xw.w), Xw.x = n / i.width, Xw.y = n / i.height, Xw.applyMatrix4(e.projectionMatrixInverse), Xw.multiplyScalar(1 / Xw.w), Math.abs(Math.max(Xw.x, Xw.y));
}
var Jw = new I(), Yw = new I(), Xw = new kn(), Zw = "instanceStart", Qw = "instanceEnd", $w = "lineWidth";
function eT(e) {
	tT(e);
	let t = e.onBeforeCompile, n = e.customProgramCacheKey;
	return e.customProgramCacheKey = () => `efpLine_${n.call(e)}`, e.onBeforeCompile = (n, r) => {
		nT(n), t.call(e, n, r);
	}, () => {
		e.onBeforeCompile = t, e.customProgramCacheKey = n;
	};
}
function tT(e) {
	e.vertexShader.includes(oT) || (e.vertexShader = Sy(e.vertexShader, oT));
}
function nT(e) {
	let t = e.vertexShader;
	if (!t.includes("lineWidth")) return !1;
	let n = `
    float materialLineWidth = linewidth;
    float linewidth = ${$w} < 0.0 ? materialLineWidth : ${$w};
  `;
	return e.vertexShader = Cy(t.replace(rT, ""), iT, `${n}\n${iT}`), e.fragmentShader = Cy(e.fragmentShader, aT, "gl_FragColor = vec4( diffuseColor.rgb, alpha * vColor.a );"), !0;
}
var rT = RegExp(`attribute\\s+vec3\\s+${Zw}\\s*;\\s*attribute\\s+vec3\\s+${Qw}\\s*;`), iT = "float aspect = resolution.x / resolution.y;", aT = "gl_FragColor = vec4( diffuseColor.rgb, alpha );", oT = "#include <color_vertex>", sT = new kn(), cT = new I(), lT = new I(), uT = new kn(), dT = new kn(), fT = new kn(), pT = new I(), mT = new Ct(), hT = new hn(), gT = new I(), _T = new Ve(), vT = new nn(), yT = new kn(), bT, xT;
function ST(e, t, n) {
	return yT.set(0, 0, -t, 1).applyMatrix4(e.projectionMatrix), yT.multiplyScalar(1 / yT.w), yT.x = xT / n.width, yT.y = xT / n.height, yT.applyMatrix4(e.projectionMatrixInverse), yT.multiplyScalar(1 / yT.w), Math.abs(Math.max(yT.x, yT.y));
}
function CT(e, t) {
	let n = e.matrixWorld, r = e.geometry, i = r.attributes.instanceStart, a = r.attributes.instanceEnd, o = Math.min(r.instanceCount, i.count);
	for (let r = 0, s = o; r < s; r++) {
		hT.start.fromBufferAttribute(i, r), hT.end.fromBufferAttribute(a, r), hT.applyMatrix4(n);
		let o = new I(), s = new I();
		bT.distanceSqToSegment(hT.start, hT.end, s, o), s.distanceTo(o) < xT * .5 && t.push({
			point: s,
			pointOnLine: o,
			distance: bT.origin.distanceTo(s),
			object: e,
			face: null,
			faceIndex: r,
			uv: null,
			uv1: null
		});
	}
}
function wT(e, t, n) {
	let r = t.projectionMatrix, i = e.material.resolution, a = e.matrixWorld, o = e.geometry, s = o.attributes.instanceStart, c = o.attributes.instanceEnd, l = Math.min(o.instanceCount, s.count), u = -t.near;
	bT.at(1, fT), fT.w = 1, fT.applyMatrix4(t.matrixWorldInverse), fT.applyMatrix4(r), fT.multiplyScalar(1 / fT.w), fT.x *= i.x / 2, fT.y *= i.y / 2, fT.z = 0, pT.copy(fT), mT.multiplyMatrices(t.matrixWorldInverse, a);
	for (let t = 0, o = l; t < o; t++) {
		if (uT.fromBufferAttribute(s, t), dT.fromBufferAttribute(c, t), uT.w = 1, dT.w = 1, uT.applyMatrix4(mT), dT.applyMatrix4(mT), uT.z > u && dT.z > u) continue;
		if (uT.z > u) {
			let e = uT.z - dT.z, t = (uT.z - u) / e;
			uT.lerp(dT, t);
		} else if (dT.z > u) {
			let e = dT.z - uT.z, t = (dT.z - u) / e;
			dT.lerp(uT, t);
		}
		uT.applyMatrix4(r), dT.applyMatrix4(r), uT.multiplyScalar(1 / uT.w), dT.multiplyScalar(1 / dT.w), uT.x *= i.x / 2, uT.y *= i.y / 2, dT.x *= i.x / 2, dT.y *= i.y / 2, hT.start.copy(uT), hT.start.z = 0, hT.end.copy(dT), hT.end.z = 0;
		let o = hT.closestPointToPointParameter(pT, !0);
		hT.at(o, gT);
		let l = Sn.lerp(uT.z, dT.z, o), d = l >= -1 && l <= 1, f = pT.distanceTo(gT) < xT * .5;
		if (d && f) {
			hT.start.fromBufferAttribute(s, t), hT.end.fromBufferAttribute(c, t), hT.start.applyMatrix4(a), hT.end.applyMatrix4(a);
			let r = new I(), i = new I();
			bT.distanceSqToSegment(hT.start, hT.end, i, r), n.push({
				point: i,
				pointOnLine: r,
				distance: bT.origin.distanceTo(i),
				object: e,
				face: null,
				faceIndex: t,
				uv: null,
				uv1: null
			});
		}
	}
}
var TT = class extends Dn {
	constructor(e = new Gw(), t = new Hw({ color: Math.random() * 16777215 })) {
		super(e, t), this.isLineSegments2 = !0, this.type = "LineSegments2";
	}
	computeLineDistances() {
		let e = this.geometry, t = e.attributes.instanceStart, n = e.attributes.instanceEnd, r = new Float32Array(2 * t.count);
		for (let e = 0, i = 0, a = t.count; e < a; e++, i += 2) cT.fromBufferAttribute(t, e), lT.fromBufferAttribute(n, e), r[i] = i === 0 ? 0 : r[i - 1], r[i + 1] = r[i] + cT.distanceTo(lT);
		let i = new F(r, 2, 1);
		return e.setAttribute("instanceDistanceStart", new en(i, 1, 0)), e.setAttribute("instanceDistanceEnd", new en(i, 1, 1)), this;
	}
	raycast(e, t) {
		let n = this.material.worldUnits, r = e.camera;
		if (r === null && !n && console.error("LineSegments2: \"Raycaster.camera\" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false."), n === !1 && (this.material.resolution.x === 0 || this.material.resolution.y === 0)) return;
		let i = e.params.Line2 === void 0 ? 0 : e.params.Line2.threshold || 0;
		bT = e.ray;
		let a = this.matrixWorld, o = this.geometry, s = this.material;
		xT = s.linewidth + i, o.boundingSphere === null && o.computeBoundingSphere(), vT.copy(o.boundingSphere).applyMatrix4(a);
		let c;
		if (c = n ? xT * .5 : ST(r, Math.max(r.near, vT.distanceToPoint(bT.origin)), s.resolution), vT.radius += c, bT.intersectsSphere(vT) === !1) return;
		o.boundingBox === null && o.computeBoundingBox(), _T.copy(o.boundingBox).applyMatrix4(a);
		let l;
		l = n ? xT * .5 : ST(r, Math.max(r.near, _T.distanceToPoint(bT.origin)), s.resolution), _T.expandByScalar(l), bT.intersectsBox(_T) !== !1 && (n ? CT(this, t) : wT(this, r, t));
	}
	onBeforeRender(e) {
		let t = this.material.uniforms;
		t && t.resolution && (e.getViewport(sT), this.material.uniforms.resolution.value.set(sT.z, sT.w));
	}
}, ET = class extends zx {
	prepareInstance(e, t) {
		e.getPointsAt(t, PT, FT), NT.set([
			PT.x,
			PT.y,
			PT.z,
			FT.x,
			FT.y,
			FT.z
		]), DT();
		let n = e.getWidthAt(t);
		return MT.linewidth = n < 0 ? e.material.linewidth : n, MT.worldUnits = e.material.worldUnits, MT.resolution.copy(e.material.resolution), jT.matrixWorld.copy(e.matrixWorld), jT;
	}
};
function DT() {
	var e, t;
	let n = jT.geometry, r = ((e = n.boundingBox) == null ? n.boundingBox = new Ve() : e).makeEmpty();
	r.expandByPoint(PT).expandByPoint(FT);
	let i = (t = n.boundingSphere) == null ? n.boundingSphere = new nn() : t;
	r.getCenter(i.center), i.radius = PT.distanceTo(FT) / 2;
}
function OT() {
	let e = new Gw();
	return e.setPositions(new Float32Array(AT)), e;
}
function kT(e) {
	return e.getAttribute("instanceStart").data.array;
}
var AT = 6, jT = new TT(OT(), new Hw()), MT = jT.material, NT = kT(jT.geometry), PT = new I(), FT = new I(), IT = jt(class extends Ux {
	constructor(e = {}) {
		super(e), this.isBatchedLines = !0, this.geometry = new Gw(), this.material = new Hw(), this.sortObjects = !0, this.raycasting = new ET(), this.culling = new Kw(), this.addUniforms({ vertex: {
			[Zw]: "vec3",
			[Qw]: "vec3",
			[$w]: "float"
		} });
	}
	getPointsAt(e, t, n) {
		this.getUniformAt(e, Zw, t), this.getUniformAt(e, Qw, n);
	}
	setPointsAt(e, t, n) {
		this.setUniformAt(e, Zw, VT.set(t.x, t.y, t.z)), this.setUniformAt(e, Qw, HT.set(n.x, n.y, n.z)), this.invalidateBounds();
	}
	getWidthAt(e) {
		return this.getUniformAt(e, $w);
	}
	setWidthAt(e, t) {
		this.setUniformAt(e, $w, t);
	}
	getBoundingSphereAt(e, t) {
		return this.getPointsAt(e, VT, HT), t.center.addVectors(VT, HT).multiplyScalar(.5), t.radius = VT.distanceTo(HT) / 2, t;
	}
	getBoundingBoxAt(e, t) {
		return this.getPointsAt(e, VT, HT), t.makeEmpty().expandByPoint(VT).expandByPoint(HT);
	}
	dispose() {
		super.dispose(), this.geometry.dispose();
	}
	resetInstance(e) {
		super.resetInstance(e), this.setPointsAt(e, BT, BT), this.setWidthAt(e, RT), this.setColorAt(e, zT);
	}
	onBeforeRender(e, t, n, r, i, a) {
		e.getViewport(UT), this.material.resolution.set(UT.z, UT.w), super.onBeforeRender(e, t, n, r, i, a);
	}
	patchMaterial(e) {
		if (!LT(e)) return super.patchMaterial(e);
		let t = eT(e), n = super.patchMaterial(e);
		return () => {
			n(), t();
		};
	}
});
function LT(e) {
	return e.isLineMaterial === !0;
}
var RT = -1, zT = new kn(1, 1, 1, 1), BT = new I(), VT = new I(), HT = new I(), UT = new kn(), WT = 255, GT = jt(Hw);
function KT(e) {
	var t, n;
	let r = (0, U.c)(6), i = (t = e.color) == null ? "white" : t, a = (n = e.width) == null ? 1 : n, o = sb(), s = Oy(), c;
	r[0] === Symbol.for("react.memo_cache_sentinel") ? (c = function(e) {
		e.clearStencil();
	}, r[0] = c) : c = r[0];
	let l = c, u = s ? zb : null, d;
	return r[1] !== i || r[2] !== o || r[3] !== u || r[4] !== a ? (d = /* @__PURE__ */ (0, R.jsx)(GT, {
		...Rb,
		...u,
		color: i,
		linewidth: a,
		stencilWrite: !0,
		stencilFunc: 517,
		stencilZPass: ge,
		stencilRef: WT,
		onBeforeRender: l,
		onBeforeCompile: o
	}), r[1] = i, r[2] = o, r[3] = u, r[4] = a, r[5] = d) : d = r[5], d;
}
//#endregion
//#region ../renderer/src/objects/lines/line-container.ts
var qT = class extends SC {
	constructor(e) {
		super({ reverse: !0 }), this.args = void 0, this.args = [{ capacity: Math.max(e.length, 1) }];
	}
	addInstance() {
		let e = -1;
		return this.mesh.addInstances(1, (t) => {
			e = t;
		}), e;
	}
	removeInstance(e) {
		this.mesh.removeInstances(e);
	}
}, JT = Xm("line-instance"), YT = (0, L.memo)(function(e) {
	let t = (0, U.c)(3), { def: n, container: r } = e, i;
	return t[0] !== r || t[1] !== n ? (i = (e) => {
		XT(r, e, n), fC(r.mesh, e, n, JT), ZT(r, e, n);
	}, t[0] = r, t[1] = n, t[2] = i) : i = t[2], TS(r, n, null, i), null;
});
function XT(e, t, n) {
	let { p0: r, p1: i, elevation: a = 0 } = n.points;
	QT.set(r.x, r.y, a), $T.set(i.x, i.y, a), e.mesh.getPointsAt(t, eE, tE), !(eE.equals(QT) && tE.equals($T)) && e.mesh.setPointsAt(t, QT, $T);
}
function ZT(e, t, n) {
	let r = Math.max(n.width, 0);
	e.mesh.getWidthAt(t) !== r && e.mesh.setWidthAt(t, r);
}
var QT = new I(), $T = new I(), eE = new I(), tE = new I();
//#endregion
//#region ../renderer/src/objects/lines/Lines.tsx
function nE(e) {
	var t;
	let n = (0, U.c)(18), { defs: r } = e, i = (t = e.mounted) == null ? r.length : t, a;
	n[0] === r ? a = n[1] : (a = () => new qT(r), n[0] = r, n[1] = a);
	let o = CS(a, r), s;
	n[2] === o ? s = n[3] : (s = (e) => o.bind(e), n[2] = o, n[3] = s);
	let c;
	n[4] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ (0, R.jsx)(KT, {}), n[4] = c) : c = n[4];
	let l;
	n[5] !== o.args || n[6] !== o.customSort || n[7] !== s ? (l = /* @__PURE__ */ (0, R.jsx)(IT, {
		args: o.args,
		ref: s,
		customSort: o.customSort,
		children: c
	}), n[5] = o.args, n[6] = o.customSort, n[7] = s, n[8] = l) : l = n[8];
	let u;
	if (n[9] !== o || n[10] !== r || n[11] !== i) {
		let e;
		n[13] === o ? e = n[14] : (e = (e) => /* @__PURE__ */ (0, R.jsx)(YT, {
			def: e,
			container: o
		}, jS(e)), n[13] = o, n[14] = e), u = r.slice(0, i).map(e), n[9] = o, n[10] = r, n[11] = i, n[12] = u;
	} else u = n[12];
	let d;
	return n[15] !== l || n[16] !== u ? (d = /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [l, u] }), n[15] = l, n[16] = u, n[17] = d) : d = n[17], d;
}
//#endregion
//#region ../renderer/src/utils/arrays.ts
function rE(e, t) {
	if (e.length !== t.length) return !1;
	for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
	return !0;
}
//#endregion
//#region ../renderer/src/objects/lighting/occluder.ts
function iE() {
	let e = (0, U.c)(2), t = Ib(), n = (0, L.useRef)(null), r;
	return e[0] === t.occluders ? r = e[1] : (r = (e) => aE(t.occluders, n, e), e[0] = t.occluders, e[1] = r), r;
}
function aE(e, t, n) {
	t.current !== n && (t.current && e.delete(t.current), t.current = n, n && (n.layers.enable(1), e.add(n)));
}
//#endregion
//#region ../renderer/src/objects/materials/ModelMaterial.tsx
function oE(e) {
	var t;
	let n = (0, U.c)(11), { source: r, opacityUniform: i } = e, a = sb(), o = Ib(), s = (t = e.translucent) != null && t, c;
	n[0] !== a || n[1] !== o || n[2] !== i || n[3] !== r || n[4] !== s ? (c = () => sE(r.clone(), i, a, o, s), n[0] = a, n[1] = o, n[2] = i, n[3] = r, n[4] = s, n[5] = c) : c = n[5];
	let [l] = (0, L.useState)(c), u, d;
	n[6] === l ? (u = n[7], d = n[8]) : (u = () => () => l.dispose(), d = [l], n[6] = l, n[7] = u, n[8] = d), (0, L.useEffect)(u, d);
	let f;
	return n[9] === l ? f = n[10] : (f = /* @__PURE__ */ (0, R.jsx)("primitive", {
		object: l,
		attach: "material"
	}), n[9] = l, n[10] = f), f;
}
function sE(e, t, n, r, i) {
	e.depthFunc = 3, e.polygonOffset = !1, e.transparent = e.transparent || i || e.opacity < 1, e.depthWrite = !0;
	let a = e.onBeforeCompile.bind(e);
	return e.onBeforeCompile = (e, ...i) => {
		a(e, ...i), e.fragmentShader = e.fragmentShader.replace("#include <dithering_fragment>", `
        #include <dithering_fragment>
        gl_FragColor.a *= ${t};
      `.trim()), bb(e, r), Jy(e, r), n(e);
	}, e.needsUpdate = !0, e;
}
//#endregion
//#region ../../node_modules/.pnpm/three@0.185.1/node_modules/three/examples/jsm/libs/meshopt_decoder.module.js
var cE = (function() {
	var e = "b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq:VZkdbk:XYi5ud9:du8Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCabaOad2fhXaAcethQaxaDfhiaOaeaoaeao6E9RhLalcl4cifcd4hKazcj;cbfaAfhYcbh8AazcjdfhEaHh3incbh5dnawTmbaxa8Acd4fRbbh5kcbh8Eazcj;cbfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcj;cbfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcj;cbfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaK6mva8FaKfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasa8Acd4fRbbgociGPlbedrbkaATmdaza8Afh8Fazcj;cbfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeaza8Afhaazcj;cbfhhcbhoceh8EaYh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaLaocefgofmbka8FaQfh8FcdhoaacdfhaahaQfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8Eaza8AfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaYhainazcj;cbfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3a8Aclfg8Aad6mbkaXazcjdfaAad2z:jjjjb8AazazcjdfaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaok:ysezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb", t = "b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:W9Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:JBl8Aud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fhOaPaDfhAasaeaH9RaHasfae6EgCcsfgocl4cifcd4hXavcj;cbfaoc9WGgQcetfhLavcj;cbfaQci2fhKavcj;cbfaQfhYcbh8Aaoc;ab6hEincbh3dnawTmbaPa8Acd4fRbbh3kcbh5avcj;cbfh8Eindndndndna3a5cet4ciGgoc9:fPdebdkaxaA9RaQ6mwdnaQTmbavcj;cbfa5aQ2faAaQ;8qbbkaAaCfhAxdkaQTmeavcj;cbfa5aQ2fcbaQ;8kbxekaxaA9RaX6moaoclVcbawEhraAaXfhocbhidnaEmbaxao9Rc;Gb6mbcbhlina8EalfhidndndndndndnaAalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaoclffagRb:q:W:cjbfhoxikaiaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaocwffagRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbahaocdffagRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaoclffagRb:q:W:cjbfhoxikaiczfaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaocwffagRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbahaocdffagRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaoclffagRb:q:W:cjbfhoxikaicafaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaocwffagRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbahaocdffagRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaQ0meaihlaxao9Rc;Fb0mbkkdnaiaQ9pmbaici4hlinaxao9RcK6mwa8EaifhqdndndndndndnaAaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spkbbahaoclffagRb:q:W:cjbfhoxikaqaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spkbbahaocwffagRb:q:W:cjbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpkbbahaocdffagRb:q:W:cjbfhokalcdfhlaiczfgiaQ6mbkkaohAaoTmoka8EaQfh8Ea5cefg5cl9hmbkdndndndnawTmbaza8Acd4fRbbglciGPlbedwbkaQTmdavcjdfa8Afhlava8Afpbdbh8Jcbhoinalavcj;cbfaofpblbg8KaYaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaLaofpblbg8NaKaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLg8Fcep9Ta8Fpxeeeeeeeeeeeeeeeegap9op9Hp9rg8Fa8Jp9Ug8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp9Ug8Jp9Abbbaladfgla8Ja8Ma8PpmwDKYqk8AExm35Ps8E8Fg8Fcep9Ta8Faap9op9Hp9rg8Fp9Ug8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp9Ug8Jp9Abbbaladfgla8Ja8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLg8Fcep9Ta8Faap9op9Hp9rg8Fp9Ug8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp9Ug8Jp9Abbbaladfgla8Ja8Ka8LpmwDKYqk8AExm35Ps8E8Fg8Fcep9Ta8Faap9op9Hp9rg8Fp9Ugap9Abbbaladfglaaa8Fa8Fpmlvorlvorlvorlvorp9Ugap9Abbbaladfglaaa8Fa8FpmwDqkwDqkwDqkwDqkp9Ugap9Abbbaladfglaaa8Fa8FpmxmPsxmPsxmPsxmPsp9Ug8Jp9AbbbaladfhlaoczfgoaQ6mbxikkaQTmeavcjdfa8Afhlava8Afpbdbh8Jcbhoinalavcj;cbfaofpblbg8KaYaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaLaofpblbg8NaKaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLg8Fcep:nea8Fpxebebebebebebebebgap9op:bep9rg8Fa8Jp:oeg8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp:oeg8Jp9Abbbaladfgla8Ja8Ma8PpmwDKYqk8AExm35Ps8E8Fg8Fcep:nea8Faap9op:bep9rg8Fp:oeg8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp:oeg8Jp9Abbbaladfgla8Ja8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLg8Fcep:nea8Faap9op:bep9rg8Fp:oeg8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp:oeg8Jp9Abbbaladfgla8Ja8Ka8LpmwDKYqk8AExm35Ps8E8Fg8Fcep:nea8Faap9op:bep9rg8Fp:oegap9Abbbaladfglaaa8Fa8Fpmlvorlvorlvorlvorp:oegap9Abbbaladfglaaa8Fa8FpmwDqkwDqkwDqkwDqkp:oegap9Abbbaladfglaaa8Fa8FpmxmPsxmPsxmPsxmPsp:oeg8Jp9AbbbaladfhlaoczfgoaQ6mbxdkkaQTmbcbhocbalcl4gl9Rc8FGhiavcjdfa8Afhrava8Afpbdbhainaravcj;cbfaofpblbg8JaYaofpblbg8KpmbzeHdOiAlCvXoQrLg8LaLaofpblbg8MaKaofpblbg8NpmbzeHdOiAlCvXoQrLgypmbezHdiOAlvCXorQLg8Faip:Rea8Falp:Tep9qg8Faap9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9Abbbaradfgraaa8LaypmwDKYqk8AExm35Ps8E8Fg8Faip:Rea8Falp:Tep9qg8Fp9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9Abbbaradfgraaa8Ja8KpmwKDYq8AkEx3m5P8Es8Fg8Ja8Ma8NpmwKDYq8AkEx3m5P8Es8Fg8KpmbezHdiOAlvCXorQLg8Faip:Rea8Falp:Tep9qg8Fp9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9Abbbaradfgraaa8Ja8KpmwDKYqk8AExm35Ps8E8Fg8Faip:Rea8Falp:Tep9qg8Fp9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9AbbbaradfhraoczfgoaQ6mbkka8Aclfg8Aad6mbkdnaCad2goTmbaOavcjdfao;8qbbkdnammbavavcjdfaCcufad2fad;8qbbkaCaHfhHc9:hoaAhPaAmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkNsezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb", n = new Uint8Array([
		0,
		97,
		115,
		109,
		1,
		0,
		0,
		0,
		1,
		4,
		1,
		96,
		0,
		0,
		3,
		3,
		2,
		0,
		0,
		5,
		3,
		1,
		0,
		1,
		12,
		1,
		0,
		10,
		22,
		2,
		12,
		0,
		65,
		0,
		65,
		0,
		65,
		0,
		252,
		10,
		0,
		0,
		11,
		7,
		0,
		65,
		0,
		253,
		15,
		26,
		11
	]), r = new Uint8Array([
		32,
		0,
		65,
		2,
		1,
		106,
		34,
		33,
		3,
		128,
		11,
		4,
		13,
		64,
		6,
		253,
		10,
		7,
		15,
		116,
		127,
		5,
		8,
		12,
		40,
		16,
		19,
		54,
		20,
		9,
		27,
		255,
		113,
		17,
		42,
		67,
		24,
		23,
		146,
		148,
		18,
		14,
		22,
		45,
		70,
		69,
		56,
		114,
		101,
		21,
		25,
		63,
		75,
		136,
		108,
		28,
		118,
		29,
		73,
		115
	]);
	if (typeof WebAssembly != "object") return { supported: !1 };
	var i = WebAssembly.validate(n) ? s(t) : s(e), a, o = WebAssembly.instantiate(i, {}).then(function(e) {
		a = e.instance, a.exports.__wasm_call_ctors();
	});
	function s(e) {
		for (var t = new Uint8Array(e.length), n = 0; n < e.length; ++n) {
			var i = e.charCodeAt(n);
			t[n] = i > 96 ? i - 97 : i > 64 ? i - 39 : i + 4;
		}
		for (var a = 0, n = 0; n < e.length; ++n) t[a++] = t[n] < 60 ? r[t[n]] : (t[n] - 60) * 64 + t[++n];
		return t.buffer.slice(0, a);
	}
	function c(e, t, n, r, i, a, o) {
		var s = e.exports.sbrk, c = r + 3 & -4, l = s(c * i), u = s(a.length), d = new Uint8Array(e.exports.memory.buffer);
		d.set(a, u);
		var f = t(l, r, i, u, a.length);
		if (f == 0 && o && o(l, c, i), n.set(d.subarray(l, l + r * i)), s(l - s(0)), f != 0) throw Error("Malformed buffer data: " + f);
	}
	var l = {
		NONE: "",
		OCTAHEDRAL: "meshopt_decodeFilterOct",
		QUATERNION: "meshopt_decodeFilterQuat",
		EXPONENTIAL: "meshopt_decodeFilterExp",
		COLOR: "meshopt_decodeFilterColor"
	}, u = {
		ATTRIBUTES: "meshopt_decodeVertexBuffer",
		TRIANGLES: "meshopt_decodeIndexBuffer",
		INDICES: "meshopt_decodeIndexSequence"
	}, d = [], f = 0;
	function p(e) {
		var t = {
			object: new Worker(e),
			pending: 0,
			requests: {}
		};
		return t.object.onmessage = function(e) {
			var n = e.data;
			t.pending -= n.count, t.requests[n.id][n.action](n.value), delete t.requests[n.id];
		}, t;
	}
	function m(e) {
		for (var t = "self.ready = WebAssembly.instantiate(new Uint8Array([" + new Uint8Array(i) + "]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = " + g.name + ";" + c.toString() + g.toString(), n = new Blob([t], { type: "text/javascript" }), r = URL.createObjectURL(n), a = d.length; a < e; ++a) d[a] = p(r);
		for (var a = e; a < d.length; ++a) d[a].object.postMessage({});
		d.length = e, URL.revokeObjectURL(r);
	}
	function h(e, t, n, r, i) {
		for (var a = d[0], o = 1; o < d.length; ++o) d[o].pending < a.pending && (a = d[o]);
		return new Promise(function(o, s) {
			var c = new Uint8Array(n), l = ++f;
			a.pending += e, a.requests[l] = {
				resolve: o,
				reject: s
			}, a.object.postMessage({
				id: l,
				count: e,
				size: t,
				source: c,
				mode: r,
				filter: i
			}, [c.buffer]);
		});
	}
	function g(e) {
		var t = e.data;
		self.ready.then(function(e) {
			if (!t.id) return self.close();
			try {
				var n = new Uint8Array(t.count * t.size);
				c(e, e.exports[t.mode], n, t.count, t.size, t.source, e.exports[t.filter]), self.postMessage({
					id: t.id,
					count: t.count,
					action: "resolve",
					value: n
				}, [n.buffer]);
			} catch (e) {
				self.postMessage({
					id: t.id,
					count: t.count,
					action: "reject",
					value: e
				});
			}
		});
	}
	return {
		ready: o,
		supported: !0,
		useWorkers: function(e) {
			m(e);
		},
		decodeVertexBuffer: function(e, t, n, r, i) {
			c(a, a.exports.meshopt_decodeVertexBuffer, e, t, n, r, a.exports[l[i]]);
		},
		decodeIndexBuffer: function(e, t, n, r) {
			c(a, a.exports.meshopt_decodeIndexBuffer, e, t, n, r);
		},
		decodeIndexSequence: function(e, t, n, r) {
			c(a, a.exports.meshopt_decodeIndexSequence, e, t, n, r);
		},
		decodeGltfBuffer: function(e, t, n, r, i, o) {
			c(a, a.exports[u[i]], e, t, n, r, a.exports[l[o]]);
		},
		decodeGltfBufferAsync: function(e, t, n, r, i) {
			return d.length > 0 ? h(e, t, n, u[r], l[i]) : o.then(function() {
				var o = new Uint8Array(e * t);
				return c(a, a.exports[u[r]], o, e, t, n, a.exports[l[i]]), o;
			});
		}
	};
})();
//#endregion
//#region ../../node_modules/.pnpm/three@0.185.1/node_modules/three/examples/jsm/utils/BufferGeometryUtils.js
function lE(e, t = !1) {
	let n = e[0].index !== null, r = new Set(Object.keys(e[0].attributes)), i = new Set(Object.keys(e[0].morphAttributes)), a = {}, o = {}, s = e[0].morphTargetsRelative, c = new qe(), l = 0;
	for (let u = 0; u < e.length; ++u) {
		let d = e[u], f = 0;
		if (n !== (d.index !== null)) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + u + ". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."), null;
		for (let e in d.attributes) {
			if (!r.has(e)) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + u + ". All geometries must have compatible attributes; make sure \"" + e + "\" attribute exists among all geometries, or in none of them."), null;
			a[e] === void 0 && (a[e] = []), a[e].push(d.attributes[e]), f++;
		}
		if (f !== r.size) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + u + ". Make sure all geometries have the same number of attributes."), null;
		if (s !== d.morphTargetsRelative) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + u + ". .morphTargetsRelative must be consistent throughout all geometries."), null;
		for (let e in d.morphAttributes) {
			if (!i.has(e)) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + u + ".  .morphAttributes must be consistent throughout all geometries."), null;
			o[e] === void 0 && (o[e] = []), o[e].push(d.morphAttributes[e]);
		}
		if (t) {
			let e;
			if (n) e = d.index.count;
			else if (d.attributes.position !== void 0) e = d.attributes.position.count;
			else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + u + ". The geometry must have either an index or a position attribute"), null;
			c.addGroup(l, e, u), l += e;
		}
	}
	if (n) {
		let t = 0, n = [];
		for (let r = 0; r < e.length; ++r) {
			let i = e[r].index;
			for (let e = 0; e < i.count; ++e) n.push(i.getX(e) + t);
			t += e[r].attributes.position.count;
		}
		c.setIndex(n);
	}
	for (let e in a) {
		let t = uE(a[e]);
		if (!t) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + e + " attribute."), null;
		c.setAttribute(e, t);
	}
	for (let e in o) {
		let t = o[e][0].length;
		if (t !== 0) {
			c.morphAttributes = c.morphAttributes || {}, c.morphAttributes[e] = [];
			for (let n = 0; n < t; ++n) {
				let t = [];
				for (let r = 0; r < o[e].length; ++r) t.push(o[e][r][n]);
				let r = uE(t);
				if (!r) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + e + " morphAttribute."), null;
				c.morphAttributes[e].push(r);
			}
		}
	}
	return c;
}
function uE(e) {
	let t, n, r, i = -1, a = 0;
	for (let o = 0; o < e.length; ++o) {
		let s = e[o];
		if (t === void 0 && (t = s.array.constructor), t !== s.array.constructor) return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."), null;
		if (n === void 0 && (n = s.itemSize), n !== s.itemSize) return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."), null;
		if (r === void 0 && (r = s.normalized), r !== s.normalized) return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."), null;
		if (i === -1 && (i = s.gpuType), i !== s.gpuType) return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."), null;
		a += s.count * n;
	}
	let o = new t(a), s = new Ue(o, n, r), c = 0;
	for (let t = 0; t < e.length; ++t) {
		let r = e[t];
		if (r.isInterleavedBufferAttribute) {
			let e = c / n;
			for (let t = 0, i = r.count; t < i; t++) for (let i = 0; i < n; i++) {
				let n = r.getComponent(t, i);
				s.setComponent(t + e, i, n);
			}
		} else o.set(r.array, c);
		c += r.count * n;
	}
	return i !== void 0 && (s.gpuType = i), s;
}
function dE(e, t) {
	if (t === 0) return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), e;
	if (t === 2 || t === 1) {
		let n = e.getIndex();
		if (n === null) {
			let t = [], r = e.getAttribute("position");
			if (r !== void 0) {
				for (let e = 0; e < r.count; e++) t.push(e);
				e.setIndex(t), n = e.getIndex();
			} else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), e;
		}
		let r = n.count - 2, i = [];
		if (t === 2) for (let e = 1; e <= r; e++) i.push(n.getX(0)), i.push(n.getX(e)), i.push(n.getX(e + 1));
		else for (let e = 0; e < r; e++) e % 2 == 0 ? (i.push(n.getX(e)), i.push(n.getX(e + 1)), i.push(n.getX(e + 2))) : (i.push(n.getX(e + 2)), i.push(n.getX(e + 1)), i.push(n.getX(e)));
		i.length / 3 !== r && console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");
		let a = e.clone();
		return a.setIndex(i), a.clearGroups(), a;
	} else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", t), e;
}
function fE(e, t = Math.PI / 3) {
	let n = e.index ? e.toNonIndexed() : e, r = n.attributes.position, i = r.count, a;
	if (r.isBufferAttribute === !0 && r.itemSize === 3 && r.normalized === !1) a = r.array;
	else {
		a = new Float64Array(i * 3);
		for (let e = 0; e < i; e++) a[3 * e + 0] = r.getX(e), a[3 * e + 1] = r.getY(e), a[3 * e + 2] = r.getZ(e);
	}
	let o = Math.cos(t), s = 1.0000000001 * 100, c = i / 3, l = new Float64Array(c * 3);
	for (let e = 0; e < c; e++) {
		let t = 9 * e, n = a[t + 0], r = a[t + 1], i = a[t + 2], o = a[t + 3], s = a[t + 4], c = a[t + 5], u = a[t + 6], d = a[t + 7], f = a[t + 8], p = u - o, m = d - s, h = f - c, g = n - o, _ = r - s, v = i - c, y = m * v - h * _, b = h * g - p * v, x = p * _ - m * g, S = 1 / (Math.sqrt(y * y + b * b + x * x) || 1);
		l[3 * e + 0] = y * S, l[3 * e + 1] = b * S, l[3 * e + 2] = x * S;
	}
	let u = new Int32Array(i), d = new Int32Array(i * 3), f = 1;
	for (; f < i * 2;) f <<= 1;
	let p = f - 1, m = new Int32Array(f), h = 0;
	for (let e = 0; e < i; e++) {
		let t = 3 * e, n = ~~(a[t + 0] * s), r = ~~(a[t + 1] * s), i = ~~(a[t + 2] * s), o = (Math.imul(n, 73856093) ^ Math.imul(r, 19349663) ^ Math.imul(i, 83492791)) & p;
		for (;;) {
			let t = m[o];
			if (t === 0) {
				let t = 3 * h;
				d[t + 0] = n, d[t + 1] = r, d[t + 2] = i, m[o] = h + 1, u[e] = h++;
				break;
			}
			let a = 3 * (t - 1);
			if (d[a + 0] === n && d[a + 1] === r && d[a + 2] === i) {
				u[e] = t - 1;
				break;
			}
			o = o + 1 & p;
		}
	}
	let g = new Int32Array(h + 1);
	for (let e = 0; e < i; e++) g[u[e] + 1]++;
	for (let e = 0; e < h; e++) g[e + 1] += g[e];
	let _ = new Int32Array(i), v = g.slice(0, h);
	for (let e = 0; e < c; e++) {
		let t = 3 * e;
		_[v[u[t + 0]]++] = e, _[v[u[t + 1]]++] = e, _[v[u[t + 2]]++] = e;
	}
	let y = new Float32Array(i * 3);
	for (let e = 0; e < c; e++) {
		let t = 3 * e, n = l[t + 0], r = l[t + 1], i = l[t + 2];
		for (let e = 0; e < 3; e++) {
			let a = t + e, s = u[a], c = 0, d = 0, f = 0;
			for (let e = g[s], t = g[s + 1]; e < t; e++) {
				let t = 3 * _[e], a = l[t + 0], s = l[t + 1], u = l[t + 2];
				n * a + r * s + i * u > o && (c += a, d += s, f += u);
			}
			let p = 1 / (Math.sqrt(c * c + d * d + f * f) || 1);
			y[3 * a + 0] = c * p, y[3 * a + 1] = d * p, y[3 * a + 2] = f * p;
		}
	}
	return n.setAttribute("normal", new Ue(y, 3, !1)), n;
}
//#endregion
//#region ../../node_modules/.pnpm/three@0.185.1/node_modules/three/examples/jsm/utils/SkeletonUtils.js
function pE(e) {
	let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = e.clone();
	return mE(e, r, function(e, r) {
		t.set(r, e), n.set(e, r);
	}), r.traverse(function(e) {
		if (!e.isSkinnedMesh) return;
		let r = e, i = t.get(e), a = i.skeleton.bones;
		r.skeleton = i.skeleton.clone(), r.bindMatrix.copy(i.bindMatrix), r.skeleton.bones = a.map(function(e) {
			return n.get(e);
		}), r.bind(r.skeleton, r.bindMatrix);
	}), r;
}
function mE(e, t, n) {
	n(e, t);
	for (let r = 0; r < e.children.length; r++) mE(e.children[r], t.children[r], n);
}
//#endregion
//#region ../../node_modules/.pnpm/three@0.185.1/node_modules/three/examples/jsm/loaders/GLTFLoader.js
var hE = class extends zt {
	constructor(e) {
		super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(e) {
			return new SE(e);
		}), this.register(function(e) {
			return new CE(e);
		}), this.register(function(e) {
			return new ME(e);
		}), this.register(function(e) {
			return new NE(e);
		}), this.register(function(e) {
			return new PE(e);
		}), this.register(function(e) {
			return new TE(e);
		}), this.register(function(e) {
			return new EE(e);
		}), this.register(function(e) {
			return new DE(e);
		}), this.register(function(e) {
			return new OE(e);
		}), this.register(function(e) {
			return new xE(e);
		}), this.register(function(e) {
			return new kE(e);
		}), this.register(function(e) {
			return new wE(e);
		}), this.register(function(e) {
			return new jE(e);
		}), this.register(function(e) {
			return new AE(e);
		}), this.register(function(e) {
			return new yE(e);
		}), this.register(function(e) {
			return new FE(e, vE.EXT_MESHOPT_COMPRESSION);
		}), this.register(function(e) {
			return new FE(e, vE.KHR_MESHOPT_COMPRESSION);
		}), this.register(function(e) {
			return new IE(e);
		});
	}
	load(e, t, n, r) {
		let i = this, a;
		if (this.resourcePath !== "") a = this.resourcePath;
		else if (this.path !== "") {
			let t = It.extractUrlBase(e);
			a = It.resolveURL(t, this.path);
		} else a = It.extractUrlBase(e);
		this.manager.itemStart(e);
		let o = function(t) {
			r ? r(t) : console.error(t), i.manager.itemError(e), i.manager.itemEnd(e);
		}, s = new st(this.manager);
		s.setPath(this.path), s.setResponseType("arraybuffer"), s.setRequestHeader(this.requestHeader), s.setWithCredentials(this.withCredentials), s.load(e, function(n) {
			try {
				i.parse(n, a, function(n) {
					t(n), i.manager.itemEnd(e);
				}, o);
			} catch (e) {
				o(e);
			}
		}, n, o);
	}
	setDRACOLoader(e) {
		return this.dracoLoader = e, this;
	}
	setKTX2Loader(e) {
		return this.ktx2Loader = e, this;
	}
	setMeshoptDecoder(e) {
		return this.meshoptDecoder = e, this;
	}
	register(e) {
		return this.pluginCallbacks.indexOf(e) === -1 && this.pluginCallbacks.push(e), this;
	}
	unregister(e) {
		return this.pluginCallbacks.indexOf(e) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e), 1), this;
	}
	parse(e, t, n, r) {
		let i, a = {}, o = {}, s = new TextDecoder();
		if (typeof e == "string") i = JSON.parse(e);
		else if (e instanceof ArrayBuffer) if (s.decode(new Uint8Array(e, 0, 4)) === LE) {
			try {
				a[vE.KHR_BINARY_GLTF] = new BE(e);
			} catch (e) {
				r && r(e);
				return;
			}
			i = JSON.parse(a[vE.KHR_BINARY_GLTF].content);
		} else i = JSON.parse(s.decode(e));
		else i = e;
		if (i.asset === void 0 || i.asset.version[0] < 2) {
			r && r(/* @__PURE__ */ Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
			return;
		}
		let c = new fD(i, {
			path: t || this.resourcePath || "",
			crossOrigin: this.crossOrigin,
			requestHeader: this.requestHeader,
			manager: this.manager,
			ktx2Loader: this.ktx2Loader,
			meshoptDecoder: this.meshoptDecoder
		});
		c.fileLoader.setRequestHeader(this.requestHeader);
		for (let e = 0; e < this.pluginCallbacks.length; e++) {
			let t = this.pluginCallbacks[e](c);
			t.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), o[t.name] = t, a[t.name] = !0;
		}
		if (i.extensionsUsed) for (let e = 0; e < i.extensionsUsed.length; ++e) {
			let t = i.extensionsUsed[e], n = i.extensionsRequired || [];
			switch (t) {
				case vE.KHR_MATERIALS_UNLIT:
					a[t] = new bE();
					break;
				case vE.KHR_DRACO_MESH_COMPRESSION:
					a[t] = new VE(i, this.dracoLoader);
					break;
				case vE.KHR_TEXTURE_TRANSFORM:
					a[t] = new HE();
					break;
				case vE.KHR_MESH_QUANTIZATION:
					a[t] = new UE();
					break;
				default: n.indexOf(t) >= 0 && o[t] === void 0 && console.warn("THREE.GLTFLoader: Unknown extension \"" + t + "\".");
			}
		}
		c.setExtensions(a), c.setPlugins(o), c.parse(n, r);
	}
	parseAsync(e, t) {
		let n = this;
		return new Promise(function(r, i) {
			n.parse(e, t, r, i);
		});
	}
};
function gE() {
	let e = {};
	return {
		get: function(t) {
			return e[t];
		},
		add: function(t, n) {
			e[t] = n;
		},
		remove: function(t) {
			delete e[t];
		},
		removeAll: function() {
			e = {};
		}
	};
}
function _E(e, t, n) {
	let r = e.json.materials[t];
	return r.extensions && r.extensions[n] ? r.extensions[n] : null;
}
var vE = {
	KHR_BINARY_GLTF: "KHR_binary_glTF",
	KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression",
	KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual",
	KHR_MATERIALS_CLEARCOAT: "KHR_materials_clearcoat",
	KHR_MATERIALS_DISPERSION: "KHR_materials_dispersion",
	KHR_MATERIALS_IOR: "KHR_materials_ior",
	KHR_MATERIALS_SHEEN: "KHR_materials_sheen",
	KHR_MATERIALS_SPECULAR: "KHR_materials_specular",
	KHR_MATERIALS_TRANSMISSION: "KHR_materials_transmission",
	KHR_MATERIALS_IRIDESCENCE: "KHR_materials_iridescence",
	KHR_MATERIALS_ANISOTROPY: "KHR_materials_anisotropy",
	KHR_MATERIALS_UNLIT: "KHR_materials_unlit",
	KHR_MATERIALS_VOLUME: "KHR_materials_volume",
	KHR_TEXTURE_BASISU: "KHR_texture_basisu",
	KHR_TEXTURE_TRANSFORM: "KHR_texture_transform",
	KHR_MESH_QUANTIZATION: "KHR_mesh_quantization",
	KHR_MATERIALS_EMISSIVE_STRENGTH: "KHR_materials_emissive_strength",
	EXT_MATERIALS_BUMP: "EXT_materials_bump",
	EXT_TEXTURE_WEBP: "EXT_texture_webp",
	EXT_TEXTURE_AVIF: "EXT_texture_avif",
	EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
	KHR_MESHOPT_COMPRESSION: "KHR_meshopt_compression",
	EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
}, yE = class {
	constructor(e) {
		this.parser = e, this.name = vE.KHR_LIGHTS_PUNCTUAL, this.cache = {
			refs: {},
			uses: {}
		};
	}
	_markDefs() {
		let e = this.parser, t = this.parser.json.nodes || [];
		for (let n = 0, r = t.length; n < r; n++) {
			let r = t[n];
			r.extensions && r.extensions[this.name] && r.extensions[this.name].light !== void 0 && e._addNodeRef(this.cache, r.extensions[this.name].light);
		}
	}
	_loadLight(e) {
		let t = this.parser, n = "light:" + e, r = t.cache.get(n);
		if (r) return r;
		let i = t.json, a = ((i.extensions && i.extensions[this.name] || {}).lights || [])[e], o, s = new Xe(16777215);
		a.color !== void 0 && s.setRGB(a.color[0], a.color[1], a.color[2], Qt);
		let c = a.range === void 0 ? 0 : a.range;
		switch (a.type) {
			case "directional":
				o = new je(s), o.target.position.set(0, 0, -1), o.add(o.target);
				break;
			case "point":
				o = new Be(s), o.distance = c;
				break;
			case "spot":
				o = new wt(s), o.distance = c, a.spot = a.spot || {}, a.spot.innerConeAngle = a.spot.innerConeAngle === void 0 ? 0 : a.spot.innerConeAngle, a.spot.outerConeAngle = a.spot.outerConeAngle === void 0 ? Math.PI / 4 : a.spot.outerConeAngle, o.angle = a.spot.outerConeAngle, o.penumbra = 1 - a.spot.innerConeAngle / a.spot.outerConeAngle, o.target.position.set(0, 0, -1), o.add(o.target);
				break;
			default: throw Error("THREE.GLTFLoader: Unexpected light type: " + a.type);
		}
		return o.position.set(0, 0, 0), iD(o, a), a.intensity !== void 0 && (o.intensity = a.intensity), o.name = t.createUniqueName(a.name || "light_" + e), r = Promise.resolve(o), t.cache.add(n, r), r;
	}
	getDependency(e, t) {
		if (e === "light") return this._loadLight(t);
	}
	createNodeAttachment(e) {
		let t = this, n = this.parser, r = n.json.nodes[e], i = (r.extensions && r.extensions[this.name] || {}).light;
		return i === void 0 ? null : this._loadLight(i).then(function(e) {
			return n._getNodeRef(t.cache, i, e);
		});
	}
}, bE = class {
	constructor() {
		this.name = vE.KHR_MATERIALS_UNLIT;
	}
	getMaterialType() {
		return et;
	}
	extendParams(e, t, n) {
		let r = [];
		e.color = new Xe(1, 1, 1), e.opacity = 1;
		let i = t.pbrMetallicRoughness;
		if (i) {
			if (Array.isArray(i.baseColorFactor)) {
				let t = i.baseColorFactor;
				e.color.setRGB(t[0], t[1], t[2], Qt), e.opacity = t[3];
			}
			i.baseColorTexture !== void 0 && r.push(n.assignTexture(e, "map", i.baseColorTexture, kt));
		}
		return Promise.all(r);
	}
}, xE = class {
	constructor(e) {
		this.parser = e, this.name = vE.KHR_MATERIALS_EMISSIVE_STRENGTH;
	}
	extendMaterialParams(e, t) {
		let n = _E(this.parser, e, this.name);
		return n === null || n.emissiveStrength !== void 0 && (t.emissiveIntensity = n.emissiveStrength), Promise.resolve();
	}
}, SE = class {
	constructor(e) {
		this.parser = e, this.name = vE.KHR_MATERIALS_CLEARCOAT;
	}
	getMaterialType(e) {
		return _E(this.parser, e, this.name) === null ? null : nt;
	}
	extendMaterialParams(e, t) {
		let n = _E(this.parser, e, this.name);
		if (n === null) return Promise.resolve();
		let r = [];
		if (n.clearcoatFactor !== void 0 && (t.clearcoat = n.clearcoatFactor), n.clearcoatTexture !== void 0 && r.push(this.parser.assignTexture(t, "clearcoatMap", n.clearcoatTexture)), n.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = n.clearcoatRoughnessFactor), n.clearcoatRoughnessTexture !== void 0 && r.push(this.parser.assignTexture(t, "clearcoatRoughnessMap", n.clearcoatRoughnessTexture)), n.clearcoatNormalTexture !== void 0 && (r.push(this.parser.assignTexture(t, "clearcoatNormalMap", n.clearcoatNormalTexture)), n.clearcoatNormalTexture.scale !== void 0)) {
			let e = n.clearcoatNormalTexture.scale;
			t.clearcoatNormalScale = new gt(e, e);
		}
		return Promise.all(r);
	}
}, CE = class {
	constructor(e) {
		this.parser = e, this.name = vE.KHR_MATERIALS_DISPERSION;
	}
	getMaterialType(e) {
		return _E(this.parser, e, this.name) === null ? null : nt;
	}
	extendMaterialParams(e, t) {
		let n = _E(this.parser, e, this.name);
		return n === null || (t.dispersion = n.dispersion === void 0 ? 0 : n.dispersion), Promise.resolve();
	}
}, wE = class {
	constructor(e) {
		this.parser = e, this.name = vE.KHR_MATERIALS_IRIDESCENCE;
	}
	getMaterialType(e) {
		return _E(this.parser, e, this.name) === null ? null : nt;
	}
	extendMaterialParams(e, t) {
		let n = _E(this.parser, e, this.name);
		if (n === null) return Promise.resolve();
		let r = [];
		return n.iridescenceFactor !== void 0 && (t.iridescence = n.iridescenceFactor), n.iridescenceTexture !== void 0 && r.push(this.parser.assignTexture(t, "iridescenceMap", n.iridescenceTexture)), n.iridescenceIor !== void 0 && (t.iridescenceIOR = n.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), n.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = n.iridescenceThicknessMinimum), n.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = n.iridescenceThicknessMaximum), n.iridescenceThicknessTexture !== void 0 && r.push(this.parser.assignTexture(t, "iridescenceThicknessMap", n.iridescenceThicknessTexture)), Promise.all(r);
	}
}, TE = class {
	constructor(e) {
		this.parser = e, this.name = vE.KHR_MATERIALS_SHEEN;
	}
	getMaterialType(e) {
		return _E(this.parser, e, this.name) === null ? null : nt;
	}
	extendMaterialParams(e, t) {
		let n = _E(this.parser, e, this.name);
		if (n === null) return Promise.resolve();
		let r = [];
		if (t.sheenColor = new Xe(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1, n.sheenColorFactor !== void 0) {
			let e = n.sheenColorFactor;
			t.sheenColor.setRGB(e[0], e[1], e[2], Qt);
		}
		return n.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = n.sheenRoughnessFactor), n.sheenColorTexture !== void 0 && r.push(this.parser.assignTexture(t, "sheenColorMap", n.sheenColorTexture, kt)), n.sheenRoughnessTexture !== void 0 && r.push(this.parser.assignTexture(t, "sheenRoughnessMap", n.sheenRoughnessTexture)), Promise.all(r);
	}
}, EE = class {
	constructor(e) {
		this.parser = e, this.name = vE.KHR_MATERIALS_TRANSMISSION;
	}
	getMaterialType(e) {
		return _E(this.parser, e, this.name) === null ? null : nt;
	}
	extendMaterialParams(e, t) {
		let n = _E(this.parser, e, this.name);
		if (n === null) return Promise.resolve();
		let r = [];
		return n.transmissionFactor !== void 0 && (t.transmission = n.transmissionFactor), n.transmissionTexture !== void 0 && r.push(this.parser.assignTexture(t, "transmissionMap", n.transmissionTexture)), Promise.all(r);
	}
}, DE = class {
	constructor(e) {
		this.parser = e, this.name = vE.KHR_MATERIALS_VOLUME;
	}
	getMaterialType(e) {
		return _E(this.parser, e, this.name) === null ? null : nt;
	}
	extendMaterialParams(e, t) {
		let n = _E(this.parser, e, this.name);
		if (n === null) return Promise.resolve();
		let r = [];
		t.thickness = n.thicknessFactor === void 0 ? 0 : n.thicknessFactor, n.thicknessTexture !== void 0 && r.push(this.parser.assignTexture(t, "thicknessMap", n.thicknessTexture)), t.attenuationDistance = n.attenuationDistance || Infinity;
		let i = n.attenuationColor || [
			1,
			1,
			1
		];
		return t.attenuationColor = new Xe().setRGB(i[0], i[1], i[2], Qt), Promise.all(r);
	}
}, OE = class {
	constructor(e) {
		this.parser = e, this.name = vE.KHR_MATERIALS_IOR;
	}
	getMaterialType(e) {
		return _E(this.parser, e, this.name) === null ? null : nt;
	}
	extendMaterialParams(e, t) {
		let n = _E(this.parser, e, this.name);
		return n === null ? Promise.resolve() : (t.ior = n.ior === void 0 ? 1.5 : n.ior, t.ior === 0 && (t.ior = 1e3), Promise.resolve());
	}
}, kE = class {
	constructor(e) {
		this.parser = e, this.name = vE.KHR_MATERIALS_SPECULAR;
	}
	getMaterialType(e) {
		return _E(this.parser, e, this.name) === null ? null : nt;
	}
	extendMaterialParams(e, t) {
		let n = _E(this.parser, e, this.name);
		if (n === null) return Promise.resolve();
		let r = [];
		t.specularIntensity = n.specularFactor === void 0 ? 1 : n.specularFactor, n.specularTexture !== void 0 && r.push(this.parser.assignTexture(t, "specularIntensityMap", n.specularTexture));
		let i = n.specularColorFactor || [
			1,
			1,
			1
		];
		return t.specularColor = new Xe().setRGB(i[0], i[1], i[2], Qt), n.specularColorTexture !== void 0 && r.push(this.parser.assignTexture(t, "specularColorMap", n.specularColorTexture, kt)), Promise.all(r);
	}
}, AE = class {
	constructor(e) {
		this.parser = e, this.name = vE.EXT_MATERIALS_BUMP;
	}
	getMaterialType(e) {
		return _E(this.parser, e, this.name) === null ? null : nt;
	}
	extendMaterialParams(e, t) {
		let n = _E(this.parser, e, this.name);
		if (n === null) return Promise.resolve();
		let r = [];
		return t.bumpScale = n.bumpFactor === void 0 ? 1 : n.bumpFactor, n.bumpTexture !== void 0 && r.push(this.parser.assignTexture(t, "bumpMap", n.bumpTexture)), Promise.all(r);
	}
}, jE = class {
	constructor(e) {
		this.parser = e, this.name = vE.KHR_MATERIALS_ANISOTROPY;
	}
	getMaterialType(e) {
		return _E(this.parser, e, this.name) === null ? null : nt;
	}
	extendMaterialParams(e, t) {
		let n = _E(this.parser, e, this.name);
		if (n === null) return Promise.resolve();
		let r = [];
		return n.anisotropyStrength !== void 0 && (t.anisotropy = n.anisotropyStrength), n.anisotropyRotation !== void 0 && (t.anisotropyRotation = n.anisotropyRotation), n.anisotropyTexture !== void 0 && r.push(this.parser.assignTexture(t, "anisotropyMap", n.anisotropyTexture)), Promise.all(r);
	}
}, ME = class {
	constructor(e) {
		this.parser = e, this.name = vE.KHR_TEXTURE_BASISU;
	}
	loadTexture(e) {
		let t = this.parser, n = t.json, r = n.textures[e];
		if (!r.extensions || !r.extensions[this.name]) return null;
		let i = r.extensions[this.name], a = t.options.ktx2Loader;
		if (!a) {
			if (n.extensionsRequired && n.extensionsRequired.indexOf(this.name) >= 0) throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");
			return null;
		}
		return t.loadTextureImage(e, i.source, a);
	}
}, NE = class {
	constructor(e) {
		this.parser = e, this.name = vE.EXT_TEXTURE_WEBP;
	}
	loadTexture(e) {
		let t = this.name, n = this.parser, r = n.json, i = r.textures[e];
		if (!i.extensions || !i.extensions[t]) return null;
		let a = i.extensions[t], o = r.images[a.source], s = n.textureLoader;
		if (o.uri) {
			let e = n.options.manager.getHandler(o.uri);
			e !== null && (s = e);
		}
		return n.loadTextureImage(e, a.source, s);
	}
}, PE = class {
	constructor(e) {
		this.parser = e, this.name = vE.EXT_TEXTURE_AVIF;
	}
	loadTexture(e) {
		let t = this.name, n = this.parser, r = n.json, i = r.textures[e];
		if (!i.extensions || !i.extensions[t]) return null;
		let a = i.extensions[t], o = r.images[a.source], s = n.textureLoader;
		if (o.uri) {
			let e = n.options.manager.getHandler(o.uri);
			e !== null && (s = e);
		}
		return n.loadTextureImage(e, a.source, s);
	}
}, FE = class {
	constructor(e, t) {
		this.name = t, this.parser = e;
	}
	loadBufferView(e) {
		let t = this.parser.json, n = t.bufferViews[e];
		if (n.extensions && n.extensions[this.name]) {
			let e = n.extensions[this.name], r = this.parser.getDependency("buffer", e.buffer), i = this.parser.options.meshoptDecoder;
			if (!i || !i.supported) {
				if (t.extensionsRequired && t.extensionsRequired.indexOf(this.name) >= 0) throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");
				return null;
			}
			return r.then(function(t) {
				let n = e.byteOffset || 0, r = e.byteLength || 0, a = e.count, o = e.byteStride, s = new Uint8Array(t, n, r);
				return i.decodeGltfBufferAsync ? i.decodeGltfBufferAsync(a, o, s, e.mode, e.filter).then(function(e) {
					return e.buffer;
				}) : i.ready.then(function() {
					let t = new ArrayBuffer(a * o);
					return i.decodeGltfBuffer(new Uint8Array(t), a, o, s, e.mode, e.filter), t;
				});
			});
		} else return null;
	}
}, IE = class {
	constructor(e) {
		this.name = vE.EXT_MESH_GPU_INSTANCING, this.parser = e;
	}
	createNodeMesh(e) {
		let t = this.parser.json, n = t.nodes[e];
		if (!n.extensions || !n.extensions[this.name] || n.mesh === void 0) return null;
		let r = t.meshes[n.mesh];
		for (let e of r.primitives) if (e.mode !== qE.TRIANGLES && e.mode !== qE.TRIANGLE_STRIP && e.mode !== qE.TRIANGLE_FAN && e.mode !== void 0) return null;
		let i = n.extensions[this.name].attributes, a = [], o = {};
		for (let e in i) a.push(this.parser.getDependency("accessor", i[e]).then((t) => (o[e] = t, o[e])));
		return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((e) => {
			let t = e.pop(), n = t.isGroup ? t.children : [t], r = e[0].count, i = [];
			for (let e of n) {
				let t = new Ct(), n = new I(), a = new ot(), s = new I(1, 1, 1), c = new he(e.geometry, e.material, r);
				for (let e = 0; e < r; e++) o.TRANSLATION && n.fromBufferAttribute(o.TRANSLATION, e), o.ROTATION && a.fromBufferAttribute(o.ROTATION, e), o.SCALE && s.fromBufferAttribute(o.SCALE, e), c.setMatrixAt(e, t.compose(n, a, s));
				for (let t in o) if (t === "_COLOR_0") {
					let e = o[t];
					c.instanceColor = new lt(e.array, e.itemSize, e.normalized);
				} else t !== "TRANSLATION" && t !== "ROTATION" && t !== "SCALE" && e.geometry.setAttribute(t, o[t]);
				He.prototype.copy.call(c, e), this.parser.assignFinalMaterial(c), i.push(c);
			}
			return t.isGroup ? (t.clear(), t.add(...i), t) : i[0];
		}));
	}
}, LE = "glTF", RE = 12, zE = {
	JSON: 1313821514,
	BIN: 5130562
}, BE = class {
	constructor(e) {
		this.name = vE.KHR_BINARY_GLTF, this.content = null, this.body = null;
		let t = new DataView(e, 0, RE), n = new TextDecoder();
		if (this.header = {
			magic: n.decode(new Uint8Array(e.slice(0, 4))),
			version: t.getUint32(4, !0),
			length: t.getUint32(8, !0)
		}, this.header.magic !== LE) throw Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
		if (this.header.version < 2) throw Error("THREE.GLTFLoader: Legacy binary file detected.");
		let r = this.header.length - RE, i = new DataView(e, RE), a = 0;
		for (; a < r;) {
			let t = i.getUint32(a, !0);
			a += 4;
			let r = i.getUint32(a, !0);
			if (a += 4, r === zE.JSON) {
				let r = new Uint8Array(e, RE + a, t);
				this.content = n.decode(r);
			} else if (r === zE.BIN) {
				let n = RE + a;
				this.body = e.slice(n, n + t);
			}
			a += t;
		}
		if (this.content === null) throw Error("THREE.GLTFLoader: JSON content not found.");
	}
}, VE = class {
	constructor(e, t) {
		if (!t) throw Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
		this.name = vE.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
	}
	decodePrimitive(e, t) {
		let n = this.json, r = this.dracoLoader, i = e.extensions[this.name].bufferView, a = e.extensions[this.name].attributes, o = {}, s = {}, c = {};
		for (let e in a) {
			let t = QE[e] || e.toLowerCase();
			o[t] = a[e];
		}
		for (let t in e.attributes) {
			let r = QE[t] || t.toLowerCase();
			if (a[t] !== void 0) {
				let i = n.accessors[e.attributes[t]];
				c[r] = JE[i.componentType].name, s[r] = i.normalized === !0;
			}
		}
		return t.getDependency("bufferView", i).then(function(e) {
			return new Promise(function(t, n) {
				r.decodeDracoFile(e, function(e) {
					for (let t in e.attributes) {
						let n = e.attributes[t], r = s[t];
						r !== void 0 && (n.normalized = r);
					}
					t(e);
				}, o, c, Qt, n);
			});
		});
	}
}, HE = class {
	constructor() {
		this.name = vE.KHR_TEXTURE_TRANSFORM;
	}
	extendTexture(e, t) {
		return (t.texCoord === void 0 || t.texCoord === e.channel) && t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 ? e : (e = e.clone(), t.texCoord !== void 0 && (e.channel = t.texCoord), t.offset !== void 0 && e.offset.fromArray(t.offset), t.rotation !== void 0 && (e.rotation = t.rotation), t.scale !== void 0 && e.repeat.fromArray(t.scale), e.needsUpdate = !0, e);
	}
}, UE = class {
	constructor() {
		this.name = vE.KHR_MESH_QUANTIZATION;
	}
}, WE = class extends fn {
	constructor(e, t, n, r) {
		super(e, t, n, r);
	}
	copySampleValue_(e) {
		let t = this.resultBuffer, n = this.sampleValues, r = this.valueSize, i = e * r * 3 + r;
		for (let e = 0; e !== r; e++) t[e] = n[i + e];
		return t;
	}
	interpolate_(e, t, n, r) {
		let i = this.resultBuffer, a = this.sampleValues, o = this.valueSize, s = o * 2, c = o * 3, l = r - t, u = (n - t) / l, d = u * u, f = d * u, p = e * c, m = p - c, h = -2 * f + 3 * d, g = f - d, _ = 1 - h, v = g - d + u;
		for (let e = 0; e !== o; e++) {
			let t = a[m + e + o], n = a[m + e + s] * l, r = a[p + e + o], c = a[p + e] * l;
			i[e] = _ * t + v * n + h * r + g * c;
		}
		return i;
	}
}, GE = new ot(), KE = class extends WE {
	interpolate_(e, t, n, r) {
		let i = super.interpolate_(e, t, n, r);
		return GE.fromArray(i).normalize().toArray(i), i;
	}
}, qE = {
	FLOAT: 5126,
	FLOAT_MAT3: 35675,
	FLOAT_MAT4: 35676,
	FLOAT_VEC2: 35664,
	FLOAT_VEC3: 35665,
	FLOAT_VEC4: 35666,
	LINEAR: 9729,
	REPEAT: 10497,
	SAMPLER_2D: 35678,
	POINTS: 0,
	LINES: 1,
	LINE_LOOP: 2,
	LINE_STRIP: 3,
	TRIANGLES: 4,
	TRIANGLE_STRIP: 5,
	TRIANGLE_FAN: 6,
	UNSIGNED_BYTE: 5121,
	UNSIGNED_SHORT: 5123
}, JE = {
	5120: Int8Array,
	5121: Uint8Array,
	5122: Int16Array,
	5123: Uint16Array,
	5125: Uint32Array,
	5126: Float32Array
}, YE = {
	9728: Ke,
	9729: Ot,
	9984: ve,
	9985: sn,
	9986: Kt,
	9987: Nt
}, XE = {
	33071: ze,
	33648: we,
	10497: Ye
}, ZE = {
	SCALAR: 1,
	VEC2: 2,
	VEC3: 3,
	VEC4: 4,
	MAT2: 4,
	MAT3: 9,
	MAT4: 16
}, QE = {
	POSITION: "position",
	NORMAL: "normal",
	TANGENT: "tangent",
	TEXCOORD_0: "uv",
	TEXCOORD_1: "uv1",
	TEXCOORD_2: "uv2",
	TEXCOORD_3: "uv3",
	COLOR_0: "color",
	WEIGHTS_0: "skinWeight",
	JOINTS_0: "skinIndex"
}, $E = {
	scale: "scale",
	translation: "position",
	rotation: "quaternion",
	weights: "morphTargetInfluences"
}, eD = {
	CUBICSPLINE: void 0,
	LINEAR: bt,
	STEP: Ht
}, tD = {
	OPAQUE: "OPAQUE",
	MASK: "MASK",
	BLEND: "BLEND"
};
function nD(e) {
	return e.DefaultMaterial === void 0 && (e.DefaultMaterial = new Ee({
		color: 16777215,
		emissive: 0,
		metalness: 1,
		roughness: 1,
		transparent: !1,
		depthTest: !0,
		side: 0
	})), e.DefaultMaterial;
}
function rD(e, t, n) {
	for (let r in n.extensions) e[r] === void 0 && (t.userData.gltfExtensions = t.userData.gltfExtensions || {}, t.userData.gltfExtensions[r] = n.extensions[r]);
}
function iD(e, t) {
	t.extras !== void 0 && (typeof t.extras == "object" ? Object.assign(e.userData, t.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + t.extras));
}
function aD(e, t, n) {
	let r = !1, i = !1, a = !1;
	for (let e = 0, n = t.length; e < n; e++) {
		let n = t[e];
		if (n.POSITION !== void 0 && (r = !0), n.NORMAL !== void 0 && (i = !0), n.COLOR_0 !== void 0 && (a = !0), r && i && a) break;
	}
	if (!r && !i && !a) return Promise.resolve(e);
	let o = [], s = [], c = [];
	for (let l = 0, u = t.length; l < u; l++) {
		let u = t[l];
		if (r) {
			let t = u.POSITION === void 0 ? e.attributes.position : n.getDependency("accessor", u.POSITION);
			o.push(t);
		}
		if (i) {
			let t = u.NORMAL === void 0 ? e.attributes.normal : n.getDependency("accessor", u.NORMAL);
			s.push(t);
		}
		if (a) {
			let t = u.COLOR_0 === void 0 ? e.attributes.color : n.getDependency("accessor", u.COLOR_0);
			c.push(t);
		}
	}
	return Promise.all([
		Promise.all(o),
		Promise.all(s),
		Promise.all(c)
	]).then(function(t) {
		let n = t[0], o = t[1], s = t[2];
		return r && (e.morphAttributes.position = n), i && (e.morphAttributes.normal = o), a && (e.morphAttributes.color = s), e.morphTargetsRelative = !0, e;
	});
}
function oD(e, t) {
	if (e.updateMorphTargets(), t.weights !== void 0) for (let n = 0, r = t.weights.length; n < r; n++) e.morphTargetInfluences[n] = t.weights[n];
	if (t.extras && Array.isArray(t.extras.targetNames)) {
		let n = t.extras.targetNames;
		if (e.morphTargetInfluences.length === n.length) {
			e.morphTargetDictionary = {};
			for (let t = 0, r = n.length; t < r; t++) e.morphTargetDictionary[n[t]] = t;
		} else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
	}
}
function sD(e) {
	let t, n = e.extensions && e.extensions[vE.KHR_DRACO_MESH_COMPRESSION];
	if (t = n ? "draco:" + n.bufferView + ":" + n.indices + ":" + cD(n.attributes) : e.indices + ":" + cD(e.attributes) + ":" + e.mode, e.targets !== void 0) for (let n = 0, r = e.targets.length; n < r; n++) t += ":" + cD(e.targets[n]);
	return t;
}
function cD(e) {
	let t = "", n = Object.keys(e).sort();
	for (let r = 0, i = n.length; r < i; r++) t += n[r] + ":" + e[n[r]] + ";";
	return t;
}
function lD(e) {
	switch (e) {
		case Int8Array: return 1 / 127;
		case Uint8Array: return 1 / 255;
		case Int16Array: return 1 / 32767;
		case Uint16Array: return 1 / 65535;
		default: throw Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
	}
}
function uD(e) {
	return e.search(/\.jpe?g($|\?)/i) > 0 || e.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : e.search(/\.webp($|\?)/i) > 0 || e.search(/^data\:image\/webp/) === 0 ? "image/webp" : e.search(/\.ktx2($|\?)/i) > 0 || e.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
}
var dD = new Ct(), fD = class {
	constructor(e = {}, t = {}) {
		this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new gE(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = {
			refs: {},
			uses: {}
		}, this.cameraCache = {
			refs: {},
			uses: {}
		}, this.lightCache = {
			refs: {},
			uses: {}
		}, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
		let n = !1, r = -1, i = !1, a = -1;
		if (typeof navigator < "u" && navigator.userAgent !== void 0) {
			let e = navigator.userAgent;
			n = /^((?!chrome|android).)*safari/i.test(e) === !0;
			let t = e.match(/Version\/(\d+)/);
			r = n && t ? parseInt(t[1], 10) : -1, i = e.indexOf("Firefox") > -1, a = i ? e.match(/Firefox\/([0-9]+)\./)[1] : -1;
		}
		typeof createImageBitmap > "u" || n && r < 17 || i && a < 98 ? this.textureLoader = new Mt(this.options.manager) : this.textureLoader = new dt(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new st(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
	}
	setExtensions(e) {
		this.extensions = e;
	}
	setPlugins(e) {
		this.plugins = e;
	}
	parse(e, t) {
		let n = this, r = this.json, i = this.extensions;
		this.cache.removeAll(), this.nodeCache = {}, this._invokeAll(function(e) {
			return e._markDefs && e._markDefs();
		}), Promise.all(this._invokeAll(function(e) {
			return e.beforeRoot && e.beforeRoot();
		})).then(function() {
			return Promise.all([
				n.getDependencies("scene"),
				n.getDependencies("animation"),
				n.getDependencies("camera")
			]);
		}).then(function(t) {
			let a = {
				scene: t[0][r.scene || 0],
				scenes: t[0],
				animations: t[1],
				cameras: t[2],
				asset: r.asset,
				parser: n,
				userData: {}
			};
			return rD(i, a, r), iD(a, r), Promise.all(n._invokeAll(function(e) {
				return e.afterRoot && e.afterRoot(a);
			})).then(function() {
				for (let e of a.scenes) e.updateMatrixWorld();
				e(a);
			});
		}).catch(t);
	}
	_markDefs() {
		let e = this.json.nodes || [], t = this.json.skins || [], n = this.json.meshes || [];
		for (let n = 0, r = t.length; n < r; n++) {
			let r = t[n].joints;
			for (let t = 0, n = r.length; t < n; t++) e[r[t]].isBone = !0;
		}
		for (let t = 0, r = e.length; t < r; t++) {
			let r = e[t];
			r.mesh !== void 0 && (this._addNodeRef(this.meshCache, r.mesh), r.skin !== void 0 && (n[r.mesh].isSkinnedMesh = !0)), r.camera !== void 0 && this._addNodeRef(this.cameraCache, r.camera);
		}
	}
	_addNodeRef(e, t) {
		t !== void 0 && (e.refs[t] === void 0 && (e.refs[t] = e.uses[t] = 0), e.refs[t]++);
	}
	_getNodeRef(e, t, n) {
		if (e.refs[t] <= 1) return n;
		let r = n.clone(), i = (e, t) => {
			let n = this.associations.get(e);
			n != null && this.associations.set(t, n);
			for (let [n, r] of e.children.entries()) i(r, t.children[n]);
		};
		return i(n, r), r.name += "_instance_" + e.uses[t]++, r;
	}
	_invokeOne(e) {
		let t = Object.values(this.plugins);
		t.push(this);
		for (let n = 0; n < t.length; n++) {
			let r = e(t[n]);
			if (r) return r;
		}
		return null;
	}
	_invokeAll(e) {
		let t = Object.values(this.plugins);
		t.unshift(this);
		let n = [];
		for (let r = 0; r < t.length; r++) {
			let i = e(t[r]);
			i && n.push(i);
		}
		return n;
	}
	getDependency(e, t) {
		let n = e + ":" + t, r = this.cache.get(n);
		if (!r) {
			switch (e) {
				case "scene":
					r = this.loadScene(t);
					break;
				case "node":
					r = this._invokeOne(function(e) {
						return e.loadNode && e.loadNode(t);
					});
					break;
				case "mesh":
					r = this._invokeOne(function(e) {
						return e.loadMesh && e.loadMesh(t);
					});
					break;
				case "accessor":
					r = this.loadAccessor(t);
					break;
				case "bufferView":
					r = this._invokeOne(function(e) {
						return e.loadBufferView && e.loadBufferView(t);
					});
					break;
				case "buffer":
					r = this.loadBuffer(t);
					break;
				case "material":
					r = this._invokeOne(function(e) {
						return e.loadMaterial && e.loadMaterial(t);
					});
					break;
				case "texture":
					r = this._invokeOne(function(e) {
						return e.loadTexture && e.loadTexture(t);
					});
					break;
				case "skin":
					r = this.loadSkin(t);
					break;
				case "animation":
					r = this._invokeOne(function(e) {
						return e.loadAnimation && e.loadAnimation(t);
					});
					break;
				case "camera":
					r = this.loadCamera(t);
					break;
				default:
					if (r = this._invokeOne(function(n) {
						return n != this && n.getDependency && n.getDependency(e, t);
					}), !r) throw Error("Unknown type: " + e);
					break;
			}
			this.cache.add(n, r);
		}
		return r;
	}
	getDependencies(e) {
		let t = this.cache.get(e);
		if (!t) {
			let n = this, r = this.json[e + (e === "mesh" ? "es" : "s")] || [];
			t = Promise.all(r.map(function(t, r) {
				return n.getDependency(e, r);
			})), this.cache.add(e, t);
		}
		return t;
	}
	loadBuffer(e) {
		let t = this.json.buffers[e], n = this.fileLoader;
		if (t.type && t.type !== "arraybuffer") throw Error("THREE.GLTFLoader: " + t.type + " buffer type is not supported.");
		if (t.uri === void 0 && e === 0) return Promise.resolve(this.extensions[vE.KHR_BINARY_GLTF].body);
		let r = this.options;
		return new Promise(function(e, i) {
			n.load(It.resolveURL(t.uri, r.path), e, void 0, function() {
				i(/* @__PURE__ */ Error("THREE.GLTFLoader: Failed to load buffer \"" + t.uri + "\"."));
			});
		});
	}
	loadBufferView(e) {
		let t = this.json.bufferViews[e];
		return this.getDependency("buffer", t.buffer).then(function(e) {
			let n = t.byteLength || 0, r = t.byteOffset || 0;
			return e.slice(r, r + n);
		});
	}
	loadAccessor(e) {
		let t = this, n = this.json, r = this.json.accessors[e];
		if (r.bufferView === void 0 && r.sparse === void 0) {
			let e = ZE[r.type], t = JE[r.componentType], n = r.normalized === !0, i = new t(r.count * e);
			return Promise.resolve(new Ue(i, e, n));
		}
		let i = [];
		return r.bufferView === void 0 ? i.push(null) : i.push(this.getDependency("bufferView", r.bufferView)), r.sparse !== void 0 && (i.push(this.getDependency("bufferView", r.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", r.sparse.values.bufferView))), Promise.all(i).then(function(e) {
			let i = e[0], a = ZE[r.type], o = JE[r.componentType], s = o.BYTES_PER_ELEMENT, c = s * a, l = r.byteOffset || 0, u = r.bufferView === void 0 ? void 0 : n.bufferViews[r.bufferView].byteStride, d = r.normalized === !0, f, p;
			if (u && u !== c) {
				let e = Math.floor(l / u), n = "InterleavedBuffer:" + r.bufferView + ":" + r.componentType + ":" + e + ":" + r.count, c = t.cache.get(n);
				c || (f = new o(i, e * u, r.count * u / s), c = new _n(f, u / s), t.cache.add(n, c)), p = new en(c, a, l % u / s, d);
			} else f = i === null ? new o(r.count * a) : new o(i, l, r.count * a), p = new Ue(f, a, d);
			if (r.sparse !== void 0) {
				let t = ZE.SCALAR, n = JE[r.sparse.indices.componentType], s = r.sparse.indices.byteOffset || 0, c = r.sparse.values.byteOffset || 0, l = new n(e[1], s, r.sparse.count * t), u = new o(e[2], c, r.sparse.count * a);
				i !== null && (p = new Ue(p.array.slice(), p.itemSize, p.normalized)), p.normalized = !1;
				for (let e = 0, t = l.length; e < t; e++) {
					let t = l[e];
					if (p.setX(t, u[e * a]), a >= 2 && p.setY(t, u[e * a + 1]), a >= 3 && p.setZ(t, u[e * a + 2]), a >= 4 && p.setW(t, u[e * a + 3]), a >= 5) throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
				}
				p.normalized = d;
			}
			return p;
		});
	}
	loadTexture(e) {
		let t = this.json, n = this.options, r = t.textures[e].source, i = t.images[r], a = this.textureLoader;
		if (i.uri) {
			let e = n.manager.getHandler(i.uri);
			e !== null && (a = e);
		}
		return this.loadTextureImage(e, r, a);
	}
	loadTextureImage(e, t, n) {
		let r = this, i = this.json, a = i.textures[e], o = i.images[t], s = (o.uri || o.bufferView) + ":" + a.sampler;
		if (this.textureCache[s]) return this.textureCache[s];
		let c = this.loadImageSource(t, n).then(function(t) {
			t.flipY = !1, t.name = a.name || o.name || "", t.name === "" && typeof o.uri == "string" && o.uri.startsWith("data:image/") === !1 && (t.name = o.uri);
			let n = (i.samplers || {})[a.sampler] || {};
			return t.magFilter = YE[n.magFilter] || 1006, t.minFilter = YE[n.minFilter] || 1008, t.wrapS = XE[n.wrapS] || 1e3, t.wrapT = XE[n.wrapT] || 1e3, t.generateMipmaps = !t.isCompressedTexture && t.minFilter !== 1003 && t.minFilter !== 1006, r.associations.set(t, { textures: e }), t;
		}).catch(function() {
			return null;
		});
		return this.textureCache[s] = c, c;
	}
	loadImageSource(e, t) {
		let n = this, r = this.json, i = this.options;
		if (this.sourceCache[e] !== void 0) return this.sourceCache[e].then((e) => e.clone());
		let a = r.images[e], o = self.URL || self.webkitURL, s = a.uri || "", c = !1;
		if (a.bufferView !== void 0) s = n.getDependency("bufferView", a.bufferView).then(function(e) {
			c = !0;
			let t = new Blob([e], { type: a.mimeType });
			return s = o.createObjectURL(t), s;
		});
		else if (a.uri === void 0) throw Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
		let l = Promise.resolve(s).then(function(e) {
			return new Promise(function(n, r) {
				let a = n;
				t.isImageBitmapLoader === !0 && (a = function(e) {
					let t = new Dt(e);
					t.needsUpdate = !0, n(t);
				}), t.load(It.resolveURL(e, i.path), a, void 0, r);
			});
		}).then(function(e) {
			return c === !0 && o.revokeObjectURL(s), iD(e, a), e.userData.mimeType = a.mimeType || uD(a.uri), e;
		}).catch(function(e) {
			throw console.error("THREE.GLTFLoader: Couldn't load texture", s), e;
		});
		return this.sourceCache[e] = l, l;
	}
	assignTexture(e, t, n, r) {
		let i = this;
		return this.getDependency("texture", n.index).then(function(a) {
			if (!a) return null;
			if (n.texCoord !== void 0 && n.texCoord > 0 && (a = a.clone(), a.channel = n.texCoord), i.extensions[vE.KHR_TEXTURE_TRANSFORM]) {
				let e = n.extensions === void 0 ? void 0 : n.extensions[vE.KHR_TEXTURE_TRANSFORM];
				if (e) {
					let t = i.associations.get(a);
					a = i.extensions[vE.KHR_TEXTURE_TRANSFORM].extendTexture(a, e), i.associations.set(a, t);
				}
			}
			return r !== void 0 && (a.colorSpace = r), e[t] = a, a;
		});
	}
	assignFinalMaterial(e) {
		let t = e.geometry, n = e.material, r = t.attributes.tangent === void 0, i = t.attributes.color !== void 0, a = t.attributes.normal === void 0;
		if (e.isPoints) {
			let e = "PointsMaterial:" + n.uuid, t = this.cache.get(e);
			t || (t = new Mn(), _t.prototype.copy.call(t, n), t.color.copy(n.color), t.map = n.map, t.sizeAttenuation = !1, this.cache.add(e, t)), n = t;
		} else if (e.isLine) {
			let e = "LineBasicMaterial:" + n.uuid, t = this.cache.get(e);
			t || (t = new Tt(), _t.prototype.copy.call(t, n), t.color.copy(n.color), t.map = n.map, this.cache.add(e, t)), n = t;
		}
		if (r || i || a) {
			let e = "ClonedMaterial:" + n.uuid + ":";
			r && (e += "derivative-tangents:"), i && (e += "vertex-colors:"), a && (e += "flat-shading:");
			let t = this.cache.get(e);
			t || (t = n.clone(), i && (t.vertexColors = !0), a && (t.flatShading = !0), r && (t.normalScale && (t.normalScale.y *= -1), t.clearcoatNormalScale && (t.clearcoatNormalScale.y *= -1)), this.cache.add(e, t), this.associations.set(t, this.associations.get(n))), n = t;
		}
		e.material = n;
	}
	getMaterialType() {
		return Ee;
	}
	loadMaterial(e) {
		let t = this, n = this.json, r = this.extensions, i = n.materials[e], a, o = {}, s = i.extensions || {}, c = [];
		if (s[vE.KHR_MATERIALS_UNLIT]) {
			let e = r[vE.KHR_MATERIALS_UNLIT];
			a = e.getMaterialType(), c.push(e.extendParams(o, i, t));
		} else {
			let n = i.pbrMetallicRoughness || {};
			if (o.color = new Xe(1, 1, 1), o.opacity = 1, Array.isArray(n.baseColorFactor)) {
				let e = n.baseColorFactor;
				o.color.setRGB(e[0], e[1], e[2], Qt), o.opacity = e[3];
			}
			n.baseColorTexture !== void 0 && c.push(t.assignTexture(o, "map", n.baseColorTexture, kt)), o.metalness = n.metallicFactor === void 0 ? 1 : n.metallicFactor, o.roughness = n.roughnessFactor === void 0 ? 1 : n.roughnessFactor, n.metallicRoughnessTexture !== void 0 && (c.push(t.assignTexture(o, "metalnessMap", n.metallicRoughnessTexture)), c.push(t.assignTexture(o, "roughnessMap", n.metallicRoughnessTexture))), a = this._invokeOne(function(t) {
				return t.getMaterialType && t.getMaterialType(e);
			}), c.push(Promise.all(this._invokeAll(function(t) {
				return t.extendMaterialParams && t.extendMaterialParams(e, o);
			})));
		}
		i.doubleSided === !0 && (o.side = 2);
		let l = i.alphaMode || tD.OPAQUE;
		if (l === tD.BLEND ? (o.transparent = !0, o.depthWrite = !1) : (o.transparent = !1, l === tD.MASK && (o.alphaTest = i.alphaCutoff === void 0 ? .5 : i.alphaCutoff)), i.normalTexture !== void 0 && a !== et && (c.push(t.assignTexture(o, "normalMap", i.normalTexture)), o.normalScale = new gt(1, 1), i.normalTexture.scale !== void 0)) {
			let e = i.normalTexture.scale;
			o.normalScale.set(e, e);
		}
		if (i.occlusionTexture !== void 0 && a !== et && (c.push(t.assignTexture(o, "aoMap", i.occlusionTexture)), i.occlusionTexture.strength !== void 0 && (o.aoMapIntensity = i.occlusionTexture.strength)), i.emissiveFactor !== void 0 && a !== et) {
			let e = i.emissiveFactor;
			o.emissive = new Xe().setRGB(e[0], e[1], e[2], Qt);
		}
		return i.emissiveTexture !== void 0 && a !== et && c.push(t.assignTexture(o, "emissiveMap", i.emissiveTexture, kt)), Promise.all(c).then(function() {
			let n = new a(o);
			return i.name && (n.name = i.name), iD(n, i), t.associations.set(n, { materials: e }), i.extensions && rD(r, n, i), n;
		});
	}
	createUniqueName(e) {
		let t = be.sanitizeNodeName(e || "");
		return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);
	}
	loadGeometries(e) {
		let t = this, n = this.extensions, r = this.primitiveCache;
		function i(e) {
			return n[vE.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e, t).then(function(n) {
				return mD(n, e, t);
			});
		}
		let a = [];
		for (let n = 0, o = e.length; n < o; n++) {
			let o = e[n], s = sD(o), c = r[s];
			if (c) a.push(c.promise);
			else {
				let e;
				e = o.extensions && o.extensions[vE.KHR_DRACO_MESH_COMPRESSION] ? i(o) : mD(new qe(), o, t), r[s] = {
					primitive: o,
					promise: e
				}, a.push(e);
			}
		}
		return Promise.all(a);
	}
	loadMesh(e) {
		let t = this, n = this.json, r = this.extensions, i = n.meshes[e], a = i.primitives, o = [];
		for (let e = 0, t = a.length; e < t; e++) {
			let t = a[e].material === void 0 ? nD(this.cache) : this.getDependency("material", a[e].material);
			o.push(t);
		}
		return o.push(t.loadGeometries(a)), Promise.all(o).then(function(n) {
			let o = n.slice(0, n.length - 1), s = n[n.length - 1], c = [];
			for (let n = 0, l = s.length; n < l; n++) {
				let l = s[n], u = a[n], d, f = o[n];
				if (u.mode === qE.TRIANGLES || u.mode === qE.TRIANGLE_STRIP || u.mode === qE.TRIANGLE_FAN || u.mode === void 0) d = i.isSkinnedMesh === !0 ? new Vt(l, f) : new Dn(l, f), d.isSkinnedMesh === !0 && d.normalizeSkinWeights(), u.mode === qE.TRIANGLE_STRIP ? d.geometry = dE(d.geometry, 1) : u.mode === qE.TRIANGLE_FAN && (d.geometry = dE(d.geometry, 2));
				else if (u.mode === qE.LINES) d = new bn(l, f);
				else if (u.mode === qE.LINE_STRIP) d = new rn(l, f);
				else if (u.mode === qE.LINE_LOOP) d = new Yt(l, f);
				else if (u.mode === qE.POINTS) d = new Ze(l, f);
				else throw Error("THREE.GLTFLoader: Primitive mode unsupported: " + u.mode);
				Object.keys(d.geometry.morphAttributes).length > 0 && oD(d, i), d.name = t.createUniqueName(i.name || "mesh_" + e), iD(d, i), u.extensions && rD(r, d, u), t.assignFinalMaterial(d), c.push(d);
			}
			for (let n = 0, r = c.length; n < r; n++) t.associations.set(c[n], {
				meshes: e,
				primitives: n
			});
			if (c.length === 1) return i.extensions && rD(r, c[0], i), c[0];
			let l = new Fe();
			i.extensions && rD(r, l, i), t.associations.set(l, { meshes: e });
			for (let e = 0, t = c.length; e < t; e++) l.add(c[e]);
			return l;
		});
	}
	loadCamera(e) {
		let t, n = this.json.cameras[e], r = n[n.type];
		if (!r) {
			console.warn("THREE.GLTFLoader: Missing camera parameters.");
			return;
		}
		return n.type === "perspective" ? t = new Je(Sn.radToDeg(r.yfov), r.aspectRatio || 1, r.znear || 1, r.zfar || 2e6) : n.type === "orthographic" && (t = new We(-r.xmag, r.xmag, r.ymag, -r.ymag, r.znear, r.zfar)), n.name && (t.name = this.createUniqueName(n.name)), iD(t, n), Promise.resolve(t);
	}
	loadSkin(e) {
		let t = this.json.skins[e], n = [];
		for (let e = 0, r = t.joints.length; e < r; e++) n.push(this._loadNodeShallow(t.joints[e]));
		return t.inverseBindMatrices === void 0 ? n.push(null) : n.push(this.getDependency("accessor", t.inverseBindMatrices)), Promise.all(n).then(function(e) {
			let n = e.pop(), r = e, i = [], a = [];
			for (let e = 0, o = r.length; e < o; e++) {
				let o = r[e];
				if (o) {
					i.push(o);
					let t = new Ct();
					n !== null && t.fromArray(n.array, e * 16), a.push(t);
				} else console.warn("THREE.GLTFLoader: Joint \"%s\" could not be found.", t.joints[e]);
			}
			return new dn(i, a);
		});
	}
	loadAnimation(e) {
		let t = this.json, n = this, r = t.animations[e], i = r.name ? r.name : "animation_" + e, a = [], o = [], s = [], c = [], l = [];
		for (let e = 0, t = r.channels.length; e < t; e++) {
			let t = r.channels[e], n = r.samplers[t.sampler], i = t.target, u = i.node, d = r.parameters === void 0 ? n.input : r.parameters[n.input], f = r.parameters === void 0 ? n.output : r.parameters[n.output];
			i.node !== void 0 && (a.push(this.getDependency("node", u)), o.push(this.getDependency("accessor", d)), s.push(this.getDependency("accessor", f)), c.push(n), l.push(i));
		}
		return Promise.all([
			Promise.all(a),
			Promise.all(o),
			Promise.all(s),
			Promise.all(c),
			Promise.all(l)
		]).then(function(e) {
			let t = e[0], a = e[1], o = e[2], s = e[3], c = e[4], l = [];
			for (let e = 0, r = t.length; e < r; e++) {
				let r = t[e], i = a[e], u = o[e], d = s[e], f = c[e];
				if (r === void 0) continue;
				r.updateMatrix && r.updateMatrix();
				let p = n._createAnimationTracks(r, i, u, d, f);
				if (p) for (let e = 0; e < p.length; e++) l.push(p[e]);
			}
			let u = new Gt(i, void 0, l);
			return iD(u, r), u;
		});
	}
	createNodeMesh(e) {
		let t = this.json, n = this, r = t.nodes[e];
		return r.mesh === void 0 ? null : n.getDependency("mesh", r.mesh).then(function(e) {
			let t = n._getNodeRef(n.meshCache, r.mesh, e);
			return r.weights !== void 0 && t.traverse(function(e) {
				if (e.isMesh) for (let t = 0, n = r.weights.length; t < n; t++) e.morphTargetInfluences[t] = r.weights[t];
			}), t;
		});
	}
	loadNode(e) {
		let t = this.json, n = this, r = t.nodes[e], i = n._loadNodeShallow(e), a = [], o = r.children || [];
		for (let e = 0, t = o.length; e < t; e++) a.push(n.getDependency("node", o[e]));
		let s = r.skin === void 0 ? Promise.resolve(null) : n.getDependency("skin", r.skin);
		return Promise.all([
			i,
			Promise.all(a),
			s
		]).then(function(e) {
			let t = e[0], n = e[1], r = e[2];
			r !== null && t.traverse(function(e) {
				e.isSkinnedMesh && e.bind(r, dD);
			});
			for (let e = 0, r = n.length; e < r; e++) t.add(n[e]);
			if (t.userData.pivot !== void 0 && n.length > 0) {
				let e = t.userData.pivot, r = n[0];
				t.pivot = new I().fromArray(e), t.position.x -= e[0], t.position.y -= e[1], t.position.z -= e[2], r.position.set(0, 0, 0), delete t.userData.pivot;
			}
			return t;
		});
	}
	_loadNodeShallow(e) {
		let t = this.json, n = this.extensions, r = this;
		if (this.nodeCache[e] !== void 0) return this.nodeCache[e];
		let i = t.nodes[e], a = i.name ? r.createUniqueName(i.name) : "", o = [], s = r._invokeOne(function(t) {
			return t.createNodeMesh && t.createNodeMesh(e);
		});
		return s && o.push(s), i.camera !== void 0 && o.push(r.getDependency("camera", i.camera).then(function(e) {
			return r._getNodeRef(r.cameraCache, i.camera, e);
		})), r._invokeAll(function(t) {
			return t.createNodeAttachment && t.createNodeAttachment(e);
		}).forEach(function(e) {
			o.push(e);
		}), this.nodeCache[e] = Promise.all(o).then(function(t) {
			let o;
			if (o = i.isBone === !0 ? new Ut() : t.length > 1 ? new Fe() : t.length === 1 ? t[0] : new He(), o !== t[0]) for (let e = 0, n = t.length; e < n; e++) o.add(t[e]);
			if (i.name && (o.userData.name = i.name, o.name = a), iD(o, i), i.extensions && rD(n, o, i), i.matrix !== void 0) {
				let e = new Ct();
				e.fromArray(i.matrix), o.applyMatrix4(e);
			} else i.translation !== void 0 && o.position.fromArray(i.translation), i.rotation !== void 0 && o.quaternion.fromArray(i.rotation), i.scale !== void 0 && o.scale.fromArray(i.scale);
			if (!r.associations.has(o)) r.associations.set(o, {});
			else if (i.mesh !== void 0 && r.meshCache.refs[i.mesh] > 1) {
				let e = r.associations.get(o);
				r.associations.set(o, { ...e });
			}
			return r.associations.get(o).nodes = e, o;
		}), this.nodeCache[e];
	}
	loadScene(e) {
		let t = this.extensions, n = this.json.scenes[e], r = this, i = new Fe();
		n.name && (i.name = r.createUniqueName(n.name)), iD(i, n), n.extensions && rD(t, i, n);
		let a = n.nodes || [], o = [];
		for (let e = 0, t = a.length; e < t; e++) o.push(r.getDependency("node", a[e]));
		return Promise.all(o).then(function(e) {
			for (let t = 0, n = e.length; t < n; t++) {
				let n = e[t];
				n.parent === null ? i.add(n) : i.add(pE(n));
			}
			return r.associations = ((e) => {
				let t = /* @__PURE__ */ new Map();
				for (let [e, n] of r.associations) (e instanceof _t || e instanceof Dt) && t.set(e, n);
				return e.traverse((e) => {
					let n = r.associations.get(e);
					n != null && t.set(e, n);
				}), t;
			})(i), i;
		});
	}
	_createAnimationTracks(e, t, n, r, i) {
		let a = [], o = e.name ? e.name : e.uuid, s = [];
		function c(e) {
			e.morphTargetInfluences && s.push(e.name ? e.name : e.uuid);
		}
		$E[i.path] === $E.weights ? (c(e), e.isGroup && e.children.forEach(c)) : s.push(o);
		let l;
		switch ($E[i.path]) {
			case $E.weights:
				l = Wt;
				break;
			case $E.rotation:
				l = Me;
				break;
			case $E.translation:
			case $E.scale:
				l = St;
				break;
			default:
				switch (n.itemSize) {
					case 1:
						l = Wt;
						break;
					default:
						l = St;
						break;
				}
				break;
		}
		let u = r.interpolation === void 0 ? bt : eD[r.interpolation], d = this._getArrayFromAccessor(n);
		for (let e = 0, n = s.length; e < n; e++) {
			let n = new l(s[e] + "." + $E[i.path], t.array, d, u);
			r.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(n), a.push(n);
		}
		return a;
	}
	_getArrayFromAccessor(e) {
		let t = e.array;
		if (e.normalized) {
			let e = lD(t.constructor), n = new Float32Array(t.length);
			for (let r = 0, i = t.length; r < i; r++) n[r] = t[r] * e;
			t = n;
		}
		return t;
	}
	_createCubicSplineTrackInterpolant(e) {
		e.createInterpolant = function(e) {
			return new (this instanceof Me ? KE : WE)(this.times, this.values, this.getValueSize() / 3, e);
		}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
	}
};
function pD(e, t, n) {
	let r = t.attributes, i = new Ve();
	if (r.POSITION !== void 0) {
		let e = n.json.accessors[r.POSITION], t = e.min, a = e.max;
		if (t !== void 0 && a !== void 0) {
			if (i.set(new I(t[0], t[1], t[2]), new I(a[0], a[1], a[2])), e.normalized) {
				let t = lD(JE[e.componentType]);
				i.min.multiplyScalar(t), i.max.multiplyScalar(t);
			}
		} else {
			console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
			return;
		}
	} else return;
	let a = t.targets;
	if (a !== void 0) {
		let e = new I(), t = new I();
		for (let r = 0, i = a.length; r < i; r++) {
			let i = a[r];
			if (i.POSITION !== void 0) {
				let r = n.json.accessors[i.POSITION], a = r.min, o = r.max;
				if (a !== void 0 && o !== void 0) {
					if (t.setX(Math.max(Math.abs(a[0]), Math.abs(o[0]))), t.setY(Math.max(Math.abs(a[1]), Math.abs(o[1]))), t.setZ(Math.max(Math.abs(a[2]), Math.abs(o[2]))), r.normalized) {
						let e = lD(JE[r.componentType]);
						t.multiplyScalar(e);
					}
					e.max(t);
				} else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
			}
		}
		i.expandByVector(e);
	}
	e.boundingBox = i;
	let o = new nn();
	i.getCenter(o.center), o.radius = i.min.distanceTo(i.max) / 2, e.boundingSphere = o;
}
function mD(e, t, n) {
	let r = t.attributes, i = [];
	function a(t, r) {
		return n.getDependency("accessor", t).then(function(t) {
			e.setAttribute(r, t);
		});
	}
	for (let t in r) {
		let n = QE[t] || t.toLowerCase();
		n in e.attributes || i.push(a(r[t], n));
	}
	if (t.indices !== void 0 && !e.index) {
		let r = n.getDependency("accessor", t.indices).then(function(t) {
			e.setIndex(t);
		});
		i.push(r);
	}
	return jn.workingColorSpace !== "srgb-linear" && "COLOR_0" in r && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${jn.workingColorSpace}" not supported.`), iD(e, t), pD(e, t, n), Promise.all(i).then(function() {
		return t.targets === void 0 ? e : aD(e, t.targets, n);
	});
}
//#endregion
//#region ../renderer/src/objects/models/model-asset.ts
var hD = Xm("model");
function gD(e, t) {
	let n = /* @__PURE__ */ new Map(), r = new Ve();
	e.updateMatrixWorld(!0), e.traverse((e) => {
		var t;
		if (!(e instanceof Dn)) return;
		let i = e;
		if (!i.geometry || !i.material) return;
		let a = Array.isArray(i.material) ? i.material[0] : i.material;
		if (!a) return;
		let o = i.geometry.clone();
		o.applyMatrix4(i.matrixWorld), o.computeBoundingBox(), o.boundingBox && r.union(o.boundingBox);
		let s = _D(o), c = `${a.uuid}|${s}`, l = (t = n.get(c)) == null ? {
			material: a,
			signature: s,
			geometries: []
		} : t;
		l.geometries.push(o), n.set(c, l);
	});
	let i = [];
	for (let [e, { material: r, signature: a, geometries: o }] of n) {
		let n = o.length === 1 ? o[0] : lE(o);
		if (!n) {
			hD.warn("model %s: dropped a part, %d geometries would not merge — material \"%s\" (%s), %s", t, o.length, r.name, r.uuid, a);
			continue;
		}
		i.push({
			id: e,
			geometry: n,
			material: r
		});
	}
	return {
		url: t,
		parts: i,
		extents: r
	};
}
function _D(e) {
	return `${e.getIndex() ? "indexed" : "non-indexed"} [${Object.keys(e.attributes).sort().join(", ")}]`;
}
//#endregion
//#region ../renderer/src/objects/models/gltf-cache.ts
function vD(e) {
	let t = xD.get(e);
	if (t) return t;
	let n = yD(e).catch((t) => {
		throw xD.delete(e), t;
	});
	return xD.set(e, n), n;
}
async function yD(e) {
	return gD((await bD().loadAsync(e)).scene, e);
}
function bD() {
	return SD != null || (SD = new hE().setMeshoptDecoder(cE)), SD;
}
var xD = /* @__PURE__ */ new Map(), SD, CD = "instanceOpacity", wD = ["opaque", "translucent"];
function TD(e) {
	var t;
	return ((t = e.opacity) == null ? 1 : t) < 1 ? "translucent" : "opaque";
}
var ED = class extends SC {
	constructor(e, t, n = "opaque") {
		super({ schema: AD }), this.args = void 0, this.kind = void 0, this.meshMatrix = OD, this.extents = void 0, this.extents = e.clone().applyMatrix4(OD), this.kind = n, this.args = [{ capacity: Math.max(t, 1) }];
	}
	setPaintOrder() {}
	place(e, t) {
		this.mesh.setMatrixAt(e, zD.multiplyMatrices(kD, DD(this.extents, t.bounds)).multiply(OD));
	}
	setOpacity(e, t) {
		var n;
		let r = this.kind === "translucent" ? (n = t.opacity) == null ? 1 : n : 1;
		this.mesh.setUniformAt(e, CD, r);
	}
	addInstance() {
		let e = -1;
		return this.mesh.addInstances(1, (t) => {
			e = t;
		}), e;
	}
	removeInstance(e) {
		this.mesh.removeInstances(e);
	}
};
function DD(e, t) {
	e.getSize(MD), e.getCenter(ND);
	let n = Math.min(MD.x > 0 ? t.size.x / MD.x : 1, MD.y > 0 ? t.size.y / MD.y : 1);
	return LD.makeTranslation(-ND.x, -ND.y, -e.min.z), PD.set(t.center.x, t.center.y, t.elevation), ID.setFromAxisAngle(jD, t.rotation), FD.setScalar(n), RD.compose(PD, ID, FD).multiply(LD);
}
var OD = new Ct().makeRotationX(-Math.PI / 2).multiply(new Ct().makeScale(1, -1, 1)), kD = OD.clone().invert(), AD = {
	fragment: { [CD]: "float" },
	vertex: { ...hb.vertex }
}, jD = new I(0, 0, 1), MD = new I(), ND = new I(), PD = new I(), FD = new I(), ID = new ot(), LD = new Ct(), RD = new Ct(), zD = new Ct(), BD = (0, L.memo)(function(e) {
	let t = (0, U.c)(3), { def: n, container: r } = e, i;
	return t[0] !== r || t[1] !== n ? (i = (e) => {
		r.place(e, n), r.setOpacity(e, n), TD(n) !== r.kind && r.reportKindMismatch();
	}, t[0] = r, t[1] = n, t[2] = i) : i = t[2], TS(r, n, null, i), null;
}), VD = Xm("models");
function HD(e) {
	var t;
	let n = (0, U.c)(22), { defs: r } = e, i = (t = e.mounted) == null ? r.length : t, a;
	n[0] === r ? a = n[1] : (a = () => GD(r, void 0), n[0] = r, n[1] = a);
	let [o, s] = (0, L.useState)(a);
	o.defs !== r && s((e) => GD(r, e.batches));
	let c;
	n[2] === r ? c = n[3] : (c = function() {
		s((e) => GD(r, e.batches));
	}, n[2] = r, n[3] = c);
	let l = c, u;
	n[4] === r ? u = n[5] : (u = YD(r), n[4] = r, n[5] = u);
	let d = u, [f, p] = (0, L.useState)(d);
	rE(f, d) || p(d);
	let m;
	n[6] === Symbol.for("react.memo_cache_sentinel") ? (m = [], n[6] = m) : m = n[6];
	let [h, g] = (0, L.useState)(m), _ = xt(WD), v, y;
	n[7] !== _ || n[8] !== f ? (v = () => {
		let e = !0;
		return Promise.all(f.map(JD)).then((t) => {
			e && (g(t.filter(UD)), _());
		}), () => {
			e = !1;
		};
	}, y = [f, _], n[7] = _, n[8] = f, n[9] = v, n[10] = y) : (v = n[9], y = n[10]), (0, L.useEffect)(v, y);
	let b;
	if (n[11] !== h || n[12] !== i || n[13] !== o.batches || n[14] !== l) {
		let e;
		n[16] !== i || n[17] !== o.batches || n[18] !== l ? (e = (e) => /* @__PURE__ */ (0, R.jsx)(L.Fragment, { children: wD.map((t, n) => {
			let r = o.batches[t].get(e.url);
			return r ? /* @__PURE__ */ (0, R.jsx)(L.Fragment, { children: e.parts.map((a) => /* @__PURE__ */ (0, R.jsx)(qD, {
				asset: e,
				part: a,
				defs: r,
				mounted: i,
				kind: t,
				renderOrder: n,
				onKindMismatch: l
			}, a.id)) }, t) : null;
		}) }, e.url), n[16] = i, n[17] = o.batches, n[18] = l, n[19] = e) : e = n[19], b = h.map(e), n[11] = h, n[12] = i, n[13] = o.batches, n[14] = l, n[15] = b;
	} else b = n[15];
	let x;
	return n[20] === b ? x = n[21] : (x = /* @__PURE__ */ (0, R.jsx)(R.Fragment, { children: b }), n[20] = b, n[21] = x), x;
}
function UD(e) {
	return e !== void 0;
}
function WD(e) {
	return e.invalidate;
}
function GD(e, t) {
	let n = {
		opaque: KD(t == null ? void 0 : t.opaque),
		translucent: KD(t == null ? void 0 : t.translucent)
	};
	for (let t of e) {
		let e = n[TD(t)], r = e.get(t.url);
		r ? r.push(t) : e.set(t.url, [t]);
	}
	return {
		defs: e,
		batches: n
	};
}
function KD(e) {
	let t = /* @__PURE__ */ new Map();
	if (e) for (let n of e.keys()) t.set(n, []);
	return t;
}
function qD(e) {
	var t;
	let n = (0, U.c)(29), { asset: r, part: i, defs: a, kind: o, renderOrder: s, onKindMismatch: c } = e, l = (t = e.mounted) == null ? a.length : t, u;
	n[0] !== r.extents || n[1] !== a.length || n[2] !== o ? (u = () => new ED(r.extents, a.length, o), n[0] = r.extents, n[1] = a.length, n[2] = o, n[3] = u) : u = n[3];
	let d = CS(u, a, c), f = iE(), p;
	n[4] !== d || n[5] !== o || n[6] !== f ? (p = (e) => {
		d.bind(e), f(o === "opaque" ? e : null);
	}, n[4] = d, n[5] = o, n[6] = f, n[7] = p) : p = n[7];
	let m;
	n[8] === i.geometry ? m = n[9] : (m = /* @__PURE__ */ (0, R.jsx)("primitive", {
		object: i.geometry,
		attach: "geometry",
		dispose: null
	}), n[8] = i.geometry, n[9] = m);
	let h = o === "translucent", g;
	n[10] !== i.material || n[11] !== h ? (g = /* @__PURE__ */ (0, R.jsx)(oE, {
		source: i.material,
		opacityUniform: CD,
		translucent: h
	}), n[10] = i.material, n[11] = h, n[12] = g) : g = n[12];
	let _;
	n[13] !== d.args || n[14] !== d.meshMatrix || n[15] !== s || n[16] !== p || n[17] !== m || n[18] !== g ? (_ = /* @__PURE__ */ (0, R.jsxs)(Wx, {
		args: d.args,
		ref: p,
		matrixAutoUpdate: !1,
		matrix: d.meshMatrix,
		sortObjects: !0,
		renderOrder: s,
		children: [m, g]
	}), n[13] = d.args, n[14] = d.meshMatrix, n[15] = s, n[16] = p, n[17] = m, n[18] = g, n[19] = _) : _ = n[19];
	let v;
	if (n[20] !== d || n[21] !== a || n[22] !== l) {
		let e;
		n[24] === d ? e = n[25] : (e = (e) => /* @__PURE__ */ (0, R.jsx)(BD, {
			def: e,
			container: d
		}, jS(e)), n[24] = d, n[25] = e), v = a.slice(0, l).map(e), n[20] = d, n[21] = a, n[22] = l, n[23] = v;
	} else v = n[23];
	let y;
	return n[26] !== _ || n[27] !== v ? (y = /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [_, v] }), n[26] = _, n[27] = v, n[28] = y) : y = n[28], y;
}
async function JD(e) {
	try {
		return await vD(e);
	} catch (t) {
		VD.warn("failed to load model %s: %O", e, t);
		return;
	}
}
function YD(e) {
	return [...new Set(e.map((e) => e.url))].sort();
}
var XD = jt(class extends _e {
	constructor(...e) {
		super(...e), this.uniforms = new cx(), this.patchedMaterial = null;
	}
	addUniforms(e) {
		this.uniforms.add(e, this.maxInstanceCount), this.patchedMaterial && (this.patchedMaterial.needsUpdate = !0);
	}
	getUniformAt(e, t, n) {
		return this.uniforms.get(e, t, n);
	}
	setUniformAt(e, t, n) {
		this.uniforms.set(e, t, n);
	}
	raycast(e, t) {
		let n = t.length;
		super.raycast(e, t);
		for (let e = n; e < t.length; e++) t[e].instanceId = t[e].batchId;
	}
	onBeforeRender(e, t, n, r, i, a) {
		super.onBeforeRender(e, t, n, r, i, a), this.uniforms.texture && (this.patchMaterial(), this.uniforms.texture.update(e));
	}
	addInstance(e) {
		let t = super.addInstance(e);
		return this.invalidateBounds(), t;
	}
	deleteInstance(e) {
		return super.deleteInstance(e), this.invalidateBounds(), this;
	}
	setMatrixAt(e, t) {
		return super.setMatrixAt(e, t), this.invalidateBounds(), this;
	}
	setInstanceCount(e) {
		super.setInstanceCount(e), this.uniforms.resize(e);
	}
	dispose() {
		super.dispose(), this.uniforms.dispose();
	}
	invalidateBounds() {
		this.boundingBox = null, this.boundingSphere = null;
	}
	patchMaterial() {
		let e = this.material;
		if (Array.isArray(e) || e === this.patchedMaterial) return;
		let t = "batchIndex", n = `float ${t} = getIndirectIndex( gl_DrawID ) + 0.5;`;
		this.patchedMaterial = e;
		let r = e.onBeforeCompile.bind(e), i = e.customProgramCacheKey.bind(e);
		e.customProgramCacheKey = () => `efpBatched_${this.uniforms.shaderKey}_${i()}`, e.onBeforeCompile = (e, i) => {
			this.uniforms.patchShader(e, t) && (e.vertexShader = Sy(e.vertexShader, n)), r(e, i);
		}, e.needsUpdate = !0;
	}
});
//#endregion
//#region ../renderer/src/objects/shapes/shape-geometry.ts
function ZD(e, t) {
	var n, r, i;
	let a = t ? "solid" : "planar";
	if (qr(e) || Jr(e)) return (n = tO[a]) == null ? tO[a] = QD(t) : n;
	let o = eO.get(e);
	return o || (o = {}, eO.set(e, o)), (i = (r = o)[a]) == null ? r[a] = $D(e, t) : i;
}
function QD(e) {
	let t = new Pe().deleteAttribute("uv");
	return e ? t.toNonIndexed() : t.deleteAttribute("normal");
}
function $D(e, t) {
	let n = new qe().setFromPoints(e.vertices).setIndex(e.indices.flat());
	if (!t) return n;
	let r = n.toNonIndexed();
	return r.computeVertexNormals(), fE(r, nO);
}
var eO = /* @__PURE__ */ new WeakMap(), tO = {}, nO = Math.PI / 6, rO = [
	"planar",
	"solid",
	"translucent"
];
function iO(e) {
	return !Xr(e.shape) || e.shape.isPlanar ? "planar" : lC(e.color) ? "translucent" : "solid";
}
var aO = class extends SC {
	constructor(e, t = "planar") {
		super(), this.capacity = void 0, this.kind = void 0, this.geometryIds = /* @__PURE__ */ new Map(), this.allocated = void 0, this.target = void 0, this.kind = t, this.allocated = oO(e, (e) => this.geometryFor(e)), this.capacity = [
			this.allocated.instances,
			this.allocated.vertices,
			this.allocated.indices
		], this.target = {
			instances: this.allocated.instances,
			vertices: this.allocated.vertices,
			indices: this.allocated.indices
		};
	}
	geometryFor(e) {
		return ZD(e, this.kind !== "planar");
	}
	reserve(e) {
		this.target.instances = e.length;
		let t = this.allocated.usedVertices, n = this.allocated.usedIndices, r = /* @__PURE__ */ new Set();
		for (let i of e) {
			let e = this.geometryFor(i.shape);
			this.geometryIds.has(e) || r.has(e) || (r.add(e), t += sO(e), n += cO(e));
		}
		this.target.vertices = t, this.target.indices = n;
	}
	defFromHit(e) {
		return this.defAt(e.batchId);
	}
	addInstance(e) {
		let t = this.geometryIdFor(e);
		return this.mesh.instanceCount === this.mesh.maxInstanceCount && this.mesh.setInstanceCount(Math.max(this.target.instances, this.mesh.maxInstanceCount + 1)), this.mesh.addInstance(t);
	}
	removeInstance(e) {
		this.mesh.deleteInstance(e);
	}
	geometryIdFor(e) {
		let t = this.geometryIds.get(e);
		if (t !== void 0) return t;
		let n = this.allocated.usedVertices + sO(e), r = this.allocated.usedIndices + cO(e);
		(n > this.allocated.vertices || r > this.allocated.indices) && (this.allocated.vertices = Math.max(n, this.target.vertices), this.allocated.indices = Math.max(r, this.target.indices), this.mesh.setGeometrySize(this.allocated.vertices, this.allocated.indices)), this.allocated.usedVertices = n, this.allocated.usedIndices = r;
		let i = this.mesh.addGeometry(e);
		return this.geometryIds.set(e, i), i;
	}
};
function oO(e, t) {
	let n = 0, r = 0, i = /* @__PURE__ */ new Set();
	for (let a of e) {
		let e = t(a.shape);
		i.has(e) || (i.add(e), n += sO(e), r += cO(e));
	}
	return {
		instances: Math.max(e.length, 1),
		vertices: Math.max(n, 1),
		indices: Math.max(r, 1),
		usedVertices: 0,
		usedIndices: 0
	};
}
function sO(e) {
	return e.getAttribute("position").count;
}
function cO(e) {
	var t, n;
	return (t = (n = e.getIndex()) == null ? void 0 : n.count) == null ? 0 : t;
}
//#endregion
//#region ../renderer/src/objects/shapes/ShapeInstance.tsx
var lO = Xm("shape-instance"), uO = (0, L.memo)(function(e) {
	let t = (0, U.c)(6), { def: n, container: r } = e, i;
	t[0] !== r || t[1] !== n.shape ? (i = () => r.geometryFor(n.shape), t[0] = r, t[1] = n.shape, t[2] = i) : i = t[2];
	let a;
	return t[3] !== r || t[4] !== n ? (a = (e) => {
		dC(r.mesh, e, uC(n.shape)), fC(r.mesh, e, n, lO), iO(n) !== r.kind && r.reportKindMismatch();
	}, t[3] = r, t[4] = n, t[5] = a) : a = t[5], TS(r, n, i, a), null;
});
//#endregion
//#region ../renderer/src/objects/shapes/Shapes.tsx
function dO(e) {
	var t;
	let n = (0, U.c)(10), { defs: r } = e, i = (t = e.mounted) == null ? r.length : t, a;
	n[0] === r ? a = n[1] : (a = () => fO(r, {}), n[0] = r, n[1] = a);
	let [o, s] = (0, L.useState)(a);
	o.defs !== r && s((e) => fO(r, e.batches));
	let c;
	n[2] === r ? c = n[3] : (c = function() {
		s((e) => fO(r, e.batches));
	}, n[2] = r, n[3] = c);
	let l = c, { batches: u } = o, d;
	n[4] !== u || n[5] !== i || n[6] !== l ? (d = rO.map((e, t) => {
		let n = u[e];
		return n ? /* @__PURE__ */ (0, R.jsx)(pO, {
			defs: n,
			mounted: i,
			kind: e,
			renderOrder: t,
			onKindMismatch: l
		}, e) : null;
	}), n[4] = u, n[5] = i, n[6] = l, n[7] = d) : d = n[7];
	let f;
	return n[8] === d ? f = n[9] : (f = /* @__PURE__ */ (0, R.jsx)(R.Fragment, { children: d }), n[8] = d, n[9] = f), f;
}
function fO(e, t) {
	var n, r;
	let i = {};
	for (let e of rO) t[e] && (i[e] = []);
	for (let t of e) ((r = i[n = iO(t)]) == null ? i[n] = [] : r).push(t);
	return {
		defs: e,
		batches: i
	};
}
function pO(e) {
	var t;
	let n = (0, U.c)(25), { defs: r, kind: i, renderOrder: a, onKindMismatch: o } = e, s = (t = e.mounted) == null ? r.length : t, c;
	n[0] !== r || n[1] !== i ? (c = () => new aO(r, i), n[0] = r, n[1] = i, n[2] = c) : c = n[2];
	let l = CS(c, r, o), u = iE();
	l.reserve(r);
	let d;
	n[3] !== l || n[4] !== i || n[5] !== u ? (d = (e) => {
		l.bind(e), u(i === "solid" ? e : null);
	}, n[3] = l, n[4] = i, n[5] = u, n[6] = d) : d = n[6];
	let f = i !== "planar", p = i === "translucent", m;
	n[7] !== f || n[8] !== p ? (m = /* @__PURE__ */ (0, R.jsx)(Vb, {
		solid: f,
		translucent: p
	}), n[7] = f, n[8] = p, n[9] = m) : m = n[9];
	let h;
	n[10] !== l.capacity || n[11] !== l.customSort || n[12] !== a || n[13] !== d || n[14] !== m ? (h = /* @__PURE__ */ (0, R.jsx)(XD, {
		args: l.capacity,
		ref: d,
		customSort: l.customSort,
		renderOrder: a,
		children: m
	}), n[10] = l.capacity, n[11] = l.customSort, n[12] = a, n[13] = d, n[14] = m, n[15] = h) : h = n[15];
	let g;
	if (n[16] !== l || n[17] !== r || n[18] !== s) {
		let e;
		n[20] === l ? e = n[21] : (e = (e) => /* @__PURE__ */ (0, R.jsx)(uO, {
			def: e,
			container: l
		}, jS(e)), n[20] = l, n[21] = e), g = r.slice(0, s).map(e), n[16] = l, n[17] = r, n[18] = s, n[19] = g;
	} else g = n[19];
	let _;
	return n[22] !== h || n[23] !== g ? (_ = /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [h, g] }), n[22] = h, n[23] = g, n[24] = _) : _ = n[24], _;
}
//#endregion
//#region ../../node_modules/.pnpm/troika-worker-utils@0.52.0/node_modules/troika-worker-utils/dist/troika-worker-utils.esm.js
function mO() {
	var e = Object.create(null);
	function t(n, i) {
		var a = n.id, o = n.name, s = n.dependencies;
		s === void 0 && (s = []);
		var c = n.init;
		c === void 0 && (c = function() {});
		var l = n.getTransferables;
		if (l === void 0 && (l = null), !e[a]) try {
			s = s.map(function(n) {
				return n && n.isWorkerModule && (t(n, function(e) {
					if (e instanceof Error) throw e;
				}), n = e[n.id].value), n;
			}), c = r("<" + o + ">.init", c), l && (l = r("<" + o + ">.getTransferables", l));
			var u = null;
			typeof c == "function" ? u = c.apply(void 0, s) : console.error("worker module init function failed to rehydrate"), e[a] = {
				id: a,
				value: u,
				getTransferables: l
			}, i(u);
		} catch (e) {
			e && e.noLog || console.error(e), i(e);
		}
	}
	function n(t, n) {
		var r, i = t.id, a = t.args;
		(!e[i] || typeof e[i].value != "function") && n(/* @__PURE__ */ Error("Worker module " + i + ": not found or its 'init' did not return a function"));
		try {
			var o = (r = e[i]).value.apply(r, a);
			o && typeof o.then == "function" ? o.then(s, function(e) {
				return n(e instanceof Error ? e : /* @__PURE__ */ Error("" + e));
			}) : s(o);
		} catch (e) {
			n(e);
		}
		function s(t) {
			try {
				var r = e[i].getTransferables && e[i].getTransferables(t);
				(!r || !Array.isArray(r) || !r.length) && (r = void 0), n(t, r);
			} catch (e) {
				console.error(e), n(e);
			}
		}
	}
	function r(e, t) {
		var n = void 0;
		self.troikaDefine = function(e) {
			return n = e;
		};
		var r = URL.createObjectURL(new Blob(["/** " + e.replace(/\*/g, "") + " **/\n\ntroikaDefine(\n" + t + "\n)"], { type: "application/javascript" }));
		try {
			importScripts(r);
		} catch (e) {
			console.error(e);
		}
		return URL.revokeObjectURL(r), delete self.troikaDefine, n;
	}
	self.addEventListener("message", function(e) {
		var r = e.data, i = r.messageId, a = r.action, o = r.data;
		try {
			a === "registerModule" && t(o, function(e) {
				e instanceof Error ? postMessage({
					messageId: i,
					success: !1,
					error: e.message
				}) : postMessage({
					messageId: i,
					success: !0,
					result: { isCallable: typeof e == "function" }
				});
			}), a === "callModule" && n(o, function(e, t) {
				e instanceof Error ? postMessage({
					messageId: i,
					success: !1,
					error: e.message
				}) : postMessage({
					messageId: i,
					success: !0,
					result: e
				}, t || void 0);
			});
		} catch (e) {
			postMessage({
				messageId: i,
				success: !1,
				error: e.stack
			});
		}
	});
}
function hO(e) {
	var t = function() {
		for (var e = [], n = arguments.length; n--;) e[n] = arguments[n];
		return t._getInitResult().then(function(t) {
			if (typeof t == "function") return t.apply(void 0, e);
			throw Error("Worker module function was called but `init` did not return a callable function");
		});
	};
	return t._getInitResult = function() {
		var n = e.dependencies, r = e.init;
		n = Array.isArray(n) ? n.map(function(e) {
			return e && (e = e.onMainThread || e, e._getInitResult && (e = e._getInitResult())), e;
		}) : [];
		var i = Promise.all(n).then(function(e) {
			return r.apply(null, e);
		});
		return t._getInitResult = function() {
			return i;
		}, i;
	}, t;
}
var gO = function() {
	var e = !1;
	if (typeof window < "u" && window.document !== void 0) try {
		new Worker(URL.createObjectURL(new Blob([""], { type: "application/javascript" }))).terminate(), e = !0;
	} catch (e) {
		console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: [" + e.message + "]");
	}
	return gO = function() {
		return e;
	}, e;
}, _O = 0, vO = 0, yO = !1, bO = Object.create(null), xO = Object.create(null), SO = Object.create(null);
function CO(e) {
	if ((!e || typeof e.init != "function") && !yO) throw Error("requires `options.init` function");
	var t = e.dependencies, n = e.init, r = e.getTransferables, i = e.workerId, a = hO(e);
	i == null && (i = "#default");
	var o = "workerModule" + ++_O, s = e.name || o, c = null;
	t = t && t.map(function(e) {
		return typeof e == "function" && !e.workerModuleData && (yO = !0, e = CO({
			workerId: i,
			name: "<" + s + "> function dependency: " + e.name,
			init: "function(){return (\n" + TO(e) + "\n)}"
		}), yO = !1), e && e.workerModuleData && (e = e.workerModuleData), e;
	});
	function l() {
		for (var e = [], t = arguments.length; t--;) e[t] = arguments[t];
		if (!gO()) return a.apply(void 0, e);
		if (!c) {
			c = DO(i, "registerModule", l.workerModuleData);
			var n = function() {
				c = null, xO[i].delete(n);
			};
			(xO[i] || (xO[i] = /* @__PURE__ */ new Set())).add(n);
		}
		return c.then(function(t) {
			if (t.isCallable) return DO(i, "callModule", {
				id: o,
				args: e
			});
			throw Error("Worker module function was called but `init` did not return a callable function");
		});
	}
	return l.workerModuleData = {
		isWorkerModule: !0,
		id: o,
		name: s,
		dependencies: t,
		init: TO(n),
		getTransferables: r && TO(r)
	}, l.onMainThread = a, l;
}
function wO(e) {
	xO[e] && xO[e].forEach(function(e) {
		e();
	}), bO[e] && (bO[e].terminate(), delete bO[e]);
}
function TO(e) {
	var t = e.toString();
	return !/^function/.test(t) && /^\w+\s*\(/.test(t) && (t = "function " + t), t;
}
function EO(e) {
	var t = bO[e];
	if (!t) {
		var n = TO(mO);
		t = bO[e] = new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: " + e.replace(/\*/g, "") + " **/\n\n;(" + n + ")()"], { type: "application/javascript" }))), t.onmessage = function(e) {
			var t = e.data, n = t.messageId, r = SO[n];
			if (!r) throw Error("WorkerModule response with empty or unknown messageId");
			delete SO[n], r(t);
		};
	}
	return t;
}
function DO(e, t, n) {
	return new Promise(function(r, i) {
		var a = ++vO;
		SO[a] = function(e) {
			e.success ? r(e.result) : i(/* @__PURE__ */ Error("Error in worker " + t + " call: " + e.error));
		}, EO(e).postMessage({
			messageId: a,
			action: t,
			data: n
		});
	});
}
//#endregion
//#region ../../node_modules/.pnpm/webgl-sdf-generator@1.1.1/node_modules/webgl-sdf-generator/dist/webgl-sdf-generator.mjs
function OO() {
	return function(e) {
		function t(e, t, n, r, i, a, o, s) {
			var c = 1 - o;
			s.x = c * c * e + 2 * c * o * n + o * o * i, s.y = c * c * t + 2 * c * o * r + o * o * a;
		}
		function n(e, t, n, r, i, a, o, s, c, l) {
			var u = 1 - c;
			l.x = u * u * u * e + 3 * u * u * c * n + 3 * u * c * c * i + c * c * c * o, l.y = u * u * u * t + 3 * u * u * c * r + 3 * u * c * c * a + c * c * c * s;
		}
		function r(e, t) {
			for (var n = /([MLQCZ])([^MLQCZ]*)/g, r, i, a, o, s; r = n.exec(e);) {
				var c = r[2].replace(/^\s*|\s*$/g, "").split(/[,\s]+/).map(function(e) {
					return parseFloat(e);
				});
				switch (r[1]) {
					case "M":
						o = i = c[0], s = a = c[1];
						break;
					case "L":
						(c[0] !== o || c[1] !== s) && t("L", o, s, o = c[0], s = c[1]);
						break;
					case "Q":
						t("Q", o, s, o = c[2], s = c[3], c[0], c[1]);
						break;
					case "C":
						t("C", o, s, o = c[4], s = c[5], c[0], c[1], c[2], c[3]);
						break;
					case "Z":
						(o !== i || s !== a) && t("L", o, s, i, a);
						break;
				}
			}
		}
		function i(e, i, a) {
			a === void 0 && (a = 16);
			var o = {
				x: 0,
				y: 0
			};
			r(e, function(e, r, s, c, l, u, d, f, p) {
				switch (e) {
					case "L":
						i(r, s, c, l);
						break;
					case "Q":
						for (var m = r, h = s, g = 1; g < a; g++) t(r, s, u, d, c, l, g / (a - 1), o), i(m, h, o.x, o.y), m = o.x, h = o.y;
						break;
					case "C":
						for (var _ = r, v = s, y = 1; y < a; y++) n(r, s, u, d, f, p, c, l, y / (a - 1), o), i(_, v, o.x, o.y), _ = o.x, v = o.y;
						break;
				}
			});
		}
		var a = "precision highp float;attribute vec2 aUV;varying vec2 vUV;void main(){vUV=aUV;gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}", o = /* @__PURE__ */ new WeakMap(), s = {
			premultipliedAlpha: !1,
			preserveDrawingBuffer: !0,
			antialias: !1,
			depth: !1
		};
		function c(e, t) {
			var n = e.getContext ? e.getContext("webgl", s) : e, r = o.get(n);
			if (!r) {
				var i = typeof WebGL2RenderingContext < "u" && n instanceof WebGL2RenderingContext, a = {}, c = {}, l = {}, u = -1, d = [];
				n.canvas.addEventListener("webglcontextlost", function(e) {
					m(), e.preventDefault();
				}, !1);
				function e(e) {
					var t = a[e];
					if (!t && (t = a[e] = n.getExtension(e), !t)) throw Error(e + " not supported");
					return t;
				}
				function t(e, t) {
					var r = n.createShader(t);
					return n.shaderSource(r, e), n.compileShader(r), r;
				}
				function s(r, a, o, s) {
					if (!c[r]) {
						var l = {}, u = {}, d = n.createProgram();
						n.attachShader(d, t(a, n.VERTEX_SHADER)), n.attachShader(d, t(o, n.FRAGMENT_SHADER)), n.linkProgram(d), c[r] = {
							program: d,
							transaction: function(t) {
								n.useProgram(d), t({
									setUniform: function(e, t) {
										for (var r = [], i = arguments.length - 2; i-- > 0;) r[i] = arguments[i + 2];
										var a = u[t] || (u[t] = n.getUniformLocation(d, t));
										n["uniform" + e].apply(n, [a].concat(r));
									},
									setAttribute: function(t, r, a, o, s) {
										var c = l[t];
										c || (c = l[t] = {
											buf: n.createBuffer(),
											loc: n.getAttribLocation(d, t),
											data: null
										}), n.bindBuffer(n.ARRAY_BUFFER, c.buf), n.vertexAttribPointer(c.loc, r, n.FLOAT, !1, 0, 0), n.enableVertexAttribArray(c.loc), i ? n.vertexAttribDivisor(c.loc, o) : e("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(c.loc, o), s !== c.data && (n.bufferData(n.ARRAY_BUFFER, s, a), c.data = s);
									}
								});
							}
						};
					}
					c[r].transaction(s);
				}
				function f(e, t) {
					u++;
					try {
						n.activeTexture(n.TEXTURE0 + u);
						var r = l[e];
						r || (r = l[e] = n.createTexture(), n.bindTexture(n.TEXTURE_2D, r), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MIN_FILTER, n.NEAREST), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MAG_FILTER, n.NEAREST)), n.bindTexture(n.TEXTURE_2D, r), t(r, u);
					} finally {
						u--;
					}
				}
				function p(e, t, r) {
					var i = n.createFramebuffer();
					d.push(i), n.bindFramebuffer(n.FRAMEBUFFER, i), n.activeTexture(n.TEXTURE0 + t), n.bindTexture(n.TEXTURE_2D, e), n.framebufferTexture2D(n.FRAMEBUFFER, n.COLOR_ATTACHMENT0, n.TEXTURE_2D, e, 0);
					try {
						r(i);
					} finally {
						n.deleteFramebuffer(i), n.bindFramebuffer(n.FRAMEBUFFER, d[--d.length - 1] || null);
					}
				}
				function m() {
					a = {}, c = {}, l = {}, u = -1, d.length = 0;
				}
				o.set(n, r = {
					gl: n,
					isWebGL2: i,
					getExtension: e,
					withProgram: s,
					withTexture: f,
					withTextureFramebuffer: p,
					handleContextLoss: m
				});
			}
			t(r);
		}
		function l(e, t, n, r, i, o, s, l) {
			s === void 0 && (s = 15), l === void 0 && (l = null), c(e, function(e) {
				var c = e.gl, u = e.withProgram, d = e.withTexture;
				d("copy", function(e, d) {
					c.texImage2D(c.TEXTURE_2D, 0, c.RGBA, i, o, 0, c.RGBA, c.UNSIGNED_BYTE, t), u("copy", a, "precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){gl_FragColor=texture2D(tex,vUV);}", function(e) {
						var t = e.setUniform, a = e.setAttribute;
						a("aUV", 2, c.STATIC_DRAW, 0, new Float32Array([
							0,
							0,
							2,
							0,
							0,
							2
						])), t("1i", "image", d), c.bindFramebuffer(c.FRAMEBUFFER, l || null), c.disable(c.BLEND), c.colorMask(s & 8, s & 4, s & 2, s & 1), c.viewport(n, r, i, o), c.scissor(n, r, i, o), c.drawArrays(c.TRIANGLES, 0, 3);
					});
				});
			});
		}
		function u(e, t, n) {
			var r = e.width, i = e.height;
			c(e, function(a) {
				var o = a.gl, s = new Uint8Array(r * i * 4);
				o.readPixels(0, 0, r, i, o.RGBA, o.UNSIGNED_BYTE, s), e.width = t, e.height = n, l(o, s, 0, 0, r, i);
			});
		}
		var d = /*#__PURE__*/ Object.freeze({
			__proto__: null,
			withWebGLContext: c,
			renderImageData: l,
			resizeWebGLCanvasWithoutClearing: u
		});
		function f(e, t, n, r, a, o) {
			o === void 0 && (o = 1);
			var s = new Uint8Array(e * t), c = r[2] - r[0], l = r[3] - r[1], u = [];
			i(n, function(e, t, n, r) {
				u.push({
					x1: e,
					y1: t,
					x2: n,
					y2: r,
					minX: Math.min(e, n),
					minY: Math.min(t, r),
					maxX: Math.max(e, n),
					maxY: Math.max(t, r)
				});
			}), u.sort(function(e, t) {
				return e.maxX - t.maxX;
			});
			for (var d = 0; d < e; d++) for (var f = 0; f < t; f++) {
				var p = g(r[0] + c * (d + .5) / e, r[1] + l * (f + .5) / t), m = (1 - Math.abs(p) / a) ** o / 2;
				p < 0 && (m = 1 - m), m = Math.max(0, Math.min(255, Math.round(m * 255))), s[f * e + d] = m;
			}
			return s;
			function g(e, t) {
				for (var n = Infinity, r = Infinity, i = u.length; i--;) {
					var a = u[i];
					if (a.maxX + r <= e) break;
					if (e + r > a.minX && t - r < a.maxY && t + r > a.minY) {
						var o = h(e, t, a.x1, a.y1, a.x2, a.y2);
						o < n && (n = o, r = Math.sqrt(n));
					}
				}
				return _(e, t) && (r = -r), r;
			}
			function _(e, t) {
				for (var n = 0, r = u.length; r--;) {
					var i = u[r];
					if (i.maxX <= e) break;
					i.y1 > t != i.y2 > t && e < (i.x2 - i.x1) * (t - i.y1) / (i.y2 - i.y1) + i.x1 && (n += i.y1 < i.y2 ? 1 : -1);
				}
				return n !== 0;
			}
		}
		function p(e, t, n, r, i, a, o, s, c, l) {
			a === void 0 && (a = 1), s === void 0 && (s = 0), c === void 0 && (c = 0), l === void 0 && (l = 0), m(e, t, n, r, i, a, o, null, s, c, l);
		}
		function m(e, t, n, r, i, a, o, s, c, u, d) {
			a === void 0 && (a = 1), c === void 0 && (c = 0), u === void 0 && (u = 0), d === void 0 && (d = 0);
			for (var p = f(e, t, n, r, i, a), m = new Uint8Array(p.length * 4), h = 0; h < p.length; h++) m[h * 4 + d] = p[h];
			l(o, m, c, u, e, t, 1 << 3 - d, s);
		}
		function h(e, t, n, r, i, a) {
			var o = i - n, s = a - r, c = o * o + s * s, l = c ? Math.max(0, Math.min(1, ((e - n) * o + (t - r) * s) / c)) : 0, u = e - (n + l * o), d = t - (r + l * s);
			return u * u + d * d;
		}
		var g = /*#__PURE__*/ Object.freeze({
			__proto__: null,
			generate: f,
			generateIntoCanvas: p,
			generateIntoFramebuffer: m
		}), _ = "precision highp float;uniform vec4 uGlyphBounds;attribute vec2 aUV;attribute vec4 aLineSegment;varying vec4 vLineSegment;varying vec2 vGlyphXY;void main(){vLineSegment=aLineSegment;vGlyphXY=mix(uGlyphBounds.xy,uGlyphBounds.zw,aUV);gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}", v = "precision highp float;uniform vec4 uGlyphBounds;uniform float uMaxDistance;uniform float uExponent;varying vec4 vLineSegment;varying vec2 vGlyphXY;float absDistToSegment(vec2 point,vec2 lineA,vec2 lineB){vec2 lineDir=lineB-lineA;float lenSq=dot(lineDir,lineDir);float t=lenSq==0.0 ? 0.0 : clamp(dot(point-lineA,lineDir)/lenSq,0.0,1.0);vec2 linePt=lineA+t*lineDir;return distance(point,linePt);}void main(){vec4 seg=vLineSegment;vec2 p=vGlyphXY;float dist=absDistToSegment(p,seg.xy,seg.zw);float val=pow(1.0-clamp(dist/uMaxDistance,0.0,1.0),uExponent)*0.5;bool crossing=(seg.y>p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y<vLineSegment.w;gl_FragColor=vec4(crossingUp ? 1.0/255.0 : 0.0,crossing&&!crossingUp ? 1.0/255.0 : 0.0,0.0,val);}", y = "precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){vec4 color=texture2D(tex,vUV);bool inside=color.r!=color.g;float val=inside ? 1.0-color.a : color.a;gl_FragColor=vec4(val);}", b = new Float32Array([
			0,
			0,
			2,
			0,
			0,
			2
		]), x = null, S = !1, C = {}, w = /* @__PURE__ */ new WeakMap();
		function T(e) {
			if (!S && !k(e)) throw Error("WebGL generation not supported");
		}
		function E(e, t, n, r, i, a, o) {
			if (a === void 0 && (a = 1), o === void 0 && (o = null), !o && (o = x, !o)) {
				var s = typeof OffscreenCanvas == "function" ? new OffscreenCanvas(1, 1) : typeof document < "u" ? document.createElement("canvas") : null;
				if (!s) throw Error("OffscreenCanvas or DOM canvas not supported");
				o = x = s.getContext("webgl", { depth: !1 });
			}
			T(o);
			var l = new Uint8Array(e * t * 4);
			c(o, function(o) {
				var s = o.gl, c = o.withTexture, u = o.withTextureFramebuffer;
				c("readable", function(o, c) {
					s.texImage2D(s.TEXTURE_2D, 0, s.RGBA, e, t, 0, s.RGBA, s.UNSIGNED_BYTE, null), u(o, c, function(o) {
						O(e, t, n, r, i, a, s, o, 0, 0, 0), s.readPixels(0, 0, e, t, s.RGBA, s.UNSIGNED_BYTE, l);
					});
				});
			});
			for (var u = new Uint8Array(e * t), d = 0, f = 0; d < l.length; d += 4) u[f++] = l[d];
			return u;
		}
		function D(e, t, n, r, i, a, o, s, c, l) {
			a === void 0 && (a = 1), s === void 0 && (s = 0), c === void 0 && (c = 0), l === void 0 && (l = 0), O(e, t, n, r, i, a, o, null, s, c, l);
		}
		function O(e, t, n, r, o, s, l, u, d, f, p) {
			s === void 0 && (s = 1), d === void 0 && (d = 0), f === void 0 && (f = 0), p === void 0 && (p = 0), T(l);
			var m = [];
			i(n, function(e, t, n, r) {
				m.push(e, t, n, r);
			}), m = new Float32Array(m), c(l, function(n) {
				var i = n.gl, c = n.isWebGL2, l = n.getExtension, h = n.withProgram, g = n.withTexture, x = n.withTextureFramebuffer, S = n.handleContextLoss;
				if (g("rawDistances", function(n, g) {
					(e !== n._lastWidth || t !== n._lastHeight) && i.texImage2D(i.TEXTURE_2D, 0, i.RGBA, n._lastWidth = e, n._lastHeight = t, 0, i.RGBA, i.UNSIGNED_BYTE, null), h("main", _, v, function(a) {
						var u = a.setAttribute, d = a.setUniform, f = !c && l("ANGLE_instanced_arrays"), p = !c && l("EXT_blend_minmax");
						u("aUV", 2, i.STATIC_DRAW, 0, b), u("aLineSegment", 4, i.DYNAMIC_DRAW, 1, m), d.apply(void 0, ["4f", "uGlyphBounds"].concat(r)), d("1f", "uMaxDistance", o), d("1f", "uExponent", s), x(n, g, function(n) {
							i.enable(i.BLEND), i.colorMask(!0, !0, !0, !0), i.viewport(0, 0, e, t), i.scissor(0, 0, e, t), i.blendFunc(i.ONE, i.ONE), i.blendEquationSeparate(i.FUNC_ADD, c ? i.MAX : p.MAX_EXT), i.clear(i.COLOR_BUFFER_BIT), c ? i.drawArraysInstanced(i.TRIANGLES, 0, 3, m.length / 4) : f.drawArraysInstancedANGLE(i.TRIANGLES, 0, 3, m.length / 4);
						});
					}), h("post", a, y, function(n) {
						n.setAttribute("aUV", 2, i.STATIC_DRAW, 0, b), n.setUniform("1i", "tex", g), i.bindFramebuffer(i.FRAMEBUFFER, u), i.disable(i.BLEND), i.colorMask(p === 0, p === 1, p === 2, p === 3), i.viewport(d, f, e, t), i.scissor(d, f, e, t), i.drawArrays(i.TRIANGLES, 0, 3);
					});
				}), i.isContextLost()) throw S(), Error("webgl context lost");
			});
		}
		function k(e) {
			var t = !e || e === x ? C : e.canvas || e, n = w.get(t);
			if (n === void 0) {
				S = !0;
				var r = null;
				try {
					var i = [
						97,
						106,
						97,
						61,
						99,
						137,
						118,
						80,
						80,
						118,
						137,
						99,
						61,
						97,
						106,
						97
					], a = E(4, 4, "M8,8L16,8L24,24L16,24Z", [
						0,
						0,
						32,
						32
					], 24, 1, e);
					n = a && i.length === a.length && a.every(function(e, t) {
						return e === i[t];
					}), n || (r = "bad trial run results", console.info(i, a));
				} catch (e) {
					n = !1, r = e.message;
				}
				r && console.warn("WebGL SDF generation not supported:", r), S = !1, w.set(t, n);
			}
			return n;
		}
		var A = /*#__PURE__*/ Object.freeze({
			__proto__: null,
			generate: E,
			generateIntoCanvas: D,
			generateIntoFramebuffer: O,
			isSupported: k
		});
		function j(e, t, n, r, i, a) {
			i === void 0 && (i = Math.max(r[2] - r[0], r[3] - r[1]) / 2), a === void 0 && (a = 1);
			try {
				return E.apply(A, arguments);
			} catch (e) {
				return console.info("WebGL SDF generation failed, falling back to JS", e), f.apply(g, arguments);
			}
		}
		function ee(e, t, n, r, i, a, o, s, c, l) {
			i === void 0 && (i = Math.max(r[2] - r[0], r[3] - r[1]) / 2), a === void 0 && (a = 1), s === void 0 && (s = 0), c === void 0 && (c = 0), l === void 0 && (l = 0);
			try {
				return D.apply(A, arguments);
			} catch (e) {
				return console.info("WebGL SDF generation failed, falling back to JS", e), p.apply(g, arguments);
			}
		}
		return e.forEachPathCommand = r, e.generate = j, e.generateIntoCanvas = ee, e.javascript = g, e.pathToLineSegments = i, e.webgl = A, e.webglUtils = d, Object.defineProperty(e, "__esModule", { value: !0 }), e;
	}({});
}
//#endregion
//#region ../../node_modules/.pnpm/bidi-js@1.0.3/node_modules/bidi-js/dist/bidi.mjs
function kO() {
	return function(e) {
		var t = {
			R: "13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",
			EN: "1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",
			ES: "17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",
			ET: "z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",
			AN: "16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",
			CS: "18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",
			B: "a,3,f+2,2v,690",
			S: "9,2,k",
			WS: "c,k,4f4,1vk+a,u,1j,335",
			ON: "x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",
			BN: "0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",
			NSM: "lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",
			AL: "16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",
			LRO: "6ct",
			RLO: "6cu",
			LRE: "6cq",
			RLE: "6cr",
			PDF: "6cs",
			LRI: "6ee",
			RLI: "6ef",
			FSI: "6eg",
			PDI: "6eh"
		}, n = {}, r = {};
		n.L = 1, r[1] = "L", Object.keys(t).forEach(function(e, t) {
			n[e] = 1 << t + 1, r[n[e]] = e;
		}), Object.freeze(n);
		var i = n.LRI | n.RLI | n.FSI, a = n.L | n.R | n.AL, o = n.B | n.S | n.WS | n.ON | n.FSI | n.LRI | n.RLI | n.PDI, s = n.BN | n.RLE | n.LRE | n.RLO | n.LRO | n.PDF, c = n.S | n.WS | n.B | i | n.PDI | s, l = null;
		function u() {
			if (!l) {
				l = /* @__PURE__ */ new Map();
				var e = function(e) {
					if (t.hasOwnProperty(e)) {
						var r = 0;
						t[e].split(",").forEach(function(t) {
							var i = t.split("+"), a = i[0], o = i[1];
							a = parseInt(a, 36), o = o ? parseInt(o, 36) : 0, l.set(r += a, n[e]);
							for (var s = 0; s < o; s++) l.set(++r, n[e]);
						});
					}
				};
				for (var r in t) e(r);
			}
		}
		function d(e) {
			return u(), l.get(e.codePointAt(0)) || n.L;
		}
		function f(e) {
			return r[d(e)];
		}
		var p = {
			pairs: "14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",
			canonical: "6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"
		};
		function m(e, t) {
			var n = 0, r = /* @__PURE__ */ new Map(), i = t && /* @__PURE__ */ new Map(), a;
			return e.split(",").forEach(function e(o) {
				if (o.indexOf("+") !== -1) for (var s = +o; s--;) e(a);
				else {
					a = o;
					var c = o.split(">"), l = c[0], u = c[1];
					l = String.fromCodePoint(n += parseInt(l, 36)), u = String.fromCodePoint(n += parseInt(u, 36)), r.set(l, u), t && i.set(u, l);
				}
			}), {
				map: r,
				reverseMap: i
			};
		}
		var h, g, _;
		function v() {
			if (!h) {
				var e = m(p.pairs, !0), t = e.map, n = e.reverseMap;
				h = t, g = n, _ = m(p.canonical, !1).map;
			}
		}
		function y(e) {
			return v(), h.get(e) || null;
		}
		function b(e) {
			return v(), g.get(e) || null;
		}
		function x(e) {
			return v(), _.get(e) || null;
		}
		var S = n.L, C = n.R, w = n.EN, T = n.ES, E = n.ET, D = n.AN, O = n.CS, k = n.B, A = n.S, j = n.ON, ee = n.BN, te = n.NSM, ne = n.AL, re = n.LRO, M = n.RLO, ie = n.LRE, ae = n.RLE, N = n.PDF, oe = n.LRI, se = n.RLI, ce = n.FSI, le = n.PDI;
		function ue(e, t) {
			for (var n = 125, r = new Uint32Array(e.length), l = 0; l < e.length; l++) r[l] = d(e[l]);
			var u = /* @__PURE__ */ new Map();
			function f(e, t) {
				var n = r[e];
				r[e] = t, u.set(n, u.get(n) - 1), n & o && u.set(o, u.get(o) - 1), u.set(t, (u.get(t) || 0) + 1), t & o && u.set(o, (u.get(o) || 0) + 1);
			}
			for (var p = new Uint8Array(e.length), m = /* @__PURE__ */ new Map(), h = [], g = null, _ = 0; _ < e.length; _++) g || h.push(g = {
				start: _,
				end: e.length - 1,
				level: t === "rtl" ? 1 : t === "ltr" ? 0 : on(_, !1)
			}), r[_] & k && (g.end = _, g = null);
			for (var v = ae | ie | M | re | i | le | N | k, ue = function(e) {
				return e + (e & 1 ? 1 : 2);
			}, de = function(e) {
				return e + (e & 1 ? 2 : 1);
			}, P = 0; P < h.length; P++) {
				g = h[P];
				var fe = [{
					_level: g.level,
					_override: 0,
					_isolate: 0
				}], pe = void 0, me = 0, he = 0, ge = 0;
				u.clear();
				for (var _e = g.start; _e <= g.end; _e++) {
					var ve = r[_e];
					if (pe = fe[fe.length - 1], u.set(ve, (u.get(ve) || 0) + 1), ve & o && u.set(o, (u.get(o) || 0) + 1), ve & v) if (ve & (ae | ie)) {
						p[_e] = pe._level;
						var ye = (ve === ae ? de : ue)(pe._level);
						ye <= n && !me && !he ? fe.push({
							_level: ye,
							_override: 0,
							_isolate: 0
						}) : me || he++;
					} else if (ve & (M | re)) {
						p[_e] = pe._level;
						var be = (ve === M ? de : ue)(pe._level);
						be <= n && !me && !he ? fe.push({
							_level: be,
							_override: ve & M ? C : S,
							_isolate: 0
						}) : me || he++;
					} else if (ve & i) {
						ve & ce && (ve = on(_e + 1, !0) === 1 ? se : oe), p[_e] = pe._level, pe._override && f(_e, pe._override);
						var xe = (ve === se ? de : ue)(pe._level);
						xe <= n && me === 0 && he === 0 ? (ge++, fe.push({
							_level: xe,
							_override: 0,
							_isolate: 1,
							_isolInitIndex: _e
						})) : me++;
					} else if (ve & le) {
						if (me > 0) me--;
						else if (ge > 0) {
							for (he = 0; !fe[fe.length - 1]._isolate;) fe.pop();
							var Se = fe[fe.length - 1]._isolInitIndex;
							Se != null && (m.set(Se, _e), m.set(_e, Se)), fe.pop(), ge--;
						}
						pe = fe[fe.length - 1], p[_e] = pe._level, pe._override && f(_e, pe._override);
					} else ve & N ? (me === 0 && (he > 0 ? he-- : !pe._isolate && fe.length > 1 && (fe.pop(), pe = fe[fe.length - 1])), p[_e] = pe._level) : ve & k && (p[_e] = g.level);
					else p[_e] = pe._level, pe._override && ve !== ee && f(_e, pe._override);
				}
				for (var Ce = [], we = null, Te = g.start; Te <= g.end; Te++) {
					var Ee = r[Te];
					if (!(Ee & s)) {
						var De = p[Te], Oe = Ee & i, ke = Ee === le;
						we && De === we._level ? (we._end = Te, we._endsWithIsolInit = Oe) : Ce.push(we = {
							_start: Te,
							_end: Te,
							_level: De,
							_startsWithPDI: ke,
							_endsWithIsolInit: Oe
						});
					}
				}
				for (var Ae = [], je = 0; je < Ce.length; je++) {
					var Me = Ce[je];
					if (!Me._startsWithPDI || Me._startsWithPDI && !m.has(Me._start)) {
						for (var Ne = [we = Me], Pe = void 0; we && we._endsWithIsolInit && (Pe = m.get(we._end)) != null;) for (var Fe = je + 1; Fe < Ce.length; Fe++) if (Ce[Fe]._start === Pe) {
							Ne.push(we = Ce[Fe]);
							break;
						}
						for (var Ie = [], Le = 0; Le < Ne.length; Le++) for (var Re = Ne[Le], ze = Re._start; ze <= Re._end; ze++) Ie.push(ze);
						for (var Be = p[Ie[0]], Ve = g.level, He = Ie[0] - 1; He >= 0; He--) if (!(r[He] & s)) {
							Ve = p[He];
							break;
						}
						var Ue = Ie[Ie.length - 1], We = p[Ue], Ge = g.level;
						if (!(r[Ue] & i)) {
							for (var Ke = Ue + 1; Ke <= g.end; Ke++) if (!(r[Ke] & s)) {
								Ge = p[Ke];
								break;
							}
						}
						Ae.push({
							_seqIndices: Ie,
							_sosType: Math.max(Ve, Be) % 2 ? C : S,
							_eosType: Math.max(Ge, We) % 2 ? C : S
						});
					}
				}
				for (var qe = 0; qe < Ae.length; qe++) {
					var Je = Ae[qe], F = Je._seqIndices, Ye = Je._sosType, Xe = Je._eosType, Ze = p[F[0]] & 1 ? C : S;
					if (u.get(te)) for (var Qe = 0; Qe < F.length; Qe++) {
						var $e = F[Qe];
						if (r[$e] & te) {
							for (var et = Ye, tt = Qe - 1; tt >= 0; tt--) if (!(r[F[tt]] & s)) {
								et = r[F[tt]];
								break;
							}
							f($e, et & (i | le) ? j : et);
						}
					}
					if (u.get(w)) for (var nt = 0; nt < F.length; nt++) {
						var rt = F[nt];
						if (r[rt] & w) for (var it = nt - 1; it >= -1; it--) {
							var at = it === -1 ? Ye : r[F[it]];
							if (at & a) {
								at === ne && f(rt, D);
								break;
							}
						}
					}
					if (u.get(ne)) for (var ot = 0; ot < F.length; ot++) {
						var st = F[ot];
						r[st] & ne && f(st, C);
					}
					if (u.get(T) || u.get(O)) for (var ct = 1; ct < F.length - 1; ct++) {
						var lt = F[ct];
						if (r[lt] & (T | O)) {
							for (var ut = 0, dt = 0, ft = ct - 1; ft >= 0 && (ut = r[F[ft]], ut & s); ft--);
							for (var pt = ct + 1; pt < F.length && (dt = r[F[pt]], dt & s); pt++);
							ut === dt && (r[lt] === T ? ut === w : ut & (w | D)) && f(lt, ut);
						}
					}
					if (u.get(w)) {
						for (var mt = 0; mt < F.length; mt++) if (r[F[mt]] & w) {
							for (var ht = mt - 1; ht >= 0 && r[F[ht]] & (E | s); ht--) f(F[ht], w);
							for (mt++; mt < F.length && r[F[mt]] & (E | s | w); mt++) r[F[mt]] !== w && f(F[mt], w);
						}
					}
					if (u.get(E) || u.get(T) || u.get(O)) for (var gt = 0; gt < F.length; gt++) {
						var _t = F[gt];
						if (r[_t] & (E | T | O)) {
							f(_t, j);
							for (var vt = gt - 1; vt >= 0 && r[F[vt]] & s; vt--) f(F[vt], j);
							for (var yt = gt + 1; yt < F.length && r[F[yt]] & s; yt++) f(F[yt], j);
						}
					}
					if (u.get(w)) for (var bt = 0, xt = Ye; bt < F.length; bt++) {
						var St = F[bt], Ct = r[St];
						Ct & w ? xt === S && f(St, S) : Ct & a && (xt = Ct);
					}
					if (u.get(o)) {
						for (var wt = C | w | D, Tt = wt | S, Et = [], Dt = [], Ot = 0; Ot < F.length; Ot++) if (r[F[Ot]] & o) {
							var kt = e[F[Ot]], At = void 0;
							if (y(kt) !== null) if (Dt.length < 63) Dt.push({
								char: kt,
								seqIndex: Ot
							});
							else break;
							else if ((At = b(kt)) !== null) for (var jt = Dt.length - 1; jt >= 0; jt--) {
								var Mt = Dt[jt].char;
								if (Mt === At || Mt === b(x(kt)) || y(x(Mt)) === kt) {
									Et.push([Dt[jt].seqIndex, Ot]), Dt.length = jt;
									break;
								}
							}
						}
						Et.sort(function(e, t) {
							return e[0] - t[0];
						});
						for (var Nt = 0; Nt < Et.length; Nt++) {
							for (var Pt = Et[Nt], Ft = Pt[0], It = Pt[1], Lt = !1, Rt = 0, zt = Ft + 1; zt < It; zt++) {
								var Bt = F[zt];
								if (r[Bt] & Tt) {
									Lt = !0;
									var Vt = r[Bt] & wt ? C : S;
									if (Vt === Ze) {
										Rt = Vt;
										break;
									}
								}
							}
							if (Lt && !Rt) {
								Rt = Ye;
								for (var Ht = Ft - 1; Ht >= 0; Ht--) {
									var Ut = F[Ht];
									if (r[Ut] & Tt) {
										var Wt = r[Ut] & wt ? C : S;
										Rt = Wt === Ze ? Ze : Wt;
										break;
									}
								}
							}
							if (Rt) {
								if (r[F[Ft]] = r[F[It]] = Rt, Rt !== Ze) {
									for (var Gt = Ft + 1; Gt < F.length; Gt++) if (!(r[F[Gt]] & s)) {
										d(e[F[Gt]]) & te && (r[F[Gt]] = Rt);
										break;
									}
								}
								if (Rt !== Ze) {
									for (var Kt = It + 1; Kt < F.length; Kt++) if (!(r[F[Kt]] & s)) {
										d(e[F[Kt]]) & te && (r[F[Kt]] = Rt);
										break;
									}
								}
							}
						}
						for (var qt = 0; qt < F.length; qt++) if (r[F[qt]] & o) {
							for (var Jt = qt, Yt = qt, Xt = Ye, Zt = qt - 1; Zt >= 0; Zt--) if (r[F[Zt]] & s) Jt = Zt;
							else {
								Xt = r[F[Zt]] & wt ? C : S;
								break;
							}
							for (var Qt = Xe, $t = qt + 1; $t < F.length; $t++) if (r[F[$t]] & (o | s)) Yt = $t;
							else {
								Qt = r[F[$t]] & wt ? C : S;
								break;
							}
							for (var en = Jt; en <= Yt; en++) r[F[en]] = Xt === Qt ? Xt : Ze;
							qt = Yt;
						}
					}
				}
				for (var tn = g.start; tn <= g.end; tn++) {
					var nn = p[tn], rn = r[tn];
					if (nn & 1 ? rn & (S | w | D) && p[tn]++ : rn & C ? p[tn]++ : rn & (D | w) && (p[tn] += 2), rn & s && (p[tn] = tn === 0 ? g.level : p[tn - 1]), tn === g.end || d(e[tn]) & (A | k)) for (var an = tn; an >= 0 && d(e[an]) & c; an--) p[an] = g.level;
				}
			}
			return {
				levels: p,
				paragraphs: h
			};
			function on(t, n) {
				for (var a = t; a < e.length; a++) {
					var o = r[a];
					if (o & (C | ne)) return 1;
					if (o & (k | S) || n && o === le) return 0;
					if (o & i) {
						var s = sn(a);
						a = s === -1 ? e.length : s;
					}
				}
				return 0;
			}
			function sn(t) {
				for (var n = 1, a = t + 1; a < e.length; a++) {
					var o = r[a];
					if (o & k) break;
					if (o & le) {
						if (--n === 0) return a;
					} else o & i && n++;
				}
				return -1;
			}
		}
		var de = "14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1", P;
		function fe() {
			if (!P) {
				var e = m(de, !0), t = e.map;
				e.reverseMap.forEach(function(e, n) {
					t.set(n, e);
				}), P = t;
			}
		}
		function pe(e) {
			return fe(), P.get(e) || null;
		}
		function me(e, t, n, r) {
			var i = e.length;
			n = Math.max(0, n == null ? 0 : +n), r = Math.min(i - 1, r == null ? i - 1 : +r);
			for (var a = /* @__PURE__ */ new Map(), o = n; o <= r; o++) if (t[o] & 1) {
				var s = pe(e[o]);
				s !== null && a.set(o, s);
			}
			return a;
		}
		function he(e, t, n, r) {
			var i = e.length;
			n = Math.max(0, n == null ? 0 : +n), r = Math.min(i - 1, r == null ? i - 1 : +r);
			var a = [];
			return t.paragraphs.forEach(function(i) {
				var o = Math.max(n, i.start), s = Math.min(r, i.end);
				if (o < s) {
					for (var l = t.levels.slice(o, s + 1), u = s; u >= o && d(e[u]) & c; u--) l[u] = i.level;
					for (var f = i.level, p = Infinity, m = 0; m < l.length; m++) {
						var h = l[m];
						h > f && (f = h), h < p && (p = h | 1);
					}
					for (var g = f; g >= p; g--) for (var _ = 0; _ < l.length; _++) if (l[_] >= g) {
						for (var v = _; _ + 1 < l.length && l[_ + 1] >= g;) _++;
						_ > v && a.push([v + o, _ + o]);
					}
				}
			}), a;
		}
		function ge(e, t, n, r) {
			var i = _e(e, t, n, r), a = [].concat(e);
			return i.forEach(function(n, r) {
				a[r] = (t.levels[n] & 1 ? pe(e[n]) : null) || e[n];
			}), a.join("");
		}
		function _e(e, t, n, r) {
			for (var i = he(e, t, n, r), a = [], o = 0; o < e.length; o++) a[o] = o;
			return i.forEach(function(e) {
				for (var t = e[0], n = e[1], r = a.slice(t, n + 1), i = r.length; i--;) a[n - i] = r[i];
			}), a;
		}
		return e.closingToOpeningBracket = b, e.getBidiCharType = d, e.getBidiCharTypeName = f, e.getCanonicalBracket = x, e.getEmbeddingLevels = ue, e.getMirroredCharacter = pe, e.getMirroredCharactersMap = me, e.getReorderSegments = he, e.getReorderedIndices = _e, e.getReorderedString = ge, e.openingToClosingBracket = y, Object.defineProperty(e, "__esModule", { value: !0 }), e;
	}({});
}
//#endregion
//#region ../../node_modules/.pnpm/troika-three-utils@0.52.5_three@0.185.1/node_modules/troika-three-utils/dist/troika-three-utils.esm.js
var AO = /\bvoid\s+main\s*\(\s*\)\s*{/g;
function jO(e) {
	let t = /^[ \t]*#include +<([\w\d./]+)>/gm;
	function n(e, t) {
		let n = xe[t];
		return n ? jO(n) : e;
	}
	return e.replace(t, n);
}
var MO = [];
for (let e = 0; e < 256; e++) MO[e] = (e < 16 ? "0" : "") + e.toString(16);
function NO() {
	let e = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0, n = Math.random() * 4294967295 | 0, r = Math.random() * 4294967295 | 0;
	return (MO[e & 255] + MO[e >> 8 & 255] + MO[e >> 16 & 255] + MO[e >> 24 & 255] + "-" + MO[t & 255] + MO[t >> 8 & 255] + "-" + MO[t >> 16 & 15 | 64] + MO[t >> 24 & 255] + "-" + MO[n & 63 | 128] + MO[n >> 8 & 255] + "-" + MO[n >> 16 & 255] + MO[n >> 24 & 255] + MO[r & 255] + MO[r >> 8 & 255] + MO[r >> 16 & 255] + MO[r >> 24 & 255]).toUpperCase();
}
var PO = Object.assign || function() {
	let e = arguments[0];
	for (let t = 1, n = arguments.length; t < n; t++) {
		let n = arguments[t];
		if (n) for (let t in n) Object.prototype.hasOwnProperty.call(n, t) && (e[t] = n[t]);
	}
	return e;
}, FO = Date.now(), IO = /* @__PURE__ */ new WeakMap(), LO = /* @__PURE__ */ new Map(), RO = 1e10;
function zO(e, t) {
	let n = GO(t), r = IO.get(e);
	if (r || IO.set(e, r = Object.create(null)), r[n]) return new r[n]();
	let i = `_onBeforeCompile${n}`, a = function(r, a) {
		e.onBeforeCompile.call(this, r, a);
		let o = this.customProgramCacheKey() + "|" + r.vertexShader + "|" + r.fragmentShader, s = LO[o];
		s || (s = LO[o] = BO(this, r, t, n)), r.vertexShader = s.vertexShader, r.fragmentShader = s.fragmentShader, PO(r.uniforms, this.uniforms), t.timeUniform && (r.uniforms[t.timeUniform] = { get value() {
			return Date.now() - FO;
		} }), this[i] && this[i](r);
	}, o = function() {
		return s(t.chained ? e : e.clone());
	}, s = function(r) {
		let i = Object.create(r, c);
		return Object.defineProperty(i, "baseMaterial", { value: e }), Object.defineProperty(i, "id", { value: RO++ }), i.uuid = NO(), i.uniforms = PO({}, r.uniforms, t.uniforms), i.defines = PO({}, r.defines, t.defines), i.defines[`TROIKA_DERIVED_MATERIAL_${n}`] = "", i.extensions = PO({}, r.extensions, t.extensions), i._listeners = void 0, i;
	}, c = {
		constructor: { value: o },
		isDerivedMaterial: { value: !0 },
		type: {
			get: () => e.type,
			set: (t) => {
				e.type = t;
			}
		},
		isDerivedFrom: {
			writable: !0,
			configurable: !0,
			value: function(e) {
				let t = this.baseMaterial;
				return e === t || t.isDerivedMaterial && t.isDerivedFrom(e) || !1;
			}
		},
		customProgramCacheKey: {
			writable: !0,
			configurable: !0,
			value: function() {
				return e.customProgramCacheKey() + "|" + n;
			}
		},
		onBeforeCompile: {
			get() {
				return a;
			},
			set(e) {
				this[i] = e;
			}
		},
		copy: {
			writable: !0,
			configurable: !0,
			value: function(t) {
				return e.copy.call(this, t), !e.isShaderMaterial && !e.isDerivedMaterial && (PO(this.extensions, t.extensions), PO(this.defines, t.defines), PO(this.uniforms, on.clone(t.uniforms))), this;
			}
		},
		clone: {
			writable: !0,
			configurable: !0,
			value: function() {
				let t = new e.constructor();
				return s(t).copy(this);
			}
		},
		getDepthMaterial: {
			writable: !0,
			configurable: !0,
			value: function() {
				let n = this._depthMaterial;
				return n || (n = this._depthMaterial = zO(e.isDerivedMaterial ? e.getDepthMaterial() : new Se({ depthPacking: it }), t), n.defines.IS_DEPTH_MATERIAL = "", n.uniforms = this.uniforms), n;
			}
		},
		getDistanceMaterial: {
			writable: !0,
			configurable: !0,
			value: function() {
				let n = this._distanceMaterial;
				return n || (n = this._distanceMaterial = zO(e.isDerivedMaterial ? e.getDistanceMaterial() : new wn(), t), n.defines.IS_DISTANCE_MATERIAL = "", n.uniforms = this.uniforms), n;
			}
		},
		dispose: {
			writable: !0,
			configurable: !0,
			value() {
				let { _depthMaterial: t, _distanceMaterial: n } = this;
				t && t.dispose(), n && n.dispose(), e.dispose.call(this);
			}
		}
	};
	return r[n] = o, new o();
}
function BO(e, { vertexShader: t, fragmentShader: n }, r, i) {
	let { vertexDefs: a, vertexMainIntro: o, vertexMainOutro: s, vertexTransform: c, fragmentDefs: l, fragmentMainIntro: u, fragmentMainOutro: d, fragmentColorTransform: f, customRewriter: p, timeUniform: m } = r;
	if (a = a || "", o = o || "", s = s || "", l = l || "", u = u || "", d = d || "", (c || p) && (t = jO(t)), (f || p) && (n = n.replace(/^[ \t]*#include <((?:tonemapping|encodings|colorspace|fog|premultiplied_alpha|dithering)_fragment)>/gm, "\n//!BEGIN_POST_CHUNK $1\n$&\n//!END_POST_CHUNK\n"), n = jO(n)), p) {
		let e = p({
			vertexShader: t,
			fragmentShader: n
		});
		t = e.vertexShader, n = e.fragmentShader;
	}
	if (f) {
		let e = [];
		n = n.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm, (t) => (e.push(t), "")), d = `${f}\n${e.join("\n")}\n${d}`;
	}
	if (m) {
		let e = `\nuniform float ${m};\n`;
		a = e + a, l = e + l;
	}
	return c && (t = `vec3 troika_position_${i};
vec3 troika_normal_${i};
vec2 troika_uv_${i};
${t}
`, a = `${a}
void troikaVertexTransform${i}() {
  vec3 position = troika_position_${i};
  vec3 normal = troika_normal_${i};
  vec2 uv = troika_uv_${i};
  ${c}
  troika_position_${i} = position;
  troika_normal_${i} = normal;
  troika_uv_${i} = uv;
}
`, o = `
troika_position_${i} = vec3(position);
troika_normal_${i} = vec3(normal);
troika_uv_${i} = vec2(uv);
troikaVertexTransform${i}();
${o}
`, t = t.replace(/\b(position|normal|uv)\b/g, (e, t, n, r) => /\battribute\s+vec[23]\s+$/.test(r.substr(0, n)) ? t : `troika_${t}_${i}`), e.map && e.map.channel > 0 || (t = t.replace(/\bMAP_UV\b/g, `troika_uv_${i}`))), t = VO(t, i, a, o, s), n = VO(n, i, l, u, d), {
		vertexShader: t,
		fragmentShader: n
	};
}
function VO(e, t, n, r, i) {
	return (r || i || n) && (e = e.replace(AO, `
${n}
void troikaOrigMain${t}() {`), e += `
void main() {
  ${r}
  troikaOrigMain${t}();
  ${i}
}`), e;
}
function HO(e, t) {
	return e === "uniforms" ? void 0 : typeof t == "function" ? t.toString() : t;
}
var UO = 0, WO = /* @__PURE__ */ new Map();
function GO(e) {
	let t = JSON.stringify(e, HO), n = WO.get(t);
	return n == null && WO.set(t, n = ++UO), n;
}
//#endregion
//#region ../../node_modules/.pnpm/troika-three-text@0.52.5_three@0.185.1/node_modules/troika-three-text/dist/troika-three-text.esm.js
function KO() {
	return typeof window > "u" && (self.window = self), function(e) {
		var t = {
			parse: function(e) {
				var n = t._bin, r = new Uint8Array(e);
				if (n.readASCII(r, 0, 4) == "ttcf") {
					var i = 4;
					n.readUshort(r, i), i += 2, n.readUshort(r, i), i += 2;
					var a = n.readUint(r, i);
					i += 4;
					for (var o = [], s = 0; s < a; s++) {
						var c = n.readUint(r, i);
						i += 4, o.push(t._readFont(r, c));
					}
					return o;
				}
				return [t._readFont(r, 0)];
			},
			_readFont: function(e, n) {
				var r = t._bin, i = n;
				r.readFixed(e, n), n += 4;
				var a = r.readUshort(e, n);
				n += 2, r.readUshort(e, n), n += 2, r.readUshort(e, n), n += 2, r.readUshort(e, n), n += 2;
				for (var o = [
					"cmap",
					"head",
					"hhea",
					"maxp",
					"hmtx",
					"name",
					"OS/2",
					"post",
					"loca",
					"glyf",
					"kern",
					"CFF ",
					"GDEF",
					"GPOS",
					"GSUB",
					"SVG "
				], s = {
					_data: e,
					_offset: i
				}, c = {}, l = 0; l < a; l++) {
					var u = r.readASCII(e, n, 4);
					n += 4, r.readUint(e, n), n += 4;
					var d = r.readUint(e, n);
					n += 4;
					var f = r.readUint(e, n);
					n += 4, c[u] = {
						offset: d,
						length: f
					};
				}
				for (l = 0; l < o.length; l++) {
					var p = o[l];
					c[p] && (s[p.trim()] = t[p.trim()].parse(e, c[p].offset, c[p].length, s));
				}
				return s;
			},
			_tabOffset: function(e, n, r) {
				for (var i = t._bin, a = i.readUshort(e, r + 4), o = r + 12, s = 0; s < a; s++) {
					var c = i.readASCII(e, o, 4);
					o += 4, i.readUint(e, o), o += 4;
					var l = i.readUint(e, o);
					if (o += 4, i.readUint(e, o), o += 4, c == n) return l;
				}
				return 0;
			}
		};
		t._bin = {
			readFixed: function(e, t) {
				return (e[t] << 8 | e[t + 1]) + (e[t + 2] << 8 | e[t + 3]) / 65540;
			},
			readF2dot14: function(e, n) {
				return t._bin.readShort(e, n) / 16384;
			},
			readInt: function(e, n) {
				return t._bin._view(e).getInt32(n);
			},
			readInt8: function(e, n) {
				return t._bin._view(e).getInt8(n);
			},
			readShort: function(e, n) {
				return t._bin._view(e).getInt16(n);
			},
			readUshort: function(e, n) {
				return t._bin._view(e).getUint16(n);
			},
			readUshorts: function(e, n, r) {
				for (var i = [], a = 0; a < r; a++) i.push(t._bin.readUshort(e, n + 2 * a));
				return i;
			},
			readUint: function(e, n) {
				return t._bin._view(e).getUint32(n);
			},
			readUint64: function(e, n) {
				return 4294967296 * t._bin.readUint(e, n) + t._bin.readUint(e, n + 4);
			},
			readASCII: function(e, t, n) {
				for (var r = "", i = 0; i < n; i++) r += String.fromCharCode(e[t + i]);
				return r;
			},
			readUnicode: function(e, t, n) {
				for (var r = "", i = 0; i < n; i++) {
					var a = e[t++] << 8 | e[t++];
					r += String.fromCharCode(a);
				}
				return r;
			},
			_tdec: typeof window < "u" && window.TextDecoder ? new window.TextDecoder() : null,
			readUTF8: function(e, n, r) {
				var i = t._bin._tdec;
				return i && n == 0 && r == e.length ? i.decode(e) : t._bin.readASCII(e, n, r);
			},
			readBytes: function(e, t, n) {
				for (var r = [], i = 0; i < n; i++) r.push(e[t + i]);
				return r;
			},
			readASCIIArray: function(e, t, n) {
				for (var r = [], i = 0; i < n; i++) r.push(String.fromCharCode(e[t + i]));
				return r;
			},
			_view: function(e) {
				return e._dataView || (e._dataView = e.buffer ? new DataView(e.buffer, e.byteOffset, e.byteLength) : new DataView(new Uint8Array(e).buffer));
			}
		}, t._lctf = {}, t._lctf.parse = function(e, n, r, i, a) {
			var o = t._bin, s = {}, c = n;
			o.readFixed(e, n), n += 4;
			var l = o.readUshort(e, n);
			n += 2;
			var u = o.readUshort(e, n);
			n += 2;
			var d = o.readUshort(e, n);
			return n += 2, s.scriptList = t._lctf.readScriptList(e, c + l), s.featureList = t._lctf.readFeatureList(e, c + u), s.lookupList = t._lctf.readLookupList(e, c + d, a), s;
		}, t._lctf.readLookupList = function(e, n, r) {
			var i = t._bin, a = n, o = [], s = i.readUshort(e, n);
			n += 2;
			for (var c = 0; c < s; c++) {
				var l = i.readUshort(e, n);
				n += 2;
				var u = t._lctf.readLookupTable(e, a + l, r);
				o.push(u);
			}
			return o;
		}, t._lctf.readLookupTable = function(e, n, r) {
			var i = t._bin, a = n, o = { tabs: [] };
			o.ltype = i.readUshort(e, n), n += 2, o.flag = i.readUshort(e, n), n += 2;
			var s = i.readUshort(e, n);
			n += 2;
			for (var c = o.ltype, l = 0; l < s; l++) {
				var u = i.readUshort(e, n);
				n += 2;
				var d = r(e, c, a + u, o);
				o.tabs.push(d);
			}
			return o;
		}, t._lctf.numOfOnes = function(e) {
			for (var t = 0, n = 0; n < 32; n++) e >>> n & 1 && t++;
			return t;
		}, t._lctf.readClassDef = function(e, n) {
			var r = t._bin, i = [], a = r.readUshort(e, n);
			if (n += 2, a == 1) {
				var o = r.readUshort(e, n);
				n += 2;
				var s = r.readUshort(e, n);
				n += 2;
				for (var c = 0; c < s; c++) i.push(o + c), i.push(o + c), i.push(r.readUshort(e, n)), n += 2;
			}
			if (a == 2) {
				var l = r.readUshort(e, n);
				for (n += 2, c = 0; c < l; c++) i.push(r.readUshort(e, n)), n += 2, i.push(r.readUshort(e, n)), n += 2, i.push(r.readUshort(e, n)), n += 2;
			}
			return i;
		}, t._lctf.getInterval = function(e, t) {
			for (var n = 0; n < e.length; n += 3) {
				var r = e[n], i = e[n + 1];
				if (e[n + 2], r <= t && t <= i) return n;
			}
			return -1;
		}, t._lctf.readCoverage = function(e, n) {
			var r = t._bin, i = {};
			i.fmt = r.readUshort(e, n), n += 2;
			var a = r.readUshort(e, n);
			return n += 2, i.fmt == 1 && (i.tab = r.readUshorts(e, n, a)), i.fmt == 2 && (i.tab = r.readUshorts(e, n, 3 * a)), i;
		}, t._lctf.coverageIndex = function(e, n) {
			var r = e.tab;
			if (e.fmt == 1) return r.indexOf(n);
			if (e.fmt == 2) {
				var i = t._lctf.getInterval(r, n);
				if (i != -1) return r[i + 2] + (n - r[i]);
			}
			return -1;
		}, t._lctf.readFeatureList = function(e, n) {
			var r = t._bin, i = n, a = [], o = r.readUshort(e, n);
			n += 2;
			for (var s = 0; s < o; s++) {
				var c = r.readASCII(e, n, 4);
				n += 4;
				var l = r.readUshort(e, n);
				n += 2;
				var u = t._lctf.readFeatureTable(e, i + l);
				u.tag = c.trim(), a.push(u);
			}
			return a;
		}, t._lctf.readFeatureTable = function(e, n) {
			var r = t._bin, i = n, a = {}, o = r.readUshort(e, n);
			n += 2, o > 0 && (a.featureParams = i + o);
			var s = r.readUshort(e, n);
			n += 2, a.tab = [];
			for (var c = 0; c < s; c++) a.tab.push(r.readUshort(e, n + 2 * c));
			return a;
		}, t._lctf.readScriptList = function(e, n) {
			var r = t._bin, i = n, a = {}, o = r.readUshort(e, n);
			n += 2;
			for (var s = 0; s < o; s++) {
				var c = r.readASCII(e, n, 4);
				n += 4;
				var l = r.readUshort(e, n);
				n += 2, a[c.trim()] = t._lctf.readScriptTable(e, i + l);
			}
			return a;
		}, t._lctf.readScriptTable = function(e, n) {
			var r = t._bin, i = n, a = {}, o = r.readUshort(e, n);
			n += 2, o > 0 && (a.default = t._lctf.readLangSysTable(e, i + o));
			var s = r.readUshort(e, n);
			n += 2;
			for (var c = 0; c < s; c++) {
				var l = r.readASCII(e, n, 4);
				n += 4;
				var u = r.readUshort(e, n);
				n += 2, a[l.trim()] = t._lctf.readLangSysTable(e, i + u);
			}
			return a;
		}, t._lctf.readLangSysTable = function(e, n) {
			var r = t._bin, i = {};
			r.readUshort(e, n), n += 2, i.reqFeature = r.readUshort(e, n), n += 2;
			var a = r.readUshort(e, n);
			return n += 2, i.features = r.readUshorts(e, n, a), i;
		}, t.CFF = {}, t.CFF.parse = function(e, n, r) {
			var i = t._bin;
			(e = new Uint8Array(e.buffer, n, r))[n = 0], e[++n], e[++n], e[++n], n++;
			var a = [];
			n = t.CFF.readIndex(e, n, a);
			for (var o = [], s = 0; s < a.length - 1; s++) o.push(i.readASCII(e, n + a[s], a[s + 1] - a[s]));
			n += a[a.length - 1];
			var c = [];
			n = t.CFF.readIndex(e, n, c);
			var l = [];
			for (s = 0; s < c.length - 1; s++) l.push(t.CFF.readDict(e, n + c[s], n + c[s + 1]));
			n += c[c.length - 1];
			var u = l[0], d = [];
			n = t.CFF.readIndex(e, n, d);
			var f = [];
			for (s = 0; s < d.length - 1; s++) f.push(i.readASCII(e, n + d[s], d[s + 1] - d[s]));
			if (n += d[d.length - 1], t.CFF.readSubrs(e, n, u), u.CharStrings) {
				n = u.CharStrings, d = [], n = t.CFF.readIndex(e, n, d);
				var p = [];
				for (s = 0; s < d.length - 1; s++) p.push(i.readBytes(e, n + d[s], d[s + 1] - d[s]));
				u.CharStrings = p;
			}
			if (u.ROS) {
				n = u.FDArray;
				var m = [];
				for (n = t.CFF.readIndex(e, n, m), u.FDArray = [], s = 0; s < m.length - 1; s++) {
					var h = t.CFF.readDict(e, n + m[s], n + m[s + 1]);
					t.CFF._readFDict(e, h, f), u.FDArray.push(h);
				}
				n += m[m.length - 1], n = u.FDSelect, u.FDSelect = [];
				var g = e[n];
				if (n++, g != 3) throw g;
				var _ = i.readUshort(e, n);
				for (n += 2, s = 0; s < _ + 1; s++) u.FDSelect.push(i.readUshort(e, n), e[n + 2]), n += 3;
			}
			return u.Encoding && (u.Encoding = t.CFF.readEncoding(e, u.Encoding, u.CharStrings.length)), u.charset && (u.charset = t.CFF.readCharset(e, u.charset, u.CharStrings.length)), t.CFF._readFDict(e, u, f), u;
		}, t.CFF._readFDict = function(e, n, r) {
			var i;
			for (var a in n.Private && (i = n.Private[1], n.Private = t.CFF.readDict(e, i, i + n.Private[0]), n.Private.Subrs && t.CFF.readSubrs(e, i + n.Private.Subrs, n.Private)), n) [
				"FamilyName",
				"FontName",
				"FullName",
				"Notice",
				"version",
				"Copyright"
			].indexOf(a) != -1 && (n[a] = r[n[a] - 426 + 35]);
		}, t.CFF.readSubrs = function(e, n, r) {
			var i = t._bin, a = [];
			n = t.CFF.readIndex(e, n, a);
			var o, s = a.length;
			o = s < 1240 ? 107 : s < 33900 ? 1131 : 32768, r.Bias = o, r.Subrs = [];
			for (var c = 0; c < a.length - 1; c++) r.Subrs.push(i.readBytes(e, n + a[c], a[c + 1] - a[c]));
		}, t.CFF.tableSE = [
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			1,
			2,
			3,
			4,
			5,
			6,
			7,
			8,
			9,
			10,
			11,
			12,
			13,
			14,
			15,
			16,
			17,
			18,
			19,
			20,
			21,
			22,
			23,
			24,
			25,
			26,
			27,
			28,
			29,
			30,
			31,
			32,
			33,
			34,
			35,
			36,
			37,
			38,
			39,
			40,
			41,
			42,
			43,
			44,
			45,
			46,
			47,
			48,
			49,
			50,
			51,
			52,
			53,
			54,
			55,
			56,
			57,
			58,
			59,
			60,
			61,
			62,
			63,
			64,
			65,
			66,
			67,
			68,
			69,
			70,
			71,
			72,
			73,
			74,
			75,
			76,
			77,
			78,
			79,
			80,
			81,
			82,
			83,
			84,
			85,
			86,
			87,
			88,
			89,
			90,
			91,
			92,
			93,
			94,
			95,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			96,
			97,
			98,
			99,
			100,
			101,
			102,
			103,
			104,
			105,
			106,
			107,
			108,
			109,
			110,
			0,
			111,
			112,
			113,
			114,
			0,
			115,
			116,
			117,
			118,
			119,
			120,
			121,
			122,
			0,
			123,
			0,
			124,
			125,
			126,
			127,
			128,
			129,
			130,
			131,
			0,
			132,
			133,
			0,
			134,
			135,
			136,
			137,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			138,
			0,
			139,
			0,
			0,
			0,
			0,
			140,
			141,
			142,
			143,
			0,
			0,
			0,
			0,
			0,
			144,
			0,
			0,
			0,
			145,
			0,
			0,
			146,
			147,
			148,
			149,
			0,
			0,
			0,
			0
		], t.CFF.glyphByUnicode = function(e, t) {
			for (var n = 0; n < e.charset.length; n++) if (e.charset[n] == t) return n;
			return -1;
		}, t.CFF.glyphBySE = function(e, n) {
			return n < 0 || n > 255 ? -1 : t.CFF.glyphByUnicode(e, t.CFF.tableSE[n]);
		}, t.CFF.readEncoding = function(e, n, r) {
			t._bin;
			var i = [".notdef"], a = e[n];
			if (n++, a != 0) throw "error: unknown encoding format: " + a;
			var o = e[n];
			n++;
			for (var s = 0; s < o; s++) i.push(e[n + s]);
			return i;
		}, t.CFF.readCharset = function(e, n, r) {
			var i = t._bin, a = [".notdef"], o = e[n];
			if (n++, o == 0) for (var s = 0; s < r; s++) {
				var c = i.readUshort(e, n);
				n += 2, a.push(c);
			}
			else {
				if (o != 1 && o != 2) throw "error: format: " + o;
				for (; a.length < r;) {
					c = i.readUshort(e, n), n += 2;
					var l = 0;
					for (o == 1 ? (l = e[n], n++) : (l = i.readUshort(e, n), n += 2), s = 0; s <= l; s++) a.push(c), c++;
				}
			}
			return a;
		}, t.CFF.readIndex = function(e, n, r) {
			var i = t._bin, a = i.readUshort(e, n) + 1, o = e[n += 2];
			if (n++, o == 1) for (var s = 0; s < a; s++) r.push(e[n + s]);
			else if (o == 2) for (s = 0; s < a; s++) r.push(i.readUshort(e, n + 2 * s));
			else if (o == 3) for (s = 0; s < a; s++) r.push(16777215 & i.readUint(e, n + 3 * s - 1));
			else if (a != 1) throw "unsupported offset size: " + o + ", count: " + a;
			return (n += a * o) - 1;
		}, t.CFF.getCharString = function(e, n, r) {
			var i = t._bin, a = e[n], o = e[n + 1];
			e[n + 2], e[n + 3], e[n + 4];
			var s = 1, c = null, l = null;
			a <= 20 && (c = a, s = 1), a == 12 && (c = 100 * a + o, s = 2), 21 <= a && a <= 27 && (c = a, s = 1), a == 28 && (l = i.readShort(e, n + 1), s = 3), 29 <= a && a <= 31 && (c = a, s = 1), 32 <= a && a <= 246 && (l = a - 139, s = 1), 247 <= a && a <= 250 && (l = 256 * (a - 247) + o + 108, s = 2), 251 <= a && a <= 254 && (l = 256 * -(a - 251) - o - 108, s = 2), a == 255 && (l = i.readInt(e, n + 1) / 65535, s = 5), r.val = l == null ? "o" + c : l, r.size = s;
		}, t.CFF.readCharString = function(e, n, r) {
			for (var i = n + r, a = t._bin, o = []; n < i;) {
				var s = e[n], c = e[n + 1];
				e[n + 2], e[n + 3], e[n + 4];
				var l = 1, u = null, d = null;
				s <= 20 && (u = s, l = 1), s == 12 && (u = 100 * s + c, l = 2), s != 19 && s != 20 || (u = s, l = 2), 21 <= s && s <= 27 && (u = s, l = 1), s == 28 && (d = a.readShort(e, n + 1), l = 3), 29 <= s && s <= 31 && (u = s, l = 1), 32 <= s && s <= 246 && (d = s - 139, l = 1), 247 <= s && s <= 250 && (d = 256 * (s - 247) + c + 108, l = 2), 251 <= s && s <= 254 && (d = 256 * -(s - 251) - c - 108, l = 2), s == 255 && (d = a.readInt(e, n + 1) / 65535, l = 5), o.push(d == null ? "o" + u : d), n += l;
			}
			return o;
		}, t.CFF.readDict = function(e, n, r) {
			for (var i = t._bin, a = {}, o = []; n < r;) {
				var s = e[n], c = e[n + 1];
				e[n + 2], e[n + 3], e[n + 4];
				var l = 1, u = null, d = null;
				if (s == 28 && (d = i.readShort(e, n + 1), l = 3), s == 29 && (d = i.readInt(e, n + 1), l = 5), 32 <= s && s <= 246 && (d = s - 139, l = 1), 247 <= s && s <= 250 && (d = 256 * (s - 247) + c + 108, l = 2), 251 <= s && s <= 254 && (d = 256 * -(s - 251) - c - 108, l = 2), s == 255) throw d = i.readInt(e, n + 1) / 65535, l = 5, "unknown number";
				if (s == 30) {
					var f = [];
					for (l = 1;;) {
						var p = e[n + l];
						l++;
						var m = p >> 4, h = 15 & p;
						if (m != 15 && f.push(m), h != 15 && f.push(h), h == 15) break;
					}
					for (var g = "", _ = [
						0,
						1,
						2,
						3,
						4,
						5,
						6,
						7,
						8,
						9,
						".",
						"e",
						"e-",
						"reserved",
						"-",
						"endOfNumber"
					], v = 0; v < f.length; v++) g += _[f[v]];
					d = parseFloat(g);
				}
				s <= 21 && (u = [
					"version",
					"Notice",
					"FullName",
					"FamilyName",
					"Weight",
					"FontBBox",
					"BlueValues",
					"OtherBlues",
					"FamilyBlues",
					"FamilyOtherBlues",
					"StdHW",
					"StdVW",
					"escape",
					"UniqueID",
					"XUID",
					"charset",
					"Encoding",
					"CharStrings",
					"Private",
					"Subrs",
					"defaultWidthX",
					"nominalWidthX"
				][s], l = 1, s == 12 && (u = [
					"Copyright",
					"isFixedPitch",
					"ItalicAngle",
					"UnderlinePosition",
					"UnderlineThickness",
					"PaintType",
					"CharstringType",
					"FontMatrix",
					"StrokeWidth",
					"BlueScale",
					"BlueShift",
					"BlueFuzz",
					"StemSnapH",
					"StemSnapV",
					"ForceBold",
					0,
					0,
					"LanguageGroup",
					"ExpansionFactor",
					"initialRandomSeed",
					"SyntheticBase",
					"PostScript",
					"BaseFontName",
					"BaseFontBlend",
					0,
					0,
					0,
					0,
					0,
					0,
					"ROS",
					"CIDFontVersion",
					"CIDFontRevision",
					"CIDFontType",
					"CIDCount",
					"UIDBase",
					"FDArray",
					"FDSelect",
					"FontName"
				][c], l = 2)), u == null ? o.push(d) : (a[u] = o.length == 1 ? o[0] : o, o = []), n += l;
			}
			return a;
		}, t.cmap = {}, t.cmap.parse = function(e, n, r) {
			e = new Uint8Array(e.buffer, n, r), n = 0;
			var i = t._bin, a = {};
			i.readUshort(e, n), n += 2;
			var o = i.readUshort(e, n);
			n += 2;
			var s = [];
			a.tables = [];
			for (var c = 0; c < o; c++) {
				var l = i.readUshort(e, n);
				n += 2;
				var u = i.readUshort(e, n);
				n += 2;
				var d = i.readUint(e, n);
				n += 4;
				var f = "p" + l + "e" + u, p = s.indexOf(d);
				if (p == -1) {
					var m;
					p = a.tables.length, s.push(d);
					var h = i.readUshort(e, d);
					h == 0 ? m = t.cmap.parse0(e, d) : h == 4 ? m = t.cmap.parse4(e, d) : h == 6 ? m = t.cmap.parse6(e, d) : h == 12 ? m = t.cmap.parse12(e, d) : console.debug("unknown format: " + h, l, u, d), a.tables.push(m);
				}
				if (a[f] != null) throw "multiple tables for one platform+encoding";
				a[f] = p;
			}
			return a;
		}, t.cmap.parse0 = function(e, n) {
			var r = t._bin, i = {};
			i.format = r.readUshort(e, n), n += 2;
			var a = r.readUshort(e, n);
			n += 2, r.readUshort(e, n), n += 2, i.map = [];
			for (var o = 0; o < a - 6; o++) i.map.push(e[n + o]);
			return i;
		}, t.cmap.parse4 = function(e, n) {
			var r = t._bin, i = n, a = {};
			a.format = r.readUshort(e, n), n += 2;
			var o = r.readUshort(e, n);
			n += 2, r.readUshort(e, n), n += 2;
			var s = r.readUshort(e, n);
			n += 2;
			var c = s / 2;
			a.searchRange = r.readUshort(e, n), n += 2, a.entrySelector = r.readUshort(e, n), n += 2, a.rangeShift = r.readUshort(e, n), n += 2, a.endCount = r.readUshorts(e, n, c), n += 2 * c, n += 2, a.startCount = r.readUshorts(e, n, c), n += 2 * c, a.idDelta = [];
			for (var l = 0; l < c; l++) a.idDelta.push(r.readShort(e, n)), n += 2;
			for (a.idRangeOffset = r.readUshorts(e, n, c), n += 2 * c, a.glyphIdArray = []; n < i + o;) a.glyphIdArray.push(r.readUshort(e, n)), n += 2;
			return a;
		}, t.cmap.parse6 = function(e, n) {
			var r = t._bin, i = {};
			i.format = r.readUshort(e, n), n += 2, r.readUshort(e, n), n += 2, r.readUshort(e, n), n += 2, i.firstCode = r.readUshort(e, n), n += 2;
			var a = r.readUshort(e, n);
			n += 2, i.glyphIdArray = [];
			for (var o = 0; o < a; o++) i.glyphIdArray.push(r.readUshort(e, n)), n += 2;
			return i;
		}, t.cmap.parse12 = function(e, n) {
			var r = t._bin, i = {};
			i.format = r.readUshort(e, n), n += 2, n += 2, r.readUint(e, n), n += 4, r.readUint(e, n), n += 4;
			var a = r.readUint(e, n);
			n += 4, i.groups = [];
			for (var o = 0; o < a; o++) {
				var s = n + 12 * o, c = r.readUint(e, s + 0), l = r.readUint(e, s + 4), u = r.readUint(e, s + 8);
				i.groups.push([
					c,
					l,
					u
				]);
			}
			return i;
		}, t.glyf = {}, t.glyf.parse = function(e, t, n, r) {
			for (var i = [], a = 0; a < r.maxp.numGlyphs; a++) i.push(null);
			return i;
		}, t.glyf._parseGlyf = function(e, n) {
			var r = t._bin, i = e._data, a = t._tabOffset(i, "glyf", e._offset) + e.loca[n];
			if (e.loca[n] == e.loca[n + 1]) return null;
			var o = {};
			if (o.noc = r.readShort(i, a), a += 2, o.xMin = r.readShort(i, a), a += 2, o.yMin = r.readShort(i, a), a += 2, o.xMax = r.readShort(i, a), a += 2, o.yMax = r.readShort(i, a), a += 2, o.xMin >= o.xMax || o.yMin >= o.yMax) return null;
			if (o.noc > 0) {
				o.endPts = [];
				for (var s = 0; s < o.noc; s++) o.endPts.push(r.readUshort(i, a)), a += 2;
				var c = r.readUshort(i, a);
				if (a += 2, i.length - a < c) return null;
				o.instructions = r.readBytes(i, a, c), a += c;
				var l = o.endPts[o.noc - 1] + 1;
				for (o.flags = [], s = 0; s < l; s++) {
					var u = i[a];
					if (a++, o.flags.push(u), 8 & u) {
						var d = i[a];
						a++;
						for (var f = 0; f < d; f++) o.flags.push(u), s++;
					}
				}
				for (o.xs = [], s = 0; s < l; s++) {
					var p = (2 & o.flags[s]) != 0, m = (16 & o.flags[s]) != 0;
					p ? (o.xs.push(m ? i[a] : -i[a]), a++) : m ? o.xs.push(0) : (o.xs.push(r.readShort(i, a)), a += 2);
				}
				for (o.ys = [], s = 0; s < l; s++) p = (4 & o.flags[s]) != 0, m = (32 & o.flags[s]) != 0, p ? (o.ys.push(m ? i[a] : -i[a]), a++) : m ? o.ys.push(0) : (o.ys.push(r.readShort(i, a)), a += 2);
				var h = 0, g = 0;
				for (s = 0; s < l; s++) h += o.xs[s], g += o.ys[s], o.xs[s] = h, o.ys[s] = g;
			} else {
				var _;
				o.parts = [];
				do {
					_ = r.readUshort(i, a), a += 2;
					var v = {
						m: {
							a: 1,
							b: 0,
							c: 0,
							d: 1,
							tx: 0,
							ty: 0
						},
						p1: -1,
						p2: -1
					};
					if (o.parts.push(v), v.glyphIndex = r.readUshort(i, a), a += 2, 1 & _) {
						var y = r.readShort(i, a);
						a += 2;
						var b = r.readShort(i, a);
						a += 2;
					} else y = r.readInt8(i, a), a++, b = r.readInt8(i, a), a++;
					2 & _ ? (v.m.tx = y, v.m.ty = b) : (v.p1 = y, v.p2 = b), 8 & _ ? (v.m.a = v.m.d = r.readF2dot14(i, a), a += 2) : 64 & _ ? (v.m.a = r.readF2dot14(i, a), a += 2, v.m.d = r.readF2dot14(i, a), a += 2) : 128 & _ && (v.m.a = r.readF2dot14(i, a), a += 2, v.m.b = r.readF2dot14(i, a), a += 2, v.m.c = r.readF2dot14(i, a), a += 2, v.m.d = r.readF2dot14(i, a), a += 2);
				} while (32 & _);
				if (256 & _) {
					var x = r.readUshort(i, a);
					for (a += 2, o.instr = [], s = 0; s < x; s++) o.instr.push(i[a]), a++;
				}
			}
			return o;
		}, t.GDEF = {}, t.GDEF.parse = function(e, n, r, i) {
			var a = n;
			n += 4;
			var o = t._bin.readUshort(e, n);
			return { glyphClassDef: o === 0 ? null : t._lctf.readClassDef(e, a + o) };
		}, t.GPOS = {}, t.GPOS.parse = function(e, n, r, i) {
			return t._lctf.parse(e, n, r, i, t.GPOS.subt);
		}, t.GPOS.subt = function(e, n, r, i) {
			var a = t._bin, o = r, s = {};
			if (s.fmt = a.readUshort(e, r), r += 2, n == 1 || n == 2 || n == 3 || n == 7 || n == 8 && s.fmt <= 2) {
				var c = a.readUshort(e, r);
				r += 2, s.coverage = t._lctf.readCoverage(e, c + o);
			}
			if (n == 1 && s.fmt == 1) {
				var l = a.readUshort(e, r);
				r += 2, l != 0 && (s.pos = t.GPOS.readValueRecord(e, r, l));
			} else if (n == 2 && s.fmt >= 1 && s.fmt <= 2) {
				l = a.readUshort(e, r), r += 2;
				var u = a.readUshort(e, r);
				r += 2;
				var d = t._lctf.numOfOnes(l), f = t._lctf.numOfOnes(u);
				if (s.fmt == 1) {
					s.pairsets = [];
					var p = a.readUshort(e, r);
					r += 2;
					for (var m = 0; m < p; m++) {
						var h = o + a.readUshort(e, r);
						r += 2;
						var g = a.readUshort(e, h);
						h += 2;
						for (var _ = [], v = 0; v < g; v++) {
							var y = a.readUshort(e, h);
							h += 2, l != 0 && (T = t.GPOS.readValueRecord(e, h, l), h += 2 * d), u != 0 && (E = t.GPOS.readValueRecord(e, h, u), h += 2 * f), _.push({
								gid2: y,
								val1: T,
								val2: E
							});
						}
						s.pairsets.push(_);
					}
				}
				if (s.fmt == 2) {
					var b = a.readUshort(e, r);
					r += 2;
					var x = a.readUshort(e, r);
					r += 2;
					var S = a.readUshort(e, r);
					r += 2;
					var C = a.readUshort(e, r);
					for (r += 2, s.classDef1 = t._lctf.readClassDef(e, o + b), s.classDef2 = t._lctf.readClassDef(e, o + x), s.matrix = [], m = 0; m < S; m++) {
						var w = [];
						for (v = 0; v < C; v++) {
							var T = null, E = null;
							l != 0 && (T = t.GPOS.readValueRecord(e, r, l), r += 2 * d), u != 0 && (E = t.GPOS.readValueRecord(e, r, u), r += 2 * f), w.push({
								val1: T,
								val2: E
							});
						}
						s.matrix.push(w);
					}
				}
			} else if (n == 4 && s.fmt == 1) s.markCoverage = t._lctf.readCoverage(e, a.readUshort(e, r) + o), s.baseCoverage = t._lctf.readCoverage(e, a.readUshort(e, r + 2) + o), s.markClassCount = a.readUshort(e, r + 4), s.markArray = t.GPOS.readMarkArray(e, a.readUshort(e, r + 6) + o), s.baseArray = t.GPOS.readBaseArray(e, a.readUshort(e, r + 8) + o, s.markClassCount);
			else if (n == 6 && s.fmt == 1) s.mark1Coverage = t._lctf.readCoverage(e, a.readUshort(e, r) + o), s.mark2Coverage = t._lctf.readCoverage(e, a.readUshort(e, r + 2) + o), s.markClassCount = a.readUshort(e, r + 4), s.mark1Array = t.GPOS.readMarkArray(e, a.readUshort(e, r + 6) + o), s.mark2Array = t.GPOS.readBaseArray(e, a.readUshort(e, r + 8) + o, s.markClassCount);
			else {
				if (n == 9 && s.fmt == 1) {
					var D = a.readUshort(e, r);
					r += 2;
					var O = a.readUint(e, r);
					if (r += 4, i.ltype == 9) i.ltype = D;
					else if (i.ltype != D) throw "invalid extension substitution";
					return t.GPOS.subt(e, i.ltype, o + O);
				}
				console.debug("unsupported GPOS table LookupType", n, "format", s.fmt);
			}
			return s;
		}, t.GPOS.readValueRecord = function(e, n, r) {
			var i = t._bin, a = [];
			return a.push(1 & r ? i.readShort(e, n) : 0), n += 1 & r ? 2 : 0, a.push(2 & r ? i.readShort(e, n) : 0), n += 2 & r ? 2 : 0, a.push(4 & r ? i.readShort(e, n) : 0), n += 4 & r ? 2 : 0, a.push(8 & r ? i.readShort(e, n) : 0), n += 8 & r ? 2 : 0, a;
		}, t.GPOS.readBaseArray = function(e, n, r) {
			var i = t._bin, a = [], o = n, s = i.readUshort(e, n);
			n += 2;
			for (var c = 0; c < s; c++) {
				for (var l = [], u = 0; u < r; u++) l.push(t.GPOS.readAnchorRecord(e, o + i.readUshort(e, n))), n += 2;
				a.push(l);
			}
			return a;
		}, t.GPOS.readMarkArray = function(e, n) {
			var r = t._bin, i = [], a = n, o = r.readUshort(e, n);
			n += 2;
			for (var s = 0; s < o; s++) {
				var c = t.GPOS.readAnchorRecord(e, r.readUshort(e, n + 2) + a);
				c.markClass = r.readUshort(e, n), i.push(c), n += 4;
			}
			return i;
		}, t.GPOS.readAnchorRecord = function(e, n) {
			var r = t._bin, i = {};
			return i.fmt = r.readUshort(e, n), i.x = r.readShort(e, n + 2), i.y = r.readShort(e, n + 4), i;
		}, t.GSUB = {}, t.GSUB.parse = function(e, n, r, i) {
			return t._lctf.parse(e, n, r, i, t.GSUB.subt);
		}, t.GSUB.subt = function(e, n, r, i) {
			var a = t._bin, o = r, s = {};
			if (s.fmt = a.readUshort(e, r), r += 2, n != 1 && n != 2 && n != 4 && n != 5 && n != 6) return null;
			if (n == 1 || n == 2 || n == 4 || n == 5 && s.fmt <= 2 || n == 6 && s.fmt <= 2) {
				var c = a.readUshort(e, r);
				r += 2, s.coverage = t._lctf.readCoverage(e, o + c);
			}
			if (n == 1 && s.fmt >= 1 && s.fmt <= 2) {
				if (s.fmt == 1) s.delta = a.readShort(e, r), r += 2;
				else if (s.fmt == 2) {
					var l = a.readUshort(e, r);
					r += 2, s.newg = a.readUshorts(e, r, l), r += 2 * s.newg.length;
				}
			} else if (n == 2 && s.fmt == 1) {
				l = a.readUshort(e, r), r += 2, s.seqs = [];
				for (var u = 0; u < l; u++) {
					var d = a.readUshort(e, r) + o;
					r += 2;
					var f = a.readUshort(e, d);
					s.seqs.push(a.readUshorts(e, d + 2, f));
				}
			} else if (n == 4) for (s.vals = [], l = a.readUshort(e, r), r += 2, u = 0; u < l; u++) {
				var p = a.readUshort(e, r);
				r += 2, s.vals.push(t.GSUB.readLigatureSet(e, o + p));
			}
			else if (n == 5 && s.fmt == 2) {
				if (s.fmt == 2) {
					var m = a.readUshort(e, r);
					r += 2, s.cDef = t._lctf.readClassDef(e, o + m), s.scset = [];
					var h = a.readUshort(e, r);
					for (r += 2, u = 0; u < h; u++) {
						var g = a.readUshort(e, r);
						r += 2, s.scset.push(g == 0 ? null : t.GSUB.readSubClassSet(e, o + g));
					}
				}
			} else if (n == 6 && s.fmt == 3) {
				if (s.fmt == 3) {
					for (u = 0; u < 3; u++) {
						l = a.readUshort(e, r), r += 2;
						for (var _ = [], v = 0; v < l; v++) _.push(t._lctf.readCoverage(e, o + a.readUshort(e, r + 2 * v)));
						r += 2 * l, u == 0 && (s.backCvg = _), u == 1 && (s.inptCvg = _), u == 2 && (s.ahedCvg = _);
					}
					l = a.readUshort(e, r), r += 2, s.lookupRec = t.GSUB.readSubstLookupRecords(e, r, l);
				}
			} else {
				if (n == 7 && s.fmt == 1) {
					var y = a.readUshort(e, r);
					r += 2;
					var b = a.readUint(e, r);
					if (r += 4, i.ltype == 9) i.ltype = y;
					else if (i.ltype != y) throw "invalid extension substitution";
					return t.GSUB.subt(e, i.ltype, o + b);
				}
				console.debug("unsupported GSUB table LookupType", n, "format", s.fmt);
			}
			return s;
		}, t.GSUB.readSubClassSet = function(e, n) {
			var r = t._bin.readUshort, i = n, a = [], o = r(e, n);
			n += 2;
			for (var s = 0; s < o; s++) {
				var c = r(e, n);
				n += 2, a.push(t.GSUB.readSubClassRule(e, i + c));
			}
			return a;
		}, t.GSUB.readSubClassRule = function(e, n) {
			var r = t._bin.readUshort, i = {}, a = r(e, n), o = r(e, n += 2);
			n += 2, i.input = [];
			for (var s = 0; s < a - 1; s++) i.input.push(r(e, n)), n += 2;
			return i.substLookupRecords = t.GSUB.readSubstLookupRecords(e, n, o), i;
		}, t.GSUB.readSubstLookupRecords = function(e, n, r) {
			for (var i = t._bin.readUshort, a = [], o = 0; o < r; o++) a.push(i(e, n), i(e, n + 2)), n += 4;
			return a;
		}, t.GSUB.readChainSubClassSet = function(e, n) {
			var r = t._bin, i = n, a = [], o = r.readUshort(e, n);
			n += 2;
			for (var s = 0; s < o; s++) {
				var c = r.readUshort(e, n);
				n += 2, a.push(t.GSUB.readChainSubClassRule(e, i + c));
			}
			return a;
		}, t.GSUB.readChainSubClassRule = function(e, n) {
			for (var r = t._bin, i = {}, a = [
				"backtrack",
				"input",
				"lookahead"
			], o = 0; o < a.length; o++) {
				var s = r.readUshort(e, n);
				n += 2, o == 1 && s--, i[a[o]] = r.readUshorts(e, n, s), n += 2 * i[a[o]].length;
			}
			return s = r.readUshort(e, n), n += 2, i.subst = r.readUshorts(e, n, 2 * s), n += 2 * i.subst.length, i;
		}, t.GSUB.readLigatureSet = function(e, n) {
			var r = t._bin, i = n, a = [], o = r.readUshort(e, n);
			n += 2;
			for (var s = 0; s < o; s++) {
				var c = r.readUshort(e, n);
				n += 2, a.push(t.GSUB.readLigature(e, i + c));
			}
			return a;
		}, t.GSUB.readLigature = function(e, n) {
			var r = t._bin, i = { chain: [] };
			i.nglyph = r.readUshort(e, n), n += 2;
			var a = r.readUshort(e, n);
			n += 2;
			for (var o = 0; o < a - 1; o++) i.chain.push(r.readUshort(e, n)), n += 2;
			return i;
		}, t.head = {}, t.head.parse = function(e, n, r) {
			var i = t._bin, a = {};
			return i.readFixed(e, n), n += 4, a.fontRevision = i.readFixed(e, n), n += 4, i.readUint(e, n), n += 4, i.readUint(e, n), n += 4, a.flags = i.readUshort(e, n), n += 2, a.unitsPerEm = i.readUshort(e, n), n += 2, a.created = i.readUint64(e, n), n += 8, a.modified = i.readUint64(e, n), n += 8, a.xMin = i.readShort(e, n), n += 2, a.yMin = i.readShort(e, n), n += 2, a.xMax = i.readShort(e, n), n += 2, a.yMax = i.readShort(e, n), n += 2, a.macStyle = i.readUshort(e, n), n += 2, a.lowestRecPPEM = i.readUshort(e, n), n += 2, a.fontDirectionHint = i.readShort(e, n), n += 2, a.indexToLocFormat = i.readShort(e, n), n += 2, a.glyphDataFormat = i.readShort(e, n), n += 2, a;
		}, t.hhea = {}, t.hhea.parse = function(e, n, r) {
			var i = t._bin, a = {};
			return i.readFixed(e, n), n += 4, a.ascender = i.readShort(e, n), n += 2, a.descender = i.readShort(e, n), n += 2, a.lineGap = i.readShort(e, n), n += 2, a.advanceWidthMax = i.readUshort(e, n), n += 2, a.minLeftSideBearing = i.readShort(e, n), n += 2, a.minRightSideBearing = i.readShort(e, n), n += 2, a.xMaxExtent = i.readShort(e, n), n += 2, a.caretSlopeRise = i.readShort(e, n), n += 2, a.caretSlopeRun = i.readShort(e, n), n += 2, a.caretOffset = i.readShort(e, n), n += 2, n += 8, a.metricDataFormat = i.readShort(e, n), n += 2, a.numberOfHMetrics = i.readUshort(e, n), n += 2, a;
		}, t.hmtx = {}, t.hmtx.parse = function(e, n, r, i) {
			for (var a = t._bin, o = {
				aWidth: [],
				lsBearing: []
			}, s = 0, c = 0, l = 0; l < i.maxp.numGlyphs; l++) l < i.hhea.numberOfHMetrics && (s = a.readUshort(e, n), n += 2, c = a.readShort(e, n), n += 2), o.aWidth.push(s), o.lsBearing.push(c);
			return o;
		}, t.kern = {}, t.kern.parse = function(e, n, r, i) {
			var a = t._bin, o = a.readUshort(e, n);
			if (n += 2, o == 1) return t.kern.parseV1(e, n - 2, r, i);
			var s = a.readUshort(e, n);
			n += 2;
			for (var c = {
				glyph1: [],
				rval: []
			}, l = 0; l < s; l++) {
				n += 2, r = a.readUshort(e, n), n += 2;
				var u = a.readUshort(e, n);
				n += 2;
				var d = u >>> 8;
				if ((d &= 15) != 0) throw "unknown kern table format: " + d;
				n = t.kern.readFormat0(e, n, c);
			}
			return c;
		}, t.kern.parseV1 = function(e, n, r, i) {
			var a = t._bin;
			a.readFixed(e, n), n += 4;
			var o = a.readUint(e, n);
			n += 4;
			for (var s = {
				glyph1: [],
				rval: []
			}, c = 0; c < o; c++) {
				a.readUint(e, n), n += 4;
				var l = a.readUshort(e, n);
				n += 2, a.readUshort(e, n), n += 2;
				var u = l >>> 8;
				if ((u &= 15) != 0) throw "unknown kern table format: " + u;
				n = t.kern.readFormat0(e, n, s);
			}
			return s;
		}, t.kern.readFormat0 = function(e, n, r) {
			var i = t._bin, a = -1, o = i.readUshort(e, n);
			n += 2, i.readUshort(e, n), n += 2, i.readUshort(e, n), n += 2, i.readUshort(e, n), n += 2;
			for (var s = 0; s < o; s++) {
				var c = i.readUshort(e, n);
				n += 2;
				var l = i.readUshort(e, n);
				n += 2;
				var u = i.readShort(e, n);
				n += 2, c != a && (r.glyph1.push(c), r.rval.push({
					glyph2: [],
					vals: []
				}));
				var d = r.rval[r.rval.length - 1];
				d.glyph2.push(l), d.vals.push(u), a = c;
			}
			return n;
		}, t.loca = {}, t.loca.parse = function(e, n, r, i) {
			var a = t._bin, o = [], s = i.head.indexToLocFormat, c = i.maxp.numGlyphs + 1;
			if (s == 0) for (var l = 0; l < c; l++) o.push(a.readUshort(e, n + (l << 1)) << 1);
			if (s == 1) for (l = 0; l < c; l++) o.push(a.readUint(e, n + (l << 2)));
			return o;
		}, t.maxp = {}, t.maxp.parse = function(e, n, r) {
			var i = t._bin, a = {}, o = i.readUint(e, n);
			return n += 4, a.numGlyphs = i.readUshort(e, n), n += 2, o == 65536 && (a.maxPoints = i.readUshort(e, n), n += 2, a.maxContours = i.readUshort(e, n), n += 2, a.maxCompositePoints = i.readUshort(e, n), n += 2, a.maxCompositeContours = i.readUshort(e, n), n += 2, a.maxZones = i.readUshort(e, n), n += 2, a.maxTwilightPoints = i.readUshort(e, n), n += 2, a.maxStorage = i.readUshort(e, n), n += 2, a.maxFunctionDefs = i.readUshort(e, n), n += 2, a.maxInstructionDefs = i.readUshort(e, n), n += 2, a.maxStackElements = i.readUshort(e, n), n += 2, a.maxSizeOfInstructions = i.readUshort(e, n), n += 2, a.maxComponentElements = i.readUshort(e, n), n += 2, a.maxComponentDepth = i.readUshort(e, n), n += 2), a;
		}, t.name = {}, t.name.parse = function(e, n, r) {
			var i = t._bin, a = {};
			i.readUshort(e, n), n += 2;
			var o = i.readUshort(e, n);
			n += 2, i.readUshort(e, n);
			for (var s, c = [
				"copyright",
				"fontFamily",
				"fontSubfamily",
				"ID",
				"fullName",
				"version",
				"postScriptName",
				"trademark",
				"manufacturer",
				"designer",
				"description",
				"urlVendor",
				"urlDesigner",
				"licence",
				"licenceURL",
				"---",
				"typoFamilyName",
				"typoSubfamilyName",
				"compatibleFull",
				"sampleText",
				"postScriptCID",
				"wwsFamilyName",
				"wwsSubfamilyName",
				"lightPalette",
				"darkPalette"
			], l = n += 2, u = 0; u < o; u++) {
				var d = i.readUshort(e, n);
				n += 2;
				var f = i.readUshort(e, n);
				n += 2;
				var p = i.readUshort(e, n);
				n += 2;
				var m = i.readUshort(e, n);
				n += 2;
				var h = i.readUshort(e, n);
				n += 2;
				var g = i.readUshort(e, n);
				n += 2;
				var _, v = c[m], y = l + 12 * o + g;
				if (d == 0) _ = i.readUnicode(e, y, h / 2);
				else if (d == 3 && f == 0) _ = i.readUnicode(e, y, h / 2);
				else if (f == 0) _ = i.readASCII(e, y, h);
				else if (f == 1) _ = i.readUnicode(e, y, h / 2);
				else if (f == 3) _ = i.readUnicode(e, y, h / 2);
				else {
					if (d != 1) throw "unknown encoding " + f + ", platformID: " + d;
					_ = i.readASCII(e, y, h), console.debug("reading unknown MAC encoding " + f + " as ASCII");
				}
				var b = "p" + d + "," + p.toString(16);
				a[b] == null && (a[b] = {}), a[b][v === void 0 ? m : v] = _, a[b]._lang = p;
			}
			for (var x in a) if (a[x].postScriptName != null && a[x]._lang == 1033) return a[x];
			for (var x in a) if (a[x].postScriptName != null && a[x]._lang == 0) return a[x];
			for (var x in a) if (a[x].postScriptName != null && a[x]._lang == 3084) return a[x];
			for (var x in a) if (a[x].postScriptName != null) return a[x];
			for (var x in a) {
				s = x;
				break;
			}
			return console.debug("returning name table with languageID " + a[s]._lang), a[s];
		}, t["OS/2"] = {}, t["OS/2"].parse = function(e, n, r) {
			var i = t._bin.readUshort(e, n);
			n += 2;
			var a = {};
			if (i == 0) t["OS/2"].version0(e, n, a);
			else if (i == 1) t["OS/2"].version1(e, n, a);
			else if (i == 2 || i == 3 || i == 4) t["OS/2"].version2(e, n, a);
			else {
				if (i != 5) throw "unknown OS/2 table version: " + i;
				t["OS/2"].version5(e, n, a);
			}
			return a;
		}, t["OS/2"].version0 = function(e, n, r) {
			var i = t._bin;
			return r.xAvgCharWidth = i.readShort(e, n), n += 2, r.usWeightClass = i.readUshort(e, n), n += 2, r.usWidthClass = i.readUshort(e, n), n += 2, r.fsType = i.readUshort(e, n), n += 2, r.ySubscriptXSize = i.readShort(e, n), n += 2, r.ySubscriptYSize = i.readShort(e, n), n += 2, r.ySubscriptXOffset = i.readShort(e, n), n += 2, r.ySubscriptYOffset = i.readShort(e, n), n += 2, r.ySuperscriptXSize = i.readShort(e, n), n += 2, r.ySuperscriptYSize = i.readShort(e, n), n += 2, r.ySuperscriptXOffset = i.readShort(e, n), n += 2, r.ySuperscriptYOffset = i.readShort(e, n), n += 2, r.yStrikeoutSize = i.readShort(e, n), n += 2, r.yStrikeoutPosition = i.readShort(e, n), n += 2, r.sFamilyClass = i.readShort(e, n), n += 2, r.panose = i.readBytes(e, n, 10), n += 10, r.ulUnicodeRange1 = i.readUint(e, n), n += 4, r.ulUnicodeRange2 = i.readUint(e, n), n += 4, r.ulUnicodeRange3 = i.readUint(e, n), n += 4, r.ulUnicodeRange4 = i.readUint(e, n), n += 4, r.achVendID = [
				i.readInt8(e, n),
				i.readInt8(e, n + 1),
				i.readInt8(e, n + 2),
				i.readInt8(e, n + 3)
			], n += 4, r.fsSelection = i.readUshort(e, n), n += 2, r.usFirstCharIndex = i.readUshort(e, n), n += 2, r.usLastCharIndex = i.readUshort(e, n), n += 2, r.sTypoAscender = i.readShort(e, n), n += 2, r.sTypoDescender = i.readShort(e, n), n += 2, r.sTypoLineGap = i.readShort(e, n), n += 2, r.usWinAscent = i.readUshort(e, n), n += 2, r.usWinDescent = i.readUshort(e, n), n += 2;
		}, t["OS/2"].version1 = function(e, n, r) {
			var i = t._bin;
			return n = t["OS/2"].version0(e, n, r), r.ulCodePageRange1 = i.readUint(e, n), n += 4, r.ulCodePageRange2 = i.readUint(e, n), n += 4;
		}, t["OS/2"].version2 = function(e, n, r) {
			var i = t._bin;
			return n = t["OS/2"].version1(e, n, r), r.sxHeight = i.readShort(e, n), n += 2, r.sCapHeight = i.readShort(e, n), n += 2, r.usDefault = i.readUshort(e, n), n += 2, r.usBreak = i.readUshort(e, n), n += 2, r.usMaxContext = i.readUshort(e, n), n += 2;
		}, t["OS/2"].version5 = function(e, n, r) {
			var i = t._bin;
			return n = t["OS/2"].version2(e, n, r), r.usLowerOpticalPointSize = i.readUshort(e, n), n += 2, r.usUpperOpticalPointSize = i.readUshort(e, n), n += 2;
		}, t.post = {}, t.post.parse = function(e, n, r) {
			var i = t._bin, a = {};
			return a.version = i.readFixed(e, n), n += 4, a.italicAngle = i.readFixed(e, n), n += 4, a.underlinePosition = i.readShort(e, n), n += 2, a.underlineThickness = i.readShort(e, n), n += 2, a;
		}, t == null && (t = {}), t.U == null && (t.U = {}), t.U.codeToGlyph = function(e, t) {
			var n = e.cmap, r = -1;
			if (n.p0e4 == null ? n.p3e1 == null ? n.p1e0 == null ? n.p0e3 != null && (r = n.p0e3) : r = n.p1e0 : r = n.p3e1 : r = n.p0e4, r == -1) throw "no familiar platform and encoding!";
			var i = n.tables[r];
			if (i.format == 0) return t >= i.map.length ? 0 : i.map[t];
			if (i.format == 4) {
				for (var a = -1, o = 0; o < i.endCount.length; o++) if (t <= i.endCount[o]) {
					a = o;
					break;
				}
				return a == -1 || i.startCount[a] > t ? 0 : 65535 & (i.idRangeOffset[a] == 0 ? t + i.idDelta[a] : i.glyphIdArray[t - i.startCount[a] + (i.idRangeOffset[a] >> 1) - (i.idRangeOffset.length - a)]);
			}
			if (i.format == 12) {
				if (t > i.groups[i.groups.length - 1][1]) return 0;
				for (o = 0; o < i.groups.length; o++) {
					var s = i.groups[o];
					if (s[0] <= t && t <= s[1]) return s[2] + (t - s[0]);
				}
				return 0;
			}
			throw "unknown cmap table format " + i.format;
		}, t.U.glyphToPath = function(e, n) {
			var r = {
				cmds: [],
				crds: []
			};
			if (e.SVG && e.SVG.entries[n]) {
				var i = e.SVG.entries[n];
				return i == null ? r : (typeof i == "string" && (i = t.SVG.toPath(i), e.SVG.entries[n] = i), i);
			}
			if (e.CFF) {
				var a = {
					x: 0,
					y: 0,
					stack: [],
					nStems: 0,
					haveWidth: !1,
					width: e.CFF.Private ? e.CFF.Private.defaultWidthX : 0,
					open: !1
				}, o = e.CFF, s = e.CFF.Private;
				if (o.ROS) {
					for (var c = 0; o.FDSelect[c + 2] <= n;) c += 2;
					s = o.FDArray[o.FDSelect[c + 1]].Private;
				}
				t.U._drawCFF(e.CFF.CharStrings[n], a, o, s, r);
			} else e.glyf && t.U._drawGlyf(n, e, r);
			return r;
		}, t.U._drawGlyf = function(e, n, r) {
			var i = n.glyf[e];
			i == null && (i = n.glyf[e] = t.glyf._parseGlyf(n, e)), i != null && (i.noc > -1 ? t.U._simpleGlyph(i, r) : t.U._compoGlyph(i, n, r));
		}, t.U._simpleGlyph = function(e, n) {
			for (var r = 0; r < e.noc; r++) {
				for (var i = r == 0 ? 0 : e.endPts[r - 1] + 1, a = e.endPts[r], o = i; o <= a; o++) {
					var s = o == i ? a : o - 1, c = o == a ? i : o + 1, l = 1 & e.flags[o], u = 1 & e.flags[s], d = 1 & e.flags[c], f = e.xs[o], p = e.ys[o];
					if (o == i) if (l) {
						if (!u) {
							t.U.P.moveTo(n, f, p);
							continue;
						}
						t.U.P.moveTo(n, e.xs[s], e.ys[s]);
					} else u ? t.U.P.moveTo(n, e.xs[s], e.ys[s]) : t.U.P.moveTo(n, (e.xs[s] + f) / 2, (e.ys[s] + p) / 2);
					l ? u && t.U.P.lineTo(n, f, p) : d ? t.U.P.qcurveTo(n, f, p, e.xs[c], e.ys[c]) : t.U.P.qcurveTo(n, f, p, (f + e.xs[c]) / 2, (p + e.ys[c]) / 2);
				}
				t.U.P.closePath(n);
			}
		}, t.U._compoGlyph = function(e, n, r) {
			for (var i = 0; i < e.parts.length; i++) {
				var a = {
					cmds: [],
					crds: []
				}, o = e.parts[i];
				t.U._drawGlyf(o.glyphIndex, n, a);
				for (var s = o.m, c = 0; c < a.crds.length; c += 2) {
					var l = a.crds[c], u = a.crds[c + 1];
					r.crds.push(l * s.a + u * s.b + s.tx), r.crds.push(l * s.c + u * s.d + s.ty);
				}
				for (c = 0; c < a.cmds.length; c++) r.cmds.push(a.cmds[c]);
			}
		}, t.U._getGlyphClass = function(e, n) {
			var r = t._lctf.getInterval(n, e);
			return r == -1 ? 0 : n[r + 2];
		}, t.U._applySubs = function(e, n, r, i) {
			for (var a = e.length - n - 1, o = 0; o < r.tabs.length; o++) if (r.tabs[o] != null) {
				var s, c = r.tabs[o];
				if (!c.coverage || (s = t._lctf.coverageIndex(c.coverage, e[n])) != -1) {
					if (r.ltype == 1) e[n], c.fmt == 1 ? e[n] = e[n] + c.delta : e[n] = c.newg[s];
					else if (r.ltype == 4) for (var l = c.vals[s], u = 0; u < l.length; u++) {
						var d = l[u], f = d.chain.length;
						if (!(f > a)) {
							for (var p = !0, m = 0, h = 0; h < f; h++) {
								for (; e[n + m + (1 + h)] == -1;) m++;
								d.chain[h] != e[n + m + (1 + h)] && (p = !1);
							}
							if (p) {
								for (e[n] = d.nglyph, h = 0; h < f + m; h++) e[n + h + 1] = -1;
								break;
							}
						}
					}
					else if (r.ltype == 5 && c.fmt == 2) for (var g = t._lctf.getInterval(c.cDef, e[n]), _ = c.cDef[g + 2], v = c.scset[_], y = 0; y < v.length; y++) {
						var b = v[y], x = b.input;
						if (!(x.length > a)) {
							for (p = !0, h = 0; h < x.length; h++) {
								var S = t._lctf.getInterval(c.cDef, e[n + 1 + h]);
								if (g == -1 && c.cDef[S + 2] != x[h]) {
									p = !1;
									break;
								}
							}
							if (p) {
								var C = b.substLookupRecords;
								for (u = 0; u < C.length; u += 2) C[u], C[u + 1];
							}
						}
					}
					else if (r.ltype == 6 && c.fmt == 3) {
						if (!t.U._glsCovered(e, c.backCvg, n - c.backCvg.length) || !t.U._glsCovered(e, c.inptCvg, n) || !t.U._glsCovered(e, c.ahedCvg, n + c.inptCvg.length)) continue;
						var w = c.lookupRec;
						for (y = 0; y < w.length; y += 2) {
							g = w[y];
							var T = i[w[y + 1]];
							t.U._applySubs(e, n + g, T, i);
						}
					}
				}
			}
		}, t.U._glsCovered = function(e, n, r) {
			for (var i = 0; i < n.length; i++) if (t._lctf.coverageIndex(n[i], e[r + i]) == -1) return !1;
			return !0;
		}, t.U.glyphsToPath = function(e, n, r) {
			for (var i = {
				cmds: [],
				crds: []
			}, a = 0, o = 0; o < n.length; o++) {
				var s = n[o];
				if (s != -1) {
					for (var c = o < n.length - 1 && n[o + 1] != -1 ? n[o + 1] : 0, l = t.U.glyphToPath(e, s), u = 0; u < l.crds.length; u += 2) i.crds.push(l.crds[u] + a), i.crds.push(l.crds[u + 1]);
					for (r && i.cmds.push(r), u = 0; u < l.cmds.length; u++) i.cmds.push(l.cmds[u]);
					r && i.cmds.push("X"), a += e.hmtx.aWidth[s], o < n.length - 1 && (a += t.U.getPairAdjustment(e, s, c));
				}
			}
			return i;
		}, t.U.P = {}, t.U.P.moveTo = function(e, t, n) {
			e.cmds.push("M"), e.crds.push(t, n);
		}, t.U.P.lineTo = function(e, t, n) {
			e.cmds.push("L"), e.crds.push(t, n);
		}, t.U.P.curveTo = function(e, t, n, r, i, a, o) {
			e.cmds.push("C"), e.crds.push(t, n, r, i, a, o);
		}, t.U.P.qcurveTo = function(e, t, n, r, i) {
			e.cmds.push("Q"), e.crds.push(t, n, r, i);
		}, t.U.P.closePath = function(e) {
			e.cmds.push("Z");
		}, t.U._drawCFF = function(e, n, r, i, a) {
			for (var o = n.stack, s = n.nStems, c = n.haveWidth, l = n.width, u = n.open, d = 0, f = n.x, p = n.y, m = 0, h = 0, g = 0, _ = 0, v = 0, y = 0, b = 0, x = 0, S = 0, C = 0, w = {
				val: 0,
				size: 0
			}; d < e.length;) {
				t.CFF.getCharString(e, d, w);
				var T = w.val;
				if (d += w.size, T == "o1" || T == "o18") o.length % 2 != 0 && !c && (l = o.shift() + i.nominalWidthX), s += o.length >> 1, o.length = 0, c = !0;
				else if (T == "o3" || T == "o23") o.length % 2 != 0 && !c && (l = o.shift() + i.nominalWidthX), s += o.length >> 1, o.length = 0, c = !0;
				else if (T == "o4") o.length > 1 && !c && (l = o.shift() + i.nominalWidthX, c = !0), u && t.U.P.closePath(a), p += o.pop(), t.U.P.moveTo(a, f, p), u = !0;
				else if (T == "o5") for (; o.length > 0;) f += o.shift(), p += o.shift(), t.U.P.lineTo(a, f, p);
				else if (T == "o6" || T == "o7") for (var E = o.length, D = T == "o6", O = 0; O < E; O++) {
					var k = o.shift();
					D ? f += k : p += k, D = !D, t.U.P.lineTo(a, f, p);
				}
				else if (T == "o8" || T == "o24") {
					E = o.length;
					for (var A = 0; A + 6 <= E;) m = f + o.shift(), h = p + o.shift(), g = m + o.shift(), _ = h + o.shift(), f = g + o.shift(), p = _ + o.shift(), t.U.P.curveTo(a, m, h, g, _, f, p), A += 6;
					T == "o24" && (f += o.shift(), p += o.shift(), t.U.P.lineTo(a, f, p));
				} else {
					if (T == "o11") break;
					if (T == "o1234" || T == "o1235" || T == "o1236" || T == "o1237") T == "o1234" && (h = p, g = (m = f + o.shift()) + o.shift(), C = _ = h + o.shift(), y = _, x = p, f = (b = (v = (S = g + o.shift()) + o.shift()) + o.shift()) + o.shift(), t.U.P.curveTo(a, m, h, g, _, S, C), t.U.P.curveTo(a, v, y, b, x, f, p)), T == "o1235" && (m = f + o.shift(), h = p + o.shift(), g = m + o.shift(), _ = h + o.shift(), S = g + o.shift(), C = _ + o.shift(), v = S + o.shift(), y = C + o.shift(), b = v + o.shift(), x = y + o.shift(), f = b + o.shift(), p = x + o.shift(), o.shift(), t.U.P.curveTo(a, m, h, g, _, S, C), t.U.P.curveTo(a, v, y, b, x, f, p)), T == "o1236" && (m = f + o.shift(), h = p + o.shift(), g = m + o.shift(), C = _ = h + o.shift(), y = _, b = (v = (S = g + o.shift()) + o.shift()) + o.shift(), x = y + o.shift(), f = b + o.shift(), t.U.P.curveTo(a, m, h, g, _, S, C), t.U.P.curveTo(a, v, y, b, x, f, p)), T == "o1237" && (m = f + o.shift(), h = p + o.shift(), g = m + o.shift(), _ = h + o.shift(), S = g + o.shift(), C = _ + o.shift(), v = S + o.shift(), y = C + o.shift(), b = v + o.shift(), x = y + o.shift(), Math.abs(b - f) > Math.abs(x - p) ? f = b + o.shift() : p = x + o.shift(), t.U.P.curveTo(a, m, h, g, _, S, C), t.U.P.curveTo(a, v, y, b, x, f, p));
					else if (T == "o14") {
						if (o.length > 0 && !c && (l = o.shift() + r.nominalWidthX, c = !0), o.length == 4) {
							var j = o.shift(), ee = o.shift(), te = o.shift(), ne = o.shift(), re = t.CFF.glyphBySE(r, te), M = t.CFF.glyphBySE(r, ne);
							t.U._drawCFF(r.CharStrings[re], n, r, i, a), n.x = j, n.y = ee, t.U._drawCFF(r.CharStrings[M], n, r, i, a);
						}
						u && (t.U.P.closePath(a), u = !1);
					} else if (T == "o19" || T == "o20") o.length % 2 != 0 && !c && (l = o.shift() + i.nominalWidthX), s += o.length >> 1, o.length = 0, c = !0, d += s + 7 >> 3;
					else if (T == "o21") o.length > 2 && !c && (l = o.shift() + i.nominalWidthX, c = !0), p += o.pop(), f += o.pop(), u && t.U.P.closePath(a), t.U.P.moveTo(a, f, p), u = !0;
					else if (T == "o22") o.length > 1 && !c && (l = o.shift() + i.nominalWidthX, c = !0), f += o.pop(), u && t.U.P.closePath(a), t.U.P.moveTo(a, f, p), u = !0;
					else if (T == "o25") {
						for (; o.length > 6;) f += o.shift(), p += o.shift(), t.U.P.lineTo(a, f, p);
						m = f + o.shift(), h = p + o.shift(), g = m + o.shift(), _ = h + o.shift(), f = g + o.shift(), p = _ + o.shift(), t.U.P.curveTo(a, m, h, g, _, f, p);
					} else if (T == "o26") for (o.length % 2 && (f += o.shift()); o.length > 0;) m = f, h = p + o.shift(), f = g = m + o.shift(), p = (_ = h + o.shift()) + o.shift(), t.U.P.curveTo(a, m, h, g, _, f, p);
					else if (T == "o27") for (o.length % 2 && (p += o.shift()); o.length > 0;) h = p, g = (m = f + o.shift()) + o.shift(), _ = h + o.shift(), f = g + o.shift(), p = _, t.U.P.curveTo(a, m, h, g, _, f, p);
					else if (T == "o10" || T == "o29") {
						var ie = T == "o10" ? i : r;
						if (o.length == 0) console.debug("error: empty stack");
						else {
							var ae = o.pop(), N = ie.Subrs[ae + ie.Bias];
							n.x = f, n.y = p, n.nStems = s, n.haveWidth = c, n.width = l, n.open = u, t.U._drawCFF(N, n, r, i, a), f = n.x, p = n.y, s = n.nStems, c = n.haveWidth, l = n.width, u = n.open;
						}
					} else if (T == "o30" || T == "o31") {
						var oe = o.length, se = (A = 0, T == "o31");
						for (A += oe - (E = -3 & oe); A < E;) se ? (h = p, g = (m = f + o.shift()) + o.shift(), p = (_ = h + o.shift()) + o.shift(), E - A == 5 ? (f = g + o.shift(), A++) : f = g, se = !1) : (m = f, h = p + o.shift(), g = m + o.shift(), _ = h + o.shift(), f = g + o.shift(), E - A == 5 ? (p = _ + o.shift(), A++) : p = _, se = !0), t.U.P.curveTo(a, m, h, g, _, f, p), A += 4;
					} else {
						if ((T + "").charAt(0) == "o") throw console.debug("Unknown operation: " + T, e), T;
						o.push(T);
					}
				}
			}
			n.x = f, n.y = p, n.nStems = s, n.haveWidth = c, n.width = l, n.open = u;
		};
		var n = t, r = { Typr: n };
		return e.Typr = n, e.default = r, Object.defineProperty(e, "__esModule", { value: !0 }), e;
	}({}).Typr;
}
function qO() {
	return function(e) {
		var t = Uint8Array, n = Uint16Array, r = Uint32Array, i = new t([
			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,
			0,
			0,
			0
		]), a = new t([
			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,
			0,
			0
		]), o = new t([
			16,
			17,
			18,
			0,
			8,
			7,
			9,
			6,
			10,
			5,
			11,
			4,
			12,
			3,
			13,
			2,
			14,
			1,
			15
		]), s = function(e, t) {
			for (var i = new n(31), a = 0; a < 31; ++a) i[a] = t += 1 << e[a - 1];
			var o = new r(i[30]);
			for (a = 1; a < 30; ++a) for (var s = i[a]; s < i[a + 1]; ++s) o[s] = s - i[a] << 5 | a;
			return [i, o];
		}, c = s(i, 2), l = c[0], u = c[1];
		l[28] = 258, u[258] = 28;
		for (var d = s(a, 0)[0], f = new n(32768), p = 0; p < 32768; ++p) {
			var m = (43690 & p) >>> 1 | (21845 & p) << 1;
			m = (61680 & (m = (52428 & m) >>> 2 | (13107 & m) << 2)) >>> 4 | (3855 & m) << 4, f[p] = ((65280 & m) >>> 8 | (255 & m) << 8) >>> 1;
		}
		var h = function(e, t, r) {
			for (var i = e.length, a = 0, o = new n(t); a < i; ++a) ++o[e[a] - 1];
			var s, c = new n(t);
			for (a = 0; a < t; ++a) c[a] = c[a - 1] + o[a - 1] << 1;
			if (r) {
				s = new n(1 << t);
				var l = 15 - t;
				for (a = 0; a < i; ++a) if (e[a]) for (var u = a << 4 | e[a], d = t - e[a], p = c[e[a] - 1]++ << d, m = p | (1 << d) - 1; p <= m; ++p) s[f[p] >>> l] = u;
			} else for (s = new n(i), a = 0; a < i; ++a) e[a] && (s[a] = f[c[e[a] - 1]++] >>> 15 - e[a]);
			return s;
		}, g = new t(288);
		for (p = 0; p < 144; ++p) g[p] = 8;
		for (p = 144; p < 256; ++p) g[p] = 9;
		for (p = 256; p < 280; ++p) g[p] = 7;
		for (p = 280; p < 288; ++p) g[p] = 8;
		var _ = new t(32);
		for (p = 0; p < 32; ++p) _[p] = 5;
		var v = h(g, 9, 1), y = h(_, 5, 1), b = function(e) {
			for (var t = e[0], n = 1; n < e.length; ++n) e[n] > t && (t = e[n]);
			return t;
		}, x = function(e, t, n) {
			var r = t / 8 | 0;
			return (e[r] | e[r + 1] << 8) >> (7 & t) & n;
		}, S = function(e, t) {
			var n = t / 8 | 0;
			return (e[n] | e[n + 1] << 8 | e[n + 2] << 16) >> (7 & t);
		}, C = [
			"unexpected EOF",
			"invalid block type",
			"invalid length/literal",
			"invalid distance",
			"stream finished",
			"no stream handler",
			,
			"no callback",
			"invalid UTF-8 data",
			"extra field too long",
			"date not in range 1980-2099",
			"filename too long",
			"stream finishing",
			"invalid zip data"
		], w = function(e, t, n) {
			var r = Error(t || C[e]);
			if (r.code = e, Error.captureStackTrace && Error.captureStackTrace(r, w), !n) throw r;
			return r;
		}, T = function(e, s, c) {
			var u = e.length;
			if (!u || c && !c.l && u < 5) return s || new t(0);
			var f = !s || c, p = !c || c.i;
			c || (c = {}), s || (s = new t(3 * u));
			var m, g = function(e) {
				var n = s.length;
				if (e > n) {
					var r = new t(Math.max(2 * n, e));
					r.set(s), s = r;
				}
			}, _ = c.f || 0, C = c.p || 0, T = c.b || 0, E = c.l, D = c.d, O = c.m, k = c.n, A = 8 * u;
			do {
				if (!E) {
					c.f = _ = x(e, C, 1);
					var j = x(e, C + 1, 3);
					if (C += 3, !j) {
						var ee = e[(le = ((m = C) / 8 | 0) + (7 & m && 1) + 4) - 4] | e[le - 3] << 8, te = le + ee;
						if (te > u) {
							p && w(0);
							break;
						}
						f && g(T + ee), s.set(e.subarray(le, te), T), c.b = T += ee, c.p = C = 8 * te;
						continue;
					}
					if (j == 1) E = v, D = y, O = 9, k = 5;
					else if (j == 2) {
						var ne = x(e, C, 31) + 257, re = x(e, C + 10, 15) + 4, M = ne + x(e, C + 5, 31) + 1;
						C += 14;
						for (var ie = new t(M), ae = new t(19), N = 0; N < re; ++N) ae[o[N]] = x(e, C + 3 * N, 7);
						C += 3 * re;
						var oe = b(ae), se = (1 << oe) - 1, ce = h(ae, oe, 1);
						for (N = 0; N < M;) {
							var le, ue = ce[x(e, C, se)];
							if (C += 15 & ue, (le = ue >>> 4) < 16) ie[N++] = le;
							else {
								var de = 0, P = 0;
								for (le == 16 ? (P = 3 + x(e, C, 3), C += 2, de = ie[N - 1]) : le == 17 ? (P = 3 + x(e, C, 7), C += 3) : le == 18 && (P = 11 + x(e, C, 127), C += 7); P--;) ie[N++] = de;
							}
						}
						var fe = ie.subarray(0, ne), pe = ie.subarray(ne);
						O = b(fe), k = b(pe), E = h(fe, O, 1), D = h(pe, k, 1);
					} else w(1);
					if (C > A) {
						p && w(0);
						break;
					}
				}
				f && g(T + 131072);
				for (var me = (1 << O) - 1, he = (1 << k) - 1, ge = C;; ge = C) {
					var _e = (de = E[S(e, C) & me]) >>> 4;
					if ((C += 15 & de) > A) {
						p && w(0);
						break;
					}
					if (de || w(2), _e < 256) s[T++] = _e;
					else {
						if (_e == 256) {
							ge = C, E = null;
							break;
						}
						var ve = _e - 254;
						if (_e > 264) {
							var ye = i[N = _e - 257];
							ve = x(e, C, (1 << ye) - 1) + l[N], C += ye;
						}
						var be = D[S(e, C) & he], xe = be >>> 4;
						if (be || w(3), C += 15 & be, pe = d[xe], xe > 3 && (ye = a[xe], pe += S(e, C) & (1 << ye) - 1, C += ye), C > A) {
							p && w(0);
							break;
						}
						f && g(T + 131072);
						for (var Se = T + ve; T < Se; T += 4) s[T] = s[T - pe], s[T + 1] = s[T + 1 - pe], s[T + 2] = s[T + 2 - pe], s[T + 3] = s[T + 3 - pe];
						T = Se;
					}
				}
				c.l = E, c.p = ge, c.b = T, E && (_ = 1, c.m = O, c.d = D, c.n = k);
			} while (!_);
			return T == s.length ? s : function(e, i, a) {
				(i == null || i < 0) && (i = 0), (a == null || a > e.length) && (a = e.length);
				var o = new (e instanceof n ? n : e instanceof r ? r : t)(a - i);
				return o.set(e.subarray(i, a)), o;
			}(s, 0, T);
		}, E = new t(0), D = typeof TextDecoder < "u" && new TextDecoder();
		try {
			D.decode(E, { stream: !0 });
		} catch {}
		return e.convert_streams = function(e) {
			var t = new DataView(e), n = 0;
			function r() {
				var e = t.getUint16(n);
				return n += 2, e;
			}
			function i() {
				var e = t.getUint32(n);
				return n += 4, e;
			}
			function a(e) {
				_.setUint16(v, e), v += 2;
			}
			function o(e) {
				_.setUint32(v, e), v += 4;
			}
			for (var s = {
				signature: i(),
				flavor: i(),
				length: i(),
				numTables: r(),
				reserved: r(),
				totalSfntSize: i(),
				majorVersion: r(),
				minorVersion: r(),
				metaOffset: i(),
				metaLength: i(),
				metaOrigLength: i(),
				privOffset: i(),
				privLength: i()
			}, c = 0; 2 ** c <= s.numTables;) c++;
			c--;
			for (var l = 16 * 2 ** c, u = 16 * s.numTables - l, d = 12, f = [], p = 0; p < s.numTables; p++) f.push({
				tag: i(),
				offset: i(),
				compLength: i(),
				origLength: i(),
				origChecksum: i()
			}), d += 16;
			var m, h = new Uint8Array(12 + 16 * f.length + f.reduce((function(e, t) {
				return e + t.origLength + 4;
			}), 0)), g = h.buffer, _ = new DataView(g), v = 0;
			return o(s.flavor), a(s.numTables), a(l), a(c), a(u), f.forEach((function(e) {
				o(e.tag), o(e.origChecksum), o(d), o(e.origLength), e.outOffset = d, (d += e.origLength) % 4 != 0 && (d += 4 - d % 4);
			})), f.forEach((function(t) {
				var n, r = e.slice(t.offset, t.offset + t.compLength);
				if (t.compLength != t.origLength) {
					var i = new Uint8Array(t.origLength);
					n = new Uint8Array(r, 2), T(n, i);
				} else i = new Uint8Array(r);
				h.set(i, t.outOffset);
				var a = 0;
				(d = t.outOffset + t.origLength) % 4 != 0 && (a = 4 - d % 4), h.set(new Uint8Array(a).buffer, t.outOffset + t.origLength), m = d + a;
			})), g.slice(0, m);
		}, Object.defineProperty(e, "__esModule", { value: !0 }), e;
	}({}).convert_streams;
}
function JO(e, t) {
	let n = {
		M: 2,
		L: 2,
		Q: 4,
		C: 6,
		Z: 0
	}, r = {
		C: "18g,ca,368,1kz",
		D: "17k,6,2,2+4,5+c,2+6,2+1,10+1,9+f,j+11,2+1,a,2,2+1,15+2,3,j+2,6+3,2+8,2,2,2+1,w+a,4+e,3+3,2,3+2,3+5,23+w,2f+4,3,2+9,2,b,2+3,3,1k+9,6+1,3+1,2+2,2+d,30g,p+y,1,1+1g,f+x,2,sd2+1d,jf3+4,f+3,2+4,2+2,b+3,42,2,4+2,2+1,2,3,t+1,9f+w,2,el+2,2+g,d+2,2l,2+1,5,3+1,2+1,2,3,6,16wm+1v",
		R: "17m+3,2,2,6+3,m,15+2,2+2,h+h,13,3+8,2,2,3+1,2,p+1,x,5+4,5,a,2,2,3,u,c+2,g+1,5,2+1,4+1,5j,6+1,2,b,2+2,f,2+1,1s+2,2,3+1,7,1ez0,2,2+1,4+4,b,4,3,b,42,2+2,4,3,2+1,2,o+3,ae,ep,x,2o+2,3+1,3,5+1,6",
		L: "x9u,jff,a,fd,jv",
		T: "4t,gj+33,7o+4,1+1,7c+18,2,2+1,2+1,2,21+a,2,1b+k,h,2u+6,3+5,3+1,2+3,y,2,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,3,7,6+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+d,1,1+1,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,ek,3+1,r+4,1e+4,6+5,2p+c,1+3,1,1+2,1+b,2db+2,3y,2p+v,ff+3,30+1,n9x,1+2,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,5s,6y+2,ea,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+9,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2,2b+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,470+8,at4+4,1o+6,t5,1s+3,2a,f5l+1,2+3,43o+2,a+7,1+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,1,gzau,v+2n,3l+6n"
	}, i;
	function a(e) {
		if (!i) {
			let e = {
				R: 2,
				L: 1,
				D: 4,
				C: 16,
				U: 32,
				T: 8
			};
			i = /* @__PURE__ */ new Map();
			for (let t in r) {
				let n = 0;
				r[t].split(",").forEach((r) => {
					let [a, o] = r.split("+");
					a = parseInt(a, 36), o = o ? parseInt(o, 36) : 0, i.set(n += a, e[t]);
					for (let r = o; r--;) i.set(++n, e[t]);
				});
			}
		}
		return i.get(e) || 32;
	}
	let o = [
		null,
		"isol",
		"init",
		"fina",
		"medi"
	];
	function s(e) {
		let t = new Uint8Array(e.length), n = 32, r = 1, i = -1;
		for (let o = 0; o < e.length; o++) {
			let s = e.codePointAt(o), c = a(s) | 0, l = 1;
			c & 8 || (n & 21 ? c & 22 ? (l = 3, (r === 1 || r === 3) && t[i]++) : c & 33 && (r === 2 || r === 4) && t[i]-- : n & 34 && (r === 2 || r === 4) && t[i]--, r = t[o] = l, n = c, i = o, s > 65535 && o++);
		}
		return t;
	}
	function c(t, n) {
		let r = [];
		for (let i = 0; i < n.length; i++) {
			let a = n.codePointAt(i);
			a > 65535 && i++, r.push(e.U.codeToGlyph(t, a));
		}
		let i = t.GSUB;
		if (i) {
			let { lookupList: t, featureList: a } = i, c, l = /^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws|ccmp)$/, u = [];
			a.forEach((i) => {
				if (l.test(i.tag)) for (let a = 0; a < i.tab.length; a++) {
					if (u[i.tab[a]]) continue;
					u[i.tab[a]] = !0;
					let l = t[i.tab[a]], d = /^(isol|init|fina|medi)$/.test(i.tag);
					d && !c && (c = s(n));
					for (let n = 0; n < r.length; n++) (!c || !d || o[c[n]] === i.tag) && e.U._applySubs(r, n, l, t);
				}
			});
		}
		return r;
	}
	function l(t, n) {
		let r = new Int16Array(n.length * 3), i = 0;
		for (; i < n.length; i++) {
			let c = n[i];
			if (c === -1) continue;
			r[i * 3 + 2] = t.hmtx.aWidth[c];
			let l = t.GPOS;
			if (l) {
				let d = l.lookupList;
				for (let l = 0; l < d.length; l++) {
					let f = d[l];
					for (let l = 0; l < f.tabs.length; l++) {
						let d = f.tabs[l];
						if (f.ltype === 1) {
							if (e._lctf.coverageIndex(d.coverage, c) !== -1 && d.pos) {
								s(d.pos, i);
								break;
							}
						} else if (f.ltype === 2) {
							let t = null, r = a();
							if (r !== -1) {
								let a = e._lctf.coverageIndex(d.coverage, n[r]);
								if (a !== -1) {
									if (d.fmt === 1) {
										let e = d.pairsets[a];
										for (let n = 0; n < e.length; n++) e[n].gid2 === c && (t = e[n]);
									} else if (d.fmt === 2) {
										let i = e.U._getGlyphClass(n[r], d.classDef1), a = e.U._getGlyphClass(c, d.classDef2);
										t = d.matrix[i][a];
									}
									if (t) {
										t.val1 && s(t.val1, r), t.val2 && s(t.val2, i);
										break;
									}
								}
							}
						} else if (f.ltype === 4) {
							let t = e._lctf.coverageIndex(d.markCoverage, c);
							if (t !== -1) {
								let s = a(o), c = s === -1 ? -1 : e._lctf.coverageIndex(d.baseCoverage, n[s]);
								if (c !== -1) {
									let e = d.markArray[t], n = d.baseArray[c][e.markClass];
									r[i * 3] = n.x - e.x + r[s * 3] - r[s * 3 + 2], r[i * 3 + 1] = n.y - e.y + r[s * 3 + 1];
									break;
								}
							}
						} else if (f.ltype === 6) {
							let o = e._lctf.coverageIndex(d.mark1Coverage, c);
							if (o !== -1) {
								let s = a();
								if (s !== -1) {
									let a = n[s];
									if (u(t, a) === 3) {
										let t = e._lctf.coverageIndex(d.mark2Coverage, a);
										if (t !== -1) {
											let e = d.mark1Array[o], n = d.mark2Array[t][e.markClass];
											r[i * 3] = n.x - e.x + r[s * 3] - r[s * 3 + 2], r[i * 3 + 1] = n.y - e.y + r[s * 3 + 1];
											break;
										}
									}
								}
							}
						}
					}
				}
			} else if (t.kern && !t.cff) {
				let e = a();
				if (e !== -1) {
					let i = t.kern.glyph1.indexOf(n[e]);
					if (i !== -1) {
						let n = t.kern.rval[i].glyph2.indexOf(c);
						n !== -1 && (r[e * 3 + 2] += t.kern.rval[i].vals[n]);
					}
				}
			}
		}
		return r;
		function a(e) {
			for (let t = i - 1; t >= 0; t--) if (n[t] !== -1 && (!e || e(n[t]))) return t;
			return -1;
		}
		function o(e) {
			return u(t, e) === 1;
		}
		function s(e, t) {
			for (let n = 0; n < 3; n++) r[t * 3 + n] += e[n] || 0;
		}
	}
	function u(t, n) {
		let r = t.GDEF && t.GDEF.glyphClassDef;
		return r ? e.U._getGlyphClass(n, r) : 0;
	}
	function d(...e) {
		for (let t = 0; t < e.length; t++) if (typeof e[t] == "number") return e[t];
	}
	function f(t) {
		let r = Object.create(null), i = t["OS/2"], a = t.hhea, o = t.head.unitsPerEm, s = d(i && i.sTypoAscender, a && a.ascender, o), u = {
			unitsPerEm: o,
			ascender: s,
			descender: d(i && i.sTypoDescender, a && a.descender, 0),
			capHeight: d(i && i.sCapHeight, s),
			xHeight: d(i && i.sxHeight, s),
			lineGap: d(i && i.sTypoLineGap, a && a.lineGap),
			supportsCodePoint(n) {
				return e.U.codeToGlyph(t, n) > 0;
			},
			forEachGlyph(i, a, o, s) {
				let d = 0, f = 1 / u.unitsPerEm * a, p = c(t, i), m = 0, h = l(t, p);
				return p.forEach((c, l) => {
					if (c !== -1) {
						let i = r[c];
						if (!i) {
							let { cmds: a, crds: o } = e.U.glyphToPath(t, c), s = "", l = 0;
							for (let e = 0, t = a.length; e < t; e++) {
								let t = n[a[e]];
								s += a[e];
								for (let e = 1; e <= t; e++) s += (e > 1 ? "," : "") + o[l++];
							}
							let u, d, f, p;
							if (o.length) {
								u = d = Infinity, f = p = -Infinity;
								for (let e = 0, t = o.length; e < t; e += 2) {
									let t = o[e], n = o[e + 1];
									t < u && (u = t), n < d && (d = n), t > f && (f = t), n > p && (p = n);
								}
							} else u = f = d = p = 0;
							i = r[c] = {
								index: c,
								advanceWidth: t.hmtx.aWidth[c],
								xMin: u,
								yMin: d,
								xMax: f,
								yMax: p,
								path: s
							};
						}
						s.call(null, i, d + h[l * 3] * f, h[l * 3 + 1] * f, m), d += h[l * 3 + 2] * f, o && (d += o * a);
					}
					m += i.codePointAt(m) > 65535 ? 2 : 1;
				}), d;
			}
		};
		return u;
	}
	return function(n) {
		let r = new Uint8Array(n, 0, 4), i = e._bin.readASCII(r, 0, 4);
		if (i === "wOFF") n = t(n);
		else if (i === "wOF2") throw Error("woff2 fonts not supported");
		return f(e.parse(n)[0]);
	};
}
var YO = /*#__PURE__*/ CO({
	name: "Typr Font Parser",
	dependencies: [
		KO,
		qO,
		JO
	],
	init(e, t, n) {
		return n(e(), t());
	}
});
function XO() {
	return function(e) {
		var t = function() {
			this.buckets = /* @__PURE__ */ new Map();
		};
		t.prototype.add = function(e) {
			var t = e >> 5;
			this.buckets.set(t, (this.buckets.get(t) || 0) | 1 << (31 & e));
		}, t.prototype.has = function(e) {
			var t = this.buckets.get(e >> 5);
			return t !== void 0 && (t & 1 << (31 & e)) != 0;
		}, t.prototype.serialize = function() {
			var e = [];
			return this.buckets.forEach((function(t, n) {
				e.push((+n).toString(36) + ":" + t.toString(36));
			})), e.join(",");
		}, t.prototype.deserialize = function(e) {
			var t = this;
			this.buckets.clear(), e.split(",").forEach((function(e) {
				var n = e.split(":");
				t.buckets.set(parseInt(n[0], 36), parseInt(n[1], 36));
			}));
		};
		var n = 2 ** 8, r = n - 1, i = ~r;
		function a(e) {
			var t = function(e) {
				return e & i;
			}(e).toString(16), r = function(e) {
				return (e & i) + n - 1;
			}(e).toString(16);
			return "codepoint-index/plane" + (e >> 16) + "/" + t + "-" + r + ".json";
		}
		function o(e, t) {
			var n = e & r, i = t.codePointAt(n / 6 | 0);
			return ((i = (i || 48) - 48) & 1 << n % 6) != 0;
		}
		function s(e, t) {
			var n;
			(n = e, n.replace(/U\+/gi, "").replace(/^,+|,+$/g, "").split(/,+/).map((function(e) {
				return e.split("-").map((function(e) {
					return parseInt(e.trim(), 16);
				}));
			}))).forEach((function(e) {
				var n = e[0], r = e[1];
				r === void 0 && (r = n), t(n, r);
			}));
		}
		function c(e, t) {
			s(e, (function(e, n) {
				for (var r = e; r <= n; r++) t(r);
			}));
		}
		var l = {}, u = {}, d = /* @__PURE__ */ new WeakMap(), f = "https://cdn.jsdelivr.net/gh/lojjic/unicode-font-resolver@v1.0.1/packages/data";
		function p(e) {
			var n = d.get(e);
			return n || (n = new t(), c(e.ranges, (function(e) {
				return n.add(e);
			})), d.set(e, n)), n;
		}
		var m, h = /* @__PURE__ */ new Map();
		function g(e, t, n) {
			return e[t] ? t : e[n] ? n : function(e) {
				for (var t in e) return t;
			}(e);
		}
		function _(e, t) {
			var n = t;
			if (!e.includes(n)) {
				n = Infinity;
				for (var r = 0; r < e.length; r++) Math.abs(e[r] - t) < Math.abs(n - t) && (n = e[r]);
			}
			return n;
		}
		function v(e) {
			return m || (m = /* @__PURE__ */ new Set(), c("9-D,20,85,A0,1680,2000-200A,2028-202F,205F,3000", (function(e) {
				m.add(e);
			}))), m.has(e);
		}
		return e.CodePointSet = t, e.clearCache = function() {
			l = {}, u = {};
		}, e.getFontsForString = function(e, t) {
			t === void 0 && (t = {});
			var n, r = t.lang;
			r === void 0 && (r = /\p{Script=Hangul}/u.test(n = e) ? "ko" : /\p{Script=Hiragana}|\p{Script=Katakana}/u.test(n) ? "ja" : "en");
			var i = t.category;
			i === void 0 && (i = "sans-serif");
			var s = t.style;
			s === void 0 && (s = "normal");
			var c = t.weight;
			c === void 0 && (c = 400);
			var d = (t.dataUrl || f).replace(/\/$/g, ""), m = /* @__PURE__ */ new Map(), y = new Uint8Array(e.length), b = {}, x = {}, S = Array(e.length), C = /* @__PURE__ */ new Map(), w = !1;
			function T(e) {
				var t = h.get(e);
				return t || (t = fetch(d + "/" + e).then((function(e) {
					if (!e.ok) throw Error(e.statusText);
					return e.json().then((function(e) {
						if (!Array.isArray(e) || e[0] !== 1) throw Error("Incorrect schema version; need 1, got " + e[0]);
						return e[1];
					}));
				})).catch((function(t) {
					if (d !== f) return w || (console.error("unicode-font-resolver: Failed loading from dataUrl \"" + d + "\", trying default CDN. " + t.message), w = !0), d = f, h.delete(e), T(e);
					throw t;
				})), h.set(e, t)), t;
			}
			for (var E = function(t) {
				var n = e.codePointAt(t), r = a(n);
				S[t] = r, l[r] || C.has(r) || C.set(r, T(r).then((function(e) {
					l[r] = e;
				}))), n > 65535 && (t++, D = t);
			}, D = 0; D < e.length; D++) E(D);
			return Promise.all(C.values()).then((function() {
				C.clear();
				for (var t = function(t) {
					var i = e.codePointAt(t), a = null, s = l[S[t]], c = void 0;
					for (var d in s) {
						var f = x[d];
						if (f === void 0 && (f = x[d] = new RegExp(d).test(r || "en")), f) {
							for (var p in c = d, s[d]) if (o(i, s[d][p])) {
								a = p;
								break;
							}
							break;
						}
					}
					if (!a) {
						t: for (var m in s) if (m !== c) {
							for (var h in s[m]) if (o(i, s[m][h])) {
								a = h;
								break t;
							}
						}
					}
					a || (console.debug("No font coverage for U+" + i.toString(16)), a = "latin"), S[t] = a, u[a] || C.has(a) || C.set(a, T("font-meta/" + a + ".json").then((function(e) {
						u[a] = e;
					}))), i > 65535 && (t++, n = t);
				}, n = 0; n < e.length; n++) t(n);
				return Promise.all(C.values());
			})).then((function() {
				for (var t, n = null, r = 0; r < e.length; r++) {
					var a = e.codePointAt(r);
					if (n && (v(a) || p(n).has(a))) y[r] = y[r - 1];
					else {
						n = u[S[r]];
						var o = b[n.id];
						if (!o) {
							var l = n.typeforms, f = g(l, i, "sans-serif"), h = g(l[f], s, "normal"), x = _((t = l[f]) == null ? void 0 : t[h], c);
							o = b[n.id] = d + "/font-files/" + n.id + "/" + f + "." + h + "." + x + ".woff";
						}
						var C = m.get(o);
						C == null && (C = m.size, m.set(o, C)), y[r] = C;
					}
					a > 65535 && (r++, y[r] = y[r - 1]);
				}
				return {
					fontUrls: Array.from(m.keys()),
					chars: y
				};
			}));
		}, Object.defineProperty(e, "__esModule", { value: !0 }), e;
	}({});
}
function ZO(e, t) {
	let n = Object.create(null), r = Object.create(null);
	function i(t, n) {
		let r = (e) => {
			console.error(`Failure loading font ${t}`, e);
		};
		try {
			let i = new XMLHttpRequest();
			i.open("get", t, !0), i.responseType = "arraybuffer", i.onload = function() {
				if (i.status >= 400) r(Error(i.statusText));
				else if (i.status > 0) try {
					let r = e(i.response);
					r.src = t, n(r);
				} catch (e) {
					r(e);
				}
			}, i.onerror = r, i.send();
		} catch (e) {
			r(e);
		}
	}
	function a(e, t) {
		let a = n[e];
		a ? t(a) : r[e] ? r[e].push(t) : (r[e] = [t], i(e, (t) => {
			t.src = e, n[e] = t, r[e].forEach((e) => e(t)), delete r[e];
		}));
	}
	return function(e, r, { lang: i, fonts: o = [], style: s = "normal", weight: c = "normal", unicodeFontsURL: l } = {}) {
		let u = new Uint8Array(e.length), d = [];
		e.length || h();
		let f = /* @__PURE__ */ new Map(), p = [];
		if (s !== "italic" && (s = "normal"), typeof c != "number" && (c = c === "bold" ? 700 : 400), o && !Array.isArray(o) && (o = [o]), o = o.slice().filter((e) => !e.lang || e.lang.test(i)).reverse(), o.length) {
			let t = 0;
			(function r(i = 0) {
				for (let s = i, c = e.length; s < c; s++) {
					let i = e.codePointAt(s);
					if (t === 1 && d[u[s - 1]].supportsCodePoint(i) || s > 0 && /\s/.test(e[s])) u[s] = u[s - 1], t === 2 && (p[p.length - 1][1] = s);
					else for (let e = u[s], c = o.length; e <= c; e++) if (e === c) {
						let e = t === 2 ? p[p.length - 1] : p[p.length] = [s, s];
						e[1] = s, t = 2;
					} else {
						u[s] = e;
						let { src: c, unicodeRange: l } = o[e];
						if (!l || g(i, l)) {
							let e = n[c];
							if (!e) {
								a(c, () => {
									r(s);
								});
								return;
							}
							if (e.supportsCodePoint(i)) {
								let n = f.get(e);
								typeof n != "number" && (n = d.length, d.push(e), f.set(e, n)), u[s] = n, t = 1;
								break;
							}
						}
					}
					i > 65535 && s + 1 < c && (u[s + 1] = u[s], s++, t === 2 && (p[p.length - 1][1] = s));
				}
				m();
			})();
		} else p.push([0, e.length - 1]), m();
		function m() {
			if (p.length) {
				let n = p.map((t) => e.substring(t[0], t[1] + 1)).join("\n");
				t.getFontsForString(n, {
					lang: i || void 0,
					style: s,
					weight: c,
					dataUrl: l
				}).then(({ fontUrls: e, chars: t }) => {
					let n = d.length, r = 0;
					p.forEach((e) => {
						for (let i = 0, a = e[1] - e[0]; i <= a; i++) u[e[0] + i] = t[r++] + n;
						r++;
					});
					let i = 0;
					e.forEach((t, r) => {
						a(t, (t) => {
							d[r + n] = t, ++i === e.length && h();
						});
					});
				});
			} else h();
		}
		function h() {
			r({
				chars: u,
				fonts: d
			});
		}
		function g(e, t) {
			for (let n = 0; n < t.length; n++) {
				let [r, i = r] = t[n];
				if (r <= e && e <= i) return !0;
			}
			return !1;
		}
	};
}
var QO = /*#__PURE__*/ CO({
	name: "FontResolver",
	dependencies: [
		ZO,
		YO,
		XO
	],
	init(e, t, n) {
		return e(t, n());
	}
});
function $O(e, t) {
	let n = Infinity, r = /[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/, i = "[^\\S\\u00A0]", a = RegExp(`${i}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);
	function o({ text: t, lang: n, fonts: r, style: i, weight: a, preResolvedFonts: o, unicodeFontsURL: s }, c) {
		let l = ({ chars: e, fonts: t }) => {
			let n, r, i = [];
			for (let a = 0; a < e.length; a++) e[a] === r ? n.end = a : (r = e[a], i.push(n = {
				start: a,
				end: a,
				fontObj: t[e[a]]
			}));
			c(i);
		};
		o ? l(o) : e(t, l, {
			lang: n,
			fonts: r,
			style: i,
			weight: a,
			unicodeFontsURL: s
		});
	}
	function s({ text: e = "", font: s, lang: c, sdfGlyphSize: p = 64, fontSize: m = 400, fontWeight: h = 1, fontStyle: g = "normal", letterSpacing: _ = 0, lineHeight: v = "normal", maxWidth: y = n, direction: b, textAlign: x = "left", textIndent: S = 0, whiteSpace: C = "normal", overflowWrap: w = "normal", anchorX: T = 0, anchorY: E = 0, metricsOnly: D = !1, unicodeFontsURL: O, preResolvedFonts: k = null, includeCaretPositions: A = !1, chunkedBoundsSize: j = 8192, colorRanges: ee = null }, te) {
		let ne = d(), re = {
			fontLoad: 0,
			typesetting: 0
		};
		e.indexOf("\r") > -1 && (console.info("Typesetter: got text with \\r chars; normalizing to \\n"), e = e.replace(/\r\n/g, "\n").replace(/\r/g, "\n")), m = +m, _ = +_, y = +y, v = v || "normal", S = +S, o({
			text: e,
			lang: c,
			style: g,
			weight: h,
			fonts: typeof s == "string" ? [{ src: s }] : s,
			unicodeFontsURL: O,
			preResolvedFonts: k
		}, (o) => {
			re.fontLoad = d() - ne;
			let s = isFinite(y), c = null, p = null, h = null, g = null, O = null, k = null, M = null, ie = null, ae = 0, N = 0, oe = C !== "nowrap", se = /* @__PURE__ */ new Map(), ce = d(), le = S, ue = 0, de = new f(), P = [de];
			o.forEach((t) => {
				let { fontObj: n } = t, { ascender: o, descender: c, unitsPerEm: l, lineGap: u, capHeight: d, xHeight: p } = n, h = se.get(n);
				if (!h) {
					let e = m / l, t = v === "normal" ? (o - c + u) * e : v * m, r = (t - (o - c) * e) / 2, i = Math.min(t, (o - c) * e), a = (o + c) / 2 * e + i / 2;
					h = {
						index: se.size,
						src: n.src,
						fontObj: n,
						fontSizeMult: e,
						unitsPerEm: l,
						ascender: o * e,
						descender: c * e,
						capHeight: d * e,
						xHeight: p * e,
						lineHeight: t,
						baseline: -r - o * e,
						caretTop: a,
						caretBottom: a - i
					}, se.set(n, h);
				}
				let { fontSizeMult: g } = h, b = e.slice(t.start, t.end + 1), x, C;
				n.forEachGlyph(b, m, _, (n, o, c, l) => {
					o += ue, l += t.start, x = o, C = n;
					let u = e.charAt(l), d = n.advanceWidth * g, p = de.count, v;
					if ("isEmpty" in n || (n.isWhitespace = !!u && RegExp(i).test(u), n.canBreakAfter = !!u && a.test(u), n.isEmpty = n.xMin === n.xMax || n.yMin === n.yMax || r.test(u)), !n.isWhitespace && !n.isEmpty && N++, oe && s && !n.isWhitespace && o + d + le > y && p) {
						if (de.glyphAt(p - 1).glyphObj.canBreakAfter) v = new f(), le = -o;
						else for (let e = p; e--;) if (e === 0 && w === "break-word") {
							v = new f(), le = -o;
							break;
						} else if (de.glyphAt(e).glyphObj.canBreakAfter) {
							v = de.splitAt(e + 1);
							let t = v.glyphAt(0).x;
							le -= t;
							for (let e = v.count; e--;) v.glyphAt(e).x -= t;
							break;
						}
						v && (de.isSoftWrapped = !0, de = v, P.push(de), ae = y);
					}
					let b = de.glyphAt(de.count);
					b.glyphObj = n, b.x = o + le, b.y = c, b.width = d, b.charIndex = l, b.fontData = h, u === "\n" && (de = new f(), P.push(de), le = -(o + d + _ * m) + S);
				}), ue = x + C.advanceWidth * g + _ * m;
			});
			let fe = 0;
			P.forEach((e) => {
				let t = !0;
				for (let n = e.count; n--;) {
					let r = e.glyphAt(n);
					t && !r.glyphObj.isWhitespace && (e.width = r.x + r.width, e.width > ae && (ae = e.width), t = !1);
					let { lineHeight: i, capHeight: a, xHeight: o, baseline: s } = r.fontData;
					i > e.lineHeight && (e.lineHeight = i);
					let c = s - e.baseline;
					c < 0 && (e.baseline += c, e.cap += c, e.ex += c), e.cap = Math.max(e.cap, e.baseline + a), e.ex = Math.max(e.ex, e.baseline + o);
				}
				e.baseline -= fe, e.cap -= fe, e.ex -= fe, fe += e.lineHeight;
			});
			let pe = 0, me = 0;
			if (T && (typeof T == "number" ? pe = -T : typeof T == "string" && (pe = -ae * (T === "left" ? 0 : T === "center" ? .5 : T === "right" ? 1 : l(T)))), E && (typeof E == "number" ? me = -E : typeof E == "string" && (me = E === "top" ? 0 : E === "top-baseline" ? -P[0].baseline : E === "top-cap" ? -P[0].cap : E === "top-ex" ? -P[0].ex : E === "middle" ? fe / 2 : E === "bottom" ? fe : E === "bottom-baseline" ? -P[P.length - 1].baseline : l(E) * fe)), !D) {
				let r = t.getEmbeddingLevels(e, b);
				c = new Uint16Array(N), p = new Uint8Array(N), h = new Float32Array(N * 2), g = {}, M = [
					n,
					n,
					-Infinity,
					-Infinity
				], ie = [], A && (k = new Float32Array(e.length * 4)), ee && (O = new Uint8Array(N * 3));
				let i = 0, a = -1, o = -1, s, l;
				if (P.forEach((d, f) => {
					let { count: m, width: _ } = d;
					if (m > 0) {
						let f = 0;
						for (let e = m; e-- && d.glyphAt(e).glyphObj.isWhitespace;) f++;
						let v = 0, y = 0;
						if (x === "center") v = (ae - _) / 2;
						else if (x === "right") v = ae - _;
						else if (x === "justify" && d.isSoftWrapped) {
							let e = 0;
							for (let t = m - f; t--;) d.glyphAt(t).glyphObj.isWhitespace && e++;
							y = (ae - _) / e;
						}
						if (y || v) {
							let e = 0;
							for (let t = 0; t < m; t++) {
								let n = d.glyphAt(t), r = n.glyphObj;
								n.x += v + e, y !== 0 && r.isWhitespace && t < m - f && (e += y, n.width += y);
							}
						}
						let b = t.getReorderSegments(e, r, d.glyphAt(0).charIndex, d.glyphAt(d.count - 1).charIndex);
						for (let e = 0; e < b.length; e++) {
							let [t, n] = b[e], r = Infinity, i = -Infinity;
							for (let e = 0; e < m; e++) if (d.glyphAt(e).charIndex >= t) {
								let t = e, a = e;
								for (; a < m; a++) {
									let e = d.glyphAt(a);
									if (e.charIndex > n) break;
									a < m - f && (r = Math.min(r, e.x), i = Math.max(i, e.x + e.width));
								}
								for (let e = t; e < a; e++) {
									let t = d.glyphAt(e);
									t.x = i - (t.x + t.width - r);
								}
								break;
							}
						}
						let S, C = (e) => S = e;
						for (let f = 0; f < m; f++) {
							let m = d.glyphAt(f);
							S = m.glyphObj;
							let _ = S.index, v = r.levels[m.charIndex] & 1;
							if (v) {
								let n = t.getMirroredCharacter(e[m.charIndex]);
								n && m.fontData.fontObj.forEachGlyph(n, 0, 0, C);
							}
							if (A) {
								let { charIndex: e, fontData: t } = m, n = m.x + pe, r = m.x + m.width + pe;
								k[e * 4] = v ? r : n, k[e * 4 + 1] = v ? n : r, k[e * 4 + 2] = d.baseline + t.caretBottom + me, k[e * 4 + 3] = d.baseline + t.caretTop + me;
								let i = e - a;
								i > 1 && u(k, a, i), a = e;
							}
							if (ee) {
								let { charIndex: e } = m;
								for (; e > o;) o++, ee.hasOwnProperty(o) && (l = ee[o]);
							}
							if (!S.isWhitespace && !S.isEmpty) {
								let e = i++, { fontSizeMult: t, src: r, index: a } = m.fontData, o = g[r] || (g[r] = {});
								o[_] || (o[_] = {
									path: S.path,
									pathBounds: [
										S.xMin,
										S.yMin,
										S.xMax,
										S.yMax
									]
								});
								let u = m.x + pe, f = m.y + d.baseline + me;
								h[e * 2] = u, h[e * 2 + 1] = f;
								let v = u + S.xMin * t, y = f + S.yMin * t, b = u + S.xMax * t, x = f + S.yMax * t;
								v < M[0] && (M[0] = v), y < M[1] && (M[1] = y), b > M[2] && (M[2] = b), x > M[3] && (M[3] = x), e % j === 0 && (s = {
									start: e,
									end: e,
									rect: [
										n,
										n,
										-Infinity,
										-Infinity
									]
								}, ie.push(s)), s.end++;
								let C = s.rect;
								if (v < C[0] && (C[0] = v), y < C[1] && (C[1] = y), b > C[2] && (C[2] = b), x > C[3] && (C[3] = x), c[e] = _, p[e] = a, ee) {
									let t = e * 3;
									O[t] = l >> 16 & 255, O[t + 1] = l >> 8 & 255, O[t + 2] = l & 255;
								}
							}
						}
					}
				}), k) {
					let t = e.length - a;
					t > 1 && u(k, a, t);
				}
			}
			let he = [];
			se.forEach(({ index: e, src: t, unitsPerEm: n, ascender: r, descender: i, lineHeight: a, capHeight: o, xHeight: s }) => {
				he[e] = {
					src: t,
					unitsPerEm: n,
					ascender: r,
					descender: i,
					lineHeight: a,
					capHeight: o,
					xHeight: s
				};
			}), re.typesetting = d() - ce, te({
				glyphIds: c,
				glyphFontIndices: p,
				glyphPositions: h,
				glyphData: g,
				fontData: he,
				caretPositions: k,
				glyphColors: O,
				chunkedBounds: ie,
				fontSize: m,
				topBaseline: me + P[0].baseline,
				blockBounds: [
					pe,
					me - fe,
					pe + ae,
					me
				],
				visibleBounds: M,
				timings: re
			});
		});
	}
	function c(e, t) {
		s({
			...e,
			metricsOnly: !0
		}, (e) => {
			let [n, r, i, a] = e.blockBounds;
			t({
				width: i - n,
				height: a - r
			});
		});
	}
	function l(e) {
		let t = e.match(/^([\d.]+)%$/), n = t ? parseFloat(t[1]) : NaN;
		return isNaN(n) ? 0 : n / 100;
	}
	function u(e, t, n) {
		let r = e[t * 4], i = e[t * 4 + 1], a = e[t * 4 + 2], o = e[t * 4 + 3], s = (i - r) / n;
		for (let i = 0; i < n; i++) {
			let n = (t + i) * 4;
			e[n] = r + s * i, e[n + 1] = r + s * (i + 1), e[n + 2] = a, e[n + 3] = o;
		}
	}
	function d() {
		return (self.performance || Date).now();
	}
	function f() {
		this.data = [];
	}
	let p = [
		"glyphObj",
		"x",
		"y",
		"width",
		"charIndex",
		"fontData"
	];
	return f.prototype = {
		width: 0,
		lineHeight: 0,
		baseline: 0,
		cap: 0,
		ex: 0,
		isSoftWrapped: !1,
		get count() {
			return Math.ceil(this.data.length / p.length);
		},
		glyphAt(e) {
			let t = f.flyweight;
			return t.data = this.data, t.index = e, t;
		},
		splitAt(e) {
			let t = new f();
			return t.data = this.data.splice(e * p.length), t;
		}
	}, f.flyweight = p.reduce((e, t, n, r) => (Object.defineProperty(e, t, {
		get() {
			return this.data[this.index * p.length + n];
		},
		set(e) {
			this.data[this.index * p.length + n] = e;
		}
	}), e), {
		data: null,
		index: 0
	}), {
		typeset: s,
		measure: c
	};
}
var ek = () => (self.performance || Date).now(), tk = /*#__PURE__*/ OO(), nk;
function rk(e, t, n, r, i, a, o, s, c, l, u = !0) {
	return u ? ck(e, t, n, r, i, a, o, s, c, l).then(null, (u) => (nk || (console.warn("WebGL SDF generation failed, falling back to JS", u), nk = !0), pk(e, t, n, r, i, a, o, s, c, l))) : pk(e, t, n, r, i, a, o, s, c, l);
}
var ik = [], ak = 5, ok = 0;
function sk() {
	let e = ek();
	for (; ik.length && ek() - e < ak;) ik.shift()();
	ok = ik.length ? setTimeout(sk, 0) : 0;
}
var ck = (...e) => new Promise((t, n) => {
	ik.push(() => {
		let r = ek();
		try {
			tk.webgl.generateIntoCanvas(...e), t({ timing: ek() - r });
		} catch (e) {
			n(e);
		}
	}), ok || (ok = setTimeout(sk, 0));
}), lk = 4, uk = 2e3, dk = {}, fk = 0;
function pk(e, t, n, r, i, a, o, s, c, l) {
	let u = "TroikaTextSDFGenerator_JS_" + fk++ % lk, d = dk[u];
	return d || (d = dk[u] = {
		workerModule: CO({
			name: u,
			workerId: u,
			dependencies: [OO, ek],
			init(e, t) {
				let n = e().javascript.generate;
				return function(...e) {
					let r = t();
					return {
						textureData: n(...e),
						timing: t() - r
					};
				};
			},
			getTransferables(e) {
				return [e.textureData.buffer];
			}
		}),
		requests: 0,
		idleTimer: null
	}), d.requests++, clearTimeout(d.idleTimer), d.workerModule(e, t, n, r, i, a).then(({ textureData: n, timing: r }) => {
		let i = ek(), a = new Uint8Array(n.length * 4);
		for (let e = 0; e < n.length; e++) a[e * 4 + l] = n[e];
		return tk.webglUtils.renderImageData(o, a, s, c, e, t, 1 << 3 - l), r += ek() - i, --d.requests === 0 && (d.idleTimer = setTimeout(() => {
			wO(u);
		}, uk)), { timing: r };
	});
}
function mk(e) {
	e._warm || (tk.webgl.isSupported(e), e._warm = !0);
}
var hk = tk.webglUtils.resizeWebGLCanvasWithoutClearing, gk = {
	defaultFontURL: null,
	unicodeFontsURL: null,
	sdfGlyphSize: 64,
	sdfMargin: 1 / 16,
	sdfExponent: 9,
	textureWidth: 2048,
	useWorker: !0
}, _k = /*#__PURE__*/ new Xe();
function vk() {
	return (self.performance || Date).now();
}
var yk = Object.create(null);
function bk(e, t) {
	e = Ck({}, e);
	let n = vk(), { defaultFontURL: r } = gk, i = [];
	if (r && i.push({
		label: "default",
		src: Tk(r)
	}), e.font && i.push({
		label: "user",
		src: Tk(e.font)
	}), e.font = i, e.text = "" + e.text, e.sdfGlyphSize = e.sdfGlyphSize || gk.sdfGlyphSize, e.unicodeFontsURL = e.unicodeFontsURL || gk.unicodeFontsURL, e.colorRanges != null) {
		let t = {};
		for (let n in e.colorRanges) if (e.colorRanges.hasOwnProperty(n)) {
			let r = e.colorRanges[n];
			typeof r != "number" && (r = _k.set(r).getHex()), t[n] = r;
		}
		e.colorRanges = t;
	}
	Object.freeze(e);
	let { textureWidth: a, sdfExponent: o } = gk, { sdfGlyphSize: s } = e, c = a / s * 4, l = yk[s];
	if (!l) {
		let e = document.createElement("canvas");
		e.width = a, e.height = s * 256 / c, l = yk[s] = {
			glyphCount: 0,
			sdfGlyphSize: s,
			sdfCanvas: e,
			sdfTexture: new Dt(e, void 0, void 0, void 0, Ot, Ot),
			contextLost: !1,
			glyphsByFont: /* @__PURE__ */ new Map()
		}, l.sdfTexture.generateMipmaps = !1, Sk(l);
	}
	let { sdfTexture: u, sdfCanvas: d } = l;
	(gk.useWorker ? Dk : Ok)(e).then((r) => {
		let { glyphIds: i, glyphFontIndices: f, fontData: p, glyphPositions: m, fontSize: h, timings: g } = r, _ = [], v = new Float32Array(i.length * 4), y = 0, b = 0, x = vk(), S = p.map((e) => {
			let t = l.glyphsByFont.get(e.src);
			return t || l.glyphsByFont.set(e.src, t = /* @__PURE__ */ new Map()), t;
		});
		i.forEach((e, t) => {
			let n = f[t], { src: a, unitsPerEm: o } = p[n], c = S[n].get(e);
			if (!c) {
				let { path: t, pathBounds: i } = r.glyphData[a][e], o = Math.max(i[2] - i[0], i[3] - i[1]) / s * (gk.sdfMargin * s + .5), u = l.glyphCount++, d = [
					i[0] - o,
					i[1] - o,
					i[2] + o,
					i[3] + o
				];
				S[n].set(e, c = {
					path: t,
					atlasIndex: u,
					sdfViewBox: d
				}), _.push(c);
			}
			let { sdfViewBox: u } = c, d = m[b++], g = m[b++], x = h / o;
			v[y++] = d + u[0] * x, v[y++] = g + u[1] * x, v[y++] = d + u[2] * x, v[y++] = g + u[3] * x, i[t] = c.atlasIndex;
		}), g.quads = (g.quads || 0) + (vk() - x);
		let C = vk();
		g.sdf = {};
		let w = d.height, T = Math.ceil(l.glyphCount / c), E = 2 ** Math.ceil(Math.log2(T * s));
		E > w && (console.info(`Increasing SDF texture size ${w}->${E}`), hk(d, a, E), u.dispose()), Promise.all(_.map((t) => xk(t, l, e.gpuAccelerateSDF).then(({ timing: e }) => {
			g.sdf[t.atlasIndex] = e;
		}))).then(() => {
			_.length && !l.contextLost && (Ek(l), u.needsUpdate = !0), g.sdfTotal = vk() - C, g.total = vk() - n, t(Object.freeze({
				parameters: e,
				sdfTexture: u,
				sdfGlyphSize: s,
				sdfExponent: o,
				glyphBounds: v,
				glyphAtlasIndices: i,
				glyphColors: r.glyphColors,
				caretPositions: r.caretPositions,
				chunkedBounds: r.chunkedBounds,
				ascender: r.ascender,
				descender: r.descender,
				lineHeight: r.lineHeight,
				capHeight: r.capHeight,
				xHeight: r.xHeight,
				topBaseline: r.topBaseline,
				blockBounds: r.blockBounds,
				visibleBounds: r.visibleBounds,
				timings: r.timings
			}));
		});
	}), Promise.resolve().then(() => {
		l.contextLost || mk(d);
	});
}
function xk({ path: e, atlasIndex: t, sdfViewBox: n }, { sdfGlyphSize: r, sdfCanvas: i, contextLost: a }, o) {
	if (a) return Promise.resolve({ timing: -1 });
	let { textureWidth: s, sdfExponent: c } = gk, l = Math.max(n[2] - n[0], n[3] - n[1]), u = Math.floor(t / 4);
	return rk(r, r, e, n, l, c, i, u % (s / r) * r, Math.floor(u / (s / r)) * r, t % 4, o);
}
function Sk(e) {
	let t = e.sdfCanvas;
	t.addEventListener("webglcontextlost", (t) => {
		console.log("Context Lost", t), t.preventDefault(), e.contextLost = !0;
	}), t.addEventListener("webglcontextrestored", (t) => {
		console.log("Context Restored", t), e.contextLost = !1;
		let n = [];
		e.glyphsByFont.forEach((t) => {
			t.forEach((t) => {
				n.push(xk(t, e, !0));
			});
		}), Promise.all(n).then(() => {
			Ek(e), e.sdfTexture.needsUpdate = !0;
		});
	});
}
function Ck(e, t) {
	for (let n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
	return e;
}
var wk;
function Tk(e) {
	return wk || (wk = typeof document > "u" ? {} : document.createElement("a")), wk.href = e, wk.href;
}
function Ek(e) {
	if (typeof createImageBitmap != "function") {
		console.info("Safari<15: applying SDF canvas workaround");
		let { sdfCanvas: t, sdfTexture: n } = e, { width: r, height: i } = t, a = e.sdfCanvas.getContext("webgl"), o = n.image.data;
		(!o || o.length !== r * i * 4) && (o = new Uint8Array(r * i * 4), n.image = {
			width: r,
			height: i,
			data: o
		}, n.flipY = !1, n.isDataTexture = !0), a.readPixels(0, 0, r, i, a.RGBA, a.UNSIGNED_BYTE, o);
	}
}
var Dk = /*#__PURE__*/ CO({
	name: "Typesetter",
	dependencies: [/* @__PURE__ */ CO({
		name: "Typesetter",
		dependencies: [
			$O,
			QO,
			kO
		],
		init(e, t, n) {
			return e(t, n());
		}
	})],
	init(e) {
		return function(t) {
			return new Promise((n) => {
				e.typeset(t, n);
			});
		};
	},
	getTransferables(e) {
		let t = [];
		for (let n in e) e[n] && e[n].buffer && t.push(e[n].buffer);
		return t;
	}
}), Ok = Dk.onMainThread, kk = {};
function Ak(e) {
	let t = kk[e];
	return t || (t = kk[e] = new Pe(1, 1, e, e).translate(.5, .5, 0)), t;
}
var jk = "aTroikaGlyphBounds", Mk = "aTroikaGlyphIndex", Nk = "aTroikaGlyphColor", Pk = class extends pt {
	constructor() {
		super(), this.detail = 1, this.curveRadius = 0, this.groups = [{
			start: 0,
			count: Infinity,
			materialIndex: 0
		}, {
			start: 0,
			count: Infinity,
			materialIndex: 1
		}], this.boundingSphere = new nn(), this.boundingBox = new Ve();
	}
	computeBoundingSphere() {}
	computeBoundingBox() {}
	set detail(e) {
		if (e !== this._detail) {
			this._detail = e, (typeof e != "number" || e < 1) && (e = 1);
			let t = Ak(e);
			[
				"position",
				"normal",
				"uv"
			].forEach((e) => {
				this.attributes[e] = t.attributes[e].clone();
			}), this.setIndex(t.getIndex().clone());
		}
	}
	get detail() {
		return this._detail;
	}
	set curveRadius(e) {
		e !== this._curveRadius && (this._curveRadius = e, this._updateBounds());
	}
	get curveRadius() {
		return this._curveRadius;
	}
	updateGlyphs(e, t, n, r, i) {
		this.updateAttributeData(jk, e, 4), this.updateAttributeData(Mk, t, 1), this.updateAttributeData(Nk, i, 3), this._blockBounds = n, this._chunkedBounds = r, this.instanceCount = t.length, this._updateBounds();
	}
	_updateBounds() {
		let e = this._blockBounds;
		if (e) {
			let { curveRadius: t, boundingBox: n } = this;
			if (t) {
				let { PI: r, floor: i, min: a, max: o, sin: s, cos: c } = Math, l = r / 2, u = r * 2, d = Math.abs(t), f = e[0] / d, p = e[2] / d, m = i((f + l) / u) === i((p + l) / u) ? a(s(f) * d, s(p) * d) : -d, h = i((f - l) / u) === i((p - l) / u) ? o(s(f) * d, s(p) * d) : d, g = i((f + r) / u) === i((p + r) / u) ? o(d - c(f) * d, d - c(p) * d) : d * 2;
				n.min.set(m, e[1], t < 0 ? -g : 0), n.max.set(h, e[3], t < 0 ? 0 : g);
			} else n.min.set(e[0], e[1], 0), n.max.set(e[2], e[3], 0);
			n.getBoundingSphere(this.boundingSphere);
		}
	}
	applyClipRect(e) {
		let t = this.getAttribute(Mk).count, n = this._chunkedBounds;
		if (n) for (let r = n.length; r--;) {
			t = n[r].end;
			let i = n[r].rect;
			if (i[1] < e.w && i[3] > e.y && i[0] < e.z && i[2] > e.x) break;
		}
		this.instanceCount = t;
	}
	updateAttributeData(e, t, n) {
		let r = this.getAttribute(e);
		t ? r && r.array.length === t.length ? (r.array.set(t), r.needsUpdate = !0) : (this.setAttribute(e, new lt(t, n)), delete this._maxInstanceCount, this.dispose()) : r && this.deleteAttribute(e);
	}
}, Fk = "\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform vec4 uTroikaTotalBounds;\nuniform vec4 uTroikaClipRect;\nuniform mat3 uTroikaOrient;\nuniform bool uTroikaUseGlyphColors;\nuniform float uTroikaEdgeOffset;\nuniform float uTroikaBlurRadius;\nuniform vec2 uTroikaPositionOffset;\nuniform float uTroikaCurveRadius;\nattribute vec4 aTroikaGlyphBounds;\nattribute float aTroikaGlyphIndex;\nattribute vec3 aTroikaGlyphColor;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec3 vTroikaGlyphColor;\nvarying vec2 vTroikaGlyphDimensions;\n", Ik = "\nvec4 bounds = aTroikaGlyphBounds;\nbounds.xz += uTroikaPositionOffset.x;\nbounds.yw -= uTroikaPositionOffset.y;\n\nvec4 outlineBounds = vec4(\n  bounds.xy - uTroikaEdgeOffset - uTroikaBlurRadius,\n  bounds.zw + uTroikaEdgeOffset + uTroikaBlurRadius\n);\nvec4 clippedBounds = vec4(\n  clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw),\n  clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw)\n);\n\nvec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy);\n\nposition.xy = mix(bounds.xy, bounds.zw, clippedXY);\n\nuv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy);\n\nfloat rad = uTroikaCurveRadius;\nif (rad != 0.0) {\n  float angle = position.x / rad;\n  position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad);\n  normal.xz = vec2(sin(angle), cos(angle));\n}\n  \nposition = uTroikaOrient * position;\nnormal = uTroikaOrient * normal;\n\nvTroikaGlyphUV = clippedXY.xy;\nvTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]);\n\n\nfloat txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize;\nvec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize;\nvec2 txStartUV = txUvPerSquare * vec2(\n  mod(floor(aTroikaGlyphIndex / 4.0), txCols),\n  floor(floor(aTroikaGlyphIndex / 4.0) / txCols)\n);\nvTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare);\nvTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0);\n", Lk = "\nuniform sampler2D uTroikaSDFTexture;\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform float uTroikaSDFExponent;\nuniform float uTroikaEdgeOffset;\nuniform float uTroikaFillOpacity;\nuniform float uTroikaBlurRadius;\nuniform vec3 uTroikaStrokeColor;\nuniform float uTroikaStrokeWidth;\nuniform float uTroikaStrokeOpacity;\nuniform bool uTroikaSDFDebug;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec2 vTroikaGlyphDimensions;\n\nfloat troikaSdfValueToSignedDistance(float alpha) {\n  // Inverse of exponential encoding in webgl-sdf-generator\n  \n  float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y);\n  float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension;\n  float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0);\n  return signedDist;\n}\n\nfloat troikaGlyphUvToSdfValue(vec2 glyphUV) {\n  vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV);\n  vec4 rgba = texture2D(uTroikaSDFTexture, textureUV);\n  float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1\n  return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a;\n}\n\nfloat troikaGlyphUvToDistance(vec2 uv) {\n  return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv));\n}\n\nfloat troikaGetAADist() {\n  \n  #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300\n  return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5;\n  #else\n  return vTroikaGlyphDimensions.x / 64.0;\n  #endif\n}\n\nfloat troikaGetFragDistValue() {\n  vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize);\n  float distance = troikaGlyphUvToDistance(clampedGlyphUV);\n \n  // Extrapolate distance when outside bounds:\n  distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : \n    length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions);\n\n  \n\n  return distance;\n}\n\nfloat troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {\n  #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL)\n  float alpha = step(-distanceOffset, -distance);\n  #else\n\n  float alpha = smoothstep(\n    distanceOffset + aaDist,\n    distanceOffset - aaDist,\n    distance\n  );\n  #endif\n\n  return alpha;\n}\n", Rk = "\nfloat aaDist = troikaGetAADist();\nfloat fragDistance = troikaGetFragDistValue();\nfloat edgeAlpha = uTroikaSDFDebug ?\n  troikaGlyphUvToSdfValue(vTroikaGlyphUV) :\n  troikaGetEdgeAlpha(fragDistance, uTroikaEdgeOffset, max(aaDist, uTroikaBlurRadius));\n\n#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL)\nvec4 fillRGBA = gl_FragColor;\nfillRGBA.a *= uTroikaFillOpacity;\nvec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity);\nif (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb;\ngl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep(\n  -uTroikaStrokeWidth - aaDist,\n  -uTroikaStrokeWidth + aaDist,\n  fragDistance\n));\ngl_FragColor.a *= edgeAlpha;\n#endif\n\nif (edgeAlpha == 0.0) {\n  discard;\n}\n";
function zk(e) {
	let t = zO(e, {
		chained: !0,
		extensions: { derivatives: !0 },
		uniforms: {
			uTroikaSDFTexture: { value: null },
			uTroikaSDFTextureSize: { value: new gt() },
			uTroikaSDFGlyphSize: { value: 0 },
			uTroikaSDFExponent: { value: 0 },
			uTroikaTotalBounds: { value: new kn(0, 0, 0, 0) },
			uTroikaClipRect: { value: new kn(0, 0, 0, 0) },
			uTroikaEdgeOffset: { value: 0 },
			uTroikaFillOpacity: { value: 1 },
			uTroikaPositionOffset: { value: new gt() },
			uTroikaCurveRadius: { value: 0 },
			uTroikaBlurRadius: { value: 0 },
			uTroikaStrokeWidth: { value: 0 },
			uTroikaStrokeColor: { value: new Xe() },
			uTroikaStrokeOpacity: { value: 1 },
			uTroikaOrient: { value: new An() },
			uTroikaUseGlyphColors: { value: !0 },
			uTroikaSDFDebug: { value: !1 }
		},
		vertexDefs: Fk,
		vertexTransform: Ik,
		fragmentDefs: Lk,
		fragmentColorTransform: Rk,
		customRewriter({ vertexShader: e, fragmentShader: t }) {
			let n = /\buniform\s+vec3\s+diffuse\b/;
			return n.test(t) && (t = t.replace(n, "varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g, "vTroikaGlyphColor"), n.test(e) || (e = e.replace(AO, "uniform vec3 diffuse;\n$&\nvTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;\n"))), {
				vertexShader: e,
				fragmentShader: t
			};
		}
	});
	return t.transparent = !0, t.forceSinglePass = !0, Object.defineProperties(t, {
		isTroikaTextMaterial: { value: !0 },
		shadowSide: {
			get() {
				return this.side;
			},
			set() {}
		}
	}), t;
}
var Bk = /*#__PURE__*/ new et({
	color: 16777215,
	side: 2,
	transparent: !0
}), Vk = 8421504, Hk = /*#__PURE__*/ new Ct(), Uk = /*#__PURE__*/ new I(), Wk = /*#__PURE__*/ new I(), Gk = [], Kk = /*#__PURE__*/ new I(), qk = "+x+y";
function Jk(e) {
	return Array.isArray(e) ? e[0] : e;
}
var Yk = () => {
	let e = new Dn(new Pe(1, 1), Bk);
	return Yk = () => e, e;
}, Xk = () => {
	let e = new Dn(new Pe(1, 1, 32, 1), Bk);
	return Xk = () => e, e;
}, Zk = { type: "syncstart" }, Qk = { type: "synccomplete" }, $k = [
	"font",
	"fontSize",
	"fontStyle",
	"fontWeight",
	"lang",
	"letterSpacing",
	"lineHeight",
	"maxWidth",
	"overflowWrap",
	"text",
	"direction",
	"textAlign",
	"textIndent",
	"whiteSpace",
	"anchorX",
	"anchorY",
	"colorRanges",
	"sdfGlyphSize"
], eA = $k.concat("material", "color", "depthOffset", "clipRect", "curveRadius", "orientation", "glyphGeometryDetail"), tA = class extends Dn {
	constructor() {
		let e = new Pk();
		super(e, null), this.text = "", this.anchorX = 0, this.anchorY = 0, this.curveRadius = 0, this.direction = "auto", this.font = null, this.unicodeFontsURL = null, this.fontSize = .1, this.fontWeight = "normal", this.fontStyle = "normal", this.lang = null, this.letterSpacing = 0, this.lineHeight = "normal", this.maxWidth = Infinity, this.overflowWrap = "normal", this.textAlign = "left", this.textIndent = 0, this.whiteSpace = "normal", this.material = null, this.color = null, this.colorRanges = null, this.outlineWidth = 0, this.outlineColor = 0, this.outlineOpacity = 1, this.outlineBlur = 0, this.outlineOffsetX = 0, this.outlineOffsetY = 0, this.strokeWidth = 0, this.strokeColor = Vk, this.strokeOpacity = 1, this.fillOpacity = 1, this.depthOffset = 0, this.clipRect = null, this.orientation = qk, this.glyphGeometryDetail = 1, this.sdfGlyphSize = null, this.gpuAccelerateSDF = !0, this.debugSDF = !1;
	}
	sync(e) {
		this._needsSync && (this._needsSync = !1, this._isSyncing ? (this._queuedSyncs || (this._queuedSyncs = [])).push(e) : (this._isSyncing = !0, this.dispatchEvent(Zk), bk({
			text: this.text,
			font: this.font,
			lang: this.lang,
			fontSize: this.fontSize || .1,
			fontWeight: this.fontWeight || "normal",
			fontStyle: this.fontStyle || "normal",
			letterSpacing: this.letterSpacing || 0,
			lineHeight: this.lineHeight || "normal",
			maxWidth: this.maxWidth,
			direction: this.direction || "auto",
			textAlign: this.textAlign,
			textIndent: this.textIndent,
			whiteSpace: this.whiteSpace,
			overflowWrap: this.overflowWrap,
			anchorX: this.anchorX,
			anchorY: this.anchorY,
			colorRanges: this.colorRanges,
			includeCaretPositions: !0,
			sdfGlyphSize: this.sdfGlyphSize,
			gpuAccelerateSDF: this.gpuAccelerateSDF,
			unicodeFontsURL: this.unicodeFontsURL
		}, (t) => {
			this._isSyncing = !1, this._textRenderInfo = t, this.geometry.updateGlyphs(t.glyphBounds, t.glyphAtlasIndices, t.blockBounds, t.chunkedBounds, t.glyphColors);
			let n = this._queuedSyncs;
			n && (this._queuedSyncs = null, this._needsSync = !0, this.sync(() => {
				n.forEach((e) => e && e());
			})), this.dispatchEvent(Qk), e && e();
		})));
	}
	onBeforeRender(e, t, n, r, i, a) {
		this.sync(), i.isTroikaTextMaterial && this._prepareForRender(i);
	}
	dispose() {
		this.geometry.dispose();
	}
	get textRenderInfo() {
		return this._textRenderInfo || null;
	}
	createDerivedMaterial(e) {
		return zk(e);
	}
	get material() {
		let e = this._derivedMaterial, t = this._baseMaterial || this._defaultMaterial || (this._defaultMaterial = Bk.clone());
		if ((!e || !e.isDerivedFrom(t)) && (e = this._derivedMaterial = this.createDerivedMaterial(t), t.addEventListener("dispose", function n() {
			t.removeEventListener("dispose", n), e.dispose();
		})), this.hasOutline()) {
			let t = e._outlineMtl;
			return t || (t = e._outlineMtl = Object.create(e, { id: { value: e.id + .1 } }), t.isTextOutlineMaterial = !0, t.depthWrite = !1, t.map = null, e.addEventListener("dispose", function n() {
				e.removeEventListener("dispose", n), t.dispose();
			})), [t, e];
		} else return e;
	}
	set material(e) {
		e && e.isTroikaTextMaterial ? (this._derivedMaterial = e, this._baseMaterial = e.baseMaterial) : this._baseMaterial = e;
	}
	hasOutline() {
		return !!(this.outlineWidth || this.outlineBlur || this.outlineOffsetX || this.outlineOffsetY);
	}
	get glyphGeometryDetail() {
		return this.geometry.detail;
	}
	set glyphGeometryDetail(e) {
		this.geometry.detail = e;
	}
	get curveRadius() {
		return this.geometry.curveRadius;
	}
	set curveRadius(e) {
		this.geometry.curveRadius = e;
	}
	get customDepthMaterial() {
		return Jk(this.material).getDepthMaterial();
	}
	set customDepthMaterial(e) {}
	get customDistanceMaterial() {
		return Jk(this.material).getDistanceMaterial();
	}
	set customDistanceMaterial(e) {}
	_prepareForRender(e) {
		let t = e.isTextOutlineMaterial, n = e.uniforms, r = this.textRenderInfo;
		if (r) {
			let { sdfTexture: e, blockBounds: i } = r;
			n.uTroikaSDFTexture.value = e, n.uTroikaSDFTextureSize.value.set(e.image.width, e.image.height), n.uTroikaSDFGlyphSize.value = r.sdfGlyphSize, n.uTroikaSDFExponent.value = r.sdfExponent, n.uTroikaTotalBounds.value.fromArray(i), n.uTroikaUseGlyphColors.value = !t && !!r.glyphColors;
			let a = 0, o = 0, s = 0, c, l, u, d = 0, f = 0;
			if (t) {
				let { outlineWidth: e, outlineOffsetX: t, outlineOffsetY: n, outlineBlur: r, outlineOpacity: i } = this;
				a = this._parsePercent(e) || 0, o = Math.max(0, this._parsePercent(r) || 0), c = i, d = this._parsePercent(t) || 0, f = this._parsePercent(n) || 0;
			} else s = Math.max(0, this._parsePercent(this.strokeWidth) || 0), s && (u = this.strokeColor, n.uTroikaStrokeColor.value.set(u == null ? Vk : u), l = this.strokeOpacity, l == null && (l = 1)), c = this.fillOpacity;
			n.uTroikaEdgeOffset.value = a, n.uTroikaPositionOffset.value.set(d, f), n.uTroikaBlurRadius.value = o, n.uTroikaStrokeWidth.value = s, n.uTroikaStrokeOpacity.value = l, n.uTroikaFillOpacity.value = c == null ? 1 : c, n.uTroikaCurveRadius.value = this.curveRadius || 0;
			let p = this.clipRect;
			if (p && Array.isArray(p) && p.length === 4) n.uTroikaClipRect.value.fromArray(p);
			else {
				let e = (this.fontSize || .1) * 100;
				n.uTroikaClipRect.value.set(i[0] - e, i[1] - e, i[2] + e, i[3] + e);
			}
			this.geometry.applyClipRect(n.uTroikaClipRect.value);
		}
		n.uTroikaSDFDebug.value = !!this.debugSDF, e.polygonOffset = !!this.depthOffset, e.polygonOffsetFactor = e.polygonOffsetUnits = this.depthOffset || 0;
		let i = t ? this.outlineColor || 0 : this.color;
		if (i == null) delete e.color;
		else {
			let t = e.hasOwnProperty("color") ? e.color : e.color = new Xe();
			(i !== t._input || typeof i == "object") && t.set(t._input = i);
		}
		let a = this.orientation || qk;
		if (a !== e._orientation) {
			let t = n.uTroikaOrient.value;
			a = a.replace(/[^-+xyz]/g, "");
			let r = a !== qk && a.match(/^([-+])([xyz])([-+])([xyz])$/);
			if (r) {
				let [, e, n, i, a] = r;
				Uk.set(0, 0, 0)[n] = e === "-" ? 1 : -1, Wk.set(0, 0, 0)[a] = i === "-" ? -1 : 1, Hk.lookAt(Kk, Uk.cross(Wk), Wk), t.setFromMatrix4(Hk);
			} else t.identity();
			e._orientation = a;
		}
	}
	_parsePercent(e) {
		if (typeof e == "string") {
			let t = e.match(/^(-?[\d.]+)%$/), n = t ? parseFloat(t[1]) : NaN;
			e = (isNaN(n) ? 0 : n / 100) * this.fontSize;
		}
		return e;
	}
	localPositionToTextCoords(e, t = new gt()) {
		t.copy(e);
		let n = this.curveRadius;
		return n && (t.x = Math.atan2(e.x, Math.abs(n) - Math.abs(e.z)) * Math.abs(n)), t;
	}
	worldPositionToTextCoords(e, t = new gt()) {
		return Uk.copy(e), this.localPositionToTextCoords(this.worldToLocal(Uk), t);
	}
	raycast(e, t) {
		let { textRenderInfo: n, curveRadius: r } = this;
		if (n) {
			let i = n.blockBounds, a = r ? Xk() : Yk(), o = a.geometry, { position: s, uv: c } = o.attributes;
			for (let e = 0; e < c.count; e++) {
				let t = i[0] + c.getX(e) * (i[2] - i[0]), n = i[1] + c.getY(e) * (i[3] - i[1]), a = 0;
				r && (a = r - Math.cos(t / r) * r, t = Math.sin(t / r) * r), s.setXYZ(e, t, n, a);
			}
			o.boundingSphere = this.geometry.boundingSphere, o.boundingBox = this.geometry.boundingBox, a.matrixWorld = this.matrixWorld, a.material.side = this.material.side, Gk.length = 0, a.raycast(e, Gk);
			for (let e = 0; e < Gk.length; e++) Gk[e].object = this, t.push(Gk[e]);
		}
	}
	copy(e) {
		let t = this.geometry;
		return super.copy(e), this.geometry = t, eA.forEach((t) => {
			this[t] = e[t];
		}), this;
	}
	clone() {
		return new this.constructor().copy(this);
	}
};
$k.forEach((e) => {
	let t = "_private_" + e;
	Object.defineProperty(tA.prototype, e, {
		get() {
			return this[t];
		},
		set(e) {
			e !== this[t] && (this[t] = e, this._needsSync = !0);
		}
	});
});
var nA = { type: "syncstart" }, rA = { type: "synccomplete" }, iA = "aTroikaTextBatchMemberIndex", aA = 32, oA = new Ve(), sA = new Xe(), cA = class e extends tA {
	constructor() {
		super(), this._members = /* @__PURE__ */ new Map(), this._dataTextures = {}, this._onMemberSynced = (e) => {
			this._members.get(e.target).dirty = !0;
		};
	}
	add(...e) {
		for (let t = 0; t < e.length; t++) e[t] instanceof tA ? this.addText(e[t]) : super.add(e[t]);
		return this;
	}
	remove(...e) {
		for (let t = 0; t < e.length; t++) e[t] instanceof tA ? this.removeText(e[t]) : super.remove(e[t]);
		return this;
	}
	addText(e) {
		this._members.has(e) || (this._members.set(e, {
			index: -1,
			glyphCount: -1,
			dirty: !0
		}), e.addEventListener("synccomplete", this._onMemberSynced));
	}
	removeText(e) {
		this._needsRepack = !0, e.removeEventListener("synccomplete", this._onMemberSynced), this._members.delete(e);
	}
	createDerivedMaterial(e) {
		return uA(e);
	}
	updateMatrixWorld(e) {
		super.updateMatrixWorld(e), this.updateBounds();
	}
	updateBounds() {
		let e = this.geometry.boundingBox.makeEmpty();
		this._members.forEach((t, n) => {
			n.matrixAutoUpdate && n.updateMatrix(), oA.copy(n.geometry.boundingBox).applyMatrix4(n.matrix), e.union(oA);
		}), e.getBoundingSphere(this.geometry.boundingSphere);
	}
	hasOutline() {
		for (let e of this._members.keys()) if (e.hasOutline()) return !0;
		return !1;
	}
	_prepareForRender(e) {
		let t = e.isTextOutlineMaterial;
		e.uniforms.uTroikaIsOutline.value = t;
		let n = this._dataTextures[t ? "outline" : "main"], r = 2 ** Math.ceil(Math.log2(this._members.size * aA));
		if (!n || r !== n.image.data.length) {
			n && n.dispose();
			let e = Math.min(r / 4, 1024);
			n = this._dataTextures[t ? "outline" : "main"] = new ye(new Float32Array(r), e, r / 4 / e, ct, Le);
		}
		let i = n.image.data, a = (e, t) => {
			t !== i[e] && (i[e] = t, n.needsUpdate = !0);
		};
		this._members.forEach(({ index: n, dirty: r }, i) => {
			if (n > -1) {
				let r = n * aA, o = i.matrix.elements;
				for (let e = 0; e < 16; e++) a(r + e, o[e]);
				i._prepareForRender(e);
				let { uTroikaTotalBounds: s, uTroikaClipRect: c, uTroikaPositionOffset: l, uTroikaEdgeOffset: u, uTroikaBlurRadius: d, uTroikaStrokeWidth: f, uTroikaStrokeColor: p, uTroikaStrokeOpacity: m, uTroikaFillOpacity: h, uTroikaCurveRadius: g } = e.uniforms;
				for (let e = 0; e < 4; e++) a(r + 16 + e, s.value.getComponent(e));
				for (let e = 0; e < 4; e++) a(r + 20 + e, c.value.getComponent(e));
				let _ = t ? i.outlineColor || 0 : i.color;
				_ == null && (_ = this.color), _ == null && (_ = this.material.color), _ == null && (_ = 16777215), a(r + 24, sA.set(_).getHex()), a(r + 25, h.value), a(r + 26, g.value), t ? (a(r + 28, l.value.x), a(r + 29, l.value.y), a(r + 30, u.value), a(r + 31, d.value)) : (a(r + 28, f.value), a(r + 29, sA.set(p.value).getHex()), a(r + 30, m.value));
			}
		}), e.setMatrixTexture(n), super._prepareForRender(e);
	}
	sync(e) {
		let t = this._needsRepack ? [] : null;
		this._needsRepack = !1, this._members.forEach((e, n) => {
			(e.dirty || n._needsSync) && (e.dirty = !1, (t || (t = [])).push(new Promise((e) => {
				n._needsSync ? n.sync(e) : e();
			})));
		}), t && (this.dispatchEvent(nA), Promise.all(t).then(() => {
			let { geometry: t } = this, n = t.attributes, r = n[iA] && n[iA].array || /* @__PURE__ */ new Uint16Array(), i = n[Mk] && n[Mk].array || /* @__PURE__ */ new Float32Array(), a = n[jk] && n[jk].array || /* @__PURE__ */ new Float32Array(), o = 0;
			this._members.forEach((e, { textRenderInfo: t }) => {
				t && (o += t.glyphAtlasIndices.length, this._textRenderInfo = t);
			}), o !== r.length && (r = lA(r, o), i = lA(i, o), a = lA(a, o * 4));
			let s = 0, c = 0;
			this._members.forEach((e, { textRenderInfo: t }) => {
				if (t) {
					let n = t.glyphAtlasIndices.length;
					r.fill(s, c, c + n), i.set(t.glyphAtlasIndices, c, c + n), a.set(t.glyphBounds, c * 4, (c + n) * 4), c += n, e.index = s++;
				}
			}), t.updateAttributeData(iA, r, 1), t.getAttribute(iA).setUsage(rt), t.updateAttributeData(Mk, i, 1), t.updateAttributeData(jk, a, 4), this.updateBounds(), this.dispatchEvent(rA), e && e();
		}));
	}
	copy(t) {
		return t instanceof e && (super.copy(t), this._members.forEach((e, t) => this.removeText(t)), t._members.forEach((e, t) => this.addText(t))), this;
	}
	dispose() {
		super.dispose(), Object.values(this._dataTextures).forEach((e) => e.dispose());
	}
};
function lA(e, t) {
	let n = new e.constructor(t);
	return n.set(e.subarray(0, t)), n;
}
function uA(e) {
	let t = "uTroikaMatricesTexture", n = "uTroikaMatricesTextureSize", r = zO(e, {
		chained: !0,
		uniforms: {
			[n]: { value: new gt() },
			[t]: { value: null }
		},
		vertexDefs: `
      uniform highp sampler2D ${t};
      uniform vec2 ${n};
      attribute float ${iA};

      vec4 troikaBatchTexel(float offset) {
        offset += ${iA} * ${aA.toFixed(1)} / 4.0;
        float w = ${n}.x;
        vec2 uv = (vec2(mod(offset, w), floor(offset / w)) + 0.5) / ${n};
        return texture2D(${t}, uv);
      }
    `,
		vertexTransform: "\n      mat4 matrix = mat4(\n        troikaBatchTexel(0.0),\n        troikaBatchTexel(1.0),\n        troikaBatchTexel(2.0),\n        troikaBatchTexel(3.0)\n      );\n      position.xyz = (matrix * vec4(position, 1.0)).xyz;\n    "
	});
	return r = zk(r), r = zO(r, {
		chained: !0,
		uniforms: { uTroikaIsOutline: { value: !1 } },
		customRewriter(e) {
			return [
				"uTroikaTotalBounds",
				"uTroikaClipRect",
				"uTroikaPositionOffset",
				"uTroikaEdgeOffset",
				"uTroikaBlurRadius",
				"uTroikaStrokeWidth",
				"uTroikaStrokeColor",
				"uTroikaStrokeOpacity",
				"uTroikaFillOpacity",
				"uTroikaCurveRadius",
				"diffuse"
			].forEach((t) => {
				e = dA(e, t);
			}), e;
		},
		vertexDefs: "\n      uniform bool uTroikaIsOutline;\n      vec3 troikaFloatToColor(float v) {\n        return mod(floor(vec3(v / 65536.0, v / 256.0, v)), 256.0) / 256.0;\n      }\n    ",
		vertexTransform: "\n      uTroikaTotalBounds = troikaBatchTexel(4.0);\n      uTroikaClipRect = troikaBatchTexel(5.0);\n      \n      vec4 data = troikaBatchTexel(6.0);\n      diffuse = troikaFloatToColor(data.x);\n      uTroikaFillOpacity = data.y;\n      uTroikaCurveRadius = data.z;\n      \n      data = troikaBatchTexel(7.0);\n      if (uTroikaIsOutline) {\n        if (data == vec4(0.0)) { // degenerate if zero outline\n          position = vec3(0.0);\n        } else {\n          uTroikaPositionOffset = data.xy;\n          uTroikaEdgeOffset = data.z;\n          uTroikaBlurRadius = data.w;\n        }\n      } else {\n        uTroikaStrokeWidth = data.x;\n        uTroikaStrokeColor = troikaFloatToColor(data.y);\n        uTroikaStrokeOpacity = data.z;\n      }\n    "
	}), r.setMatrixTexture = (e) => {
		r.uniforms[t].value = e, r.uniforms[n].value.set(e.image.width, e.image.height);
	}, r;
}
function dA({ vertexShader: e, fragmentShader: t }, n, r = n) {
	let i = RegExp(`uniform\\s+(bool|float|vec[234]|mat[34])\\s+${n}\\b`), a, o = !1;
	t = t.replace(i, (e, t) => (o = !0, `varying ${a = t} ${r}`));
	let s = !1;
	return e = e.replace(i, (e, t) => (s = !0, `${o ? "varying" : ""} ${a = t} ${r}`)), s || (e = `${o ? "varying" : ""} ${a} ${r};\n${e}`), {
		vertexShader: e,
		fragmentShader: t
	};
}
//#endregion
//#region ../renderer/src/core/text/batched-text-material.ts
var fA = "aTroikaTextBatchMemberIndex";
function pA(e, t) {
	let n = e.onBeforeCompile.bind(e);
	e.onBeforeCompile = (e, r) => {
		t.patchShader(e, fA), n(e, r);
	};
}
function mA(e, t, n) {
	e.transparent = t.transparent, e._outlineMtl = gA(e);
	let r = e.customProgramCacheKey.bind(e);
	return e.customProgramCacheKey = () => `efpText_${n.shaderKey}|${r()}`, e.onBeforeCompile = (e) => {
		e.vertexShader = Sy(e.vertexShader, _A);
	}, e;
}
function hA(e) {
	var t;
	return !!((t = e.uniforms) != null && t.uTroikaMatricesTexture);
}
function gA(e) {
	let t = Object.create(e, { id: { value: e.id - .5 } });
	return t.isTextOutlineMaterial = !0, t.depthWrite = !1, t.map = null, e.addEventListener("dispose", function n() {
		e.removeEventListener("dispose", n), t.dispose();
	}), t;
}
var _A = "uTroikaPositionOffset = vec2(0.0);";
//#endregion
//#region ../renderer/src/core/text/glyph-packing.ts
function vA(e, t, n) {
	var r, i, a, o, s, c;
	let l = e.attributes, u = (r = (i = l.aTroikaTextBatchMemberIndex) == null ? void 0 : i.array) == null ? /* @__PURE__ */ new Uint16Array() : r, d = (a = (o = l[yA]) == null ? void 0 : o.array) == null ? /* @__PURE__ */ new Float32Array() : a, f = (s = (c = l[bA]) == null ? void 0 : c.array) == null ? /* @__PURE__ */ new Float32Array() : s, p = 0, m;
	for (let e of t) {
		var h;
		let t = (h = n(e)) == null ? void 0 : h.textRenderInfo;
		t && (p += t.glyphAtlasIndices.length, m = t);
	}
	p !== u.length && (u = ex(u, p), d = ex(d, p), f = ex(f, p * 4));
	let g = 0;
	for (let e of t) {
		var _;
		let t = (_ = n(e)) == null ? void 0 : _.textRenderInfo;
		if (!t) continue;
		let r = t.glyphAtlasIndices.length;
		u.fill(e, g, g + r), d.set(t.glyphAtlasIndices, g), f.set(t.glyphBounds, g * 4), g += r;
	}
	return e.updateAttributeData(fA, u, 1), e.getAttribute(fA).setUsage(rt), e.updateAttributeData(yA, d, 1), e.updateAttributeData(bA, f, 4), m;
}
var yA = "aTroikaGlyphIndex", bA = "aTroikaGlyphBounds", xA = class {
	constructor() {
		this.textures = {}, this.needsUpdate = !1;
	}
	prepareForRender(e, t, n) {
		var r, i;
		let a = t.isTextOutlineMaterial;
		t.uniforms.uTroikaIsOutline.value = a;
		let o = e.addedMembersCount, s = this.textureFor(a ? "outline" : "main", Math.max(1, o)), c = s.image.data;
		this.needsUpdate = !1, DA.multiplyMatrices(n.projectionMatrix, n.matrixWorldInverse).multiply(e.matrixWorld), OA.setFromProjectionMatrix(DA, n.coordinateSystem), AA.extractRotation(e.matrixWorld).transpose().multiply(jA.extractRotation(n.matrixWorld)).multiply(Oh);
		let l = (r = (i = e.color) == null ? t.color : i) == null ? 16777215 : r;
		for (let n = 0; n < o; n++) {
			let r = e.getText(n);
			if (!(r != null && r.textRenderInfo)) continue;
			SA(r, AA);
			let i = n * TA;
			CA(r) ? this.writeMember(c, i, r, t, l) : this.collapse(c, i);
		}
		s.needsUpdate = this.needsUpdate, wA(t, s);
	}
	dispose() {
		for (let t of Object.keys(this.textures)) {
			var e;
			(e = this.textures[t]) == null || e.dispose(), delete this.textures[t];
		}
	}
	textureFor(e, t) {
		let n = this.textures[e], r = 2 ** Math.ceil(Math.log2(t * TA));
		if (n && r === n.image.data.length) return n;
		n == null || n.dispose();
		let i = Math.min(r / 4, 1024);
		return n = new ye(new Float32Array(r), i, r / 4 / i, ct, Le), this.textures[e] = n, n;
	}
	writeMember(e, t, n, r, i) {
		var a;
		let o = r.isTextOutlineMaterial, s = n.matrix.elements;
		for (let n = 0; n < 16; n++) this.setTexData(e, t + n, s[n]);
		n._prepareForRender(r);
		let { uTroikaTotalBounds: c, uTroikaClipRect: l, uTroikaPositionOffset: u, uTroikaEdgeOffset: d, uTroikaBlurRadius: f, uTroikaStrokeWidth: p, uTroikaStrokeColor: m, uTroikaStrokeOpacity: h, uTroikaFillOpacity: g, uTroikaCurveRadius: _ } = r.uniforms;
		for (let n = 0; n < 4; n++) this.setTexData(e, t + 16 + n, c.value.getComponent(n));
		for (let n = 0; n < 4; n++) this.setTexData(e, t + 20 + n, l.value.getComponent(n));
		let v = (a = o ? n.outlineColor || 0 : n.color) == null ? i : a;
		this.setTexData(e, t + 24, EA.set(v).getHex()), this.setTexData(e, t + 25, g.value), this.setTexData(e, t + 26, _.value), o ? (this.setTexData(e, t + 28, u.value.x), this.setTexData(e, t + 29, u.value.y), this.setTexData(e, t + 30, d.value), this.setTexData(e, t + 31, f.value)) : (this.setTexData(e, t + 28, p.value), this.setTexData(e, t + 29, EA.set(m.value).getHex()), this.setTexData(e, t + 30, h.value));
	}
	collapse(e, t) {
		for (let n = 0; n < 16; n++) this.setTexData(e, t + n, 0);
	}
	setTexData(e, t, n) {
		n !== e[t] && (e[t] = n, this.needsUpdate = !0);
	}
};
function SA(e, t) {
	let n = e.spriteAnchor;
	n && (PA.set(e.position.x - n.x, e.position.y - n.y, 0), MA.copy(t).multiply(NA.makeTranslation(PA.x, PA.y, PA.z)).multiply(NA.makeRotationZ(e.rotation.z)).scale(e.scale).premultiply(NA.makeTranslation(n.x, n.y, e.position.z)), e.matrix.equals(MA) || e.setMatrix(MA));
}
function CA(e) {
	return e.visible ? OA.intersectsSphere(kA.copy(e.geometry.boundingSphere).applyMatrix4(e.matrix)) : !1;
}
function wA(e, t) {
	let { uTroikaMatricesTexture: n, uTroikaMatricesTextureSize: r } = e.uniforms;
	n.value = t, r.value.set(t.image.width, t.image.height);
}
var TA = 32, EA = new Xe(), DA = new Ct(), OA = new cn(), kA = new nn(), AA = new Ct(), jA = new Ct(), MA = new Ct(), NA = new Ct(), PA = new I(), FA = jt(class extends cA {
	constructor() {
		super(), this.isBatchedText = !0, this.uniforms = new cx(), this.memberTexture = new xA(), this.ordered = [], this.textById = [], this.freeIds = [], this._addedMembersCount = 0, this.boundsNeedsUpdate = !1, this.batchNeedsSync = !0, this.disposed = !1, this.patchedMaterial = null, this.addEventListener("synccomplete", () => {
			this.boundsNeedsUpdate = !0;
		});
	}
	get size() {
		return this._members.size;
	}
	get addedMembersCount() {
		return this._addedMembersCount;
	}
	requestSync() {
		this.batchNeedsSync = !0;
	}
	invalidateBounds() {
		this.boundsNeedsUpdate = !0;
	}
	getText(e) {
		return this.textById[e];
	}
	setVisibleAt(e, t) {
		let n = this.textById[e];
		!n || n.visible === t || (n.visible = t, this.invalidateBounds());
	}
	setOrder(e) {
		this.ordered = [];
		for (let n of e) {
			var t;
			let e = (t = this._members.get(n)) == null ? void 0 : t.index;
			e !== void 0 && this.ordered.push(e);
		}
		this._needsRepack = !0, this.batchNeedsSync = !0, this.boundsNeedsUpdate = !0;
	}
	addUniforms(e) {
		this.uniforms.add(e, Math.max(1, this._addedMembersCount)), this.materialsNeedUpdate();
	}
	getUniformAt(e, t, n) {
		return this.uniforms.get(e, t, n);
	}
	setUniformAt(e, t, n) {
		this.uniforms.set(e, t, n);
	}
	addText(e) {
		var t;
		let n = this._members.get(e);
		if (n) return n.index;
		let r = (t = this.freeIds.pop()) == null ? this._addedMembersCount++ : t;
		return super.addText(e), this._members.get(e).index = r, e._batchParent = this, this.textById[r] = e, this.ordered.push(r), this.uniforms.resize(this._addedMembersCount), this.batchNeedsSync = !0, this.boundsNeedsUpdate = !0, r;
	}
	removeText(e) {
		let t = this._members.get(e);
		if (super.removeText(e), !t) return;
		this.textById[t.index] = void 0, this.freeIds.push(t.index), e._batchParent === this && (e._batchParent = void 0);
		let n = this.ordered.indexOf(t.index);
		n >= 0 && this.ordered.splice(n, 1), this.batchNeedsSync = !0, this.boundsNeedsUpdate = !0;
	}
	copy(e) {
		return tA.prototype.copy.call(this, e), this;
	}
	dispose() {
		this.disposed = !0, super.dispose();
		for (let e of this.textById) e && (super.removeText(e), e._batchParent === this && (e._batchParent = void 0));
		this.memberTexture.dispose(), this.uniforms.dispose(), this.ordered.length = 0, this.textById.length = 0, this.freeIds.length = 0, this._addedMembersCount = 0, this.dispatchEvent(RA);
	}
	updateBounds() {
		if (!this.boundsNeedsUpdate) return;
		let e = this.geometry.boundingBox.makeEmpty();
		for (let t of this.ordered) {
			let n = this.textById[t];
			n && (n.matrixAutoUpdate && n.updateMatrix(), n.visible && (BA.copy(n.geometry.boundingBox).applyMatrix4(n.matrix), e.union(BA)));
		}
		e.getBoundingSphere(this.geometry.boundingSphere), this.boundsNeedsUpdate = !1;
	}
	raycast(e, t) {
		this.updateBounds();
		let n = this.geometry.boundingSphere;
		if (!(n && Number.isFinite(n.radius) && n.radius > 0 && (zA.copy(n).applyMatrix4(this.matrixWorld), !e.ray.intersectsSphere(zA)))) for (let n = 0; n < this._addedMembersCount; n++) {
			let r = this.textById[n];
			if (!(r != null && r.visible) || !r.textRenderInfo) continue;
			r.matrixAutoUpdate && r.updateMatrix(), r.matrixWorld.multiplyMatrices(this.matrixWorld, r.matrix);
			let i = t.length;
			r.raycast(e, t);
			for (let e = i; e < t.length; e++) t[e].object = this, t[e].instanceId = n;
		}
	}
	onBeforeRender(e, t, n, r, i) {
		var a;
		this.batchNeedsSync && this.sync(), hA(i) && this.memberTexture.prepareForRender(this, i, n), (a = this.uniforms.texture) == null || a.update(e);
	}
	sync(e) {
		if (this.disposed || !this.batchNeedsSync) {
			e == null || e();
			return;
		}
		this.batchNeedsSync = !1;
		let t = this._needsRepack;
		this._needsRepack = !1;
		let n = [];
		if (this._members.forEach((e, r) => {
			let i = r._needsSync;
			(e.dirty || i) && (e.dirty = !1, t = !0, i && n.push(new Promise((e) => r.sync(e))));
		}), !t) {
			e == null || e();
			return;
		}
		this.dispatchEvent(IA);
		let r = () => {
			this.disposed || (this.repackBatchedGeometry(), this.dispatchEvent(LA)), e == null || e();
		};
		n.length ? Promise.all(n).then(r) : r();
	}
	get material() {
		return super.material;
	}
	set material(e) {
		super.material = Array.isArray(e) ? e[e.length - 1] : e;
	}
	createDerivedMaterial(e) {
		return e !== this.patchedMaterial && (this.patchedMaterial = e, pA(e, this.uniforms)), mA(super.createDerivedMaterial(e), e, this.uniforms);
	}
	repackBatchedGeometry() {
		let e = vA(this.geometry, this.ordered, (e) => this.textById[e]);
		e && (this._textRenderInfo = e), this.boundsNeedsUpdate = !0, this.updateBounds();
	}
	materialsNeedUpdate() {
		let e = this.material;
		for (let t of Array.isArray(e) ? e : [e]) t.needsUpdate = !0;
	}
}), IA = { type: "syncstart" }, LA = { type: "synccomplete" }, RA = { type: "dispose" }, zA = new nn(), BA = new Ve(), VA = class extends tA {
	constructor(...e) {
		super(...e), this._batchParent = void 0, this._syncFlag = !0, this.spriteAnchor = null;
	}
	setMatrix(e) {
		var t;
		this.matrixAutoUpdate = !1, this.matrix.copy(e), (t = this._batchParent) == null || t.invalidateBounds();
	}
	updateMatrix() {
		var e;
		super.updateMatrix(), (e = this._batchParent) == null || e.invalidateBounds();
	}
	_prepareForRender(e) {
		let t = "+x+y", n = e.isTextOutlineMaterial, r = e.uniforms, i = this.textRenderInfo, a = this._batchParent !== void 0;
		if (i) {
			var o;
			let { sdfTexture: e, blockBounds: t } = i, { width: l, height: u } = e.image;
			r.uTroikaSDFTexture.value = e, r.uTroikaSDFTextureSize.value.set(l, u), r.uTroikaSDFGlyphSize.value = i.sdfGlyphSize, r.uTroikaSDFExponent.value = i.sdfExponent, r.uTroikaTotalBounds.value.fromArray(t), r.uTroikaUseGlyphColors.value = !n && !!i.glyphColors;
			let d = 0, f = 0, p = 0, m, h = 1, g, _ = 0, v = 0;
			if (n) {
				let { outlineWidth: e, outlineOffsetX: t, outlineOffsetY: n, outlineBlur: r, outlineOpacity: i } = this;
				d = this._parsePercent(e) || 0, f = Math.max(0, this._parsePercent(r) || 0), m = i, _ = this._parsePercent(t) || 0, v = this._parsePercent(n) || 0;
			} else {
				if (p = Math.max(0, this._parsePercent(this.strokeWidth) || 0), p) {
					var s, c;
					g = this.strokeColor, r.uTroikaStrokeColor.value.set((s = g) == null ? 8421504 : s), h = (c = this.strokeOpacity) == null ? 1 : c;
				}
				m = this.fillOpacity;
			}
			r.uTroikaEdgeOffset.value = d, r.uTroikaPositionOffset.value.set(_, v), r.uTroikaBlurRadius.value = f, r.uTroikaStrokeWidth.value = p, r.uTroikaStrokeOpacity.value = h, r.uTroikaFillOpacity.value = (o = m) == null ? 1 : o, r.uTroikaCurveRadius.value = this.curveRadius || 0;
			let y = this.clipRect;
			if (y && Array.isArray(y) && y.length === 4) r.uTroikaClipRect.value.fromArray(y);
			else {
				let e = (this.fontSize || .1) * 100;
				r.uTroikaClipRect.value.set(t[0] - e, t[1] - e, t[2] + e, t[3] + e);
			}
			a || this.geometry.applyClipRect(r.uTroikaClipRect.value);
		}
		if (r.uTroikaSDFDebug.value = !!this.debugSDF, !a) {
			let t = n ? this.outlineColor || 0 : this.color;
			if (t == null) delete e.color;
			else {
				let n = e.hasOwnProperty("color") ? e.color : e.color = new Xe();
				(t !== n._input || typeof t == "object") && n.set(n._input = t);
			}
		}
		let l = this.orientation || t;
		if (l !== e._orientation) {
			let n = r.uTroikaOrient.value;
			l = l.replace(/[^-+xyz]/g, "");
			let i = l !== t && /^([-+])([xyz])([-+])([xyz])$/.exec(l);
			if (i) {
				let [, e, t, r, a] = i;
				UA.set(0, 0, 0)[t] = e === "-" ? 1 : -1, WA.set(0, 0, 0)[a] = r === "-" ? -1 : 1, HA.lookAt(GA, UA.cross(WA), WA), n.setFromMatrix4(HA);
			} else n.identity();
			e._orientation = l;
		}
	}
};
Object.defineProperty(VA.prototype, "_needsSync", {
	configurable: !0,
	get() {
		return this._syncFlag;
	},
	set(e) {
		var t;
		this._syncFlag = e, e && ((t = this._batchParent) == null || t.requestSync());
	}
}), jt(VA);
var HA = new Ct(), UA = new I(), WA = new I(), GA = new I(), KA = 1.1;
function qA(e) {
	let { bounds: t, lines: n, alignment: r, padding: i } = e, a = $A.set(t.size.x, t.size.y).multiplyScalar(.5), o = ej.copy(a);
	if (r.vertical === "center") {
		let e = 0;
		for (let t of n) e += YA(t);
		o.y -= (t.size.y - e) / 2;
	} else o.sub(tj.fromArray(i));
	o.multiply(XA(r));
	let s = [];
	for (let e of n) {
		var c;
		let t = e.fontSize, n = -t;
		s.push({
			anchorX: r.horizontal,
			anchorY: r.vertical === "bottom" ? "bottom" : "top",
			textAlign: (c = r.text) == null ? r.horizontal : c,
			offsetX: o.x,
			offsetY: o.y,
			scaleX: t,
			scaleY: n,
			clipRect: [
				(-a.x - o.x) / t,
				(a.y - o.y) / n,
				(a.x - o.x) / t,
				(-a.y - o.y) / n
			]
		}), o.y += YA(e);
	}
	return s;
}
function JA(e, t, n, r) {
	var i;
	let { rotation: a } = n, o = rj.set(t.offsetX, t.offsetY).rotateAround(ij, a).add(n.center);
	if (e.position.set(o.x, o.y, n.elevation), e.rotation.set(0, 0, a), e.scale.set(t.scaleX, t.scaleY, 1), r) {
		var s;
		let t = (s = e.spriteAnchor) == null ? new gt() : s;
		t.set(n.center.x, n.center.y), e.spriteAnchor = t, e.matrixAutoUpdate = !1;
	} else e.spriteAnchor = null, e.matrixAutoUpdate = !0;
	e.updateMatrix();
	let c = (i = e.clipRect) == null ? e.clipRect = [
		0,
		0,
		0,
		0
	] : i;
	c[0] = t.clipRect[0], c[1] = t.clipRect[1], c[2] = t.clipRect[2], c[3] = t.clipRect[3];
}
function YA(e) {
	return e.fontSize * KA * e.text.split("\n").length;
}
function XA(e) {
	return nj.set(ZA[e.horizontal], QA[e.vertical]);
}
var ZA = {
	left: -1,
	center: 0,
	right: 1
}, QA = {
	top: -1,
	center: -1,
	bottom: 1
}, $A = new gt(), ej = new gt(), tj = new gt(), nj = new gt(), rj = new gt(), ij = new gt(0, 0), aj = class extends SC {
	constructor(e) {
		super(), this.groups = [], this.freeGroups = [], this.groupByMember = /* @__PURE__ */ new Map(), this.groupCount = 0, this.appliedOrder = [], this.syncScheduled = !1, this.invalidate = void 0, this.invalidate = e;
	}
	linesAt(e) {
		var t;
		return (t = this.groups[e]) == null ? sj : t;
	}
	scheduleSync() {
		this.syncScheduled || (this.syncScheduled = !0, Promise.resolve().then(() => {
			this.syncScheduled = !1, this.mesh && this.mesh.sync(this.invalidate);
		}));
	}
	claim(e, t) {
		let n = super.claim(e, t);
		return this.layerDefs.length && this.applyOrder(), n;
	}
	setVisibleAt(e, t) {
		let n = this.groups[e];
		if (n) for (let e of n.slots) this.mesh.setVisibleAt(e, t);
	}
	setPaintOrder(e, t) {
		super.setPaintOrder(e, t), this.scheduleSync();
	}
	defFromHit(e) {
		let t = e.instanceId;
		return t === void 0 ? void 0 : this.defAt(this.groupByMember.get(t));
	}
	applyOrder() {
		let e = [];
		for (let t of ub(this.layerDefs, this.layerDimmed)) {
			let n = this.slotOf(t);
			if (n === void 0) continue;
			let r = this.groups[n];
			r && (e.push(...r.texts), this.dimmedBySlot[n] = db(t.dim, this.layerDimmed));
		}
		rE(e, this.appliedOrder) || (this.appliedOrder = e, this.mesh.setOrder(e));
	}
	writeDim(e, t) {
		let n = this.groups[e];
		if (n) for (let e of n.slots) super.writeDim(e, t);
	}
	addInstance(e) {
		var t;
		let n = (t = this.freeGroups.pop()) == null ? this.groupCount++ : t, r = [], i = [];
		for (let t = 0; t < e; t++) {
			let e = oj();
			r.push(e), i.push(this.mesh.addText(e));
		}
		this.groups[n] = {
			texts: r,
			slots: i
		};
		for (let e of i) this.groupByMember.set(e, n);
		return n;
	}
	removeInstance(e) {
		let t = this.groups[e];
		if (t) {
			for (let e of t.slots) this.groupByMember.delete(e);
			for (let e of t.texts) this.mesh.removeText(e), e.dispose();
			this.groups[e] = void 0, this.freeGroups.push(e), this.appliedOrder = [];
		}
	}
};
function oj() {
	let e = new VA();
	return e.fontSize = 1, e.lineHeight = KA, e.whiteSpace = "nowrap", e;
}
var sj = {
	texts: [],
	slots: []
}, cj = Xm("text-instance"), lj = (0, L.memo)(function(e) {
	let t = (0, U.c)(5), { def: n, container: r } = e, i;
	t[0] === n.lines.length ? i = t[1] : (i = () => n.lines.length, t[0] = n.lines.length, t[1] = i);
	let a;
	return t[2] !== r || t[3] !== n ? (a = (e) => {
		uj(r, e, n);
	}, t[2] = r, t[3] = n, t[4] = a) : a = t[4], TS(r, n, i, a), null;
});
function uj(e, t, n) {
	let { texts: r, slots: i } = e.linesAt(t), a = qA(n);
	for (let t = 0; t < r.length; t++) dj(e.mesh, i[t], r[t], n.lines[t], a[t], n);
	e.scheduleSync();
}
function dj(e, t, n, r, i, a) {
	e.setVisibleAt(t, r.fontSize > 0), !(r.fontSize <= 0) && (n.text = r.text, n.font = r.fontUrl, n.anchorX = i.anchorX, n.anchorY = i.anchorY, n.textAlign = i.textAlign, fj(n, r.color, "fill"), r.stroke && (fj(n, r.stroke.color, "outline"), n.outlineWidth = r.fontSize == 0 ? 0 : r.stroke.width / r.fontSize), JA(n, i, a.bounds, a.screenSpace === !0));
}
function fj(e, t, n) {
	let r = n == "fill" ? "color" : "outlineColor", i = `${n}Opacity`, a = cC(t);
	if (!a) {
		cj.warn(`Invalid color: ${t} %O`, e), e[r] = t;
		return;
	}
	pj.setRGB(a.r / 255, a.g / 255, a.b / 255, kt), e[r] = pj.getHex(Qt), e[i] = a.a;
}
var pj = new Xe();
//#endregion
//#region ../renderer/src/objects/text/Texts.tsx
function mj(e) {
	var t;
	let n = (0, U.c)(16), { defs: r } = e, i = (t = e.mounted) == null ? r.length : t, a = xt(hj), o;
	n[0] === a ? o = n[1] : (o = () => new aj(a), n[0] = a, n[1] = o);
	let s = CS(o, r), c;
	n[2] === s ? c = n[3] : (c = (e) => s.bind(e), n[2] = s, n[3] = c);
	let l;
	n[4] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ (0, R.jsx)(Vb, {}), n[4] = l) : l = n[4];
	let u;
	n[5] === c ? u = n[6] : (u = /* @__PURE__ */ (0, R.jsx)(FA, {
		ref: c,
		children: l
	}), n[5] = c, n[6] = u);
	let d;
	if (n[7] !== s || n[8] !== r || n[9] !== i) {
		let e;
		n[11] === s ? e = n[12] : (e = (e) => /* @__PURE__ */ (0, R.jsx)(lj, {
			def: e,
			container: s
		}, jS(e)), n[11] = s, n[12] = e), d = r.slice(0, i).map(e), n[7] = s, n[8] = r, n[9] = i, n[10] = d;
	} else d = n[10];
	let f;
	return n[13] !== u || n[14] !== d ? (f = /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [u, d] }), n[13] = u, n[14] = d, n[15] = f) : f = n[15], f;
}
function hj(e) {
	return e.invalidate;
}
//#endregion
//#region ../renderer/src/objects/layer/mount-scheduler.ts
var gj = Xm("mount");
function _j(e = xj) {
	let t = [], n = /* @__PURE__ */ new WeakMap(), r = /* @__PURE__ */ new WeakSet(), i = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new Set(), o = null, s = 0, c = 0, l = !1, u = 0, d = 0, f = [], p = wj, m = typeof requestAnimationFrame == "function" ? (e) => void requestAnimationFrame(e) : (e) => void setTimeout(e, 0), h = () => {
		for (let e of [...a]) e();
	}, g = (e, t, n) => {
		let r = i.get(e), a = Math.max(1, Math.round(n / Math.max(r == null ? p : r, Tj))), o = r === void 0 ? Math.min(a, Ej) : a, s = Math.ceil(e.children.length / Dj);
		return Math.min(e.children.length - t, Math.max(o, s));
	}, _ = (e) => {
		var t;
		return r.has(e) ? e.children.length : Math.min((t = n.get(e)) == null ? 0 : t, e.children.length);
	}, v = () => {
		if (f.length !== 0) {
			for (let t of f) {
				var e;
				gj.debug(`${(e = t.name) == null ? "?" : e}, admitted ${_(t)}/${t.children.length}`);
			}
			f.length = 0;
		}
	}, y = () => {
		l || (l = !0, v(), m(() => {
			l = !1, u = 0, d = 0, b();
		}));
	}, b = () => {
		var i;
		if (o || l) return;
		let a = t.find((e) => {
			var t;
			return !r.has(e) && ((t = n.get(e)) == null ? 0 : t) < e.children.length;
		});
		if (!a) {
			v();
			return;
		}
		let p = e - u;
		if ((p < Sj || d >= Cj) && d > 0) {
			y();
			return;
		}
		let m = (i = n.get(a)) == null ? 0 : i, _ = g(a, m, p);
		n.set(a, m + _), m + _ >= a.children.length && r.add(a), o = a, s = _, c = performance.now(), f.includes(a) || f.push(a), h();
	};
	return {
		register: (e) => (e.children.length === 0 && !r.has(e) && (r.add(e), h()), t.includes(e) || (t.push(e), h()), b(), () => {
			let n = t.indexOf(e);
			n >= 0 && (t.splice(n, 1), h()), o === e && (o = null, b());
		}),
		leaves: () => [...t],
		admittedCount: (e) => {
			var t;
			return r.has(e) ? e.children.length : Math.min((t = n.get(e)) == null ? 0 : t, e.children.length);
		},
		subscribe: (e) => (a.add(e), () => {
			a.delete(e);
		}),
		reportMounted: (e) => {
			if (o !== e) return;
			let t = performance.now() - c;
			s > 0 && (p = Math.max(t / s, Tj), i.set(e, p)), o = null, u += t, d++, b();
		}
	};
}
function vj(e) {
	let t = (0, U.c)(8), n, r;
	t[0] === e ? (n = t[1], r = t[2]) : (n = (t) => Bm(e, t), r = () => Vm(e), t[0] = e, t[1] = n, t[2] = r);
	let i = (0, L.useDeferredValue)((0, L.useSyncExternalStore)(n, r)), a;
	t[3] === i ? a = t[4] : (a = Mm(i), t[3] = i, t[4] = a);
	let o = yj(e, !a, i.length), s;
	return t[5] !== i || t[6] !== o ? (s = {
		children: i,
		mounted: o
	}, t[5] = i, t[6] = o, t[7] = s) : s = t[7], s;
}
function yj(e, t, n) {
	let r = (0, U.c)(18), i = (0, L.use)(bj), a;
	r[0] === i ? a = r[1] : (a = (e) => i ? i.subscribe(e) : Oj, r[0] = i, r[1] = a);
	let o;
	r[2] !== e || r[3] !== t || r[4] !== i || r[5] !== n ? (o = () => !t || !i ? n : i.admittedCount(e), r[2] = e, r[3] = t, r[4] = i, r[5] = n, r[6] = o) : o = r[6];
	let s = (0, L.useSyncExternalStore)(a, o), c, l;
	r[7] !== e || r[8] !== t || r[9] !== i ? (c = () => {
		if (!(!i || !t)) return i.register(e);
	}, l = [
		i,
		e,
		t
	], r[7] = e, r[8] = t, r[9] = i, r[10] = c, r[11] = l) : (c = r[10], l = r[11]), (0, L.useEffect)(c, l);
	let u, d;
	return r[12] !== e || r[13] !== t || r[14] !== s || r[15] !== i ? (u = () => {
		i && t && s > 0 && i.reportMounted(e);
	}, d = [
		i,
		e,
		t,
		s
	], r[12] = e, r[13] = t, r[14] = s, r[15] = i, r[16] = u, r[17] = d) : (u = r[16], d = r[17]), (0, L.useEffect)(u, d), s;
}
var bj = (0, L.createContext)(null), xj = 11, Sj = 2, Cj = 12, wj = .25, Tj = .02, Ej = 64, Dj = 8, Oj = () => void 0;
//#endregion
//#region ../renderer/src/objects/layer/visibility-gui.ts
function kj(e, t) {
	e.add({
		get visible() {
			return !t.hidden;
		},
		set visible(e) {
			t.hidden = !e, zm(t);
		}
	}, "visible").name(t.name).listen();
}
function Aj(e, t) {
	let n = [];
	return () => {
		let r = t();
		if (!(r.length === n.length && r.every((e, t) => e === n[t]))) {
			n = r;
			for (let t of [...e.controllers]) t.destroy();
			for (let t of r) kj(e, t);
		}
	};
}
function jj(e) {
	let t = (0, U.c)(5), n = Bt(), r = (0, L.use)(bj), i, a;
	t[0] !== n || t[1] !== e || t[2] !== r ? (i = () => {
		if (!n) return;
		let t = n.addFolder("Main layers"), i = Aj(t, () => {
			let t = Vm(e);
			return Mm(t) ? t : [];
		});
		i();
		let a = Bm(e, i), o = n.addFolder("Content layers"), s;
		if (r) {
			let e = Aj(o, () => r.leaves());
			e(), s = r.subscribe(e);
		}
		return () => {
			a(), s == null || s(), t.destroy(), o.destroy();
		};
	}, a = [
		n,
		r,
		e
	], t[0] = n, t[1] = e, t[2] = r, t[3] = i, t[4] = a) : (i = t[3], a = t[4]), (0, L.useEffect)(i, a);
}
//#endregion
//#region ../renderer/src/objects/layer/Layer.tsx
function Mj(e) {
	let t = (0, U.c)(3), { layer: n, children: r } = e;
	jj(n);
	let i;
	return t[0] !== r || t[1] !== n ? (i = /* @__PURE__ */ (0, R.jsx)(Fj, {
		layer: n,
		hidden: !1,
		orderBase: 0,
		orderStep: 1,
		children: r
	}), t[0] = r, t[1] = n, t[2] = i) : i = t[2], i;
}
function Nj(e) {
	let t = (0, U.c)(17), { defs: n, mounted: r } = e, i = null;
	if (Nm(n)) {
		let e;
		t[0] !== n || t[1] !== r ? (e = /* @__PURE__ */ (0, R.jsx)(dO, {
			defs: n,
			mounted: r
		}), t[0] = n, t[1] = r, t[2] = e) : e = t[2], i = e;
	} else if (Pm(n)) {
		let e;
		t[3] !== n || t[4] !== r ? (e = /* @__PURE__ */ (0, R.jsx)(Dw, {
			defs: n,
			mounted: r
		}), t[3] = n, t[4] = r, t[5] = e) : e = t[5], i = e;
	} else if (Fm(n)) {
		let e;
		t[6] !== n || t[7] !== r ? (e = /* @__PURE__ */ (0, R.jsx)(mj, {
			defs: n,
			mounted: r
		}), t[6] = n, t[7] = r, t[8] = e) : e = t[8], i = e;
	} else if (Im(n)) {
		let e;
		t[9] !== n || t[10] !== r ? (e = /* @__PURE__ */ (0, R.jsx)(nE, {
			defs: n,
			mounted: r
		}), t[9] = n, t[10] = r, t[11] = e) : e = t[11], i = e;
	} else if (Lm(n)) {
		let e;
		t[12] !== n || t[13] !== r ? (e = /* @__PURE__ */ (0, R.jsx)(HD, {
			defs: n,
			mounted: r
		}), t[12] = n, t[13] = r, t[14] = e) : e = t[14], i = e;
	}
	let a;
	return t[15] === i ? a = t[16] : (a = /* @__PURE__ */ (0, R.jsx)(L.Suspense, {
		fallback: null,
		children: i
	}), t[15] = i, t[16] = a), a;
}
function Pj(e) {
	let t = (0, U.c)(28), { layer: n, children: r, hidden: i, orderBase: a, orderStep: o } = e, s = Dy(), c = Oy(), l = i || n.hidden === !0, u = c || n.overlay === !0, d;
	t[0] !== n || t[1] !== s ? (d = [n, ...s], t[0] = n, t[1] = s, t[2] = d) : d = t[2];
	let f = d, p = !l, { children: m, mounted: h } = vj(n);
	oh(n, m);
	let g = Dv(n, p), _ = null;
	if (Mm(m)) {
		let e = o / m.length, n;
		if (t[3] !== e || t[4] !== m || t[5] !== l || t[6] !== a) {
			let r;
			t[8] !== e || t[9] !== l || t[10] !== a ? (r = (t, n) => /* @__PURE__ */ (0, R.jsx)(Fj, {
				layer: t,
				hidden: l,
				orderBase: a + n * e,
				orderStep: e
			}, t.name), t[8] = e, t[9] = l, t[10] = a, t[11] = r) : r = t[11], n = m.map(r), t[3] = e, t[4] = m, t[5] = l, t[6] = a, t[7] = n;
		} else n = t[7];
		_ = n;
	} else if (h > 0) {
		let e;
		t[12] !== m || t[13] !== h ? (e = /* @__PURE__ */ (0, R.jsx)(Nj, {
			defs: m,
			mounted: h
		}), t[12] = m, t[13] = h, t[14] = e) : e = t[14], _ = e;
	}
	let v = !n.hidden, y = (u ? Lj : Ij) + a, b;
	t[15] !== _ || t[16] !== n.name || t[17] !== g || t[18] !== r || t[19] !== v || t[20] !== y ? (b = /* @__PURE__ */ (0, R.jsxs)("group", {
		name: n.name,
		visible: v,
		renderOrder: y,
		...g,
		children: [r, _]
	}), t[15] = _, t[16] = n.name, t[17] = g, t[18] = r, t[19] = v, t[20] = y, t[21] = b) : b = t[21];
	let x = b, S;
	t[22] !== x || t[23] !== u ? (S = /* @__PURE__ */ (0, R.jsx)(My, {
		value: u,
		children: x
	}), t[22] = x, t[23] = u, t[24] = S) : S = t[24];
	let C;
	return t[25] !== f || t[26] !== S ? (C = /* @__PURE__ */ (0, R.jsx)(jy, {
		value: f,
		children: S
	}), t[25] = f, t[26] = S, t[27] = C) : C = t[27], C;
}
var Fj = (0, L.memo)(Pj), Ij = 0, Lj = 1;
//#endregion
//#region ../renderer/src/objects/lighting/lighting-gui.ts
function Rj(e) {
	let t = (0, U.c)(5), n = Bt(), r = Ib(), i, a;
	t[0] !== r || t[1] !== n || t[2] !== e ? (i = () => {
		if (!n) return;
		let t = zj(n, e, r);
		return () => {
			t.destroy();
		};
	}, a = [
		r,
		n,
		e
	], t[0] = r, t[1] = n, t[2] = e, t[3] = i, t[4] = a) : (i = t[3], a = t[4]), (0, L.useEffect)(i, a);
}
function zj(e, t, n) {
	let r = e.addFolder("Lighting"), i = r.add(t, "trackPitch").name("track camera pitch"), a = r.add(t, "pitchDegrees", 0, 89, 1).name("pitch°");
	return i.onChange((e) => Vj(a, !e)), Vj(a, !t.trackPitch), r.addColor(t, "skyColor").name("sky color"), r.addColor(t, "groundColor").name("ground color"), r.addColor(t, "directionalColor").name("directional color"), r.add(t, "contrast", 0, 1, .01).name("contrast"), Bj(r, n), r;
}
function Bj(e, t) {
	e.addColor(t, "shadowHex").name("shadow color").onChange((e) => t.shadowColor.value.set(e)), e.add(t.shadowDistance, "value", 1, 5, .1).name("contact distance"), e.add(t.shadowStrength, "value", 0, 1, .01).name("contact strength");
	let n = e.add(t, "enabled").name("ambient occlusion"), r = [e.add(t, "radius", 1, 30, .5).name("ao radius"), e.add(t.aoStrength, "value", 0, 1, .01).name("ao strength")];
	n.onChange((e) => {
		for (let t of r) Vj(t, e);
	});
	for (let e of r) Vj(e, t.enabled);
}
function Vj(e, t) {
	t ? e.show() : e.hide();
}
//#endregion
//#region ../renderer/src/objects/lighting/Lighting.tsx
function Hj(e) {
	let t = (0, U.c)(24), { contrast: n, skyColor: r, groundColor: i, directionalColor: a } = e, o;
	if (t[0] !== e.shadow) {
		var s;
		o = (s = e.shadow) == null ? {} : s, t[0] = e.shadow, t[1] = o;
	} else o = t[1];
	let { color: c, contactDistance: l, contactStrength: u, ambientOcclusion: d, aoRadius: f, aoStrength: p } = o, m = (0, L.useRef)(null), h = (0, L.useRef)(null), g = (0, L.useRef)(null), _ = Sh(), v = Ib(), y = xt(Wj), [b] = (0, L.useState)(Uj), x;
	t[2] === Symbol.for("react.memo_cache_sentinel") ? (x = {
		sky: "",
		ground: "",
		directional: ""
	}, t[2] = x) : x = t[2];
	let S = (0, L.useRef)(x), C, w;
	t[3] === Symbol.for("react.memo_cache_sentinel") ? (C = () => {
		h.current.target = g.current;
	}, w = [], t[3] = C, t[4] = w) : (C = t[3], w = t[4]), (0, L.useLayoutEffect)(C, w);
	let T, E;
	t[5] !== d || t[6] !== f || t[7] !== p || t[8] !== l || t[9] !== u || t[10] !== n || t[11] !== a || t[12] !== v || t[13] !== i || t[14] !== y || t[15] !== b || t[16] !== c || t[17] !== r ? (T = () => {
		Gj(b, {
			contrast: n,
			skyColor: r,
			groundColor: i,
			directionalColor: a
		}), Kj(v, {
			color: c,
			contactDistance: l,
			contactStrength: u,
			ambientOcclusion: d,
			aoRadius: f,
			aoStrength: p
		}), y();
	}, E = [
		b,
		v,
		y,
		n,
		r,
		i,
		a,
		c,
		l,
		u,
		d,
		f,
		p
	], t[5] = d, t[6] = f, t[7] = p, t[8] = l, t[9] = u, t[10] = n, t[11] = a, t[12] = v, t[13] = i, t[14] = y, t[15] = b, t[16] = c, t[17] = r, t[18] = T, t[19] = E) : (T = t[18], E = t[19]), (0, L.useEffect)(T, E), Rj(b);
	let D;
	t[20] !== b || t[21] !== _ ? (D = (e) => {
		let t = m.current, n = h.current;
		qj(e.camera, _, b, n.position), t.position.setFromMatrixColumn(_.matrix, 2).normalize().applyMatrix4(_.matrixInverse), Jj(t.color, b.skyColor, S.current, "sky"), Jj(t.groundColor, b.groundColor, S.current, "ground"), Jj(n.color, b.directionalColor, S.current, "directional");
		let r = Math.acos(Ff(n.position.z, -1, 1)), { hemisphereIntensity: i, directionalIntensity: a } = Xj(Ff(b.contrast, 0, 1), r, t.color, t.groundColor, n.color);
		t.intensity = i * Math.PI, n.intensity = a * Math.PI;
	}, t[20] = b, t[21] = _, t[22] = D) : D = t[22], Pt(D);
	let O;
	return t[23] === Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [
		/* @__PURE__ */ (0, R.jsx)("hemisphereLight", {
			ref: m,
			color: $j.skyColor,
			groundColor: $j.groundColor,
			intensity: iM.hemisphereIntensity * Math.PI
		}),
		/* @__PURE__ */ (0, R.jsx)("directionalLight", {
			ref: h,
			color: $j.directionalColor,
			intensity: iM.directionalIntensity * Math.PI
		}),
		/* @__PURE__ */ (0, R.jsx)("object3D", { ref: g })
	] }), t[23] = O) : O = t[23], O;
}
function Uj() {
	return { ...$j };
}
function Wj(e) {
	return e.invalidate;
}
function Gj(e, t) {
	t.contrast !== void 0 && (e.contrast = t.contrast), t.skyColor !== void 0 && (e.skyColor = t.skyColor), t.groundColor !== void 0 && (e.groundColor = t.groundColor), t.directionalColor !== void 0 && (e.directionalColor = t.directionalColor);
}
function Kj(e, t) {
	t.color !== void 0 && (e.shadowHex = t.color, e.shadowColor.value.set(t.color)), t.contactDistance !== void 0 && (e.shadowDistance.value = t.contactDistance), t.contactStrength !== void 0 && (e.shadowStrength.value = t.contactStrength), t.ambientOcclusion !== void 0 && (e.enabled = t.ambientOcclusion), t.aoRadius !== void 0 && (e.radius = t.aoRadius), t.aoStrength !== void 0 && (e.aoStrength.value = t.aoStrength);
}
function qj(e, t, n, r) {
	if (n.trackPitch) return r.setFromMatrixColumn(e.matrixWorld, 2).transformDirection(t.matrixInverse);
	let i = aM.setFromMatrixColumn(e.matrixWorld, 1).transformDirection(t.matrixInverse), a = Hn(n.pitchDegrees);
	return r.set(-i.x, -i.y, 0).normalize().multiplyScalar(Math.sin(a)).setZ(Math.cos(a));
}
function Jj(e, t, n, r) {
	n[r] !== t && (e.set(t), n[r] = t);
}
function Yj(e, t, n, r) {
	let i = Math.cos(e), a = 0;
	for (let e of eM) a = Math.max(a, r[e]);
	let o = 1 / Math.max(a * i, rM);
	if (Qj(o, e, t, n, r) < 1) return o;
	let s = 0, c = o;
	for (let i = 0; i < tM; i++) {
		let i = (s + c) / 2;
		Qj(i, e, t, n, r) < 1 ? s = i : c = i;
	}
	return (s + c) / 2;
}
function Xj(e, t, n, r, i) {
	let a = e * Yj(t, n, r, i);
	return {
		hemisphereIntensity: Zj(a, t, n, i),
		directionalIntensity: a
	};
}
function Zj(e, t, n, r) {
	let i = Math.cos(t), a = Infinity;
	for (let t of eM) {
		let o = Math.max(n[t], nM);
		a = Math.min(a, (1 - e * r[t] * i) / o);
	}
	return a;
}
function Qj(e, t, n, r, i) {
	let a = Zj(e, t, n, i), o = Math.sin(t), s = -Infinity;
	for (let t of eM) {
		let c = (r[t] + n[t]) / 2;
		s = Math.max(s, a * c + e * i[t] * o);
	}
	return s;
}
var $j = {
	trackPitch: !1,
	pitchDegrees: 60,
	contrast: .7,
	skyColor: "#ffffff",
	groundColor: "#b9c1cc",
	directionalColor: "#fff3e6"
}, eM = [
	"r",
	"g",
	"b"
], tM = 20, nM = 1e-6, rM = 1e-6, iM = Xj($j.contrast, Hn($j.pitchDegrees), new Xe($j.skyColor), new Xe($j.groundColor), new Xe($j.directionalColor)), aM = new I(), oM = Xm("occlusion"), sM = class {
	constructor() {
		this.depthTarget = null, this.aoTarget = null, this.blurTarget = null, this.targetSize = new gt(), this.unavailable = !1;
	}
	get depth() {
		return this.depthTarget;
	}
	get ao() {
		return this.aoTarget;
	}
	get blur() {
		return this.blurTarget;
	}
	get size() {
		return this.targetSize;
	}
	get held() {
		return this.depthTarget !== null;
	}
	dispose() {
		this.release();
	}
	sync(e) {
		if (this.unavailable) return !1;
		let t = e.getSize(fM), n = Math.floor(t.x * lM), r = Math.floor(t.y * lM);
		return n < 1 || r < 1 ? !1 : this.depthTarget && this.targetSize.x === n && this.targetSize.y === r ? !0 : this.build(e, n, r);
	}
	allocate(e, t, n) {
		this.depthTarget = new En(e, t, {
			...dM,
			depthBuffer: !0,
			depthTexture: new at(e, t, n)
		}), this.aoTarget = new En(e, t, {
			...dM,
			depthBuffer: !1
		}), this.blurTarget = new En(e, t, { depthBuffer: !1 }), this.blurTarget.texture = this.depthTarget.texture, this.targetSize.set(e, t);
	}
	build(e, t, n) {
		this.release();
		for (let r of uM) {
			if (this.allocate(t, n, r), this.verify(e)) return !0;
			this.release();
		}
		return oM.debug("ambient occlusion off: this context gives no complete render targets"), this.unavailable = !0, !1;
	}
	release() {
		var e, t, n, r;
		(e = this.depthTarget) == null || e.dispose(), (t = this.aoTarget) == null || t.dispose(), (n = this.blurTarget) == null || n.dispose(), (r = this.depthTarget) == null || (r = r.depthTexture) == null || r.dispose(), this.depthTarget = null, this.aoTarget = null, this.blurTarget = null, this.targetSize.set(0, 0);
	}
	verify(e) {
		let t = cM(e);
		if (!t) return !1;
		let n = e.getRenderTarget();
		try {
			let n = !0;
			for (let r of [this.depthTarget, this.blurTarget]) e.setRenderTarget(r), t.checkFramebufferStatus(t.FRAMEBUFFER) !== t.FRAMEBUFFER_COMPLETE && (n = !1);
			return n;
		} catch {
			return !1;
		} finally {
			e.setRenderTarget(n);
		}
	}
};
function cM(e) {
	let t = e.getContext();
	if (typeof WebGL2RenderingContext == "function") return t instanceof WebGL2RenderingContext ? t : void 0;
}
var lM = .5, uM = [Rt, Ft], dM = {
	format: ut,
	type: Zt,
	minFilter: Ke,
	magFilter: Ke
}, fM = new gt();
//#endregion
//#region ../renderer/src/objects/lighting/OcclusionPasses.tsx
function pM() {
	let e = (0, U.c)(14), t = Ib(), n = Sh(), [r] = (0, L.useState)(hM), [i] = (0, L.useState)(mM), a;
	e[0] === t ? a = e[1] : (a = () => gM("occlusion-blur", qy, Gy(t)), e[0] = t, e[1] = a);
	let [o] = (0, L.useState)(a), s, c;
	e[2] !== i || e[3] !== o || e[4] !== t || e[5] !== r ? (s = () => () => {
		r.dispose(), i.uniforms.uNoise.value.dispose(), bM(i), bM(o), SM(t);
	}, c = [
		i,
		o,
		t,
		r
	], e[2] = i, e[3] = o, e[4] = t, e[5] = r, e[6] = s, e[7] = c) : (s = e[6], c = e[7]), (0, L.useEffect)(s, c);
	let l;
	return e[8] !== i || e[9] !== o || e[10] !== t || e[11] !== r || e[12] !== n ? (l = (e) => {
		if (SM(t), !t.enabled || t.occluders.size === 0) {
			r.held && r.dispose();
			return;
		}
		r.sync(e.gl) && (_M(e.gl, e.scene, e.camera, r, i, o, t.aoGuard.value, t.radius * n.scale, t.taps), xM(t, r, e.gl));
	}, e[8] = i, e[9] = o, e[10] = t, e[11] = r, e[12] = n, e[13] = l) : l = e[13], Pt(l), null;
}
function mM() {
	return gM("occlusion-ao", Ry, Ny());
}
function hM() {
	return new sM();
}
function gM(e, t, n) {
	let r = new $t({
		uniforms: n,
		vertexShader: Ly,
		fragmentShader: t,
		depthTest: !1,
		depthWrite: !1,
		blending: 0
	}), i = new Dn(new Pe(2, 2), r);
	i.name = e, i.frustumCulled = !1;
	let a = new gn();
	return a.add(i), {
		scene: a,
		material: r,
		quad: i,
		uniforms: n
	};
}
function _M(e, t, n, r, i, a, o, s, c) {
	let l = r.depth, u = r.ao, d = r.blur;
	if (!(l != null && l.depthTexture) || !u || !d) return;
	let f = 1 / (1 + o);
	i.uniforms.uProjection.value.copy(n.projectionMatrix).premultiply(EM.makeScale(f, f, 1)), i.uniforms.uUnprojection.value.copy(i.uniforms.uProjection.value).invert(), i.uniforms.uDepth.value = l.depthTexture, i.uniforms.uRadius.value = s, i.uniforms.uTaps.value = c, i.uniforms.uTexel.value.set(1 / r.size.x, 1 / r.size.y), i.uniforms.uNoiseScale.value.set(r.size.x / 4, r.size.y / 4), a.uniforms.uOcclusion.value = u.texture, a.uniforms.uDepth.value = l.depthTexture, a.uniforms.uTexel.value.copy(i.uniforms.uTexel.value), vM(e, t, n, l, i.uniforms);
	let p = e.getRenderTarget();
	try {
		yM(e, u, i.scene, n), yM(e, d, a.scene, n);
	} finally {
		e.setRenderTarget(p);
	}
}
function vM(e, t, n, r, i) {
	let a = e.getRenderTarget(), o = n.layers.mask, s = t.overrideMaterial, c = wM.copy(n.projectionMatrix), l = TM.copy(n.projectionMatrixInverse);
	n.layers.set(1), t.overrideMaterial = CM, n.projectionMatrix.copy(i.uProjection.value), n.projectionMatrixInverse.copy(i.uUnprojection.value), e.setRenderTarget(r);
	try {
		e.clear(!1, !0, !1), e.render(t, n);
	} finally {
		n.projectionMatrix.copy(c), n.projectionMatrixInverse.copy(l), t.overrideMaterial = s, n.layers.mask = o, e.setRenderTarget(a);
	}
}
function yM(e, t, n, r) {
	e.setRenderTarget(t), e.render(n, r);
}
function bM(e) {
	e.material.dispose(), e.quad.geometry.dispose();
}
function xM(e, t, n) {
	let r = t.depth, i = t.blur;
	!(r != null && r.depthTexture) || !i || (e.aoMap.value = i.texture, e.aoDepth.value = r.depthTexture, n.getDrawingBufferSize(e.aoViewport.value), e.aoActive.value = 1);
}
function SM(e) {
	e.aoActive.value = 0, e.aoMap.value = null, e.aoDepth.value = null;
}
var CM = new et({
	side: 2,
	colorWrite: !1,
	depthWrite: !0,
	depthTest: !0,
	blending: 0,
	polygonOffset: !1,
	toneMapped: !1
}), wM = new Ct(), TM = new Ct(), EM = new Ct();
function DM(e, t) {
	if (e <= 0) return;
	let n = kM * t * NM, r = e * e / (MM * n);
	return Math.min(Math.max(r, e * (1 - AM)), e * (1 - jM));
}
function OM(e) {
	return Math.max(e, .1) * 2;
}
var kM = .1, AM = .98, jM = .5, MM = 2 ** 24, NM = Math.cos(Hn(85));
//#endregion
//#region ../renderer/src/space/Camera.tsx
function PM(e) {
	var t, n, r, i;
	let a = (0, U.c)(67), o = (t = e.minZoom) == null ? UM : t, s = (n = e.maxZoom) == null ? WM : n, c = (r = e.minPitch) == null ? GM : r, l = (i = e.maxPitch) == null ? KM : i, u = e.bounds, d = e.smoothTime, f = e.children, p = xt(LM), m = xt(IM), h = xt(FM), g = Rh(), _ = Sh(), { width: v, height: y, dpr: b } = mh(), x = y * b, S = (0, L.useRef)(1), C;
	a[0] !== g || a[1] !== p ? (C = () => zM(g, p().camera), a[0] = g, a[1] = p, a[2] = C) : C = a[2];
	let w;
	a[3] !== x || a[4] !== C ? (w = dh(x, C), a[3] = x, a[4] = C, a[5] = w) : w = a[5];
	let T = w, E;
	a[6] !== g || a[7] !== p ? (E = () => {
		let e = p().camera;
		vh(e) && (e.fov = ph, e.up.set(0, 0, -1), e.updateProjectionMatrix(), g == null || g.updateCameraUp());
	}, a[6] = g, a[7] = p, a[8] = E) : E = a[8];
	let D;
	a[9] !== h || a[10] !== g || a[11] !== p ? (D = [
		h,
		g,
		p
	], a[9] = h, a[10] = g, a[11] = p, a[12] = D) : D = a[12], (0, L.useLayoutEffect)(E, D);
	let O, k;
	a[13] !== g || a[14] !== d ? (O = () => {
		g && HM(g, d);
	}, k = [g, d], a[13] = g, a[14] = d, a[15] = O, a[16] = k) : (O = a[15], k = a[16]), (0, L.useLayoutEffect)(O, k);
	let A;
	a[17] !== u || a[18] !== g || a[19] !== m || a[20] !== _ ? (A = () => {
		g && (VM(g, u, _), m());
	}, a[17] = u, a[18] = g, a[19] = m, a[20] = _, a[21] = A) : A = a[21];
	let j;
	a[22] !== u || a[23] !== g || a[24] !== b || a[25] !== y || a[26] !== m || a[27] !== _ || a[28] !== v ? (j = [
		u,
		g,
		b,
		y,
		m,
		_,
		v
	], a[22] = u, a[23] = g, a[24] = b, a[25] = y, a[26] = m, a[27] = _, a[28] = v, a[29] = j) : j = a[29], (0, L.useEffect)(A, j);
	let ee, te;
	a[30] !== g || a[31] !== l || a[32] !== c ? (ee = () => {
		g && RM(g, c, l);
	}, te = [
		g,
		l,
		c
	], a[30] = g, a[31] = l, a[32] = c, a[33] = ee, a[34] = te) : (ee = a[33], te = a[34]), (0, L.useLayoutEffect)(ee, te);
	let ne;
	a[35] !== x || a[36] !== g || a[37] !== p || a[38] !== T || a[39] !== m || a[40] !== s || a[41] !== o ? (ne = () => {
		let e = p().camera;
		if (!vh(e)) return;
		let t = fh(x, ph);
		if (t <= 0) return;
		let n = T.zoomFactorToDistance(S.current), r = t / o, i = t / s;
		e.far = OM(r), e.updateProjectionMatrix(), g ? (BM(g, i, r), g.dollyTo(n, !1)) : (e.position.set(0, 0, -n), e.updateMatrixWorld()), m();
	}, a[35] = x, a[36] = g, a[37] = p, a[38] = T, a[39] = m, a[40] = s, a[41] = o, a[42] = ne) : ne = a[42];
	let re;
	a[43] !== x || a[44] !== h || a[45] !== g || a[46] !== p || a[47] !== T || a[48] !== m || a[49] !== s || a[50] !== o ? (re = [
		x,
		h,
		g,
		p,
		T,
		m,
		s,
		o
	], a[43] = x, a[44] = h, a[45] = g, a[46] = p, a[47] = T, a[48] = m, a[49] = s, a[50] = o, a[51] = re) : re = a[51], (0, L.useLayoutEffect)(ne, re);
	let M;
	a[52] !== g || a[53] !== p || a[54] !== T ? (M = () => {
		if (!vh(p().camera) || !g) return;
		let e = function() {
			S.current = T.distanceToZoomFactor(g.distance);
		};
		return g.addEventListener("update", e), () => g.removeEventListener("update", e);
	}, a[52] = g, a[53] = p, a[54] = T, a[55] = M) : M = a[55];
	let ie;
	a[56] !== h || a[57] !== g || a[58] !== p || a[59] !== T ? (ie = [
		h,
		g,
		p,
		T
	], a[56] = h, a[57] = g, a[58] = p, a[59] = T, a[60] = ie) : ie = a[60], (0, L.useEffect)(M, ie);
	let ae;
	a[61] !== g || a[62] !== _ ? (ae = (e) => {
		let t = e.camera;
		if (!vh(t)) return;
		let n = DM(zM(g, e.camera), _.scale);
		n === void 0 || t.near === n || (t.near = n, t.updateProjectionMatrix());
	}, a[61] = g, a[62] = _, a[63] = ae) : ae = a[63], Pt(ae);
	let N;
	return a[64] !== f || a[65] !== T ? (N = /* @__PURE__ */ (0, R.jsx)(lh, {
		value: T,
		children: f
	}), a[64] = f, a[65] = T, a[66] = N) : N = a[66], N;
}
function FM(e) {
	return e.camera.uuid;
}
function IM(e) {
	return e.invalidate;
}
function LM(e) {
	return e.get;
}
function RM(e, t, n) {
	e.minPolarAngle = Hn(t), e.maxPolarAngle = Hn(Math.min(n, 85)), e.polarAngle < e.minPolarAngle ? e.rotatePolarTo(e.minPolarAngle, !1) : e.polarAngle > e.maxPolarAngle && e.rotatePolarTo(e.maxPolarAngle, !1);
}
function zM(e, t) {
	var n;
	return (n = e == null ? void 0 : e.distance) == null ? Math.abs(t.position.z) : n;
}
function BM(e, t, n) {
	e.minDistance = t, e.maxDistance = n;
}
function VM(e, t, n) {
	if (!t) {
		e.setBoundary(void 0);
		return;
	}
	let r = n.planToWorld({
		...t.min,
		z: 0
	}, YM), i = n.planToWorld({
		...t.max,
		z: 0
	}, XM);
	e.setBoundary(JM.set(r, i));
}
function HM(e, t) {
	var n, r, i, a;
	e.smoothTime = {
		dolly: (n = t == null ? void 0 : t.zoomTime) == null ? qM : n,
		truck: (r = t == null ? void 0 : t.panTime) == null ? qM : r,
		rotateAzimuth: (i = t == null ? void 0 : t.rollTime) == null ? qM : i,
		rotatePolar: (a = t == null ? void 0 : t.pitchTime) == null ? qM : a
	};
}
var UM = .1, WM = 35, GM = 0, KM = 85, qM = .25, JM = new Ve(), YM = new I(), XM = new I();
//#endregion
//#region ../renderer/src/space/VisibleRect.tsx
function ZM(e) {
	let t = (0, U.c)(16), { rect: n, viewbox: r } = e, i = xt($M), a = xt(QM), o = Rh(), { width: s, height: c, dpr: l } = mh(), u;
	t[0] !== l || t[1] !== c || t[2] !== n || t[3] !== r || t[4] !== s ? (u = eN(n, r, s, c, l), t[0] = l, t[1] = c, t[2] = n, t[3] = r, t[4] = s, t[5] = u) : u = t[5];
	let d = u, f = n.center.x, p = n.center.y, m, h;
	return t[6] !== a || t[7] !== f || t[8] !== p || t[9] !== o || t[10] !== c || t[11] !== i || t[12] !== d || t[13] !== s ? (m = () => {
		if (vh(a) && !(s <= 0 || c <= 0) && !(d === 1 && f === s / 2 && p === c / 2)) return tN(a, o, d, f, p, s, c), i(), () => {
			a.clearViewOffset(), o == null || o.setViewport(null, 0, 0, 0), i();
		};
	}, h = [
		d,
		f,
		p,
		s,
		c,
		a,
		o,
		i
	], t[6] = a, t[7] = f, t[8] = p, t[9] = o, t[10] = c, t[11] = i, t[12] = d, t[13] = s, t[14] = m, t[15] = h) : (m = t[14], h = t[15]), (0, L.useLayoutEffect)(m, h), null;
}
function QM(e) {
	return e.camera;
}
function $M(e) {
	return e.invalidate;
}
function eN(e, t, n, r, i) {
	let a = wh(t, n * i, r * i), o = t.size.width * a, s = t.size.height * a;
	return !(o > 0) || !(s > 0) ? 1 : Math.min(e.size.width * i / o, e.size.height * i / s, 1);
}
function tN(e, t, n, r, i, a, o) {
	let s = n * a, c = n * o;
	e.setViewOffset(s, c, s / 2 - r, c / 2 - i, a, o), t == null || t.setViewport(r - s / 2, o - c / 2 - i, s, c);
}
//#endregion
//#region ../renderer/src/space/Scene.tsx
var nN = Xm("scene");
function rN(e) {
	let t = (0, U.c)(27), n, r, i, a, o, s, c;
	t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], o = t[5], s = t[6], c = t[7]) : ({sceneDef: s, memoryLimit: o, lighting: a, visibleRect: c, external: i, children: r, ...n} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = o, t[6] = s, t[7] = c);
	let { viewbox: l, staticTransform: u } = s, d, f;
	t[8] !== u || t[9] !== c ? (d = () => {
		c && u && nN.warn("visibleRect is ignored for a scene with a staticTransform");
	}, f = [c, u], t[8] = u, t[9] = c, t[10] = d, t[11] = f) : (d = t[10], f = t[11]), (0, L.useEffect)(d, f);
	let p;
	t[12] !== r || t[13] !== a || t[14] !== o || t[15] !== s ? (p = /* @__PURE__ */ (0, R.jsx)(aN, {
		sceneDef: s,
		memoryLimit: o,
		lighting: a,
		children: r
	}), t[12] = r, t[13] = a, t[14] = o, t[15] = s, t[16] = p) : p = t[16];
	let m = p, h;
	t[17] !== n || t[18] !== i || t[19] !== m || t[20] !== u || t[21] !== l || t[22] !== c ? (h = i ? m : /* @__PURE__ */ (0, R.jsxs)(PM, {
		...n,
		children: [c && !u && /* @__PURE__ */ (0, R.jsx)(ZM, {
			rect: c,
			viewbox: l
		}), m]
	}), t[17] = n, t[18] = i, t[19] = m, t[20] = u, t[21] = l, t[22] = c, t[23] = h) : h = t[23];
	let g;
	return t[24] !== s || t[25] !== h ? (g = /* @__PURE__ */ (0, R.jsx)(iN, {
		sceneDef: s,
		children: h
	}), t[24] = s, t[25] = h, t[26] = g) : g = t[26], g;
}
function iN(e) {
	let t = (0, U.c)(9), { sceneDef: n, children: r } = e, { viewbox: i, staticTransform: a } = n, { width: o, height: s, dpr: c } = mh(), l;
	t[0] !== c || t[1] !== s || t[2] !== a || t[3] !== i || t[4] !== o ? (l = () => new Ch({
		viewbox: i,
		width: o,
		height: s,
		dpr: c,
		staticTransform: a
	}), t[0] = c, t[1] = s, t[2] = a, t[3] = i, t[4] = o, t[5] = l) : l = t[5];
	let [u] = (0, L.useState)(l), d;
	return t[6] !== r || t[7] !== u ? (d = /* @__PURE__ */ (0, R.jsx)(Th, {
		value: u,
		children: r
	}), t[6] = r, t[7] = u, t[8] = d) : d = t[8], d;
}
function aN(e) {
	let t = (0, U.c)(44), { sceneDef: n, memoryLimit: r, lighting: i, children: a } = e, { viewbox: o, staticTransform: s, rootLayer: c } = n, { width: l, height: u, dpr: d } = mh(), f = xt(oN), p = Sh(), [m] = (0, L.useState)(_j), h;
	t[0] === r ? h = t[1] : (h = () => new Zb(r), t[0] = r, t[1] = h);
	let [g] = (0, L.useState)(h), _;
	t[2] === p.matrixInverse ? _ = t[3] : (_ = () => {
		let e = Fb();
		return e.planFromWorld.value = p.matrixInverse, e;
	}, t[2] = p.matrixInverse, t[3] = _);
	let [v] = (0, L.useState)(_), y = (0, L.useRef)(null), b, x;
	t[4] !== d || t[5] !== u || t[6] !== f || t[7] !== p || t[8] !== s || t[9] !== o || t[10] !== l ? (b = () => {
		p.refit({
			viewbox: o,
			width: l,
			height: u,
			dpr: d,
			staticTransform: s
		});
		let e = y.current;
		e && (e.matrix.copy(p.matrix), e.matrixWorldNeedsUpdate = !0), f();
	}, x = [
		p,
		o,
		l,
		u,
		d,
		s,
		f
	], t[4] = d, t[5] = u, t[6] = f, t[7] = p, t[8] = s, t[9] = o, t[10] = l, t[11] = b, t[12] = x) : (b = t[11], x = t[12]), (0, L.useLayoutEffect)(b, x);
	let S, C;
	t[13] !== g || t[14] !== r ? (S = () => {
		g.setMemoryLimit(r), r || nN.debug("no memory limit set, image atlases upload at full size");
	}, C = [g, r], t[13] = g, t[14] = r, t[15] = S, t[16] = C) : (S = t[15], C = t[16]), (0, L.useEffect)(S, C);
	let w, T;
	t[17] === n ? (w = t[18], T = t[19]) : (w = () => {
		Zm(n, nN.debug);
	}, T = [n], t[17] = n, t[18] = w, t[19] = T), (0, L.useEffect)(w, T);
	let E;
	t[20] === n.background ? E = t[21] : (E = n.background !== void 0 && /* @__PURE__ */ (0, R.jsx)(Hb, { color: n.background }), t[20] = n.background, t[21] = E);
	let D;
	t[22] !== c || t[23] !== E ? (D = /* @__PURE__ */ (0, R.jsx)(Mj, {
		layer: c,
		children: E
	}), t[22] = c, t[23] = E, t[24] = D) : D = t[24];
	let O;
	t[25] !== m || t[26] !== D ? (O = /* @__PURE__ */ (0, R.jsx)(bj, {
		value: m,
		children: D
	}), t[25] = m, t[26] = D, t[27] = O) : O = t[27];
	let k;
	t[28] !== g || t[29] !== O ? (k = /* @__PURE__ */ (0, R.jsx)(Qb, {
		value: g,
		children: O
	}), t[28] = g, t[29] = O, t[30] = k) : k = t[30];
	let A;
	t[31] === i ? A = t[32] : (A = /* @__PURE__ */ (0, R.jsx)(Hj, { ...i }), t[31] = i, t[32] = A);
	let j;
	t[33] !== p.matrix || t[34] !== k || t[35] !== A ? (j = /* @__PURE__ */ (0, R.jsxs)("group", {
		name: "world",
		ref: y,
		matrixAutoUpdate: !1,
		matrix: p.matrix,
		children: [k, A]
	}), t[33] = p.matrix, t[34] = k, t[35] = A, t[36] = j) : j = t[36];
	let ee;
	t[37] === Symbol.for("react.memo_cache_sentinel") ? (ee = /* @__PURE__ */ (0, R.jsx)(pM, {}), t[37] = ee) : ee = t[37];
	let te;
	t[38] !== a || t[39] !== j ? (te = /* @__PURE__ */ (0, R.jsxs)(gy, { children: [
		j,
		ee,
		a
	] }), t[38] = a, t[39] = j, t[40] = te) : te = t[40];
	let ne;
	return t[41] !== v || t[42] !== te ? (ne = /* @__PURE__ */ (0, R.jsx)(Lb, {
		value: v,
		children: te
	}), t[41] = v, t[42] = te, t[43] = ne) : ne = t[43], ne;
}
function oN(e) {
	return e.invalidate;
}
//#endregion
//#region ../renderer/src/Renderer.tsx
var sN = Xm("renderer");
function cN(e) {
	let t = (0, U.c)(59), n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y;
	t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], o = t[5], s = t[6], c = t[7], l = t[8], u = t[9], d = t[10], f = t[11], p = t[12], m = t[13], h = t[14], g = t[15], _ = t[16], v = t[17], y = t[18]) : ({debug: o, scene: _, memoryLimit: d, minZoom: p, maxZoom: u, minPitch: f, maxPitch: l, bounds: n, smoothTime: v, controls: a, lighting: c, visibleRect: y, onPointerMissed: h, gl: s, requestFrame: g, onFrame: m, children: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = o, t[6] = s, t[7] = c, t[8] = l, t[9] = u, t[10] = d, t[11] = f, t[12] = p, t[13] = m, t[14] = h, t[15] = g, t[16] = _, t[17] = v, t[18] = y);
	let b;
	t[19] !== n || t[20] !== l || t[21] !== u || t[22] !== f || t[23] !== p || t[24] !== v ? (b = {
		minZoom: p,
		maxZoom: u,
		minPitch: f,
		maxPitch: l,
		bounds: n,
		smoothTime: v
	}, t[19] = n, t[20] = l, t[21] = u, t[22] = f, t[23] = p, t[24] = v, t[25] = b) : b = t[25];
	let x = b, S = s !== void 0, C;
	t[26] !== a || t[27] !== S ? (C = !S && /* @__PURE__ */ (0, R.jsx)(vv, { config: a }), t[26] = a, t[27] = S, t[28] = C) : C = t[28];
	let w;
	t[29] === h ? w = t[30] : (w = /* @__PURE__ */ (0, R.jsx)(Iv, { onPointerMissed: h }), t[29] = h, t[30] = w);
	let T;
	t[31] !== x || t[32] !== i || t[33] !== S || t[34] !== c || t[35] !== d || t[36] !== _ || t[37] !== C || t[38] !== w || t[39] !== y ? (T = /* @__PURE__ */ (0, R.jsxs)(rN, {
		sceneDef: _,
		external: S,
		memoryLimit: d,
		lighting: c,
		visibleRect: y,
		...x,
		children: [
			C,
			w,
			i
		]
	}), t[31] = x, t[32] = i, t[33] = S, t[34] = c, t[35] = d, t[36] = _, t[37] = C, t[38] = w, t[39] = y, t[40] = T) : T = t[40];
	let E;
	t[41] !== o || t[42] !== T ? (E = /* @__PURE__ */ (0, R.jsx)(Ev, {
		enabled: o,
		children: T
	}), t[41] = o, t[42] = T, t[43] = E) : E = t[43];
	let D = E;
	if (s) {
		if (!g || !m) return sN.error("external mode needs requestFrame and onFrame alongside gl; nothing will render"), null;
		let e;
		return t[44] !== s || t[45] !== m || t[46] !== g || t[47] !== D ? (e = /* @__PURE__ */ (0, R.jsx)(ey, {
			gl: s,
			requestFrame: g,
			onFrame: m,
			children: D
		}), t[44] = s, t[45] = m, t[46] = g, t[47] = D, t[48] = e) : e = t[48], e;
	}
	let O;
	t[49] === Symbol.for("react.memo_cache_sentinel") ? (O = { stencil: !0 }, t[49] = O) : O = t[49];
	let k;
	t[50] === o ? k = t[51] : (k = (e) => {
		var t;
		e.gl.debug.checkShaderErrors = (t = o) != null && t;
	}, t[50] = o, t[51] = k);
	let A = o ? "always" : "demand", j;
	t[52] === Symbol.for("react.memo_cache_sentinel") ? (j = { debounce: 50 }, t[52] = j) : j = t[52];
	let ee;
	return t[53] !== r || t[54] !== o || t[55] !== k || t[56] !== A || t[57] !== D ? (ee = /* @__PURE__ */ (0, R.jsx)(L.StrictMode, { children: /* @__PURE__ */ (0, R.jsx)(L.Suspense, {
		fallback: null,
		children: /* @__PURE__ */ (0, R.jsx)(Tv, {
			...r,
			debugEnabled: o,
			flat: !0,
			gl: O,
			onCreated: k,
			frameloop: A,
			resize: j,
			children: D
		})
	}) }), t[53] = r, t[54] = o, t[55] = k, t[56] = A, t[57] = D, t[58] = ee) : ee = t[58], ee;
}
//#endregion
//#region ../renderer/src/space/viewport.ts
function lN() {
	let e = (0, U.c)(3), t = xt(uN), n = Sh(), r;
	return e[0] !== t || e[1] !== n ? (r = new dN({
		get: t,
		space: n
	}), e[0] = t, e[1] = n, e[2] = r) : r = e[2], r;
}
function uN(e) {
	return e.get;
}
var dN = class {
	constructor(e) {
		this.context = e;
	}
	canvasToPlan(e, t) {
		let { space: n, get: r } = this.context;
		return n.canvasToPlan(e, r().camera, t);
	}
	planToCanvas(e, t) {
		let { space: n, get: r } = this.context;
		return n.planToCanvas(e, r().camera, t);
	}
	isVisible(e) {
		let { space: t, get: n } = this.context, r = t.planToNdc(e, n().camera, fN);
		return !!r && Math.abs(r.x) <= 1 && Math.abs(r.y) <= 1;
	}
}, fN = new gt();
//#endregion
//#region src/engine/update-def.ts
function pN(e, t, n) {
	let r = !1;
	return e.forEach((e, i) => {
		let a = 0;
		n[i].forEach(({ value: e, scaleFactor: n }) => {
			t < n && (a = e);
		}), e.fontSize !== a * t && (r = !0), e.fontSize = a * t;
	}), r;
}
function mN(e, t) {
	let { center: n, size: r, rotation: i, elevation: a } = e.bounds, o = t % 2 != 0;
	return e.bounds.set(n.x, n.y, o ? r.y : r.x, o ? r.x : r.y, i + t * Math.PI / 2, a), e;
}
function hN(e, t) {
	let { size: n, center: r, rotation: i, elevation: a } = e;
	return new mr(r, t % 2 == 0 ? n : {
		x: n.y,
		y: n.x
	}, i + t * Math.PI / 2, a);
}
function gN(e, t) {
	if (!Number.isFinite(e) || !Number.isFinite(t)) return 0;
	let n = Kn(e, t);
	return Math.abs(n) <= Math.PI / 4 ? 0 : Math.round(n / (Math.PI / 2));
}
function _N(e, t) {
	let n = Kn(e, t), r = Math.PI / 2;
	return Math.abs(n) > r + .1;
}
function vN(e) {
	return (e + Math.PI + Math.PI) % (2 * Math.PI) - Math.PI;
}
function yN(e, t, n, r) {
	let i = t.width, a = t.height, o = e.size, s = e.center, c = e.rotation, l = o.x / i, u = o.x - n * 2, d = (o.y - n * 2) * .8, f = u / i, p = d / a;
	r = Math.min(Math.max(r, 0), Math.min(f, p, l));
	let m = i * r, h = a * r, g = Math.sin(c), _ = Math.cos(c), v = o.x / 2 - n, y = -o.y / 2 + n, b = s.x + v * _ - y * g, x = s.y + v * g + y * _, S = m / 2, C = -h / 2, w = S * _ - C * g, T = S * g + C * _;
	return pf(b - w, x - T, i, a, r, c, e.elevation);
}
function bN(e) {
	if (!e) return !1;
	if (!Number.isInteger(+e) || +e != 1 && +e != 0) throw Error("Map roll: setting value is incorrect");
	return !!+e;
}
//#endregion
//#region src/engine/utils/rotation.ts
function xN(e, t) {
	var n, r;
	if (!t) return !1;
	let i = Math.cos((n = t.rotation) == null ? 0 : n), a = Math.sin((r = t.rotation) == null ? 0 : r), o = t.size.x / 2, s = t.size.y / 2;
	return SN(e, e.rotation + Math.PI / 2).every((e) => {
		let n = e.x - t.center.x, r = e.y - t.center.y, c = n * i + r * a, l = r * i - n * a;
		return Math.abs(c) <= o && Math.abs(l) <= s;
	});
}
function SN(e, t = e.rotation) {
	let n = e.size.x / 2, r = e.size.y / 2, i = Math.sin(t), a = Math.cos(t), o = e.center.x, s = e.center.y;
	return [
		{
			x: -n,
			y: -r
		},
		{
			x: n,
			y: -r
		},
		{
			x: n,
			y: r
		},
		{
			x: -n,
			y: r
		}
	].map((e) => ({
		x: o + e.x * a - e.y * i,
		y: s + e.x * i + e.y * a
	}));
}
function CN(e, t) {
	let n = e.bounds;
	return _N(t, n.rotation) ? (n.rotate(vN(n.rotation) - n.rotation, n), !0) : !1;
}
function wN(e) {
	return e.onRoll = ({ roll: t }) => TN(e, t) ? [e] : void 0, e;
}
function TN(e, t) {
	let n = e.bounds, r = gN(t, n.rotation);
	return r === 0 ? !1 : (n.rotate(r * Math.PI / 2, n), !0);
}
//#endregion
//#region src/utils/is-mobile.ts
var EN = /Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/i.test(navigator.userAgent), DN = EN || pe, ON = DN ? 8 : 512, kN = DN ? 100 : 0;
async function AN(e, t) {
	return (e.preferred ? await t(e.preferred) : null) || (e.fallback ? t(e.fallback) : null);
}
async function jN(e, t, n, r) {
	if (!e.size) return /* @__PURE__ */ new Map();
	let i = Array.from(e.entries()), a = /* @__PURE__ */ new Map();
	for (let e = 0; e < i.length; e += n) {
		let o = i.slice(e, e + n), s = await Promise.all(o.map(async ([e, n]) => [e, await AN(n, t)]));
		for (let [e, t] of s) t && a.set(e, t);
		r && await new Promise((e) => setTimeout(e, r));
	}
	return a;
}
async function MN(e, t = ON, n = kN) {
	return jN(e, fe, t, n);
}
async function NN(e, t = ON, n = kN) {
	let r = /* @__PURE__ */ new Map();
	return jN(e, (e) => {
		let t = r.get(e);
		return t || (t = Ef(e), r.set(e, t)), t;
	}, t, n);
}
//#endregion
//#region src/components/Maplibre/utils/poi-marker-hit-test.ts
var PN = null, FN = {
	set(e) {
		PN = e;
	},
	test(e, t) {
		return PN ? PN(e, t) : !1;
	}
}, IN = [], LN = /* @__PURE__ */ new Map(), RN = null, zN = [];
function BN() {
	let e = Jq.booths.filter((e) => e.visible && e.rect && e.rect.size.width > 0 && e.rect.size.height > 0);
	if (IN = [], RN = null, LN = /* @__PURE__ */ new Map(), zN = e.filter((e) => e.paths), !e.length) return;
	let t = [], n = Infinity, r = Infinity, i = -Infinity, a = -Infinity;
	for (let o of e) {
		let e = o.rotate ? new mr(o.rect.center, o.rect.size, o.rotate) : null, s = e ? e.bounds : o.rect;
		t.push({
			booth: o,
			shape: e == null ? o.rect : e,
			bounds: s
		}), s.min.x < n && (n = s.min.x), s.min.y < r && (r = s.min.y), s.max.x > i && (i = s.max.x), s.max.y > a && (a = s.max.y);
	}
	let o = Er.fromMinMax({
		x: n,
		y: r
	}, {
		x: i,
		y: a
	}), s = Math.ceil(o.size.width / 2), c = Math.ceil(o.size.height / 2);
	for (let e = 0; e < 2; e++) for (let n = 0; n < 2; n++) {
		let r = new Er(o.min.x + e * s, o.min.y + n * c, s, c);
		IN.push(r), LN.set(r, t.filter((e) => r.intersects(e.bounds)));
	}
	P.log("hover segmentToHitAreas", LN);
}
function VN() {
	return N(() => [
		Jq.booths,
		Yq.loaded,
		Yq.visible
	], () => BN(), { fireImmediately: !0 });
}
function HN(e, t) {
	let n = {
		x: e,
		y: t
	}, r;
	r = RN && RN.containsPoint(n) ? RN : IN.find((e) => e.containsPoint(n)), r && (RN = r);
	let i = r ? LN.get(r) : void 0;
	if (i) {
		let e = i.filter((e) => e.booth.visible && e.shape.containsPoint(n));
		if (e.length) return (e.length > 1 ? e.sort((e, t) => e.booth.rect.area - t.booth.rect.area)[0] : e[0]).booth;
	}
	for (let e of zN) if (e.visible) for (let t of e.paths) for (let r of Ao(t.index, Yq.mode === $F.Default ? "" : e.layer.name)) {
		let t = r.map((e) => ({
			x: e[0],
			y: e[1]
		}));
		if (lr.fromConvexRing(t).containsPoint(n)) return e;
	}
	return null;
}
function UN(e, t) {
	return HN(e, t);
}
//#endregion
//#region src/components/Map/pointer.ts
function WN(e) {
	rP = e;
}
function GN(e) {
	nP = e;
}
function KN(e, t) {
	for (let n of t) tP.set(n, e);
}
function qN(e) {
	var t;
	return (t = tP.get(e)) == null ? null : t;
}
function JN(e) {
	$.setKioskModeEnabled || ($.hoveredBooth = QN(e.point, e.def));
}
function YN() {
	$.setKioskModeEnabled || ($.hoveredBooth = null);
}
function XN(e) {
	$N(e.point) && Q.clickBooth(QN(e.point, e.def));
}
function ZN(e) {
	$N(e.point) && Q.clickBooth(QN(e.point));
}
function QN(e, t) {
	return (t ? qN(t) : null) || UN(e.x, e.y);
}
function $N(e) {
	if (!$.rootElement) return !1;
	if (eP(), rP == null || rP(e), $.overlayPosition === "bottom" && $.overlaySize === "full" && Q.showMap(), $.onGetCoordsClick) {
		let t = Q.layerStore.layers.find((e) => e.visible && (e.mode === eI.TurnedOn || e.mode === eI.TurnedOff));
		$.onGetCoordsClick({
			x: e.x,
			y: e.y,
			z: (t == null ? void 0 : t.name) || null
		});
	}
	if ($.setKioskModeEnabled || FN.test(e.x, e.y)) return !1;
	if ($.onMarkerClick) {
		var t;
		let n = (t = nP == null ? void 0 : nP(e.x, e.y)) == null ? null : t;
		$.onMarkerClick(n);
	}
	return !0;
}
function eP() {
	if (typeof window > "u") return;
	let e = window.__resett;
	e == null || e();
}
var tP = /* @__PURE__ */ new WeakMap(), nP, rP;
//#endregion
//#region src/utils/blob-image-size.ts
async function iP(e) {
	try {
		let t = await createImageBitmap(e), n = {
			width: t.width,
			height: t.height
		};
		return t.close(), n;
	} catch {
		return null;
	}
}
//#endregion
//#region src/components/Map/drawing/config/booth-logos.ts
function aP(e) {
	return e.exhibitors.find((e) => e.logoInBooth && e.logo);
}
function oP(e) {
	var t;
	let n = (t = aP(e)) == null ? void 0 : t.logoAspectRatio;
	return typeof n == "number" && Number.isFinite(n) && n > 0 ? n : void 0;
}
function sP() {
	let e = /* @__PURE__ */ new Map(), t = (t) => {
		let n = e.get(t);
		return n || (n = cP(t), e.set(t, n)), n;
	}, n = /* @__PURE__ */ new Map(), r = (e) => {
		let t = n.get(e);
		return t || (t = lP(e), n.set(e, t)), t;
	};
	return async (e, n) => {
		var i;
		let a = await t(n);
		if (!a) return null;
		let o = (i = oP(e)) == null ? await r(a) : i;
		return o === null ? null : {
			blob: a,
			aspectRatio: o
		};
	};
}
async function cP(e) {
	return Df(e) ? kf(e) : e;
}
async function lP(e) {
	let t = await iP(e);
	return t != null && t.height ? t.width / t.height : null;
}
//#endregion
//#region ../../node_modules/.pnpm/color-parse@1.4.3/node_modules/color-parse/index.js
var uP = /* @__PURE__ */ t(((e, t) => {
	var n = Zr();
	t.exports = i;
	var r = {
		red: 0,
		orange: 60,
		yellow: 120,
		green: 180,
		blue: 240,
		purple: 300
	};
	function i(e) {
		var t, i = [], a = 1, o;
		if (typeof e == "string") if (e = e.toLowerCase(), n[e]) i = n[e].slice(), o = "rgb";
		else if (e === "transparent") a = 0, o = "rgb", i = [
			0,
			0,
			0
		];
		else if (/^#[A-Fa-f0-9]+$/.test(e)) {
			var s = e.slice(1), c = s.length, l = c <= 4;
			a = 1, l ? (i = [
				parseInt(s[0] + s[0], 16),
				parseInt(s[1] + s[1], 16),
				parseInt(s[2] + s[2], 16)
			], c === 4 && (a = parseInt(s[3] + s[3], 16) / 255)) : (i = [
				parseInt(s[0] + s[1], 16),
				parseInt(s[2] + s[3], 16),
				parseInt(s[4] + s[5], 16)
			], c === 8 && (a = parseInt(s[6] + s[7], 16) / 255)), i[0] || (i[0] = 0), i[1] || (i[1] = 0), i[2] || (i[2] = 0), o = "rgb";
		} else if (t = /^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(e)) {
			var u = t[1], d = u === "rgb", s = u.replace(/a$/, "");
			o = s;
			var c = s === "cmyk" ? 4 : s === "gray" ? 1 : 3;
			i = t[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(e, t) {
				if (/%$/.test(e)) return t === c ? parseFloat(e) / 100 : s === "rgb" ? parseFloat(e) * 255 / 100 : parseFloat(e);
				if (s[t] === "h") {
					if (/deg$/.test(e)) return parseFloat(e);
					if (r[e] !== void 0) return r[e];
				}
				return parseFloat(e);
			}), u === s && i.push(1), a = d || i[c] === void 0 ? 1 : i[c], i = i.slice(0, c);
		} else e.length > 10 && /[0-9](?:\s|\/)/.test(e) && (i = e.match(/([0-9]+)/g).map(function(e) {
			return parseFloat(e);
		}), o = e.match(/([a-z])/gi).join("").toLowerCase());
		else isNaN(e) ? Array.isArray(e) || e.length ? (i = [
			e[0],
			e[1],
			e[2]
		], o = "rgb", a = e.length === 4 ? e[3] : 1) : e instanceof Object && (e.r != null || e.red != null || e.R != null ? (o = "rgb", i = [
			e.r || e.red || e.R || 0,
			e.g || e.green || e.G || 0,
			e.b || e.blue || e.B || 0
		]) : (o = "hsl", i = [
			e.h || e.hue || e.H || 0,
			e.s || e.saturation || e.S || 0,
			e.l || e.lightness || e.L || e.b || e.brightness
		]), a = e.a || e.alpha || e.opacity || 1, e.opacity != null && (a /= 100)) : (o = "rgb", i = [
			e >>> 16,
			(e & 65280) >>> 8,
			e & 255
		]);
		return {
			space: o,
			values: i,
			alpha: a
		};
	}
})), dP = /* @__PURE__ */ t(((e, t) => {
	t.exports = {
		name: "rgb",
		min: [
			0,
			0,
			0
		],
		max: [
			255,
			255,
			255
		],
		channel: [
			"red",
			"green",
			"blue"
		],
		alias: ["RGB"]
	};
})), fP = /* @__PURE__ */ t(((e, t) => {
	var n = dP();
	t.exports = {
		name: "hsl",
		min: [
			0,
			0,
			0
		],
		max: [
			360,
			100,
			100
		],
		channel: [
			"hue",
			"saturation",
			"lightness"
		],
		alias: ["HSL"],
		rgb: function(e) {
			var t = e[0] / 360, n = e[1] / 100, r = e[2] / 100, i, a, o, s, c;
			if (n === 0) return c = r * 255, [
				c,
				c,
				c
			];
			a = r < .5 ? r * (1 + n) : r + n - r * n, i = 2 * r - a, s = [
				0,
				0,
				0
			];
			for (var l = 0; l < 3; l++) o = t + 1 / 3 * -(l - 1), o < 0 ? o++ : o > 1 && o--, c = 6 * o < 1 ? i + (a - i) * 6 * o : 2 * o < 1 ? a : 3 * o < 2 ? i + (a - i) * (2 / 3 - o) * 6 : i, s[l] = c * 255;
			return s;
		}
	}, n.hsl = function(e) {
		var t = e[0] / 255, n = e[1] / 255, r = e[2] / 255, i = Math.min(t, n, r), a = Math.max(t, n, r), o = a - i, s, c, l;
		return a === i ? s = 0 : t === a ? s = (n - r) / o : n === a ? s = 2 + (r - t) / o : r === a && (s = 4 + (t - n) / o), s = Math.min(s * 60, 360), s < 0 && (s += 360), l = (i + a) / 2, c = a === i ? 0 : l <= .5 ? o / (a + i) : o / (2 - a - i), [
			s,
			c * 100,
			l * 100
		];
	};
})), pP = /* @__PURE__ */ t(((e, t) => {
	var n = uP(), r = fP();
	function i(e, t, n) {
		return t < n ? e < t ? t : e > n ? n : e : e < n ? n : e > t ? t : e;
	}
	function a(e, t, n) {
		return e * (1 - n) + t * n;
	}
	t.exports = o;
	function o(e) {
		return e = e.map(function(e) {
			if (e = n(e), e.space != "rgb") {
				if (e.space != "hsl") throw "c.spacespace is not supported.";
				e.values = r.rgb(e.values);
			}
			return e.values.push(e.alpha), e.values;
		}), function(t, n) {
			n = n || a, t = i(t, 0, 1);
			var r = (e.length - 1) * t, o = Math.floor(r), s = Math.ceil(r);
			t = r - o;
			var c = e[o], l = e[s], u = c.map(function(e, r) {
				return e = n(e, l[r], t), r < 3 && (e = Math.round(e)), e;
			});
			return u[3] === 1 ? "rgb(" + u.slice(0, 3) + ")" : "rgba(" + u + ")";
		};
	}
})), mP = {
	[Oc.Unasked]: {
		iconName: "icon-question-mark",
		color: {
			primary: "#8E99AB",
			secondary: "#EAEFF9"
		}
	},
	[Oc.Accepted]: {
		iconName: "icon-checkmark",
		color: {
			primary: "#32B175",
			secondary: "#E4FFF2"
		}
	},
	[Oc.Rejected]: {
		iconName: "icon-close",
		color: {
			primary: "#E1463C",
			secondary: "#FFEDEB"
		}
	},
	[Oc.Undecided]: {
		iconName: "icon-switch-horizontal",
		color: {
			primary: "#FABA27",
			secondary: "#FFF7E5"
		}
	}
}, hP, gP;
function _P(e, t, n, r) {
	n && Object.defineProperty(e, t, {
		enumerable: n.enumerable,
		configurable: n.configurable,
		writable: n.writable,
		value: n.initializer ? n.initializer.call(r) : void 0
	});
}
function vP(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var yP = /* @__PURE__ */ new Map(), bP = (hP = class e {
	constructor(e) {
		this.booth = void 0, _P(this, "selectBgAnimationPart", gP, this), this.booth = e, xP(() => e.selected, (e) => this.selectBgAnimationPart = Yd(e), 1e3, 8, !0);
	}
	static get(t) {
		let n = yP.get(t);
		return n || (n = new e(t), yP.set(t, n)), n;
	}
}, gP = vP(hP.prototype, "selectBgAnimationPart", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: null
}), hP);
function xP(e, t, n, r, i) {
	let a = i ? s : o;
	r % 2 == 1 && r++, N(e, () => {
		if (e()) {
			let i = performance.now(), o = i + r * n, s = () => {
				if (e()) {
					if (performance.now() >= o) {
						t(1);
						return;
					}
					t(a(i, n)), window.requestAnimationFrame(s);
				}
			};
			s();
		} else t(0);
	}, { fireImmediately: !0 });
	function o(e, t) {
		return (performance.now() - e) % t / 1e3;
	}
	function s(e, t) {
		let n = ((performance.now() - e) % (t * 2) - t) / 1e3;
		return 1 - Math.abs(Math.abs(n) - t / 1e3) / (t / 1e3);
	}
}
//#endregion
//#region src/components/Map/drawing/config/BoothDrawerBase.ts
var SP = class {
	constructor(e) {
		this.booth = void 0, this.boothShape = void 0, this.booth = e, this.boothShape = bP.get(e);
	}
}, CP = /* @__PURE__ */ e(pP(), 1), wP, TP, EP;
function DP(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
function OP(e) {
	return new jP(e);
}
function kP(e) {
	if (e.length === 0) return null;
	let t = e[0];
	return e.every((e) => e === t) ? t : null;
}
function AP(e, t) {
	let n = [];
	for (let r of e) {
		let e = Pf({
			index: r.index,
			color: r.color,
			unblinking: r.unblinking
		}, t);
		e && n.push(e);
	}
	return n;
}
var jP = (wP = j({ keepAlive: !0 }), TP = j({ keepAlive: !0 }), EP = class extends SP {
	constructor(e) {
		if (super(e), e.paths) e.shapes = AP(e.paths, Q.layerStore.mode === $F.Default ? "" : e.layer.name).map((e) => {
			let t = $.monochrome ? (0, ks.default)(e.color).grayscale().rgb().string() : this.getBoothColor().string();
			return e.color === "transparent" ? e.color = t : e.defaultColor = e.color, e;
		});
		else {
			let t = e.borderColor === "none" ? 0 : isNaN(e.borderWidth) ? Jq.borderWidth : e.borderWidth, n = this.booth.rect.expand(-t / 2), r = this.getBoothColor().string();
			e.shapes = [yf(new mr(n.center, n.size, this.booth.rotate, this.booth.elevation), r)];
		}
		N(() => this.booth.hover, () => !this.booth.selected && this.update()), N(() => [
			Yq.layersLoaded,
			this.booth.skipDim,
			this.booth.selected,
			this.boothShape.selectBgAnimationPart
		], () => this.update());
	}
	getShape() {
		return this.booth.shapes;
	}
	update() {
		if (Yq.layersLoaded) for (let e of this.booth.shapes) e.dim = this.booth.skipDim ? 0 : void 0, e.color && !e.unblinking && (e.color = (e.defaultColor ? this.getBoothPathColor(e.defaultColor) : this.getBoothColor()).string()), zm(e);
	}
	get poiHighlighted() {
		let e = this.booth;
		return !e.selected && e.poiTypeId != null && e.skipDim;
	}
	getBoothPathColor(e) {
		if ($.heatmap) return this.getHeatmapColor();
		let t = this.booth, n = vo.colors.booths.selected, r = (0, ks.default)(this.poiHighlighted ? n : e).hsl();
		if (t.selected) {
			var i;
			if ((i = oo().__fpSettings) != null && i.fpVer) {
				let e = this.selectedColorInterpolateFunc(this.boothShape.selectBgAnimationPart), t = (0, ks.default)(e === "none" ? n : e);
				return $.monochrome ? t.grayscale() : t;
			}
			let e = (0, ks.default)(n).hsl(), t = e.lightness() * this.boothShape.selectBgAnimationPart;
			r = r.hue(e.hue()).lightness(t);
		} else t.hover && (r = r.darken(.1));
		return $.monochrome && (r = r.grayscale()), r;
	}
	getHeatmapColor() {
		let e = this.booth, t = Xq.getHeatmapColorForBooth(e);
		if (e.selected) {
			let e = this.selectedColorInterpolateFunc(this.boothShape.selectBgAnimationPart);
			return (0, ks.default)(e === "none" ? "#f33" : e);
		}
		return e.hover ? t.darken(.2).alpha(t.alpha() * 1.5) : t;
	}
	get defaultColor() {
		let e = this.booth, t = vo.colors.booths.default;
		if (e instanceof Os) t = e.color || vo.colors.booths.empty;
		else if (e instanceof Ds) {
			if (z.isRebooking) {
				var n, r;
				if (!((n = e.exhibitors) != null && n.length)) return mP[Oc.Unasked].color.primary;
				let t = kP(((r = e.exhibitors) == null ? [] : r).map((e) => e.rebookingState));
				return t === null ? "#000000" : mP[t].color.primary;
			}
			let i = vo.colors.booths;
			t = e.onHold ? e.holdColor || i.defaultHold : e.exhibitors.length || e.reserved ? e.soldColor || i.defaultSold : e.availColor || i.empty;
		}
		try {
			t === "none" && (t = vo.colors.booths.default), (0, ks.default)(t);
		} catch (e) {
			t = vo.colors.booths.default, console.error("Booth: defaultColor", e);
		}
		return t;
	}
	get selectedColorInterpolateFunc() {
		var e, t;
		return (0, CP.default)([vo.colors.booths.seectedLight || ((0, ks.default)(this.booth.labelColor || vo.boothLabelColor).isLight() ? "#000" : "#fff"), $.selectedRoute ? vo == null || (e = vo.colors) == null || (e = e.booths) == null || (e = e.wayfinding) == null ? void 0 : e.selected : vo == null || (t = vo.colors) == null || (t = t.booths) == null ? void 0 : t.selected]);
	}
	getBoothColor() {
		let e = this.booth;
		if ($.heatmap) return this.getHeatmapColor();
		let t;
		t = e.error ? "#f33" : z.isRebooking ? this.defaultColor : e.selected ? this.selectedColorInterpolateFunc(this.boothShape.selectBgAnimationPart) : this.poiHighlighted ? vo.colors.booths.selected : this.defaultColor;
		let n;
		try {
			n = (0, ks.default)(t === "none" ? "#f33" : t);
		} catch {
			n = (0, ks.default)(this.defaultColor);
		}
		return (e.hover && !e.selected || e.selected && z.isRebooking) && (n = n.darken(.2).alpha(n.alpha() * 1.5)), ($.monochrome || $.heatmapYah) && (n = n.grayscale()), n;
	}
}, DP(EP.prototype, "defaultColor", [wP], Object.getOwnPropertyDescriptor(EP.prototype, "defaultColor"), EP.prototype), DP(EP.prototype, "selectedColorInterpolateFunc", [TP], Object.getOwnPropertyDescriptor(EP.prototype, "selectedColorInterpolateFunc"), EP.prototype), EP);
//#endregion
//#region src/components/Map/drawing/config/config-booth-bookmark.ts
function MP(e) {
	if (!$.kiosk) return new NP(e);
}
var NP = class extends SP {
	constructor(e) {
		super(e), this.shape = void 0, this.bookmarkId = void 0, this.canvas = void 0, this.rect = void 0, this.padding = void 0, this.getShape = () => this.shape, this.padding = this.booth.borderWidth / 2, this.rect = new mr(this.booth.rect.center, this.booth.rect.size, this.booth.rotate, this.booth.elevation), this.canvas = ff(11, devicePixelRatio), this.bookmarkId = `bookmark-${this.booth.id}`, this.shape = bf(this.canvas, this.rect, { hidden: !e.bookmarked }), this.shape.onScale = ({ pixelSize: e }) => this.layOutBookmark(e), N(() => [
			e.bookmarked,
			Yq.layersLoaded,
			this.booth.skipDim
		], () => this.update(e.bookmarked), { fireImmediately: e.bookmarked }), N(() => $.mapSettings, ({ roll: e }) => {
			bN(e == null ? 0 : e) && (this.shape.onRoll = ({ roll: e, pixelSize: t }) => {
				let n = gN(e, this.rect.rotation);
				if (n !== 0) return this.rect = hN(this.rect, n), this.layOutBookmark(t), [this.shape];
			});
		}, { fireImmediately: !0 });
	}
	update(e) {
		Yq.layersLoaded && (this.shape.hidden = !e, this.shape.dim = this.booth.skipDim ? 0 : void 0, zm(this.shape));
	}
	layOutBookmark(e) {
		return this.shape.bounds = yN(this.rect, this.canvas, this.padding, e), this.shape.hidden ? [] : [this.shape];
	}
};
//#endregion
//#region src/components/Map/drawing/config/config-booth-border.ts
function PP(e) {
	if (vo.EXPO !== "confex20" && !(e.poiType || e.borderColor === "none" || e.borderWidth === 0 && !Jq.borderWidth || e.paths && !e.pathsWithRect)) return new FP(e);
}
var FP = class extends SP {
	constructor(e) {
		super(e), this.shape = void 0;
		let t = this.booth.rect, { x: n, y: r } = t.center, { width: i, height: a } = t.size, o = e.borderWidth || Jq.borderWidth, s = [], c = (t, i, a, o) => {
			var c;
			let l = new mr({
				x: t,
				y: i
			}, {
				x: a,
				y: o
			}, 0, e.elevation).toPolygon();
			s.push(l.rotate((c = e.rotate) == null ? 0 : c, {
				x: n,
				y: r
			}));
		};
		c(n, r - a / 2, i + o, o), c(n, r + a / 2, i + o, o), c(n - i / 2, r, o, a + o), c(n + i / 2, r, o, a + o);
		let l = lr.merge(...s), u = this.getBorderColor();
		this.shape = yf(l, u.string()), N(() => [
			this.booth.skipDim,
			Yq.layersLoaded,
			this.booth.hover,
			this.booth.selected,
			$.heatmap
		], () => {
			Yq.layersLoaded && (this.shape.dim = !this.booth.skipDim && void 0, this.shape.color = this.getBorderColor().string(), zm(this.shape));
		});
	}
	getBorderColor() {
		let e = this.booth;
		if ($.heatmap) {
			let t = Xq.getHeatmapColorForBooth(e);
			if (e.selected) {
				let e = vo.colors.booths.selectedBorder;
				return e ? (0, ks.default)(e) : t.darken(.4);
			}
			return e.hover ? t.darken(.3) : t.darken(.2);
		}
		return (0, ks.default)((e.selected ? vo.colors.booths.selectedBorder : e.borderColor) || vo.colors.booths.default);
	}
	getShape() {
		return this.shape;
	}
}, IP = /[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/u;
function LP(e) {
	return IP.test(e);
}
//#endregion
//#region src/components/Map/drawing/config/label-inset.ts
var RP = .05;
function zP(e, t) {
	let n = RP * Math.min(t.width, t.height);
	return e > 0 && n > 0 ? Math.min(e / 2, n) : 0;
}
//#endregion
//#region src/components/Map/drawing/config/config-booth-labels.ts
var BP = vo.boothLabelColor;
vo.EXPO === "tqs2021" && (BP = "#000");
var VP = EN || pe, HP = (e) => e.replace(" ", "").substring(0, 4).replace(/[0-9]/g, "3").replace(/[A-Z]/gi, "A"), UP = document.createElement("canvas").getContext("2d");
function WP(e) {
	if (!(!(e instanceof Ds) || e.noLabels)) return new $P(e);
}
function GP(e) {
	return Array.isArray(e) && e.length > 0 ? Math.max(...e.map((e) => e)) : typeof e == "number" ? e : -0;
}
var KP = () => {
	var e, t;
	return !!((e = $.selectedRoute) != null && e.from && (t = $.selectedRoute) != null && t.to);
};
function qP(e, t = [], n = "normal") {
	let r = [
		...t,
		{
			weight: 500,
			url: mf,
			style: "normal"
		},
		{
			weight: 300,
			url: hf,
			style: "normal"
		}
	].find((t) => +t.weight === e && t.style === n);
	return (r == null ? void 0 : r.url) || mf;
}
function JP(e, t) {
	return Number(getComputedStyle(document.body).getPropertyValue(e)) || t;
}
function YP() {
	return {
		main: JP(d, 500),
		details: JP(r, 300)
	};
}
function XP() {
	return {
		main: JP(m, 500),
		details: JP(g, 300)
	};
}
function ZP() {
	return XP().details;
}
var QP = "Details", $P = class extends SP {
	constructor(e) {
		super(e), this.canvasRect = void 0, this.paddingScaled = void 0, this.padding = void 0, this.minZoomDotVisible = 0, this.maxZoomDotVisible = 0, this.exh = [], this.shapeLabel = void 0, this.shapeDot = void 0, this.fontSizes = [[], []], this.lines = [[], []], this.topLeftAlignment = void 0, this.centerAlignment = void 0, this.prefixes = void 0, this.fontUrls = ["", ""], this.canvasRect = new mr(e.rect.center, e.rect.size, e.rotate, e.elevation), this.paddingScaled = [4, 4], this.padding = zP(e.borderWidth || Jq.borderWidth, e.rect.size), this.topLeftAlignment = {
			horizontal: $.rtl ? "right" : "left",
			vertical: "top"
		}, this.centerAlignment = {
			horizontal: "center",
			vertical: "center"
		}, this.prefixes = VP ? [
			{
				fontSize: 7,
				name: "XS",
				short: !0
			},
			{
				fontSize: 10,
				name: "S",
				short: !0
			},
			{
				fontSize: 16,
				name: QP,
				short: !1
			}
		] : [
			{
				fontSize: 7,
				name: "XS",
				short: !0
			},
			{
				fontSize: 10,
				name: "S",
				short: !0
			},
			{
				fontSize: 12,
				name: "M",
				short: !0
			},
			{
				fontSize: 14,
				name: "L",
				short: !0
			},
			{
				fontSize: 18,
				name: QP,
				short: !1
			}
		], !(e instanceof Os) && (this.exh = z.hideExhibitors ? [] : z.onlyFeaturedExhibitors ? e.exhibitors.filter((e) => e.featured) : e.exhibitors, VP && this.optimizationLevel() >= 3 && (this.prefixes = this.prefixes.filter((e) => e.name !== "S")), this.createLines(), this.calculateFontSizeFactors(), this.shapeLabel = xf(Sf(this.lines, this.booth.labelColor || BP, 0, this.fontUrls), new mr(this.booth.rect.center, this.booth.rect.size, this.booth.rotate, this.booth.elevation), [...this.paddingScaled], {
			horizontal: "left",
			vertical: "top"
		}), this.shapeLabel.onScale = ({ pixelSize: e }) => this.layOutLabel(e), this.getShapeDot(), N(() => Yq.layersLoaded && this.booth.skipDim === !0, (e) => {
			this.shapeLabel.dim = e ? 0 : void 0, this.shapeDot.dim = e ? 0 : void 0, zm(this.shapeLabel, this.shapeDot);
		}), N(() => $.mapSettings, ({ roll: e }) => {
			bN(e == null ? 0 : e) && (this.shapeLabel.onRoll = ({ roll: e, pixelSize: t }) => {
				let n = gN(e, this.shapeLabel.bounds.rotation);
				if (n === 0) return;
				let { size: r } = this.canvasRect;
				return this.shapeLabel = mN(this.shapeLabel, n), !this.shapeLabel.hidden && !this.exh.length && r.x !== r.y && (this.canvasRect = hN(this.canvasRect, n), this.calculateFontSizeFactors(), this.layOutLabel(t), this.layOutDot(t)), [this.shapeLabel, this.shapeDot];
			});
		}, { fireImmediately: !0 }));
	}
	getShape() {
		return [this.shapeLabel, this.shapeDot];
	}
	layOutLabel(e) {
		var t, n;
		let r = (t = this.lines[1]) == null ? [] : t, i = (n = this.fontSizes[1]) == null ? [] : n;
		if (vo.EXPO !== "wineparis2026") {
			let t = this.exh.length ? this.topLeftAlignment : r.length ? e < i[i.length - 1].scaleFactor ? this.topLeftAlignment : this.centerAlignment : this.topLeftAlignment;
			this.shapeLabel.alignment = t;
		}
		return pN(this.shapeLabel.lines, e, this.fontSizes) ? (this.shapeLabel.padding[0] = this.paddingScaled[0] * e + this.padding, this.shapeLabel.padding[1] = this.paddingScaled[1] * e + this.padding, [this.shapeLabel]) : [];
	}
	layOutDot(e) {
		let t = e >= this.minZoomDotVisible && e <= this.maxZoomDotVisible;
		if (!t && this.shapeDot.hidden) return [];
		let n = this.shapeDot.bounds, r = this.shapeDot.source;
		return n.scale({
			x: r.width * e / n.size.x,
			y: r.height * e / n.size.y
		}, n.center, n), this.shapeDot.hidden = !t, [this.shapeDot];
	}
	getShapeDot() {
		this.shapeDot = Tf(this.canvasRect, this.booth.labelColor || BP), this.shapeDot.hidden = !0, this.shapeDot.onScale = ({ pixelSize: e }) => this.layOutDot(e);
		let e = this.shapeDot.source;
		this.maxZoomDotVisible = Math.min(this.canvasRect.size.x / e.width, this.canvasRect.size.y / e.height);
	}
	createLines() {
		let e = this.booth, t = [], n = [], r = VP && this.optimizationLevel() >= 3 ? 1 : 3;
		if (this.exh.length) {
			let i = e.exhibitors.filter((e) => e.order === 0), a = e.exhibitors.filter((e) => e.order);
			if (i.length > 0) t.push(...i.map((e) => e.name));
			else if (z.onlyFeaturedExhibitors) t.push(...e.exhibitors.filter((e) => e.featured).map((e) => e.name));
			else if (a.length > 0) {
				t.push(...a.map((e) => e.name));
				let n = e.exhibitors.filter((e) => e.order === void 0);
				n.length > 0 && t.push(M("and {{moreCount}} more", { moreCount: n.length }));
			} else e.exhibitors.length > r ? t.push(`${e.exhibitors.length} ${z.exhibitorTermPlural}`) : t.push(...e.exhibitors.map((e) => e.name));
			n.push(e.title || e.name);
		} else {
			let r = !!e.exhibitors.length;
			t.push(e.title || e.name), e.onHold ? n.push(M("On Hold")) : e.reserved ? n.push(M("Reserved")) : r || n.push(...e.exhibitors.map((e) => e.name).sort((e, t) => e > t ? 1 : -1)), e.size && n.push(e.size.indexOf("/") > -1 ? e.size.substring(0, e.size.indexOf("/")).trim() : e.size), e.price && e.price !== "0" && !$.previewMode && n.push(e.price);
		}
		$.rtl && t.forEach((e, n) => {
			(e.endsWith(".") || e.endsWith("!") || e.endsWith("?")) && (t[n] = t[n] + "‏"), LP(e) && (t[n] = t[n] + "  ");
		}), this.lines = [t, n];
	}
	calculateFontSizeFactors() {
		let e = this.lines[0], t, n = this.canvasRect, r = [], i = [], a = this.prefixes.slice(0, this.exh.length ? this.prefixes.length : this.prefixes.length - 1), { main: o, details: s } = this.exh.length ? XP() : YP();
		for (let { fontSize: c, short: l } of a) {
			let a = c * devicePixelRatio, u = .9 * c * devicePixelRatio, d = qc(a, o), f = qc(u, s), p = z.hideExhibitorBoothNumber || l, m, h, g, _;
			if (this.exh.length) t = l ? [] : this.lines[1], g = Math.max(...e.map((e) => this.measureText(e, d).width), ...t.map((e) => this.measureText(e, f).width)), m = Math.max(...e.map((e) => this.exh.length ? this.measureText(HP(e), d).width : this.measureText(HP(e), d).width + 3 + 3), ...t.map((e) => this.measureText(HP(e), f).width)), _ = a * e.length + u * t.length + devicePixelRatio * (e.length + t.length) + 3, h = p ? _ / e.length : null;
			else {
				let t = e[0].replace(/[0-9]/g, "3").replace(/[A-Z]/g, "A");
				g = this.measureText(t, d).width + 3 + 3, _ = a + 4;
			}
			let v = n.size.x / (m || g), y = n.size.y / (h || _), b = Math.min(v, y);
			r.push({
				scaleFactor: b,
				value: a,
				lines: []
			}), p || i.push({
				scaleFactor: b,
				value: u,
				lines: []
			});
		}
		if (!this.exh.length) {
			let e = r[r.length - 1], t = this.prefixes.find((e) => e.name === QP);
			t && (r.push({
				scaleFactor: e.scaleFactor / 1.8,
				value: t.fontSize * devicePixelRatio,
				lines: []
			}), i.push({
				scaleFactor: e.scaleFactor / 1.8,
				value: t.fontSize * (VP ? 1 : .9) * devicePixelRatio,
				lines: []
			}));
		}
		let c = gf();
		this.fontUrls = [qP(o, c), qP(s, c)], this.minZoomDotVisible = GP(r.map((e) => e.scaleFactor)), this.fontSizes = [r, i];
	}
	calcArea(e, t) {
		return Math.floor(Math.max(0, e) * Math.max(0, t) / 1e3);
	}
	optimizationLevel() {
		return Math.min(z.viewOptimizationLevel ? z.viewOptimizationLevel : Math.floor(this.calcArea(this.canvasRect.size.x, this.canvasRect.size.y) / 5e3), 3);
	}
	measureText(e, t) {
		return UP.font = t, UP.measureText(e);
	}
}, eF = document.createElement("canvas").getContext("2d"), tF = class {
	constructor(e, t, n) {
		this.maxMultilineFontSize = void 0, this.baseFontSize = void 0, this.fontSizes = void 0, this.ctx = void 0, this.spaceWidth = void 0, this.baseFontSize = this.maxMultilineFontSize = n, this.fontSizes = t, this.ctx = eF, this.ctx.textAlign = "center", this.ctx.textBaseline = "alphabetic", this.ctx.font = e(this.baseFontSize), this.spaceWidth = this.ctx.measureText(" ").width;
	}
	getStepsForRect(e, t, n) {
		let r = e.split(/\s+/), i = r.map((e) => this.ctx.measureText(e).width), a = [], o = Infinity, s = 0;
		for (let e of this.fontSizes) {
			let c = e, l = e / this.baseFontSize, u = i.map((e) => e * l), d = this.spaceWidth * l, f = nF(u, d, e > this.maxMultilineFontSize ? 1 : Infinity).filter((e) => e);
			for (let i = 0; i < f.length; i++) {
				let l = f[i], p = l, m = i + 1, h = c * m, g = p / t, _ = h / n, v = Math.max(_, g);
				if (v > o || m < s) continue;
				o = v, s = m;
				let y = aF(iF(l, m, u, d), u, d);
				if (!y) continue;
				let b = sF(y, r);
				a.push({
					scaleFactor: v,
					value: e,
					lines: b,
					width: l
				});
			}
		}
		return a;
	}
};
function nF(e, t, n) {
	let r = [], i, a = 1, o = Infinity, s;
	for (; (s = rF(o, e, t)) && s.length <= n;) a !== s.length && (r[a - 1] = i), a = s.length, i = Math.max(...s), o = i - 1;
	return r[a - 1] = i, r;
}
function rF(e, t, n) {
	let r = [], i, a = -1;
	function o() {
		a++, i = 0;
	}
	o();
	for (let s of t) {
		let t = i + (i > 0 ? n : 0) + s;
		if (t > e) {
			if (s > e) return null;
			o(), i = s;
		} else i = t;
		r[a] = i;
	}
	return r;
}
function iF(e, t, n, r) {
	return i(t, 0);
	function i(e, t) {
		let r = a(t), o = [];
		for (let a of r) {
			let r = t + a.length;
			if (r >= n.length) {
				o.push([a]);
				break;
			}
			if (e > 0) {
				let t = i(e - 1, r);
				for (let n of t) n.length === e - 1 && o.push([a, ...n]);
			}
		}
		return o;
	}
	function a(t) {
		if (t >= n.length) throw Error("From exceed blocks length");
		let i = [0, -1], a = 0, o = 0;
		for (; n.length > t + o && (a += (o > 0 ? r : 0) + n[t + o]) && a / e < 1.001;) o++;
		return i.map((e) => o + e).filter((e) => e > 0).map((e) => s(t, e));
		function s(e, t) {
			let n = Array(t);
			for (; t--;) n[t] = t + e;
			return n;
		}
	}
}
function aF(e, t, n) {
	let r = e.map((e) => ({
		ll: e,
		dd: oF(e.map((e) => e.map((e) => t[e]).reduce((e, t, r) => e + (r > 0 ? n : 0) + t), 0))
	}));
	return r.sort((e, t) => e.dd - t.dd), r.map((e) => e.ll)[0];
}
function oF(e) {
	let t = e.length, n = e.reduce((e, t) => e + t) / t;
	return Math.sqrt(e.map((e) => (e - n) ** 2).reduce((e, t) => e + t) / t);
}
function sF(e, t) {
	return e.map((e) => e.map((e) => t[e]).reduce((e, t, n) => e + (n > 0 ? " " : "") + t), "");
}
//#endregion
//#region src/components/Map/drawing/config/config-booth-labels-special.ts
var cF = /* @__PURE__ */ new Map();
function lF(e) {
	let t = cF.get(e);
	return t || (t = new tF(qc, [
		18,
		16,
		14,
		12,
		10,
		7
	].map((t) => t * e), 14 * e), cF.set(e, t), setTimeout(() => cF.delete(e), 5e3)), t;
}
function uF(e) {
	if (!(!(e instanceof Os) || e.noLabels)) return new dF(e);
}
var dF = class extends $P {
	constructor(e) {
		super(e), this.steps = [], this.labelIsVertical = void 0, this.text = "";
		let t = this.booth.rect, n = qP(Number(getComputedStyle(document.body).getPropertyValue("--expofp-booth-special-weight")) || Number(getComputedStyle(document.body).getPropertyValue("--expofp-booth-main-weight")) || 500, gf()), r = t.expand({
			x: -(t.size.width * RP + this.padding),
			y: -(t.size.height * RP + this.padding)
		});
		this.setText(), this.canvasRect = new mr(r.center, r.size, e.rotate, e.elevation), this.setFactors(this.text), this.labelIsVertical = Math.abs(Math.abs(e.rotate) - Math.PI / 2) < .01, this.fontSizes = [this.steps, []], this.minZoomDotVisible = GP(this.steps.map((e) => e.scaleFactor)), this.shapeLabel = xf([{
			text: this.text,
			color: e.labelColor || vo.boothLabelColor,
			fontUrl: n,
			fontSize: 0
		}], new mr(r.center, r.size, e.rotate, e.elevation), [this.padding, this.padding], {
			horizontal: "center",
			text: "center",
			vertical: "center"
		}), this.shapeLabel.onScale = ({ pixelSize: e }) => this.layOutLabel(e), this.getShapeDot(), N(() => Yq.layersLoaded && this.booth.skipDim === !0, (e) => {
			this.shapeLabel.dim = e ? 0 : void 0, this.shapeDot.dim = e ? 0 : void 0, zm(this.shapeLabel, this.shapeDot);
		}), N(() => $.mapSettings, ({ roll: e }) => {
			bN(e == null ? 0 : e) && (this.shapeLabel.onRoll = ({ roll: e, pixelSize: t }) => {
				let n = this.shapeLabel.bounds.rotation;
				if (this.labelIsVertical) return _N(e, n) ? (this.shapeLabel.bounds.rotate(-2 * n, this.shapeLabel.bounds), [this.shapeLabel, this.shapeDot]) : void 0;
				let r = gN(e, n);
				if (r === 0) return;
				let { size: i } = this.canvasRect;
				return this.shapeLabel = mN(this.shapeLabel, r), i.x !== i.y && !this.shapeLabel.hidden && (this.canvasRect = hN(this.canvasRect, r), this.setFactors(this.text), this.layOutLabel(t), this.layOutDot(t)), [this.shapeLabel, this.shapeDot];
			});
		}, { fireImmediately: !0 });
	}
	getShape() {
		return [this.shapeLabel, this.shapeDot];
	}
	layOutLabel(e) {
		let t = this.steps.find((t) => t.scaleFactor < 1 / e);
		return t ? (this.shapeLabel.lines[0].fontSize = t.value * e, this.shapeLabel.lines[0].text = t.lines.join("\n"), this.shapeLabel.padding = [this.paddingScaled[0] * e + this.padding, this.paddingScaled[1] * e + this.padding], [this.shapeLabel]) : (this.shapeLabel.lines[0].fontSize = 0, [this.shapeLabel]);
	}
	layOutDot(e) {
		let t = this.steps.find((t) => t.scaleFactor < 1 / e), n = this.shapeDot.bounds, r = this.shapeDot.source;
		return n.scale({
			x: r.width * e / n.size.x,
			y: r.height * e / n.size.y
		}, n.center, n), this.shapeDot.hidden = !!t, [this.shapeDot];
	}
	setFactors(e) {
		this.steps = lF(devicePixelRatio).getStepsForRect(e, this.canvasRect.size.x, this.canvasRect.size.y);
	}
	setText() {
		let e = this.booth.title || this.booth.name, t = `Clicks: ${Xq.getTotalClicksByBooth(this.booth)}`;
		this.text = $.heatmap ? `${e} - ${t}` : e;
	}
}, fF = /* @__PURE__ */ new Map();
function pF(e, t) {
	return fF.set(e, t), () => {
		fF.get(e) === t && fF.delete(e);
	};
}
function mF() {
	return [...fF.values()].map((e) => e());
}
//#endregion
//#region src/utils/getLogoUrl.ts
function hF(e) {
	var t, n, r;
	let i = gF();
	return i === "tiny" ? (t = (n = e.tinyUrl) == null ? e.smallUrl : n) == null ? e.url : t : i === "small" ? (r = e.smallUrl) == null ? e.url : r : e.url;
}
function gF() {
	if (EN || pe) return z.viewOptimizationLevel ? z.viewOptimizationLevel >= 5 ? "tiny" : "small" : void 0;
}
function _F(e) {
	var t, n;
	return Hn((t = (n = e.transform) == null || (n = n.animVal[0]) == null ? void 0 : n.angle) == null ? 0 : t);
}
function vF(e) {
	var t;
	let n = Er.fromSvg(e);
	return {
		url: (t = e.getAttribute("data-model-3d")) == null ? "" : t,
		bounds: mr.fromMinMax(n.min, n.max, _F(e))
	};
}
//#endregion
//#region src/components/Map/drawing/config/loadBoothsImages.ts
async function yF() {
	let e = mF();
	await Promise.all(e.map(async (e) => {
		let t = await e;
		if (!(t != null && t.children.length)) return;
		let { layer: n, children: r } = t;
		n.children.push(...r), zm(n);
	}));
}
var bF = (e) => `${e}:images`, xF = (e) => `${e}:models`;
function SF(e) {
	let t = /* @__PURE__ */ new Map();
	for (let r of e) {
		var n;
		if (!r.rect) continue;
		let e = (n = aP(r)) == null ? void 0 : n.logo;
		e && t.set(r.id, {
			preferred: hF(e),
			fallback: e.url
		});
	}
	return t;
}
function CF(e) {
	var t;
	let n = io(Mo(e)).select(`[data-layer="${e.name}"]`), r = (((t = oo().__fpVersion) == null ? 0 : t) > 5 ? n.selectAll(":scope > image, :scope > g:not([data-layer]) image").nodes() : n.selectAll(":scope > g[data-is-editable='false'] image").nodes()).filter(Boolean), i = [], a = [];
	for (let e of r) (e.hasAttribute("data-model-3d") ? a : i).push(e);
	return {
		icons: i,
		models: a
	};
}
function wF(e, t) {
	let n = e.rect, r = n.size.width, i = n.size.height, a = i ? r / i : 1, o, s, c, l = .9;
	a > t ? (s = i * l, o = s * t) : (o = r * l, s = o / t);
	let u = e.rotate || 0;
	return t >= 2 && !u && i >= r * 2 ? (s = r * l, o = s * t, c = -90) : c = Un(u), o > r && (o = r, s = o / t), s > i && (s = i, o = s * t), {
		name: e.slug,
		bounds: new mr(n.center, {
			x: o,
			y: s
		}, Hn(c), e.elevation),
		booth: e
	};
}
//#endregion
//#region src/components/Map/drawing/config/config-booths.ts
var TF = (0, Jm.default)("efp:booth-logos");
function EF(e, t) {
	return ((t) => {
		let n = e, r = [], i = [], a = [], o = [], s = [], c = bF(n), l = {
			name: c,
			children: []
		};
		for (let e of t) {
			var u, d, f, p;
			let t = (u = OP(e)) == null ? void 0 : u.getShape();
			t && (r.push(...t), KN(e, t));
			let n = (d = WP(e)) == null ? void 0 : d.getShape();
			n && i.push(...n);
			let c = (f = uF(e)) == null ? void 0 : f.getShape();
			if (c && a.push(...c), !vo.borderless) {
				var m;
				let t = (m = PP(e)) == null ? void 0 : m.getShape();
				t && o.push(t);
			}
			let l = (p = MP(e)) == null ? void 0 : p.getShape();
			l && s.push(l);
		}
		let h = i.filter((e) => e.lines), g = a.filter((e) => e.lines), _ = i.filter((e) => e.source), v = a.filter((e) => e.source);
		if (!$.hideLogoInBooth) {
			let e = SF(t);
			pF(c, async () => {
				let t = await NN(e, 350), n = [], r = sP(), i = await Promise.all([...t].map(async ([e, t]) => {
					let n = Jq.boothById.get(e);
					return [
						e,
						n,
						n ? await r(n, t) : null
					];
				}));
				for (let [e, t, r] of i) {
					if (!t) {
						TF("dropped a logo: no booth has id %s", e);
						continue;
					}
					if (!r) {
						TF("dropped the logo of booth %s: the image could not be read", e);
						continue;
					}
					let { blob: i, aspectRatio: a } = r, { bounds: o } = wF(t, a), s = bf(i, o), c = t.borderWidth || Jq.borderWidth, l = t.rect.expand(-c), u = new mr(l.center, l.size, t.rotate);
					s.onRoll = xN(s.bounds, u) ? ({ roll: e }) => TN(s, e) ? [s] : void 0 : ({ roll: e }) => CN(s, e) ? [s] : void 0, t.shapes.push(s), n.push(s);
				}
				return {
					layer: l,
					children: n
				};
			});
		}
		let y = {
			name: `${n}:labelGroup`,
			children: [
				{
					name: `${n}:labels`,
					children: h
				},
				{
					name: `${n}:specialLabels`,
					children: g
				},
				{
					name: `${n}:dots`,
					children: _
				},
				{
					name: `${n}:specialDots`,
					children: v
				}
			]
		};
		N(() => Yq.layersLoaded && KP(), (e) => {
			y.dim = e ? 0 : void 0, zm(y);
		}, { fireImmediately: !0 });
		let b = [];
		if (t.length) {
			let e = n + ":";
			b = [
				{
					name: `${e}boothBackground`,
					children: r,
					onPointerMove: JN,
					onPointerOut: YN,
					onClick: XN
				},
				y,
				l,
				{
					name: `${e}boothsBookmark`,
					children: s
				},
				{
					name: `${n}:boothBorder`,
					children: o
				}
			];
		}
		return {
			name: n,
			children: b
		};
	})(t);
}
//#endregion
//#region src/components/Map/drawing/config/config-outdoor-poi.ts
var DF = (e) => !!e && e !== "transparent" && e !== "none";
function OF(e) {
	var t, n, r;
	let i = ((t = e.paths) == null ? [] : t).map((e) => e.color).find(DF), a = ((n = e.shapes) == null ? [] : n).map((e) => e.color).find(DF), o = (r = i == null ? a : i) == null ? null : r;
	if (!o) return null;
	try {
		return $.monochrome ? (0, ks.default)(o).grayscale().rgb().string() : o;
	} catch {
		return o;
	}
}
function kF() {
	return z.enableExperimentalOutdoorMarkers === !0;
}
function AF(e) {
	return e.name.toLowerCase().startsWith(l.toLowerCase());
}
async function jF(e) {
	var t, n;
	let r = Q.poiMarkerStore.generation, i = window.devicePixelRatio || 1, a = [], o = new Map(((t = (n = Q.poiTypeStore) == null ? void 0 : n.poiTypes) == null ? [] : t).map((e) => [e.id, e])), s = /* @__PURE__ */ new Map(), c = (e) => {
		let t = s.get(e);
		return t || (t = fe(e), s.set(e, t)), t;
	};
	await Promise.all(e.map(async (e) => {
		var t, n;
		let r = e.poiTypeId == null || (t = o.get(e.poiTypeId)) == null ? void 0 : t.iconUrl, s = r ? await c(r) : null;
		r && !s && console.warn("PoI icon failed to load", e.name, r);
		let l = e.rect.center;
		a.push({
			boothId: e.id,
			center: {
				x: l.x,
				y: l.y
			},
			icon: Gc(s, 42, i, (n = OF(e)) == null ? p : n)
		});
	})), Q.poiMarkerStore.generation === r && Q.poiMarkerStore.addMany(a);
}
function MF(e, t) {
	return !kF() || !AF(e) ? !1 : (Q.maplibreStore.showMaplibre && jF(t.filter((e) => e.poiTypeId && e.rect)), !0);
}
//#endregion
//#region src/components/Map/drawing/config/config-load-layer.ts
function NF(e) {
	return e.childLayers.length ? e.childLayers : aI(e, e.basePriority, 15).layers;
}
async function PF(e, t) {
	let n = [], r = Ps(Q, e);
	if (MF(e, r)) return e.loaded = !0, e.configured = !0, e.children = [], Cf(e.name, [], { hidden: !0 });
	let i = await Nf(e), a = [], o = Ko(r, 350), s = Jq.booths.filter((t) => t.rect && (!t.layer || t.layer === e || t.layer.childLayers.includes(e)) && t.exhibitors.find((e) => {
		var t;
		return !!e.logoInBooth && !!((t = e.logo) != null && t.url);
	}) && !$.hideLogoInBooth), c = new Map(s.map((e) => [e, e.noLabels]));
	s.forEach((e) => e.noLabels = !0), r.length && o.forEach((t, n) => {
		a.push(EF(`${e.name}:${f}:${n}`, t));
	});
	for (let [e, t] of c) e.noLabels = t;
	e.loaded = !0;
	let l = i.children.find((e) => e.name === "bg"), u = i.children.find((e) => e.name === "fg"), d = bF(e.name), { icons: p, models: m } = CF(e), h = {
		name: d,
		children: []
	}, g = {
		name: xF(e.name),
		children: m.map(vF)
	};
	p.length && pF(d, async () => {
		let e = await jf(p), t = [];
		for (let n of e) {
			let { bounds: { x: e, y: r, height: i, angle: a, width: o }, source: s } = n, c = mr.fromMinMax({
				x: e,
				y: r
			}, {
				x: e + o,
				y: r + i
			}, Hn(a));
			t.push(bf(s, c));
		}
		return {
			layer: h,
			children: t
		};
	}), l && n.push({
		...l,
		name: `${i.name}:bg`
	}), a.length && n.push(...a), u && n.push({
		...u,
		name: `${i.name}:fg`
	}), p.length && n.push(h), g.children.length && n.push(g);
	let _ = await Promise.all(e.childLayers.sort((e, t) => e.basePriority - t.basePriority).map((e) => PF(e, !0)));
	return n.push(..._), e.children = n, e.configured = !0, Cf(e.name, n, { hidden: !t });
}
async function FF(e) {
	if (e.configured) return Cf(e.name, e.children, { hidden: !e.visible });
	if (Q.layerStore.mode !== $F.Default && !lo(e.name) && !e.rootParent) try {
		let t = i().fpSvgLayerJsRefs[e.name];
		t && await S(t);
	} catch (t) {
		console.warn(`Layer data not loaded: ${e.name}`, t);
	}
	let t = NF(e);
	t.length && (e.childLayers = t);
	let { layers: n } = Q.layerStore;
	return Q.layerStore.layers = [...n, ...t.filter((e) => !n.some((t) => t.name === e.name))], PF(e, e.visible);
}
//#endregion
//#region src/utils/shortenName.ts
function IF(e) {
	return typeof e == "string" ? e.split(" ").map((e) => {
		let t = e.replace(/[^A-Z0-9+-]/gi, ""), n = t.match(/^[-+]?\d+$/);
		return n ? n[0] : /^[A-Z]{2,4}$/.test(t) ? t : t.charAt(0).toUpperCase();
	}).join("") : e;
}
//#endregion
//#region src/store/LayerStore.ts
var LF, RF, zF, BF, VF, HF, UF, WF, GF, KF, qF, JF, YF;
function XF(e, t, n, r) {
	n && Object.defineProperty(e, t, {
		enumerable: n.enumerable,
		configurable: n.configurable,
		writable: n.writable,
		value: n.initializer ? n.initializer.call(r) : void 0
	});
}
function ZF(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var QF = [
	"money2020usa",
	"rodion2",
	"possible2025",
	"2025virtuosotravelweek",
	"zscalerskofy26",
	"gamescom2025"
], $F = /*#__PURE__*/ function(e) {
	return e[e.Default = 0] = "Default", e[e.Separated = 1] = "Separated", e[e.Radio = 2] = "Radio", e[e.CheckBox = 3] = "CheckBox", e;
}({}), eI = /*#__PURE__*/ function(e) {
	return e[e.Unset = 0] = "Unset", e[e.AlwaysVisible = 1] = "AlwaysVisible", e[e.AlwaysHidden = 2] = "AlwaysHidden", e[e.TurnedOn = 3] = "TurnedOn", e[e.TurnedOff = 4] = "TurnedOff", e;
}({}), tI = (LF = class {
	constructor() {
		this.basePriority = 0, this.name = "", this.description = "", this.frozen = !1, this.rect = null, this.viewbox = null, this.configured = !1, this.childLayers = [], this.rootParent = null, this.mode = eI.Unset, this.children = [], this.pathway = void 0, this.floorIndex = void 0, XF(this, "loaded", RF, this), XF(this, "visible", zF, this);
	}
	get shortName() {
		return IF(this.description);
	}
}, RF = ZF(LF.prototype, "loaded", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), zF = ZF(LF.prototype, "visible", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), LF), nI = (BF = j({ keepAlive: !0 }), VF = j({ keepAlive: !0 }), HF = j({ keepAlive: !0 }), UF = j({ keepAlive: !0 }), WF = j({ keepAlive: !0 }), GF = class {
	constructor() {
		XF(this, "layers", KF, this), XF(this, "defaultLayer", qF, this), XF(this, "mode", JF, this), XF(this, "layersLoaded", YF, this), this.updateVisibilityTimeout = 0, this.selectFloorTimeout = 0;
	}
	get visible() {
		return this.layers.filter((e) => e.frozen || e.visible);
	}
	get loaded() {
		return this.layers.filter((e) => e.loaded);
	}
	get rectangle() {
		let e = this.visible.filter((e) => !e.frozen).map((e) => {
			var t;
			return (t = e.viewbox) == null ? e.rect : t;
		}).filter((e) => !!e);
		return this.mode !== $F.Radio || !e.length ? null : Er.fromUnion(...e) || null;
	}
	get bounds() {
		let e = this.visible.map((e) => {
			var t;
			return (t = e.viewbox) == null ? e.rect : t;
		}).filter(Boolean);
		return e.length ? Er.fromUnion(...e) : void 0;
	}
	get viewboxRectangle() {
		let e = this.visible.filter((e) => !e.frozen).map((e) => e.viewbox).filter((e) => !!e);
		return e.length && Er.fromUnion(...e) || null;
	}
	get pathwayLayers() {
		return this.layers.filter((e) => e.pathway);
	}
	get floors() {
		if (!Zo()) return [];
		let e = new Set(this.layers.filter((e) => e && !e.frozen && !e.rootParent && !e.pathway).concat(Q.routeStore.layers.filter((e) => e && e.mode !== eI.AlwaysHidden && e.mode !== eI.AlwaysVisible))), t = Array.from(e).reverse();
		return t.map((e, n) => {
			var r;
			let i = Q.routeStore.layers.length > 0 && Q.routeStore.layers.indexOf(e) === -1, a = Q.toursStore.tourLayers.length > 0 && Q.toursStore.tourLayers.indexOf(e) === -1;
			return {
				layer: e,
				name: e.name,
				shortName: e.shortName,
				description: e.description,
				active: e.visible,
				disabled: !!(i || a),
				index: (r = e.floorIndex) == null ? t.length - n - 1 : r
			};
		});
	}
	selectFloor(e) {
		if (this.selectFloorTimeout) return;
		this.selectFloorTimeout = window.setTimeout(() => this.selectFloorTimeout = 0, 500);
		let t = this.layers.find((t) => t.description === e.description);
		if (!t) return;
		if (this.mode === $F.Radio) {
			var n;
			if (this.updateVisibility(t, !0), Q.maplibreStore.showMaplibre) return;
			if ((n = oo().__fpSettings) != null && n.fpVer || QF.includes(vo.EXPO)) {
				var r;
				let e = (r = t.viewbox) == null ? t.rect : r;
				Q.uiState.moveToRect = e;
			} else {
				let e = this.layers.indexOf(this.layers.filter((e) => !e.frozen && e.visible)[0]), n = this.layers.indexOf(t);
				if (e === n) return;
				Q.uiState.zoomBy = n < e ? .95 : 1.05;
			}
		} else this.updateVisibility(t, !t.visible);
		let i = Q.toursStore.getTourLayerInfo(t.name) || Q.toursStore.getTourLayerInfo(t.description);
		if (i) {
			this.showPathWay(i.id);
			return;
		}
		Q.toursStore.stopTour();
	}
	updateVisibility(e, t) {
		if (this.mode === $F.Radio && !t) return;
		let n = e instanceof tI ? e : this.findLayer(e);
		if (!n || n.visible === t) {
			n && Q.routeStore.currentRouteLayer !== n && (Q.routeStore.currentRouteLayer = n);
			return;
		}
		FF(n).then(() => {
			this.mode === $F.Radio && this.layers.filter((e) => !e.pathway).forEach((e) => {
				e.name !== n.name && !e.frozen && e.visible && (e.visible = !1, e.childLayers.forEach((e) => {
					e.visible = !1;
				}));
			}), n && (n.visible = t, n.childLayers.forEach((e) => {
				e.visible = t;
			}), t && (Q.routeStore.currentRouteLayer = n), typeof Q.fp.onFloorActivated == "function" && (clearTimeout(this.updateVisibilityTimeout), this.updateVisibilityTimeout = window.setTimeout(() => {
				let e = Q.fp.getFloors();
				Q.fp.onFloorActivated(e.find((e) => e.name === n.name));
			})));
		});
	}
	findLayer(e) {
		var t;
		if (e == null) return null;
		let n = this.layers.filter((e) => !e.rootParent);
		if (typeof e == "number") {
			let t = n.filter((e) => !e.frozen)[e];
			if (t) return t;
		}
		let r = e.toString().toLowerCase();
		return n.find((e) => {
			let t = (e.name.match(/(-?[0-9]+)/) || "")[0];
			return r === (e == null ? void 0 : e.name.toLowerCase()) || r === (e == null ? void 0 : e.description.toLowerCase()) || r === (e == null ? void 0 : e.shortName.toLowerCase()) || r === t;
		}) || (/\D/.test(r) || (t = n.filter((e) => !e.frozen)[parseInt(r)]) == null ? null : t);
	}
	getPathwayList() {
		return this.layers.filter((e) => e.pathway);
	}
	async showPathWay(e) {
		try {
			let t = this.findLayer(e);
			if (!t) throw Error(`There is no pathway with this name. ${e}`);
			await FF(t);
			let n = this.getPathwayList();
			se(() => {
				n.forEach((t) => {
					let n = t.name === e;
					t.visible = n, t.childLayers.forEach((e) => {
						e.visible = n;
					});
				});
			});
		} catch (e) {
			console.error("showPathWay", e);
		}
	}
	hidePathways() {
		this.getPathwayList().forEach((e) => {
			e.visible = !1, e.childLayers.forEach((e) => {
				e.visible = !1;
			});
		});
	}
}, KF = ZF(GF.prototype, "layers", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return [];
	}
}), qF = ZF(GF.prototype, "defaultLayer", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: null
}), JF = ZF(GF.prototype, "mode", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return $F.Default;
	}
}), YF = ZF(GF.prototype, "layersLoaded", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), ZF(GF.prototype, "visible", [BF], Object.getOwnPropertyDescriptor(GF.prototype, "visible"), GF.prototype), ZF(GF.prototype, "loaded", [VF], Object.getOwnPropertyDescriptor(GF.prototype, "loaded"), GF.prototype), ZF(GF.prototype, "rectangle", [HF], Object.getOwnPropertyDescriptor(GF.prototype, "rectangle"), GF.prototype), ZF(GF.prototype, "bounds", [UF], Object.getOwnPropertyDescriptor(GF.prototype, "bounds"), GF.prototype), ZF(GF.prototype, "viewboxRectangle", [WF], Object.getOwnPropertyDescriptor(GF.prototype, "viewboxRectangle"), GF.prototype), ZF(GF.prototype, "pathwayLayers", [j], Object.getOwnPropertyDescriptor(GF.prototype, "pathwayLayers"), GF.prototype), ZF(GF.prototype, "floors", [j], Object.getOwnPropertyDescriptor(GF.prototype, "floors"), GF.prototype), ZF(GF.prototype, "selectFloor", [C], Object.getOwnPropertyDescriptor(GF.prototype, "selectFloor"), GF.prototype), ZF(GF.prototype, "updateVisibility", [C], Object.getOwnPropertyDescriptor(GF.prototype, "updateVisibility"), GF.prototype), ZF(GF.prototype, "showPathWay", [C], Object.getOwnPropertyDescriptor(GF.prototype, "showPathWay"), GF.prototype), ZF(GF.prototype, "hidePathways", [C], Object.getOwnPropertyDescriptor(GF.prototype, "hidePathways"), GF.prototype), GF), rI = 1e3;
function iI(e) {
	return e == null || qr(e) ? e : Er.fromMinMax({
		x: e.x1,
		y: e.y1
	}, {
		x: e.x2,
		y: e.y2
	});
}
function aI(e, t, n) {
	let r = [], i = t;
	return io(Mo(e)).selectAll(`svg [data-layer="${e.name}"] > [data-layer]`).nodes().filter((e) => e.childNodes.length).forEach((t) => {
		let a = t.getAttribute("data-layer"), o = new tI();
		o.name = t.getAttribute("data-layer"), o.visible = e.visible, o.description = t.getAttribute("data-layer-description") || a, o.frozen = t.getAttribute("data-layer-isfrozen") === "true", o.rect = e.rect, o.viewbox = e.viewbox, o.mode = eI.Unset, o.rootParent = e.rootParent ? e.rootParent : e;
		let s = aI(o, i, n);
		i = s.priority + n, o.basePriority = i, s.layers.length && (o.childLayers = s.layers, r.push(...s.layers)), r.push(o);
	}), {
		layers: r,
		priority: i
	};
}
function oI(e) {
	let { layerStore: t } = e, n = oo().__fpLayers;
	t.mode = oo().__fpLayersMode || $F.Default;
	let r = new URLSearchParams(window.location.search).get("layer"), i = (e, n) => r ? n.toLowerCase() === r.toLowerCase() : t.mode === $F.Default ? e.visible : e.mode == eI.TurnedOn, a = [], o = 0;
	n ? n.forEach((e) => {
		o += rI;
		let t = new tI();
		t.name = e.name, t.description = e.description, t.frozen = e.frozen, t.visible = i(e, t.shortName), t.rect = iI(e.rect), t.viewbox = iI(e.viewbox), t.mode = e.mode || eI.Unset, t.basePriority = o, t.floorIndex = e.floorIndex, a.push(t);
	}) : io(Mo()).selectAll("svg > [data-layer]").nodes().filter((e) => e.childNodes.length).forEach((e) => {
		let t = e.getAttribute("data-layer");
		if (!t.startsWith("WF")) {
			var n;
			o += rI;
			let r = new tI();
			r.name = t, r.visible = !0, r.description = e.getAttribute("data-layer-description") || t, r.frozen = e.getAttribute("data-layer-isfrozen") === "true", r.rect = (n = ko.filter((e) => e.name === r.name || e.name === r.description)[0]) == null ? void 0 : n.rect, r.mode = eI.Unset, r.basePriority = o, a.push(r);
		}
	}), t.mode !== $F.Default && a.forEach((e) => {
		e.mode === eI.AlwaysHidden ? (e.frozen = !0, e.visible = !1) : e.mode === eI.AlwaysVisible ? e.frozen = e.visible = !0 : e.mode === eI.TurnedOff ? (e.frozen = !1, e.visible = !1) : e.mode === eI.TurnedOn && (e.frozen = !1, e.visible = !0);
	});
	try {
		a.forEach((e) => {
			cf(e.name) && (e.frozen = !1, e.visible = !1, e.pathway = !0);
		});
	} catch (e) {
		console.warn(e);
	}
	a = a.filter((e) => e.pathway || !e.frozen || e.frozen && e.visible), t.defaultLayer = a.find((e) => e.name === oo().__fpDefaultLayer), t.layers = [...t.layers, ...a];
}
//#endregion
//#region src/store/init/init-poiTypes.ts
function sI(e) {
	var t;
	((t = z.poiTypes) == null ? [] : t).forEach((t) => {
		e.poiTypeStore.poiTypes.push(t);
	});
}
//#endregion
//#region src/store/init/init-speakers.ts
function cI(e) {
	lI(e.speakerStore);
}
function lI(e) {
	let t = rs("bookmarked");
	e.replaceBookmarked(t.speakers), T(() => {
		var t;
		let n = rs("bookmarked");
		is("bookmarked", {
			exhibitors: n.exhibitors,
			events: n.events,
			speakers: (t = e.bookmarked) == null ? void 0 : t.map((e) => e.id),
			booths: n.booths
		});
	});
}
//#endregion
//#region src/components/Kiosk/SetKiosk/constants.ts
var uI = "expofp-kiosk", dI = "expofp-kiosk-stats-id", fI = "interactive-kiosk", pI = "Your Location", mI = "kiosk_";
//#endregion
//#region src/components/Kiosk/SetKiosk/storage.ts
async function hI(e) {
	localStorage.setItem(uI, JSON.stringify(e));
}
async function gI() {
	localStorage.removeItem(uI);
}
function _I() {
	let e = localStorage.getItem(uI);
	if (e) try {
		return JSON.parse(e);
	} catch (e) {
		console.warn(e);
		return;
	}
}
//#endregion
//#region src/components/Kiosk/kiosk-mode.ts
function vI(e) {
	return e.screenSize.width > 768;
}
function yI(e, t) {
	t && a(() => SI(e)) || (e.kiosk = t, t || e.resetUIScale(), A && window.localStorage.setItem(s, t ? "1" : "0"));
}
function bI(e) {
	let t = new URLSearchParams(window.location.search).get(s);
	return t === "1" || t === "0" ? t === "1" : xI(e);
}
function xI(e) {
	var t;
	let n = A ? window.localStorage.getItem(s) : null;
	return n === "1" || n === "0" ? n === "1" : A && _I() != null || Object.keys((t = e.kiosk) == null ? {} : t).length > 0;
}
function SI(e) {
	return vI(e) ? !1 : (P.warn(`Kiosk mode refused: the plan is ${e.screenSize.width}px wide, and the kiosk layout needs more than 768px.`), !0);
}
//#endregion
//#region src/utils/detectLimitedModeViaImage.ts
var CI = `${k}expofp-overlay.png`;
async function wI(e = CI) {
	try {
		let t = await fe(e), n = document.createElement("canvas");
		n.width = 1, n.height = 1;
		let r = n.getContext("2d");
		if (!r) return !0;
		try {
			return r.drawImage(t, 0, 0, 1, 1), r.getImageData(0, 0, 1, 1), !1;
		} catch {
			return !0;
		}
	} catch {
		return typeof location < "u" && location.protocol === "file:";
	}
}
//#endregion
//#region src/store/init/init-ui.ts
var TI = Rn(), EI = null;
function DI(e) {
	let t = window.__efpElement;
	if (!t) return;
	let { uiState: n } = e;
	n.rootElement = t;
	let r = (e, t) => se("uiState.screenSize", () => {
		n.screenSize = new Jn(e, t);
	});
	r(t.clientWidth, t.clientHeight), EI == null || EI.disconnect(), EI = new TI.ResizeObserver((e) => {
		e.forEach((e) => {
			r(e.contentRect.width, e.contentRect.height);
		});
	}), EI.observe(t);
}
function OI(e) {
	let { uiState: t, exhibitorStore: n } = e;
	if (DI(e), oc) {
		let e = n.exhibitorById.get(oc.id);
		e && (t.previewExhibitor = e);
	}
	let r = typeof matchMedia < "u" ? matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`) : null;
	r && r.addEventListener && r.addEventListener("change", () => {
		t.devicePixelRatio = window.devicePixelRatio;
	});
	let i = oc || !Yo ? "full" : "medium";
	z.isRebooking && t.list.type === "search" && !t.list.text && e.selectExhibitors(), t.desiredOverlaySize = i, T(() => {
		(t.searchFocused || t.menu) && t.overlayPosition !== "left" && (t.desiredOverlaySize = "full");
	}), T(() => {
		t.overlaySize !== "full" && t.menu && (t.menu = !1);
	}), t.wsShown || (t.wsStarted = !0), A && localStorage.getItem("kiosk") === "1" && yI(t, !0), window.__resett = s;
	function a() {
		e.reset();
	}
	let o;
	function s() {
		!t.kiosk || t.setKioskModeEnabled || (P.log("zzz2", "reset timer"), clearTimeout(o), o = setTimeout(a, 3e4), t.inIdle = !1);
	}
	if (T(() => {
		let e = t.list;
		e.type === "search" && (e.text === "kiosk=1" ? yI(t, !0) : e.text === "kiosk=0" && yI(t, !1));
	}), N(() => [t.kiosk, t.setKioskModeEnabled], ([e, t]) => {
		e && !t ? s() : clearTimeout(o);
	}, { equals: re.structural }), A) {
		var c;
		t.setVisibility(JSON.parse((c = localStorage.getItem("___visibility")) == null ? "null" : c) || {});
	}
	AI(e);
}
function kI() {
	EI && (EI.disconnect(), EI = null);
}
async function AI(e) {
	try {
		if (!await wI()) return;
		e.uiState.setGlobalErrorMessage({
			title: "Unsupported Environment Detected",
			body: "This application requires a proper server environment to function correctly.\n                For full functionality, please ensure the application is served through an HTTP/HTTPS server.\n                Some features may not work as expected in the current setup."
		});
	} catch (e) {
		console.error(e);
	}
}
//#endregion
//#region src/store/init/index.ts
function jI(e) {
	oI(e), Xs(e), cI(e), jc(e), Vs(e), sI(e), Ms(e), el(e), OI(e);
}
//#endregion
//#region src/store/search-buttons/constants.ts
var MI = /*#__PURE__*/ function(e) {
	return e.BOOKMARKS = "bookmarks", e.VISITED = "visited", e.SESSIONS = "sessions", e.TOURS = "guided_tours", e.CATEGORIES = "categories", e.POI_TYPE = "poi_type", e.POI_TYPES = "poi_types", e.LINK = "link", e.EXHIBITORS = "exhibitors", e;
}({}), NI = {
	POI_TYPE: "poiType_",
	CATEGORIES: "categories_",
	POI_TYPES: "poi_types_",
	LINK: "link_"
}, PI = {
	BOOKMARKS: "icon-bookmark",
	VISITED: "icon-checkmark",
	SESSIONS: "icon-schedule",
	EXHIBITORS: "icon-exhibitors"
};
//#endregion
//#region ../../node_modules/.pnpm/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/extends.js
function FI() {
	return FI = Object.assign ? Object.assign.bind() : function(e) {
		for (var t = 1; t < arguments.length; t++) {
			var n = arguments[t];
			for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
		}
		return e;
	}, FI.apply(null, arguments);
}
//#endregion
//#region ../../node_modules/.pnpm/resolve-pathname@3.0.0/node_modules/resolve-pathname/esm/resolve-pathname.js
function II(e) {
	return e.charAt(0) === "/";
}
function LI(e, t) {
	for (var n = t, r = n + 1, i = e.length; r < i; n += 1, r += 1) e[n] = e[r];
	e.pop();
}
function RI(e, t) {
	t === void 0 && (t = "");
	var n = e && e.split("/") || [], r = t && t.split("/") || [], i = e && II(e), a = t && II(t), o = i || a;
	if (e && II(e) ? r = n : n.length && (r.pop(), r = r.concat(n)), !r.length) return "/";
	var s;
	if (r.length) {
		var c = r[r.length - 1];
		s = c === "." || c === ".." || c === "";
	} else s = !1;
	for (var l = 0, u = r.length; u >= 0; u--) {
		var d = r[u];
		d === "." ? LI(r, u) : d === ".." ? (LI(r, u), l++) : l && (LI(r, u), l--);
	}
	if (!o) for (; l--;) r.unshift("..");
	o && r[0] !== "" && (!r[0] || !II(r[0])) && r.unshift("");
	var f = r.join("/");
	return s && f.substr(-1) !== "/" && (f += "/"), f;
}
//#endregion
//#region ../../node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js
var zI = "Invariant failed";
function BI(e, t) {
	if (!e) throw Error(zI);
}
//#endregion
//#region ../../node_modules/.pnpm/history@4.10.1/node_modules/history/esm/history.js
function VI(e) {
	return e.charAt(0) === "/" ? e : "/" + e;
}
function HI(e, t) {
	return e.toLowerCase().indexOf(t.toLowerCase()) === 0 && "/?#".indexOf(e.charAt(t.length)) !== -1;
}
function UI(e, t) {
	return HI(e, t) ? e.substr(t.length) : e;
}
function WI(e) {
	return e.charAt(e.length - 1) === "/" ? e.slice(0, -1) : e;
}
function GI(e) {
	var t = e || "/", n = "", r = "", i = t.indexOf("#");
	i !== -1 && (r = t.substr(i), t = t.substr(0, i));
	var a = t.indexOf("?");
	return a !== -1 && (n = t.substr(a), t = t.substr(0, a)), {
		pathname: t,
		search: n === "?" ? "" : n,
		hash: r === "#" ? "" : r
	};
}
function KI(e) {
	var t = e.pathname, n = e.search, r = e.hash, i = t || "/";
	return n && n !== "?" && (i += n.charAt(0) === "?" ? n : "?" + n), r && r !== "#" && (i += r.charAt(0) === "#" ? r : "#" + r), i;
}
function qI(e, t, n, r) {
	var i;
	typeof e == "string" ? (i = GI(e), i.state = t) : (i = FI({}, e), i.pathname === void 0 && (i.pathname = ""), i.search ? i.search.charAt(0) !== "?" && (i.search = "?" + i.search) : i.search = "", i.hash ? i.hash.charAt(0) !== "#" && (i.hash = "#" + i.hash) : i.hash = "", t !== void 0 && i.state === void 0 && (i.state = t));
	try {
		i.pathname = decodeURI(i.pathname);
	} catch (e) {
		throw e instanceof URIError ? URIError("Pathname \"" + i.pathname + "\" could not be decoded. This is likely caused by an invalid percent-encoding.") : e;
	}
	return n && (i.key = n), r ? i.pathname ? i.pathname.charAt(0) !== "/" && (i.pathname = RI(i.pathname, r.pathname)) : i.pathname = r.pathname : i.pathname || (i.pathname = "/"), i;
}
function JI() {
	var e = null;
	function t(t) {
		return e = t, function() {
			e === t && (e = null);
		};
	}
	function n(t, n, r, i) {
		if (e != null) {
			var a = typeof e == "function" ? e(t, n) : e;
			typeof a == "string" ? typeof r == "function" ? r(a, i) : i(!0) : i(a !== !1);
		} else i(!0);
	}
	var r = [];
	function i(e) {
		var t = !0;
		function n() {
			t && e.apply(void 0, arguments);
		}
		return r.push(n), function() {
			t = !1, r = r.filter(function(e) {
				return e !== n;
			});
		};
	}
	function a() {
		var e = [...arguments];
		r.forEach(function(t) {
			return t.apply(void 0, e);
		});
	}
	return {
		setPrompt: t,
		confirmTransitionTo: n,
		appendListener: i,
		notifyListeners: a
	};
}
var YI = !!(typeof window < "u" && window.document && window.document.createElement);
function XI(e, t) {
	t(window.confirm(e));
}
function ZI() {
	var e = window.navigator.userAgent;
	return (e.indexOf("Android 2.") !== -1 || e.indexOf("Android 4.0") !== -1) && e.indexOf("Mobile Safari") !== -1 && e.indexOf("Chrome") === -1 && e.indexOf("Windows Phone") === -1 ? !1 : window.history && "pushState" in window.history;
}
function QI() {
	return window.navigator.userAgent.indexOf("Trident") === -1;
}
function $I(e) {
	return e.state === void 0 && navigator.userAgent.indexOf("CriOS") === -1;
}
var eL = "popstate", tL = "hashchange";
function nL() {
	try {
		return window.history.state || {};
	} catch {
		return {};
	}
}
function rL(e) {
	e === void 0 && (e = {}), !YI && BI(!1);
	var t = window.history, n = ZI(), r = !QI(), i = e, a = i.forceRefresh, o = a !== void 0 && a, s = i.getUserConfirmation, c = s === void 0 ? XI : s, l = i.keyLength, u = l === void 0 ? 6 : l, d = e.basename ? WI(VI(e.basename)) : "";
	function f(e) {
		var t = e || {}, n = t.key, r = t.state, i = window.location, a = i.pathname, o = i.search, s = i.hash, c = a + o + s;
		return d && (c = UI(c, d)), qI(c, r, n);
	}
	function p() {
		return Math.random().toString(36).substr(2, u);
	}
	var m = JI();
	function h(e) {
		FI(ne, e), ne.length = t.length, m.notifyListeners(ne.location, ne.action);
	}
	function g(e) {
		$I(e) || y(f(e.state));
	}
	function _() {
		y(f(nL()));
	}
	var v = !1;
	function y(e) {
		if (v) v = !1, h();
		else {
			var t = "POP";
			m.confirmTransitionTo(e, t, c, function(n) {
				n ? h({
					action: t,
					location: e
				}) : b(e);
			});
		}
	}
	function b(e) {
		var t = ne.location, n = S.indexOf(t.key);
		n === -1 && (n = 0);
		var r = S.indexOf(e.key);
		r === -1 && (r = 0);
		var i = n - r;
		i && (v = !0, E(i));
	}
	var x = f(nL()), S = [x.key];
	function C(e) {
		return d + KI(e);
	}
	function w(e, r) {
		var i = "PUSH", a = qI(e, r, p(), ne.location);
		m.confirmTransitionTo(a, i, c, function(e) {
			if (e) {
				var r = C(a), s = a.key, c = a.state;
				if (n) if (t.pushState({
					key: s,
					state: c
				}, null, r), o) window.location.href = r;
				else {
					var l = S.indexOf(ne.location.key), u = S.slice(0, l + 1);
					u.push(a.key), S = u, h({
						action: i,
						location: a
					});
				}
				else window.location.href = r;
			}
		});
	}
	function T(e, r) {
		var i = "REPLACE", a = qI(e, r, p(), ne.location);
		m.confirmTransitionTo(a, i, c, function(e) {
			if (e) {
				var r = C(a), s = a.key, c = a.state;
				if (n) if (t.replaceState({
					key: s,
					state: c
				}, null, r), o) window.location.replace(r);
				else {
					var l = S.indexOf(ne.location.key);
					l !== -1 && (S[l] = a.key), h({
						action: i,
						location: a
					});
				}
				else window.location.replace(r);
			}
		});
	}
	function E(e) {
		t.go(e);
	}
	function D() {
		E(-1);
	}
	function O() {
		E(1);
	}
	var k = 0;
	function A(e) {
		k += e, k === 1 && e === 1 ? (window.addEventListener(eL, g), r && window.addEventListener(tL, _)) : k === 0 && (window.removeEventListener(eL, g), r && window.removeEventListener(tL, _));
	}
	var j = !1;
	function ee(e) {
		e === void 0 && (e = !1);
		var t = m.setPrompt(e);
		return j || (A(1), j = !0), function() {
			return j && (j = !1, A(-1)), t();
		};
	}
	function te(e) {
		var t = m.appendListener(e);
		return A(1), function() {
			A(-1), t();
		};
	}
	var ne = {
		length: t.length,
		action: "POP",
		location: x,
		createHref: C,
		push: w,
		replace: T,
		go: E,
		goBack: D,
		goForward: O,
		block: ee,
		listen: te
	};
	return ne;
}
//#endregion
//#region src/services/url-sync.ts
var iL = rL(), aL = window.location.pathname, oL = [], sL = "", cL = !1, lL = !1, uL = 0, dL = () => void 0, fL;
function pL() {
	return oL;
}
function mL(e) {
	if (!sL) return aL + e;
	let t = w(e).search, n = t === "?" ? "" : t;
	return aL + (n ? `${n}&${sL}` : `?${sL}`);
}
function hL() {
	return w(iL.location.search).search;
}
function gL(e) {
	!cL && !lL && iL.push(mL(e));
}
function _L(e) {
	return cL || lL ? !1 : (iL.replace(mL(e)), !0);
}
function vL() {
	cL = !0;
}
function yL(e) {
	cL || (cL = e.offHistory), dL = e.onNavigate, aL = window.location.pathname, sL = w(iL.location.search).platform, cL || oL.push(aL + iL.location.search), fL = iL.listen((e, t) => {
		if (xL(), cL) return;
		let n = aL + e.search;
		oL[oL.length - 1] !== n && oL.push(n), P.log("history", t, e), t === "POP" && dL();
	});
}
function bL() {
	cL = !1, sL = "", oL.length = 0, xL(), fL == null || fL();
}
function xL() {
	lL = !1, window.clearTimeout(uL);
}
function SL() {
	lL = !0, window.clearTimeout(uL), uL = window.setTimeout(xL, 1e3), iL.goBack();
}
//#endregion
//#region src/services/URLFilterManager.ts
var CL, wL, TL;
function EL(e, t, n, r) {
	n && Object.defineProperty(e, t, {
		enumerable: n.enumerable,
		configurable: n.configurable,
		writable: n.writable,
		value: n.initializer ? n.initializer.call(r) : void 0
	});
}
function DL(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var OL = {
	CATEGORIES: "categories",
	POI_TYPE: "poiType",
	POI_TYPES: "poiTypes",
	EXHIBITORS: "exhibitors"
}, kL = (CL = class {
	constructor(e) {
		this.rootStore = e, EL(this, "currentFilters", wL, this), EL(this, "isInitialized", TL, this), this.setupReactions();
	}
	initialize() {
		this.parseURLFilters(), this.applyFiltersToStore(), this.isInitialized = !0, P.log("URLFilterManager initialized with filters:", this.currentFilters);
	}
	parseURLFilters() {
		let { categories: e, poiType: t, poiTypes: n, exhibitors: r } = this.readRawFilters(), i = n.filter((e) => {
			if (!e) return !1;
			let t = this.rootStore.poiTypeStore.poiTypes.some((t) => t.name.toLowerCase() === e.toLowerCase());
			return t || P.warn(`POI type not found in data: ${e}`), t;
		});
		e.length > 0 && (t || i.length > 0) ? (P.warn("URL contains both categories and POI types. Clearing POI types."), this.currentFilters = {
			categories: e,
			poiType: null,
			poiTypes: [],
			exhibitors: r
		}) : this.currentFilters = {
			categories: e,
			poiType: t,
			poiTypes: i,
			exhibitors: r
		}, P.log("URLFilterManager parsed filters:", {
			categories: e,
			poiType: t,
			poiTypes: n,
			exhibitors: r
		}), this.validateFilters(this.currentFilters);
	}
	readRawFilters() {
		let e = i().filters;
		if (Object.keys(e).length > 0) {
			var t, n, r, a;
			return {
				categories: [...(t = e.categories) == null ? [] : t],
				poiType: (n = e.poiType) == null ? null : n,
				poiTypes: [...(r = e.poiTypes) == null ? [] : r],
				exhibitors: (a = e.exhibitors) != null && a
			};
		}
		let o = new URLSearchParams(window.location.search), s = o.get(OL.CATEGORIES), c = s ? Bo(s) : [], l = o.get(OL.POI_TYPE), u = l ? Ho(l) : null, d = o.get(OL.POI_TYPES), f = d ? Bo(d) : [], p = o.get(OL.EXHIBITORS);
		return {
			categories: c,
			poiType: u,
			poiTypes: f,
			exhibitors: p === "true" || p === ""
		};
	}
	applyFiltersToStore() {
		let { uiState: e, categoryFilterStore: t, searchButtonsStore: n } = this.rootStore;
		if (this.currentFilters.categories.length > 0) {
			let n = this.currentFilters.categories.map((e) => this.rootStore.categoryStore.categories.find((t) => t.name.toLowerCase() === e.toLowerCase())).filter((e) => e !== void 0);
			n.length > 0 ? (e.selectedCategoryFilters = n, t.state.selectedItems = n.map((e) => ({
				id: e.id,
				name: e.name
			})), e.categoryFilterOpen = !0, P.log("URLFilterManager applied categories:", n.map((e) => e.name)), setTimeout(() => {
				this.focusOnFilteredBooths(), this.rootStore.searchStore.setFocused(!0);
			}, 100)) : P.warn("URLFilterManager: no categories found for names:", this.currentFilters.categories);
		}
		if (this.currentFilters.poiType) {
			let t = this.rootStore.poiTypeStore.poiTypes.find((e) => e.name.toLowerCase() === this.currentFilters.poiType.toLowerCase());
			t ? (e.selectedPoiTypeFilters = [t], n.setPoiFilterId(`${NI.POI_TYPE}${t.id}`), P.log("URLFilterManager applied POI type:", t.name), setTimeout(() => {
				this.focusOnFilteredBooths(), this.rootStore.searchStore.setFocused(!0);
			}, 100)) : P.warn("URLFilterManager: no POI type found for name:", this.currentFilters.poiType);
		}
		if (this.currentFilters.poiTypes.length > 0) {
			let t = this.currentFilters.poiTypes.map((e) => e ? this.rootStore.poiTypeStore.poiTypes.find((t) => t.name.toLowerCase() === e.toLowerCase()) : null).filter((e) => e != null);
			t.length > 0 ? (e.selectedPoiTypeFilters = t, P.log("URLFilterManager applied POI types:", t.map((e) => e.name)), setTimeout(() => {
				this.focusOnFilteredBooths(), this.rootStore.searchStore.setFocused(!0);
			}, 100)) : (P.warn("URLFilterManager: no POI types found for names:", this.currentFilters.poiTypes), this.currentFilters.poiTypes = []);
		}
		this.currentFilters.exhibitors && this.openExhibitorsList();
	}
	filterSearch() {
		let { uiState: e } = this.rootStore, t = new URLSearchParams();
		if (e.selectedCategoryFilters.length > 0) {
			let n = zo(e.selectedCategoryFilters.map((e) => e.name.toLowerCase()));
			n && t.set(OL.CATEGORIES, n);
		}
		if (e.selectedPoiTypeFilters.length > 0 && e.selectedCategoryFilters.length === 0) if (e.selectedPoiTypeFilters.length === 1) {
			let n = e.selectedPoiTypeFilters[0].name.toLowerCase();
			if (n) {
				let e = Vo(n);
				e && t.set(OL.POI_TYPE, e);
			}
		} else {
			let n = zo(e.selectedPoiTypeFilters.map((e) => e.name.toLowerCase()));
			n && t.set(OL.POI_TYPES, n);
		}
		return this.currentFilters.exhibitors && e.selectedCategoryFilters.length === 0 && e.selectedPoiTypeFilters.length === 0 && t.set(OL.EXHIBITORS, "true"), t.toString() ? `?${t.toString()}` : "";
	}
	updateURLFromFilters() {
		let { uiState: e } = this.rootStore;
		_L(this.filterSearch()), this.currentFilters = {
			categories: e.selectedCategoryFilters.length > 0 ? e.selectedCategoryFilters.map((e) => e.name) : [],
			poiType: e.selectedPoiTypeFilters.length === 1 && e.selectedCategoryFilters.length === 0 ? e.selectedPoiTypeFilters[0].name : null,
			poiTypes: e.selectedPoiTypeFilters.length > 1 && e.selectedCategoryFilters.length === 0 ? e.selectedPoiTypeFilters.map((e) => e.name) : [],
			exhibitors: this.currentFilters.exhibitors
		};
	}
	setCategories(e) {
		this.currentFilters.categories = Uo(e), this.currentFilters.poiType = null, this.isInitialized && this.updateURLFromFilters();
	}
	setPoiType(e) {
		this.currentFilters.poiType = Wo(e), this.currentFilters.poiTypes = [], this.currentFilters.categories = [], this.isInitialized && this.updateURLFromFilters();
	}
	setPoiTypes(e) {
		this.currentFilters.poiTypes = Uo(e), this.currentFilters.poiType = null, this.currentFilters.categories = [], this.isInitialized && this.updateURLFromFilters();
	}
	clearAllFilters() {
		this.currentFilters = {
			categories: [],
			poiType: null,
			poiTypes: [],
			exhibitors: !1
		};
		let { uiState: e } = this.rootStore;
		e.categoryFilterOpen = !1, this.updateURLFromFilters();
	}
	getCurrentFilters() {
		return { ...this.currentFilters };
	}
	setupReactions() {
		N(() => this.rootStore.uiState.selectedCategoryFilters, (e) => {
			if (this.isInitialized && e.length > 0) {
				let t = Uo(e.map((e) => e.name));
				this.setCategories(t);
			}
		}), N(() => this.rootStore.uiState.selectedPoiTypeFilters, (e) => {
			if (this.isInitialized && e.length > 0) if (e.length === 1) {
				let t = Wo(e[0].name);
				t && this.setPoiType(t);
			} else {
				let t = Uo(e.map((e) => e.name));
				this.setPoiTypes(t);
			}
		});
	}
	validateFilters(e) {
		if (e.categories.length > 0 && (e.poiType || e.poiTypes.length > 0)) return P.warn("Categories and POI types cannot be active simultaneously"), !1;
		if (e.poiType && e.poiTypes.length > 0) return P.warn("Both single POI type and multiple POI types cannot be active simultaneously"), !1;
		for (let t of e.categories) if (!this.getCategoryIdByName(t)) return P.warn(`Category not found: ${t}`), !1;
		if (e.poiType && !this.getPoiTypeIdByName(e.poiType)) return P.warn(`POI type not found: ${e.poiType}`), !1;
		for (let t of e.poiTypes) if (!this.getPoiTypeIdByName(t)) return P.warn(`POI type not found: ${t}`), !1;
		return !0;
	}
	getCategoryIdByName(e) {
		let t = this.rootStore.categoryStore.categories.find((t) => t.name.toLowerCase() === e.toLowerCase());
		return t ? t.id : null;
	}
	getPoiTypeIdByName(e) {
		let t = this.rootStore.poiTypeStore.poiTypes.find((t) => t.name.toLowerCase() === e.toLowerCase());
		return t ? t.id : null;
	}
	focusOnFilteredBooths() {
		if (!this.rootStore.layerStore.layersLoaded) {
			N(() => this.rootStore.layerStore.layersLoaded, () => {
				this.focusOnFilteredBooths();
			}, { fireImmediately: !1 });
			return;
		}
		let { uiState: e, exhibitorStore: t, boothStore: n } = this.rootStore, r = [];
		if (e.selectedCategoryFilters.length > 0) {
			let i = t.exhibitors.filter((t) => e.selectedCategoryFilters.some((e) => t.categories.some((t) => t.id === e.id)));
			r = n.booths.filter((e) => i.some((t) => {
				var n;
				return t.id === ((n = e.exhibitors[0]) == null ? void 0 : n.id);
			}));
		}
		if (e.selectedPoiTypeFilters.length > 0) {
			let t = n.booths.filter((t) => e.selectedPoiTypeFilters.some((e) => t.poiTypeId === e.id));
			r = r.length > 0 ? r.filter((e) => t.some((t) => t.id === e.id)) : t;
		}
		let i = r.filter((e) => e.visible);
		i.length > 0 ? (e.moveToBooths = i, this.rootStore.moveToList(i)) : r.length > 0 && (this.rootStore.showMap(), this.rootStore.moveToList(r));
	}
	openExhibitorsList() {
		let { uiState: e } = this.rootStore;
		e.list = {
			type: "exhibitors",
			text: "",
			focused: !1
		}, setTimeout(() => {
			this.rootStore.searchStore.setFocused(!0);
		}, 100), P.log("URLFilterManager opened exhibitors list");
	}
}, wL = DL(CL.prototype, "currentFilters", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return {
			categories: [],
			poiType: null,
			poiTypes: [],
			exhibitors: !1
		};
	}
}), TL = DL(CL.prototype, "isInitialized", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), DL(CL.prototype, "initialize", [C], Object.getOwnPropertyDescriptor(CL.prototype, "initialize"), CL.prototype), DL(CL.prototype, "parseURLFilters", [C], Object.getOwnPropertyDescriptor(CL.prototype, "parseURLFilters"), CL.prototype), DL(CL.prototype, "applyFiltersToStore", [C], Object.getOwnPropertyDescriptor(CL.prototype, "applyFiltersToStore"), CL.prototype), DL(CL.prototype, "updateURLFromFilters", [C], Object.getOwnPropertyDescriptor(CL.prototype, "updateURLFromFilters"), CL.prototype), DL(CL.prototype, "setCategories", [C], Object.getOwnPropertyDescriptor(CL.prototype, "setCategories"), CL.prototype), DL(CL.prototype, "setPoiType", [C], Object.getOwnPropertyDescriptor(CL.prototype, "setPoiType"), CL.prototype), DL(CL.prototype, "setPoiTypes", [C], Object.getOwnPropertyDescriptor(CL.prototype, "setPoiTypes"), CL.prototype), DL(CL.prototype, "clearAllFilters", [C], Object.getOwnPropertyDescriptor(CL.prototype, "clearAllFilters"), CL.prototype), DL(CL.prototype, "focusOnFilteredBooths", [C], Object.getOwnPropertyDescriptor(CL.prototype, "focusOnFilteredBooths"), CL.prototype), DL(CL.prototype, "openExhibitorsList", [C], Object.getOwnPropertyDescriptor(CL.prototype, "openExhibitorsList"), CL.prototype), CL), AL = { "Content-Type": "application/json" };
function jL(e, t) {
	let n = new URL(e, t);
	return n.searchParams.set("expoKey", window.__efpEvent), n.toString();
}
async function ML(e, t) {
	try {
		var n;
		let r = await fetch(jL("/api/kiosks", t), {
			method: "POST",
			headers: AL,
			body: JSON.stringify(e)
		});
		return r.ok ? (n = (await r.json()).key) == null ? null : n : (console.error("createKiosk", r.status, r.statusText), null);
	} catch (e) {
		return console.error("createKiosk", e), null;
	}
}
async function NL(e, t) {
	let n = localStorage.getItem(dI);
	if (n) try {
		let r = await fetch(jL("/api/kiosks", t), {
			method: "POST",
			headers: AL,
			body: JSON.stringify({
				...e,
				key: n
			})
		});
		r.ok || console.error("updateKiosk", r.status, r.statusText);
	} catch (e) {
		console.error("updateKiosk", e);
	}
}
//#endregion
//#region src/components/Kiosk/SetKiosk/Confirm/ConfirmDialog.tsx
function PL({ isDisabled: e, content: t, confirmLabel: n, cancelLabel: r, onConfirm: i, onCancel: a, confirmVariant: o, cancelVariant: s }) {
	return /* @__PURE__ */ (0, R.jsxs)("div", {
		className: "efp-confirm-dialog",
		children: [t && /* @__PURE__ */ (0, R.jsx)("div", {
			className: "efp-confirm-dialog__content",
			children: t
		}), /* @__PURE__ */ (0, R.jsxs)("div", {
			className: "efp-confirm-dialog__controls",
			children: [/* @__PURE__ */ (0, R.jsx)(Pn, {
				size: "md",
				text: n,
				onClick: i,
				disabled: e,
				variant: o
			}), a && /* @__PURE__ */ (0, R.jsx)(Pn, {
				size: "md",
				text: r,
				variant: s,
				onClick: a,
				disabled: e
			})]
		})]
	});
}
//#endregion
//#region src/components/Kiosk/SetKiosk/Message/InfoMessage.tsx
function FL({ list: e }) {
	return e != null && e.length ? /* @__PURE__ */ (0, R.jsx)("div", {
		className: "efp-info-message",
		children: e.map(({ id: e, image: t, content: n }) => /* @__PURE__ */ (0, R.jsxs)("div", {
			className: "efp-info-message__item",
			children: [/* @__PURE__ */ (0, R.jsx)("img", {
				className: "efp-info-message__img",
				src: t.src,
				alt: t.alt,
				width: "30",
				height: "30"
			}), /* @__PURE__ */ (0, R.jsx)("span", { children: n })]
		}, e))
	}) : null;
}
//#endregion
//#region src/components/Kiosk/SetKiosk/FormInput/RangeInput.tsx
function IL({ value: e, name: t, min: n, max: r, step: i, onChange: a, isDisabled: o, symbol: s }) {
	let c = () => a(Math.min(e + i, r)), l = () => a(Math.max(e - i, n)), u = 0;
	r !== n && (u = (e - n) / (r - n) * 100);
	let d = "-50%";
	return u === 0 ? d = "0" : u === 100 && (d = "-100%"), /* @__PURE__ */ (0, R.jsxs)("div", {
		className: "efp-range-input",
		children: [/* @__PURE__ */ (0, R.jsxs)("span", {
			className: "efp-range-input__header",
			children: [
				/* @__PURE__ */ (0, R.jsx)("button", {
					type: "button",
					className: "efp-range-input__control",
					draggable: "false",
					onClick: l,
					disabled: o,
					"aria-label": M("Decrease"),
					children: /* @__PURE__ */ (0, R.jsx)("i", { className: "icon-minus" })
				}),
				/* @__PURE__ */ (0, R.jsxs)("span", {
					className: "efp-no-select",
					children: [
						t,
						" ",
						/* @__PURE__ */ (0, R.jsxs)("strong", { children: [e, s == null ? "" : s] })
					]
				}),
				/* @__PURE__ */ (0, R.jsx)("button", {
					type: "button",
					className: "efp-range-input__control",
					draggable: "false",
					onClick: c,
					disabled: o,
					"aria-label": M("Increase"),
					children: /* @__PURE__ */ (0, R.jsx)("i", { className: "icon-plus" })
				})
			]
		}), /* @__PURE__ */ (0, R.jsxs)("label", {
			className: "efp-range-input__input-block",
			children: [/* @__PURE__ */ (0, R.jsx)("input", {
				className: "efp-range-input__input",
				name: t,
				type: "range",
				min: n,
				max: r,
				step: i,
				value: e,
				disabled: o,
				onChange: (e) => a(Number(e.target.value))
			}), /* @__PURE__ */ (0, R.jsxs)("span", {
				className: "efp-range-input__custom-input",
				children: [/* @__PURE__ */ (0, R.jsx)("span", {
					className: "efp-range-input__progress",
					style: { width: `${u}%` }
				}), /* @__PURE__ */ (0, R.jsx)("span", {
					className: "efp-range-input__thumb",
					style: {
						insetInlineStart: `${u}%`,
						transform: `translateX(${d}) translateY(-50%)`
					}
				})]
			})]
		})]
	});
}
//#endregion
//#region src/components/Kiosk/SetKiosk/SetKioskForm.tsx
function LL({ onSave: e, onDelete: t, isSaveDisabled: n, isDeleteDisabled: r, areControlsDisabled: i, angle: a, onRotateIcon: o, uiScale: s, minUiScale: c, maxUiScale: l, uiScaleStep: u, onUiScaleChange: d, iconSizePercent: f, onChangeIconSizePercent: p }) {
	return /* @__PURE__ */ (0, R.jsx)("div", {
		className: "efp-set-kiosk-form",
		children: /* @__PURE__ */ (0, R.jsxs)("div", {
			className: "efp-set-kiosk-form__content",
			children: [/* @__PURE__ */ (0, R.jsxs)("div", {
				className: "efp-set-kiosk-form__inputs",
				children: [
					/* @__PURE__ */ (0, R.jsx)(IL, {
						value: a,
						name: M("Icon rotation"),
						min: 0,
						max: 360,
						step: 1,
						symbol: "°",
						isDisabled: i,
						onChange: o
					}),
					/* @__PURE__ */ (0, R.jsx)(IL, {
						value: f,
						name: M("Icon size"),
						min: 100,
						max: 300,
						step: 1,
						symbol: "%",
						isDisabled: i,
						onChange: p
					}),
					/* @__PURE__ */ (0, R.jsx)(IL, {
						value: Math.round(s * 100),
						name: M("UI scale"),
						min: c * 100,
						max: l * 100,
						step: u * 100,
						symbol: "%",
						isDisabled: i,
						onChange: (e) => d(e / 100)
					})
				]
			}), /* @__PURE__ */ (0, R.jsxs)("div", {
				className: "efp-set-kiosk-form__controls",
				children: [/* @__PURE__ */ (0, R.jsx)(Pn, {
					size: "md",
					variant: "gray",
					text: M("Delete kiosk"),
					onClick: t,
					disabled: r
				}), /* @__PURE__ */ (0, R.jsx)(Pn, {
					size: "md",
					variant: "primary",
					text: M("Save"),
					onClick: e,
					disabled: n
				})]
			})]
		})
	});
}
//#endregion
//#region src/components/Kiosk/SetKiosk/SetKioskStatusMessages.tsx
var RL = /* @__PURE__ */ e(Nn(), 1);
function zL({ messages: e }) {
	return e != null && e.length ? /* @__PURE__ */ (0, R.jsx)("div", {
		className: "efp-status-messages",
		children: e.map(({ id: e, variant: t, title: n }) => {
			let r = t === "success", i = t === "error";
			return /* @__PURE__ */ (0, R.jsxs)("div", {
				className: (0, RL.default)("efp-status-messages__message", {
					"efp-status-messages__message--success": r,
					"efp-status-messages__message--error": i
				}),
				children: [
					r ? /* @__PURE__ */ (0, R.jsx)("i", { className: "icon-checkmark" }) : null,
					i ? /* @__PURE__ */ (0, R.jsx)("i", { className: "icon-warning-solid" }) : null,
					n
				]
			}, e);
		})
	}) : null;
}
//#endregion
//#region src/components/Kiosk/SetKiosk/SetKioskComponent.tsx
function BL({ isSaveDisabled: e, isDeleteDisabled: t, areControlsDisabled: n, confirmOnClose: r, angle: i, uiScale: a, minUiScale: o, maxUiScale: s, uiScaleStep: c, iconSizePercent: l, isInfoVisible: u, statusMessages: d, onClose: f, onDelete: p, onSave: m, onChange: h }) {
	let [g, _] = (0, L.useState)(null);
	return /* @__PURE__ */ (0, R.jsx)("div", {
		className: "efp-set-kiosk-mode-anchor",
		children: /* @__PURE__ */ (0, R.jsxs)(Vn, {
			className: "efp-set-kiosk-mode",
			children: [
				/* @__PURE__ */ (0, R.jsxs)("div", {
					className: "efp-set-kiosk-mode__header",
					children: [
						/* @__PURE__ */ (0, R.jsx)("img", {
							src: `${k}icons/dragdrop-solid.svg`,
							alt: M("Drag and Drop Icon"),
							width: "24",
							height: "24"
						}),
						/* @__PURE__ */ (0, R.jsx)("span", {
							className: "efp-no-select",
							children: g ? g.title : M("Set Kiosk")
						}),
						/* @__PURE__ */ (0, R.jsx)("button", {
							type: "button",
							draggable: "false",
							className: "efp-set-kiosk-mode__close",
							"aria-label": M("Close"),
							onClick: () => {
								let e = () => {
									_(null);
								}, t = () => {
									f == null || f(), _(null);
								};
								g ? e() : r ? _({
									title: M("Leave without saving?"),
									content: /* @__PURE__ */ (0, R.jsxs)("span", { children: [M("You have changes that "), /* @__PURE__ */ (0, R.jsx)("strong", { children: M("haven't been saved.") })] }),
									confirmLabel: M("Keep editing"),
									cancelLabel: M("Leave"),
									onCancel: t,
									onConfirm: e,
									confirmVariant: "primary",
									cancelVariant: "danger"
								}) : t();
							},
							children: /* @__PURE__ */ (0, R.jsx)("i", { className: "icon-close" })
						})
					]
				}),
				!g && /* @__PURE__ */ (0, R.jsx)(zL, { messages: d }),
				u ? /* @__PURE__ */ (0, R.jsx)(FL, { list: [{
					id: "1",
					image: {
						src: `${k}icons/tap.svg`,
						alt: M("Tap to set or move kiosk.")
					},
					content: /* @__PURE__ */ (0, R.jsxs)("span", { children: [
						M("Tap to "),
						/* @__PURE__ */ (0, R.jsx)("strong", { children: M("set or move") }),
						M(" kiosk.")
					] })
				}, {
					id: "2",
					image: {
						src: `${k}icons/rotate.svg`,
						alt: M("Zoom and rotate the map before saving.")
					},
					content: /* @__PURE__ */ (0, R.jsxs)("span", { children: [/* @__PURE__ */ (0, R.jsx)("strong", { children: M("Zoom and rotate") }), M(" the map before saving.")] })
				}] }) : /* @__PURE__ */ (0, R.jsx)(R.Fragment, { children: g ? /* @__PURE__ */ (0, R.jsx)(PL, { ...g }) : /* @__PURE__ */ (0, R.jsx)(LL, {
					isSaveDisabled: e,
					isDeleteDisabled: t,
					areControlsDisabled: n,
					onSave: () => {
						m == null || m(), _(null);
					},
					onDelete: () => {
						_({
							title: M("Delete kiosk?"),
							content: /* @__PURE__ */ (0, R.jsxs)("span", { children: [M("Are you sure you want to "), /* @__PURE__ */ (0, R.jsx)("strong", { children: M("delete this kiosk?") })] }),
							confirmLabel: M("Cancel"),
							cancelLabel: M("Delete"),
							onConfirm: () => {
								_(null);
							},
							onCancel: () => {
								p == null || p(), _(null);
							},
							confirmVariant: "gray",
							cancelVariant: "danger"
						});
					},
					angle: i,
					onRotateIcon: (e) => h == null ? void 0 : h({ angle: e }),
					uiScale: a,
					minUiScale: o,
					maxUiScale: s,
					uiScaleStep: c,
					onUiScaleChange: (e) => h == null ? void 0 : h({ scale: e }),
					iconSizePercent: l,
					onChangeIconSizePercent: (e) => h == null ? void 0 : h({ percent: e })
				}) })
			]
		})
	});
}
//#endregion
//#region src/components/Kiosk/SetKiosk/getName.ts
var VL = () => pI, HL = () => fI;
//#endregion
//#region src/components/Kiosk/SetKiosk/getKioskUrlParamKey.ts
function UL(e) {
	return `${mI}${e}`;
}
//#endregion
//#region src/tools/telemetry.ts
var WL = "efp-telemetry", GL = 300 * 1e3, KL = 1e3, qL = 63e3;
function JL(e) {
	return e ? `${WL}:${e}` : WL;
}
function YL(e = WL) {
	return {
		get() {
			try {
				let t = localStorage.getItem(e);
				return t ? JSON.parse(t) : null;
			} catch {
				return null;
			}
		},
		set(t) {
			try {
				localStorage.setItem(e, JSON.stringify(t));
			} catch (e) {
				console.error("Failed to persist telemetry data", e);
			}
		},
		clear() {
			try {
				localStorage.removeItem(e);
			} catch (e) {
				console.error("Failed to clear telemetry data", e);
			}
		}
	};
}
function XL(e, t) {
	if (!t) return e;
	let n = e.indexOf("#"), r = n === -1 ? e : e.slice(0, n), i = n === -1 ? "" : e.slice(n), a = "?";
	return r.includes("?") && (a = r.endsWith("?") || r.endsWith("&") ? "" : "&"), `${r}${a}expo=${encodeURIComponent(t)}${i}`;
}
function ZL(e) {
	let t = new TextEncoder(), n = [], r = t.encode(JSON.stringify({
		...e,
		items: []
	})).byteLength;
	for (let i of e.items) {
		let e = t.encode(JSON.stringify(i)).byteLength, a = n.length > 0 ? e + 1 : e;
		if (n.length > 0 && r + a > qL) break;
		r += a, n.push(i);
	}
	let i = n.length === e.items.length ? e : {
		...e,
		items: n
	};
	return {
		payload: i,
		body: JSON.stringify(i),
		bytes: r
	};
}
function QL(e) {
	return e >= 400 && e < 500 && e !== 408 && e !== 429;
}
function $L(e) {
	return e.length <= KL ? e : (console.warn(`Telemetry queue full: dropping ${e.length - KL} oldest events`), e.slice(-1e3));
}
function eR(e) {
	let t = e.headers.get("Retry-After");
	if (!t) return 0;
	let n = 0, r = Number(t);
	if (Number.isFinite(r)) n = r * 1e3;
	else {
		let e = Date.parse(t);
		isNaN(e) || (n = Math.max(0, e - Date.now()));
	}
	return Math.min(n, GL);
}
function tR(e) {
	var t;
	let { url: n, expo: r, expoId: i, storage: a = YL(JL(r)) } = e, o = XL(n, r), s = (t = e.kioskId) == null ? "" : t;
	function c() {
		let e = a.get();
		return e ? (e.expo = r, e.expoId = i, e.kioskId = s, e) : {
			expo: r,
			expoId: i,
			kioskId: s,
			items: []
		};
	}
	function l(e) {
		s = e;
	}
	let u = !1, d = !1, f = 0;
	async function p() {
		if (u) {
			d = !0;
			return;
		}
		u = !0;
		try {
			do {
				if (d = !1, performance.now() < f) break;
				let e = null;
				try {
					let t = c().items.length;
					for (; t > 0;) {
						let n = c();
						if (n.items.length === 0) break;
						let { payload: r, body: i, bytes: a } = ZL(n), s = r.items.length;
						m(n, n.items.slice(s)), e = r.items, t -= s;
						let l = await fetch(o, {
							method: "POST",
							body: i,
							headers: { "Content-Type": "application/json" },
							credentials: "omit",
							keepalive: a <= qL
						});
						if (await l.text().catch(() => void 0), e = null, !l.ok) {
							if (QL(l.status)) {
								console.error(`Telemetry batch refused by the endpoint: HTTP ${l.status} (dropped: ${s})`);
								continue;
							}
							if (l.status === 429 || l.status === 503) {
								let e = eR(l);
								e > 0 && (f = performance.now() + e);
							}
							h(r.items), console.error(`Failed to send telemetry: HTTP ${l.status} (requeued: ${s})`);
							break;
						}
					}
				} catch (t) {
					e && h(e), console.error("Failed to send telemetry", t);
				}
			} while (d);
		} finally {
			u = !1;
		}
	}
	function m(e, t) {
		t.length === 0 ? a.clear() : a.set({
			...e,
			items: t
		});
	}
	function h(e) {
		if (e.length === 0) return;
		let t = c();
		m(t, $L([...e, ...t.items]));
	}
	function g(e) {
		let t = c();
		t.items.push(e), m(t, $L(t.items));
	}
	async function _(e) {
		g(e), await p();
	}
	return {
		enqueue: g,
		send: _,
		flush: p,
		setKioskId: l
	};
}
//#endregion
//#region src/tools/track-event.ts
var nR, rR;
function iR() {
	try {
		return i();
	} catch {
		return;
	}
}
function aR() {
	let e = window.__efpEvent;
	if (nR && rR === e) return nR;
	nR == null || nR.flush();
	let t;
	try {
		var n, r;
		let e = new URL((n = (r = iR()) == null ? void 0 : r.trackerUrl) == null ? "" : n).searchParams.get("expoId");
		t = e ? Number(e) : void 0;
	} catch (e) {
		P.error(e);
	}
	return nR = tR({
		url: "https://app.expofp.com/api/telemetry",
		expo: e,
		expoId: t
	}), rR = e, nR;
}
function oR(e, t, n) {
	let r = pL(), i = r[r.length - 2];
	return {
		type: e,
		subtype: n,
		value: t == null ? "" : String(t),
		timestamp: (/* @__PURE__ */ new Date()).toISOString(),
		url: window.location.href,
		referrer: i ? window.location.origin + i : ""
	};
}
function sR() {
	var e;
	return !!window.__efpEvent && !!((e = iR()) != null && e.trackerUrl) && !$.heatmap;
}
async function cR(e, t, n) {
	if (P.log("trackEvent", e, t, n), sR()) try {
		var r;
		let i = oR(e, t, n), a = _I(), o = null;
		if (a ? o = await uR(a) : localStorage.removeItem(dI), !sR()) return;
		let s = aR();
		if (a && !o) {
			s.enqueue(i);
			return;
		}
		s.setKioskId((r = o) == null ? "" : r), pR(s), await s.send(i);
	} catch (e) {
		P.error("trackEvent", String(e));
	}
}
var lR;
async function uR(e) {
	if (!e) return null;
	let t = localStorage.getItem(dI);
	if (t) return t;
	if (!lR) {
		let t = window.__efpEvent;
		lR = ML(e, "https://app.expofp.com/").then((e) => !e || window.__efpEvent !== t ? null : (localStorage.setItem(dI, e), e)).finally(() => {
			lR = void 0;
		});
	}
	return lR;
}
var dR = !1;
function fR() {
	nR == null || nR.flush(), nR = void 0, rR = void 0, dR = !1;
}
function pR(e) {
	if (dR) return;
	dR = !0;
	let t = "efp-track-events";
	try {
		let r = localStorage.getItem(t);
		if (!r) return;
		let i = JSON.parse(r);
		if (!Array.isArray(i)) {
			localStorage.removeItem(t);
			return;
		}
		for (let t of i) {
			var n;
			!t || typeof t != "object" || !t.headers || e.enqueue({
				type: t.type,
				value: t.value == null ? "" : String(t.value),
				timestamp: t.timeStamp,
				url: t.headers["X-href"],
				referrer: (n = t.headers["X-ref"]) == null ? "" : n
			});
		}
		localStorage.removeItem(t);
	} catch (e) {
		localStorage.removeItem(t), P.error("Failed to migrate old events.", String(e));
	}
}
//#endregion
//#region src/tools/gtag.ts
var mR = "G-78CKLYWFJK";
window.dataLayer = window.dataLayer || [];
function hR(...e) {
	window.dataLayer.push(arguments);
}
var gR = /*#__PURE__*/ function(e) {
	return e.Load = "Load floor plan", e.ViewBooth = "View booth", e.ViewExhibitor = "View exhibitor", e.ViewCategory = "View category", e.Search = "Search", e.ClickCustomButton = "Click custom button", e.ViewVideo = "View video", e.ViewGallery = "View gallery", e.ClickPhone = "Click phone", e.ClickEmail = "Click email", e.ClickWebsite = "Click website", e.ClickFacebook = "Click Facebook", e.ClickInstagaram = "Click Instagram", e.ClickLinkedin = "Click Linkedin", e.ClickTwitter = "Click Twitter", e.ClickGooglePlus = "Click Google Plus", e.ClickXing = "Click Xing", e.ClickYoutube = "Click Youtube", e.ClickBookmark = "Click bookmark", e.ClickDirections = "Click Directions", e.Rendered = "Floor plan rendered", e.WsExhibitorClick = "ws_exhibitor_click", e;
}({});
async function _R() {
	try {
		let e = fetch("https://consent.expofp.com/api/verify-ip/is-in-gdpr"), t = new Promise((e) => {
			setTimeout(() => {
				e(null);
			}, 5e3);
		}), n = await Promise.race([e, t]);
		return n instanceof Response && n.ok ? (await n.json()).result : null;
	} catch (e) {
		return console.error(e), null;
	}
}
function vR(e) {
	if (e === "granted" || e === "denied") return e;
	let t = document.cookie.split("; ").find((e) => e.startsWith("cookie_consent="));
	if (t) return t === "cookie_consent=true" ? "granted" : "denied";
}
function yR(e) {
	let t = 2592e3, n = de ? "localhost" : ".expofp.com";
	document.cookie = `cookie_consent=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${n}`, document.cookie = "cookie_consent=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/", document.cookie = e ? `cookie_consent=${e}; max-age=${t}; domain=${n}; path=/` : `cookie_consent=${e}; max-age=${t}; path=/`;
}
function bR() {
	let e = document.cookie.split(";"), t = de ? "localhost" : ".expofp.com";
	for (let n = 0; n < e.length; n++) {
		let r = e[n], i = r.indexOf("="), a = i > -1 ? r.substr(0, i).trim() : r.trim();
		a.startsWith("_ga") && (document.cookie = `${a}=;expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${t}`);
	}
}
function xR(e) {
	let t = vR(e);
	t && (t === "denied" ? (bR(), z.gtag && (window[`ga-disable-${z.gtag}`] = !0), window[`ga-disable-${mR}`] = !0) : (z.gtag && (window[`ga-disable-${z.gtag}`] = !1), window[`ga-disable-${mR}`] = !1), hR("consent", "update", {
		analytics_storage: t,
		ad_personalization: t
	}));
}
function SR(e, t, n) {
	switch (e) {
		case gR.ViewBooth:
			hR("event", "select_content", {
				content_type: e,
				content_id: t
			}), cR("booview", t);
			break;
		case gR.ViewCategory:
			hR("event", "select_content", {
				content_type: e,
				content_id: t
			}), cR("catview", t);
			break;
		case gR.ViewExhibitor:
		case gR.ViewGallery:
		case gR.ViewVideo:
			hR("event", "select_content", {
				content_type: e,
				content_id: t
			});
			break;
		case gR.Search:
			hR("event", "search", { search_term: t }), cR("search", t);
			break;
		case gR.ClickCustomButton:
		case gR.ClickPhone:
		case gR.ClickEmail:
		case gR.ClickWebsite:
		case gR.ClickFacebook:
		case gR.ClickInstagaram:
		case gR.ClickLinkedin:
		case gR.ClickTwitter:
		case gR.ClickGooglePlus:
		case gR.ClickXing:
		case gR.ClickYoutube:
			hR("event", "share", {
				content_type: e,
				content_id: t
			}), cR("share", t);
			break;
		case gR.ClickBookmark:
			hR("event", "share", {
				content_type: gR.ClickCustomButton,
				content_id: t
			});
			break;
		case gR.ClickDirections:
			hR("event", "route", {
				content_type: e,
				content_id: t
			}), cR("route", t);
			break;
		default: hR("event", e, {
			content_type: n,
			content_id: t
		});
	}
}
function CR(e, t) {
	hR("event", e, {
		...t,
		fp_key: vo.EXPO
	});
}
function wR(e) {
	CR(gR.WsExhibitorClick, {
		exhibitor_id: e.id,
		exhibitor_name: e.name,
		exhibitor_external_id: e.externalId,
		creative_slot: "ws_slider"
	}), cR("ws_exhibitor_click", e.id);
}
var TR, ER;
if (!TR) {
	TR = document.createElement("script"), TR.type = "text/javascript", TR.async = !0, TR.src = `https://www.googletagmanager.com/gtag/js?id=${mR}`;
	let e = document.getElementsByTagName("script")[0];
	e.parentNode.insertBefore(TR, e), hR("js", /* @__PURE__ */ new Date());
}
if (z.gtag && !ER) {
	ER = document.createElement("script"), ER.type = "text/javascript", ER.async = !0, ER.src = `https://www.googletagmanager.com/gtag/js?id=${z.gtag}`;
	let e = document.getElementsByTagName("script")[0];
	e.parentNode.insertBefore(ER, e), hR("config", z.gtag, { fp_key: vo.EXPO });
}
hR("config", mR, { fp_key: vo.EXPO }), window.gtag = hR, hR("consent", "default", {
	ad_storage: "denied",
	analytics_storage: "denied",
	region: /* @__PURE__ */ "BE.BG.CZ.DK.DE.EE.IE.EL.ES.FR.HR.IT.CY.LV.LT.LU.HU.MT.NL.AT.PL.PT.RO.SI.SK.FI.SE.UK.IS.NO.LI.CH.MK.AL.RS.TR".split("."),
	functionality_storage: "denied",
	personalization_storage: "denied",
	security_storage: "denied",
	ad_personalization: "denied"
});
function DR() {
	TR && TR.parentNode && (TR.parentNode.removeChild(TR), TR = null), ER && ER.parentNode && (ER.parentNode.removeChild(ER), ER = null);
}
//#endregion
//#region src/utils/trackingParams.ts
var OR = [
	"_gl",
	"_ga",
	"_ga_[\\w-]+",
	"gclid",
	"gclsrc",
	"gbraid",
	"wbraid",
	"gad_source",
	"fbclid",
	"utm_[\\w-]+"
], kR = RegExp(`^(${OR.join("|")})$`, "i");
function AR(e) {
	let t = e.startsWith("?") ? e.slice(1) : e;
	if (!t) return null;
	let n = t.split("&"), r = n.filter((e) => !kR.test(e.split("=")[0]));
	return r.length === n.length ? null : r.join("&");
}
//#endregion
//#region src/utils/sanitizeText.ts
var jR = (e) => e.trim().replace(/[^a-z0-9]/gi, "");
function MR(e, t = []) {
	if (!e) return "";
	let n = [
		...OR,
		"ref=",
		"lp_id=",
		"lp_token=",
		`${HL()}=`
	].concat(t), r = RegExp(`(^|\\?|&)(${n.join("|")})[^&]*`, "g");
	return e.replace(r, "").replace(/(^|[?&])([^=&#]+)=(?=&|$)/g, (e, t, n) => `${t}${n}`);
}
//#endregion
//#region src/store/BookmarksStore.ts
var NR;
function PR(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var FR = (NR = class {
	constructor(e) {
		this.rootStore = void 0, this.rootStore = e;
	}
	get bookmarkedBooths() {
		return this.rootStore.boothStore.booths.filter((e) => e.exhibitors.length === 0 && e.bookmarkedDirectly);
	}
	get total() {
		return this.rootStore.exhibitorStore.bookmarked.length + this.rootStore.eventStore.bookmarked.length + this.rootStore.speakerStore.bookmarked.length + this.bookmarkedBooths.length;
	}
	get hasRoutableBookmarks() {
		return this.rootStore.exhibitorStore.bookmarked.length > 0 || this.bookmarkedBooths.length > 0;
	}
}, PR(NR.prototype, "bookmarkedBooths", [j], Object.getOwnPropertyDescriptor(NR.prototype, "bookmarkedBooths"), NR.prototype), PR(NR.prototype, "total", [j], Object.getOwnPropertyDescriptor(NR.prototype, "total"), NR.prototype), PR(NR.prototype, "hasRoutableBookmarks", [j], Object.getOwnPropertyDescriptor(NR.prototype, "hasRoutableBookmarks"), NR.prototype), NR), IR, LR;
function RR(e, t, n, r) {
	n && Object.defineProperty(e, t, {
		enumerable: n.enumerable,
		configurable: n.configurable,
		writable: n.writable,
		value: n.initializer ? n.initializer.call(r) : void 0
	});
}
function zR(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var BR = (IR = class {
	get publicRootStore() {
		return this.rootStore;
	}
	constructor(e) {
		this.rootStore = void 0, RR(this, "state", LR, this), this.rootStore = e;
	}
	openFilter() {
		this.state.isOpen = !0, this.state.pendingItems = [...this.state.selectedItems];
	}
	closeFilter() {
		this.state.isOpen = !1, this.state.pendingItems = [], this.rootStore.urlFilterManager && this.rootStore.urlFilterManager.isInitialized && this.rootStore.urlFilterManager.clearAllFilters();
	}
	applyFilter() {
		this.state.selectedItems = [...this.state.pendingItems], this.closeFilter(), this.updateUIState();
	}
	resetFilter() {
		this.state.pendingItems = [];
	}
	clearPendingItems() {
		this.state.pendingItems = [];
	}
	setPendingItems(e) {
		this.state.pendingItems = e;
	}
}, LR = zR(IR.prototype, "state", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return {
			isOpen: !1,
			selectedItems: [],
			pendingItems: []
		};
	}
}), zR(IR.prototype, "openFilter", [C], Object.getOwnPropertyDescriptor(IR.prototype, "openFilter"), IR.prototype), zR(IR.prototype, "closeFilter", [C], Object.getOwnPropertyDescriptor(IR.prototype, "closeFilter"), IR.prototype), zR(IR.prototype, "applyFilter", [C], Object.getOwnPropertyDescriptor(IR.prototype, "applyFilter"), IR.prototype), zR(IR.prototype, "resetFilter", [C], Object.getOwnPropertyDescriptor(IR.prototype, "resetFilter"), IR.prototype), zR(IR.prototype, "clearPendingItems", [C], Object.getOwnPropertyDescriptor(IR.prototype, "clearPendingItems"), IR.prototype), zR(IR.prototype, "setPendingItems", [C], Object.getOwnPropertyDescriptor(IR.prototype, "setPendingItems"), IR.prototype), IR), VR;
function HR(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var UR = (VR = class extends BR {
	get filteredExhibitors() {
		return this.state.selectedItems.length === 0 ? this.rootStore.exhibitorStore.exhibitors : this.rootStore.exhibitorStore.exhibitors.filter((e) => this.state.selectedItems.some((t) => e.categories.some((e) => e.id === t.id)));
	}
	get filteredBooths() {
		return this.rootStore.boothStore.booths.filter((e) => this.filteredExhibitors.some((t) => {
			var n;
			return t.id === ((n = e.exhibitors[0]) == null ? void 0 : n.id);
		}));
	}
	get publicRootStore() {
		return this.rootStore;
	}
	updateUIState() {
		this.rootStore.uiState.menu = !1;
		let e = this.state.selectedItems.map((e) => this.rootStore.categoryStore.categories.find((t) => t.id === e.id)).filter(Boolean);
		this.rootStore.uiState.selectedCategoryFilters = e, this.rootStore.uiState.categoryFilterOpen = !0, this.rootStore.searchStore.setFocused(!0), this.rootStore.moveToList(), this.rootStore.showMap();
		let t = e.map((e) => e.name);
		this.rootStore.urlFilterManager.setCategories(t);
	}
	getFilteredItems() {
		return this.rootStore.exhibitorStore.exhibitors.map((e) => ({
			id: e.id,
			name: e.name
		}));
	}
	getMatchingExhibitorsCount() {
		return this.state.pendingItems.length === 0 ? this.rootStore.exhibitorStore.exhibitors.length : this.rootStore.exhibitorStore.exhibitors.filter((e) => e.categories.some((e) => this.state.pendingItems.some((t) => t.id === e.id))).length;
	}
	resetFilter() {
		this.state.pendingItems = [], this.state.selectedItems = [], this.rootStore.uiState.selectedCategoryFilters = [], this.rootStore.uiState.categoryFilterOpen = !1, this.rootStore.uiState.list = {
			type: "search",
			text: "",
			focused: !1
		}, this.rootStore.urlFilterManager.setCategories([]);
	}
}, HR(VR.prototype, "filteredExhibitors", [j], Object.getOwnPropertyDescriptor(VR.prototype, "filteredExhibitors"), VR.prototype), HR(VR.prototype, "filteredBooths", [j], Object.getOwnPropertyDescriptor(VR.prototype, "filteredBooths"), VR.prototype), HR(VR.prototype, "resetFilter", [C], Object.getOwnPropertyDescriptor(VR.prototype, "resetFilter"), VR.prototype), VR), WR, GR;
function KR(e, t, n, r) {
	n && Object.defineProperty(e, t, {
		enumerable: n.enumerable,
		configurable: n.configurable,
		writable: n.writable,
		value: n.initializer ? n.initializer.call(r) : void 0
	});
}
function qR(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var JR = (WR = class {
	constructor(e) {
		this.keys = e, KR(this, "engine", GR, this), this.enginePromise = null, this.lastCollection = null;
	}
	loadEngine() {
		return this.enginePromise || (this.enginePromise = this.buildEngine()), this.enginePromise;
	}
	async buildEngine() {
		try {
			let { default: e } = await import("./fuse-Didw830W.js").then((e) => e.n);
			se(() => {
				this.engine = new e([], {
					keys: this.keys,
					ignoreFieldNorm: !0,
					includeScore: !0,
					threshold: .3,
					ignoreLocation: !0
				});
			});
		} catch (e) {
			console.error(e), this.enginePromise = null;
		}
	}
	search(e, t) {
		return !this.engine || !(e != null && e.length) || !t ? [] : (this.lastCollection !== e && (this.engine.setCollection(e), this.lastCollection = e), this.engine.search(t));
	}
}, GR = qR(WR.prototype, "engine", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: null
}), WR), YR, XR, ZR;
function QR(e, t, n, r) {
	n && Object.defineProperty(e, t, {
		enumerable: n.enumerable,
		configurable: n.configurable,
		writable: n.writable,
		value: n.initializer ? n.initializer.call(r) : void 0
	});
}
function $R(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var ez = (YR = class {
	constructor() {
		QR(this, "enabled", XR, this), QR(this, "unreadCount", ZR, this);
	}
	setEnabled(e) {
		this.enabled = e;
	}
	setUnreadCount(e) {
		this.unreadCount = e;
	}
}, XR = $R(YR.prototype, "enabled", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), ZR = $R(YR.prototype, "unreadCount", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return 0;
	}
}), $R(YR.prototype, "setEnabled", [C], Object.getOwnPropertyDescriptor(YR.prototype, "setEnabled"), YR.prototype), $R(YR.prototype, "setUnreadCount", [C], Object.getOwnPropertyDescriptor(YR.prototype, "setUnreadCount"), YR.prototype), YR), tz = oo().__fpGeo, nz, rz, iz, az, oz, sz, cz, lz, uz;
function dz(e, t, n, r) {
	n && Object.defineProperty(e, t, {
		enumerable: n.enumerable,
		configurable: n.configurable,
		writable: n.writable,
		value: n.initializer ? n.initializer.call(r) : void 0
	});
}
function fz(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var pz = !0;
function mz() {
	return typeof window > "u" || window.navigator.onLine;
}
var hz = (nz = j({ keepAlive: !0 }), rz = j({ keepAlive: !0 }), iz = j({ keepAlive: !0 }), az = j({ keepAlive: !0 }), oz = j({ keepAlive: !0 }), sz = class {
	constructor(e) {
		this.rootStore = void 0, dz(this, "mapViewMode", cz, this), dz(this, "maplibreSelected", lz, this), dz(this, "isOnline", uz, this), this.cameraPortBox = y.box(null, { deep: !1 }), this.handleOnline = () => this.setOnline(!0), this.handleOffline = () => this.setOnline(!1), this.rootStore = e, this.mapViewMode = this.getInitialViewMode(), this.maplibreSelected = this.mapViewMode !== "floorplan", typeof window < "u" && (window.addEventListener("online", this.handleOnline), window.addEventListener("offline", this.handleOffline));
	}
	dispose() {
		typeof window > "u" || (window.removeEventListener("online", this.handleOnline), window.removeEventListener("offline", this.handleOffline));
	}
	setOnline(e) {
		this.isOnline = e;
	}
	get cameraPort() {
		return this.cameraPortBox.get();
	}
	setCameraPort(e) {
		this.cameraPortBox.set(e);
	}
	clearCameraPortIfCurrent(e) {
		this.cameraPortBox.get() === e && this.cameraPortBox.set(null);
	}
	activateMaplibre() {
		this.maplibreEnabled && (this.mapViewMode = z.allow3dView && this.mapViewMode !== "map3d" ? "map3d" : "map2d", this.maplibreSelected = !0);
	}
	deactivateMaplibre() {
		this.mapViewMode = "floorplan", this.maplibreSelected = !1;
	}
	get hideModeSwitchButton() {
		return !this.maplibreEnabled || !z.allow3dView || pz;
	}
	get maplibreEnabled() {
		var e, t, n;
		let r = (e = (t = this.rootStore.fp) == null ? void 0 : t.maplibre) == null ? window.__efpMaplibre : e, i = !!(r != null && r.offline) && (!!r.style || !!r.styleUrl);
		return this.useMaplibreMap && !!(!(tz == null || (n = tz.properties) == null) && n.config) && (this.isOnline || i);
	}
	get useMaplibreMap() {
		var e, t;
		return (e = z.enableExperimentalMaplibre) == null ? (tz == null || (t = tz.properties) == null || (t = t.config) == null ? void 0 : t.type) === "maplibre" : e;
	}
	get showMaplibre() {
		return this.maplibreEnabled && (this.mapViewMode === "map2d" || this.mapViewMode === "map3d");
	}
	get isMap3d() {
		return this.maplibreEnabled && this.mapViewMode === "map3d";
	}
	getInitialViewMode() {
		return this.maplibreEnabled ? this.rootStore.uiState.is3DView ? "map3d" : "map2d" : "floorplan";
	}
}, cz = fz(sz.prototype, "mapViewMode", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return "floorplan";
	}
}), lz = fz(sz.prototype, "maplibreSelected", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), uz = fz(sz.prototype, "isOnline", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return mz();
	}
}), fz(sz.prototype, "setOnline", [C], Object.getOwnPropertyDescriptor(sz.prototype, "setOnline"), sz.prototype), fz(sz.prototype, "setCameraPort", [C], Object.getOwnPropertyDescriptor(sz.prototype, "setCameraPort"), sz.prototype), fz(sz.prototype, "clearCameraPortIfCurrent", [C], Object.getOwnPropertyDescriptor(sz.prototype, "clearCameraPortIfCurrent"), sz.prototype), fz(sz.prototype, "activateMaplibre", [C], Object.getOwnPropertyDescriptor(sz.prototype, "activateMaplibre"), sz.prototype), fz(sz.prototype, "deactivateMaplibre", [C], Object.getOwnPropertyDescriptor(sz.prototype, "deactivateMaplibre"), sz.prototype), fz(sz.prototype, "hideModeSwitchButton", [nz], Object.getOwnPropertyDescriptor(sz.prototype, "hideModeSwitchButton"), sz.prototype), fz(sz.prototype, "maplibreEnabled", [rz], Object.getOwnPropertyDescriptor(sz.prototype, "maplibreEnabled"), sz.prototype), fz(sz.prototype, "useMaplibreMap", [iz], Object.getOwnPropertyDescriptor(sz.prototype, "useMaplibreMap"), sz.prototype), fz(sz.prototype, "showMaplibre", [az], Object.getOwnPropertyDescriptor(sz.prototype, "showMaplibre"), sz.prototype), fz(sz.prototype, "isMap3d", [oz], Object.getOwnPropertyDescriptor(sz.prototype, "isMap3d"), sz.prototype), sz);
//#endregion
//#region src/components/Map/camera.ts
function gz(e) {
	return {
		get api() {
			return e.current.api;
		},
		state: () => e.current.state()
	};
}
function _z(e) {
	yz = e;
}
function vz() {
	return yz;
}
var yz, bz = 1.4, xz = 4.2;
function Sz(e) {
	var t;
	return (e == null || (t = e.toLowerCase) == null ? void 0 : t.call(e).trim()) === "m" ? bz : xz;
}
//#endregion
//#region src/utils/calcTravelTime.ts
function Cz(e, t) {
	return Math.round(e / t);
}
//#endregion
//#region src/utils/planBearing.ts
function wz(e) {
	return (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + e * Math.PI / 360))) / 360;
}
function Tz(e, t) {
	let n = (Math.atan2(wz(t.lat) - wz(e.lat), (t.lng - e.lng) / 360) - Math.atan2(t.y - e.y, t.x - e.x)) * 180 / Math.PI % 360;
	return Number.isFinite(n) ? (n + 360) % 360 : NaN;
}
//#endregion
//#region src/utils/gps.ts
function Ez(e) {
	return [{
		local: {
			x: e.p0.x,
			y: e.p0.y
		},
		geo: {
			lat: e.p0.lat,
			lng: e.p0.lng
		}
	}, {
		local: {
			x: e.p2.x,
			y: e.p2.y
		},
		geo: {
			lat: e.p2.lat,
			lng: e.p2.lng
		}
	}];
}
function Dz(e) {
	return typeof e == "number" && Number.isFinite(e);
}
function Oz({ lat: e, lng: t, angle: n }, r) {
	if (!(Dz(e) && Dz(t))) return null;
	let { p0: i, p2: a } = r, o = Rr(i, a);
	if (!Dz(o) || o <= 0) return P.warn("Invalid GPS config: zero or negative distance", {
		fullGpsDistance: o,
		p0: i,
		p2: a
	}), null;
	let [s, c] = Ez(r), l = Hr({
		lat: e,
		lng: t
	}, s, c);
	return Ur({
		p0: l,
		p1: Wr({
			p0: i,
			p1: a
		})
	}) > 5 * Yn(i, a) ? (P.warn("Current position too far"), null) : {
		...l,
		angle: n
	};
}
function kz(e, t, n) {
	let [r, i] = Ez(n), { lat: a, lng: o } = Vr({
		x: e,
		y: t
	}, r, i);
	return [o, a];
}
function Az(e) {
	var t, n;
	let r = tz == null || (t = tz.properties) == null ? void 0 : t.config, i = r ? Tz(r.p0, r.p2) : NaN, a = Number.isFinite(i) ? i : (n = r == null ? void 0 : r.bearing) == null ? 0 : n;
	return (e == null ? void 0 : e.angle) === null ? 0 : (((e.angle - a) % 360 + 360) % 360 - 90 + 360) % 360;
}
//#endregion
//#region ../wayfinding/src/core/graph/buildGraph.ts
function jz(e, t, n) {
	var r, i;
	return t.build(e.getLines(), {
		oriented: (r = n.oriented) == null || r,
		onlyAccessible: (i = n.onlyAccessible) != null && i
	}), {
		finder: t,
		dataSource: e,
		options: n
	};
}
//#endregion
//#region ../../node_modules/.pnpm/ngraph.events@1.4.0/node_modules/ngraph.events/dist/ngraph.events.cjs
var Mz = /* @__PURE__ */ t(((e, t) => {
	function n(e) {
		i(e);
		let t = r(e);
		return e.on = t.on, e.off = t.off, e.fire = t.fire, e;
	}
	function r(e) {
		let t = Object.create(null);
		return {
			on: function(n, r, i) {
				if (typeof r != "function") throw Error("callback is expected to be a function");
				let a = t[n];
				return a || (a = t[n] = []), a.push({
					callback: r,
					ctx: i
				}), e;
			},
			off: function(n, r) {
				if (typeof n > "u") return t = Object.create(null), e;
				if (t[n]) if (typeof r != "function") delete t[n];
				else {
					let e = t[n];
					for (let t = 0; t < e.length; ++t) e[t].callback === r && e.splice(t, 1);
				}
				return e;
			},
			fire: function(n) {
				let r = t[n];
				if (!r) return e;
				let i;
				arguments.length > 1 && (i = Array.prototype.slice.call(arguments, 1));
				for (let e = 0; e < r.length; ++e) {
					let t = r[e];
					t.callback.apply(t.ctx, i);
				}
				return e;
			}
		};
	}
	function i(e) {
		if (!e) throw Error("Eventify cannot use falsy object as events subject");
		let t = [
			"on",
			"fire",
			"off"
		];
		for (let n = 0; n < t.length; ++n) if (e.hasOwnProperty(t[n])) throw Error("Subject cannot be eventified, since it already has property '" + t[n] + "'");
	}
	t.exports = n;
})), Nz = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
	t.exports = r;
	var n = Mz();
	function r(e) {
		if (e = e || {}, "uniqueLinkId" in e && (console.warn("ngraph.graph: Starting from version 0.14 `uniqueLinkId` is deprecated.\nUse `multigraph` option instead\n", "\n", "Note: there is also change in default behavior: From now on each graph\nis considered to be not a multigraph by default (each edge is unique)."), e.multigraph = e.uniqueLinkId), e.multigraph === void 0 && (e.multigraph = !1), typeof Map != "function") throw Error("ngraph.graph requires `Map` to be defined. Please polyfill it before using ngraph");
		var t = /* @__PURE__ */ new Map(), r = [], l = {}, u = 0, d = e.multigraph ? E : T, f = [], p = ie, m = ie, h = ie, g = ie, _ = {
			addNode: x,
			addLink: w,
			removeLink: A,
			removeNode: C,
			getNode: S,
			getNodeCount: D,
			getLinkCount: O,
			getLinksCount: O,
			getNodesCount: D,
			getLinks: k,
			forEachNode: oe,
			forEachLinkedNode: ne,
			forEachLink: te,
			beginUpdate: h,
			endUpdate: g,
			clear: ee,
			hasLink: j,
			hasNode: S,
			getLink: j
		};
		return n(_), v(), _;
		function v() {
			var e = _.on;
			_.on = t;
			function t() {
				return _.beginUpdate = h = ae, _.endUpdate = g = N, p = y, m = b, _.on = e, e.apply(_, arguments);
			}
		}
		function y(e, t) {
			f.push({
				link: e,
				changeType: t
			});
		}
		function b(e, t) {
			f.push({
				node: e,
				changeType: t
			});
		}
		function x(e, n) {
			if (e === void 0) throw Error("Invalid node identifier");
			h();
			var r = S(e);
			return r ? (r.data = n, m(r, "update")) : (r = new a(e, n), m(r, "add")), t.set(e, r), g(), r;
		}
		function S(e) {
			return t.get(e);
		}
		function C(e) {
			var n = S(e);
			if (!n) return !1;
			h();
			var r = n.links;
			if (r) {
				n.links = null;
				for (var i = 0; i < r.length; ++i) A(r[i]);
			}
			return t.delete(e), m(n, "remove"), g(), !0;
		}
		function w(e, t, n) {
			h();
			var i = S(e) || x(e), a = S(t) || x(t), s = d(e, t, n);
			return r.push(s), o(i, s), e !== t && o(a, s), p(s, "add"), g(), s;
		}
		function T(e, t, n) {
			return new s(e, t, n, c(e, t));
		}
		function E(e, t, n) {
			var r = c(e, t), i = l.hasOwnProperty(r);
			if (i || j(e, t)) {
				i || (l[r] = 0);
				var a = "@" + ++l[r];
				r = c(e + a, t + a);
			}
			return new s(e, t, n, r);
		}
		function D() {
			return t.size;
		}
		function O() {
			return r.length;
		}
		function k(e) {
			var t = S(e);
			return t ? t.links : null;
		}
		function A(e) {
			if (!e) return !1;
			var t = i(e, r);
			if (t < 0) return !1;
			h(), r.splice(t, 1);
			var n = S(e.fromId), a = S(e.toId);
			return n && (t = i(e, n.links), t >= 0 && n.links.splice(t, 1)), a && (t = i(e, a.links), t >= 0 && a.links.splice(t, 1)), p(e, "remove"), g(), !0;
		}
		function j(e, t) {
			var n = S(e), r;
			if (!n || !n.links) return null;
			for (r = 0; r < n.links.length; ++r) {
				var i = n.links[r];
				if (i.fromId === e && i.toId === t) return i;
			}
			return null;
		}
		function ee() {
			h(), oe(function(e) {
				C(e.id);
			}), g();
		}
		function te(e) {
			var t, n;
			if (typeof e == "function") for (t = 0, n = r.length; t < n; ++t) e(r[t]);
		}
		function ne(e, t, n) {
			var r = S(e);
			if (r && r.links && typeof t == "function") return n ? M(r.links, e, t) : re(r.links, e, t);
		}
		function re(e, n, r) {
			for (var i, a = 0; a < e.length; ++a) {
				var o = e[a], s = o.fromId === n ? o.toId : o.fromId;
				if (i = r(t.get(s), o), i) return !0;
			}
		}
		function M(e, n, r) {
			for (var i, a = 0; a < e.length; ++a) {
				var o = e[a];
				if (o.fromId === n && (i = r(t.get(o.toId), o), i)) return !0;
			}
		}
		function ie() {}
		function ae() {
			u += 1;
		}
		function N() {
			--u, u === 0 && f.length > 0 && (_.fire("changed", f), f.length = 0);
		}
		function oe(e) {
			if (typeof e != "function") throw Error("Function is expected to iterate over graph nodes. You passed " + e);
			for (var n = t.values(), r = n.next(); !r.done;) {
				if (e(r.value)) return !0;
				r = n.next();
			}
		}
	}
	function i(e, t) {
		if (!t) return -1;
		if (t.indexOf) return t.indexOf(e);
		var n = t.length, r;
		for (r = 0; r < n; r += 1) if (t[r] === e) return r;
		return -1;
	}
	function a(e, t) {
		this.id = e, this.links = null, this.data = t;
	}
	function o(e, t) {
		e.links ? e.links.push(t) : e.links = [t];
	}
	function s(e, t, n, r) {
		this.fromId = e, this.toId = t, this.data = n, this.id = r;
	}
	function c(e, t) {
		return e.toString() + "👉 " + t.toString();
	}
})))(), 1), Pz = (e) => {
	var t;
	return `${(t = e.layer) == null ? "" : t}_${e.x}_${e.y}`;
}, Fz = 1, Iz = (e, t) => {
	var n, r;
	return ((n = e.layer) == null ? "" : n) === ((r = t.layer) == null ? "" : r) && Yn(e, t) <= Fz;
}, Lz = (e, t, n) => Iz(e.p0, t) && Iz(e.p1, n) || Iz(e.p0, n) && Iz(e.p1, t);
function Rz(e, t, n) {
	return e.find((e) => Lz(e, t, n));
}
var zz = Hn(5);
function Bz(e, t) {
	if (e.virtual !== t.virtual) return !1;
	let n = Gr(e.p0, e.p1), r = Gr(t.p0, t.p1), i = Math.abs(r - n);
	return i > Math.PI && (i = 2 * Math.PI - i), i <= zz;
}
function Vz(e, t) {
	let n = [];
	for (let r = 1; r < e.length; r++) {
		let i = e[r - 1], a = e[r], o = Rz(t, i, a);
		if (!o) {
			console.warn(`WF: buildRouteSegments — no line found between ${Pz(i)} and ${Pz(a)}`);
			continue;
		}
		let s = {
			p0: i,
			p1: a,
			virtual: o.virtual
		}, c = n[n.length - 1];
		c && Bz(c, s) ? n[n.length - 1] = {
			...c,
			p1: s.p1
		} : n.push(s);
	}
	return n;
}
//#endregion
//#region ../wayfinding/src/core/graph/constants.ts
var Hz = 1e4, Uz = 1.01;
//#endregion
//#region ../wayfinding/src/core/graph/linkCost.ts
function Wz(e) {
	return Yn(e.p0, e.p1) / (e.weight || 4);
}
function Gz(e) {
	var t, n;
	return ((t = e.p0.layer) == null ? "" : t) !== ((n = e.p1.layer) == null ? "" : n);
}
function Kz(e) {
	return e.virtual ? e.virtualLength == null ? Gz(e) ? Hz : 0 : e.virtualLength : Wz(e);
}
//#endregion
//#region ../wayfinding/src/core/graph/buildNGraph.ts
function qz(e, t) {
	let { oriented: n, onlyAccessible: r } = t, i = (0, Nz.default)();
	for (let t of e) {
		if (r && t.unaccessible) continue;
		let e = Pz(t.p0), a = Pz(t.p1), o = Kz(t);
		i.addLink(e, a, { distance: o }), n && !t.unidirection && i.addLink(a, e, { distance: o });
	}
	return i;
}
//#endregion
//#region ../wayfinding/src/core/graph/utils/a-star/defaultSettings.js
var Jz = [];
typeof Object.freeze == "function" && Object.freeze(Jz);
var Yz = {
	heuristic: Xz,
	distance: Zz,
	blocked: Qz,
	compareFScore: $z,
	NO_PATH: Jz,
	setHeapIndex: eB,
	setH1: rB,
	setH2: iB,
	compareF1Score: tB,
	compareF2Score: nB
};
function Xz() {
	return 0;
}
function Zz() {
	return 1;
}
function Qz() {
	return !1;
}
function $z(e, t) {
	return e.fScore - t.fScore;
}
function eB(e, t) {
	e.heapIndex = t;
}
function tB(e, t) {
	return e.f1 - t.f1;
}
function nB(e, t) {
	return e.f2 - t.f2;
}
function rB(e, t) {
	e.h1 = t;
}
function iB(e, t) {
	e.h2 = t;
}
//#endregion
//#region ../wayfinding/src/core/graph/utils/a-star/makeSearchStatePool.js
function aB(e) {
	this.node = e, this.parent = null, this.closed = !1, this.open = 0, this.distanceToSource = Infinity, this.fScore = Infinity, this.heapIndex = -1;
}
function oB() {
	let e = 0, t = [];
	return {
		createNewState: r,
		reset: n
	};
	function n() {
		e = 0;
	}
	function r(n) {
		let r = t[e];
		return r ? (r.node = n, r.parent = null, r.closed = !1, r.open = 0, r.distanceToSource = Infinity, r.fScore = Infinity, r.heapIndex = -1) : (r = new aB(n), t[e] = r), e++, r;
	}
}
//#endregion
//#region ../wayfinding/src/core/graph/utils/a-star/NodeHeap.js
function sB(e, t) {
	if (!(this instanceof sB)) return new sB(e, t);
	if (Array.isArray(e) || (t = e, e = []), t = t || {}, this.data = e || [], this.length = this.data.length, this.compare = t.compare || lB, this.setNodeId = t.setNodeId || cB, this.length > 0) for (let e = this.length >> 1; e >= 0; e--) this._down(e);
	if (t.setNodeId) for (let e = 0; e < this.length; ++e) this.setNodeId(this.data[e], e);
}
function cB() {}
function lB(e, t) {
	return e - t;
}
sB.prototype = {
	push: function(e) {
		this.data.push(e), this.setNodeId(e, this.length), this.length++, this._up(this.length - 1);
	},
	pop: function() {
		if (this.length === 0) return;
		let e = this.data[0];
		return this.length--, this.length > 0 && (this.data[0] = this.data[this.length], this.setNodeId(this.data[0], 0), this._down(0)), this.data.pop(), e;
	},
	peek: function() {
		return this.data[0];
	},
	updateItem: function(e) {
		this._down(e), this._up(e);
	},
	_up: function(e) {
		let t = this.data, n = this.compare, r = this.setNodeId, i = t[e];
		for (; e > 0;) {
			let a = e - 1 >> 1, o = t[a];
			if (n(i, o) >= 0) break;
			t[e] = o, r(o, e), e = a;
		}
		t[e] = i, r(i, e);
	},
	_down: function(e) {
		let t = this.data, n = this.compare, r = this.length >> 1, i = t[e], a = this.setNodeId;
		for (; e < r;) {
			let r = (e << 1) + 1, o = r + 1, s = t[r];
			if (o < this.length && n(t[o], s) < 0 && (r = o, s = t[o]), n(s, i) >= 0) break;
			t[e] = s, a(s, e), e = r;
		}
		t[e] = i, a(i, e);
	}
};
//#endregion
//#region ../wayfinding/src/core/graph/utils/a-star/a-star.js
var uB = Yz.NO_PATH;
function dB(e, t) {
	t = t || {};
	let n = t.oriented, r = t.blocked;
	r || (r = Yz.blocked);
	let i = t.heuristic;
	i || (i = Yz.heuristic);
	let a = t.distance;
	a || (a = Yz.distance);
	let o = oB();
	return { find: s };
	function s(t, s) {
		let c = e.getNode(t);
		if (!c) throw Error("fromId is not defined in this graph: " + t);
		let l = e.getNode(s);
		if (!l) throw Error("toId is not defined in this graph: " + s);
		o.reset();
		let u = /* @__PURE__ */ new Map(), d = new sB({
			compare: Yz.compareFScore,
			setNodeId: Yz.setHeapIndex
		}), f = o.createNewState(c);
		u.set(t, f), f.fScore = i(c, l), f.distanceToSource = 0, d.push(f), f.open = 1;
		let p;
		for (; d.length > 0;) {
			if (p = d.pop(), fB(p, l)) return pB(p);
			p.closed = !0, e.forEachLinkedNode(p.node.id, m, n);
		}
		return uB;
		function m(e, t) {
			let n = u.get(e.id);
			if (n || (n = o.createNewState(e), u.set(e.id, n)), n.closed || (n.open === 0 && (d.push(n), n.open = 1), r(e, p.node, t))) return;
			let s = p.distanceToSource + a(e, p, t);
			s >= n.distanceToSource || (n.parent = p, n.distanceToSource = s, n.fScore = s + i(n.node, l), d.updateItem(n.heapIndex));
		}
	}
}
function fB(e, t) {
	return e.node === t;
}
function pB(e) {
	let t = [e.node], n = e.parent;
	for (; n;) t.push(n.node), n = n.parent;
	return t;
}
//#endregion
//#region ../wayfinding/src/core/graph/pathfinder/parseNodeId.ts
function mB(e) {
	let t = e.lastIndexOf("_"), n = e.lastIndexOf("_", t - 1);
	if (n === -1) throw Error(`WF: invalid node ID format "${e}", expected "{layer}_{x}_{y}"`);
	return [
		e.substring(0, n),
		parseFloat(e.substring(n + 1, t)),
		parseFloat(e.substring(t + 1))
	];
}
//#endregion
//#region ../wayfinding/src/core/graph/pathfinder/aStarPathFinder.ts
function hB() {
	return function(e, t, n) {
		let r = 1;
		if (t.parent) {
			let [, n, i] = mB(t.parent.node.id), [, a, o] = mB(t.node.id), [, s, c] = mB(e.id);
			Gr({
				x: n,
				y: i
			}, {
				x: a,
				y: o
			}) !== Gr({
				x: a,
				y: o
			}, {
				x: s,
				y: c
			}) && (r = Uz);
		}
		return r * n.data.distance;
	};
}
function gB() {
	let e = null, t = null;
	return {
		build(n, r) {
			t = qz(n, r), e = dB(t, {
				oriented: r.oriented,
				distance: hB()
			});
		},
		hasNode(e) {
			return t ? !!t.hasNode(e) : !1;
		},
		find(t, n) {
			if (!e) return [];
			let r = e.find(t, n);
			return r.length ? r.map((e) => {
				let [t, n, r] = mB(e.id);
				return {
					id: e.id,
					layer: t,
					x: n,
					y: r
				};
			}).reverse() : [];
		}
	};
}
//#endregion
//#region ../wayfinding/src/core/graph/graphCache.ts
function _B() {
	let e = null, t = !1;
	return { getOrBuild(n, r) {
		return e && t === r ? e : (e = jz(n, gB(), {
			oriented: !0,
			onlyAccessible: r
		}), t = r, e);
	} };
}
//#endregion
//#region ../wayfinding/src/core/routing/getRouteLength.ts
function vB(e) {
	return e.reduce((e, t) => e + Yn(t.p0, t.p1), 0);
}
//#endregion
//#region ../wayfinding/src/core/graph/findShortestPath.ts
function yB(e, t, n) {
	return {
		layer: e,
		x: t,
		y: n
	};
}
function bB(e, t) {
	let n = 0;
	for (let r = 1; r < e.length; r++) {
		let i = Rz(t, e[r - 1], e[r]);
		i && (n += Kz(i));
	}
	return n;
}
function xB(e, t, n) {
	let r = e.dataSource.getLines(), i = null, a = Infinity;
	for (let o of t) for (let t of n) {
		let n = Pz(o), s = Pz(t);
		if (!e.finder.hasNode(n) || !e.finder.hasNode(s)) {
			console.debug(`WF. findShortestPath: node not in graph, skipping pair ${n} → ${s}`);
			continue;
		}
		let c = e.finder.find(n, s);
		if (!c.length) continue;
		let l = c.map((e) => yB(e.layer, e.x, e.y)), u = Vz(l, r);
		if (!u.length) continue;
		let d = bB(l, r);
		d < a && (a = d, i = {
			lines: u,
			distance: vB(u)
		});
	}
	return i;
}
//#endregion
//#region ../wayfinding/src/core/routing/routeResult.ts
var SB = () => ({
	lines: [],
	totalDistance: 0
});
//#endregion
//#region ../wayfinding/src/core/routing/buildRoute.ts
function CB(e, t, n) {
	if (!t.length || !n.length) return SB();
	let r = xB(e, t, n);
	return r ? {
		lines: r.lines,
		totalDistance: r.distance
	} : SB();
}
//#endregion
//#region ../wayfinding/src/core/routing/buildMultiPointRoute.ts
function wB(e, t) {
	if (t.length < 2) return SB();
	let n = t.filter((e, n) => n === 0 || n === t.length - 1 || e.length > 0);
	if (n.length < 2) return SB();
	if (n.length === 2) return CB(e, n[0], n[1]);
	let r = [];
	for (let t = 0; t < n.length - 1; t++) r.push(CB(e, n[t], n[t + 1]));
	return {
		lines: r.flatMap((e) => e.lines),
		totalDistance: r.reduce((e, t) => e + t.totalDistance, 0)
	};
}
//#endregion
//#region ../wayfinding/src/core/routing/optimizeWaypointOrder.ts
var TB = 100, EB = -.01;
function DB(e) {
	let t = new Map(e), n = Array.from(t.keys());
	if (n.length <= 2) return n;
	let r = kB(n, t);
	return r.length < 4 ? r : AB(r, t);
}
function OB(e) {
	if (e.length <= 3) return e;
	let t = e[0], n = e[e.length - 1], r = e.slice(1, -1);
	return [
		t,
		...DB(r.map((e, t) => [String(t), {
			x: e.x,
			y: e.y
		}])).map((e) => r[Number(e)]),
		n
	];
}
function kB(e, t) {
	let n = [e[0]], r = new Set(e), i = e[0];
	for (r.delete(e[0]); r.size > 0;) {
		let e = t.get(i), a = "", o = Infinity;
		for (let n of r) {
			let r = t.get(n), i = Math.abs(e.x - r.x) + Math.abs(e.y - r.y);
			i < o && (o = i, a = n);
		}
		if (!a) break;
		n.push(a), r.delete(a), i = a;
	}
	return n;
}
function AB(e, t) {
	let n = [...e], r = !0;
	for (let e = 0; r && e < TB; e++) {
		r = !1;
		scan: for (let e = 1; e < n.length - 2; e++) for (let i = e + 1; i < n.length - 1; i++) {
			let a = t.get(n[e - 1]), o = t.get(n[e]), s = t.get(n[i]), c = t.get(n[i + 1]);
			if (Math.abs(a.x - s.x) + Math.abs(a.y - s.y) + Math.abs(o.x - c.x) + Math.abs(o.y - c.y) - (Math.abs(a.x - o.x) + Math.abs(a.y - o.y)) - (Math.abs(s.x - c.x) + Math.abs(s.y - c.y)) < EB) {
				for (let t = e, r = i; t < r; t++, r--) [n[t], n[r]] = [n[r], n[t]];
				r = !0;
				break scan;
			}
		}
	}
	return n;
}
//#endregion
//#region ../wayfinding/src/core/geometry/projectPointOnSegment.ts
function jB(e, t, n) {
	let { projected: r, distance: i, t: a } = Kr({
		p0: t,
		p1: n
	}, e);
	return {
		projected: {
			x: r.x,
			y: r.y
		},
		distance: i,
		t: a
	};
}
//#endregion
//#region ../wayfinding/src/core/geometry/pointInPolygon.ts
var MB = .01;
function NB(e, t, n) {
	return Math.abs(.5 * (e.x * (t.y - n.y) + t.x * (n.y - e.y) + n.x * (e.y - t.y)));
}
function PB(e) {
	if (e.length < 3) return 0;
	let t = 0;
	for (let n = 1; n < e.length - 1; n++) t += NB(e[0], e[n], e[n + 1]);
	return t;
}
function FB(e, t, n = PB(t)) {
	if (n === 0) return !1;
	let r = 0;
	for (let n = 0, i = t.length - 1; n < t.length; i = n++) r += NB(e, t[i], t[n]);
	return Math.abs(n - r) < n * MB;
}
//#endregion
//#region ../wayfinding/src/core/routing/graphPointResolvers.ts
function IB(e, t, n) {
	let r = PB(t);
	return e.getLineEnds().filter((e) => (!n || e.layer === n) && FB(e, t, r));
}
//#endregion
//#region ../wayfinding/src/core/routing/resolveWaypointCandidates.ts
function LB(e, t) {
	var n;
	if ((n = t.bounds) != null && n.length) return {
		candidates: IB(e.dataSource, t.bounds, t.layer),
		offGraphEntry: null
	};
	let r = null, i = Infinity;
	for (let n of e.dataSource.getLines()) {
		if (n.virtual || t.layer && n.p0.layer !== t.layer || n.p0.x === n.p1.x && n.p0.y === n.p1.y) continue;
		let e = jB(t, n.p0, n.p1);
		e.distance < i && (i = e.distance, r = {
			segment: n,
			proj: e
		});
	}
	if (!r) return {
		candidates: [],
		offGraphEntry: null
	};
	let { segment: a, proj: o } = r;
	return o.t === 0 ? {
		candidates: [a.p0],
		offGraphEntry: null
	} : o.t === 1 ? {
		candidates: [a.p1],
		offGraphEntry: null
	} : {
		candidates: [a.p0, a.p1],
		offGraphEntry: {
			segment: a,
			projection: {
				layer: a.p0.layer,
				x: o.projected.x,
				y: o.projected.y
			}
		}
	};
}
//#endregion
//#region ../wayfinding/src/core/createWayfindingEngine.ts
var RB = 1e-6, zB = (e, t) => e.layer === t.layer && Math.abs(e.x - t.x) < RB && Math.abs(e.y - t.y) < RB;
function BB(e, t) {
	if (!e.length) return e;
	let n = e[0], r = n.p0, i = zB(t.segment.p0, r) ? t.segment.p1 : t.segment.p0;
	return zB(n.p1, i) ? [{
		...n,
		p0: t.projection
	}, ...e.slice(1)] : [{
		...t.segment,
		p0: t.projection,
		p1: r
	}, ...e];
}
function VB(e, t) {
	if (!e.length) return e;
	let n = e[e.length - 1], r = n.p1, i = zB(t.segment.p0, r) ? t.segment.p1 : t.segment.p0;
	return zB(n.p0, i) ? [...e.slice(0, -1), {
		...n,
		p1: t.projection
	}] : [...e, {
		...t.segment,
		p0: r,
		p1: t.projection
	}];
}
function HB(e, t, n) {
	let r = e;
	return t && (r = BB(r, t)), n && (r = VB(r, n)), r;
}
function UB(e) {
	let t = _B();
	return {
		buildRoute(n, r, i) {
			var a;
			let o = t.getOrBuild(e, (a = i == null ? void 0 : i.accessible) != null && a), s = LB(o, n), c = LB(o, r), l = CB(o, s.candidates, c.candidates), u = !!s.offGraphEntry || !!c.offGraphEntry, d = HB(l.lines, s.offGraphEntry, c.offGraphEntry);
			return {
				lines: d,
				distance: u ? vB(d) : l.totalDistance
			};
		},
		buildWaypointsRoute(n, r) {
			var i;
			if (n.length < 2) return {
				lines: [],
				distance: 0
			};
			let a = t.getOrBuild(e, (i = r == null ? void 0 : r.accessible) != null && i), o = (r != null && r.fastest ? OB(n) : n).map((e) => LB(a, e)), s = wB(a, o.map((e) => e.candidates)), c = o[0].offGraphEntry, l = o[o.length - 1].offGraphEntry, u = !!c || !!l, d = HB(s.lines, c, l);
			return {
				lines: d,
				distance: u ? vB(d) : s.totalDistance
			};
		}
	};
}
//#endregion
//#region ../wayfinding/src/core/rendering/computeTrailPoints.ts
var WB = .4, GB = 8;
function KB(e, t, n = GB, r = WB) {
	let i = Yn(t, e);
	if (i === 0 || n <= 0) return [];
	let a = Math.max(Math.ceil(i / n) + 1, 2), o = {
		x: (e.x + t.x) / 2,
		y: (e.y + t.y) / 2 - i * r
	}, s = [];
	for (let n = 0; n < a; n++) {
		let r = n / (a - 1);
		s.push(qB(e, o, t, r));
	}
	return s;
}
function qB(e, t, n, r) {
	let i = 1 - r;
	return {
		x: i * i * e.x + 2 * i * r * t.x + r * r * n.x,
		y: i * i * e.y + 2 * i * r * t.y + r * r * n.y
	};
}
//#endregion
//#region ../wayfinding/src/core/rendering/computeTransitionPoints.ts
function JB(e, t) {
	return e.toLowerCase() === t.toLowerCase();
}
function YB(e, t) {
	return e.findIndex((e) => JB(e, t));
}
function XB(e, t, n) {
	let r = YB(e, t), i = YB(e, n);
	return r === -1 || i === -1 ? "neutral" : i > r ? "up" : "down";
}
function ZB(e, t, n) {
	return e.find((e) => JB(e.p0.layer, t) ? !n.has(e.p1.layer.toLowerCase()) : JB(e.p1.layer, t) ? !n.has(e.p0.layer.toLowerCase()) : !1);
}
function QB(e, t, n, r) {
	if (t.has(r.toLowerCase())) return r;
	let i = r, a = /* @__PURE__ */ new Set([n.toLowerCase(), i.toLowerCase()]), o = ZB(e, i, a);
	for (; o && (i = JB(o.p0.layer, i) ? o.p1.layer : o.p0.layer, !t.has(i.toLowerCase()));) a.add(i.toLowerCase()), o = ZB(e, i, a);
	return i;
}
function $B(e) {
	let { routeLines: t, currentLayerName: n, floorOrder: r } = e, i = t.filter((e) => e.virtual && !JB(e.p0.layer, e.p1.layer)), a = /* @__PURE__ */ new Set();
	for (let e of t) e.virtual || (a.add(e.p0.layer.toLowerCase()), a.add(e.p1.layer.toLowerCase()));
	let o = (n ? i.filter((e) => JB(e.p0.layer, n) || JB(e.p1.layer, n)) : i).map((e) => {
		let t = !n || JB(e.p0.layer, n), o = t ? e.p0 : e.p1, s = t ? e.p1 : e.p0, c = QB(i, a, o.layer, s.layer);
		return {
			x: o.x,
			y: o.y,
			layer: o.layer,
			targetLayer: c,
			direction: XB(r, o.layer, c),
			role: n ? t ? "exit" : "entry" : "exit"
		};
	}), s = new Set(o.filter((e) => e.role === "exit").map((e) => `${e.x}:${e.y}`)), c = /* @__PURE__ */ new Set();
	return o.filter((e) => {
		let t = `${e.x}:${e.y}`;
		return e.role === "entry" && s.has(t) || c.has(t) ? !1 : (c.add(t), !0);
	});
}
//#endregion
//#region ../wayfinding/src/core/rendering/routeGeometry.ts
function eV(e) {
	return Er.fromPoints(e);
}
//#endregion
//#region ../wayfinding/src/core/position/gpsThreshold.ts
var tV = 7.5, nV = 15, rV = 20;
function iV(e, t) {
	let { p0: n, p2: r } = t, i = Rr(n, r), a = Yn(n, r);
	return !i || !a ? 0 : a / i * e;
}
var aV = (e) => {
	if (typeof e == "number" && Number.isFinite(e)) return e;
}, oV = (e, t) => {
	let n = aV(e);
	return n === void 0 || n === 0 ? t : n;
};
function sV({ thresholdInMeters: e, gpsConfig: t }) {
	let n = 0;
	return e && t && (n = iV(e, t)), n || (n = rV), n;
}
function cV(e) {
	return sV({
		thresholdInMeters: oV(e == null ? void 0 : e.rerouteThreshold, nV),
		gpsConfig: e
	});
}
//#endregion
//#region ../wayfinding/src/core/position/distanceToRoute.ts
function lV(e, t, n, r, i, a) {
	let o = i - n, s = a - r, c = e - n, l = t - r, u = o * o + s * s;
	if (u === 0) return Yn({
		x: e,
		y: t
	}, {
		x: n,
		y: r
	});
	let d = (c * o + l * s) / u;
	d < 0 ? d = 0 : d > 1 && (d = 1);
	let f = n + d * o, p = r + d * s;
	return Yn({
		x: e,
		y: t
	}, {
		x: f,
		y: p
	});
}
function uV(e, t) {
	let n = Infinity;
	for (let r of t) {
		if (e.layer && (r.p0.layer !== e.layer || r.p1.layer !== e.layer)) continue;
		let t = lV(e.x, e.y, r.p0.x, r.p0.y, r.p1.x, r.p1.y);
		t < n && (n = t);
	}
	return n;
}
//#endregion
//#region ../wayfinding/src/core/position/rerouteController.ts
function dV(e) {
	return { shouldReroute(t, n) {
		if (!n.length) return !1;
		let r = t.layer;
		return r && !n.some((e) => e.p0.layer === r && e.p1.layer === r) ? !0 : uV(t, n) > e;
	} };
}
//#endregion
//#region ../wayfinding/src/core/position/snapToRoute.ts
function fV(e, t, { snapThreshold: n }) {
	let r = t.length;
	if (!r) return { snapped: !1 };
	let i = e.layer || null, a = Infinity, o = null, s = 0, c = i == null;
	for (let n = 0; n < r; n++) {
		let r = t[n], { p0: l, p1: u } = r, d = Yn(l, u);
		if (d === 0) continue;
		if (i != null && String(l.layer) !== i) {
			s += d;
			continue;
		}
		c = !0;
		let f = jB({
			x: e.x,
			y: e.y
		}, l, u);
		f.distance < a && (a = f.distance, o = {
			point: {
				layer: l.layer,
				x: f.projected.x,
				y: f.projected.y
			},
			line: r,
			fromStart: s + d * f.t
		}), s += d;
	}
	return i != null && !c || !o || a > n ? { snapped: !1 } : {
		snapped: !0,
		snappedPoint: o.point,
		snappedLine: o.line,
		distance: s - o.fromStart
	};
}
//#endregion
//#region ../wayfinding/src/core/position/splitRouteByPoint.ts
function pV(e, t) {
	let n = 1e-6, r = -1, i = 0, a = Infinity;
	for (let n = 0; n < e.length; n++) {
		let o = e[n];
		if (o.p0.layer !== t.layer) continue;
		let s = o.p1.x - o.p0.x, c = o.p1.y - o.p0.y, l = s * s + c * c;
		if (l === 0) continue;
		let u = ((t.x - o.p0.x) * s + (t.y - o.p0.y) * c) / l;
		if (u < -1e-6 || u > 1.000001) continue;
		let d = Math.min(1, Math.max(0, u)), f = o.p0.x + d * s, p = o.p0.y + d * c, m = (t.x - f) ** 2 + (t.y - p) ** 2;
		m < a && (a = m, r = n, i = d);
	}
	if (r === -1) return {
		passed: [],
		remaining: e
	};
	if (i < n) return {
		passed: e.slice(0, r),
		remaining: e.slice(r)
	};
	if (i > 1 - n) return {
		passed: e.slice(0, r + 1),
		remaining: e.slice(r + 1)
	};
	let o = e[r], s = {
		layer: o.p0.layer,
		x: o.p0.x + i * (o.p1.x - o.p0.x),
		y: o.p0.y + i * (o.p1.y - o.p0.y)
	};
	return {
		passed: [...e.slice(0, r), {
			...o,
			p1: s
		}],
		remaining: [{
			...o,
			p0: s
		}, ...e.slice(r + 1)]
	};
}
//#endregion
//#region ../wayfinding/src/renderer/iconManager.ts
function mV(e, t) {
	let n = e.bounds, r = e.source, i = r.width * t, a = r.height * t;
	if (!(n.size.x === i && n.size.y === a)) return n.set(n.center.x, n.center.y, i, a, n.rotation, n.elevation), [e];
}
function hV(e, t, n, r = !1) {
	let i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
	function c(e) {
		return e.onTop ? n.currentPosition : n.icons;
	}
	function l(e, t) {
		return t === void 0 ? e : `${e}#${t}`;
	}
	function u(e, t) {
		let n = a.get(e);
		n || (n = /* @__PURE__ */ new Set(), a.set(e, n)), n.add(t), o.set(t, e);
	}
	function d(e) {
		let t = o.get(e);
		if (!t) return;
		let n = a.get(t);
		n && n.delete(e), o.delete(e);
	}
	function f(n, a, o, l = o.rotation) {
		var d, f, p;
		let m = c(o), h = (d = o.screenSpace) == null ? r : d;
		e.touchLayer(m);
		let g = {
			source: o.canvas,
			bounds: new mr({
				x: o.x,
				y: o.y
			}, gV, l),
			hidden: (f = o.hidden) != null && f,
			dim: +!!o.dimmed,
			origin: o.origin,
			screenSpace: h
		};
		o.cardinalSnap && !h && t.attachCardinalSnap(g), g.onScale = ({ pixelSize: e }) => mV(g, e), m.children.push(g);
		let _ = {
			imageDef: g,
			layer: m,
			callback: (p = o.onClick) == null ? null : p
		};
		return i.set(n, _), s.set(g, _), u(a, n), _;
	}
	function p(t, n, r, a) {
		var o;
		let c = r.layer.children, l = c.indexOf(r.imageDef), u = (o = a.rotation) == null ? r.imageDef.bounds.rotation : o;
		r.imageDef.hidden = !0, e.touchDef(r.imageDef), l >= 0 && c.splice(l, 1), e.touchLayer(r.layer), i.delete(t), s.delete(r.imageDef), d(t), f(t, n, a, u);
	}
	function m(t, r, i, a) {
		var o, s, l;
		if (i.layer !== c(a)) throw Error(`renderer: icon "${t}" cannot move between layers (was onTop=${i.layer === n.currentPosition}, got onTop=${!!a.onTop})`);
		if (i.imageDef.source !== a.canvas) {
			p(t, r, i, a);
			return;
		}
		let u = i.imageDef.bounds, d = (o = a.rotation) == null ? u.rotation : o;
		u.set(a.x, a.y, u.size.x, u.size.y, d, u.elevation), i.imageDef.hidden = (s = a.hidden) != null && s, i.imageDef.dim = +!!a.dimmed, i.callback = (l = a.onClick) == null ? null : l, e.touchDef(i.imageDef);
	}
	function h(t) {
		t.imageDef.hidden = !0, t.callback = null, e.touchDef(t.imageDef);
	}
	return {
		setIcon(e, t, n) {
			let r = l(e, n);
			if (t === null) {
				let e = i.get(r);
				e && h(e);
				return;
			}
			let a = i.get(r);
			a ? m(r, e, a, t) : f(r, e, t);
		},
		clearIcons(e) {
			let t = typeof e == "string" ? [e] : e;
			for (let e of t) {
				let t = a.get(e);
				if (t) for (let e of t) {
					let t = i.get(e);
					t && h(t);
				}
			}
		},
		hideAll() {
			for (let e of i.values()) h(e);
		},
		destroy() {
			for (let t of i.values()) {
				let n = t.layer.children, r = n.indexOf(t.imageDef);
				r >= 0 && n.splice(r, 1), e.touchLayer(t.layer);
			}
			i.clear(), s.clear(), a.clear(), o.clear();
		},
		handleClick(e) {
			let t = s.get(e);
			return !(t != null && t.callback) || t.imageDef.hidden ? !1 : (t.callback(), !0);
		},
		handleHover(e) {
			let t = s.get(e);
			return !!(t != null && t.callback) && !(t != null && t.imageDef.hidden);
		}
	};
}
var gV = {
	x: 0,
	y: 0
};
//#endregion
//#region ../wayfinding/src/renderer/layerManager.ts
function _V(e) {
	let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
	return {
		touchLayer(e) {
			t.add(e);
		},
		touchDef(e) {
			n.add(e);
		},
		flush() {
			if (!(t.size === 0 && n.size === 0)) {
				for (let e of t) e.children = [...e.children];
				e.update(...t, ...n), t.clear(), n.clear();
			}
		},
		destroy() {
			t.clear(), n.clear();
		}
	};
}
//#endregion
//#region ../wayfinding/src/renderer/lineAnimation.ts
var vV = 1, yV = 0;
function bV(e, t, n, r = 0) {
	let i = 0, a = 0, o = null, s = null;
	if (!e.length) return;
	let c = e.map((e) => ({
		p0: {
			x: e.points.p0.x,
			y: e.points.p0.y
		},
		p1: {
			x: e.points.p1.x,
			y: e.points.p1.y
		},
		elevation: e.points.elevation
	})), l = c.map((e) => {
		let t = e.p1.x - e.p0.x, n = e.p1.y - e.p0.y;
		return Math.sqrt(t * t + n * n);
	}), u = e.map(() => -1), d = [], f = l.reduce((e, t) => e + t, 0);
	if (!f) return;
	let p = Math.max(20, Math.min(f / 2, 300));
	function m(e) {
		let t = e % 1 * f, n = 0;
		i = 0, a = 0;
		for (let e = 0; e < l.length; e++) {
			if (n + l[e] > t) {
				i = e, a = t - n;
				break;
			}
			n += l[e], e === l.length - 1 && (i = 0, a = 0);
		}
	}
	function h(t, n) {
		if (u[t] === n) return;
		u[t] = n;
		let r = e[t], i = c[t];
		if (r.hidden = n <= yV, !r.hidden) {
			let { p0: e, p1: t } = i;
			r.points = n >= vV ? i : {
				p0: e,
				p1: {
					x: e.x + (t.x - e.x) * n,
					y: e.y + (t.y - e.y) * n
				},
				elevation: i.elevation
			};
		}
		d.push(r);
	}
	function g() {
		d.length = 0;
		let n = i;
		for (let e = 0; e < n; e++) h(e, vV);
		h(n, Math.min(a / l[n], vV));
		for (let t = n + 1; t < e.length; t++) h(t, yV);
		d.length && t(d);
	}
	function _(t) {
		o != null || (o = t);
		let r = (t - o) / 1e3;
		o = t;
		let c = n();
		if (!(Number.isFinite(c) && c > 0)) {
			s = requestAnimationFrame(_);
			return;
		}
		let u = p * Math.sqrt(c);
		for (a += u * r, a %= f; a >= l[i];) a -= l[i], i++, i >= e.length && (i = 0);
		g(), s = requestAnimationFrame(_);
	}
	function v() {
		y(), r <= 0 && (i = 0, a = 0), o = null, s = requestAnimationFrame(_);
	}
	function y() {
		s && (cancelAnimationFrame(s), s = null, o = null);
	}
	function b() {
		if (f <= 0) return 0;
		let e = 0;
		for (let t = 0; t < i; t++) e += l[t];
		return e += a, e / f;
	}
	function x() {
		document.visibilityState === "visible" ? v() : y();
	}
	return r > 0 && m(r), document.addEventListener("visibilitychange", x), v(), {
		stop: () => {
			y(), document.removeEventListener("visibilitychange", x);
		},
		getProgress: b
	};
}
//#endregion
//#region ../wayfinding/src/renderer/routeLineManager.ts
function xV({ p0: e, p1: t }, n) {
	return {
		points: {
			p0: {
				x: e.x,
				y: e.y
			},
			p1: {
				x: t.x,
				y: t.y
			}
		},
		color: n,
		width: 10
	};
}
function SV(e, t, n, r) {
	let i = r.lines, a = r.linesAnimated, o = null, s = 1;
	function c(e) {
		s = e;
	}
	function l(t) {
		u(t), t.children = [], e.touchLayer(t);
	}
	function u(t) {
		for (let n of t.children) n.hidden = !0, e.touchDef(n);
	}
	return {
		setRouteLines(r, l, d) {
			var f, p;
			e.touchLayer(i), e.touchLayer(a), a.onScale = ({ pixelSize: e }) => c(e);
			let m = (f = d == null ? void 0 : d.resetAnimation) == null || f, h = 0;
			o && (m || (h = o.getProgress()), o.stop(), o = null), u(i), u(a);
			let g = r.map((e) => xV(e, t.passed)), _ = l.map((e) => xV(e, t.remaining));
			if (i.children = [...g, ..._], !_.length) {
				a.children = [];
				return;
			}
			let v = l.map((e) => ({
				...xV(e, t.active),
				hidden: !0
			}));
			a.children = v, o = (p = bV(v, (e) => n.update(...e), () => s, h)) == null ? null : p;
		},
		clearLines() {
			o && (o.stop(), o = null), l(i), l(a);
		},
		destroy() {
			this.clearLines(), a.onScale = void 0;
		}
	};
}
//#endregion
//#region ../wayfinding/src/renderer/trailManager.ts
var CV = 40;
function wV(e, t) {
	let n = /* @__PURE__ */ new Map(), r = 1, i = !1;
	function a(e) {
		r = e;
		let i = [], a = !1;
		for (let e of n.values()) {
			let t = c(e);
			i.push(...t.changed), a || (a = t.membershipChanged);
		}
		return a && i.push(t), i.length ? i : void 0;
	}
	function o(n, r) {
		if (!r.length) return;
		let i = new Set(r);
		for (let e of i) e.hidden = !0;
		t.children = t.children.filter((e) => !i.has(e)), e.touchLayer(t);
	}
	function s() {
		i || (t.onScale = ({ pixelSize: e }) => a(e), i = !0, e.touchLayer(t));
	}
	function c(n) {
		s();
		let i = CV * r, a = KB(n.from, n.to, i), c = n.canvas, l = {
			x: c.width * r,
			y: c.height * r
		}, u = n.dotDefs, d = Math.min(u.length, a.length), f = [];
		for (let e = 0; e < d; e++) {
			let t = u[e].bounds;
			t.set(a[e].x, a[e].y, l.x, l.y, t.rotation, t.elevation), f.push(u[e]);
		}
		if (a.length > d) {
			let n = a.slice(d).map((e) => ({
				source: c,
				bounds: new mr({
					x: e.x,
					y: e.y
				}, l)
			}));
			return t.children.push(...n), u.push(...n), e.touchLayer(t), {
				changed: f,
				membershipChanged: !0
			};
		}
		if (u.length > d) {
			let e = u.splice(d);
			return o(n, e), f.push(...e), {
				changed: f,
				membershipChanged: !0
			};
		}
		return {
			changed: f,
			membershipChanged: !1
		};
	}
	function l(t) {
		let r = n.get(t);
		if (r) {
			o(r, r.dotDefs);
			for (let t of r.dotDefs) e.touchDef(t);
			r.dotDefs = [], n.delete(t);
		}
	}
	function u(t) {
		for (let n of t.changed) e.touchDef(n);
	}
	return {
		setTrail(e, t, r, i) {
			if (t === null || r === null) {
				l(e);
				return;
			}
			if (!i) throw Error(`renderer: setTrail("${e}") requires options when from/to are non-null`);
			let a = n.get(e);
			if (a) {
				if (a.canvas !== i.canvas) throw Error(`renderer: trail "${e}" cannot change canvas after first call`);
				a.from = t, a.to = r, u(c(a));
				return;
			}
			let o = {
				from: t,
				to: r,
				canvas: i.canvas,
				dotDefs: []
			};
			n.set(e, o), u(c(o));
		},
		destroy() {
			for (let e of [...n.keys()]) l(e);
			t.onScale = void 0, i = !1;
		}
	};
}
//#endregion
//#region ../wayfinding/src/renderer/createWayfindingRenderer.ts
var TV = {
	passed: "#B5B7BC",
	remaining: "#A4CCE2",
	active: "#0794EA"
};
function EV(e, t, n = {}) {
	let r = {
		...TV,
		...n.colors
	}, i = _V(e), a = hV(i, e, t, n.screenSpaceIcons), o = wV(i, t.trail), s = SV(i, r, e, t), c = {
		setIcon: (...e) => a.setIcon(...e),
		clearIcons: (...e) => a.clearIcons(...e),
		setTrail: (...e) => o.setTrail(...e),
		setRouteLines: (...e) => s.setRouteLines(...e),
		handleClick: (e) => a.handleClick(e),
		handleHover: (e) => a.handleHover(e),
		clearRoute() {
			s.clearLines(), o.destroy(), a.hideAll();
		},
		flush: () => i.flush(),
		destroy() {
			c.clearRoute(), a.destroy(), o.destroy(), s.destroy(), i.flush(), i.destroy();
		}
	};
	return c;
}
//#endregion
//#region ../wayfinding/src/renderer/layers.ts
var DV = "wayfinding", OV = "wf-trail-points", kV = "wf-lines", AV = "wf-lines-animated", jV = "wf-points", MV = "wf-current-position";
function NV(e = {}) {
	return {
		name: DV,
		children: [
			{
				name: OV,
				children: []
			},
			{
				name: kV,
				children: []
			},
			{
				name: AV,
				children: []
			},
			{
				name: jV,
				children: []
			},
			{
				name: MV,
				children: []
			}
		],
		dim: 0,
		overlay: e.overlay
	};
}
function PV(e) {
	let t = e.children.find((e) => "name" in e && e.name === DV && "children" in e);
	if (!t) throw Error("The scene holds no wayfinding block — mount `root` first.");
	let n = new Map(t.children.map((e) => [e.name, e]));
	function r(e) {
		let t = n.get(e);
		if (!t) throw Error(`The wayfinding block is missing its \`${e}\` layer.`);
		return t;
	}
	return {
		trail: r(OV),
		lines: r(kV),
		linesAnimated: r(AV),
		icons: r(jV),
		currentPosition: r(MV)
	};
}
//#endregion
//#region ../wayfinding/src/runtime/positionView.ts
var FV = "current-position", IV = "position";
function LV({ renderer: e, iconProvider: t }) {
	return {
		place(n, r) {
			let i = Number.isFinite(n.heading), a = i ? "current_arrow" : "current", o = i ? Hn(n.heading) : void 0;
			e.setIcon(IV, {
				canvas: t.getIcon(a).canvas,
				onTop: !0,
				x: n.x,
				y: n.y,
				rotation: o,
				screenSpace: !i && void 0,
				hidden: r,
				dimmed: r,
				origin: [.5, .5]
			});
		},
		hide() {
			e.setIcon(IV, null);
		}
	};
}
//#endregion
//#region ../wayfinding/src/runtime/endpointView.ts
function RV(e, t) {
	return !t || !e.bounds && e.id !== "current-position";
}
function zV({ renderer: e, iconProvider: t, floorContext: n }) {
	return {
		place(r, i, a, o) {
			if (!a.length) return;
			let s = n.isLayerVisible(r.layer), c = n.isLayerVisible(i.layer), l = a[0], u = a[a.length - 1], d = r.id === "current-position" && o;
			e.setIcon("source", {
				canvas: t.getIcon(d ? "source_inactive" : "source").canvas,
				x: l.x,
				y: l.y,
				hidden: RV(r, s),
				dimmed: !s,
				cardinalSnap: !0
			}), e.setIcon("destination", {
				canvas: t.getIcon("destination").canvas,
				x: u.x,
				y: u.y,
				hidden: !c || !i.bounds,
				dimmed: !c,
				cardinalSnap: !0
			});
		},
		hide() {
			e.setIcon("source", null), e.setIcon("destination", null);
		}
	};
}
//#endregion
//#region ../wayfinding/src/runtime/getRouteLines.ts
function BV({ engine: e, from: t, to: n, waypoints: r, accessible: i }) {
	return r != null && r.length ? e.buildWaypointsRoute([
		t,
		...r,
		n
	], { accessible: i }).lines : e.buildRoute(t, n, { accessible: i }).lines;
}
//#endregion
//#region ../wayfinding/src/runtime/snapPositionToRoute.ts
function VV(e, t, n) {
	if (!(t != null && t.bounds)) return !1;
	let r = n == null || !t.layer || t.layer === n, i = FB({
		x: e.x,
		y: e.y
	}, t.bounds);
	return r && i;
}
function HV(e, t, n, r, i) {
	if (!t.length) return { snapped: !1 };
	let a = e.layer || null;
	if (VV(e, n, a)) {
		let e = t[0];
		return {
			snapped: !0,
			snappedPoint: e.p0,
			snappedLine: e,
			distance: vB(t)
		};
	}
	if (VV(e, r, a)) {
		let e = t[t.length - 1];
		return {
			snapped: !0,
			snappedPoint: e.p1,
			snappedLine: e,
			distance: 0
		};
	}
	return fV(e, t, { snapThreshold: i });
}
//#endregion
//#region ../wayfinding/src/runtime/positionTrailView.ts
var UV = "trail";
function WV({ renderer: e, iconProvider: t, floorContext: n, trails: r, snapThreshold: i }) {
	let a = LV({
		renderer: e,
		iconProvider: t
	});
	return {
		placeIcon(e) {
			let t = !n.isLayerVisible(e.layer);
			a.place(e, t);
		},
		hideIcon() {
			a.hide();
		},
		applyToRoute(e, t, r) {
			let o = HV(e, r, t.from, t.to, i), s = !n.isLayerVisible(e.layer);
			return o.snapped ? a.place({
				...e,
				x: o.snappedPoint.x,
				y: o.snappedPoint.y
			}, s) : a.place(e, s), o;
		},
		setTrail(e, t) {
			e && t ? r.place(UV, e, t) : r.clear(UV);
		},
		clearTrail() {
			r.clear(UV);
		}
	};
}
//#endregion
//#region ../wayfinding/src/runtime/routeLinesView.ts
function GV({ renderer: e }) {
	return {
		draw({ passed: t, remaining: n }, r = !1) {
			e.setRouteLines(t, n, { resetAnimation: !r });
		},
		clear() {
			e.setRouteLines([], [], { resetAnimation: !0 });
		}
	};
}
//#endregion
//#region ../wayfinding/src/runtime/routeRenderData.ts
function KV({ routeLines: e, currentRouteLayer: t, snap: n }) {
	let r = e.filter((e) => !e.virtual), i = (e) => t === null ? e : e.filter((e) => e.p0.layer === t);
	if (!(n != null && n.snapped)) return {
		passed: [],
		remaining: i(r),
		distance: vB(r)
	};
	let { passed: a, remaining: o } = pV(r, n.snappedPoint), s = o !== r && o.length > 0 && o[0].p0.layer === n.snappedPoint.layer ? [{
		...o[0],
		p0: n.snappedPoint
	}, ...o.slice(1)] : o;
	return {
		passed: i(a),
		remaining: i(s),
		distance: n.distance
	};
}
//#endregion
//#region ../wayfinding/src/runtime/routeUpdate.ts
function qV(e, t) {
	return {
		lines: e.filter((e) => !e.virtual),
		bounds: eV(t.flatMap((e) => [e.p0, e.p1]))
	};
}
//#endregion
//#region ../wayfinding/src/runtime/trailView.ts
function JV({ renderer: e, iconProvider: t, floorContext: n }) {
	let r = /* @__PURE__ */ new Set();
	function i(e, t) {
		if (n.showAllFloors()) return !0;
		let r = n.getActiveFloor();
		return r ? e === r && t === r : !1;
	}
	function a(t) {
		e.setTrail(t, null, null), r.delete(t);
	}
	return {
		place(n, o, s) {
			if (!i(o.layer, s.layer)) {
				a(n);
				return;
			}
			e.setTrail(n, o, s, { canvas: t.getIcon("trail").canvas }), r.add(n);
		},
		clear(e) {
			a(e);
		},
		clearAll() {
			for (let t of r) e.setTrail(t, null, null);
			r.clear();
		}
	};
}
//#endregion
//#region ../wayfinding/src/runtime/transitionView.ts
var YV = "transition";
function XV({ renderer: e, iconProvider: t, floorContext: n, onTransitionClick: r }) {
	return {
		place(i) {
			e.clearIcons(YV);
			let a;
			if (n.showAllFloors()) a = null;
			else {
				let e = n.getActiveFloor();
				if (!e) return;
				a = e;
			}
			let o = $B({
				routeLines: i,
				currentLayerName: a,
				floorOrder: n.getFloorOrder()
			});
			for (let [n, i] of o.entries()) e.setIcon(YV, {
				canvas: t.getIcon(ZV(i.role, i.direction)).canvas,
				x: i.x,
				y: i.y,
				cardinalSnap: !0,
				onClick: i.role === "exit" ? () => r(i) : void 0
			}, n);
		},
		clear() {
			e.clearIcons(YV);
		}
	};
}
function ZV(e, t) {
	return e === "entry" ? "transition_entry" : t === "up" ? "transition_up" : t === "down" ? "transition_down" : "transition";
}
//#endregion
//#region ../wayfinding/src/runtime/createWayfindingRuntime.ts
var QV = (e) => e.flatMap((e) => [e.p0, e.p1]);
function $V({ engine: e, renderer: t, iconProvider: n, floorContext: r, snapThreshold: i, rerouteThreshold: a, onTransitionClick: o, onRouteUpdate: s, onRouteDistance: c }) {
	let l = dV(a), u = zV({
		renderer: t,
		iconProvider: n,
		floorContext: r
	}), d = XV({
		renderer: t,
		iconProvider: n,
		floorContext: r,
		onTransitionClick: o
	}), f = WV({
		renderer: t,
		iconProvider: n,
		floorContext: r,
		trails: JV({
			renderer: t,
			iconProvider: n,
			floorContext: r
		}),
		snapThreshold: i
	}), p = GV({ renderer: t }), m = [], h = null, g = null, _ = null, v = 0, y = !1, b = !1;
	function x() {
		return r.showAllFloors() ? null : r.getActiveFloor();
	}
	function S() {
		let e = x();
		return e === null ? m.filter((e) => !e.virtual) : m.filter((t) => t.p0.layer === e && !t.virtual);
	}
	function C(e) {
		return l.shouldReroute(e, m.filter((e) => !e.virtual));
	}
	function w() {
		if (!h || !g) return null;
		let e = S();
		return e.length ? {
			from: h,
			to: g,
			routePoints: QV(e),
			visibleLines: e
		} : null;
	}
	function T(e = null, t = !1) {
		if (!h || !g) return;
		let n = KV({
			routeLines: m,
			currentRouteLayer: x(),
			snap: e
		});
		p.draw(n, t), v = n.distance;
	}
	function E(e) {
		let t = w();
		if (!t) {
			f.setTrail(null, null);
			return;
		}
		let n = _ && e && !e.snapped ? _ : null, r = (e) => {
			var t;
			return (t = e.bounds) != null && t.length ? null : e.id === "current-position" ? n : e;
		}, i = y ? null : r(t.from);
		if (i) {
			f.setTrail(t.routePoints[0], i);
			return;
		}
		let a = r(t.to);
		f.setTrail(a ? t.routePoints[t.routePoints.length - 1] : null, a);
	}
	function D() {
		if (!h || !g) return;
		let e = w();
		if (!e) {
			u.hide(), d.clear(), f.clearTrail(), T();
			return;
		}
		u.place(h, g, e.routePoints, b), d.place(m), T(), E(null);
	}
	function O() {
		if (!h || !g) return;
		let e = w();
		e && u.place(h, g, e.routePoints, b);
	}
	function k() {
		if (b = !1, !_ || !h || !g) return null;
		let e = m.filter((e) => !e.virtual);
		if (!e.length) return null;
		let t = w(), n = t ? f.applyToRoute(_, t, e) : HV(_, e, h, g, i);
		return n.snapped && (y = !0), b = n.snapped, n;
	}
	function A() {
		let e = qV(m, S());
		return s(e.lines, e.bounds), e;
	}
	function j({ from: n, to: r, waypoints: i, accessible: a }) {
		let o = BV({
			engine: e,
			from: n,
			to: r,
			waypoints: i,
			accessible: a
		});
		if (!o.length) return ne(), !1;
		y = !1, h = n, g = r, m = o, D();
		let { lines: s } = A(), l = k();
		return O(), E(l), l && T(l, !0), c(l ? v : vB(s)), t.flush(), !0;
	}
	function ee(e) {
		let n = _ !== null;
		if (_ = e, !e) {
			b = !1, f.hideIcon(), E(null), n && O(), T(), c(v), t.flush();
			return;
		}
		f.placeIcon(e);
		let r = k();
		O(), E(r), r && T(r, !0), c(v), t.flush();
	}
	function te() {
		D();
		let e = k();
		O(), E(e), e && T(e, !0), m.length && A(), c(v), t.flush();
	}
	function ne() {
		y = !1, m = [], h = null, g = null, v = 0, u.hide(), d.clear(), f.clearTrail(), p.clear(), s([], new Er()), c(0), t.flush();
	}
	function re() {
		ne(), _ = null, t.destroy();
	}
	return {
		setRoute: j,
		onPositionChanged: ee,
		onFloorChanged: te,
		shouldReroute: C,
		clearRoute: ne,
		destroy: re
	};
}
//#endregion
//#region ../wayfinding/src/createWayfinding.ts
function eH(e) {
	let { dataSource: t, renderer: n, iconProvider: r, floorContext: i, layers: a, gpsConfig: o } = e, s = UB(t), c = EV(n, a, { screenSpaceIcons: e.screenSpaceIcons }), l = $V({
		engine: s,
		renderer: c,
		iconProvider: r,
		floorContext: i,
		snapThreshold: sV({
			thresholdInMeters: oV(o == null ? void 0 : o.snapThreshold, tV),
			gpsConfig: o
		}),
		rerouteThreshold: cV(o),
		onTransitionClick: (t) => {
			var n;
			return (n = e.onTransitionClick) == null ? void 0 : n.call(e, t);
		},
		onRouteUpdate: (t, n) => {
			var r;
			return (r = e.onRouteUpdate) == null ? void 0 : r.call(e, t, n);
		},
		onRouteDistance: (t) => {
			var n;
			return (n = e.onRouteDistance) == null ? void 0 : n.call(e, t);
		}
	});
	return {
		setRoute: (e) => l.setRoute(e),
		buildRoute: (e, t, n) => s.buildRoute(e, t, n),
		clearRoute: () => l.clearRoute(),
		setPosition: (e) => l.onPositionChanged(e),
		notifyFloorChanged: () => l.onFloorChanged(),
		shouldReroute: (e) => l.shouldReroute(e),
		handleClick: (e) => {
			for (let t of e) if (c.handleClick(t)) return !0;
			return !1;
		},
		handleHover: (e) => e.some((e) => c.handleHover(e)),
		setIcon: (e, t, n) => c.setIcon(e, t, n),
		flush: () => c.flush(),
		destroy: () => l.destroy()
	};
}
//#endregion
//#region src/wayfinding/adapters/arbitraryPoint.ts
var tH = "Your Location", nH = "kiosk-anchor";
function rH(e, t, n) {
	return {
		id: n,
		x: e.x,
		y: e.y,
		layer: e.z == null ? "" : String(e.z),
		name: t
	};
}
//#endregion
//#region src/wayfinding/adapters/boothToEndpoint.ts
function iH(e) {
	var t, n;
	let r = e.rect, i = mr.fromMinMax(r.min, r.max, e.rotate).corners();
	return {
		x: r.center.x,
		y: r.center.y,
		layer: (t = (n = e.layer) == null ? void 0 : n.name) == null ? "" : t,
		bounds: i
	};
}
//#endregion
//#region src/wayfinding/adapters/canvasIconProvider.ts
var aH = "#00A2FF", oH = "#FF9F06", sH = 34, cH = 56;
function lH(e, t, n, r, i, a) {
	let o = e.get(t);
	return o ? (o.id = t, Pc(o, n, r, i)) : a();
}
function uH(e) {
	return {
		canvas: e,
		width: e.width,
		height: e.height
	};
}
function dH(e) {
	var t, n;
	let { iconMap: r, pixelRatio: i } = e, a = (t = e.sourceColor) == null ? aH : t, o = (n = e.destinationColor) == null ? oH : n, s = /* @__PURE__ */ new Map();
	s.set("destination", uH(lH(r, "destination", sH, sH, i, () => Ic(i, o)))), s.set("source", uH(lH(r, "departure", sH, sH, i, () => Fc(i, a)))), s.set("source_inactive", uH(lH(r, "departure_inactive", sH, sH, i, () => Fc(i, a))));
	let c = Fc(i, a);
	c.id = "current-location", s.set("current", uH(c));
	let l = lH(r, "transition", sH, sH, i, () => Fc(i, a));
	return s.set("transition", uH(l)), s.set("transition_up", uH(lH(r, "transition_up", cH, sH, i, () => l))), s.set("transition_down", uH(lH(r, "transition_down", cH, sH, i, () => l))), s.set("transition_entry", uH(lH(r, "departure", sH, sH, i, () => Fc(i, a)))), s.set("current_arrow", uH(lH(r, "direction", sH, sH, i, () => Lc(i, a)))), s.set("trail", uH(uf(4, "#b5b7bc"))), { getIcon(e) {
		let t = s.get(e);
		if (!t) throw Error(`Unknown icon: ${e}`);
		return t;
	} };
}
//#endregion
//#region src/wayfinding/adapters/floorContext.ts
var fH = 0;
function pH(e, t) {
	return {
		showAllFloors() {
			return e.mode === fH;
		},
		getActiveFloor() {
			var n;
			let r = (n = t.currentRouteLayer) == null ? void 0 : n.name;
			return r && e.layers.some((e) => e.name === r && e.visible) ? r : "";
		},
		isLayerVisible(t) {
			var n, r;
			return t ? e.findLayer ? (n = (r = e.findLayer(t)) == null ? void 0 : r.visible) == null || n : e.layers.some((e) => e.name === t && e.visible) : !0;
		},
		getFloorOrder() {
			return e.floors.map((e) => e.name).reverse();
		}
	};
}
//#endregion
//#region src/wayfinding/adapters/graphDataSource.ts
function mH() {
	return {
		getLines: () => {
			var e, t;
			return (e = (t = uo()) == null ? void 0 : t.lines) == null ? [] : e;
		},
		getLineEnds: () => {
			var e, t;
			return (e = (t = uo()) == null ? void 0 : t.lineEnds) == null ? [] : e;
		}
	};
}
//#endregion
//#region src/utils/math.ts
function hH(e, t) {
	return e * (1 - t / 100);
}
//#endregion
//#region src/wayfinding/adapters/kioskCanvas.ts
var gH = 199, _H = 152, vH = 55, yH = "#ee4422";
function bH(e, t) {
	let n = devicePixelRatio, r = e == null ? void 0 : e.get("kiosk");
	if (r) {
		r.id = "kiosk";
		let e = t ? t / 100 : 1;
		return Pc(r, hH(gH * e, vH), hH(_H * e, vH), n);
	}
	return Lc(n, (0, ks.default)(yH).hex());
}
//#endregion
//#region src/wayfinding/adapters/positionInput.ts
function xH(e) {
	return {
		x: e.x,
		y: e.y,
		layer: e.z == null ? "" : String(e.z),
		heading: Number.isFinite(e.angle) ? e.angle : void 0
	};
}
//#endregion
//#region src/wayfinding/bindMobxReactions.ts
var SH = (e) => "rect" in e ? iH(e) : e;
function CH({ wayfinding: e, kioskHandler: t, yahHandler: n, stores: { routeStore: r, uiState: i, layerStore: a } }) {
	let o = [];
	function s() {
		var t;
		let n = i.selectedRoute, a = n != null && n.from ? SH(n.from) : null, o = n != null && n.to ? SH(n.to) : null;
		if (!a || !o) {
			e.clearRoute();
			return;
		}
		e.setRoute({
			from: a,
			to: o,
			waypoints: n == null || (t = n.waypoints) == null ? void 0 : t.map(iH),
			accessible: r.onlyAccessible
		}) === !1 && console.error(/* @__PURE__ */ Error(`Route not found: (${a.x},${a.y}) → (${o.x},${o.y})`));
	}
	function c() {
		let t = r.currentPosition, a = r.iconType !== 0, o = i.selectedRoute, s = !!(o != null && o.from && o != null && o.to), c = a && !s;
		if (!t) {
			e.setPosition(null), n(null);
			return;
		}
		let l = xH(t);
		c ? (e.setPosition(null), n({
			x: l.x,
			y: l.y,
			layer: l.layer
		})) : (n(null), e.setPosition(l));
	}
	function l() {
		var t;
		let n = r.currentPosition, a = i.selectedRoute;
		if (!n || !(a != null && a.to)) return;
		let o = !a.from, s = ((t = a.from) == null ? void 0 : t.id) === "current-position" && e.shouldReroute(xH(n));
		!o && !s || r.rebuildRouteFromPosition(rH(n, tH, FV));
	}
	function u() {
		var e, n;
		let r = (e = a.floors.find((e) => e.active)) == null ? void 0 : e.name;
		t((n = i.kioskData) == null ? null : n, r, a.mode);
	}
	function d() {
		var e;
		let t = i.selectedRoute, n = r.currentPosition;
		if (!(t != null && t.to) || !n || ((e = t.from) == null ? void 0 : e.id) !== "current-position" || r.routeLines.length > 0) return;
		let a = n.z == null ? "" : String(n.z);
		t.from.x === n.x && t.from.y === n.y && t.from.layer === a || r.rebuildRouteFromPosition(rH(n, tH, FV));
	}
	o.push(N(() => a.layersLoaded, () => {
		s(), c();
	}), N(() => [i.selectedRoute, r.onlyAccessible], () => {
		s(), c();
	}), N(() => r.currentPosition, () => {
		c();
	}), N(() => {
		let e = r.currentPosition;
		return e ? {
			x: e.x,
			y: e.y,
			z: e.z
		} : null;
	}, () => {
		l(), d();
	}, { equals: re.structural }), N(() => [i.kioskData, a.floors.find((e) => e.active)], () => u()));
	let f = null, p = N(() => [r.currentRouteLayer, i.getRouteNextFloor], () => {
		a.layersLoaded && (f !== null && clearTimeout(f), f = setTimeout(() => {
			e.notifyFloorChanged(), c(), f = null;
		}, 0));
	});
	return o.push(() => {
		f !== null && clearTimeout(f), p();
	}), s(), c(), u(), () => {
		for (let e of o) e();
		o.length = 0;
	};
}
//#endregion
//#region src/wayfinding/handlers/kioskHandler.ts
var wH = "kiosk", TH = 0;
function EH({ wayfinding: e, kioskIconMap: t }) {
	let n = /* @__PURE__ */ new Map(), r = (e) => {
		let r = e == null ? 100 : e, i = n.get(r);
		if (i) return i;
		let a = bH(t, e);
		return n.set(r, a), a;
	};
	return (t, n, i) => {
		var a;
		if (!t) {
			e.setIcon(wH, null), e.flush();
			return;
		}
		if (i !== TH && t.z && n && t.z !== n) {
			e.setIcon(wH, null), e.flush();
			return;
		}
		e.setIcon(wH, {
			canvas: r(t.iconSizePercent),
			x: t.x,
			y: t.y,
			rotation: Hn((a = t.heading) == null ? 0 : a),
			screenSpace: !1
		}), e.flush();
	};
}
//#endregion
//#region src/wayfinding/handlers/yahHandler.ts
var DH = "yah", OH = "#ff4343", kH = 64, AH = 90, jH = 32;
function MH(e, t) {
	let n = e.get(DH);
	return n ? (n.id = DH, Pc(n, hH(kH, jH), hH(AH, jH), t)) : Rc(t, OH);
}
function NH({ wayfinding: e, iconMap: t, pixelRatio: n, floorContext: r }) {
	let i = MH(t, n);
	return i.id = "current-location-2", (t) => {
		if (!t) {
			e.setIcon(DH, null), e.flush();
			return;
		}
		let n = r.isLayerVisible(t.layer);
		e.setIcon(DH, {
			canvas: i,
			x: t.x,
			y: t.y,
			hidden: !n,
			dimmed: !n,
			origin: [.5, 1]
		}), e.flush();
	};
}
//#endregion
//#region src/wayfinding/createWayfinding.ts
var PH = null;
function FH() {
	return PH !== null;
}
function IH() {
	if (!PH) throw Error("Wayfinding is not initialized — call createWayfinding() first.");
	return PH;
}
function LH(e, t, n) {
	return IH().wayfinding.buildRoute(e, t, n);
}
function RH(e) {
	let { scene: t, store: n, canvas: r } = e, i = PV(t.rootLayer), { wayfinding: a, dispose: o } = zH(n, i, {
		attachCardinalSnap: wN,
		update: zm
	}), s = i.icons;
	return s.onClick = (e) => VH(a, e), s.onPointerMove = (e) => HH(a, r, e), s.onPointerOut = () => HH(a, r), zm(s), () => {
		s.onClick = void 0, s.onPointerMove = void 0, s.onPointerOut = void 0, r.current && (r.current.style.cursor = ""), zm(s), o();
	};
}
function zH(e, t, n) {
	var r;
	let i = mH(), a = dH({
		iconMap: e.fp.icons,
		pixelRatio: devicePixelRatio
	}), o = pH(e.layerStore, e.routeStore), s = eH({
		dataSource: i,
		renderer: n,
		iconProvider: a,
		floorContext: o,
		layers: t,
		gpsConfig: tz == null || (r = tz.properties) == null ? void 0 : r.config,
		screenSpaceIcons: e.uiState.is3DView,
		onTransitionClick: (t) => {
			t.role === "exit" && e.layerStore.updateVisibility(t.targetLayer, !0);
		},
		onRouteUpdate: (t, n) => {
			e.routeStore.updateRoute([...t]), n.isEmpty() || (e.uiState.moveToRect = n);
		},
		onRouteDistance: (t) => e.routeStore.updateRouteDistance(t)
	}), c = CH({
		wayfinding: s,
		kioskHandler: EH({
			wayfinding: s,
			kioskIconMap: e.fp.icons
		}),
		yahHandler: NH({
			wayfinding: s,
			iconMap: e.fp.icons,
			pixelRatio: devicePixelRatio,
			floorContext: o
		}),
		stores: {
			routeStore: e.routeStore,
			uiState: e.uiState,
			layerStore: e.layerStore
		}
	});
	e.routeStore.showAccessible = i.getLines().some((e) => e.unaccessible);
	let l = { wayfinding: s };
	return PH = l, s.flush(), {
		wayfinding: s,
		dispose() {
			BH(l) && (PH = null, e.routeStore.showAccessible = !1), c(), s.destroy();
		}
	};
}
function BH(e) {
	return PH === e;
}
function VH(e, t) {
	e.handleClick([t.def]) && t.stopPropagation();
}
function HH(e, t, n) {
	let r = t.current;
	if (!r) return;
	let i = n ? e.handleHover([n.def]) : !1;
	r.style.cursor = i ? "pointer" : "";
}
//#endregion
//#region src/store/reveal-layer.ts
var UH = () => void 0;
function WH({ layer: e, show: t, then: n }) {
	return !e || e.visible ? (n(), UH) : (t(e), oe(() => e.visible, n));
}
//#endregion
//#region src/store/RouteStore.ts
var GH, KH, qH, JH, W, YH, XH, ZH, QH, $H, eU, tU, nU, rU, iU, aU, oU, sU, cU, lU, uU;
function dU(e, t, n, r) {
	n && Object.defineProperty(e, t, {
		enumerable: n.enumerable,
		configurable: n.configurable,
		writable: n.writable,
		value: n.initializer ? n.initializer.call(r) : void 0
	});
}
function fU(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
function pU(e) {
	return typeof e == "string" ? Number(e.replace(",", ".")) : e;
}
var mU = (GH = j({ keepAlive: !0 }), KH = j({ keepAlive: !0 }), qH = j({ keepAlive: !0 }), JH = j({ keepAlive: !0 }), W = class {
	constructor(e) {
		this.rootStore = void 0, this.cpTimeout = void 0, dU(this, "routeLines", YH, this), dU(this, "routeDistance", XH, this), dU(this, "currentPosition", ZH, this), dU(this, "requestCompass", QH, this), dU(this, "iconType", $H, this), dU(this, "tempToBooth", eU, this), dU(this, "focusEnabled", tU, this), dU(this, "prevZ", nU, this), dU(this, "markersData", rU, this), dU(this, "prevMarkers", iU, this), this.pendingReveal = null, dU(this, "showAccessible", aU, this), dU(this, "onlyAccessible", oU, this), dU(this, "currentRouteLayer", sU, this), dU(this, "currentRouteExhibitor", cU, this), dU(this, "routeUnits", lU, this), dU(this, "isGpsTrackingEnabled", uU, this), this.rootStore = e, this.focusEnabled = !window.location.search;
	}
	get canFindLocation() {
		return !!$.kioskData || !!this.currentPosition;
	}
	selectRoute(e, t = !0, n = !1) {
		if (t && ($.list = {
			type: "search",
			text: "",
			focused: !1
		}), e && !e.from && e.to) {
			let t = this.resolveFallbackFrom();
			t && (e = new CU(t, e.to, e.waypoints));
		}
		e != null && e.from && e != null && e.to && e.from === e.to && (e = null);
		let r = [];
		e != null && e.from && e != null && e.to && window.setTimeout(() => {
			this.rootStore.showMap();
		}, navigator.userAgent.toLowerCase().indexOf("android") > -1 ? 400 : 50), (e == null ? void 0 : e.from) instanceof Es && e.from.visible && r.push(e.from), (e == null ? void 0 : e.to) instanceof Es && e.to.visible && (this.tempToBooth = null, r.push(e.to)), !e && Q.fp.onDirection && Q.fp.onDirection(null);
		let i = C(() => {
			if (this.rootStore.moveToList(r), $.details = e, e && (!e.from || !e.to) && $.overlayBottom && ($.desiredOverlaySize = "medium"), e != null && e.to && e != null && e.from) {
				let t = hU(e.from);
				t && this.rootStore.layerStore.updateVisibility(t, !0);
			}
			if (!this.currentRouteLayer) {
				let t = gU(this.rootStore.layerStore, e == null ? void 0 : e.from), n = gU(this.rootStore.layerStore, e == null ? void 0 : e.to);
				t ? this.currentRouteLayer = t : n && (this.currentRouteLayer = n);
			}
			t && e != null && e.from && e != null && e.to && SR(gR.ClickDirections, `${e != null && e.from ? "From " + e.from.name : ""} ${e != null && e.to ? "To " + e.to.name : ""}`);
		});
		n ? i() : setTimeout(i, 200);
	}
	rebuildRouteFromPosition(e) {
		let t = $.selectedRoute;
		t != null && t.to && this.selectRoute(new CU(e, t.to, t.waypoints), !1, !0);
	}
	resolveFallbackFrom() {
		var e;
		if (this.currentPosition) return rH(this.currentPosition, tH, FV);
		let t = $.kioskData;
		return t ? rH({
			x: t.x,
			y: t.y,
			z: (e = t.z) == null ? void 0 : e
		}, VL(), nH) : null;
	}
	setStartPoint(e) {
		let t = $.selectedRoute;
		if (t != null && t.to && !(t != null && t.from) && e) {
			let n = new CU(e, t.to, t.waypoints);
			this.selectRoute(n);
		}
	}
	get pathLayers() {
		var e;
		return (e = Q.routeStore.routeLines) == null || (e = e.map((e) => e.p0.layer)) == null ? void 0 : e.filter((e, t, n) => n.indexOf(e) === t).map((e, t) => ({
			id: t + 1,
			layer: Q.layerStore.findLayer(e)
		}));
	}
	getNearestBooth(e) {
		if (!e) return null;
		let t = this.rootStore.layerStore.findLayer(e.z), n = tz == null ? void 0 : tz.properties.config, r = !!(e.lat && e.lng), i = n && r ? Oz(e, n) : e;
		return !i || !Dz(i.x) || !Dz(i.y) ? null : this.rootStore.boothStore.booths.filter((n) => {
			if (Yq.mode === $F.Default || !t) return n.visible && n.rect;
			var r;
			return n.rect && (typeof e.z != "number" && !e.z && n.visible || t.name === ((r = n.layer) == null ? void 0 : r.name));
		}).sort((e, t) => Yn(i, e.rect.center) - Yn(i, t.rect.center))[0] || null;
	}
	setMarkers(e) {
		var t, n;
		this.markersData.markers = ((t = e == null ? void 0 : e.markers) == null ? [] : t).map(_U), this.markersData.icons = (n = e == null ? void 0 : e.icons) == null ? [] : n;
	}
	selectMarker(e, t) {
		let n = this.markersData.markers.find((t) => t.id === e);
		this.markersData.markers.forEach((e) => e.active = !1), n && (n.active = !0);
		let r = Q.layerStore.findLayer(n == null ? void 0 : n.z);
		if (t && n) {
			r && !(r != null && r.visible) && Yq.updateVisibility(r, !0);
			let e = vz();
			return e ? e.api.panTo({
				x: n.x,
				y: n.y
			}) : (P.warn("Map camera is not mounted. Cannot pan to marker."), Promise.resolve());
		}
		return Promise.resolve();
	}
	get selectedMarkers() {
		return this.markersData.markers.filter((e) => e.active);
	}
	get layers() {
		var e;
		let t = [];
		return (e = Q.routeStore.routeLines) == null || e.map((e) => e.p0.layer).forEach((e) => {
			t.indexOf(e) === -1 && t.push(e);
		}), t.map((e) => Q.layerStore.layers.find((t) => t.name === e)).filter((e) => !!e);
	}
	clickRoute(e, t) {
		window.__resett && window.__resett(), this.rootStore.uiState.menu = !1, $.list.type === "route-planner" && ($.list = {
			type: "search",
			text: "",
			focused: !1
		}), this.selectRoute(new CU(e, t));
	}
	selectCurrentPosition(e, t = !0, n) {
		var r, i, a, o, s;
		clearTimeout(this.cpTimeout), e && (e.x = pU(e.x), e.y = pU(e.y), e.lat !== void 0 && (e.lat = pU(e.lat)), e.lng !== void 0 && (e.lng = pU(e.lng)), Zo() || (e.z = void 0));
		let c = t && this.rootStore.uiState.details && !(this.rootStore.uiState.details instanceof CU), l = t && !c && (this.focusEnabled || this.prevZ != (e == null ? void 0 : e.z));
		this.focusEnabled && (this.focusEnabled = !1), this.prevZ = (r = e == null || (i = e.z) == null ? void 0 : i.toString()) == null ? null : r, this.iconType = +!!n;
		let u = e ? vU(e) : null;
		if (!e || !u) {
			this.currentPosition = null;
			return;
		}
		let d = Q.layerStore.findLayer(e.z), f = new TU(u.x, u.y, (d == null ? void 0 : d.name) || ((a = this.currentRouteLayer) == null ? void 0 : a.name), Az(u), e.lat, e.lng), p = !((o = this.routeLines) != null && o.length);
		d && (s = this.routeLines) != null && s.length && (p = !!this.routeLines.find((e) => e.p0.layer === d.name || e.p1.layer === d.name));
		let m = l && p;
		this.currentPosition = f, m && this.focusOnPosition(f, d), this.gpsEnabled || (this.cpTimeout = setTimeout(() => {
			this.currentPosition && this.selectCurrentPosition(null, !1);
		}, 30 * 1e3));
	}
	findLocation() {
		var e, t;
		if (!this.canFindLocation) return;
		let n = (e = this.currentPosition) == null ? $.kioskData : e;
		n && (this.currentPosition && localStorage.getItem("efp-compass-permission-granted") === "false" && (Q.routeStore.requestCompass = !0), (t = this.pendingReveal) == null || t.call(this), this.pendingReveal = WH({
			layer: Q.layerStore.findLayer(n.z),
			show: (e) => Yq.updateVisibility(e, !0),
			then: () => {
				$.moveToRect = this.findLocationRect(n);
			}
		}));
	}
	findLocationRect(e) {
		let t = Er.fromCenter(e, {
			x: 100,
			y: 100
		});
		if (t.intersects(Do)) return t;
		let n = Math.max(Do.min.x, Math.min(e.x, Do.max.x)), r = Math.max(Do.min.y, Math.min(e.y, Do.max.y)), i = Math.min(Do.size.width, Do.size.height) * .3, a = Er.fromCenter({
			x: n,
			y: r
		}, {
			x: i,
			y: i
		}).intersection(Do);
		return a ? Er.fromUnion(t, a) : t;
	}
	focusOnPosition(e, t) {
		var n;
		(n = this.pendingReveal) == null || n.call(this), this.pendingReveal = WH({
			layer: t,
			show: (e) => Yq.updateVisibility(e, !0),
			then: () => {
				if (Q.maplibreStore.showMaplibre) {
					$.moveToLocation = !0;
					return;
				}
				let t = vz();
				if (t) {
					t.api.panTo({
						x: e.x,
						y: e.y
					});
					return;
				}
				P.warn("Map camera is not mounted. Cannot pan to current position.");
			}
		});
	}
	get routeInfo() {
		let e = this.routeDistance, t = this.routeUnits;
		return e ? {
			distance: `${e}${t}`,
			units: t,
			time: Cz(e, Sz(t))
		} : null;
	}
	updateRoute(e, t) {
		!(e != null && e.length) && !this.routeLines.length || (this.routeLines = e, this.updateRoutePoints());
	}
	updateRouteDistance(e) {
		var t, n, r, i;
		if (e == null) return;
		let a = Mo(), o = (t = (n = a.getAttribute("units") || "ft").toLowerCase) == null ? void 0 : t.call(n).trim(), s = (r = (i = a.getAttribute("fp-ver")) == null ? void 0 : i.startsWith("5")) != null && r;
		this.routeDistance = Math.round(e / (s ? 1 : 10)), this.routeUnits = o, this.updateRoutePoints();
	}
	updateRoutePoints() {
		let e = $.selectedRoute, t = this.routeDistance, n = this.routeUnits;
		Q.fp.onDirection && setTimeout(() => {
			var r, i;
			Q.fp.onDirection({
				from: wU((r = e == null ? void 0 : e.from) == null ? null : r),
				to: wU((i = e == null ? void 0 : e.to) == null ? null : i),
				lines: this.routeLines,
				distance: t == null ? "" : `${t}${n}`,
				units: n,
				time: Cz(t == null ? 0 : t, Sz(n))
			});
		}, 200);
	}
	checkRoutes() {
		if (!FH()) {
			console.warn("checkRoutes: wayfinding is not initialized — call createWayfinding() first. Skipping route check.");
			return;
		}
		let e = Q.boothStore.booths;
		console.info(`Route check started  ${e.length}.... `);
		for (let t = 0; t < e.length; t++) {
			let n = e[t];
			for (let r = t + 1; r < e.length; r++) {
				let t = e[r];
				LH(iH(n), iH(t)).lines.length || console.warn(`No route found from ${n.name} to ${t.name}`);
			}
		}
		console.info("Route check done....");
	}
	setGpsTrackingEnabled(e) {
		this.isGpsTrackingEnabled = e;
	}
	get gpsEnabled() {
		return z.autoTrackingGps && this.isGpsTrackingEnabled && !z.enableIPS;
	}
	setOnlyAccessible(e) {
		this.onlyAccessible = e;
	}
}, YH = fU(W.prototype, "routeLines", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return [];
	}
}), XH = fU(W.prototype, "routeDistance", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), ZH = fU(W.prototype, "currentPosition", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), QH = fU(W.prototype, "requestCompass", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), $H = fU(W.prototype, "iconType", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return 0;
	}
}), eU = fU(W.prototype, "tempToBooth", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), tU = fU(W.prototype, "focusEnabled", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !0;
	}
}), nU = fU(W.prototype, "prevZ", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), rU = fU(W.prototype, "markersData", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return {
			icons: [],
			markers: []
		};
	}
}), iU = fU(W.prototype, "prevMarkers", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return [];
	}
}), aU = fU(W.prototype, "showAccessible", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), oU = fU(W.prototype, "onlyAccessible", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), sU = fU(W.prototype, "currentRouteLayer", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), cU = fU(W.prototype, "currentRouteExhibitor", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), fU(W.prototype, "canFindLocation", [j], Object.getOwnPropertyDescriptor(W.prototype, "canFindLocation"), W.prototype), fU(W.prototype, "selectRoute", [C], Object.getOwnPropertyDescriptor(W.prototype, "selectRoute"), W.prototype), fU(W.prototype, "rebuildRouteFromPosition", [C], Object.getOwnPropertyDescriptor(W.prototype, "rebuildRouteFromPosition"), W.prototype), fU(W.prototype, "setStartPoint", [C], Object.getOwnPropertyDescriptor(W.prototype, "setStartPoint"), W.prototype), fU(W.prototype, "pathLayers", [GH], Object.getOwnPropertyDescriptor(W.prototype, "pathLayers"), W.prototype), fU(W.prototype, "setMarkers", [C], Object.getOwnPropertyDescriptor(W.prototype, "setMarkers"), W.prototype), fU(W.prototype, "selectMarker", [C], Object.getOwnPropertyDescriptor(W.prototype, "selectMarker"), W.prototype), fU(W.prototype, "selectedMarkers", [KH], Object.getOwnPropertyDescriptor(W.prototype, "selectedMarkers"), W.prototype), fU(W.prototype, "layers", [qH], Object.getOwnPropertyDescriptor(W.prototype, "layers"), W.prototype), fU(W.prototype, "clickRoute", [C], Object.getOwnPropertyDescriptor(W.prototype, "clickRoute"), W.prototype), fU(W.prototype, "selectCurrentPosition", [C], Object.getOwnPropertyDescriptor(W.prototype, "selectCurrentPosition"), W.prototype), fU(W.prototype, "findLocation", [C], Object.getOwnPropertyDescriptor(W.prototype, "findLocation"), W.prototype), lU = fU(W.prototype, "routeUnits", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return "ft";
	}
}), fU(W.prototype, "routeInfo", [j], Object.getOwnPropertyDescriptor(W.prototype, "routeInfo"), W.prototype), fU(W.prototype, "updateRoute", [C], Object.getOwnPropertyDescriptor(W.prototype, "updateRoute"), W.prototype), fU(W.prototype, "updateRouteDistance", [C], Object.getOwnPropertyDescriptor(W.prototype, "updateRouteDistance"), W.prototype), fU(W.prototype, "updateRoutePoints", [C], Object.getOwnPropertyDescriptor(W.prototype, "updateRoutePoints"), W.prototype), fU(W.prototype, "checkRoutes", [C], Object.getOwnPropertyDescriptor(W.prototype, "checkRoutes"), W.prototype), uU = fU(W.prototype, "isGpsTrackingEnabled", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !0;
	}
}), fU(W.prototype, "setGpsTrackingEnabled", [C], Object.getOwnPropertyDescriptor(W.prototype, "setGpsTrackingEnabled"), W.prototype), fU(W.prototype, "gpsEnabled", [JH], Object.getOwnPropertyDescriptor(W.prototype, "gpsEnabled"), W.prototype), fU(W.prototype, "setOnlyAccessible", [C], Object.getOwnPropertyDescriptor(W.prototype, "setOnlyAccessible"), W.prototype), W);
function hU(e) {
	var t;
	if (e) return e instanceof Es ? (t = e.layer) == null ? void 0 : t.name : e.layer;
}
function gU(e, t) {
	var n;
	return t ? t instanceof Es ? (n = t.layer) == null ? null : n : e.findLayer(t.layer) : null;
}
function _U(e) {
	return {
		...e,
		x: pU(e.x),
		y: pU(e.y),
		lat: e.lat === void 0 ? void 0 : pU(e.lat),
		lng: e.lng === void 0 ? void 0 : pU(e.lng)
	};
}
function vU(e) {
	var t;
	let n = (t = tz == null ? void 0 : tz.properties.config) == null ? null : t, r = null;
	return n && jr({
		min: n.p0,
		max: n.p2
	}, e) ? r = { ...e } : n && Dz(e.lat) && Dz(e.lng) ? r = Oz(e, n) : n || (r = e), r || null;
}
function yU(e) {
	var t;
	return Q.boothStore.findBooth(e) || ((t = Q.exhibitorStore.findExhibitor(e)) == null ? void 0 : t.booths[0]);
}
function bU(e) {
	let t = Q.boothStore.boothByExternalId.get(e);
	if (t) return {
		type: "booth",
		entity: t
	};
	let n = Q.exhibitorStore.exhibitorByExternalId.get(e);
	if (n) return {
		type: "exhibitor",
		entity: n
	};
}
function xU(e) {
	let t = [], n = [];
	for (let r of e) {
		let e = bU(r);
		e && (e.type === "booth" ? t.push(r) : n.push(r));
	}
	return {
		boothExternalIds: t,
		exhibitorExternalIds: n
	};
}
function SU(e, t, n) {
	var r, i;
	return new CU((r = yU(e)) == null ? null : r, (i = yU(t)) == null ? null : i, n == null ? void 0 : n.map((e) => yU(e)).filter((e) => !!e));
}
var CU = class {
	constructor(e, t, n) {
		this.from = e, this.to = t, this.waypoints = n;
		let r = e instanceof Es ? e.id : void 0, i = t instanceof Es ? t.id : void 0;
		this.waypoints = n == null ? void 0 : n.filter((e) => e && e.id !== r && e.id !== i);
	}
};
function wU(e) {
	var t, n;
	return e ? e instanceof Es ? {
		id: e.id,
		name: e.name,
		externalId: e.externalId,
		layer: {
			name: (t = e.layer) == null ? void 0 : t.name,
			description: (n = e.layer) == null ? void 0 : n.description
		}
	} : {
		id: 2 ** 53 - 1,
		name: e.name,
		externalId: void 0,
		layer: {
			name: e.layer,
			description: void 0
		}
	} : null;
}
var TU = class {
	constructor(e, t, n, r, i, a) {
		this.x = e, this.y = t, this.z = n, this.angle = r, this.lat = i, this.lng = a;
	}
}, EU, DU, OU;
function kU(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var AU = (EU = j({ keepAlive: !0 }), DU = j({ keepAlive: !0 }), OU = class {
	constructor(e) {
		this.rootStore = e;
	}
	get ui() {
		return this.rootStore.uiState;
	}
	get isRouteActive() {
		let e = this.ui.selectedRoute;
		return !!(e != null && e.from && e != null && e.to);
	}
	get isSearchListOpen() {
		let { list: e } = this.ui;
		return e.type === "search" || z.isRebooking && e.type === "exhibitors";
	}
	get mediumSizeMultiplier() {
		return this.isRouteActive ? 7 : this.ui.details ? 3 : this.isSearchListOpen ? 9 : 3;
	}
	get fullSizeOffset() {
		let e = this.ui, t = e.wsShown ? 54 : 0, n = e.bannerType === "free" && !e.freeBannerDismissed ? 40 : 0;
		if (e.details && !(e.details instanceof CU)) return t + n + 20;
		let r = e.shouldShowSearchButtons ? 54 : 0;
		return t + n + 54 + 20 + r;
	}
}, kU(OU.prototype, "mediumSizeMultiplier", [EU], Object.getOwnPropertyDescriptor(OU.prototype, "mediumSizeMultiplier"), OU.prototype), kU(OU.prototype, "fullSizeOffset", [DU], Object.getOwnPropertyDescriptor(OU.prototype, "fullSizeOffset"), OU.prototype), OU), jU = {
	active: !1,
	key: "",
	matchingMarkers: []
};
function MU(e, t, n, r) {
	if (!e.length || t) return jU;
	let i = new Set(e), a = new Map(r.map((e) => [e.boothId, e])), o = [];
	for (let e of n) {
		if (e.poiTypeId == null || !i.has(e.poiTypeId)) continue;
		let t = a.get(e.id);
		t && o.push(t);
	}
	return o.length ? {
		active: !0,
		key: [...new Set(o.map((e) => e.boothId))].sort((e, t) => e - t).join(","),
		matchingMarkers: o
	} : jU;
}
//#endregion
//#region src/store/PoiMarkerStore.ts
var NU, PU, FU, IU, LU;
function RU(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var zU = (NU = j({ keepAlive: !0 }), PU = j({ keepAlive: !0 }), FU = j({ keepAlive: !0 }), IU = j({ keepAlive: !0 }), LU = class {
	constructor(e) {
		this.rootStore = void 0, this.markersBox = y.box([], { deep: !1 }), this.generation = 0, this.rootStore = e;
	}
	get markers() {
		return this.markersBox.get();
	}
	addMany(e) {
		e.length && this.markersBox.set([...this.markers, ...e]);
	}
	clear() {
		this.generation += 1, this.markersBox.set([]);
	}
	get selectedMarkerId() {
		let e = [...this.rootStore.uiState.selectedBooths], t = e.length === 1 ? e[0] : void 0;
		return t && this.markers.some((e) => e.boothId === t.id) ? t.id : null;
	}
	get selectionActive() {
		return this.selectedMarkerId !== null;
	}
	get outdoorFilter() {
		let { uiState: e, boothStore: t } = this.rootStore;
		return MU(e.selectedPoiTypeFilters.map((e) => e.id), e.selectedCategoryFilters.length > 0, t.booths, this.markers);
	}
	get dimSuppressed() {
		return this.outdoorFilter.active || this.selectionActive;
	}
}, RU(LU.prototype, "addMany", [C], Object.getOwnPropertyDescriptor(LU.prototype, "addMany"), LU.prototype), RU(LU.prototype, "clear", [C], Object.getOwnPropertyDescriptor(LU.prototype, "clear"), LU.prototype), RU(LU.prototype, "selectedMarkerId", [NU], Object.getOwnPropertyDescriptor(LU.prototype, "selectedMarkerId"), LU.prototype), RU(LU.prototype, "selectionActive", [PU], Object.getOwnPropertyDescriptor(LU.prototype, "selectionActive"), LU.prototype), RU(LU.prototype, "outdoorFilter", [FU], Object.getOwnPropertyDescriptor(LU.prototype, "outdoorFilter"), LU.prototype), RU(LU.prototype, "dimSuppressed", [IU], Object.getOwnPropertyDescriptor(LU.prototype, "dimSuppressed"), LU.prototype), LU), BU = class {
	constructor(e) {
		this.rootStore = void 0, this.poiTypes = [], this.rootStore = e;
	}
}, VU = class {
	constructor() {
		this.id = void 0;
	}
	shouldShowShortcuts() {
		return !0;
	}
}, HU;
function UU(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var WU = (HU = class extends VU {
	constructor(e) {
		super(), this.rootStore = e, this.id = "search";
	}
	createShortcuts() {
		let { searchButtonsStore: e } = this.rootStore, t = [], n = e.getActiveParent();
		if (n && n.children) {
			let r = n.children.filter((e) => e.visible);
			if (n.type === "poi_types" && r.length === 1) return t;
			r.forEach((r) => {
				if (r.type === "poi_types" || r.type === "categories") {
					var i;
					let a = ((i = r.id) == null ? void 0 : i.toString()) || r.name, o = e.isChildActive(a);
					t.push({
						id: a,
						label: r.name,
						enabled: !0,
						active: o,
						tooltip: o ? `Remove ${r.name} from filter (show all ${n.name})` : `Filter only by ${r.name}`,
						variant: "default",
						action: "toggle",
						showResetButton: !1
					});
				}
			});
		}
		return t;
	}
	get shortcuts() {
		return this.createShortcuts();
	}
	shouldShowShortcuts() {
		let { searchButtonsStore: e } = this.rootStore;
		return e.hasActiveParentWithChildren;
	}
	handleShortcutClick(e) {
		let { searchButtonsStore: t } = this.rootStore;
		t.toggleChildFilter(e);
	}
	handleShortcutReset() {
		let { searchButtonsStore: e } = this.rootStore;
		e.clearAllChildFilters();
	}
}, UU(HU.prototype, "shortcuts", [j], Object.getOwnPropertyDescriptor(HU.prototype, "shortcuts"), HU.prototype), HU), GU;
function KU(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var qU = (GU = class extends VU {
	constructor(e) {
		super(), this.rootStore = e, this.id = "sessions";
	}
	get computedShortcuts() {
		let { sessionsFilterStore: e, eventStore: t } = this.rootStore, { filters: n } = e.state, r = [];
		return r.push({
			id: "bookmarks",
			icon: "icon-bookmark",
			enabled: !0,
			active: n.showBookmarksOnly.value,
			tooltip: "Show bookmarked events only",
			variant: "default",
			action: "toggle",
			showResetButton: !1
		}), t.tracks.length > 0 && r.push({
			id: "tracks",
			label: "Tracks",
			badge: n.selectedTracks.value.length > 0 ? n.selectedTracks.value.length : void 0,
			enabled: !0,
			active: n.selectedTracks.value.length > 0,
			tooltip: "Show events by tracks",
			variant: "default",
			action: "custom",
			showResetButton: !0
		}), this.rootStore.speakerStore.speakers.length > 0 && r.push({
			id: "speakers",
			label: "Speakers",
			enabled: !0,
			active: !1,
			tooltip: "Open speakers list",
			variant: "default",
			action: "custom",
			showResetButton: !1
		}), t.liveEvents.length > 0 && r.push({
			id: "live",
			label: "Live",
			enabled: !0,
			active: n.showLiveOnly.value,
			tooltip: "Show events happening now",
			variant: "default",
			action: "toggle",
			showResetButton: !1
		}), t.todayEvents.length > 0 && r.push({
			id: "today",
			label: "Today",
			enabled: !0,
			active: n.date.value === "today",
			tooltip: "Show today's events",
			variant: "default",
			action: "toggle",
			showResetButton: !1
		}), t.tomorrowEvents.length > 0 && r.push({
			id: "tomorrow",
			label: "Tomorrow",
			enabled: !0,
			active: n.date.value === "tomorrow",
			tooltip: "Show tomorrow's events",
			variant: "default",
			action: "toggle",
			showResetButton: !1
		}), t.pastEvents.length > 0 && r.push({
			id: "past",
			label: "Past",
			enabled: !0,
			active: n.date.value === "past",
			tooltip: "Show past events",
			variant: "default",
			action: "toggle",
			showResetButton: !1
		}), t.venues.length > 0 && r.push({
			id: "venues",
			label: "Venues",
			badge: n.selectedVenues.value.length > 0 ? n.selectedVenues.value.length : void 0,
			enabled: !0,
			active: n.selectedVenues.value.length > 0,
			tooltip: "Show events by venues",
			variant: "default",
			action: "custom",
			showResetButton: !0
		}), r;
	}
	createShortcuts() {
		return this.computedShortcuts;
	}
	handleShortcutClick(e) {
		switch (e) {
			case "live":
				this.toggleLiveFilter();
				break;
			case "bookmarks":
				this.toggleBookmarksFilter();
				break;
			case "tracks":
				this.rootStore.sessionsFilterStore.openFilterWithSections(["tracks"]);
				break;
			case "venues":
				this.rootStore.sessionsFilterStore.openFilterWithSections(["venues"]);
				break;
			case "speakers":
				this.rootStore.selectSpeakers();
				break;
			case "today":
				this.toggleDateFilter("today");
				break;
			case "tomorrow":
				this.toggleDateFilter("tomorrow");
				break;
			case "past":
				this.toggleDateFilter("past");
				break;
			case "earliest":
				this.toggleSortOrder();
				break;
			default: console.warn(`Unknown shortcut ID: ${e}`);
		}
	}
	handleShortcutReset(e) {
		let { sessionsFilterStore: t } = this.rootStore;
		switch (e) {
			case "live":
				t.setPending("showLiveOnly", !1), t.applyFilters();
				break;
			case "tracks":
				t.setPending("selectedTracks", []), t.applyFilters();
				break;
			case "venues":
				t.setPending("selectedVenues", []), t.applyFilters();
				break;
			case "bookmarks":
				t.setPending("showBookmarksOnly", !1), t.applyFilters();
				break;
			case "today":
				t.setPending("date", "all"), t.applyFilters();
				break;
			case "tomorrow":
				t.setPending("date", "all"), t.applyFilters();
				break;
			case "past":
				t.setPending("date", "all"), t.applyFilters();
				break;
			default: console.warn(`Unknown shortcut reset ID: ${e}`);
		}
	}
	shouldShowShortcuts() {
		return this.rootStore.uiState.list.type === "sessions" && this.rootStore.uiState.details === null;
	}
	toggleBookmarksFilter() {
		let { sessionsFilterStore: e } = this.rootStore, t = !e.state.filters.showBookmarksOnly.value;
		e.setPending("showBookmarksOnly", t), e.applyFilters();
	}
	toggleLiveFilter() {
		let { sessionsFilterStore: e } = this.rootStore, t = !e.state.filters.showLiveOnly.value;
		e.setPending("showLiveOnly", t), e.applyFilters();
	}
	setDateFilter(e) {
		let { sessionsFilterStore: t } = this.rootStore;
		t.setPending("date", e), t.applyFilters();
	}
	toggleDateFilter(e) {
		let { sessionsFilterStore: t } = this.rootStore;
		t.state.filters.date.value === e ? t.setPending("date", "all") : t.setPending("date", e), t.applyFilters();
	}
	toggleSortOrder() {
		let { sessionsFilterStore: e } = this.rootStore, t = e.state.filters.sortOrder.value === "asc" ? "desc" : "asc";
		e.setPending("sortOrder", t), e.applyFilters();
	}
}, KU(GU.prototype, "computedShortcuts", [j], Object.getOwnPropertyDescriptor(GU.prototype, "computedShortcuts"), GU.prototype), GU), JU;
function YU(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var XU = (JU = class extends VU {
	constructor(e) {
		super(), this.rootStore = e, this.id = "speakers";
	}
	get computedShortcuts() {
		let { speakerFilterStore: e } = this.rootStore, { filters: t } = e.state;
		return [];
	}
	createShortcuts() {
		return this.computedShortcuts;
	}
	handleShortcutClick(e) {
		switch (e) {
			case "companies":
				this.rootStore.speakerFilterStore.openFilterWithSections(["companies"]);
				break;
			case "jobTitles":
				this.rootStore.speakerFilterStore.openFilterWithSections(["jobTitles"]);
				break;
			default: console.warn(`Unknown shortcut ID: ${e}`);
		}
	}
	handleShortcutReset(e) {
		let { speakerFilterStore: t } = this.rootStore;
		switch (e) {
			case "companies":
				t.setPending("selectedCompanies", []), t.applyFilters();
				break;
			case "jobTitles":
				t.setPending("selectedJobTitles", []), t.applyFilters();
				break;
			default: console.warn(`Unknown shortcut ID for reset: ${e}`);
		}
	}
}, YU(JU.prototype, "computedShortcuts", [j], Object.getOwnPropertyDescriptor(JU.prototype, "computedShortcuts"), JU.prototype), JU), G, ZU, QU, $U, eW;
function tW(e, t, n, r) {
	n && Object.defineProperty(e, t, {
		enumerable: n.enumerable,
		configurable: n.configurable,
		writable: n.writable,
		value: n.initializer ? n.initializer.call(r) : void 0
	});
}
function nW(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var rW = (G = class {
	constructor(e) {
		this.rootStore = void 0, tW(this, "items", ZU, this), tW(this, "startPoint", QU, this), tW(this, "source", $U, this), tW(this, "excludedVisitedCount", eW, this), this.rootStore = e;
	}
	get resolvedBooths() {
		let e = /* @__PURE__ */ new Map();
		return this.startPoint && e.set(this.startPoint.id, this.startPoint), this.items.forEach((t) => {
			t.booth && e.set(t.booth.id, t.booth);
		}), Array.from(e.values());
	}
	get stopsCount() {
		return this.items.length;
	}
	get startPointBoothOptions() {
		return this.rootStore.boothStore.booths;
	}
	get startPointAutocompleteOptions() {
		let { exhibitorStore: e } = this.rootStore, t = this.startPointBoothOptions, n = [], r = /* @__PURE__ */ new Set();
		return e.exhibitors.forEach((e) => {
			e.booths.forEach((t) => {
				r.add(t.id), n.push({
					value: t.id.toString(),
					label: `${e.name} - ${t.name}`,
					exhibitorId: e.id
				});
			});
		}), t.filter((e) => !r.has(e.id)).forEach((e) => {
			n.push({
				value: e.id.toString(),
				label: e.name
			});
		}), n.sort((e, t) => e.label.localeCompare(t.label, void 0, { sensitivity: "base" }));
	}
	get title() {
		return this.source === "bookmarks" ? M("Bookmarks route") : "";
	}
	get subtitleParts() {
		let { routeInfo: e } = this.rootStore.routeStore, t;
		if (e != null && e.time) {
			let n = e.time;
			t = n < 60 ? M("< 1 min") : M("~ {{n}} min", { n: Math.round(n / 60) });
		}
		return {
			stops: M("{{count}} stops", { count: this.stopsCount }),
			from: this.startPoint ? M("From {{name}}", { name: this.startPoint.name }) : void 0,
			distance: e ? e.distance : void 0,
			travelTime: t
		};
	}
	get routeFloors() {
		let e = this.rootStore.routeStore.pathLayers;
		return e.map((t, n) => {
			var r, i, a, o, s, c;
			let l = e[n + 1], u = (r = (i = t.layer) == null ? void 0 : i.basePriority) == null ? 0 : r, d = (a = l == null || (o = l.layer) == null ? void 0 : o.basePriority) == null ? 0 : a, f = l ? d < u ? "up" : "down" : void 0;
			return {
				id: t.id,
				name: (s = t.layer) == null ? void 0 : s.shortName,
				description: (c = t.layer) == null ? void 0 : c.description,
				directionToNext: f
			};
		});
	}
	get currentRouteFloor() {
		let e = this.routeFloors, t = this.rootStore.routeStore.currentRouteLayer;
		if (!e.length) return;
		if (!t) return e[0] ? {
			id: e[0].id,
			name: e[0].name
		} : void 0;
		let n = e.find((e) => {
			var n, r;
			return ((n = e.description) == null ? void 0 : n.toLowerCase()) === ((r = t.description) == null ? void 0 : r.toLowerCase());
		});
		return n ? {
			id: n.id,
			name: n.name
		} : {
			id: e[0].id,
			name: e[0].name
		};
	}
	setRouteFloor(e) {
		let t = this.rootStore.routeStore.pathLayers.find((t) => t.id === e.id);
		t != null && t.layer && this.rootStore.layerStore.updateVisibility(t.layer, !0);
	}
	launch(e, t = "custom", n) {
		this.excludedVisitedCount = e.filter((e) => e.type === "exhibitor" && e.entity.visited).length, this.items = e.filter((e) => e.type !== "exhibitor" || !e.entity.visited), this.source = t, this.startPoint = n === void 0 ? this.detectStartPoint() : n;
		let { uiState: r } = this.rootStore;
		r.list = {
			type: "route-planner",
			source: t
		}, r.details = null, r.menu = !1, this.buildRoute();
	}
	launchFromBookmarks(e) {
		let { exhibitorStore: t, eventStore: n, boothStore: r } = this.rootStore, i = [];
		t.bookmarked.forEach((e) => {
			i.push({
				type: "exhibitor",
				entity: e,
				booth: e.booths[0] || null
			});
		}), r.booths.filter((e) => e.exhibitors.length === 0 && e.bookmarkedDirectly).forEach((e) => {
			i.push({
				type: "booth",
				entity: e,
				booth: e
			});
		}), this.launch(i, "bookmarks", e);
	}
	launchFromSlugs(e, t) {
		let n = this.resolveSlugs(e);
		this.launch(n, "custom", t);
	}
	resolveSlugs(e) {
		let { exhibitorStore: t, eventStore: n, boothStore: r } = this.rootStore;
		return e.filter(Boolean).map((e) => {
			let n = e.toLowerCase(), r = t.exhibitors.find((e) => {
				var t, r;
				return ((t = e.slug) == null ? void 0 : t.toLowerCase()) === n || ((r = e.externalId) == null ? void 0 : r.toLowerCase()) === n;
			});
			if (r) return {
				type: "exhibitor",
				entity: r,
				booth: r.booths[0] || null
			};
			let i = yU(e);
			return i ? {
				type: "booth",
				entity: i,
				booth: i
			} : null;
		}).filter((e) => e !== null);
	}
	buildRoute() {
		let e = [];
		if (this.startPoint && this.startPoint.name && e.push(this.startPoint.name), this.items.forEach((t) => {
			t.booth && t.booth.name && e.push(t.booth.name);
		}), e.length < 2) {
			this.rootStore.routeStore.updateRoute([]);
			return;
		}
		let t;
		try {
			var n, r;
			let i = (n = this.rootStore.fp) == null || (r = n.getOptimizedRoutes) == null ? void 0 : r.call(n, e);
			t = Array.isArray(i) ? i.flatMap((e) => {
				var t;
				return (t = e == null ? void 0 : e.waypoints) == null ? [] : t;
			}) : [];
		} catch {
			t = [];
		}
		let i = new Set(e), a = new Set(t), o = e.length > 0 && [...i].every((e) => a.has(e));
		(!t.length || !o) && (t = e.slice()), this.reorderItemsByNames(t);
		let s = this.resolvedBooths;
		if (s.length < 2) {
			this.rootStore.routeStore.updateRoute([]);
			return;
		}
		let c = s[0], l = s[s.length - 1], u = s.slice(1, -1), d = new CU(c, l, u);
		this.rootStore.routeStore.selectRoute(d, !1), this.rootStore.uiState.setIsMultiPointRoute(u.length > 0);
	}
	reorderItemsByNames(e) {
		let t = this.startPoint ? this.startPoint.name : null, n = /* @__PURE__ */ new Map();
		this.items.forEach((e) => {
			let t = e.booth ? e.booth.name : null;
			t && (n.has(t) || n.set(t, []), n.get(t).push(e));
		});
		let r = [];
		e.forEach((e) => {
			if (e !== t) {
				let t = n.get(e);
				t && t.length > 0 && r.push(...t.splice(0));
			}
		}), this.items = r;
	}
	detectStartPoint() {
		let { boothStore: e, poiTypeStore: t } = this.rootStore, n = ["entrance", "entrances"], r = t.poiTypes.find((e) => n.includes(e.name.toLowerCase()));
		return r && e.booths.find((e) => e.poiTypeId === r.id) || null;
	}
	setStartPoint(e) {
		this.startPoint = e, this.buildRoute();
	}
	removeItem(e) {
		this.items.splice(e, 1), this.buildRoute();
	}
	reorderItems(e, t) {
		let [n] = this.items.splice(e, 1);
		this.items.splice(t, 0, n), this.buildRoute();
	}
	close() {
		this.items = [], this.startPoint = null, this.source = null, this.excludedVisitedCount = 0, this.rootStore.uiState.details = null, this.rootStore.uiState.list = {
			type: "search",
			text: "",
			focused: !1
		}, this.rootStore.routeStore.selectRoute(null, !1);
	}
}, ZU = nW(G.prototype, "items", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return [];
	}
}), QU = nW(G.prototype, "startPoint", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), $U = nW(G.prototype, "source", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), eW = nW(G.prototype, "excludedVisitedCount", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return 0;
	}
}), nW(G.prototype, "resolvedBooths", [j], Object.getOwnPropertyDescriptor(G.prototype, "resolvedBooths"), G.prototype), nW(G.prototype, "stopsCount", [j], Object.getOwnPropertyDescriptor(G.prototype, "stopsCount"), G.prototype), nW(G.prototype, "startPointBoothOptions", [j], Object.getOwnPropertyDescriptor(G.prototype, "startPointBoothOptions"), G.prototype), nW(G.prototype, "startPointAutocompleteOptions", [j], Object.getOwnPropertyDescriptor(G.prototype, "startPointAutocompleteOptions"), G.prototype), nW(G.prototype, "title", [j], Object.getOwnPropertyDescriptor(G.prototype, "title"), G.prototype), nW(G.prototype, "subtitleParts", [j], Object.getOwnPropertyDescriptor(G.prototype, "subtitleParts"), G.prototype), nW(G.prototype, "routeFloors", [j], Object.getOwnPropertyDescriptor(G.prototype, "routeFloors"), G.prototype), nW(G.prototype, "currentRouteFloor", [j], Object.getOwnPropertyDescriptor(G.prototype, "currentRouteFloor"), G.prototype), nW(G.prototype, "setRouteFloor", [C], Object.getOwnPropertyDescriptor(G.prototype, "setRouteFloor"), G.prototype), nW(G.prototype, "launch", [C], Object.getOwnPropertyDescriptor(G.prototype, "launch"), G.prototype), nW(G.prototype, "launchFromBookmarks", [C], Object.getOwnPropertyDescriptor(G.prototype, "launchFromBookmarks"), G.prototype), nW(G.prototype, "launchFromSlugs", [C], Object.getOwnPropertyDescriptor(G.prototype, "launchFromSlugs"), G.prototype), nW(G.prototype, "buildRoute", [C], Object.getOwnPropertyDescriptor(G.prototype, "buildRoute"), G.prototype), nW(G.prototype, "setStartPoint", [C], Object.getOwnPropertyDescriptor(G.prototype, "setStartPoint"), G.prototype), nW(G.prototype, "removeItem", [C], Object.getOwnPropertyDescriptor(G.prototype, "removeItem"), G.prototype), nW(G.prototype, "reorderItems", [C], Object.getOwnPropertyDescriptor(G.prototype, "reorderItems"), G.prototype), nW(G.prototype, "close", [C], Object.getOwnPropertyDescriptor(G.prototype, "close"), G.prototype), G), iW = class {
	constructor() {
		this.id = void 0;
	}
	invalidateCache() {}
	shouldShowSubButtons() {
		return !0;
	}
}, aW;
function oW(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var sW = (aW = class extends iW {
	constructor(e) {
		super(), this.rootStore = e, this.id = "sessions";
	}
	get computedSubButtons() {
		let e = [];
		return e.push({
			id: "sessions_show_all",
			label: "All Tracks",
			text: "All Tracks",
			enabled: !0,
			active: this.rootStore.searchButtonsStore.activeSubButtonId === "sessions_show_all" || !this.rootStore.searchButtonsStore.activeSubButtonId && !this.rootStore.uiState.selectedTrack,
			parentButtonId: "sessions",
			type: "show_all",
			onClick: () => this.handleSessionsShowAllClick()
		}), this.rootStore.eventStore.tracks.forEach((t) => {
			let n = this.rootStore.eventStore.getEventsByTrack(t.id).length;
			e.push({
				id: `sessions_track_${t.id}`,
				label: t.name,
				text: t.name,
				enabled: !0,
				active: this.rootStore.searchButtonsStore.activeSubButtonId === `sessions_track_${t.id}`,
				parentButtonId: "sessions",
				type: "track",
				data: t,
				count: n,
				onClick: () => this.handleSessionsTrackClick(t)
			});
		}), e;
	}
	createSubButtons() {
		return this.computedSubButtons;
	}
	handleSubButtonClick(e) {
		if (e === "sessions_show_all") this.handleSessionsShowAllClick();
		else if (e.startsWith("sessions_track_")) {
			let t = parseInt(e.replace("sessions_track_", "")), n = this.rootStore.eventStore.tracks.find((e) => e.id === t);
			n && this.handleSessionsTrackClick(n);
		}
	}
	shouldShowSubButtons() {
		return this.rootStore.eventStore.tracks.length > 0;
	}
	reportActivation(e) {
		if (this.rootStore.searchButtonsStore.activeSubButtonId === e) return;
		let t = this.computedSubButtons.find((t) => t.id === e);
		!t || !t.label || cR("sbtnview", t.label, "subbutton");
	}
	handleSessionsShowAllClick() {
		this.reportActivation("sessions_show_all"), this.rootStore.uiState.list = {
			type: "sessions",
			text: "",
			focused: !1
		}, this.rootStore.uiState.selectedTrack = null, this.rootStore.searchButtonsStore.setSubButtonId("sessions_show_all");
	}
	handleSessionsTrackClick(e) {
		this.reportActivation(`sessions_track_${e.id}`), this.rootStore.uiState.list = {
			type: "sessions",
			text: "",
			focused: !1
		}, this.rootStore.uiState.selectedTrack = e, this.rootStore.searchButtonsStore.setSubButtonId(`sessions_track_${e.id}`);
	}
}, oW(aW.prototype, "computedSubButtons", [j], Object.getOwnPropertyDescriptor(aW.prototype, "computedSubButtons"), aW.prototype), aW), cW = class {
	constructor() {
		this.providers = /* @__PURE__ */ new Map(), this.cache = /* @__PURE__ */ new Map();
	}
	register(e) {
		this.providers.set(e.id, e), this.cache.delete(e.id);
	}
	unregister(e) {
		this.providers.delete(e), this.cache.delete(e);
	}
	getSubButtons(e) {
		let t = this.providers.get(e);
		return t ? t.createSubButtons() : [];
	}
	handleSubButtonClick(e, t) {
		let n = this.providers.get(e);
		n && n.handleSubButtonClick(t);
	}
	shouldShowSubButtons(e) {
		let t = this.providers.get(e);
		return t ? !t.shouldShowSubButtons || t.shouldShowSubButtons() : !1;
	}
	invalidateCache(e) {
		this.cache.delete(e);
		let t = this.providers.get(e);
		t != null && t.invalidateCache && t.invalidateCache();
	}
	invalidateAllCache() {
		this.cache.clear(), this.providers.forEach((e) => {
			e.invalidateCache && e.invalidateCache();
		});
	}
	getRegisteredProviders() {
		return Array.from(this.providers.keys());
	}
	isProviderRegistered(e) {
		return this.providers.has(e);
	}
};
//#endregion
//#region src/store/search-buttons/utils.ts
function lW(e) {
	try {
		let t = e.replace(NI.POI_TYPE, ""), n = parseInt(t, 10);
		return isNaN(n) ? null : n;
	} catch {
		return null;
	}
}
function uW(e) {
	let t = z.filterButtonsConfig;
	return !(t != null && t.searchButtons) || !Array.isArray(t.searchButtons) ? null : t.searchButtons.find((t) => t.id === e) || null;
}
function dW(e) {
	let t = 0;
	for (let n of e.values()) t += n;
	return t;
}
function fW(e) {
	return e && typeof e == "object" && Array.isArray(e.searchButtons) && e.searchButtons.length > 0;
}
//#endregion
//#region src/store/search-buttons/SearchButtonsActions.ts
var pW;
function mW(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var hW = (pW = class {
	constructor(e, t, n) {
		this.rootStore = e, this.state = t, this.filters = n;
	}
	reportActivation(e) {
		e && cR("sbtnview", e);
	}
	handleSearchButtonClick(e, t) {
		let n = {
			[MI.BOOKMARKS]: () => this.handleBookmarksClick(t),
			[MI.VISITED]: () => this.handleVisitedClick(t),
			[MI.SESSIONS]: () => this.handleSessionsClick(t),
			[MI.TOURS]: () => this.handleToursClick(t),
			[MI.CATEGORIES]: () => this.handleCategoriesClick(t),
			[MI.EXHIBITORS]: () => this.handleExhibitorsClick(t)
		}[e];
		if (n) {
			n();
			return;
		}
		e.startsWith(NI.POI_TYPE) && this.handlePoiTypeClick(e, t);
	}
	handleExtendedSearchButtonClick(e) {
		var t;
		let n = uW(e);
		if (!n) return;
		let r = n.name;
		if (n.type === "link") {
			this.handleLinkClick(n, r);
			return;
		}
		let i = ((t = n.children) == null ? void 0 : t.filter((e) => e.visible)) || [];
		if (i.length === 1 && i[0].type === "poi_types" && i[0].name === n.name) {
			this.handleSearchButtonClick(e, r);
			return;
		}
		n.children && i.length > 0 ? this.handleParentButton(e, n, r) : this.handleSearchButtonClick(e, r);
	}
	handleMainButtonClick(e) {
		this.handleSearchButtonClick(e);
	}
	handleSessionsClick(e) {
		let { uiState: t } = this.rootStore;
		t.list.type === "sessions" ? this.switchToSearch() : (this.reportActivation(e), this.resetAllFilters(), t.details = null, t.menu = !1, t.list = {
			type: "sessions",
			text: "",
			focused: !1
		}, this.state.setSubButton(null), t.selectedTrack = null, this.state.subButtonsEnabled && this.showSubButtons("sessions"), this.isMobile && (t.desiredOverlaySize = "full"));
	}
	togglePoiType(e) {
		this.handleSearchButtonClick(`${NI.POI_TYPE}${e}`);
	}
	clearAllFilters() {
		this.switchToSearch();
	}
	showSubButtons(e) {
		this.state.subButtonsEnabled && (this.state.setSubButtonParent(e), this.state.setSubButton(null), this.rootStore.uiState.subButtonsVisible = !0);
	}
	hideSubButtons() {
		this.state.setSubButtonParent(null), this.state.setSubButton(null), this.rootStore.uiState.subButtonsVisible = !1;
	}
	handleSubButtonClick(e) {
		this.state.activeSubButtonId !== e && this.state.setSubButton(e);
	}
	toggleListView(e, t, n) {
		this.rootStore.uiState.list.type === e ? this.switchToSearch() : (this.reportActivation(n), this.resetAllFilters(), t());
	}
	handleBookmarksClick(e) {
		this.toggleListView("bookmarks", () => {
			this.rootStore.clickBookmarks();
		}, e);
	}
	handleVisitedClick(e) {
		this.toggleListView("visited", () => {
			this.rootStore.clickVisited();
		}, e);
	}
	handleToursClick(e) {
		let { uiState: t } = this.rootStore;
		t.list.type === "tours" ? this.switchToSearch() : (this.reportActivation(e), this.resetAllFilters(), t.details = null, t.menu = !1, t.list = {
			type: "tours",
			text: "",
			focused: !1
		}, this.isMobile && (t.desiredOverlaySize = "full"));
	}
	handleCategoriesClick(e) {
		let { uiState: t } = this.rootStore;
		this.reportActivation(e), t.list.type === "search" ? this.state.activePoiFilterId && this.filters.clearPoiTypeFilters() : this.switchToSearch(), this.state.searchShortcutState.activeParentId && (this.state.setActiveParentId(null), this.state.clearChildren(), this.state.showShortcuts(!1), this.filters.clearAllChildFilters()), this.rootStore.categoryFilterStore.openFilter();
	}
	handleExhibitorsClick(e) {
		let { uiState: t } = this.rootStore;
		t.list.type === "exhibitors" ? this.switchToSearch() : (this.reportActivation(e), this.resetAllFilters(), t.details = null, t.menu = !1, t.list = {
			type: "exhibitors",
			text: "",
			focused: !1
		}, this.isMobile && (t.desiredOverlaySize = "full"));
	}
	handlePoiTypeClick(e, t) {
		let { uiState: n } = this.rootStore, r = this.state.activePoiFilterId !== e;
		r && this.reportActivation(t);
		let i = n.list.type === "search" && n.list.text || "";
		n.list.type === "search" ? n.selectedCategoryFilters.length > 0 && this.filters.clearCategoryFilters() : this.switchToSearch(!0), this.state.searchShortcutState.activeParentId && (this.state.setActiveParentId(null), this.state.clearChildren(), this.state.showShortcuts(!1), this.filters.clearAllChildFilters()), r ? this.setPoiFilterFromString(e) : this.filters.clearPoiTypeFilters(), i && n.list.type === "search" && (n.list = {
			type: "search",
			text: i,
			focused: !1
		}), this.rootStore.searchStore.selectSearchAndFocus(i);
	}
	handleLinkClick(e, t) {
		var n;
		let r = (n = e.children) == null ? void 0 : n.find((e) => e.type === "link");
		r && "linkUrl" in r && (this.reportActivation(t), window.open(r.linkUrl, "_blank"));
	}
	handleParentButton(e, t, n) {
		let { uiState: r } = this.rootStore;
		if (this.state.searchShortcutState.activeParentId === e) {
			this.state.setActiveParentId(null), this.state.clearChildren(), this.state.showShortcuts(!1), this.filters.clearAllChildFilters(), this.rootStore.urlFilterManager.clearAllFilters(), r.centerMap = !0, r.overlaySize === "full" && r.searchFocused && this.rootStore.searchStore.setFocused(!1);
			return;
		}
		this.reportActivation(n), r.list.type !== "search" && this.switchToSearch(), this.state.activePoiFilterId && this.state.setPoiFilter(null), this.state.setActiveParentId(e), this.state.showShortcuts(!0), this.state.clearChildren(), this.filters.applyAllChildrenFilters(t), this.rootStore.searchStore.selectSearchAndFocus();
	}
	preserveSearchText(e) {
		let { uiState: t } = this.rootStore, n = t.list.type === "search" && t.list.text || "";
		e(), t.list.type === "search" && n && (t.list = {
			type: "search",
			text: n,
			focused: !1
		});
	}
	switchToSearch(e = !1) {
		let t = () => {
			this.resetAllFilters(), this.rootStore.uiState.details = null, this.rootStore.uiState.menu = !1, this.rootStore.uiState.list = {
				type: "search",
				text: "",
				focused: !1
			};
		};
		e ? this.preserveSearchText(t) : t();
	}
	resetAllFilters() {
		this.state.reset(), this.rootStore.uiState.selectedPoiTypeFilters = [], this.rootStore.uiState.selectedCategoryFilters = [], this.rootStore.uiState.categoryFilterOpen = !1, this.rootStore.categoryFilterStore.state.selectedItems = [], this.rootStore.categoryFilterStore.state.pendingItems = [], this.rootStore.urlFilterManager.clearAllFilters(), this.rootStore.fp.hidePathways();
	}
	setPoiFilterFromString(e) {
		this.state.setPoiFilter(e);
		let t = lW(e);
		if (t !== null) {
			let e = this.rootStore.poiTypeStore.poiTypes.find((e) => e.id === t);
			e && (this.rootStore.uiState.selectedPoiTypeFilters = [e], this.rootStore.urlFilterManager.setPoiType(e.name));
		}
	}
	get isMobile() {
		return typeof window < "u" && window.innerWidth <= 768;
	}
}, mW(pW.prototype, "handleSearchButtonClick", [C], Object.getOwnPropertyDescriptor(pW.prototype, "handleSearchButtonClick"), pW.prototype), mW(pW.prototype, "handleExtendedSearchButtonClick", [C], Object.getOwnPropertyDescriptor(pW.prototype, "handleExtendedSearchButtonClick"), pW.prototype), mW(pW.prototype, "handleMainButtonClick", [C], Object.getOwnPropertyDescriptor(pW.prototype, "handleMainButtonClick"), pW.prototype), mW(pW.prototype, "handleSessionsClick", [C], Object.getOwnPropertyDescriptor(pW.prototype, "handleSessionsClick"), pW.prototype), mW(pW.prototype, "togglePoiType", [C], Object.getOwnPropertyDescriptor(pW.prototype, "togglePoiType"), pW.prototype), mW(pW.prototype, "clearAllFilters", [C], Object.getOwnPropertyDescriptor(pW.prototype, "clearAllFilters"), pW.prototype), mW(pW.prototype, "showSubButtons", [C], Object.getOwnPropertyDescriptor(pW.prototype, "showSubButtons"), pW.prototype), mW(pW.prototype, "hideSubButtons", [C], Object.getOwnPropertyDescriptor(pW.prototype, "hideSubButtons"), pW.prototype), mW(pW.prototype, "handleSubButtonClick", [C], Object.getOwnPropertyDescriptor(pW.prototype, "handleSubButtonClick"), pW.prototype), pW), gW = 150, _W = "#1a1a1a", vW = "#ffffff", yW = /^[0-9A-Fa-f]{6}$/, bW = /^[0-9A-Fa-f]{3}$/;
function xW(e) {
	let t = e.replace("#", "");
	return yW.test(t) ? t : bW.test(t) ? t[0] + t[0] + t[1] + t[1] + t[2] + t[2] : null;
}
function SW(e) {
	let t = xW(e);
	if (!t) return _W;
	let n = parseInt(t.substring(0, 2), 16), r = parseInt(t.substring(2, 4), 16), i = parseInt(t.substring(4, 6), 16);
	return .299 * n + .587 * r + .114 * i > gW ? _W : vW;
}
//#endregion
//#region src/store/search-buttons/SearchButtonsFactory.ts
var CW = class {
	constructor(e, t, n) {
		this.rootStore = e, this.state = t, this.actions = n, this.buttonFactories = void 0, this.buttonFactories = {
			[MI.BOOKMARKS]: (e) => this.createBookmarksButton(e),
			[MI.VISITED]: (e) => this.createVisitedButton(e),
			[MI.CATEGORIES]: (e) => this.createCategoriesButton(e),
			[MI.SESSIONS]: (e) => this.createSessionsButton(e),
			[MI.TOURS]: (e) => this.createGuidedToursButton(e),
			[MI.POI_TYPE]: (e) => this.createPoiTypeButton(e),
			[MI.POI_TYPES]: (e) => this.createPoiTypesButton(e),
			[MI.LINK]: (e) => this.createLinkButton(e),
			[MI.EXHIBITORS]: (e) => this.createExhibitorsButton(e)
		};
	}
	createButtons(e) {
		return this.dedupeButtons(e).filter((e) => e.visible).map((e) => {
			var t;
			return {
				button: this.createButton(e),
				order: (t = e.order) == null ? 2 ** 53 - 1 : t
			};
		}).filter((e) => e.button !== null).sort((e, t) => e.order - t.order).map((e) => e.button);
	}
	createButton(e) {
		let t = this.buttonFactories[e.type];
		return t ? t(e) : null;
	}
	createBaseButton(e) {
		let t = e.color && e.color.toUpperCase() !== "#FFFFFF", n = x(e.name);
		return {
			id: e.id || `${e.type}_${e.name}`,
			label: n,
			text: n,
			enabled: !0,
			isDimmed: !1,
			isClickable: !0,
			backgroundColor: t ? e.color : void 0,
			textColor: t && e.color ? SW(e.color) : void 0
		};
	}
	createButtonId(e, t) {
		return t.id || `${e}${t.name}`;
	}
	createBookmarksButton(e) {
		let { uiState: t } = this.rootStore;
		return t.kiosk || t.disableBookmarked || z.hideBookmarks ? null : {
			...this.createBaseButton(e),
			id: MI.BOOKMARKS,
			icon: PI.BOOKMARKS,
			active: t.list.type === "bookmarks",
			count: this.countBookmarks(),
			onClick: () => this.actions.handleSearchButtonClick(MI.BOOKMARKS, e.name)
		};
	}
	createVisitedButton(e) {
		let { uiState: t } = this.rootStore;
		return t.kiosk ? null : {
			...this.createBaseButton(e),
			id: MI.VISITED,
			icon: PI.VISITED,
			active: t.list.type === "visited",
			count: this.countVisited(),
			onClick: () => this.actions.handleSearchButtonClick(MI.VISITED, e.name)
		};
	}
	createCategoriesButton(e) {
		var t;
		if (!((t = e.children) != null && t.length)) {
			let t = this.getCategoriesTotalCount();
			return t > 0 ? this.createSimpleCategoriesButton(e, t) : null;
		}
		let n = (e.children || []).filter((e) => e.visible);
		if (n.length === 0) return null;
		let r = this.createButtonId(NI.CATEGORIES, e), i = n.filter((e) => e.type === "categories"), a = this.countCategories(i);
		return {
			...this.createBaseButton(e),
			id: r,
			active: this.state.searchShortcutState.activeParentId === r,
			count: a,
			showZeroCount: !0,
			onClick: () => this.actions.handleExtendedSearchButtonClick(r)
		};
	}
	createSimpleCategoriesButton(e, t) {
		let { uiState: n } = this.rootStore, r = n.selectedCategoryFilters.length > 0 ? n.selectedCategoryFilters.length : t;
		return {
			...this.createBaseButton(e),
			id: MI.CATEGORIES,
			active: n.selectedCategoryFilters.length > 0 && !this.state.searchShortcutState.activeParentId,
			count: r,
			showZeroCount: !0,
			onClick: () => this.actions.handleSearchButtonClick(MI.CATEGORIES, e.name)
		};
	}
	createSessionsButton(e) {
		let { uiState: t } = this.rootStore, n = this.getSessionsTotalCount();
		return n === 0 ? null : {
			...this.createBaseButton(e),
			id: MI.SESSIONS,
			icon: PI.SESSIONS,
			active: t.list.type === "sessions",
			count: n,
			showZeroCount: !0,
			hasSubButtons: !0,
			onClick: () => this.actions.handleSessionsClick(e.name)
		};
	}
	createGuidedToursButton(e) {
		let { uiState: t } = this.rootStore, n = this.getGuidedToursTotalCount();
		return n === 0 ? null : {
			...this.createBaseButton(e),
			id: "guided_tours",
			active: t.list.type === "tours" || t.list.type === "multi-point-tour",
			count: n,
			showZeroCount: !0,
			onClick: () => this.actions.handleSearchButtonClick("guided_tours", e.name)
		};
	}
	createPoiTypeButton(e) {
		let t = this.rootStore.poiTypeStore.poiTypes.find((t) => t.name === e.name);
		if (!t) return null;
		let n = `${NI.POI_TYPE}${t.id}`, r = this.getPoiTypeTotalCount(t.id);
		return r === 0 ? null : {
			...this.createBaseButton(e),
			id: n,
			active: this.state.activePoiFilterId === n,
			count: r,
			showZeroCount: !0,
			onClick: () => this.actions.handleSearchButtonClick(n, e.name)
		};
	}
	createPoiTypesButton(e) {
		var t;
		if (!((t = e.children) != null && t.length)) return this.createPoiTypeButton(e);
		let n = e.children.filter((e) => e.visible);
		if (n.length === 0) return null;
		if (this.shouldFlattenToSinglePoiType(n, e)) return this.createPoiTypeButton(e);
		let r = n.filter((e) => e.type !== "link"), i = this.countPoiTypes(r), a = this.createButtonId(NI.POI_TYPES, e);
		return {
			...this.createBaseButton(e),
			id: a,
			active: this.state.searchShortcutState.activeParentId === a,
			count: i,
			showZeroCount: !0,
			onClick: () => this.actions.handleExtendedSearchButtonClick(a)
		};
	}
	shouldFlattenToSinglePoiType(e, t) {
		return e.length === 1 && e[0].type === "poi_types" && e[0].name === t.name;
	}
	createLinkButton(e) {
		let t = this.createButtonId(NI.LINK, e);
		return {
			...this.createBaseButton(e),
			id: t,
			active: !1,
			onClick: () => this.actions.handleExtendedSearchButtonClick(t)
		};
	}
	createExhibitorsButton(e) {
		let { uiState: t } = this.rootStore, n = this.getExhibitorsTotalCount();
		return n === 0 ? null : {
			...this.createBaseButton(e),
			id: MI.EXHIBITORS,
			icon: PI.EXHIBITORS,
			active: t.list.type === "exhibitors",
			count: n,
			showZeroCount: !0,
			onClick: () => this.actions.handleSearchButtonClick(MI.EXHIBITORS, e.name)
		};
	}
	countCategories(e) {
		let { categoryById: t } = this.rootStore.categoryStore, n = /* @__PURE__ */ new Set();
		return e.forEach((e) => {
			if (e.type !== "categories") return;
			let r = t.get(Number(e.id));
			r && r.exhibitors.forEach((e) => n.add(e.id));
		}), n.size;
	}
	countPoiTypes(e) {
		return e.reduce((e, t) => {
			if (t.type !== "poi_types") return e;
			if (t.count !== void 0) return e + t.count;
			let n = Number(t.id), r = this.rootStore.poiTypeStore.poiTypes.find((e) => e.id === n);
			return r ? e + this.rootStore.boothStore.booths.filter((e) => e.poiTypeId === r.id).length : e;
		}, 0);
	}
	dedupeButtons(e) {
		let t = /* @__PURE__ */ new Set();
		return e.filter((e) => {
			let n = `${e.type}_${e.name}`;
			return t.has(n) ? !1 : (t.add(n), !0);
		});
	}
	countBookmarks() {
		return this.rootStore.exhibitorStore.bookmarked.length + this.rootStore.eventStore.bookmarked.length + this.rootStore.speakerStore.bookmarked.length + this.rootStore.boothStore.booths.filter((e) => e.exhibitors.length === 0 && e.bookmarkedDirectly).length;
	}
	countVisited() {
		return this.rootStore.exhibitorStore.visited.length + this.rootStore.eventStore.visited.length;
	}
	getSessionsTotalCount() {
		return this.rootStore.eventStore.eventItems.length;
	}
	getGuidedToursTotalCount() {
		return this.rootStore.toursStore.hasTours ? this.rootStore.toursStore.tourItems.length : 0;
	}
	getCategoriesTotalCount() {
		return this.rootStore.categoryStore.categories.filter((e) => e.exhibitors.length > 0).length;
	}
	getPoiTypeTotalCount(e) {
		return this.rootStore.boothStore.booths.filter((t) => t.poiTypeId === e).length;
	}
	getExhibitorsTotalCount() {
		return this.rootStore.exhibitorStore.exhibitors.length;
	}
}, wW;
function TW(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var EW = (wW = class {
	constructor(e, t) {
		this.rootStore = e, this.state = t;
	}
	applyAllChildrenFilters(e) {
		if (!e.children) return;
		let { uiState: t } = this.rootStore, n = e.children.filter((e) => e.visible), { categories: r, poiTypes: i } = this.collectFilters(n);
		t.selectedCategoryFilters = r, t.selectedPoiTypeFilters = i, t.categoryFilterOpen = r.length > 0;
	}
	applyChildFilters() {
		let { uiState: e } = this.rootStore, t = Array.from(this.state.searchShortcutState.activeChildren);
		if (e.selectedCategoryFilters = [], e.selectedPoiTypeFilters = [], e.categoryFilterOpen = !1, t.length === 0) return;
		let n = uW(this.state.searchShortcutState.activeParentId);
		if (!(n != null && n.children)) return;
		let r = n.children.filter((e) => e.visible), { categories: i, poiTypes: a } = this.collectSelectedFilters(r, t);
		e.selectedCategoryFilters = i, e.selectedPoiTypeFilters = a, e.categoryFilterOpen = i.length > 0;
	}
	clearAllChildFilters() {
		this.state.clearChildren(), this.rootStore.uiState.selectedCategoryFilters = [], this.rootStore.uiState.selectedPoiTypeFilters = [], this.rootStore.uiState.categoryFilterOpen = !1;
	}
	clearCategoryFilters() {
		let { uiState: e } = this.rootStore;
		e.selectedCategoryFilters = [], this.rootStore.categoryFilterStore.state.selectedItems = [], this.rootStore.categoryFilterStore.state.pendingItems = [], this.rootStore.urlFilterManager.setCategories([]);
	}
	clearPoiTypeFilters() {
		this.state.setPoiFilter(null), this.rootStore.uiState.selectedPoiTypeFilters = [], this.rootStore.urlFilterManager.setPoiType(null);
	}
	toggleChildFilter(e) {
		let t = uW(this.state.searchShortcutState.activeParentId);
		t != null && t.children && (this.state.toggleChild(e), this.state.hasActiveChildren ? this.applyChildFilters() : this.applyAllChildrenFilters(t));
	}
	getActiveParent() {
		return this.state.searchShortcutState.activeParentId ? uW(this.state.searchShortcutState.activeParentId) : null;
	}
	areAllSelected() {
		if (!this.state.searchShortcutState.activeParentId) return !1;
		let e = uW(this.state.searchShortcutState.activeParentId);
		if (!(e != null && e.children)) return !1;
		let t = e.children.filter((e) => e.visible).filter((e) => e.type !== "link");
		return t.length > 0 && t.every((e) => {
			var t;
			let n = ((t = e.id) == null ? void 0 : t.toString()) || e.name;
			return this.state.isChildActive(n);
		});
	}
	getChildrenCount() {
		if (!this.state.searchShortcutState.activeParentId) return 0;
		let e = uW(this.state.searchShortcutState.activeParentId);
		return e != null && e.children ? e.children.filter((e) => e.visible).filter((e) => e.type !== "link").length : 0;
	}
	collectFilters(e) {
		let t = [], n = [];
		return e.forEach((e) => {
			let r = Number(e.id);
			if (e.type === "categories") {
				let e = this.rootStore.categoryStore.categories.find((e) => e.id === r);
				e && t.push(e);
			} else if (e.type === "poi_types") {
				let e = this.rootStore.poiTypeStore.poiTypes.find((e) => e.id === r);
				e && n.push(e);
			}
		}), {
			categories: t,
			poiTypes: n
		};
	}
	collectSelectedFilters(e, t) {
		let n = [], r = [];
		return t.forEach((t) => {
			let i = e.find((e) => {
				var n;
				return e.type !== "link" && (((n = e.id) == null ? void 0 : n.toString()) || e.name) === t;
			});
			if (!i) return;
			let a = Number(i.id);
			if (i.type === "categories") {
				let e = this.rootStore.categoryStore.categories.find((e) => e.id === a);
				e && n.push(e);
			} else if (i.type === "poi_types") {
				let e = this.rootStore.poiTypeStore.poiTypes.find((e) => e.id === a);
				e && r.push(e);
			}
		}), {
			categories: n,
			poiTypes: r
		};
	}
}, TW(wW.prototype, "applyAllChildrenFilters", [C], Object.getOwnPropertyDescriptor(wW.prototype, "applyAllChildrenFilters"), wW.prototype), TW(wW.prototype, "applyChildFilters", [C], Object.getOwnPropertyDescriptor(wW.prototype, "applyChildFilters"), wW.prototype), TW(wW.prototype, "clearAllChildFilters", [C], Object.getOwnPropertyDescriptor(wW.prototype, "clearAllChildFilters"), wW.prototype), TW(wW.prototype, "clearCategoryFilters", [C], Object.getOwnPropertyDescriptor(wW.prototype, "clearCategoryFilters"), wW.prototype), TW(wW.prototype, "clearPoiTypeFilters", [C], Object.getOwnPropertyDescriptor(wW.prototype, "clearPoiTypeFilters"), wW.prototype), TW(wW.prototype, "toggleChildFilter", [C], Object.getOwnPropertyDescriptor(wW.prototype, "toggleChildFilter"), wW.prototype), wW), DW, OW, kW, AW, jW, MW, NW;
function PW(e, t, n, r) {
	n && Object.defineProperty(e, t, {
		enumerable: n.enumerable,
		configurable: n.configurable,
		writable: n.writable,
		value: n.initializer ? n.initializer.call(r) : void 0
	});
}
function FW(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var IW = (DW = class {
	constructor() {
		PW(this, "isVisible", OW, this), PW(this, "activePoiFilterId", kW, this), PW(this, "activeSubButtonsParentId", AW, this), PW(this, "activeSubButtonId", jW, this), PW(this, "subButtonsEnabled", MW, this), PW(this, "searchShortcutState", NW, this);
	}
	setVisible(e) {
		this.isVisible = e;
	}
	setSubButtonParent(e) {
		this.activeSubButtonsParentId = e;
	}
	setPoiFilter(e) {
		this.activePoiFilterId = e;
	}
	setSubButton(e) {
		this.activeSubButtonId = e;
	}
	setSubButtonsEnabled(e) {
		this.subButtonsEnabled = e;
	}
	setActiveParentId(e) {
		this.searchShortcutState.activeParentId = e;
	}
	showShortcuts(e) {
		this.searchShortcutState.isShortcutsVisible = e;
	}
	clearChildren() {
		this.searchShortcutState.activeChildren.clear();
	}
	toggleChild(e) {
		this.searchShortcutState.activeChildren.has(e) ? this.searchShortcutState.activeChildren.delete(e) : this.searchShortcutState.activeChildren.add(e);
	}
	reset() {
		this.activePoiFilterId = null, this.searchShortcutState.activeParentId = null, this.searchShortcutState.activeChildren.clear(), this.searchShortcutState.isShortcutsVisible = !1;
	}
	get hasActiveChildren() {
		return this.searchShortcutState.activeChildren.size > 0;
	}
	get activeChildrenCount() {
		return this.searchShortcutState.activeChildren.size;
	}
	get hasActiveParentWithChildren() {
		return this.searchShortcutState.isShortcutsVisible && this.searchShortcutState.activeParentId !== null;
	}
	isChildActive(e) {
		return this.searchShortcutState.activeChildren.has(e);
	}
}, OW = FW(DW.prototype, "isVisible", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !0;
	}
}), kW = FW(DW.prototype, "activePoiFilterId", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), AW = FW(DW.prototype, "activeSubButtonsParentId", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), jW = FW(DW.prototype, "activeSubButtonId", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), MW = FW(DW.prototype, "subButtonsEnabled", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), NW = FW(DW.prototype, "searchShortcutState", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return {
			activeParentId: null,
			activeChildren: /* @__PURE__ */ new Set(),
			isShortcutsVisible: !1
		};
	}
}), FW(DW.prototype, "setVisible", [C], Object.getOwnPropertyDescriptor(DW.prototype, "setVisible"), DW.prototype), FW(DW.prototype, "setSubButtonParent", [C], Object.getOwnPropertyDescriptor(DW.prototype, "setSubButtonParent"), DW.prototype), FW(DW.prototype, "setPoiFilter", [C], Object.getOwnPropertyDescriptor(DW.prototype, "setPoiFilter"), DW.prototype), FW(DW.prototype, "setSubButton", [C], Object.getOwnPropertyDescriptor(DW.prototype, "setSubButton"), DW.prototype), FW(DW.prototype, "setSubButtonsEnabled", [C], Object.getOwnPropertyDescriptor(DW.prototype, "setSubButtonsEnabled"), DW.prototype), FW(DW.prototype, "setActiveParentId", [C], Object.getOwnPropertyDescriptor(DW.prototype, "setActiveParentId"), DW.prototype), FW(DW.prototype, "showShortcuts", [C], Object.getOwnPropertyDescriptor(DW.prototype, "showShortcuts"), DW.prototype), FW(DW.prototype, "clearChildren", [C], Object.getOwnPropertyDescriptor(DW.prototype, "clearChildren"), DW.prototype), FW(DW.prototype, "toggleChild", [C], Object.getOwnPropertyDescriptor(DW.prototype, "toggleChild"), DW.prototype), FW(DW.prototype, "reset", [C], Object.getOwnPropertyDescriptor(DW.prototype, "reset"), DW.prototype), FW(DW.prototype, "hasActiveChildren", [j], Object.getOwnPropertyDescriptor(DW.prototype, "hasActiveChildren"), DW.prototype), FW(DW.prototype, "activeChildrenCount", [j], Object.getOwnPropertyDescriptor(DW.prototype, "activeChildrenCount"), DW.prototype), FW(DW.prototype, "hasActiveParentWithChildren", [j], Object.getOwnPropertyDescriptor(DW.prototype, "hasActiveParentWithChildren"), DW.prototype), DW), K;
function LW(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var RW = (K = class {
	constructor(e) {
		this.rootStore = void 0, this._subButtonRegistry = void 0, this.state = void 0, this.filters = void 0, this.actions = void 0, this.factory = void 0, this.poiTypeCountsCache = /* @__PURE__ */ new Map(), this.lastPoiTypeCountUpdate = 0, this.rootStore = e, this.state = new IW(), this.filters = new EW(e, this.state), this.actions = new hW(e, this.state, this.filters), this.factory = new CW(e, this.state, this.actions), this.setupReactions();
	}
	setupReactions() {
		N(() => this.rootStore.boothStore.booths.length, () => this.invalidatePoiTypeCounts());
	}
	get subButtonRegistry() {
		return this._subButtonRegistry || (this._subButtonRegistry = new cW(), this.registerSubButtonProviders()), this._subButtonRegistry;
	}
	registerSubButtonProviders() {
		this.subButtonRegistry.register(new sW(this.rootStore));
	}
	invalidatePoiTypeCounts() {
		this.poiTypeCountsCache.clear(), this.lastPoiTypeCountUpdate = 0;
	}
	get isVisible() {
		return this.state.isVisible;
	}
	get shouldShow() {
		let { uiState: e } = this.rootStore;
		if (e.screenSize.width >= 768) return this.state.isVisible;
		let t = !!(e.selectedExhibitor || e.selectedBooth || e.selectedEventItem || e.selectedRoute || e.menu || e.list.type === "language");
		return this.state.isVisible && !t;
	}
	get activePoiFilterId() {
		return this.state.activePoiFilterId;
	}
	get activeSubButtonsParentId() {
		return this.state.activeSubButtonsParentId;
	}
	get activeSubButtonId() {
		return this.state.activeSubButtonId;
	}
	get subButtonsEnabled() {
		return this.state.subButtonsEnabled;
	}
	get searchShortcutState() {
		return this.state.searchShortcutState;
	}
	get searchButtons() {
		let e = z.filterButtonsConfig;
		if (!fW(e)) return console.warn("[SearchButtonsStore] Invalid filterButtonsConfig detected"), [];
		let t = e.searchButtons;
		return this.factory.createButtons(t);
	}
	get hasAnySearchButtons() {
		return this.searchButtons.length > 0;
	}
	get hasActiveSearchButton() {
		return this.state.activePoiFilterId !== null || this.rootStore.uiState.selectedCategoryFilters.length > 0;
	}
	get activeSearchButtonLabel() {
		if (this.state.activePoiFilterId) {
			let e = this.searchButtons.find((e) => e.id === this.state.activePoiFilterId);
			return (e == null ? void 0 : e.label) || null;
		}
		return this.rootStore.uiState.selectedCategoryFilters.length > 0 ? "Categories" : null;
	}
	get activeSubButtons() {
		return this.state.activeSubButtonsParentId ? this.subButtonRegistry.getSubButtons(this.state.activeSubButtonsParentId) : [];
	}
	get shouldShowSubButtons() {
		if (!this.state.subButtonsEnabled || !this.state.activeSubButtonsParentId) return !1;
		let e = this.searchButtons.find((e) => e.id === this.state.activeSubButtonsParentId);
		return !e || !e.active ? !1 : this.subButtonRegistry.shouldShowSubButtons(this.state.activeSubButtonsParentId) && this.activeSubButtons.length > 0;
	}
	get hasActiveParentWithChildren() {
		return this.state.hasActiveParentWithChildren;
	}
	get areAllSelected() {
		return this.filters.areAllSelected();
	}
	get activeChildrenCount() {
		return this.state.activeChildrenCount;
	}
	get totalChildrenCount() {
		return this.filters.getChildrenCount();
	}
	get poiTypeCounts() {
		let e = Date.now();
		if (e - this.lastPoiTypeCountUpdate < 1e3 && this.poiTypeCountsCache.size > 0) return this.poiTypeCountsCache;
		let t = /* @__PURE__ */ new Map();
		return this.rootStore.boothStore.booths.forEach((e) => {
			e.poiTypeId && t.set(e.poiTypeId, (t.get(e.poiTypeId) || 0) + 1);
		}), this.poiTypeCountsCache = t, this.lastPoiTypeCountUpdate = e, t;
	}
	get totalPoiTypeCount() {
		return dW(this.poiTypeCounts);
	}
	get activePoiTypeId() {
		var e;
		return (e = this.state.activePoiFilterId) != null && e.startsWith(NI.POI_TYPE) ? lW(this.state.activePoiFilterId) : null;
	}
	handleSearchButtonClick(e, t) {
		this.actions.handleSearchButtonClick(e, t);
	}
	handleExtendedSearchButtonClick(e) {
		this.actions.handleExtendedSearchButtonClick(e);
	}
	handleMainButtonClick(e) {
		this.actions.handleMainButtonClick(e);
	}
	handleSessionsClick(e) {
		this.actions.handleSessionsClick(e);
	}
	togglePoiType(e) {
		this.actions.togglePoiType(e);
	}
	clearAllFilters() {
		this.actions.clearAllFilters();
	}
	showSubButtons(e) {
		this.actions.showSubButtons(e);
	}
	hideSubButtons() {
		this.actions.hideSubButtons();
	}
	handleSubButtonClick(e) {
		this.state.activeSubButtonId !== e && (this.state.setSubButton(e), this.state.activeSubButtonsParentId && this.subButtonRegistry.handleSubButtonClick(this.state.activeSubButtonsParentId, e));
	}
	toggleChildFilter(e) {
		this.filters.toggleChildFilter(e);
	}
	clearPoiTypeFilters() {
		this.filters.clearPoiTypeFilters();
	}
	clearAllChildFilters() {
		this.filters.clearAllChildFilters();
	}
	setActiveParentId(e) {
		this.state.setActiveParentId(e);
	}
	showShortcuts(e) {
		this.state.showShortcuts(e);
	}
	clearChildren() {
		this.state.clearChildren();
	}
	setSubButtonId(e) {
		this.state.setSubButton(e);
	}
	setPoiFilterId(e) {
		this.state.setPoiFilter(e);
	}
	getPoiTypeTotalCount(e) {
		return this.poiTypeCounts.get(e) || 0;
	}
	isChildActive(e) {
		return this.state.isChildActive(e);
	}
	getActiveParent() {
		return this.filters.getActiveParent();
	}
}, LW(K.prototype, "invalidatePoiTypeCounts", [C], Object.getOwnPropertyDescriptor(K.prototype, "invalidatePoiTypeCounts"), K.prototype), LW(K.prototype, "isVisible", [j], Object.getOwnPropertyDescriptor(K.prototype, "isVisible"), K.prototype), LW(K.prototype, "shouldShow", [j], Object.getOwnPropertyDescriptor(K.prototype, "shouldShow"), K.prototype), LW(K.prototype, "activePoiFilterId", [j], Object.getOwnPropertyDescriptor(K.prototype, "activePoiFilterId"), K.prototype), LW(K.prototype, "activeSubButtonsParentId", [j], Object.getOwnPropertyDescriptor(K.prototype, "activeSubButtonsParentId"), K.prototype), LW(K.prototype, "activeSubButtonId", [j], Object.getOwnPropertyDescriptor(K.prototype, "activeSubButtonId"), K.prototype), LW(K.prototype, "subButtonsEnabled", [j], Object.getOwnPropertyDescriptor(K.prototype, "subButtonsEnabled"), K.prototype), LW(K.prototype, "searchShortcutState", [j], Object.getOwnPropertyDescriptor(K.prototype, "searchShortcutState"), K.prototype), LW(K.prototype, "searchButtons", [j], Object.getOwnPropertyDescriptor(K.prototype, "searchButtons"), K.prototype), LW(K.prototype, "hasAnySearchButtons", [j], Object.getOwnPropertyDescriptor(K.prototype, "hasAnySearchButtons"), K.prototype), LW(K.prototype, "hasActiveSearchButton", [j], Object.getOwnPropertyDescriptor(K.prototype, "hasActiveSearchButton"), K.prototype), LW(K.prototype, "activeSearchButtonLabel", [j], Object.getOwnPropertyDescriptor(K.prototype, "activeSearchButtonLabel"), K.prototype), LW(K.prototype, "activeSubButtons", [j], Object.getOwnPropertyDescriptor(K.prototype, "activeSubButtons"), K.prototype), LW(K.prototype, "shouldShowSubButtons", [j], Object.getOwnPropertyDescriptor(K.prototype, "shouldShowSubButtons"), K.prototype), LW(K.prototype, "hasActiveParentWithChildren", [j], Object.getOwnPropertyDescriptor(K.prototype, "hasActiveParentWithChildren"), K.prototype), LW(K.prototype, "areAllSelected", [j], Object.getOwnPropertyDescriptor(K.prototype, "areAllSelected"), K.prototype), LW(K.prototype, "activeChildrenCount", [j], Object.getOwnPropertyDescriptor(K.prototype, "activeChildrenCount"), K.prototype), LW(K.prototype, "totalChildrenCount", [j], Object.getOwnPropertyDescriptor(K.prototype, "totalChildrenCount"), K.prototype), LW(K.prototype, "poiTypeCounts", [j], Object.getOwnPropertyDescriptor(K.prototype, "poiTypeCounts"), K.prototype), LW(K.prototype, "totalPoiTypeCount", [j], Object.getOwnPropertyDescriptor(K.prototype, "totalPoiTypeCount"), K.prototype), LW(K.prototype, "activePoiTypeId", [j], Object.getOwnPropertyDescriptor(K.prototype, "activePoiTypeId"), K.prototype), LW(K.prototype, "handleSearchButtonClick", [C], Object.getOwnPropertyDescriptor(K.prototype, "handleSearchButtonClick"), K.prototype), LW(K.prototype, "handleExtendedSearchButtonClick", [C], Object.getOwnPropertyDescriptor(K.prototype, "handleExtendedSearchButtonClick"), K.prototype), LW(K.prototype, "handleMainButtonClick", [C], Object.getOwnPropertyDescriptor(K.prototype, "handleMainButtonClick"), K.prototype), LW(K.prototype, "handleSessionsClick", [C], Object.getOwnPropertyDescriptor(K.prototype, "handleSessionsClick"), K.prototype), LW(K.prototype, "togglePoiType", [C], Object.getOwnPropertyDescriptor(K.prototype, "togglePoiType"), K.prototype), LW(K.prototype, "clearAllFilters", [C], Object.getOwnPropertyDescriptor(K.prototype, "clearAllFilters"), K.prototype), LW(K.prototype, "showSubButtons", [C], Object.getOwnPropertyDescriptor(K.prototype, "showSubButtons"), K.prototype), LW(K.prototype, "hideSubButtons", [C], Object.getOwnPropertyDescriptor(K.prototype, "hideSubButtons"), K.prototype), LW(K.prototype, "handleSubButtonClick", [C], Object.getOwnPropertyDescriptor(K.prototype, "handleSubButtonClick"), K.prototype), LW(K.prototype, "toggleChildFilter", [C], Object.getOwnPropertyDescriptor(K.prototype, "toggleChildFilter"), K.prototype), LW(K.prototype, "clearPoiTypeFilters", [C], Object.getOwnPropertyDescriptor(K.prototype, "clearPoiTypeFilters"), K.prototype), LW(K.prototype, "clearAllChildFilters", [C], Object.getOwnPropertyDescriptor(K.prototype, "clearAllChildFilters"), K.prototype), LW(K.prototype, "setActiveParentId", [C], Object.getOwnPropertyDescriptor(K.prototype, "setActiveParentId"), K.prototype), LW(K.prototype, "showShortcuts", [C], Object.getOwnPropertyDescriptor(K.prototype, "showShortcuts"), K.prototype), LW(K.prototype, "clearChildren", [C], Object.getOwnPropertyDescriptor(K.prototype, "clearChildren"), K.prototype), LW(K.prototype, "setSubButtonId", [C], Object.getOwnPropertyDescriptor(K.prototype, "setSubButtonId"), K.prototype), LW(K.prototype, "setPoiFilterId", [C], Object.getOwnPropertyDescriptor(K.prototype, "setPoiFilterId"), K.prototype), K), q, zW, BW, VW, HW;
function UW(e, t, n, r) {
	n && Object.defineProperty(e, t, {
		enumerable: n.enumerable,
		configurable: n.configurable,
		writable: n.writable,
		value: n.initializer ? n.initializer.call(r) : void 0
	});
}
function WW(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var GW = class {
	static closeDetails(e) {
		return e.details ? (e.details = null, !0) : !1;
	}
	static closeMultiPointTour(e) {
		return e.rootStore.fp.hidePathways(), !0;
	}
	static clearSearchAndFocus(e) {
		return e.searchText ? (e.setSearchText(""), e.setFocused(!0), !0) : !1;
	}
	static returnToSearch(e, t = !1) {
		e.list = {
			type: "search",
			text: "",
			focused: t
		};
	}
	static returnToSessions(e, t = !1) {
		e.list = {
			type: "sessions",
			text: "",
			focused: t
		};
	}
	static returnToTours(e, t = !1) {
		e.list = {
			type: "tours",
			text: "",
			focused: t
		};
	}
	static openMenu(e) {
		e.menu = !0;
	}
	static closeMenu(e) {
		e.menu = !1;
	}
	static clearListScroll(e, t) {
		e.clearListScroll(t);
	}
	static resetActiveListIndex(e) {
		e.activeListIndex = -1;
	}
}, KW = (q = class {
	constructor(e) {
		this.rootStore = void 0, UW(this, "searchText", zW, this), UW(this, "isFocused", BW, this), UW(this, "isClearMode", VW, this), UW(this, "skipInputFocus", HW, this), this.rootStore = e;
	}
	get uiState() {
		return this.rootStore.uiState;
	}
	get searchBoxConfig() {
		return this.uiState.searchBoxConfig;
	}
	get searchBoxMode() {
		return this.searchBoxConfig.mode;
	}
	get searchBoxTitle() {
		return this.searchBoxConfig.title;
	}
	get searchBoxSubtitle() {
		return this.searchBoxConfig.subtitle;
	}
	get searchBoxBadge() {
		return this.searchBoxConfig.badge;
	}
	get searchBoxIcon() {
		return this.searchBoxConfig.icon;
	}
	get searchBoxActions() {
		return this.uiState.searchBoxActions;
	}
	get shouldShowSearchInput() {
		return this.searchBoxMode === "search";
	}
	get shouldShowCloseButton() {
		let { menu: e, details: t, list: n } = this.uiState, r = z.isRebooking && n.type === "exhibitors";
		return !this.shouldShowSearchInput || n.type === "sessions" || n.type === "tours" || n.type === "speakers" || n.type === "exhibitors" && !r || e || t !== null || !!this.searchText || this.isClearMode || this.isFocused;
	}
	get closeButtonAction() {
		return !this.shouldShowSearchInput || this.searchBoxMode === "details" || this.uiState.list.type === "sessions" || this.uiState.list.type === "speakers" || this.uiState.list.type === "exhibitors" && !z.isRebooking ? "close" : this.searchText ? "clear" : "close";
	}
	get shouldShowShadow() {
		let { menu: e, details: t, list: n } = this.uiState, r = n.type === "search" && !!n.text;
		return !(this.rootStore.fp.alwaysShowSidebar || e || t !== null || n.type !== "search" || r || this.isFocused || this.uiState.heatmap);
	}
	get placeholder() {
		let { list: e, heatmapYah: t } = this.uiState;
		return e.type === "sessions" ? M("Search sessions") : e.type === "tours" ? M("Search Guided Tours") : e.type === "exhibitors" ? M("Search exhibitors") : e.type === "speakers" ? M("Search speakers") : vo.EXPO.startsWith("lenzerheidemotorclassics") ? "SUCHE" : vo.EXPO.startsWith("jetlag") ? "Search location or artist" : t ? M("Find values greater than") : this.uiState.hasAppliedFilters ? M("Search") : z.searchText || M("Search");
	}
	get searchBoxClass() {
		return {
			"is-details": this.searchBoxMode === "details" && !(this.uiState.details instanceof CU),
			"is-interface": this.searchBoxMode === "interface",
			"has-shadow": this.shouldShowShadow,
			"has-subtitle": !!this.searchBoxConfig.subtitle,
			"has-badge": !!this.searchBoxConfig.badge,
			"has-icon": !!this.searchBoxConfig.icon,
			"is-overlay-full": this.uiState.isOverlayOpen && this.uiState.overlaySize === "full",
			"is-featured-exhibitor": this.uiState.isFeaturedExhibitorActive,
			"is-route": this.uiState.details instanceof CU,
			"is-guided-tours": this.uiState.isGuidedToursActive,
			"is-overlay-scrolled": this.uiState.isOverlayScrolled,
			"overlay-pulse": this.uiState.kiosk && this.uiState.inIdle && !this.uiState.setKioskModeEnabled
		};
	}
	get ariaLabel() {
		return !this.shouldShowSearchInput || this.searchBoxMode === "details" ? M("Close") : this.searchText ? M("Clear search") : M("Close");
	}
	selectSearch(e) {
		window.__resett && window.__resett(), this.uiState.details = null;
		let t = MR(e || "", Object.keys(this.uiState.mapSettings).map((e) => `${e}=`));
		this.setSearchText(t), this.uiState.activeListIndex = -1;
	}
	selectSearchAndFocus(e) {
		this.selectSearch(e), this.setFocused(!0);
	}
	setSearchText(e) {
		this.searchText = e, this.uiState.hasAppliedFilters ? this.rootStore.moveToList() : this.uiState.centerMap = !0, this.uiState.activeListIndex = e ? 0 : -1, this.uiState.list.type !== "sessions" && this.uiState.list.type !== "tours" && this.uiState.list.type !== "speakers" && this.uiState.list.type !== "exhibitors" ? this.uiState.list = {
			type: "search",
			text: e,
			focused: this.isFocused
		} : this.uiState.list.type === "exhibitors" && (this.uiState.list = {
			type: "exhibitors",
			text: e,
			focused: this.isFocused
		}), this.uiState.searchClearMode = this.isClearMode;
	}
	setFocused(e) {
		this.isFocused = e, this.isClearMode = !1, this.skipInputFocus = !1, this.uiState.searchFocused = e, this.uiState.searchClearMode = !1, this.uiState.desiredOverlaySize = "full";
	}
	handleBackAction() {
		let { uiState: e } = this, { list: t } = e;
		if (e.desiredOverlaySize = "full", this.backMode === "menu") {
			this.resetSearchButtonState(), GW.openMenu(e);
			return;
		}
		if (t.type === "route-planner") {
			this.rootStore.routePlannerStore.close(), this.rootStore.selectBookmarks(), SL();
			return;
		}
		if (t.type === "multi-point-tour" && !e.details) {
			GW.returnToTours(e, !1), this.rootStore.fp.hidePathways();
			return;
		}
		if (e.details) {
			e.details = null, SL();
			return;
		}
		if (e.menu) {
			t.type === "sessions" ? e.list = {
				type: "sessions",
				text: "",
				focused: !0
			} : t.type === "exhibitors" ? e.list = {
				type: "exhibitors",
				text: "",
				focused: !0
			} : e.list = {
				type: "search",
				text: "",
				focused: !0
			}, this.setFocused(!0), this.isClearMode = !0, GW.closeMenu(e);
			return;
		}
		if (t.type === "tours" && e.details instanceof CU) {
			e.details = null;
			return;
		}
		if (t.type === "sessions" || t.type === "tours" || t.type === "exhibitors") {
			if (GW.closeDetails(e)) return;
			this.clearActiveFilters(), GW.returnToSearch(e, !1), this.selectSearchAndFocus();
			return;
		}
		switch (t.type) {
			case "filter":
				e.details = null;
				return;
			case "multi-point-tour":
				this.rootStore.fp.hidePathways(), GW.closeDetails(e) ? GW.returnToTours(e, !1) : SL();
				return;
			case "category":
				this.rootStore.selectCategory(t.category);
				return;
			case "speakers":
				if (GW.closeDetails(e)) return;
				GW.returnToSessions(e, !1);
				return;
			case "bookmarks":
			case "visited":
				if (GW.closeDetails(e)) return;
				this.selectSearchAndFocus();
				return;
			case h:
				GW.returnToSearch(e, !1), GW.openMenu(e);
				return;
		}
		GW.closeDetails(e) || GW.clearSearchAndFocus(this) || GW.openMenu(e);
	}
	closeSearch() {
		let { uiState: e } = this, { list: t } = e;
		if (t.type === "route-planner") {
			this.rootStore.routePlannerStore.close(), GW.returnToSearch(e, !1), this.resetSearchBox();
			return;
		}
		if (GW.closeDetails(e), GW.clearListScroll(e, t.type), GW.closeMultiPointTour(e), t.type === "bookmarks") {
			GW.returnToSearch(e, !1), this.resetSearchBox();
			return;
		}
		if (e.selectedCategory) {
			GW.returnToSearch(e, !1), this.resetSearchBox();
			return;
		}
		if (t.type === "sessions") {
			this.closeSessions();
			return;
		}
		if (t.type === "exhibitors") {
			if (z.isRebooking) {
				this.searchBoxMode === "search" && this.searchText ? (this.setSearchText(""), this.isClearMode = !0, this.clearActiveFilters()) : this.resetSearchBox();
				return;
			}
			this.closeExhibitors();
			return;
		}
		if (e.menu) {
			GW.closeMenu(e), this.resetSearchBox();
			return;
		}
		if (this.searchBoxMode === "search" && !e.details && this.searchText) {
			this.setSearchText(""), this.isClearMode = !0, this.clearActiveFilters();
			return;
		}
		GW.returnToSearch(e, !1), this.searchText = "", this.resetSearchBox(), e.details = null, this.clearActiveFilters();
	}
	clearActiveFilters() {
		this.rootStore.searchButtonsStore.setPoiFilterId(null), this.rootStore.uiState.selectedPoiTypeFilters = [], this.rootStore.uiState.selectedCategoryFilters = [], this.rootStore.categoryFilterStore.state.selectedItems = [], this.rootStore.categoryFilterStore.state.pendingItems = [], this.rootStore.searchButtonsStore.searchShortcutState.activeParentId = null, this.rootStore.searchButtonsStore.searchShortcutState.activeChildren.clear(), this.rootStore.searchButtonsStore.searchShortcutState.isShortcutsVisible = !1, this.rootStore.urlFilterManager && this.rootStore.urlFilterManager.isInitialized && this.rootStore.urlFilterManager.clearAllFilters();
	}
	resetSearchButtonState() {
		let { uiState: e } = this;
		this.rootStore.searchButtonsStore.clearAllFilters(), this.rootStore.searchButtonsStore.setSubButtonId(null), this.rootStore.searchButtonsStore.hideSubButtons(), e.selectedTrack = null, this.searchText = "", this.isClearMode = !1;
	}
	handleSearchAction() {
		this.isFocused || this.setFocused(!0);
	}
	openOverlayWithoutInputFocus() {
		this.skipInputFocus = !0, this.isFocused = !0, this.isClearMode = !1, this.uiState.searchFocused = !0, this.uiState.searchClearMode = !1, this.uiState.desiredOverlaySize = "full";
	}
	closeSessions() {
		this.searchText = "", GW.returnToSearch(this.uiState, !1), this.uiState.details = null, GW.resetActiveListIndex(this.uiState), this.uiState.selectedTrack = null, this.rootStore.searchButtonsStore.setSubButtonId(null), this.rootStore.searchButtonsStore.hideSubButtons();
	}
	closeExhibitors() {
		this.searchText = "", GW.returnToSearch(this.uiState, !1), this.uiState.details = null, GW.resetActiveListIndex(this.uiState);
	}
	resetSearchBox() {
		this.setFocused(!1), this.isClearMode = !1, this.syncWithUIState();
	}
	syncWithUIState() {
		this.searchText = (this.uiState.list.type === "search" || this.uiState.list.type === "exhibitors") && this.uiState.list.text || "", this.isFocused = this.uiState.searchFocused, this.isClearMode = this.uiState.searchClearMode;
	}
	get actionButtonIcon() {
		return this.shouldShowSearchInput ? this.shouldShowCloseButton ? "icon-close" : "icon-search" : "icon-close";
	}
	clearAndSelectSearch() {
		this.selectSearch(""), this.setFocused(!1);
	}
	get backMode() {
		let e = this.uiState.list.type;
		return (e === "bookmarks" || e === "visited") && !this.uiState.details && !this.uiState.menu || this.shouldShowSearchInput && !this.searchText ? "menu" : "back";
	}
	get isMobileDetailsMode() {
		return window.innerWidth < 768 && this.uiState.details !== null && this.uiState.overlaySize === "full" && !(this.uiState.details instanceof CU);
	}
	get shouldShowTitle() {
		return !this.shouldShowSearchInput;
	}
	get searchState() {
		return {
			text: this.searchText,
			isFocused: this.isFocused,
			isClearMode: this.isClearMode,
			mode: this.searchBoxMode,
			title: this.searchBoxConfig.title,
			subtitle: this.searchBoxConfig.subtitle,
			badge: this.searchBoxConfig.badge,
			icon: this.searchBoxConfig.icon
		};
	}
}, zW = WW(q.prototype, "searchText", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return "";
	}
}), BW = WW(q.prototype, "isFocused", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), VW = WW(q.prototype, "isClearMode", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), HW = WW(q.prototype, "skipInputFocus", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), WW(q.prototype, "searchBoxConfig", [j], Object.getOwnPropertyDescriptor(q.prototype, "searchBoxConfig"), q.prototype), WW(q.prototype, "searchBoxMode", [j], Object.getOwnPropertyDescriptor(q.prototype, "searchBoxMode"), q.prototype), WW(q.prototype, "searchBoxTitle", [j], Object.getOwnPropertyDescriptor(q.prototype, "searchBoxTitle"), q.prototype), WW(q.prototype, "searchBoxSubtitle", [j], Object.getOwnPropertyDescriptor(q.prototype, "searchBoxSubtitle"), q.prototype), WW(q.prototype, "searchBoxBadge", [j], Object.getOwnPropertyDescriptor(q.prototype, "searchBoxBadge"), q.prototype), WW(q.prototype, "searchBoxIcon", [j], Object.getOwnPropertyDescriptor(q.prototype, "searchBoxIcon"), q.prototype), WW(q.prototype, "searchBoxActions", [j], Object.getOwnPropertyDescriptor(q.prototype, "searchBoxActions"), q.prototype), WW(q.prototype, "shouldShowSearchInput", [j], Object.getOwnPropertyDescriptor(q.prototype, "shouldShowSearchInput"), q.prototype), WW(q.prototype, "shouldShowCloseButton", [j], Object.getOwnPropertyDescriptor(q.prototype, "shouldShowCloseButton"), q.prototype), WW(q.prototype, "closeButtonAction", [j], Object.getOwnPropertyDescriptor(q.prototype, "closeButtonAction"), q.prototype), WW(q.prototype, "shouldShowShadow", [j], Object.getOwnPropertyDescriptor(q.prototype, "shouldShowShadow"), q.prototype), WW(q.prototype, "placeholder", [j], Object.getOwnPropertyDescriptor(q.prototype, "placeholder"), q.prototype), WW(q.prototype, "searchBoxClass", [j], Object.getOwnPropertyDescriptor(q.prototype, "searchBoxClass"), q.prototype), WW(q.prototype, "ariaLabel", [j], Object.getOwnPropertyDescriptor(q.prototype, "ariaLabel"), q.prototype), WW(q.prototype, "selectSearch", [C], Object.getOwnPropertyDescriptor(q.prototype, "selectSearch"), q.prototype), WW(q.prototype, "selectSearchAndFocus", [C], Object.getOwnPropertyDescriptor(q.prototype, "selectSearchAndFocus"), q.prototype), WW(q.prototype, "setSearchText", [C], Object.getOwnPropertyDescriptor(q.prototype, "setSearchText"), q.prototype), WW(q.prototype, "setFocused", [C], Object.getOwnPropertyDescriptor(q.prototype, "setFocused"), q.prototype), WW(q.prototype, "handleBackAction", [C], Object.getOwnPropertyDescriptor(q.prototype, "handleBackAction"), q.prototype), WW(q.prototype, "closeSearch", [C], Object.getOwnPropertyDescriptor(q.prototype, "closeSearch"), q.prototype), WW(q.prototype, "clearActiveFilters", [C], Object.getOwnPropertyDescriptor(q.prototype, "clearActiveFilters"), q.prototype), WW(q.prototype, "resetSearchButtonState", [C], Object.getOwnPropertyDescriptor(q.prototype, "resetSearchButtonState"), q.prototype), WW(q.prototype, "handleSearchAction", [C], Object.getOwnPropertyDescriptor(q.prototype, "handleSearchAction"), q.prototype), WW(q.prototype, "openOverlayWithoutInputFocus", [C], Object.getOwnPropertyDescriptor(q.prototype, "openOverlayWithoutInputFocus"), q.prototype), WW(q.prototype, "closeSessions", [C], Object.getOwnPropertyDescriptor(q.prototype, "closeSessions"), q.prototype), WW(q.prototype, "closeExhibitors", [C], Object.getOwnPropertyDescriptor(q.prototype, "closeExhibitors"), q.prototype), WW(q.prototype, "resetSearchBox", [C], Object.getOwnPropertyDescriptor(q.prototype, "resetSearchBox"), q.prototype), WW(q.prototype, "syncWithUIState", [C], Object.getOwnPropertyDescriptor(q.prototype, "syncWithUIState"), q.prototype), WW(q.prototype, "actionButtonIcon", [j], Object.getOwnPropertyDescriptor(q.prototype, "actionButtonIcon"), q.prototype), WW(q.prototype, "clearAndSelectSearch", [C], Object.getOwnPropertyDescriptor(q.prototype, "clearAndSelectSearch"), q.prototype), WW(q.prototype, "backMode", [j], Object.getOwnPropertyDescriptor(q.prototype, "backMode"), q.prototype), WW(q.prototype, "isMobileDetailsMode", [j], Object.getOwnPropertyDescriptor(q.prototype, "isMobileDetailsMode"), q.prototype), WW(q.prototype, "shouldShowTitle", [j], Object.getOwnPropertyDescriptor(q.prototype, "shouldShowTitle"), q.prototype), WW(q.prototype, "searchState", [j], Object.getOwnPropertyDescriptor(q.prototype, "searchState"), q.prototype), q), qW, JW;
function YW(e, t, n, r) {
	n && Object.defineProperty(e, t, {
		enumerable: n.enumerable,
		configurable: n.configurable,
		writable: n.writable,
		value: n.initializer ? n.initializer.call(r) : void 0
	});
}
function XW(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var ZW = {
	selectedTracks: [],
	selectedVenues: [],
	selectedSpeakers: [],
	date: "all",
	timeOfDay: "all",
	sortOrder: "desc",
	use24hFormat: !1,
	showBookmarksOnly: !1,
	showLiveOnly: !1
}, QW = (qW = class extends BR {
	constructor(e) {
		super(e), YW(this, "state", JW, this);
	}
	createInitialFilters() {
		let e = {};
		return Object.keys(ZW).forEach((t) => {
			e[t] = {
				value: ZW[t],
				pending: ZW[t]
			};
		}), e;
	}
	setSearchText(e) {
		this.state.searchText = e;
	}
	setPending(e, t) {
		this.state.filters[e].pending = t;
	}
	applyFilters() {
		let { filters: e } = this.state, t = e.selectedTracks.value.length > 0, n = e.selectedVenues.value.length > 0;
		Object.keys(e).forEach((t) => {
			e[t].value = e[t].pending;
		});
		let r = e.selectedTracks.value.length > 0, i = e.selectedVenues.value.length > 0;
		t !== r && this.rootStore.shortcutRegistry.updateActivationOrderFromState("sessions", "tracks", t, r), n !== i && this.rootStore.shortcutRegistry.updateActivationOrderFromState("sessions", "venues", n, i), this.state.selectedItems = [...this.state.pendingItems], this.state.isOpen = !1, this.updateUIState();
	}
	resetFilters() {
		let { filters: e } = this.state;
		Object.keys(ZW).forEach((t) => {
			e[t].pending = ZW[t];
		}), this.state.pendingItems = [], this.state.searchText = "";
	}
	resetAndApplyFilters() {
		let { filters: e } = this.state, t = e.selectedTracks.value.length > 0, n = e.selectedVenues.value.length > 0;
		this.resetFilters(), Object.keys(e).forEach((t) => {
			e[t].value = e[t].pending;
		}), t !== !1 && this.rootStore.shortcutRegistry.updateActivationOrderFromState("sessions", "tracks", t, !1), n !== !1 && this.rootStore.shortcutRegistry.updateActivationOrderFromState("sessions", "venues", n, !1), this.state.selectedItems = [], this.state.isOpen = !1, this.rootStore.uiState.list = {
			type: "sessions",
			text: "",
			focused: !1
		};
	}
	openFilter() {
		this.state.isOpen = !0, this.state.pendingItems = [...this.state.selectedItems];
		let { filters: e } = this.state;
		Object.keys(e).forEach((t) => {
			e[t].pending = e[t].value;
		});
	}
	closeFilter() {
		this.state.isOpen = !1, this.state.pendingItems = [...this.state.selectedItems];
		let { filters: e } = this.state;
		Object.keys(e).forEach((t) => {
			e[t].pending = e[t].value;
		});
	}
	openFilterWithSections(e) {
		this.state.visibleSections = e, this.openFilter();
	}
	get activeFiltersCount() {
		let { filters: e } = this.state, t = 0;
		return Object.keys(ZW).forEach((n) => {
			let r = e[n].value, i = ZW[n];
			Array.isArray(i) && Array.isArray(r) ? r.length > 0 && t++ : r !== i && t++;
		}), t;
	}
	updateUIState() {
		this.rootStore.uiState.list = {
			type: "sessions",
			text: "",
			focused: !1
		}, this.rootStore.searchStore.setFocused(!0);
	}
	getFilteredItems() {
		return [];
	}
}, JW = XW(qW.prototype, "state", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return {
			isOpen: !1,
			selectedItems: [],
			pendingItems: [],
			searchText: "",
			visibleSections: [
				"tracks",
				"venues",
				"speakers",
				"date",
				"time",
				"sort",
				"settings"
			],
			filters: this.createInitialFilters()
		};
	}
}), XW(qW.prototype, "setSearchText", [C], Object.getOwnPropertyDescriptor(qW.prototype, "setSearchText"), qW.prototype), XW(qW.prototype, "setPending", [C], Object.getOwnPropertyDescriptor(qW.prototype, "setPending"), qW.prototype), XW(qW.prototype, "applyFilters", [C], Object.getOwnPropertyDescriptor(qW.prototype, "applyFilters"), qW.prototype), XW(qW.prototype, "resetFilters", [C], Object.getOwnPropertyDescriptor(qW.prototype, "resetFilters"), qW.prototype), XW(qW.prototype, "resetAndApplyFilters", [C], Object.getOwnPropertyDescriptor(qW.prototype, "resetAndApplyFilters"), qW.prototype), XW(qW.prototype, "openFilter", [C], Object.getOwnPropertyDescriptor(qW.prototype, "openFilter"), qW.prototype), XW(qW.prototype, "closeFilter", [C], Object.getOwnPropertyDescriptor(qW.prototype, "closeFilter"), qW.prototype), XW(qW.prototype, "openFilterWithSections", [C], Object.getOwnPropertyDescriptor(qW.prototype, "openFilterWithSections"), qW.prototype), XW(qW.prototype, "activeFiltersCount", [j], Object.getOwnPropertyDescriptor(qW.prototype, "activeFiltersCount"), qW.prototype), qW), $W = class {
	constructor() {
		this.providers = /* @__PURE__ */ new Map(), this.activationOrder = /* @__PURE__ */ new Map();
	}
	register(e) {
		if (!(e != null && e.id)) throw Error("Provider must have a valid id");
		this.providers.set(e.id, e);
	}
	unregister(e) {
		this.providers.delete(e), this.activationOrder.delete(e);
	}
	getShortcuts(e) {
		let t = this.providers.get(e);
		if (!t) return [];
		let n = t.createShortcuts(), r = this.activationOrder.get(e);
		return r ? this.sortShortcuts(n, r) : n;
	}
	sortShortcuts(e, t) {
		let n = new Map(t.map((e, t) => [e, t]));
		return e.sort((e, t) => {
			if (e.active !== t.active) return e.active ? -1 : 1;
			if (e.active && t.active) {
				let r = n.get(e.id), i = n.get(t.id);
				return r !== void 0 && i !== void 0 ? r - i : (r === void 0 ? 0 : -1) - (i === void 0 ? 0 : -1);
			}
			return 0;
		});
	}
	handleShortcutClick(e, t) {
		var n;
		let r = this.providers.get(e);
		if (!r) return;
		let i = r.createShortcuts().find((e) => e.id === t), a = (n = i == null ? void 0 : i.active) != null && n;
		r.handleShortcutClick(t);
		let o = this.isShortcutActive(r, t);
		this.reportClick(i, a, o), a !== o && this.updateActivationOrder(e, t, a, o);
	}
	reportClick(e, t, n) {
		if (!e || !(e.action === "custom" || !t && n)) return;
		let r = e.label || e.id;
		r && cR("sbtnview", r, "shortcut");
	}
	isShortcutActive(e, t) {
		var n, r;
		return (n = (r = e.createShortcuts().find((e) => e.id === t)) == null ? void 0 : r.active) != null && n;
	}
	handleShortcutReset(e, t) {
		let n = this.providers.get(e);
		if (!(n != null && n.handleShortcutReset)) return;
		n.handleShortcutReset(t);
		let r = this.activationOrder.get(e);
		r != null && r.includes(t) && this.updateActivationOrder(e, t, !0, !1);
	}
	updateActivationOrder(e, t, n, r) {
		let i = this.activationOrder.get(e) || [], a;
		if (!n && r) a = i.includes(t) ? i : [...i, t];
		else if (n && !r) a = i.filter((e) => e !== t);
		else return;
		a.length > 0 ? this.activationOrder.set(e, a) : this.activationOrder.delete(e);
	}
	updateActivationOrderFromState(e, t, n, r) {
		this.updateActivationOrder(e, t, n, r);
	}
	shouldShowShortcuts(e) {
		var t, n;
		let r = this.providers.get(e);
		return (t = r == null || (n = r.shouldShowShortcuts) == null ? void 0 : n.call(r)) == null || t;
	}
	getRegisteredProviders() {
		return Array.from(this.providers.keys());
	}
	isProviderRegistered(e) {
		return this.providers.has(e);
	}
	clear() {
		this.providers.clear(), this.activationOrder.clear();
	}
}, eG, tG, nG, rG, iG;
function aG(e, t, n, r) {
	n && Object.defineProperty(e, t, {
		enumerable: n.enumerable,
		configurable: n.configurable,
		writable: n.writable,
		value: n.initializer ? n.initializer.call(r) : void 0
	});
}
function oG(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var sG = (eG = class {
	constructor(e) {
		aG(this, "value", tG, this), aG(this, "pending", nG, this), this.value = e, this.pending = e;
	}
	setValue(e) {
		this.pending = e;
	}
	apply() {
		this.value = this.pending;
	}
	reset() {
		this.pending = this.value;
	}
}, tG = oG(eG.prototype, "value", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: null
}), nG = oG(eG.prototype, "pending", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: null
}), oG(eG.prototype, "setValue", [C], Object.getOwnPropertyDescriptor(eG.prototype, "setValue"), eG.prototype), oG(eG.prototype, "apply", [C], Object.getOwnPropertyDescriptor(eG.prototype, "apply"), eG.prototype), oG(eG.prototype, "reset", [C], Object.getOwnPropertyDescriptor(eG.prototype, "reset"), eG.prototype), eG), cG = (rG = class {
	constructor(e) {
		this.rootStore = void 0, aG(this, "state", iG, this), this.rootStore = e;
	}
	get activeFiltersCount() {
		let e = 0, { filters: t } = this.state;
		return t.selectedCompanies.value.length > 0 && e++, t.selectedJobTitles.value.length > 0 && e++, e;
	}
	applyFilters() {
		let { filters: e } = this.state;
		e.selectedCompanies.apply(), e.selectedJobTitles.apply(), this.closeFilter();
	}
	resetFilters() {
		let { filters: e } = this.state;
		e.selectedCompanies.pending = [], e.selectedJobTitles.pending = [];
	}
	resetAndApplyFilters() {
		this.resetFilters(), this.applyFilters();
	}
	clearAllFilters() {
		let { filters: e } = this.state;
		e.selectedCompanies.pending = [], e.selectedJobTitles.pending = [], e.selectedCompanies.value = [], e.selectedJobTitles.value = [];
	}
	openFilter() {
		this.state.isOpen = !0;
	}
	closeFilter() {
		this.state.isOpen = !1;
	}
	openFilterWithSections(e) {
		this.state.visibleSections = e, this.openFilter();
	}
	setPending(e, t) {
		this.state.filters[e].setValue(t);
	}
	toggleCompanyFilter(e) {
		let { selectedCompanies: t } = this.state.filters, n = t.value;
		n.includes(e) ? t.setValue(n.filter((t) => t !== e)) : t.setValue([...n, e]);
	}
	toggleJobTitleFilter(e) {
		let { selectedJobTitles: t } = this.state.filters, n = t.value;
		n.includes(e) ? t.setValue(n.filter((t) => t !== e)) : t.setValue([...n, e]);
	}
	getDefaultValues() {
		return {
			selectedCompanies: [],
			selectedJobTitles: []
		};
	}
}, iG = oG(rG.prototype, "state", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return {
			isOpen: !1,
			filters: {
				selectedCompanies: new sG([]),
				selectedJobTitles: new sG([])
			},
			visibleSections: ["companies", "jobTitles"]
		};
	}
}), oG(rG.prototype, "activeFiltersCount", [j], Object.getOwnPropertyDescriptor(rG.prototype, "activeFiltersCount"), rG.prototype), oG(rG.prototype, "applyFilters", [C], Object.getOwnPropertyDescriptor(rG.prototype, "applyFilters"), rG.prototype), oG(rG.prototype, "resetFilters", [C], Object.getOwnPropertyDescriptor(rG.prototype, "resetFilters"), rG.prototype), oG(rG.prototype, "resetAndApplyFilters", [C], Object.getOwnPropertyDescriptor(rG.prototype, "resetAndApplyFilters"), rG.prototype), oG(rG.prototype, "clearAllFilters", [C], Object.getOwnPropertyDescriptor(rG.prototype, "clearAllFilters"), rG.prototype), oG(rG.prototype, "openFilter", [C], Object.getOwnPropertyDescriptor(rG.prototype, "openFilter"), rG.prototype), oG(rG.prototype, "closeFilter", [C], Object.getOwnPropertyDescriptor(rG.prototype, "closeFilter"), rG.prototype), oG(rG.prototype, "openFilterWithSections", [C], Object.getOwnPropertyDescriptor(rG.prototype, "openFilterWithSections"), rG.prototype), oG(rG.prototype, "setPending", [C], Object.getOwnPropertyDescriptor(rG.prototype, "setPending"), rG.prototype), oG(rG.prototype, "toggleCompanyFilter", [C], Object.getOwnPropertyDescriptor(rG.prototype, "toggleCompanyFilter"), rG.prototype), oG(rG.prototype, "toggleJobTitleFilter", [C], Object.getOwnPropertyDescriptor(rG.prototype, "toggleJobTitleFilter"), rG.prototype), rG), lG, uG, dG, fG;
function pG(e, t, n, r) {
	n && Object.defineProperty(e, t, {
		enumerable: n.enumerable,
		configurable: n.configurable,
		writable: n.writable,
		value: n.initializer ? n.initializer.call(r) : void 0
	});
}
function mG(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var hG = (lG = class {
	constructor(e, t, n, r, i, a, o = { type: "speaker" }) {
		this.id = e, this.externalId = t, this.name = n, this.company = r, this.jobTitle = i, this.photoFile = a, this.entity = o, this.slug = void 0, pG(this, "bookmarked", uG, this), this.slug = Ro(n || `speaker-${e}`);
	}
	get displayName() {
		return this.name;
	}
	get fullTitle() {
		let e = [this.name];
		return this.jobTitle && e.push(this.jobTitle), this.company && e.push(this.company), e.join(" - ");
	}
	get hasPhoto() {
		return !!this.photoFile;
	}
	get hasCompany() {
		return !!this.company;
	}
	get hasJobTitle() {
		return !!this.jobTitle;
	}
}, uG = mG(lG.prototype, "bookmarked", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), lG), gG = (dG = class {
	constructor(e) {
		this.rootStore = void 0, this.speakersMap = /* @__PURE__ */ new Map(), pG(this, "selectedSpeaker", fG, this), this.rootStore = e;
	}
	get speakers() {
		return Array.from(this.speakersMap.values()).sort((e, t) => e.name.localeCompare(t.name));
	}
	getSpeakerById(e) {
		return this.speakersMap.get(e);
	}
	getSpeakerBySlug(e) {
		return Array.from(this.speakersMap.values()).find((t) => t.slug === e);
	}
	addSpeaker(e) {
		if (this.speakersMap.has(e.id)) return this.speakersMap.get(e.id);
		let t = new hG(e.id, e.externalId, e.name, e.company, e.jobTitle, e.photoFile);
		return this.speakersMap.set(e.id, t), t;
	}
	get companies() {
		let e = /* @__PURE__ */ new Set();
		return this.speakers.forEach((t) => {
			t.company && e.add(t.company);
		}), Array.from(e).sort();
	}
	get jobTitles() {
		let e = /* @__PURE__ */ new Set();
		return this.speakers.forEach((t) => {
			t.jobTitle && e.add(t.jobTitle);
		}), Array.from(e).sort();
	}
	getSpeakersByCompany(e) {
		return this.speakers.filter((t) => t.company === e);
	}
	getSpeakersByJobTitle(e) {
		return this.speakers.filter((t) => t.jobTitle === e);
	}
	getEventsBySpeaker(e) {
		return this.rootStore.eventStore.eventItems.filter((t) => t.speakers.some((t) => t.id === e));
	}
	findBySlug(e) {
		return this.getSpeakerBySlug(e);
	}
	selectSpeaker(e, t = !0) {
		this.selectedSpeaker = e, this.rootStore.uiState.details = e, this.rootStore.uiState.desiredOverlaySize = "medium";
	}
	get bookmarked() {
		return this.speakers.filter((e) => e.bookmarked);
	}
	replaceBookmarked(e) {
		let t = (e || []).map((e) => this.speakersMap.get(e)).filter((e) => e), n = new Set(t), r = this.bookmarked.filter((e) => !n.has(e));
		for (let e of r) e.bookmarked = !1;
		for (let e of t) e.bookmarked = !0;
	}
	clearSelectedSpeaker() {
		this.selectedSpeaker = null, this.rootStore.uiState.details = null;
	}
}, fG = mG(dG.prototype, "selectedSpeaker", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), mG(dG.prototype, "speakers", [j], Object.getOwnPropertyDescriptor(dG.prototype, "speakers"), dG.prototype), mG(dG.prototype, "companies", [j], Object.getOwnPropertyDescriptor(dG.prototype, "companies"), dG.prototype), mG(dG.prototype, "jobTitles", [j], Object.getOwnPropertyDescriptor(dG.prototype, "jobTitles"), dG.prototype), mG(dG.prototype, "selectSpeaker", [C], Object.getOwnPropertyDescriptor(dG.prototype, "selectSpeaker"), dG.prototype), mG(dG.prototype, "bookmarked", [j], Object.getOwnPropertyDescriptor(dG.prototype, "bookmarked"), dG.prototype), mG(dG.prototype, "replaceBookmarked", [C], Object.getOwnPropertyDescriptor(dG.prototype, "replaceBookmarked"), dG.prototype), mG(dG.prototype, "clearSelectedSpeaker", [C], Object.getOwnPropertyDescriptor(dG.prototype, "clearSelectedSpeaker"), dG.prototype), dG), _G = {
	uitestdemo: [{
		id: "connected-business-tour",
		layers: [{
			floor: "1",
			id: "Pathway_1"
		}, {
			floor: "2",
			id: "Pathway_2"
		}],
		name: "Connected Business Tour",
		points: [
			"2345",
			"coffee-or-2119",
			"11-or-1289"
		]
	}],
	uitest2026: [
		{
			id: "knowledge-trail",
			layers: [{
				floor: "1",
				id: "Pathway_1"
			}],
			name: "Knowledge Trail",
			description: "Designed for attendees focused on learning sessions and hands-on workshops, this route provides a clear path through the main educational areas of the event. It ensures quick access to conference rooms, interactive workshops, and the Innovation Lab, allowing participants to maximize their time, gain new knowledge, and engage directly with practical demonstrations.",
			points: [
				"2345",
				"coffee-or-2119",
				"11-or-1289",
				"255",
				"729"
			]
		},
		{
			id: "vip-express",
			layers: [{
				floor: "1",
				id: "Pathway_2"
			}],
			name: "VIP Express",
			description: "A reserved route created specifically for VIP guests, allowing them to move efficiently between exclusive areas without interruptions. It connects the VIP Lounge with private meeting rooms and a dedicated exit, ensuring comfort, privacy, and quick access to high-priority zones throughout the event.",
			points: [
				"365",
				"burger-point",
				"backyard-or-1813",
				"2122",
				"2164",
				"mp12",
				"11-or-1289"
			]
		},
		{
			id: "startup-discovery-walk",
			layers: [{
				floor: "1",
				id: "Pathway_3"
			}],
			name: "Startup Discovery Walk",
			description: "A route designed for attendees interested in exploring the newest and most innovative companies. It guides visitors through the Innovation Hub and Startup Pavilion, finishing at the Pitch Stage where emerging businesses showcase their ideas. This path helps attendees quickly discover fresh solutions and connect with founders shaping the future of logistics and supply chain.",
			points: [
				"mc7",
				"1895",
				"coffee-or-2183",
				"2345",
				"innovation-stage-or-1303",
				"biergarten-or-620",
				"spa-or-573"
			]
		},
		{
			id: "global-networking-path",
			layers: [{
				floor: "1",
				id: "Pathway_4"
			}],
			name: "Global Networking Path",
			description: "Created for participants who want to expand their global connections. This route leads from the Main Hall to the International Pavilion, highlighting exhibitors from around the world, and continues to the Networking Lounge. It ensures a smooth flow for meeting international partners, discovering global solutions, and engaging in meaningful business conversations.",
			points: [
				"puppy-park-or-184",
				"ocado-intelligent-automation",
				"533",
				"mocktails-or-941",
				"infios",
				"slip-robotics",
				"penske-transportation-solutions",
				"headshot-studio-or-1988",
				"coffee-or-2183"
			]
		}
	],
	uitestimex: [{
		id: "startup-discovery-walk",
		layers: [{
			floor: "1",
			id: "Pathway_1"
		}],
		name: "Startup Discovery Walk",
		description: "Designed for attendees focused on learning sessions and hands-on workshops, this route provides a clear path through the main educational areas of the event. It ensures quick access to conference rooms, interactive workshops, and the Innovation Lab, allowing participants to maximize their time, gain new knowledge, and engage directly with practical demonstrations.",
		points: [
			"84624",
			"E1235",
			"E1817",
			"E2105"
		]
	}, {
		id: "tech-innovation-trail",
		layers: [{
			floor: "1",
			id: "Pathway_2"
		}],
		name: "Tech Innovation Trail",
		description: "Focuses on technology exhibitors — mapping a route through companies offering event management software, AI tools, and digital signage solutions. Great for testing longer routes with multiple stops.",
		points: [
			"84628",
			"95111",
			"E1905",
			"39440",
			"91811",
			"40760",
			"10651"
		]
	}],
	ifaberlin2025clone: [{
		id: "knowledge-trail",
		layers: [{
			floor: "1",
			id: "Pathway_2"
		}],
		name: "Knowledge Trail",
		description: "Designed for attendees focused on learning sessions and hands-on workshops, this route provides a clear path through the main educational areas of the event. It ensures quick access to conference rooms, interactive workshops, and the Innovation Lab, allowing participants to maximize their time, gain new knowledge, and engage directly with practical demonstrations.",
		points: [
			"gr-ocg-107",
			"gr-ocg-109",
			"gr-ocg-102",
			"gr-ocg-104",
			"gr-ocg-106",
			"gr-ocg-111",
			"gr-ocg-110",
			"Seating Lounge | Outdoor 1"
		]
	}],
	demo: [{
		id: "the-green-journey",
		layers: [{
			floor: "1",
			id: "Pathway_1"
		}],
		name: "The Green Journey — From Idea to Implementation",
		description: "Embark on a curated journey through the exhibition’s most innovative sustainability zones. This tour highlights how modern industries rethink construction, manufacturing, and waste transformation to create a cleaner future. You’ll explore cutting-edge eco-materials, smart production methods, and next-generation recycling technologies — with a few pleasant stops along the way. The route ends in a relaxing lounge area, perfect for unwinding and reflecting on the ideas you’ve discovered.",
		points: [
			"RXhoaWJpdG9yXzE4OTc5ODY=",
			"RXhoaWJpdG9yXzE4OTc5NTg=",
			"RXhoaWJpdG9yXzE4OTc5Mzk=",
			"RXhoaWJpdG9yXzE4OTc5Mjc=",
			"Coffe Bar | Hall 5.1"
		]
	}],
	wcc2026: [
		{
			id: "learning-on-show-floor",
			layers: [{
				floor: "L",
				id: "Pathway_1"
			}],
			name: "Learning on show floor",
			points: [
				"Space Domain Theater | 723",
				"3307",
				"Unveiled Theater | 2241"
			]
		},
		{
			id: "networking-on-show-floor",
			layers: [{
				floor: "L",
				id: "Pathway_2"
			}],
			name: "Networking on show floor",
			points: [
				"Restaurant | 406",
				"Meeting Hub | 636",
				"Brew Lounge | 1163"
			]
		},
		{
			id: "welcome-and-information-journey",
			layers: [
				{
					floor: "1",
					id: "Pathway_5"
				},
				{
					floor: "3",
					id: "Pathway_3"
				},
				{
					floor: "2",
					id: "Pathway_4"
				},
				{
					floor: "C",
					id: "Pathway_6"
				}
			],
			name: "Welcome and Information Journey",
			description: "Follow this route to get oriented, find visitor services, complete registration, and enter the exhibition hall."
		}
	],
	lamma2026: [{
		id: "innovation-trail",
		layers: [{
			floor: "1",
			id: "Pathway_1"
		}],
		name: "Innovation Trail",
		points: [
			"12120485",
			"12120827",
			"12120497",
			"15552598",
			"15552695",
			"15552538",
			"12120220",
			"15552729",
			"15784756",
			"15552462",
			"12120351",
			"15552470"
		]
	}],
	fdhw2026: [
		{
			id: "association-of-convenience-stores-trail",
			layers: [{
				floor: "1",
				id: "Pathway_1"
			}],
			name: "Association of Convenience Stores Trail",
			description: "Show: IFE.\nData Types Allowed to View: IFE Visitors / IFE Suppliers / IFE Press / IFEM Visitors / IFEM Suppliers / IFEM Press.",
			points: [
				"16282530",
				"16282664",
				"16572191",
				"16282882",
				"16572254",
				"16282294",
				"16282527",
				"16282319",
				"16445163"
			]
		},
		{
			id: "newbies-at-the-pub-show",
			layers: [{
				floor: "1",
				id: "Pathway_2"
			}],
			name: "Newbies at The Pub Show",
			description: "Show: The Pub Show.\nData Types Allowed to View: Pub Visitor / Pub Supplier / Pub Press / HRC Visitor / HRC Supplier / HRC Press.",
			points: [
				"16282289",
				"16282507",
				"16282613",
				"16282283",
				"16282382",
				"16282792",
				"16830654",
				"16282656",
				"16282309",
				"16282902",
				"16282450",
				"16283034",
				"16282743",
				"16572201",
				"16282279",
				"16369552",
				"16282392",
				"16282603"
			]
		},
		{
			id: "chef-steve-munkley-mbe-s-top-picks",
			layers: [{
				floor: "1",
				id: "Pathway_3"
			}],
			name: "Chef Steve Munkley MBE's Top Picks",
			description: "Show: HRC.\nData Types Allowed to View: Pub Visitor / Pub Supplier / Pub Press / HRC Visitor / HRC Supplier / HRC Press.",
			points: [
				"16282438",
				"16282525",
				"16282753",
				"16282554",
				"16282784",
				"16282440",
				"16282479",
				"16282833",
				"PastryHQ | S1290",
				"16282914",
				"16282776"
			]
		},
		{
			id: "radford-chancellor-s-must-see-exhibitors",
			layers: [{
				floor: "1",
				id: "Pathway_4"
			}],
			name: "Radford Chancellor's Must See Exhibitors",
			description: "Show: HRC.\nData Types Allowed to View: Pub Visitor / Pub Supplier / Pub Press / HRC Visitor / HRC Supplier / HRC Press.",
			points: [
				"16282429",
				"16283073",
				"16600529"
			]
		},
		{
			id: "anna-sebastian-s-top-tipples",
			layers: [{
				floor: "1",
				id: "Pathway_5"
			}],
			name: "Anna Sebastian's Top Tipples",
			description: "Show: HRC & The Pub Show.\nData Types Allowed to View: Pub Visitor / Pub Supplier / Pub Press / HRC Visitor / HRC Supplier / HRC Press.",
			points: [
				"16282311",
				"16445141",
				"16837929",
				"16369552",
				"16282279",
				"16282289",
				"16282603"
			]
		},
		{
			id: "fcsi-members-trail",
			layers: [{
				floor: "1",
				id: "Pathway_6"
			}],
			name: "\xA0FCSI Members Trail",
			points: [
				"16282429",
				"16600529",
				"16282606",
				"16282806",
				"16282745",
				"16282964"
			]
		}
	],
	retailtechnologyshow2026: [{
		id: "innovation-awards-finalists",
		layers: [{
			floor: "1",
			id: "Pathway_1"
		}],
		name: "Innovation Awards Finalists",
		points: [
			"Business France | K10",
			"16528837",
			"16528943",
			"16528881",
			"16528816",
			"16529021",
			"16529050",
			"16528953",
			"16528893",
			"16529071"
		]
	}, {
		id: "zebra-partners-scavenger-hunt",
		layers: [{
			floor: "1",
			id: "Pathway_2"
		}],
		name: "Zebra Partners Scavenger Hunt",
		points: [
			"16528708",
			"16528793",
			"16529002",
			"16529036",
			"16529030",
			"16529038",
			"16528903",
			"16528855",
			"16528716",
			"16528967",
			"16528895",
			"16529088",
			"16529055",
			"16529024"
		]
	}]
}, vG, yG, bG, xG, SG;
function CG(e, t, n, r) {
	n && Object.defineProperty(e, t, {
		enumerable: n.enumerable,
		configurable: n.configurable,
		writable: n.writable,
		value: n.initializer ? n.initializer.call(r) : void 0
	});
}
function wG(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var TG = 1, EG = (vG = class {
	constructor(e) {
		this.rootStore = void 0, CG(this, "tours", yG, this), CG(this, "currentExpo", bG, this), CG(this, "hasTours", xG, this), CG(this, "toursLoadError", SG, this), this.rootStore = e, this.loadTours();
	}
	loadTours() {
		try {
			if (this.currentExpo = vo.EXPO || "default", this.toursLoadError = null, !this.isValidToursData(_G)) {
				this.toursLoadError = "Invalid tours data format", this.resetTours();
				return;
			}
			let e = _G[this.currentExpo] || [];
			if (!this.validateToursStructure(e)) {
				this.toursLoadError = "Invalid tour items structure", this.resetTours();
				return;
			}
			this.tours = e, this.hasTours = e.length > 0;
		} catch (e) {
			console.error("Error loading tours:", e), this.toursLoadError = e instanceof Error ? e.message : "Failed to load tours", this.resetTours();
		}
	}
	resetTours() {
		this.tours = [], this.hasTours = !1;
	}
	isValidToursData(e) {
		return typeof e == "object" && !!e && !Array.isArray(e);
	}
	validateToursStructure(e) {
		return Array.isArray(e) ? e.every((e) => e && typeof e == "object" && typeof e.id == "string" && Array.isArray(e.layers) && e.layers.length >= TG && (e.points === void 0 || Array.isArray(e.points))) : !1;
	}
	get tourItems() {
		return this.tours;
	}
	getTourById(e) {
		return this.tours.find((t) => t.id === e);
	}
	getToursByPoint(e) {
		return this.tours.filter((t) => {
			var n;
			return (n = t.points) == null ? void 0 : n.includes(e);
		});
	}
	getToursForExpo(e) {
		return this.isValidToursData(_G) && _G[e] || [];
	}
	get currentTour() {
		let { list: e } = this.rootStore.uiState;
		return e.type !== "multi-point-tour" || !this.isMultiPointTourList(e) ? null : this.getTourById(e.tourId) || null;
	}
	isMultiPointTourList(e) {
		return e.type === "multi-point-tour" && typeof e.tourId == "string";
	}
	get isActive() {
		return this.rootStore.uiState.list.type === "multi-point-tour";
	}
	get tourLayers() {
		let e = this.currentTour;
		return e ? e.layers.map((e) => this.rootStore.layerStore.findLayer(e.floor)).filter((e) => e != null) : [];
	}
	getTourLayerInfo(e) {
		let t = this.currentTour;
		if (t) return t.layers.find((t) => {
			let n = this.rootStore.layerStore.findLayer(t.floor);
			return n && (n.name === e || n.description === e);
		});
	}
	launchTour(e, t, n) {
		let r = this.validateTourForLaunch(e);
		if (r) return console.warn(`Cannot launch tour: ${r}`), !1;
		let i = e.layers[0].id, a = e.layers[0].floor;
		return e.points && e.points.length > 0 ? this.rootStore.fp.showPathway(i, e.points) : this.rootStore.fp.showPathwayOnly(i, a), this.rootStore.uiState.setTourTitle(t), this.rootStore.uiState.setTourDescription(n), this.rootStore.uiState.setIsMultiPointTour(!0), this.rootStore.uiState.setMultiPointTourList(e.id), window.setTimeout(() => {
			this.rootStore.showMap();
		}, navigator.userAgent.toLowerCase().indexOf("android") > -1 ? 400 : 50), !0;
	}
	validateTourForLaunch(e) {
		return e.layers.length < TG ? `Tour must have at least ${TG} layer` : null;
	}
	stopTour() {
		this.rootStore.uiState.setIsMultiPointTour(!1), this.rootStore.uiState.setPathwayOnlyMode(!1);
		let e = this.rootStore.uiState.list.type;
		(e === "tours" || e === "multi-point-tour") && (this.rootStore.uiState.list = {
			type: "search",
			text: "",
			focused: !1
		}), this.rootStore.fp.hidePathways();
	}
}, yG = wG(vG.prototype, "tours", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return [];
	}
}), bG = wG(vG.prototype, "currentExpo", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return "";
	}
}), xG = wG(vG.prototype, "hasTours", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), SG = wG(vG.prototype, "toursLoadError", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), wG(vG.prototype, "loadTours", [C], Object.getOwnPropertyDescriptor(vG.prototype, "loadTours"), vG.prototype), wG(vG.prototype, "resetTours", [C], Object.getOwnPropertyDescriptor(vG.prototype, "resetTours"), vG.prototype), wG(vG.prototype, "tourItems", [j], Object.getOwnPropertyDescriptor(vG.prototype, "tourItems"), vG.prototype), wG(vG.prototype, "currentTour", [j], Object.getOwnPropertyDescriptor(vG.prototype, "currentTour"), vG.prototype), wG(vG.prototype, "isActive", [j], Object.getOwnPropertyDescriptor(vG.prototype, "isActive"), vG.prototype), wG(vG.prototype, "tourLayers", [j], Object.getOwnPropertyDescriptor(vG.prototype, "tourLayers"), vG.prototype), wG(vG.prototype, "launchTour", [C], Object.getOwnPropertyDescriptor(vG.prototype, "launchTour"), vG.prototype), wG(vG.prototype, "stopTour", [C], Object.getOwnPropertyDescriptor(vG.prototype, "stopTour"), vG.prototype), vG), DG = [
	"x",
	"y",
	"z"
];
function OG(e) {
	let t = {}, n = AG(e, "x");
	n !== null && (t.x = n);
	let r = AG(e, "y");
	r !== null && (t.y = r);
	let i = e.get(UL("z"));
	return i !== null && (t.z = i), t;
}
function kG(e, t) {
	if (t) for (let n of DG) {
		let r = t[n];
		r != null && e.set(UL(n), typeof r == "number" ? r.toFixed(2) : `${r}`);
	}
}
function AG(e, t) {
	let n = e.get(UL(t));
	if (n === null) return null;
	let r = parseFloat(n);
	return Number.isNaN(r) ? null : r;
}
//#endregion
//#region src/components/Map/scene.ts
function jG(e) {
	NG = e;
}
function MG() {
	return NG;
}
var NG, PG = "https://expofp.com/", FG = {
	SUBDOMAIN_CTA: "expofp_subdomain_cta",
	SUBDOMAIN_LOGO: "expofp_subdomain_logo"
};
function IG(e, t = "/") {
	let n = new URL(t, PG);
	return n.searchParams.set("utm_campaign", e), n.toString();
}
//#endregion
//#region src/tools/freeBanner.ts
var LG = "free-dismissed5";
function RG(e) {
	return e.getItem(LG) !== null;
}
function zG(e) {
	e.setItem(LG, "1");
}
function BG() {
	return IG(FG.SUBDOMAIN_CTA);
}
//#endregion
//#region src/tools/has-html-tags.ts
function VG(e) {
	return /<[^>]*>/.test(e);
}
//#endregion
//#region src/tools/strip-html.ts
function HG(e) {
	var t;
	if (typeof document > "u") return e;
	let n = document.createElement("div");
	return n.innerHTML = e, (t = n.textContent) == null ? "" : t;
}
//#endregion
//#region src/utils/responsiveClass.ts
var UG = {
	xs: 0,
	sm: 480,
	md: 768,
	lg: 998,
	xl: 1100
};
function WG(e) {
	let { sm: t, md: n, lg: r, xl: i } = UG;
	return e < t ? "xs" : e >= t && e < n ? "sm" : e >= n && e < r ? "md" : e >= r && e < i ? "lg" : "xl";
}
//#endregion
//#region src/utils/scene-bounds.ts
var GG = "areamap";
function KG(e) {
	var t;
	let n = e == null || (t = e.rootLayer) == null ? void 0 : t.children;
	if (!(n != null && n.length)) return null;
	let r = Infinity, i = Infinity, a = -Infinity, o = -Infinity, s = (e, t) => {
		!Number.isFinite(e) || !Number.isFinite(t) || (e < r && (r = e), t < i && (i = t), e > a && (a = e), t > o && (o = t));
	}, c = (e) => {
		s(e.min.x, e.min.y), s(e.max.x, e.max.y);
	}, l = (e) => {
		if (jm(e)) {
			e.children.forEach(l);
			return;
		}
		if (Em(e)) {
			c(qr(e.shape) ? e.shape : e.shape.bounds);
			return;
		}
		if (km(e)) {
			s(e.points.p0.x, e.points.p0.y), s(e.points.p1.x, e.points.p1.y);
			return;
		}
		c(e.bounds.bounds);
	};
	for (let e of n) {
		let t = e.name;
		typeof t == "string" && t.toLowerCase() === GG || l(e);
	}
	return r > a || i > o ? null : Er.fromMinMax({
		x: r,
		y: i
	}, {
		x: a,
		y: o
	});
}
function qG(e, t) {
	return !e || !t || t.area <= 0 || e.area / t.area > .1 ? .15 : .25;
}
function JG(e, t) {
	return t ? e.expand({
		x: e.size.width * t,
		y: e.size.height * t
	}) : e;
}
function YG(e, t) {
	let n = KG(e);
	return n ? JG(n, qG(n, t)) : null;
}
function XG(e) {
	return e === "layer-viewbox" || e === "explicit-viewbox" || e === "scene-derived";
}
function ZG(e) {
	if (e.layerViewbox) return {
		rect: e.layerViewbox,
		source: "layer-viewbox"
	};
	if (e.explicitArea) return {
		rect: e.explicitArea,
		source: "explicit-viewbox"
	};
	if (e.layerRectangle) return {
		rect: e.layerRectangle,
		source: "layer-rectangle"
	};
	let t = YG(e.sceneDef, e.svgArea);
	return t ? {
		rect: t,
		source: "scene-derived"
	} : {
		rect: e.svgArea,
		source: "svg-area"
	};
}
//#endregion
//#region src/store/UIState.ts
var QG, $G, eK, tK, nK, rK, iK, aK, oK, sK, cK, lK, uK, dK, fK, pK, mK, hK, gK, _K, vK, J, yK, bK, xK, SK, CK, wK, TK, EK, DK, OK, kK, AK, jK, MK, NK, PK, FK, IK, LK, RK, zK, BK, VK, HK, UK, WK, GK, KK, qK, JK, YK, XK, ZK, QK, $K, eq, tq, nq, rq, iq, aq, oq, sq, cq, lq, uq, dq, fq, pq, mq, hq, gq, _q, vq, yq, bq, xq, Sq, Cq, wq, Tq, Eq, Dq, Oq, kq, Aq, jq, Mq, Nq, Pq, Fq, Iq;
function Y(e, t, n, r) {
	n && Object.defineProperty(e, t, {
		enumerable: n.enumerable,
		configurable: n.configurable,
		writable: n.writable,
		value: n.initializer ? n.initializer.call(r) : void 0
	});
}
function X(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var Lq = ["dimensions25"], Rq = (QG = y.struct, $G = y.ref, eK = y.ref, tK = y.ref, nK = y.struct, rK = j({ keepAlive: !0 }), iK = j({ keepAlive: !0 }), aK = j({ keepAlive: !0 }), oK = j({ keepAlive: !0 }), sK = j({ keepAlive: !0 }), cK = j({ keepAlive: !0 }), lK = j({ keepAlive: !0 }), uK = j({ keepAlive: !0 }), dK = j({ keepAlive: !0 }), fK = j({ keepAlive: !0 }), pK = j({ keepAlive: !0 }), mK = j({ keepAlive: !0 }), hK = j({ keepAlive: !0 }), gK = j({ keepAlive: !0 }), _K = j({ keepAlive: !0 }), vK = j({ keepAlive: !0 }), J = class {
	setSelectedCategoryFilters(e) {
		this.selectedCategoryFilters = e;
	}
	resetCategoryFilter() {
		this.selectedCategoryFilters = [], this.categoryFilterOpen = !1;
	}
	setSearchClearMode(e) {
		this.searchClearMode = e;
	}
	setRouteTitle(e) {
		this.routeTitle = e;
	}
	setRouteDescription(e) {
		this.routeDescription = e;
	}
	setIsMultiPointRoute(e) {
		this.isMultiPointRoute = e;
	}
	setTourTitle(e) {
		this.tourTitle = e;
	}
	setTourDescription(e) {
		this.tourDescription = e;
	}
	setIsMultiPointTour(e) {
		this.isMultiPointTour = e;
	}
	setPathwayOnlyMode(e) {
		this.pathwayOnlyMode = e;
	}
	setMultiPointTourList(e) {
		this.list = {
			type: "multi-point-tour",
			tourId: e
		};
	}
	get activePathwayLayers() {
		var e;
		if (((e = this.list) == null ? void 0 : e.type) === "multi-point-tour") {
			var t;
			let e = this.rootStore.toursStore.getTourById(this.list.tourId);
			return (e == null || (t = e.layers) == null ? void 0 : t.map((e) => e.id)) || [];
		}
		return [];
	}
	get highlightedBooths() {
		var e, t, n, r, i, a, o;
		let s = new Set(this.rootStore.exhibitorStore.highlightedByExternalIds), c = new Set(this.rootStore.boothStore.highlightedByExternalIds), l = /* @__PURE__ */ new Set([...this.rootStore.exhibitorStore.exhibitors.filter((e) => s.has(e.externalId)).flatMap((e) => e.booths.filter((e) => e instanceof Ds)).map((e) => e.id.toString()), ...this.rootStore.boothStore.booths.filter((e) => c.has(e.externalId)).map((e) => e.id.toString())]);
		if (((e = this.list) == null ? void 0 : e.type) === "search" && !((t = this.list) == null || (t = t.text) == null) && t.trim().length) {
			l.clear();
			let e = this.fuzzySearchItems.filter((e) => e.score === 0).map((e) => e.item);
			e.length ? Bq(e, this.rootStore.boothStore.booths, this.rootStore.eventStore.eventItems).forEach((e) => l.add(e.id.toString())) : this.listBooths.forEach((e) => l.add(e.id.toString()));
		}
		if (((n = this.list) == null ? void 0 : n.type) === "filter" && (l.clear(), this.list.items.flatMap((e) => e.booths.filter((e) => e instanceof Ds)).forEach((e) => l.add(e.id.toString()))), this.categoryFilterOpen && this.selectedCategoryFilters.length > 0 ? (l.clear(), this.selectedCategoryFilters.forEach((e) => {
			e.exhibitors.flatMap((e) => e.booths).forEach((e) => l.add(e.id.toString()));
		})) : ((r = this.list) == null ? void 0 : r.type) === "category" && (l.clear(), this.list.category.exhibitors.flatMap((e) => e.booths).forEach((e) => l.add(e.id.toString()))), ((i = this.list) == null ? void 0 : i.type) === "bookmarks" && (l.clear(), Bq(this.listItems, this.rootStore.boothStore.booths, this.rootStore.eventStore.eventItems).forEach((e) => l.add(e.id.toString()))), ((a = this.list) == null ? void 0 : a.type) === "visited" && (l.clear(), Bq(this.listItems, this.rootStore.boothStore.booths, this.rootStore.eventStore.eventItems).forEach((e) => l.add(e.id.toString()))), ((o = this.list) == null ? void 0 : o.type) === "exhibitors") {
			var u;
			l.clear();
			let e = (u = this.list.text) == null ? void 0 : u.toLowerCase().trim(), t = this.rootStore.exhibitorStore.exhibitors;
			e && (t = t.filter((t) => t.name.toLowerCase().includes(e))), t.flatMap((e) => e.booths.filter((e) => e instanceof Ds)).forEach((e) => l.add(e.id.toString()));
		}
		if (this.selectedPoiTypeFilters.length > 0 && (l.clear(), this.selectedPoiTypeFilters.forEach((e) => {
			this.rootStore.boothStore.booths.filter((t) => t.poiTypeId === e.id).forEach((e) => l.add(e.id.toString()));
		})), this.details instanceof CU) {
			var d;
			l.clear(), this.details.from instanceof Es && l.add(this.details.from.id.toString()), this.details.to instanceof Es && l.add(this.details.to.id.toString()), (d = this.details.waypoints) == null || d.forEach((e) => l.add(e.id.toString()));
		}
		if (this.details instanceof Es && (l.clear(), l.add(this.details.id.toString())), this.details instanceof Ac && (l.clear(), this.details.booths.filter((e) => e instanceof Ds).forEach((e) => l.add(e.id.toString()))), this.details instanceof Ys) {
			let e = this.details;
			if (e.boothId) {
				l.clear();
				let t = this.rootStore.boothStore.booths.find((t) => t.id === e.boothId);
				t && l.add(t.id.toString());
			}
		}
		return l;
	}
	constructor(e) {
		this.rootStore = void 0, this.interfaceMetadata = Object.freeze([
			{
				id: "menu",
				className: "efp-overlay-menu",
				priority: 80,
				isActive: () => this.menu,
				searchBoxConfig: () => ({
					mode: "interface",
					title: M("Menu")
				})
			},
			{
				id: "exhibitor",
				className: "efp-overlay-exhibitor",
				priority: 70,
				isActive: () => this.details instanceof Ac,
				searchBoxConfig: () => ({
					mode: "details",
					title: this.details.name
				})
			},
			{
				id: "booth",
				className: "efp-overlay-booth",
				priority: 70,
				isActive: () => this.details instanceof Es,
				searchBoxConfig: () => {
					let e = this.details;
					return {
						mode: "details",
						title: e.title || e.name
					};
				}
			},
			{
				id: "event",
				className: "efp-overlay-event",
				priority: 70,
				isActive: () => this.details instanceof Ys,
				searchBoxConfig: () => ({
					mode: "details",
					title: this.details.name
				})
			},
			{
				id: "route",
				className: "efp-overlay-route",
				priority: 70,
				isActive: () => this.details instanceof CU,
				searchBoxConfig: () => ({
					mode: "details",
					title: M("Directions")
				})
			},
			{
				id: "search",
				className: "efp-overlay-search",
				priority: 60,
				isActive: () => !this.details && !this.menu && this.list.type === "search" && (this.rootStore.fp.alwaysShowSidebar && !this.overlayOnDemand || this.heatmap || this.searchFocused || this.list.text.length > 0 || this.searchClearMode),
				searchBoxConfig: () => ({
					mode: "search",
					title: M("Search")
				})
			},
			{
				id: "exhibitors",
				className: "efp-overlay-exhibitors",
				priority: 50,
				isActive: () => this.list.type === "exhibitors" && !this.details,
				searchBoxConfig: () => ({
					mode: "search",
					title: M("Exhibitors")
				})
			},
			{
				id: "filter",
				className: "efp-overlay-filter",
				priority: 50,
				isActive: () => this.list.type === "filter" && !this.details,
				searchBoxConfig: () => ({
					mode: "search",
					title: M("Filter")
				})
			},
			{
				id: "bookmarks",
				className: "efp-overlay-bookmarks",
				priority: 50,
				isActive: () => this.list.type === "bookmarks" && !this.details,
				searchBoxConfig: () => ({
					mode: "interface",
					title: M("Bookmarks"),
					badge: this.rootStore.bookmarksStore.total
				})
			},
			{
				id: "visited",
				className: "efp-overlay-visited",
				priority: 50,
				isActive: () => this.list.type === "visited" && !this.details,
				searchBoxConfig: () => ({
					mode: "interface",
					title: M("Visited"),
					badge: this.rootStore.exhibitorStore.visited.length
				})
			},
			{
				id: h,
				className: "efp-overlay-language",
				priority: 50,
				isActive: () => this.list.type === h,
				searchBoxConfig: () => ({
					mode: "interface",
					title: M("Language")
				})
			},
			{
				id: "category",
				className: "efp-overlay-category",
				priority: 50,
				isActive: () => !$.menu && !!$.selectedCategory,
				searchBoxConfig: () => {
					var e;
					return {
						mode: "interface",
						title: this.list.type === "category" && ((e = this.list.category) == null ? void 0 : e.name) || M("Categories")
					};
				}
			},
			{
				id: "sessions",
				className: "efp-overlay-sessions",
				priority: 50,
				isActive: () => this.list.type === "sessions" && !this.details,
				searchBoxConfig: () => ({
					mode: "search",
					title: M("Sessions"),
					subtitle: this.selectedTrack ? this.selectedTrack.name : void 0
				})
			},
			{
				id: "speakers",
				className: "efp-overlay-speakers",
				priority: 50,
				isActive: () => this.list.type === "speakers" && !this.details,
				searchBoxConfig: () => ({
					mode: "search",
					title: M("Speakers")
				})
			},
			{
				id: "speaker",
				className: "efp-overlay-speaker",
				priority: 50,
				isActive: () => this.details instanceof hG,
				searchBoxConfig: () => ({
					mode: "details",
					title: this.details.name
				})
			},
			{
				id: "tours",
				className: "efp-overlay-tours",
				priority: 50,
				isActive: () => this.list.type === "tours" && !this.details,
				searchBoxConfig: () => ({
					mode: "search",
					title: M("Guided Tours")
				})
			},
			{
				id: "multi-point-wayfinding",
				className: "efp-overlay-multi-point",
				priority: 75,
				isActive: () => !!(this.isMultiPointRoute && this.selectedRoute && this.list.type !== "route-planner"),
				searchBoxConfig: () => ({
					mode: "interface",
					title: this.routeTitle || M("Multi-point route")
				})
			},
			{
				id: "multi-point-tour",
				className: "efp-overlay-multi-point-tour",
				priority: 75,
				isActive: () => this.list.type === "multi-point-tour" && !this.details,
				searchBoxConfig: () => ({
					mode: "interface",
					title: this.tourTitle || M("Multi-point route")
				})
			},
			{
				id: "route-planner",
				className: "efp-overlay-route-planner",
				priority: 76,
				isActive: () => this.list.type === "route-planner" && (!this.details || this.details instanceof CU),
				searchBoxConfig: () => ({
					mode: "interface",
					title: M("Route planner")
				})
			}
		].sort((e, t) => t.priority - e.priority)), Y(this, "list", yK, this), Y(this, "details", bK, this), Y(this, "hoveredExhibitor", xK, this), Y(this, "hoveredBooth", SK, this), Y(this, "zoomBy", CK, this), Y(this, "rollReset", wK, this), Y(this, "moveToBooths", TK, this), Y(this, "moveToRect", EK, this), Y(this, "moveToRectPaddingPercent", DK, this), Y(this, "moveToLocation", OK, this), Y(this, "menu", kK, this), Y(this, "searchFocused", AK, this), Y(this, "searchClearMode", jK, this), Y(this, "printingPdf", MK, this), Y(this, "screenSize", NK, this), Y(this, "desiredOverlaySize", PK, this), Y(this, "overlayShowsAll", FK, this), Y(this, "centerMap", IK, this), Y(this, "zoomAfTransformK", LK, this), Y(this, "activeListIndex", RK, this), Y(this, "devicePixelRatio", zK, this), this.previewExhibitor = null, Y(this, "wsStarted", BK, this), Y(this, "canvasStarted", VK, this), Y(this, "kiosk", HK, this), Y(this, "inIdle", UK, this), Y(this, "modalActive", WK, this), Y(this, "galleryActive", GK, this), Y(this, "hideOverlay", KK, this), Y(this, "searchButtonsOverride", qK, this), Y(this, "hideCookieConsent", JK, this), Y(this, "hideHeaderLogo", YK, this), Y(this, "hideLogoInBooth", XK, this), Y(this, "disableBookmarked", ZK, this), Y(this, "hideLanguage", QK, this), Y(this, "monochrome", $K, this), Y(this, "heatmap", eq, this), Y(this, "heatmapYah", tq, this), this.rootElement = null, Y(this, "debugCircles", nq, this), Y(this, "mapControlsHidden", rq, this), Y(this, "floorsControlHidden", iq, this), Y(this, "hideFreeOrDemo", aq, this), Y(this, "freeBannerDismissed", oq, this), Y(this, "currentBanner", sq, this), Y(this, "sceneDefReady", cq, this), Y(this, "categoryFilterOpen", lq, this), Y(this, "selectedCategoryFilters", uq, this), Y(this, "selectedPoiTypeFilters", dq, this), Y(this, "selectedTrack", fq, this), Y(this, "subButtonsVisible", pq, this), Y(this, "searchBoxMode", mq, this), Y(this, "searchBoxTitle", hq, this), Y(this, "searchBoxSubtitle", gq, this), Y(this, "routeTitle", _q, this), Y(this, "routeDescription", vq, this), Y(this, "isMultiPointRoute", yq, this), Y(this, "tourTitle", bq, this), Y(this, "tourDescription", xq, this), Y(this, "isMultiPointTour", Sq, this), Y(this, "pathwayOnlyMode", Cq, this), Y(this, "isOverlayScrolled", wq, this), Y(this, "listScrollTop", Tq, this), Y(this, "listScrollItemId", Eq, this), Y(this, "listScrollIndex", Dq, this), this.scrollPositions = /* @__PURE__ */ new Map(), this.scrollItemIds = /* @__PURE__ */ new Map(), Y(this, "_customUIScale", Oq, this), this.searchFilterHeightPx = 54, this.searchInputHeightPx = 54, this.overlayUISizePx = 390, this.overlayKioskSizePx = 450, this.overlayMediumHeightRems = 10, this.headerHeightRem = 0, this.wsImageHeightPx = 44, this.mapVisibleStart = 0, Y(this, "forceDim", kq, this), Y(this, "mapSettings", Aq, this), this.maxPitch = 60, Y(this, "animatePitch", jq, this), Y(this, "forceShowDetails", Mq, this), Y(this, "buildRoute", Nq, this), Y(this, "globalErrorMessages", Pq, this), this.minUIScale = .8, this.maxUIScale = 1.4, Y(this, "setKioskModeEnabled", Fq, this), Y(this, "kioskData", Iq, this), this.rootStore = e, this.mapSettings = { ...this.defaultMapSettings }, this.initializeUIScale();
	}
	get rtl() {
		let e = ae();
		return e === "ar" || e === "he";
	}
	get noOverlay() {
		return this.rootStore.fp.noOverlay || this.hideOverlay;
	}
	get overlayOnDemand() {
		return this.noOverlay && this.searchButtonsOverride === !0;
	}
	get overlayHiddenNow() {
		return this.noOverlay && !(this.overlayOnDemand && this.isOverlayOpen);
	}
	get onBoothClick() {
		return this.rootStore.fp.onBoothClick;
	}
	get onMarkerClick() {
		return this.rootStore.fp.onMarkerClick;
	}
	get onBookmarkClick() {
		return this.rootStore.fp.onBookmarkClick;
	}
	get onVisitedClick() {
		return this.rootStore.fp.onVisitedClick;
	}
	get onCategoryClick() {
		return this.rootStore.fp.onCategoryClick;
	}
	get onDirection() {
		return this.rootStore.fp.onDirection;
	}
	get onDetails() {
		return this.rootStore.fp.onDetails;
	}
	get onExhibitorCustomButtonClick() {
		return this.rootStore.fp.onExhibitorCustomButtonClick;
	}
	get onGetCoordsClick() {
		return this.rootStore.fp.onGetCoordsClick;
	}
	get selectedExhibitor() {
		return this.details instanceof Ac ? this.details : null;
	}
	get selectedBooth() {
		return this.details instanceof Es ? this.details : null;
	}
	get selectedCategory() {
		return this.list.type === "category" ? this.list.category : null;
	}
	get selectedRoute() {
		return this.details instanceof CU ? this.details : null;
	}
	get selectedSpeaker() {
		return this.details instanceof hG ? this.details : null;
	}
	get uiScale() {
		return this._customUIScale === null ? this.kiosk ? 1.2 : 1 : this._customUIScale;
	}
	get isGuidedToursActive() {
		return this.rootStore.toursStore.isActive;
	}
	get getRouteNextFloor() {
		var e, t, n;
		let r = this.rootStore.routeStore.pathLayers, i = (e = this.rootStore.routeStore.currentRouteLayer) == null ? void 0 : e.name;
		if (!i) return null;
		let a = r.findIndex((e) => {
			var t;
			return ((t = e.layer) == null ? void 0 : t.name) === i;
		});
		return a === -1 || (t = (n = r[a + 1]) == null || (n = n.layer) == null ? void 0 : n.name) == null ? null : t;
	}
	get headerHeightPx() {
		return Go(this.headerHeightRem);
	}
	get overlayPosition() {
		return this.screenSize.width > 768 || this.kiosk ? "left" : "bottom";
	}
	get overlayCollapsed() {
		return this.kiosk && this.overlayPosition === "left" && !this.searchFocused && !this.menu && !this.details && !this.selectedCategory && !this.selectedExhibitor && this.list.type !== "bookmarks" && this.list.type !== "language" && !("text" in this.list && this.list.text.length);
	}
	get overlaySize() {
		return this.overlayLeft ? "full" : this.desiredOverlaySize;
	}
	get overlayBottom() {
		return this.overlayPosition === "bottom";
	}
	get overlayLeft() {
		return this.overlayPosition === "left";
	}
	get overlayWidthPx() {
		return this.overlayHiddenNow ? 0 : this.overlayLeft ? this.kiosk ? this.overlayKioskSizePx : this.overlayUISizePx : Go(this.screenSize.width);
	}
	get wsPaddingPx() {
		return Go(.25);
	}
	get wsOccupiedHeightPx() {
		return this.wsShown ? this.wsImageHeightPx + this.wsPaddingPx * 2 : 0;
	}
	get wsShown() {
		return !this.hideHeaderLogo && this.rootStore.exhibitorStore.advertised.length > 0;
	}
	get wsDesktopPosition() {
		return vo.EXPO === "cbresupplypartner" ? "bottom" : "top";
	}
	get wsPosition() {
		return this.overlayBottom ? "top" : this.wsDesktopPosition;
	}
	get responsiveClass() {
		return WG(this.screenSize.width);
	}
	get mapVisibleTop() {
		return (this.wsPosition === "top" ? this.wsOccupiedHeightPx : 0) + this.headerHeightPx;
	}
	get mapVisibleBottom() {
		return this.overlayLeft || this.overlayHiddenNow ? this.wsPosition === "bottom" ? this.wsOccupiedHeightPx : 0 : Go(this.overlayMediumHeightRems);
	}
	get searchActionsHeightPx() {
		return this.overlayPosition === "bottom" ? this.searchInputHeightPx + this.searchFilterHeightPx : this.searchInputHeightPx;
	}
	get shouldShowSearchButtons() {
		return this.rootStore.searchButtonsStore.hasAnySearchButtons && !this.details && !this.menu && !["language", "filter"].includes(this.list.type);
	}
	get shouldShowMobileToggle() {
		let e = this.list.type === "route-planner";
		return this.overlayPosition === "bottom" && (e || !this.details && !this.menu && this.list.type !== "language" && this.list.type !== "bookmarks" && this.list.type !== "sessions");
	}
	get mobileToggleIsListMode() {
		return !this.isOverlayOpen || this.overlaySize !== "full";
	}
	get canvasVisibleRectPx() {
		let e = this.screenSize;
		return Er.fromMinMax({
			x: $.rtl ? 0 : this.mapVisibleStart,
			y: this.mapVisibleTop + this.searchActionsHeightPx
		}, {
			x: $.rtl ? e.width - this.mapVisibleStart : e.width,
			y: e.height - this.mapVisibleBottom
		});
	}
	get shouldShiftMapRect() {
		return this.overlayPosition === "left" && (this.details || this.hasAppliedFilters || this.selectedRoute);
	}
	get hasAppliedFilters() {
		return this.selectedCategoryFilters.length > 0 || this.selectedPoiTypeFilters.length > 0;
	}
	get canvasVisibleRectPt() {
		return this.canvasVisibleRectPx.scale(this.devicePixelRatio, {
			x: 0,
			y: 0
		});
	}
	get canvasSizePt() {
		return this.screenSize.multiply(this.devicePixelRatio);
	}
	get shouldUseBackdrop() {
		var e, t;
		if ($.overlayCollapsed) return !1;
		if (A && localStorage.getItem("forcebackdrop") === "1") return !0;
		if (this.overlayBottom || (e = this.selectedExhibitor) != null && e.leadingImageUrl && !((t = this.selectedExhibitor) != null && t.leadingImageLinkUrl)) return !1;
		let r = n.satisfies({ safari: ">=13" }), i = n.satisfies({ chrome: ">=77" });
		return /(android)/i.test(navigator.userAgent) ? !1 : r || i && $.canvasSizePt.height * $.canvasSizePt.width < 3e6;
	}
	setForceDim(e) {
		this.forceDim = e;
	}
	get dimmed() {
		var e, t, n;
		return this.forceDim || this.pathwayOnlyMode ? !0 : this.highlightedBooths.size > 0 || ((e = this.list) == null ? void 0 : e.type) === "search" && ((t = this.list) == null || (t = t.text) == null ? void 0 : t.trim().length) > 0 || ((n = this.list) == null ? void 0 : n.type) === "exhibitors";
	}
	get defaultSearchItems() {
		let { exhibitorStore: e, categoryStore: t, boothStore: n, heatmapStore: r } = this.rootStore, i = e.exhibitors, a = t.categories.filter((e) => e.exhibitors.length), o = n.booths;
		this.selectedPoiTypeFilters.length > 0 && (i = i.filter((e) => e.booths.some((e) => this.selectedPoiTypeFilters.some((t) => e.poiTypeId === t.id))));
		let s = [], c = !this.selectedCategoryFilters.length && z.showCategories ? a.filter((e) => !Lq.includes(vo.EXPO) || !e.name.includes("/")) : [], l = o.filter((e) => e instanceof Os);
		if (this.selectedCategoryFilters.length > 0 ? s = [...i] : (z.showCompaniesAndBooths && (s = s.concat(i)), z.showOtherSpaces && (s = s.concat(l))), this.heatmap) return [...i, ...o].sort((e, t) => r.getClicksByType(t) - r.getClicksByType(e));
		if (this.heatmapYah) {
			var u;
			return ((u = r.heatmapData) == null || (u = u.yah) == null ? void 0 : u.sort((e, t) => r.getClicksByType(t) - r.getClicksByType(e))) || [];
		}
		return i.length === 0 ? o : [...c, ...s.sort((e, t) => {
			let n = e instanceof Ac && e.featured !== void 0;
			if (n !== (t instanceof Ac && t.featured !== void 0)) return n ? -1 : 1;
			let r = e instanceof Os && e.title ? e.title : e.name, i = t instanceof Os && t.title ? t.title : t.name;
			return r.localeCompare(i, void 0, {
				sensitivity: "base",
				numeric: !0
			});
		})];
	}
	get searchItems() {
		var e;
		if (this.list.type !== "search") return [];
		let t = ((e = this.list.text) == null ? void 0 : e.trim().toLowerCase()) || "", { exhibitorStore: n, boothStore: r, eventStore: i, speakerStore: a, heatmapStore: o } = this.rootStore, s = n.exhibitors, c = r.booths, l = i.eventItems, u = a.speakers;
		if (this.selectedCategoryFilters.length > 0 && (s = s.filter((e) => this.selectedCategoryFilters.some((t) => e.categories.some((e) => e.id === t.id)))), this.selectedPoiTypeFilters.length > 0 && (s = s.filter((e) => e.booths.some((e) => this.selectedPoiTypeFilters.some((t) => e.poiTypeId === t.id)))), !t) return this.defaultSearchItems;
		let d = [t.replace(/&[^&=]+=[^&]+/g, "")];
		if (this.heatmapYah) {
			var f;
			return ((f = o.heatmapData.yah) == null ? [] : f).filter((e) => Number.isNaN(Number(t)) ? e : e.viewCount >= Number(t)).sort((e, t) => o.getClicksByType(t) - o.getClicksByType(e));
		}
		let p = [], m = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Set(), _ = /* @__PURE__ */ new Set();
		function v(e) {
			return e ? e.replace(/[!@#$%^*\-.,()^#$%:?_+'"/]/g, " ").replace(/\s\s+/g, " ") : "";
		}
		function y(e, t) {
			return !e || !t ? !1 : v(e).toLowerCase().includes(v(t).toLowerCase());
		}
		function b(e, t) {
			return e ? y(e, t) || y(z.levelTerm + " " + e, t) : !1;
		}
		s.forEach((e) => {
			d.some((t) => y(e.name, t) || e.booths.some((e) => {
				var n, r;
				return !t && y(e.name, t) || b((n = (r = e.layer) == null ? void 0 : r.name) == null ? null : n, t);
			})) && m.add(e);
		}), this.selectedCategoryFilters.length > 0 && c.forEach((e) => {
			(this.heatmap || !(e instanceof Ds) || !Array.from(m).find((t) => t.booths.includes(e))) && d.some((t) => {
				var n, r;
				return y(e.title || "", t) || y(e.name, t) || y(e.fullName, t) || b((n = (r = e.layer) == null ? void 0 : r.name) == null ? null : n, t);
			}) && h.add(e);
		});
		let x = l, S = u;
		if (x.forEach((e) => {
			d.some((t) => y(e.name || "", t) || y(e.description || "", t)) && g.add(e);
		}), S.forEach((e) => {
			d.some((t) => y(e.name, t) || y(e.company, t) || y(e.jobTitle, t)) && _.add(e);
		}), p.push(...g), p.push(...m), this.heatmap) return p.sort((e, t) => o.getClicksByType(t) - o.getClicksByType(e));
		let C = new Map(p.map((e) => [e.id, e]));
		return p.map((e) => {
			if (!e.name) return null;
			let n = jR(e instanceof Es && e.fullName.toLowerCase() || e.name.toLowerCase()), r = n.indexOf(jR(t));
			if (r === -1) return null;
			let i = {
				id: e.id,
				position: r,
				lowerCaseName: n,
				featured: !1
			};
			return e instanceof Ac && (i.featured = e.featured), i;
		}).filter((e) => !!e).sort((e, t) => (e.featured || t.featured) && e.featured !== t.featured ? e.featured ? -1 : 1 : e.position === t.position ? e.lowerCaseName.localeCompare(t.lowerCaseName) || String(e.id).localeCompare(String(t.id)) : e.position - t.position).map(({ id: e }) => C.get(e)).filter((e) => !!e);
	}
	get searchList() {
		return [
			...this.rootStore.eventStore.eventItems,
			...this.rootStore.speakerStore.speakers,
			...this.rootStore.categoryStore.categories.filter((e) => e.exhibitors.length),
			...this.rootStore.exhibitorStore.exhibitors,
			...this.rootStore.boothStore.booths
		];
	}
	get foundInDescription() {
		var e, t;
		if (((e = this.list) == null ? void 0 : e.type) !== "search") return [];
		let n = (t = this.list) == null || (t = t.text) == null ? void 0 : t.trim().toLowerCase();
		if (!n) return [];
		let r = this.fuzzySearchItems.map(({ item: e }) => e), i = new Set(r.map((e) => e.name)), a = this.categoryFilteredSearchList.filter((e) => !i.has(e.name)), o = [];
		for (let e of a) {
			let t = zq(e);
			if (!t) continue;
			let r = (VG(t) ? HG(t) : t).toLowerCase().indexOf(n);
			r !== -1 && o.push({
				item: e,
				pos: r
			});
		}
		return o.sort((e, t) => e.pos - t.pos), o.map((e) => e.item);
	}
	get foundInDescriptionStruct() {
		var e, t;
		let n = {};
		if (((e = this.list) == null ? void 0 : e.type) !== "search") return n;
		let r = (t = this.list) == null || (t = t.text) == null ? void 0 : t.trim().toLowerCase();
		return this.foundInDescription.forEach((e) => {
			let t = zq(e);
			if (!t) return;
			VG(t) && (t = HG(t));
			let i = t.toLowerCase().indexOf(r);
			if (i === -1) return;
			let a = i > 3 ? i - 3 : 0, o = t.substring(a).trim();
			n[e.id] = i > 0 ? `...${o}` : o;
		}), n;
	}
	get categoryFilteredSearchList() {
		return this.selectedCategoryFilters.length === 0 ? this.searchList : this.searchList.filter((e) => e instanceof Ac && this.selectedCategoryFilters.some((t) => e.categories.some((e) => e.id === t.id)));
	}
	get fuzzySearchItems() {
		var e, t;
		if (((e = this.list) == null ? void 0 : e.type) !== "search") return [];
		let n = (t = this.list) == null || (t = t.text) == null ? void 0 : t.trim().toLowerCase();
		if (!n) return this.defaultSearchItems.map((e) => ({
			item: e,
			score: 0,
			matches: []
		}));
		let r = this.rootStore.fuzzySearchEngineStore.search(this.categoryFilteredSearchList, n), i = [], a = [];
		for (let e of r) {
			var o, s, c, l, u, d, f, p;
			let t = e.item, r = t.entity.type, m = r === "booth" ? t : null, h = r === "exhibitor" ? t : null, g = [
				(o = (s = t.name) == null ? void 0 : s.toLowerCase()) == null ? "" : o,
				(c = m == null || (l = m.title) == null ? void 0 : l.toLowerCase()) == null ? "" : c,
				(u = m == null || (d = m.fullName) == null ? void 0 : d.toLowerCase()) == null ? "" : u,
				...(f = h == null || (p = h.booths) == null ? void 0 : p.map((e) => {
					var t, n;
					return (t = (n = e.name) == null ? void 0 : n.toLowerCase()) == null ? "" : t;
				})) == null ? [] : f
			], _ = Infinity;
			for (let e of g) {
				let t = e.indexOf(n);
				t !== -1 && t < _ && (_ = t);
			}
			_ === Infinity ? a.push(e) : i.push({
				result: {
					item: t,
					score: 0
				},
				pos: _
			});
		}
		return i.sort((e, t) => e.pos - t.pos), [...i.map((e) => e.result), ...a];
	}
	get listItems() {
		if (this.details instanceof CU && this.list.type !== "multi-point-tour") return [this.details.from, this.details.to].filter((e) => e instanceof Es);
		switch (this.list.type) {
			case "search": {
				let e = !(this.heatmap || this.heatmapYah) && this.rootStore.fuzzySearchEngineStore.engine ? this.fuzzySearchItems.map(({ item: e }) => e).concat(this.foundInDescription) : this.searchItems;
				return e = e.filter((e) => e.entity.type !== "booth" || !e.exhibitors.length), this.hasAppliedFilters ? e.filter((e) => {
					if (this.selectedCategoryFilters.length > 0 && e instanceof Ac && !this.selectedCategoryFilters.some((t) => e.categories.some((e) => e.id === t.id))) return !1;
					if (this.selectedPoiTypeFilters.length > 0) {
						if (e instanceof Ac && !e.booths.some((e) => this.selectedPoiTypeFilters.some((t) => e.poiTypeId === t.id)) || e instanceof Es && !this.selectedPoiTypeFilters.some((t) => e.poiTypeId === t.id)) return !1;
						if (e instanceof Ys && e.boothId) {
							let t = this.rootStore.boothStore.booths.find((t) => t.id === e.boothId);
							if (!t || !this.selectedPoiTypeFilters.some((e) => t.poiTypeId === e.id)) return !1;
						}
					}
					return !0;
				}) : e;
			}
			case "bookmarks": return [
				...this.rootStore.exhibitorStore.bookmarked,
				...this.rootStore.eventStore.bookmarked,
				...this.rootStore.speakerStore.bookmarked,
				...this.rootStore.boothStore.booths.filter((e) => e.exhibitors.length === 0 && e.bookmarkedDirectly)
			];
			case "visited": return [...this.rootStore.exhibitorStore.visited, ...this.rootStore.eventStore.visited];
			case "category": return this.list.category.exhibitors;
			case h: return ee();
			case "filter": return this.list.items;
			case "sessions": return this.rootStore.eventStore.eventItems;
			case "exhibitors": {
				var e;
				let t = this.rootStore.exhibitorStore.exhibitors, n = (e = this.list.text) == null ? void 0 : e.toLowerCase().trim();
				return n ? t.filter((e) => e.name.toLowerCase().includes(n)) : t;
			}
			case "multi-point-tour": {
				let e = this.rootStore.toursStore.getTourById(this.list.tourId);
				return !e || !e.points || e.points.length === 0 ? [] : e.points.map((e) => {
					let t = parseInt(e);
					if (!isNaN(t)) {
						let e = this.rootStore.boothStore.boothById.get(t);
						if (e) return e;
					}
					let n = bU(e);
					return (n == null ? void 0 : n.entity) || null;
				}).filter((e) => !!e);
			}
			case "route-planner": return this.rootStore.routePlannerStore.resolvedBooths;
		}
		throw Error("Unknown list.type");
	}
	get listBooths() {
		return Bq(this.listItems, this.rootStore.boothStore.booths, this.rootStore.eventStore.eventItems);
	}
	get selectedBooths() {
		var e;
		let t = [];
		this.selectedExhibitor ? t = this.selectedExhibitor.booths : this.selectedBooth && (t = [this.selectedBooth]);
		let n = this.selectedRoute, r = [
			n == null ? void 0 : n.from,
			n == null ? void 0 : n.to,
			...(e = n == null ? void 0 : n.waypoints) == null ? [] : e
		].filter((e) => e instanceof Es);
		return t.push(...r), new Set(t);
	}
	get hoveredBooths() {
		let e = [];
		return this.hoveredBooth ? e = [this.hoveredBooth] : this.hoveredExhibitor && (e = this.hoveredExhibitor.booths), new Set(e);
	}
	get visibility() {
		var e;
		return {
			controls: !this.mapControlsHidden,
			levels: !this.floorsControlHidden,
			header: this.wsShown,
			overlay: !this.hideOverlay,
			searchButtons: (e = this.searchButtonsOverride) == null ? !this.hideOverlay : e
		};
	}
	setVisibility(e) {
		let t = [
			"controls",
			"levels",
			"header",
			"overlay"
		], n = {
			...t.reduce((e, t) => ({
				...e,
				[t]: !0
			}), {}),
			...t.filter((t) => t in e).reduce((t, n) => ({
				...t,
				[n]: e[n]
			}), {})
		}, r = typeof e.searchButtons == "boolean" ? e.searchButtons : null;
		A && (Object.values(n).every(Boolean) && r === null ? localStorage.removeItem(O) : localStorage.setItem(O, JSON.stringify(r === null ? n : {
			...n,
			searchButtons: r
		}))), this.mapControlsHidden = !n.controls, this.floorsControlHidden = !n.levels, this.hideHeaderLogo = !n.header, this.hideFreeOrDemo = !n.header, this.hideOverlay = !n.overlay, this.searchButtonsOverride = r;
	}
	toggleMapOverlay() {
		this.overlayPosition === "bottom" && this.overlaySize === "full" ? this.desiredOverlaySize = "medium" : this.overlayPosition === "bottom" && this.overlaySize !== "full" && (this.desiredOverlaySize = "full");
	}
	changeZoom(e) {
		this.zoomBy = e;
	}
	zoomIn() {
		this.changeZoom(1.5);
	}
	zoomOut() {
		this.changeZoom(.66);
	}
	fitBounds() {
		var e;
		let { rect: t, source: n } = ZG({
			layerViewbox: this.rootStore.layerStore.viewboxRectangle,
			explicitArea: Oo ? Do : null,
			layerRectangle: this.rootStore.layerStore.rectangle,
			sceneDef: (e = MG()) == null ? null : e,
			svgArea: Do
		});
		this.moveToRect = t, this.moveToRectPaddingPercent = XG(n) ? 0 : qG(t, Do), this.rollReset = !0;
	}
	get previewMode() {
		var e;
		let t = A ? (e = localStorage.getItem("efp-previewMode")) == null ? localStorage.getItem(_) : e : null;
		return t === "true" || t === "1" || this.rootStore.fp.previewMode;
	}
	get viewerMode() {
		var e;
		let t = A ? (e = localStorage.getItem("efp-viewerMode")) == null ? localStorage.getItem(u) : e : null;
		return t === "true" || t === "1" || this.rootStore.fp.viewerMode;
	}
	get selectedEventItem() {
		return this.details instanceof Ys ? this.details : null;
	}
	get defaultMapSettings() {
		return {
			zoomtime: 500,
			pitchtime: 500,
			center: void 0,
			centerxy: void 0,
			z: void 0,
			bearing: 0,
			roll: 1,
			pitch: 1,
			pitchdegrees: this.pitchEnabled ? 30 : 0
		};
	}
	setMapSettings(e) {
		let t = {};
		for (let n of Object.keys(e)) {
			let r = e[n];
			r != null && (n === "zoomtime" || n === "pitchtime" ? t[n] = Math.min(Math.max(e[n] || this.mapSettings[n] || 0, 500), 5e3) : Object.assign(t, { [n]: r }));
		}
		this.mapSettings = {
			...this.mapSettings,
			...t
		};
	}
	resetMapSettings() {
		this.mapSettings = { ...this.defaultMapSettings };
	}
	get is3DView() {
		return !!z.allow3dView;
	}
	get pitchEnabled() {
		return this.is3DView ? this.mapSettings.pitch === void 0 || Number(this.mapSettings.pitch) === 1 : !1;
	}
	get rollEnabled() {
		return this.rootStore.fp.enableRotation ? this.mapSettings.roll === void 0 || Number(this.mapSettings.roll) === 1 : !1;
	}
	get baseQRCodeUrl() {
		return `https://${vo.EXPO}.expofp.com`;
	}
	get viewMapOnPhoneQRCodeUrl() {
		if (z != null && z.customKioskQrCodeUrl) return z.customKioskQrCodeUrl;
		let e = new URL(this.baseQRCodeUrl);
		e.search = window.location.search;
		let t = e.toString();
		return console.log("View Map On Phone QR Code Url", t), t;
	}
	get routeQRCodeUrl() {
		var e, t;
		let n = new URL(this.baseQRCodeUrl), r = (e = this.selectedRoute) == null ? void 0 : e.from, i = (t = this.selectedRoute) == null ? void 0 : t.to, a = r instanceof Es ? r.slug : "", o = i instanceof Es ? i.slug : "";
		n.search = `?route%3A${encodeURIComponent(o)}%3A${encodeURIComponent(a)}%3Afalse`, kG(n.searchParams, this.kioskData);
		let s = n.toString();
		return console.log("Route QR Code Url", s), s;
	}
	get isFeaturedExhibitorActive() {
		return this.details instanceof Ac && !!this.details.featured;
	}
	get activeInterfaceData() {
		for (let e of this.interfaceMetadata) if (e.isActive()) return e;
		return null;
	}
	get activeInterfaceId() {
		var e;
		return (e = this.activeInterfaceData) == null ? void 0 : e.id;
	}
	get searchBoxConfig() {
		let e = this.activeInterfaceData;
		return !e || !e.searchBoxConfig ? {
			mode: "search",
			title: "",
			subtitle: void 0,
			badge: void 0,
			icon: void 0
		} : e.searchBoxConfig() || {
			mode: "search",
			title: "",
			subtitle: void 0,
			badge: void 0,
			icon: void 0
		};
	}
	get searchBoxActions() {
		var e, t, n;
		return (e = (t = this.activeInterfaceData) == null || (n = t.actions) == null ? void 0 : n.call(t)) == null ? [] : e;
	}
	get overlayInterfaceClasses() {
		let e = [], t = this.activeInterfaceData;
		return t && (e.push(t.className), t.additionalClasses && e.push(...t.additionalClasses())), this.details && e.push("overlay-has-details"), this.list.type && e.push(`overlay-list-${this.list.type}`), this.isFeaturedExhibitorActive && e.push("overlay-exhibitor-featured"), e;
	}
	get isOverlayOpen() {
		return this.noOverlay && !this.overlayOnDemand ? !1 : this.activeInterfaceData !== null;
	}
	setOverlayScrolled(e) {
		this.isOverlayScrolled = e;
	}
	setListScrollTop(e, t) {
		this.listScrollTop = t, this.scrollPositions.set(e, t);
	}
	setListScrollItemId(e, t) {
		this.listScrollItemId = t, this.scrollItemIds.set(e, t);
	}
	getListScrollTop(e) {
		return this.scrollPositions.get(e) || 0;
	}
	getListScrollItemId(e) {
		return this.scrollItemIds.get(e) || null;
	}
	clearListScroll(e) {
		this.scrollPositions.delete(e), this.scrollItemIds.delete(e), this.list.type === e && (this.listScrollTop = 0, this.listScrollItemId = null);
	}
	get bannerType() {
		return this.hideFreeOrDemo || this.heatmap ? null : vo.EXPO === "expo" ? "demo" : z.expoFpAd || z.isTrial ? "free" : null;
	}
	get isBannerVisible() {
		return this.bannerType !== null;
	}
	setCurrentBanner(e) {
		this.currentBanner = e;
	}
	setForceShowDetails(e) {
		this.forceShowDetails = e;
	}
	get showRouteInstantly() {
		return !!(this.kiosk && !this.forceShowDetails);
	}
	startBuildRoute() {
		this.rootStore.selectSearch(""), this.mapControlsHidden = !0, this.floorsControlHidden = !0, this.hideHeaderLogo = !0, this.hideFreeOrDemo = !0, this.hideOverlay = !0, this.hideCookieConsent = !0, this.buildRoute = !0;
	}
	setGlobalErrorMessage(e) {
		this.globalErrorMessages.push(e);
	}
	popGlobalErrorMessage() {
		this.globalErrorMessages.pop();
	}
	initializeUIScale() {
		if (new URLSearchParams(window.location.search).get("kiosk") !== "0" && A) {
			var e;
			let t = (e = localStorage.getItem("efp-uiScale")) == null ? localStorage.getItem(o) : e;
			if (t) {
				let e = parseFloat(t);
				!isNaN(e) && e >= .8 && e <= 1.4 && (this._customUIScale = e);
			}
		}
	}
	setUIScale(e, t = !0) {
		if (e === void 0 || isNaN(e) || e < this.minUIScale || e > this.maxUIScale) {
			P.warn(`Invalid ui-scale value: ${e}. Must be between ${this.minUIScale} and ${this.maxUIScale}.`);
			return;
		}
		this._customUIScale = e, t && A && (localStorage.setItem(te, e.toString()), localStorage.removeItem(o));
	}
	resetUIScale() {
		this._customUIScale = null, A && (localStorage.removeItem(te), localStorage.removeItem(o));
	}
	restoreUIScale() {
		this._customUIScale = null, this.initializeUIScale();
	}
	enableSetKioskMode(e) {
		this.setKioskModeEnabled = e;
	}
	setKioskData(e) {
		this.kioskData = e;
	}
}, yK = X(J.prototype, "list", [QG], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return {
			type: "search",
			text: "",
			focused: !1
		};
	}
}), bK = X(J.prototype, "details", [$G], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), xK = X(J.prototype, "hoveredExhibitor", [eK], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), SK = X(J.prototype, "hoveredBooth", [tK], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), CK = X(J.prototype, "zoomBy", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), wK = X(J.prototype, "rollReset", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), TK = X(J.prototype, "moveToBooths", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), EK = X(J.prototype, "moveToRect", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), DK = X(J.prototype, "moveToRectPaddingPercent", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), OK = X(J.prototype, "moveToLocation", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), kK = X(J.prototype, "menu", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), AK = X(J.prototype, "searchFocused", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), jK = X(J.prototype, "searchClearMode", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), MK = X(J.prototype, "printingPdf", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), NK = X(J.prototype, "screenSize", [nK], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return new Jn(window.innerWidth, window.innerHeight);
	}
}), PK = X(J.prototype, "desiredOverlaySize", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: null
}), FK = X(J.prototype, "overlayShowsAll", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), IK = X(J.prototype, "centerMap", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), LK = X(J.prototype, "zoomAfTransformK", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return 1;
	}
}), RK = X(J.prototype, "activeListIndex", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return -1;
	}
}), zK = X(J.prototype, "devicePixelRatio", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return window.devicePixelRatio;
	}
}), BK = X(J.prototype, "wsStarted", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), VK = X(J.prototype, "canvasStarted", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), HK = X(J.prototype, "kiosk", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), UK = X(J.prototype, "inIdle", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), WK = X(J.prototype, "modalActive", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return { share: !1 };
	}
}), GK = X(J.prototype, "galleryActive", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), KK = X(J.prototype, "hideOverlay", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), qK = X(J.prototype, "searchButtonsOverride", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), JK = X(J.prototype, "hideCookieConsent", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !!vR();
	}
}), YK = X(J.prototype, "hideHeaderLogo", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), XK = X(J.prototype, "hideLogoInBooth", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), ZK = X(J.prototype, "disableBookmarked", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), QK = X(J.prototype, "hideLanguage", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), $K = X(J.prototype, "monochrome", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), eq = X(J.prototype, "heatmap", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), tq = X(J.prototype, "heatmapYah", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), nq = X(J.prototype, "debugCircles", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return [];
	}
}), rq = X(J.prototype, "mapControlsHidden", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), iq = X(J.prototype, "floorsControlHidden", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), aq = X(J.prototype, "hideFreeOrDemo", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), oq = X(J.prototype, "freeBannerDismissed", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return RG(sessionStorage);
	}
}), sq = X(J.prototype, "currentBanner", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), cq = X(J.prototype, "sceneDefReady", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), lq = X(J.prototype, "categoryFilterOpen", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), uq = X(J.prototype, "selectedCategoryFilters", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return [];
	}
}), dq = X(J.prototype, "selectedPoiTypeFilters", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return [];
	}
}), fq = X(J.prototype, "selectedTrack", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), pq = X(J.prototype, "subButtonsVisible", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), mq = X(J.prototype, "searchBoxMode", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return "search";
	}
}), hq = X(J.prototype, "searchBoxTitle", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return "";
	}
}), gq = X(J.prototype, "searchBoxSubtitle", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: null
}), _q = X(J.prototype, "routeTitle", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: null
}), vq = X(J.prototype, "routeDescription", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: null
}), yq = X(J.prototype, "isMultiPointRoute", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), bq = X(J.prototype, "tourTitle", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: null
}), xq = X(J.prototype, "tourDescription", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: null
}), Sq = X(J.prototype, "isMultiPointTour", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), Cq = X(J.prototype, "pathwayOnlyMode", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), wq = X(J.prototype, "isOverlayScrolled", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), Tq = X(J.prototype, "listScrollTop", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return 0;
	}
}), Eq = X(J.prototype, "listScrollItemId", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), Dq = X(J.prototype, "listScrollIndex", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return 0;
	}
}), Oq = X(J.prototype, "_customUIScale", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), X(J.prototype, "setSelectedCategoryFilters", [C], Object.getOwnPropertyDescriptor(J.prototype, "setSelectedCategoryFilters"), J.prototype), X(J.prototype, "resetCategoryFilter", [C], Object.getOwnPropertyDescriptor(J.prototype, "resetCategoryFilter"), J.prototype), X(J.prototype, "setSearchClearMode", [C], Object.getOwnPropertyDescriptor(J.prototype, "setSearchClearMode"), J.prototype), X(J.prototype, "setRouteTitle", [C], Object.getOwnPropertyDescriptor(J.prototype, "setRouteTitle"), J.prototype), X(J.prototype, "setRouteDescription", [C], Object.getOwnPropertyDescriptor(J.prototype, "setRouteDescription"), J.prototype), X(J.prototype, "setIsMultiPointRoute", [C], Object.getOwnPropertyDescriptor(J.prototype, "setIsMultiPointRoute"), J.prototype), X(J.prototype, "setTourTitle", [C], Object.getOwnPropertyDescriptor(J.prototype, "setTourTitle"), J.prototype), X(J.prototype, "setTourDescription", [C], Object.getOwnPropertyDescriptor(J.prototype, "setTourDescription"), J.prototype), X(J.prototype, "setIsMultiPointTour", [C], Object.getOwnPropertyDescriptor(J.prototype, "setIsMultiPointTour"), J.prototype), X(J.prototype, "setPathwayOnlyMode", [C], Object.getOwnPropertyDescriptor(J.prototype, "setPathwayOnlyMode"), J.prototype), X(J.prototype, "setMultiPointTourList", [C], Object.getOwnPropertyDescriptor(J.prototype, "setMultiPointTourList"), J.prototype), X(J.prototype, "activePathwayLayers", [j], Object.getOwnPropertyDescriptor(J.prototype, "activePathwayLayers"), J.prototype), X(J.prototype, "highlightedBooths", [j], Object.getOwnPropertyDescriptor(J.prototype, "highlightedBooths"), J.prototype), X(J.prototype, "rtl", [j], Object.getOwnPropertyDescriptor(J.prototype, "rtl"), J.prototype), X(J.prototype, "noOverlay", [rK], Object.getOwnPropertyDescriptor(J.prototype, "noOverlay"), J.prototype), X(J.prototype, "overlayOnDemand", [j], Object.getOwnPropertyDescriptor(J.prototype, "overlayOnDemand"), J.prototype), X(J.prototype, "overlayHiddenNow", [j], Object.getOwnPropertyDescriptor(J.prototype, "overlayHiddenNow"), J.prototype), X(J.prototype, "selectedExhibitor", [iK], Object.getOwnPropertyDescriptor(J.prototype, "selectedExhibitor"), J.prototype), X(J.prototype, "selectedBooth", [aK], Object.getOwnPropertyDescriptor(J.prototype, "selectedBooth"), J.prototype), X(J.prototype, "selectedCategory", [oK], Object.getOwnPropertyDescriptor(J.prototype, "selectedCategory"), J.prototype), X(J.prototype, "selectedRoute", [sK], Object.getOwnPropertyDescriptor(J.prototype, "selectedRoute"), J.prototype), X(J.prototype, "selectedSpeaker", [cK], Object.getOwnPropertyDescriptor(J.prototype, "selectedSpeaker"), J.prototype), X(J.prototype, "uiScale", [lK], Object.getOwnPropertyDescriptor(J.prototype, "uiScale"), J.prototype), X(J.prototype, "isGuidedToursActive", [uK], Object.getOwnPropertyDescriptor(J.prototype, "isGuidedToursActive"), J.prototype), X(J.prototype, "getRouteNextFloor", [dK], Object.getOwnPropertyDescriptor(J.prototype, "getRouteNextFloor"), J.prototype), X(J.prototype, "headerHeightPx", [j], Object.getOwnPropertyDescriptor(J.prototype, "headerHeightPx"), J.prototype), X(J.prototype, "overlayPosition", [j], Object.getOwnPropertyDescriptor(J.prototype, "overlayPosition"), J.prototype), X(J.prototype, "overlayCollapsed", [j], Object.getOwnPropertyDescriptor(J.prototype, "overlayCollapsed"), J.prototype), X(J.prototype, "overlaySize", [j], Object.getOwnPropertyDescriptor(J.prototype, "overlaySize"), J.prototype), X(J.prototype, "overlayBottom", [j], Object.getOwnPropertyDescriptor(J.prototype, "overlayBottom"), J.prototype), X(J.prototype, "overlayLeft", [j], Object.getOwnPropertyDescriptor(J.prototype, "overlayLeft"), J.prototype), X(J.prototype, "overlayWidthPx", [j], Object.getOwnPropertyDescriptor(J.prototype, "overlayWidthPx"), J.prototype), X(J.prototype, "wsPaddingPx", [j], Object.getOwnPropertyDescriptor(J.prototype, "wsPaddingPx"), J.prototype), X(J.prototype, "wsOccupiedHeightPx", [j], Object.getOwnPropertyDescriptor(J.prototype, "wsOccupiedHeightPx"), J.prototype), X(J.prototype, "wsShown", [fK], Object.getOwnPropertyDescriptor(J.prototype, "wsShown"), J.prototype), X(J.prototype, "wsDesktopPosition", [j], Object.getOwnPropertyDescriptor(J.prototype, "wsDesktopPosition"), J.prototype), X(J.prototype, "wsPosition", [j], Object.getOwnPropertyDescriptor(J.prototype, "wsPosition"), J.prototype), X(J.prototype, "responsiveClass", [j], Object.getOwnPropertyDescriptor(J.prototype, "responsiveClass"), J.prototype), X(J.prototype, "mapVisibleTop", [j], Object.getOwnPropertyDescriptor(J.prototype, "mapVisibleTop"), J.prototype), X(J.prototype, "mapVisibleBottom", [j], Object.getOwnPropertyDescriptor(J.prototype, "mapVisibleBottom"), J.prototype), X(J.prototype, "searchActionsHeightPx", [j], Object.getOwnPropertyDescriptor(J.prototype, "searchActionsHeightPx"), J.prototype), X(J.prototype, "shouldShowSearchButtons", [j], Object.getOwnPropertyDescriptor(J.prototype, "shouldShowSearchButtons"), J.prototype), X(J.prototype, "shouldShowMobileToggle", [j], Object.getOwnPropertyDescriptor(J.prototype, "shouldShowMobileToggle"), J.prototype), X(J.prototype, "mobileToggleIsListMode", [j], Object.getOwnPropertyDescriptor(J.prototype, "mobileToggleIsListMode"), J.prototype), X(J.prototype, "canvasVisibleRectPx", [j], Object.getOwnPropertyDescriptor(J.prototype, "canvasVisibleRectPx"), J.prototype), X(J.prototype, "shouldShiftMapRect", [j], Object.getOwnPropertyDescriptor(J.prototype, "shouldShiftMapRect"), J.prototype), X(J.prototype, "hasAppliedFilters", [j], Object.getOwnPropertyDescriptor(J.prototype, "hasAppliedFilters"), J.prototype), X(J.prototype, "canvasVisibleRectPt", [j], Object.getOwnPropertyDescriptor(J.prototype, "canvasVisibleRectPt"), J.prototype), X(J.prototype, "canvasSizePt", [j], Object.getOwnPropertyDescriptor(J.prototype, "canvasSizePt"), J.prototype), X(J.prototype, "shouldUseBackdrop", [pK], Object.getOwnPropertyDescriptor(J.prototype, "shouldUseBackdrop"), J.prototype), kq = X(J.prototype, "forceDim", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), X(J.prototype, "setForceDim", [C], Object.getOwnPropertyDescriptor(J.prototype, "setForceDim"), J.prototype), X(J.prototype, "dimmed", [j], Object.getOwnPropertyDescriptor(J.prototype, "dimmed"), J.prototype), X(J.prototype, "defaultSearchItems", [j], Object.getOwnPropertyDescriptor(J.prototype, "defaultSearchItems"), J.prototype), X(J.prototype, "searchItems", [j], Object.getOwnPropertyDescriptor(J.prototype, "searchItems"), J.prototype), X(J.prototype, "searchList", [j], Object.getOwnPropertyDescriptor(J.prototype, "searchList"), J.prototype), X(J.prototype, "foundInDescription", [j], Object.getOwnPropertyDescriptor(J.prototype, "foundInDescription"), J.prototype), X(J.prototype, "foundInDescriptionStruct", [j], Object.getOwnPropertyDescriptor(J.prototype, "foundInDescriptionStruct"), J.prototype), X(J.prototype, "categoryFilteredSearchList", [j], Object.getOwnPropertyDescriptor(J.prototype, "categoryFilteredSearchList"), J.prototype), X(J.prototype, "fuzzySearchItems", [j], Object.getOwnPropertyDescriptor(J.prototype, "fuzzySearchItems"), J.prototype), X(J.prototype, "listItems", [j], Object.getOwnPropertyDescriptor(J.prototype, "listItems"), J.prototype), X(J.prototype, "listBooths", [mK], Object.getOwnPropertyDescriptor(J.prototype, "listBooths"), J.prototype), X(J.prototype, "selectedBooths", [hK], Object.getOwnPropertyDescriptor(J.prototype, "selectedBooths"), J.prototype), X(J.prototype, "hoveredBooths", [gK], Object.getOwnPropertyDescriptor(J.prototype, "hoveredBooths"), J.prototype), X(J.prototype, "visibility", [j], Object.getOwnPropertyDescriptor(J.prototype, "visibility"), J.prototype), X(J.prototype, "setVisibility", [C], Object.getOwnPropertyDescriptor(J.prototype, "setVisibility"), J.prototype), X(J.prototype, "toggleMapOverlay", [C], Object.getOwnPropertyDescriptor(J.prototype, "toggleMapOverlay"), J.prototype), X(J.prototype, "changeZoom", [C], Object.getOwnPropertyDescriptor(J.prototype, "changeZoom"), J.prototype), X(J.prototype, "zoomIn", [C], Object.getOwnPropertyDescriptor(J.prototype, "zoomIn"), J.prototype), X(J.prototype, "zoomOut", [C], Object.getOwnPropertyDescriptor(J.prototype, "zoomOut"), J.prototype), X(J.prototype, "fitBounds", [C], Object.getOwnPropertyDescriptor(J.prototype, "fitBounds"), J.prototype), X(J.prototype, "selectedEventItem", [_K], Object.getOwnPropertyDescriptor(J.prototype, "selectedEventItem"), J.prototype), Aq = X(J.prototype, "mapSettings", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return {};
	}
}), X(J.prototype, "setMapSettings", [C], Object.getOwnPropertyDescriptor(J.prototype, "setMapSettings"), J.prototype), X(J.prototype, "resetMapSettings", [C], Object.getOwnPropertyDescriptor(J.prototype, "resetMapSettings"), J.prototype), jq = X(J.prototype, "animatePitch", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !0;
	}
}), X(J.prototype, "pitchEnabled", [vK], Object.getOwnPropertyDescriptor(J.prototype, "pitchEnabled"), J.prototype), X(J.prototype, "rollEnabled", [j], Object.getOwnPropertyDescriptor(J.prototype, "rollEnabled"), J.prototype), X(J.prototype, "baseQRCodeUrl", [j], Object.getOwnPropertyDescriptor(J.prototype, "baseQRCodeUrl"), J.prototype), X(J.prototype, "viewMapOnPhoneQRCodeUrl", [j], Object.getOwnPropertyDescriptor(J.prototype, "viewMapOnPhoneQRCodeUrl"), J.prototype), X(J.prototype, "routeQRCodeUrl", [j], Object.getOwnPropertyDescriptor(J.prototype, "routeQRCodeUrl"), J.prototype), X(J.prototype, "isFeaturedExhibitorActive", [j], Object.getOwnPropertyDescriptor(J.prototype, "isFeaturedExhibitorActive"), J.prototype), X(J.prototype, "activeInterfaceData", [j], Object.getOwnPropertyDescriptor(J.prototype, "activeInterfaceData"), J.prototype), X(J.prototype, "activeInterfaceId", [j], Object.getOwnPropertyDescriptor(J.prototype, "activeInterfaceId"), J.prototype), X(J.prototype, "searchBoxConfig", [j], Object.getOwnPropertyDescriptor(J.prototype, "searchBoxConfig"), J.prototype), X(J.prototype, "searchBoxActions", [j], Object.getOwnPropertyDescriptor(J.prototype, "searchBoxActions"), J.prototype), X(J.prototype, "overlayInterfaceClasses", [j], Object.getOwnPropertyDescriptor(J.prototype, "overlayInterfaceClasses"), J.prototype), X(J.prototype, "isOverlayOpen", [j], Object.getOwnPropertyDescriptor(J.prototype, "isOverlayOpen"), J.prototype), X(J.prototype, "setOverlayScrolled", [C], Object.getOwnPropertyDescriptor(J.prototype, "setOverlayScrolled"), J.prototype), X(J.prototype, "setListScrollTop", [C], Object.getOwnPropertyDescriptor(J.prototype, "setListScrollTop"), J.prototype), X(J.prototype, "setListScrollItemId", [C], Object.getOwnPropertyDescriptor(J.prototype, "setListScrollItemId"), J.prototype), X(J.prototype, "getListScrollTop", [C], Object.getOwnPropertyDescriptor(J.prototype, "getListScrollTop"), J.prototype), X(J.prototype, "getListScrollItemId", [C], Object.getOwnPropertyDescriptor(J.prototype, "getListScrollItemId"), J.prototype), X(J.prototype, "clearListScroll", [C], Object.getOwnPropertyDescriptor(J.prototype, "clearListScroll"), J.prototype), X(J.prototype, "bannerType", [j], Object.getOwnPropertyDescriptor(J.prototype, "bannerType"), J.prototype), X(J.prototype, "isBannerVisible", [j], Object.getOwnPropertyDescriptor(J.prototype, "isBannerVisible"), J.prototype), X(J.prototype, "setCurrentBanner", [C], Object.getOwnPropertyDescriptor(J.prototype, "setCurrentBanner"), J.prototype), Mq = X(J.prototype, "forceShowDetails", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), X(J.prototype, "setForceShowDetails", [C], Object.getOwnPropertyDescriptor(J.prototype, "setForceShowDetails"), J.prototype), X(J.prototype, "showRouteInstantly", [j], Object.getOwnPropertyDescriptor(J.prototype, "showRouteInstantly"), J.prototype), Nq = X(J.prototype, "buildRoute", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), X(J.prototype, "startBuildRoute", [C], Object.getOwnPropertyDescriptor(J.prototype, "startBuildRoute"), J.prototype), Pq = X(J.prototype, "globalErrorMessages", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return [];
	}
}), X(J.prototype, "setGlobalErrorMessage", [C], Object.getOwnPropertyDescriptor(J.prototype, "setGlobalErrorMessage"), J.prototype), X(J.prototype, "popGlobalErrorMessage", [C], Object.getOwnPropertyDescriptor(J.prototype, "popGlobalErrorMessage"), J.prototype), X(J.prototype, "initializeUIScale", [C], Object.getOwnPropertyDescriptor(J.prototype, "initializeUIScale"), J.prototype), X(J.prototype, "setUIScale", [C], Object.getOwnPropertyDescriptor(J.prototype, "setUIScale"), J.prototype), X(J.prototype, "resetUIScale", [C], Object.getOwnPropertyDescriptor(J.prototype, "resetUIScale"), J.prototype), X(J.prototype, "restoreUIScale", [C], Object.getOwnPropertyDescriptor(J.prototype, "restoreUIScale"), J.prototype), Fq = X(J.prototype, "setKioskModeEnabled", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), X(J.prototype, "enableSetKioskMode", [C], Object.getOwnPropertyDescriptor(J.prototype, "enableSetKioskMode"), J.prototype), Iq = X(J.prototype, "kioskData", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return null;
	}
}), X(J.prototype, "setKioskData", [C], Object.getOwnPropertyDescriptor(J.prototype, "setKioskData"), J.prototype), J);
function zq(e) {
	return "description" in e && typeof e.description == "string" ? e.description : void 0;
}
function Bq(e, t, n = []) {
	let r = [];
	return e.forEach((e) => {
		if (e instanceof Ac) r.push(...e.booths);
		else if (e instanceof Es) r.push(e);
		else if (e instanceof Ys) {
			let n = t.find((t) => t.id === e.boothId);
			e.boothId && n && r.push(n);
		} else e instanceof hG && n.filter((t) => t.speakers.some((t) => t.id === e.id) && t.boothId).forEach((e) => {
			let n = t.find((t) => t.id === e.boothId);
			n && r.push(n);
		});
	}), new Set(r.filter(Boolean));
}
//#endregion
//#region src/store/RootStore.ts
var Z, Vq, Hq;
function Uq(e, t, n, r) {
	n && Object.defineProperty(e, t, {
		enumerable: n.enumerable,
		configurable: n.configurable,
		writable: n.writable,
		value: n.initializer ? n.initializer.call(r) : void 0
	});
}
function Wq(e, t, n, r, i) {
	var a = {};
	return Object.keys(r).forEach(function(e) {
		a[e] = r[e];
	}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
		return r(e, t, n) || n;
	}, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
}
var Gq = (Z = class {
	setResetCameraFn(e) {
		this.resetCameraFn = e;
	}
	constructor() {
		this.categoryStore = void 0, this.exhibitorStore = void 0, this.boothStore = void 0, this.uiState = void 0, this.overlayStore = void 0, this.routeStore = void 0, this.routePlannerStore = void 0, this.toursStore = void 0, this.maplibreStore = void 0, this.layerStore = void 0, this.intercomStore = void 0, this.eventStore = void 0, this.poiTypeStore = void 0, this.poiMarkerStore = void 0, this.heatmapStore = void 0, this.fuzzySearchEngineStore = void 0, this.categoryFilterStore = void 0, this.sessionsFilterStore = void 0, this.speakerStore = void 0, this.speakerFilterStore = void 0, this.searchStore = void 0, this.searchButtonsStore = void 0, this.bookmarksStore = void 0, this.urlFilterManager = void 0, this.shortcutRegistry = void 0, this.fp = void 0, Uq(this, "initialized", Vq, this), Uq(this, "resetCameraFn", Hq, this), this.categoryStore = new zs(this), this.exhibitorStore = new kc(this), this.boothStore = new Ts(this), this.routeStore = new mU(this), this.routePlannerStore = new rW(this), this.toursStore = new EG(this), this.uiState = new Rq(this), this.overlayStore = new AU(this), this.maplibreStore = new hz(this), this.layerStore = new nI(), this.intercomStore = new ez(), this.eventStore = new Js(this), this.heatmapStore = new Qc(), this.poiTypeStore = new BU(this), this.poiMarkerStore = new zU(this), this.fuzzySearchEngineStore = new JR([
			"name",
			"title",
			"fullName",
			"booths.name"
		]), this.categoryFilterStore = new UR(this), this.sessionsFilterStore = new QW(this), this.speakerStore = new gG(this), this.speakerFilterStore = new cG(this), this.searchStore = new KW(this), this.searchButtonsStore = new RW(this), this.bookmarksStore = new FR(this), this.urlFilterManager = new kL(this), this.shortcutRegistry = new $W(), this.registerShortcutProviders();
	}
	selectExhibitor(e, t = !0) {
		this.uiState.hoveredExhibitor = null, this.uiState.details = e;
		var n = e.booths.filter((e) => e.visible), r = e.booths.filter((e) => !e.visible);
		!n.length && r.length && this.layerStore.updateVisibility(r[0].layer, !0), t && setTimeout(() => this.moveToList(e.booths.filter((e) => e.visible)), pe || EN ? 500 : 50);
	}
	selectBooth(e, t = !0) {
		var n;
		let r = Array.isArray(e) ? e : [e];
		this.uiState.details = r[0], r.length === 1 && (n = r[0].schedule) != null && n.length && (this.uiState.desiredOverlaySize = "medium"), r.length === 1 && r[0].layer && !r[0].visible && this.layerStore.mode === $F.Radio && this.layerStore.updateVisibility(r[0].layer, !0), t && setTimeout(() => this.moveToList(r), pe || EN ? 500 : 50);
	}
	reset() {
		let e = window.__searchi;
		e && e.querySelector && e.querySelector("input[type=search]") && e.querySelector("input[type=search]").blur && e.querySelector("input[type=search]").blur(), window.setTimeout(() => {
			this.uiState.setKioskModeEnabled || b().then(() => {
				se(() => {
					var e;
					this.selectSearch(""), this.uiState.details = null, (e = this.resetCameraFn) == null || e.call(this), this.uiState.menu = !1, this.searchStore.resetSearchBox(), this.searchButtonsStore.clearAllFilters();
				}), setTimeout(() => {
					se(() => {
						this.uiState.inIdle = !0;
					});
				}, 100);
			});
		}, 1e3);
	}
	selectNone() {
		window.__resett && window.__resett(), this.uiState.details = this.uiState.selectedCategory;
	}
	selectBookmarks() {
		this.uiState.details = null, this.uiState.list = { type: "bookmarks" };
	}
	selectVisited() {
		this.uiState.details = null, this.uiState.list = { type: "visited" };
	}
	selectLanguage() {
		this.uiState.details = null, this.uiState.list = { type: h };
	}
	selectCategory(e) {
		var t;
		window.__resett && window.__resett(), this.uiState.details = e, this.uiState.list = {
			type: "category",
			category: e
		}, this.uiState.desiredOverlaySize = "full", e.exhibitors.find((e) => e.booths.find((e) => e.visible)) || this.layerStore.updateVisibility((t = e.exhibitors[0]) == null || (t = t.booths[0]) == null ? void 0 : t.layer, !0), setTimeout(() => {
			this.uiState.moveToBooths = e.exhibitors.filter((e) => e.booths.find((e) => e.visible)).flatMap((e) => e.booths);
		}, 200);
	}
	selectEventItem(e, t = !0) {
		if (this.uiState.hoveredExhibitor = null, this.uiState.details = e, this.uiState.desiredOverlaySize = "medium", e.boothId) {
			let t = this.boothStore.booths.find((t) => t.id === e.boothId);
			t && t.layer && !t.visible && this.layerStore.mode === $F.Radio && this.layerStore.updateVisibility(t.layer, !0);
		}
		t && setTimeout(() => {
			if (e.boothId) {
				let t = this.boothStore.booths.find((t) => t.id === e.boothId);
				t && this.moveToList([t]);
			}
		}, pe || EN ? 500 : 50);
	}
	selectSearch(e) {
		window.__resett && window.__resett(), this.uiState.details = null, this.speakerStore.clearSelectedSpeaker(), this.uiState.list = {
			type: "search",
			text: MR(e, Object.keys(this.uiState.mapSettings).map((e) => `${e}=`)),
			focused: !1
		}, this.uiState.activeListIndex = -1;
	}
	clickBookmarks() {
		window.__resett && window.__resett(), this.uiState.menu = !1, this.selectBookmarks(), this.moveToList(), this.showMap();
	}
	clickVisited() {
		window.__resett && window.__resett(), this.uiState.menu = !1, this.selectVisited(), this.moveToList(), this.showMap();
	}
	clickLanguage() {
		window.__resett && window.__resett(), this.uiState.menu = !1, this.selectLanguage();
	}
	clickCategory(e) {
		window.__resett && window.__resett(), this.uiState.menu = !1, this.selectCategory(e), this.uiState.onCategoryClick && this.uiState.onCategoryClick({
			id: e.id,
			name: e.name,
			exhibitors: e.exhibitors.map((e) => e.id)
		}), setTimeout(() => {
			this.moveToList(), this.showMap();
		}, 100);
	}
	clickSeminars() {
		this.clickCategory(this.categoryStore.seminarsCategory);
	}
	clickBoothInList(e) {
		window.__resett && window.__resett(), this.uiState.hoveredBooth = null, this.selectBooth(e), this.moveToList([e]), this.showMap();
	}
	clickBoothInList2(e) {
		window.__resett && window.__resett(), this.uiState.hoveredBooth = null, this.selectBooth(e, !1), window.setTimeout(() => {
			this.moveToList([e]), this.showMap();
		}, navigator.userAgent.toLowerCase().indexOf("android") > -1 ? 400 : 50);
	}
	clickBooth(e) {
		var t, n, r, i;
		let a = this.uiState.details;
		if (this.uiState.menu = !1, this.uiState.list.type === "sessions" && this.searchStore.selectSearch(), this.uiState.list.type === "speakers" && this.searchStore.selectSearch(), this.uiState.list.type === "tours" && this.searchStore.selectSearch(), this.uiState.list.type === "multi-point-tour" && this.searchStore.selectSearch(), !((t = this.uiState.selectedRoute) != null && t.from && (n = this.uiState.selectedRoute) != null && n.to)) {
			if ((r = this.uiState.selectedRoute) != null && r.to && !((i = this.uiState.selectedRoute) != null && i.from) && e) {
				this.routeStore.setStartPoint(e);
				return;
			}
			if (e) this.routeStore.tempToBooth = e;
			else {
				this.uiState.details = null, this.fp.hidePathways(), this.uiState.list = {
					type: "search",
					text: "",
					focused: !1
				}, this.uiState.onBoothClick && this.uiState.onBoothClick({ target: null });
				return;
			}
			if (this.uiState.onBoothClick) {
				let t = {
					name: "",
					description: ""
				}, n = { target: {
					...e,
					layer: e.layer || t
				} };
				this.uiState.onBoothClick(n);
			}
			if (e.exhibitors.length === 1 && e instanceof Ds) {
				let t = e.exhibitors[0];
				a === t ? SR(gR.ViewBooth, e.name) : this.heatmapStore.forceTrack = {
					action: gR.ViewBooth,
					label: e.name,
					exhibitor: t
				}, this.selectExhibitor(t, !1);
			} else a === e && SR(gR.ViewBooth, e.name), this.selectBooth(e, !1);
			this.showMap();
		}
	}
	clickExhibitor2(e) {
		this.selectExhibitor(e, !0), this.showMap();
	}
	clickExhibitor(e) {
		window.setTimeout(() => {
			this.clickExhibitor2(e);
		}, navigator.userAgent.toLowerCase().indexOf("android") > -1 ? 400 : 50);
	}
	showMap() {
		this.uiState.overlayPosition === "bottom" && Yo && (this.uiState.desiredOverlaySize = "medium");
	}
	showOverlay() {
		this.uiState.overlayPosition === "bottom" && (this.uiState.desiredOverlaySize = "full");
	}
	toggleMapOverlay() {
		this.uiState.overlayPosition === "bottom" && this.uiState.overlaySize === "full" ? this.uiState.desiredOverlaySize = "medium" : this.uiState.overlayPosition === "bottom" && this.uiState.overlaySize !== "full" && (this.uiState.desiredOverlaySize = "full");
	}
	moveToList(e) {
		e = e || this.uiState.listItems;
		let t = [];
		e.forEach((e) => {
			if (e instanceof Ac) t.push(...e.booths.filter((e) => e.visible));
			else if (e instanceof Es) e.visible && t.push(e);
			else if (e instanceof Ys && e.boothId) {
				let n = this.boothStore.boothById.get(e.boothId);
				n != null && n.visible && t.push(n);
			} else e instanceof hG && this.speakerStore.getEventsBySpeaker(e.id).forEach((e) => {
				if (!e.boothId) return;
				let n = this.boothStore.boothById.get(e.boothId);
				n != null && n.visible && t.push(n);
			});
		}), this.uiState.moveToBooths = t;
	}
	moveToExhibitor(e) {
		this.moveToList([e]);
	}
	changeActiveListIndex(e) {
		let t = this.uiState.activeListIndex + e;
		t = Math.max(0, Math.min(this.uiState.listItems.length - 1, t)), this.uiState.activeListIndex = t;
	}
	toggleModal(e) {
		this.uiState.modalActive[e] = !this.uiState.modalActive[e];
	}
	openGallery() {
		this.uiState.galleryActive = !0;
	}
	closeGallery() {
		this.uiState.galleryActive = !1;
	}
	openActiveListItem() {
		let e = this.uiState.listItems[this.uiState.activeListIndex];
		e && (P.log("Opening", e), e instanceof Ac ? this.clickExhibitor(e) : e instanceof Bs ? this.clickCategory(e) : e instanceof Es && this.clickBoothInList2(e));
	}
	toggleCategoryFilter() {
		this.uiState.categoryFilterOpen = !this.uiState.categoryFilterOpen;
	}
	applyCategoryFilters(e) {
		this.uiState.selectedCategoryFilters = e, this.uiState.categoryFilterOpen = !1;
	}
	get filteredExhibitors() {
		return this.uiState.selectedCategoryFilters.length === 0 ? this.exhibitorStore.exhibitors : this.exhibitorStore.exhibitors.filter((e) => this.uiState.selectedCategoryFilters.some((t) => e.categories.some((e) => e.id === t.id)));
	}
	selectSessions() {
		this.uiState.list = {
			type: "sessions",
			text: "",
			focused: !1
		}, this.uiState.menu = !1, this.uiState.selectedTrack = null, this.searchButtonsStore.setSubButtonId(null), this.searchButtonsStore.subButtonsEnabled && this.searchButtonsStore.showSubButtons("sessions"), EN && (this.uiState.desiredOverlaySize = "full");
	}
	selectExhibitors() {
		this.uiState.list = {
			type: "exhibitors",
			text: "",
			focused: !1
		}, this.uiState.menu = !1, EN && (this.uiState.desiredOverlaySize = "full");
	}
	selectTours() {
		this.uiState.list = {
			type: "tours",
			text: "",
			focused: !1
		}, this.uiState.menu = !1, EN && (this.uiState.desiredOverlaySize = "full");
	}
	selectSpeakers() {
		this.uiState.list = {
			type: "speakers",
			text: "",
			focused: !1
		}, this.uiState.menu = !1, EN && (this.uiState.desiredOverlaySize = "full");
	}
	selectSpeaker(e, t = !0) {
		this.speakerStore.selectSpeaker(e, t);
	}
	resetFilters() {
		this.searchButtonsStore.clearAllFilters();
	}
	registerShortcutProviders() {
		this.shortcutRegistry.register(new qU(this)), this.shortcutRegistry.register(new XU(this)), this.shortcutRegistry.register(new WU(this));
	}
}, Vq = Wq(Z.prototype, "initialized", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: function() {
		return !1;
	}
}), Hq = Wq(Z.prototype, "resetCameraFn", [y], {
	configurable: !0,
	enumerable: !0,
	writable: !0,
	initializer: null
}), Wq(Z.prototype, "setResetCameraFn", [C], Object.getOwnPropertyDescriptor(Z.prototype, "setResetCameraFn"), Z.prototype), Wq(Z.prototype, "selectExhibitor", [C], Object.getOwnPropertyDescriptor(Z.prototype, "selectExhibitor"), Z.prototype), Wq(Z.prototype, "selectBooth", [C], Object.getOwnPropertyDescriptor(Z.prototype, "selectBooth"), Z.prototype), Wq(Z.prototype, "reset", [C], Object.getOwnPropertyDescriptor(Z.prototype, "reset"), Z.prototype), Wq(Z.prototype, "selectNone", [C], Object.getOwnPropertyDescriptor(Z.prototype, "selectNone"), Z.prototype), Wq(Z.prototype, "selectBookmarks", [C], Object.getOwnPropertyDescriptor(Z.prototype, "selectBookmarks"), Z.prototype), Wq(Z.prototype, "selectVisited", [C], Object.getOwnPropertyDescriptor(Z.prototype, "selectVisited"), Z.prototype), Wq(Z.prototype, "selectLanguage", [C], Object.getOwnPropertyDescriptor(Z.prototype, "selectLanguage"), Z.prototype), Wq(Z.prototype, "selectCategory", [C], Object.getOwnPropertyDescriptor(Z.prototype, "selectCategory"), Z.prototype), Wq(Z.prototype, "selectEventItem", [C], Object.getOwnPropertyDescriptor(Z.prototype, "selectEventItem"), Z.prototype), Wq(Z.prototype, "selectSearch", [C], Object.getOwnPropertyDescriptor(Z.prototype, "selectSearch"), Z.prototype), Wq(Z.prototype, "clickBookmarks", [C], Object.getOwnPropertyDescriptor(Z.prototype, "clickBookmarks"), Z.prototype), Wq(Z.prototype, "clickVisited", [C], Object.getOwnPropertyDescriptor(Z.prototype, "clickVisited"), Z.prototype), Wq(Z.prototype, "clickLanguage", [C], Object.getOwnPropertyDescriptor(Z.prototype, "clickLanguage"), Z.prototype), Wq(Z.prototype, "clickCategory", [C], Object.getOwnPropertyDescriptor(Z.prototype, "clickCategory"), Z.prototype), Wq(Z.prototype, "clickSeminars", [C], Object.getOwnPropertyDescriptor(Z.prototype, "clickSeminars"), Z.prototype), Wq(Z.prototype, "clickBoothInList", [C], Object.getOwnPropertyDescriptor(Z.prototype, "clickBoothInList"), Z.prototype), Wq(Z.prototype, "clickBoothInList2", [C], Object.getOwnPropertyDescriptor(Z.prototype, "clickBoothInList2"), Z.prototype), Wq(Z.prototype, "clickBooth", [C], Object.getOwnPropertyDescriptor(Z.prototype, "clickBooth"), Z.prototype), Wq(Z.prototype, "clickExhibitor2", [C], Object.getOwnPropertyDescriptor(Z.prototype, "clickExhibitor2"), Z.prototype), Wq(Z.prototype, "clickExhibitor", [C], Object.getOwnPropertyDescriptor(Z.prototype, "clickExhibitor"), Z.prototype), Wq(Z.prototype, "showMap", [C], Object.getOwnPropertyDescriptor(Z.prototype, "showMap"), Z.prototype), Wq(Z.prototype, "showOverlay", [C], Object.getOwnPropertyDescriptor(Z.prototype, "showOverlay"), Z.prototype), Wq(Z.prototype, "toggleMapOverlay", [C], Object.getOwnPropertyDescriptor(Z.prototype, "toggleMapOverlay"), Z.prototype), Wq(Z.prototype, "moveToList", [C], Object.getOwnPropertyDescriptor(Z.prototype, "moveToList"), Z.prototype), Wq(Z.prototype, "moveToExhibitor", [C], Object.getOwnPropertyDescriptor(Z.prototype, "moveToExhibitor"), Z.prototype), Wq(Z.prototype, "changeActiveListIndex", [C], Object.getOwnPropertyDescriptor(Z.prototype, "changeActiveListIndex"), Z.prototype), Wq(Z.prototype, "toggleModal", [C], Object.getOwnPropertyDescriptor(Z.prototype, "toggleModal"), Z.prototype), Wq(Z.prototype, "openGallery", [C], Object.getOwnPropertyDescriptor(Z.prototype, "openGallery"), Z.prototype), Wq(Z.prototype, "closeGallery", [C], Object.getOwnPropertyDescriptor(Z.prototype, "closeGallery"), Z.prototype), Wq(Z.prototype, "openActiveListItem", [C], Object.getOwnPropertyDescriptor(Z.prototype, "openActiveListItem"), Z.prototype), Wq(Z.prototype, "toggleCategoryFilter", [C], Object.getOwnPropertyDescriptor(Z.prototype, "toggleCategoryFilter"), Z.prototype), Wq(Z.prototype, "applyCategoryFilters", [C], Object.getOwnPropertyDescriptor(Z.prototype, "applyCategoryFilters"), Z.prototype), Wq(Z.prototype, "filteredExhibitors", [j], Object.getOwnPropertyDescriptor(Z.prototype, "filteredExhibitors"), Z.prototype), Wq(Z.prototype, "selectSessions", [C], Object.getOwnPropertyDescriptor(Z.prototype, "selectSessions"), Z.prototype), Wq(Z.prototype, "selectExhibitors", [C], Object.getOwnPropertyDescriptor(Z.prototype, "selectExhibitors"), Z.prototype), Wq(Z.prototype, "selectTours", [C], Object.getOwnPropertyDescriptor(Z.prototype, "selectTours"), Z.prototype), Wq(Z.prototype, "selectSpeakers", [C], Object.getOwnPropertyDescriptor(Z.prototype, "selectSpeakers"), Z.prototype), Wq(Z.prototype, "selectSpeaker", [C], Object.getOwnPropertyDescriptor(Z.prototype, "selectSpeaker"), Z.prototype), Wq(Z.prototype, "resetFilters", [C], Object.getOwnPropertyDescriptor(Z.prototype, "resetFilters"), Z.prototype), Z);
//#endregion
//#region src/store/index.ts
if (!window.__storeInitAllowed) throw Error("Store initialization is not allowed before data is loaded");
D({ computedRequiresReaction: !0 });
var Q = new Gq();
jI(Q);
var $ = Q.uiState, Kq = Q.overlayStore, qq = Q.exhibitorStore, Jq = Q.boothStore;
Q.categoryStore;
var Yq = Q.layerStore, Xq = Q.heatmapStore, Zq = Q.searchStore;
Q.toursStore;
var Qq = Q.intercomStore;
window.__store = Q;
//#endregion
export { BL as $, uf as $t, NV as A, Er as An, VN as At, _z as B, Wh as Bt, CU as C, Oo as Cn, ZP as Ct, RH as D, ai as Dn, eP as Dt, xU as E, z as En, ZN as Et, Tz as F, $n as Fn, bN as Ft, DR as G, Mm as Gt, AR as H, Gh as Ht, Cz as I, Hn as In, lN as It, xR as J, wf as Jt, vR as K, bf as Kt, Sz as L, Bn as Ln, cN as Lt, Oz as M, mr as Mn, MN as Mt, kz as N, lr as Nn, EN as Nt, nH as O, Gr as On, GN as Ot, Dz as P, Yn as Pn, gN as Pt, cR as Q, gf as Qt, gz as R, Rn, Sv as Rt, TU as S, Do as Sn, yF as St, yU as T, oo as Tn, mP as Tt, gR as U, zm as Ut, tz as V, Uh as Vt, _R as W, jm as Wt, wR as X, xf as Xt, yR as Y, yf as Yt, fR as Z, Sf as Zt, IG as _, Yo as _n, uI as _t, Yq as a, Kc as an, gL as at, hG as b, Mo as bn, FF as bt, Q as c, Oc as cn, DI as ct, XG as d, Bs as dn, bI as dt, pf as en, NL as et, qG as f, Es as fn, vI as ft, FG as g, Zo as gn, hI as gt, zG as h, rs as hn, gI as ht, Qq as i, Pc as in, yL as it, DB as j, Sr as jn, FN as jt, FV as k, Rr as kn, WN as kt, $ as l, cc as ln, kI as lt, BG as m, Os as mn, _I as mt, qq as n, $c as nn, bL as nt, Kq as o, qc as on, _L as ot, ZG as p, Ds as pn, xI as pt, SR as q, Cf as qt, Xq as r, Jc as rn, vL as rt, Zq as s, Ac as sn, FI as st, Jq as t, cf as tn, hL as tt, JG as u, Ys as un, yI as ut, jG as v, Go as vn, eI as vt, SU as w, vo as wn, qP as wt, SW as x, Ao as xn, kF as xt, OG as y, Xo as yn, $F as yt, vz as z, Yh as zt };

;/* vite-per-chunk-css */
__vite_inject_css__(".efp-set-kiosk-mode-anchor{bottom:calc(1.25rem * var(--ui-scale));z-index:9999;pointer-events:none;position:fixed;left:50%;transform:translate(-50%)}.efp-set-kiosk-mode{width:calc(23.75rem * var(--ui-scale));background:var(--color-primary);border-radius:var(--border-radius-xl);box-shadow:var(--shadow-md);pointer-events:auto;line-height:1;display:grid}.efp-set-kiosk-mode__header{padding:calc(.625rem * var(--ui-scale)) calc(1rem * var(--ui-scale));font-size:var(--font-size-xl);font-weight:var(--font-weight-bold);color:var(--color-white);text-align:center;grid-template-columns:auto 1fr auto;place-items:center;display:grid}.efp-set-kiosk-mode__header i{font-size:var(--icon-size-xl)}.efp-set-kiosk-mode__header img{width:var(--icon-size-xl);height:var(--icon-size-xl)}.efp-set-kiosk-mode__close{box-shadow:none;cursor:pointer;background:0 0;border:0;margin:0;padding:0}.efp-confirm-dialog{background:var(--color-white);box-shadow:var(--shadow-md);border-radius:var(--border-radius-xl);padding:calc(1rem * var(--ui-scale)) calc(1.125rem * var(--ui-scale));gap:calc(1rem * var(--ui-scale));display:grid;position:relative}.efp-confirm-dialog__content{font-size:var(--font-size-xl);font-weight:var(--font-weight-normal)}.efp-confirm-dialog__content strong{font-weight:var(--font-weight-medium)}.efp-confirm-dialog__controls{gap:calc(.625rem * var(--ui-scale));grid-template-columns:1fr 1fr;display:grid}.efp-info-message{border-radius:var(--border-radius-xl);padding:calc(1rem * var(--ui-scale)) calc(1.125rem * var(--ui-scale));background:var(--color-white);gap:calc(.5rem * var(--ui-scale));display:grid;position:relative}.efp-info-message__item{gap:calc(.625rem * var(--ui-scale));font-size:var(--font-size-xl);font-weight:var(--font-weight-normal);grid-auto-flow:column;place-content:flex-start;place-items:center;line-height:1;display:grid}.efp-info-message__item strong{font-weight:var(--font-weight-bold)}.efp-info-message__img{width:calc(1.875rem * var(--ui-scale));height:calc(1.875rem * var(--ui-scale))}.efp-set-kiosk-form{border-radius:var(--border-radius-xl);background:var(--color-white);padding:calc(1rem * var(--ui-scale)) calc(1.125rem * var(--ui-scale));display:grid;position:relative}.efp-set-kiosk-form__content{gap:calc(1rem * var(--ui-scale));display:grid}.efp-set-kiosk-form__inputs{gap:calc(.625rem * var(--ui-scale));display:grid}.efp-set-kiosk-form__controls{gap:calc(.625rem * var(--ui-scale));grid-template-columns:1fr 2fr;display:grid}.efp-range-input{gap:calc(.3125rem * var(--ui-scale));width:100%;font-size:var(--font-size-lg);display:grid}.efp-range-input__header{text-align:center;color:var(--color-black);font-size:var(--font-size-lg);font-weight:var(--font-weight-normal);grid-template-columns:auto 1fr auto;place-items:center;display:grid}.efp-range-input__header strong{font-weight:var(--font-weight-medium)}.efp-range-input__control{width:calc(1.25rem * var(--ui-scale));height:calc(1.25rem * var(--ui-scale));box-shadow:none;cursor:pointer;border:0;outline:none;place-content:center;place-items:center;margin:0;padding:0;display:grid}.efp-range-input__control i{font-size:var(--icon-size-xxs)}.efp-range-input__input-block{width:100%;height:calc(1.375rem * var(--ui-scale));place-items:center;display:grid;position:relative}.efp-range-input__input{opacity:0;z-index:2;width:100%;height:100%;position:absolute;top:0;bottom:0;left:0;right:0}.efp-range-input__custom-input{height:calc(.375rem * var(--ui-scale));background:var(--color-gray-400);border-radius:calc(.1875rem * var(--ui-scale));pointer-events:none;position:absolute;top:50%;left:0;right:0;transform:translateY(-50%)}.efp-range-input__progress{background:var(--color-primary);border-radius:inherit;height:100%;position:absolute;top:0}.efp-range-input__progress:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:0}.efp-range-input__progress:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:0}.efp-range-input__progress:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:0}.efp-range-input__progress:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:0}.efp-range-input__thumb{width:calc(1.375rem * var(--ui-scale));height:calc(1.375rem * var(--ui-scale));background:var(--color-white);border:calc(.1875rem * var(--ui-scale)) solid var(--color-primary-dark);pointer-events:none;box-shadow:var(--shadow-sm);border-radius:50%;position:absolute;top:50%}.efp-range-input__thumb:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:0}.efp-range-input__thumb:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:0}.efp-range-input__thumb:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:0}.efp-range-input__thumb:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:0}.efp-status-messages{height:calc(calc(2.75rem * var(--ui-scale)) + var(--border-radius-2xl));border-radius:var(--border-radius-xl);grid-template-rows:1fr;display:grid;position:absolute;top:0;left:0;right:0;overflow:hidden}.efp-status-messages__message{gap:calc(.375rem * var(--ui-scale));color:var(--color-white);font-size:var(--font-size-xl);font-weight:var(--font-weight-bold);padding-bottom:var(--border-radius-2xl);grid-auto-flow:column;place-content:center;place-items:center;display:grid}.efp-status-messages__message i{font-size:var(--icon-size-md)}.efp-status-messages__message--success{background:var(--color-green)}.efp-status-messages__message--error{background:var(--color-red)}\n/*$vite$:1*/", "store.css", false);