UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

1,285 lines (1,284 loc) • 42.6 kB
(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] = "b5bae47c-00fd-4f83-8cb7-29f489540076", e._sentryDebugIdIdentifier = "sentry-dbid-b5bae47c-00fd-4f83-8cb7-29f489540076"); } catch {} })(); import { r as e } from "./rolldown-runtime-BOCG9HEF.js"; import { a as t, c as n, i as r, l as i, n as a, o, r as s, s as c, t as l } from "./floorplan.loader-DNLxyDic.js"; import { At as u, Bt as d, Ct as f, Dt as ee, Et as te, Ft as ne, It as re, K as ie, Lt as ae, Mt as oe, Nt as se, Ot as ce, Pt as le, Rt as p, St as ue, Tt as de, U as fe, W as pe, _t as me, bt as he, et as ge, f as _e, ft as m, ht as ve, jt as ye, kt as be, l as xe, lt as h, mt as Se, n as Ce, o as we, pt as Te, r as Ee, rt as De, ut as Oe, v as ke, vt as Ae, w as g, wt as je, xt as Me, y as Ne, zt as _ } from "./i18n-BVE2kS7w.js"; import { s as Pe } from "./efp-debug-init-DfQX41Dz.js"; import { t as Fe } from "./react-CM7l092i.js"; import { t as Ie } from "./jsx-runtime-BGutO_I9.js"; import { r as Le } from "./loadImage-B-6VhOfG.js"; import { n as v, t as Re } from "./is-own-domain-B64uVROp.js"; import { C as y, D as ze, Q as Be, ht as b, i as Ve, n as He, w as Ue } from "./exports-gWa75nmY.js"; import { t as We } from "./client-BtPJvi_3.js"; import { i as Ge, n as Ke, r as x, t as qe } from "./components-DMOhc6ZZ.js"; import { An as S, At as Je, C, E as Ye, En as Xe, G as Ze, H as Qe, J as $e, N as et, P as w, Q as tt, Rn as nt, S as rt, T, U as E, V as D, Z as it, at, c as O, ct as ot, dn as st, dt as ct, fn as k, gn as lt, hn as A, it as ut, j as dt, l as j, lt as ft, nt as pt, ot as M, q as N, rt as mt, sn as P, tt as F, ut as ht, w as gt, wn as _t, y as vt } from "./store-CARxK2Ft.js"; import { n as yt, t as bt } from "./integrateKiosk-bnGUsf7Q.js"; //#region ../../node_modules/.pnpm/@sentry+browser@10.69.0/node_modules/@sentry/browser/build/npm/esm/prod/report-dialog.js function I(e = {}) { let n = r.document, i = (n == null ? void 0 : n.head) || (n == null ? void 0 : n.body); if (!i) { s && b.error("[showReportDialog] Global document not defined"); return; } let a = Ue(), o = y(), c = o == null ? void 0 : o.getDsn(); if (!c) { s && b.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 L = /* @__PURE__ */ e(Fe()); function xt(e) { let t = e.match(/^([^.]+)/); return t !== null && parseInt(t[0]) >= 17; } function St(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 Ct(e, { componentStack: t }, n) { if (xt(L.version) && Be(e) && t) { let n = Error(e.message); n.name = `React ErrorBoundary ${e.name}`, n.stack = t, St(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 wt = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, R = { componentStack: null, error: null, eventId: null }, Tt = class extends L.Component { constructor(e) { super(e), this.state = R, this._openFallbackReportDialog = !0; let t = y(); t && e.showDialog && (this._openFallbackReportDialog = !1, this._cleanupHook = t.on("afterSendEvent", (t) => { !t.type && this._lastEventId && t.event_id === this._lastEventId && I({ ...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 = Ct(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 && I({ ...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 === R ? 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(R); } 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" ? L.createElement(e, { error: n.error, componentStack: n.componentStack, resetError: () => this.resetErrorBoundary(), eventId: n.eventId }) : e; return L.isValidElement(r) ? r : (e && wt && b.warn("fallback did not produce a valid ReactElement"), null); } }, Et = /* @__PURE__ */ e(Pe(), 1), Dt = We(), Ot = nt(); function kt() { let e = window.location.hostname.split("."); return e.length >= 3 && e[e.length - 2] === "expofp" && e[e.length - 1] === "com"; } function At() { return kt() ? window.location.hostname.split(".")[0] : "main"; } function jt(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 Mt() { return !1; } function Nt(e) { return e; } function Pt(e) { if (Mt() || !kt() || ct(e) || !window.navigator.onLine) return null; let t = Nt({ subDomain: At(), subscriptionStatus: jt(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 z = /*@__PURE__*/ _("ZodMiniType", (e, t) => { if (!e._zod) throw Error("Uninitialized schema in ZodMiniType."); ye.init(e, t), e.def = t, e.type = t.type, e.parse = (t, n) => oe(e, t, n, { callee: e.parse }), e.safeParse = (t, n) => le(e, t, n), e.parseAsync = async (t, n) => se(e, t, n, { callee: e.parseAsync }), e.safeParseAsync = async (t, n) => ne(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) => re(e, t, n), e.brand = () => e, e.register = ((t, n) => (t.add(e, n), e)), e.apply = (t) => t(e); }), Ft = /*@__PURE__*/ _("ZodMiniString", (e, t) => { u.init(e, t), z.init(e, t); }); // @__NO_SIDE_EFFECTS__ function It(e) { return f(Ft, e); } var Lt = /*@__PURE__*/ _("ZodMiniNumber", (e, t) => { ee.init(e, t), z.init(e, t); }); // @__NO_SIDE_EFFECTS__ function B(e) { return Me(Lt, e); } var Rt = /*@__PURE__*/ _("ZodMiniNever", (e, t) => { te.init(e, t), z.init(e, t); }); // @__NO_SIDE_EFFECTS__ function zt(e) { return he(Rt, e); } var Bt = /*@__PURE__*/ _("ZodMiniArray", (e, t) => { je.init(e, t), z.init(e, t); }); // @__NO_SIDE_EFFECTS__ function Vt(e, t) { return new Bt({ type: "array", element: e, ...p(t) }); } var Ht = /*@__PURE__*/ _("ZodMiniObject", (e, t) => { ce.init(e, t), z.init(e, t), ae(e, "shape", () => t.shape); }); // @__NO_SIDE_EFFECTS__ function V(e, t) { return new Ht({ type: "object", shape: e, catchall: /* @__PURE__ */ zt(), ...p(t) }); } var Ut = /*@__PURE__*/ _("ZodMiniOptional", (e, t) => { be.init(e, t), z.init(e, t); }); // @__NO_SIDE_EFFECTS__ function H(e) { return new Ut({ type: "optional", innerType: e }); } var Wt = /*@__PURE__*/ _("ZodMiniCustom", (e, t) => { de.init(e, t), z.init(e, t); }); // @__NO_SIDE_EFFECTS__ function Gt(e, t = {}) { return ue(Wt, e, t); } //#endregion //#region src/schemas/sdk.schemas.ts var Kt = /* @__PURE__ */ V({ x: /* @__PURE__ */ B(), y: /* @__PURE__ */ B() }), qt = /* @__PURE__ */ V({ leftTop: Kt, rightBottom: Kt }), Jt = (/* @__PURE__ */ V({ name: /* @__PURE__ */ H(/* @__PURE__ */ It()), externalId: /* @__PURE__ */ H(/* @__PURE__ */ It()) })).check(/* @__PURE__ */ Gt((e) => !!(e.name || e.externalId), "Either name or externalId must be provided")), Yt = (/* @__PURE__ */ V({ booths: /* @__PURE__ */ H(/* @__PURE__ */ Vt(Jt)), exhibitors: /* @__PURE__ */ H(/* @__PURE__ */ Vt(Jt)) })).check(/* @__PURE__ */ Gt((e) => { var t, n; return !!((t = e.booths) != null && t.length || (n = e.exhibitors) != null && n.length); }, "Selector must contain booths or exhibitors")), Xt = /* @__PURE__ */ H(/* @__PURE__ */ V({ padding: /* @__PURE__ */ H(/* @__PURE__ */ B()) })); //#endregion //#region src/components/Kiosk/recoverKioskFromUrlPrams.ts function Zt(e) { let t = vt(e); Object.values(t).length && (bt(t, !1), yt(t)); } //#endregion //#region src/utils/getMostFrequent.ts function Qt(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 $t(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 && !m(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 U = !1; function en() { K(d()), g(() => O.layerStore.layersLoaded, () => { let e = d().camera; Object.keys(e).length && vn(x(e)); let t = d().visibility; Object.keys(t).length && j.setVisibility(t); }); } function tn(e) { ut({ offHistory: e, onNavigate: G }), sn(), W(), g(() => O.layerStore.layersLoaded, () => { O.urlFilterManager && !O.urlFilterManager.isInitialized && O.urlFilterManager.initialize(), G(), _e(_n), _e(hn), j.viewerMode && (j.menu = !0); }); } function nn(e = "") { M("?" + m(e.toString())), O.layerStore.layersLoaded ? rn(e) : (W(), g(() => O.layerStore.layersLoaded, () => rn(e))); } function rn(e) { var t, n; let r = "?" + m(e), a = dn(r), o = [...(t = a.intents) == null ? [] : t, ...Se(r).intents], { intents: s = [], ...c } = Te(r, { visibility: a.visibility, consent: a.consent, intents: o }); K(a), K(c); let l = (n = a.consent) == null ? c.consent : n; l && $e(l), a.camera && Object.keys(a.camera).length && vn(x(a.camera)), a.visibility && Object.keys(a.visibility).length && j.setVisibility(a.visibility), sn(), G(); let u = [...o, ...s]; u.length && i(O.fp, u); } function W() { let e = F(); return Ke(e.length > 1 ? m(e.substring(1)) : ""); } function G() { U = !0; try { Zt(new URLSearchParams(m(window.location.search))); let { primary: e } = h(F()), t = e.type === "select" && (!e.slug || /^t=[^&]*$/.test(e.slug)) && (j.heatmap || j.heatmapYah); !W() && !t && an(e); } finally { U = !1; } hn(), _n(); } function an(e) { let t = O.fp; switch (e.type) { case "kiosk": e.enabled !== null && ht(j, e.enabled); return; case "list": t.showList(e.list); return; case "tour": t.selectTour(e.tourId); return; case "planner": t.openPlanner({ items: e.items, from: e.from, fromBookmarks: e.fromBookmarks }); return; case "route": var n, r; O.routeStore.setOnlyAccessible(e.accessible), O.routeStore.selectRoute(gt((n = e.from) == null ? "" : n, (r = e.to) == null ? "" : r, e.waypoints)), O.uiState.setIsMultiPointRoute(e.waypoints.length > 0), e.title && O.uiState.setRouteTitle(e.title); return; case "selectExhibitors": setTimeout(() => t.selectExhibitor(e.values), 250); return; case "ownedByFilters": Le.log("Skipping filter parameters in dispatchFromUrl (owned by URLFilterManager)"); return; case "ownedByConfig": return; case "select": t.select(e.slug); return; } } function on(e) { let { pathwayId: t, boothIds: n, exhibitorIds: r } = e, i = O.boothStore.booths.filter((e) => n.includes(e.externalId)), a = O.exhibitorStore.exhibitors.filter((e) => r.includes(e.externalId)).flatMap((e) => e.booths), o = [...i, ...a]; if (lt()) { let e = Qt(o.map((e) => e.layer.name)); e && O.fp.activateFloor({ name: e }); } (n.length > 0 || r.length > 0) && O.fp.highlightEntities([...n, ...r]), O.layerStore.showPathWay(t), o.length > 0 && Ne(() => { O.uiState.moveToRect = S.fromUnion(...o.map((e) => e.rect).filter(Boolean)), O.uiState.rollReset = !0; }); } function sn() { let { oneShots: e } = h(F()); for (let t of e) cn(t); let t = Qe(F()); t !== null && M("?" + t), j.previewExhibitor && M("?" + j.previewExhibitor.slug), un(); } function cn(e) { switch (e.type) { case "heatmap": ln(e.yah); return; case "blueDot": { var t, n; let r = new rt(e.x, e.y, (t = O.layerStore.findLayer((n = e.layer) == null ? "" : n)) == null ? void 0 : t.name, void 0, e.lat, e.lng); g(() => O.layerStore.layersLoaded, () => O.routeStore.selectCurrentPosition(r, !0, 1)); return; } case "viewerMode": xe && (e.enabled ? localStorage.setItem(De, "true") : (localStorage.removeItem(De), localStorage.removeItem(ie))); return; case "previewMode": xe && (e.enabled ? localStorage.setItem(ge, "true") : (localStorage.removeItem(ge), localStorage.removeItem(pe))); return; case "uiScale": e.scale === null ? Le.warn(`Invalid ui-scale parameter: ${e.raw}. Must be a number between 0.8 and 1.4.`) : O.uiState.setUIScale(e.scale, !0); return; case "resetUiScale": O.uiState.resetUIScale(); return; } } function ln(e) { mt(), e ? (j.heatmapYah = !0, j.monochrome = !0, j.hideLogoInBooth = !0, j.hideHeaderLogo = !0, j.disableBookmarked = !0) : j.heatmap = !0; } function un() { let e = $t(F(), (e) => { let t = O.exhibitorStore.exhibitors.find((t) => t.slug === e || t.externalId === e); return t == null ? void 0 : t.name; }); e !== null && M(e); } function K(e) { e.noOverlay !== void 0 && (j.hideOverlay = e.noOverlay), e.monochrome && (j.monochrome = !0), e.hideHeaderLogo && (j.hideHeaderLogo = !0), e.hideLogoInBooth && (j.hideLogoInBooth = !0), e.disableFeatured && O.exhibitorStore.exhibitors.forEach((e) => e.featured = !1), e.disableBookmarked && (j.disableBookmarked = !0), e.disableGps && O.routeStore.setGpsTrackingEnabled(!1), e.heatmap && a(e.heatmap) && ln(e.heatmap.variant === "yah"); } function dn(e) { return ve(me, e).value; } var fn = null, pn = null, mn = null; function hn() { let { selection: e, exhibitor: t, booth: n, eventItem: r } = gn(), i = O.urlFilterManager.filterSearch(); if (U) return; let a = Oe(e) || i; F() !== a && (t !== fn || n !== pn || r !== mn ? at(a) : M(a), fn = t, pn = n, mn = r); } function gn() { let e = j.selectedExhibitor, t = j.selectedBooth, n = j.selectedEventItem, r = j.selectedRoute, i = j.selectedSpeaker, a = j.setKioskModeEnabled, o = j.list, s; if (o.type === "route-planner" && !e && !t && !n) { var c; let e = O.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 && !j.isMultiPointRoute) { var l; s = { type: "route", to: r.to instanceof k ? r.to.slug : void 0, from: r.from instanceof k ? r.from.slug : void 0, accessible: O.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 = j.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 _n() { var e; if (!Re) return; let t = j.selectedExhibitor, n = j.selectedEventItem, r = j.selectedSpeaker, i = ""; t ? i = t.name : n ? i = n.name : r ? i = r.name : j.list.type === "search" && j.list.text ? i = "`" + (j.list.text || "") + "`" : j.list.type === "multi-point-tour" && j.tourTitle && (i = j.tourTitle), i.length && (i += " – "), i += (e = o(Xe, v)) == null ? c(window.location.hostname, v) : e, document.title = i; } function vn(e) { try { if (j.setMapSettings(e), e.z) { let t = O.layerStore.layers.find((t) => t.name === e.z); t && O.layerStore.updateVisibility(t, !0); } } catch (e) { console.error("Failed to process map settings.", e); } } //#endregion //#region src/store/details-events.ts function yn() { return ke(() => j.details, () => { var e; if (!j.onDetails) return; if (!j.details) { j.onDetails(null); return; } let t = j.details; if (_t.EXPO === "wineparis" && (t instanceof P && (t = t.booths[0]), !t)) return; let n = null, r = []; if (t instanceof P) n = "exhibitor", r = t.booths.map((e) => e.name).sort((e, t) => { var n, r; return e == ((n = O.routeStore.tempToBooth) == null ? void 0 : n.name) ? -1 : +(t == ((r = O.routeStore.tempToBooth) == null ? void 0 : r.name)); }); else if (t instanceof k) n = "booth", r = [t.name]; else if (t instanceof C) { 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 st && (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 }; j.onDetails({ ...s, ...n === "route" ? { routeInfo: (e = O.routeStore.routeInfo) == null ? void 0 : e } : {} }); }); } //#endregion //#region src/utils/mapEntity.ts function q(e) { switch (e.entity.type) { case "booth": var t, n; return { id: e.id, name: Y(e.name), externalId: Y(e.externalId), isSpecial: e.entity.variant === "special", exhibitors: J(e.exhibitors), layer: { name: Y((t = e.layer) == null ? void 0 : t.name), description: Y((n = e.layer) == null ? void 0 : n.description) }, meta: e.meta, description: Y(e.description), entity: e.entity, title: Y(e.title) }; case "category": return { id: e.id, name: Y(e.name), exhibitors: J(e.exhibitors), entity: e.entity, slug: Y(e.slug) }; case "exhibitor": return { id: e.id, name: Y(e.name), externalId: Y(e.externalId), booths: J(e.booths), entity: e.entity, slug: Y(e.slug) }; case "schedule": return { id: e.id, externalId: Y(e.externalId), boothId: e.boothId, exhibitorId: e.exhibitorId, name: Y(e.name), description: Y(e.description), startDate: Y(e.startDate), endDate: Y(e.endDate), link: Y(e.link), entity: e.entity, isEnded: e.isEnded }; case fe: return { id: e.id, name: Y(e.name), entity: e.entity }; case "heatmap-yah": return { id: Y(e.id), name: Y(e.name), viewCount: e.viewCount || 0, x: e.x || 0, y: e.y || 0, z: e.z, entity: e.entity }; default: return e; } } function J(e) { return Array.isArray(e) ? e.filter(Boolean).map((e) => e.id).filter(Boolean) : []; } function Y(e) { return typeof e == "string" ? e : ""; } //#endregion //#region src/floorplan.ready.tsx var X = Ie(), Z = (0, Et.default)("efp:api"); (0, Ot.install)(); var bn = class extends l { constructor(...e) { super(...e), this.root = void 0, this.disposeDetailsEvents = void 0, this.disposeBoothHitTest = void 0; } init() { en(), this.ignoreQuery || tn(this.offHistory), tt("load"), ot(O), O.fp = this, this.disposeDetailsEvents = yn(), this.disposeBoothHitTest = Je(), $e(this.consent), N(E.Load, ""), this.root = (0, Dt.createRoot)(this.renderTarget), this.root.render(/* @__PURE__ */ (0, X.jsx)(Tt, { children: /* @__PURE__ */ (0, X.jsx)(qe, { offHistory: this.offHistory, consent: this.consent }) })), N(E.Rendered, ""), ke(() => O.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(), !O.initialized) { var n; (n = this.onInit) == null || n.call(this, this); } O.initialized = !0; }); let e = Pt(Xe); e && import("./bootIntercom-C-YBp0xT.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 = O.boothStore.booths.filter((t) => typeof e == "string" ? t.name === e || t.externalId === e : e.includes(t.name) || e.includes(t.externalId)); O.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)) { O.uiState.menu = !1, O.searchStore.resetSearchBox(), O.uiState.details = null; return; } let t = O.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") { O.selectExhibitor(t[0]), O.moveToList([t[0]]); return; } let n = Qt(t.flatMap((e) => e.booths.map((e) => e.layer)).map((e) => e.description)); n && O.layerStore.updateVisibility(n, !0), O.uiState.menu = !1, O.searchStore.resetSearchBox(), O.uiState.details = null, O.uiState.list = { type: "filter", items: t, query: { key: "exhibitors", value: t.map((e) => e.name).join(",") } }, O.moveToList(); } highlightExhibitors(e) { Array.isArray(e) || $("highlightExhibitors", "Parameter must be an array of strings.", "EFP000200"), O.boothStore.highlightedByExternalIds = [], O.exhibitorStore.highlightedByExternalIds = [...e]; } highlightBooths(e) { Array.isArray(e) || $("highlightBooths", "Parameter must be an array of strings.", "EFP000300"), O.exhibitorStore.highlightedByExternalIds = [], O.boothStore.highlightedByExternalIds = [...e]; } highlightEntities(e) { Array.isArray(e) || $("highlightEntities", "Parameter must be an array of strings.", "EFP000400"); let { boothExternalIds: t, exhibitorExternalIds: n } = Ye(e); O.boothStore.highlightedByExternalIds = [...t], O.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; } O.routeStore.selectRoute(new C(Q(n), Q(r), t.map(Q))); return; } e || $("selectRoute", "At a minimum, the starting point must be passed.", "EFP000402"), O.routeStore.selectRoute(new C(Q(e), Q(t))); } 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(Q).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: dt(e.map((e) => [e.name, { x: e.rect.center.x, y: e.rect.center.y }])) })); } selectCurrentPosition(e, t, n) { var r; let i = w(e.x) && w(e.y), a = w(e.lng) && w(e.lat); !i && !a && $("selectCurrentPosition", "A point must be passed. Either (x,y) or (lat,lng) are required.", "EFP000600"), O.routeStore.selectCurrentPosition(e, t, n), (r = this.onCurrentPositionChanged) == null || r.call(this, e); } setBookmarks(e) { (!Array.isArray(e) || !e.length) && $("setBookmarks", "Parameter must be an array.", "EFP000700"), e.forEach((e) => { let t = O.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 = A("bookmarked"), i = { exhibitor: { existingIds: new Set(r.exhibitors || []), finder: (e) => O.exhibitorStore.findExhibitor(e), replacer: (e) => O.exhibitorStore.replaceBookmarked(e) }, event: { existingIds: new Set(r.events || []), finder: (e) => O.eventStore.findByNameOrSlug(e), replacer: (e) => O.eventStore.replaceBookmarked(e) }, speaker: { existingIds: new Set(r.speakers || []), finder: (e) => O.speakerStore.speakers.find((t) => t.name === e || t.externalId === e || t.slug === e), replacer: (e) => O.speakerStore.replaceBookmarked(e) }, booth: { existingIds: new Set(r.booths || []), finder: (e) => { let t = O.boothStore.findBooth(e); return (t == null ? void 0 : t.exhibitors.length) === 0 ? t : void 0; }, replacer: (e) => O.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 = A("visited"), i = { exhibitor: { existingIds: new Set(r.exhibitors || []), finder: (e) => O.exhibitorStore.findExhibitor(e), replacer: (e) => O.exhibitorStore.replaceVisited(e) }, event: { existingIds: new Set(r.events || []), finder: (e) => O.eventStore.findByNameOrSlug(e), replacer: (e) => O.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; } O.routeStore.setMarkers(e); } selectMarker(e, t = !0) { return typeof e != "string" && $("selectMarker", "The identifier must be passed.", "EFP000900"), O.routeStore.selectMarker(e, t); } drawCircles(e) { Array.isArray(e) || $("drawCircles", "Invalid input.", "EFP000A00"), O.uiState.debugCircles = e; } checkRoutes() { O.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"), O.layerStore.updateVisibility(e, t); } getCenterCoordinates() { return O.fp.getCenterCoordinates(); } exhibitorsList() { return O.exhibitorStore.exhibitors.map((e) => q(e)); } boothsList() { return O.boothStore.booths.map((e) => q(e)); } categoriesList() { return O.categoryStore.categories.map((e) => q(e)); } selectCategory(e) { if (e == null || typeof e != "string") { O.searchStore.selectSearch(); return; } let t = e == null ? void 0 : e.toLowerCase(), n = O.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; } O.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 = O.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(() => O.selectBooth(r), 250); return; } let i = O.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) { O.selectEventItem(i, !0); return; } let a = O.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(() => O.clickExhibitor(a), 250); return; } let o = O.categoryStore.categories.find((e) => e.slug === t); if (o) { O.selectCategory(o); return; } let s = O.speakerStore.findBySlug(t); if (s) { O.selectSpeaker(s, !0); return; } t.includes("heatmap=true") || O.searchStore.selectSearch(t); } showList(e) { let t = { bookmarks: () => O.selectBookmarks(), visited: () => O.selectVisited(), sessions: () => O.selectSessions(), exhibitors: () => O.selectExhibitors(), speakers: () => O.selectSpeakers(), tours: () => O.selectTours(), language: () => O.selectLanguage() }, n = t[e]; if (!n) { $("showList", `Unknown list "${e}". Must be one of: ${Object.keys(t).join(", ")}.`, "EFP001800"); return; } n(); } selectTour(e) { if (typeof e != "string" || !e) { $("selectTour", "A tour id must be passed.", "EFP001900"); return; } let t = O.toursStore.getTourById(e); t ? O.toursStore.launchTour(t, t.name, t.description) : (console.warn(`Route with id "${e}" not found`), O.selectTours()); } openPlanner(e = {}) { if (typeof e != "object" || !e) { $("openPlanner", "An options object must be passed.", "EFP001A00"); return; } let t = e.from ? T(e.from) : null; if (e.fromBookmarks) O.routePlannerStore.launchFromBookmarks(t == null ? void 0 : t); else { var n; O.routePlannerStore.launchFromSlugs((n = e.items) == null ? [] : n, t == null ? void 0 : t); } } startBuildRoute() { O.uiState.startBuildRoute(); } applyParameters(e) { typeof e != "string" && $("applyParameters", "A query string must be passed.", "EFP000D00"), nn(e); } getVisibility() { return O.uiState.visibility; } setVisibility(e) { (typeof e != "object" || !Object.keys(e).length) && $("setVisibility", "The parameter must be passed.", "EFP000E00"), O.uiState.setVisibility(e); } findLocation() { O.routeStore.findLocation(); } zoomIn() { O.uiState.zoomIn(); } zoomOut() { O.uiState.zoomOut(); } switchView() { O.maplibreStore.activateMaplibre(); } setCamera(e) { Z("setCamera called with camera=%O", e); let t = Ae.safeParse(e); if (!t.success) { $("setCamera", t.error.message, "EFP001B00"); return; } O.uiState.setMapSettings(x(t.data)); } getCamera() { return Ge(O.uiState.mapSettings); } zoomTo(e, t) { Z("zoomTo called with selectors=%O options=%O", e, t); let n = Yt.safeParse(e); if (!n.success) { $("zoomTo", n.error.message, "EFP001600"); return; } let r = Xt.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; Z("getBounds called with selectors=%O", e); let r = Yt.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 = O.boothStore.boothByExternalId.get(e.externalId) : e.name && (t = O.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 = O.exhibitorStore.exhibitorByExternalId.get(e.externalId) : e.name && (n = O.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 (Z("fitBounds called with bounds=%O options=%O", e, t), !e) { O.uiState.fitBounds(); return; } let n = qt.safeParse(e); if (!n.success) { $("fitBounds", n.error.message, "EFP001500"); return; } let r = Xt.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 }); O.uiState.moveToRect = t != null && t.padding ? i.expand(t.padding) : i; } getBoothRect(e) { var t; typeof e != "string" && $("getBoothRect", "A booth name must be passed.", "EFP000F00"); let n = (t = T(e)) == null ? void 0 : t.rect; return n ? Sn.fromBox(n) : void 0; } convertToGeo(e, t) { var n; if (!(!(D == null || (n = D.properties) == null) && n.config)) { $("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 et(e, t, D.properties.config); } getGeoConfig() { var e, t; let n = D == null || (e = D.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, t; window.removeEventListener("error", n), (e = this.disposeDetailsEvents) == null || e.call(this), this.disposeDetailsEvents = void 0, (t = this.disposeBoothHitTest) == null || t.call(this), this.disposeBoothHitTest = void 0, O.maplibreStore.dispose(), pt(), ft(), Ze(), it(), this.root.unmount(), super.releaseResources(); } search(e) { return typeof e != "string" && $("search", "A search string must be passed.", "EFP001100"), O.fuzzySearchEngineStore.loadEngine().then(() => (O.searchStore.selectSearch(e), O.uiState.fuzzySearchItems.map((e) => ({ item: q(e.item), score: e.score })))); } getFloors() { return O.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 ? Ye(t) : { boothExternalIds: [], exhibitorExternalIds: [] }; on({ pathwayId: e, boothIds: n, exhibitorIds: r }); } showPathwayOnly(e, t) { this.activateFloor({ name: t }), O.layerStore.showPathWay(e), O.uiState.setPathwayOnlyMode(!0); let n = O.layerStore.findLayer(e), r = O.layerStore.findLayer(t), i = n != null && n.rect || n != null && n.viewbox ? n : r; if (i != null && i.rect || i != null && i.viewbox) { var a; let e = (a = i.viewbox) == null ? i.rect : a; O.uiState.moveToRect = e.clone(); } } hidePathways() { this.highlightBooths([]), O.layerStore.hidePathways(), O.uiState.setPathwayOnlyMode(!1); } showSearch() { O.selectSearch(""); } changeLanguage(e) { var t; let n = e == null || (t = e.toLowerCase) == null ? void 0 : t.call(e); if (!Ee(n)) { $("changeLanguage", `Language "${e}" was not found. Available languages: ${Ce().map((e) => e.id).join(",")}`, "EFP001300"); return; } we(n); } isGpsTrackingEnabled() { return O.routeStore.gpsEnabled; } setGpsTrackingEnabled(e) { O.routeStore.setGpsTrackingEnabled(e); } deselectCurrentPosition() { O.routeStore.selectCurrentPosition(null, !1); } deselectRoute() { O.routeStore.selectRoute(null), O.routeStore.setOnlyAccessible(!1); } reset() { if (this.selectBooth(""), this.selectExhibitor(""), this.selectCategory(), this.deselectCurrentPosition(), this.deselectRoute(), this.highlightEntities([]), O.uiState.kioskData && O.resetCameraFn) { var e; (e = O.resetCameraFn) == null || e.call(O); } else this.fitBounds(); } selectAccessibleRoute(e) { O.routeStore.setOnlyAccessible(!0), this.selectRoute(e); } }; function Q(e) { return typeof e == "string" ? T(e) : O.routeStore.getNearestBooth(e); } var xn = 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}`), O.fp.disableRuntimeAlerts) return; O.uiState.setGlobalErrorMessage({ title: r, body: /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [ i, " ", /* @__PURE__ */ (0, X.jsx)("a", { href: a, target: "_blank", rel: "noreferrer", children: a }) ] }) }), clearTimeout(xn); let o = 8e3; xn = window.setTimeout(() => { let e = async () => { O.uiState.globalErrorMessages.length > 0 && (O.uiState.popGlobalErrorMessage(), await new Promise((e) => setTimeout(e, o / 2)), e()); }; e(); }, o); } var Sn = 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 { bn as default };