@expofp/floorplan
Version:
Interactive floor plan library for expos and events
1,382 lines (1,381 loc) • 45.6 kB
JavaScript
(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.47.0" };
var t = new e.Error().stack;
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "0c1d7a9c-ce2d-44c1-9cd0-5bd3fb53e1a5", e._sentryDebugIdIdentifier = "sentry-dbid-0c1d7a9c-ce2d-44c1-9cd0-5bd3fb53e1a5");
} catch {}
})();
import { r as e } from "./rolldown-runtime-5rOLGCTp.js";
import { a as t, c as n, i as r, n as i, o as a, r as o, s, t as c } from "./floorplan.loader-DEaS-fgT.js";
import { $ as l, A as u, Ct as d, D as f, Dt as p, Et as ee, H as m, J as te, O as ne, Ot as h, Q as re, R as ie, St as ae, Tt as oe, Y as se, Z as g, _t as ce, at as le, bt as ue, ct as de, dt as fe, et as pe, ft as me, gt as he, ht as ge, it as _e, l as ve, lt as ye, mt as be, n as xe, o as Se, ot as Ce, pt as we, r as Te, tt as Ee, ut as De, vt as Oe, wt as ke, xt as Ae, yt as je } from "./i18n-DlquqKCP.js";
import { s as Me } from "./efp-debug-init-D3gNE8Zq.js";
import { t as Ne } from "./react-XuvSZP7j.js";
import { t as Pe } from "./jsx-runtime-BzLvm2y2.js";
import { a as _, o as Fe } from "./is-debug-IkNSAGo8.js";
import { n as Ie, t as Le } from "./is-own-domain-yrTLx04R.js";
import { C as Re, D as ze, Q as Be, ht as v, i as Ve, n as He, w as Ue } from "./exports-CnYQMV4a.js";
import { l as We, u as Ge } from "./mobx.module-BTnTbXnp.js";
import { t as Ke } from "./client-DbQnuxsE.js";
import { i as qe, n as Je, r as y, t as Ye } from "./components-CzNKFauU.js";
import { a as Xe, h as Ze, i as Qe, p as $e } from "./UIState-Dd6fvko0.js";
import { l as b, u as x } from "./store-DTvNQcN7.js";
import { n as et } from "./event-scoped-cache-CUHa0QyF.js";
import { $t as S, Bt as tt, Jt as nt, N as C, P as rt, Vt as it, et as w, g as at, j as ot, w as st } from "./LayerStore-DCg-juRT.js";
import { m as T, p as ct, u as lt, v as E } from "./wayfinding-BUQns13Y.js";
import { C as ut, S as dt, a as D, b as ft, h as pt, i as mt, m as ht, n as O, p as gt, s as _t, t as vt, u as yt, v as bt, w as k, y as A } from "./RouteStore-B82dztUW.js";
import { r as xt, t as St } from "./kiosk-mode-zD8K_fUT.js";
import { n as Ct, t as wt } from "./integrateKiosk-CumGPvbc.js";
import { t as Tt } from "./init-ui-BQ7d5hKB.js";
//#region ../../node_modules/.pnpm/@sentry+browser@10.69.0/node_modules/@sentry/browser/build/npm/esm/prod/report-dialog.js
function Et(e = {}) {
let n = r.document, i = (n == null ? void 0 : n.head) || (n == null ? void 0 : n.body);
if (!i) {
o && v.error("[showReportDialog] Global document not defined");
return;
}
let a = Ue(), s = Re(), c = s == null ? void 0 : s.getDsn();
if (!c) {
o && v.error("[showReportDialog] DSN not configured");
return;
}
let l = {
...e,
user: {
...a.getUser(),
...e.user
},
eventId: e.eventId || Ve()
}, u = r.document.createElement("script");
u.async = !0, u.crossOrigin = "anonymous", u.src = t(c, l);
let { onLoad: d, onClose: f } = l;
if (d && (u.onload = d), f) {
let e = (t) => {
if (t.data === "__sentry_reportdialog_closed__") try {
f();
} finally {
r.removeEventListener("message", e);
}
};
r.addEventListener("message", e);
}
i.appendChild(u);
}
//#endregion
//#region ../../node_modules/.pnpm/@sentry+react@10.69.0_react@19.2.8/node_modules/@sentry/react/build/esm/error.js
var j = /* @__PURE__ */ e(Ne());
function Dt(e) {
let t = e.match(/^([^.]+)/);
return t !== null && parseInt(t[0]) >= 17;
}
function Ot(e, t) {
let n = /* @__PURE__ */ new WeakSet();
function r(e, t) {
if (!n.has(e)) {
if (e.cause) return n.add(e), r(e.cause, t);
e.cause = t;
}
}
r(e, t);
}
function kt(e, { componentStack: t }, n) {
if (Dt(j.version) && Be(e) && t) {
let n = Error(e.message);
n.name = `React ErrorBoundary ${e.name}`, n.stack = t, Ot(e, n);
}
return He(e, n);
}
//#endregion
//#region ../../node_modules/.pnpm/@sentry+react@10.69.0_react@19.2.8/node_modules/@sentry/react/build/esm/debug-build.js
var At = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, M = {
componentStack: null,
error: null,
eventId: null
}, jt = class extends j.Component {
constructor(e) {
super(e), this.state = M, this._openFallbackReportDialog = !0;
let t = Re();
t && e.showDialog && (this._openFallbackReportDialog = !1, this._cleanupHook = t.on("afterSendEvent", (t) => {
!t.type && this._lastEventId && t.event_id === this._lastEventId && Et({
...e.dialogOptions,
eventId: this._lastEventId
});
}));
}
componentDidCatch(e, t) {
let { componentStack: n } = t, { beforeCapture: r, onError: i, showDialog: a, dialogOptions: o } = this.props;
ze((s) => {
r && r(s, e, n);
let c = kt(e, t, { mechanism: {
handled: this.props.handled == null ? !!this.props.fallback : this.props.handled,
type: "auto.function.react.error_boundary"
} });
i && i(e, n, c), a && (this._lastEventId = c, this._openFallbackReportDialog && Et({
...o,
eventId: c
})), this.setState({
error: e,
componentStack: n,
eventId: c
});
});
}
componentDidMount() {
let { onMount: e } = this.props;
e && e();
}
componentWillUnmount() {
let { error: e, componentStack: t, eventId: n } = this.state, { onUnmount: r } = this.props;
r && (this.state === M ? r(null, null, null) : r(e, t, n)), this._cleanupHook && (this._cleanupHook(), this._cleanupHook = void 0);
}
resetErrorBoundary() {
let { onReset: e } = this.props, { error: t, componentStack: n, eventId: r } = this.state;
e && e(t, n, r), this.setState(M);
}
render() {
let { fallback: e, children: t } = this.props, n = this.state;
if (n.componentStack === null) return typeof t == "function" ? t() : t;
let r = typeof e == "function" ? j.createElement(e, {
error: n.error,
componentStack: n.componentStack,
resetError: () => this.resetErrorBoundary(),
eventId: n.eventId
}) : e;
return j.isValidElement(r) ? r : (e && At && v.warn("fallback did not produce a valid ReactElement"), null);
}
}, Mt = /* @__PURE__ */ e(Me(), 1), Nt = Ke(), Pt = Ze();
function N() {
let e = window.location.hostname.split(".");
return e.length >= 3 && e[e.length - 2] === "expofp" && e[e.length - 1] === "com";
}
function Ft() {
return N() ? window.location.hostname.split(".")[0] : "main";
}
function It(e) {
if ((e == null ? void 0 : e.free) === !0) return "Free";
let t = e == null ? void 0 : e.trialExpiresAt;
if (t) {
let e = new Date(t).getTime();
if (!Number.isNaN(e)) return Date.now() < e ? "Trial Active" : "Trial Expired";
}
return "Active";
}
function Lt() {
return !1;
}
function Rt(e) {
return e;
}
function zt(e) {
if (Lt() || !N() || xt(e) || !window.navigator.onLine) return null;
let t = Rt({
subDomain: Ft(),
subscriptionStatus: It(e)
});
return t.subDomain !== "demo" && t.subscriptionStatus !== "Free" && t.subscriptionStatus !== "Trial Expired" ? null : t;
}
//#endregion
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/mini/schemas.js
var P = /*@__PURE__*/ p("ZodMiniType", (e, t) => {
if (!e._zod) throw Error("Uninitialized schema in ZodMiniType.");
je.init(e, t), e.def = t, e.type = t.type, e.parse = (t, n) => ue(e, t, n, { callee: e.parse }), e.safeParse = (t, n) => ae(e, t, n), e.parseAsync = async (t, n) => Ae(e, t, n, { callee: e.parseAsync }), e.safeParseAsync = async (t, n) => d(e, t, n), e.check = (...n) => {
var r;
return e.clone({
...t,
checks: [...(r = t.checks) == null ? [] : r, ...n.map((e) => typeof e == "function" ? { _zod: {
check: e,
def: { check: "custom" },
onattach: []
} } : e)]
}, { parent: !0 });
}, e.with = e.check, e.clone = (t, n) => ke(e, t, n), e.brand = () => e, e.register = ((t, n) => (t.add(e, n), e)), e.apply = (t) => t(e);
}), Bt = /*@__PURE__*/ p("ZodMiniString", (e, t) => {
Oe.init(e, t), P.init(e, t);
});
// @__NO_SIDE_EFFECTS__
function F(e) {
return fe(Bt, e);
}
var Vt = /*@__PURE__*/ p("ZodMiniNumber", (e, t) => {
ge.init(e, t), P.init(e, t);
});
// @__NO_SIDE_EFFECTS__
function I(e) {
return ye(Vt, e);
}
var Ht = /*@__PURE__*/ p("ZodMiniNever", (e, t) => {
be.init(e, t), P.init(e, t);
});
// @__NO_SIDE_EFFECTS__
function Ut(e) {
return de(Ht, e);
}
var Wt = /*@__PURE__*/ p("ZodMiniArray", (e, t) => {
me.init(e, t), P.init(e, t);
});
// @__NO_SIDE_EFFECTS__
function L(e, t) {
return new Wt({
type: "array",
element: e,
...ee(t)
});
}
var Gt = /*@__PURE__*/ p("ZodMiniObject", (e, t) => {
he.init(e, t), P.init(e, t), oe(e, "shape", () => t.shape);
});
// @__NO_SIDE_EFFECTS__
function R(e, t) {
return new Gt({
type: "object",
shape: e,
catchall: /* @__PURE__ */ Ut(),
...ee(t)
});
}
var Kt = /*@__PURE__*/ p("ZodMiniOptional", (e, t) => {
ce.init(e, t), P.init(e, t);
});
// @__NO_SIDE_EFFECTS__
function z(e) {
return new Kt({
type: "optional",
innerType: e
});
}
var qt = /*@__PURE__*/ p("ZodMiniCustom", (e, t) => {
we.init(e, t), P.init(e, t);
});
// @__NO_SIDE_EFFECTS__
function Jt(e, t = {}) {
return De(qt, e, t);
}
//#endregion
//#region src/schemas/sdk.schemas.ts
var Yt = /* @__PURE__ */ R({
x: /* @__PURE__ */ I(),
y: /* @__PURE__ */ I()
}), Xt = /* @__PURE__ */ R({
leftTop: Yt,
rightBottom: Yt
}), Zt = (/* @__PURE__ */ R({
name: /* @__PURE__ */ z(/* @__PURE__ */ F()),
externalId: /* @__PURE__ */ z(/* @__PURE__ */ F())
})).check(/* @__PURE__ */ Jt((e) => !!(e.name || e.externalId), "Either name or externalId must be provided")), Qt = (/* @__PURE__ */ R({
booths: /* @__PURE__ */ z(/* @__PURE__ */ L(Zt)),
exhibitors: /* @__PURE__ */ z(/* @__PURE__ */ L(Zt))
})).check(/* @__PURE__ */ Jt((e) => {
var t, n;
return !!((t = e.booths) != null && t.length || (n = e.exhibitors) != null && n.length);
}, "Selector must contain booths or exhibitors")), $t = /* @__PURE__ */ z(/* @__PURE__ */ R({ padding: /* @__PURE__ */ z(/* @__PURE__ */ I()) }));
//#endregion
//#region src/components/Kiosk/recoverKioskFromUrlPrams.ts
function en(e) {
let t = Xe(e);
Object.values(t).length && (wt(t, !1), Ct(t));
}
//#endregion
//#region src/utils/getMostFrequent.ts
function tn(e) {
let t = {}, n = 0, r;
return e.forEach((e) => {
t[e] = (t[e] || 0) + 1, t[e] > n && (n = t[e], r = e);
}), r;
}
//#endregion
//#region src/services/multi-slug.ts
function nn(e, t) {
if (!e.includes("&") && !e.includes("%26")) return null;
let n = e.startsWith("?") ? e.slice(1) : e, r = n.includes("&") ? "&" : "%26", i = n.split(r), a = (e) => !!e && !g(e).includes("=");
return i.filter(a).length < 2 ? null : "?" + i.map((e) => a(e) && t(e) || e).join("&");
}
//#endregion
//#region src/services/url-dispatch.ts
var B = !1, V = !1;
function rn() {
W(h()), C(() => b.layerStore.layersLoaded, () => {
let e = h().camera;
Object.keys(e).length && xn(y(e));
let t = h().visibility;
Object.keys(t).length && x.setVisibility(t);
});
}
function an(e) {
dt({
offHistory: e,
onNavigate: () => U({ backForward: !0 })
}), dn(), H(), C(() => b.layerStore.layersLoaded, () => {
b.urlFilterManager && !b.urlFilterManager.isInitialized && b.urlFilterManager.initialize(), V = !0;
try {
U();
} finally {
V = !1;
}
ot(G), ot(_n), x.viewerMode && (x.menu = !0);
});
}
function on(e = "") {
k("?" + g(e.toString())), b.layerStore.layersLoaded ? sn(e) : (H(), C(() => b.layerStore.layersLoaded, () => sn(e)));
}
function sn(e) {
var t, r;
let i = "?" + g(e), a = hn(i), o = [...(t = a.intents) == null ? [] : t, ...l(i).intents], { intents: s = [], ...c } = re(i, {
visibility: a.visibility,
consent: a.consent,
intents: o
});
W(a), W(c);
let u = (r = a.consent) == null ? c.consent : r;
u && pt(u), a.camera && Object.keys(a.camera).length && xn(y(a.camera)), a.visibility && Object.keys(a.visibility).length && x.setVisibility(a.visibility), dn(), U();
let d = [...o, ...s];
d.length && n(b.fp, d);
}
function H() {
let e = A();
return Je(e.length > 1 ? g(e.substring(1)) : "");
}
function U(e = {}) {
B = !0;
try {
en(new URLSearchParams(g(window.location.search)));
let { primary: t } = te(A()), n = t.type === "select" && (!t.slug || /^t=[^&]*$/.test(t.slug)) && (x.heatmap || x.heatmapYah);
!H() && !n && (e.backForward ? cn(t) : ln(t));
} finally {
B = !1;
}
if (e.backForward) {
let { exhibitor: e, booth: t, eventItem: n } = bn(), r = gn();
r.exhibitor = e, r.booth = t, r.eventItem = n;
}
_n(), G();
}
function cn(e) {
e.type === "list" && e.list === "sessions" ? b.fp.showSessions() : ln(e);
let { intents: t } = l(A());
n(b.fp, t.filter((e) => e.name === "showSessions"));
}
function ln(e) {
let t = b.fp;
switch (e.type) {
case "kiosk":
e.enabled !== null && St(x, e.enabled);
return;
case "list":
t.showList(e.list);
return;
case "tour":
t.selectTour(e.tourId);
return;
case "planner":
V && b.searchButtonsStore.keepFiltersOnNextNavigation(), t.openPlanner({
items: e.items,
from: e.from,
fromBookmarks: e.fromBookmarks
});
return;
case "route": {
var n, r;
b.routeStore.setOnlyAccessible(e.accessible);
let t = mt((n = e.from) == null ? "" : n, (r = e.to) == null ? "" : r, e.waypoints);
V && !(t.from && t.from === t.to) && b.searchButtonsStore.keepFiltersOnNextNavigation(), b.routeStore.selectRoute(t), b.uiState.setIsMultiPointRoute(e.waypoints.length > 0), e.title && b.uiState.setRouteTitle(e.title);
return;
}
case "selectExhibitors":
setTimeout(() => t.selectExhibitor(e.values), 250);
return;
case "ownedByFilters":
Fe.log("Skipping filter parameters in dispatchFromUrl (owned by URLFilterManager)");
return;
case "ownedByConfig": return;
case "select":
t.select(e.slug);
return;
}
}
function un(e) {
let { pathwayId: t, boothIds: n, exhibitorIds: r } = e, i = b.boothStore.booths.filter((e) => n.includes(e.externalId)), a = b.exhibitorStore.exhibitors.filter((e) => r.includes(e.externalId)).flatMap((e) => e.booths), o = [...i, ...a];
if (tt()) {
let e = tn(o.map((e) => e.layer.name));
e && b.fp.activateFloor({ name: e });
}
(n.length > 0 || r.length > 0) && b.fp.highlightEntities([...n, ...r]), b.layerStore.showPathWay(t), o.length > 0 && Ge(() => {
b.uiState.moveToRect = S.fromUnion(...o.map((e) => e.rect).filter(Boolean)), b.uiState.rollReset = !0;
});
}
function dn() {
let { oneShots: e } = te(A());
for (let t of e) fn(t);
let t = Qe(A());
t !== null && k("?" + t), x.previewExhibitor && k("?" + x.previewExhibitor.slug), mn();
}
function fn(e) {
switch (e.type) {
case "heatmap":
pn(e.yah);
return;
case "blueDot": {
var t, n;
let r = new vt(e.x, e.y, (t = b.layerStore.findLayer((n = e.layer) == null ? "" : n)) == null ? void 0 : t.name, void 0, e.lat, e.lng);
C(() => b.layerStore.layersLoaded, () => b.routeStore.selectCurrentPosition(r, !0, 1));
return;
}
case "viewerMode":
ve && (e.enabled ? localStorage.setItem(m, "true") : (localStorage.removeItem(m), localStorage.removeItem(u)));
return;
case "previewMode":
ve && (e.enabled ? localStorage.setItem(ie, "true") : (localStorage.removeItem(ie), localStorage.removeItem(ne)));
return;
case "uiScale":
e.scale === null ? Fe.warn(`Invalid ui-scale parameter: ${e.raw}. Must be a number between 0.8 and 1.4.`) : b.uiState.setUIScale(e.scale, !0);
return;
case "resetUiScale":
b.uiState.resetUIScale();
return;
}
}
function pn(e) {
ft(), e ? (x.heatmapYah = !0, x.monochrome = !0, x.hideLogoInBooth = !0, x.hideHeaderLogo = !0, x.disableBookmarked = !0) : x.heatmap = !0;
}
function mn() {
let e = nn(A(), (e) => {
let t = b.exhibitorStore.exhibitors.find((t) => t.slug === e || t.externalId === e);
return t == null ? void 0 : t.name;
});
e !== null && k(e);
}
function W(e) {
e.noOverlay !== void 0 && (x.hideOverlay = e.noOverlay), e.monochrome && (x.monochrome = !0), e.hideHeaderLogo && (x.hideHeaderLogo = !0), e.hideLogoInBooth && (x.hideLogoInBooth = !0), e.disableFeatured && b.exhibitorStore.exhibitors.forEach((e) => e.featured = !1), e.disableBookmarked && (x.disableBookmarked = !0), e.disableGps && b.routeStore.setGpsTrackingEnabled(!1), e.heatmap && i(e.heatmap) && pn(e.heatmap.variant === "yah");
}
function hn(e) {
return Ee(_e, e).value;
}
var gn = et(() => ({
exhibitor: null,
booth: null,
eventItem: null
}));
function _n() {
let { selection: e, exhibitor: t, booth: n, eventItem: r } = bn(), i = b.urlFilterManager.filterSearch(), a = vn(e);
if (B) return;
let o = a || se(e) || i;
if (A() === o) return;
let s = gn();
t !== s.exhibitor || n !== s.booth || r !== s.eventItem ? ut(o) : k(o), s.exhibitor = t, s.booth = n, s.eventItem = r;
}
function vn(e) {
if (e.type !== "list" || e.list !== "sessions") return "";
let { selectedTracks: t, selectedVenues: n, date: r, timeOfDay: i, showBookmarksOnly: a, showLiveOnly: o } = b.sessionsFilterStore.state.filters, s = {};
return t.value.length && (s.tracks = yn(t.value)), n.value.length && (s.venues = yn(n.value)), r.value !== "all" && (s.date = r.value), r.value === "today" && i.value !== "all" && (s.time = i.value), a.value && (s.bookmarked = !0), o.value && (s.live = !0), Object.keys(s).length ? "?" + pe({
name: "showSessions",
args: [s]
}) : "";
}
function yn(e) {
return [...e].sort((e, t) => e - t).map(String);
}
function bn() {
let e = x.selectedExhibitor, t = x.selectedBooth, n = x.selectedEventItem, r = x.selectedRoute, i = x.selectedSpeaker, a = x.setKioskModeEnabled, o = x.list, s;
if (o.type === "route-planner" && !e && !t && !n) {
var c;
let e = b.routePlannerStore;
s = {
type: "planner",
fromBookmarks: e.source === "bookmarks",
items: e.items.map((e) => e.entity.slug).filter(Boolean),
from: ((c = e.startPoint) == null ? void 0 : c.slug) || void 0
};
} else if (r && !x.isMultiPointRoute) {
var l;
s = {
type: "route",
to: r.to instanceof w ? r.to.slug : void 0,
from: r.from instanceof w ? r.from.slug : void 0,
accessible: b.routeStore.onlyAccessible,
waypoints: (l = r.waypoints) == null ? void 0 : l.map((e) => e.slug)
};
} else if (e) s = {
type: "slug",
slug: e.slug
};
else if (t) s = {
type: "slug",
slug: t.slug
};
else if (n) s = {
type: "slug",
slug: n.slug
};
else if (i) s = {
type: "slug",
slug: i.slug
};
else if (a) s = { type: "none" };
else switch (o.type) {
case "bookmarks":
case "visited":
case "sessions":
case "exhibitors":
case "speakers":
case "tours":
case "language":
s = {
type: "list",
list: o.type
};
break;
case "category":
var u, d;
s = {
type: "slug",
slug: (u = (d = x.selectedCategory) == null ? void 0 : d.slug) == null ? "" : u
};
break;
case "search":
s = {
type: "slug",
slug: o.text || ""
};
break;
case "filter":
s = {
type: "filter",
key: o.query.key,
value: o.query.value
};
break;
case "multi-point-tour":
s = {
type: "tour",
tourId: o.tourId
};
break;
default: throw Error("Unkown list.type");
}
return {
selection: s,
exhibitor: e,
booth: t,
eventItem: n
};
}
function G() {
var e;
if (!Le) return;
let t = x.selectedExhibitor, n = x.selectedEventItem, r = x.selectedSpeaker, i = "";
t ? i = t.name : n ? i = n.name : r ? i = r.name : x.list.type === "search" && x.list.text ? i = "`" + (x.list.text || "") + "`" : x.list.type === "multi-point-tour" && x.tourTitle && (i = x.tourTitle), i.length && (i += " – "), i += (e = a(nt, Ie)) == null ? s(window.location.hostname, Ie) : e, document.title = i;
}
function xn(e) {
try {
if (x.setMapSettings(e), e.z) {
let t = b.layerStore.layers.find((t) => t.name === e.z);
t && b.layerStore.updateVisibility(t, !0);
}
} catch (e) {
console.error("Failed to process map settings.", e);
}
}
//#endregion
//#region src/store/details-events.ts
function Sn() {
return We(() => x.details, () => {
var e;
if (!x.onDetails) return;
if (!x.details) {
x.onDetails(null);
return;
}
let t = x.details;
if (it.EXPO === "wineparis" && (t instanceof at && (t = t.booths[0]), !t)) return;
let n = null, r = [];
if (t instanceof at) n = "exhibitor", r = t.booths.map((e) => e.name).sort((e, t) => {
var n, r;
return e == ((n = b.routeStore.tempToBooth) == null ? void 0 : n.name) ? -1 : +(t == ((r = b.routeStore.tempToBooth) == null ? void 0 : r.name));
});
else if (t instanceof w) n = "booth", r = [t.name];
else if (t instanceof O) {
var i, a;
n = "route", r = [(i = t.from) == null ? void 0 : i.name, (a = t.to) == null ? void 0 : a.name].filter((e) => !!e);
} else t instanceof $e && (n = "category", r = t.exhibitors.map((e) => e.booths.map((e) => e.name)).flat());
let o = t, s = {
type: n,
name: o == null ? void 0 : o.name,
id: o == null ? void 0 : o.id,
externalId: o == null ? void 0 : o.externalId,
boothsNames: r
};
x.onDetails({
...s,
...n === "route" ? { routeInfo: (e = b.routeStore.routeInfo) == null ? void 0 : e } : {}
});
});
}
//#endregion
//#region src/utils/mapEntity.ts
function K(e) {
switch (e.entity.type) {
case "booth":
var t, n;
return {
id: e.id,
name: J(e.name),
externalId: J(e.externalId),
isSpecial: e.entity.variant === "special",
exhibitors: q(e.exhibitors),
layer: {
name: J((t = e.layer) == null ? void 0 : t.name),
description: J((n = e.layer) == null ? void 0 : n.description)
},
meta: e.meta,
description: J(e.description),
entity: e.entity,
title: J(e.title)
};
case "category": return {
id: e.id,
name: J(e.name),
exhibitors: q(e.exhibitors),
entity: e.entity,
slug: J(e.slug)
};
case "exhibitor": return {
id: e.id,
name: J(e.name),
externalId: J(e.externalId),
booths: q(e.booths),
entity: e.entity,
slug: J(e.slug)
};
case "schedule": return {
id: e.id,
externalId: J(e.externalId),
boothId: e.boothId,
exhibitorId: e.exhibitorId,
name: J(e.name),
description: J(e.description),
startDate: J(e.startDate),
endDate: J(e.endDate),
link: J(e.link),
entity: e.entity,
isEnded: e.isEnded
};
case f: return {
id: e.id,
name: J(e.name),
entity: e.entity
};
case "heatmap-yah": return {
id: J(e.id),
name: J(e.name),
viewCount: e.viewCount || 0,
x: e.x || 0,
y: e.y || 0,
z: e.z,
entity: e.entity
};
default: return e;
}
}
function q(e) {
return Array.isArray(e) ? e.filter(Boolean).map((e) => e.id).filter(Boolean) : [];
}
function J(e) {
return typeof e == "string" ? e : "";
}
//#endregion
//#region src/floorplan.ready.tsx
var Y = Pe(), X = (0, Mt.default)("efp:api");
(0, Pt.install)();
var Cn = class extends c {
constructor(...e) {
super(...e), this.root = void 0;
}
init() {
gt(), rn(), this.ignoreQuery || an(this.offHistory), bt("load"), Tt(b), b.fp = this, _(Sn()), st(), pt(this.consent), ht(yt.Load, ""), this.root = (0, Nt.createRoot)(this.renderTarget), this.root.render(/* @__PURE__ */ (0, Y.jsx)(jt, { children: /* @__PURE__ */ (0, Y.jsx)(Ye, {
offHistory: this.offHistory,
consent: this.consent
}) })), ht(yt.Rendered, ""), _(We(() => b.layerStore.layersLoaded, () => {
let e = this.renderTarget.getRootNode(), t = e instanceof ShadowRoot ? e.host : this.renderTarget.parentElement;
for (document.querySelectorAll(".expofp-floorplan-loader").forEach((e) => e.remove()); t && this.element.firstChild && this.element.firstChild !== t;) this.element.removeChild(this.element.firstChild);
if (this.resolveReady(), !b.initialized) {
var n;
(n = this.onInit) == null || n.call(this, this);
}
b.initialized = !0;
})), _(() => clearTimeout(Q));
let e = zt(nt);
e && import("./bootIntercom-C3tqD4Ct.js").then(({ bootIntercom: t }) => t(e)).catch(() => {});
}
selectBooth(e) {
if (typeof e != "string" && !Array.isArray(e)) {
$("selectBooth", "Parameter must be a string or an array of strings.", "EFP000000");
return;
}
let t = b.boothStore.booths.filter((t) => typeof e == "string" ? t.name === e || t.externalId === e : e.includes(t.name) || e.includes(t.externalId));
b.selectBooth(t);
}
selectExhibitor(e) {
if (typeof e != "string" && !Array.isArray(e)) {
$("selectExhibitor", "Parameter must be a string or an array of strings.", "EFP000100");
return;
}
if (!(e != null && e.length)) {
b.uiState.menu = !1, b.searchStore.resetSearchBox(), b.uiState.details = null;
return;
}
let t = b.exhibitorStore.exhibitors.filter((t) => typeof e == "string" ? t.name === e || t.externalId === e : e.includes(t.name) || e.includes(t.externalId));
if (!(t != null && t.length)) return;
if (typeof e == "string") {
b.selectExhibitor(t[0]), b.moveToList([t[0]]);
return;
}
let n = tn(t.flatMap((e) => e.booths.map((e) => e.layer)).map((e) => e.description));
n && b.layerStore.updateVisibility(n, !0), b.uiState.menu = !1, b.searchStore.resetSearchBox(), b.uiState.details = null, b.uiState.list = {
type: "filter",
items: t,
query: {
key: "exhibitors",
value: t.map((e) => e.name).join(",")
}
}, b.moveToList();
}
highlightExhibitors(e) {
if (!Array.isArray(e)) {
$("highlightExhibitors", "Parameter must be an array of strings.", "EFP000200");
return;
}
b.boothStore.highlightedByExternalIds = [], b.exhibitorStore.highlightedByExternalIds = [...e];
}
highlightBooths(e) {
if (!Array.isArray(e)) {
$("highlightBooths", "Parameter must be an array of strings.", "EFP000300");
return;
}
b.exhibitorStore.highlightedByExternalIds = [], b.boothStore.highlightedByExternalIds = [...e];
}
highlightEntities(e) {
if (!Array.isArray(e)) {
$("highlightEntities", "Parameter must be an array of strings.", "EFP000400");
return;
}
let { boothExternalIds: t, exhibitorExternalIds: n } = _t(e);
b.boothStore.highlightedByExternalIds = [...t], b.exhibitorStore.highlightedByExternalIds = [...n];
}
selectRoute(e, t) {
if (Array.isArray(e)) {
let t = [...e], n = t.shift(), r = t.pop();
if (t.length > 8) throw Error("The maximum number of waypoints is 8.");
if (!n || !r) {
$("selectRoute", "Invalid route format: When providing an array, it must include at least two points: a start and a destination.", "EFP000401");
return;
}
let i = t.map(Z).filter((e) => e !== null);
b.routeStore.selectRoute(new O(Z(n), Z(r), i));
return;
}
e || $("selectRoute", "At a minimum, the starting point must be passed.", "EFP000402"), b.routeStore.selectRoute(new O(Z(e), t ? Z(t) : null));
}
getOptimizedRoutes(e) {
if (!Array.isArray(e)) return $("getOptimizedRoutes", "Parameter must be an array.", "EFP000500"), [];
if (e.length > 8) throw Error("The maximum number of waypoints is 8.");
let t = e.map(Z).filter((e) => !!e);
if (!t.length) throw Error("No booths found for the provided waypoints.");
let n = /* @__PURE__ */ new Map();
for (let e of t) {
var r, i;
let t = (r = (i = e.layer) == null ? void 0 : i.name) == null ? "" : r, a = n.get(t);
a ? a.push(e) : n.set(t, [e]);
}
return Array.from(n.values()).map((e) => ({ waypoints: lt(e.map((e) => [e.name, {
x: e.rect.center.x,
y: e.rect.center.y
}])) }));
}
selectCurrentPosition(e, t, n) {
var r;
let i = T(e.x) && T(e.y), a = T(e.lng) && T(e.lat);
if (!i && !a) {
$("selectCurrentPosition", "A point must be passed. Either (x,y) or (lat,lng) are required.", "EFP000600");
return;
}
b.routeStore.selectCurrentPosition(e, t, n), (r = this.onCurrentPositionChanged) == null || r.call(this, e);
}
setBookmarks(e) {
if (!Array.isArray(e) || !e.length) {
$("setBookmarks", "Parameter must be an array.", "EFP000700");
return;
}
e.forEach((e) => {
let t = b.exhibitorStore.exhibitors.find((t) => t.name === e.name || t.externalId === e.externalId);
t && (t.bookmarked = e.bookmarked);
});
}
setEntitiesBookmarks(e) {
if (!Array.isArray(e) || !e.length) {
$("setEntitiesBookmarks", "Parameter must be an array.", "EFP000701");
return;
}
let t = [
"exhibitor",
"event",
"speaker",
"booth"
], n = e.find((e) => !e.type || !t.includes(e.type));
if (n) {
$("setEntitiesBookmarks", `Invalid entity type: ${n.type}. Must be one of: ${t.join(", ")}.`, "EFP000702");
return;
}
let r = rt("bookmarked"), i = {
exhibitor: {
existingIds: new Set(r.exhibitors || []),
finder: (e) => b.exhibitorStore.findExhibitor(e),
replacer: (e) => b.exhibitorStore.replaceBookmarked(e)
},
event: {
existingIds: new Set(r.events || []),
finder: (e) => b.eventStore.findByNameOrSlug(e),
replacer: (e) => b.eventStore.replaceBookmarked(e)
},
speaker: {
existingIds: new Set(r.speakers || []),
finder: (e) => b.speakerStore.speakers.find((t) => t.name === e || t.externalId === e || t.slug === e),
replacer: (e) => b.speakerStore.replaceBookmarked(e)
},
booth: {
existingIds: new Set(r.booths || []),
finder: (e) => {
let t = b.boothStore.findBooth(e);
return (t == null ? void 0 : t.exhibitors.length) === 0 ? t : void 0;
},
replacer: (e) => b.boothStore.replaceBookmarked(e)
}
};
e.forEach((e) => {
let t = i[e.type], n = e.name || e.externalId || "", r = t.finder(n);
r ? e.bookmarked ? t.existingIds.add(r.id) : t.existingIds.delete(r.id) : console.warn(`Entity not found: ${e.type} with query "${n}"`);
}), Object.values(i).forEach((e) => {
e.replacer(Array.from(e.existingIds));
});
}
setEntitiesVisited(e) {
if (!Array.isArray(e) || !e.length) {
$("setEntitiesVisited", "Parameter must be an array.", "EFP000703");
return;
}
let t = ["exhibitor", "event"], n = e.find((e) => !e.type || !t.includes(e.type));
if (n) {
$("setEntitiesVisited", `Invalid entity type: ${n.type}. Must be one of: ${t.join(", ")}.`, "EFP000704");
return;
}
let r = rt("visited"), i = {
exhibitor: {
existingIds: new Set(r.exhibitors || []),
finder: (e) => b.exhibitorStore.findExhibitor(e),
replacer: (e) => b.exhibitorStore.replaceVisited(e)
},
event: {
existingIds: new Set(r.events || []),
finder: (e) => b.eventStore.findByNameOrSlug(e),
replacer: (e) => b.eventStore.replaceVisited(e)
}
};
e.forEach((e) => {
let t = i[e.type], n = e.name || e.externalId || "", r = t.finder(n);
r ? e.visited ? t.existingIds.add(r.id) : t.existingIds.delete(r.id) : console.warn(`Entity not found: ${e.type} with query "${n}"`);
}), Object.values(i).forEach((e) => {
e.replacer(Array.from(e.existingIds));
});
}
setMarkers(e) {
if (!e || !Array.isArray(e.icons) || !Array.isArray(e.markers)) {
$("setMarkers", "Invalid input.", "EFP000800");
return;
}
b.routeStore.setMarkers(e);
}
selectMarker(e, t = !0) {
return typeof e != "string" && $("selectMarker", "The identifier must be passed.", "EFP000900"), b.routeStore.selectMarker(e, t);
}
drawCircles(e) {
if (!Array.isArray(e)) {
$("drawCircles", "Invalid input.", "EFP000A00");
return;
}
b.uiState.debugCircles = e;
}
checkRoutes() {
b.routeStore.checkRoutes();
}
updateLayerVisibility(e, t) {
typeof e != "string" && $("updateLayerVisibility", "The layer name (string) must be passed.", "EFP000B00"), t || $("updateLayerVisibility", "Passing a false value to visible will have no effect.", "EFP000B01"), b.layerStore.updateVisibility(e, t);
}
getCenterCoordinates() {
return b.fp.getCenterCoordinates();
}
exhibitorsList() {
return b.exhibitorStore.exhibitors.map((e) => K(e));
}
boothsList() {
return b.boothStore.booths.map((e) => K(e));
}
categoriesList() {
return b.categoryStore.categories.map((e) => K(e));
}
selectCategory(e) {
if (e == null || typeof e != "string") {
b.searchStore.selectSearch();
return;
}
let t = e == null ? void 0 : e.toLowerCase(), n = b.categoryStore.categories.find(({ name: e, slug: n }) => (e == null ? void 0 : e.toLowerCase()) === t || (n == null ? void 0 : n.toLowerCase()) === t);
if (!n) {
$("selectCategory", `Category ${e} not found.`, "EFP000C01");
return;
}
b.selectCategory(n);
}
select(e) {
if (typeof e != "string") {
$("select", "Parameter must be a string.", "EFP001700");
return;
}
let t = e, n = t == null ? void 0 : t.toLowerCase(), r = b.boothStore.booths.find((e) => {
var t, r, i;
return ((t = e.slug) == null ? void 0 : t.toLowerCase()) === n || ((r = e.externalId) == null ? void 0 : r.toLowerCase()) === n || ((i = e.externalId) == null || (i = i.toLowerCase()) == null ? void 0 : i.replace(/\s+/g, "")) === n;
});
if (r) {
setTimeout(() => b.selectBooth(r), 250);
return;
}
let i = b.eventStore.eventItems.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 (i) {
b.selectEventItem(i, !0);
return;
}
let a = b.exhibitorStore.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 (a) {
setTimeout(() => b.clickExhibitor(a), 250);
return;
}
let o = b.categoryStore.categories.find((e) => e.slug === t);
if (o) {
b.selectCategory(o);
return;
}
let s = b.speakerStore.findBySlug(t);
if (s) {
b.selectSpeaker(s, !0);
return;
}
t.includes("heatmap=true") || b.searchStore.selectSearch(t);
}
showList(e) {
let t = {
bookmarks: () => b.selectBookmarks(),
visited: () => b.selectVisited(),
sessions: () => b.selectSessions(),
exhibitors: () => b.selectExhibitors(),
speakers: () => b.selectSpeakers(),
tours: () => b.selectTours(),
language: () => b.selectLanguage()
}, n = t[e];
if (!n) {
$("showList", `Unknown list "${e}". Must be one of: ${Object.keys(t).join(", ")}.`, "EFP001800");
return;
}
n();
}
showSessions(e = {}) {
X("showSessions called with filters=%O", e);
let t = le.safeParse(e);
if (!t.success) {
$("showSessions", t.error.message, "EFP001C00");
return;
}
let n = t.data, { eventStore: r, sessionsFilterStore: i } = b;
Ge(() => {
var e, t, a, o;
x.details = null, b.selectSessions(), i.closeFilter(), i.setPending("selectedTracks", wn(n.tracks, r.tracks, "track")), i.setPending("selectedVenues", wn(n.venues, r.venues, "venue")), i.setPending("date", (e = n.date) == null ? "all" : e), i.setPending("timeOfDay", (t = n.time) == null ? "all" : t), i.setPending("showBookmarksOnly", (a = n.bookmarked) != null && a), i.setPending("showLiveOnly", (o = n.live) != null && o), i.commitFilters();
});
}
selectTour(e) {
if (typeof e != "string" || !e) {
$("selectTour", "A tour id must be passed.", "EFP001900");
return;
}
let t = b.toursStore.getTourById(e);
t ? b.toursStore.launchTour(t, t.name, t.description) : (console.warn(`Route with id "${e}" not found`), b.selectTours());
}
openPlanner(e = {}) {
if (typeof e != "object" || !e) {
$("openPlanner", "An options object must be passed.", "EFP001A00");
return;
}
let t = e.from ? D(e.from) : null;
if (e.fromBookmarks) b.routePlannerStore.launchFromBookmarks(t == null ? void 0 : t);
else {
var n;
b.routePlannerStore.launchFromSlugs((n = e.items) == null ? [] : n, t == null ? void 0 : t);
}
}
startBuildRoute() {
b.uiState.startBuildRoute();
}
applyParameters(e) {
typeof e != "string" && $("applyParameters", "A query string must be passed.", "EFP000D00"), on(e);
}
getVisibility() {
return b.uiState.visibility;
}
setVisibility(e) {
(typeof e != "object" || !Object.keys(e).length) && $("setVisibility", "The parameter must be passed.", "EFP000E00"), b.uiState.setVisibility(e);
}
findLocation() {
b.routeStore.findLocation();
}
zoomIn() {
b.uiState.zoomIn();
}
zoomOut() {
b.uiState.zoomOut();
}
switchView() {
b.maplibreStore.activateMaplibre();
}
setCamera(e) {
X("setCamera called with camera=%O", e);
let t = Ce.safeParse(e);
if (!t.success) {
$("setCamera", t.error.message, "EFP001B00");
return;
}
b.uiState.setMapSettings(y(t.data));
}
getCamera() {
return qe(b.uiState.mapSettings);
}
zoomTo(e, t) {
X("zoomTo called with selectors=%O options=%O", e, t);
let n = Qt.safeParse(e);
if (!n.success) {
$("zoomTo", n.error.message, "EFP001600");
return;
}
let r = $t.safeParse(t);
if (!r.success) {
$("zoomTo", r.error.message, "EFP001601");
return;
}
let i = this.getBounds(e);
i && this.fitBounds(i, t);
}
getBounds(e) {
var t, n;
X("getBounds called with selectors=%O", e);
let r = Qt.safeParse(e);
if (!r.success) {
$("getBounds", r.error.message, "EFP001400");
return;
}
let i = [];
if ((t = e.booths) == null || t.forEach((e) => {
let t;
e.externalId ? t = b.boothStore.boothByExternalId.get(e.externalId) : e.name && (t = b.boothStore.boothByName.get(e.name.toLowerCase())), t != null && t.rect && i.push(t.rect);
}), (n = e.exhibitors) == null || n.forEach((e) => {
var t;
let n;
e.externalId ? n = b.exhibitorStore.exhibitorByExternalId.get(e.externalId) : e.name && (n = b.exhibitorStore.exhibitorByName.get(e.name.toLowerCase())), n == null || (t = n.booths) == null || t.forEach((e) => {
e.rect && i.push(e.rect);
});
}), i.length === 0) return;
let a = S.fromUnion(...i);
return {
leftTop: {
x: a.min.x,
y: a.min.y
},
rightBottom: {
x: a.max.x,
y: a.max.y
}
};
}
fitBounds(e, t) {
if (X("fitBounds called with bounds=%O options=%O", e, t), !e) {
b.uiState.fitBounds();
return;
}
let n = Xt.safeParse(e);
if (!n.success) {
$("fitBounds", n.error.message, "EFP001500");
return;
}
let r = $t.safeParse(t);
if (!r.success) {
$("fitBounds", r.error.message, "EFP001501");
return;
}
let i = S.fromMinMax({
x: e.leftTop.x,
y: e.leftTop.y
}, {
x: e.rightBottom.x,
y: e.rightBottom.y
});
b.uiState.moveToRect = t != null && t.padding ? i.expand(t.padding) : i;
}
getBoothRect(e) {
var t;
if (typeof e != "string") {
$("getBoothRect", "A booth name must be passed.", "EFP000F00");
return;
}
let n = (t = D(e)) == null ? void 0 : t.rect;
return n ? Tn.fromBox(n) : void 0;
}
convertToGeo(e, t) {
var n;
let r = (n = E()) == null || (n = n.properties) == null ? void 0 : n.config;
if (!r) {
$("convertToGeo", "The coordinates cannot be converted because the GPS configuration is not defined.", "EFP001000");
return;
}
if (!e || !t) {
$("convertToGeo", "Both coordinates must be passed.", "EFP001001");
return;
}
return ct(e, t, r);
}
getGeoConfig() {
var e, t;
let n = (e = E()) == null || (e = e.properties) == null ? void 0 : e.config;
return n ? {
bearing: (t = n.bearing) == null ? 0 : t,
p0: n.p0,
p1: n.p1,
p2: n.p2
} : null;
}
releaseResources() {
var e;
b.maplibreStore.dispose(), (e = this.root) == null || e.unmount(), super.releaseResources();
}
search(e) {
return typeof e == "string" ? b.fuzzySearchEngineStore.loadEngine().then(() => (b.searchStore.selectSearch(e), b.uiState.fuzzySearchItems.map((e) => ({
item: K(e.item),
score: e.score
})))) : ($("search", "A search string must be passed.", "EFP001100"), Promise.resolve([]));
}
getFloors() {
return b.layerStore.floors.map((e) => ({
name: e.name,
shortName: e.shortName,
description: e.description,
active: e.active,
disabled: e.disabled,
index: e.index
}));
}
activateFloor(e) {
if (!(e != null && e.name) && (e == null ? void 0 : e.index) == null) {
$("activateFloor", "Invalid floorId. It must contain either a name or an index.", "EFP001200");
return;
}
let t = this.getFloors();
if (e.name) {
let n = t.find((t) => t.name === e.name || t.shortName === e.name);
if (!n) {
$("activateFloor", `Floor with name "${e.name}" not found.`, "EFP001201");
return;
}
if (n.active) return;
this.updateLayerVisibility(n.name, !0);
return;
}
if (e.index !== null) {
let n = t.find((t) => t.index === e.index), r = n == null ? void 0 : n.name;
if (!r) {
$("activateFloor", `Floor at index ${e.index} does not exist.`, "EFP001203");
return;
}
if (n.active) return;
this.updateLayerVisibility(r, !0);
return;
}
}
showPathway(e, t) {
let { boothExternalIds: n, exhibitorExternalIds: r } = t != null && t.length ? _t(t) : {
boothExternalIds: [],
exhibitorExternalIds: []
};
un({
pathwayId: e,
boothIds: n,
exhibitorIds: r
});
}
showPathwayOnly(e, t) {
var n;
this.activateFloor({ name: t }), b.layerStore.showPathWay(e), b.uiState.setPathwayOnlyMode(!0);
let r = b.layerStore.findLayer(e), i = b.layerStore.findLayer(t), a = r != null && r.rect || r != null && r.viewbox ? r : i, o = (n = a == null ? void 0 : a.viewbox) == null ? a == null ? void 0 : a.rect : n;
o && (b.uiState.moveToRect = o.clone());
}
hidePathways() {
this.highlightBooths([]), b.layerStore.hidePathways(), b.uiState.setPathwayOnlyMode(!1);
}
showSearch() {
b.selectSearch("");
}
changeLanguage(e) {
var t;
let n = e == null || (t = e.toLowerCase) == null ? void 0 : t.call(e);
if (!Te(n)) {
$("changeLanguage", `Language "${e}" was not found. Available languages: ${xe().map((e) => e.id).join(",")}`, "EFP001300");
return;
}
Se(n);
}
isGpsTrackingEnabled() {
return b.routeStore.gpsEnabled;
}
setGpsTrackingEnabled(e) {
b.routeStore.setGpsTrackingEnabled(e);
}
deselectCurrentPosition() {
b.routeStore.selectCurrentPosition(null, !1);
}
deselectRoute() {
b.routeStore.selectRoute(null), b.routeStore.setOnlyAccessible(!1);
}
reset() {
if (this.selectBooth(""), this.selectExhibitor(""), this.selectCategory(), this.deselectCurrentPosition(), this.deselectRoute(), this.highlightEntities([]), b.uiState.kioskData && b.resetCameraFn) {
var e;
(e = b.resetCameraFn) == null || e.call(b);
} else this.fitBounds();
}
selectAccessibleRoute(e) {
b.routeStore.setOnlyAccessible(!0), this.selectRoute(e);
}
};
function wn(e = [], t, n) {
let r = /* @__PURE__ */ new Set();
for (let o of e) {
var i, a;
let e = o.toLowerCase(), s = (i = (a = t.find((e) => String(e.id) === o)) == null ? t.find((t) => {
var n;
return ((n = t.externalId) == null ? void 0 : n.toLowerCase()) === e;
}) : a) == null ? t.find((t) => {
var n, r;
return ((n = t.name) == null ? void 0 : n.toLowerCase()) === e || ((r = t.slug) == null ? void 0 : r.toLowerCase()) === e;
}) : i;
s ? r.add(s.id) : console.warn(`Entity not found: ${n} with query "${o}"`);
}
return [...r];
}
function Z(e) {
let t = typeof e == "string" ? D(e) : b.routeStore.getNearestBooth(e);
return t == null ? null : t;
}
var Q = 0;
function $(e, t, n) {
let r = `Error calling "${e}" SDK method.`, i = `${t.endsWith(".") ? t : t + "."} More information at`, a = "https://js-sdk.expofp.com/api/packages";
if (n && (a += `#error-${n}`), console.error(`${r} ${i} ${a}`), b.fp.disableRuntimeAlerts) return;
b.uiState.setGlobalErrorMessage({
title: r,
body: /* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [
i,
" ",
/* @__PURE__ */ (0, Y.jsx)("a", {
href: a,
target: "_blank",
rel: "noreferrer",
children: a
})
] })
}), clearTimeout(Q);
let o = 8e3;
Q = window.setTimeout(() => {
let e = async () => {
b.uiState.globalErrorMessages.length > 0 && (b.uiState.popGlobalErrorMessage(), await new Promise((e) => setTimeout(e, o / 2)), e());
};
e();
}, o);
}
var Tn = class e {
get h() {
return Math.abs(this.y2 - this.y1);
}
get w() {
return Math.abs(this.x2 - this.x1);
}
get cx() {
return (this.x1 + this.x2) / 2;
}
get cy() {
return (this.y1 + this.y2) / 2;
}
constructor(e, t, n, r) {
if (this.x1 = void 0, this.y1 = void 0, this.x2 = void 0, this.y2 = void 0, e > n) {
let t = e;
e = n, n = t;
}
if (t > r) {
let e = t;
t = r, r = e;
}
this.x1 = e, this.y1 = t, this.x2 = n, this.y2 = r;
}
static fromBox(t) {
return new e(t.min.x, t.min.y, t.max.x, t.max.y);
}
static fromCxcywh(t, n, r, i) {
return new e(t - r / 2, n - i / 2, t + r / 2, n + i / 2);
}
contains(e) {
return e.x1 >= this.x1 && e.x2 <= this.x2 && e.y1 >= this.y1 && e.y2 <= this.y2;
}
intersects(e) {
let t = Math.max(this.x1, e.x1), n = Math.min(this.x2, e.x2), r = Math.max(this.y1, e.y1), i = Math.min(this.y2, e.y2);
return n >= t && i >= r;
}
getIntersection(t) {
let n = Math.max(this.x1, t.x1), r = Math.min(this.x2, t.x2), i = Math.max(this.y1, t.y1), a = Math.min(this.y2, t.y2);
return r >= n && a >= i ? new e(n, i, r, a) : new e(0, 0, 0, 0);
}
getRotated90() {
return e.fromCxcywh(this.cx, this.cy, this.h, this.w);
}
normalize(t, n) {
return new e(this.x1 / t, this.y1 / n, this.x2 / t, this.y2 / n);
}
withPadding(t, n = t) {
return this.w < t * 2 || this.h < n * 2 ? this : e.fromCxcywh(this.cx, this.cy, this.w - t * 2, this.h - n * 2);
}
scale(t) {
return new e(this.x1 * t, this.y1 * t, this.x2 * t, this.y2 * t);
}
getArea() {
return this.w * this.h;
}
clone() {
return new e(this.x1, this.y1, this.x2, this.y2);
}
translate(e, t) {
return this.x1 += e, this.x2 += e, this.y1 += t, this.y2 += t, this;
}
equals(e) {
return e.x1 === this.x1 && e.x2 === this.x2 && e.y1 === this.y1 && e.y2 === this.y2;
}
toString() {
return this.x1 + "," + this.y1 + "," + this.w + "," + this.h;
}
containsPoint(e, t) {
return e >= this.x1 && e <= this.x2 && t >= this.y1 && t <= this.y2;
}
};
//#endregion
export { Cn as default };