@expofp/floorplan 3.10.0 → 3.10.2
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/{Button-CbNlJYq-.js → Button-Bj5GinNb.js} +6 -6
- package/dist/browser/{CookieConsent-BVLqsKtm.js → CookieConsent-vekYv-WL.js} +7 -7
- package/dist/browser/{Debug-DniNgMUO.js → Debug-B8Z6UAk7.js} +7 -7
- package/dist/browser/{Demo-BXOuVfdG.js → Demo-DxKBQPXs.js} +10 -10
- package/dist/browser/{Free-DbDrs1SH.js → Free-xJ581Tn5.js} +10 -10
- package/dist/browser/{Gallery-CK2yO-rS.js → Gallery-BCLvsYMq.js} +10 -10
- package/dist/browser/{GpsLoader-B5WB_xlb.js → GpsLoader-D8b4YGWa.js} +25 -25
- package/dist/browser/{KioskStore-CzIrPa11.js → KioskStore-iac7BFkc.js} +28 -28
- package/dist/browser/{MaplibreAdapter-CSa9XGJa.js → MaplibreAdapter-hBzzKWxy.js} +2597 -2462
- package/dist/browser/{ModalContainer-CduduGaw.js → ModalContainer-CNFkEgVO.js} +11 -11
- package/dist/browser/{PermissionNotice-B62dyKda.js → PermissionNotice-BjNUzq-I.js} +7 -7
- package/dist/browser/{SetKioskMode-DvbL360U.js → SetKioskMode-rZPgTzX2.js} +11 -11
- package/dist/browser/{ShowKiosk-CK47Q2V7.js → ShowKiosk-C0-HDdLS.js} +11 -11
- package/dist/browser/{TouchHand-BHu7qEu9.js → TouchHand-BpAIvJuD.js} +4 -4
- package/dist/browser/{ViewerMenuPanel-TTUNLqUt.js → ViewerMenuPanel-B8HWceZY.js} +10 -10
- package/dist/browser/{add-debug-secret-listener-DN1tIBbN.js → add-debug-secret-listener-DrG0zrQz.js} +1 -1
- package/dist/browser/{boolean-editor-CcJuEdkU.js → boolean-editor-CksHtQqy.js} +45 -45
- package/dist/browser/{bootIntercom-DyEAiiah.js → bootIntercom-DIY2vGKD.js} +2 -2
- package/dist/browser/booth-by-xy-CB4TcAKe.js +1067 -0
- package/dist/browser/{browser-Ctb0x-hW.js → browser-BJI7T84p.js} +2 -2
- package/dist/browser/bundle.json +62 -62
- package/dist/browser/{classnames-CeriETl9.js → classnames-DY5QZHM2.js} +2 -2
- package/dist/browser/{client-hS_SUT9J.js → client-BKj8O-3N.js} +10 -10
- package/dist/browser/{components-CcIkwnTn.js → components-C9T4gWSC.js} +1674 -1674
- package/dist/browser/{debug-overlay-DBRVNju-.js → debug-overlay-oxl07sGQ.js} +355 -355
- package/dist/browser/{debug-ui-Vy_hMYMs.js → debug-ui-vcgITEra.js} +6 -6
- package/dist/browser/{dist-CyHdGr2I.js → dist-B6a_6LWa.js} +64 -63
- package/dist/browser/{dist-Bimiy1i5.js → dist-BD71uIJa.js} +5 -5
- package/dist/browser/{dist-D3O88lUU.js → dist-DQ-MzacE.js} +3 -3
- package/dist/browser/{efp-debug-init-C0HXaTIA.js → efp-debug-init-DeppnUIb.js} +2 -2
- package/dist/browser/{enum-editor-DkQTyshB.js → enum-editor-CeBF-egH.js} +478 -478
- package/dist/browser/{es5-BI29YLB7.js → es5-DyEOE9h8.js} +2 -2
- package/dist/browser/{event-not-found-C45GofSi.js → event-not-found--rNrnsfb.js} +1 -1
- package/dist/browser/{exports-B2fVUjK8.js → exports-CQRMT27z.js} +449 -443
- package/dist/browser/{favicon-CZB9txqZ.js → favicon-Y_DfJIgc.js} +1 -1
- package/dist/browser/{fetch-retry.umd-C_1YSqZv.js → fetch-retry.umd-mDEk7YNi.js} +2 -2
- package/dist/browser/{flex-C4nAB--c.js → flex-gMXInosq.js} +7 -7
- package/dist/browser/{floorplan.loader-D9ci7TWk.js → floorplan.loader-CKHHfoqW.js} +1284 -1282
- package/dist/browser/{floorplan.ready-Cou1AYpA.js → floorplan.ready-Dk5rTB4-.js} +291 -291
- package/dist/browser/{fuse-DLH3KYAO.js → fuse-C0XgkQam.js} +4 -4
- package/dist/browser/{i18n-C0K3C5Jv.js → i18n-DDp2WKLS.js} +19 -20
- package/dist/browser/index.js +12 -12
- package/dist/browser/{index.module-BMETmKP4.js → index.module-DJ1o-lSs.js} +4 -4
- package/dist/browser/{is-webview-CxvtAxIZ.js → is-webview-DSeLj16c.js} +1 -1
- package/dist/browser/{jsx-runtime-B9nB58Uq.js → jsx-runtime-4SB5tKoZ.js} +2 -2
- package/dist/browser/{lib-CcxG8Udi.js → lib-CNsibyKE.js} +4 -4
- package/dist/browser/{loadImage-B-fxupzg.js → loadImage-m5qxmKm8.js} +4 -4
- package/dist/browser/{logDeviceInfo-kZTVPeyv.js → logDeviceInfo-DJbQFFfl.js} +9 -9
- package/dist/browser/{main-B_62LzEM.js → main-Ci70zd7U.js} +1 -1
- package/dist/browser/{mobx-CUQ-tbco.js → mobx-85FEI3nE.js} +4 -4
- package/dist/browser/{particles.min-Csuxu9yr.js → particles.min-Cjclve40.js} +2 -2
- package/dist/browser/{prop-types-B7Gun2Sn.js → prop-types-O5uO9swn.js} +2 -2
- package/dist/browser/{react-ZKXuYPAa.js → react-938H1sny.js} +2 -2
- package/dist/browser/{react-dom-D82ielqJ.js → react-dom-BB5-5CwA.js} +3 -3
- package/dist/browser/{reset-all-settings-BwbmLw6_.js → reset-all-settings-C3UGYA7h.js} +7 -7
- package/dist/browser/{rolldown-runtime-75nnKCA3.js → rolldown-runtime-D_bOcK0P.js} +1 -1
- package/dist/browser/{settings-CfbArDtc.js → settings-CuvIoKLw.js} +2 -2
- package/dist/browser/{settings-item-R9UibMb5.js → settings-item-jhTAtSrk.js} +15 -15
- package/dist/browser/{store-DANngpFy.js → store-g-LcmXc-.js} +7024 -6098
- package/dist/browser/{string-editor-CURRcjvv.js → string-editor-CjVQpF6U.js} +22 -22
- package/dist/browser/{theme-Nw3wi1eA.js → theme-DxKuEQUA.js} +927 -930
- package/dist/browser/{ui-CzHA_XVw.js → ui-BMAImlSF.js} +8 -8
- package/dist/browser/{useRenderTarget-KMx97ZHc.js → useRenderTarget-DL0u3FKy.js} +4 -4
- package/dist/esm/components/Map/Map.js +1 -1
- package/dist/esm/components/Maplibre/MaplibreAdapter.js +1 -1
- package/dist/esm/components/Maplibre/MaplibreWrapper.js +1 -1
- package/dist/esm/components/Maplibre/styles/mapbox-streets-bright.d.ts +3 -0
- package/dist/esm/components/Maplibre/styles/mapbox-streets-bright.js +16 -0
- package/dist/esm/components/Maplibre/styles/mapbox-streets.d.ts +3 -0
- package/dist/esm/components/Maplibre/styles/mapbox-streets.js +16 -0
- package/dist/esm/components/Maplibre/useCameraReactions.d.ts +4 -3
- package/dist/esm/components/Maplibre/useCameraReactions.js +1 -1
- package/dist/esm/components/Maplibre/useWayfindingAndMarkers.js +1 -1
- package/dist/esm/components/Maplibre/utils/geo-config.d.ts +5 -8
- package/dist/esm/components/Maplibre/utils/geo-config.js +1 -1
- package/dist/esm/components/Maplibre/utils/map-helpers.js +1 -1
- package/dist/esm/components/Maplibre/utils/solver.d.ts +6 -7
- package/dist/esm/components/Maplibre/utils/solver.js +1 -1
- package/dist/esm/data/svg.d.ts +2 -1
- package/dist/esm/data/svg.js +1 -1
- package/dist/esm/renderer/RendererService.d.ts +2 -1
- package/dist/esm/renderer/RendererService.js +1 -1
- package/dist/esm/store/LayerStore.d.ts +1 -0
- package/dist/esm/store/LayerStore.js +1 -1
- package/dist/esm/store/RouteStore.d.ts +1 -2
- package/dist/esm/store/RouteStore.js +1 -1
- package/dist/esm/store/UIState.js +1 -1
- package/dist/esm/utils/gps.js +1 -1
- package/dist/esm/utils/planBearing.d.ts +14 -0
- package/dist/esm/utils/planBearing.js +1 -0
- package/dist/esm/utils/scene-bounds.d.ts +57 -0
- package/dist/esm/utils/scene-bounds.js +1 -0
- package/dist/esm/wayfinding/adapters/canvasIconProvider.d.ts +1 -1
- package/dist/esm/wayfinding/adapters/canvasIconProvider.js +1 -1
- package/dist/esm/wayfinding/adapters/graphDataSource.d.ts +2 -1
- package/dist/esm/wayfinding/adapters/graphDataSource.js +1 -1
- package/dist/esm/wayfinding/adapters/index.d.ts +3 -4
- package/dist/esm/wayfinding/adapters/index.js +1 -1
- package/dist/esm/wayfinding/bindMobxReactions.d.ts +6 -0
- package/dist/esm/wayfinding/bindMobxReactions.js +1 -1
- package/dist/esm/wayfinding/core/__tests__/helpers.d.ts +4 -4
- package/dist/esm/wayfinding/core/createWayfindingEngine.js +1 -1
- package/dist/esm/wayfinding/core/graph/buildGraph.d.ts +1 -1
- package/dist/esm/wayfinding/core/graph/buildNGraph.d.ts +2 -2
- package/dist/esm/wayfinding/core/graph/findShortestPath.d.ts +2 -2
- package/dist/esm/wayfinding/core/graph/graphHelpers.d.ts +4 -4
- package/dist/esm/wayfinding/core/graph/graphHelpers.js +1 -1
- package/dist/esm/wayfinding/core/graph/linkCost.d.ts +2 -2
- package/dist/esm/wayfinding/core/index.d.ts +8 -8
- package/dist/esm/wayfinding/core/index.js +1 -1
- package/dist/esm/wayfinding/core/position/gpsThreshold.d.ts +2 -2
- package/dist/esm/wayfinding/core/routing/getRouteLength.d.ts +1 -1
- package/dist/esm/wayfinding/core/types.d.ts +19 -9
- package/dist/esm/wayfinding/createWayfinding.d.ts +15 -1
- package/dist/esm/wayfinding/createWayfinding.js +1 -1
- package/dist/esm/wayfinding/handlers/yahHandler.d.ts +3 -3
- package/dist/esm/wayfinding/handlers/yahHandler.js +1 -1
- package/dist/esm/wayfinding/index.d.ts +13 -0
- package/dist/esm/wayfinding/index.js +1 -0
- package/dist/esm/wayfinding/renderer/createWayfindingRenderer.js +1 -1
- package/dist/esm/wayfinding/renderer/iconManager.d.ts +3 -3
- package/dist/esm/wayfinding/renderer/routeLineManager.d.ts +5 -5
- package/dist/esm/wayfinding/renderer/trailManager.d.ts +2 -2
- package/dist/esm/wayfinding/runtime/createWayfindingRuntime.js +1 -1
- package/dist/esm/wayfinding/runtime/endpointView.d.ts +1 -2
- package/dist/esm/wayfinding/runtime/positionTrailView.d.ts +5 -6
- package/dist/esm/wayfinding/runtime/positionView.d.ts +2 -3
- package/dist/esm/wayfinding/runtime/routeUpdate.d.ts +3 -3
- package/dist/esm/wayfinding/runtime/trailView.d.ts +1 -2
- package/dist/esm/wayfinding/runtime/transitionView.d.ts +2 -3
- package/dist/esm/wayfinding/runtime/types.d.ts +10 -2
- package/package.json +8 -8
- package/dist/browser/createWayfinding-D3oRCnRo.js +0 -1892
- package/dist/esm/wayfinding/adapters/iconProvider.d.ts +0 -15
- package/dist/esm/wayfinding/adapters/iconProvider.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as
|
|
1
|
+
import{useEffect as r}from"react";import i from"../../store";import{createWayfinding as m}from"../../wayfinding";import{configMarkers as a}from"../Map/drawing/config/config-markers";export function useWayfindingAndMarkers(t,o){r(()=>{if(!t)return;const f=m(o,i),n=a(o);return()=>{f?.(),n?.()}},[t,o])}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
3
|
-
import type
|
|
4
|
-
import type
|
|
1
|
+
import { type Box } from '@expofp/geometry';
|
|
2
|
+
import { type LngLatBoundsLike, type Map as MaplibreMap } from 'maplibre-gl';
|
|
3
|
+
import { type GeoConfig as MaplibreGeoConfig } from '../MaplibreWrapper';
|
|
4
|
+
import { type TransformGeoConfig } from './solver';
|
|
5
5
|
export interface GeoConfig extends MaplibreGeoConfig {
|
|
6
6
|
gpsConfig: TransformGeoConfig;
|
|
7
7
|
}
|
|
@@ -21,10 +21,7 @@ export declare const INITIAL_FIT_ZOOM_ADJUSTMENT = 0.15;
|
|
|
21
21
|
export declare function deriveVenueMapBounds(config: TransformGeoConfig): LngLatBoundsLike | undefined;
|
|
22
22
|
export declare function getLocalRectGeoBounds(rect: Box, config: TransformGeoConfig): LngLatBoundsLike;
|
|
23
23
|
export declare function getVisibleRectFitPadding(extraPadding?: number): CameraPaddingOptions;
|
|
24
|
-
/**
|
|
25
|
-
* Derive the geographic configuration from the fpGeo data.
|
|
26
|
-
* Returns null if geo data is not available.
|
|
27
|
-
*/
|
|
24
|
+
/** Geographic configuration from fpGeo data; null when unavailable. */
|
|
28
25
|
export declare function deriveGeoConfig(): GeoConfig | null;
|
|
29
26
|
export declare function fitMapToLocalRect(map: MaplibreMap | null, rect: Box | null, geoConfig: GeoConfig | null, options?: FitMapOptions): void;
|
|
30
27
|
//# sourceMappingURL=geo-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fpGeo as
|
|
1
|
+
import{LngLatBounds as R}from"maplibre-gl";import{fpGeo as y}from"../../../data/fpGeo";import{svgArea as c}from"../../../data/svg";import{uiState as b}from"../../../store";import{convertLocalToGps as f}from"../../../utils/gps";import{planBearing as z}from"../../../utils/planBearing";export const MAP_BOUNDS_PADDING_FACTOR=3,MAP_BOUNDS_MIN_PADDING_DEGREES=.02,INITIAL_FIT_ZOOM_ADJUSTMENT=.15;const p=1.42,M=.35,D=.9,E=.85,A=8,S=.05;export function deriveVenueMapBounds(t){const n=[[c.min.x,c.min.y],[c.max.x,c.min.y],[c.max.x,c.max.y],[c.min.x,c.max.y]].map(([a,m])=>f(a,m,t));if(!n.every(([a,m])=>Number.isFinite(a)&&Number.isFinite(m)))return;const e=n.map(([a])=>a),o=n.map(([,a])=>a),i=Math.min(...e),r=Math.max(...e),s=Math.min(...o),u=Math.max(...o),x=Math.max((r-i)*MAP_BOUNDS_PADDING_FACTOR,MAP_BOUNDS_MIN_PADDING_DEGREES),h=Math.max((u-s)*MAP_BOUNDS_PADDING_FACTOR,MAP_BOUNDS_MIN_PADDING_DEGREES);return[[i-x,s-h],[r+x,u+h]]}function d(t,n,e,o){const i=Math.min(t.getZoom(),n),r=(e-i)*Math.min(1,o/p);return i+r>=t.getMinZoom()-S}function v(t,n,e){if(d(t,n,e,p))return p;if(!d(t,n,e,M))return null;let o=M,i=p;for(let r=0;r<A;r++){const s=(o+i)/2;d(t,n,e,s)?o=s:i=s}return o}export function getLocalRectGeoBounds(t,n){const e=[f(t.min.x,t.min.y,n),f(t.max.x,t.min.y,n),f(t.max.x,t.max.y,n),f(t.min.x,t.max.y,n)],o=e.map(([r])=>r),i=e.map(([,r])=>r);return[[Math.min(...o),Math.min(...i)],[Math.max(...o),Math.max(...i)]]}export function getVisibleRectFitPadding(t=0){const n=b.canvasVisibleRectPx,e=b.screenSize;return!n||!e?{top:t,bottom:t,left:t,right:t}:{top:Math.max(0,n.min.y)+t,bottom:Math.max(0,e.height-n.max.y)+t,left:Math.max(0,n.min.x)+t,right:Math.max(0,e.width-n.max.x)+t}}export function deriveGeoConfig(){if(!y?.properties?.config)return null;const t=y.properties.config,n=(t.p0.lng+t.p2.lng)/2,e=(t.p0.lat+t.p2.lat)/2,o=z(t.p0,t.p2),i=Number.isFinite(o)?o:t.bearing??0;return{center:[n,e],bearing:i,zoom:16,gpsConfig:t}}export function fitMapToLocalRect(t,n,e,o={}){if(!t||!n||!e||n.size.height===1/0||n.size.width===1/0||n.size.height<=0||n.size.width<=0)return;const i=getLocalRectGeoBounds(n,e.gpsConfig),r=getVisibleRectFitPadding(o.padding??50),s=t.cameraForBounds(i,{padding:r,bearing:e.bearing});if(!s?.center||typeof s.zoom!="number"){t.fitBounds(i,{padding:r,bearing:e.bearing,essential:!0});return}const u=t.project(t.getCenter()),x=t.project(s.center),h=Math.max(t.getCanvas().clientWidth,t.getCanvas().clientHeight,1),a=Math.hypot(x.x-u.x,x.y-u.y)/h,m=Math.abs(t.getZoom()-s.zoom),_=o.duration??Math.min(2800,500+a*450+m*150),l={center:s.center,zoom:s.zoom,bearing:e.bearing,duration:_,essential:!0};if(a<=1.2&&m<=1.5){t.easeTo(l);return}const O=t.getBounds().extend(R.convert(i)),g=t.cameraForBounds(O,{padding:r,bearing:e.bearing});if(!g?.center||typeof g.zoom!="number"||g.zoom>=t.getZoom()-.2){t.easeTo(l);return}const T=v(t,s.zoom,g.zoom);if(T!==null){const F=Math.max(M,T*D),L=Math.round(_*E);t.flyTo({...l,curve:F,duration:L});return}t.easeTo(l)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import u from"../../../store";import{MAP_DIM_LAYER_ID as c}from"../MaplibreWrapper";export const DEFAULT_TILE_SOURCE={style:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json"};const s=12;export const DEFAULT_MAP_OPTIONS={pitch:30,maxPitch:70,minZoom:s},MAP_2D_OPTIONS={pitch:0,maxPitch:0,minZoom:s};export function applyMapDimValue(t,e){t?.getLayer(c)&&(t.setPaintProperty(c,"fill-opacity",f(e)),t.triggerRepaint())}function f(t){return Math.min(Math.max(t,0),1)}export function applyMapOptions(t,e,i=!1){if(!t)return;t.setMinZoom(e.minZoom??null),t.setMaxZoom(e.maxZoom??null),t.setMaxBounds(e.maxBounds??null);const o=e.pitch,n=e.maxPitch,r=t.getPitch(),l=!!(i&&o!=null&&n!=null&&n<r);n!=null&&!l&&t.setMaxPitch(e.maxPitch),!(o==null||r===o)&&(i?(t.easeTo({pitch:o,duration:300}),l&&t.once("moveend",()=>t.setMaxPitch(n))):t.jumpTo({pitch:o}))}export function getTileSource(){const t=u.fp?.maplibre??window.__efpMaplibre;return t?.style?{style:t.style}:t?.styleUrl?{style:t.styleUrl}:DEFAULT_TILE_SOURCE}
|
|
@@ -10,14 +10,13 @@ export interface TransformGeoConfig {
|
|
|
10
10
|
p2: GeoAnchorPoint;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* the floorplan correctly inside a Maplibre `CustomLayerInterface`.
|
|
13
|
+
* Affine matrix mapping plan (SVG) coordinates to Mercator, used as the
|
|
14
|
+
* `staticTransform` in the `SceneDef` so the renderer can position the floor
|
|
15
|
+
* plan inside a Maplibre `CustomLayerInterface`.
|
|
17
16
|
*
|
|
18
|
-
*
|
|
19
|
-
* to
|
|
20
|
-
*
|
|
17
|
+
* Solved by Gaussian elimination from 3 anchors. The third anchor is synthesized
|
|
18
|
+
* perpendicular to the p0->p2 diagonal, so the result is a similarity transform
|
|
19
|
+
* (uniform scale + rotation, no shear).
|
|
21
20
|
*/
|
|
22
21
|
export declare function calculateTransformMatrix(geoConfig: TransformGeoConfig, units?: string | null): number[];
|
|
23
22
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{MercatorCoordinate as F}from"maplibre-gl";const S=1e-12,g=3.28084,y=6371e3,O=1,k=.02;export function calculateTransformMatrix(t,i){let r,a;try{r=q(t),a="perpendicular"}catch(h){if(!t.p1)throw h;r=t.p1,a="explicit-fallback"}const o=G(t);a==="perpendicular"&&o?.inconsistent&&console.warn("Maplibre geo: ignoring inconsistent anchor p1; placing venue from the p0->p2 diagonal.",{angleErrorDeg:o.angleErrorDeg,sideRatioError:o.ratioError});const n=[t.p0,r,t.p2],s=[],c=[],e=[];for(const h of n){B(h),c.push([h.x,h.y]);const p=F.fromLngLat([h.lng,h.lat],0),d=p.meterInMercatorCoordinateUnits();M(p.x),M(p.y),M(d),s.push(d),e.push([p.x,p.y])}const l=[],E=[];for(let h=0;h<3;h++){const[p,d]=c[h],[A,L]=e[h];l.push([p,d,1,0,0,0]),E.push(A),l.push([0,0,0,p,d,1]),E.push(L)}const P=V(l,E),[R,w,D,T,I,N]=P,_=i?.toLowerCase?.().trim()==="ft"?1/g:1,v=s.reduce((h,p)=>h+p,0)/s.length*_,f=[R,T,0,0,w,I,0,0,0,0,v,0,D,N,0,1];if(!f.every(Number.isFinite))throw new Error("Cannot calculate Maplibre transform: geo anchor points produced a non-finite matrix.");return f}function G(t){const i=t.p1;if(!i)return null;const r=Z(t.p0.x,t.p0.y,i.x,i.y,t.p2.x,t.p2.y),a=j(t.p0,i,t.p2),o=Math.abs(r.angleDeg-a.angleDeg),n=Number.isFinite(a.axisRatio)&&a.axisRatio>0?Math.abs(r.axisRatio/a.axisRatio-1):1/0;return{angleErrorDeg:o,ratioError:n,inconsistent:o>O||n>k}}function Z(t,i,r,a,o,n){const s=Math.hypot(r-t,a-i),c=Math.hypot(o-t,n-i),e=(r-t)*(o-t)+(a-i)*(n-i),l=s>0&&c>0?e/(s*c):NaN;return{axisRatio:s>0?c/s:1/0,angleDeg:m(Math.acos(Math.max(-1,Math.min(1,l))))}}function j(t,i,r){const a=x(t.lat,t.lng,i.lat,i.lng),o=x(t.lat,t.lng,r.lat,r.lng),n=b(t.lat,t.lng,i.lat,i.lng),s=b(t.lat,t.lng,r.lat,r.lng);let c=Math.abs(s-n)%360;return c>180&&(c=360-c),{axisRatio:a>0?o/a:1/0,angleDeg:c}}function q(t){const i=t.p2.x-t.p0.x,r=t.p2.y-t.p0.y;if(i===0&&r===0)throw new Error("Cannot calculate Maplibre transform: p0 and p2 have identical SVG coordinates.");const a=t.p0.x-r,o=t.p0.y+i,n=x(t.p0.lat,t.p0.lng,t.p2.lat,t.p2.lng),s=b(t.p0.lat,t.p0.lng,t.p2.lat,t.p2.lng),[c,e]=U(t.p0.lat,t.p0.lng,n,s+90);return{x:a,y:o,lat:e,lng:c}}function B(t){M(t.x),M(t.y),M(t.lat),M(t.lng)}function M(t){if(!Number.isFinite(t))throw new Error("Cannot calculate Maplibre transform: geo anchor points contain invalid coordinates.")}function u(t){return t*Math.PI/180}function m(t){return t*180/Math.PI}function x(t,i,r,a){const o=u(t),n=u(r),s=u(r-t),c=u(a-i),e=Math.sin(s/2)*Math.sin(s/2)+Math.cos(o)*Math.cos(n)*Math.sin(c/2)*Math.sin(c/2),l=2*Math.atan2(Math.sqrt(e),Math.sqrt(1-e));return y*l}function b(t,i,r,a){const o=u(t),n=u(r),s=u(a-i),c=Math.sin(s)*Math.cos(n),e=Math.cos(o)*Math.sin(n)-Math.sin(o)*Math.cos(n)*Math.cos(s);return(m(Math.atan2(c,e))+360)%360}function U(t,i,r,a){const o=r/y,n=u(a),s=u(t),c=u(i),e=Math.asin(Math.sin(s)*Math.cos(o)+Math.cos(s)*Math.sin(o)*Math.cos(n)),l=c+Math.atan2(Math.sin(n)*Math.sin(o)*Math.cos(s),Math.cos(o)-Math.sin(s)*Math.sin(e));return[m(l),m(e)]}function V(t,i){const r=t.length,a=t.map((n,s)=>[...n,i[s]]);for(let n=0;n<r;n++){let s=n;for(let c=n+1;c<r;c++)Math.abs(a[c][n])>Math.abs(a[s][n])&&(s=c);if([a[n],a[s]]=[a[s],a[n]],Math.abs(a[n][n])<S)throw new Error("Cannot calculate Maplibre transform: geo anchor points are collinear or invalid.");for(let c=n+1;c<r;c++){const e=a[c][n]/a[n][n];for(let l=n;l<=r;l++)a[c][l]-=e*a[n][l]}}const o=new Array(r);for(let n=r-1;n>=0;n--){o[n]=a[n][r];for(let s=n+1;s<r;s++)o[n]-=a[n][s]*o[s];o[n]/=a[n][n]}return o}
|
package/dist/esm/data/svg.d.ts
CHANGED
|
@@ -2,11 +2,12 @@ import { Box } from '@expofp/geometry';
|
|
|
2
2
|
import { Layer } from '../store/LayerStore';
|
|
3
3
|
declare const svgViewBox: Box;
|
|
4
4
|
declare let svgArea: Box;
|
|
5
|
+
declare let svgAreaExplicit: boolean;
|
|
5
6
|
declare let floors: {
|
|
6
7
|
name: string | undefined;
|
|
7
8
|
rect: Box;
|
|
8
9
|
}[];
|
|
9
|
-
export { floors, svgArea, svgViewBox };
|
|
10
|
+
export { floors, svgArea, svgAreaExplicit, svgViewBox };
|
|
10
11
|
export declare function getTrianglesFromFpPaths(index: number, suffix: string): number[][][];
|
|
11
12
|
export declare let gtePathByIndex: (index: number, suffix?: string) => any;
|
|
12
13
|
export declare let getLayerSvg: (layer?: Layer | string) => SVGElement;
|
package/dist/esm/data/svg.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Box as
|
|
1
|
+
import{Box as g}from"@expofp/geometry";import*as a from"d3-selection";import{STRING_META_DELIMITER as _}from"../constants";import v from"../tools/logger";import A from"../tools/settings";import{extractMetaFromString as x}from"../utils/extractMetaFromString";import B from".";const r=new Map;function w(e,n=""){if(r.has(n))return r.get(n);const s=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;s.firstChild.tagName==="parsererror"&&v.error("Parsed svg with error: ",c);const t=new Map;return a.select(s).selectAll("style").each(function(){const i=this.textContent,M=/\.([a-z0-9.]+)\s*{[^}]*fill\s*:\s*([^};]+);[^}]*}/gi;let h;for(;(h=M.exec(i))!==null;){const P=h[1],b=h[2];t.set(P,b)}}),a.select(s).selectAll("*[class]").each(function(){const i=this;i.style.fill=t.get(i.className.baseVal)}),E(s),r.set(n,s),s}let c=w(window.__fp);const l=window.__viewbox,p=a.select(c).select("rect#VIEWBOX").node(),d=c.viewBox.baseVal,m=new g(d.x,d.y,d.width,d.height);let f,u=!1;l?(f=new g(l.x,l.y,l.width,l.height),u=!0,p?.remove()):p?(f=g.fromSvg(p),u=!0,p.remove()):f=m.scale(1.1),a.select(c).attr("width",m.size.width),a.select(c).attr("height",m.size.height),v.log("svgArea",f,"svgViewBox",m),A.wayfinding=!!(!B.hideDirections&&window.__wfData);let S=window.__fpLayersMode?a.select(c).selectAll("[data-floor]").nodes().map(e=>(e.remove(),{name:e.dataset.floor,rect:g.fromSvg(e)})).sort():[];export{S as floors,f as svgArea,u as svgAreaExplicit,m as svgViewBox};export function getTrianglesFromFpPaths(e,n){const o=gtePathByIndex(e,n);for(const t of o.positions)t[1]=Math.abs(t[1]),t.length=2;const s=[];for(const t of o.cells)s.push([o.positions[t[0]],o.positions[t[1]],o.positions[t[2]]]);return s}export let gtePathByIndex=(e,n="")=>{try{return window[`__fpPaths${n}`][e]}catch{return window.__fpPaths[e]}},getLayerSvg=(e="")=>typeof e=="string"?r.has(e)?r.get(e):window[`__fp${e}`]?w(window[`__fp${e}`],e):r.get(""):e.rootParent?r.has(e.rootParent.name)?r.get(e.rootParent.name):window[`__fp${e.rootParent.name}`]?w(window[`__fp${e.rootParent.name}`],e.rootParent.name):r.get(""):window[`__fp${e.name}`]?w(window[`__fp${e.name}`],e.name):r.get("");function E(e){a.select(e).selectAll("[id], [data-name]").each(function(){const n=this;let o={};const s=n.getAttribute("data-name");if(s&&s.includes(_)){const{meta:i}=x(s);o={...o,...i}}const t=n.getAttribute("id");if(t&&t.includes(_)){const{meta:i}=x(t);o={...o,...i}}n.setAttribute("data-meta",JSON.stringify(o))})}
|
|
@@ -7,6 +7,7 @@ export declare class RendererService {
|
|
|
7
7
|
private _fontUrls;
|
|
8
8
|
private requestRepaint;
|
|
9
9
|
private currentPtScale;
|
|
10
|
+
private ptScaleCorrection;
|
|
10
11
|
private rendererEventsCleanup;
|
|
11
12
|
readonly ptScaleRegistry: HandlerRegistry<PtScaleHandler>;
|
|
12
13
|
readonly rollRegistry: HandlerRegistry<RollHandler>;
|
|
@@ -19,7 +20,7 @@ export declare class RendererService {
|
|
|
19
20
|
get angle(): number;
|
|
20
21
|
create(options: RendererOptions): Renderer;
|
|
21
22
|
start(scene: SceneDef): void;
|
|
22
|
-
attach(renderer: Renderer, scene: SceneDef, requestRepaint?: () => void): void;
|
|
23
|
+
attach(renderer: Renderer, scene: SceneDef, requestRepaint?: () => void, ptScaleCorrection?: number): void;
|
|
23
24
|
dispose(): void;
|
|
24
25
|
disposeIfCurrent(renderer: Renderer | null): void;
|
|
25
26
|
onPtScale(name: string, handler: PtScaleHandler): Disposer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Renderer as
|
|
1
|
+
import{Renderer as c}from"@expofp/renderer";import{HandlerRegistry as a}from"./HandlerRegistry";import{loadCustomFontsUrls as h}from"./index";import d from"../tools/logger";import{isDefaultScene as p}from"./engine-core/defs";export class RendererService{_renderer=null;_scene=null;_fontUrls=[];requestRepaint=null;currentPtScale=null;ptScaleCorrection=1;rendererEventsCleanup=null;ptScaleRegistry=new a;rollRegistry=new a;layerImagesRegistry=new a;get renderer(){return this._renderer?.isInitialized?this._renderer:null}get scene(){return this._scene}get fontUrls(){return this._fontUrls}getCameraState(){if(!this._renderer?.isInitialized){d.warn("Renderer is not initialized. Cannot get camera state.");return}return this._renderer.controls.getCameraState()}get scale(){return this.currentPtScale!==null?this.currentPtScale:this._renderer?.isInitialized?this._renderer.controls.getCameraState()?.ptScale??1:1}get angle(){return this._renderer?.isInitialized?this._renderer.controls.getCameraState()?.roll??0:0}create(e){return this._renderer=new c(e),this._fontUrls=h(),this.setupEventListeners(),this._renderer}start(e){if(this._scene=e,this.requestRepaint=null,!this._renderer)throw new Error("RendererService: renderer is not created.");this._renderer.init(e),this._renderer.start()}attach(e,r,l,n=1){this._renderer=e,this._scene=r,this._fontUrls=h(),this.requestRepaint=l??null,this.ptScaleCorrection=n,this.setupEventListeners()}dispose(){this.rendererEventsCleanup?.(),this.rendererEventsCleanup=null,this.ptScaleRegistry.clear(),this.rollRegistry.clear(),this.layerImagesRegistry.clear(),this._renderer?.dispose(),this._renderer=null,this._scene=null,this._fontUrls=[],this.requestRepaint=null,this.currentPtScale=null,this.ptScaleCorrection=1}disposeIfCurrent(e){if(!e||this._renderer!==e){e?.dispose();return}this.dispose()}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){if(!this._renderer.isInitialized){d.warn("Renderer is not initialized. Cannot update.");return}this._renderer.update(...e),this.requestRepaint?.()}}setupEventListeners(){this.rendererEventsCleanup?.(),this.rendererEventsCleanup=null;const e=this._renderer;if(!e)return;const r=n=>{const{ptScale:t,sceneId:i}=f(n);if(!p(i)||!Number.isFinite(t))return;const o=t*this.ptScaleCorrection;this.currentPtScale=o;const u=[...this.ptScaleRegistry.invoke(o)];u.length&&this.update(...u)},l=n=>{if(!Number.isFinite(n))return;const t=[];for(const i of this.rollRegistry.invoke(n))Array.isArray(i)?t.push(...i):t.push(i);t.length&&this.update(...t)};e.events.addEventListener("viewport:ptscale",r),e.events.addEventListener("navigation:roll",l),this.rendererEventsCleanup=()=>{e.events.removeEventListener("viewport:ptscale",r),e.events.removeEventListener("navigation:roll",l)}}}function f(s){return typeof s=="number"?{ptScale:s}:s}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__esDecorate as
|
|
1
|
+
import{__esDecorate as s,__runInitializers as o}from"tslib";import{Box as O}from"@expofp/geometry";import{action as w,computed as u,observable as h,runInAction as j}from"mobx";import C from"../components/Map/drawing/config/config-load-layer";import{areLayersEnabled as B}from"../utils/areLayersEnabled";import{shortenName as D}from"../utils/shortenName";import n from".";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 W=(()=>{let i,y=[],m=[],p,v=[],b=[];return class{static{const c=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;i=[h],p=[h],s(null,null,i,{kind:"field",name:"loaded",static:!1,private:!1,access:{has:l=>"loaded"in l,get:l=>l.loaded,set:(l,f)=>{l.loaded=f}},metadata:c},y,m),s(null,null,p,{kind:"field",name:"visible",static:!1,private:!1,access:{has:l=>"visible"in l,get:l=>l.visible,set:(l,f)=>{l.visible=f}},metadata:c},v,b),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;floorIndex;loaded=o(this,y,void 0);visible=(o(this,m),o(this,v,void 0));get shortName(){return D(this.description)}constructor(){o(this,b)}}})();export{W as Layer};let N=(()=>{let i=[],y,m=[],p=[],v,b=[],_=[],c,l=[],f=[],L,x=[],S=[],k,P,R,A,I,z,T,V,E;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;y=[h],v=[h],c=[h],L=[h],k=[u({keepAlive:!0})],P=[u({keepAlive:!0})],R=[u({keepAlive:!0})],A=[u({keepAlive:!0})],I=[u],z=[u],T=[w],V=[w],E=[w],s(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),s(this,null,P,{kind:"getter",name:"loaded",static:!1,private:!1,access:{has:e=>"loaded"in e,get:e=>e.loaded},metadata:t},null,i),s(this,null,R,{kind:"getter",name:"rectangle",static:!1,private:!1,access:{has:e=>"rectangle"in e,get:e=>e.rectangle},metadata:t},null,i),s(this,null,A,{kind:"getter",name:"viewboxRectangle",static:!1,private:!1,access:{has:e=>"viewboxRectangle"in e,get:e=>e.viewboxRectangle},metadata:t},null,i),s(this,null,I,{kind:"getter",name:"pathwayLayers",static:!1,private:!1,access:{has:e=>"pathwayLayers"in e,get:e=>e.pathwayLayers},metadata:t},null,i),s(this,null,z,{kind:"getter",name:"floors",static:!1,private:!1,access:{has:e=>"floors"in e,get:e=>e.floors},metadata:t},null,i),s(this,null,T,{kind:"method",name:"updateVisibility",static:!1,private:!1,access:{has:e=>"updateVisibility"in e,get:e=>e.updateVisibility},metadata:t},null,i),s(this,null,V,{kind:"method",name:"showPathWay",static:!1,private:!1,access:{has:e=>"showPathWay"in e,get:e=>e.showPathWay},metadata:t},null,i),s(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),s(null,null,y,{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},m,p),s(null,null,v,{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,_),s(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},l,f),s(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},x,S),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}layers=(o(this,i),o(this,m,[]));defaultLayer=(o(this,p),o(this,b,void 0));mode=(o(this,_),o(this,l,void 0));layersLoaded=(o(this,f),o(this,x,!1));updateVisibilityTimeout=(o(this,S),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:O.fromUnion(...t)||null}get viewboxRectangle(){var t=this.visible.filter(e=>!e.frozen&&e.viewbox).map(e=>e.viewbox);return t.length&&O.fromUnion(...t)||null}get pathwayLayers(){return this.layers.filter(t=>t.pathway)}get floors(){if(!B())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:a.floorIndex??e.length-r-1}})}updateVisibility(t,e){if(this.mode===LayersMode.Radio&&!e)return;const a=t instanceof W?t:this.findLayer(t);if(!a||a.visible===e){a&&n.routeStore.currentRouteLayer!==a&&(n.routeStore.currentRouteLayer=a);return}C(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 C(e,n.rendererService);const a=this.getPathwayList();j(()=>{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,6 +1,5 @@
|
|
|
1
1
|
import { Point } from '@expofp/geometry';
|
|
2
|
-
import { ArbitraryPoint } from '../wayfinding
|
|
3
|
-
import { RouteLine } from '../wayfinding/core';
|
|
2
|
+
import { ArbitraryPoint, type RouteLine } from '../wayfinding';
|
|
4
3
|
import { Booth } from './BoothStore';
|
|
5
4
|
import { Exhibitor } from './ExhibitorStore';
|
|
6
5
|
import { Layer } from './LayerStore';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__esDecorate as a,__runInitializers as r}from"tslib";import{action as h,computed as E,observable as f}from"mobx";import{Box as S,Point as He,boxContainsPoint as Je,pointDistance as Fe}from"@expofp/geometry";import c,{layersStore as L}from".";import{fpGeo as P}from"../data/fpGeo";import{getName as Qe}from"../components/Kiosk/SetKiosk";import{DEFAULT_UNITS as Ne,ORIENTATION_GRANTED_KEY as et}from"../constants";import Be from"../data";import{getLayerSvg as tt,svgArea as k}from"../data/svg";import{GaEventActions as st,sendEventToGa as it}from"../tools/gtag";import Ue from"../tools/logger";import{areLayersEnabled as at}from"../utils/areLayersEnabled";import{calcSpeed as Ze}from"../utils/calcSpeed";import{calcTravelTime as qe}from"../utils/calcTravelTime";import{calculateRelativeBearing as rt,convertGpsToLocal as $e,isValidPointCoords as Ve}from"../utils/gps";import{boothToEndpoint as Ke,CURRENT_LOCATION_NAME as nt,CURRENT_POSITION_POINT_ID as ot,graphDataSource as je,KIOSK_ANCHOR_POINT_ID as lt,toArbitraryPoint as We}from"../wayfinding/adapters";import{createWayfindingEngine as ct}from"../wayfinding/core";import{BoothBase as R}from"./BoothStore";import{uiState as _}from"./index";import{LayersMode as ut}from"./LayerStore";const b=s=>typeof s=="string"?Number(s.replace(",",".")):s;let dt=(()=>{let s=[],n,l=[],p=[],y,v=[],g=[],z,D=[],I=[],A,w=[],M=[],C,G=[],O=[],F,N=[],B=[],U,Z=[],q=[],$,V=[],K=[],j,W=[],X=[],Y,H=[],J=[],Q,ee=[],te=[],se,ie=[],ae=[],re,ne=[],oe=[],le,ce=[],ue=[],de,fe,me,he,pe,_e,ye,ge,ke,be,Re,ve,xe,Ee=[],Te=[],Le,Se,Pe,ze,De,Ie,Ae=[],we=[],Me,Ce,Ge;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[f],y=[f],z=[f],A=[f],C=[f],F=[f],U=[f],$=[f],j=[f],Y=[f],Q=[f],se=[f],re=[f],le=[f],de=[E],fe=[h],me=[h],he=[h],pe=[E({keepAlive:!0})],_e=[h],ye=[h],ge=[E({keepAlive:!0})],ke=[E({keepAlive:!0})],be=[h],Re=[h],ve=[h],xe=[f],Le=[E],Se=[h],Pe=[h],ze=[h],De=[h],Ie=[f],Me=[h],Ce=[E({keepAlive:!0})],Ge=[h],a(this,null,de,{kind:"getter",name:"canFindLocation",static:!1,private:!1,access:{has:e=>"canFindLocation"in e,get:e=>e.canFindLocation},metadata:t},null,s),a(this,null,fe,{kind:"method",name:"selectRoute",static:!1,private:!1,access:{has:e=>"selectRoute"in e,get:e=>e.selectRoute},metadata:t},null,s),a(this,null,me,{kind:"method",name:"rebuildRouteFromPosition",static:!1,private:!1,access:{has:e=>"rebuildRouteFromPosition"in e,get:e=>e.rebuildRouteFromPosition},metadata:t},null,s),a(this,null,he,{kind:"method",name:"setStartPoint",static:!1,private:!1,access:{has:e=>"setStartPoint"in e,get:e=>e.setStartPoint},metadata:t},null,s),a(this,null,pe,{kind:"getter",name:"pathLayers",static:!1,private:!1,access:{has:e=>"pathLayers"in e,get:e=>e.pathLayers},metadata:t},null,s),a(this,null,_e,{kind:"method",name:"setMarkers",static:!1,private:!1,access:{has:e=>"setMarkers"in e,get:e=>e.setMarkers},metadata:t},null,s),a(this,null,ye,{kind:"method",name:"selectMarker",static:!1,private:!1,access:{has:e=>"selectMarker"in e,get:e=>e.selectMarker},metadata:t},null,s),a(this,null,ge,{kind:"getter",name:"selectedMarkers",static:!1,private:!1,access:{has:e=>"selectedMarkers"in e,get:e=>e.selectedMarkers},metadata:t},null,s),a(this,null,ke,{kind:"getter",name:"layers",static:!1,private:!1,access:{has:e=>"layers"in e,get:e=>e.layers},metadata:t},null,s),a(this,null,be,{kind:"method",name:"clickRoute",static:!1,private:!1,access:{has:e=>"clickRoute"in e,get:e=>e.clickRoute},metadata:t},null,s),a(this,null,Re,{kind:"method",name:"selectCurrentPosition",static:!1,private:!1,access:{has:e=>"selectCurrentPosition"in e,get:e=>e.selectCurrentPosition},metadata:t},null,s),a(this,null,ve,{kind:"method",name:"findLocation",static:!1,private:!1,access:{has:e=>"findLocation"in e,get:e=>e.findLocation},metadata:t},null,s),a(this,null,Le,{kind:"getter",name:"routeInfo",static:!1,private:!1,access:{has:e=>"routeInfo"in e,get:e=>e.routeInfo},metadata:t},null,s),a(this,null,Se,{kind:"method",name:"updateRoute",static:!1,private:!1,access:{has:e=>"updateRoute"in e,get:e=>e.updateRoute},metadata:t},null,s),a(this,null,Pe,{kind:"method",name:"updateRouteDistance",static:!1,private:!1,access:{has:e=>"updateRouteDistance"in e,get:e=>e.updateRouteDistance},metadata:t},null,s),a(this,null,ze,{kind:"method",name:"updateRoutePoints",static:!1,private:!1,access:{has:e=>"updateRoutePoints"in e,get:e=>e.updateRoutePoints},metadata:t},null,s),a(this,null,De,{kind:"method",name:"checkRoutes",static:!1,private:!1,access:{has:e=>"checkRoutes"in e,get:e=>e.checkRoutes},metadata:t},null,s),a(this,null,Me,{kind:"method",name:"setGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"setGpsTrackingEnabled"in e,get:e=>e.setGpsTrackingEnabled},metadata:t},null,s),a(this,null,Ce,{kind:"getter",name:"gpsEnabled",static:!1,private:!1,access:{has:e=>"gpsEnabled"in e,get:e=>e.gpsEnabled},metadata:t},null,s),a(this,null,Ge,{kind:"method",name:"setOnlyAccessible",static:!1,private:!1,access:{has:e=>"setOnlyAccessible"in e,get:e=>e.setOnlyAccessible},metadata:t},null,s),a(null,null,n,{kind:"field",name:"routeLines",static:!1,private:!1,access:{has:e=>"routeLines"in e,get:e=>e.routeLines,set:(e,i)=>{e.routeLines=i}},metadata:t},l,p),a(null,null,y,{kind:"field",name:"routeDistance",static:!1,private:!1,access:{has:e=>"routeDistance"in e,get:e=>e.routeDistance,set:(e,i)=>{e.routeDistance=i}},metadata:t},v,g),a(null,null,z,{kind:"field",name:"currentPosition",static:!1,private:!1,access:{has:e=>"currentPosition"in e,get:e=>e.currentPosition,set:(e,i)=>{e.currentPosition=i}},metadata:t},D,I),a(null,null,A,{kind:"field",name:"requestCompass",static:!1,private:!1,access:{has:e=>"requestCompass"in e,get:e=>e.requestCompass,set:(e,i)=>{e.requestCompass=i}},metadata:t},w,M),a(null,null,C,{kind:"field",name:"iconType",static:!1,private:!1,access:{has:e=>"iconType"in e,get:e=>e.iconType,set:(e,i)=>{e.iconType=i}},metadata:t},G,O),a(null,null,F,{kind:"field",name:"tempToBooth",static:!1,private:!1,access:{has:e=>"tempToBooth"in e,get:e=>e.tempToBooth,set:(e,i)=>{e.tempToBooth=i}},metadata:t},N,B),a(null,null,U,{kind:"field",name:"focusEnabled",static:!1,private:!1,access:{has:e=>"focusEnabled"in e,get:e=>e.focusEnabled,set:(e,i)=>{e.focusEnabled=i}},metadata:t},Z,q),a(null,null,$,{kind:"field",name:"prevZ",static:!1,private:!1,access:{has:e=>"prevZ"in e,get:e=>e.prevZ,set:(e,i)=>{e.prevZ=i}},metadata:t},V,K),a(null,null,j,{kind:"field",name:"markersData",static:!1,private:!1,access:{has:e=>"markersData"in e,get:e=>e.markersData,set:(e,i)=>{e.markersData=i}},metadata:t},W,X),a(null,null,Y,{kind:"field",name:"prevMarkers",static:!1,private:!1,access:{has:e=>"prevMarkers"in e,get:e=>e.prevMarkers,set:(e,i)=>{e.prevMarkers=i}},metadata:t},H,J),a(null,null,Q,{kind:"field",name:"showAccessible",static:!1,private:!1,access:{has:e=>"showAccessible"in e,get:e=>e.showAccessible,set:(e,i)=>{e.showAccessible=i}},metadata:t},ee,te),a(null,null,se,{kind:"field",name:"onlyAccessible",static:!1,private:!1,access:{has:e=>"onlyAccessible"in e,get:e=>e.onlyAccessible,set:(e,i)=>{e.onlyAccessible=i}},metadata:t},ie,ae),a(null,null,re,{kind:"field",name:"currentRouteLayer",static:!1,private:!1,access:{has:e=>"currentRouteLayer"in e,get:e=>e.currentRouteLayer,set:(e,i)=>{e.currentRouteLayer=i}},metadata:t},ne,oe),a(null,null,le,{kind:"field",name:"currentRouteExhibitor",static:!1,private:!1,access:{has:e=>"currentRouteExhibitor"in e,get:e=>e.currentRouteExhibitor,set:(e,i)=>{e.currentRouteExhibitor=i}},metadata:t},ce,ue),a(null,null,xe,{kind:"field",name:"routeUnits",static:!1,private:!1,access:{has:e=>"routeUnits"in e,get:e=>e.routeUnits,set:(e,i)=>{e.routeUnits=i}},metadata:t},Ee,Te),a(null,null,Ie,{kind:"field",name:"isGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"isGpsTrackingEnabled"in e,get:e=>e.isGpsTrackingEnabled,set:(e,i)=>{e.isGpsTrackingEnabled=i}},metadata:t},Ae,we),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=r(this,s);cpTimeout;routeLines=r(this,l,[]);routeDistance=(r(this,p),r(this,v,null));currentPosition=(r(this,g),r(this,D,null));requestCompass=(r(this,I),r(this,w,!1));iconType=(r(this,M),r(this,G,0));tempToBooth=(r(this,O),r(this,N,null));focusEnabled=(r(this,B),r(this,Z,!0));prevZ=(r(this,q),r(this,V,null));markersData=(r(this,K),r(this,W,{icons:[],markers:[]}));prevMarkers=(r(this,X),r(this,H,[]));showAccessible=(r(this,J),r(this,ee,!!je.getLines().find(t=>t.unaccessible)));onlyAccessible=(r(this,te),r(this,ie,!1));currentRouteLayer=(r(this,ae),r(this,ne,null));currentRouteExhibitor=(r(this,oe),r(this,ce,null));constructor(t){r(this,we),this.rootStore=t,this.focusEnabled=!window.location.search}get canFindLocation(){return!!_.kioskData||!!this.currentPosition}selectRoute(t,e=!0,i=!1){if(e&&(_.list={type:"search",text:"",focused:!1}),t&&!t.from&&t.to){const d=this.resolveFallbackFrom();d&&(t=new Route(d,t.to,t.waypoints))}t?.from&&t?.to&&t.from===t.to&&(t=null);let o=[];t?.from&&t?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),t?.from instanceof R&&t.from.visible&&o.push(t.from),t?.to instanceof R&&t.to.visible&&(this.tempToBooth=null,o.push(t.to)),!t&&c.fp.onDirection&&c.fp.onDirection(null);const u=()=>{if(this.rootStore.moveToList(o),_.details=t,t&&(!t.from||!t.to)&&c.showOverlay(),t?.to&&t?.from){const d=ft(t.from);d&&this.rootStore.layerStore.updateVisibility(d,!0)}if(!this.currentRouteLayer){const d=Xe(this.rootStore.layerStore,t?.from),m=Xe(this.rootStore.layerStore,t?.to);d?this.currentRouteLayer=d:m&&(this.currentRouteLayer=m)}e&&t?.from&&t?.to&&it(st.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)};i?u():setTimeout(u,200)}rebuildRouteFromPosition(t){const e=_.selectedRoute;e?.to&&this.selectRoute(new Route(t,e.to,e.waypoints),!1,!0)}resolveFallbackFrom(){if(this.currentPosition)return We(this.currentPosition,nt,ot);const t=_.kioskData;return t?We({x:t.x,y:t.y,z:t.z},Qe(),lt):null}setStartPoint(t){const e=_.selectedRoute;if(e?.to&&!e?.from&&t){const i=new Route(t,e.to,e.waypoints);this.selectRoute(i)}}get pathLayers(){return c.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,i)=>i.indexOf(t)===e).reverse().map((t,e)=>({id:e+1,layer:c.layerStore.findLayer(t)}))}getNearestBooth(t){if(!t)return null;let e=this.rootStore.layerStore.findLayer(t.z);const i=t.lat&&t.lng?$e(t,P.properties.config):t;return this.rootStore.boothStore.booths.filter(o=>L.mode===ut.Default||!e?o.visible&&o.rect:o.rect&&(typeof t.z!="number"&&!t.z&&o.visible||e.name===o.layer?.name)).sort((o,u)=>Fe(i,o.rect.center)-Fe(i,u.rect.center))[0]||null}setMarkers(t){this.markersData.markers=(t?.markers??[]).map(mt),this.markersData.icons=t?.icons??[]}selectMarker(t,e){const i=this.markersData.markers.find(u=>u.id===t);this.markersData.markers.forEach(u=>u.active=!1),i&&(i.active=!0);let o=c.layerStore.findLayer(i?.z);if(e&&i){const u=c.rendererService.renderer;return o&&!o?.visible&&L.updateVisibility(o,!0),u?u.controls.panTo(i.x,i.y):(Ue.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 c.routeStore.routeLines?.map(e=>e.p0.layer).reverse().forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>c.layerStore.layers.find(i=>i.name===e))}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=null,_.list.type==="route-planner"&&(_.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(t,e))}selectCurrentPosition(t,e=!0,i){clearTimeout(this.cpTimeout),t&&(t.x=b(t.x),t.y=b(t.y),t.lat=b(t.lat),t.lng=b(t.lng),at()||(t.z=null));const o=e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route),u=e&&!o&&(this.focusEnabled||this.prevZ!=t?.z);this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString(),this.iconType=i?1:0;const d=t?ht(t):null;if(!d){this.currentPosition=null;return}const m=c.layerStore.findLayer(t.z),x=new CurrentPosition(d.x,d.y,m?.name||this.currentRouteLayer?.name,rt(d),t.lat,t.lng);let Oe=!this.routeLines?.length;if(m&&this.routeLines?.length&&(Oe=!!this.routeLines.find(T=>T.p0.layer===m.name||T.p1.layer===m.name)),u&&Oe){const T=c.rendererService.renderer;if(m&&!m?.visible&&L.updateVisibility(m,!0),!T){Ue.warn("Renderer is not initialized. Cannot pan to current position.");return}T.controls.panTo(x.x,x.y)}this.currentPosition=x,this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(!this.canFindLocation)return;if(c.maplibreStore.showMaplibre){_.moveToLocation=!0;return}const t=this.currentPosition??_.kioskData;if(!t)return;this.currentPosition&&localStorage.getItem(et)==="false"&&(c.routeStore.requestCompass=!0);const e=S.fromCenter(t,{x:100,y:100});let i;if(e.intersects(k))i=e;else{const u=Math.max(k.min.x,Math.min(t.x,k.max.x)),d=Math.max(k.min.y,Math.min(t.y,k.max.y)),m=Math.min(k.size.width,k.size.height)*.3,x=S.fromCenter({x:u,y:d},{x:m,y:m}).intersection(k);i=x?S.fromUnion(e,x):e}_.moveToRect=i;const o=c.layerStore.findLayer(t.z);o&&L.updateVisibility(o,!0)}routeUnits=(r(this,ue),r(this,Ee,Ne));get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:qe(t,Ze(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=tt(),i=(e.getAttribute("units")||Ne).toLowerCase?.().trim(),o=e.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(t/(o?1:10)),this.routeUnits=i,this.updateRoutePoints()}updateRoutePoints(){const t=_.selectedRoute,e=this.routeDistance,i=this.routeUnits;c.fp.onDirection&&setTimeout(()=>{c.fp.onDirection({from:Ye(t?.from??null),to:Ye(t?.to??null),lines:this.routeLines,distance:`${e}${i}`,units:i,time:qe(e,Ze(i))})},200)}checkRoutes(){const t=ct(je),e=c.boothStore.booths;console.info(`Route check started ${e.length}.... `);for(let i=0;i<e.length;i++){const o=e[i];for(let u=i+1;u<e.length;u++){const d=e[u];t.buildRoute(Ke(o),Ke(d)).lines.length||console.warn(`No route found from ${o.name} to ${d.name}`)}}console.info("Route check done....")}isGpsTrackingEnabled=(r(this,Te),r(this,Ae,!0));setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return Be.autoTrackingGps&&this.isGpsTrackingEnabled&&!Be.enableIPS}setOnlyAccessible(t){this.onlyAccessible=t}}})();export default dt;function ft(s){if(s)return s instanceof R?s.layer?.name:s.layer}function Xe(s,n){return n?n instanceof R?n.layer??null:s.findLayer(n.layer):null}function mt(s){return{...s,x:b(s.x),y:b(s.y),lat:b(s.lat),lng:b(s.lng)}}function ht(s){let n=null,l=null;return P&&(n=P.properties.config),n&&Je({min:n.p0,max:n.p2},s)?l={...s}:n&&Ve(s.lat)&&Ve(s.lng)?l=$e(s,n):n||(l=s),l||null}export function findBooth(s){return c.boothStore.findBooth(s)||c.exhibitorStore.findExhibitor(s)?.booths[0]}export function findEntityByExternalId(s){const n=c.boothStore.boothByExternalId.get(s);if(n)return{type:"booth",entity:n};const l=c.exhibitorStore.exhibitorByExternalId.get(s);if(l)return{type:"exhibitor",entity:l}}export function separateExternalIds(s){const n=[],l=[];for(const p of s){const y=findEntityByExternalId(p);y&&(y.type==="booth"?n.push(p):l.push(p))}return{boothExternalIds:n,exhibitorExternalIds:l}}export function extractRoute(s,n,l){return new Route(findBooth(s)??null,findBooth(n)??null,l?.map(p=>findBooth(p)))}export class Route{from;to;waypoints;constructor(n,l,p){this.from=n,this.to=l,this.waypoints=p;const y=n instanceof R?n.id:void 0,v=l instanceof R?l.id:void 0;this.waypoints=p?.filter(g=>g&&g.id!==y&&g.id!==v)}}function Ye(s){return s?s instanceof R?{id:s.id,name:s.name,externalId:s.externalId,layer:{name:s.layer?.name,description:s.layer?.description}}:{id:Number.MAX_SAFE_INTEGER,name:s.name,externalId:void 0,layer:{name:s.layer,description:void 0}}:null}export class CurrentPosition extends He{x;y;z;angle;lat;lng;constructor(n,l,p,y,v,g){super(n,l),this.x=n,this.y=l,this.z=p,this.angle=y,this.lat=v,this.lng=g}}
|
|
1
|
+
import{__esDecorate as a,__runInitializers as r}from"tslib";import{action as m,computed as E,observable as f}from"mobx";import{Box as S,Point as Ye,boxContainsPoint as He,pointDistance as Fe}from"@expofp/geometry";import c,{layersStore as L}from".";import{fpGeo as P}from"../data/fpGeo";import{getName as Je}from"../components/Kiosk/SetKiosk";import{DEFAULT_UNITS as Ne,ORIENTATION_GRANTED_KEY as Qe}from"../constants";import Be from"../data";import{getLayerSvg as et,svgArea as g}from"../data/svg";import{GaEventActions as tt,sendEventToGa as st}from"../tools/gtag";import Ue from"../tools/logger";import{areLayersEnabled as it}from"../utils/areLayersEnabled";import{calcSpeed as Ze}from"../utils/calcSpeed";import{calcTravelTime as qe}from"../utils/calcTravelTime";import{calculateRelativeBearing as at,convertGpsToLocal as $e,isValidPointCoords as Ve}from"../utils/gps";import{boothToEndpoint as Ke,buildRoute as rt,CURRENT_LOCATION_NAME as nt,CURRENT_POSITION_POINT_ID as ot,isWayfindingReady as lt,KIOSK_ANCHOR_POINT_ID as ct,toArbitraryPoint as je}from"../wayfinding";import{BoothBase as R}from"./BoothStore";import{uiState as _}from"./index";import{LayersMode as ut}from"./LayerStore";const b=s=>typeof s=="string"?Number(s.replace(",",".")):s;let dt=(()=>{let s=[],n,l=[],h=[],y,v=[],k=[],z,D=[],I=[],A,w=[],M=[],C,G=[],O=[],F,N=[],B=[],U,Z=[],q=[],$,V=[],K=[],j,W=[],X=[],Y,H=[],J=[],Q,ee=[],te=[],se,ie=[],ae=[],re,ne=[],oe=[],le,ce=[],ue=[],de,fe,me,he,pe,_e,ye,ke,ge,be,Re,ve,xe,Ee=[],Te=[],Le,Se,Pe,ze,De,Ie,Ae=[],we=[],Me,Ce,Ge;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[f],y=[f],z=[f],A=[f],C=[f],F=[f],U=[f],$=[f],j=[f],Y=[f],Q=[f],se=[f],re=[f],le=[f],de=[E],fe=[m],me=[m],he=[m],pe=[E({keepAlive:!0})],_e=[m],ye=[m],ke=[E({keepAlive:!0})],ge=[E({keepAlive:!0})],be=[m],Re=[m],ve=[m],xe=[f],Le=[E],Se=[m],Pe=[m],ze=[m],De=[m],Ie=[f],Me=[m],Ce=[E({keepAlive:!0})],Ge=[m],a(this,null,de,{kind:"getter",name:"canFindLocation",static:!1,private:!1,access:{has:e=>"canFindLocation"in e,get:e=>e.canFindLocation},metadata:t},null,s),a(this,null,fe,{kind:"method",name:"selectRoute",static:!1,private:!1,access:{has:e=>"selectRoute"in e,get:e=>e.selectRoute},metadata:t},null,s),a(this,null,me,{kind:"method",name:"rebuildRouteFromPosition",static:!1,private:!1,access:{has:e=>"rebuildRouteFromPosition"in e,get:e=>e.rebuildRouteFromPosition},metadata:t},null,s),a(this,null,he,{kind:"method",name:"setStartPoint",static:!1,private:!1,access:{has:e=>"setStartPoint"in e,get:e=>e.setStartPoint},metadata:t},null,s),a(this,null,pe,{kind:"getter",name:"pathLayers",static:!1,private:!1,access:{has:e=>"pathLayers"in e,get:e=>e.pathLayers},metadata:t},null,s),a(this,null,_e,{kind:"method",name:"setMarkers",static:!1,private:!1,access:{has:e=>"setMarkers"in e,get:e=>e.setMarkers},metadata:t},null,s),a(this,null,ye,{kind:"method",name:"selectMarker",static:!1,private:!1,access:{has:e=>"selectMarker"in e,get:e=>e.selectMarker},metadata:t},null,s),a(this,null,ke,{kind:"getter",name:"selectedMarkers",static:!1,private:!1,access:{has:e=>"selectedMarkers"in e,get:e=>e.selectedMarkers},metadata:t},null,s),a(this,null,ge,{kind:"getter",name:"layers",static:!1,private:!1,access:{has:e=>"layers"in e,get:e=>e.layers},metadata:t},null,s),a(this,null,be,{kind:"method",name:"clickRoute",static:!1,private:!1,access:{has:e=>"clickRoute"in e,get:e=>e.clickRoute},metadata:t},null,s),a(this,null,Re,{kind:"method",name:"selectCurrentPosition",static:!1,private:!1,access:{has:e=>"selectCurrentPosition"in e,get:e=>e.selectCurrentPosition},metadata:t},null,s),a(this,null,ve,{kind:"method",name:"findLocation",static:!1,private:!1,access:{has:e=>"findLocation"in e,get:e=>e.findLocation},metadata:t},null,s),a(this,null,Le,{kind:"getter",name:"routeInfo",static:!1,private:!1,access:{has:e=>"routeInfo"in e,get:e=>e.routeInfo},metadata:t},null,s),a(this,null,Se,{kind:"method",name:"updateRoute",static:!1,private:!1,access:{has:e=>"updateRoute"in e,get:e=>e.updateRoute},metadata:t},null,s),a(this,null,Pe,{kind:"method",name:"updateRouteDistance",static:!1,private:!1,access:{has:e=>"updateRouteDistance"in e,get:e=>e.updateRouteDistance},metadata:t},null,s),a(this,null,ze,{kind:"method",name:"updateRoutePoints",static:!1,private:!1,access:{has:e=>"updateRoutePoints"in e,get:e=>e.updateRoutePoints},metadata:t},null,s),a(this,null,De,{kind:"method",name:"checkRoutes",static:!1,private:!1,access:{has:e=>"checkRoutes"in e,get:e=>e.checkRoutes},metadata:t},null,s),a(this,null,Me,{kind:"method",name:"setGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"setGpsTrackingEnabled"in e,get:e=>e.setGpsTrackingEnabled},metadata:t},null,s),a(this,null,Ce,{kind:"getter",name:"gpsEnabled",static:!1,private:!1,access:{has:e=>"gpsEnabled"in e,get:e=>e.gpsEnabled},metadata:t},null,s),a(this,null,Ge,{kind:"method",name:"setOnlyAccessible",static:!1,private:!1,access:{has:e=>"setOnlyAccessible"in e,get:e=>e.setOnlyAccessible},metadata:t},null,s),a(null,null,n,{kind:"field",name:"routeLines",static:!1,private:!1,access:{has:e=>"routeLines"in e,get:e=>e.routeLines,set:(e,i)=>{e.routeLines=i}},metadata:t},l,h),a(null,null,y,{kind:"field",name:"routeDistance",static:!1,private:!1,access:{has:e=>"routeDistance"in e,get:e=>e.routeDistance,set:(e,i)=>{e.routeDistance=i}},metadata:t},v,k),a(null,null,z,{kind:"field",name:"currentPosition",static:!1,private:!1,access:{has:e=>"currentPosition"in e,get:e=>e.currentPosition,set:(e,i)=>{e.currentPosition=i}},metadata:t},D,I),a(null,null,A,{kind:"field",name:"requestCompass",static:!1,private:!1,access:{has:e=>"requestCompass"in e,get:e=>e.requestCompass,set:(e,i)=>{e.requestCompass=i}},metadata:t},w,M),a(null,null,C,{kind:"field",name:"iconType",static:!1,private:!1,access:{has:e=>"iconType"in e,get:e=>e.iconType,set:(e,i)=>{e.iconType=i}},metadata:t},G,O),a(null,null,F,{kind:"field",name:"tempToBooth",static:!1,private:!1,access:{has:e=>"tempToBooth"in e,get:e=>e.tempToBooth,set:(e,i)=>{e.tempToBooth=i}},metadata:t},N,B),a(null,null,U,{kind:"field",name:"focusEnabled",static:!1,private:!1,access:{has:e=>"focusEnabled"in e,get:e=>e.focusEnabled,set:(e,i)=>{e.focusEnabled=i}},metadata:t},Z,q),a(null,null,$,{kind:"field",name:"prevZ",static:!1,private:!1,access:{has:e=>"prevZ"in e,get:e=>e.prevZ,set:(e,i)=>{e.prevZ=i}},metadata:t},V,K),a(null,null,j,{kind:"field",name:"markersData",static:!1,private:!1,access:{has:e=>"markersData"in e,get:e=>e.markersData,set:(e,i)=>{e.markersData=i}},metadata:t},W,X),a(null,null,Y,{kind:"field",name:"prevMarkers",static:!1,private:!1,access:{has:e=>"prevMarkers"in e,get:e=>e.prevMarkers,set:(e,i)=>{e.prevMarkers=i}},metadata:t},H,J),a(null,null,Q,{kind:"field",name:"showAccessible",static:!1,private:!1,access:{has:e=>"showAccessible"in e,get:e=>e.showAccessible,set:(e,i)=>{e.showAccessible=i}},metadata:t},ee,te),a(null,null,se,{kind:"field",name:"onlyAccessible",static:!1,private:!1,access:{has:e=>"onlyAccessible"in e,get:e=>e.onlyAccessible,set:(e,i)=>{e.onlyAccessible=i}},metadata:t},ie,ae),a(null,null,re,{kind:"field",name:"currentRouteLayer",static:!1,private:!1,access:{has:e=>"currentRouteLayer"in e,get:e=>e.currentRouteLayer,set:(e,i)=>{e.currentRouteLayer=i}},metadata:t},ne,oe),a(null,null,le,{kind:"field",name:"currentRouteExhibitor",static:!1,private:!1,access:{has:e=>"currentRouteExhibitor"in e,get:e=>e.currentRouteExhibitor,set:(e,i)=>{e.currentRouteExhibitor=i}},metadata:t},ce,ue),a(null,null,xe,{kind:"field",name:"routeUnits",static:!1,private:!1,access:{has:e=>"routeUnits"in e,get:e=>e.routeUnits,set:(e,i)=>{e.routeUnits=i}},metadata:t},Ee,Te),a(null,null,Ie,{kind:"field",name:"isGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"isGpsTrackingEnabled"in e,get:e=>e.isGpsTrackingEnabled,set:(e,i)=>{e.isGpsTrackingEnabled=i}},metadata:t},Ae,we),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=r(this,s);cpTimeout;routeLines=r(this,l,[]);routeDistance=(r(this,h),r(this,v,null));currentPosition=(r(this,k),r(this,D,null));requestCompass=(r(this,I),r(this,w,!1));iconType=(r(this,M),r(this,G,0));tempToBooth=(r(this,O),r(this,N,null));focusEnabled=(r(this,B),r(this,Z,!0));prevZ=(r(this,q),r(this,V,null));markersData=(r(this,K),r(this,W,{icons:[],markers:[]}));prevMarkers=(r(this,X),r(this,H,[]));showAccessible=(r(this,J),r(this,ee,!1));onlyAccessible=(r(this,te),r(this,ie,!1));currentRouteLayer=(r(this,ae),r(this,ne,null));currentRouteExhibitor=(r(this,oe),r(this,ce,null));constructor(t){r(this,we),this.rootStore=t,this.focusEnabled=!window.location.search}get canFindLocation(){return!!_.kioskData||!!this.currentPosition}selectRoute(t,e=!0,i=!1){if(e&&(_.list={type:"search",text:"",focused:!1}),t&&!t.from&&t.to){const d=this.resolveFallbackFrom();d&&(t=new Route(d,t.to,t.waypoints))}t?.from&&t?.to&&t.from===t.to&&(t=null);let o=[];t?.from&&t?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),t?.from instanceof R&&t.from.visible&&o.push(t.from),t?.to instanceof R&&t.to.visible&&(this.tempToBooth=null,o.push(t.to)),!t&&c.fp.onDirection&&c.fp.onDirection(null);const u=()=>{if(this.rootStore.moveToList(o),_.details=t,t&&(!t.from||!t.to)&&c.showOverlay(),t?.to&&t?.from){const d=ft(t.from);d&&this.rootStore.layerStore.updateVisibility(d,!0)}if(!this.currentRouteLayer){const d=We(this.rootStore.layerStore,t?.from),p=We(this.rootStore.layerStore,t?.to);d?this.currentRouteLayer=d:p&&(this.currentRouteLayer=p)}e&&t?.from&&t?.to&&st(tt.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)};i?u():setTimeout(u,200)}rebuildRouteFromPosition(t){const e=_.selectedRoute;e?.to&&this.selectRoute(new Route(t,e.to,e.waypoints),!1,!0)}resolveFallbackFrom(){if(this.currentPosition)return je(this.currentPosition,nt,ot);const t=_.kioskData;return t?je({x:t.x,y:t.y,z:t.z},Je(),ct):null}setStartPoint(t){const e=_.selectedRoute;if(e?.to&&!e?.from&&t){const i=new Route(t,e.to,e.waypoints);this.selectRoute(i)}}get pathLayers(){return c.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,i)=>i.indexOf(t)===e).reverse().map((t,e)=>({id:e+1,layer:c.layerStore.findLayer(t)}))}getNearestBooth(t){if(!t)return null;let e=this.rootStore.layerStore.findLayer(t.z);const i=t.lat&&t.lng?$e(t,P.properties.config):t;return this.rootStore.boothStore.booths.filter(o=>L.mode===ut.Default||!e?o.visible&&o.rect:o.rect&&(typeof t.z!="number"&&!t.z&&o.visible||e.name===o.layer?.name)).sort((o,u)=>Fe(i,o.rect.center)-Fe(i,u.rect.center))[0]||null}setMarkers(t){this.markersData.markers=(t?.markers??[]).map(mt),this.markersData.icons=t?.icons??[]}selectMarker(t,e){const i=this.markersData.markers.find(u=>u.id===t);this.markersData.markers.forEach(u=>u.active=!1),i&&(i.active=!0);let o=c.layerStore.findLayer(i?.z);if(e&&i){const u=c.rendererService.renderer;return o&&!o?.visible&&L.updateVisibility(o,!0),u?u.controls.panTo(i.x,i.y):(Ue.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 c.routeStore.routeLines?.map(e=>e.p0.layer).reverse().forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>c.layerStore.layers.find(i=>i.name===e))}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=null,_.list.type==="route-planner"&&(_.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(t,e))}selectCurrentPosition(t,e=!0,i){clearTimeout(this.cpTimeout),t&&(t.x=b(t.x),t.y=b(t.y),t.lat=b(t.lat),t.lng=b(t.lng),it()||(t.z=null));const o=e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route),u=e&&!o&&(this.focusEnabled||this.prevZ!=t?.z);this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString(),this.iconType=i?1:0;const d=t?ht(t):null;if(!d){this.currentPosition=null;return}const p=c.layerStore.findLayer(t.z),x=new CurrentPosition(d.x,d.y,p?.name||this.currentRouteLayer?.name,at(d),t.lat,t.lng);let Oe=!this.routeLines?.length;if(p&&this.routeLines?.length&&(Oe=!!this.routeLines.find(T=>T.p0.layer===p.name||T.p1.layer===p.name)),u&&Oe){const T=c.rendererService.renderer;if(p&&!p?.visible&&L.updateVisibility(p,!0),!T){Ue.warn("Renderer is not initialized. Cannot pan to current position.");return}T.controls.panTo(x.x,x.y)}this.currentPosition=x,this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(!this.canFindLocation)return;if(c.maplibreStore.showMaplibre){_.moveToLocation=!0;return}const t=this.currentPosition??_.kioskData;if(!t)return;this.currentPosition&&localStorage.getItem(Qe)==="false"&&(c.routeStore.requestCompass=!0);const e=S.fromCenter(t,{x:100,y:100});let i;if(e.intersects(g))i=e;else{const u=Math.max(g.min.x,Math.min(t.x,g.max.x)),d=Math.max(g.min.y,Math.min(t.y,g.max.y)),p=Math.min(g.size.width,g.size.height)*.3,x=S.fromCenter({x:u,y:d},{x:p,y:p}).intersection(g);i=x?S.fromUnion(e,x):e}_.moveToRect=i;const o=c.layerStore.findLayer(t.z);o&&L.updateVisibility(o,!0)}routeUnits=(r(this,ue),r(this,Ee,Ne));get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:qe(t,Ze(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=et(),i=(e.getAttribute("units")||Ne).toLowerCase?.().trim(),o=e.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(t/(o?1:10)),this.routeUnits=i,this.updateRoutePoints()}updateRoutePoints(){const t=_.selectedRoute,e=this.routeDistance,i=this.routeUnits;c.fp.onDirection&&setTimeout(()=>{c.fp.onDirection({from:Xe(t?.from??null),to:Xe(t?.to??null),lines:this.routeLines,distance:`${e}${i}`,units:i,time:qe(e,Ze(i))})},200)}checkRoutes(){if(!lt()){console.warn("checkRoutes: wayfinding is not initialized \u2014 call createWayfinding() first. Skipping route check.");return}const t=c.boothStore.booths;console.info(`Route check started ${t.length}.... `);for(let e=0;e<t.length;e++){const i=t[e];for(let o=e+1;o<t.length;o++){const u=t[o];rt(Ke(i),Ke(u)).lines.length||console.warn(`No route found from ${i.name} to ${u.name}`)}}console.info("Route check done....")}isGpsTrackingEnabled=(r(this,Te),r(this,Ae,!0));setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return Be.autoTrackingGps&&this.isGpsTrackingEnabled&&!Be.enableIPS}setOnlyAccessible(t){this.onlyAccessible=t}}})();export default dt;function ft(s){if(s)return s instanceof R?s.layer?.name:s.layer}function We(s,n){return n?n instanceof R?n.layer??null:s.findLayer(n.layer):null}function mt(s){return{...s,x:b(s.x),y:b(s.y),lat:b(s.lat),lng:b(s.lng)}}function ht(s){let n=null,l=null;return P&&(n=P.properties.config),n&&He({min:n.p0,max:n.p2},s)?l={...s}:n&&Ve(s.lat)&&Ve(s.lng)?l=$e(s,n):n||(l=s),l||null}export function findBooth(s){return c.boothStore.findBooth(s)||c.exhibitorStore.findExhibitor(s)?.booths[0]}export function findEntityByExternalId(s){const n=c.boothStore.boothByExternalId.get(s);if(n)return{type:"booth",entity:n};const l=c.exhibitorStore.exhibitorByExternalId.get(s);if(l)return{type:"exhibitor",entity:l}}export function separateExternalIds(s){const n=[],l=[];for(const h of s){const y=findEntityByExternalId(h);y&&(y.type==="booth"?n.push(h):l.push(h))}return{boothExternalIds:n,exhibitorExternalIds:l}}export function extractRoute(s,n,l){return new Route(findBooth(s)??null,findBooth(n)??null,l?.map(h=>findBooth(h)))}export class Route{from;to;waypoints;constructor(n,l,h){this.from=n,this.to=l,this.waypoints=h;const y=n instanceof R?n.id:void 0,v=l instanceof R?l.id:void 0;this.waypoints=h?.filter(k=>k&&k.id!==y&&k.id!==v)}}function Xe(s){return s?s instanceof R?{id:s.id,name:s.name,externalId:s.externalId,layer:{name:s.layer?.name,description:s.layer?.description}}:{id:Number.MAX_SAFE_INTEGER,name:s.name,externalId:void 0,layer:{name:s.layer,description:void 0}}:null}export class CurrentPosition extends Ye{x;y;z;angle;lat;lng;constructor(n,l,h,y,v,k){super(n,l),this.x=n,this.y=l,this.z=h,this.angle=y,this.lat=v,this.lng=k}}
|