@expofp/floorplan 3.42.0 → 3.43.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.
Files changed (170) hide show
  1. package/dist/browser/{Button-7vKTUMwa.js → Button-Bs_UxgiQ.js} +6 -6
  2. package/dist/browser/{CookieConsent-DZnUFAi1.js → CookieConsent-Dyu43_hP.js} +8 -8
  3. package/dist/browser/{Debug-Dsywuwjc.js → Debug-BsTTWQvE.js} +10 -10
  4. package/dist/browser/{DebugTools-NEHhoTT0.js → DebugTools-aXs-5eza.js} +7 -7
  5. package/dist/browser/{Demo-CdqpnPmk.js → Demo-B-7KGDMJ.js} +13 -13
  6. package/dist/browser/{Free-CknV-WFB.js → Free-CNL5OIgo.js} +16 -15
  7. package/dist/browser/{GalleryContainer-DiofTl5g.js → GalleryContainer-vKUdXOJc.js} +470 -469
  8. package/dist/browser/{GpsLoader-yBTov2Mi.js → GpsLoader-CTx41t_T.js} +40 -37
  9. package/dist/browser/{KioskStore-BhUGohiO.js → KioskStore-DryCUldq.js} +52 -48
  10. package/dist/browser/{store-C7bFMNRR.js → LayerStore-KA0vMV1s.js} +21398 -31273
  11. package/dist/browser/{MaplibreAdapter-alyJSU90.js → MaplibreAdapter-VThms9qo.js} +290 -285
  12. package/dist/browser/{ModalContainer-CRjFYu9I.js → ModalContainer-BnQWgJFk.js} +11 -11
  13. package/dist/browser/{PermissionNotice-QlgW3rD2.js → PermissionNotice-C6o0LjTv.js} +7 -7
  14. package/dist/browser/RouteStore-dygrca38.js +1203 -0
  15. package/dist/browser/SetKioskMode-BlUF1qvU.js +50 -0
  16. package/dist/browser/{ShowKiosk-CdtvEFA0.js → ShowKiosk-DFoRzTZf.js} +18 -17
  17. package/dist/browser/UIState-DOeFZ2L0.js +2026 -0
  18. package/dist/browser/{ViewerMenuPanel-ClN5-HkT.js → ViewerMenuPanel-BTQx7alw.js} +25 -24
  19. package/dist/browser/{add-debug-secret-listener-CRrpI_Kh.js → add-debug-secret-listener-DEG-kL4W.js} +1 -1
  20. package/dist/browser/{adopt-global-settings-Bfg8Afor.js → adopt-global-settings-CbCj9y4x.js} +10 -10
  21. package/dist/browser/{boolean-editor-D07VGVC2.js → boolean-editor-MewBldvq.js} +10 -10
  22. package/dist/browser/{bootIntercom-BiVMwUUy.js → bootIntercom-Dhf8kEsO.js} +3 -3
  23. package/dist/browser/bundle.json +110 -71
  24. package/dist/browser/{camera-events-DLOVTy6c.js → camera-events-BGPhoW-g.js} +1 -1
  25. package/dist/browser/{classnames-nqfwPBx9.js → classnames-CjOzT3Et.js} +2 -2
  26. package/dist/browser/{client-BiRIy1Co.js → client-B7ipF6CH.js} +6 -6
  27. package/dist/browser/{components-DEFGVG-x.js → components-z1AUvMqv.js} +1245 -1228
  28. package/dist/browser/create-live-plan-BV3wMQvQ.js +3650 -0
  29. package/dist/browser/{debug-context-CNrat8d3.js → debug-context-DHcoFmUh.js} +6 -6
  30. package/dist/browser/{debug-overlay-BUUrDM9l.js → debug-overlay-DyWRfHNB.js} +11 -11
  31. package/dist/browser/{debug-ui-CnrGzk6e.js → debug-ui--YQc14iG.js} +7 -7
  32. package/dist/browser/{dimming-D0giTIOt.js → dimming-B3eCxIBl.js} +277 -270
  33. package/dist/browser/{dist-DrIFPR9W.js → dist-CFpNRHGA.js} +6 -6
  34. package/dist/browser/{dist--ZX1xaYT.js → dist-DZnPa7Gt.js} +3 -3
  35. package/dist/browser/{dist-CV32Y46p.js → dist-d1mv4aS_.js} +7 -7
  36. package/dist/browser/{efp-debug-init-BbvlaL2_.js → efp-debug-init-Fe6M60if.js} +4 -4
  37. package/dist/browser/{enum-editor-CvWk2CYa.js → enum-editor-Bpqhj_kX.js} +5 -5
  38. package/dist/browser/{es5-Dcwx3Epy.js → es5-Tm811jgW.js} +2 -2
  39. package/dist/browser/{event-head-BSYCtvm2.js → event-head-DUUPR6gG.js} +1 -1
  40. package/dist/browser/{event-not-found-DbibmJ01.js → event-not-found-payUnjNK.js} +4 -4
  41. package/dist/browser/event-scoped-cache-C5u7vr_A.js +22 -0
  42. package/dist/browser/{exports-CBnfqlGn.js → exports-DqGDS1fu.js} +1 -1
  43. package/dist/browser/{favicon-DOUIGf88.js → favicon-DsfOrGNO.js} +1 -1
  44. package/dist/browser/{fetch-retry.umd-CESjFBn2.js → fetch-retry.umd-CC5xe8w5.js} +2 -2
  45. package/dist/browser/{flex-CkonIXcz.js → flex-CezZmi5f.js} +6 -6
  46. package/dist/browser/{floorplan.loader-D6Qw8CMQ.js → floorplan.loader-Dlxv8xv-.js} +658 -707
  47. package/dist/browser/{floorplan.ready-Cn5pmGNZ.js → floorplan.ready-Bet-4Pmf.js} +373 -359
  48. package/dist/browser/freeBanner-D8r4eSMx.js +31 -0
  49. package/dist/browser/{fuse-EvF4pTyh.js → fuse-hqr4jkDB.js} +2 -2
  50. package/dist/browser/{i18n-bazUgGYZ.js → i18n-CbKfwktv.js} +1821 -3872
  51. package/dist/browser/index.js +131 -47
  52. package/dist/browser/{index.module-Cd7A7ETP.js → index.module-BbVqiHXM.js} +17 -17
  53. package/dist/browser/init-ui-BqvkD2nz.js +286 -0
  54. package/dist/browser/integrateKiosk-DaSOYn36.js +35 -0
  55. package/dist/browser/{loadImage-7pQI5Tjs.js → is-debug-dWXc5YUy.js} +30 -14
  56. package/dist/browser/{is-own-domain-BBpQe8Jk.js → is-own-domain-D8anlQ_Q.js} +1 -1
  57. package/dist/browser/{is-webview-CvWOfDn6.js → is-webview-fqXWp538.js} +1 -1
  58. package/dist/browser/{jsx-runtime-CSQgoSxn.js → jsx-runtime-DO7PmxNL.js} +2 -2
  59. package/dist/browser/kiosk-mode-7b7iDbkP.js +33 -0
  60. package/dist/browser/{kiosk-record-CW_1KB9b.js → kiosk-record-UJxF1fjj.js} +1 -1
  61. package/dist/browser/kioskApi-CgpMBKhv.js +440 -0
  62. package/dist/browser/{lib-DM-z760g.js → lib-Czk5Lszd.js} +3 -3
  63. package/dist/browser/loadImage-CFo9-YJJ.js +17 -0
  64. package/dist/browser/{logDeviceInfo-Cn9Bhvpl.js → logDeviceInfo-DJjhYuqu.js} +9 -9
  65. package/dist/browser/{mobx-CtL28CVI.js → mobx-C81AIECP.js} +11 -11
  66. package/dist/browser/mobx.module-CWCYJWja.js +2064 -0
  67. package/dist/browser/{optional-boolean-editor-D9vSAE8_.js → optional-boolean-editor-B62ChR7X.js} +4 -4
  68. package/dist/browser/{optional-enum-editor-CGhySOL7.js → optional-enum-editor-BBO6A0hj.js} +5 -5
  69. package/dist/browser/{optional-string-editor-CZyRAOtc.js → optional-string-editor-7Q9UPGmg.js} +5 -5
  70. package/dist/browser/{particles.min-7s3EMxTb.js → particles.min-BKHVPr2d.js} +2 -2
  71. package/dist/browser/{react-Brm2MVUC.js → react-Cg2OORRh.js} +2 -2
  72. package/dist/browser/{react-dom-D9UnnQqq.js → react-dom-Ty-lfgLt.js} +3 -3
  73. package/dist/browser/{rolldown-runtime-B01qwuDw.js → rolldown-runtime-CWnoF_DQ.js} +1 -1
  74. package/dist/browser/scene-C5l_d13f.js +108 -0
  75. package/dist/browser/{scheduler-DZj4HovO.js → scheduler-BU0IIfqL.js} +2 -2
  76. package/dist/browser/{select-BC5N0CfJ.js → select-BzHMeDb4.js} +11 -11
  77. package/dist/browser/{settings-ChFxDoJk.js → settings-BtJgR42s.js} +2 -2
  78. package/dist/browser/{settings-item-DFO14ZCg.js → settings-item-DdFFETI3.js} +7 -7
  79. package/dist/browser/store-BTr1tlEV.js +58 -0
  80. package/dist/browser/{string-editor-C4gzTT4q.js → string-editor-BEEQ6kcc.js} +5 -5
  81. package/dist/browser/{text-field-61qAnXmd.js → text-field-DoMqPokj.js} +6 -6
  82. package/dist/browser/{theme-DSnFzQS0.js → theme-BvRXg3tc.js} +9 -9
  83. package/dist/browser/{ui-BFqga_Pg.js → ui-CjqBOwnM.js} +9 -9
  84. package/dist/browser/{useRenderTarget-BxS4Swp7.js → useRenderTarget-CaMfMKd3.js} +5 -5
  85. package/dist/browser/{viewport-CHeX03S_.js → viewport-D1DrneSN.js} +4 -3
  86. package/dist/browser/wayfinding-BFQ3ZTEN.js +2322 -0
  87. package/dist/esm/components/GalleryContainer.js +1 -1
  88. package/dist/esm/components/Kiosk/integrateKiosk.js +1 -1
  89. package/dist/esm/components/LogoOverlay.js +1 -1
  90. package/dist/esm/components/Map/Map.js +1 -1
  91. package/dist/esm/components/Map/MapCamera.js +1 -1
  92. package/dist/esm/components/Map/booth-by-xy.d.ts +8 -10
  93. package/dist/esm/components/Map/booth-by-xy.js +1 -1
  94. package/dist/esm/components/Map/drawing/config/BoothShape.d.ts +0 -1
  95. package/dist/esm/components/Map/drawing/config/BoothShape.js +1 -1
  96. package/dist/esm/components/Map/drawing/config/config-booth-bg.js +1 -1
  97. package/dist/esm/components/Map/drawing/config/config-booth-bookmark.js +1 -1
  98. package/dist/esm/components/Map/drawing/config/config-booth-border.js +1 -1
  99. package/dist/esm/components/Map/drawing/config/config-booth-labels-special.js +2 -2
  100. package/dist/esm/components/Map/drawing/config/config-booth-labels.js +1 -1
  101. package/dist/esm/components/Map/drawing/config/config-booths.js +1 -1
  102. package/dist/esm/components/Map/drawing/config/config-markers.js +1 -1
  103. package/dist/esm/components/Map/drawing/config/layer-images.d.ts +7 -2
  104. package/dist/esm/components/Map/drawing/config/layer-images.js +1 -1
  105. package/dist/esm/components/Map/traffic/useManageTraffic.js +1 -1
  106. package/dist/esm/components/Maplibre/MaplibreAdapter.js +1 -1
  107. package/dist/esm/components/Maplibre/useCameraReactions.js +1 -1
  108. package/dist/esm/components/Maplibre/utils/geo-config.js +1 -1
  109. package/dist/esm/components/Maplibre/utils/map-helpers.js +1 -1
  110. package/dist/esm/components/Menu.js +1 -1
  111. package/dist/esm/data/fpGeo.d.ts +6 -1
  112. package/dist/esm/data/fpGeo.js +1 -1
  113. package/dist/esm/data/index.d.ts +9 -4
  114. package/dist/esm/data/index.js +1 -1
  115. package/dist/esm/data/svg.d.ts +15 -13
  116. package/dist/esm/data/svg.js +1 -1
  117. package/dist/esm/floorplan.loader.d.ts +6 -1
  118. package/dist/esm/floorplan.loader.js +1 -1
  119. package/dist/esm/floorplan.ready.d.ts +8 -2
  120. package/dist/esm/floorplan.ready.js +1 -1
  121. package/dist/esm/load.js +11 -11
  122. package/dist/esm/plan-lifecycle.d.ts +65 -0
  123. package/dist/esm/plan-lifecycle.js +1 -0
  124. package/dist/esm/services/URLFilterManager.js +1 -1
  125. package/dist/esm/services/url-dispatch.js +1 -1
  126. package/dist/esm/services/url-sync.d.ts +5 -1
  127. package/dist/esm/services/url-sync.js +1 -1
  128. package/dist/esm/store/MaplibreStore.js +1 -1
  129. package/dist/esm/store/OverlayStore.d.ts +15 -2
  130. package/dist/esm/store/OverlayStore.js +1 -1
  131. package/dist/esm/store/RouteStore.js +1 -1
  132. package/dist/esm/store/UIState.js +1 -1
  133. package/dist/esm/store/create-live-plan.d.ts +13 -0
  134. package/dist/esm/store/create-live-plan.js +1 -0
  135. package/dist/esm/store/index.d.ts +2 -13
  136. package/dist/esm/store/index.js +1 -1
  137. package/dist/esm/store/init/init-booths.js +1 -1
  138. package/dist/esm/store/init/init-events.js +1 -1
  139. package/dist/esm/store/init/init-exhibitors.js +1 -1
  140. package/dist/esm/store/init/init-layers.js +1 -1
  141. package/dist/esm/store/init/init-speakers.js +1 -1
  142. package/dist/esm/store/init/init-ui.d.ts +4 -6
  143. package/dist/esm/store/init/init-ui.js +1 -1
  144. package/dist/esm/store/live-store.d.ts +19 -0
  145. package/dist/esm/store/live-store.js +1 -0
  146. package/dist/esm/store/search-buttons/SearchButtonsStore.js +1 -1
  147. package/dist/esm/tools/event-scoped-cache.d.ts +13 -0
  148. package/dist/esm/tools/event-scoped-cache.js +1 -0
  149. package/dist/esm/tools/gtag.d.ts +15 -1
  150. package/dist/esm/tools/gtag.js +1 -1
  151. package/dist/esm/tools/reset.js +1 -1
  152. package/dist/esm/tools/settings.d.ts +7 -2
  153. package/dist/esm/tools/settings.js +1 -1
  154. package/dist/esm/tools/slug.js +1 -1
  155. package/dist/esm/tools/style-registry.d.ts +28 -0
  156. package/dist/esm/tools/style-registry.js +1 -0
  157. package/dist/esm/tools/track-event.js +1 -1
  158. package/dist/esm/types.d.ts +7 -1
  159. package/dist/esm/utils/entity-storage.js +1 -1
  160. package/dist/esm/utils/gps.js +1 -1
  161. package/dist/esm/utils/plan-reactions.d.ts +20 -0
  162. package/dist/esm/utils/plan-reactions.js +1 -0
  163. package/dist/esm/utils/preview-exhibitor.d.ts +9 -2
  164. package/dist/esm/utils/preview-exhibitor.js +1 -1
  165. package/dist/esm/utils/swappable-proxy.d.ts +28 -0
  166. package/dist/esm/utils/swappable-proxy.js +1 -0
  167. package/dist/esm/wayfinding/createWayfinding.js +1 -1
  168. package/package.json +32 -10
  169. package/dist/browser/SetKioskMode-DE_MMA2F.js +0 -48
  170. package/dist/browser/integrateKiosk-DskxWOv7.js +0 -34
