@expofp/floorplan 3.0.0-alpha.11 → 3.0.0-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/{Debug-CdG24TNO.js → Debug-DfbBpzaA.js} +2 -2
- package/dist/browser/{Demo-orSDDEhp.js → Demo-9nX3Ze8t.js} +3 -3
- package/dist/browser/{Free-CVkfvG88.js → Free-CcNlU68J.js} +3 -3
- package/dist/browser/{Gallery-byAt942-.js → Gallery-BZojDfZ5.js} +3 -3
- package/dist/browser/{GpsLoader-Bdm0xIOk.js → GpsLoader-DtvpmRK_.js} +3 -3
- package/dist/browser/KioskStore-9CgKZ7_Y.js +216 -0
- package/dist/browser/{Mapbox-DloFGenX.js → Mapbox-DNt1naKj.js} +4 -4
- package/dist/browser/{SetKioskMode-CSGLnvuM.js → SetKioskMode-D-4L7JoE.js} +4 -4
- package/dist/browser/{ShowKiosk-DFZZ3UF3.js → ShowKiosk-ULNAsz__.js} +3 -3
- package/dist/browser/{ThreeComponent-DDjYQPXG.js → ThreeComponent-BStWIWLA.js} +4 -4
- package/dist/browser/{boolean-editor-BDA6-EZk.js → boolean-editor-CSqyOu_X.js} +3 -3
- package/dist/browser/bundle.json +26 -29
- package/dist/browser/{client-CIaQNg0L.js → client-Ca3SQ9bO.js} +2 -2
- package/dist/browser/{data-DeojhQ9l.js → data-BiWncDmi.js} +2 -2
- package/dist/browser/{debug-overlay-BMxh17e5.js → debug-overlay-CzQ4hWUN.js} +4 -4
- package/dist/browser/{debug-ui-DG09ZPYf.js → debug-ui-DMGPYlVK.js} +3 -3
- package/dist/browser/{fetch-retry.umd-Djerm8iU.js → fetch-retry.umd-CYEtSlH7.js} +1 -1
- package/dist/browser/{flex-RkXbYeB3.js → flex-BFGvV1iS.js} +2 -2
- package/dist/browser/{floorplan.ready-DOocUJOv.js → floorplan.ready-BrEhyuTm.js} +18008 -17968
- package/dist/browser/{index-CUwIlhvm.js → index-BC6Y3-P3.js} +1 -1
- package/dist/browser/{index-CsH1M7pW.js → index-BeFIoJ6b.js} +2 -2
- package/dist/browser/{index-jlJdZcGv.js → index-BqB89tei.js} +3 -3
- package/dist/browser/{index-BFfFTwRU.js → index-BuqxEypR.js} +4 -4
- package/dist/browser/{index-B7HWgssM.js → index-DGktAn6-.js} +1 -1
- package/dist/browser/{index-t2Qtb-FM.js → index-Du62yX73.js} +2 -2
- package/dist/browser/index-k8Qo-0Dy.js +10220 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/{particles.min-DU4QgXsV.js → particles.min-Bo4ztMtY.js} +1 -1
- package/dist/esm/components/Bookmarks.d.ts +0 -1
- package/dist/esm/components/Bookmarks.js +1 -1
- package/dist/esm/components/Kiosk/KioskStore.d.ts +3 -3
- package/dist/esm/components/Kiosk/KioskStore.js +1 -1
- package/dist/esm/components/Map/Map.d.ts +0 -23
- package/dist/esm/components/Map/Map.js +1 -1
- package/dist/esm/components/Map/drawing/config/TextFitter.d.ts +1 -1
- package/dist/esm/components/Map/drawing/config/config-all.d.ts +2 -3
- package/dist/esm/components/Map/drawing/config/config-all.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-bg.d.ts +1 -1
- package/dist/esm/components/Map/drawing/config/config-bg.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-bg.d.ts +5 -5
- package/dist/esm/components/Map/drawing/config/config-booth-bg.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-bookmark.d.ts +5 -5
- package/dist/esm/components/Map/drawing/config/config-booth-bookmark.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-border.d.ts +3 -3
- package/dist/esm/components/Map/drawing/config/config-booth-border.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-labels-special.d.ts +6 -6
- package/dist/esm/components/Map/drawing/config/config-booth-labels-special.js +2 -2
- package/dist/esm/components/Map/drawing/config/config-booth-labels.d.ts +5 -5
- package/dist/esm/components/Map/drawing/config/config-booth-labels.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-scaled.d.ts +3 -3
- package/dist/esm/components/Map/drawing/config/config-booth-scaled.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booths.d.ts +2 -2
- package/dist/esm/components/Map/drawing/config/config-booths.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-load-layer.d.ts +2 -2
- package/dist/esm/components/Map/drawing/config/config-load-layer.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-markers.d.ts +2 -3
- package/dist/esm/components/Map/drawing/config/config-markers.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-wf.d.ts +2 -3
- package/dist/esm/components/Map/drawing/config/config-wf.js +1 -1
- package/dist/esm/components/Map/drawing/config/loadBoothsImages.d.ts +2 -3
- package/dist/esm/components/Map/drawing/config/loadBoothsImages.js +1 -1
- package/dist/esm/components/Map/traffic/useBuildRoute.d.ts +3 -5
- package/dist/esm/components/Map/traffic/useBuildRoute.js +6 -6
- package/dist/esm/components/Map/traffic/useManageTraffic.d.ts +3 -5
- package/dist/esm/components/Map/traffic/useManageTraffic.js +1 -1
- package/dist/esm/components/SidebarActions.d.ts +3 -0
- package/dist/esm/components/SidebarActions.js +1 -1
- package/dist/esm/components/Wayfinding.js +1 -1
- package/dist/esm/data/tours.json +74 -0
- package/dist/esm/floorplan.ready.d.ts +2 -2
- package/dist/esm/floorplan.ready.js +1 -1
- package/dist/esm/index.d.ts +0 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/offline/offlineManager.js +1 -1
- package/dist/esm/renderer/HandlerRegistry.d.ts +18 -0
- package/dist/esm/renderer/HandlerRegistry.js +1 -0
- package/dist/esm/renderer/RendererService.d.ts +26 -0
- package/dist/esm/renderer/RendererService.js +1 -0
- package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/canvases.d.ts +1 -1
- package/dist/esm/renderer/engine-core/canvases.js +1 -0
- package/dist/esm/renderer/engine-core/fonts.js +1 -0
- package/dist/esm/{components/Map/drawing/config/engine-core → renderer}/index.d.ts +10 -10
- package/dist/esm/renderer/index.js +1 -0
- package/dist/esm/store/BookmarksStore.d.ts +1 -2
- package/dist/esm/store/BookmarksStore.js +2 -2
- package/dist/esm/store/LayerStore.js +1 -1
- package/dist/esm/store/RootStore.d.ts +6 -8
- package/dist/esm/store/RootStore.js +1 -1
- package/dist/esm/store/RouteStore.js +1 -1
- package/dist/esm/store/UIState.d.ts +3 -3
- package/dist/esm/store/UIState.js +1 -1
- package/dist/esm/utils/mapEntity.js +1 -1
- package/dist/esm/utils/shortenName.js +1 -1
- package/dist/esm/utils/useRenderTarget.js +1 -1
- package/dist/esm/utils/wayfinding.d.ts +1 -1
- package/dist/esm/utils/wayfinding.js +1 -1
- package/package.json +3 -7
- package/dist/browser/KioskStore-D2NCiJjy.js +0 -216
- package/dist/browser/index-yzyqTrur.js +0 -12540
- package/dist/browser/sw.js +0 -2
- package/dist/esm/components/Map/drawing/config/engine-core/canvases.js +0 -1
- package/dist/esm/components/Map/drawing/config/engine-core/fonts.js +0 -1
- package/dist/esm/components/Map/drawing/config/engine-core/index.js +0 -1
- package/dist/esm/components/Map/drawing/config/engine-core/renderer.d.ts +0 -4
- package/dist/esm/components/Map/drawing/config/engine-core/renderer.js +0 -1
- package/dist/esm/expofp-debug.d.ts +0 -5
- package/dist/esm/expofp-debug.js +0 -1
- package/dist/esm/offline/sw.d.ts +0 -2
- package/dist/esm/offline/sw.js +0 -1
- package/dist/stats.html +0 -4950
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/animation.d.ts +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/animation.js +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/defs.d.ts +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/defs.js +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/fonts.d.ts +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/settings.d.ts +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/settings.js +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/types.d.ts +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/types.js +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/update-def.d.ts +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/update-def.js +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/utils/rotation.d.ts +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/utils/rotation.js +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { RenderableDef, ImageDef, TextDef, LayerDef } from "@expofp/renderer";
|
|
2
|
+
import type { ImageDefWithParentBounds } from "./index";
|
|
3
|
+
export type Disposer = () => void;
|
|
4
|
+
export type PtScaleHandler = (scale: number) => RenderableDef | undefined;
|
|
5
|
+
export type RollHandler = (angle: number) => ImageDef | TextDef | (ImageDef | TextDef)[] | undefined;
|
|
6
|
+
export type LayerImagesHandler = () => Promise<{
|
|
7
|
+
layer: LayerDef;
|
|
8
|
+
children: ImageDefWithParentBounds[];
|
|
9
|
+
}>;
|
|
10
|
+
export declare class HandlerRegistry<T extends (...args: any[]) => any> {
|
|
11
|
+
private handlers;
|
|
12
|
+
register(name: string, fn: T): Disposer;
|
|
13
|
+
unregisterByName(name: string): void;
|
|
14
|
+
unregisterByPrefix(prefix: string): void;
|
|
15
|
+
invoke(...args: Parameters<T>): Array<NonNullable<ReturnType<T>>>;
|
|
16
|
+
clear(): void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=HandlerRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export class HandlerRegistry{handlers=new Map;register(e,s){return this.handlers.set(e,s),()=>this.handlers.delete(e)}unregisterByName(e){this.handlers.delete(e)}unregisterByPrefix(e){for(const s of this.handlers.keys())s.startsWith(e)&&this.handlers.delete(s)}invoke(...e){const s=[];for(const t of this.handlers.values()){const r=t(...e);r!=null&&s.push(r)}return s}clear(){this.handlers.clear()}}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Renderer, RenderableDef, SceneDef, CameraState, RendererOptions } from "@expofp/renderer";
|
|
2
|
+
import { HandlerRegistry, Disposer, PtScaleHandler, RollHandler, LayerImagesHandler } from "./HandlerRegistry";
|
|
3
|
+
import { CustomFonts } from "./index";
|
|
4
|
+
export declare class RendererService {
|
|
5
|
+
private _renderer;
|
|
6
|
+
private _scene;
|
|
7
|
+
private _fontUrls;
|
|
8
|
+
readonly ptScaleRegistry: HandlerRegistry<PtScaleHandler>;
|
|
9
|
+
readonly rollRegistry: HandlerRegistry<RollHandler>;
|
|
10
|
+
readonly layerImagesRegistry: HandlerRegistry<LayerImagesHandler>;
|
|
11
|
+
get renderer(): Renderer | null;
|
|
12
|
+
get scene(): SceneDef | null;
|
|
13
|
+
get fontUrls(): CustomFonts[];
|
|
14
|
+
getCameraState(): CameraState | undefined;
|
|
15
|
+
get scale(): number;
|
|
16
|
+
get angle(): number;
|
|
17
|
+
create(options: RendererOptions): Renderer;
|
|
18
|
+
start(scene: SceneDef): void;
|
|
19
|
+
dispose(): void;
|
|
20
|
+
onPtScale(name: string, handler: PtScaleHandler): Disposer;
|
|
21
|
+
onRoll(name: string, handler: RollHandler): Disposer;
|
|
22
|
+
onLayerImages(name: string, handler: LayerImagesHandler): Disposer;
|
|
23
|
+
update(...defs: RenderableDef[]): void;
|
|
24
|
+
private setupEventListeners;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=RendererService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Renderer as a}from"@expofp/renderer";import{HandlerRegistry as n}from"./HandlerRegistry";import{loadCustomFontsUrls as l}from"./index";import s from"../tools/logger";export class RendererService{_renderer=null;_scene=null;_fontUrls=[];ptScaleRegistry=new n;rollRegistry=new n;layerImagesRegistry=new n;get renderer(){return this._renderer?.isInitialized?this._renderer:null}get scene(){return this._scene}get fontUrls(){return this._fontUrls}getCameraState(){if(!this._renderer?.isInitialized){s.warn("Renderer is not initialized. Cannot get camera state.");return}return this._renderer.controls.getCameraState()}get scale(){return this.getCameraState()?.ptScale??1}get angle(){return this.getCameraState()?.roll??0}create(e){return this._renderer=new a(e),this._fontUrls=l(),this.setupEventListeners(),this._renderer}start(e){if(this._scene=e,!this._renderer)throw new Error("RendererService: renderer is not created.");this._renderer.init(e),this._renderer.start()}dispose(){this.ptScaleRegistry.clear(),this.rollRegistry.clear(),this.layerImagesRegistry.clear(),this._renderer?.dispose(),this._renderer=null,this._scene=null,this._fontUrls=[]}onPtScale(e,r){return this.ptScaleRegistry.register(e,r)}onRoll(e,r){return this.rollRegistry.register(e,r)}onLayerImages(e,r){return this.layerImagesRegistry.register(e,r)}update(...e){if(!this._renderer?.isInitialized){s.warn("Renderer is not initialized. Cannot update.");return}this._renderer.update(...e)}setupEventListeners(){const e=this._renderer;e.events.addEventListener("viewport:ptscale",r=>{if(!Number.isFinite(r))return;const t=[...this.ptScaleRegistry.invoke(r)];t.length&&e.update(...t)}),e.events.addEventListener("navigation:roll",r=>{if(!Number.isFinite(r))return;const t=[];for(const i of this.rollRegistry.invoke(r))Array.isArray(i)?t.push(...i):t.push(i);t.length&&e.update(...t)})}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Rect } from "
|
|
1
|
+
import { Rect } from "../../components/Map/drawing/config/Rect";
|
|
2
2
|
export declare function createCircleCanvas(radius: number, color: string): HTMLCanvasElement;
|
|
3
3
|
export declare function createBookmarkCanvas(maxSizePx: number, pixelRatio: number): HTMLCanvasElement;
|
|
4
4
|
export declare function getBounds(x: number, y: number, width: number, height: number, scale?: number, rotate?: number): Rect;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Rect as v}from"../../components/Map/drawing/config/Rect";const h=new Map;export function createCircleCanvas(o,n){const c=n.toUpperCase();if(!h.has(c)){const e=document.createElement("canvas"),s=o*2*devicePixelRatio+1*2;e.width=s,e.height=s;const i=e.getContext("2d");i.fillStyle=n,i.beginPath(),i.arc(s/2,s/2,o*devicePixelRatio,0,2*Math.PI),i.fill(),h.set(c,e)}return h.get(c)}const r=new Map;export function createBookmarkCanvas(o,n){const c=o;if(r.has(c))return r.get(c);const e=o,a=e*1.4,s=Math.ceil(e*n),i=Math.ceil(a*n),l=document.createElement("canvas");l.width=s,l.height=i;const t=l.getContext("2d");return t.scale(n,n),t.fillStyle="#fdbf2b",t.strokeStyle="#fff",t.lineWidth=4/n,t.beginPath(),t.moveTo(0,0),t.lineTo(0,a),t.lineTo(e/2,a-e/2),t.lineTo(e,a),t.lineTo(e,0),t.lineTo(0,0),t.fill(),t.stroke(),r.set(c,l),l}export function getBounds(o,n,c,e,a=1,s){const i=c*a,l=e*a,t=i/2,d=l/2,f={x:o-t,y:n-d},g={x:o+t,y:n+d};return new v(f,g,s)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import o from"../../tools/base-runtime-url";export const DEFAULT_FONT_URL=`${o}fonts/oswald-v17-cyrillic_latin-500.woff`,DEFAULT_FONT_LIGHT_URL=`${o}fonts/oswald-v17-cyrillic_latin-300.woff`;export function loadCustomFontsUrls(){const t=window.__data;return t&&t.customCssFonts?.length?t.customCssFonts:[]}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { IndicesType, MeshType, VerticesType, Line, TextLines, DefOptions, Point, FontSizeFactor } from "./types";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { IndicesType, MeshType, VerticesType, Line, TextLines, DefOptions, Point, FontSizeFactor } from "./engine-core/types";
|
|
2
|
+
import { rectToShapeDef, meshToShapeDef, createLayerDef, createLineDef, createSceneDef, createImageDef, createShapeDef, createTextDefLines, createTextDef, createShapeDot } from "./engine-core/defs";
|
|
3
|
+
import { updateLinesScale, updateTextDefRotation, getRotation, shouldFlip, getAngleDiff, getClampedBoundsCanvas, flipAngle, updateRectRotation } from "./engine-core/update-def";
|
|
4
|
+
import { createCircleCanvas, createBookmarkCanvas, getBounds } from "./engine-core/canvases";
|
|
5
|
+
import { loadCustomFontsUrls, CustomFonts, DEFAULT_FONT_URL, DEFAULT_FONT_LIGHT_URL } from "./engine-core/fonts";
|
|
6
|
+
import { isInnerInsideOuter, flipImageDef } from "./engine-core/utils/rotation";
|
|
7
|
+
import { mapRollSetting, getRollValue } from "./engine-core/settings";
|
|
8
|
+
import { ImageDefWithParentBounds } from "./engine-core/types";
|
|
9
|
+
import { RendererService } from "./RendererService";
|
|
10
10
|
export type { IndicesType, MeshType, VerticesType, Line, TextLines, DefOptions, FontSizeFactor, Point };
|
|
11
|
-
export { startRenderer, updateRenderer };
|
|
12
11
|
export { rectToShapeDef, meshToShapeDef, createLayerDef, createLineDef, createSceneDef, createImageDef, createShapeDef, createTextDef, createTextDefLines, createShapeDot, };
|
|
13
12
|
export { updateLinesScale, updateTextDefRotation, getRotation, shouldFlip, flipAngle, getAngleDiff, getClampedBoundsCanvas };
|
|
14
13
|
export { createCircleCanvas, createBookmarkCanvas, getBounds };
|
|
@@ -16,4 +15,5 @@ export { loadCustomFontsUrls, DEFAULT_FONT_URL, DEFAULT_FONT_LIGHT_URL };
|
|
|
16
15
|
export type { CustomFonts };
|
|
17
16
|
export { isInnerInsideOuter, mapRollSetting, getRollValue, updateRectRotation, flipImageDef };
|
|
18
17
|
export type { ImageDefWithParentBounds };
|
|
18
|
+
export { RendererService };
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{rectToShapeDef as e,meshToShapeDef as t,createLayerDef as r,createLineDef as o,createSceneDef as a,createImageDef as p,createShapeDef as f,createTextDefLines as i,createTextDef as m,createShapeDot as n}from"./engine-core/defs";import{updateLinesScale as c,updateTextDefRotation as l,getRotation as D,shouldFlip as s,getAngleDiff as d,getClampedBoundsCanvas as g,flipAngle as T,updateRectRotation as u}from"./engine-core/update-def";import{createCircleCanvas as x,createBookmarkCanvas as L,getBounds as R}from"./engine-core/canvases";import{loadCustomFontsUrls as S,DEFAULT_FONT_URL as h,DEFAULT_FONT_LIGHT_URL as C}from"./engine-core/fonts";import{isInnerInsideOuter as F,flipImageDef as I}from"./engine-core/utils/rotation";import{mapRollSetting as U,getRollValue as _}from"./engine-core/settings";import{RendererService as v}from"./RendererService";export{e as rectToShapeDef,t as meshToShapeDef,r as createLayerDef,o as createLineDef,a as createSceneDef,p as createImageDef,f as createShapeDef,m as createTextDef,i as createTextDefLines,n as createShapeDot};export{c as updateLinesScale,l as updateTextDefRotation,D as getRotation,s as shouldFlip,T as flipAngle,d as getAngleDiff,g as getClampedBoundsCanvas};export{x as createCircleCanvas,L as createBookmarkCanvas,R as getBounds};export{S as loadCustomFontsUrls,h as DEFAULT_FONT_URL,C as DEFAULT_FONT_LIGHT_URL};export{F as isInnerInsideOuter,U as mapRollSetting,_ as getRollValue,u as updateRectRotation,I as flipImageDef};export{v as RendererService};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import RootStore from "./RootStore";
|
|
2
|
-
import type { InterfaceAction } from "./types";
|
|
3
2
|
export default class BookmarksStore {
|
|
4
3
|
private readonly rootStore;
|
|
5
4
|
private readonly _share;
|
|
@@ -7,7 +6,7 @@ export default class BookmarksStore {
|
|
|
7
6
|
get bookmarkedBooths(): import("./BoothStore").Booth[];
|
|
8
7
|
get total(): number;
|
|
9
8
|
get hasBookmarks(): boolean;
|
|
10
|
-
get
|
|
9
|
+
get hasRoutableBookmarks(): boolean;
|
|
11
10
|
share(): void;
|
|
12
11
|
}
|
|
13
12
|
//# sourceMappingURL=BookmarksStore.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__esDecorate as r,__runInitializers as b}from"tslib";import{computed as s}from"mobx";import u from"copy-to-clipboard";import{t as
|
|
2
|
-
`+
|
|
1
|
+
import{__esDecorate as r,__runInitializers as b}from"tslib";import{computed as s}from"mobx";import u from"copy-to-clipboard";import{t as m}from"../utils/i18n";let p=(()=>{let a=[],i,l,k,h;return class{static{const o=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;i=[s],l=[s],k=[s],h=[s],r(this,null,i,{kind:"getter",name:"bookmarkedBooths",static:!1,private:!1,access:{has:t=>"bookmarkedBooths"in t,get:t=>t.bookmarkedBooths},metadata:o},null,a),r(this,null,l,{kind:"getter",name:"total",static:!1,private:!1,access:{has:t=>"total"in t,get:t=>t.total},metadata:o},null,a),r(this,null,k,{kind:"getter",name:"hasBookmarks",static:!1,private:!1,access:{has:t=>"hasBookmarks"in t,get:t=>t.hasBookmarks},metadata:o},null,a),r(this,null,h,{kind:"getter",name:"hasRoutableBookmarks",static:!1,private:!1,access:{has:t=>"hasRoutableBookmarks"in t,get:t=>t.hasRoutableBookmarks},metadata:o},null,a),o&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})}rootStore=b(this,a);_share;constructor(o){this.rootStore=o,this._share=this.share.bind(this)}get bookmarkedBooths(){return this.rootStore.boothStore.booths.filter(o=>o.exhibitors.length===0&&o.bookmarkedDirectly)}get total(){return this.rootStore.exhibitorStore.bookmarked.length+this.rootStore.eventStore.bookmarked.length+this.rootStore.speakerStore.bookmarked.length+this.bookmarkedBooths.length}get hasBookmarks(){return this.total>0}get hasRoutableBookmarks(){return this.rootStore.exhibitorStore.bookmarked.length>0||this.bookmarkedBooths.length>0}share(){const{exhibitorStore:o,eventStore:t,speakerStore:d}=this.rootStore,n=window.location,c=[...o.bookmarked.map(e=>e.id),...t.bookmarked.map(e=>e.id),...d.bookmarked.map(e=>e.id),...this.bookmarkedBooths.map(e=>e.id)];u(`${n.protocol}//${n.host}/?b=`+c.join("|")),alert(m("Link copied to clipboard")+`.
|
|
2
|
+
`+m("Open it on another device to import bookmarks")+".")}}})();export default p;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__esDecorate as l,__runInitializers as o}from"tslib";import{action as w,computed as
|
|
1
|
+
import{__esDecorate as l,__runInitializers as o}from"tslib";import{action as w,computed as v,observable as u,runInAction as C}from"mobx";import n from".";import I from"../components/Map/drawing/config/config-load-layer";import W from"../core/Rect";import{shortenName as j}from"../utils/shortenName";import{areLayersEnabled as D}from"../utils/areLayersEnabled";export var LayersMode;(function(i){i[i.Default=0]="Default",i[i.Separated=1]="Separated",i[i.Radio=2]="Radio",i[i.CheckBox=3]="CheckBox"})(LayersMode||(LayersMode={}));export var LayerMode;(function(i){i[i.Unset=0]="Unset",i[i.AlwaysVisible=1]="AlwaysVisible",i[i.AlwaysHidden=2]="AlwaysHidden",i[i.TurnedOn=3]="TurnedOn",i[i.TurnedOff=4]="TurnedOff"})(LayerMode||(LayerMode={}));let O=(()=>{let i,h=[],y=[],m,p=[],_=[];return class{static{const c=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;i=[u],m=[u],l(null,null,i,{kind:"field",name:"loaded",static:!1,private:!1,access:{has:s=>"loaded"in s,get:s=>s.loaded,set:(s,f)=>{s.loaded=f}},metadata:c},h,y),l(null,null,m,{kind:"field",name:"visible",static:!1,private:!1,access:{has:s=>"visible"in s,get:s=>s.visible,set:(s,f)=>{s.visible=f}},metadata:c},p,_),c&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:c})}basePriority;name;description;frozen;rect=null;viewbox=null;configured;childLayers=[];rootParent=null;mode;children=[];pathway;loaded=o(this,h,void 0);visible=(o(this,y),o(this,p,void 0));get shortName(){return j(this.description)}constructor(){o(this,_)}}})();export{O as Layer};let N=(()=>{let i=[],h,y=[],m=[],p,_=[],b=[],c,s=[],f=[],L,S=[],P=[],k,x,A,R,T,V,z,E;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;h=[u],p=[u],c=[u],L=[u],k=[v({keepAlive:!0})],x=[v({keepAlive:!0})],A=[v({keepAlive:!0})],R=[v],T=[v],V=[w],z=[w],E=[w],l(this,null,k,{kind:"getter",name:"visible",static:!1,private:!1,access:{has:e=>"visible"in e,get:e=>e.visible},metadata:t},null,i),l(this,null,x,{kind:"getter",name:"loaded",static:!1,private:!1,access:{has:e=>"loaded"in e,get:e=>e.loaded},metadata:t},null,i),l(this,null,A,{kind:"getter",name:"rectangle",static:!1,private:!1,access:{has:e=>"rectangle"in e,get:e=>e.rectangle},metadata:t},null,i),l(this,null,R,{kind:"getter",name:"pathwayLayers",static:!1,private:!1,access:{has:e=>"pathwayLayers"in e,get:e=>e.pathwayLayers},metadata:t},null,i),l(this,null,T,{kind:"getter",name:"floors",static:!1,private:!1,access:{has:e=>"floors"in e,get:e=>e.floors},metadata:t},null,i),l(this,null,V,{kind:"method",name:"updateVisibility",static:!1,private:!1,access:{has:e=>"updateVisibility"in e,get:e=>e.updateVisibility},metadata:t},null,i),l(this,null,z,{kind:"method",name:"showPathWay",static:!1,private:!1,access:{has:e=>"showPathWay"in e,get:e=>e.showPathWay},metadata:t},null,i),l(this,null,E,{kind:"method",name:"hidePathways",static:!1,private:!1,access:{has:e=>"hidePathways"in e,get:e=>e.hidePathways},metadata:t},null,i),l(null,null,h,{kind:"field",name:"layers",static:!1,private:!1,access:{has:e=>"layers"in e,get:e=>e.layers,set:(e,a)=>{e.layers=a}},metadata:t},y,m),l(null,null,p,{kind:"field",name:"defaultLayer",static:!1,private:!1,access:{has:e=>"defaultLayer"in e,get:e=>e.defaultLayer,set:(e,a)=>{e.defaultLayer=a}},metadata:t},_,b),l(null,null,c,{kind:"field",name:"mode",static:!1,private:!1,access:{has:e=>"mode"in e,get:e=>e.mode,set:(e,a)=>{e.mode=a}},metadata:t},s,f),l(null,null,L,{kind:"field",name:"layersLoaded",static:!1,private:!1,access:{has:e=>"layersLoaded"in e,get:e=>e.layersLoaded,set:(e,a)=>{e.layersLoaded=a}},metadata:t},S,P),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}layers=(o(this,i),o(this,y,[]));defaultLayer=(o(this,m),o(this,_,void 0));mode=(o(this,b),o(this,s,void 0));layersLoaded=(o(this,f),o(this,S,!1));updateVisibilityTimeout=(o(this,P),0);get visible(){return this.layers.filter(t=>t.frozen||t.visible)}get loaded(){return this.layers.filter(t=>t.loaded)}get rectangle(){var t=this.visible.filter(e=>!e.frozen).map(e=>e.viewbox??e.rect);return this.mode!==LayersMode.Radio||!t.length?null:W.fromMultiple(t)||null}get pathwayLayers(){return this.layers.filter(t=>t.pathway)}get floors(){if(!D())return[];const t=new Set(this.layers.filter(a=>a&&!a.frozen&&!a.rootParent&&!a.pathway).concat(n.routeStore.layers.filter(a=>a&&a.mode!==LayerMode.AlwaysHidden&&a.mode!==LayerMode.AlwaysVisible))),e=Array.from(t).reverse();return e.map((a,r)=>{const d=n.routeStore.layers.length>0&&n.routeStore.layers.indexOf(a)===-1,g=n.toursStore.tourLayers.length>0&&n.toursStore.tourLayers.indexOf(a)===-1;return{layer:a,name:a.name,shortName:a.shortName,description:a.description,active:a.visible,disabled:!!(d||g),index:e.length-r-1}})}updateVisibility(t,e){if(this.mode===LayersMode.Radio&&!e)return;const a=t instanceof O?t:this.findLayer(t);if(!a||a.visible===e){a&&n.routeStore.currentRouteLayer!==a&&(n.routeStore.currentRouteLayer=a);return}I(a,n.rendererService).then(()=>{this.mode===LayersMode.Radio&&this.layers.filter(r=>!r.pathway).forEach(r=>{r.name!==a.name&&!r.frozen&&r.visible&&(r.visible=!1,r.childLayers.forEach(d=>{d.visible=!1}))}),a&&(a.visible=e,a.childLayers.forEach(r=>{r.visible=e}),e&&(n.routeStore.currentRouteLayer=a),typeof n.fp.onFloorActivated=="function"&&(clearTimeout(this.updateVisibilityTimeout),this.updateVisibilityTimeout=setTimeout(()=>{const r=n.fp.getFloors();n.fp.onFloorActivated(r.find(d=>d.name===a.name))})))})}findLayer(t){if(t==null)return null;const e=this.layers.filter(r=>!r.rootParent);if(typeof t=="number"&&(a=e.filter(r=>!r.frozen)[t],a))return a;t=t.toString().toLowerCase();var a=e.find(r=>{const d=(r.name.match(/(-?[0-9]+)/)||"")[0];return t===r?.name.toLowerCase()||t===r?.description.toLowerCase()||t===r?.shortName.toLowerCase()||t===d});return!a&&!/\D/.test(t)&&(a=e.filter(r=>!r.frozen)[parseInt(t)]),a}getPathwayList(){return this.layers.filter(t=>t.pathway)}async showPathWay(t){try{const e=this.findLayer(t);if(!e)throw new Error(`There is no pathway with this name. ${t}`);await I(e,n.rendererService);const a=this.getPathwayList();C(()=>{a.forEach(r=>{const d=r.name===t;r.visible=d,r.childLayers.forEach(g=>{g.visible=d})})})}catch(e){console.error("showPathWay",e)}}hidePathways(){this.getPathwayList().forEach(e=>{e.visible=!1,e.childLayers.forEach(a=>{a.visible=!1})})}}})();export default N;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import BoothStore from "./BoothStore";
|
|
1
|
+
import FloorPlanReady from "../floorplan.ready";
|
|
2
|
+
import BoothStore, { Booth } from "./BoothStore";
|
|
4
3
|
import CategoryStore, { Category } from "./CategoryStore";
|
|
5
4
|
import ExhibitorStore, { Exhibitor } from "./ExhibitorStore";
|
|
6
5
|
import CategoryFilterStore from "./CategoryFilterStore";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import type { Speaker } from "./SpeakerStore";
|
|
6
|
+
import EventStore, { EventItem } from "./EventStore";
|
|
7
|
+
import { Speaker } from "./SpeakerStore";
|
|
10
8
|
import HeatmapStore from "./HeatmapStore";
|
|
11
9
|
import LanguageStore from "./LanguageStore";
|
|
12
10
|
import LayerStore from "./LayerStore";
|
|
@@ -26,7 +24,7 @@ import { URLFilterManager } from "../services/URLFilterManager";
|
|
|
26
24
|
import { ShortcutRegistry } from "./ShortcutRegistry";
|
|
27
25
|
import SpeakerStore from "./SpeakerStore";
|
|
28
26
|
import SpeakerFilterStore from "./SpeakerFilterStore";
|
|
29
|
-
import
|
|
27
|
+
import { RendererService } from "../renderer";
|
|
30
28
|
export default class RootStore {
|
|
31
29
|
readonly categoryStore: CategoryStore;
|
|
32
30
|
readonly exhibitorStore: ExhibitorStore;
|
|
@@ -51,8 +49,8 @@ export default class RootStore {
|
|
|
51
49
|
readonly bookmarksStore: BookmarksStore;
|
|
52
50
|
readonly urlFilterManager: URLFilterManager;
|
|
53
51
|
readonly shortcutRegistry: ShortcutRegistry;
|
|
52
|
+
readonly rendererService: RendererService;
|
|
54
53
|
fp: FloorPlanReady;
|
|
55
|
-
renderer: Renderer;
|
|
56
54
|
initialized: boolean;
|
|
57
55
|
resetCameraFn: () => void;
|
|
58
56
|
setResetCameraFn(resetCameraFn: () => void): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__esDecorate as i,__runInitializers as n}from"tslib";import{action as a,observable as se,computed as he,runInAction as ae}from"mobx";import ne from"../tools/logger";import{isWebGlSupported as ce}from"../utils";import ue,{BoothBase as oe,RegularBooth as de}from"./BoothStore";import me,{Category as Se}from"./CategoryStore";import fe,{Exhibitor as le}from"./ExhibitorStore";import ge from"./CategoryFilterStore";import pe from"./EventStore";import{GaEventActions as ke}from"../tools/gtag";import r from"../utils/is-mobile";import c from"../utils/is-webview";import ve from"./HeatmapStore";import ye from"./LanguageStore";import _e,{LayersMode as re}from"./LayerStore";import be from"./MapboxStore";import we from"./RouteStore";import xe from"./RoutePlannerStore";import Be from"./ToursStore";import Le from"./UIState";import Ce from"./PoiTypeStore";import{sanitizeSearch as Ee}from"../utils/sanitizeText";import Fe from"./FuzzySearchEngineStore";import Ie from"./SessionsFilterStore";import{getLocale as Te}from"../utils/i18n";import ze from"./SearchStore";import Me from"./SearchButtonsStore";import Oe from"./BookmarksStore";import{URLFilterManager as Re}from"../services/URLFilterManager";import{ShortcutRegistry as Ae}from"./ShortcutRegistry";import{SessionsShortcutProvider as Ve}from"./providers/SessionsShortcutProvider";import Pe from"./SpeakerStore";import Ge from"./SpeakerFilterStore";import{SpeakerShortcutProvider as Ne}from"./providers/SpeakerShortcutProvider";import{SearchShortcutProvider as qe}from"./providers/SearchShortcutProvider";let je=(()=>{let s=[],u,d=[],m=[],S,f=[],g=[],p,k,v,y,_,b,w,x,B,L,C,E,F,I,T,z,M,O,R,A,V,P,G,N,q,j,U,W,D,H,K,$,J,Q,X,Y,Z,ee,te,ie;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;u=[se],S=[se],p=[a],k=[a],v=[a],y=[a],_=[a],b=[a],w=[a],x=[a],B=[a],L=[a],C=[a],E=[a],F=[a],I=[a],T=[a],z=[a],M=[a],O=[a],R=[a],A=[a],V=[a],P=[a],G=[a],N=[a],q=[a],j=[a],U=[a],W=[a],D=[a],H=[a],K=[a],$=[a],J=[a],Q=[he],X=[a],Y=[a],Z=[a],ee=[a],te=[a],ie=[a],i(this,null,p,{kind:"method",name:"setResetCameraFn",static:!1,private:!1,access:{has:e=>"setResetCameraFn"in e,get:e=>e.setResetCameraFn},metadata:t},null,s),i(this,null,k,{kind:"method",name:"selectExhibitor",static:!1,private:!1,access:{has:e=>"selectExhibitor"in e,get:e=>e.selectExhibitor},metadata:t},null,s),i(this,null,v,{kind:"method",name:"selectBooth",static:!1,private:!1,access:{has:e=>"selectBooth"in e,get:e=>e.selectBooth},metadata:t},null,s),i(this,null,y,{kind:"method",name:"reset",static:!1,private:!1,access:{has:e=>"reset"in e,get:e=>e.reset},metadata:t},null,s),i(this,null,_,{kind:"method",name:"selectNone",static:!1,private:!1,access:{has:e=>"selectNone"in e,get:e=>e.selectNone},metadata:t},null,s),i(this,null,b,{kind:"method",name:"selectBookmarks",static:!1,private:!1,access:{has:e=>"selectBookmarks"in e,get:e=>e.selectBookmarks},metadata:t},null,s),i(this,null,w,{kind:"method",name:"selectVisited",static:!1,private:!1,access:{has:e=>"selectVisited"in e,get:e=>e.selectVisited},metadata:t},null,s),i(this,null,x,{kind:"method",name:"selectLanguage",static:!1,private:!1,access:{has:e=>"selectLanguage"in e,get:e=>e.selectLanguage},metadata:t},null,s),i(this,null,B,{kind:"method",name:"selectCategory",static:!1,private:!1,access:{has:e=>"selectCategory"in e,get:e=>e.selectCategory},metadata:t},null,s),i(this,null,L,{kind:"method",name:"selectEventItem",static:!1,private:!1,access:{has:e=>"selectEventItem"in e,get:e=>e.selectEventItem},metadata:t},null,s),i(this,null,C,{kind:"method",name:"selectSearch",static:!1,private:!1,access:{has:e=>"selectSearch"in e,get:e=>e.selectSearch},metadata:t},null,s),i(this,null,E,{kind:"method",name:"clickBookmarks",static:!1,private:!1,access:{has:e=>"clickBookmarks"in e,get:e=>e.clickBookmarks},metadata:t},null,s),i(this,null,F,{kind:"method",name:"clickVisited",static:!1,private:!1,access:{has:e=>"clickVisited"in e,get:e=>e.clickVisited},metadata:t},null,s),i(this,null,I,{kind:"method",name:"clickLanguage",static:!1,private:!1,access:{has:e=>"clickLanguage"in e,get:e=>e.clickLanguage},metadata:t},null,s),i(this,null,T,{kind:"method",name:"clickCategory",static:!1,private:!1,access:{has:e=>"clickCategory"in e,get:e=>e.clickCategory},metadata:t},null,s),i(this,null,z,{kind:"method",name:"clickSeminars",static:!1,private:!1,access:{has:e=>"clickSeminars"in e,get:e=>e.clickSeminars},metadata:t},null,s),i(this,null,M,{kind:"method",name:"clickBoothInList",static:!1,private:!1,access:{has:e=>"clickBoothInList"in e,get:e=>e.clickBoothInList},metadata:t},null,s),i(this,null,O,{kind:"method",name:"clickBoothInList2",static:!1,private:!1,access:{has:e=>"clickBoothInList2"in e,get:e=>e.clickBoothInList2},metadata:t},null,s),i(this,null,R,{kind:"method",name:"clickBooth",static:!1,private:!1,access:{has:e=>"clickBooth"in e,get:e=>e.clickBooth},metadata:t},null,s),i(this,null,A,{kind:"method",name:"clickExhibitor2",static:!1,private:!1,access:{has:e=>"clickExhibitor2"in e,get:e=>e.clickExhibitor2},metadata:t},null,s),i(this,null,V,{kind:"method",name:"clickExhibitor",static:!1,private:!1,access:{has:e=>"clickExhibitor"in e,get:e=>e.clickExhibitor},metadata:t},null,s),i(this,null,P,{kind:"method",name:"showMap",static:!1,private:!1,access:{has:e=>"showMap"in e,get:e=>e.showMap},metadata:t},null,s),i(this,null,G,{kind:"method",name:"showOverlay",static:!1,private:!1,access:{has:e=>"showOverlay"in e,get:e=>e.showOverlay},metadata:t},null,s),i(this,null,N,{kind:"method",name:"toggleMapOverlay",static:!1,private:!1,access:{has:e=>"toggleMapOverlay"in e,get:e=>e.toggleMapOverlay},metadata:t},null,s),i(this,null,q,{kind:"method",name:"moveToList",static:!1,private:!1,access:{has:e=>"moveToList"in e,get:e=>e.moveToList},metadata:t},null,s),i(this,null,j,{kind:"method",name:"moveToExhibitor",static:!1,private:!1,access:{has:e=>"moveToExhibitor"in e,get:e=>e.moveToExhibitor},metadata:t},null,s),i(this,null,U,{kind:"method",name:"changeActiveListIndex",static:!1,private:!1,access:{has:e=>"changeActiveListIndex"in e,get:e=>e.changeActiveListIndex},metadata:t},null,s),i(this,null,W,{kind:"method",name:"toggleModal",static:!1,private:!1,access:{has:e=>"toggleModal"in e,get:e=>e.toggleModal},metadata:t},null,s),i(this,null,D,{kind:"method",name:"openGallery",static:!1,private:!1,access:{has:e=>"openGallery"in e,get:e=>e.openGallery},metadata:t},null,s),i(this,null,H,{kind:"method",name:"closeGallery",static:!1,private:!1,access:{has:e=>"closeGallery"in e,get:e=>e.closeGallery},metadata:t},null,s),i(this,null,K,{kind:"method",name:"openActiveListItem",static:!1,private:!1,access:{has:e=>"openActiveListItem"in e,get:e=>e.openActiveListItem},metadata:t},null,s),i(this,null,$,{kind:"method",name:"toggleCategoryFilter",static:!1,private:!1,access:{has:e=>"toggleCategoryFilter"in e,get:e=>e.toggleCategoryFilter},metadata:t},null,s),i(this,null,J,{kind:"method",name:"applyCategoryFilters",static:!1,private:!1,access:{has:e=>"applyCategoryFilters"in e,get:e=>e.applyCategoryFilters},metadata:t},null,s),i(this,null,Q,{kind:"getter",name:"filteredExhibitors",static:!1,private:!1,access:{has:e=>"filteredExhibitors"in e,get:e=>e.filteredExhibitors},metadata:t},null,s),i(this,null,X,{kind:"method",name:"selectSessions",static:!1,private:!1,access:{has:e=>"selectSessions"in e,get:e=>e.selectSessions},metadata:t},null,s),i(this,null,Y,{kind:"method",name:"selectExhibitors",static:!1,private:!1,access:{has:e=>"selectExhibitors"in e,get:e=>e.selectExhibitors},metadata:t},null,s),i(this,null,Z,{kind:"method",name:"selectTours",static:!1,private:!1,access:{has:e=>"selectTours"in e,get:e=>e.selectTours},metadata:t},null,s),i(this,null,ee,{kind:"method",name:"selectSpeakers",static:!1,private:!1,access:{has:e=>"selectSpeakers"in e,get:e=>e.selectSpeakers},metadata:t},null,s),i(this,null,te,{kind:"method",name:"selectSpeaker",static:!1,private:!1,access:{has:e=>"selectSpeaker"in e,get:e=>e.selectSpeaker},metadata:t},null,s),i(this,null,ie,{kind:"method",name:"resetFilters",static:!1,private:!1,access:{has:e=>"resetFilters"in e,get:e=>e.resetFilters},metadata:t},null,s),i(null,null,u,{kind:"field",name:"initialized",static:!1,private:!1,access:{has:e=>"initialized"in e,get:e=>e.initialized,set:(e,o)=>{e.initialized=o}},metadata:t},d,m),i(null,null,S,{kind:"field",name:"resetCameraFn",static:!1,private:!1,access:{has:e=>"resetCameraFn"in e,get:e=>e.resetCameraFn,set:(e,o)=>{e.resetCameraFn=o}},metadata:t},f,g),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}categoryStore=n(this,s);exhibitorStore;boothStore;uiState;routeStore;routePlannerStore;toursStore;mapboxStore;layerStore;eventStore;poiTypeStore;heatmapStore;languageStore;fuzzySearchEngineStore;categoryFilterStore;sessionsFilterStore;speakerStore;speakerFilterStore;searchStore;searchButtonsStore;bookmarksStore;urlFilterManager;shortcutRegistry;fp;renderer;initialized=n(this,d,!1);resetCameraFn=(n(this,m),n(this,f,void 0));setResetCameraFn(t){this.resetCameraFn=t}constructor(){n(this,g),this.categoryStore=new me(this),this.exhibitorStore=new fe(this),this.boothStore=new ue(this),this.routeStore=new we(this),this.routePlannerStore=new xe(this),this.toursStore=new Be(this),this.uiState=new Le(this),this.mapboxStore=new be(this),this.layerStore=new _e,this.eventStore=new pe(this),this.heatmapStore=new ve(this),this.languageStore=new ye(this),this.poiTypeStore=new Ce(this),this.fuzzySearchEngineStore=new Fe,this.categoryFilterStore=new ge(this),this.sessionsFilterStore=new Ie(this),this.speakerStore=new Pe(this),this.speakerFilterStore=new Ge(this),this.searchStore=new ze(this),this.searchButtonsStore=new Me(this),this.bookmarksStore=new Oe(this),this.urlFilterManager=new Re(this),this.shortcutRegistry=new Ae,this.registerShortcutProviders()}selectExhibitor(t,e=!0){this.uiState.hoveredExhibitor=null,this.uiState.details=t;var o=t.booths.filter(h=>h.visible),l=t.booths.filter(h=>!h.visible);!o.length&&l.length&&this.layerStore.updateVisibility(l[0].layer,!0),e&&setTimeout(()=>this.moveToList(t.booths.filter(h=>h.visible)),c||r?500:50)}selectBooth(t,e=!0){let o=Array.isArray(t)?t:[t];this.uiState.details=o[0],o.length===1&&o[0].schedule?.length&&(this.uiState.desiredOverlaySize="medium"),o.length===1&&o[0].layer&&!o[0].visible&&this.layerStore.mode===re.Radio&&this.layerStore.updateVisibility(o[0].layer,!0),e&&setTimeout(()=>this.moveToList(o),c||r?500:50)}reset(){const t=window.__searchi;t&&t.querySelector&&t.querySelector("input[type=search]")&&t.querySelector("input[type=search]").blur&&t.querySelector("input[type=search]").blur(),window.setTimeout(()=>{this.uiState.setKioskModeEnabled||(localStorage.removeItem("language"),this.languageStore.changeLanguage(Te()).then(()=>{ae(()=>{this.selectSearch(""),this.routeStore.defaultFrom&&!this.routeStore.defaultFrom?.visible?this.selectBooth(this.routeStore.defaultFrom):this.uiState.details=null,this.resetCameraFn?.(),this.uiState.menu=!1,this.searchStore.resetSearchBox(),this.searchButtonsStore.clearAllFilters()}),setTimeout(()=>{ae(()=>{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:"language",id:this.languageStore.language?.id}}selectCategory(t){window.__resett&&window.__resett(),this.uiState.details=t,this.uiState.list={type:"category",category:t},this.uiState.desiredOverlaySize="full",t.exhibitors.find(o=>o.booths.find(l=>l.visible))||this.layerStore.updateVisibility(t.exhibitors[0]?.booths[0]?.layer,!0),setTimeout(()=>{this.uiState.moveToBooths=t.exhibitors.filter(o=>o.booths.find(l=>l.visible)).flatMap(o=>o.booths)},200)}selectEventItem(t,e=!0){if(this.uiState.hoveredExhibitor=null,this.uiState.details=t,this.uiState.desiredOverlaySize="medium",t.boothId){const o=this.boothStore.booths.find(l=>l.id===t.boothId);o&&o.layer&&!o.visible&&this.layerStore.mode===re.Radio&&this.layerStore.updateVisibility(o.layer,!0)}e&&setTimeout(()=>{if(t.boothId){const o=this.boothStore.booths.find(l=>l.id===t.boothId);o&&this.moveToList([o])}},c||r?500:50)}selectSearch(t){window.__resett&&window.__resett(),this.uiState.details=null,this.speakerStore.clearSelectedSpeaker(),this.uiState.list={type:"search",text:Ee(t,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(t){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectCategory(t),this.uiState.onCategoryClick&&this.uiState.onCategoryClick({id:t.id,name:t.name,exhibitors:t.exhibitors.map(e=>e.id)}),setTimeout(()=>{this.moveToList(),this.showMap()},100)}clickSeminars(){this.clickCategory(this.categoryStore.seminarsCategory)}clickBoothInList(t){window.__resett&&window.__resett(),this.uiState.hoveredBooth=null,this.selectBooth(t),this.moveToList([t]),this.showMap()}clickBoothInList2(t){window.__resett&&window.__resett(),this.uiState.hoveredBooth=null,this.selectBooth(t,!1),window.setTimeout(()=>{this.moveToList([t]),this.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50)}clickBooth(t){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(),!(this.uiState.selectedRoute?.from&&this.uiState.selectedRoute?.to)){if(this.uiState.selectedRoute?.to&&!this.uiState.selectedRoute?.from&&t){this.routeStore.setStartPoint(t);return}if(t)this.routeStore.tempToBooth=t;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){const e={name:"",description:""},o={target:{...t,layer:t.layer||e}};this.uiState.onBoothClick(o)}t.exhibitors.length===1&&t instanceof de?(this.heatmapStore.forceTrack={action:ke.ViewBooth,label:t.name},this.selectExhibitor(t.exhibitors[0],!1)):this.selectBooth(t,!1),this.showMap()}}clickExhibitor2(t){this.selectExhibitor(t,!0),this.showMap()}clickExhibitor(t){window.setTimeout(()=>{this.clickExhibitor2(t)},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50)}showMap(){const t=this.uiState.details;t&&"schedule"in t&&t.schedule?.length>0?this.uiState.desiredOverlaySize="full":this.uiState.overlayPosition==="bottom"&&ce&&(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(t){t=t||this.uiState.listItems;const e=[];t.forEach(o=>{o instanceof le?e.push(...o.booths.filter(l=>l.visible)):o instanceof oe&&e.push(o)}),this.uiState.moveToBooths=e}moveToExhibitor(t){this.moveToList([t])}changeActiveListIndex(t){let e=this.uiState.activeListIndex+t;e=Math.max(0,Math.min(this.uiState.listItems.length-1,e)),this.uiState.activeListIndex=e}toggleModal(t){this.uiState.modalActive[t]=!this.uiState.modalActive[t]}openGallery(){this.uiState.galleryActive=!0}closeGallery(){this.uiState.galleryActive=!1}openActiveListItem(){const t=this.uiState.listItems[this.uiState.activeListIndex];t&&(ne.log("Opening",t),t instanceof le?this.clickExhibitor(t):t instanceof Se?this.clickCategory(t):t instanceof oe&&this.clickBoothInList2(t))}toggleCategoryFilter(){this.uiState.categoryFilterOpen=!this.uiState.categoryFilterOpen}applyCategoryFilters(t){this.uiState.selectedCategoryFilters=t,this.uiState.categoryFilterOpen=!1}get filteredExhibitors(){return this.uiState.selectedCategoryFilters.length===0?this.exhibitorStore.exhibitors:this.exhibitorStore.exhibitors.filter(t=>this.uiState.selectedCategoryFilters.some(e=>t.categories.some(o=>o.id===e.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"),r&&(this.uiState.desiredOverlaySize="full")}selectExhibitors(){this.uiState.list={type:"exhibitors",text:"",focused:!1},this.uiState.menu=!1,r&&(this.uiState.desiredOverlaySize="full")}selectTours(){this.uiState.list={type:"tours",text:"",focused:!1},this.uiState.menu=!1,r&&(this.uiState.desiredOverlaySize="full")}selectSpeakers(){this.uiState.list={type:"speakers",text:"",focused:!1},this.uiState.menu=!1,r&&(this.uiState.desiredOverlaySize="full")}selectSpeaker(t,e=!0){this.speakerStore.selectSpeaker(t,e)}resetFilters(){this.searchButtonsStore.clearAllFilters()}registerShortcutProviders(){this.shortcutRegistry.register(new Ve(this)),this.shortcutRegistry.register(new Ne(this)),this.shortcutRegistry.register(new qe(this))}}})();export default je;
|
|
1
|
+
import{__esDecorate as i,__runInitializers as n}from"tslib";import{action as a,observable as se,computed as he,runInAction as ae}from"mobx";import ne from"../tools/logger";import{isWebGlSupported as ce}from"../utils";import ue,{BoothBase as oe,RegularBooth as de}from"./BoothStore";import me,{Category as Se}from"./CategoryStore";import fe,{Exhibitor as le}from"./ExhibitorStore";import ge from"./CategoryFilterStore";import pe from"./EventStore";import{GaEventActions as ke}from"../tools/gtag";import r from"../utils/is-mobile";import c from"../utils/is-webview";import ve from"./HeatmapStore";import ye from"./LanguageStore";import _e,{LayersMode as re}from"./LayerStore";import be from"./MapboxStore";import we from"./RouteStore";import xe from"./RoutePlannerStore";import Be from"./ToursStore";import Le from"./UIState";import Ce from"./PoiTypeStore";import{sanitizeSearch as Ee}from"../utils/sanitizeText";import Fe from"./FuzzySearchEngineStore";import Ie from"./SessionsFilterStore";import{getLocale as Te}from"../utils/i18n";import ze from"./SearchStore";import Me from"./SearchButtonsStore";import Oe from"./BookmarksStore";import{URLFilterManager as Re}from"../services/URLFilterManager";import{ShortcutRegistry as Ae}from"./ShortcutRegistry";import{SessionsShortcutProvider as Ve}from"./providers/SessionsShortcutProvider";import Pe from"./SpeakerStore";import Ge from"./SpeakerFilterStore";import{SpeakerShortcutProvider as Ne}from"./providers/SpeakerShortcutProvider";import{SearchShortcutProvider as qe}from"./providers/SearchShortcutProvider";import{RendererService as je}from"../renderer";let Ue=(()=>{let s=[],u,d=[],m=[],S,f=[],g=[],p,k,v,y,_,b,w,x,B,L,C,E,F,I,T,z,M,O,R,A,V,P,G,N,q,j,U,W,D,H,K,$,J,Q,X,Y,Z,ee,te,ie;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;u=[se],S=[se],p=[a],k=[a],v=[a],y=[a],_=[a],b=[a],w=[a],x=[a],B=[a],L=[a],C=[a],E=[a],F=[a],I=[a],T=[a],z=[a],M=[a],O=[a],R=[a],A=[a],V=[a],P=[a],G=[a],N=[a],q=[a],j=[a],U=[a],W=[a],D=[a],H=[a],K=[a],$=[a],J=[a],Q=[he],X=[a],Y=[a],Z=[a],ee=[a],te=[a],ie=[a],i(this,null,p,{kind:"method",name:"setResetCameraFn",static:!1,private:!1,access:{has:e=>"setResetCameraFn"in e,get:e=>e.setResetCameraFn},metadata:t},null,s),i(this,null,k,{kind:"method",name:"selectExhibitor",static:!1,private:!1,access:{has:e=>"selectExhibitor"in e,get:e=>e.selectExhibitor},metadata:t},null,s),i(this,null,v,{kind:"method",name:"selectBooth",static:!1,private:!1,access:{has:e=>"selectBooth"in e,get:e=>e.selectBooth},metadata:t},null,s),i(this,null,y,{kind:"method",name:"reset",static:!1,private:!1,access:{has:e=>"reset"in e,get:e=>e.reset},metadata:t},null,s),i(this,null,_,{kind:"method",name:"selectNone",static:!1,private:!1,access:{has:e=>"selectNone"in e,get:e=>e.selectNone},metadata:t},null,s),i(this,null,b,{kind:"method",name:"selectBookmarks",static:!1,private:!1,access:{has:e=>"selectBookmarks"in e,get:e=>e.selectBookmarks},metadata:t},null,s),i(this,null,w,{kind:"method",name:"selectVisited",static:!1,private:!1,access:{has:e=>"selectVisited"in e,get:e=>e.selectVisited},metadata:t},null,s),i(this,null,x,{kind:"method",name:"selectLanguage",static:!1,private:!1,access:{has:e=>"selectLanguage"in e,get:e=>e.selectLanguage},metadata:t},null,s),i(this,null,B,{kind:"method",name:"selectCategory",static:!1,private:!1,access:{has:e=>"selectCategory"in e,get:e=>e.selectCategory},metadata:t},null,s),i(this,null,L,{kind:"method",name:"selectEventItem",static:!1,private:!1,access:{has:e=>"selectEventItem"in e,get:e=>e.selectEventItem},metadata:t},null,s),i(this,null,C,{kind:"method",name:"selectSearch",static:!1,private:!1,access:{has:e=>"selectSearch"in e,get:e=>e.selectSearch},metadata:t},null,s),i(this,null,E,{kind:"method",name:"clickBookmarks",static:!1,private:!1,access:{has:e=>"clickBookmarks"in e,get:e=>e.clickBookmarks},metadata:t},null,s),i(this,null,F,{kind:"method",name:"clickVisited",static:!1,private:!1,access:{has:e=>"clickVisited"in e,get:e=>e.clickVisited},metadata:t},null,s),i(this,null,I,{kind:"method",name:"clickLanguage",static:!1,private:!1,access:{has:e=>"clickLanguage"in e,get:e=>e.clickLanguage},metadata:t},null,s),i(this,null,T,{kind:"method",name:"clickCategory",static:!1,private:!1,access:{has:e=>"clickCategory"in e,get:e=>e.clickCategory},metadata:t},null,s),i(this,null,z,{kind:"method",name:"clickSeminars",static:!1,private:!1,access:{has:e=>"clickSeminars"in e,get:e=>e.clickSeminars},metadata:t},null,s),i(this,null,M,{kind:"method",name:"clickBoothInList",static:!1,private:!1,access:{has:e=>"clickBoothInList"in e,get:e=>e.clickBoothInList},metadata:t},null,s),i(this,null,O,{kind:"method",name:"clickBoothInList2",static:!1,private:!1,access:{has:e=>"clickBoothInList2"in e,get:e=>e.clickBoothInList2},metadata:t},null,s),i(this,null,R,{kind:"method",name:"clickBooth",static:!1,private:!1,access:{has:e=>"clickBooth"in e,get:e=>e.clickBooth},metadata:t},null,s),i(this,null,A,{kind:"method",name:"clickExhibitor2",static:!1,private:!1,access:{has:e=>"clickExhibitor2"in e,get:e=>e.clickExhibitor2},metadata:t},null,s),i(this,null,V,{kind:"method",name:"clickExhibitor",static:!1,private:!1,access:{has:e=>"clickExhibitor"in e,get:e=>e.clickExhibitor},metadata:t},null,s),i(this,null,P,{kind:"method",name:"showMap",static:!1,private:!1,access:{has:e=>"showMap"in e,get:e=>e.showMap},metadata:t},null,s),i(this,null,G,{kind:"method",name:"showOverlay",static:!1,private:!1,access:{has:e=>"showOverlay"in e,get:e=>e.showOverlay},metadata:t},null,s),i(this,null,N,{kind:"method",name:"toggleMapOverlay",static:!1,private:!1,access:{has:e=>"toggleMapOverlay"in e,get:e=>e.toggleMapOverlay},metadata:t},null,s),i(this,null,q,{kind:"method",name:"moveToList",static:!1,private:!1,access:{has:e=>"moveToList"in e,get:e=>e.moveToList},metadata:t},null,s),i(this,null,j,{kind:"method",name:"moveToExhibitor",static:!1,private:!1,access:{has:e=>"moveToExhibitor"in e,get:e=>e.moveToExhibitor},metadata:t},null,s),i(this,null,U,{kind:"method",name:"changeActiveListIndex",static:!1,private:!1,access:{has:e=>"changeActiveListIndex"in e,get:e=>e.changeActiveListIndex},metadata:t},null,s),i(this,null,W,{kind:"method",name:"toggleModal",static:!1,private:!1,access:{has:e=>"toggleModal"in e,get:e=>e.toggleModal},metadata:t},null,s),i(this,null,D,{kind:"method",name:"openGallery",static:!1,private:!1,access:{has:e=>"openGallery"in e,get:e=>e.openGallery},metadata:t},null,s),i(this,null,H,{kind:"method",name:"closeGallery",static:!1,private:!1,access:{has:e=>"closeGallery"in e,get:e=>e.closeGallery},metadata:t},null,s),i(this,null,K,{kind:"method",name:"openActiveListItem",static:!1,private:!1,access:{has:e=>"openActiveListItem"in e,get:e=>e.openActiveListItem},metadata:t},null,s),i(this,null,$,{kind:"method",name:"toggleCategoryFilter",static:!1,private:!1,access:{has:e=>"toggleCategoryFilter"in e,get:e=>e.toggleCategoryFilter},metadata:t},null,s),i(this,null,J,{kind:"method",name:"applyCategoryFilters",static:!1,private:!1,access:{has:e=>"applyCategoryFilters"in e,get:e=>e.applyCategoryFilters},metadata:t},null,s),i(this,null,Q,{kind:"getter",name:"filteredExhibitors",static:!1,private:!1,access:{has:e=>"filteredExhibitors"in e,get:e=>e.filteredExhibitors},metadata:t},null,s),i(this,null,X,{kind:"method",name:"selectSessions",static:!1,private:!1,access:{has:e=>"selectSessions"in e,get:e=>e.selectSessions},metadata:t},null,s),i(this,null,Y,{kind:"method",name:"selectExhibitors",static:!1,private:!1,access:{has:e=>"selectExhibitors"in e,get:e=>e.selectExhibitors},metadata:t},null,s),i(this,null,Z,{kind:"method",name:"selectTours",static:!1,private:!1,access:{has:e=>"selectTours"in e,get:e=>e.selectTours},metadata:t},null,s),i(this,null,ee,{kind:"method",name:"selectSpeakers",static:!1,private:!1,access:{has:e=>"selectSpeakers"in e,get:e=>e.selectSpeakers},metadata:t},null,s),i(this,null,te,{kind:"method",name:"selectSpeaker",static:!1,private:!1,access:{has:e=>"selectSpeaker"in e,get:e=>e.selectSpeaker},metadata:t},null,s),i(this,null,ie,{kind:"method",name:"resetFilters",static:!1,private:!1,access:{has:e=>"resetFilters"in e,get:e=>e.resetFilters},metadata:t},null,s),i(null,null,u,{kind:"field",name:"initialized",static:!1,private:!1,access:{has:e=>"initialized"in e,get:e=>e.initialized,set:(e,o)=>{e.initialized=o}},metadata:t},d,m),i(null,null,S,{kind:"field",name:"resetCameraFn",static:!1,private:!1,access:{has:e=>"resetCameraFn"in e,get:e=>e.resetCameraFn,set:(e,o)=>{e.resetCameraFn=o}},metadata:t},f,g),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}categoryStore=n(this,s);exhibitorStore;boothStore;uiState;routeStore;routePlannerStore;toursStore;mapboxStore;layerStore;eventStore;poiTypeStore;heatmapStore;languageStore;fuzzySearchEngineStore;categoryFilterStore;sessionsFilterStore;speakerStore;speakerFilterStore;searchStore;searchButtonsStore;bookmarksStore;urlFilterManager;shortcutRegistry;rendererService=new je;fp;initialized=n(this,d,!1);resetCameraFn=(n(this,m),n(this,f,void 0));setResetCameraFn(t){this.resetCameraFn=t}constructor(){n(this,g),this.categoryStore=new me(this),this.exhibitorStore=new fe(this),this.boothStore=new ue(this),this.routeStore=new we(this),this.routePlannerStore=new xe(this),this.toursStore=new Be(this),this.uiState=new Le(this),this.mapboxStore=new be(this),this.layerStore=new _e,this.eventStore=new pe(this),this.heatmapStore=new ve(this),this.languageStore=new ye(this),this.poiTypeStore=new Ce(this),this.fuzzySearchEngineStore=new Fe,this.categoryFilterStore=new ge(this),this.sessionsFilterStore=new Ie(this),this.speakerStore=new Pe(this),this.speakerFilterStore=new Ge(this),this.searchStore=new ze(this),this.searchButtonsStore=new Me(this),this.bookmarksStore=new Oe(this),this.urlFilterManager=new Re(this),this.shortcutRegistry=new Ae,this.registerShortcutProviders()}selectExhibitor(t,e=!0){this.uiState.hoveredExhibitor=null,this.uiState.details=t;var o=t.booths.filter(h=>h.visible),l=t.booths.filter(h=>!h.visible);!o.length&&l.length&&this.layerStore.updateVisibility(l[0].layer,!0),e&&setTimeout(()=>this.moveToList(t.booths.filter(h=>h.visible)),c||r?500:50)}selectBooth(t,e=!0){let o=Array.isArray(t)?t:[t];this.uiState.details=o[0],o.length===1&&o[0].schedule?.length&&(this.uiState.desiredOverlaySize="medium"),o.length===1&&o[0].layer&&!o[0].visible&&this.layerStore.mode===re.Radio&&this.layerStore.updateVisibility(o[0].layer,!0),e&&setTimeout(()=>this.moveToList(o),c||r?500:50)}reset(){const t=window.__searchi;t&&t.querySelector&&t.querySelector("input[type=search]")&&t.querySelector("input[type=search]").blur&&t.querySelector("input[type=search]").blur(),window.setTimeout(()=>{this.uiState.setKioskModeEnabled||(localStorage.removeItem("language"),this.languageStore.changeLanguage(Te()).then(()=>{ae(()=>{this.selectSearch(""),this.routeStore.defaultFrom&&!this.routeStore.defaultFrom?.visible?this.selectBooth(this.routeStore.defaultFrom):this.uiState.details=null,this.resetCameraFn?.(),this.uiState.menu=!1,this.searchStore.resetSearchBox(),this.searchButtonsStore.clearAllFilters()}),setTimeout(()=>{ae(()=>{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:"language",id:this.languageStore.language?.id}}selectCategory(t){window.__resett&&window.__resett(),this.uiState.details=t,this.uiState.list={type:"category",category:t},this.uiState.desiredOverlaySize="full",t.exhibitors.find(o=>o.booths.find(l=>l.visible))||this.layerStore.updateVisibility(t.exhibitors[0]?.booths[0]?.layer,!0),setTimeout(()=>{this.uiState.moveToBooths=t.exhibitors.filter(o=>o.booths.find(l=>l.visible)).flatMap(o=>o.booths)},200)}selectEventItem(t,e=!0){if(this.uiState.hoveredExhibitor=null,this.uiState.details=t,this.uiState.desiredOverlaySize="medium",t.boothId){const o=this.boothStore.booths.find(l=>l.id===t.boothId);o&&o.layer&&!o.visible&&this.layerStore.mode===re.Radio&&this.layerStore.updateVisibility(o.layer,!0)}e&&setTimeout(()=>{if(t.boothId){const o=this.boothStore.booths.find(l=>l.id===t.boothId);o&&this.moveToList([o])}},c||r?500:50)}selectSearch(t){window.__resett&&window.__resett(),this.uiState.details=null,this.speakerStore.clearSelectedSpeaker(),this.uiState.list={type:"search",text:Ee(t,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(t){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectCategory(t),this.uiState.onCategoryClick&&this.uiState.onCategoryClick({id:t.id,name:t.name,exhibitors:t.exhibitors.map(e=>e.id)}),setTimeout(()=>{this.moveToList(),this.showMap()},100)}clickSeminars(){this.clickCategory(this.categoryStore.seminarsCategory)}clickBoothInList(t){window.__resett&&window.__resett(),this.uiState.hoveredBooth=null,this.selectBooth(t),this.moveToList([t]),this.showMap()}clickBoothInList2(t){window.__resett&&window.__resett(),this.uiState.hoveredBooth=null,this.selectBooth(t,!1),window.setTimeout(()=>{this.moveToList([t]),this.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50)}clickBooth(t){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(),!(this.uiState.selectedRoute?.from&&this.uiState.selectedRoute?.to)){if(this.uiState.selectedRoute?.to&&!this.uiState.selectedRoute?.from&&t){this.routeStore.setStartPoint(t);return}if(t)this.routeStore.tempToBooth=t;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){const e={name:"",description:""},o={target:{...t,layer:t.layer||e}};this.uiState.onBoothClick(o)}t.exhibitors.length===1&&t instanceof de?(this.heatmapStore.forceTrack={action:ke.ViewBooth,label:t.name},this.selectExhibitor(t.exhibitors[0],!1)):this.selectBooth(t,!1),this.showMap()}}clickExhibitor2(t){this.selectExhibitor(t,!0),this.showMap()}clickExhibitor(t){window.setTimeout(()=>{this.clickExhibitor2(t)},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50)}showMap(){const t=this.uiState.details;t&&"schedule"in t&&t.schedule?.length>0?this.uiState.desiredOverlaySize="full":this.uiState.overlayPosition==="bottom"&&ce&&(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(t){t=t||this.uiState.listItems;const e=[];t.forEach(o=>{o instanceof le?e.push(...o.booths.filter(l=>l.visible)):o instanceof oe&&e.push(o)}),this.uiState.moveToBooths=e}moveToExhibitor(t){this.moveToList([t])}changeActiveListIndex(t){let e=this.uiState.activeListIndex+t;e=Math.max(0,Math.min(this.uiState.listItems.length-1,e)),this.uiState.activeListIndex=e}toggleModal(t){this.uiState.modalActive[t]=!this.uiState.modalActive[t]}openGallery(){this.uiState.galleryActive=!0}closeGallery(){this.uiState.galleryActive=!1}openActiveListItem(){const t=this.uiState.listItems[this.uiState.activeListIndex];t&&(ne.log("Opening",t),t instanceof le?this.clickExhibitor(t):t instanceof Se?this.clickCategory(t):t instanceof oe&&this.clickBoothInList2(t))}toggleCategoryFilter(){this.uiState.categoryFilterOpen=!this.uiState.categoryFilterOpen}applyCategoryFilters(t){this.uiState.selectedCategoryFilters=t,this.uiState.categoryFilterOpen=!1}get filteredExhibitors(){return this.uiState.selectedCategoryFilters.length===0?this.exhibitorStore.exhibitors:this.exhibitorStore.exhibitors.filter(t=>this.uiState.selectedCategoryFilters.some(e=>t.categories.some(o=>o.id===e.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"),r&&(this.uiState.desiredOverlaySize="full")}selectExhibitors(){this.uiState.list={type:"exhibitors",text:"",focused:!1},this.uiState.menu=!1,r&&(this.uiState.desiredOverlaySize="full")}selectTours(){this.uiState.list={type:"tours",text:"",focused:!1},this.uiState.menu=!1,r&&(this.uiState.desiredOverlaySize="full")}selectSpeakers(){this.uiState.list={type:"speakers",text:"",focused:!1},this.uiState.menu=!1,r&&(this.uiState.desiredOverlaySize="full")}selectSpeaker(t,e=!0){this.speakerStore.selectSpeaker(t,e)}resetFilters(){this.searchButtonsStore.clearAllFilters()}registerShortcutProviders(){this.shortcutRegistry.register(new Ve(this)),this.shortcutRegistry.register(new Ne(this)),this.shortcutRegistry.register(new qe(this))}}})();export default Ue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__esDecorate as i,__runInitializers as r}from"tslib";import{action as m,computed as g,observable as u}from"mobx";import{Point as Ze,lineLength as Me}from"simple-geometry";import n,{boothStore as qe,layersStore as R}from".";import{fpGeo as L}from"../components/Mapbox/utils/fpGeo";import $e from"../core/Rect";import{GaEventActions as Ve,sendEventToGa as je}from"../tools/gtag";import{convertGpsToLocal as Be,isValidPointCoords as Ce,calculateRelativeBearing as We}from"../utils/gps";import{getLayerSvg as Ke,svgArea as Ye}from"../data/svg";import{getGraphLines as He,sublines as Je}from"../utils/wayfinding";import{LayersMode as Qe}from"./LayerStore";import{uiState as p}from"./index";import{calcSpeed as Fe}from"../utils/calcSpeed";import{calcTravelTime as Ge}from"../utils/calcTravelTime";import{DEFAULT_UNITS as Ue,ORIENTATION_GRANTED_KEY as Xe}from"../constants";import{areLayersEnabled as et}from"../utils/areLayersEnabled";import{distancePointToRouteOnLayer as tt,findBoothInRadius as st}from"../components/Map/drawing/config/route-snapping";import Ne from"../data";const _=a=>typeof a=="string"?Number(a.replace(",",".")):a;let at=(()=>{let a=[],o,l=[],d=[],f,b=[],v=[],S,E=[],z=[],P,D=[],I=[],w,A=[],M=[],B,C=[],F=[],G,U=[],N=[],O,Z=[],q=[],$,V=[],j=[],W,K=[],Y=[],H,J=[],Q=[],X,ee=[],te=[],se,ae=[],ie=[],re,oe=[],ne=[],le,ce,ue,de,fe,he,me,pe,_e,ye,ge,ke,be,ve=[],xe=[],Re,Le,Te,Se,Ee,ze,Pe=[],De=[],Ie,we;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;o=[u],f=[u],S=[u],P=[u],w=[u],B=[u],G=[u],O=[u],$=[u],W=[u],H=[u],X=[u],se=[u],re=[u],le=[g],ce=[m],ue=[m],de=[g({keepAlive:!0})],fe=[g({keepAlive:!0})],he=[m],me=[m],pe=[g({keepAlive:!0})],_e=[g({keepAlive:!0})],ye=[m],ge=[m],ke=[m],be=[u],Re=[g],Le=[m],Te=[m],Se=[m],Ee=[m],ze=[u],Ie=[m],we=[g({keepAlive:!0})],i(this,null,le,{kind:"getter",name:"canFindLocation",static:!1,private:!1,access:{has:e=>"canFindLocation"in e,get:e=>e.canFindLocation},metadata:t},null,a),i(this,null,ce,{kind:"method",name:"selectRoute",static:!1,private:!1,access:{has:e=>"selectRoute"in e,get:e=>e.selectRoute},metadata:t},null,a),i(this,null,ue,{kind:"method",name:"setStartPoint",static:!1,private:!1,access:{has:e=>"setStartPoint"in e,get:e=>e.setStartPoint},metadata:t},null,a),i(this,null,de,{kind:"getter",name:"pathLayers",static:!1,private:!1,access:{has:e=>"pathLayers"in e,get:e=>e.pathLayers},metadata:t},null,a),i(this,null,fe,{kind:"getter",name:"nearestBooth",static:!1,private:!1,access:{has:e=>"nearestBooth"in e,get:e=>e.nearestBooth},metadata:t},null,a),i(this,null,he,{kind:"method",name:"setMarkers",static:!1,private:!1,access:{has:e=>"setMarkers"in e,get:e=>e.setMarkers},metadata:t},null,a),i(this,null,me,{kind:"method",name:"selectMarker",static:!1,private:!1,access:{has:e=>"selectMarker"in e,get:e=>e.selectMarker},metadata:t},null,a),i(this,null,pe,{kind:"getter",name:"selectedMarkers",static:!1,private:!1,access:{has:e=>"selectedMarkers"in e,get:e=>e.selectedMarkers},metadata:t},null,a),i(this,null,_e,{kind:"getter",name:"layers",static:!1,private:!1,access:{has:e=>"layers"in e,get:e=>e.layers},metadata:t},null,a),i(this,null,ye,{kind:"method",name:"clickRoute",static:!1,private:!1,access:{has:e=>"clickRoute"in e,get:e=>e.clickRoute},metadata:t},null,a),i(this,null,ge,{kind:"method",name:"selectCurrentPosition",static:!1,private:!1,access:{has:e=>"selectCurrentPosition"in e,get:e=>e.selectCurrentPosition},metadata:t},null,a),i(this,null,ke,{kind:"method",name:"findLocation",static:!1,private:!1,access:{has:e=>"findLocation"in e,get:e=>e.findLocation},metadata:t},null,a),i(this,null,Re,{kind:"getter",name:"routeInfo",static:!1,private:!1,access:{has:e=>"routeInfo"in e,get:e=>e.routeInfo},metadata:t},null,a),i(this,null,Le,{kind:"method",name:"updateRoute",static:!1,private:!1,access:{has:e=>"updateRoute"in e,get:e=>e.updateRoute},metadata:t},null,a),i(this,null,Te,{kind:"method",name:"updateRouteDistance",static:!1,private:!1,access:{has:e=>"updateRouteDistance"in e,get:e=>e.updateRouteDistance},metadata:t},null,a),i(this,null,Se,{kind:"method",name:"updateRoutePoints",static:!1,private:!1,access:{has:e=>"updateRoutePoints"in e,get:e=>e.updateRoutePoints},metadata:t},null,a),i(this,null,Ee,{kind:"method",name:"checkRoutes",static:!1,private:!1,access:{has:e=>"checkRoutes"in e,get:e=>e.checkRoutes},metadata:t},null,a),i(this,null,Ie,{kind:"method",name:"setGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"setGpsTrackingEnabled"in e,get:e=>e.setGpsTrackingEnabled},metadata:t},null,a),i(this,null,we,{kind:"getter",name:"gpsEnabled",static:!1,private:!1,access:{has:e=>"gpsEnabled"in e,get:e=>e.gpsEnabled},metadata:t},null,a),i(null,null,o,{kind:"field",name:"routeLines",static:!1,private:!1,access:{has:e=>"routeLines"in e,get:e=>e.routeLines,set:(e,s)=>{e.routeLines=s}},metadata:t},l,d),i(null,null,f,{kind:"field",name:"routeDistance",static:!1,private:!1,access:{has:e=>"routeDistance"in e,get:e=>e.routeDistance,set:(e,s)=>{e.routeDistance=s}},metadata:t},b,v),i(null,null,S,{kind:"field",name:"currentPosition",static:!1,private:!1,access:{has:e=>"currentPosition"in e,get:e=>e.currentPosition,set:(e,s)=>{e.currentPosition=s}},metadata:t},E,z),i(null,null,P,{kind:"field",name:"requestCompass",static:!1,private:!1,access:{has:e=>"requestCompass"in e,get:e=>e.requestCompass,set:(e,s)=>{e.requestCompass=s}},metadata:t},D,I),i(null,null,w,{kind:"field",name:"iconType",static:!1,private:!1,access:{has:e=>"iconType"in e,get:e=>e.iconType,set:(e,s)=>{e.iconType=s}},metadata:t},A,M),i(null,null,B,{kind:"field",name:"tempToBooth",static:!1,private:!1,access:{has:e=>"tempToBooth"in e,get:e=>e.tempToBooth,set:(e,s)=>{e.tempToBooth=s}},metadata:t},C,F),i(null,null,G,{kind:"field",name:"defaultFrom",static:!1,private:!1,access:{has:e=>"defaultFrom"in e,get:e=>e.defaultFrom,set:(e,s)=>{e.defaultFrom=s}},metadata:t},U,N),i(null,null,O,{kind:"field",name:"focusEnabled",static:!1,private:!1,access:{has:e=>"focusEnabled"in e,get:e=>e.focusEnabled,set:(e,s)=>{e.focusEnabled=s}},metadata:t},Z,q),i(null,null,$,{kind:"field",name:"prevZ",static:!1,private:!1,access:{has:e=>"prevZ"in e,get:e=>e.prevZ,set:(e,s)=>{e.prevZ=s}},metadata:t},V,j),i(null,null,W,{kind:"field",name:"markersData",static:!1,private:!1,access:{has:e=>"markersData"in e,get:e=>e.markersData,set:(e,s)=>{e.markersData=s}},metadata:t},K,Y),i(null,null,H,{kind:"field",name:"prevMarkers",static:!1,private:!1,access:{has:e=>"prevMarkers"in e,get:e=>e.prevMarkers,set:(e,s)=>{e.prevMarkers=s}},metadata:t},J,Q),i(null,null,X,{kind:"field",name:"showAccessible",static:!1,private:!1,access:{has:e=>"showAccessible"in e,get:e=>e.showAccessible,set:(e,s)=>{e.showAccessible=s}},metadata:t},ee,te),i(null,null,se,{kind:"field",name:"onlyAccessible",static:!1,private:!1,access:{has:e=>"onlyAccessible"in e,get:e=>e.onlyAccessible,set:(e,s)=>{e.onlyAccessible=s}},metadata:t},ae,ie),i(null,null,re,{kind:"field",name:"currentRouteLayer",static:!1,private:!1,access:{has:e=>"currentRouteLayer"in e,get:e=>e.currentRouteLayer,set:(e,s)=>{e.currentRouteLayer=s}},metadata:t},oe,ne),i(null,null,be,{kind:"field",name:"routeUnits",static:!1,private:!1,access:{has:e=>"routeUnits"in e,get:e=>e.routeUnits,set:(e,s)=>{e.routeUnits=s}},metadata:t},ve,xe),i(null,null,ze,{kind:"field",name:"isGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"isGpsTrackingEnabled"in e,get:e=>e.isGpsTrackingEnabled,set:(e,s)=>{e.isGpsTrackingEnabled=s}},metadata:t},Pe,De),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=r(this,a);cpTimeout;routeLines=r(this,l,[]);routeDistance=(r(this,d),r(this,b,null));currentPosition=(r(this,v),r(this,E,null));requestCompass=(r(this,z),r(this,D,!1));iconType=(r(this,I),r(this,A,0));tempToBooth=(r(this,M),r(this,C,null));defaultFrom=(r(this,F),r(this,U,null));focusEnabled=(r(this,N),r(this,Z,!0));prevZ=(r(this,q),r(this,V,null));markersData=(r(this,j),r(this,K,{icons:[],markers:[]}));prevMarkers=(r(this,Y),r(this,J,[]));showAccessible=(r(this,Q),r(this,ee,!!Je()?.lines?.find(t=>t.unaccessible)));onlyAccessible=(r(this,te),r(this,ae,!1));currentRouteLayer=(r(this,ie),r(this,oe,null));constructor(t){r(this,De),this.rootStore=t,this.focusEnabled=!window.location.search}get canFindLocation(){return!!this.defaultFrom||!!this.currentPosition}selectRoute(t,e=!0){e&&(p.list={type:"search",text:"",focused:!1}),!t?.from&&t?.to&&this.currentPosition&&(t.from=this.nearestBooth),t?.from&&t?.to&&t.from===t.to&&(t=null);let s=[];t?.from&&t?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),t?.from?.visible&&s.push(t.from),t?.to?.visible&&(this.tempToBooth=null,s.push(t.to)),!t&&n.fp.onDirection&&n.fp.onDirection(null),setTimeout(()=>{this.rootStore.moveToList(s),p.details=t,t&&(!t.from||!t.to)&&n.showOverlay(),t?.to&&t?.from?.layer&&this.rootStore.layerStore.updateVisibility(t.from.layer,!0),!this.currentRouteLayer&&t?.from?.layer&&(this.currentRouteLayer=t?.from?.layer),t?.from&&t?.to&&je(Ve.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)},200)}setStartPoint(t){const e=p.selectedRoute;if(e?.to&&!e?.from&&t){const s=new Route(t,e.to,e.waypoints);this.selectRoute(s)}}get pathLayers(){return n.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,s)=>s.indexOf(t)===e).reverse().map((t,e)=>({id:e+1,layer:n.layerStore.findLayer(t)}))}get nearestBooth(){return this.getNearestBooth(this.currentPosition)}getNearestBooth(t){if(!t)return null;let e=this.rootStore.layerStore.findLayer(t.z);const s=t.lat&&t.lng?Be(t,L.properties.config):t;return this.rootStore.boothStore.booths.filter(c=>R.mode===Qe.Default||!e?c.visible&&c.rect:c.rect&&(typeof t.z!="number"&&!t.z&&c.visible||e.name===c.layer?.name)).sort((c,h)=>Me(s,{x:c.rect.cx,y:c.rect.cy})-Me(s,{x:h.rect.cx,y:h.rect.cy}))[0]||null}setMarkers(t){this.markersData.markers=(t?.markers??[]).map(it),this.markersData.icons=t?.icons??[]}selectMarker(t,e){const s=this.markersData.markers.find(h=>h.id===t);this.markersData.markers.forEach(h=>h.active=!1),s&&(s.active=!0);let c=n.layerStore.findLayer(s?.z);return e&&s?(c&&!c?.visible&&R.updateVisibility(c,!0),n?.renderer?.controls.panTo(s.x,s.y)):Promise.resolve()}get selectedMarkers(){return this.markersData.markers.filter(t=>t.active)}get layers(){var t=[];return n.routeStore.routeLines?.map(e=>e.p0.layer).reverse().forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>n.layerStore.layers.find(s=>s.name===e))}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=null,p.list.type==="route-planner"&&(p.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(this.defaultFrom||t,e))}selectCurrentPosition(t,e=!0,s){clearTimeout(this.cpTimeout),t&&(t.x=_(t.x),t.y=_(t.y),t.lat=_(t.lat),t.lng=_(t.lng),et()||(t.z=null)),e=!(e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route))&&(this.focusEnabled||this.prevZ!=t?.z),this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString(),this.iconType=s?1:0;const h=t?rt(t):null;if(!h){this.currentPosition=null;return}const y=new CurrentPosition(h.x,h.y,t.z||this.currentRouteLayer?.name,We(h),t.lat,t.lng),T=p.selectedRoute,k=n.layerStore.findLayer(t.z);let Ae=!this.routeLines?.length;k&&this.routeLines?.length&&(Ae=!!this.routeLines.find(x=>x.p0.layer===k.name||x.p1.layer===k.name)),e&&Ae&&(k&&!k?.visible&&R.updateVisibility(k,!0),this.rootStore.renderer?.controls.panTo(y.x,y.y));const Oe=!L?.properties?.config?.disableRerouting&&ot(y,this.routeLines)&&!!st(y,qe.booths,[T?.to]);if(T&&Oe){const x=n.routeStore.getNearestBooth(y);n.routeStore.selectRoute(new Route(x,T?.to),!1)}this.currentPosition=y,this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(this.canFindLocation){if(n.mapboxStore.showMapbox){p.moveToLocation=!0;return}if(n.routeStore.currentPosition){const t=n.routeStore.currentPosition,e=$e.fromCxcywh(t.x,t.y,100,100);if(!e.intersects(Ye))return;localStorage.getItem(Xe)==="false"&&(n.routeStore.requestCompass=!0),p.moveToRect=e;const c=n.layerStore.findLayer(n.routeStore.currentPosition?.z);c&&R.updateVisibility(c,!0)}else n.selectBooth(n.routeStore.defaultFrom)}}routeUnits=(r(this,ne),r(this,ve,Ue));get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:Ge(t,Fe(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=Ke(),s=(e.getAttribute("units")||Ue).toLowerCase?.().trim(),c=e.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(t/(c?1:10)),this.routeUnits=s,this.updateRoutePoints()}updateRoutePoints(){const t=p.selectedRoute,e=this.routeDistance,s=this.routeUnits;n.fp.onDirection&&setTimeout(()=>{n.fp.onDirection({from:t?.from?{id:t.from.id,name:t.from.name,externalId:t.from.externalId,layer:{name:t.from?.layer?.name,description:t.from?.layer?.description}}:null,to:t?.to?{id:t.to.id,name:t.to.name,externalId:t.to.externalId,layer:{name:t.to.layer?.name,description:t.to.layer?.description}}:null,lines:this.routeLines,distance:`${e}${s}`,units:s,time:Ge(e,Fe(s))})},200)}checkRoutes(){let t=n.boothStore.booths;console.info(`Route check started ${t.length}.... `);for(let e=0;e<t.length;e++){const s=t[e];for(let c=e+1;c<t.length;c++){const h=t[c];He(s,h).length||console.warn(`No route found from ${s.name} to ${h.name}`)}}console.info("Route check done....")}isGpsTrackingEnabled=(r(this,xe),r(this,Pe,!0));setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return Ne.autoTrackingGps&&this.isGpsTrackingEnabled&&!Ne.enableIPS}}})();export default at;function it(a){return{...a,x:_(a.x),y:_(a.y),lat:_(a.lat),lng:_(a.lng)}}function rt(a){let o=null,l=null;return L&&(o=L.properties.config),o&&a.x>=o.p0.x&&a.x<=o.p2.x&&a.y>=o.p0.y&&a.y<=o.p2.y?l={...a}:o&&Ce(a.lat)&&Ce(a.lng)?l=Be(a,o):o||(l=a),l||null}export function findBooth(a){return n.boothStore.findBooth(a)||n.exhibitorStore.findExhibitor(a)?.booths[0]}export function findEntityByExternalId(a){const o=n.boothStore.boothByExternalId.get(a);if(o)return{type:"booth",entity:o};const l=n.exhibitorStore.exhibitorByExternalId.get(a);if(l)return{type:"exhibitor",entity:l}}export function separateExternalIds(a){const o=[],l=[];for(const d of a){const f=findEntityByExternalId(d);f&&(f.type==="booth"?o.push(d):l.push(d))}return{boothExternalIds:o,exhibitorExternalIds:l}}export function extractRoute(a,o,l){return new Route(findBooth(a)??n.routeStore.defaultFrom??null,findBooth(o),l?.map(d=>findBooth(d)))}export class Route{from;to;waypoints;constructor(o,l,d){this.from=o,this.to=l,this.waypoints=d,this.waypoints=d?.filter(f=>f&&f.id!==o?.id&&f.id!==l?.id)}}export class CurrentPosition extends Ze{x;y;z;angle;lat;lng;constructor(o,l,d,f,b,v){super(o,l),this.x=o,this.y=l,this.z=d,this.angle=f,this.lat=b,this.lng=v}}function ot(a,o,l=10){if(!a||!o?.length)return!1;const d={layer:a.z?String(a.z):void 0,x:a.x,y:a.y},f=tt(d,o);return isFinite(f)&&f>l}
|
|
1
|
+
import{__esDecorate as i,__runInitializers as r}from"tslib";import{action as m,computed as k,observable as d}from"mobx";import{Point as qe,lineLength as Me}from"simple-geometry";import o,{boothStore as $e,layersStore as x}from".";import{fpGeo as S}from"../components/Mapbox/utils/fpGeo";import Ve from"../core/Rect";import{GaEventActions as je,sendEventToGa as We}from"../tools/gtag";import{convertGpsToLocal as Be,isValidPointCoords as Ce,calculateRelativeBearing as Ke}from"../utils/gps";import{getLayerSvg as Ye,svgArea as He}from"../data/svg";import{getGraphLines as Je,sublines as Qe}from"../utils/wayfinding";import{LayersMode as Xe}from"./LayerStore";import{uiState as p}from"./index";import{calcSpeed as Fe}from"../utils/calcSpeed";import{calcTravelTime as Ge}from"../utils/calcTravelTime";import{DEFAULT_UNITS as Ue,ORIENTATION_GRANTED_KEY as et}from"../constants";import{areLayersEnabled as tt}from"../utils/areLayersEnabled";import{distancePointToRouteOnLayer as st,findBoothInRadius as at}from"../components/Map/drawing/config/route-snapping";import Ne from"../data";import Oe from"../tools/logger";const y=a=>typeof a=="string"?Number(a.replace(",",".")):a;let it=(()=>{let a=[],n,l=[],f=[],h,v=[],R=[],L,E=[],z=[],P,D=[],I=[],w,A=[],M=[],B,C=[],F=[],G,U=[],N=[],O,Z=[],q=[],$,V=[],j=[],W,K=[],Y=[],H,J=[],Q=[],X,ee=[],te=[],se,ae=[],ie=[],re,ne=[],oe=[],le,ce,ue,de,fe,he,me,pe,_e,ye,ge,ke,be,ve=[],Re=[],xe,Se,Te,Le,Ee,ze,Pe=[],De=[],Ie,we;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[d],h=[d],L=[d],P=[d],w=[d],B=[d],G=[d],O=[d],$=[d],W=[d],H=[d],X=[d],se=[d],re=[d],le=[k],ce=[m],ue=[m],de=[k({keepAlive:!0})],fe=[k({keepAlive:!0})],he=[m],me=[m],pe=[k({keepAlive:!0})],_e=[k({keepAlive:!0})],ye=[m],ge=[m],ke=[m],be=[d],xe=[k],Se=[m],Te=[m],Le=[m],Ee=[m],ze=[d],Ie=[m],we=[k({keepAlive:!0})],i(this,null,le,{kind:"getter",name:"canFindLocation",static:!1,private:!1,access:{has:e=>"canFindLocation"in e,get:e=>e.canFindLocation},metadata:t},null,a),i(this,null,ce,{kind:"method",name:"selectRoute",static:!1,private:!1,access:{has:e=>"selectRoute"in e,get:e=>e.selectRoute},metadata:t},null,a),i(this,null,ue,{kind:"method",name:"setStartPoint",static:!1,private:!1,access:{has:e=>"setStartPoint"in e,get:e=>e.setStartPoint},metadata:t},null,a),i(this,null,de,{kind:"getter",name:"pathLayers",static:!1,private:!1,access:{has:e=>"pathLayers"in e,get:e=>e.pathLayers},metadata:t},null,a),i(this,null,fe,{kind:"getter",name:"nearestBooth",static:!1,private:!1,access:{has:e=>"nearestBooth"in e,get:e=>e.nearestBooth},metadata:t},null,a),i(this,null,he,{kind:"method",name:"setMarkers",static:!1,private:!1,access:{has:e=>"setMarkers"in e,get:e=>e.setMarkers},metadata:t},null,a),i(this,null,me,{kind:"method",name:"selectMarker",static:!1,private:!1,access:{has:e=>"selectMarker"in e,get:e=>e.selectMarker},metadata:t},null,a),i(this,null,pe,{kind:"getter",name:"selectedMarkers",static:!1,private:!1,access:{has:e=>"selectedMarkers"in e,get:e=>e.selectedMarkers},metadata:t},null,a),i(this,null,_e,{kind:"getter",name:"layers",static:!1,private:!1,access:{has:e=>"layers"in e,get:e=>e.layers},metadata:t},null,a),i(this,null,ye,{kind:"method",name:"clickRoute",static:!1,private:!1,access:{has:e=>"clickRoute"in e,get:e=>e.clickRoute},metadata:t},null,a),i(this,null,ge,{kind:"method",name:"selectCurrentPosition",static:!1,private:!1,access:{has:e=>"selectCurrentPosition"in e,get:e=>e.selectCurrentPosition},metadata:t},null,a),i(this,null,ke,{kind:"method",name:"findLocation",static:!1,private:!1,access:{has:e=>"findLocation"in e,get:e=>e.findLocation},metadata:t},null,a),i(this,null,xe,{kind:"getter",name:"routeInfo",static:!1,private:!1,access:{has:e=>"routeInfo"in e,get:e=>e.routeInfo},metadata:t},null,a),i(this,null,Se,{kind:"method",name:"updateRoute",static:!1,private:!1,access:{has:e=>"updateRoute"in e,get:e=>e.updateRoute},metadata:t},null,a),i(this,null,Te,{kind:"method",name:"updateRouteDistance",static:!1,private:!1,access:{has:e=>"updateRouteDistance"in e,get:e=>e.updateRouteDistance},metadata:t},null,a),i(this,null,Le,{kind:"method",name:"updateRoutePoints",static:!1,private:!1,access:{has:e=>"updateRoutePoints"in e,get:e=>e.updateRoutePoints},metadata:t},null,a),i(this,null,Ee,{kind:"method",name:"checkRoutes",static:!1,private:!1,access:{has:e=>"checkRoutes"in e,get:e=>e.checkRoutes},metadata:t},null,a),i(this,null,Ie,{kind:"method",name:"setGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"setGpsTrackingEnabled"in e,get:e=>e.setGpsTrackingEnabled},metadata:t},null,a),i(this,null,we,{kind:"getter",name:"gpsEnabled",static:!1,private:!1,access:{has:e=>"gpsEnabled"in e,get:e=>e.gpsEnabled},metadata:t},null,a),i(null,null,n,{kind:"field",name:"routeLines",static:!1,private:!1,access:{has:e=>"routeLines"in e,get:e=>e.routeLines,set:(e,s)=>{e.routeLines=s}},metadata:t},l,f),i(null,null,h,{kind:"field",name:"routeDistance",static:!1,private:!1,access:{has:e=>"routeDistance"in e,get:e=>e.routeDistance,set:(e,s)=>{e.routeDistance=s}},metadata:t},v,R),i(null,null,L,{kind:"field",name:"currentPosition",static:!1,private:!1,access:{has:e=>"currentPosition"in e,get:e=>e.currentPosition,set:(e,s)=>{e.currentPosition=s}},metadata:t},E,z),i(null,null,P,{kind:"field",name:"requestCompass",static:!1,private:!1,access:{has:e=>"requestCompass"in e,get:e=>e.requestCompass,set:(e,s)=>{e.requestCompass=s}},metadata:t},D,I),i(null,null,w,{kind:"field",name:"iconType",static:!1,private:!1,access:{has:e=>"iconType"in e,get:e=>e.iconType,set:(e,s)=>{e.iconType=s}},metadata:t},A,M),i(null,null,B,{kind:"field",name:"tempToBooth",static:!1,private:!1,access:{has:e=>"tempToBooth"in e,get:e=>e.tempToBooth,set:(e,s)=>{e.tempToBooth=s}},metadata:t},C,F),i(null,null,G,{kind:"field",name:"defaultFrom",static:!1,private:!1,access:{has:e=>"defaultFrom"in e,get:e=>e.defaultFrom,set:(e,s)=>{e.defaultFrom=s}},metadata:t},U,N),i(null,null,O,{kind:"field",name:"focusEnabled",static:!1,private:!1,access:{has:e=>"focusEnabled"in e,get:e=>e.focusEnabled,set:(e,s)=>{e.focusEnabled=s}},metadata:t},Z,q),i(null,null,$,{kind:"field",name:"prevZ",static:!1,private:!1,access:{has:e=>"prevZ"in e,get:e=>e.prevZ,set:(e,s)=>{e.prevZ=s}},metadata:t},V,j),i(null,null,W,{kind:"field",name:"markersData",static:!1,private:!1,access:{has:e=>"markersData"in e,get:e=>e.markersData,set:(e,s)=>{e.markersData=s}},metadata:t},K,Y),i(null,null,H,{kind:"field",name:"prevMarkers",static:!1,private:!1,access:{has:e=>"prevMarkers"in e,get:e=>e.prevMarkers,set:(e,s)=>{e.prevMarkers=s}},metadata:t},J,Q),i(null,null,X,{kind:"field",name:"showAccessible",static:!1,private:!1,access:{has:e=>"showAccessible"in e,get:e=>e.showAccessible,set:(e,s)=>{e.showAccessible=s}},metadata:t},ee,te),i(null,null,se,{kind:"field",name:"onlyAccessible",static:!1,private:!1,access:{has:e=>"onlyAccessible"in e,get:e=>e.onlyAccessible,set:(e,s)=>{e.onlyAccessible=s}},metadata:t},ae,ie),i(null,null,re,{kind:"field",name:"currentRouteLayer",static:!1,private:!1,access:{has:e=>"currentRouteLayer"in e,get:e=>e.currentRouteLayer,set:(e,s)=>{e.currentRouteLayer=s}},metadata:t},ne,oe),i(null,null,be,{kind:"field",name:"routeUnits",static:!1,private:!1,access:{has:e=>"routeUnits"in e,get:e=>e.routeUnits,set:(e,s)=>{e.routeUnits=s}},metadata:t},ve,Re),i(null,null,ze,{kind:"field",name:"isGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"isGpsTrackingEnabled"in e,get:e=>e.isGpsTrackingEnabled,set:(e,s)=>{e.isGpsTrackingEnabled=s}},metadata:t},Pe,De),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=r(this,a);cpTimeout;routeLines=r(this,l,[]);routeDistance=(r(this,f),r(this,v,null));currentPosition=(r(this,R),r(this,E,null));requestCompass=(r(this,z),r(this,D,!1));iconType=(r(this,I),r(this,A,0));tempToBooth=(r(this,M),r(this,C,null));defaultFrom=(r(this,F),r(this,U,null));focusEnabled=(r(this,N),r(this,Z,!0));prevZ=(r(this,q),r(this,V,null));markersData=(r(this,j),r(this,K,{icons:[],markers:[]}));prevMarkers=(r(this,Y),r(this,J,[]));showAccessible=(r(this,Q),r(this,ee,!!Qe()?.lines?.find(t=>t.unaccessible)));onlyAccessible=(r(this,te),r(this,ae,!1));currentRouteLayer=(r(this,ie),r(this,ne,null));constructor(t){r(this,De),this.rootStore=t,this.focusEnabled=!window.location.search}get canFindLocation(){return!!this.defaultFrom||!!this.currentPosition}selectRoute(t,e=!0){e&&(p.list={type:"search",text:"",focused:!1}),!t?.from&&t?.to&&this.currentPosition&&(t.from=this.nearestBooth),t?.from&&t?.to&&t.from===t.to&&(t=null);let s=[];t?.from&&t?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),t?.from?.visible&&s.push(t.from),t?.to?.visible&&(this.tempToBooth=null,s.push(t.to)),!t&&o.fp.onDirection&&o.fp.onDirection(null),setTimeout(()=>{this.rootStore.moveToList(s),p.details=t,t&&(!t.from||!t.to)&&o.showOverlay(),t?.to&&t?.from?.layer&&this.rootStore.layerStore.updateVisibility(t.from.layer,!0),!this.currentRouteLayer&&t?.from?.layer&&(this.currentRouteLayer=t?.from?.layer),e&&t?.from&&t?.to&&We(je.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)},200)}setStartPoint(t){const e=p.selectedRoute;if(e?.to&&!e?.from&&t){const s=new Route(t,e.to,e.waypoints);this.selectRoute(s)}}get pathLayers(){return o.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,s)=>s.indexOf(t)===e).reverse().map((t,e)=>({id:e+1,layer:o.layerStore.findLayer(t)}))}get nearestBooth(){return this.getNearestBooth(this.currentPosition)}getNearestBooth(t){if(!t)return null;let e=this.rootStore.layerStore.findLayer(t.z);const s=t.lat&&t.lng?Be(t,S.properties.config):t;return this.rootStore.boothStore.booths.filter(c=>x.mode===Xe.Default||!e?c.visible&&c.rect:c.rect&&(typeof t.z!="number"&&!t.z&&c.visible||e.name===c.layer?.name)).sort((c,u)=>Me(s,{x:c.rect.cx,y:c.rect.cy})-Me(s,{x:u.rect.cx,y:u.rect.cy}))[0]||null}setMarkers(t){this.markersData.markers=(t?.markers??[]).map(rt),this.markersData.icons=t?.icons??[]}selectMarker(t,e){const s=this.markersData.markers.find(u=>u.id===t);this.markersData.markers.forEach(u=>u.active=!1),s&&(s.active=!0);let c=o.layerStore.findLayer(s?.z);if(e&&s){const u=o.rendererService.renderer;return c&&!c?.visible&&x.updateVisibility(c,!0),u?u.controls.panTo(s.x,s.y):(Oe.warn("Renderer is not initialized. Cannot pan to marker."),Promise.resolve())}return Promise.resolve()}get selectedMarkers(){return this.markersData.markers.filter(t=>t.active)}get layers(){var t=[];return o.routeStore.routeLines?.map(e=>e.p0.layer).reverse().forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>o.layerStore.layers.find(s=>s.name===e))}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=null,p.list.type==="route-planner"&&(p.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(this.defaultFrom||t,e))}selectCurrentPosition(t,e=!0,s){clearTimeout(this.cpTimeout),t&&(t.x=y(t.x),t.y=y(t.y),t.lat=y(t.lat),t.lng=y(t.lng),tt()||(t.z=null)),e=!(e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route))&&(this.focusEnabled||this.prevZ!=t?.z),this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString(),this.iconType=s?1:0;const u=t?nt(t):null;if(!u){this.currentPosition=null;return}const _=o.layerStore.findLayer(t.z),b=new CurrentPosition(u.x,u.y,_?.name||this.currentRouteLayer?.name,Ke(u),t.lat,t.lng),T=p.selectedRoute;let Ae=!this.routeLines?.length;if(_&&this.routeLines?.length&&(Ae=!!this.routeLines.find(g=>g.p0.layer===_.name||g.p1.layer===_.name)),e&&Ae){const g=o.rendererService.renderer;if(_&&!_?.visible&&x.updateVisibility(_,!0),!g){Oe.warn("Renderer is not initialized. Cannot pan to current position.");return}g.controls.panTo(b.x,b.y)}const Ze=!S?.properties?.config?.disableRerouting&&ot(b,this.routeLines)&&!!at(b,$e.booths,[T?.to]);if(T&&Ze){const g=o.routeStore.getNearestBooth(b);o.routeStore.selectRoute(new Route(g,T?.to),!1)}this.currentPosition=b,this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(this.canFindLocation){if(o.mapboxStore.showMapbox){p.moveToLocation=!0;return}if(o.routeStore.currentPosition){const t=o.routeStore.currentPosition,e=Ve.fromCxcywh(t.x,t.y,100,100);if(!e.intersects(He))return;localStorage.getItem(et)==="false"&&(o.routeStore.requestCompass=!0),p.moveToRect=e;const c=o.layerStore.findLayer(o.routeStore.currentPosition?.z);c&&x.updateVisibility(c,!0)}else o.selectBooth(o.routeStore.defaultFrom)}}routeUnits=(r(this,oe),r(this,ve,Ue));get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:Ge(t,Fe(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=Ye(),s=(e.getAttribute("units")||Ue).toLowerCase?.().trim(),c=e.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(t/(c?1:10)),this.routeUnits=s,this.updateRoutePoints()}updateRoutePoints(){const t=p.selectedRoute,e=this.routeDistance,s=this.routeUnits;o.fp.onDirection&&setTimeout(()=>{o.fp.onDirection({from:t?.from?{id:t.from.id,name:t.from.name,externalId:t.from.externalId,layer:{name:t.from?.layer?.name,description:t.from?.layer?.description}}:null,to:t?.to?{id:t.to.id,name:t.to.name,externalId:t.to.externalId,layer:{name:t.to.layer?.name,description:t.to.layer?.description}}:null,lines:this.routeLines,distance:`${e}${s}`,units:s,time:Ge(e,Fe(s))})},200)}checkRoutes(){let t=o.boothStore.booths;console.info(`Route check started ${t.length}.... `);for(let e=0;e<t.length;e++){const s=t[e];for(let c=e+1;c<t.length;c++){const u=t[c];Je(s,u).length||console.warn(`No route found from ${s.name} to ${u.name}`)}}console.info("Route check done....")}isGpsTrackingEnabled=(r(this,Re),r(this,Pe,!0));setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return Ne.autoTrackingGps&&this.isGpsTrackingEnabled&&!Ne.enableIPS}}})();export default it;function rt(a){return{...a,x:y(a.x),y:y(a.y),lat:y(a.lat),lng:y(a.lng)}}function nt(a){let n=null,l=null;return S&&(n=S.properties.config),n&&a.x>=n.p0.x&&a.x<=n.p2.x&&a.y>=n.p0.y&&a.y<=n.p2.y?l={...a}:n&&Ce(a.lat)&&Ce(a.lng)?l=Be(a,n):n||(l=a),l||null}export function findBooth(a){return o.boothStore.findBooth(a)||o.exhibitorStore.findExhibitor(a)?.booths[0]}export function findEntityByExternalId(a){const n=o.boothStore.boothByExternalId.get(a);if(n)return{type:"booth",entity:n};const l=o.exhibitorStore.exhibitorByExternalId.get(a);if(l)return{type:"exhibitor",entity:l}}export function separateExternalIds(a){const n=[],l=[];for(const f of a){const h=findEntityByExternalId(f);h&&(h.type==="booth"?n.push(f):l.push(f))}return{boothExternalIds:n,exhibitorExternalIds:l}}export function extractRoute(a,n,l){return new Route(findBooth(a)??o.routeStore.defaultFrom??null,findBooth(n),l?.map(f=>findBooth(f)))}export class Route{from;to;waypoints;constructor(n,l,f){this.from=n,this.to=l,this.waypoints=f,this.waypoints=f?.filter(h=>h&&h.id!==n?.id&&h.id!==l?.id)}}export class CurrentPosition extends qe{x;y;z;angle;lat;lng;constructor(n,l,f,h,v,R){super(n,l),this.x=n,this.y=l,this.z=f,this.angle=h,this.lat=v,this.lng=R}}function ot(a,n,l=10){if(!a||!n?.length)return!1;const f={layer:a.z?String(a.z):void 0,x:a.x,y:a.y},h=st(f,n);return isFinite(h)&&h>l}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Rect from "../core/Rect";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import Size from "../core/Size";
|
|
3
|
+
import { Booth } from "./BoothStore";
|
|
4
|
+
import { Category } from "./CategoryStore";
|
|
5
5
|
import { Exhibitor } from "./ExhibitorStore";
|
|
6
6
|
import { RawPoiType } from "../data/Data";
|
|
7
7
|
import RootStore from "./RootStore";
|