@expofp/floorplan 3.25.2 → 3.27.0
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-DZ5RJVoX.js → Button-e8P-AcfW.js} +6 -6
- package/dist/browser/{CookieConsent-CNE-7zNI.js → CookieConsent-DT6PZdD-.js} +8 -8
- package/dist/browser/{Debug-TDQ_xzea.js → Debug-Btnxv9GC.js} +8 -8
- package/dist/browser/DebugTools-CH_HoQal.js +1922 -0
- package/dist/browser/{Demo-A0X5mRqG.js → Demo-DZoFFss-.js} +10 -10
- package/dist/browser/{Free-BjYK0xDM.js → Free-DiFQkGSU.js} +10 -10
- package/dist/browser/{GalleryContainer-BsQuHOrj.js → GalleryContainer-aJ6EZ5I3.js} +11 -11
- package/dist/browser/{GpsLoader-DoutzmU_.js → GpsLoader-Bu9mBOam.js} +34 -34
- package/dist/browser/KioskStore-DUC4jNn0.js +241 -0
- package/dist/browser/{MaplibreAdapter-W1ZdQQ00.js → MaplibreAdapter-DIlDXt73.js} +2067 -2152
- package/dist/browser/{ModalContainer-BfZm0B_L.js → ModalContainer-CVRxdpt2.js} +11 -11
- package/dist/browser/{PermissionNotice-Cm6qrOC_.js → PermissionNotice-B5X5RQja.js} +7 -7
- package/dist/browser/SetKioskMode-BbDnU98F.js +48 -0
- package/dist/browser/{ShowKiosk-B0cj0p6h.js → ShowKiosk-B7HfONvN.js} +11 -11
- package/dist/browser/{ViewerMenuPanel-FFmV-n9m.js → ViewerMenuPanel-CT6kvVUw.js} +17 -17
- package/dist/browser/{add-debug-secret-listener-BOW3NQe7.js → add-debug-secret-listener-Dvv-Pg0-.js} +1 -1
- package/dist/browser/{adopt-global-settings-DNTNdr3z.js → adopt-global-settings-CXzCKJtp.js} +10 -10
- package/dist/browser/{boolean-editor-Bx4HLLyu.js → boolean-editor-CHMR9ZwP.js} +10 -10
- package/dist/browser/{bootIntercom-C_8HLvxg.js → bootIntercom-DQcGuly8.js} +3 -3
- package/dist/browser/bundle.json +77 -65
- package/dist/browser/camera-events-BkrzcISl.js +18 -0
- package/dist/browser/{classnames-DovQg6we.js → classnames-BYuGpzao.js} +2 -2
- package/dist/browser/{client-CadlVOps.js → client-hxMr1frV.js} +793 -992
- package/dist/browser/{components-BK-czcTL.js → components-DiB2l4Q7.js} +1934 -1986
- package/dist/browser/debug-context-CfyAAxAt.js +24315 -0
- package/dist/browser/{debug-overlay-vFTynZrP.js → debug-overlay-PYUvPcx-.js} +11 -11
- package/dist/browser/{debug-ui-BgSppEQg.js → debug-ui-BXRAYxv6.js} +7 -7
- package/dist/browser/dimming-Dj-1kBgQ.js +1108 -0
- package/dist/browser/{dist-C1WQpGAq.js → dist-30RVEJTr.js} +7 -7
- package/dist/browser/{dist-CkAU9dsV.js → dist-DgGMS59X.js} +6 -6
- package/dist/browser/{dist-gIYlJ33F.js → dist-opCvrhNh.js} +3 -3
- package/dist/browser/{efp-debug-init-CGEJSmuk.js → efp-debug-init-CYfrcz9M.js} +4 -4
- package/dist/browser/{enum-editor-BZXgS3I-.js → enum-editor-BYO96W3-.js} +5 -5
- package/dist/browser/{es5-DoqUhz95.js → es5-Bpzk_wCi.js} +2 -2
- package/dist/browser/{event-not-found-Dl66nXH1.js → event-not-found-DEepFxEc.js} +1 -1
- package/dist/browser/{exports-CK5UTqgq.js → exports-Bo5VUoiX.js} +1 -1
- package/dist/browser/{favicon-BnTLQysW.js → favicon-Bf88cI9_.js} +1 -1
- package/dist/browser/{fetch-retry.umd-D_tGjwEb.js → fetch-retry.umd-D2BnNN8g.js} +2 -2
- package/dist/browser/{flex-BCrAgMxK.js → flex-B5cqWC1b.js} +6 -6
- package/dist/browser/{floorplan.loader-DXJR9eeS.js → floorplan.loader-D3lRYRJS.js} +10 -10
- package/dist/browser/{floorplan.ready-C0sdmceF.js → floorplan.ready-CsdDpbEv.js} +343 -307
- package/dist/browser/{fuse-C7evxCwi.js → fuse-CzalO4Mu.js} +2 -2
- package/dist/browser/{i18n-Cp32ZzDq.js → i18n-D1sb3MoT.js} +5 -5
- package/dist/browser/index.js +14 -14
- package/dist/browser/{index.module-CeDH7KeK.js → index.module-JxYvexTC.js} +4 -4
- package/dist/browser/{integrateKiosk-JZG1AZBF.js → integrateKiosk-e4HqZu2W.js} +5 -5
- package/dist/browser/{is-webview-Be9due3O.js → is-webview-ChPDTaTY.js} +1 -1
- package/dist/browser/{jsx-runtime-DwNSQYOA.js → jsx-runtime-Ca1Wj_4-.js} +2 -2
- package/dist/browser/{kiosk-record-BMwfA16j.js → kiosk-record-C2cafcoW.js} +1 -1
- package/dist/browser/{lib-DeQ47J_S.js → lib-DXqE6M9Z.js} +3 -3
- package/dist/browser/{loadImage-DVBOry5-.js → loadImage-8qYzT9NG.js} +4 -4
- package/dist/browser/{logDeviceInfo-uPn7yfGH.js → logDeviceInfo-CF95RwQH.js} +9 -9
- package/dist/browser/{mobx-DFFcUY2e.js → mobx-B8aGIDdz.js} +7 -7
- package/dist/browser/{optional-boolean-editor-DfcaW7-l.js → optional-boolean-editor-D02Q8KUS.js} +4 -4
- package/dist/browser/{optional-enum-editor-SEARu4hs.js → optional-enum-editor-RV_EKfNQ.js} +5 -5
- package/dist/browser/{optional-string-editor-COLkp8EA.js → optional-string-editor-D_t_aZG2.js} +5 -5
- package/dist/browser/{particles.min-DHvuM5ou.js → particles.min-CDyH_67D.js} +2 -2
- package/dist/browser/{react-BNCBBLDK.js → react-CDmIhEY6.js} +2 -2
- package/dist/browser/{react-dom-ql8ZgjdB.js → react-dom-PGvJwDoR.js} +3 -3
- package/dist/browser/{rolldown-runtime-D0mAPq9J.js → rolldown-runtime-CwqkRsWu.js} +1 -1
- package/dist/browser/scheduler-MBFOnOYr.js +212 -0
- package/dist/browser/{select-CwB0Zi7C.js → select-2x53pvd0.js} +11 -11
- package/dist/browser/{settings-MzAuoQZ6.js → settings-BCkl8gdb.js} +2 -2
- package/dist/browser/{settings-item-Ca6s5CDf.js → settings-item-DT6Vnw06.js} +7 -7
- package/dist/browser/store-Dej5FGrq.js +31205 -0
- package/dist/browser/{string-editor-BjOeNcgJ.js → string-editor-w9YDgRoR.js} +5 -5
- package/dist/browser/{text-field-6Ccfbuuo.js → text-field-ricOc0h0.js} +6 -6
- package/dist/browser/{theme-XlV0fBPc.js → theme-Ce7vpk9b.js} +9 -9
- package/dist/browser/{ui-BopruaHZ.js → ui-PDV2rEkU.js} +9 -9
- package/dist/browser/{useRenderTarget-CdH-VI6E.js → useRenderTarget-DroCs5kL.js} +5 -5
- package/dist/browser/viewport-Jwms2MJD.js +41 -0
- package/dist/esm/components/Booth/Booth.js +1 -1
- package/dist/esm/components/Event.js +1 -1
- package/dist/esm/components/Exhibitor.js +1 -1
- package/dist/esm/components/Kiosk/KioskStore.d.ts +5 -2
- package/dist/esm/components/Kiosk/KioskStore.js +1 -1
- package/dist/esm/components/Kiosk/SetKioskMode.d.ts +1 -2
- package/dist/esm/components/Kiosk/SetKioskMode.js +1 -1
- package/dist/esm/components/Layout.js +1 -1
- package/dist/esm/components/Map/Map.d.ts +1 -1
- package/dist/esm/components/Map/Map.js +1 -1
- package/dist/esm/components/Map/MapCamera.d.ts +17 -0
- package/dist/esm/components/Map/MapCamera.js +1 -0
- package/dist/esm/components/Map/MapViewport.d.ts +12 -0
- package/dist/esm/components/Map/MapViewport.js +1 -0
- package/dist/esm/components/Map/booth-by-xy.d.ts +13 -0
- package/dist/esm/components/Map/booth-by-xy.js +1 -1
- package/dist/esm/components/Map/camera-events.d.ts +16 -0
- package/dist/esm/components/Map/camera-events.js +1 -0
- package/dist/esm/components/Map/camera.d.ts +48 -0
- package/dist/esm/components/Map/camera.js +1 -0
- package/dist/esm/components/Map/drawing/config/TextFitter.d.ts +1 -1
- package/dist/esm/components/Map/drawing/config/config-all.d.ts +1 -2
- package/dist/esm/components/Map/drawing/config/config-all.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-bg.d.ts +1 -2
- package/dist/esm/components/Map/drawing/config/config-bg.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-badge.d.ts +70 -3
- package/dist/esm/components/Map/drawing/config/config-booth-badge.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-bg.d.ts +3 -6
- 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 +11 -7
- 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 +2 -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 +16 -3
- 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 +18 -4
- package/dist/esm/components/Map/drawing/config/config-booth-labels.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booths.d.ts +1 -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 +1 -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 +23 -2
- package/dist/esm/components/Map/drawing/config/config-markers.js +1 -1
- package/dist/esm/components/Map/drawing/config/layer-images.d.ts +35 -0
- package/dist/esm/components/Map/drawing/config/layer-images.js +1 -0
- package/dist/esm/components/Map/drawing/config/loadBoothsImages.d.ts +38 -3
- package/dist/esm/components/Map/drawing/config/loadBoothsImages.js +1 -1
- package/dist/esm/components/Map/pointer.d.ts +73 -0
- package/dist/esm/components/Map/pointer.js +1 -0
- package/dist/esm/components/Map/scene.d.ts +20 -0
- package/dist/esm/components/Map/scene.js +1 -0
- package/dist/esm/components/Map/traffic/trafficLayers.d.ts +2 -7
- package/dist/esm/components/Map/traffic/trafficLayers.js +1 -1
- package/dist/esm/components/Map/traffic/useBuildRoute.d.ts +4 -3
- package/dist/esm/components/Map/traffic/useBuildRoute.js +6 -6
- package/dist/esm/components/Map/traffic/useManageTraffic.d.ts +4 -3
- package/dist/esm/components/Map/traffic/useManageTraffic.js +1 -1
- package/dist/esm/components/Map/viewport.d.ts +63 -0
- package/dist/esm/components/Map/viewport.js +1 -0
- package/dist/esm/components/Maplibre/MaplibreAdapter.d.ts +6 -2
- package/dist/esm/components/Maplibre/MaplibreAdapter.js +1 -1
- package/dist/esm/components/Maplibre/MaplibreWrapper.d.ts +30 -8
- package/dist/esm/components/Maplibre/MaplibreWrapper.js +1 -1
- package/dist/esm/components/Maplibre/useDimming.d.ts +2 -2
- package/dist/esm/components/Maplibre/useDimming.js +1 -1
- package/dist/esm/components/Maplibre/useKioskIdleEvents.d.ts +5 -6
- package/dist/esm/components/Maplibre/useLayerVisibilitySync.d.ts +2 -2
- package/dist/esm/components/Maplibre/useLayerVisibilitySync.js +1 -1
- package/dist/esm/components/Maplibre/usePoiMarkers.d.ts +1 -2
- package/dist/esm/components/Maplibre/useWayfindingAndMarkers.d.ts +8 -5
- package/dist/esm/components/Maplibre/useWayfindingAndMarkers.js +1 -1
- package/dist/esm/components/Maplibre/utils/layer-defs.d.ts +8 -3
- package/dist/esm/components/Maplibre/utils/layer-defs.js +1 -1
- package/dist/esm/components/Maplibre/utils/poi-marker-hit-test.d.ts +3 -3
- package/dist/esm/components/Speaker.js +1 -1
- package/dist/esm/components/Ws.js +1 -1
- package/dist/esm/engine/defs.d.ts +30 -0
- package/dist/esm/engine/defs.js +3 -0
- package/dist/esm/engine/fonts.js +1 -0
- package/dist/esm/engine/update-def.d.ts +52 -0
- package/dist/esm/engine/update-def.js +1 -0
- package/dist/esm/engine/utils/rotation.d.ts +6 -0
- package/dist/esm/engine/utils/rotation.js +1 -0
- package/dist/esm/floorplan.ready.d.ts +2 -0
- package/dist/esm/floorplan.ready.js +1 -1
- package/dist/esm/services/url-sync.js +1 -1
- package/dist/esm/store/BoothStore.d.ts +11 -0
- package/dist/esm/store/HeatmapStore.d.ts +9 -0
- package/dist/esm/store/LayerStore.d.ts +2 -0
- package/dist/esm/store/LayerStore.js +1 -1
- package/dist/esm/store/RootStore.d.ts +0 -2
- package/dist/esm/store/RootStore.js +1 -1
- package/dist/esm/store/RouteStore.js +1 -1
- package/dist/esm/store/ShortcutRegistry.d.ts +14 -0
- package/dist/esm/store/ShortcutRegistry.js +1 -1
- package/dist/esm/store/UIState.js +1 -1
- package/dist/esm/store/details-events.d.ts +11 -0
- package/dist/esm/store/details-events.js +1 -0
- package/dist/esm/store/init/init-booths.js +1 -1
- package/dist/esm/store/providers/SessionsSubButtonProvider.d.ts +18 -0
- package/dist/esm/store/providers/SessionsSubButtonProvider.js +1 -1
- package/dist/esm/store/search-buttons/SearchButtonsActions.d.ts +15 -2
- package/dist/esm/store/search-buttons/SearchButtonsActions.js +1 -1
- package/dist/esm/store/search-buttons/SearchButtonsFactory.js +1 -1
- package/dist/esm/store/search-buttons/SearchButtonsStore.d.ts +3 -3
- package/dist/esm/store/search-buttons/SearchButtonsStore.js +1 -1
- package/dist/esm/tools/gtag.d.ts +1 -0
- package/dist/esm/tools/gtag.js +1 -1
- package/dist/esm/tools/telemetry.d.ts +2 -0
- package/dist/esm/tools/telemetry.js +1 -1
- package/dist/esm/tools/track-event.d.ts +26 -2
- package/dist/esm/tools/track-event.js +1 -1
- package/dist/esm/utils/dimming.d.ts +13 -2
- package/dist/esm/utils/dimming.js +1 -1
- package/dist/esm/utils/mobx.d.ts +2 -2
- package/dist/esm/utils/mobx.js +1 -1
- package/dist/esm/utils/scene-bounds.d.ts +1 -1
- package/dist/esm/utils/scene-bounds.js +1 -1
- package/dist/esm/wayfinding/adapters/canvasIconProvider.js +1 -1
- package/dist/esm/wayfinding/createWayfinding.d.ts +19 -2
- package/dist/esm/wayfinding/createWayfinding.js +1 -1
- package/package.json +11 -10
- package/dist/browser/KioskStore-CRN9B487.js +0 -290
- package/dist/browser/SetKioskMode-BlmUmBkH.js +0 -57
- package/dist/browser/booth-by-xy-DgXTlV8u.js +0 -1130
- package/dist/browser/main-WTEdqNkt.js +0 -289
- package/dist/browser/store-B_c3r86U.js +0 -41370
- package/dist/esm/components/Map/pointInConvexQuad.d.ts +0 -3
- package/dist/esm/components/Map/pointInConvexQuad.js +0 -1
- package/dist/esm/components/Map/visibleArea.d.ts +0 -16
- package/dist/esm/components/Map/visibleArea.js +0 -1
- package/dist/esm/components/Maplibre/useRendererEvents.d.ts +0 -9
- package/dist/esm/components/Maplibre/useRendererEvents.js +0 -1
- package/dist/esm/components/Maplibre/utils/update-pump.d.ts +0 -18
- package/dist/esm/components/Maplibre/utils/update-pump.js +0 -1
- package/dist/esm/renderer/HandlerRegistry.d.ts +0 -18
- package/dist/esm/renderer/HandlerRegistry.js +0 -1
- package/dist/esm/renderer/RendererService.d.ts +0 -44
- package/dist/esm/renderer/RendererService.js +0 -1
- package/dist/esm/renderer/engine-core/defs.d.ts +0 -40
- package/dist/esm/renderer/engine-core/defs.js +0 -3
- package/dist/esm/renderer/engine-core/fonts.js +0 -1
- package/dist/esm/renderer/engine-core/settings.d.ts +0 -4
- package/dist/esm/renderer/engine-core/settings.js +0 -1
- package/dist/esm/renderer/engine-core/types.d.ts +0 -50
- package/dist/esm/renderer/engine-core/types.js +0 -1
- package/dist/esm/renderer/engine-core/update-def.d.ts +0 -12
- package/dist/esm/renderer/engine-core/update-def.js +0 -1
- package/dist/esm/renderer/engine-core/utils/rotation.d.ts +0 -17
- package/dist/esm/renderer/engine-core/utils/rotation.js +0 -1
- package/dist/esm/renderer/index.d.ts +0 -19
- package/dist/esm/renderer/index.js +0 -1
- /package/dist/esm/{renderer/engine-core → engine}/canvases.d.ts +0 -0
- /package/dist/esm/{renderer/engine-core → engine}/canvases.js +0 -0
- /package/dist/esm/{renderer/engine-core → engine}/fonts.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as x}from"react/jsx-runtime";import{isLayerDefs as Z}from"@expofp/renderer";import H from"color";import{runInAction as Q}from"mobx";import{observer as Y}from"mobx-react-lite";import{useCallback as F,useEffect as h,useMemo as m,useRef as f,useState as k}from"react";import q from"../../data";import{getLayerSvg as ee,svgArea as C,svgAreaExplicit as re}from"../../data/svg";import{createSceneDef as te}from"../../engine/defs";import t,{uiState as c}from"../../store";import M from"../../tools/settings";import oe from"../../utils/is-debug";import{fitRectIsFraming as ne,getVenueFitMarginPercent as ie,resolveVenueFitRect as ae}from"../../utils/scene-bounds";import ce from"../Map/drawing/config/config-all";import{loadLayersImages as se}from"../Map/drawing/config/loadBoothsImages";import{MapViewport as le}from"../Map/MapViewport";import{clearSelection as ue}from"../Map/pointer";import{setMapScene as $}from"../Map/scene";import{useBuildRoute as me}from"../Map/traffic/useBuildRoute";import{useManageTraffic as fe}from"../Map/traffic/useManageTraffic";import{centerCoordinates as pe}from"../Map/viewport";import de from"./MaplibreWrapper";import{useCameraReactions as ge}from"./useCameraReactions";import{useDimming as be}from"./useDimming";import{useKioskIdleEvents as Se}from"./useKioskIdleEvents";import{useLayerVisibilitySync as ye}from"./useLayerVisibilitySync";import{usePoiMarkers as Re}from"./usePoiMarkers";import{useWayfindingAndMarkers as he}from"./useWayfindingAndMarkers";import{cameraForLocalRect as Ce,deriveGeoConfig as Me,getLocalRectGeoBounds as Ae,getVisibleRectFitPadding as Le,INITIAL_FIT_ZOOM_ADJUSTMENT as Pe}from"./utils/geo-config";import{applyMapOptions as V,DEFAULT_MAP_OPTIONS as De,getTileSource as ze,MAP_2D_OPTIONS as Te}from"./utils/map-helpers";import{calculateTransformMatrix as ve}from"./utils/solver";const j="routes-api.expofp.com",Oe=800;function Ee(i,g,s){return{getCameraState:()=>{const o=i.getCenter();return{lng:o.lng,lat:o.lat,zoom:i.getZoom(),bearing:i.getBearing(),pitch:i.getPitch()}},applyCameraState:o=>{i.easeTo({center:[o.lng,o.lat],zoom:o.zoom,bearing:o.bearing??g,pitch:o.pitch??s(),duration:Oe,essential:!0})},resetPitch:()=>{const o=s();i.getPitch()!==o&&i.jumpTo({pitch:o})}}}function N(){t.poiMarkerStore.clear(),Q(()=>{t.layerStore.layers.forEach(i=>{i.configured=!1,i.children=[],i.loaded=!1}),t.layerStore.layersLoaded=!1})}const Ie=Y(function({viewMode:g}){const[s,o]=k(null),[z,T]=k(!1),u=f(null),b=f(null),A=f(null),v=f(null),S=f(null),r=m(()=>Me(),[]),L=m(()=>ae({layerViewbox:t.layerStore.viewboxRectangle,explicitArea:re?C:null,layerRectangle:t.layerStore.rectangle,sceneDef:s,svgArea:C}),[s]),y=L.rect,p=m(()=>{if(!r)return null;const e=ne(L.source)?0:ie(y,C),n=Le(0);e&&c.screenSize&&(n.left+=c.screenSize.width*e,n.right+=c.screenSize.width*e,n.top+=c.screenSize.height*e,n.bottom+=c.screenSize.height*e);const l=c.screenSize?Ce(y,r.gpsConfig,r.bearing,{width:c.screenSize.width,height:c.screenSize.height},n):null;return l?{center:l.center,bearing:r.bearing,zoom:l.zoom}:{center:r.center,bearing:r.bearing,zoom:r.zoom,bounds:Ae(y,r.gpsConfig),fitPadding:n,zoomAdjustment:Pe}},[r,L,y]),R=m(()=>r?ve(r.gpsConfig,ee()?.getAttribute("units")):null,[r]),d=m(()=>({...g==="map2d"?Te:De}),[g]),P=f(d),U=m(()=>ze(),[]),a=m(()=>{if(!s||!R)return null;const e=s.rootLayer.children,n=Z(e)?e.filter(l=>l.name.toLowerCase()!=="areamap"):e;return{...s,rootLayer:{...s.rootLayer,children:n},background:void 0,staticTransform:R}},[s,R]),O=f(null);h(()=>{O.current=a},[a]),h(()=>{if(a)return $(a),()=>$(void 0)},[a]);const{mapDimAnimatorRef:E,venueDimAnimatorRef:I,applyDimmingTarget:_,handleMapDimLayerReady:B}=be(u,O);h(()=>{if(!r)return;let e=!1;N(),ce().then(({layers:D,cleanup:w})=>{if(e){w();return}A.current=w;const X=H(M.backgroundColor==="none"?"#ebebeb":M.backgroundColor).string();o(te(D,C,X))}).catch(D=>{e||console.warn("Maplibre scene configuration failed.",D)});const n=E.current,l=I.current;return()=>{e=!0,N(),A.current?.(),A.current=null,S.current&&(t.maplibreStore.clearCameraPortIfCurrent(S.current),S.current=null),u.current=null,b.current=null,v.current=null,T(!1),n?.stop(),l?.stop(),c.sceneDefReady=!1}},[r,E,I]);const G=F((e,n)=>{u.current=e,b.current=e.getCanvas(),v.current=n,T(!0),V(e,P.current);const l=Ee(e,r?.bearing??e.getBearing(),()=>P.current.pitch??0);S.current=l,t.maplibreStore.setCameraPort(l),t.fp.getCenterCoordinates=()=>pe(b.current),_({immediate:!0}),se(),t.layerStore.layersLoaded=!0,t.fp.onFpConfigured&&t.fp.onFpConfigured(),c.sceneDefReady=!0,n()},[_,r]);h(()=>{P.current=d,V(u.current,d,!0)},[d]),Se(z,u),he(a,b),Re(z,u,r),ye(a,u,r),ge(u,r,a),me({enabled:t.layerStore.layersLoaded&&c.buildRoute,scene:a??void 0});const J=q.busRoutes??!1;fe({permission:t.layerStore.layersLoaded&&J,scene:a??void 0,dataJsonUrl:`https://${j}/v1/routes?expo=${M.EXPO}`,websocketUrl:`wss://${j}/locations?expo=${M.EXPO}`});const K=F(e=>{console.warn("Maplibre map failed to load; falling back to floorplan mode.",e),t.maplibreStore.deactivateMaplibre()},[]);if(!r||!p||!R||!a)return null;const W=`${p.center.join(",")}:${p.bearing}:${p.zoom}`;return x(de,{sceneDef:a,geoConfig:p,tileSource:U,mapOptions:d,debug:oe,onMapReady:G,onMapDimLayerReady:B,onMapLoadError:K,onPointerMissed:ue,children:x(le,{})},W)});export default Ie;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import 'maplibre-gl/dist/maplibre-gl.css';
|
|
2
|
-
import {
|
|
2
|
+
import { type PointerMissedEventData, type SceneDef } from '@expofp/renderer';
|
|
3
3
|
import { type LngLatBoundsLike, Map as MaplibreMap, type StyleSpecification } from 'maplibre-gl';
|
|
4
|
+
import { type ReactNode } from 'react';
|
|
4
5
|
export declare const MAP_DIM_LAYER_ID = "expofp-map-dim";
|
|
5
6
|
/**
|
|
6
7
|
* Configuration for the map tile source.
|
|
@@ -46,29 +47,50 @@ export interface MapOptions {
|
|
|
46
47
|
maxBounds?: LngLatBoundsLike;
|
|
47
48
|
}
|
|
48
49
|
export interface MaplibreWrapperProps {
|
|
49
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* The scene to render inside the map, already prepared for external mode by the caller:
|
|
52
|
+
* MapLibre is the only basemap (no areamap layer), the map paints the background, and the
|
|
53
|
+
* scene's `staticTransform` places the plan in Mercator.
|
|
54
|
+
*/
|
|
50
55
|
sceneDef: SceneDef;
|
|
51
56
|
/** Geographic configuration for map positioning and floorplan locking */
|
|
52
57
|
geoConfig: GeoConfig;
|
|
53
|
-
/** Static SVG-to-Mercator transform prepared by the adapter */
|
|
54
|
-
staticTransform: number[];
|
|
55
58
|
/** Tile source configuration (online style URL for now) */
|
|
56
59
|
tileSource: TileSourceConfig;
|
|
57
60
|
/** Map camera constraints and defaults */
|
|
58
61
|
mapOptions?: MapOptions;
|
|
59
|
-
/**
|
|
60
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Mounts the renderer's debug overlay. Fixed for the wrapper's lifetime: when set, map creation
|
|
64
|
+
* waits for `prepareDebug()`, so the map's context is created already instrumented and the
|
|
65
|
+
* GPU-memory panel has figures to show.
|
|
66
|
+
*/
|
|
67
|
+
debug?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Called once the map exists and its custom layer received the shared WebGL context — the
|
|
70
|
+
* moment the caller can wire map-level state: camera port, options, store flags.
|
|
71
|
+
*/
|
|
72
|
+
onMapReady?: (map: MaplibreMap, requestRepaint: () => void) => void;
|
|
61
73
|
/** Called when the dim overlay layer is available for paint updates. */
|
|
62
74
|
onMapDimLayerReady?: (map: MaplibreMap) => void;
|
|
63
75
|
/** Called when the map style cannot be loaded. */
|
|
64
76
|
onMapLoadError?: (error: unknown) => void;
|
|
77
|
+
/** Forwarded to the renderer: a click that reached no layer handler. */
|
|
78
|
+
onPointerMissed?: (event: PointerMissedEventData) => void;
|
|
79
|
+
/** Components rendered inside the renderer's tree, under the scene's space. */
|
|
80
|
+
children?: ReactNode;
|
|
65
81
|
}
|
|
66
82
|
/**
|
|
67
83
|
* A pure, state-agnostic React component that renders a Maplibre map
|
|
68
84
|
* with the ExpoFP floorplan embedded via CustomLayerInterface.
|
|
69
85
|
*
|
|
86
|
+
* The floorplan draws through the ordinary `<Renderer>` in external mode: the custom layer hands
|
|
87
|
+
* over the map's WebGL context when MapLibre creates it, repaint demand becomes
|
|
88
|
+
* `map.triggerRepaint()`, and every frame the map draws forwards its projection matrix to the
|
|
89
|
+
* renderer's subscribed draw. There is no update pump: the renderer asks the host for frames
|
|
90
|
+
* itself, through the same demand channel its own canvas would use.
|
|
91
|
+
*
|
|
70
92
|
* This component does NOT import MobX or any application state.
|
|
71
|
-
* All state synchronization is done externally via the
|
|
93
|
+
* All state synchronization is done externally via the onMapReady callback.
|
|
72
94
|
*/
|
|
73
|
-
export default function MaplibreWrapper({ sceneDef, geoConfig,
|
|
95
|
+
export default function MaplibreWrapper({ sceneDef, geoConfig, tileSource, mapOptions, debug, onMapReady, onMapDimLayerReady, onMapLoadError, onPointerMissed, children, }: MaplibreWrapperProps): import("react").JSX.Element;
|
|
74
96
|
//# sourceMappingURL=MaplibreWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as F}from"react/jsx-runtime";import"maplibre-gl/dist/maplibre-gl.css";import{prepareDebug as H,Renderer as J}from"@expofp/renderer";import{addProtocol as V,Map as W}from"maplibre-gl";import{Protocol as X}from"pmtiles";import{useEffect as z,useRef as l,useState as k}from"react";import{registerPmtilesArchive as K}from"./utils/pmtiles-range-fallback";import{createStyleTransform as Q}from"./utils/resolve-map-style";export const MAP_DIM_LAYER_ID="expofp-map-dim";const p="expofp-map-dim-source",$="3d-expofp";let y=null;const v=["coalesce",["get","name:en"],["get","name_en"],["get","name:latin"],["get","name"]],ee={type:"Feature",geometry:{type:"Polygon",coordinates:[[[-180,-85],[180,-85],[180,85],[-180,85],[-180,-85]]]},properties:{}};function T(e){if(!e||typeof e!="object")return!1;const o=e.length;if(typeof o!="number"||o<16)return!1;const r=e[0];return typeof r=="number"&&Number.isFinite(r)}function te(e){if(T(e))return Array.from(e);const r=e?.defaultProjectionData?.mainMatrix;return T(r)?Array.from(r):(console.warn("Maplibre custom layer received an unsupported projection matrix payload.",e),null)}function g(e){return typeof e=="string"?e.includes("name"):Array.isArray(e)?e.some(o=>g(o)):!e||typeof e!="object"?!1:Object.values(e).some(o=>g(o))}function oe(e){return e.type!=="symbol"||!e.id||!e.layout?!1:g(e.layout["text-field"])}function re(e){const o=e.getStyle();for(const r of o.layers??[])oe(r)&&e.setLayoutProperty(r.id,"text-field",v)}function ne(){if(y)return y;const e=new X;y=e;try{V("pmtiles",e.tile)}catch(o){console.warn("Maplibre PMTiles protocol registration failed.",o)}return e}export default function ie({sceneDef:e,geoConfig:o,tileSource:r,mapOptions:Z,debug:b,onMapReady:x,onMapDimLayerReady:h,onMapLoadError:M,onPointerMissed:B,children:C}){const P=l(null),[A,S]=k(),_=l(x),L=l(h),j=l(M),N=l({geoConfig:o,tileSource:r,mapOptions:Z,debug:b});return z(()=>{_.current=x,L.current=h,j.current=M}),z(()=>{const E=P.current;if(!E)return;const{geoConfig:n,tileSource:d,mapOptions:s,debug:U}=N.current;let m=!1,I;const R=()=>{const G=ne(),Y=n.bounds?{bounds:n.bounds,fitBoundsOptions:{padding:n.fitPadding,bearing:n.bearing}}:{center:n.center,zoom:n.zoom},D=Q(d.style,d.offline?i=>K(G,i):void 0),t=new W({container:E,...Y,bearing:n.bearing,pitch:s?.pitch??30,maxPitch:s?.maxPitch??70,minZoom:s?.minZoom,maxZoom:s?.maxZoom,maxBounds:s?.maxBounds,bearingSnap:0,canvasContextAttributes:{antialias:!0}});n.zoomAdjustment&&t.jumpTo({zoom:t.getZoom()+n.zoomAdjustment}),t.once("error",i=>{t.isStyleLoaded()||j.current?.(i?.error??i)});const O=i=>{const a=i?.id;!a||t.hasImage(a)||t.addImage(a,{width:1,height:1,data:new Uint8Array(4)})};t.on("styleimagemissing",O);let f;const u=()=>t.triggerRepaint(),q={id:$,type:"custom",renderingMode:"3d",onAdd(i,a){m||(S({gl:a,requestFrame:u,onFrame:c=>(f=c,u(),()=>{f===c&&(f=void 0)})}),_.current?.(t,u))},render(i,a){const c=te(a??i);c&&f?.(c)}},w=()=>{re(t),t.getSource(p)||t.addSource(p,{type:"geojson",data:ee}),t.getLayer(MAP_DIM_LAYER_ID)||t.addLayer({id:MAP_DIM_LAYER_ID,type:"fill",source:p,paint:{"fill-color":"#000000","fill-opacity":0,"fill-opacity-transition":{duration:0,delay:0}}}),L.current?.(t),t.addLayer(q)};t.on("style.load",w),t.setStyle(d.style,D?{transformStyle:D}:void 0),I=()=>{t.off("style.load",w),t.off("styleimagemissing",O),t.remove()}};return U?H().then(()=>{m||R()}):R(),()=>{m=!0,I?.(),S(void 0)}},[]),F("div",{ref:P,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},children:A&&F(J,{...A,scene:e,debug:b,onPointerMissed:B,children:C})})}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { type SceneDef } from '@expofp/renderer';
|
|
1
2
|
import { type Map as MaplibreMap } from 'maplibre-gl';
|
|
2
3
|
import { type RefObject } from 'react';
|
|
3
|
-
import { type RendererService } from '../../renderer/RendererService';
|
|
4
4
|
import { type DimmingAnimator } from '../../utils/dimming';
|
|
5
5
|
export interface DimmingControls {
|
|
6
6
|
mapDimAnimatorRef: RefObject<DimmingAnimator | null>;
|
|
@@ -21,5 +21,5 @@ export declare function getMapDimTarget(): boolean;
|
|
|
21
21
|
* keeps them in sync with uiState.dimmed via a MobX reaction,
|
|
22
22
|
* and provides a callback for when the map dim layer is ready.
|
|
23
23
|
*/
|
|
24
|
-
export declare function useDimming(mapRef: RefObject<MaplibreMap | null>,
|
|
24
|
+
export declare function useDimming(mapRef: RefObject<MaplibreMap | null>, sceneRef: RefObject<SceneDef | null>): DimmingControls;
|
|
25
25
|
//# sourceMappingURL=useDimming.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as
|
|
1
|
+
import{update as g}from"@expofp/renderer";import{useCallback as c,useEffect as T,useRef as p}from"react";import d,{uiState as y}from"../../store";import{applyVenueDim as I,createDimmingAnimator as s,DIM_INTENSITY as l,VENUE_DIM_INTENSITY as M}from"../../utils/dimming";import{useReaction as A}from"../../utils/mobx";import{applyMapDimValue as D}from"./utils/map-helpers";export function getMapDimTarget(){return y.dimmed&&!d.poiMarkerStore.dimSuppressed}export function useDimming(i,u){const e=p(null),n=p(null),a=c(r=>{const t=getMapDimTarget();e.current?.setTarget(t,r),n.current?.setTarget(t,r)},[]);T(()=>{const r=s(m=>{D(i.current,m*l)}),t=s(m=>{const o=u.current;o&&I(o,m*M)&&g(o.rootLayer)});return e.current=r,n.current=t,()=>{r.stop(),t.stop(),e.current=null,n.current=null}},[i,u]),A(()=>getMapDimTarget(),()=>a());const f=c(r=>{const t=e.current?.getValue()??(getMapDimTarget()?1:0);D(r,t*l)},[]);return{mapDimAnimatorRef:e,venueDimAnimatorRef:n,applyDimmingTarget:a,handleMapDimLayerReady:f}}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type Renderer } from '@expofp/renderer';
|
|
2
1
|
import { type Map as MaplibreMap } from 'maplibre-gl';
|
|
3
2
|
import { type RefObject } from 'react';
|
|
4
3
|
/**
|
|
@@ -9,10 +8,10 @@ import { type RefObject } from 'react';
|
|
|
9
8
|
* these listeners the timer runs out mid-gesture for a visitor who only moves
|
|
10
9
|
* the map.
|
|
11
10
|
*
|
|
12
|
-
* `
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
11
|
+
* `ready` is the mount signal: `mapRef.current` is assigned in the same
|
|
12
|
+
* `handleMapReady` call that sets it, so keying the effect on `ready` is what
|
|
13
|
+
* guarantees there is a map to subscribe to — the early return below is the
|
|
14
|
+
* assertion of that contract, not a tolerated miss.
|
|
16
15
|
*/
|
|
17
|
-
export declare function useKioskIdleEvents(
|
|
16
|
+
export declare function useKioskIdleEvents(ready: boolean, mapRef: RefObject<MaplibreMap | null>): void;
|
|
18
17
|
//# sourceMappingURL=useKioskIdleEvents.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { type SceneDef } from '@expofp/renderer';
|
|
1
2
|
import type { Map as MaplibreMap } from 'maplibre-gl';
|
|
2
3
|
import { type RefObject } from 'react';
|
|
3
|
-
import type { RendererService } from '../../renderer/RendererService';
|
|
4
4
|
import { type GeoConfig } from './utils/geo-config';
|
|
5
5
|
/**
|
|
6
6
|
* Keeps the 3D scene layer visibility in sync with LayerStore.
|
|
7
7
|
* When a layer's visibility changes, updates the corresponding LayerDefs
|
|
8
8
|
* and fits the camera to the newly visible floor.
|
|
9
9
|
*/
|
|
10
|
-
export declare function useLayerVisibilitySync(
|
|
10
|
+
export declare function useLayerVisibilitySync(scene: SceneDef | null, mapRef: RefObject<MaplibreMap | null>, geoConfig: GeoConfig | null): void;
|
|
11
11
|
//# sourceMappingURL=useLayerVisibilitySync.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useRef as
|
|
1
|
+
import{update as p}from"@expofp/renderer";import{useRef as y}from"react";import a from"../../store";import{useReaction as L}from"../../utils/mobx";import{fitMapToLocalRect as b}from"./utils/geo-config";import{collectLayerDefsByName as h}from"./utils/layer-defs";export function useLayerVisibilitySync(r,s,l){const n=y(null),c=y(null);L(()=>a.layerStore.layers.map(t=>`${t.name}:${t.visible?1:0}`),()=>{if(!r)return;n.current?.rootLayer!==r.rootLayer&&(n.current={rootLayer:r.rootLayer,defsByName:h(r.rootLayer)});const t=n.current.defsByName,i=[];for(const e of a.layerStore.layers){const m=t.get(e.name);if(m?.length)for(const f of m){const u=!e.visible;f.hidden!==u&&(f.hidden=u,i.push(f))}}i.length&&p(...i);const o=a.layerStore.layers.find(e=>e.visible&&!e.frozen&&!e.rootParent&&!e.pathway);if(!o||c.current===o.name)return;c.current=o.name;const d=o.viewbox??o.rect;b(s.current,d??null,l)},void 0,[r,s,l])}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type Renderer } from '@expofp/renderer';
|
|
2
1
|
import { type Map as MaplibreMap } from 'maplibre-gl';
|
|
3
2
|
import { type RefObject } from 'react';
|
|
4
3
|
import { type GeoConfig } from './utils/geo-config';
|
|
@@ -22,5 +21,5 @@ import { type GeoConfig } from './utils/geo-config';
|
|
|
22
21
|
* (`configOutdoorPoiLayer` never publishes), so this is belt-and-braces — it
|
|
23
22
|
* keeps the map untouched even if markers reach the store another way.
|
|
24
23
|
*/
|
|
25
|
-
export declare function usePoiMarkers(
|
|
24
|
+
export declare function usePoiMarkers(ready: boolean, mapRef: RefObject<MaplibreMap | null>, geoConfig: GeoConfig | null): void;
|
|
26
25
|
//# sourceMappingURL=usePoiMarkers.d.ts.map
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
1
|
+
import { type SceneDef } from '@expofp/renderer';
|
|
2
|
+
import { type RefObject } from 'react';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Starts wayfinding and markers once the scene exists, and tears them down with it — the same
|
|
5
|
+
* declarative forms the standalone map uses: both fill layers `configAll` put in the scene, and
|
|
6
|
+
* layout and picking reach them through the handlers their own defs declare.
|
|
7
|
+
* @param scene - The prepared scene the map draws, once it exists.
|
|
8
|
+
* @param canvas - The canvas the plan draws on — the map's own, read lazily.
|
|
6
9
|
*/
|
|
7
|
-
export declare function useWayfindingAndMarkers(
|
|
10
|
+
export declare function useWayfindingAndMarkers(scene: SceneDef | null, canvas: RefObject<HTMLCanvasElement | null>): void;
|
|
8
11
|
//# sourceMappingURL=useWayfindingAndMarkers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as
|
|
1
|
+
import{useEffect as f}from"react";import n from"../../store";import{createWayfinding as e}from"../../wayfinding";import{configMarkers as m}from"../Map/drawing/config/config-markers";export function useWayfindingAndMarkers(r,o){f(()=>{if(!r)return;const i=e({scene:r,store:n,canvas:o}),t=m({scene:r});return()=>{i(),t()}},[r,o])}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import { type LayerDef
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { type LayerDef } from '@expofp/renderer';
|
|
2
|
+
/**
|
|
3
|
+
* Indexes a layer tree by name, one list per name — floors repeat across scenes.
|
|
4
|
+
* @param layer - The root to walk.
|
|
5
|
+
* @param acc - The accumulator, threaded through recursion.
|
|
6
|
+
* @returns Layer defs by name.
|
|
7
|
+
*/
|
|
8
|
+
export declare function collectLayerDefsByName(layer: LayerDef, acc?: Map<string, LayerDef<import("@expofp/renderer").RenderableDef>[]>): Map<string, LayerDef<import("@expofp/renderer").RenderableDef>[]>;
|
|
4
9
|
//# sourceMappingURL=layer-defs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{isLayerDef as o}from"@expofp/renderer";export function collectLayerDefsByName(e,f=new Map){if(e.name){const n=f.get(e.name)??[];n.push(e),f.set(e.name,n)}for(const n of e.children??[])o(n)&&collectLayerDefsByName(n,f);return f}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
type PoiMarkerHitTest = (x: number, y: number) => boolean;
|
|
2
2
|
/**
|
|
3
3
|
* Model-space hit-test against the outdoor PoI symbol/cluster layers, set by
|
|
4
|
-
* `usePoiMarkers` while active. The
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* `usePoiMarkers` while active. The plan's click seam (`clickedPlan` in
|
|
5
|
+
* Map/pointer.ts) consults it so a click handled by a native MapLibre layer
|
|
6
|
+
* does not also select the booth underneath.
|
|
7
7
|
*
|
|
8
8
|
* Deliberately a leaf module (no imports): it decouples the renderer click
|
|
9
9
|
* pipeline from the Maplibre hook that owns the marker layers.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as s,jsxs as r}from"react/jsx-runtime";import"./Speaker.scss";import
|
|
1
|
+
import{jsx as s,jsxs as r}from"react/jsx-runtime";import"./Speaker.scss";import p from"classnames";import{observer as f}from"mobx-react-lite";import{useObserver as w}from"mobx-react-lite";import{useEffect as j,useMemo as y,useRef as h,useState as T}from"react";import x from"../data";import t,{uiState as o}from"../store";import{GaEventActions as l,sendEventToGa as m}from"../tools/gtag";import A from"../tools/track-event";import{t as u}from"../utils/i18n";import{Schedule as D,SidebarActionsContainer as G}from"./";const H=f(()=>{const i=h(null),n=h(null),[v,_]=T(!1),e=t.speakerStore.selectedSpeaker;if(!e)return s("div",{className:"efp-speaker-empty",children:u("Speaker not found")});const k=t.speakerStore.getEventsBySpeaker(e.id),d=y(()=>[...k].sort((a,c)=>{const B=new Date(a.startDate).getTime(),E=new Date(c.startDate).getTime();return B-E}),[k]);j(()=>{(()=>{if(n.current){const c=n.current.offsetHeight;_(c>300)}})()},[]);const S=a=>{t.selectEventItem(a,!0)},b=()=>{e.bookmarked=!e.bookmarked,m(l.ClickBookmark,e.name),e.bookmarked&&A("bookmark",e.name,"speaker")},N=()=>{m(l.ClickCustomButton,e.name),t.toggleModal("share")},C=()=>{m(l.ClickCustomButton,e.name)},g=p({"efp-speaker":!0,[o.responsiveClass]:!0});return w(()=>r("div",{className:g,children:[r("div",{className:"efp-speaker__header",children:[s("div",{className:"efp-speaker__icon",children:s("i",{className:"icon-speaker-solid"})}),r("div",{className:"efp-speaker__content",children:[s("div",{className:"efp-speaker__name",children:e.name}),e.company&&s("div",{className:"efp-speaker__company",children:e.company}),e.jobTitle&&s("div",{className:"efp-speaker__job-title",children:e.jobTitle})]}),e.photoFile&&s("div",{className:"efp-speaker__photo",children:s("img",{src:e.photoFile,alt:e.name})})]}),s("div",{className:"efp-speaker__buttons",children:!o.isGuidedToursActive&&s(G,{showBookmark:!o.disableBookmarked&&!x.hideBookmarks&&!o.kiosk,showDirections:!1,inBookmark:e.bookmarked||!1,showShare:!0,showVisited:!1,visited:!1,onClickBookmark:b,onClickShare:N,onClickVisited:C})}),s("div",{className:p("efp-speaker__details",{"details-hidden":o.kiosk&&v}),ref:n,children:d.length>0&&r("div",{className:"efp-speaker-events",children:[s("h3",{className:"efp-speaker-events__title",children:u("Sessions")}),s(D,{events:d,showBooths:!0,isSessions:!1,onEventClick:S})]})})]}))}),O=f(()=>{const i=t.uiState.details;return!i||i?.entity?.type!=="speaker"?null:s(H,{})});export default O;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as n}from"react/jsx-runtime";import"./Ws.scss";import
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import"./Ws.scss";import b from"classnames";import{reaction as y}from"mobx";import{useLocalStore as I,useObserver as x}from"mobx-react-lite";import S,{createRef as k,useCallback as h}from"react";import{CSSTransition as T,TransitionGroup as v}from"react-transition-group";import E,{exhibitorStore as N,uiState as o}from"../store";import{trackWsExhibitorClick as M}from"../tools/gtag";import{remsToPixels as B,shuffle as L}from"../utils";import{loadImagesInBatchesById as R}from"../utils/loadImagesInBatches";import{useInit as z}from"../utils/mobx";const u=8e3,W=S.memo(()=>{const t=I(()=>({el:null,all:[],adv:[],keySeq:0,index:0,batchStart:0,imgByExhibitorId:new Map,batchSize:100,loading:!1,leftToNextLoad:0,timeoutId:0,get sectionStyle(){const{wsStarted:e,wsPosition:i}=o,l=i==="top",r={right:0,width:"100%",opacity:e?1:0};return l?r.top=0:r.bottom=0,r}})),s=h((e=!1)=>{const i=e?t.adv:[];e?t.index=t.batchStart:t.batchStart=t.index;const r=(t.el?.getBoundingClientRect().width??0)-B(.3)*2;let g=0;const a=[];do{const c=t.all[t.index%t.all.length],m=t.imgByExhibitorId.get(c.id);if(!m)break;const p=m.width*o.wsImageHeightPx/m.height+20;if(g+p>r&&a.length)break;g+=p;const w=i[a.length]?.e===c?i[a.length]:null;a.push(w??{key:t.keySeq++,e:c,nodeRef:k()}),t.index=(t.index+1)%t.all.length}while(!0);t.adv=a,t.leftToNextLoad=Math.max(0,t.leftToNextLoad-Math.max(0,a.length-i.length))},[t]),d=h(async()=>{t.loading=!0;let e=t.all.slice(t.index,t.index+t.batchSize);e.length<t.batchSize&&(e=e.concat(t.all.slice(0,t.batchSize-e.length)));const i=await R(new Map(e.map(l=>[l.id,{fallback:l.logo?.url}])));return t.leftToNextLoad=i.size,t.loading=!1,i},[t]),f=h(()=>{const e=async()=>{if(t.loading){t.timeoutId=window.setTimeout(e,u);return}t.leftToNextLoad<=t.adv.length&&(t.imgByExhibitorId=await d()),s(),t.timeoutId=window.setTimeout(e,u)};clearTimeout(t.timeoutId),t.timeoutId=window.setTimeout(e,u)},[d,s]);return z(()=>{let e,i=!0;return(async()=>(t.all=L(N.advertised),t.imgByExhibitorId=await d(),i&&(s(),f(),o.wsStarted=!0,e=y(()=>o.screenSize,()=>s(!0),{delay:250}))))(),()=>{i=!1,e?.(),clearInterval(t.timeoutId)}}),x(()=>n("section",{className:b("ws",{"efp-semi-transparent":o.setKioskModeEnabled}),ref:e=>t.el=e,onMouseOver:()=>clearInterval(t.timeoutId),onMouseOut:f,style:t.sectionStyle,children:n(v,{component:null,children:t.adv.map(e=>n(T,{timeout:500,nodeRef:e.nodeRef,children:n("a",{ref:e.nodeRef,href:`?${e.e.slug}`,className:"ws__exhibitor",style:{height:`${o.wsImageHeightPx}px`},onClick:i=>{i.preventDefault(),M(e.e),E.clickExhibitor(e.e)},children:n("img",{src:e.e.logo?.url,alt:e.e.name,crossOrigin:"anonymous"})})},e.key))})}))});export default()=>x(()=>o.wsShown?n(W,{}):null);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Box, type LineLike, Mesh, type Polygon, Rect, type TriangleIndex } from '@expofp/geometry';
|
|
2
|
+
import { type ImageDef, type ImageSource, type LayerDef, type LineDef, type RenderableDefCollection, type SceneDef, type ShapeDef, type SharedDef, type TextAlignment, type TextDef, type TextLineDef } from '@expofp/renderer';
|
|
3
|
+
/**
|
|
4
|
+
* What svgMesh3d puts on `window.__fpPaths`: vertices as bare number tuples, which is why this is
|
|
5
|
+
* not geometry's `MeshLike` — that one holds points. The third component is optional because
|
|
6
|
+
* svgMesh3d emits it per vertex and only sometimes.
|
|
7
|
+
*/
|
|
8
|
+
export interface MeshType {
|
|
9
|
+
positions: [number, number, number?][];
|
|
10
|
+
cells: TriangleIndex[];
|
|
11
|
+
}
|
|
12
|
+
export type TextLines = [string[], string[]];
|
|
13
|
+
export interface FontSizeFactor {
|
|
14
|
+
scaleFactor: number;
|
|
15
|
+
value: number;
|
|
16
|
+
lines: string[];
|
|
17
|
+
}
|
|
18
|
+
export declare function rectToShapeDef(rect: SVGRectElement, color?: string): ShapeDef;
|
|
19
|
+
export declare function meshToShapeDef(mesh: MeshType, color: string): ShapeDef;
|
|
20
|
+
export declare function createShapeDef(shape: Box | Rect | Polygon | Mesh, color?: string): ShapeDef;
|
|
21
|
+
export declare function createImageDef(source: ImageSource, bounds: Rect, options?: SharedDef & {
|
|
22
|
+
origin?: [number, number];
|
|
23
|
+
}): ImageDef;
|
|
24
|
+
export declare function createTextDef(textLines: TextLineDef[], bounds: Rect, padding: [number, number], alignment: TextAlignment, options?: SharedDef): TextDef;
|
|
25
|
+
export declare function createTextDefLines(textLines: TextLines, color: string, fontSize: number, fontUrl?: [string | undefined, string | undefined]): TextLineDef[];
|
|
26
|
+
export declare function createLineDef({ p0, p1 }: LineLike, color?: string, width?: number): LineDef;
|
|
27
|
+
export declare function createLayerDef(name: string, children: RenderableDefCollection, options?: SharedDef): LayerDef;
|
|
28
|
+
export declare function createSceneDef(layers: LayerDef[], viewboxRect: Box | SVGRectElement, background?: string): SceneDef;
|
|
29
|
+
export declare function createShapeDot(rect: Rect, color?: string, radius?: number): ImageDef;
|
|
30
|
+
//# sourceMappingURL=defs.d.ts.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{Box as i,isBox as s,isMesh as c,isPolygon as u,isRect as x,Mesh as d,Rect as h}from"@expofp/geometry";import{createCircleCanvas as p}from"./canvases";import{DEFAULT_FONT_LIGHT_URL as w,DEFAULT_FONT_URL as D}from"./fonts";export function rectToShapeDef(e,r){return createShapeDef(i.fromSvg(e),r)}export function meshToShapeDef(e,r){if(!e)throw new Error("Create ShapeDef: mesh is not provided");const t=e.positions.map(o=>({x:o[0],y:Math.abs(o[1]),z:o[2]??0})),n=e.cells;return createShapeDef(new d(t,n),r)}export function createShapeDef(e,r="#000"){if(!e||!(s(e)||x(e)||u(e)||c(e)))throw new Error("Invalid shape definition");return{shape:e,color:r}}export function createImageDef(e,r,t){if(!e)throw new Error("Image source is not provided");return{source:e,bounds:r,...t}}export function createTextDef(e,r,t,n,o){if(e.length===0)throw new Error("Invalid text lines");return{lines:e,bounds:r,padding:t,alignment:n,...o}}export function createTextDefLines(e,r,t,n=[void 0,void 0]){const[o,f]=e,a=[{text:o.join(`
|
|
2
|
+
`),fontUrl:n[0]||D,color:r,fontSize:t}];return f.length&&a.push({text:f.join(`
|
|
3
|
+
`),fontUrl:n[1]||w,color:r,fontSize:t}),a}export function createLineDef({p0:e,p1:r},t="#000",n=10){if(!(e?.x&&e.y||r?.x&&r.y))throw new Error("Line data is invalid");return{points:{p0:{x:e.x,y:e.y},p1:{x:r.x,y:r.y}},color:t,width:n}}export function createLayerDef(e,r,t){if(!e)throw new Error("Layer name is required");return r||(r=[]),{name:e,children:r,...t}}export function createSceneDef(e,r,t){const n=r instanceof i?r:i.fromSvg(r);return{rootLayer:createLayerDef("root",e),background:t,viewbox:n}}export function createShapeDot(e,r="#000",t=1.5){const n=p(t,r),o=new h(e.center,{x:n.width,y:n.height},e.rotation,e.elevation);return createImageDef(n,o)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getConfig as s}from"@expofp/config";import t from"../tools/base-runtime-url";export const DEFAULT_FONT_URL=`${t}fonts/oswald-v17-cyrillic_latin-500.woff`,DEFAULT_FONT_LIGHT_URL=`${t}fonts/oswald-v17-cyrillic_latin-300.woff`;export function loadCustomFontsUrls(){const o=s();return o.customCssFonts?.length?o.customCssFonts:[]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Rect } from '@expofp/geometry';
|
|
2
|
+
import { type TextDef, type TextLineDef } from '@expofp/renderer';
|
|
3
|
+
import { type FontSizeFactor } from './defs';
|
|
4
|
+
export declare function updateLinesScale(lines: TextLineDef[], scale: number, fontSizes: [FontSizeFactor[], FontSizeFactor[]]): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Turns a text def's own bounds: the axis-aligned 90° footprint swap (width ↔ height) plus the
|
|
7
|
+
* rotation delta.
|
|
8
|
+
*
|
|
9
|
+
* **In place**, where {@link updateRectRotation} returns a new rect, and the difference is
|
|
10
|
+
* ownership rather than taste. These bounds belong to a def the renderer already holds, and the
|
|
11
|
+
* drawers capture them into locals to write through (`layOutDot` resizes `shapeDot.bounds` that
|
|
12
|
+
* way) — so replacing the object would strand every reference to it. `Rect.set` is geometry's
|
|
13
|
+
* escape hatch for exactly this. A drawer's own `canvasRect` has no such holders, which is why the
|
|
14
|
+
* other one is free to hand back a fresh value.
|
|
15
|
+
* @param textDef - The def to turn; its bounds are written through.
|
|
16
|
+
* @param rotation - The rotation delta, in radians.
|
|
17
|
+
* @returns The same def, for callers that read as if it were a value.
|
|
18
|
+
*/
|
|
19
|
+
export declare function updateTextDefRotation(textDef: TextDef, rotation: number): TextDef;
|
|
20
|
+
/**
|
|
21
|
+
* Turns a plain rect: the same transform {@link updateTextDefRotation} applies, on a rect no def
|
|
22
|
+
* holds — a drawer's `canvasRect`, which every caller reassigns — so this one is free to return a
|
|
23
|
+
* new value instead of writing through.
|
|
24
|
+
*
|
|
25
|
+
* Rebuilt from scalars, so the elevation is carried across explicitly; a rect that dropped it would
|
|
26
|
+
* take whatever is rebuilt from it down to the floor on the first roll.
|
|
27
|
+
* @param rect - The rect to turn.
|
|
28
|
+
* @param angle - The rotation delta, in radians.
|
|
29
|
+
* @returns The turned rect.
|
|
30
|
+
*/
|
|
31
|
+
export declare function updateRectRotation(rect: Rect, angle: number): Rect;
|
|
32
|
+
export declare function getRotation(newAngle: number, currentRotation: number): number | undefined;
|
|
33
|
+
export declare function shouldFlip(newAngle: number, currentRotation: number): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The signed shortest angle from `currentRotation` to `newAngle`, wrapped into `(-π, π]`.
|
|
36
|
+
*
|
|
37
|
+
* Always a number: the `| undefined` this used to be declared with described no path through the
|
|
38
|
+
* body, and its two callers already read the result as a plain angle.
|
|
39
|
+
* @param newAngle - The angle turned to, in radians.
|
|
40
|
+
* @param currentRotation - The angle turned from, in radians.
|
|
41
|
+
* @returns The difference in radians.
|
|
42
|
+
*/
|
|
43
|
+
export declare function getAngleDiff(newAngle: number, currentRotation: number): number;
|
|
44
|
+
export declare function flipAngle(angle: number): number;
|
|
45
|
+
export declare function getClampedBoundsCanvas(rect: Rect, canvas: HTMLCanvasElement, padding: number, scale: number): Rect;
|
|
46
|
+
/**
|
|
47
|
+
* Reads the `roll` map setting — `1`/`0`, from the URL or the venue — as a boolean, refusing
|
|
48
|
+
* anything else. The label configs consult it before declaring their `onRoll` rules: with roll
|
|
49
|
+
* disabled the plan never turns, so a counter-rotation would only ever fight a stale angle.
|
|
50
|
+
*/
|
|
51
|
+
export declare function getRollValue(value: 1 | 0): boolean;
|
|
52
|
+
//# sourceMappingURL=update-def.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Rect as X}from"@expofp/geometry";import{getBounds as Y}from"./canvases";export function updateLinesScale(o,n,t){let e=!1;return o.forEach((i,c)=>{let s=0;t[c].forEach(({value:a,scaleFactor:r})=>{n<r&&(s=a)}),i.fontSize!==s*n&&(e=!0),i.fontSize=s*n}),e}export function updateTextDefRotation(o,n){const t=o.bounds;return t.set(t.center.x,t.center.y,t.size.y,t.size.x,t.rotation+n,t.elevation),o}export function updateRectRotation(o,n){const{size:t,center:e,rotation:i,elevation:c}=o;return new X(e,{x:t.y,y:t.x},i+n,c)}export function getRotation(o,n){const t=getAngleDiff(o,n);if(Math.abs(t)>Math.PI/4)return Math.sign(t)*Math.PI/2}export function shouldFlip(o,n){const t=getAngleDiff(o,n),e=Math.PI/2;return Math.abs(t)>e+.1}export function getAngleDiff(o,n){const t=Math.PI,e=2*t;return((c,s)=>((c-s+t)%e+e)%e-t)(o,n)}export function flipAngle(o){return(o+Math.PI+Math.PI)%(2*Math.PI)-Math.PI}export function getClampedBoundsCanvas(o,n,t,e){const i=n.width,c=n.height,s=o.size,a=o.center,r=o.rotation,d=s.x/i,m=s.x-t*2,g=(s.y-t*2)*.8,M=0,b=m/i,I=g/c,y=Math.min(b,I,d);e=Math.min(Math.max(e,M),y);const P=i*e,R=c*e,h=Math.sin(r),f=Math.cos(r),u=s.x/2-t,x=-s.y/2+t,S=a.x+u*f-x*h,z=a.y+u*h+x*f,p=P/2,l=-R/2,B=p*f-l*h,W=p*h+l*f,w=S-B,H=z-W;return Y(w,H,i,c,e,r)}export function getRollValue(o){if(!o)return!1;if(!Number.isInteger(+o)||+o!=1&&+o!=0)throw new Error("Map roll: setting value is incorrect");return!!+o}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Rect, RectLike } from '@expofp/geometry';
|
|
2
|
+
import { ImageDef } from '@expofp/renderer';
|
|
3
|
+
export declare function isInnerInsideOuter(inner: Rect, outer?: RectLike): boolean;
|
|
4
|
+
export declare function flipImageDef(imageDef: ImageDef, angle: number): boolean;
|
|
5
|
+
export declare function rotateImageDef(imageDef: ImageDef, angle: number): boolean;
|
|
6
|
+
//# sourceMappingURL=rotation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{flipAngle as h,getRotation as y,shouldFlip as u}from"../update-def";export function isInnerInsideOuter(o,n){if(!n)return!1;const t=Math.cos(n.rotation??0),e=Math.sin(n.rotation??0),c=n.size.x/2,a=n.size.y/2;return d(o,o.rotation+Math.PI/2).every(r=>{const i=r.x-n.center.x,f=r.y-n.center.y,s=i*t+f*e,x=f*t-i*e;return Math.abs(s)<=c&&Math.abs(x)<=a})}function d(o,n=o.rotation){const t=o.size.x/2,e=o.size.y/2,c=Math.sin(n),a=Math.cos(n),r=o.center.x,i=o.center.y;return[{x:-t,y:-e},{x:t,y:-e},{x:t,y:e},{x:-t,y:e}].map(s=>({x:r+s.x*a-s.y*c,y:i+s.x*c+s.y*a}))}export function flipImageDef(o,n){const t=o.bounds;return u(n,t.rotation)?(t.rotate(h(t.rotation)-t.rotation,t),!0):!1}export function rotateImageDef(o,n){const t=o.bounds,e=y(n,t.rotation);return e===void 0?!1:(t.rotate(e,t),!0)}
|
|
@@ -8,6 +8,8 @@ import type { GeoConfig } from './types';
|
|
|
8
8
|
import { Bounds, POISelectors } from './types/sdk.types';
|
|
9
9
|
export default class FloorPlanReady extends FloorPlanLoader {
|
|
10
10
|
root: ReturnType<typeof createRoot>;
|
|
11
|
+
private disposeDetailsEvents?;
|
|
12
|
+
private disposeBoothHitTest?;
|
|
11
13
|
protected init(): void;
|
|
12
14
|
selectBooth(nameOrExternalId: string | string[]): void;
|
|
13
15
|
selectExhibitor(nameOrExternalId: string | string[]): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as A,jsx as x,jsxs as T}from"react/jsx-runtime";import{Box as E}from"@expofp/geometry";import{CameraSchema as I}from"@expofp/schema";import{optimizeWaypointOrder as M}from"@expofp/wayfinding";import{ErrorBoundary as R}from"@sentry/react";import $ from"debug";import{reaction as V}from"mobx";import{createRoot as z}from"react-dom/client";import{install as j}from"resize-observer";import G from"./components/Layout";import{MAX_ROUTE_WAYPOINTS as d}from"./constants";import N from"./data";import{fpGeo as b}from"./data/fpGeo";import q from"./floorplan.loader";import{shouldLoadIntercom as O}from"./intercom";import{BoundsSchema as U,POISelectorsSchema as P,ZoomToOptionsSchema as w}from"./schemas/sdk.schemas";import{applyDeclarativeConfig as Y,applyParameters as D,applyPathway as H,initUrlRouting as W}from"./services/url-dispatch";import{destroyUrlSync as X}from"./services/url-sync";import r from"./store";import{bindRootElement as K,destroyUiHandlers as Q}from"./store/init/init-ui";import{findBooth as S,Route as B,separateExternalIds as k}from"./store/RouteStore";import{destroyGtag as Z,GaEventActions as v,sendEventToGa as F,setConsentSettings as J}from"./tools/gtag";import _ from"./tools/report-error";import ee from"./tools/track-event";import{cameraToMapSettings as te,mapSettingsToCamera as re}from"./utils/camera-map-settings";import{getStorage as C}from"./utils/entity-storage";import{getMostFrequent as oe}from"./utils/getMostFrequent";import{convertLocalToGps as ie,isValidPointCoords as y}from"./utils/gps";import{getLocales as se,hasLocale as ne,setLocale as ae}from"./utils/i18n";import{mapEntity as g}from"./utils/mapEntity";const p=$("efp:api");j();export default class he extends q{init(){Y(),this.ignoreQuery||W(this.offHistory),ee("load"),K(r),r.fp=this,J(this.consent),F(v.Load,""),this.root=z(this.renderTarget),this.root.render(x(R,{children:x(G,{offHistory:this.offHistory,consent:this.consent})})),F(v.Rendered,""),V(()=>r.layerStore.layersLoaded,()=>{this.resolveReady(),r.initialized||this.onInit?.(this),r.initialized=!0});const e=O(N);e&&import("./intercom/bootIntercom").then(({bootIntercom:t})=>t(e)).catch(()=>{})}selectBooth(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectBooth","Parameter must be a string or an array of strings.","EFP000000");return}const t=r.boothStore.booths.filter(o=>typeof e=="string"?o.name===e||o.externalId===e:e.includes(o.name)||e.includes(o.externalId));r.selectBooth(t)}selectExhibitor(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectExhibitor","Parameter must be a string or an array of strings.","EFP000100");return}if(!e?.length){r.uiState.menu=!1,r.searchStore.resetSearchBox(),r.uiState.details=null;return}const t=r.exhibitorStore.exhibitors.filter(s=>typeof e=="string"?s.name===e||s.externalId===e:e.includes(s.name)||e.includes(s.externalId));if(!t?.length)return;if(typeof e=="string"){r.selectExhibitor(t[0]),r.moveToList([t[0]]);return}const o=t.flatMap(s=>s.booths.map(i=>i.layer)),n=oe(o.map(s=>s.description));n&&r.layerStore.updateVisibility(n,!0),r.uiState.menu=!1,r.searchStore.resetSearchBox(),r.uiState.details=null,r.uiState.list={type:"filter",items:t,query:{key:"exhibitors",value:t.map(s=>s.name).join(",")}},r.moveToList()}highlightExhibitors(e){Array.isArray(e)||a("highlightExhibitors","Parameter must be an array of strings.","EFP000200"),r.boothStore.highlightedByExternalIds=[],r.exhibitorStore.highlightedByExternalIds=[...e]}highlightBooths(e){Array.isArray(e)||a("highlightBooths","Parameter must be an array of strings.","EFP000300"),r.exhibitorStore.highlightedByExternalIds=[],r.boothStore.highlightedByExternalIds=[...e]}highlightEntities(e){Array.isArray(e)||a("highlightEntities","Parameter must be an array of strings.","EFP000400");const{boothExternalIds:t,exhibitorExternalIds:o}=k(e);r.boothStore.highlightedByExternalIds=[...t],r.exhibitorStore.highlightedByExternalIds=[...o]}selectRoute(e,t){if(Array.isArray(e)){let o=[...e];const n=o.shift(),s=o.pop();if(o.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);if(!n||!s){a("selectRoute","Invalid route format: When providing an array, it must include at least two points: a start and a destination.","EFP000401");return}r.routeStore.selectRoute(new B(m(n),m(s),o.map(m)));return}e||a("selectRoute","At a minimum, the starting point must be passed.","EFP000402"),r.routeStore.selectRoute(new B(m(e),m(t)))}getOptimizedRoutes(e){if(!Array.isArray(e))return a("getOptimizedRoutes","Parameter must be an array.","EFP000500"),[];if(e.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);const t=e.map(m).filter(n=>!!n);if(!t.length)throw new Error("No booths found for the provided waypoints.");const o=new Map;for(const n of t){const s=n.layer?.name??"",i=o.get(s);i?i.push(n):o.set(s,[n])}return Array.from(o.values()).map(n=>({waypoints:M(n.map(s=>[s.name,{x:s.rect.center.x,y:s.rect.center.y}]))}))}selectCurrentPosition(e,t,o){const n=y(e.x)&&y(e.y),s=y(e.lng)&&y(e.lat);!n&&!s&&a("selectCurrentPosition","A point must be passed. Either (x,y) or (lat,lng) are required.","EFP000600"),r.routeStore.selectCurrentPosition(e,t,o),this.onCurrentPositionChanged?.(e)}setBookmarks(e){(!Array.isArray(e)||!e.length)&&a("setBookmarks","Parameter must be an array.","EFP000700"),e.forEach(t=>{const o=r.exhibitorStore.exhibitors.find(n=>n.name===t.name||n.externalId===t.externalId);o&&(o.bookmarked=t.bookmarked)})}setEntitiesBookmarks(e){if(!Array.isArray(e)||!e.length){a("setEntitiesBookmarks","Parameter must be an array.","EFP000701");return}const t=["exhibitor","event","speaker","booth"],o=e.find(i=>!i.type||!t.includes(i.type));if(o){a("setEntitiesBookmarks",`Invalid entity type: ${o.type}. Must be one of: ${t.join(", ")}.`,"EFP000702");return}const n=C("bookmarked"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:i=>r.exhibitorStore.findExhibitor(i),replacer:i=>r.exhibitorStore.replaceBookmarked(i)},event:{existingIds:new Set(n.events||[]),finder:i=>r.eventStore.findByNameOrSlug(i),replacer:i=>r.eventStore.replaceBookmarked(i)},speaker:{existingIds:new Set(n.speakers||[]),finder:i=>r.speakerStore.speakers.find(h=>h.name===i||h.externalId===i||h.slug===i),replacer:i=>r.speakerStore.replaceBookmarked(i)},booth:{existingIds:new Set(n.booths||[]),finder:i=>{const h=r.boothStore.findBooth(i);return h?.exhibitors.length===0?h:void 0},replacer:i=>r.boothStore.replaceBookmarked(i)}};e.forEach(i=>{const h=s[i.type],u=i.name||i.externalId||"",c=h.finder(u);c?i.bookmarked?h.existingIds.add(c.id):h.existingIds.delete(c.id):console.warn(`Entity not found: ${i.type} with query "${u}"`)}),Object.values(s).forEach(i=>{i.replacer(Array.from(i.existingIds))})}setEntitiesVisited(e){if(!Array.isArray(e)||!e.length){a("setEntitiesVisited","Parameter must be an array.","EFP000703");return}const t=["exhibitor","event"],o=e.find(i=>!i.type||!t.includes(i.type));if(o){a("setEntitiesVisited",`Invalid entity type: ${o.type}. Must be one of: ${t.join(", ")}.`,"EFP000704");return}const n=C("visited"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:i=>r.exhibitorStore.findExhibitor(i),replacer:i=>r.exhibitorStore.replaceVisited(i)},event:{existingIds:new Set(n.events||[]),finder:i=>r.eventStore.findByNameOrSlug(i),replacer:i=>r.eventStore.replaceVisited(i)}};e.forEach(i=>{const h=s[i.type],u=i.name||i.externalId||"",c=h.finder(u);c?i.visited?h.existingIds.add(c.id):h.existingIds.delete(c.id):console.warn(`Entity not found: ${i.type} with query "${u}"`)}),Object.values(s).forEach(i=>{i.replacer(Array.from(i.existingIds))})}setMarkers(e){if(!e||!Array.isArray(e.icons)||!Array.isArray(e.markers)){a("setMarkers","Invalid input.","EFP000800");return}r.routeStore.setMarkers(e)}selectMarker(e,t=!0){return typeof e!="string"&&a("selectMarker","The identifier must be passed.","EFP000900"),r.routeStore.selectMarker(e,t)}drawCircles(e){Array.isArray(e)||a("drawCircles","Invalid input.","EFP000A00"),r.uiState.debugCircles=e}checkRoutes(){r.routeStore.checkRoutes()}updateLayerVisibility(e,t){typeof e!="string"&&a("updateLayerVisibility","The layer name (string) must be passed.","EFP000B00"),t||a("updateLayerVisibility","Passing a false value to visible will have no effect.","EFP000B01"),r.layerStore.updateVisibility(e,t)}getCenterCoordinates(){return r.fp.getCenterCoordinates()}exhibitorsList(){return r.exhibitorStore.exhibitors.map(e=>g(e))}boothsList(){return r.boothStore.booths.map(e=>g(e))}categoriesList(){return r.categoryStore.categories.map(e=>g(e))}selectCategory(e){if(e==null||typeof e!="string"){r.searchStore.selectSearch();return}const t=e?.toLowerCase(),o=r.categoryStore.categories.find(({name:n,slug:s})=>n?.toLowerCase()===t||s?.toLowerCase()===t);if(!o){a("selectCategory",`Category ${e} not found.`,"EFP000C01");return}r.selectCategory(o)}select(e){if(typeof e!="string"){a("select","Parameter must be a string.","EFP001700");return}const t=e,o=t?.toLowerCase(),n=r.boothStore.booths.find(c=>c.slug?.toLowerCase()===o||c.externalId?.toLowerCase()===o||c.externalId?.toLowerCase()?.replace(/\s+/g,"")===o);if(n){setTimeout(()=>r.selectBooth(n),250);return}const s=r.eventStore.eventItems.find(c=>c.slug?.toLowerCase()===o||c.externalId?.toLowerCase()===o);if(s){r.selectEventItem(s,!0);return}const i=r.exhibitorStore.exhibitors.find(c=>c.slug?.toLowerCase()===o||c.externalId?.toLowerCase()===o);if(i){setTimeout(()=>r.clickExhibitor(i),250);return}const h=r.categoryStore.categories.find(c=>c.slug===t);if(h){r.selectCategory(h);return}const u=r.speakerStore.findBySlug(t);if(u){r.selectSpeaker(u,!0);return}t.includes("heatmap=true")||r.searchStore.selectSearch(t)}showList(e){const t={bookmarks:()=>r.selectBookmarks(),visited:()=>r.selectVisited(),sessions:()=>r.selectSessions(),exhibitors:()=>r.selectExhibitors(),speakers:()=>r.selectSpeakers(),tours:()=>r.selectTours(),language:()=>r.selectLanguage()},o=t[e];if(!o){a("showList",`Unknown list "${e}". Must be one of: ${Object.keys(t).join(", ")}.`,"EFP001800");return}o()}selectTour(e){if(typeof e!="string"||!e){a("selectTour","A tour id must be passed.","EFP001900");return}const t=r.toursStore.getTourById(e);t?r.toursStore.launchTour(t,t.name,t.description):(console.warn(`Route with id "${e}" not found`),r.selectTours())}openPlanner(e={}){if(typeof e!="object"||e===null){a("openPlanner","An options object must be passed.","EFP001A00");return}const t=e.from?S(e.from):null;e.fromBookmarks?r.routePlannerStore.launchFromBookmarks(t??void 0):r.routePlannerStore.launchFromSlugs(e.items??[],t??void 0)}startBuildRoute(){r.uiState.startBuildRoute()}applyParameters(e){typeof e!="string"&&a("applyParameters","A query string must be passed.","EFP000D00"),D(e)}getVisibility(){return r.uiState.visibility}setVisibility(e){(typeof e!="object"||!Object.keys(e).length)&&a("setVisibility","The parameter must be passed.","EFP000E00"),r.uiState.setVisibility(e)}findLocation(){r.routeStore.findLocation()}zoomIn(){r.uiState.zoomIn()}zoomOut(){r.uiState.zoomOut()}switchView(){r.maplibreStore.activateMaplibre()}setCamera(e){p("setCamera called with camera=%O",e);const t=I.safeParse(e);if(!t.success){a("setCamera",t.error.message,"EFP001B00");return}r.uiState.setMapSettings(te(t.data))}getCamera(){return re(r.uiState.mapSettings)}zoomTo(e,t){p("zoomTo called with selectors=%O options=%O",e,t);const o=P.safeParse(e);if(!o.success){a("zoomTo",o.error.message,"EFP001600");return}const n=w.safeParse(t);if(!n.success){a("zoomTo",n.error.message,"EFP001601");return}const s=this.getBounds(e);s&&this.fitBounds(s,t)}getBounds(e){p("getBounds called with selectors=%O",e);const t=P.safeParse(e);if(!t.success){a("getBounds",t.error.message,"EFP001400");return}const o=[];if(e.booths?.forEach(s=>{let i;s.externalId?i=r.boothStore.boothByExternalId.get(s.externalId):s.name&&(i=r.boothStore.boothByName.get(s.name.toLowerCase())),i?.rect&&o.push(i.rect)}),e.exhibitors?.forEach(s=>{let i;s.externalId?i=r.exhibitorStore.exhibitorByExternalId.get(s.externalId):s.name&&(i=r.exhibitorStore.exhibitorByName.get(s.name.toLowerCase())),i?.booths?.forEach(h=>{h.rect&&o.push(h.rect)})}),o.length===0)return;const n=E.fromUnion(...o);return{leftTop:{x:n.min.x,y:n.min.y},rightBottom:{x:n.max.x,y:n.max.y}}}fitBounds(e,t){if(p("fitBounds called with bounds=%O options=%O",e,t),!e){r.uiState.fitBounds();return}const o=U.safeParse(e);if(!o.success){a("fitBounds",o.error.message,"EFP001500");return}const n=w.safeParse(t);if(!n.success){a("fitBounds",n.error.message,"EFP001501");return}const s=E.fromMinMax({x:e.leftTop.x,y:e.leftTop.y},{x:e.rightBottom.x,y:e.rightBottom.y});r.uiState.moveToRect=t?.padding?s.expand(t.padding):s}getBoothRect(e){typeof e!="string"&&a("getBoothRect","A booth name must be passed.","EFP000F00");const t=S(e)?.rect;return t?l.fromBox(t):void 0}convertToGeo(e,t){if(!b?.properties?.config){a("convertToGeo","The coordinates cannot be converted because the GPS configuration is not defined.","EFP001000");return}if(!e||!t){a("convertToGeo","Both coordinates must be passed.","EFP001001");return}return ie(e,t,b.properties.config)}getGeoConfig(){const e=b?.properties?.config;return e?{bearing:e.bearing??0,p0:e.p0,p1:e.p1,p2:e.p2}:null}releaseResources(){window.removeEventListener("error",_),r.maplibreStore.dispose(),X(),Q(),Z(),this.root.unmount(),super.releaseResources()}search(e){return typeof e!="string"&&a("search","A search string must be passed.","EFP001100"),r.fuzzySearchEngineStore.loadEngine().then(()=>(r.searchStore.selectSearch(e),r.uiState.fuzzySearchItems.map(t=>({item:g(t.item),score:t.score}))))}getFloors(){return r.layerStore.floors.map(e=>({name:e.name,shortName:e.shortName,description:e.description,active:e.active,disabled:e.disabled,index:e.index}))}activateFloor(e){if(!e?.name&&e?.index==null){a("activateFloor","Invalid floorId. It must contain either a name or an index.","EFP001200");return}const t=this.getFloors();if(e.name){const o=t.find(n=>n.name===e.name||n.shortName===e.name);if(!o){a("activateFloor",`Floor with name "${e.name}" not found.`,"EFP001201");return}if(o.active)return;this.updateLayerVisibility(o.name,!0);return}if(e.index!==null){const o=t.find(s=>s.index===e.index),n=o?.name;if(!n){a("activateFloor",`Floor at index ${e.index} does not exist.`,"EFP001203");return}if(o.active)return;this.updateLayerVisibility(n,!0);return}}showPathway(e,t){const{boothExternalIds:o,exhibitorExternalIds:n}=t?.length?k(t):{boothExternalIds:[],exhibitorExternalIds:[]};H({pathwayId:e,boothIds:o,exhibitorIds:n})}showPathwayOnly(e,t){this.activateFloor({name:t}),r.layerStore.showPathWay(e),r.uiState.setPathwayOnlyMode(!0);const o=r.layerStore.findLayer(e),n=r.layerStore.findLayer(t),s=o?.rect||o?.viewbox?o:n;if(s?.rect||s?.viewbox){const i=s.viewbox??s.rect;r.uiState.moveToRect=i.clone()}}hidePathways(){this.highlightBooths([]),r.layerStore.hidePathways(),r.uiState.setPathwayOnlyMode(!1)}showSearch(){r.selectSearch("")}changeLanguage(e){const t=e?.toLowerCase?.();if(!ne(t)){a("changeLanguage",`Language "${e}" was not found. Available languages: ${se().map(o=>o.id).join(",")}`,"EFP001300");return}ae(t)}isGpsTrackingEnabled(){return r.routeStore.gpsEnabled}setGpsTrackingEnabled(e){r.routeStore.setGpsTrackingEnabled(e)}deselectCurrentPosition(){r.routeStore.selectCurrentPosition(null,!1)}deselectRoute(){r.routeStore.selectRoute(null),r.routeStore.setOnlyAccessible(!1)}reset(){this.selectBooth(""),this.selectExhibitor(""),this.selectCategory(),this.deselectCurrentPosition(),this.deselectRoute(),this.highlightEntities([]),r.uiState.kioskData&&r.resetCameraFn?r.resetCameraFn?.():this.fitBounds()}selectAccessibleRoute(e){r.routeStore.setOnlyAccessible(!0),this.selectRoute(e)}}function m(f){return typeof f=="string"?S(f):r.routeStore.getNearestBooth(f)}let L=0;function a(f,e,t){const o=`Error calling "${f}" SDK method.`,n=`${e.endsWith(".")?e:e+"."} More information at`;let s="https://js-sdk.expofp.com/api/packages";if(t&&(s+=`#error-${t}`),console.error(`${o} ${n} ${s}`),r.fp.disableRuntimeAlerts)return;r.uiState.setGlobalErrorMessage({title:o,body:T(A,{children:[n," ",x("a",{href:s,target:"_blank",rel:"noreferrer",children:s})]})}),clearTimeout(L);const i=8e3;L=window.setTimeout(()=>{const h=async()=>{r.uiState.globalErrorMessages.length>0&&(r.uiState.popGlobalErrorMessage(),await new Promise(u=>setTimeout(u,i/2)),h())};h()},i)}class l{get h(){return Math.abs(this.y2-this.y1)}get w(){return Math.abs(this.x2-this.x1)}get cx(){return(this.x1+this.x2)/2}get cy(){return(this.y1+this.y2)/2}constructor(e,t,o,n){if(e>o){const s=e;e=o,o=s}if(t>n){const s=t;t=n,n=s}this.x1=e,this.y1=t,this.x2=o,this.y2=n}static fromBox(e){return new l(e.min.x,e.min.y,e.max.x,e.max.y)}static fromCxcywh(e,t,o,n){return new l(e-o/2,t-n/2,e+o/2,t+n/2)}contains(e){return e.x1>=this.x1&&e.x2<=this.x2&&e.y1>=this.y1&&e.y2<=this.y2}intersects(e){const t=Math.max(this.x1,e.x1),o=Math.min(this.x2,e.x2),n=Math.max(this.y1,e.y1),s=Math.min(this.y2,e.y2);return o>=t&&s>=n}getIntersection(e){const t=Math.max(this.x1,e.x1),o=Math.min(this.x2,e.x2),n=Math.max(this.y1,e.y1),s=Math.min(this.y2,e.y2);return o>=t&&s>=n?new l(t,n,o,s):new l(0,0,0,0)}getRotated90(){return l.fromCxcywh(this.cx,this.cy,this.h,this.w)}normalize(e,t){return new l(this.x1/e,this.y1/t,this.x2/e,this.y2/t)}withPadding(e,t=e){return this.w<e*2||this.h<t*2?this:l.fromCxcywh(this.cx,this.cy,this.w-e*2,this.h-t*2)}scale(e){return new l(this.x1*e,this.y1*e,this.x2*e,this.y2*e)}getArea(){return this.w*this.h}clone(){return new l(this.x1,this.y1,this.x2,this.y2)}translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this}equals(e){return e.x1===this.x1&&e.x2===this.x2&&e.y1===this.y1&&e.y2===this.y2}toString(){return this.x1+","+this.y1+","+this.w+","+this.h}containsPoint(e,t){return e>=this.x1&&e<=this.x2&&t>=this.y1&&t<=this.y2}}
|
|
1
|
+
import{Fragment as A,jsx as x,jsxs as T}from"react/jsx-runtime";import{Box as E}from"@expofp/geometry";import{CameraSchema as I}from"@expofp/schema";import{optimizeWaypointOrder as M}from"@expofp/wayfinding";import{ErrorBoundary as R}from"@sentry/react";import $ from"debug";import{reaction as V}from"mobx";import{createRoot as z}from"react-dom/client";import{install as j}from"resize-observer";import G from"./components/Layout";import{bindBoothHitTest as N}from"./components/Map/booth-by-xy";import{MAX_ROUTE_WAYPOINTS as d}from"./constants";import D from"./data";import{fpGeo as b}from"./data/fpGeo";import H from"./floorplan.loader";import{shouldLoadIntercom as q}from"./intercom";import{BoundsSchema as O,POISelectorsSchema as P,ZoomToOptionsSchema as w}from"./schemas/sdk.schemas";import{applyDeclarativeConfig as U,applyParameters as Y,applyPathway as W,initUrlRouting as X}from"./services/url-dispatch";import{destroyUrlSync as K}from"./services/url-sync";import r from"./store";import{bindDetailsEvents as Q}from"./store/details-events";import{bindRootElement as Z,destroyUiHandlers as J}from"./store/init/init-ui";import{findBooth as S,Route as B,separateExternalIds as v}from"./store/RouteStore";import{destroyGtag as _,GaEventActions as k,sendEventToGa as F,setConsentSettings as ee}from"./tools/gtag";import te from"./tools/report-error";import re,{resetTelemetry as ie}from"./tools/track-event";import{cameraToMapSettings as oe,mapSettingsToCamera as se}from"./utils/camera-map-settings";import{getStorage as C}from"./utils/entity-storage";import{getMostFrequent as ne}from"./utils/getMostFrequent";import{convertLocalToGps as ae,isValidPointCoords as y}from"./utils/gps";import{getLocales as he,hasLocale as ce,setLocale as le}from"./utils/i18n";import{mapEntity as g}from"./utils/mapEntity";const p=$("efp:api");j();export default class ue extends H{init(){U(),this.ignoreQuery||X(this.offHistory),re("load"),Z(r),r.fp=this,this.disposeDetailsEvents=Q(),this.disposeBoothHitTest=N(),ee(this.consent),F(k.Load,""),this.root=z(this.renderTarget),this.root.render(x(R,{children:x(G,{offHistory:this.offHistory,consent:this.consent})})),F(k.Rendered,""),V(()=>r.layerStore.layersLoaded,()=>{this.resolveReady(),r.initialized||this.onInit?.(this),r.initialized=!0});const e=q(D);e&&import("./intercom/bootIntercom").then(({bootIntercom:t})=>t(e)).catch(()=>{})}selectBooth(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectBooth","Parameter must be a string or an array of strings.","EFP000000");return}const t=r.boothStore.booths.filter(i=>typeof e=="string"?i.name===e||i.externalId===e:e.includes(i.name)||e.includes(i.externalId));r.selectBooth(t)}selectExhibitor(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectExhibitor","Parameter must be a string or an array of strings.","EFP000100");return}if(!e?.length){r.uiState.menu=!1,r.searchStore.resetSearchBox(),r.uiState.details=null;return}const t=r.exhibitorStore.exhibitors.filter(s=>typeof e=="string"?s.name===e||s.externalId===e:e.includes(s.name)||e.includes(s.externalId));if(!t?.length)return;if(typeof e=="string"){r.selectExhibitor(t[0]),r.moveToList([t[0]]);return}const i=t.flatMap(s=>s.booths.map(o=>o.layer)),n=ne(i.map(s=>s.description));n&&r.layerStore.updateVisibility(n,!0),r.uiState.menu=!1,r.searchStore.resetSearchBox(),r.uiState.details=null,r.uiState.list={type:"filter",items:t,query:{key:"exhibitors",value:t.map(s=>s.name).join(",")}},r.moveToList()}highlightExhibitors(e){Array.isArray(e)||a("highlightExhibitors","Parameter must be an array of strings.","EFP000200"),r.boothStore.highlightedByExternalIds=[],r.exhibitorStore.highlightedByExternalIds=[...e]}highlightBooths(e){Array.isArray(e)||a("highlightBooths","Parameter must be an array of strings.","EFP000300"),r.exhibitorStore.highlightedByExternalIds=[],r.boothStore.highlightedByExternalIds=[...e]}highlightEntities(e){Array.isArray(e)||a("highlightEntities","Parameter must be an array of strings.","EFP000400");const{boothExternalIds:t,exhibitorExternalIds:i}=v(e);r.boothStore.highlightedByExternalIds=[...t],r.exhibitorStore.highlightedByExternalIds=[...i]}selectRoute(e,t){if(Array.isArray(e)){let i=[...e];const n=i.shift(),s=i.pop();if(i.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);if(!n||!s){a("selectRoute","Invalid route format: When providing an array, it must include at least two points: a start and a destination.","EFP000401");return}r.routeStore.selectRoute(new B(m(n),m(s),i.map(m)));return}e||a("selectRoute","At a minimum, the starting point must be passed.","EFP000402"),r.routeStore.selectRoute(new B(m(e),m(t)))}getOptimizedRoutes(e){if(!Array.isArray(e))return a("getOptimizedRoutes","Parameter must be an array.","EFP000500"),[];if(e.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);const t=e.map(m).filter(n=>!!n);if(!t.length)throw new Error("No booths found for the provided waypoints.");const i=new Map;for(const n of t){const s=n.layer?.name??"",o=i.get(s);o?o.push(n):i.set(s,[n])}return Array.from(i.values()).map(n=>({waypoints:M(n.map(s=>[s.name,{x:s.rect.center.x,y:s.rect.center.y}]))}))}selectCurrentPosition(e,t,i){const n=y(e.x)&&y(e.y),s=y(e.lng)&&y(e.lat);!n&&!s&&a("selectCurrentPosition","A point must be passed. Either (x,y) or (lat,lng) are required.","EFP000600"),r.routeStore.selectCurrentPosition(e,t,i),this.onCurrentPositionChanged?.(e)}setBookmarks(e){(!Array.isArray(e)||!e.length)&&a("setBookmarks","Parameter must be an array.","EFP000700"),e.forEach(t=>{const i=r.exhibitorStore.exhibitors.find(n=>n.name===t.name||n.externalId===t.externalId);i&&(i.bookmarked=t.bookmarked)})}setEntitiesBookmarks(e){if(!Array.isArray(e)||!e.length){a("setEntitiesBookmarks","Parameter must be an array.","EFP000701");return}const t=["exhibitor","event","speaker","booth"],i=e.find(o=>!o.type||!t.includes(o.type));if(i){a("setEntitiesBookmarks",`Invalid entity type: ${i.type}. Must be one of: ${t.join(", ")}.`,"EFP000702");return}const n=C("bookmarked"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:o=>r.exhibitorStore.findExhibitor(o),replacer:o=>r.exhibitorStore.replaceBookmarked(o)},event:{existingIds:new Set(n.events||[]),finder:o=>r.eventStore.findByNameOrSlug(o),replacer:o=>r.eventStore.replaceBookmarked(o)},speaker:{existingIds:new Set(n.speakers||[]),finder:o=>r.speakerStore.speakers.find(h=>h.name===o||h.externalId===o||h.slug===o),replacer:o=>r.speakerStore.replaceBookmarked(o)},booth:{existingIds:new Set(n.booths||[]),finder:o=>{const h=r.boothStore.findBooth(o);return h?.exhibitors.length===0?h:void 0},replacer:o=>r.boothStore.replaceBookmarked(o)}};e.forEach(o=>{const h=s[o.type],u=o.name||o.externalId||"",c=h.finder(u);c?o.bookmarked?h.existingIds.add(c.id):h.existingIds.delete(c.id):console.warn(`Entity not found: ${o.type} with query "${u}"`)}),Object.values(s).forEach(o=>{o.replacer(Array.from(o.existingIds))})}setEntitiesVisited(e){if(!Array.isArray(e)||!e.length){a("setEntitiesVisited","Parameter must be an array.","EFP000703");return}const t=["exhibitor","event"],i=e.find(o=>!o.type||!t.includes(o.type));if(i){a("setEntitiesVisited",`Invalid entity type: ${i.type}. Must be one of: ${t.join(", ")}.`,"EFP000704");return}const n=C("visited"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:o=>r.exhibitorStore.findExhibitor(o),replacer:o=>r.exhibitorStore.replaceVisited(o)},event:{existingIds:new Set(n.events||[]),finder:o=>r.eventStore.findByNameOrSlug(o),replacer:o=>r.eventStore.replaceVisited(o)}};e.forEach(o=>{const h=s[o.type],u=o.name||o.externalId||"",c=h.finder(u);c?o.visited?h.existingIds.add(c.id):h.existingIds.delete(c.id):console.warn(`Entity not found: ${o.type} with query "${u}"`)}),Object.values(s).forEach(o=>{o.replacer(Array.from(o.existingIds))})}setMarkers(e){if(!e||!Array.isArray(e.icons)||!Array.isArray(e.markers)){a("setMarkers","Invalid input.","EFP000800");return}r.routeStore.setMarkers(e)}selectMarker(e,t=!0){return typeof e!="string"&&a("selectMarker","The identifier must be passed.","EFP000900"),r.routeStore.selectMarker(e,t)}drawCircles(e){Array.isArray(e)||a("drawCircles","Invalid input.","EFP000A00"),r.uiState.debugCircles=e}checkRoutes(){r.routeStore.checkRoutes()}updateLayerVisibility(e,t){typeof e!="string"&&a("updateLayerVisibility","The layer name (string) must be passed.","EFP000B00"),t||a("updateLayerVisibility","Passing a false value to visible will have no effect.","EFP000B01"),r.layerStore.updateVisibility(e,t)}getCenterCoordinates(){return r.fp.getCenterCoordinates()}exhibitorsList(){return r.exhibitorStore.exhibitors.map(e=>g(e))}boothsList(){return r.boothStore.booths.map(e=>g(e))}categoriesList(){return r.categoryStore.categories.map(e=>g(e))}selectCategory(e){if(e==null||typeof e!="string"){r.searchStore.selectSearch();return}const t=e?.toLowerCase(),i=r.categoryStore.categories.find(({name:n,slug:s})=>n?.toLowerCase()===t||s?.toLowerCase()===t);if(!i){a("selectCategory",`Category ${e} not found.`,"EFP000C01");return}r.selectCategory(i)}select(e){if(typeof e!="string"){a("select","Parameter must be a string.","EFP001700");return}const t=e,i=t?.toLowerCase(),n=r.boothStore.booths.find(c=>c.slug?.toLowerCase()===i||c.externalId?.toLowerCase()===i||c.externalId?.toLowerCase()?.replace(/\s+/g,"")===i);if(n){setTimeout(()=>r.selectBooth(n),250);return}const s=r.eventStore.eventItems.find(c=>c.slug?.toLowerCase()===i||c.externalId?.toLowerCase()===i);if(s){r.selectEventItem(s,!0);return}const o=r.exhibitorStore.exhibitors.find(c=>c.slug?.toLowerCase()===i||c.externalId?.toLowerCase()===i);if(o){setTimeout(()=>r.clickExhibitor(o),250);return}const h=r.categoryStore.categories.find(c=>c.slug===t);if(h){r.selectCategory(h);return}const u=r.speakerStore.findBySlug(t);if(u){r.selectSpeaker(u,!0);return}t.includes("heatmap=true")||r.searchStore.selectSearch(t)}showList(e){const t={bookmarks:()=>r.selectBookmarks(),visited:()=>r.selectVisited(),sessions:()=>r.selectSessions(),exhibitors:()=>r.selectExhibitors(),speakers:()=>r.selectSpeakers(),tours:()=>r.selectTours(),language:()=>r.selectLanguage()},i=t[e];if(!i){a("showList",`Unknown list "${e}". Must be one of: ${Object.keys(t).join(", ")}.`,"EFP001800");return}i()}selectTour(e){if(typeof e!="string"||!e){a("selectTour","A tour id must be passed.","EFP001900");return}const t=r.toursStore.getTourById(e);t?r.toursStore.launchTour(t,t.name,t.description):(console.warn(`Route with id "${e}" not found`),r.selectTours())}openPlanner(e={}){if(typeof e!="object"||e===null){a("openPlanner","An options object must be passed.","EFP001A00");return}const t=e.from?S(e.from):null;e.fromBookmarks?r.routePlannerStore.launchFromBookmarks(t??void 0):r.routePlannerStore.launchFromSlugs(e.items??[],t??void 0)}startBuildRoute(){r.uiState.startBuildRoute()}applyParameters(e){typeof e!="string"&&a("applyParameters","A query string must be passed.","EFP000D00"),Y(e)}getVisibility(){return r.uiState.visibility}setVisibility(e){(typeof e!="object"||!Object.keys(e).length)&&a("setVisibility","The parameter must be passed.","EFP000E00"),r.uiState.setVisibility(e)}findLocation(){r.routeStore.findLocation()}zoomIn(){r.uiState.zoomIn()}zoomOut(){r.uiState.zoomOut()}switchView(){r.maplibreStore.activateMaplibre()}setCamera(e){p("setCamera called with camera=%O",e);const t=I.safeParse(e);if(!t.success){a("setCamera",t.error.message,"EFP001B00");return}r.uiState.setMapSettings(oe(t.data))}getCamera(){return se(r.uiState.mapSettings)}zoomTo(e,t){p("zoomTo called with selectors=%O options=%O",e,t);const i=P.safeParse(e);if(!i.success){a("zoomTo",i.error.message,"EFP001600");return}const n=w.safeParse(t);if(!n.success){a("zoomTo",n.error.message,"EFP001601");return}const s=this.getBounds(e);s&&this.fitBounds(s,t)}getBounds(e){p("getBounds called with selectors=%O",e);const t=P.safeParse(e);if(!t.success){a("getBounds",t.error.message,"EFP001400");return}const i=[];if(e.booths?.forEach(s=>{let o;s.externalId?o=r.boothStore.boothByExternalId.get(s.externalId):s.name&&(o=r.boothStore.boothByName.get(s.name.toLowerCase())),o?.rect&&i.push(o.rect)}),e.exhibitors?.forEach(s=>{let o;s.externalId?o=r.exhibitorStore.exhibitorByExternalId.get(s.externalId):s.name&&(o=r.exhibitorStore.exhibitorByName.get(s.name.toLowerCase())),o?.booths?.forEach(h=>{h.rect&&i.push(h.rect)})}),i.length===0)return;const n=E.fromUnion(...i);return{leftTop:{x:n.min.x,y:n.min.y},rightBottom:{x:n.max.x,y:n.max.y}}}fitBounds(e,t){if(p("fitBounds called with bounds=%O options=%O",e,t),!e){r.uiState.fitBounds();return}const i=O.safeParse(e);if(!i.success){a("fitBounds",i.error.message,"EFP001500");return}const n=w.safeParse(t);if(!n.success){a("fitBounds",n.error.message,"EFP001501");return}const s=E.fromMinMax({x:e.leftTop.x,y:e.leftTop.y},{x:e.rightBottom.x,y:e.rightBottom.y});r.uiState.moveToRect=t?.padding?s.expand(t.padding):s}getBoothRect(e){typeof e!="string"&&a("getBoothRect","A booth name must be passed.","EFP000F00");const t=S(e)?.rect;return t?l.fromBox(t):void 0}convertToGeo(e,t){if(!b?.properties?.config){a("convertToGeo","The coordinates cannot be converted because the GPS configuration is not defined.","EFP001000");return}if(!e||!t){a("convertToGeo","Both coordinates must be passed.","EFP001001");return}return ae(e,t,b.properties.config)}getGeoConfig(){const e=b?.properties?.config;return e?{bearing:e.bearing??0,p0:e.p0,p1:e.p1,p2:e.p2}:null}releaseResources(){window.removeEventListener("error",te),this.disposeDetailsEvents?.(),this.disposeDetailsEvents=void 0,this.disposeBoothHitTest?.(),this.disposeBoothHitTest=void 0,r.maplibreStore.dispose(),K(),J(),_(),ie(),this.root.unmount(),super.releaseResources()}search(e){return typeof e!="string"&&a("search","A search string must be passed.","EFP001100"),r.fuzzySearchEngineStore.loadEngine().then(()=>(r.searchStore.selectSearch(e),r.uiState.fuzzySearchItems.map(t=>({item:g(t.item),score:t.score}))))}getFloors(){return r.layerStore.floors.map(e=>({name:e.name,shortName:e.shortName,description:e.description,active:e.active,disabled:e.disabled,index:e.index}))}activateFloor(e){if(!e?.name&&e?.index==null){a("activateFloor","Invalid floorId. It must contain either a name or an index.","EFP001200");return}const t=this.getFloors();if(e.name){const i=t.find(n=>n.name===e.name||n.shortName===e.name);if(!i){a("activateFloor",`Floor with name "${e.name}" not found.`,"EFP001201");return}if(i.active)return;this.updateLayerVisibility(i.name,!0);return}if(e.index!==null){const i=t.find(s=>s.index===e.index),n=i?.name;if(!n){a("activateFloor",`Floor at index ${e.index} does not exist.`,"EFP001203");return}if(i.active)return;this.updateLayerVisibility(n,!0);return}}showPathway(e,t){const{boothExternalIds:i,exhibitorExternalIds:n}=t?.length?v(t):{boothExternalIds:[],exhibitorExternalIds:[]};W({pathwayId:e,boothIds:i,exhibitorIds:n})}showPathwayOnly(e,t){this.activateFloor({name:t}),r.layerStore.showPathWay(e),r.uiState.setPathwayOnlyMode(!0);const i=r.layerStore.findLayer(e),n=r.layerStore.findLayer(t),s=i?.rect||i?.viewbox?i:n;if(s?.rect||s?.viewbox){const o=s.viewbox??s.rect;r.uiState.moveToRect=o.clone()}}hidePathways(){this.highlightBooths([]),r.layerStore.hidePathways(),r.uiState.setPathwayOnlyMode(!1)}showSearch(){r.selectSearch("")}changeLanguage(e){const t=e?.toLowerCase?.();if(!ce(t)){a("changeLanguage",`Language "${e}" was not found. Available languages: ${he().map(i=>i.id).join(",")}`,"EFP001300");return}le(t)}isGpsTrackingEnabled(){return r.routeStore.gpsEnabled}setGpsTrackingEnabled(e){r.routeStore.setGpsTrackingEnabled(e)}deselectCurrentPosition(){r.routeStore.selectCurrentPosition(null,!1)}deselectRoute(){r.routeStore.selectRoute(null),r.routeStore.setOnlyAccessible(!1)}reset(){this.selectBooth(""),this.selectExhibitor(""),this.selectCategory(),this.deselectCurrentPosition(),this.deselectRoute(),this.highlightEntities([]),r.uiState.kioskData&&r.resetCameraFn?r.resetCameraFn?.():this.fitBounds()}selectAccessibleRoute(e){r.routeStore.setOnlyAccessible(!0),this.selectRoute(e)}}function m(f){return typeof f=="string"?S(f):r.routeStore.getNearestBooth(f)}let L=0;function a(f,e,t){const i=`Error calling "${f}" SDK method.`,n=`${e.endsWith(".")?e:e+"."} More information at`;let s="https://js-sdk.expofp.com/api/packages";if(t&&(s+=`#error-${t}`),console.error(`${i} ${n} ${s}`),r.fp.disableRuntimeAlerts)return;r.uiState.setGlobalErrorMessage({title:i,body:T(A,{children:[n," ",x("a",{href:s,target:"_blank",rel:"noreferrer",children:s})]})}),clearTimeout(L);const o=8e3;L=window.setTimeout(()=>{const h=async()=>{r.uiState.globalErrorMessages.length>0&&(r.uiState.popGlobalErrorMessage(),await new Promise(u=>setTimeout(u,o/2)),h())};h()},o)}class l{get h(){return Math.abs(this.y2-this.y1)}get w(){return Math.abs(this.x2-this.x1)}get cx(){return(this.x1+this.x2)/2}get cy(){return(this.y1+this.y2)/2}constructor(e,t,i,n){if(e>i){const s=e;e=i,i=s}if(t>n){const s=t;t=n,n=s}this.x1=e,this.y1=t,this.x2=i,this.y2=n}static fromBox(e){return new l(e.min.x,e.min.y,e.max.x,e.max.y)}static fromCxcywh(e,t,i,n){return new l(e-i/2,t-n/2,e+i/2,t+n/2)}contains(e){return e.x1>=this.x1&&e.x2<=this.x2&&e.y1>=this.y1&&e.y2<=this.y2}intersects(e){const t=Math.max(this.x1,e.x1),i=Math.min(this.x2,e.x2),n=Math.max(this.y1,e.y1),s=Math.min(this.y2,e.y2);return i>=t&&s>=n}getIntersection(e){const t=Math.max(this.x1,e.x1),i=Math.min(this.x2,e.x2),n=Math.max(this.y1,e.y1),s=Math.min(this.y2,e.y2);return i>=t&&s>=n?new l(t,n,i,s):new l(0,0,0,0)}getRotated90(){return l.fromCxcywh(this.cx,this.cy,this.h,this.w)}normalize(e,t){return new l(this.x1/e,this.y1/t,this.x2/e,this.y2/t)}withPadding(e,t=e){return this.w<e*2||this.h<t*2?this:l.fromCxcywh(this.cx,this.cy,this.w-e*2,this.h-t*2)}scale(e){return new l(this.x1*e,this.y1*e,this.x2*e,this.y2*e)}getArea(){return this.w*this.h}clone(){return new l(this.x1,this.y1,this.x2,this.y2)}translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this}equals(e){return e.x1===this.x1&&e.x2===this.x2&&e.y1===this.y1&&e.y2===this.y2}toString(){return this.x1+","+this.y1+","+this.w+","+this.h}containsPoint(e,t){return e>=this.x1&&e<=this.x2&&t>=this.y1&&t<=this.y2}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitPlatformParams as s}from"@expofp/config";import{createBrowserHistory as
|
|
1
|
+
import{splitPlatformParams as s}from"@expofp/config";import{createBrowserHistory as g}from"history";import w from"../tools/logger";const t=g();let a=window.location.pathname;const o=[];let c="",r=!1,l=!1,u=0,h=()=>{},m;export function getLocationHistory(){return o}function d(e){if(!c)return a+e;const n=s(e).search,i=n==="?"?"":n;return a+(i?`${i}&${c}`:`?${c}`)}export function currentSearch(){return s(t.location.search).search}export function pushQuery(e){!r&&!l&&t.push(d(e))}export function replaceQuery(e){return r||l?!1:(t.replace(d(e)),!0)}export function disableUrlWrites(){r=!0}export function initUrlSync(e){r||=e.offHistory,h=e.onNavigate,a=window.location.pathname,c=s(t.location.search).platform,r||o.push(a+t.location.search),m=t.listen((n,i)=>{if(f(),r)return;const p=a+n.search;o[o.length-1]!==p&&o.push(p),w.log("history",i,n),i==="POP"&&h()})}export function destroyUrlSync(){r=!1,c="",o.length=0,f(),m?.()}function f(){l=!1,window.clearTimeout(u)}export function goBack(){l=!0,window.clearTimeout(u),u=window.setTimeout(f,1e3),t.goBack()}
|
|
@@ -45,6 +45,17 @@ export declare abstract class BoothBase {
|
|
|
45
45
|
* only at the rotation-sensitive render/geometry sites; the footprint
|
|
46
46
|
* itself ({@link rect}) is axis-aligned and never carries this rotation. */
|
|
47
47
|
readonly rotate: number;
|
|
48
|
+
/**
|
|
49
|
+
* Height of the booth's top surface above the floor, from the `data-elev` attribute on its
|
|
50
|
+
* `<rect>`; `0` when the attribute is absent. Held apart from {@link rect} for the same reason as
|
|
51
|
+
* {@link rotate} — a `Box` is pure 2D with no elevation — and combined into a geometry `Rect` as
|
|
52
|
+
* its fourth argument wherever something is drawn *on* the booth: its fill, labels, badges,
|
|
53
|
+
* bookmarks, borders and logo. That is what places those on the roof rather than on the floor.
|
|
54
|
+
*
|
|
55
|
+
* Stored as authored, with no sign flip: the renderer's scene mirrors z, so plan space reads
|
|
56
|
+
* positive-up and a booth 50 units tall simply has `elevation: 50`.
|
|
57
|
+
*/
|
|
58
|
+
readonly elevation: number;
|
|
48
59
|
readonly paths: PathInfo[];
|
|
49
60
|
readonly pathsWithRect: boolean;
|
|
50
61
|
readonly slug: string;
|