@@ -1,17 +1,19 @@
1
1
  import { Box } from '@expofp/geometry';
2
- import { Layer } from '../store/LayerStore';
3
- declare const svgViewBox: Box;
4
- declare let svgArea: Box;
5
- declare let svgAreaExplicit: boolean;
6
- declare let floors: {
7
- name: string | undefined;
2
+ import { type FpPath } from '@expofp/schema';
3
+ import { type Layer } from '../store/LayerStore.js';
4
+ /** One floor rectangle authored as a `[data-floor]` element in the drawing. */
5
+ interface SvgFloor {
6
+ name: string;
8
7
  rect: Box;
9
- }[];
10
- export { floors, svgArea, svgAreaExplicit, svgViewBox };
8
+ }
9
+ /** The Fit-to-screen reference rectangle of the live event's drawing. */
10
+ export declare function getSvgArea(): Box;
11
+ /** Whether {@link getSvgArea} was authored rather than derived from the viewBox. */
12
+ export declare function isSvgAreaExplicit(): boolean;
13
+ /** The live event's floor rectangles; empty when the plan has no layers mode. */
14
+ export declare function getFloors(): SvgFloor[];
11
15
  export declare function getTrianglesFromFpPaths(index: number, suffix: string): number[][][];
12
- export declare let gtePathByIndex: (index: number, suffix?: string) => {
13
- positions: [number, number, (number | undefined)?][];
14
- cells: [number, number, number][];
15
- };
16
- export declare let getLayerSvg: (layer?: Layer | string) => SVGElement;
16
+ export declare function gtePathByIndex(index: number, suffix?: string): FpPath;
17
+ export declare function getLayerSvg(layer?: Layer | string): SVGElement;
18
+ export {};
17
19
  //# sourceMappingURL=svg.d.ts.map
@@ -1 +1 @@
1
- import{Box as h}from"@expofp/geometry";import*as a from"d3-selection";import{STRING_META_DELIMITER as x}from"../constants";import M from"../tools/logger";import E from"../tools/settings";import{extractMetaFromString as b}from"../utils/extractMetaFromString";import _ from".";import{getFpPaths as A,getFpSvg as c,getFpSvgJs as P,getWfData as V}from"./fp-payloads";const n=new Map;function p(e,r=""){if(n.has(r))return n.get(r);const s=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;s.firstChild.tagName==="parsererror"&&M.error("Parsed svg with error: ",l);const i=new Map;return a.select(s).selectAll("style").each(function(){const t=this.textContent,S=/\.([a-z0-9.]+)\s*{[^}]*fill\s*:\s*([^};]+);[^}]*}/gi;let v;for(;(v=S.exec(t))!==null;){const B=v[1],F=v[2];i.set(B,F)}}),a.select(s).selectAll("*[class]").each(function(){const t=this;t.style.fill=i.get(t.className.baseVal)}),N(s),n.set(r,s),s}let l=p(c());const m=P().__viewbox,d=a.select(l).select("rect#VIEWBOX").node(),u=l.viewBox.baseVal,g=new h(u.x,u.y,u.width,u.height);let f,w=!1;m?(f=new h(m.x,m.y,m.width,m.height),w=!0,d?.remove()):d?(f=h.fromSvg(d),w=!0,d.remove()):f=g.scale(1.1),a.select(l).attr("width",g.size.width),a.select(l).attr("height",g.size.height),M.log("svgArea",f,"svgViewBox",g),E.wayfinding=!!(!_.hideDirections&&V());let I=P().__fpLayersMode?a.select(l).selectAll("[data-floor]").nodes().map(e=>(e.remove(),{name:e.dataset.floor,rect:h.fromSvg(e)})).sort():[];export{I as floors,f as svgArea,w as svgAreaExplicit,g as svgViewBox};export function getTrianglesFromFpPaths(e,r){const o=gtePathByIndex(e,r),s=o.positions.map(t=>[t[0],Math.abs(t[1])]),i=[];for(const t of o.cells)i.push([s[t[0]],s[t[1]],s[t[2]]]);return i}export let gtePathByIndex=(e,r="")=>(A(r)??A())[e],getLayerSvg=(e="")=>typeof e=="string"?n.has(e)?n.get(e):c(e)?p(c(e),e):n.get(""):e.rootParent?n.has(e.rootParent.name)?n.get(e.rootParent.name):c(e.rootParent.name)?p(c(e.rootParent.name),e.rootParent.name):n.get(""):c(e.name)?p(c(e.name),e.name):n.get("");function N(e){a.select(e).selectAll("[id], [data-name]").each(function(){const r=this;let o={};const s=r.getAttribute("data-name");if(s&&s.includes(x)){const{meta:t}=b(s);o={...o,...t}}const i=r.getAttribute("id");if(i&&i.includes(x)){const{meta:t}=b(i);o={...o,...t}}r.setAttribute("data-meta",JSON.stringify(o))})}
1
+ import{Box as l}from"@expofp/geometry";import*as c from"d3-selection";import{STRING_META_DELIMITER as h}from"../constants.js";import{eventScopedCache as A,eventScopedValue as M}from"../tools/event-scoped-cache.js";import p from"../tools/logger.js";import{extractMetaFromString as u}from"../utils/extractMetaFromString.js";import{getFpPaths as d,getFpSvg as v,getFpSvgJs as x}from"./fp-payloads.js";const m=A();function w(o,e=""){const t=m().get(e);if(t)return t;const s=new DOMParser().parseFromString(o,"image/svg+xml").documentElement;s.firstChild?.tagName==="parsererror"&&p.error("Parsed svg with error: ",s);const n=new Map;return c.select(s).selectAll("style").each(function(){const i=this.textContent??"",f=/\.([a-z0-9.]+)\s*{[^}]*fill\s*:\s*([^};]+);[^}]*}/gi;let a;for(;(a=f.exec(i))!==null;){const S=a[1],b=a[2];n.set(S,b)}}),c.select(s).selectAll("*[class]").each(function(){const i=n.get(this.className.baseVal);i!==void 0&&(this.style.fill=i)}),F(s),m().set(e,s),s}function E(){const o=w(v()??""),e=x().__viewbox,t=c.select(o).select("rect#VIEWBOX").node(),r=o.viewBox.baseVal,s=new l(r.x,r.y,r.width,r.height);let n,i=!1;e?(n=new l(e.x,e.y,e.width,e.height),i=!0,t?.remove()):t?(n=l.fromSvg(t),i=!0,t.remove()):n=s.scale(1.1),c.select(o).attr("width",s.size.width),c.select(o).attr("height",s.size.height),p.log("svgArea",n,"svgViewBox",s);const f=x().__fpLayersMode?c.select(o).selectAll("[data-floor]").nodes().map(a=>(a.remove(),{name:a.dataset.floor??"",rect:l.fromSvg(a)})).sort():[];return{area:n,areaExplicit:i,floors:f}}const g=M(E);export function getSvgArea(){return g().area}export function isSvgAreaExplicit(){return g().areaExplicit}export function getFloors(){return g().floors}export function getTrianglesFromFpPaths(o,e){const t=gtePathByIndex(o,e),r=t.positions.map(n=>[n[0],Math.abs(n[1])]),s=[];for(const n of t.cells)s.push([r[n[0]],r[n[1]],r[n[2]]]);return s}export function gtePathByIndex(o,e=""){const t=d(e)??d();if(!t)throw new Error(`No meshes for layer "${e}"`);return t[o]}export function getLayerSvg(o=""){g();const e=typeof o=="string"?o:o.rootParent?.name??o.name,t=m().get(e);if(t)return t;const r=v(e);return r?w(r,e):m().get("")}function F(o){c.select(o).selectAll("[id], [data-name]").each(function(){let e={};const t=this.getAttribute("data-name");if(t&&t.includes(h)){const{meta:s}=u(t);e={...e,...s}}const r=this.getAttribute("id");if(r&&r.includes(h)){const{meta:s}=u(r);e={...e,...s}}this.setAttribute("data-meta",JSON.stringify(e))})}
@@ -106,10 +106,15 @@ export default class FloorPlanLoader implements FloorPlan {
106
106
  convertToGeo(x: number, y: number): any;
107
107
  getGeoConfig(): GeoConfig | null;
108
108
  /**
109
+ * Ends the live plan: dispose only — nothing is rebuilt here, because the
110
+ * config singleton still holds the dying event (ADR-0011). The next `load()`
111
+ * constructs the fresh world.
112
+ *
109
113
  * Raises the `destroyed` flag — which the pending `init()` checks before it
110
114
  * mounts anything — settles {@link ready}, then hands the state-specific
111
115
  * teardown to {@link releaseResources}. The guard lives here so both states
112
- * are idempotent through one implementation.
116
+ * are idempotent through one implementation, and a host may call it
117
+ * defensively from a framework unmount hook.
113
118
  */
114
119
  destroy(): void;
115
120
  /** @deprecated Renamed to {@link destroy}. */
@@ -1 +1 @@
1
- import{getConfig as C}from"@expofp/config";import{PREVIEW_MODE_ATTRIBUTE as F}from"./constants";import{toInternalSettings as M}from"./internal-settings.js";import d from"./tools/base-runtime-url";import{loadCss as P,loadFont as p}from"./tools/loaders";import S from"./tools/logger";import{resetGlobalVariables as T}from"./tools/reset";import{initSentry as A}from"./tools/sentry";import{heatmapEnabled as V}from"./utils/heatmap-enabled";import{initI18n as H}from"./utils/i18n";import z from"./utils/is-debug";import G from"./utils/is-localhost";import x from"./utils/is-webview";import{loadCustomCss as N}from"./utils/loadCustomCss";import{loadIcons as Y}from"./utils/loadIcons";import v from"./utils/use-shadow";function e(){throw new Error("FloorPlan not ready")}export const DESTROYED_BEFORE_READY="FloorPlan destroyed before it finished loading";export default class Q{get ready(){return this._ready}get previewMode(){return C().previewMode||this.element.hasAttribute(F)}get allowConsent(){return this.consent==="ask"?void 0:this.consent==="granted"}getInternalSettings(){return M(C())}selectBooth(t){e()}selectExhibitor(t){e()}selectRoute(t,s){e()}getOptimizedRoutes(t){e()}selectCurrentPosition(t,s,a){e()}setBookmarks(t){e()}setEntitiesBookmarks(t){e()}setEntitiesVisited(t){e()}setMarkers(t){e()}updateLayerVisibility(t,s){e()}getCenterCoordinates(){e()}applyParameters(t){e()}exhibitorsList(){e()}boothsList(){e()}categoriesList(){e()}selectCategory(t){e()}select(t){e()}showList(t){e()}selectTour(t){e()}openPlanner(t){e()}startBuildRoute(){e()}getVisibility(){e()}setVisibility(t){e()}findLocation(){e()}zoomIn(){e()}zoomOut(){e()}zoomTo(t,s){e()}switchView(){e()}setCamera(t){e()}getCamera(){e()}fitBounds(){e()}getBounds(t){e()}getBoothRect(t){e()}convertToGeo(t,s){e()}getGeoConfig(){e()}destroy(){this.destroyed||(this.destroyed=!0,this.rejectReady(new Error(DESTROYED_BEFORE_READY)),this.releaseResources())}unstable_destroy(){this.destroy()}releaseResources(){for(window.removeEventListener("__efpStyleLoad",this.efpStyleLoadHandler);this.element.firstChild;)this.element.removeChild(this.element.firstChild);delete this.element.__expofp,T()}highlightExhibitors(t){e()}highlightBooths(t){e()}onCurrentPositionChanged(t){e()}search(t){e()}getFloors(){e()}onFloorActivated(t){e()}activateFloor(t){e()}showPathway(t,s){e()}showPathwayOnly(t,s){e()}hidePathways(){e()}showSearch(){e()}changeLanguage(t){e()}isGpsTrackingEnabled(){e()}setGpsTrackingEnabled(t){e()}deselectCurrentPosition(){e()}deselectRoute(){e()}reset(){e()}selectAccessibleRoute(t){e()}constructor(t,s){this.resolveReady=()=>{},this.rejectReady=()=>{},this.icons=new Map,this.enableRotation=!0,this.alwaysShowSidebar=!1,this.destroyed=!1;const a=C();this.noOverlay=!!a.noOverlay,this.offHistory=!!a.offHistory,this.ignoreQuery=a.ignoreQuery,this.consent=a.consent,this.consent==="ask"&&(x?this.consent="granted":G&&!z&&(this.consent="denied")),this.onBoothClick=t.onBoothClick,this.onBookmarkClick=t.onBookmarkClick,this.onVisitedClick=t.onVisitedClick,this.onCategoryClick=t.onCategoryClick,this.onDetails=t.onDetails,this.onExhibitorCustomButtonClick=t.onExhibitorCustomButtonClick,this.onGetCoordsClick=t.onGetCoordsClick,this.onMarkerClick=t.onMarkerClick,this.onFpConfigured=t.onFpConfigured,this.onDirection=t.onDirection,this.onInit=t.onInit,this.onCurrentPositionChanged=t.onCurrentPositionChanged,this.onFloorActivated=t.onFloorActivated,this.onLeaveEvent=t.onLeaveEvent,this.viewerMode=!!a.viewerMode,this.disableRuntimeAlerts=a.disableRuntimeAlerts,this.maplibre=a.maplibre,window.__efpMaplibre=a.maplibre,this._ready=new Promise((c,i)=>{this.resolveReady=c,this.rejectReady=i}),this._ready.catch(()=>{}),this.element=s;const I=s;if(I.__expofp)throw new Error("Element already in use");I.__expofp=this;const g=a.expo;A({eventId:g||"",isWebview:x}),this.eventId=g,window.__efpEvent=g,window.__efpElement=s;const w=document.createElement("div");w.style.height="100%",w.style.width="100%",s.appendChild(w);let n;if(v){n=w.attachShadow({mode:"open"});const c=n,i=document;c.createElement=(...r)=>i.createElement(...r),c.createElementNS=(...r)=>i.createElementNS(...r),c.createTextNode=(...r)=>i.createTextNode(...r)}else n=w;const y=document.createElement("div");y.style.height="100%",y.style.width="100%",n.appendChild(y),v&&Object.defineProperty(y,"ownerDocument",{value:n}),window.__efpShadowDOMStyleParent=v?n:void 0,this.renderTarget=y,S.log("Instantiating ExpoFP floorplan",s,g);let k=0;this.efpStyleLoadHandler=function(c){const i=window.__efpStyleElements??[];for(;k<i.length;){const r=i[k];n.appendChild(r),k++}},window.addEventListener("__efpStyleLoad",this.efpStyleLoadHandler),this.efpStyleLoadHandler();const h=this;(async function(){const i=C();if(await H(),h.destroyed)return;const r=new URLSearchParams(window.location.search);let m,f;if(i?.trackerUrl)try{m=new URL(i.trackerUrl),f=m.searchParams.get("expoId")}catch(o){console.error(o)}const R=async o=>{if(!m||!f)return Promise.reject(new Error("trackerUrl or expoId is missing"));const l=new URL(o.dataUrl,m.origin),u=await fetch(l.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expoId:f,token:decodeURIComponent(r.get("t")??"")})});let b=[];u.ok&&(b=(await u.json()).map(o.dataMapper)),window.__heatmapDataYah={yah:b}},E=i?.heatmap??{},L=V(E)||r.get("heatmap")==="true",O=E.variant==="yah"||r.get("type")==="yah",U=E.kiosk===!0||r.get("subtype")==="kiosk";if(L)try{if(O)U?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,l)=>({...o,name:`QR Code #${l+1}`})});else{if(!m||!f)throw new Error("trackerUrl or expoId is missing");const o=new URL("/api/fp-stats/get",m.origin);o.searchParams.set("expoId",f),o.searchParams.set("type","booview"),o.searchParams.set("t",decodeURIComponent(r.get("t")??""));const l=new URL("api/fp-stats/get",m.origin);l.searchParams.set("expoId",f),l.searchParams.set("type","exview"),l.searchParams.set("t",decodeURIComponent(r.get("t")??""));const[u,b]=await Promise.all([fetch(o.toString()),fetch(l.toString())]),[_,j]=await Promise.all([u.json(),b.json()]);window.__heatmapData={booths:_,exhibitors:j}}}catch(o){console.error("Heatmap: Initialization error",o)}const B=[P(d+"vendor/sanitize-css/sanitize.css",n),P(d+"vendor/perfect-scrollbar/css/perfect-scrollbar.css",n),p("Oswald",d+"fonts/oswald-v17-cyrillic_latin-300.woff",{weight:300}),p("Oswald",d+"fonts/oswald-v17-cyrillic_latin-500.woff",{weight:500}),p("Inter",d+"fonts/inter-400.woff2",{weight:400}),p("Inter",d+"fonts/inter-500.woff2",{weight:500}),p("Inter",d+"fonts/inter-600.woff2",{weight:600}),p("efp-symbols",d+"fonts/efp-symbols.woff",{weight:400}),N(i,n),Y(h.icons)];if(await Promise.all(B),h.destroyed)return;h.enableRotation=i?.enableRotation??!1,h.alwaysShowSidebar=i?.alwaysShowSidebar??!1,S.log("Data loaded"),window.__storeInitAllowed=!0;const{default:D}=await import("./floorplan.ready");if(h.destroyed)return;Object.setPrototypeOf(h,D.prototype).init()})()}}
1
+ import{getConfig as C}from"@expofp/config";import{PREVIEW_MODE_ATTRIBUTE as M}from"./constants";import{toInternalSettings as T}from"./internal-settings.js";import{disposePlan as A}from"./plan-lifecycle.js";import d from"./tools/base-runtime-url";import{loadCss as S,loadFont as p}from"./tools/loaders";import _ from"./tools/logger";import{resetGlobalVariables as V}from"./tools/reset";import{initSentry as H}from"./tools/sentry";import{parkRegisteredStyles as z}from"./tools/style-registry.js";import{heatmapEnabled as G}from"./utils/heatmap-enabled";import{initI18n as N}from"./utils/i18n";import Y from"./utils/is-debug";import Q from"./utils/is-localhost";import x from"./utils/is-webview";import{loadCustomCss as W}from"./utils/loadCustomCss";import{loadIcons as K}from"./utils/loadIcons";import E from"./utils/use-shadow";function e(){throw new Error("FloorPlan not ready")}export const DESTROYED_BEFORE_READY="FloorPlan destroyed before it finished loading";export default class ${get ready(){return this._ready}get previewMode(){return C().previewMode||this.element.hasAttribute(M)}get allowConsent(){return this.consent==="ask"?void 0:this.consent==="granted"}getInternalSettings(){return T(C())}selectBooth(t){e()}selectExhibitor(t){e()}selectRoute(t,s){e()}getOptimizedRoutes(t){e()}selectCurrentPosition(t,s,a){e()}setBookmarks(t){e()}setEntitiesBookmarks(t){e()}setEntitiesVisited(t){e()}setMarkers(t){e()}updateLayerVisibility(t,s){e()}getCenterCoordinates(){e()}applyParameters(t){e()}exhibitorsList(){e()}boothsList(){e()}categoriesList(){e()}selectCategory(t){e()}select(t){e()}showList(t){e()}selectTour(t){e()}openPlanner(t){e()}startBuildRoute(){e()}getVisibility(){e()}setVisibility(t){e()}findLocation(){e()}zoomIn(){e()}zoomOut(){e()}zoomTo(t,s){e()}switchView(){e()}setCamera(t){e()}getCamera(){e()}fitBounds(){e()}getBounds(t){e()}getBoothRect(t){e()}convertToGeo(t,s){e()}getGeoConfig(){e()}destroy(){if(!this.destroyed){this.destroyed=!0,this.rejectReady(new Error(DESTROYED_BEFORE_READY));try{this.releaseResources()}finally{A()}}}unstable_destroy(){this.destroy()}releaseResources(){for(window.removeEventListener("__efpStyleLoad",this.efpStyleLoadHandler),z();this.element.firstChild;)this.element.removeChild(this.element.firstChild);delete this.element.__expofp,V()}highlightExhibitors(t){e()}highlightBooths(t){e()}onCurrentPositionChanged(t){e()}search(t){e()}getFloors(){e()}onFloorActivated(t){e()}activateFloor(t){e()}showPathway(t,s){e()}showPathwayOnly(t,s){e()}hidePathways(){e()}showSearch(){e()}changeLanguage(t){e()}isGpsTrackingEnabled(){e()}setGpsTrackingEnabled(t){e()}deselectCurrentPosition(){e()}deselectRoute(){e()}reset(){e()}selectAccessibleRoute(t){e()}constructor(t,s){this.resolveReady=()=>{},this.rejectReady=()=>{},this.icons=new Map,this.enableRotation=!0,this.alwaysShowSidebar=!1,this.destroyed=!1;const a=C();this.noOverlay=!!a.noOverlay,this.offHistory=!!a.offHistory,this.ignoreQuery=a.ignoreQuery,this.consent=a.consent,this.consent==="ask"&&(x?this.consent="granted":Q&&!Y&&(this.consent="denied")),this.onBoothClick=t.onBoothClick,this.onBookmarkClick=t.onBookmarkClick,this.onVisitedClick=t.onVisitedClick,this.onCategoryClick=t.onCategoryClick,this.onDetails=t.onDetails,this.onExhibitorCustomButtonClick=t.onExhibitorCustomButtonClick,this.onGetCoordsClick=t.onGetCoordsClick,this.onMarkerClick=t.onMarkerClick,this.onFpConfigured=t.onFpConfigured,this.onDirection=t.onDirection,this.onInit=t.onInit,this.onCurrentPositionChanged=t.onCurrentPositionChanged,this.onFloorActivated=t.onFloorActivated,this.onLeaveEvent=t.onLeaveEvent,this.viewerMode=!!a.viewerMode,this.disableRuntimeAlerts=a.disableRuntimeAlerts,this.maplibre=a.maplibre,window.__efpMaplibre=a.maplibre,this._ready=new Promise((h,i)=>{this.resolveReady=h,this.rejectReady=i}),this._ready.catch(()=>{}),this.element=s;const R=s;if(R.__expofp)throw new Error("Element already in use");R.__expofp=this;const g=a.expo;H({eventId:g||"",isWebview:x}),this.eventId=g,window.__efpEvent=g,window.__efpElement=s;const w=document.createElement("div");w.style.height="100%",w.style.width="100%",s.appendChild(w);let n;if(E){n=w.attachShadow({mode:"open"});const h=n,i=document;h.createElement=(...r)=>i.createElement(...r),h.createElementNS=(...r)=>i.createElementNS(...r),h.createTextNode=(...r)=>i.createTextNode(...r)}else n=w;const y=document.createElement("div");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,_.log("Instantiating ExpoFP floorplan",s,g);let k=0;this.efpStyleLoadHandler=function(h){const i=window.__efpStyleElements??[];for(;k<i.length;){const r=i[k];n.appendChild(r),k++}},window.addEventListener("__efpStyleLoad",this.efpStyleLoadHandler),this.efpStyleLoadHandler();const c=this;(async function(){const i=C();if(await N(),c.destroyed)return;const r=new URLSearchParams(window.location.search);let m,f;if(i?.trackerUrl)try{m=new URL(i.trackerUrl),f=m.searchParams.get("expoId")}catch(o){console.error(o)}const I=async o=>{if(!m||!f)return Promise.reject(new Error("trackerUrl or expoId is missing"));const l=new URL(o.dataUrl,m.origin),u=await fetch(l.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expoId:f,token:decodeURIComponent(r.get("t")??"")})});let b=[];u.ok&&(b=(await u.json()).map(o.dataMapper)),window.__heatmapDataYah={yah:b}},v=i?.heatmap??{},L=G(v)||r.get("heatmap")==="true",O=v.variant==="yah"||r.get("type")==="yah",U=v.kiosk===!0||r.get("subtype")==="kiosk";if(L)try{if(O)U?await I({dataUrl:"/api/kiosks/list/viewer",dataMapper:o=>({...o,id:o.key,name:`Kiosk ${o.key}`})}):await I({dataUrl:"/api/v1/you-are-here/qr-code/list/viewer",dataMapper:(o,l)=>({...o,name:`QR Code #${l+1}`})});else{if(!m||!f)throw new Error("trackerUrl or expoId is missing");const o=new URL("/api/fp-stats/get",m.origin);o.searchParams.set("expoId",f),o.searchParams.set("type","booview"),o.searchParams.set("t",decodeURIComponent(r.get("t")??""));const l=new URL("api/fp-stats/get",m.origin);l.searchParams.set("expoId",f),l.searchParams.set("type","exview"),l.searchParams.set("t",decodeURIComponent(r.get("t")??""));const[u,b]=await Promise.all([fetch(o.toString()),fetch(l.toString())]),[P,F]=await Promise.all([u.json(),b.json()]);window.__heatmapData={booths:P,exhibitors:F}}}catch(o){console.error("Heatmap: Initialization error",o)}const B=[S(d+"vendor/sanitize-css/sanitize.css",n),S(d+"vendor/perfect-scrollbar/css/perfect-scrollbar.css",n),p("Oswald",d+"fonts/oswald-v17-cyrillic_latin-300.woff",{weight:300}),p("Oswald",d+"fonts/oswald-v17-cyrillic_latin-500.woff",{weight:500}),p("Inter",d+"fonts/inter-400.woff2",{weight:400}),p("Inter",d+"fonts/inter-500.woff2",{weight:500}),p("Inter",d+"fonts/inter-600.woff2",{weight:600}),p("efp-symbols",d+"fonts/efp-symbols.woff",{weight:400}),W(i,n),K(c.icons)];if(await Promise.all(B),c.destroyed)return;c.enableRotation=i?.enableRotation??!1,c.alwaysShowSidebar=i?.alwaysShowSidebar??!1,_.log("Data loaded");const{createLivePlan:D}=await import("./store/create-live-plan.js"),{default:j}=await import("./floorplan.ready.js");if(c.destroyed)return;D(),Object.setPrototypeOf(c,j.prototype).init()})()}}
@@ -8,8 +8,6 @@ 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?;
13
11
  protected init(): void;
