@expofp/floorplan 3.6.8 → 3.7.1
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/{CookieConsent-Cncx5MUo.js → CookieConsent-BTBtNSL4.js} +7 -7
- package/dist/browser/{Debug-C23thmWk.js → Debug-BdwQwhiQ.js} +6 -6
- package/dist/browser/{Demo-DSb7Ekrl.js → Demo-Buqcfw7W.js} +8 -8
- package/dist/browser/{Free-BeBvDQks.js → Free-DlGGWYcj.js} +8 -8
- package/dist/browser/{Gallery-DJp_kx8F.js → Gallery-aa79wHFQ.js} +9 -9
- package/dist/browser/{GpsLoader-BdifcifC.js → GpsLoader-Dh_U8H51.js} +8 -8
- package/dist/browser/{KioskStore-DYZoqQXS.js → KioskStore-37p-3HM2.js} +4 -4
- package/dist/browser/{MaplibreAdapter-CE8_agwM.js → MaplibreAdapter-GcuLfvZ5.js} +8 -8
- package/dist/browser/{Modal-Bfb0n1B8.js → Modal-N2u3kqja.js} +9 -9
- package/dist/browser/{PermissionNotice-DKdD4h46.js → PermissionNotice-ISmSMsbo.js} +6 -6
- package/dist/browser/{SetKioskMode-DuNVSQWY.js → SetKioskMode-Du32HGMJ.js} +7 -7
- package/dist/browser/{ShowKiosk-D7HpK4Vy.js → ShowKiosk-kDSUSRXW.js} +9 -9
- package/dist/browser/{TouchHand-cOenO3ek.js → TouchHand-8ZopG2q8.js} +4 -4
- package/dist/browser/{ViewerMenuPanel-Bg0tj3gx.js → ViewerMenuPanel-4BqW-Jdf.js} +7 -7
- package/dist/browser/{add-debug-secret-listener-Bho_Lcfi.js → add-debug-secret-listener-BjXftNTV.js} +1 -1
- package/dist/browser/{boolean-editor-D0cuDin9.js → boolean-editor-BhMIoPsa.js} +9 -9
- package/dist/browser/{bootIntercom-Biw_wDYN.js → bootIntercom-B6p5fxfJ.js} +2 -2
- package/dist/browser/{browser-B_AZwEGt.js → browser-CnPEW9Lr.js} +2 -2
- package/dist/browser/bundle.json +56 -56
- package/dist/browser/{classnames-P_hDEADy.js → classnames-CRgVhgv0.js} +2 -2
- package/dist/browser/{client-BWF9f76e.js → client-BUO_kQ1k.js} +4 -4
- package/dist/browser/{components-CeZt1lmp.js → components-BfPS9gG1.js} +36 -36
- package/dist/browser/{createWayfinding-CKqKUY_z.js → createWayfinding-Dt1LyGu0.js} +6 -6
- package/dist/browser/{debug-overlay-BF6cHm3k.js → debug-overlay-B0EofpfU.js} +10 -10
- package/dist/browser/{debug-ui-BIUGyBQC.js → debug-ui-DGJ2SkEi.js} +6 -6
- package/dist/browser/{dist-DfMPPgs2.js → dist-DJxbAzyk.js} +5 -5
- package/dist/browser/{dist-jCP6nVE5.js → dist-DjPMrEXM.js} +6 -6
- package/dist/browser/{dist-CxtRpH13.js → dist-TGwGfy82.js} +3 -3
- package/dist/browser/{efp-debug-init-DRWk6Ngr.js → efp-debug-init-DHlNt03k.js} +2 -2
- package/dist/browser/{enum-editor-C1qogHYw.js → enum-editor-CDXrDwYI.js} +11 -11
- package/dist/browser/{event-not-found-N5yjiQ9a.js → event-not-found-ddjIwKQI.js} +1 -1
- package/dist/browser/{exports-5LKHKfGT.js → exports-DrNfOFs_.js} +1 -1
- package/dist/browser/{favicon-Sk0rR2WR.js → favicon-BU-SX7hC.js} +1 -1
- package/dist/browser/{fetch-retry.umd-C73V3Brk.js → fetch-retry.umd-CYgJBfTb.js} +2 -2
- package/dist/browser/{flex-BeVc1m6P.js → flex-DhG3X7TO.js} +5 -5
- package/dist/browser/{floorplan.loader-9Y_ojgL5.js → floorplan.loader-CLetOZGp.js} +14 -11
- package/dist/browser/{floorplan.ready-BOcA_yVv.js → floorplan.ready-VzbeB1JK.js} +248 -238
- package/dist/browser/{fuse-C9f0vBar.js → fuse-BwjwTuSA.js} +2 -2
- package/dist/browser/{i18n-BKsTSAyU.js → i18n-DWUkHBly.js} +3 -3
- package/dist/browser/index.js +11 -11
- package/dist/browser/{jsx-runtime-CyYpaHIz.js → jsx-runtime-CCjvPhTZ.js} +2 -2
- package/dist/browser/{lib-2Cx8p8Zb.js → lib-CmUZvL-A.js} +4 -4
- package/dist/browser/{main-Doh8o2zS.js → main-D5cs84bD.js} +1 -1
- package/dist/browser/{mobx-CCRlye8v.js → mobx-Crx8xVu_.js} +4 -4
- package/dist/browser/{particles.min-BbHwrXlN.js → particles.min-4xFbqMer.js} +2 -2
- package/dist/browser/{prop-types-DgDLuskW.js → prop-types-Df-0AVZe.js} +2 -2
- package/dist/browser/{react-DVbrPK37.js → react-CXBSzFGH.js} +2 -2
- package/dist/browser/{react-dom-DDHx0KTC.js → react-dom-vkCA7ORh.js} +3 -3
- package/dist/browser/{reset-all-settings-BytR-WLk.js → reset-all-settings-_SJm36FD.js} +7 -7
- package/dist/browser/{rolldown-runtime-DeC1rnVy.js → rolldown-runtime-CHynt3ZH.js} +1 -1
- package/dist/browser/{settings-CzsYAA4U.js → settings-D8YocUE4.js} +2 -2
- package/dist/browser/{settings-item-D2fC24ff.js → settings-item-_8AjjHJ-.js} +6 -6
- package/dist/browser/{storage-DfrjuXFq.js → storage-BCJWp9_C.js} +4 -4
- package/dist/browser/{store-Bf3GyR2S.js → store-CoBm8UFz.js} +11 -11
- package/dist/browser/{string-editor-BUYKIZ3I.js → string-editor-b0i54Igp.js} +7 -7
- package/dist/browser/{theme-BBCbhStF.js → theme-D8c9f86A.js} +8 -8
- package/dist/browser/{ui-nIudEROB.js → ui-7txfiTr8.js} +8 -8
- package/dist/browser/{useRenderTarget-DXDlZKNV.js → useRenderTarget-D01j_Es7.js} +4 -4
- package/dist/esm/data/fpGeo.d.ts +0 -1
- package/dist/esm/floorplan.loader.d.ts +2 -1
- package/dist/esm/floorplan.loader.js +1 -1
- package/dist/esm/floorplan.ready.d.ts +2 -0
- package/dist/esm/floorplan.ready.js +1 -1
- package/dist/esm/types.d.ts +29 -0
- package/package.json +9 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PREVIEW_MODE_ATTRIBUTE as T}from"./constants";import c from"./tools/base-runtime-url";import{buildRebookingUrl as F,getRebookingToken as A,retainRebookingToken as V}from"./tools/rebookingUrl";import{loadCss as I,loadFont as g,loadJs as k}from"./tools/loaders";import U from"./tools/logger";import{sleep as H}from"./utils";import{initI18n as z}from"./utils/i18n";import S from"./utils/is-webview";import{loadCustomCss as G}from"./utils/loadCustomCss";import{loadIcons as N}from"./utils/loadIcons";import Q from"./utils/mergeExhibitors";import E from"./utils/use-shadow";import q from"./utils/is-debug";import W from"./utils/is-localhost";import{initSentry as $}from"./tools/sentry";import{shouldLoadIntercom as J}from"./intercom";function t(){throw new Error("FloorPlan not ready")}export default class K{options;renderTarget;_ready;element;eventId;dataUrl;noOverlay;offHistory;ignoreQuery;allowConsent;onInit;disableRuntimeAlerts;viewerMode;maplibre;efpStyleLoadHandler;resolveReady;icons=new Map;enableRotation=!0;alwaysShowSidebar=!1;get ready(){return this._ready}get previewMode(){return this.options.previewMode||this.element.hasAttribute(T)}onBoothClick;onBookmarkClick;onVisitedClick;onCategoryClick;onFpConfigured;onDirection;onDetails;onExhibitorCustomButtonClick;onGetCoordsClick;onMarkerClick;onLeaveEvent;selectBooth(e){t()}selectExhibitor(e){t()}selectRoute(e,r){t()}getOptimizedRoutes(e){t()}selectCurrentPosition(e,r,h){t()}setBookmarks(e){t()}setEntitiesBookmarks(e){t()}setEntitiesVisited(e){t()}setMarkers(e){t()}updateLayerVisibility(e,r){t()}getCenterCoordinates(){t()}applyParameters(e){t()}exhibitorsList(){t()}boothsList(){t()}categoriesList(){t()}selectCategory(e){t()}getVisibility(){t()}setVisibility(e){t()}findLocation(){t()}zoomIn(){t()}zoomOut(){t()}zoomTo(e,r){t()}switchView(){t()}fitBounds(){t()}getBounds(e){t()}getBoothRect(e){t()}convertToGeo(e,r){t()}unstable_destroy(){t()}highlightExhibitors(e){t()}highlightBooths(e){t()}onCurrentPositionChanged(e){t()}search(e){t()}getFloors(){t()}onFloorActivated(e){t()}activateFloor(e){t()}showPathway(e,r){t()}showPathwayOnly(e,r){t()}hidePathways(){t()}showSearch(){t()}changeLanguage(e){t()}isGpsTrackingEnabled(){t()}setGpsTrackingEnabled(e){t()}deselectCurrentPosition(){t()}deselectRoute(){t()}reset(){t()}selectAccessibleRoute(e){t()}constructor(e){this.options=e,this.noOverlay=!!e.noOverlay,this.offHistory=!!e.offHistory,this.ignoreQuery=e.ignoreQuery,this.allowConsent=W&&!q?!1:e.allowConsent,this.onBoothClick=e.onBoothClick,this.onBookmarkClick=e.onBookmarkClick,this.onVisitedClick=e.onVisitedClick,this.onCategoryClick=e.onCategoryClick,this.onDetails=e.onDetails,this.onExhibitorCustomButtonClick=e.onExhibitorCustomButtonClick,this.onGetCoordsClick=e.onGetCoordsClick,this.onMarkerClick=e.onMarkerClick,this.onFpConfigured=e.onFpConfigured,this.onDirection=e.onDirection,this.onInit=e.onInit,this.onCurrentPositionChanged=e.onCurrentPositionChanged,this.onFloorActivated=e.onFloorActivated,this.onLeaveEvent=e.onLeaveEvent,this.viewerMode=!!e.viewerMode,this.disableRuntimeAlerts=e.disableRuntimeAlerts??!0,this.maplibre=e.maplibre,window.__efpMaplibre=e.maplibre,this._ready=new Promise((l,a)=>{this.resolveReady=l});const r=e.element;if(this.element=r,r.__expofp)throw new Error("Element already in use");if(r.__expofp=this,r.getAttribute("data-event-id")||r.getAttribute("data-event"))throw new Error("data-xxx attributes are removed, use options instead");const h=e.expo||e.event;if(!h)throw new Error("`expo` option is required");$({eventId:h||"",isWebview:S}),this.eventId=h,window.__efpEvent=h,window.__efpElement=r;const m=document.createElement("div");m.style.height="100%",m.style.width="100%",r.appendChild(m);let n;if(S&&(this.allowConsent=!0),e.allowConsent===void 0){const a=new URL(window.location.href).searchParams.get("allowConsent");a&&(this.allowConsent=a==="true")}if(E){n=m.attachShadow({mode:"open"});const l=n,a=document;l.createElement=(...i)=>a.createElement(...i),l.createElementNS=(...i)=>a.createElementNS(...i),l.createTextNode=(...i)=>a.createTextNode(...i)}else n=m;const y=document.createElement("div");if(y.style.height="100%",y.style.width="100%",n.appendChild(y),E&&Object.defineProperty(y,"ownerDocument",{value:n}),window.__efpShadowDOMStyleParent=E?n:void 0,this.renderTarget=y,r.getAttribute("data-data-url"))throw new Error("data-xxx attributes are removed, use options instead");const u=e.legacyDataUrlBase;window.__dataUrlBase=u,this.dataUrl=u,U.log("Instantiating ExpoFP floorplan",e.element,h);const L=u+"data.js",O=u+"wf.data.js",x=u+"fp.svg.js",B=[k(O),k(L),k(x)];let v=0;this.efpStyleLoadHandler=function(l){const a=window.__efpStyleElements;for(;v<a.length;){const i=a[v];n.appendChild(i),v++}},window.addEventListener("__efpStyleLoad",this.efpStyleLoadHandler);const b=this;(async function(){await Promise.all(B);let a=0;for(;window.__fpPending&&!window.__fp;)await H(2e3),await k(x+`?v=${++a}`);const i=window.__data;if(!i){const{showEventNotFound:o}=await import("./tools/event-not-found");o(r);return}const P=J(i);P&&import("./intercom/bootIntercom").then(({bootIntercom:o})=>o(P)).catch(()=>{}),await z();const w=new URLSearchParams(window.location.search);let f,C;if(i?.trackerUrl)try{f=new URL(i.trackerUrl),C=f.searchParams.get("expoId")}catch(o){console.error(o)}const R=async o=>{if(!f||!C)return Promise.reject(new Error("trackerUrl or expoId is missing"));const s=new URL(o.dataUrl,f.origin),d=await fetch(s.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expoId:C,token:decodeURIComponent(w.get("t"))})});let p=[];d.ok&&(p=(await d.json()).map(o.dataMapper)),window.__heatmapDataYah={yah:p}};if(w.get("heatmap")==="true")try{if(w.get("type")==="yah")w.get("subtype")==="kiosk"?await R({dataUrl:"/api/kiosks/list/viewer",dataMapper:o=>({...o,id:o.key,name:`Kiosk ${o.key}`})}):await R({dataUrl:"/api/v1/you-are-here/qr-code/list/viewer",dataMapper:(o,s)=>({...o,name:`QR Code #${s+1}`})});else{const o=new URL("/api/fp-stats/get",f.origin);o.searchParams.set("expoId",C),o.searchParams.set("type","booview"),o.searchParams.set("t",decodeURIComponent(w.get("t")));const s=new URL("api/fp-stats/get",f.origin);s.searchParams.set("expoId",C),s.searchParams.set("type","exview"),s.searchParams.set("t",decodeURIComponent(w.get("t")));const[d,p]=await Promise.all([fetch(o.toString()),fetch(s.toString())]),[_,M]=await Promise.all([d.json(),p.json()]);window.__heatmapData={booths:_,exhibitors:M}}}catch(o){console.error("Heatmap: Initialization error",o)}try{const o=A();if(o){V(o);const s=F("api/rebooking-data",{rt:o,expoKey:h}),d=await fetch(s);if(d.ok){const p=await d.json();Q(i,p)}i.isRebooking=d.ok}else i.isRebooking=!1}catch(o){console.error(o)}const D=[I(c+"vendor/sanitize-css/sanitize.css",n),I(c+"vendor/perfect-scrollbar/css/perfect-scrollbar.css",n),g("Oswald",c+"fonts/oswald-v17-cyrillic_latin-300.woff",{weight:300}),g("Oswald",c+"fonts/oswald-v17-cyrillic_latin-500.woff",{weight:500}),g("Inter",c+"fonts/inter-400.woff2",{weight:400}),g("Inter",c+"fonts/inter-500.woff2",{weight:500}),g("Inter",c+"fonts/inter-600.woff2",{weight:600}),g("efp-symbols",c+"fonts/efp-symbols.woff",{weight:400}),G(i,n),N(b.icons)];await Promise.all(D),b.enableRotation=i?.enableRotation??!1,b.alwaysShowSidebar=i?.alwaysShowSidebar??!1,U.log("Data loaded");const{default:j}=await import("./floorplan.ready");for(document.querySelectorAll(".expofp-floorplan-loader").forEach(o=>o.remove());r.firstChild&&r.firstChild!==m;)r.removeChild(r.firstChild);Object.setPrototypeOf(b,j.prototype).init()})()}}
|
|
1
|
+
import{PREVIEW_MODE_ATTRIBUTE as T}from"./constants";import c from"./tools/base-runtime-url";import{buildRebookingUrl as F,getRebookingToken as A,retainRebookingToken as V}from"./tools/rebookingUrl";import{loadCss as I,loadFont as g,loadJs as k}from"./tools/loaders";import U from"./tools/logger";import{sleep as H}from"./utils";import{initI18n as z}from"./utils/i18n";import S from"./utils/is-webview";import{loadCustomCss as G}from"./utils/loadCustomCss";import{loadIcons as N}from"./utils/loadIcons";import Q from"./utils/mergeExhibitors";import E from"./utils/use-shadow";import q from"./utils/is-debug";import W from"./utils/is-localhost";import{initSentry as $}from"./tools/sentry";import{shouldLoadIntercom as J}from"./intercom";function t(){throw new Error("FloorPlan not ready")}export default class K{options;renderTarget;_ready;element;eventId;dataUrl;noOverlay;offHistory;ignoreQuery;allowConsent;onInit;disableRuntimeAlerts;viewerMode;maplibre;efpStyleLoadHandler;resolveReady;icons=new Map;enableRotation=!0;alwaysShowSidebar=!1;get ready(){return this._ready}get previewMode(){return this.options.previewMode||this.element.hasAttribute(T)}onBoothClick;onBookmarkClick;onVisitedClick;onCategoryClick;onFpConfigured;onDirection;onDetails;onExhibitorCustomButtonClick;onGetCoordsClick;onMarkerClick;onLeaveEvent;selectBooth(e){t()}selectExhibitor(e){t()}selectRoute(e,r){t()}getOptimizedRoutes(e){t()}selectCurrentPosition(e,r,h){t()}setBookmarks(e){t()}setEntitiesBookmarks(e){t()}setEntitiesVisited(e){t()}setMarkers(e){t()}updateLayerVisibility(e,r){t()}getCenterCoordinates(){t()}applyParameters(e){t()}exhibitorsList(){t()}boothsList(){t()}categoriesList(){t()}selectCategory(e){t()}getVisibility(){t()}setVisibility(e){t()}findLocation(){t()}zoomIn(){t()}zoomOut(){t()}zoomTo(e,r){t()}switchView(){t()}fitBounds(){t()}getBounds(e){t()}getBoothRect(e){t()}convertToGeo(e,r){t()}getGeoConfig(){t()}unstable_destroy(){t()}highlightExhibitors(e){t()}highlightBooths(e){t()}onCurrentPositionChanged(e){t()}search(e){t()}getFloors(){t()}onFloorActivated(e){t()}activateFloor(e){t()}showPathway(e,r){t()}showPathwayOnly(e,r){t()}hidePathways(){t()}showSearch(){t()}changeLanguage(e){t()}isGpsTrackingEnabled(){t()}setGpsTrackingEnabled(e){t()}deselectCurrentPosition(){t()}deselectRoute(){t()}reset(){t()}selectAccessibleRoute(e){t()}constructor(e){this.options=e,this.noOverlay=!!e.noOverlay,this.offHistory=!!e.offHistory,this.ignoreQuery=e.ignoreQuery,this.allowConsent=W&&!q?!1:e.allowConsent,this.onBoothClick=e.onBoothClick,this.onBookmarkClick=e.onBookmarkClick,this.onVisitedClick=e.onVisitedClick,this.onCategoryClick=e.onCategoryClick,this.onDetails=e.onDetails,this.onExhibitorCustomButtonClick=e.onExhibitorCustomButtonClick,this.onGetCoordsClick=e.onGetCoordsClick,this.onMarkerClick=e.onMarkerClick,this.onFpConfigured=e.onFpConfigured,this.onDirection=e.onDirection,this.onInit=e.onInit,this.onCurrentPositionChanged=e.onCurrentPositionChanged,this.onFloorActivated=e.onFloorActivated,this.onLeaveEvent=e.onLeaveEvent,this.viewerMode=!!e.viewerMode,this.disableRuntimeAlerts=e.disableRuntimeAlerts??!0,this.maplibre=e.maplibre,window.__efpMaplibre=e.maplibre,this._ready=new Promise((l,a)=>{this.resolveReady=l});const r=e.element;if(this.element=r,r.__expofp)throw new Error("Element already in use");if(r.__expofp=this,r.getAttribute("data-event-id")||r.getAttribute("data-event"))throw new Error("data-xxx attributes are removed, use options instead");const h=e.expo||e.event;if(!h)throw new Error("`expo` option is required");$({eventId:h||"",isWebview:S}),this.eventId=h,window.__efpEvent=h,window.__efpElement=r;const m=document.createElement("div");m.style.height="100%",m.style.width="100%",r.appendChild(m);let n;if(S&&(this.allowConsent=!0),e.allowConsent===void 0){const a=new URL(window.location.href).searchParams.get("allowConsent");a&&(this.allowConsent=a==="true")}if(E){n=m.attachShadow({mode:"open"});const l=n,a=document;l.createElement=(...i)=>a.createElement(...i),l.createElementNS=(...i)=>a.createElementNS(...i),l.createTextNode=(...i)=>a.createTextNode(...i)}else n=m;const y=document.createElement("div");if(y.style.height="100%",y.style.width="100%",n.appendChild(y),E&&Object.defineProperty(y,"ownerDocument",{value:n}),window.__efpShadowDOMStyleParent=E?n:void 0,this.renderTarget=y,r.getAttribute("data-data-url"))throw new Error("data-xxx attributes are removed, use options instead");const u=e.legacyDataUrlBase;window.__dataUrlBase=u,this.dataUrl=u,U.log("Instantiating ExpoFP floorplan",e.element,h);const L=u+"data.js",O=u+"wf.data.js",x=u+"fp.svg.js",B=[k(O),k(L),k(x)];let v=0;this.efpStyleLoadHandler=function(l){const a=window.__efpStyleElements;for(;v<a.length;){const i=a[v];n.appendChild(i),v++}},window.addEventListener("__efpStyleLoad",this.efpStyleLoadHandler);const b=this;(async function(){await Promise.all(B);let a=0;for(;window.__fpPending&&!window.__fp;)await H(2e3),await k(x+`?v=${++a}`);const i=window.__data;if(!i){const{showEventNotFound:o}=await import("./tools/event-not-found");o(r);return}const P=J(i);P&&import("./intercom/bootIntercom").then(({bootIntercom:o})=>o(P)).catch(()=>{}),await z();const w=new URLSearchParams(window.location.search);let f,C;if(i?.trackerUrl)try{f=new URL(i.trackerUrl),C=f.searchParams.get("expoId")}catch(o){console.error(o)}const R=async o=>{if(!f||!C)return Promise.reject(new Error("trackerUrl or expoId is missing"));const s=new URL(o.dataUrl,f.origin),d=await fetch(s.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expoId:C,token:decodeURIComponent(w.get("t"))})});let p=[];d.ok&&(p=(await d.json()).map(o.dataMapper)),window.__heatmapDataYah={yah:p}};if(w.get("heatmap")==="true")try{if(w.get("type")==="yah")w.get("subtype")==="kiosk"?await R({dataUrl:"/api/kiosks/list/viewer",dataMapper:o=>({...o,id:o.key,name:`Kiosk ${o.key}`})}):await R({dataUrl:"/api/v1/you-are-here/qr-code/list/viewer",dataMapper:(o,s)=>({...o,name:`QR Code #${s+1}`})});else{const o=new URL("/api/fp-stats/get",f.origin);o.searchParams.set("expoId",C),o.searchParams.set("type","booview"),o.searchParams.set("t",decodeURIComponent(w.get("t")));const s=new URL("api/fp-stats/get",f.origin);s.searchParams.set("expoId",C),s.searchParams.set("type","exview"),s.searchParams.set("t",decodeURIComponent(w.get("t")));const[d,p]=await Promise.all([fetch(o.toString()),fetch(s.toString())]),[_,M]=await Promise.all([d.json(),p.json()]);window.__heatmapData={booths:_,exhibitors:M}}}catch(o){console.error("Heatmap: Initialization error",o)}try{const o=A();if(o){V(o);const s=F("api/rebooking-data",{rt:o,expoKey:h}),d=await fetch(s);if(d.ok){const p=await d.json();Q(i,p)}i.isRebooking=d.ok}else i.isRebooking=!1}catch(o){console.error(o)}const D=[I(c+"vendor/sanitize-css/sanitize.css",n),I(c+"vendor/perfect-scrollbar/css/perfect-scrollbar.css",n),g("Oswald",c+"fonts/oswald-v17-cyrillic_latin-300.woff",{weight:300}),g("Oswald",c+"fonts/oswald-v17-cyrillic_latin-500.woff",{weight:500}),g("Inter",c+"fonts/inter-400.woff2",{weight:400}),g("Inter",c+"fonts/inter-500.woff2",{weight:500}),g("Inter",c+"fonts/inter-600.woff2",{weight:600}),g("efp-symbols",c+"fonts/efp-symbols.woff",{weight:400}),G(i,n),N(b.icons)];await Promise.all(D),b.enableRotation=i?.enableRotation??!1,b.alwaysShowSidebar=i?.alwaysShowSidebar??!1,U.log("Data loaded");const{default:j}=await import("./floorplan.ready");for(document.querySelectorAll(".expofp-floorplan-loader").forEach(o=>o.remove());r.firstChild&&r.firstChild!==m;)r.removeChild(r.firstChild);Object.setPrototypeOf(b,j.prototype).init()})()}}
|
|
@@ -4,6 +4,7 @@ import { CurrentPosition, MarkersData } from "./store/RouteStore";
|
|
|
4
4
|
import { Visibility } from "./store/types";
|
|
5
5
|
import Rect from "./core/Rect";
|
|
6
6
|
import { Bounds, POISelectors } from "./types/sdk.types";
|
|
7
|
+
import type { GeoConfig } from "./types";
|
|
7
8
|
export default class FloorPlanReady extends FloorPlanLoader {
|
|
8
9
|
root: ReturnType<typeof createRoot>;
|
|
9
10
|
protected init(): void;
|
|
@@ -63,6 +64,7 @@ export default class FloorPlanReady extends FloorPlanLoader {
|
|
|
63
64
|
}): void;
|
|
64
65
|
getBoothRect(name: string): Rect;
|
|
65
66
|
convertToGeo(x: number, y: number): [number, number] | never;
|
|
67
|
+
getGeoConfig(): GeoConfig | null;
|
|
66
68
|
unstable_destroy(): void;
|
|
67
69
|
search(term: string): Promise<{
|
|
68
70
|
item: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as g,Fragment as L,jsxs as C}from"react/jsx-runtime";import{reaction as T}from"mobx";import{createRoot as R}from"react-dom/client";import{install as I}from"resize-observer";import V from"./components/Layout";import $ from"./floorplan.loader";import{applyParameters as M,destroyHistory as j,initRouting as z}from"./services/routing";import t from"./store";import{Route as S,findBooth as x,separateExternalIds as E}from"./store/RouteStore";import{destroyUiHandlers as G}from"./store/init/init-ui";import{GaEventActions as P,destroyGtag as _,sendEventToGa as w,setConsentSettings as q}from"./tools/gtag";import N from"./tools/report-error";import{resetGlobalVariables as Y}from"./tools/reset";import H from"./tools/track-event";import{fpGeo as B}from"./data/fpGeo";import{convertLocalToGps as O,isValidPointCoords as d}from"./utils/gps";import m from"./core/Rect";import{mapEntity as y}from"./utils/mapEntity";import{LANG_KEY as X,MAX_ROUTE_WAYPOINTS as p,PATHWAY_KEY as U}from"./constants";import{getStorage as v}from"./utils/entity-storage";import{ErrorBoundary as D}from"@sentry/react";import{POISelectorsSchema as F,BoundsSchema as K,ZoomToOptionsSchema as A}from"./schemas/sdk.schemas";import W from"debug";import{optimizeWaypointOrder as Q}from"./wayfinding/core/routing/optimizeWaypointOrder";import{hasLocale as Z,getLocales as J}from"./utils/i18n";const b=W("efp:api");I();export default class ee extends ${root;init(){this.ignoreQuery||z(this.offHistory),H("load"),t.fp=this,q(this.allowConsent),w(P.Load,""),this.root=R(this.renderTarget),this.root.render(g(D,{children:g(V,{offHistory:this.offHistory,allowConsent:this.allowConsent})})),w(P.Rendered,""),T(()=>t.layerStore.layersLoaded,()=>{this.resolveReady(),t.initialized||this.onInit?.(this),t.initialized=!0})}selectBooth(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectBooth","Parameter must be a string or an array of strings.","EFP000000");return}const i=t.boothStore.booths.filter(o=>typeof e=="string"?o.name===e||o.externalId===e:e.includes(o.name)||e.includes(o.externalId));t.selectBooth(i)}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){t.uiState.menu=!1,t.searchStore.resetSearchBox(),t.uiState.details=null;return}const i=t.exhibitorStore.exhibitors.filter(s=>typeof e=="string"?s.name===e||s.externalId===e:e.includes(s.name)||e.includes(s.externalId));if(!i?.length)return;if(typeof e=="string"){t.selectExhibitor(i[0]),t.moveToList([i[0]]);return}const o=i.flatMap(s=>s.booths.map(r=>r.layer)),{description:n}=o.reduce((s,r)=>(s.freq[r.description]=(s.freq[r.description]||0)+1,s.freq[r.description]>s.maxCount&&(s.maxCount=s.freq[r.description],s.mostFrequent=r),s),{freq:{},mostFrequent:o[0],maxCount:0}).mostFrequent;t.layerStore.updateVisibility(n,!0),t.uiState.menu=!1,t.searchStore.resetSearchBox(),t.uiState.details=null,t.uiState.list={type:"filter",items:i,query:{key:"exhibitors",value:i.map(s=>s.externalId).join(",")}},t.moveToList()}highlightExhibitors(e){Array.isArray(e)||a("highlightExhibitors","Parameter must be an array of strings.","EFP000200"),t.boothStore.highlightedByExternalIds=[],t.exhibitorStore.highlightedByExternalIds=[...e]}highlightBooths(e){Array.isArray(e)||a("highlightBooths","Parameter must be an array of strings.","EFP000300"),t.exhibitorStore.highlightedByExternalIds=[],t.boothStore.highlightedByExternalIds=[...e]}highlightEntities(e){Array.isArray(e)||a("highlightEntities","Parameter must be an array of strings.","EFP000400");const{boothExternalIds:i,exhibitorExternalIds:o}=E(e);t.boothStore.highlightedByExternalIds=[...i],t.exhibitorStore.highlightedByExternalIds=[...o]}selectRoute(e,i){if(Array.isArray(e)){let o=[...e];const n=o.shift(),s=o.pop();if(o.length>p)throw new Error(`The maximum number of waypoints is ${p}.`);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}t.routeStore.selectRoute(new S(f(n),f(s),o.map(f)));return}e||a("selectRoute","At a minimum, the starting point must be passed.","EFP000402"),t.routeStore.selectRoute(new S(f(e),f(i)))}getOptimizedRoutes(e){if(!Array.isArray(e))return a("getOptimizedRoutes","Parameter must be an array.","EFP000500"),[];if(e.length>p)throw new Error(`The maximum number of waypoints is ${p}.`);const i=e.map(f).filter(n=>!!n);if(!i.length)throw new Error("No booths found for the provided waypoints.");const o=new Map;for(const n of i){const s=n.layer?.name??"",r=o.get(s);r?r.push(n):o.set(s,[n])}return Array.from(o.values()).map(n=>({waypoints:Q(n.map(s=>[s.name,{cx:s.rect.cx,cy:s.rect.cy}]))}))}selectCurrentPosition(e,i,o){const n=d(e.x)&&d(e.y),s=d(e.lng)&&d(e.lat);!n&&!s&&a("selectCurrentPosition","A point must be passed. Either (x,y) or (lat,lng) are required.","EFP000600"),t.routeStore.selectCurrentPosition(e,i,o),this.onCurrentPositionChanged?.(e)}setBookmarks(e){(!Array.isArray(e)||!e.length)&&a("setBookmarks","Parameter must be an array.","EFP000700"),e.forEach(i=>{const o=t.exhibitorStore.exhibitors.find(n=>n.name===i.name||n.externalId===i.externalId);o&&(o.bookmarked=i.bookmarked)})}setEntitiesBookmarks(e){if(!Array.isArray(e)||!e.length){a("setEntitiesBookmarks","Parameter must be an array.","EFP000701");return}const i=["exhibitor","event","speaker","booth"],o=e.find(r=>!r.type||!i.includes(r.type));if(o){a("setEntitiesBookmarks",`Invalid entity type: ${o.type}. Must be one of: ${i.join(", ")}.`,"EFP000702");return}const n=v("bookmarked"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:r=>t.exhibitorStore.findExhibitor(r),replacer:r=>t.exhibitorStore.replaceBookmarked(r)},event:{existingIds:new Set(n.events||[]),finder:r=>t.eventStore.findByNameOrSlug(r),replacer:r=>t.eventStore.replaceBookmarked(r)},speaker:{existingIds:new Set(n.speakers||[]),finder:r=>t.speakerStore.speakers.find(l=>l.name===r||l.externalId===r||l.slug===r),replacer:r=>t.speakerStore.replaceBookmarked(r)},booth:{existingIds:new Set(n.booths||[]),finder:r=>{const l=t.boothStore.findBooth(r);return l?.exhibitors.length===0?l:void 0},replacer:r=>t.boothStore.replaceBookmarked(r)}};e.forEach(r=>{const l=s[r.type],h=r.name||r.externalId||"",c=l.finder(h);c?r.bookmarked?l.existingIds.add(c.id):l.existingIds.delete(c.id):console.warn(`Entity not found: ${r.type} with query "${h}"`)}),Object.values(s).forEach(r=>{r.replacer(Array.from(r.existingIds))})}setEntitiesVisited(e){if(!Array.isArray(e)||!e.length){a("setEntitiesVisited","Parameter must be an array.","EFP000703");return}const i=["exhibitor","event"],o=e.find(r=>!r.type||!i.includes(r.type));if(o){a("setEntitiesVisited",`Invalid entity type: ${o.type}. Must be one of: ${i.join(", ")}.`,"EFP000704");return}const n=v("visited"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:r=>t.exhibitorStore.findExhibitor(r),replacer:r=>t.exhibitorStore.replaceVisited(r)},event:{existingIds:new Set(n.events||[]),finder:r=>t.eventStore.findByNameOrSlug(r),replacer:r=>t.eventStore.replaceVisited(r)}};e.forEach(r=>{const l=s[r.type],h=r.name||r.externalId||"",c=l.finder(h);c?r.visited?l.existingIds.add(c.id):l.existingIds.delete(c.id):console.warn(`Entity not found: ${r.type} with query "${h}"`)}),Object.values(s).forEach(r=>{r.replacer(Array.from(r.existingIds))})}setMarkers(e){if(!e||!Array.isArray(e.icons)||!Array.isArray(e.markers)){a("setMarkers","Invalid input.","EFP000800");return}t.routeStore.setMarkers(e)}selectMarker(e,i=!0){return typeof e!="string"&&a("selectMarker","The identifier must be passed.","EFP000900"),t.routeStore.selectMarker(e,i)}drawCircles(e){Array.isArray(e)||a("drawCircles","Invalid input.","EFP000A00"),t.uiState.debugCircles=e}checkRoutes(){t.routeStore.checkRoutes()}updateLayerVisibility(e,i){typeof e!="string"&&a("updateLayerVisibility","The layer name (string) must be passed.","EFP000B00"),i||a("updateLayerVisibility","Passing a false value to visible will have no effect.","EFP000B01"),t.layerStore.updateVisibility(e,i)}getCenterCoordinates(){return t.fp.getCenterCoordinates()}exhibitorsList(){return t.exhibitorStore.exhibitors.map(e=>y(e))}boothsList(){return t.boothStore.booths.map(e=>y(e))}categoriesList(){return t.categoryStore.categories.map(e=>y(e))}selectCategory(e){if(e==null||typeof e!="string"){t.searchStore.selectSearch();return}const i=e?.toLowerCase(),o=t.categoryStore.categories.find(({name:n,slug:s})=>n?.toLowerCase()===i||s?.toLowerCase()===i);if(!o){a("selectCategory",`Category ${e} not found.`,"EFP000C01");return}t.selectCategory(o)}applyParameters(e){typeof e!="string"&&a("applyParameters","A query string must be passed.","EFP000D00"),M(e)}getVisibility(){return t.uiState.visibility}setVisibility(e){(typeof e!="object"||!Object.keys(e).length)&&a("setVisibility","The parameter must be passed.","EFP000E00"),t.uiState.setVisibility(e)}findLocation(){t.routeStore.findLocation()}zoomIn(){t.uiState.zoomIn()}zoomOut(){t.uiState.zoomOut()}switchView(){t.maplibreStore.activateMaplibre()}zoomTo(e,i){b("zoomTo called with selectors=%O options=%O",e,i);const o=F.safeParse(e);if(!o.success){a("zoomTo",o.error.message,"EFP001600");return}const n=A.safeParse(i);if(!n.success){a("zoomTo",n.error.message,"EFP001601");return}const s=this.getBounds(e);s&&this.fitBounds(s,i)}getBounds(e){b("getBounds called with selectors=%O",e);const i=F.safeParse(e);if(!i.success){a("getBounds",i.error.message,"EFP001400");return}const o=[];if(e.booths?.forEach(s=>{let r;s.externalId?r=t.boothStore.boothByExternalId.get(s.externalId):s.name&&(r=t.boothStore.boothByName.get(s.name.toLowerCase())),r?.rect&&o.push(r.rect)}),e.exhibitors?.forEach(s=>{let r;s.externalId?r=t.exhibitorStore.exhibitorByExternalId.get(s.externalId):s.name&&(r=t.exhibitorStore.exhibitorByName.get(s.name.toLowerCase())),r?.booths?.forEach(l=>{l.rect&&o.push(l.rect)})}),o.length===0)return;const n=m.fromMultiple(o);return{leftTop:{x:n.x1,y:n.y1},rightBottom:{x:n.x2,y:n.y2}}}fitBounds(e,i){if(b("fitBounds called with bounds=%O options=%O",e,i),!e){t.uiState.fitBounds();return}const o=K.safeParse(e);if(!o.success){a("fitBounds",o.error.message,"EFP001500");return}const n=A.safeParse(i);if(!n.success){a("fitBounds",n.error.message,"EFP001501");return}let s;if(i?.padding){const r=i.padding;s=m.fromX1y1x2y2(e.leftTop.x-r,e.leftTop.y-r,e.rightBottom.x+r,e.rightBottom.y+r)}else s=m.fromX1y1x2y2(e.leftTop.x,e.leftTop.y,e.rightBottom.x,e.rightBottom.y);t.uiState.moveToRect=s}getBoothRect(e){return typeof e!="string"&&a("getBoothRect","A booth name must be passed.","EFP000F00"),x(e)?.rect}convertToGeo(e,i){if(!B?.properties?.config){a("convertToGeo","The coordinates cannot be converted because the GPS configuration is not defined.","EFP001000");return}if(!e||!i){a("convertToGeo","Both coordinates must be passed.","EFP001001");return}return O(e,i,B.properties.config)}unstable_destroy(){let e=window.__efpElement.firstChild;Y(),window.removeEventListener("__efpStyleLoad",this.efpStyleLoadHandler),window.removeEventListener("error",N),t.maplibreStore.dispose(),j(),G(),_(),[...document.getElementsByTagName("script")].filter(o=>o.src.indexOf("/fp.svg")>-1||o.src.indexOf("/wf.data.js")>-1||o.src.indexOf("/data.js")>-1).forEach(o=>o.remove()),this.root.unmount(),e.remove()}search(e){return typeof e!="string"&&a("search","A search string must be passed.","EFP001100"),t.fuzzySearchEngineStore.loadEngine().then(()=>(t.searchStore.selectSearch(e),t.uiState.fuzzySearchItems.map(i=>({item:y(i.item),score:i.score}))))}getFloors(){return t.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 i=this.getFloors();if(e.name){const o=i.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=i.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,i){const o=new URLSearchParams;if(o.set(U,e),i?.length){const{boothExternalIds:n,exhibitorExternalIds:s}=E(i);n.length>0&&o.set("booths",n.join(",")),s.length>0&&o.set("exhibitors",s.join(","))}this.applyParameters(o.toString())}showPathwayOnly(e,i){this.activateFloor({name:i}),t.layerStore.showPathWay(e),t.uiState.setPathwayOnlyMode(!0);const o=t.layerStore.findLayer(e),n=t.layerStore.findLayer(i),s=o?.rect||o?.viewbox?o:n;if(s?.rect||s?.viewbox){const r=s.viewbox??s.rect;t.uiState.moveToRect=m.fromX1y1x2y2(r.x1,r.y1,r.x2,r.y2)}}hidePathways(){this.highlightBooths([]),t.layerStore.hidePathways(),t.uiState.setPathwayOnlyMode(!1)}showSearch(){t.selectSearch("")}changeLanguage(e){const i=e?.toLowerCase?.();if(!Z(i)){a("changeLanguage",`Language "${e}" was not found. Available languages: ${J().map(n=>n.id).join(",")}`,"EFP001300");return}const o=new URLSearchParams;o.set(X,i),this.applyParameters(o.toString())}isGpsTrackingEnabled(){return t.routeStore.gpsEnabled}setGpsTrackingEnabled(e){t.routeStore.setGpsTrackingEnabled(e)}deselectCurrentPosition(){t.routeStore.selectCurrentPosition(null,!1)}deselectRoute(){t.routeStore.selectRoute(null),t.routeStore.setOnlyAccessible(!1)}reset(){this.selectBooth(""),this.selectExhibitor(""),this.selectCategory(),this.deselectCurrentPosition(),this.deselectRoute(),this.highlightEntities([]),t.uiState.kioskData&&t.resetCameraFn?t.resetCameraFn?.():this.fitBounds()}selectAccessibleRoute(e){t.routeStore.setOnlyAccessible(!0),this.selectRoute(e)}}function f(u){return typeof u=="string"?x(u):t.routeStore.getNearestBooth(u)}let k=0;function a(u,e,i){const o=`Error calling "${u}" SDK method.`,n=`${e.endsWith(".")?e:e+"."} More information at`;let s="https://js-sdk.expofp.com/api/packages";if(i&&(s+=`#error-${i}`),console.error(`${o} ${n} ${s}`),t.fp.disableRuntimeAlerts)return;t.uiState.setGlobalErrorMessage({title:o,body:C(L,{children:[n," ",g("a",{href:s,target:"_blank",rel:"noreferrer",children:s})]})}),clearTimeout(k);const r=8e3;k=window.setTimeout(()=>{const l=async()=>{t.uiState.globalErrorMessages.length>0&&(t.uiState.popGlobalErrorMessage(),await new Promise(h=>setTimeout(h,r/2)),l())};l()},r)}
|
|
1
|
+
import{jsx as g,Fragment as L,jsxs as C}from"react/jsx-runtime";import{reaction as T}from"mobx";import{createRoot as R}from"react-dom/client";import{install as I}from"resize-observer";import V from"./components/Layout";import $ from"./floorplan.loader";import{applyParameters as M,destroyHistory as j,initRouting as z}from"./services/routing";import t from"./store";import{Route as x,findBooth as E,separateExternalIds as P}from"./store/RouteStore";import{destroyUiHandlers as G}from"./store/init/init-ui";import{GaEventActions as w,destroyGtag as _,sendEventToGa as B,setConsentSettings as q}from"./tools/gtag";import N from"./tools/report-error";import{resetGlobalVariables as Y}from"./tools/reset";import H from"./tools/track-event";import{fpGeo as b}from"./data/fpGeo";import{convertLocalToGps as O,isValidPointCoords as d}from"./utils/gps";import m from"./core/Rect";import{mapEntity as y}from"./utils/mapEntity";import{LANG_KEY as X,MAX_ROUTE_WAYPOINTS as p,PATHWAY_KEY as U}from"./constants";import{getStorage as v}from"./utils/entity-storage";import{ErrorBoundary as D}from"@sentry/react";import{POISelectorsSchema as F,BoundsSchema as K,ZoomToOptionsSchema as A}from"./schemas/sdk.schemas";import W from"debug";import{optimizeWaypointOrder as Q}from"./wayfinding/core/routing/optimizeWaypointOrder";import{hasLocale as Z,getLocales as J}from"./utils/i18n";const S=W("efp:api");I();export default class ee extends ${root;init(){this.ignoreQuery||z(this.offHistory),H("load"),t.fp=this,q(this.allowConsent),B(w.Load,""),this.root=R(this.renderTarget),this.root.render(g(D,{children:g(V,{offHistory:this.offHistory,allowConsent:this.allowConsent})})),B(w.Rendered,""),T(()=>t.layerStore.layersLoaded,()=>{this.resolveReady(),t.initialized||this.onInit?.(this),t.initialized=!0})}selectBooth(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectBooth","Parameter must be a string or an array of strings.","EFP000000");return}const i=t.boothStore.booths.filter(o=>typeof e=="string"?o.name===e||o.externalId===e:e.includes(o.name)||e.includes(o.externalId));t.selectBooth(i)}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){t.uiState.menu=!1,t.searchStore.resetSearchBox(),t.uiState.details=null;return}const i=t.exhibitorStore.exhibitors.filter(s=>typeof e=="string"?s.name===e||s.externalId===e:e.includes(s.name)||e.includes(s.externalId));if(!i?.length)return;if(typeof e=="string"){t.selectExhibitor(i[0]),t.moveToList([i[0]]);return}const o=i.flatMap(s=>s.booths.map(r=>r.layer)),{description:n}=o.reduce((s,r)=>(s.freq[r.description]=(s.freq[r.description]||0)+1,s.freq[r.description]>s.maxCount&&(s.maxCount=s.freq[r.description],s.mostFrequent=r),s),{freq:{},mostFrequent:o[0],maxCount:0}).mostFrequent;t.layerStore.updateVisibility(n,!0),t.uiState.menu=!1,t.searchStore.resetSearchBox(),t.uiState.details=null,t.uiState.list={type:"filter",items:i,query:{key:"exhibitors",value:i.map(s=>s.externalId).join(",")}},t.moveToList()}highlightExhibitors(e){Array.isArray(e)||a("highlightExhibitors","Parameter must be an array of strings.","EFP000200"),t.boothStore.highlightedByExternalIds=[],t.exhibitorStore.highlightedByExternalIds=[...e]}highlightBooths(e){Array.isArray(e)||a("highlightBooths","Parameter must be an array of strings.","EFP000300"),t.exhibitorStore.highlightedByExternalIds=[],t.boothStore.highlightedByExternalIds=[...e]}highlightEntities(e){Array.isArray(e)||a("highlightEntities","Parameter must be an array of strings.","EFP000400");const{boothExternalIds:i,exhibitorExternalIds:o}=P(e);t.boothStore.highlightedByExternalIds=[...i],t.exhibitorStore.highlightedByExternalIds=[...o]}selectRoute(e,i){if(Array.isArray(e)){let o=[...e];const n=o.shift(),s=o.pop();if(o.length>p)throw new Error(`The maximum number of waypoints is ${p}.`);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}t.routeStore.selectRoute(new x(f(n),f(s),o.map(f)));return}e||a("selectRoute","At a minimum, the starting point must be passed.","EFP000402"),t.routeStore.selectRoute(new x(f(e),f(i)))}getOptimizedRoutes(e){if(!Array.isArray(e))return a("getOptimizedRoutes","Parameter must be an array.","EFP000500"),[];if(e.length>p)throw new Error(`The maximum number of waypoints is ${p}.`);const i=e.map(f).filter(n=>!!n);if(!i.length)throw new Error("No booths found for the provided waypoints.");const o=new Map;for(const n of i){const s=n.layer?.name??"",r=o.get(s);r?r.push(n):o.set(s,[n])}return Array.from(o.values()).map(n=>({waypoints:Q(n.map(s=>[s.name,{cx:s.rect.cx,cy:s.rect.cy}]))}))}selectCurrentPosition(e,i,o){const n=d(e.x)&&d(e.y),s=d(e.lng)&&d(e.lat);!n&&!s&&a("selectCurrentPosition","A point must be passed. Either (x,y) or (lat,lng) are required.","EFP000600"),t.routeStore.selectCurrentPosition(e,i,o),this.onCurrentPositionChanged?.(e)}setBookmarks(e){(!Array.isArray(e)||!e.length)&&a("setBookmarks","Parameter must be an array.","EFP000700"),e.forEach(i=>{const o=t.exhibitorStore.exhibitors.find(n=>n.name===i.name||n.externalId===i.externalId);o&&(o.bookmarked=i.bookmarked)})}setEntitiesBookmarks(e){if(!Array.isArray(e)||!e.length){a("setEntitiesBookmarks","Parameter must be an array.","EFP000701");return}const i=["exhibitor","event","speaker","booth"],o=e.find(r=>!r.type||!i.includes(r.type));if(o){a("setEntitiesBookmarks",`Invalid entity type: ${o.type}. Must be one of: ${i.join(", ")}.`,"EFP000702");return}const n=v("bookmarked"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:r=>t.exhibitorStore.findExhibitor(r),replacer:r=>t.exhibitorStore.replaceBookmarked(r)},event:{existingIds:new Set(n.events||[]),finder:r=>t.eventStore.findByNameOrSlug(r),replacer:r=>t.eventStore.replaceBookmarked(r)},speaker:{existingIds:new Set(n.speakers||[]),finder:r=>t.speakerStore.speakers.find(l=>l.name===r||l.externalId===r||l.slug===r),replacer:r=>t.speakerStore.replaceBookmarked(r)},booth:{existingIds:new Set(n.booths||[]),finder:r=>{const l=t.boothStore.findBooth(r);return l?.exhibitors.length===0?l:void 0},replacer:r=>t.boothStore.replaceBookmarked(r)}};e.forEach(r=>{const l=s[r.type],h=r.name||r.externalId||"",c=l.finder(h);c?r.bookmarked?l.existingIds.add(c.id):l.existingIds.delete(c.id):console.warn(`Entity not found: ${r.type} with query "${h}"`)}),Object.values(s).forEach(r=>{r.replacer(Array.from(r.existingIds))})}setEntitiesVisited(e){if(!Array.isArray(e)||!e.length){a("setEntitiesVisited","Parameter must be an array.","EFP000703");return}const i=["exhibitor","event"],o=e.find(r=>!r.type||!i.includes(r.type));if(o){a("setEntitiesVisited",`Invalid entity type: ${o.type}. Must be one of: ${i.join(", ")}.`,"EFP000704");return}const n=v("visited"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:r=>t.exhibitorStore.findExhibitor(r),replacer:r=>t.exhibitorStore.replaceVisited(r)},event:{existingIds:new Set(n.events||[]),finder:r=>t.eventStore.findByNameOrSlug(r),replacer:r=>t.eventStore.replaceVisited(r)}};e.forEach(r=>{const l=s[r.type],h=r.name||r.externalId||"",c=l.finder(h);c?r.visited?l.existingIds.add(c.id):l.existingIds.delete(c.id):console.warn(`Entity not found: ${r.type} with query "${h}"`)}),Object.values(s).forEach(r=>{r.replacer(Array.from(r.existingIds))})}setMarkers(e){if(!e||!Array.isArray(e.icons)||!Array.isArray(e.markers)){a("setMarkers","Invalid input.","EFP000800");return}t.routeStore.setMarkers(e)}selectMarker(e,i=!0){return typeof e!="string"&&a("selectMarker","The identifier must be passed.","EFP000900"),t.routeStore.selectMarker(e,i)}drawCircles(e){Array.isArray(e)||a("drawCircles","Invalid input.","EFP000A00"),t.uiState.debugCircles=e}checkRoutes(){t.routeStore.checkRoutes()}updateLayerVisibility(e,i){typeof e!="string"&&a("updateLayerVisibility","The layer name (string) must be passed.","EFP000B00"),i||a("updateLayerVisibility","Passing a false value to visible will have no effect.","EFP000B01"),t.layerStore.updateVisibility(e,i)}getCenterCoordinates(){return t.fp.getCenterCoordinates()}exhibitorsList(){return t.exhibitorStore.exhibitors.map(e=>y(e))}boothsList(){return t.boothStore.booths.map(e=>y(e))}categoriesList(){return t.categoryStore.categories.map(e=>y(e))}selectCategory(e){if(e==null||typeof e!="string"){t.searchStore.selectSearch();return}const i=e?.toLowerCase(),o=t.categoryStore.categories.find(({name:n,slug:s})=>n?.toLowerCase()===i||s?.toLowerCase()===i);if(!o){a("selectCategory",`Category ${e} not found.`,"EFP000C01");return}t.selectCategory(o)}applyParameters(e){typeof e!="string"&&a("applyParameters","A query string must be passed.","EFP000D00"),M(e)}getVisibility(){return t.uiState.visibility}setVisibility(e){(typeof e!="object"||!Object.keys(e).length)&&a("setVisibility","The parameter must be passed.","EFP000E00"),t.uiState.setVisibility(e)}findLocation(){t.routeStore.findLocation()}zoomIn(){t.uiState.zoomIn()}zoomOut(){t.uiState.zoomOut()}switchView(){t.maplibreStore.activateMaplibre()}zoomTo(e,i){S("zoomTo called with selectors=%O options=%O",e,i);const o=F.safeParse(e);if(!o.success){a("zoomTo",o.error.message,"EFP001600");return}const n=A.safeParse(i);if(!n.success){a("zoomTo",n.error.message,"EFP001601");return}const s=this.getBounds(e);s&&this.fitBounds(s,i)}getBounds(e){S("getBounds called with selectors=%O",e);const i=F.safeParse(e);if(!i.success){a("getBounds",i.error.message,"EFP001400");return}const o=[];if(e.booths?.forEach(s=>{let r;s.externalId?r=t.boothStore.boothByExternalId.get(s.externalId):s.name&&(r=t.boothStore.boothByName.get(s.name.toLowerCase())),r?.rect&&o.push(r.rect)}),e.exhibitors?.forEach(s=>{let r;s.externalId?r=t.exhibitorStore.exhibitorByExternalId.get(s.externalId):s.name&&(r=t.exhibitorStore.exhibitorByName.get(s.name.toLowerCase())),r?.booths?.forEach(l=>{l.rect&&o.push(l.rect)})}),o.length===0)return;const n=m.fromMultiple(o);return{leftTop:{x:n.x1,y:n.y1},rightBottom:{x:n.x2,y:n.y2}}}fitBounds(e,i){if(S("fitBounds called with bounds=%O options=%O",e,i),!e){t.uiState.fitBounds();return}const o=K.safeParse(e);if(!o.success){a("fitBounds",o.error.message,"EFP001500");return}const n=A.safeParse(i);if(!n.success){a("fitBounds",n.error.message,"EFP001501");return}let s;if(i?.padding){const r=i.padding;s=m.fromX1y1x2y2(e.leftTop.x-r,e.leftTop.y-r,e.rightBottom.x+r,e.rightBottom.y+r)}else s=m.fromX1y1x2y2(e.leftTop.x,e.leftTop.y,e.rightBottom.x,e.rightBottom.y);t.uiState.moveToRect=s}getBoothRect(e){return typeof e!="string"&&a("getBoothRect","A booth name must be passed.","EFP000F00"),E(e)?.rect}convertToGeo(e,i){if(!b?.properties?.config){a("convertToGeo","The coordinates cannot be converted because the GPS configuration is not defined.","EFP001000");return}if(!e||!i){a("convertToGeo","Both coordinates must be passed.","EFP001001");return}return O(e,i,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}unstable_destroy(){let e=window.__efpElement.firstChild;Y(),window.removeEventListener("__efpStyleLoad",this.efpStyleLoadHandler),window.removeEventListener("error",N),t.maplibreStore.dispose(),j(),G(),_(),[...document.getElementsByTagName("script")].filter(o=>o.src.indexOf("/fp.svg")>-1||o.src.indexOf("/wf.data.js")>-1||o.src.indexOf("/data.js")>-1).forEach(o=>o.remove()),this.root.unmount(),e.remove()}search(e){return typeof e!="string"&&a("search","A search string must be passed.","EFP001100"),t.fuzzySearchEngineStore.loadEngine().then(()=>(t.searchStore.selectSearch(e),t.uiState.fuzzySearchItems.map(i=>({item:y(i.item),score:i.score}))))}getFloors(){return t.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 i=this.getFloors();if(e.name){const o=i.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=i.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,i){const o=new URLSearchParams;if(o.set(U,e),i?.length){const{boothExternalIds:n,exhibitorExternalIds:s}=P(i);n.length>0&&o.set("booths",n.join(",")),s.length>0&&o.set("exhibitors",s.join(","))}this.applyParameters(o.toString())}showPathwayOnly(e,i){this.activateFloor({name:i}),t.layerStore.showPathWay(e),t.uiState.setPathwayOnlyMode(!0);const o=t.layerStore.findLayer(e),n=t.layerStore.findLayer(i),s=o?.rect||o?.viewbox?o:n;if(s?.rect||s?.viewbox){const r=s.viewbox??s.rect;t.uiState.moveToRect=m.fromX1y1x2y2(r.x1,r.y1,r.x2,r.y2)}}hidePathways(){this.highlightBooths([]),t.layerStore.hidePathways(),t.uiState.setPathwayOnlyMode(!1)}showSearch(){t.selectSearch("")}changeLanguage(e){const i=e?.toLowerCase?.();if(!Z(i)){a("changeLanguage",`Language "${e}" was not found. Available languages: ${J().map(n=>n.id).join(",")}`,"EFP001300");return}const o=new URLSearchParams;o.set(X,i),this.applyParameters(o.toString())}isGpsTrackingEnabled(){return t.routeStore.gpsEnabled}setGpsTrackingEnabled(e){t.routeStore.setGpsTrackingEnabled(e)}deselectCurrentPosition(){t.routeStore.selectCurrentPosition(null,!1)}deselectRoute(){t.routeStore.selectRoute(null),t.routeStore.setOnlyAccessible(!1)}reset(){this.selectBooth(""),this.selectExhibitor(""),this.selectCategory(),this.deselectCurrentPosition(),this.deselectRoute(),this.highlightEntities([]),t.uiState.kioskData&&t.resetCameraFn?t.resetCameraFn?.():this.fitBounds()}selectAccessibleRoute(e){t.routeStore.setOnlyAccessible(!0),this.selectRoute(e)}}function f(u){return typeof u=="string"?E(u):t.routeStore.getNearestBooth(u)}let k=0;function a(u,e,i){const o=`Error calling "${u}" SDK method.`,n=`${e.endsWith(".")?e:e+"."} More information at`;let s="https://js-sdk.expofp.com/api/packages";if(i&&(s+=`#error-${i}`),console.error(`${o} ${n} ${s}`),t.fp.disableRuntimeAlerts)return;t.uiState.setGlobalErrorMessage({title:o,body:C(L,{children:[n," ",g("a",{href:s,target:"_blank",rel:"noreferrer",children:s})]})}),clearTimeout(k);const r=8e3;k=window.setTimeout(()=>{const l=async()=>{t.uiState.globalErrorMessages.length>0&&(t.uiState.popGlobalErrorMessage(),await new Promise(h=>setTimeout(h,r/2)),l())};l()},r)}
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -70,6 +70,7 @@ export interface FloorPlan {
|
|
|
70
70
|
getBounds(selectors: POISelectors): Bounds | undefined;
|
|
71
71
|
getBoothRect(name: string): Rect;
|
|
72
72
|
convertToGeo(x: number, y: number): [number, number] | never;
|
|
73
|
+
getGeoConfig(): GeoConfig | null;
|
|
73
74
|
unstable_destroy(): void;
|
|
74
75
|
highlightExhibitors(externalIds: string[]): void;
|
|
75
76
|
highlightBooths(externalIds: string[]): void;
|
|
@@ -357,5 +358,33 @@ export interface POISelectors {
|
|
|
357
358
|
/** Array of exhibitor selectors */
|
|
358
359
|
exhibitors?: POISelector[];
|
|
359
360
|
}
|
|
361
|
+
/**
|
|
362
|
+
* Geographic anchor point that ties a floor plan coordinate to a real-world
|
|
363
|
+
* GPS location. Used to georeference the map.
|
|
364
|
+
*/
|
|
365
|
+
export interface GeoAnchor {
|
|
366
|
+
/** X coordinate in the floor plan coordinate system */
|
|
367
|
+
x: number;
|
|
368
|
+
/** Y coordinate in the floor plan coordinate system */
|
|
369
|
+
y: number;
|
|
370
|
+
/** Latitude in decimal degrees */
|
|
371
|
+
lat: number;
|
|
372
|
+
/** Longitude in decimal degrees */
|
|
373
|
+
lng: number;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Geographic configuration of the floor plan: its orientation and the anchor
|
|
377
|
+
* points that map local coordinates to GPS positions.
|
|
378
|
+
*/
|
|
379
|
+
export interface GeoConfig {
|
|
380
|
+
/** Bearing in degrees clockwise from true north; `0` when the map is north-aligned. */
|
|
381
|
+
bearing: number;
|
|
382
|
+
/** Primary anchor point. */
|
|
383
|
+
p0: GeoAnchor;
|
|
384
|
+
/** Optional secondary anchor point. */
|
|
385
|
+
p1?: GeoAnchor;
|
|
386
|
+
/** Tertiary anchor point. */
|
|
387
|
+
p2: GeoAnchor;
|
|
388
|
+
}
|
|
360
389
|
export {};
|
|
361
390
|
//# sourceMappingURL=types.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expofp/floorplan",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/expofp/efp-app.git",
|
|
@@ -73,19 +73,21 @@
|
|
|
73
73
|
"tslib": "^2.3.0",
|
|
74
74
|
"uuid": "^9.0.1",
|
|
75
75
|
"zod": "4.3.5",
|
|
76
|
-
"@expofp/resolve": "3.
|
|
77
|
-
"@expofp/debug": "3.
|
|
76
|
+
"@expofp/resolve": "3.7.1",
|
|
77
|
+
"@expofp/debug": "3.7.1"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@babel/plugin-proposal-decorators": "^7.29.7",
|
|
81
81
|
"@babel/plugin-transform-class-properties": "^7.29.7",
|
|
82
82
|
"@sentry/vite-plugin": "^5.3.0",
|
|
83
|
-
"@storybook/addon-vitest": "10.4.
|
|
84
|
-
"@storybook/react": "10.4.
|
|
85
|
-
"@storybook/react-vite": "10.4.
|
|
83
|
+
"@storybook/addon-vitest": "10.4.4",
|
|
84
|
+
"@storybook/react": "10.4.4",
|
|
85
|
+
"@storybook/react-vite": "10.4.4",
|
|
86
86
|
"@types/color": "^3.0.7",
|
|
87
87
|
"@types/d3": "^7.1.0",
|
|
88
88
|
"@types/lz-string": "1.3.32",
|
|
89
|
+
"@types/react": "^19.2.17",
|
|
90
|
+
"@types/react-dom": "^19.2.3",
|
|
89
91
|
"@vitejs/plugin-react": "^6.0.2",
|
|
90
92
|
"@vitest/browser": "^4.1.7",
|
|
91
93
|
"@vitest/browser-playwright": "^4.1.7",
|
|
@@ -95,7 +97,7 @@
|
|
|
95
97
|
"react-dom": "^19.2.7",
|
|
96
98
|
"rollup-plugin-visualizer": "^7.0.1",
|
|
97
99
|
"sass-embedded": "^1.100.0",
|
|
98
|
-
"storybook": "10.4.
|
|
100
|
+
"storybook": "10.4.4"
|
|
99
101
|
},
|
|
100
102
|
"peerDependencies": {
|
|
101
103
|
"react": "^19.2.7",
|