14
12
  selectBooth(nameOrExternalId: string | string[]): void;
15
13
  selectExhibitor(nameOrExternalId: string | string[]): void;
@@ -75,6 +73,14 @@ export default class FloorPlanReady extends FloorPlanLoader {
75
73
  getBoothRect(name: string): BoothRect;
76
74
  convertToGeo(x: number, y: number): [number, number] | never;
77
75
  getGeoConfig(): GeoConfig | null;
76
+ /**
77
+ * What this instance owns of the teardown — its React root and the store's
78
+ * window listeners — run by `FloorPlanLoader.destroy()` while the store
79
+ * barrel is still live. Everything the plan's services own (URL sync, UI
80
+ * handlers, GA, telemetry, reactions, timers) registered itself with the
81
+ * plan when it started, and `disposePlan()` — and with it the dead window —
82
+ * follows this.
83
+ */
78
84
  protected releaseResources(): void;
79
85
  search(term: string): Promise<{
80
86
  item: unknown;
@@ -1 +1 @@
1
- import{Fragment as T,jsx as x,jsxs as A}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 q from"./data";import{fpGeo as b}from"./data/fpGeo";import D from"./floorplan.loader";import{shouldLoadIntercom as H}from"./intercom";import{BoundsSchema as O,POISelectorsSchema as w,ZoomToOptionsSchema as P}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 v,separateExternalIds as B}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 oe}from"./tools/track-event";import{cameraToMapSettings as ie,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 le,setLocale as ce}from"./utils/i18n";import{mapEntity as g}from"./utils/mapEntity";const p=$("efp:api");j();export default class ue extends D{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,()=>{const t=this.renderTarget.getRootNode(),o=t instanceof ShadowRoot?t.host:this.renderTarget.parentElement;for(document.querySelectorAll(".expofp-floorplan-loader").forEach(s=>s.remove());o&&this.element.firstChild&&this.element.firstChild!==o;)this.element.removeChild(this.element.firstChild);this.resolveReady(),r.initialized||this.onInit?.(this),r.initialized=!0});const e=H(q);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(n=>typeof e=="string"?n.name===e||n.externalId===e:e.includes(n.name)||e.includes(n.externalId));if(!t?.length)return;if(typeof e=="string"){r.selectExhibitor(t[0]),r.moveToList([t[0]]);return}const o=t.flatMap(n=>n.booths.map(i=>i.layer)),s=ne(o.map(n=>n.description));s&&r.layerStore.updateVisibility(s,!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(n=>n.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}=B(e);r.boothStore.highlightedByExternalIds=[...t],r.exhibitorStore.highlightedByExternalIds=[...o]}selectRoute(e,t){if(Array.isArray(e)){let o=[...e];const s=o.shift(),n=o.pop();if(o.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);if(!s||!n){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 v(m(s),m(n),o.map(m)));return}e||a("selectRoute","At a minimum, the starting point must be passed.","EFP000402"),r.routeStore.selectRoute(new v(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(s=>!!s);if(!t.length)throw new Error("No booths found for the provided waypoints.");const o=new Map;for(const s of t){const n=s.layer?.name??"",i=o.get(n);i?i.push(s):o.set(n,[s])}return Array.from(o.values()).map(s=>({waypoints:M(s.map(n=>[n.name,{x:n.rect.center.x,y:n.rect.center.y}]))}))}selectCurrentPosition(e,t,o){const s=y(e.x)&&y(e.y),n=y(e.lng)&&y(e.lat);!s&&!n&&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(s=>s.name===t.name||s.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 s=C("bookmarked"),n={exhibitor:{existingIds:new Set(s.exhibitors||[]),finder:i=>r.exhibitorStore.findExhibitor(i),replacer:i=>r.exhibitorStore.replaceBookmarked(i)},event:{existingIds:new Set(s.events||[]),finder:i=>r.eventStore.findByNameOrSlug(i),replacer:i=>r.eventStore.replaceBookmarked(i)},speaker:{existingIds:new Set(s.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(s.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=n[i.type],u=i.name||i.externalId||"",l=h.finder(u);l?i.bookmarked?h.existingIds.add(l.id):h.existingIds.delete(l.id):console.warn(`Entity not found: ${i.type} with query "${u}"`)}),Object.values(n).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 s=C("visited"),n={exhibitor:{existingIds:new Set(s.exhibitors||[]),finder:i=>r.exhibitorStore.findExhibitor(i),replacer:i=>r.exhibitorStore.replaceVisited(i)},event:{existingIds:new Set(s.events||[]),finder:i=>r.eventStore.findByNameOrSlug(i),replacer:i=>r.eventStore.replaceVisited(i)}};e.forEach(i=>{const h=n[i.type],u=i.name||i.externalId||"",l=h.finder(u);l?i.visited?h.existingIds.add(l.id):h.existingIds.delete(l.id):console.warn(`Entity not found: ${i.type} with query "${u}"`)}),Object.values(n).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:s,slug:n})=>s?.toLowerCase()===t||n?.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(),s=r.boothStore.booths.find(l=>l.slug?.toLowerCase()===o||l.externalId?.toLowerCase()===o||l.externalId?.toLowerCase()?.replace(/\s+/g,"")===o);if(s){setTimeout(()=>r.selectBooth(s),250);return}const n=r.eventStore.eventItems.find(l=>l.slug?.toLowerCase()===o||l.externalId?.toLowerCase()===o);if(n){r.selectEventItem(n,!0);return}const i=r.exhibitorStore.exhibitors.find(l=>l.slug?.toLowerCase()===o||l.externalId?.toLowerCase()===o);if(i){setTimeout(()=>r.clickExhibitor(i),250);return}const h=r.categoryStore.categories.find(l=>l.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"),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(ie(t.data))}getCamera(){return se(r.uiState.mapSettings)}zoomTo(e,t){p("zoomTo called with selectors=%O options=%O",e,t);const o=w.safeParse(e);if(!o.success){a("zoomTo",o.error.message,"EFP001600");return}const s=P.safeParse(t);if(!s.success){a("zoomTo",s.error.message,"EFP001601");return}const n=this.getBounds(e);n&&this.fitBounds(n,t)}getBounds(e){p("getBounds called with selectors=%O",e);const t=w.safeParse(e);if(!t.success){a("getBounds",t.error.message,"EFP001400");return}const o=[];if(e.booths?.forEach(n=>{let i;n.externalId?i=r.boothStore.boothByExternalId.get(n.externalId):n.name&&(i=r.boothStore.boothByName.get(n.name.toLowerCase())),i?.rect&&o.push(i.rect)}),e.exhibitors?.forEach(n=>{let i;n.externalId?i=r.exhibitorStore.exhibitorByExternalId.get(n.externalId):n.name&&(i=r.exhibitorStore.exhibitorByName.get(n.name.toLowerCase())),i?.booths?.forEach(h=>{h.rect&&o.push(h.rect)})}),o.length===0)return;const s=E.fromUnion(...o);return{leftTop:{x:s.min.x,y:s.min.y},rightBottom:{x:s.max.x,y:s.max.y}}}fitBounds(e,t){if(p("fitBounds called with bounds=%O options=%O",e,t),!e){r.uiState.fitBounds();return}const o=O.safeParse(e);if(!o.success){a("fitBounds",o.error.message,"EFP001500");return}const s=P.safeParse(t);if(!s.success){a("fitBounds",s.error.message,"EFP001501");return}const n=E.fromMinMax({x:e.leftTop.x,y:e.leftTop.y},{x:e.rightBottom.x,y:e.rightBottom.y});r.uiState.moveToRect=t?.padding?n.expand(t.padding):n}getBoothRect(e){typeof e!="string"&&a("getBoothRect","A booth name must be passed.","EFP000F00");const t=S(e)?.rect;return t?c.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(),_(),oe(),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(s=>s.name===e.name||s.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(n=>n.index===e.index),s=o?.name;if(!s){a("activateFloor",`Floor at index ${e.index} does not exist.`,"EFP001203");return}if(o.active)return;this.updateLayerVisibility(s,!0);return}}showPathway(e,t){const{boothExternalIds:o,exhibitorExternalIds:s}=t?.length?B(t):{boothExternalIds:[],exhibitorExternalIds:[]};W({pathwayId:e,boothIds:o,exhibitorIds:s})}showPathwayOnly(e,t){this.activateFloor({name:t}),r.layerStore.showPathWay(e),r.uiState.setPathwayOnlyMode(!0);const o=r.layerStore.findLayer(e),s=r.layerStore.findLayer(t),n=o?.rect||o?.viewbox?o:s;if(n?.rect||n?.viewbox){const i=n.viewbox??n.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(!le(t)){a("changeLanguage",`Language "${e}" was not found. Available languages: ${he().map(o=>o.id).join(",")}`,"EFP001300");return}ce(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.`,s=`${e.endsWith(".")?e:e+"."} More information at`;let n="https://js-sdk.expofp.com/api/packages";if(t&&(n+=`#error-${t}`),console.error(`${o} ${s} ${n}`),r.fp.disableRuntimeAlerts)return;r.uiState.setGlobalErrorMessage({title:o,body:A(T,{children:[s," ",x("a",{href:n,target:"_blank",rel:"noreferrer",children:n})]})}),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 c{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,s){if(e>o){const n=e;e=o,o=n}if(t>s){const n=t;t=s,s=n}this.x1=e,this.y1=t,this.x2=o,this.y2=s}static fromBox(e){return new c(e.min.x,e.min.y,e.max.x,e.max.y)}static fromCxcywh(e,t,o,s){return new c(e-o/2,t-s/2,e+o/2,t+s/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),s=Math.max(this.y1,e.y1),n=Math.min(this.y2,e.y2);return o>=t&&n>=s}getIntersection(e){const t=Math.max(this.x1,e.x1),o=Math.min(this.x2,e.x2),s=Math.max(this.y1,e.y1),n=Math.min(this.y2,e.y2);return o>=t&&n>=s?new c(t,s,o,n):new c(0,0,0,0)}getRotated90(){return c.fromCxcywh(this.cx,this.cy,this.h,this.w)}normalize(e,t){return new c(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:c.fromCxcywh(this.cx,this.cy,this.w-e*2,this.h-t*2)}scale(e){return new c(this.x1*e,this.y1*e,this.x2*e,this.y2*e)}getArea(){return this.w*this.h}clone(){return new c(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 T,jsx as x,jsxs as I}from"react/jsx-runtime";import{Box as P}from"@expofp/geometry";import{CameraSchema as M}from"@expofp/schema";import{optimizeWaypointOrder as R}from"@expofp/wayfinding";import{ErrorBoundary as $}from"@sentry/react";import V from"debug";import{reaction as z}from"mobx";import{createRoot as j}from"react-dom/client";import{install as G}from"resize-observer";import N from"./components/Layout";import{bindBoothHitTest as q}from"./components/Map/booth-by-xy.js";import{MAX_ROUTE_WAYPOINTS as d}from"./constants";import O from"./data";import{getFpGeo as w}from"./data/fpGeo.js";import D from"./floorplan.loader";import{shouldLoadIntercom as Y}from"./intercom";import{registerPlanDisposer as b}from"./plan-lifecycle.js";import{BoundsSchema as H,POISelectorsSchema as B,ZoomToOptionsSchema as k}from"./schemas/sdk.schemas";import{applyDeclarativeConfig as U,applyParameters as W,applyPathway as X,initUrlRouting as K}from"./services/url-dispatch";import r from"./store";import{bindDetailsEvents as Q}from"./store/details-events";import{bindRootElement as Z}from"./store/init/init-ui.js";import{findBooth as S,Route as v,separateExternalIds as F}from"./store/RouteStore";import{GaEventActions as C,initGtag as J,sendEventToGa as A,setConsentSettings as _}from"./tools/gtag.js";import ee from"./tools/track-event.js";import{cameraToMapSettings as te,mapSettingsToCamera as re}from"./utils/camera-map-settings";import{getStorage as L}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=V("efp:api");G();export default class he extends D{init(){J(),U(),this.ignoreQuery||K(this.offHistory),ee("load"),Z(r),r.fp=this,b(Q()),q(),_(this.consent),A(C.Load,""),this.root=j(this.renderTarget),this.root.render(x($,{children:x(N,{offHistory:this.offHistory,consent:this.consent})})),A(C.Rendered,""),b(z(()=>r.layerStore.layersLoaded,()=>{const t=this.renderTarget.getRootNode(),o=t instanceof ShadowRoot?t.host:this.renderTarget.parentElement;for(document.querySelectorAll(".expofp-floorplan-loader").forEach(s=>s.remove());o&&this.element.firstChild&&this.element.firstChild!==o;)this.element.removeChild(this.element.firstChild);this.resolveReady(),r.initialized||this.onInit?.(this),r.initialized=!0})),b(()=>clearTimeout(E));const e=Y(O);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(n=>typeof e=="string"?n.name===e||n.externalId===e:e.includes(n.name)||e.includes(n.externalId));if(!t?.length)return;if(typeof e=="string"){r.selectExhibitor(t[0]),r.moveToList([t[0]]);return}const o=t.flatMap(n=>n.booths.map(i=>i.layer)),s=oe(o.map(n=>n.description));s&&r.layerStore.updateVisibility(s,!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(n=>n.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}=F(e);r.boothStore.highlightedByExternalIds=[...t],r.exhibitorStore.highlightedByExternalIds=[...o]}selectRoute(e,t){if(Array.isArray(e)){let o=[...e];const s=o.shift(),n=o.pop();if(o.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);if(!s||!n){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 v(m(s),m(n),o.map(m)));return}e||a("selectRoute","At a minimum, the starting point must be passed.","EFP000402"),r.routeStore.selectRoute(new v(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(s=>!!s);if(!t.length)throw new Error("No booths found for the provided waypoints.");const o=new Map;for(const s of t){const n=s.layer?.name??"",i=o.get(n);i?i.push(s):o.set(n,[s])}return Array.from(o.values()).map(s=>({waypoints:R(s.map(n=>[n.name,{x:n.rect.center.x,y:n.rect.center.y}]))}))}selectCurrentPosition(e,t,o){const s=y(e.x)&&y(e.y),n=y(e.lng)&&y(e.lat);!s&&!n&&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(s=>s.name===t.name||s.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 s=L("bookmarked"),n={exhibitor:{existingIds:new Set(s.exhibitors||[]),finder:i=>r.exhibitorStore.findExhibitor(i),replacer:i=>r.exhibitorStore.replaceBookmarked(i)},event:{existingIds:new Set(s.events||[]),finder:i=>r.eventStore.findByNameOrSlug(i),replacer:i=>r.eventStore.replaceBookmarked(i)},speaker:{existingIds:new Set(s.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(s.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=n[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(n).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 s=L("visited"),n={exhibitor:{existingIds:new Set(s.exhibitors||[]),finder:i=>r.exhibitorStore.findExhibitor(i),replacer:i=>r.exhibitorStore.replaceVisited(i)},event:{existingIds:new Set(s.events||[]),finder:i=>r.eventStore.findByNameOrSlug(i),replacer:i=>r.eventStore.replaceVisited(i)}};e.forEach(i=>{const h=n[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(n).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:s,slug:n})=>s?.toLowerCase()===t||n?.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(),s=r.boothStore.booths.find(c=>c.slug?.toLowerCase()===o||c.externalId?.toLowerCase()===o||c.externalId?.toLowerCase()?.replace(/\s+/g,"")===o);if(s){setTimeout(()=>r.selectBooth(s),250);return}const n=r.eventStore.eventItems.find(c=>c.slug?.toLowerCase()===o||c.externalId?.toLowerCase()===o);if(n){r.selectEventItem(n,!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"),W(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=M.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=B.safeParse(e);if(!o.success){a("zoomTo",o.error.message,"EFP001600");return}const s=k.safeParse(t);if(!s.success){a("zoomTo",s.error.message,"EFP001601");return}const n=this.getBounds(e);n&&this.fitBounds(n,t)}getBounds(e){p("getBounds called with selectors=%O",e);const t=B.safeParse(e);if(!t.success){a("getBounds",t.error.message,"EFP001400");return}const o=[];if(e.booths?.forEach(n=>{let i;n.externalId?i=r.boothStore.boothByExternalId.get(n.externalId):n.name&&(i=r.boothStore.boothByName.get(n.name.toLowerCase())),i?.rect&&o.push(i.rect)}),e.exhibitors?.forEach(n=>{let i;n.externalId?i=r.exhibitorStore.exhibitorByExternalId.get(n.externalId):n.name&&(i=r.exhibitorStore.exhibitorByName.get(n.name.toLowerCase())),i?.booths?.forEach(h=>{h.rect&&o.push(h.rect)})}),o.length===0)return;const s=P.fromUnion(...o);return{leftTop:{x:s.min.x,y:s.min.y},rightBottom:{x:s.max.x,y:s.max.y}}}fitBounds(e,t){if(p("fitBounds called with bounds=%O options=%O",e,t),!e){r.uiState.fitBounds();return}const o=H.safeParse(e);if(!o.success){a("fitBounds",o.error.message,"EFP001500");return}const s=k.safeParse(t);if(!s.success){a("fitBounds",s.error.message,"EFP001501");return}const n=P.fromMinMax({x:e.leftTop.x,y:e.leftTop.y},{x:e.rightBottom.x,y:e.rightBottom.y});r.uiState.moveToRect=t?.padding?n.expand(t.padding):n}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){const o=w()?.properties?.config;if(!o){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,o)}getGeoConfig(){const e=w()?.properties?.config;return e?{bearing:e.bearing??0,p0:e.p0,p1:e.p1,p2:e.p2}:null}releaseResources(){r.maplibreStore.dispose(),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(s=>s.name===e.name||s.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(n=>n.index===e.index),s=o?.name;if(!s){a("activateFloor",`Floor at index ${e.index} does not exist.`,"EFP001203");return}if(o.active)return;this.updateLayerVisibility(s,!0);return}}showPathway(e,t){const{boothExternalIds:o,exhibitorExternalIds:s}=t?.length?F(t):{boothExternalIds:[],exhibitorExternalIds:[]};X({pathwayId:e,boothIds:o,exhibitorIds:s})}showPathwayOnly(e,t){this.activateFloor({name:t}),r.layerStore.showPathWay(e),r.uiState.setPathwayOnlyMode(!0);const o=r.layerStore.findLayer(e),s=r.layerStore.findLayer(t),n=o?.rect||o?.viewbox?o:s;if(n?.rect||n?.viewbox){const i=n.viewbox??n.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 E=0;function a(f,e,t){const o=`Error calling "${f}" SDK method.`,s=`${e.endsWith(".")?e:e+"."} More information at`;let n="https://js-sdk.expofp.com/api/packages";if(t&&(n+=`#error-${t}`),console.error(`${o} ${s} ${n}`),r.fp.disableRuntimeAlerts)return;r.uiState.setGlobalErrorMessage({title:o,body:I(T,{children:[s," ",x("a",{href:n,target:"_blank",rel:"noreferrer",children:n})]})}),clearTimeout(E);const i=8e3;E=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,s){if(e>o){const n=e;e=o,o=n}if(t>s){const n=t;t=s,s=n}this.x1=e,this.y1=t,this.x2=o,this.y2=s}static fromBox(e){return new l(e.min.x,e.min.y,e.max.x,e.max.y)}static fromCxcywh(e,t,o,s){return new l(e-o/2,t-s/2,e+o/2,t+s/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),s=Math.max(this.y1,e.y1),n=Math.min(this.y2,e.y2);return o>=t&&n>=s}getIntersection(e){const t=Math.max(this.x1,e.x1),o=Math.min(this.x2,e.x2),s=Math.max(this.y1,e.y1),n=Math.min(this.y2,e.y2);return o>=t&&n>=s?new l(t,s,o,n):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}}
package/dist/esm/load.js CHANGED
@@ -1,4 +1,4 @@
1
- import"./utils/silence-mobx-react-lite-warning";import{applyIntents as f,loadConfig as p,setConfig as m}from"@expofp/config";import{safeLocalStorage as u}from"@expofp/utils";import d from"debug";import{initHtmlHead as h}from"./_misc_to_move/initHtmlHead";import{logBuildInfo as y}from"./_misc_to_move/logBuildInfo";import v from"./floorplan.loader";import{brand as g}from"./utils/brand";import{applyEventHead as w,buildEventHead as S}from"./utils/event-head";import{formatEventTitle as k}from"./utils/event-title";import E from"./utils/is-own-domain";import{migrateLegacyStorageKeys as b}from"./utils/legacy-storage-keys";const s=d("efp:load");export async function load(i,t={}){h(),y(),d("efp:device").enabled&&import("./_misc_to_move/logDeviceInfo").then(e=>e.logDeviceInfo()).catch(()=>{});const a=t.element;let o;if(typeof a=="string"){const e=document.querySelector(a);if(!e)throw new Error(`Element not found for selector: ${a}`);o=e}else a?o=a:(o=document.getElementById("floorplan"),o||(o=document.createElement("div"),_(o),document.body.appendChild(o)));x(),o.setAttribute("data-efp-floorplan-defaults",""),document.documentElement.style.overscrollBehavior||="none",document.body.style.overscrollBehavior||="none",requestAnimationFrame(()=>{o.style.backgroundColor="#ebebeb"}),b();let n;try{if(n=await p(i,t,window.location.search,u()??void 0),!n.fpSvgJsRef)throw new Error("No floor plan drawing: the manifest must set `legacyDataUrlBase` (live event) or `fpSvgJsRef` (offline copy)")}catch(e){const{showEventNotFound:c}=await import("./tools/event-not-found");throw c(o),e}if(s("config",n),m(n),E){const e=k(n,g);e&&(document.title=e),w(document,S(n),`${window.location.origin}/`)}const r=new v(t,o),l=window.___fpResolve;return window.___fp=r,l&&(r.ready.then(()=>l(r)).catch(e=>s("placeholder resolve skipped:",e)),delete window.___fpResolve),r.ready.then(()=>{const e=new CustomEvent("expofp:ready",{detail:{floorplan:r}});window.__expofpReady=e,window.dispatchEvent(e)}).catch(e=>s("ready event skipped:",e)),r.ready.then(()=>f(r,n.intents)).catch(e=>s("config intents skipped:",e)),r}function x(){const i="efp-floorplan-defaults";if(document.getElementById(i))return;const t=document.createElement("style");t.id=i,t.textContent=`
1
+ import"./utils/silence-mobx-react-lite-warning";import{applyIntents as m,loadConfig as p,setConfig as u}from"@expofp/config";import{safeLocalStorage as h}from"@expofp/utils";import l from"debug";import{initHtmlHead as y}from"./_misc_to_move/initHtmlHead";import{logBuildInfo as w}from"./_misc_to_move/logBuildInfo";import v from"./floorplan.loader";import{claimPlanSlot as g,disposePlan as E,registerPlanDisposer as S}from"./plan-lifecycle.js";import c from"./tools/report-error.js";import{brand as k}from"./utils/brand";import{applyEventHead as b,buildEventHead as x}from"./utils/event-head";import{formatEventTitle as _}from"./utils/event-title";import $ from"./utils/is-own-domain";import{migrateLegacyStorageKeys as B}from"./utils/legacy-storage-keys";const s=l("efp:load");export async function load(r,e={}){g();try{return await C(r,e)}catch(n){try{E()}catch(o){s("teardown after a failed load:",o)}throw n}}async function C(r,e={}){window.addEventListener("error",c),S(()=>window.removeEventListener("error",c)),y(),w(),l("efp:device").enabled&&import("./_misc_to_move/logDeviceInfo").then(t=>t.logDeviceInfo()).catch(()=>{});const n=e.element;let o;if(typeof n=="string"){const t=document.querySelector(n);if(!t)throw new Error(`Element not found for selector: ${n}`);o=t}else n?o=n:(o=document.getElementById("floorplan"),o||(o=document.createElement("div"),R(o),document.body.appendChild(o)));L(),o.setAttribute("data-efp-floorplan-defaults",""),document.documentElement.style.overscrollBehavior||="none",document.body.style.overscrollBehavior||="none",requestAnimationFrame(()=>{o.style.backgroundColor="#ebebeb"}),B();let a;try{if(a=await p(r,e,window.location.search,h()??void 0),!a.fpSvgJsRef)throw new Error("No floor plan drawing: the manifest must set `legacyDataUrlBase` (live event) or `fpSvgJsRef` (offline copy)")}catch(t){const{showEventNotFound:f}=await import("./tools/event-not-found");throw f(o),t}if(s("config",a),u(a),$){const t=_(a,k);t&&(document.title=t),b(document,x(a),`${window.location.origin}/`)}const i=new v(e,o),d=window.___fpResolve;return window.___fp=i,d&&(i.ready.then(()=>d(i)).catch(t=>s("placeholder resolve skipped:",t)),delete window.___fpResolve),i.ready.then(()=>{const t=new CustomEvent("expofp:ready",{detail:{floorplan:i}});window.__expofpReady=t,window.dispatchEvent(t)}).catch(t=>s("ready event skipped:",t)),i.ready.then(()=>m(i,a.intents)).catch(t=>s("config intents skipped:",t)),i}function L(){const r="efp-floorplan-defaults";if(document.getElementById(r))return;const e=document.createElement("style");e.id=r,e.textContent=`
2
2
  [data-efp-floorplan-defaults] {
3
3
  position: fixed;
4
4
  top: 0;
@@ -10,8 +10,8 @@ import"./utils/silence-mobx-react-lite-warning";import{applyIntents as f,loadCon
10
10
  overscroll-behavior: none;
11
11
  background: #fff;
12
12
  transition: background-color 2s ease;
13
- }`,document.head.prepend(t)}function _(i){if(!document.adoptedStyleSheets)return;const t="efp-runtime-loader-spinner",a=`
14
- .${t} {
13
+ }`,document.head.prepend(e)}function R(r){if(!document.adoptedStyleSheets)return;const e="efp-runtime-loader-spinner",n=`
14
+ .${e} {
15
15
  position: fixed;
16
16
  top: 50%;
17
17
  left: 50%;
@@ -25,29 +25,29 @@ import"./utils/silence-mobx-react-lite-warning";import{applyIntents as f,loadCon
25
25
  transition: all 1s ease;
26
26
  }
27
27
 
28
- .${t} > svg {
28
+ .${e} > svg {
29
29
  width: 60px;
30
30
  transform-origin: center;
31
- animation: ${t}-rotate 2s linear infinite;
31
+ animation: ${e}-rotate 2s linear infinite;
32
32
  }
33
33
 
34
- .${t} > svg > circle {
34
+ .${e} > svg > circle {
35
35
  fill: none;
36
36
  stroke: var(--color-primary, #2382f4);
37
37
  stroke-dasharray: 1, 200;
38
38
  stroke-dashoffset: 0;
39
39
  stroke-linecap: round;
40
40
  stroke-width: 2;
41
- animation: ${t}-dash 1.5s ease-in-out infinite;
41
+ animation: ${e}-dash 1.5s ease-in-out infinite;
42
42
  }
43
43
 
44
- @keyframes ${t}-rotate {
44
+ @keyframes ${e}-rotate {
45
45
  100% {
46
46
  transform: rotate(360deg);
47
47
  }
48
48
  }
49
49
 
50
- @keyframes ${t}-dash {
50
+ @keyframes ${e}-dash {
51
51
  0% {
52
52
  stroke-dasharray: 1, 200;
53
53
  stroke-dashoffset: 0;
@@ -61,8 +61,8 @@ import"./utils/silence-mobx-react-lite-warning";import{applyIntents as f,loadCon
61
61
  100% {
62
62
  stroke-dashoffset: -125px;
63
63
  }
64
- }`,o=new CSSStyleSheet;o.replaceSync(a),document.adoptedStyleSheets=[...document.adoptedStyleSheets,o],i.innerHTML=`<div class="${t}">
64
+ }`,o=new CSSStyleSheet;o.replaceSync(n),document.adoptedStyleSheets=[...document.adoptedStyleSheets,o],r.innerHTML=`<div class="${e}">
65
65
  <svg viewBox="25 25 50 50">
66
66
  <circle r="20" cy="50" cx="50"></circle>
67
67
  </svg>
68
- </div>`,requestAnimationFrame(()=>{i.querySelector(`.${t}`)?.style.setProperty("opacity","1")})}
68
+ </div>`,requestAnimationFrame(()=>{r.querySelector(`.${e}`)?.style.setProperty("opacity","1")})}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * The live-plan bookkeeping behind the one-live-plan-per-page contract
3
+ * (ADR-0011). One page shows one plan at a time; a *plan swap* is
4
+ * `unstable_destroy()` followed by `load()`, and the next load builds a
5
+ * completely fresh event-scoped world rather than resetting the old one.
6
+ *
7
+ * Two things live here, and nothing else — the module is deliberately free of
8
+ * store, config and DOM imports so `load()` can hold the contract without
9
+ * pulling the event-scoped graph into the entry chunk:
10
+ *
11
+ * - the slot: `load()` claims it and refuses a second plan; `disposePlan()`
12
+ * frees it, which is what makes `unstable_destroy()` idempotent;
13
+ * - the teardown registry: everything the plan owns — MobX reactions, DOM
14
+ * listeners, timers, the store graph itself — registers how to undo itself,
15
+ * because an undisposed reaction stays subscribed to the dead instance and
16
+ * pins it across the swap (spike finding, `docs/2026-08-27-plan-swap-proxy-spike-verdict.md`).
17
+ *
18
+ * Module-scope *data* that belongs to one event is not registered anywhere: it
19
+ * is memoized on the installed config by `tools/event-scoped-cache.ts`.
20
+ */
21
+ type Disposer = () => void;
22
+ /**
23
+ * What an embedder sees when their navigation code loads a second plan without
24
+ * destroying the first. Naming the fix is the point — the alternative is a
25
+ * corrupted map (ADR-0011).
26
+ */
27
+ export declare const LIVE_PLAN_ERROR: string;
28
+ /** Whether a plan currently owns the page. */
29
+ export declare function isPlanLive(): boolean;
30
+ /**
31
+ * Names the plan currently occupying the page. Bumped by every teardown, so async work started by
32
+ * one plan can tell that it has come back to a different one — or to none.
33
+ *
34
+ * `isPlanLive()` cannot answer that question: the next `load()` claims the slot long before
35
+ * `createLivePlan()` points the barrel at its graph, so a continuation resuming in that window sees
36
+ * a live plan and reads a barrel that is still empty. Capture this before the `await`, compare
37
+ * after, and drop the result when it no longer belongs to anyone (ADR-0011).
38
+ */
39
+ export declare function planGeneration(): number;
40
+ /**
41
+ * Reserves the page for the plan being loaded. Called at the top of `load()`,
42
+ * before anything is built, so a sequencing bug in the host's navigation
43
+ * surfaces as a rejected promise rather than a half-swapped world.
44
+ *
45
+ * @throws when a plan is already alive; the live plan is left untouched.
46
+ */
47
+ export declare function claimPlanSlot(): void;
48
+ /**
49
+ * Registers how to undo one thing the live plan owns. Disposers run in reverse
50
+ * registration order, so whatever was built first — the store graph — is the
51
+ * last thing to go.
52
+ */
53
+ export declare function registerPlanDisposer(dispose: Disposer): void;
54
+ /**
55
+ * Tears the live plan down and frees the slot: the disposer registry runs in
56
+ * reverse, then the page is empty again. Idempotent — a second call, and a
57
+ * call when nothing was ever loaded, do nothing.
58
+ *
59
+ * @throws the first failure once every disposer has run. A disposer that
60
+ * throws is a bug in that module, not a reason to strand the rest of the
61
+ * teardown and leave the page half-alive.
62
+ */
63
+ export declare function disposePlan(): void;
64
+ export {};
65
+ //# sourceMappingURL=plan-lifecycle.d.ts.map
@@ -0,0 +1 @@
1
+ export const LIVE_PLAN_ERROR="A plan is already loaded on this page; call destroy() first (one live plan per page \u2014 see the Switching plans guide).";let e=!1,i=0;const n=[];export function isPlanLive(){return e}export function planGeneration(){return i}export function claimPlanSlot(){if(e)throw new Error(LIVE_PLAN_ERROR);e=!0}export function registerPlanDisposer(t){n.push(t)}export function disposePlan(){if(!e)return;e=!1,i++;let t,r=!1;for(;n.length>0;)try{n.pop()()}catch(o){r||(t=o,r=!0)}if(r)throw t}
@@ -1 +1 @@
1
- import{__decorate as a}from"tslib";import{getConfig as m}from"@expofp/config";import{action as c,observable as g,reaction as u}from"mobx";import{PREFIXES as S}from"../store/search-buttons/constants";import l from"../tools/logger";import{decodeString as P,decodeStringArray as F,encodeString as L,encodeStringArray as T,toLowerCaseArray as d,toLowerCaseString as f}from"../utils/urlEncoding";import{replaceQuery as I}from"./url-sync";const h={CATEGORIES:"categories",POI_TYPE:"poiType",POI_TYPES:"poiTypes",EXHIBITORS:"exhibitors"};export class URLFilterManager{constructor(e){this.rootStore=e,this.currentFilters={categories:[],poiType:null,poiTypes:[],exhibitors:!1},this.isInitialized=!1,this.setupReactions()}initialize(){this.parseURLFilters(),this.applyFiltersToStore(),this.isInitialized=!0,l.log("URLFilterManager initialized with filters:",this.currentFilters)}parseURLFilters(){const{categories:e,poiType:t,poiTypes:r,exhibitors:i}=this.readRawFilters(),o=r.filter(s=>{if(!s)return!1;const n=this.rootStore.poiTypeStore.poiTypes.some(p=>p.name.toLowerCase()===s.toLowerCase());return n||l.warn(`POI type not found in data: ${s}`),n});e.length>0&&(t||o.length>0)?(l.warn("URL contains both categories and POI types. Clearing POI types."),this.currentFilters={categories:e,poiType:null,poiTypes:[],exhibitors:i}):this.currentFilters={categories:e,poiType:t,poiTypes:o,exhibitors:i},l.log("URLFilterManager parsed filters:",{categories:e,poiType:t,poiTypes:r,exhibitors:i}),this.validateFilters(this.currentFilters)}readRawFilters(){const e=m().filters;if(Object.keys(e).length>0)return{categories:[...e.categories??[]],poiType:e.poiType??null,poiTypes:[...e.poiTypes??[]],exhibitors:e.exhibitors??!1};const t=new URLSearchParams(window.location.search),r=t.get(h.CATEGORIES),i=r?F(r):[],o=t.get(h.POI_TYPE),s=o?P(o):null,n=t.get(h.POI_TYPES),p=n?F(n):[],y=t.get(h.EXHIBITORS);return{categories:i,poiType:s,poiTypes:p,exhibitors:y==="true"||y===""}}applyFiltersToStore(){const{uiState:e,categoryFilterStore:t,searchButtonsStore:r}=this.rootStore;if(this.currentFilters.categories.length>0){const i=this.currentFilters.categories.map(o=>this.rootStore.categoryStore.categories.find(s=>s.name.toLowerCase()===o.toLowerCase())).filter(o=>o!==void 0);i.length>0?(e.selectedCategoryFilters=i,t.state.selectedItems=i.map(o=>({id:o.id,name:o.name})),e.categoryFilterOpen=!0,l.log("URLFilterManager applied categories:",i.map(o=>o.name)),setTimeout(()=>{this.focusOnFilteredBooths(),this.rootStore.searchStore.setFocused(!0)},100)):l.warn("URLFilterManager: no categories found for names:",this.currentFilters.categories)}if(this.currentFilters.poiType){const i=this.rootStore.poiTypeStore.poiTypes.find(o=>o.name.toLowerCase()===this.currentFilters.poiType.toLowerCase());i?(e.selectedPoiTypeFilters=[i],r.setPoiFilterId(`${S.POI_TYPE}${i.id}`),l.log("URLFilterManager applied POI type:",i.name),setTimeout(()=>{this.focusOnFilteredBooths(),this.rootStore.searchStore.setFocused(!0)},100)):l.warn("URLFilterManager: no POI type found for name:",this.currentFilters.poiType)}if(this.currentFilters.poiTypes.length>0){const i=this.currentFilters.poiTypes.map(o=>o?this.rootStore.poiTypeStore.poiTypes.find(s=>s.name.toLowerCase()===o.toLowerCase()):null).filter(o=>o!=null);i.length>0?(e.selectedPoiTypeFilters=i,l.log("URLFilterManager applied POI types:",i.map(o=>o.name)),setTimeout(()=>{this.focusOnFilteredBooths(),this.rootStore.searchStore.setFocused(!0)},100)):(l.warn("URLFilterManager: no POI types found for names:",this.currentFilters.poiTypes),this.currentFilters.poiTypes=[])}this.currentFilters.exhibitors&&this.openExhibitorsList()}filterSearch(){const{uiState:e}=this.rootStore,t=new URLSearchParams;if(e.selectedCategoryFilters.length>0){const r=e.selectedCategoryFilters.map(o=>o.name.toLowerCase()),i=T(r);i&&t.set(h.CATEGORIES,i)}if(e.selectedPoiTypeFilters.length>0&&e.selectedCategoryFilters.length===0)if(e.selectedPoiTypeFilters.length===1){const r=e.selectedPoiTypeFilters[0].name.toLowerCase();if(r){const i=L(r);i&&t.set(h.POI_TYPE,i)}}else{const r=e.selectedPoiTypeFilters.map(o=>o.name.toLowerCase()),i=T(r);i&&t.set(h.POI_TYPES,i)}return this.currentFilters.exhibitors&&e.selectedCategoryFilters.length===0&&e.selectedPoiTypeFilters.length===0&&t.set(h.EXHIBITORS,"true"),t.toString()?`?${t.toString()}`:""}updateURLFromFilters(){const{uiState:e}=this.rootStore;I(this.filterSearch()),this.currentFilters={categories:e.selectedCategoryFilters.length>0?e.selectedCategoryFilters.map(t=>t.name):[],poiType:e.selectedPoiTypeFilters.length===1&&e.selectedCategoryFilters.length===0?e.selectedPoiTypeFilters[0].name:null,poiTypes:e.selectedPoiTypeFilters.length>1&&e.selectedCategoryFilters.length===0?e.selectedPoiTypeFilters.map(t=>t.name):[],exhibitors:this.currentFilters.exhibitors}}setCategories(e){this.currentFilters.categories=d(e),this.currentFilters.poiType=null,this.isInitialized&&this.updateURLFromFilters()}setPoiType(e){this.currentFilters.poiType=f(e),this.currentFilters.poiTypes=[],this.currentFilters.categories=[],this.isInitialized&&this.updateURLFromFilters()}setPoiTypes(e){this.currentFilters.poiTypes=d(e),this.currentFilters.poiType=null,this.currentFilters.categories=[],this.isInitialized&&this.updateURLFromFilters()}clearAllFilters(){this.currentFilters={categories:[],poiType:null,poiTypes:[],exhibitors:!1};const{uiState:e}=this.rootStore;e.categoryFilterOpen=!1,this.updateURLFromFilters()}getCurrentFilters(){return{...this.currentFilters}}setupReactions(){u(()=>this.rootStore.uiState.selectedCategoryFilters,e=>{if(this.isInitialized&&e.length>0){const t=d(e.map(r=>r.name));this.setCategories(t)}}),u(()=>this.rootStore.uiState.selectedPoiTypeFilters,e=>{if(this.isInitialized&&e.length>0)if(e.length===1){const t=f(e[0].name);t&&this.setPoiType(t)}else{const t=d(e.map(r=>r.name));this.setPoiTypes(t)}})}validateFilters(e){if(e.categories.length>0&&(e.poiType||e.poiTypes.length>0))return l.warn("Categories and POI types cannot be active simultaneously"),!1;if(e.poiType&&e.poiTypes.length>0)return l.warn("Both single POI type and multiple POI types cannot be active simultaneously"),!1;for(const t of e.categories)if(!this.getCategoryIdByName(t))return l.warn(`Category not found: ${t}`),!1;if(e.poiType&&!this.getPoiTypeIdByName(e.poiType))return l.warn(`POI type not found: ${e.poiType}`),!1;for(const t of e.poiTypes)if(!this.getPoiTypeIdByName(t))return l.warn(`POI type not found: ${t}`),!1;return!0}getCategoryIdByName(e){const t=this.rootStore.categoryStore.categories.find(r=>r.name.toLowerCase()===e.toLowerCase());return t?t.id:null}getPoiTypeIdByName(e){const t=this.rootStore.poiTypeStore.poiTypes.find(r=>r.name.toLowerCase()===e.toLowerCase());return t?t.id:null}focusOnFilteredBooths(){if(!this.rootStore.layerStore.layersLoaded){u(()=>this.rootStore.layerStore.layersLoaded,()=>{this.focusOnFilteredBooths()},{fireImmediately:!1});return}const{uiState:e,exhibitorStore:t,boothStore:r}=this.rootStore;let i=[];if(e.selectedCategoryFilters.length>0){const s=t.exhibitors.filter(n=>e.selectedCategoryFilters.some(p=>n.categories.some(y=>y.id===p.id)));i=r.booths.filter(n=>s.some(p=>p.id===n.exhibitors[0]?.id))}if(e.selectedPoiTypeFilters.length>0){const s=r.booths.filter(n=>e.selectedPoiTypeFilters.some(p=>n.poiTypeId===p.id));i.length>0?i=i.filter(n=>s.some(p=>p.id===n.id)):i=s}const o=i.filter(s=>s.visible);o.length>0?(e.moveToBooths=o,this.rootStore.moveToList(o)):i.length>0&&(this.rootStore.showMap(),this.rootStore.moveToList(i))}openExhibitorsList(){const{uiState:e}=this.rootStore;e.list={type:"exhibitors",text:"",focused:!1},setTimeout(()=>{this.rootStore.searchStore.setFocused(!0)},100),l.log("URLFilterManager opened exhibitors list")}}a([g],URLFilterManager.prototype,"currentFilters",void 0),a([g],URLFilterManager.prototype,"isInitialized",void 0),a([c],URLFilterManager.prototype,"initialize",null),a([c],URLFilterManager.prototype,"parseURLFilters",null),a([c],URLFilterManager.prototype,"applyFiltersToStore",null),a([c],URLFilterManager.prototype,"updateURLFromFilters",null),a([c],URLFilterManager.prototype,"setCategories",null),a([c],URLFilterManager.prototype,"setPoiType",null),a([c],URLFilterManager.prototype,"setPoiTypes",null),a([c],URLFilterManager.prototype,"clearAllFilters",null),a([c],URLFilterManager.prototype,"focusOnFilteredBooths",null),a([c],URLFilterManager.prototype,"openExhibitorsList",null);
1
+ import{__decorate as a}from"tslib";import{getConfig as m}from"@expofp/config";import{action as c,observable as g}from"mobx";import{PREFIXES as S}from"../store/search-buttons/constants";import l from"../tools/logger";import{planReaction as u}from"../utils/plan-reactions.js";import{decodeString as P,decodeStringArray as F,encodeString as L,encodeStringArray as T,toLowerCaseArray as d,toLowerCaseString as f}from"../utils/urlEncoding";import{replaceQuery as I}from"./url-sync";const h={CATEGORIES:"categories",POI_TYPE:"poiType",POI_TYPES:"poiTypes",EXHIBITORS:"exhibitors"};export class URLFilterManager{constructor(e){this.rootStore=e,this.currentFilters={categories:[],poiType:null,poiTypes:[],exhibitors:!1},this.isInitialized=!1,this.setupReactions()}initialize(){this.parseURLFilters(),this.applyFiltersToStore(),this.isInitialized=!0,l.log("URLFilterManager initialized with filters:",this.currentFilters)}parseURLFilters(){const{categories:e,poiType:t,poiTypes:r,exhibitors:i}=this.readRawFilters(),o=r.filter(s=>{if(!s)return!1;const n=this.rootStore.poiTypeStore.poiTypes.some(p=>p.name.toLowerCase()===s.toLowerCase());return n||l.warn(`POI type not found in data: ${s}`),n});e.length>0&&(t||o.length>0)?(l.warn("URL contains both categories and POI types. Clearing POI types."),this.currentFilters={categories:e,poiType:null,poiTypes:[],exhibitors:i}):this.currentFilters={categories:e,poiType:t,poiTypes:o,exhibitors:i},l.log("URLFilterManager parsed filters:",{categories:e,poiType:t,poiTypes:r,exhibitors:i}),this.validateFilters(this.currentFilters)}readRawFilters(){const e=m().filters;if(Object.keys(e).length>0)return{categories:[...e.categories??[]],poiType:e.poiType??null,poiTypes:[...e.poiTypes??[]],exhibitors:e.exhibitors??!1};const t=new URLSearchParams(window.location.search),r=t.get(h.CATEGORIES),i=r?F(r):[],o=t.get(h.POI_TYPE),s=o?P(o):null,n=t.get(h.POI_TYPES),p=n?F(n):[],y=t.get(h.EXHIBITORS);return{categories:i,poiType:s,poiTypes:p,exhibitors:y==="true"||y===""}}applyFiltersToStore(){const{uiState:e,categoryFilterStore:t,searchButtonsStore:r}=this.rootStore;if(this.currentFilters.categories.length>0){const i=this.currentFilters.categories.map(o=>this.rootStore.categoryStore.categories.find(s=>s.name.toLowerCase()===o.toLowerCase())).filter(o=>o!==void 0);i.length>0?(e.selectedCategoryFilters=i,t.state.selectedItems=i.map(o=>({id:o.id,name:o.name})),e.categoryFilterOpen=!0,l.log("URLFilterManager applied categories:",i.map(o=>o.name)),setTimeout(()=>{this.focusOnFilteredBooths(),this.rootStore.searchStore.setFocused(!0)},100)):l.warn("URLFilterManager: no categories found for names:",this.currentFilters.categories)}if(this.currentFilters.poiType){const i=this.rootStore.poiTypeStore.poiTypes.find(o=>o.name.toLowerCase()===this.currentFilters.poiType.toLowerCase());i?(e.selectedPoiTypeFilters=[i],r.setPoiFilterId(`${S.POI_TYPE}${i.id}`),l.log("URLFilterManager applied POI type:",i.name),setTimeout(()=>{this.focusOnFilteredBooths(),this.rootStore.searchStore.setFocused(!0)},100)):l.warn("URLFilterManager: no POI type found for name:",this.currentFilters.poiType)}if(this.currentFilters.poiTypes.length>0){const i=this.currentFilters.poiTypes.map(o=>o?this.rootStore.poiTypeStore.poiTypes.find(s=>s.name.toLowerCase()===o.toLowerCase()):null).filter(o=>o!=null);i.length>0?(e.selectedPoiTypeFilters=i,l.log("URLFilterManager applied POI types:",i.map(o=>o.name)),setTimeout(()=>{this.focusOnFilteredBooths(),this.rootStore.searchStore.setFocused(!0)},100)):(l.warn("URLFilterManager: no POI types found for names:",this.currentFilters.poiTypes),this.currentFilters.poiTypes=[])}this.currentFilters.exhibitors&&this.openExhibitorsList()}filterSearch(){const{uiState:e}=this.rootStore,t=new URLSearchParams;if(e.selectedCategoryFilters.length>0){const r=e.selectedCategoryFilters.map(o=>o.name.toLowerCase()),i=T(r);i&&t.set(h.CATEGORIES,i)}if(e.selectedPoiTypeFilters.length>0&&e.selectedCategoryFilters.length===0)if(e.selectedPoiTypeFilters.length===1){const r=e.selectedPoiTypeFilters[0].name.toLowerCase();if(r){const i=L(r);i&&t.set(h.POI_TYPE,i)}}else{const r=e.selectedPoiTypeFilters.map(o=>o.name.toLowerCase()),i=T(r);i&&t.set(h.POI_TYPES,i)}return this.currentFilters.exhibitors&&e.selectedCategoryFilters.length===0&&e.selectedPoiTypeFilters.length===0&&t.set(h.EXHIBITORS,"true"),t.toString()?`?${t.toString()}`:""}updateURLFromFilters(){const{uiState:e}=this.rootStore;I(this.filterSearch()),this.currentFilters={categories:e.selectedCategoryFilters.length>0?e.selectedCategoryFilters.map(t=>t.name):[],poiType:e.selectedPoiTypeFilters.length===1&&e.selectedCategoryFilters.length===0?e.selectedPoiTypeFilters[0].name:null,poiTypes:e.selectedPoiTypeFilters.length>1&&e.selectedCategoryFilters.length===0?e.selectedPoiTypeFilters.map(t=>t.name):[],exhibitors:this.currentFilters.exhibitors}}setCategories(e){this.currentFilters.categories=d(e),this.currentFilters.poiType=null,this.isInitialized&&this.updateURLFromFilters()}setPoiType(e){this.currentFilters.poiType=f(e),this.currentFilters.poiTypes=[],this.currentFilters.categories=[],this.isInitialized&&this.updateURLFromFilters()}setPoiTypes(e){this.currentFilters.poiTypes=d(e),this.currentFilters.poiType=null,this.currentFilters.categories=[],this.isInitialized&&this.updateURLFromFilters()}clearAllFilters(){this.currentFilters={categories:[],poiType:null,poiTypes:[],exhibitors:!1};const{uiState:e}=this.rootStore;e.categoryFilterOpen=!1,this.updateURLFromFilters()}getCurrentFilters(){return{...this.currentFilters}}setupReactions(){u(()=>this.rootStore.uiState.selectedCategoryFilters,e=>{if(this.isInitialized&&e.length>0){const t=d(e.map(r=>r.name));this.setCategories(t)}}),u(()=>this.rootStore.uiState.selectedPoiTypeFilters,e=>{if(this.isInitialized&&e.length>0)if(e.length===1){const t=f(e[0].name);t&&this.setPoiType(t)}else{const t=d(e.map(r=>r.name));this.setPoiTypes(t)}})}validateFilters(e){if(e.categories.length>0&&(e.poiType||e.poiTypes.length>0))return l.warn("Categories and POI types cannot be active simultaneously"),!1;if(e.poiType&&e.poiTypes.length>0)return l.warn("Both single POI type and multiple POI types cannot be active simultaneously"),!1;for(const t of e.categories)if(!this.getCategoryIdByName(t))return l.warn(`Category not found: ${t}`),!1;if(e.poiType&&!this.getPoiTypeIdByName(e.poiType))return l.warn(`POI type not found: ${e.poiType}`),!1;for(const t of e.poiTypes)if(!this.getPoiTypeIdByName(t))return l.warn(`POI type not found: ${t}`),!1;return!0}getCategoryIdByName(e){const t=this.rootStore.categoryStore.categories.find(r=>r.name.toLowerCase()===e.toLowerCase());return t?t.id:null}getPoiTypeIdByName(e){const t=this.rootStore.poiTypeStore.poiTypes.find(r=>r.name.toLowerCase()===e.toLowerCase());return t?t.id:null}focusOnFilteredBooths(){if(!this.rootStore.layerStore.layersLoaded){u(()=>this.rootStore.layerStore.layersLoaded,()=>{this.focusOnFilteredBooths()},{fireImmediately:!1});return}const{uiState:e,exhibitorStore:t,boothStore:r}=this.rootStore;let i=[];if(e.selectedCategoryFilters.length>0){const s=t.exhibitors.filter(n=>e.selectedCategoryFilters.some(p=>n.categories.some(y=>y.id===p.id)));i=r.booths.filter(n=>s.some(p=>p.id===n.exhibitors[0]?.id))}if(e.selectedPoiTypeFilters.length>0){const s=r.booths.filter(n=>e.selectedPoiTypeFilters.some(p=>n.poiTypeId===p.id));i.length>0?i=i.filter(n=>s.some(p=>p.id===n.id)):i=s}const o=i.filter(s=>s.visible);o.length>0?(e.moveToBooths=o,this.rootStore.moveToList(o)):i.length>0&&(this.rootStore.showMap(),this.rootStore.moveToList(i))}openExhibitorsList(){const{uiState:e}=this.rootStore;e.list={type:"exhibitors",text:"",focused:!1},setTimeout(()=>{this.rootStore.searchStore.setFocused(!0)},100),l.log("URLFilterManager opened exhibitors list")}}a([g],URLFilterManager.prototype,"currentFilters",void 0),a([g],URLFilterManager.prototype,"isInitialized",void 0),a([c],URLFilterManager.prototype,"initialize",null),a([c],URLFilterManager.prototype,"parseURLFilters",null),a([c],URLFilterManager.prototype,"applyFiltersToStore",null),a([c],URLFilterManager.prototype,"updateURLFromFilters",null),a([c],URLFilterManager.prototype,"setCategories",null),a([c],URLFilterManager.prototype,"setPoiType",null),a([c],URLFilterManager.prototype,"setPoiTypes",null),a([c],URLFilterManager.prototype,"clearAllFilters",null),a([c],URLFilterManager.prototype,"focusOnFilteredBooths",null),a([c],URLFilterManager.prototype,"openExhibitorsList",null);
@@ -1 +1 @@
1
- import{applyIntents as G,getConfig as h,parseDeprecatedUrlParams as K,parseFromUrlTolerant as V,parseIntentsFromUrl as Y,parseLegacyQuery as k,serializeSelection as Q}from"@expofp/config";import{Box as W}from"@expofp/geometry";import{UrlConfigSchema as z}from"@expofp/schema";import{safeDecode as p}from"@expofp/utils";import{autorun as v,runInAction as H,when as d}from"mobx";import{applyKioskMode as j}from"../components/Kiosk/kiosk-mode";import{recoverKioskFromUrlPrams as N}from"../components/Kiosk/recoverKioskFromUrlPrams";import{LEGACY_PREVIEW_MODE_STORAGE_KEY as $,LEGACY_VIEWER_MODE_STORAGE_KEY as q,PREVIEW_MODE_STORAGE_KEY as E,VIEWER_MODE_STORAGE_KEY as I}from"../constants";import J from"../data";import i,{uiState as o}from"../store";import{BoothBase as w}from"../store/BoothStore";import{CurrentPosition as X,extractRoute as Z}from"../store/RouteStore";import{setConsentSettings as ee}from"../tools/gtag";import x from"../tools/logger";import{areLayersEnabled as te}from"../utils/areLayersEnabled";import{brand as M}from"../utils/brand";import{cameraToMapSettings as B}from"../utils/camera-map-settings";import{handleCustomCommand as oe}from"../utils/customCommands";import{formatEventTitle as re,formatPlaceholderTitle as ie}from"../utils/event-title";import{getMostFrequent as ne}from"../utils/getMostFrequent";import{heatmapEnabled as se}from"../utils/heatmap-enabled";import ae from"../utils/is-own-domain";import{isLocalStorageAvailable as P}from"../utils/localStorage";import{stripTrackingParams as le}from"../utils/trackingParams";import{rewriteMultiSlugQuery as ce}from"./multi-slug";import{currentSearch as m,disableUrlWrites as ue,initUrlSync as me,pushQuery as fe,replaceQuery as f}from"./url-sync";let y=!1;export function applyDeclarativeConfig(){S(h()),d(()=>i.layerStore.layersLoaded,()=>{const e=h().camera;Object.keys(e).length&&A(B(e));const t=h().visibility;Object.keys(t).length&&o.setVisibility(t)})}export function initUrlRouting(e){me({offHistory:e,onNavigate:b}),O(),g(),d(()=>i.layerStore.layersLoaded,()=>{i.urlFilterManager&&!i.urlFilterManager.isInitialized&&i.urlFilterManager.initialize(),b(),v(_),v(T),o.viewerMode&&(o.menu=!0)})}export function applyParameters(e=""){f("?"+p(e.toString())),i.layerStore.layersLoaded?L(e):(g(),d(()=>i.layerStore.layersLoaded,()=>L(e)))}function L(e){const t="?"+p(e),r=ye(t),n=[...r.intents??[],...Y(t).intents],{intents:c=[],...l}=K(t,{visibility:r.visibility,consent:r.consent,intents:n});S(r),S(l);const a=r.consent??l.consent;a&&ee(a),r.camera&&Object.keys(r.camera).length&&A(B(r.camera)),r.visibility&&Object.keys(r.visibility).length&&o.setVisibility(r.visibility),O(),b();const s=[...n,...c];s.length&&G(i.fp,s)}function g(){const e=m(),t=e.length>1?p(e.substring(1)):"";return oe(t)}function b(){y=!0;try{const e=new URLSearchParams(p(window.location.search));N(e);const{primary:t}=k(m()),r=t.type==="select"&&(!t.slug||/^t=[^&]*$/.test(t.slug))&&(o.heatmap||o.heatmapYah);!g()&&!r&&pe(t)}finally{y=!1}T(),_()}function pe(e){const t=i.fp;switch(e.type){case"kiosk":e.enabled!==null&&j(o,e.enabled);return;case"list":t.showList(e.list);return;case"tour":t.selectTour(e.tourId);return;case"planner":t.openPlanner({items:e.items,from:e.from,fromBookmarks:e.fromBookmarks});return;case"route":{i.routeStore.setOnlyAccessible(e.accessible),i.routeStore.selectRoute(Z(e.from??"",e.to??"",e.waypoints)),i.uiState.setIsMultiPointRoute(e.waypoints.length>0),e.title&&i.uiState.setRouteTitle(e.title);return}case"selectExhibitors":setTimeout(()=>t.selectExhibitor(e.values),250);return;case"ownedByFilters":x.log("Skipping filter parameters in dispatchFromUrl (owned by URLFilterManager)");return;case"ownedByConfig":return;case"select":t.select(e.slug);return}}export function applyPathway(e){const{pathwayId:t,boothIds:r,exhibitorIds:n}=e,c=i.boothStore.booths.filter(s=>r.includes(s.externalId)),l=i.exhibitorStore.exhibitors.filter(s=>n.includes(s.externalId)).flatMap(s=>s.booths),a=[...c,...l];if(te()){const s=ne(a.map(u=>u.layer.name));s&&i.fp.activateFloor({name:s})}(r.length>0||n.length>0)&&i.fp.highlightEntities([...r,...n]),i.layerStore.showPathWay(t),a.length>0&&H(()=>{i.uiState.moveToRect=W.fromUnion(...a.map(s=>s.rect).filter(Boolean)),i.uiState.rollReset=!0})}function O(){const{oneShots:e}=k(m());for(const r of e)de(r);const t=le(m());t!==null&&f("?"+t),o.previewExhibitor&&f("?"+o.previewExhibitor.slug),he()}function de(e){switch(e.type){case"heatmap":R(e.yah);return;case"blueDot":{const t=new X(e.x,e.y,i.layerStore.findLayer(e.layer??"")?.name,void 0,e.lat,e.lng);d(()=>i.layerStore.layersLoaded,()=>i.routeStore.selectCurrentPosition(t,!0,1));return}case"viewerMode":P&&(e.enabled?localStorage.setItem(I,"true"):(localStorage.removeItem(I),localStorage.removeItem(q)));return;case"previewMode":P&&(e.enabled?localStorage.setItem(E,"true"):(localStorage.removeItem(E),localStorage.removeItem($)));return;case"uiScale":e.scale!==null?i.uiState.setUIScale(e.scale,!0):x.warn(`Invalid ui-scale parameter: ${e.raw}. Must be a number between 0.8 and 1.4.`);return;case"resetUiScale":i.uiState.resetUIScale();return}}function R(e){ue(),e?(o.heatmapYah=!0,o.monochrome=!0,o.hideLogoInBooth=!0,o.hideHeaderLogo=!0,o.disableBookmarked=!0):o.heatmap=!0}function he(){const e=ce(m(),t=>i.exhibitorStore.exhibitors.find(n=>n.slug===t||n.externalId===t)?.name);e!==null&&f(e)}function S(e){e.noOverlay!==void 0&&(o.hideOverlay=e.noOverlay),e.monochrome&&(o.monochrome=!0),e.hideHeaderLogo&&(o.hideHeaderLogo=!0),e.hideLogoInBooth&&(o.hideLogoInBooth=!0),e.disableFeatured&&i.exhibitorStore.exhibitors.forEach(t=>t.featured=!1),e.disableBookmarked&&(o.disableBookmarked=!0),e.disableGps&&i.routeStore.setGpsTrackingEnabled(!1),e.heatmap&&se(e.heatmap)&&R(e.heatmap.variant==="yah")}function ye(e){return V(z,e).value}let U=null,F=null,C=null;function T(){const{selection:e,exhibitor:t,booth:r,eventItem:n}=ge(),c=i.urlFilterManager.filterSearch();if(y)return;const l=Q(e)||c;m()!==l&&(t!==U||r!==F||n!==C?fe(l):f(l),U=t,F=r,C=n)}function ge(){const e=o.selectedExhibitor,t=o.selectedBooth,r=o.selectedEventItem,n=o.selectedRoute,c=o.selectedSpeaker,l=o.setKioskModeEnabled,a=o.list;let s;if(a.type==="route-planner"&&!e&&!t&&!r){const u=i.routePlannerStore;s={type:"planner",fromBookmarks:u.source==="bookmarks",items:u.items.map(D=>D.entity.slug).filter(Boolean),from:u.startPoint?.slug||void 0}}else if(n&&!o.isMultiPointRoute)s={type:"route",to:n.to instanceof w?n.to.slug:void 0,from:n.from instanceof w?n.from.slug:void 0,accessible:i.routeStore.onlyAccessible,waypoints:n.waypoints?.map(u=>u.slug)};else if(e)s={type:"slug",slug:e.slug};else if(t)s={type:"slug",slug:t.slug};else if(r)s={type:"slug",slug:r.slug};else if(c)s={type:"slug",slug:c.slug};else if(l)s={type:"none"};else switch(a.type){case"bookmarks":case"visited":case"sessions":case"exhibitors":case"speakers":case"tours":case"language":s={type:"list",list:a.type};break;case"category":s={type:"slug",slug:o.selectedCategory?.slug??""};break;case"search":s={type:"slug",slug:a.text||""};break;case"filter":s={type:"filter",key:a.query.key,value:a.query.value};break;case"multi-point-tour":s={type:"tour",tourId:a.tourId};break;default:throw new Error("Unkown list.type")}return{selection:s,exhibitor:e,booth:t,eventItem:r}}function _(){if(!ae)return;const e=o.selectedExhibitor,t=o.selectedEventItem,r=o.selectedSpeaker;let n="";e?n=e.name:t?n=t.name:r?n=r.name:o.list.type==="search"&&o.list.text?n="`"+(o.list.text||"")+"`":o.list.type==="multi-point-tour"&&o.tourTitle&&(n=o.tourTitle),n.length&&(n+=" \u2013 "),n+=re(J,M)??ie(window.location.hostname,M),document.title=n}function A(e){try{if(o.setMapSettings(e),e.z){const t=i.layerStore.layers.find(r=>r.name===e.z);t&&i.layerStore.updateVisibility(t,!0)}}catch(t){console.error("Failed to process map settings.",t)}}
1
+ import{applyIntents as _,getConfig as h,parseDeprecatedUrlParams as A,parseFromUrlTolerant as D,parseIntentsFromUrl as V,parseLegacyQuery as v,serializeSelection as G}from"@expofp/config";import{Box as K}from"@expofp/geometry";import{UrlConfigSchema as Y}from"@expofp/schema";import{safeDecode as p}from"@expofp/utils";import{runInAction as W}from"mobx";import{applyKioskMode as Q}from"../components/Kiosk/kiosk-mode";import{recoverKioskFromUrlPrams as z}from"../components/Kiosk/recoverKioskFromUrlPrams";import{LEGACY_PREVIEW_MODE_STORAGE_KEY as H,LEGACY_VIEWER_MODE_STORAGE_KEY as j,PREVIEW_MODE_STORAGE_KEY as k,VIEWER_MODE_STORAGE_KEY as I}from"../constants";import N from"../data";import i,{uiState as o}from"../store";import{BoothBase as E}from"../store/BoothStore";import{CurrentPosition as $,extractRoute as q}from"../store/RouteStore";import{eventScopedValue as J}from"../tools/event-scoped-cache.js";import{setConsentSettings as X}from"../tools/gtag";import x from"../tools/logger";import{areLayersEnabled as Z}from"../utils/areLayersEnabled";import{brand as w}from"../utils/brand";import{cameraToMapSettings as M}from"../utils/camera-map-settings";import{handleCustomCommand as ee}from"../utils/customCommands";import{formatEventTitle as te,formatPlaceholderTitle as oe}from"../utils/event-title";import{getMostFrequent as re}from"../utils/getMostFrequent";import{heatmapEnabled as ie}from"../utils/heatmap-enabled";import ne from"../utils/is-own-domain";import{isLocalStorageAvailable as P}from"../utils/localStorage";import{planAutorun as B,planWhen as d}from"../utils/plan-reactions.js";import{stripTrackingParams as se}from"../utils/trackingParams";import{rewriteMultiSlugQuery as ae}from"./multi-slug";import{currentSearch as m,disableUrlWrites as le,initUrlSync as ce,pushQuery as ue,replaceQuery as f}from"./url-sync";let y=!1;export function applyDeclarativeConfig(){S(h()),d(()=>i.layerStore.layersLoaded,()=>{const e=h().camera;Object.keys(e).length&&C(M(e));const t=h().visibility;Object.keys(t).length&&o.setVisibility(t)})}export function initUrlRouting(e){ce({offHistory:e,onNavigate:g}),O(),b(),d(()=>i.layerStore.layersLoaded,()=>{i.urlFilterManager&&!i.urlFilterManager.isInitialized&&i.urlFilterManager.initialize(),g(),B(F),B(U),o.viewerMode&&(o.menu=!0)})}export function applyParameters(e=""){f("?"+p(e.toString())),i.layerStore.layersLoaded?L(e):(b(),d(()=>i.layerStore.layersLoaded,()=>L(e)))}function L(e){const t="?"+p(e),r=de(t),n=[...r.intents??[],...V(t).intents],{intents:c=[],...l}=A(t,{visibility:r.visibility,consent:r.consent,intents:n});S(r),S(l);const a=r.consent??l.consent;a&&X(a),r.camera&&Object.keys(r.camera).length&&C(M(r.camera)),r.visibility&&Object.keys(r.visibility).length&&o.setVisibility(r.visibility),O(),g();const s=[...n,...c];s.length&&_(i.fp,s)}function b(){const e=m(),t=e.length>1?p(e.substring(1)):"";return ee(t)}function g(){y=!0;try{const e=new URLSearchParams(p(window.location.search));z(e);const{primary:t}=v(m()),r=t.type==="select"&&(!t.slug||/^t=[^&]*$/.test(t.slug))&&(o.heatmap||o.heatmapYah);!b()&&!r&&me(t)}finally{y=!1}U(),F()}function me(e){const t=i.fp;switch(e.type){case"kiosk":e.enabled!==null&&Q(o,e.enabled);return;case"list":t.showList(e.list);return;case"tour":t.selectTour(e.tourId);return;case"planner":t.openPlanner({items:e.items,from:e.from,fromBookmarks:e.fromBookmarks});return;case"route":{i.routeStore.setOnlyAccessible(e.accessible),i.routeStore.selectRoute(q(e.from??"",e.to??"",e.waypoints)),i.uiState.setIsMultiPointRoute(e.waypoints.length>0),e.title&&i.uiState.setRouteTitle(e.title);return}case"selectExhibitors":setTimeout(()=>t.selectExhibitor(e.values),250);return;case"ownedByFilters":x.log("Skipping filter parameters in dispatchFromUrl (owned by URLFilterManager)");return;case"ownedByConfig":return;case"select":t.select(e.slug);return}}export function applyPathway(e){const{pathwayId:t,boothIds:r,exhibitorIds:n}=e,c=i.boothStore.booths.filter(s=>r.includes(s.externalId)),l=i.exhibitorStore.exhibitors.filter(s=>n.includes(s.externalId)).flatMap(s=>s.booths),a=[...c,...l];if(Z()){const s=re(a.map(u=>u.layer.name));s&&i.fp.activateFloor({name:s})}(r.length>0||n.length>0)&&i.fp.highlightEntities([...r,...n]),i.layerStore.showPathWay(t),a.length>0&&W(()=>{i.uiState.moveToRect=K.fromUnion(...a.map(s=>s.rect).filter(Boolean)),i.uiState.rollReset=!0})}function O(){const{oneShots:e}=v(m());for(const r of e)fe(r);const t=se(m());t!==null&&f("?"+t),o.previewExhibitor&&f("?"+o.previewExhibitor.slug),pe()}function fe(e){switch(e.type){case"heatmap":R(e.yah);return;case"blueDot":{const t=new $(e.x,e.y,i.layerStore.findLayer(e.layer??"")?.name,void 0,e.lat,e.lng);d(()=>i.layerStore.layersLoaded,()=>i.routeStore.selectCurrentPosition(t,!0,1));return}case"viewerMode":P&&(e.enabled?localStorage.setItem(I,"true"):(localStorage.removeItem(I),localStorage.removeItem(j)));return;case"previewMode":P&&(e.enabled?localStorage.setItem(k,"true"):(localStorage.removeItem(k),localStorage.removeItem(H)));return;case"uiScale":e.scale!==null?i.uiState.setUIScale(e.scale,!0):x.warn(`Invalid ui-scale parameter: ${e.raw}. Must be a number between 0.8 and 1.4.`);return;case"resetUiScale":i.uiState.resetUIScale();return}}function R(e){le(),e?(o.heatmapYah=!0,o.monochrome=!0,o.hideLogoInBooth=!0,o.hideHeaderLogo=!0,o.disableBookmarked=!0):o.heatmap=!0}function pe(){const e=ae(m(),t=>i.exhibitorStore.exhibitors.find(n=>n.slug===t||n.externalId===t)?.name);e!==null&&f(e)}function S(e){e.noOverlay!==void 0&&(o.hideOverlay=e.noOverlay),e.monochrome&&(o.monochrome=!0),e.hideHeaderLogo&&(o.hideHeaderLogo=!0),e.hideLogoInBooth&&(o.hideLogoInBooth=!0),e.disableFeatured&&i.exhibitorStore.exhibitors.forEach(t=>t.featured=!1),e.disableBookmarked&&(o.disableBookmarked=!0),e.disableGps&&i.routeStore.setGpsTrackingEnabled(!1),e.heatmap&&ie(e.heatmap)&&R(e.heatmap.variant==="yah")}function de(e){return D(Y,e).value}const he=J(()=>({exhibitor:null,booth:null,eventItem:null}));function U(){const{selection:e,exhibitor:t,booth:r,eventItem:n}=ye(),c=i.urlFilterManager.filterSearch();if(y)return;const l=G(e)||c;if(m()===l)return;const a=he();t!==a.exhibitor||r!==a.booth||n!==a.eventItem?ue(l):f(l),a.exhibitor=t,a.booth=r,a.eventItem=n}function ye(){const e=o.selectedExhibitor,t=o.selectedBooth,r=o.selectedEventItem,n=o.selectedRoute,c=o.selectedSpeaker,l=o.setKioskModeEnabled,a=o.list;let s;if(a.type==="route-planner"&&!e&&!t&&!r){const u=i.routePlannerStore;s={type:"planner",fromBookmarks:u.source==="bookmarks",items:u.items.map(T=>T.entity.slug).filter(Boolean),from:u.startPoint?.slug||void 0}}else if(n&&!o.isMultiPointRoute)s={type:"route",to:n.to instanceof E?n.to.slug:void 0,from:n.from instanceof E?n.from.slug:void 0,accessible:i.routeStore.onlyAccessible,waypoints:n.waypoints?.map(u=>u.slug)};else if(e)s={type:"slug",slug:e.slug};else if(t)s={type:"slug",slug:t.slug};else if(r)s={type:"slug",slug:r.slug};else if(c)s={type:"slug",slug:c.slug};else if(l)s={type:"none"};else switch(a.type){case"bookmarks":case"visited":case"sessions":case"exhibitors":case"speakers":case"tours":case"language":s={type:"list",list:a.type};break;case"category":s={type:"slug",slug:o.selectedCategory?.slug??""};break;case"search":s={type:"slug",slug:a.text||""};break;case"filter":s={type:"filter",key:a.query.key,value:a.query.value};break;case"multi-point-tour":s={type:"tour",tourId:a.tourId};break;default:throw new Error("Unkown list.type")}return{selection:s,exhibitor:e,booth:t,eventItem:r}}function F(){if(!ne)return;const e=o.selectedExhibitor,t=o.selectedEventItem,r=o.selectedSpeaker;let n="";e?n=e.name:t?n=t.name:r?n=r.name:o.list.type==="search"&&o.list.text?n="`"+(o.list.text||"")+"`":o.list.type==="multi-point-tour"&&o.tourTitle&&(n=o.tourTitle),n.length&&(n+=" \u2013 "),n+=te(N,w)??oe(window.location.hostname,w),document.title=n}function C(e){try{if(o.setMapSettings(e),e.z){const t=i.layerStore.layers.find(r=>r.name===e.z);t&&i.layerStore.updateVisibility(t,!0)}}catch(t){console.error("Failed to process map settings.",t)}}
@@ -9,7 +9,11 @@ export declare function pushQuery(search: string): void;
9
9
  * debug-mode scrub reloads only on `true`, else `?debug=` would reload forever).
10
10
  */
11
11
  export declare function replaceQuery(search: string): boolean;
12
- /** Stop writing to the history for the rest of the session (heatmap mode). */
12
+ /**
13
+ * Stop writing to the history for the rest of the plan (heatmap mode). Reached
14
+ * in every mode, `ignoreQuery` included, so it arms the plan's reset itself
15
+ * rather than relying on `initUrlSync` having done so; the reset is idempotent.
16
+ */
13
17
  export declare function disableUrlWrites(): void;
14
18
  /**
15
19
  * Start listening to the browser history. `onNavigate` fires on every POP
@@ -1 +1 @@
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()}
1
+ import{splitPlatformParams as u}from"@expofp/config";import{createBrowserHistory as w}from"history";import{registerPlanDisposer as g}from"../plan-lifecycle.js";import{eventScopedValue as x}from"../tools/event-scoped-cache.js";import P from"../tools/logger";const t=w();function a(){return window.location.pathname}const c=x(()=>[]);let i="",r=!1,s=!1,f=0,p=()=>{},m;export function getLocationHistory(){return c()}function y(e){if(!i)return a()+e;const n=u(e).search,o=n==="?"?"":n;return a()+(o?`${o}&${i}`:`?${i}`)}export function currentSearch(){return u(t.location.search).search}export function pushQuery(e){!r&&!s&&t.push(y(e))}export function replaceQuery(e){return r||s?!1:(t.replace(y(e)),!0)}export function disableUrlWrites(){g(destroyUrlSync),r=!0}export function initUrlSync(e){g(destroyUrlSync),r||=e.offHistory,p=e.onNavigate,i=u(t.location.search).platform,r||c().push(a()+t.location.search),m=t.listen((n,o)=>{if(h(),r)return;const l=c(),d=a()+n.search;l[l.length-1]!==d&&l.push(d),P.log("history",o,n),o==="POP"&&p()})}export function destroyUrlSync(){r=!1,i="",p=()=>{},c().length=0,h(),m?.(),m=void 0}function h(){s=!1,window.clearTimeout(f)}export function goBack(){s=!0,window.clearTimeout(f),f=window.setTimeout(h,1e3),t.goBack()}
@@ -1 +1 @@
1
- import{__decorate as t}from"tslib";import{action as r,computed as o,observable as l}from"mobx";import a from"../data";import{fpGeo as n}from"../data/fpGeo";const s=import.meta.env?.VITE_EXPOFP_DISABLE_3D_TOGGLE!=="false";function d(){return typeof window>"u"||window.navigator.onLine}export default class e{constructor(i){this.mapViewMode="floorplan",this.maplibreSelected=!1,this.isOnline=d(),this.cameraPortBox=l.box(null,{deep:!1}),this.handleOnline=()=>this.setOnline(!0),this.handleOffline=()=>this.setOnline(!1),this.rootStore=i,this.mapViewMode=this.getInitialViewMode(),this.maplibreSelected=this.mapViewMode!=="floorplan",typeof window<"u"&&(window.addEventListener("online",this.handleOnline),window.addEventListener("offline",this.handleOffline))}dispose(){typeof window>"u"||(window.removeEventListener("online",this.handleOnline),window.removeEventListener("offline",this.handleOffline))}setOnline(i){this.isOnline=i}get cameraPort(){return this.cameraPortBox.get()}setCameraPort(i){this.cameraPortBox.set(i)}clearCameraPortIfCurrent(i){this.cameraPortBox.get()===i&&this.cameraPortBox.set(null)}activateMaplibre(){this.maplibreEnabled&&(this.mapViewMode=a.allow3dView&&this.mapViewMode!=="map3d"?"map3d":"map2d",this.maplibreSelected=!0)}deactivateMaplibre(){this.mapViewMode="floorplan",this.maplibreSelected=!1}get hideModeSwitchButton(){return!this.maplibreEnabled||!a.allow3dView||s||a.hideModeSwitchButton}get maplibreEnabled(){const i=this.rootStore.fp?.maplibre??window.__efpMaplibre,p=!!i?.offline&&(!!i.style||!!i.styleUrl);return this.useMaplibreMap&&!!n?.properties?.config&&(this.isOnline||p)}get useMaplibreMap(){return a.enableExperimentalMaplibre??n?.properties?.config?.type==="maplibre"}get showMaplibre(){return this.maplibreEnabled&&(this.mapViewMode==="map2d"||this.mapViewMode==="map3d")}get isMap3d(){return this.maplibreEnabled&&this.mapViewMode==="map3d"}getInitialViewMode(){return this.maplibreEnabled?this.rootStore.uiState.is3DView?"map3d":"map2d":"floorplan"}}t([l],e.prototype,"mapViewMode",void 0),t([l],e.prototype,"maplibreSelected",void 0),t([l],e.prototype,"isOnline",void 0),t([r],e.prototype,"setOnline",null),t([r],e.prototype,"setCameraPort",null),t([r],e.prototype,"clearCameraPortIfCurrent",null),t([r],e.prototype,"activateMaplibre",null),t([r],e.prototype,"deactivateMaplibre",null),t([o({keepAlive:!0})],e.prototype,"hideModeSwitchButton",null),t([o({keepAlive:!0})],e.prototype,"maplibreEnabled",null),t([o({keepAlive:!0})],e.prototype,"useMaplibreMap",null),t([o({keepAlive:!0})],e.prototype,"showMaplibre",null),t([o({keepAlive:!0})],e.prototype,"isMap3d",null);
1
+ import{__decorate as t}from"tslib";import{action as r,computed as o,observable as l}from"mobx";import a from"../data";import{getFpGeo as n}from"../data/fpGeo.js";const s=import.meta.env?.VITE_EXPOFP_DISABLE_3D_TOGGLE!=="false";function d(){return typeof window>"u"||window.navigator.onLine}export default class e{constructor(i){this.mapViewMode="floorplan",this.maplibreSelected=!1,this.isOnline=d(),this.cameraPortBox=l.box(null,{deep:!1}),this.handleOnline=()=>this.setOnline(!0),this.handleOffline=()=>this.setOnline(!1),this.rootStore=i,this.mapViewMode=this.getInitialViewMode(),this.maplibreSelected=this.mapViewMode!=="floorplan",typeof window<"u"&&(window.addEventListener("online",this.handleOnline),window.addEventListener("offline",this.handleOffline))}dispose(){typeof window>"u"||(window.removeEventListener("online",this.handleOnline),window.removeEventListener("offline",this.handleOffline))}setOnline(i){this.isOnline=i}get cameraPort(){return this.cameraPortBox.get()}setCameraPort(i){this.cameraPortBox.set(i)}clearCameraPortIfCurrent(i){this.cameraPortBox.get()===i&&this.cameraPortBox.set(null)}activateMaplibre(){this.maplibreEnabled&&(this.mapViewMode=a.allow3dView&&this.mapViewMode!=="map3d"?"map3d":"map2d",this.maplibreSelected=!0)}deactivateMaplibre(){this.mapViewMode="floorplan",this.maplibreSelected=!1}get hideModeSwitchButton(){return!this.maplibreEnabled||!a.allow3dView||s||a.hideModeSwitchButton}get maplibreEnabled(){const i=this.rootStore.fp?.maplibre??window.__efpMaplibre,p=!!i?.offline&&(!!i.style||!!i.styleUrl);return this.useMaplibreMap&&!!n()?.properties?.config&&(this.isOnline||p)}get useMaplibreMap(){return a.enableExperimentalMaplibre??n()?.properties?.config?.type==="maplibre"}get showMaplibre(){return this.maplibreEnabled&&(this.mapViewMode==="map2d"||this.mapViewMode==="map3d")}get isMap3d(){return this.maplibreEnabled&&this.mapViewMode==="map3d"}getInitialViewMode(){return this.maplibreEnabled?this.rootStore.uiState.is3DView?"map3d":"map2d":"floorplan"}}t([l],e.prototype,"mapViewMode",void 0),t([l],e.prototype,"maplibreSelected",void 0),t([l],e.prototype,"isOnline",void 0),t([r],e.prototype,"setOnline",null),t([r],e.prototype,"setCameraPort",null),t([r],e.prototype,"clearCameraPortIfCurrent",null),t([r],e.prototype,"activateMaplibre",null),t([r],e.prototype,"deactivateMaplibre",null),t([o({keepAlive:!0})],e.prototype,"hideModeSwitchButton",null),t([o({keepAlive:!0})],e.prototype,"maplibreEnabled",null),t([o({keepAlive:!0})],e.prototype,"useMaplibreMap",null),t([o({keepAlive:!0})],e.prototype,"showMaplibre",null),t([o({keepAlive:!0})],e.prototype,"isMap3d",null);
@@ -11,9 +11,22 @@ export default class OverlayStore {
11
11
  private get ui();
12
12
  private get isRouteActive();
13
13
  private get isSearchListOpen();
14
- /** Divisor for the medium sheet height (viewportHeight / multiplier) — larger = shorter sheet. */
14
+ /**
15
+ * Divisor for the medium sheet height (viewportHeight / multiplier) — larger = shorter sheet.
16
+ *
17
+ * Plain `@computed`, deliberately: a `keepAlive` computed never suspends, so
18
+ * it stays registered on its whole transitive dependency chain — which ends
19
+ * at the module-scope locale box in `utils/i18n.ts`. That box outlives the
20
+ * plan, so a keepAlive here pins this store, its `rootStore`, the FloorPlan
21
+ * instance and its render target for the life of the page (ADR-0011). The
22
+ * body is arithmetic; there is nothing to memoize.
23
+ */
15
24
  get mediumSizeMultiplier(): 3 | 7 | 9;
16
- /** Pixels subtracted from viewport height for the full sheet (search box, banners, safe padding). */
25
+ /**
26
+ * Pixels subtracted from viewport height for the full sheet (search box,
27
+ * banners, safe padding). Plain `@computed` for the reason above — this one
28
+ * reaches the locale box through `ui.shouldShowSearchButtons`.
29
+ */
17
30
  get fullSizeOffset(): number;
18
31
  }
19
32
  //# sourceMappingURL=OverlayStore.d.ts.map
@@ -1 +1 @@
1
- import{__decorate as s}from"tslib";import{computed as u}from"mobx";import l from"../data";import{Route as h}from"./RouteStore";export default class e{constructor(t){this.rootStore=t}get ui(){return this.rootStore.uiState}get isRouteActive(){const t=this.ui.selectedRoute;return!!(t?.from&&t?.to)}get isSearchListOpen(){const{list:t}=this.ui;return t.type==="search"||l.isRebooking&&t.type==="exhibitors"}get mediumSizeMultiplier(){return this.isRouteActive?7:this.ui.details?3:this.isSearchListOpen?9:3}get fullSizeOffset(){const t=this.ui,i=t.wsShown?54:0,r=t.bannerType==="free"&&!t.freeBannerDismissed?40:0,o=20;if(t.details&&!(t.details instanceof h))return i+r+o;const n=54,c=t.shouldShowSearchButtons?54:0;return i+r+n+o+c}}s([u({keepAlive:!0})],e.prototype,"mediumSizeMultiplier",null),s([u({keepAlive:!0})],e.prototype,"fullSizeOffset",null);
1
+ import{__decorate as s}from"tslib";import{computed as n}from"mobx";import h from"../data";import{Route as a}from"./RouteStore";export default class e{constructor(t){this.rootStore=t}get ui(){return this.rootStore.uiState}get isRouteActive(){const t=this.ui.selectedRoute;return!!(t?.from&&t?.to)}get isSearchListOpen(){const{list:t}=this.ui;return t.type==="search"||h.isRebooking&&t.type==="exhibitors"}get mediumSizeMultiplier(){return this.isRouteActive?7:this.ui.details?3:this.isSearchListOpen?9:3}get fullSizeOffset(){const t=this.ui,i=t.wsShown?54:0,r=t.bannerType==="free"&&!t.freeBannerDismissed?40:0,o=20;if(t.details&&!(t.details instanceof a))return i+r+o;const u=54,c=t.shouldShowSearchButtons?54:0;return i+r+u+o+c}}s([n],e.prototype,"mediumSizeMultiplier",null),s([n],e.prototype,"fullSizeOffset",null);