@expofp/floorplan 3.25.1 → 3.26.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 (93) hide show
  1. package/dist/browser/{Button-4H7Y1oIu.js → Button-DI5g1CPS.js} +5 -5
  2. package/dist/browser/{CookieConsent-CoWK7bx_.js → CookieConsent-Qws_nQ3N.js} +7 -7
  3. package/dist/browser/{Debug-D-XXdsjt.js → Debug-DTNPNDds.js} +7 -7
  4. package/dist/browser/{Demo-c-7YAVSW.js → Demo-BDZjOBQc.js} +9 -9
  5. package/dist/browser/{Free-MaZo2dmm.js → Free-Cage9TkV.js} +9 -9
  6. package/dist/browser/{GalleryContainer-DOnJhv4I.js → GalleryContainer-EeLKgziN.js} +10 -10
  7. package/dist/browser/{GpsLoader-f-s46e4s.js → GpsLoader-CJMX_mJN.js} +11 -11
  8. package/dist/browser/{KioskStore-B5S4imVV.js → KioskStore-BSza48xl.js} +24 -24
  9. package/dist/browser/{MaplibreAdapter-C848yf6N.js → MaplibreAdapter-evVQiVQj.js} +1589 -1580
  10. package/dist/browser/{ModalContainer-aakS4vkf.js → ModalContainer-CTKDfIyR.js} +10 -10
  11. package/dist/browser/{PermissionNotice-Bnrs8YcD.js → PermissionNotice-O469DuWb.js} +6 -6
  12. package/dist/browser/{SetKioskMode-DzZZyS6g.js → SetKioskMode-DUk4c-Gs.js} +11 -11
  13. package/dist/browser/{ShowKiosk-O_w7S73S.js → ShowKiosk-DumFiuHU.js} +10 -10
  14. package/dist/browser/{ViewerMenuPanel-Db9A3MbQ.js → ViewerMenuPanel-ByFemA_T.js} +10 -10
  15. package/dist/browser/{add-debug-secret-listener-B7IVgt3l.js → add-debug-secret-listener-TLumKuSo.js} +1 -1
  16. package/dist/browser/{adopt-global-settings-CroPYwuh.js → adopt-global-settings-ghJrZaU5.js} +9 -9
  17. package/dist/browser/{boolean-editor-ACHtv3re.js → boolean-editor-WIpm-pFP.js} +9 -9
  18. package/dist/browser/{bootIntercom-wfCldz8i.js → bootIntercom-BR_Ehbyl.js} +2 -2
  19. package/dist/browser/{booth-by-xy-BeNsPAK4.js → booth-by-xy-CyZpg1Fn.js} +287 -287
  20. package/dist/browser/bundle.json +65 -65
  21. package/dist/browser/{classnames-DNJ9erp0.js → classnames-BmlkHMS8.js} +2 -2
  22. package/dist/browser/{client-B0kI_Wgq.js → client-CIHxJZmk.js} +4 -4
  23. package/dist/browser/{components-CH6jzgzD.js → components-7lxOhyyi.js} +1911 -1902
  24. package/dist/browser/{debug-overlay-DPLD8G41.js → debug-overlay-B7jCqVlX.js} +10 -10
  25. package/dist/browser/{debug-ui-BcuP78GL.js → debug-ui-D1ApG52e.js} +6 -6
  26. package/dist/browser/{dist-j5FbLfDv.js → dist-BrF5yJyj.js} +5 -5
  27. package/dist/browser/{dist-DFYO_yWm.js → dist-C67OkD_4.js} +6 -6
  28. package/dist/browser/{dist-D878OZ4g.js → dist-CnpnDA-V.js} +3 -3
  29. package/dist/browser/{efp-debug-init-WBPOkifi.js → efp-debug-init-BqEN61Fo.js} +3 -3
  30. package/dist/browser/{enum-editor-Bo1kcz2P.js → enum-editor-Cy6VeZZd.js} +4 -4
  31. package/dist/browser/{es5-Dw3hh2hq.js → es5-DyV1fctu.js} +2 -2
  32. package/dist/browser/{event-not-found-D8_q8mVF.js → event-not-found-BpFVdXz_.js} +1 -1
  33. package/dist/browser/{exports-CoddzsKD.js → exports-C7NzL4lf.js} +1 -1
  34. package/dist/browser/{favicon-BT321x5p.js → favicon-BHscWjwp.js} +1 -1
  35. package/dist/browser/{fetch-retry.umd-CA8ymopQ.js → fetch-retry.umd-BytZeydp.js} +2 -2
  36. package/dist/browser/{flex-D9q2kF6V.js → flex-BQBLAC6l.js} +5 -5
  37. package/dist/browser/{floorplan.loader-CyQJ2YNJ.js → floorplan.loader-DkaQPhwC.js} +10 -10
  38. package/dist/browser/{floorplan.ready-CNRA40yt.js → floorplan.ready-DwuXZphI.js} +158 -158
  39. package/dist/browser/{fuse-mrwK1iZf.js → fuse-DZTwJ52u.js} +2 -2
  40. package/dist/browser/{i18n-DAfeAZ8S.js → i18n-Bcv8xw_q.js} +5 -5
  41. package/dist/browser/index.js +14 -14
  42. package/dist/browser/{index.module-Dk3kAKpT.js → index.module-BFxDVa3K.js} +4 -4
  43. package/dist/browser/{integrateKiosk-DxVChOVT.js → integrateKiosk-VTNZSSfD.js} +4 -4
  44. package/dist/browser/{is-webview-Co4s-GiT.js → is-webview-CjItzxdV.js} +1 -1
  45. package/dist/browser/{jsx-runtime-BLEarrXz.js → jsx-runtime-CT2c-IhD.js} +2 -2
  46. package/dist/browser/{kiosk-record-Dtemk-B5.js → kiosk-record-v7r7q7t0.js} +1 -1
  47. package/dist/browser/{lib-CLrvaGLZ.js → lib-DGh8lZgT.js} +3 -3
  48. package/dist/browser/{loadImage-CKDCgeht.js → loadImage-a_ahClbD.js} +4 -4
  49. package/dist/browser/{logDeviceInfo-DIsLUyHd.js → logDeviceInfo-DHfa6NcE.js} +9 -9
  50. package/dist/browser/{main-CTB1lHrg.js → main-sUuehgQu.js} +1 -1
  51. package/dist/browser/{mobx-DuryiTxo.js → mobx-dAtztuiQ.js} +4 -4
  52. package/dist/browser/{optional-boolean-editor-CWY6Zx6h.js → optional-boolean-editor-D43-yLO3.js} +3 -3
  53. package/dist/browser/{optional-enum-editor-C8w2_YdD.js → optional-enum-editor-Cvn8TV-x.js} +4 -4
  54. package/dist/browser/{optional-string-editor-BAG27Bz5.js → optional-string-editor-sY0yVw_j.js} +4 -4
  55. package/dist/browser/{particles.min-DG6IF5ip.js → particles.min-BD7iDSr6.js} +2 -2
  56. package/dist/browser/{react-BjxCyCXo.js → react-BJopqGbW.js} +2 -2
  57. package/dist/browser/{react-dom-BbWLMz4w.js → react-dom-B77nDdqp.js} +3 -3
  58. package/dist/browser/{rolldown-runtime-D8LGmHLI.js → rolldown-runtime-BmHtYG9i.js} +1 -1
  59. package/dist/browser/{select-CTX5p1zp.js → select-ByU-Ym6-.js} +10 -10
  60. package/dist/browser/{settings-XnHelA1L.js → settings-CEH1i0Pj.js} +2 -2
  61. package/dist/browser/{settings-item-Dgr7yr9v.js → settings-item-_PTji9Bz.js} +6 -6
  62. package/dist/browser/{store-YlSxEv0I.js → store-Oj0dGPnb.js} +1098 -1037
  63. package/dist/browser/{string-editor-B-DLDQmW.js → string-editor-DaF1t7MK.js} +4 -4
  64. package/dist/browser/{text-field-DlqnEhco.js → text-field-XRLZPyNV.js} +5 -5
  65. package/dist/browser/{theme-DHHsQVr7.js → theme-D0OZcdto.js} +8 -8
  66. package/dist/browser/{ui-ffwGvnRO.js → ui-7ozfXlN3.js} +8 -8
  67. package/dist/browser/{useRenderTarget-CAxp6qGQ.js → useRenderTarget-BG295f3e.js} +4 -4
  68. package/dist/esm/components/Booth/Booth.js +1 -1
  69. package/dist/esm/components/Event.js +1 -1
  70. package/dist/esm/components/Exhibitor.js +1 -1
  71. package/dist/esm/components/Layout.js +1 -1
  72. package/dist/esm/components/Maplibre/MaplibreAdapter.js +1 -1
  73. package/dist/esm/components/Speaker.js +1 -1
  74. package/dist/esm/floorplan.ready.js +1 -1
  75. package/dist/esm/services/url-sync.js +1 -1
  76. package/dist/esm/store/HeatmapStore.d.ts +9 -0
  77. package/dist/esm/store/RootStore.js +1 -1
  78. package/dist/esm/store/ShortcutRegistry.d.ts +14 -0
  79. package/dist/esm/store/ShortcutRegistry.js +1 -1
  80. package/dist/esm/store/providers/SessionsSubButtonProvider.d.ts +18 -0
  81. package/dist/esm/store/providers/SessionsSubButtonProvider.js +1 -1
  82. package/dist/esm/store/search-buttons/SearchButtonsActions.d.ts +15 -2
  83. package/dist/esm/store/search-buttons/SearchButtonsActions.js +1 -1
  84. package/dist/esm/store/search-buttons/SearchButtonsFactory.js +1 -1
  85. package/dist/esm/store/search-buttons/SearchButtonsStore.d.ts +3 -3
  86. package/dist/esm/store/search-buttons/SearchButtonsStore.js +1 -1
  87. package/dist/esm/tools/gtag.d.ts +1 -0
  88. package/dist/esm/tools/gtag.js +1 -1
  89. package/dist/esm/tools/telemetry.d.ts +2 -0
  90. package/dist/esm/tools/telemetry.js +1 -1
  91. package/dist/esm/tools/track-event.d.ts +26 -2
  92. package/dist/esm/tools/track-event.js +1 -1
  93. package/package.json +9 -9
@@ -7,6 +7,20 @@ export declare class ShortcutRegistry {
7
7
  getShortcuts(interfaceId: string): ShortcutConfig[];
8
8
  private sortShortcuts;
9
9
  handleShortcutClick(interfaceId: string, shortcutId: string): void;
10
+ /**
11
+ * Reports a chip click to stats, using the `action` each provider already
12
+ * declares rather than guessing from `active`:
13
+ *
14
+ * - `toggle` — `active` IS the filter, so only the click that turns it on is
15
+ * a view of it; turning it off is not.
16
+ * - `custom` — opens a panel or a list on every click, while `active` says
17
+ * whether a filter happens to be set. Reading `active` here would drop
18
+ * every re-open made after the first selection.
19
+ *
20
+ * Tagged `shortcut` so these stay separable from the main button row, whose
21
+ * `sbtnview` carries no subtype.
22
+ */
23
+ private reportClick;
10
24
  private isShortcutActive;
11
25
  handleShortcutReset(interfaceId: string, shortcutId: string): void;
12
26
  private updateActivationOrder;
@@ -1 +1 @@
1
- export class ShortcutRegistry{constructor(){this.providers=new Map,this.activationOrder=new Map}register(t){if(!t?.id)throw new Error("Provider must have a valid id");this.providers.set(t.id,t)}unregister(t){this.providers.delete(t),this.activationOrder.delete(t)}getShortcuts(t){const e=this.providers.get(t);if(!e)return[];const i=e.createShortcuts(),r=this.activationOrder.get(t);return r?this.sortShortcuts(i,r):i}sortShortcuts(t,e){const i=new Map(e.map((r,s)=>[r,s]));return t.sort((r,s)=>{if(r.active!==s.active)return r.active?-1:1;if(r.active&&s.active){const o=i.get(r.id),n=i.get(s.id);return o!==void 0&&n!==void 0?o-n:(o!==void 0?-1:0)-(n!==void 0?-1:0)}return 0})}handleShortcutClick(t,e){const i=this.providers.get(t);if(!i)return;const r=this.isShortcutActive(i,e);i.handleShortcutClick(e);const s=this.isShortcutActive(i,e);r!==s&&this.updateActivationOrder(t,e,r,s)}isShortcutActive(t,e){return t.createShortcuts().find(r=>r.id===e)?.active??!1}handleShortcutReset(t,e){const i=this.providers.get(t);if(!i?.handleShortcutReset)return;i.handleShortcutReset(e),this.activationOrder.get(t)?.includes(e)&&this.updateActivationOrder(t,e,!0,!1)}updateActivationOrder(t,e,i,r){const s=this.activationOrder.get(t)||[];let o;if(!i&&r)o=s.includes(e)?s:[...s,e];else if(i&&!r)o=s.filter(n=>n!==e);else return;o.length>0?this.activationOrder.set(t,o):this.activationOrder.delete(t)}updateActivationOrderFromState(t,e,i,r){this.updateActivationOrder(t,e,i,r)}shouldShowShortcuts(t){return this.providers.get(t)?.shouldShowShortcuts?.()??!0}getRegisteredProviders(){return Array.from(this.providers.keys())}isProviderRegistered(t){return this.providers.has(t)}clear(){this.providers.clear(),this.activationOrder.clear()}}
1
+ import c from"../tools/track-event";export class ShortcutRegistry{constructor(){this.providers=new Map,this.activationOrder=new Map}register(t){if(!t?.id)throw new Error("Provider must have a valid id");this.providers.set(t.id,t)}unregister(t){this.providers.delete(t),this.activationOrder.delete(t)}getShortcuts(t){const e=this.providers.get(t);if(!e)return[];const r=e.createShortcuts(),i=this.activationOrder.get(t);return i?this.sortShortcuts(r,i):r}sortShortcuts(t,e){const r=new Map(e.map((i,s)=>[i,s]));return t.sort((i,s)=>{if(i.active!==s.active)return i.active?-1:1;if(i.active&&s.active){const o=r.get(i.id),n=r.get(s.id);return o!==void 0&&n!==void 0?o-n:(o!==void 0?-1:0)-(n!==void 0?-1:0)}return 0})}handleShortcutClick(t,e){const r=this.providers.get(t);if(!r)return;const i=r.createShortcuts().find(n=>n.id===e),s=i?.active??!1;r.handleShortcutClick(e);const o=this.isShortcutActive(r,e);this.reportClick(i,s,o),s!==o&&this.updateActivationOrder(t,e,s,o)}reportClick(t,e,r){if(!t||!(t.action==="custom"||!e&&r))return;const s=t.label||t.id;s&&c("sbtnview",s,"shortcut")}isShortcutActive(t,e){return t.createShortcuts().find(i=>i.id===e)?.active??!1}handleShortcutReset(t,e){const r=this.providers.get(t);if(!r?.handleShortcutReset)return;r.handleShortcutReset(e),this.activationOrder.get(t)?.includes(e)&&this.updateActivationOrder(t,e,!0,!1)}updateActivationOrder(t,e,r,i){const s=this.activationOrder.get(t)||[];let o;if(!r&&i)o=s.includes(e)?s:[...s,e];else if(r&&!i)o=s.filter(n=>n!==e);else return;o.length>0?this.activationOrder.set(t,o):this.activationOrder.delete(t)}updateActivationOrderFromState(t,e,r,i){this.updateActivationOrder(t,e,r,i)}shouldShowShortcuts(t){return this.providers.get(t)?.shouldShowShortcuts?.()??!0}getRegisteredProviders(){return Array.from(this.providers.keys())}isProviderRegistered(t){return this.providers.has(t)}clear(){this.providers.clear(),this.activationOrder.clear()}}
@@ -9,6 +9,24 @@ export declare class SessionsSubButtonProvider extends BaseSubButtonProvider {
9
9
  createSubButtons(): SearchSubButtonConfig[];
10
10
  handleSubButtonClick(subButtonId: string): void;
11
11
  shouldShowSubButtons(): boolean;
12
+ /**
13
+ * Reports a sub-button click to stats. Must run BEFORE the handler mutates
14
+ * state, because it compares against the sub-button currently selected — a
15
+ * click on the one already selected is not a new view of it. (The store's
16
+ * `handleSubButtonClick` guards the same case the same way, but the UI calls
17
+ * the `onClick` baked into each config and never reaches that guard.)
18
+ *
19
+ * Deliberately NOT the button's own `active`: `sessions_show_all` is also
20
+ * active whenever no sub-button and no track are selected — the state every
21
+ * path that opens the sessions list leaves behind — which made the first
22
+ * "All Tracks" click, the most common one there is, structurally impossible
23
+ * to report.
24
+ *
25
+ * Captions are data (`track.name`) or a plain literal, never `t()`, so the
26
+ * value is stable across locales. Tagged `subbutton` to keep this row
27
+ * separable from the main button row.
28
+ */
29
+ private reportActivation;
12
30
  private handleSessionsShowAllClick;
13
31
  private handleSessionsTrackClick;
14
32
  }
@@ -1 +1 @@
1
- import{__decorate as r}from"tslib";import{computed as i}from"mobx";import{BaseSubButtonProvider as n}from"../SubButtonProvider";export class SessionsSubButtonProvider extends n{constructor(t){super(),this.rootStore=t,this.id="sessions"}get computedSubButtons(){const t=[];return t.push({id:"sessions_show_all",label:"All Tracks",text:"All Tracks",enabled:!0,active:this.rootStore.searchButtonsStore.activeSubButtonId==="sessions_show_all"||!this.rootStore.searchButtonsStore.activeSubButtonId&&!this.rootStore.uiState.selectedTrack,parentButtonId:"sessions",type:"show_all",onClick:()=>this.handleSessionsShowAllClick()}),this.rootStore.eventStore.tracks.forEach(s=>{const e=this.rootStore.eventStore.getEventsByTrack(s.id).length;t.push({id:`sessions_track_${s.id}`,label:s.name,text:s.name,enabled:!0,active:this.rootStore.searchButtonsStore.activeSubButtonId===`sessions_track_${s.id}`,parentButtonId:"sessions",type:"track",data:s,count:e,onClick:()=>this.handleSessionsTrackClick(s)})}),t}createSubButtons(){return this.computedSubButtons}handleSubButtonClick(t){if(t==="sessions_show_all")this.handleSessionsShowAllClick();else if(t.startsWith("sessions_track_")){const s=parseInt(t.replace("sessions_track_","")),e=this.rootStore.eventStore.tracks.find(o=>o.id===s);e&&this.handleSessionsTrackClick(e)}}shouldShowSubButtons(){return this.rootStore.eventStore.tracks.length>0}handleSessionsShowAllClick(){this.rootStore.uiState.list={type:"sessions",text:"",focused:!1},this.rootStore.uiState.selectedTrack=null,this.rootStore.searchButtonsStore.setSubButtonId("sessions_show_all")}handleSessionsTrackClick(t){this.rootStore.uiState.list={type:"sessions",text:"",focused:!1},this.rootStore.uiState.selectedTrack=t,this.rootStore.searchButtonsStore.setSubButtonId(`sessions_track_${t.id}`)}}r([i],SessionsSubButtonProvider.prototype,"computedSubButtons",null);
1
+ import{__decorate as r}from"tslib";import{computed as i}from"mobx";import n from"../../tools/track-event";import{BaseSubButtonProvider as a}from"../SubButtonProvider";export class SessionsSubButtonProvider extends a{constructor(t){super(),this.rootStore=t,this.id="sessions"}get computedSubButtons(){const t=[];return t.push({id:"sessions_show_all",label:"All Tracks",text:"All Tracks",enabled:!0,active:this.rootStore.searchButtonsStore.activeSubButtonId==="sessions_show_all"||!this.rootStore.searchButtonsStore.activeSubButtonId&&!this.rootStore.uiState.selectedTrack,parentButtonId:"sessions",type:"show_all",onClick:()=>this.handleSessionsShowAllClick()}),this.rootStore.eventStore.tracks.forEach(s=>{const e=this.rootStore.eventStore.getEventsByTrack(s.id).length;t.push({id:`sessions_track_${s.id}`,label:s.name,text:s.name,enabled:!0,active:this.rootStore.searchButtonsStore.activeSubButtonId===`sessions_track_${s.id}`,parentButtonId:"sessions",type:"track",data:s,count:e,onClick:()=>this.handleSessionsTrackClick(s)})}),t}createSubButtons(){return this.computedSubButtons}handleSubButtonClick(t){if(t==="sessions_show_all")this.handleSessionsShowAllClick();else if(t.startsWith("sessions_track_")){const s=parseInt(t.replace("sessions_track_","")),e=this.rootStore.eventStore.tracks.find(o=>o.id===s);e&&this.handleSessionsTrackClick(e)}}shouldShowSubButtons(){return this.rootStore.eventStore.tracks.length>0}reportActivation(t){if(this.rootStore.searchButtonsStore.activeSubButtonId===t)return;const s=this.computedSubButtons.find(e=>e.id===t);!s||!s.label||n("sbtnview",s.label,"subbutton")}handleSessionsShowAllClick(){this.reportActivation("sessions_show_all"),this.rootStore.uiState.list={type:"sessions",text:"",focused:!1},this.rootStore.uiState.selectedTrack=null,this.rootStore.searchButtonsStore.setSubButtonId("sessions_show_all")}handleSessionsTrackClick(t){this.reportActivation(`sessions_track_${t.id}`),this.rootStore.uiState.list={type:"sessions",text:"",focused:!1},this.rootStore.uiState.selectedTrack=t,this.rootStore.searchButtonsStore.setSubButtonId(`sessions_track_${t.id}`)}}r([i],SessionsSubButtonProvider.prototype,"computedSubButtons",null);
@@ -6,10 +6,23 @@ export declare class SearchButtonsActions {
6
6
  private state;
7
7
  private filters;
8
8
  constructor(rootStore: RootStore, state: SearchButtonsState, filters: SearchButtonsFilters);
9
- handleSearchButtonClick(searchButtonId: string): void;
9
+ /**
10
+ * Reports a search-button click to stats. Called only from the branch of a
11
+ * handler that turns the button ON: the click that switches a filter off is
12
+ * not a view of it. Deriving that from the button's `active` prop instead
13
+ * would be wrong — `active` is a display flag whose meaning differs per
14
+ * button (for Categories it means "filters are applied", not "panel open"),
15
+ * so only the handler knows what its own click did.
16
+ *
17
+ * `caption` is the button's configured name, NOT the rendered label: the
18
+ * label is run through `tIfExists`, so reporting it would split one button
19
+ * into one analytics series per locale.
20
+ */
21
+ private reportActivation;
22
+ handleSearchButtonClick(searchButtonId: string, caption?: string): void;
10
23
  handleExtendedSearchButtonClick(buttonId: string): void;
11
24
  handleMainButtonClick(buttonId: string): void;
12
- handleSessionsClick(): void;
25
+ handleSessionsClick(caption?: string): void;
13
26
  togglePoiType(poiTypeId: number): void;
14
27
  clearAllFilters(): void;
15
28
  showSubButtons(parentButtonId: string): void;
@@ -1 +1 @@
1
- import{__decorate as s}from"tslib";import{action as l}from"mobx";import{MOBILE_BREAKPOINT as a}from"../../constants";import{PREFIXES as h,SearchButtonType as r}from"./constants";import{extractPoiTypeId as n,getButtonConfig as c}from"./utils";export class SearchButtonsActions{constructor(t,e,i){this.rootStore=t,this.state=e,this.filters=i}handleSearchButtonClick(t){const i={[r.BOOKMARKS]:()=>this.handleBookmarksClick(),[r.VISITED]:()=>this.handleVisitedClick(),[r.SESSIONS]:()=>this.handleSessionsClick(),[r.TOURS]:()=>this.handleToursClick(),[r.CATEGORIES]:()=>this.handleCategoriesClick(),[r.EXHIBITORS]:()=>this.handleExhibitorsClick()}[t];if(i){i();return}t.startsWith(h.POI_TYPE)&&this.handlePoiTypeClick(t)}handleExtendedSearchButtonClick(t){const e=c(t);if(!e)return;if(e.type==="link"){this.handleLinkClick(e);return}const i=e.children?.filter(o=>o.visible)||[];if(i.length===1&&i[0].type==="poi_types"&&i[0].name===e.name){this.handleSearchButtonClick(t);return}e.children&&i.length>0?this.handleParentButton(t,e):this.handleSearchButtonClick(t)}handleMainButtonClick(t){this.handleSearchButtonClick(t)}handleSessionsClick(){const{uiState:t}=this.rootStore;t.list.type==="sessions"?this.switchToSearch():(this.resetAllFilters(),t.details=null,t.menu=!1,t.list={type:"sessions",text:"",focused:!1},this.state.setSubButton(null),t.selectedTrack=null,this.state.subButtonsEnabled&&this.showSubButtons("sessions"),this.isMobile&&(t.desiredOverlaySize="full"))}togglePoiType(t){this.handleSearchButtonClick(`${h.POI_TYPE}${t}`)}clearAllFilters(){this.switchToSearch()}showSubButtons(t){this.state.subButtonsEnabled&&(this.state.setSubButtonParent(t),this.state.setSubButton(null),this.rootStore.uiState.subButtonsVisible=!0)}hideSubButtons(){this.state.setSubButtonParent(null),this.state.setSubButton(null),this.rootStore.uiState.subButtonsVisible=!1}handleSubButtonClick(t){this.state.activeSubButtonId!==t&&this.state.setSubButton(t)}toggleListView(t,e){this.rootStore.uiState.list.type===t?this.switchToSearch():(this.resetAllFilters(),e())}handleBookmarksClick(){this.toggleListView("bookmarks",()=>{this.rootStore.clickBookmarks()})}handleVisitedClick(){this.toggleListView("visited",()=>{this.rootStore.clickVisited()})}handleToursClick(){const{uiState:t}=this.rootStore;t.list.type==="tours"?this.switchToSearch():(this.resetAllFilters(),t.details=null,t.menu=!1,t.list={type:"tours",text:"",focused:!1},this.isMobile&&(t.desiredOverlaySize="full"))}handleCategoriesClick(){const{uiState:t}=this.rootStore;t.list.type!=="search"?this.switchToSearch():this.state.activePoiFilterId&&this.filters.clearPoiTypeFilters(),this.state.searchShortcutState.activeParentId&&(this.state.setActiveParentId(null),this.state.clearChildren(),this.state.showShortcuts(!1),this.filters.clearAllChildFilters()),this.rootStore.categoryFilterStore.openFilter()}handleExhibitorsClick(){const{uiState:t}=this.rootStore;t.list.type==="exhibitors"?this.switchToSearch():(this.resetAllFilters(),t.details=null,t.menu=!1,t.list={type:"exhibitors",text:"",focused:!1},this.isMobile&&(t.desiredOverlaySize="full"))}handlePoiTypeClick(t){const{uiState:e}=this.rootStore,i=e.list.type==="search"&&e.list.text||"";e.list.type!=="search"?this.switchToSearch(!0):e.selectedCategoryFilters.length>0&&this.filters.clearCategoryFilters(),this.state.searchShortcutState.activeParentId&&(this.state.setActiveParentId(null),this.state.clearChildren(),this.state.showShortcuts(!1),this.filters.clearAllChildFilters()),this.state.activePoiFilterId===t?this.filters.clearPoiTypeFilters():this.setPoiFilterFromString(t),i&&e.list.type==="search"&&(e.list={type:"search",text:i,focused:!1}),this.rootStore.searchStore.selectSearchAndFocus(i)}handleLinkClick(t){const e=t.children?.find(i=>i.type==="link");e&&"linkUrl"in e&&window.open(e.linkUrl,"_blank")}handleParentButton(t,e){const{uiState:i}=this.rootStore;if(this.state.searchShortcutState.activeParentId===t){this.state.setActiveParentId(null),this.state.clearChildren(),this.state.showShortcuts(!1),this.filters.clearAllChildFilters(),this.rootStore.urlFilterManager.clearAllFilters(),i.centerMap=!0,i.overlaySize==="full"&&i.searchFocused&&this.rootStore.searchStore.setFocused(!1);return}i.list.type!=="search"&&this.switchToSearch(),this.state.activePoiFilterId&&this.state.setPoiFilter(null),this.state.setActiveParentId(t),this.state.showShortcuts(!0),this.state.clearChildren(),this.filters.applyAllChildrenFilters(e),this.rootStore.searchStore.selectSearchAndFocus()}preserveSearchText(t){const{uiState:e}=this.rootStore,i=e.list.type==="search"&&e.list.text||"";t(),e.list.type==="search"&&i&&(e.list={type:"search",text:i,focused:!1})}switchToSearch(t=!1){const e=()=>{this.resetAllFilters(),this.rootStore.uiState.details=null,this.rootStore.uiState.menu=!1,this.rootStore.uiState.list={type:"search",text:"",focused:!1}};t?this.preserveSearchText(e):e()}resetAllFilters(){this.state.reset(),this.rootStore.uiState.selectedPoiTypeFilters=[],this.rootStore.uiState.selectedCategoryFilters=[],this.rootStore.uiState.categoryFilterOpen=!1,this.rootStore.categoryFilterStore.state.selectedItems=[],this.rootStore.categoryFilterStore.state.pendingItems=[],this.rootStore.urlFilterManager.clearAllFilters(),this.rootStore.fp.hidePathways()}setPoiFilterFromString(t){this.state.setPoiFilter(t);const e=n(t);if(e!==null){const i=this.rootStore.poiTypeStore.poiTypes.find(o=>o.id===e);i&&(this.rootStore.uiState.selectedPoiTypeFilters=[i],this.rootStore.urlFilterManager.setPoiType(i.name))}}get isMobile(){return typeof window<"u"&&window.innerWidth<=a}}s([l],SearchButtonsActions.prototype,"handleSearchButtonClick",null),s([l],SearchButtonsActions.prototype,"handleExtendedSearchButtonClick",null),s([l],SearchButtonsActions.prototype,"handleMainButtonClick",null),s([l],SearchButtonsActions.prototype,"handleSessionsClick",null),s([l],SearchButtonsActions.prototype,"togglePoiType",null),s([l],SearchButtonsActions.prototype,"clearAllFilters",null),s([l],SearchButtonsActions.prototype,"showSubButtons",null),s([l],SearchButtonsActions.prototype,"hideSubButtons",null),s([l],SearchButtonsActions.prototype,"handleSubButtonClick",null);
1
+ import{__decorate as r}from"tslib";import{action as l}from"mobx";import{MOBILE_BREAKPOINT as n}from"../../constants";import c from"../../tools/track-event";import{PREFIXES as a,SearchButtonType as o}from"./constants";import{extractPoiTypeId as u,getButtonConfig as S}from"./utils";export class SearchButtonsActions{constructor(e,t,i){this.rootStore=e,this.state=t,this.filters=i}reportActivation(e){e&&c("sbtnview",e)}handleSearchButtonClick(e,t){const s={[o.BOOKMARKS]:()=>this.handleBookmarksClick(t),[o.VISITED]:()=>this.handleVisitedClick(t),[o.SESSIONS]:()=>this.handleSessionsClick(t),[o.TOURS]:()=>this.handleToursClick(t),[o.CATEGORIES]:()=>this.handleCategoriesClick(t),[o.EXHIBITORS]:()=>this.handleExhibitorsClick(t)}[e];if(s){s();return}e.startsWith(a.POI_TYPE)&&this.handlePoiTypeClick(e,t)}handleExtendedSearchButtonClick(e){const t=S(e);if(!t)return;const i=t.name;if(t.type==="link"){this.handleLinkClick(t,i);return}const s=t.children?.filter(h=>h.visible)||[];if(s.length===1&&s[0].type==="poi_types"&&s[0].name===t.name){this.handleSearchButtonClick(e,i);return}t.children&&s.length>0?this.handleParentButton(e,t,i):this.handleSearchButtonClick(e,i)}handleMainButtonClick(e){this.handleSearchButtonClick(e)}handleSessionsClick(e){const{uiState:t}=this.rootStore;t.list.type==="sessions"?this.switchToSearch():(this.reportActivation(e),this.resetAllFilters(),t.details=null,t.menu=!1,t.list={type:"sessions",text:"",focused:!1},this.state.setSubButton(null),t.selectedTrack=null,this.state.subButtonsEnabled&&this.showSubButtons("sessions"),this.isMobile&&(t.desiredOverlaySize="full"))}togglePoiType(e){this.handleSearchButtonClick(`${a.POI_TYPE}${e}`)}clearAllFilters(){this.switchToSearch()}showSubButtons(e){this.state.subButtonsEnabled&&(this.state.setSubButtonParent(e),this.state.setSubButton(null),this.rootStore.uiState.subButtonsVisible=!0)}hideSubButtons(){this.state.setSubButtonParent(null),this.state.setSubButton(null),this.rootStore.uiState.subButtonsVisible=!1}handleSubButtonClick(e){this.state.activeSubButtonId!==e&&this.state.setSubButton(e)}toggleListView(e,t,i){this.rootStore.uiState.list.type===e?this.switchToSearch():(this.reportActivation(i),this.resetAllFilters(),t())}handleBookmarksClick(e){this.toggleListView("bookmarks",()=>{this.rootStore.clickBookmarks()},e)}handleVisitedClick(e){this.toggleListView("visited",()=>{this.rootStore.clickVisited()},e)}handleToursClick(e){const{uiState:t}=this.rootStore;t.list.type==="tours"?this.switchToSearch():(this.reportActivation(e),this.resetAllFilters(),t.details=null,t.menu=!1,t.list={type:"tours",text:"",focused:!1},this.isMobile&&(t.desiredOverlaySize="full"))}handleCategoriesClick(e){const{uiState:t}=this.rootStore;this.reportActivation(e),t.list.type!=="search"?this.switchToSearch():this.state.activePoiFilterId&&this.filters.clearPoiTypeFilters(),this.state.searchShortcutState.activeParentId&&(this.state.setActiveParentId(null),this.state.clearChildren(),this.state.showShortcuts(!1),this.filters.clearAllChildFilters()),this.rootStore.categoryFilterStore.openFilter()}handleExhibitorsClick(e){const{uiState:t}=this.rootStore;t.list.type==="exhibitors"?this.switchToSearch():(this.reportActivation(e),this.resetAllFilters(),t.details=null,t.menu=!1,t.list={type:"exhibitors",text:"",focused:!1},this.isMobile&&(t.desiredOverlaySize="full"))}handlePoiTypeClick(e,t){const{uiState:i}=this.rootStore,s=this.state.activePoiFilterId!==e;s&&this.reportActivation(t);const h=i.list.type==="search"&&i.list.text||"";i.list.type!=="search"?this.switchToSearch(!0):i.selectedCategoryFilters.length>0&&this.filters.clearCategoryFilters(),this.state.searchShortcutState.activeParentId&&(this.state.setActiveParentId(null),this.state.clearChildren(),this.state.showShortcuts(!1),this.filters.clearAllChildFilters()),s?this.setPoiFilterFromString(e):this.filters.clearPoiTypeFilters(),h&&i.list.type==="search"&&(i.list={type:"search",text:h,focused:!1}),this.rootStore.searchStore.selectSearchAndFocus(h)}handleLinkClick(e,t){const i=e.children?.find(s=>s.type==="link");i&&"linkUrl"in i&&(this.reportActivation(t),window.open(i.linkUrl,"_blank"))}handleParentButton(e,t,i){const{uiState:s}=this.rootStore;if(this.state.searchShortcutState.activeParentId===e){this.state.setActiveParentId(null),this.state.clearChildren(),this.state.showShortcuts(!1),this.filters.clearAllChildFilters(),this.rootStore.urlFilterManager.clearAllFilters(),s.centerMap=!0,s.overlaySize==="full"&&s.searchFocused&&this.rootStore.searchStore.setFocused(!1);return}this.reportActivation(i),s.list.type!=="search"&&this.switchToSearch(),this.state.activePoiFilterId&&this.state.setPoiFilter(null),this.state.setActiveParentId(e),this.state.showShortcuts(!0),this.state.clearChildren(),this.filters.applyAllChildrenFilters(t),this.rootStore.searchStore.selectSearchAndFocus()}preserveSearchText(e){const{uiState:t}=this.rootStore,i=t.list.type==="search"&&t.list.text||"";e(),t.list.type==="search"&&i&&(t.list={type:"search",text:i,focused:!1})}switchToSearch(e=!1){const t=()=>{this.resetAllFilters(),this.rootStore.uiState.details=null,this.rootStore.uiState.menu=!1,this.rootStore.uiState.list={type:"search",text:"",focused:!1}};e?this.preserveSearchText(t):t()}resetAllFilters(){this.state.reset(),this.rootStore.uiState.selectedPoiTypeFilters=[],this.rootStore.uiState.selectedCategoryFilters=[],this.rootStore.uiState.categoryFilterOpen=!1,this.rootStore.categoryFilterStore.state.selectedItems=[],this.rootStore.categoryFilterStore.state.pendingItems=[],this.rootStore.urlFilterManager.clearAllFilters(),this.rootStore.fp.hidePathways()}setPoiFilterFromString(e){this.state.setPoiFilter(e);const t=u(e);if(t!==null){const i=this.rootStore.poiTypeStore.poiTypes.find(s=>s.id===t);i&&(this.rootStore.uiState.selectedPoiTypeFilters=[i],this.rootStore.urlFilterManager.setPoiType(i.name))}}get isMobile(){return typeof window<"u"&&window.innerWidth<=n}}r([l],SearchButtonsActions.prototype,"handleSearchButtonClick",null),r([l],SearchButtonsActions.prototype,"handleExtendedSearchButtonClick",null),r([l],SearchButtonsActions.prototype,"handleMainButtonClick",null),r([l],SearchButtonsActions.prototype,"handleSessionsClick",null),r([l],SearchButtonsActions.prototype,"togglePoiType",null),r([l],SearchButtonsActions.prototype,"clearAllFilters",null),r([l],SearchButtonsActions.prototype,"showSubButtons",null),r([l],SearchButtonsActions.prototype,"hideSubButtons",null),r([l],SearchButtonsActions.prototype,"handleSubButtonClick",null);
@@ -1 +1 @@
1
- import h from"../../data";import{getContrastTextColor as l}from"../../utils/getContrastTextColor";import{tIfExists as d}from"../../utils/i18n";import{BUTTON_ICONS as u,PREFIXES as a,SearchButtonType as i}from"./constants";export class SearchButtonsFactory{constructor(t,e,o){this.rootStore=t,this.state=e,this.actions=o,this.buttonFactories={[i.BOOKMARKS]:r=>this.createBookmarksButton(r),[i.VISITED]:r=>this.createVisitedButton(r),[i.CATEGORIES]:r=>this.createCategoriesButton(r),[i.SESSIONS]:r=>this.createSessionsButton(r),[i.TOURS]:r=>this.createGuidedToursButton(r),[i.POI_TYPE]:r=>this.createPoiTypeButton(r),[i.POI_TYPES]:r=>this.createPoiTypesButton(r),[i.LINK]:r=>this.createLinkButton(r),[i.EXHIBITORS]:r=>this.createExhibitorsButton(r)}}createButtons(t){return this.dedupeButtons(t).filter(e=>e.visible).map(e=>({button:this.createButton(e),order:e.order??Number.MAX_SAFE_INTEGER})).filter(e=>e.button!==null).sort((e,o)=>e.order-o.order).map(e=>e.button)}createButton(t){const e=this.buttonFactories[t.type];return e?e(t):null}createBaseButton(t){const e=t.color&&t.color.toUpperCase()!=="#FFFFFF",o=d(t.name);return{id:t.id||`${t.type}_${t.name}`,label:o,text:o,enabled:!0,isDimmed:!1,isClickable:!0,backgroundColor:e?t.color:void 0,textColor:e&&t.color?l(t.color):void 0}}createButtonId(t,e){return e.id||`${t}${e.name}`}createBookmarksButton(t){const{uiState:e}=this.rootStore;return e.kiosk||e.disableBookmarked||h.hideBookmarks?null:{...this.createBaseButton(t),id:i.BOOKMARKS,icon:u.BOOKMARKS,active:e.list.type==="bookmarks",count:this.countBookmarks(),onClick:()=>this.actions.handleSearchButtonClick(i.BOOKMARKS)}}createVisitedButton(t){const{uiState:e}=this.rootStore;return e.kiosk?null:{...this.createBaseButton(t),id:i.VISITED,icon:u.VISITED,active:e.list.type==="visited",count:this.countVisited(),onClick:()=>this.actions.handleSearchButtonClick(i.VISITED)}}createCategoriesButton(t){if(!t.children?.length){const n=this.getCategoriesTotalCount();return n>0?this.createSimpleCategoriesButton(t,n):null}const e=(t.children||[]).filter(n=>n.visible);if(e.length===0)return null;const o=this.createButtonId(a.CATEGORIES,t),r=e.filter(n=>n.type==="categories"),s=this.countCategories(r);return{...this.createBaseButton(t),id:o,active:this.state.searchShortcutState.activeParentId===o,count:s,showZeroCount:!0,onClick:()=>this.actions.handleExtendedSearchButtonClick(o)}}createSimpleCategoriesButton(t,e){const{uiState:o}=this.rootStore,r=o.selectedCategoryFilters.length>0?o.selectedCategoryFilters.length:e;return{...this.createBaseButton(t),id:i.CATEGORIES,active:o.selectedCategoryFilters.length>0&&!this.state.searchShortcutState.activeParentId,count:r,showZeroCount:!0,onClick:()=>this.actions.handleSearchButtonClick(i.CATEGORIES)}}createSessionsButton(t){const{uiState:e}=this.rootStore,o=this.getSessionsTotalCount();return o===0?null:{...this.createBaseButton(t),id:i.SESSIONS,icon:u.SESSIONS,active:e.list.type==="sessions",count:o,showZeroCount:!0,hasSubButtons:!0,onClick:()=>this.actions.handleSessionsClick()}}createGuidedToursButton(t){const{uiState:e}=this.rootStore,o=this.getGuidedToursTotalCount();return o===0?null:{...this.createBaseButton(t),id:"guided_tours",active:e.list.type==="tours"||e.list.type==="multi-point-tour",count:o,showZeroCount:!0,onClick:()=>this.actions.handleSearchButtonClick("guided_tours")}}createPoiTypeButton(t){const e=this.rootStore.poiTypeStore.poiTypes.find(s=>s.name===t.name);if(!e)return null;const o=`${a.POI_TYPE}${e.id}`,r=this.getPoiTypeTotalCount(e.id);return r===0?null:{...this.createBaseButton(t),id:o,active:this.state.activePoiFilterId===o,count:r,showZeroCount:!0,onClick:()=>this.actions.handleSearchButtonClick(o)}}createPoiTypesButton(t){if(!t.children?.length)return this.createPoiTypeButton(t);const e=t.children.filter(n=>n.visible);if(e.length===0)return null;if(this.shouldFlattenToSinglePoiType(e,t))return this.createPoiTypeButton(t);const o=e.filter(n=>n.type!=="link"),r=this.countPoiTypes(o),s=this.createButtonId(a.POI_TYPES,t);return{...this.createBaseButton(t),id:s,active:this.state.searchShortcutState.activeParentId===s,count:r,showZeroCount:!0,onClick:()=>this.actions.handleExtendedSearchButtonClick(s)}}shouldFlattenToSinglePoiType(t,e){return t.length===1&&t[0].type==="poi_types"&&t[0].name===e.name}createLinkButton(t){const e=this.createButtonId(a.LINK,t);return{...this.createBaseButton(t),id:e,active:!1,onClick:()=>this.actions.handleExtendedSearchButtonClick(e)}}createExhibitorsButton(t){const{uiState:e}=this.rootStore,o=this.getExhibitorsTotalCount();return o===0?null:{...this.createBaseButton(t),id:i.EXHIBITORS,icon:u.EXHIBITORS,active:e.list.type==="exhibitors",count:o,showZeroCount:!0,onClick:()=>this.actions.handleSearchButtonClick(i.EXHIBITORS)}}countCategories(t){const{categoryById:e}=this.rootStore.categoryStore,o=new Set;return t.forEach(r=>{if(r.type!=="categories")return;const s=e.get(Number(r.id));s&&s.exhibitors.forEach(n=>o.add(n.id))}),o.size}countPoiTypes(t){return t.reduce((e,o)=>{if(o.type!=="poi_types")return e;if(o.count!==void 0)return e+o.count;const r=Number(o.id),s=this.rootStore.poiTypeStore.poiTypes.find(n=>n.id===r);if(s){const n=this.rootStore.boothStore.booths.filter(c=>c.poiTypeId===s.id).length;return e+n}return e},0)}dedupeButtons(t){const e=new Set;return t.filter(o=>{const r=`${o.type}_${o.name}`;return e.has(r)?!1:(e.add(r),!0)})}countBookmarks(){return this.rootStore.exhibitorStore.bookmarked.length+this.rootStore.eventStore.bookmarked.length+this.rootStore.speakerStore.bookmarked.length+this.rootStore.boothStore.booths.filter(t=>t.exhibitors.length===0&&t.bookmarkedDirectly).length}countVisited(){return this.rootStore.exhibitorStore.visited.length+this.rootStore.eventStore.visited.length}getSessionsTotalCount(){return this.rootStore.eventStore.eventItems.length}getGuidedToursTotalCount(){return this.rootStore.toursStore.hasTours?this.rootStore.toursStore.tourItems.length:0}getCategoriesTotalCount(){return this.rootStore.categoryStore.categories.filter(t=>t.exhibitors.length>0).length}getPoiTypeTotalCount(t){return this.rootStore.boothStore.booths.filter(e=>e.poiTypeId===t).length}getExhibitorsTotalCount(){return this.rootStore.exhibitorStore.exhibitors.length}}
1
+ import c from"../../data";import{getContrastTextColor as l}from"../../utils/getContrastTextColor";import{tIfExists as d}from"../../utils/i18n";import{BUTTON_ICONS as u,PREFIXES as a,SearchButtonType as i}from"./constants";export class SearchButtonsFactory{constructor(t,e,o){this.rootStore=t,this.state=e,this.actions=o,this.buttonFactories={[i.BOOKMARKS]:r=>this.createBookmarksButton(r),[i.VISITED]:r=>this.createVisitedButton(r),[i.CATEGORIES]:r=>this.createCategoriesButton(r),[i.SESSIONS]:r=>this.createSessionsButton(r),[i.TOURS]:r=>this.createGuidedToursButton(r),[i.POI_TYPE]:r=>this.createPoiTypeButton(r),[i.POI_TYPES]:r=>this.createPoiTypesButton(r),[i.LINK]:r=>this.createLinkButton(r),[i.EXHIBITORS]:r=>this.createExhibitorsButton(r)}}createButtons(t){return this.dedupeButtons(t).filter(e=>e.visible).map(e=>({button:this.createButton(e),order:e.order??Number.MAX_SAFE_INTEGER})).filter(e=>e.button!==null).sort((e,o)=>e.order-o.order).map(e=>e.button)}createButton(t){const e=this.buttonFactories[t.type];return e?e(t):null}createBaseButton(t){const e=t.color&&t.color.toUpperCase()!=="#FFFFFF",o=d(t.name);return{id:t.id||`${t.type}_${t.name}`,label:o,text:o,enabled:!0,isDimmed:!1,isClickable:!0,backgroundColor:e?t.color:void 0,textColor:e&&t.color?l(t.color):void 0}}createButtonId(t,e){return e.id||`${t}${e.name}`}createBookmarksButton(t){const{uiState:e}=this.rootStore;return e.kiosk||e.disableBookmarked||c.hideBookmarks?null:{...this.createBaseButton(t),id:i.BOOKMARKS,icon:u.BOOKMARKS,active:e.list.type==="bookmarks",count:this.countBookmarks(),onClick:()=>this.actions.handleSearchButtonClick(i.BOOKMARKS,t.name)}}createVisitedButton(t){const{uiState:e}=this.rootStore;return e.kiosk?null:{...this.createBaseButton(t),id:i.VISITED,icon:u.VISITED,active:e.list.type==="visited",count:this.countVisited(),onClick:()=>this.actions.handleSearchButtonClick(i.VISITED,t.name)}}createCategoriesButton(t){if(!t.children?.length){const n=this.getCategoriesTotalCount();return n>0?this.createSimpleCategoriesButton(t,n):null}const e=(t.children||[]).filter(n=>n.visible);if(e.length===0)return null;const o=this.createButtonId(a.CATEGORIES,t),r=e.filter(n=>n.type==="categories"),s=this.countCategories(r);return{...this.createBaseButton(t),id:o,active:this.state.searchShortcutState.activeParentId===o,count:s,showZeroCount:!0,onClick:()=>this.actions.handleExtendedSearchButtonClick(o)}}createSimpleCategoriesButton(t,e){const{uiState:o}=this.rootStore,r=o.selectedCategoryFilters.length>0?o.selectedCategoryFilters.length:e;return{...this.createBaseButton(t),id:i.CATEGORIES,active:o.selectedCategoryFilters.length>0&&!this.state.searchShortcutState.activeParentId,count:r,showZeroCount:!0,onClick:()=>this.actions.handleSearchButtonClick(i.CATEGORIES,t.name)}}createSessionsButton(t){const{uiState:e}=this.rootStore,o=this.getSessionsTotalCount();return o===0?null:{...this.createBaseButton(t),id:i.SESSIONS,icon:u.SESSIONS,active:e.list.type==="sessions",count:o,showZeroCount:!0,hasSubButtons:!0,onClick:()=>this.actions.handleSessionsClick(t.name)}}createGuidedToursButton(t){const{uiState:e}=this.rootStore,o=this.getGuidedToursTotalCount();return o===0?null:{...this.createBaseButton(t),id:"guided_tours",active:e.list.type==="tours"||e.list.type==="multi-point-tour",count:o,showZeroCount:!0,onClick:()=>this.actions.handleSearchButtonClick("guided_tours",t.name)}}createPoiTypeButton(t){const e=this.rootStore.poiTypeStore.poiTypes.find(s=>s.name===t.name);if(!e)return null;const o=`${a.POI_TYPE}${e.id}`,r=this.getPoiTypeTotalCount(e.id);return r===0?null:{...this.createBaseButton(t),id:o,active:this.state.activePoiFilterId===o,count:r,showZeroCount:!0,onClick:()=>this.actions.handleSearchButtonClick(o,t.name)}}createPoiTypesButton(t){if(!t.children?.length)return this.createPoiTypeButton(t);const e=t.children.filter(n=>n.visible);if(e.length===0)return null;if(this.shouldFlattenToSinglePoiType(e,t))return this.createPoiTypeButton(t);const o=e.filter(n=>n.type!=="link"),r=this.countPoiTypes(o),s=this.createButtonId(a.POI_TYPES,t);return{...this.createBaseButton(t),id:s,active:this.state.searchShortcutState.activeParentId===s,count:r,showZeroCount:!0,onClick:()=>this.actions.handleExtendedSearchButtonClick(s)}}shouldFlattenToSinglePoiType(t,e){return t.length===1&&t[0].type==="poi_types"&&t[0].name===e.name}createLinkButton(t){const e=this.createButtonId(a.LINK,t);return{...this.createBaseButton(t),id:e,active:!1,onClick:()=>this.actions.handleExtendedSearchButtonClick(e)}}createExhibitorsButton(t){const{uiState:e}=this.rootStore,o=this.getExhibitorsTotalCount();return o===0?null:{...this.createBaseButton(t),id:i.EXHIBITORS,icon:u.EXHIBITORS,active:e.list.type==="exhibitors",count:o,showZeroCount:!0,onClick:()=>this.actions.handleSearchButtonClick(i.EXHIBITORS,t.name)}}countCategories(t){const{categoryById:e}=this.rootStore.categoryStore,o=new Set;return t.forEach(r=>{if(r.type!=="categories")return;const s=e.get(Number(r.id));s&&s.exhibitors.forEach(n=>o.add(n.id))}),o.size}countPoiTypes(t){return t.reduce((e,o)=>{if(o.type!=="poi_types")return e;if(o.count!==void 0)return e+o.count;const r=Number(o.id),s=this.rootStore.poiTypeStore.poiTypes.find(n=>n.id===r);if(s){const n=this.rootStore.boothStore.booths.filter(h=>h.poiTypeId===s.id).length;return e+n}return e},0)}dedupeButtons(t){const e=new Set;return t.filter(o=>{const r=`${o.type}_${o.name}`;return e.has(r)?!1:(e.add(r),!0)})}countBookmarks(){return this.rootStore.exhibitorStore.bookmarked.length+this.rootStore.eventStore.bookmarked.length+this.rootStore.speakerStore.bookmarked.length+this.rootStore.boothStore.booths.filter(t=>t.exhibitors.length===0&&t.bookmarkedDirectly).length}countVisited(){return this.rootStore.exhibitorStore.visited.length+this.rootStore.eventStore.visited.length}getSessionsTotalCount(){return this.rootStore.eventStore.eventItems.length}getGuidedToursTotalCount(){return this.rootStore.toursStore.hasTours?this.rootStore.toursStore.tourItems.length:0}getCategoriesTotalCount(){return this.rootStore.categoryStore.categories.filter(t=>t.exhibitors.length>0).length}getPoiTypeTotalCount(t){return this.rootStore.boothStore.booths.filter(e=>e.poiTypeId===t).length}getExhibitorsTotalCount(){return this.rootStore.exhibitorStore.exhibitors.length}}
@@ -1,4 +1,4 @@
1
- import RootStore from '../RootStore';
1
+ import type RootStore from '../RootStore';
2
2
  import type { SearchButtonConfig, SearchButtonTypeConfig, SearchShortcutState, SearchSubButtonConfig } from '../types';
3
3
  export default class SearchButtonsStore {
4
4
  private readonly rootStore;
@@ -34,10 +34,10 @@ export default class SearchButtonsStore {
34
34
  get poiTypeCounts(): Map<number, number>;
35
35
  get totalPoiTypeCount(): number;
36
36
  get activePoiTypeId(): number | null;
37
- handleSearchButtonClick(searchButtonId: string): void;
37
+ handleSearchButtonClick(searchButtonId: string, caption?: string): void;
38
38
  handleExtendedSearchButtonClick(buttonId: string): void;
39
39
  handleMainButtonClick(buttonId: string): void;
40
- handleSessionsClick(): void;
40
+ handleSessionsClick(caption?: string): void;
41
41
  togglePoiType(poiTypeId: number): void;
42
42
  clearAllFilters(): void;
43
43
  showSubButtons(parentButtonId: string): void;
@@ -1 +1 @@
1
- import{__decorate as i}from"tslib";import{action as s,computed as o,reaction as l}from"mobx";import{CACHE_DURATION as u,LANGUAGE_TYPE as a,MOBILE_BREAKPOINT as h}from"../../constants";import c from"../../data";import{SessionsSubButtonProvider as p}from"../providers/SessionsSubButtonProvider";import{SubButtonRegistry as d}from"../SubButtonRegistry";import{PREFIXES as S}from"./constants";import{SearchButtonsActions as y}from"./SearchButtonsActions";import{SearchButtonsFactory as B}from"./SearchButtonsFactory";import{SearchButtonsFilters as C}from"./SearchButtonsFilters";import{SearchButtonsState as g}from"./SearchButtonsState";import{countMapValues as b,extractPoiTypeId as P,isValidConfig as v}from"./utils";export default class e{constructor(t){this.poiTypeCountsCache=new Map,this.lastPoiTypeCountUpdate=0,this.rootStore=t,this.state=new g,this.filters=new C(t,this.state),this.actions=new y(t,this.state,this.filters),this.factory=new B(t,this.state,this.actions),this.setupReactions()}setupReactions(){l(()=>this.rootStore.boothStore.booths.length,()=>this.invalidatePoiTypeCounts())}get subButtonRegistry(){return this._subButtonRegistry||(this._subButtonRegistry=new d,this.registerSubButtonProviders()),this._subButtonRegistry}registerSubButtonProviders(){this.subButtonRegistry.register(new p(this.rootStore))}invalidatePoiTypeCounts(){this.poiTypeCountsCache.clear(),this.lastPoiTypeCountUpdate=0}get isVisible(){return this.state.isVisible}get shouldShow(){const{uiState:t}=this.rootStore;if(t.screenSize.width>=h)return this.state.isVisible;const r=!!(t.selectedExhibitor||t.selectedBooth||t.selectedEventItem||t.selectedRoute||t.menu||t.list.type===a);return this.state.isVisible&&!r}get activePoiFilterId(){return this.state.activePoiFilterId}get activeSubButtonsParentId(){return this.state.activeSubButtonsParentId}get activeSubButtonId(){return this.state.activeSubButtonId}get subButtonsEnabled(){return this.state.subButtonsEnabled}get searchShortcutState(){return this.state.searchShortcutState}get searchButtons(){const t=c.filterButtonsConfig;if(!v(t))return console.warn("[SearchButtonsStore] Invalid filterButtonsConfig detected"),[];const n=t.searchButtons;return this.factory.createButtons(n)}get hasAnySearchButtons(){return this.searchButtons.length>0}get hasActiveSearchButton(){return this.state.activePoiFilterId!==null||this.rootStore.uiState.selectedCategoryFilters.length>0}get activeSearchButtonLabel(){return this.state.activePoiFilterId?this.searchButtons.find(n=>n.id===this.state.activePoiFilterId)?.label||null:this.rootStore.uiState.selectedCategoryFilters.length>0?"Categories":null}get activeSubButtons(){return this.state.activeSubButtonsParentId?this.subButtonRegistry.getSubButtons(this.state.activeSubButtonsParentId):[]}get shouldShowSubButtons(){if(!this.state.subButtonsEnabled||!this.state.activeSubButtonsParentId)return!1;const t=this.searchButtons.find(n=>n.id===this.state.activeSubButtonsParentId);return!t||!t.active?!1:this.subButtonRegistry.shouldShowSubButtons(this.state.activeSubButtonsParentId)&&this.activeSubButtons.length>0}get hasActiveParentWithChildren(){return this.state.hasActiveParentWithChildren}get areAllSelected(){return this.filters.areAllSelected()}get activeChildrenCount(){return this.state.activeChildrenCount}get totalChildrenCount(){return this.filters.getChildrenCount()}get poiTypeCounts(){const t=Date.now();if(t-this.lastPoiTypeCountUpdate<u&&this.poiTypeCountsCache.size>0)return this.poiTypeCountsCache;const n=new Map;return this.rootStore.boothStore.booths.forEach(r=>{r.poiTypeId&&n.set(r.poiTypeId,(n.get(r.poiTypeId)||0)+1)}),this.poiTypeCountsCache=n,this.lastPoiTypeCountUpdate=t,n}get totalPoiTypeCount(){return b(this.poiTypeCounts)}get activePoiTypeId(){return this.state.activePoiFilterId?.startsWith(S.POI_TYPE)?P(this.state.activePoiFilterId):null}handleSearchButtonClick(t){this.actions.handleSearchButtonClick(t)}handleExtendedSearchButtonClick(t){this.actions.handleExtendedSearchButtonClick(t)}handleMainButtonClick(t){this.actions.handleMainButtonClick(t)}handleSessionsClick(){this.actions.handleSessionsClick()}togglePoiType(t){this.actions.togglePoiType(t)}clearAllFilters(){this.actions.clearAllFilters()}showSubButtons(t){this.actions.showSubButtons(t)}hideSubButtons(){this.actions.hideSubButtons()}handleSubButtonClick(t){this.state.activeSubButtonId!==t&&(this.state.setSubButton(t),this.state.activeSubButtonsParentId&&this.subButtonRegistry.handleSubButtonClick(this.state.activeSubButtonsParentId,t))}toggleChildFilter(t){this.filters.toggleChildFilter(t)}clearPoiTypeFilters(){this.filters.clearPoiTypeFilters()}clearAllChildFilters(){this.filters.clearAllChildFilters()}setActiveParentId(t){this.state.setActiveParentId(t)}showShortcuts(t){this.state.showShortcuts(t)}clearChildren(){this.state.clearChildren()}setSubButtonId(t){this.state.setSubButton(t)}setPoiFilterId(t){this.state.setPoiFilter(t)}getPoiTypeTotalCount(t){return this.poiTypeCounts.get(t)||0}isChildActive(t){return this.state.isChildActive(t)}getActiveParent(){return this.filters.getActiveParent()}}i([s],e.prototype,"invalidatePoiTypeCounts",null),i([o],e.prototype,"isVisible",null),i([o],e.prototype,"shouldShow",null),i([o],e.prototype,"activePoiFilterId",null),i([o],e.prototype,"activeSubButtonsParentId",null),i([o],e.prototype,"activeSubButtonId",null),i([o],e.prototype,"subButtonsEnabled",null),i([o],e.prototype,"searchShortcutState",null),i([o],e.prototype,"searchButtons",null),i([o],e.prototype,"hasAnySearchButtons",null),i([o],e.prototype,"hasActiveSearchButton",null),i([o],e.prototype,"activeSearchButtonLabel",null),i([o],e.prototype,"activeSubButtons",null),i([o],e.prototype,"shouldShowSubButtons",null),i([o],e.prototype,"hasActiveParentWithChildren",null),i([o],e.prototype,"areAllSelected",null),i([o],e.prototype,"activeChildrenCount",null),i([o],e.prototype,"totalChildrenCount",null),i([o],e.prototype,"poiTypeCounts",null),i([o],e.prototype,"totalPoiTypeCount",null),i([o],e.prototype,"activePoiTypeId",null),i([s],e.prototype,"handleSearchButtonClick",null),i([s],e.prototype,"handleExtendedSearchButtonClick",null),i([s],e.prototype,"handleMainButtonClick",null),i([s],e.prototype,"handleSessionsClick",null),i([s],e.prototype,"togglePoiType",null),i([s],e.prototype,"clearAllFilters",null),i([s],e.prototype,"showSubButtons",null),i([s],e.prototype,"hideSubButtons",null),i([s],e.prototype,"handleSubButtonClick",null),i([s],e.prototype,"toggleChildFilter",null),i([s],e.prototype,"clearPoiTypeFilters",null),i([s],e.prototype,"clearAllChildFilters",null),i([s],e.prototype,"setActiveParentId",null),i([s],e.prototype,"showShortcuts",null),i([s],e.prototype,"clearChildren",null),i([s],e.prototype,"setSubButtonId",null),i([s],e.prototype,"setPoiFilterId",null);
1
+ import{__decorate as i}from"tslib";import{action as s,computed as o,reaction as l}from"mobx";import{CACHE_DURATION as u,LANGUAGE_TYPE as a,MOBILE_BREAKPOINT as h}from"../../constants";import c from"../../data";import{SessionsSubButtonProvider as p}from"../providers/SessionsSubButtonProvider";import{SubButtonRegistry as d}from"../SubButtonRegistry";import{PREFIXES as S}from"./constants";import{SearchButtonsActions as y}from"./SearchButtonsActions";import{SearchButtonsFactory as B}from"./SearchButtonsFactory";import{SearchButtonsFilters as C}from"./SearchButtonsFilters";import{SearchButtonsState as g}from"./SearchButtonsState";import{countMapValues as b,extractPoiTypeId as P,isValidConfig as v}from"./utils";export default class e{constructor(t){this.poiTypeCountsCache=new Map,this.lastPoiTypeCountUpdate=0,this.rootStore=t,this.state=new g,this.filters=new C(t,this.state),this.actions=new y(t,this.state,this.filters),this.factory=new B(t,this.state,this.actions),this.setupReactions()}setupReactions(){l(()=>this.rootStore.boothStore.booths.length,()=>this.invalidatePoiTypeCounts())}get subButtonRegistry(){return this._subButtonRegistry||(this._subButtonRegistry=new d,this.registerSubButtonProviders()),this._subButtonRegistry}registerSubButtonProviders(){this.subButtonRegistry.register(new p(this.rootStore))}invalidatePoiTypeCounts(){this.poiTypeCountsCache.clear(),this.lastPoiTypeCountUpdate=0}get isVisible(){return this.state.isVisible}get shouldShow(){const{uiState:t}=this.rootStore;if(t.screenSize.width>=h)return this.state.isVisible;const r=!!(t.selectedExhibitor||t.selectedBooth||t.selectedEventItem||t.selectedRoute||t.menu||t.list.type===a);return this.state.isVisible&&!r}get activePoiFilterId(){return this.state.activePoiFilterId}get activeSubButtonsParentId(){return this.state.activeSubButtonsParentId}get activeSubButtonId(){return this.state.activeSubButtonId}get subButtonsEnabled(){return this.state.subButtonsEnabled}get searchShortcutState(){return this.state.searchShortcutState}get searchButtons(){const t=c.filterButtonsConfig;if(!v(t))return console.warn("[SearchButtonsStore] Invalid filterButtonsConfig detected"),[];const n=t.searchButtons;return this.factory.createButtons(n)}get hasAnySearchButtons(){return this.searchButtons.length>0}get hasActiveSearchButton(){return this.state.activePoiFilterId!==null||this.rootStore.uiState.selectedCategoryFilters.length>0}get activeSearchButtonLabel(){return this.state.activePoiFilterId?this.searchButtons.find(n=>n.id===this.state.activePoiFilterId)?.label||null:this.rootStore.uiState.selectedCategoryFilters.length>0?"Categories":null}get activeSubButtons(){return this.state.activeSubButtonsParentId?this.subButtonRegistry.getSubButtons(this.state.activeSubButtonsParentId):[]}get shouldShowSubButtons(){if(!this.state.subButtonsEnabled||!this.state.activeSubButtonsParentId)return!1;const t=this.searchButtons.find(n=>n.id===this.state.activeSubButtonsParentId);return!t||!t.active?!1:this.subButtonRegistry.shouldShowSubButtons(this.state.activeSubButtonsParentId)&&this.activeSubButtons.length>0}get hasActiveParentWithChildren(){return this.state.hasActiveParentWithChildren}get areAllSelected(){return this.filters.areAllSelected()}get activeChildrenCount(){return this.state.activeChildrenCount}get totalChildrenCount(){return this.filters.getChildrenCount()}get poiTypeCounts(){const t=Date.now();if(t-this.lastPoiTypeCountUpdate<u&&this.poiTypeCountsCache.size>0)return this.poiTypeCountsCache;const n=new Map;return this.rootStore.boothStore.booths.forEach(r=>{r.poiTypeId&&n.set(r.poiTypeId,(n.get(r.poiTypeId)||0)+1)}),this.poiTypeCountsCache=n,this.lastPoiTypeCountUpdate=t,n}get totalPoiTypeCount(){return b(this.poiTypeCounts)}get activePoiTypeId(){return this.state.activePoiFilterId?.startsWith(S.POI_TYPE)?P(this.state.activePoiFilterId):null}handleSearchButtonClick(t,n){this.actions.handleSearchButtonClick(t,n)}handleExtendedSearchButtonClick(t){this.actions.handleExtendedSearchButtonClick(t)}handleMainButtonClick(t){this.actions.handleMainButtonClick(t)}handleSessionsClick(t){this.actions.handleSessionsClick(t)}togglePoiType(t){this.actions.togglePoiType(t)}clearAllFilters(){this.actions.clearAllFilters()}showSubButtons(t){this.actions.showSubButtons(t)}hideSubButtons(){this.actions.hideSubButtons()}handleSubButtonClick(t){this.state.activeSubButtonId!==t&&(this.state.setSubButton(t),this.state.activeSubButtonsParentId&&this.subButtonRegistry.handleSubButtonClick(this.state.activeSubButtonsParentId,t))}toggleChildFilter(t){this.filters.toggleChildFilter(t)}clearPoiTypeFilters(){this.filters.clearPoiTypeFilters()}clearAllChildFilters(){this.filters.clearAllChildFilters()}setActiveParentId(t){this.state.setActiveParentId(t)}showShortcuts(t){this.state.showShortcuts(t)}clearChildren(){this.state.clearChildren()}setSubButtonId(t){this.state.setSubButton(t)}setPoiFilterId(t){this.state.setPoiFilter(t)}getPoiTypeTotalCount(t){return this.poiTypeCounts.get(t)||0}isChildActive(t){return this.state.isChildActive(t)}getActiveParent(){return this.filters.getActiveParent()}}i([s],e.prototype,"invalidatePoiTypeCounts",null),i([o],e.prototype,"isVisible",null),i([o],e.prototype,"shouldShow",null),i([o],e.prototype,"activePoiFilterId",null),i([o],e.prototype,"activeSubButtonsParentId",null),i([o],e.prototype,"activeSubButtonId",null),i([o],e.prototype,"subButtonsEnabled",null),i([o],e.prototype,"searchShortcutState",null),i([o],e.prototype,"searchButtons",null),i([o],e.prototype,"hasAnySearchButtons",null),i([o],e.prototype,"hasActiveSearchButton",null),i([o],e.prototype,"activeSearchButtonLabel",null),i([o],e.prototype,"activeSubButtons",null),i([o],e.prototype,"shouldShowSubButtons",null),i([o],e.prototype,"hasActiveParentWithChildren",null),i([o],e.prototype,"areAllSelected",null),i([o],e.prototype,"activeChildrenCount",null),i([o],e.prototype,"totalChildrenCount",null),i([o],e.prototype,"poiTypeCounts",null),i([o],e.prototype,"totalPoiTypeCount",null),i([o],e.prototype,"activePoiTypeId",null),i([s],e.prototype,"handleSearchButtonClick",null),i([s],e.prototype,"handleExtendedSearchButtonClick",null),i([s],e.prototype,"handleMainButtonClick",null),i([s],e.prototype,"handleSessionsClick",null),i([s],e.prototype,"togglePoiType",null),i([s],e.prototype,"clearAllFilters",null),i([s],e.prototype,"showSubButtons",null),i([s],e.prototype,"hideSubButtons",null),i([s],e.prototype,"handleSubButtonClick",null),i([s],e.prototype,"toggleChildFilter",null),i([s],e.prototype,"clearPoiTypeFilters",null),i([s],e.prototype,"clearAllChildFilters",null),i([s],e.prototype,"setActiveParentId",null),i([s],e.prototype,"showShortcuts",null),i([s],e.prototype,"clearChildren",null),i([s],e.prototype,"setSubButtonId",null),i([s],e.prototype,"setPoiFilterId",null);
@@ -19,6 +19,7 @@ export declare enum GaEventActions {
19
19
  ClickGooglePlus = "Click Google Plus",
20
20
  ClickXing = "Click Xing",
21
21
  ClickYoutube = "Click Youtube",
22
+ ClickBookmark = "Click bookmark",
22
23
  ClickDirections = "Click Directions",
23
24
  Rendered = "Floor plan rendered",
24
25
  WsExhibitorClick = "ws_exhibitor_click"
@@ -1 +1 @@
1
- import r from"../data";import l from"../tools/settings";import s from"../tools/track-event";import u from"../utils/is-debug";const d="G-78CKLYWFJK";window.dataLayer=window.dataLayer||[];export default function i(...e){window.dataLayer.push(arguments)}export var GaEventActions;(function(e){e.Load="Load floor plan",e.ViewBooth="View booth",e.ViewExhibitor="View exhibitor",e.ViewCategory="View category",e.Search="Search",e.ClickCustomButton="Click custom button",e.ViewVideo="View video",e.ViewGallery="View gallery",e.ClickPhone="Click phone",e.ClickEmail="Click email",e.ClickWebsite="Click website",e.ClickFacebook="Click Facebook",e.ClickInstagaram="Click Instagram",e.ClickLinkedin="Click Linkedin",e.ClickTwitter="Click Twitter",e.ClickGooglePlus="Click Google Plus",e.ClickXing="Click Xing",e.ClickYoutube="Click Youtube",e.ClickDirections="Click Directions",e.Rendered="Floor plan rendered",e.WsExhibitorClick="ws_exhibitor_click"})(GaEventActions||(GaEventActions={}));export async function checkUserIsGDPR(){try{const e=fetch("https://consent.expofp.com/api/verify-ip/is-in-gdpr"),t=new Promise(a=>{setTimeout(()=>{a(null)},5e3)}),o=await Promise.race([e,t]);return o instanceof Response&&o.ok?(await o.json()).result:null}catch(e){return console.error(e),null}}export function hasUserConsent(e){if(e==="granted"||e==="denied")return e;const t=document.cookie.split("; ").find(o=>o.startsWith("cookie_consent="));if(t)return t==="cookie_consent=true"?"granted":"denied"}export function setCookieConsent(e){const o=u?"localhost":".expofp.com";document.cookie=`cookie_consent=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${o}`,document.cookie="cookie_consent=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/",document.cookie=e?`cookie_consent=${e}; max-age=2592000; domain=${o}; path=/`:`cookie_consent=${e}; max-age=2592000; path=/`}function p(){const e=document.cookie.split(";"),t=u?"localhost":".expofp.com";for(let o=0;o<e.length;o++){const a=e[o],k=a.indexOf("="),g=k>-1?a.substr(0,k).trim():a.trim();g.startsWith("_ga")&&(document.cookie=`${g}=;expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${t}`)}}export function setConsentSettings(e){let t=hasUserConsent(e);t&&(t==="denied"?(p(),r.gtag&&(window[`ga-disable-${r.gtag}`]=!0),window[`ga-disable-${d}`]=!0):(r.gtag&&(window[`ga-disable-${r.gtag}`]=!1),window[`ga-disable-${d}`]=!1),i("consent","update",{analytics_storage:t,ad_personalization:t}))}export function sendEventToGa(e,t,o){switch(e){case GaEventActions.ViewBooth:{i("event","select_content",{content_type:e,content_id:t}),s("booview",t);break}case GaEventActions.ViewCategory:{i("event","select_content",{content_type:e,content_id:t}),s("catview",t);break}case GaEventActions.ViewExhibitor:case GaEventActions.ViewGallery:case GaEventActions.ViewVideo:i("event","select_content",{content_type:e,content_id:t});break;case GaEventActions.Search:i("event","search",{search_term:t}),s("search",t);break;case GaEventActions.ClickCustomButton:case GaEventActions.ClickPhone:case GaEventActions.ClickEmail:case GaEventActions.ClickWebsite:case GaEventActions.ClickFacebook:case GaEventActions.ClickInstagaram:case GaEventActions.ClickLinkedin:case GaEventActions.ClickTwitter:case GaEventActions.ClickGooglePlus:case GaEventActions.ClickXing:case GaEventActions.ClickYoutube:i("event","share",{content_type:e,content_id:t}),s("share",t);break;case GaEventActions.ClickDirections:i("event","route",{content_type:e,content_id:t}),s("route",t);break;default:i("event",e,{content_type:o,content_id:t})}}export function sendPayloadToGa(e,t){i("event",e,{...t,fp_key:l.EXPO})}export function trackWsExhibitorClick(e){sendPayloadToGa(GaEventActions.WsExhibitorClick,{exhibitor_id:e.id,exhibitor_name:e.name,exhibitor_external_id:e.externalId,creative_slot:"ws_slider"}),s("ws_exhibitor_click",e.id)}let n,c;if(!n){n=document.createElement("script"),n.type="text/javascript",n.async=!0,n.src=`https://www.googletagmanager.com/gtag/js?id=${d}`;const e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(n,e),i("js",new Date)}if(r.gtag&&!c){c=document.createElement("script"),c.type="text/javascript",c.async=!0,c.src=`https://www.googletagmanager.com/gtag/js?id=${r.gtag}`;const e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(c,e),i("config",r.gtag,{fp_key:l.EXPO})}i("config",d,{fp_key:l.EXPO}),window.gtag=i,i("consent","default",{ad_storage:"denied",analytics_storage:"denied",region:["BE","BG","CZ","DK","DE","EE","IE","EL","ES","FR","HR","IT","CY","LV","LT","LU","HU","MT","NL","AT","PL","PT","RO","SI","SK","FI","SE","UK","IS","NO","LI","CH","MK","AL","RS","TR"],functionality_storage:"denied",personalization_storage:"denied",security_storage:"denied",ad_personalization:"denied"});export function destroyGtag(){n&&n.parentNode&&(n.parentNode.removeChild(n),n=null),c&&c.parentNode&&(c.parentNode.removeChild(c),c=null)}
1
+ import r from"../data";import l from"../tools/settings";import s from"../tools/track-event";import u from"../utils/is-debug";const d="G-78CKLYWFJK";window.dataLayer=window.dataLayer||[];export default function o(...e){window.dataLayer.push(arguments)}export var GaEventActions;(function(e){e.Load="Load floor plan",e.ViewBooth="View booth",e.ViewExhibitor="View exhibitor",e.ViewCategory="View category",e.Search="Search",e.ClickCustomButton="Click custom button",e.ViewVideo="View video",e.ViewGallery="View gallery",e.ClickPhone="Click phone",e.ClickEmail="Click email",e.ClickWebsite="Click website",e.ClickFacebook="Click Facebook",e.ClickInstagaram="Click Instagram",e.ClickLinkedin="Click Linkedin",e.ClickTwitter="Click Twitter",e.ClickGooglePlus="Click Google Plus",e.ClickXing="Click Xing",e.ClickYoutube="Click Youtube",e.ClickBookmark="Click bookmark",e.ClickDirections="Click Directions",e.Rendered="Floor plan rendered",e.WsExhibitorClick="ws_exhibitor_click"})(GaEventActions||(GaEventActions={}));export async function checkUserIsGDPR(){try{const e=fetch("https://consent.expofp.com/api/verify-ip/is-in-gdpr"),t=new Promise(a=>{setTimeout(()=>{a(null)},5e3)}),i=await Promise.race([e,t]);return i instanceof Response&&i.ok?(await i.json()).result:null}catch(e){return console.error(e),null}}export function hasUserConsent(e){if(e==="granted"||e==="denied")return e;const t=document.cookie.split("; ").find(i=>i.startsWith("cookie_consent="));if(t)return t==="cookie_consent=true"?"granted":"denied"}export function setCookieConsent(e){const i=u?"localhost":".expofp.com";document.cookie=`cookie_consent=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${i}`,document.cookie="cookie_consent=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/",document.cookie=e?`cookie_consent=${e}; max-age=2592000; domain=${i}; path=/`:`cookie_consent=${e}; max-age=2592000; path=/`}function m(){const e=document.cookie.split(";"),t=u?"localhost":".expofp.com";for(let i=0;i<e.length;i++){const a=e[i],k=a.indexOf("="),g=k>-1?a.substr(0,k).trim():a.trim();g.startsWith("_ga")&&(document.cookie=`${g}=;expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${t}`)}}export function setConsentSettings(e){let t=hasUserConsent(e);t&&(t==="denied"?(m(),r.gtag&&(window[`ga-disable-${r.gtag}`]=!0),window[`ga-disable-${d}`]=!0):(r.gtag&&(window[`ga-disable-${r.gtag}`]=!1),window[`ga-disable-${d}`]=!1),o("consent","update",{analytics_storage:t,ad_personalization:t}))}export function sendEventToGa(e,t,i){switch(e){case GaEventActions.ViewBooth:{o("event","select_content",{content_type:e,content_id:t}),s("booview",t);break}case GaEventActions.ViewCategory:{o("event","select_content",{content_type:e,content_id:t}),s("catview",t);break}case GaEventActions.ViewExhibitor:case GaEventActions.ViewGallery:case GaEventActions.ViewVideo:o("event","select_content",{content_type:e,content_id:t});break;case GaEventActions.Search:o("event","search",{search_term:t}),s("search",t);break;case GaEventActions.ClickCustomButton:case GaEventActions.ClickPhone:case GaEventActions.ClickEmail:case GaEventActions.ClickWebsite:case GaEventActions.ClickFacebook:case GaEventActions.ClickInstagaram:case GaEventActions.ClickLinkedin:case GaEventActions.ClickTwitter:case GaEventActions.ClickGooglePlus:case GaEventActions.ClickXing:case GaEventActions.ClickYoutube:o("event","share",{content_type:e,content_id:t}),s("share",t);break;case GaEventActions.ClickBookmark:o("event","share",{content_type:GaEventActions.ClickCustomButton,content_id:t});break;case GaEventActions.ClickDirections:o("event","route",{content_type:e,content_id:t}),s("route",t);break;default:o("event",e,{content_type:i,content_id:t})}}export function sendPayloadToGa(e,t){o("event",e,{...t,fp_key:l.EXPO})}export function trackWsExhibitorClick(e){sendPayloadToGa(GaEventActions.WsExhibitorClick,{exhibitor_id:e.id,exhibitor_name:e.name,exhibitor_external_id:e.externalId,creative_slot:"ws_slider"}),s("ws_exhibitor_click",e.id)}let n,c;if(!n){n=document.createElement("script"),n.type="text/javascript",n.async=!0,n.src=`https://www.googletagmanager.com/gtag/js?id=${d}`;const e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(n,e),o("js",new Date)}if(r.gtag&&!c){c=document.createElement("script"),c.type="text/javascript",c.async=!0,c.src=`https://www.googletagmanager.com/gtag/js?id=${r.gtag}`;const e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(c,e),o("config",r.gtag,{fp_key:l.EXPO})}o("config",d,{fp_key:l.EXPO}),window.gtag=o,o("consent","default",{ad_storage:"denied",analytics_storage:"denied",region:["BE","BG","CZ","DK","DE","EE","IE","EL","ES","FR","HR","IT","CY","LV","LT","LU","HU","MT","NL","AT","PL","PT","RO","SI","SK","FI","SE","UK","IS","NO","LI","CH","MK","AL","RS","TR"],functionality_storage:"denied",personalization_storage:"denied",security_storage:"denied",ad_personalization:"denied"});export function destroyGtag(){n&&n.parentNode&&(n.parentNode.removeChild(n),n=null),c&&c.parentNode&&(c.parentNode.removeChild(c),c=null)}
@@ -1,6 +1,8 @@
1
1
  export interface TelemetryEvent {
2
2
  type: string;
3
3
  value: string;
4
+ /** Narrows `type` — e.g. which kind of entity a `bookmark` event refers to. */
5
+ subtype?: string;
4
6
  /** ISO string */
5
7
  timestamp: string;
6
8
  url: string;
@@ -1 +1 @@
1
- const _="efp-telemetry",M=3e5,N=1e3;function g(s=_){return{get(){try{const r=localStorage.getItem(s);return r?JSON.parse(r):null}catch{return null}},set(r){try{localStorage.setItem(s,JSON.stringify(r))}catch(n){console.error("Failed to persist telemetry data",n)}},clear(){try{localStorage.removeItem(s)}catch(r){console.error("Failed to clear telemetry data",r)}}}}function R(s){const r=s.headers.get("Retry-After");if(!r)return 0;let n=0;const a=Number(r);if(Number.isFinite(a))n=a*1e3;else{const o=Date.parse(r);isNaN(o)||(n=Math.max(0,o-Date.now()))}return Math.min(n,3e5)}export function createTelemetry(s){const{url:r,expo:n,expoId:a,storage:o=g()}=s;let c=s.kioskId??"";function l(){const e=o.get();return e?(e.expo=n,e.expoId=a,e.kioskId=c,e):{expo:n,expoId:a,kioskId:c,items:[]}}function y(e){c=e}let u=!1,f=!1,d=0;async function m(){if(u){f=!0;return}u=!0;do{if(f=!1,performance.now()<d)break;let e=null;try{if(e=l(),e.items.length===0)break;o.clear();const t=JSON.stringify(e),p=new TextEncoder().encode(t).byteLength,i=await fetch(r,{method:"POST",body:t,headers:{"Content-Type":"application/json"},credentials:"omit",keepalive:p<63e3});if(!i.ok){if(i.status===429||i.status===503){const h=R(i);h>0&&(d=performance.now()+h)}E(e),console.error(`Failed to send telemetry: HTTP ${i.status}`)}}catch(t){e&&E(e),console.error("Failed to send telemetry",t)}}while(f);u=!1}function E(e){const t=l();t.items=[...e.items,...t.items],t.items.length>1e3&&(t.items=t.items.slice(-1e3)),o.set(t)}function T(e){const t=l();t.items.push(e),t.items.length>1e3&&(t.items=t.items.slice(-1e3)),o.set(t)}async function S(e){T(e),await m()}return{enqueue:T,send:S,flush:m,setKioskId:y}}
1
+ const m="efp-telemetry",I=3e5,O=1e3;function R(t){return t?`${m}:${t}`:m}function A(t=m){return{get(){try{const r=localStorage.getItem(t);return r?JSON.parse(r):null}catch{return null}},set(r){try{localStorage.setItem(t,JSON.stringify(r))}catch(s){console.error("Failed to persist telemetry data",s)}},clear(){try{localStorage.removeItem(t)}catch(r){console.error("Failed to clear telemetry data",r)}}}}function M(t,r){if(!r)return t;const s=t.indexOf("#"),o=s===-1?t:t.slice(0,s),i=s===-1?"":t.slice(s);let c="?";return o.includes("?")&&(c=o.endsWith("?")||o.endsWith("&")?"":"&"),`${o}${c}expo=${encodeURIComponent(r)}${i}`}function N(t){const r=t.headers.get("Retry-After");if(!r)return 0;let s=0;const o=Number(r);if(Number.isFinite(o))s=o*1e3;else{const i=Date.parse(r);isNaN(i)||(s=Math.max(0,i-Date.now()))}return Math.min(s,3e5)}export function createTelemetry(t){const{url:r,expo:s,expoId:o,storage:i=A(R(s))}=t,c=M(r,s);let l=t.kioskId??"";function u(){const e=i.get();return e?(e.expo=s,e.expoId=o,e.kioskId=l,e):{expo:s,expoId:o,kioskId:l,items:[]}}function S(e){l=e}let f=!1,d=!1,h=0;async function E(){if(f){d=!0;return}f=!0;do{if(d=!1,performance.now()<h)break;let e=null;try{if(e=u(),e.items.length===0)break;i.clear();const n=JSON.stringify(e),_=new TextEncoder().encode(n).byteLength,a=await fetch(c,{method:"POST",body:n,headers:{"Content-Type":"application/json"},credentials:"omit",keepalive:_<63e3});if(!a.ok){if(a.status===429||a.status===503){const p=N(a);p>0&&(h=performance.now()+p)}y(e),console.error(`Failed to send telemetry: HTTP ${a.status}`)}}catch(n){e&&y(e),console.error("Failed to send telemetry",n)}}while(d);f=!1}function y(e){const n=u();n.items=[...e.items,...n.items],n.items.length>1e3&&(n.items=n.items.slice(-1e3)),i.set(n)}function T(e){const n=u();n.items.push(e),n.items.length>1e3&&(n.items=n.items.slice(-1e3)),i.set(n)}async function g(e){T(e),await E()}return{enqueue:T,send:g,flush:E,setKioskId:S}}
@@ -1,4 +1,28 @@
1
- type TrackEventType = 'load' | 'exview' | 'search' | 'route' | 'share' | 'booview' | 'catview' | 'ws_exhibitor_click';
2
- export default function trackEvent(type: TrackEventType, value?: any): Promise<void>;
1
+ type TrackEventType = 'load' | 'exview' | 'search' | 'route' | 'share' | 'booview' | 'catview' | 'ws_exhibitor_click' | 'sesview' | 'bookmark' | 'spkview' | 'sbtnview';
2
+ /** Which kind of entity a `bookmark` event refers to. */
3
+ export type TrackEventBookmarkSubtype = 'booth' | 'exhibitor' | 'session' | 'speaker';
4
+ /**
5
+ * Which button surface an `sbtnview` came from. The main row above the plan
6
+ * sends none, so its series is unchanged; the surfaces added later are
7
+ * distinguishable instead of being silently mixed into the same counter.
8
+ */
9
+ export type TrackEventButtonSubtype = 'subbutton' | 'shortcut';
10
+ export type TrackEventSubtype = TrackEventBookmarkSubtype | TrackEventButtonSubtype;
11
+ export default function trackEvent(type: TrackEventType, value?: any, subtype?: TrackEventSubtype): Promise<void>;
12
+ /**
13
+ * Drops the module-scope telemetry state — the client (with its cached expo,
14
+ * expoId and kioskId) and the one-shot migration flag. `unstable_destroy()`
15
+ * tears down the DOM and the stores, but ES module state outlives it, so
16
+ * without this a host that destroys the plan and loads a different one keeps
17
+ * reporting under the first plan's event.
18
+ *
19
+ * Anything the client still had queued is drained first: it belongs to the
20
+ * plan being torn down. That drain is best-effort — `flush()` is async and
21
+ * can return early — so it is not what stops the batch being credited to the
22
+ * next plan; the per-expo storage key is. A batch restored after a failed
23
+ * POST keeps its own expo's key and waits for the next client for that expo,
24
+ * instead of being adopted and relabelled by a different one.
25
+ */
26
+ export declare function resetTelemetry(): void;
3
27
  export {};
4
28
  //# sourceMappingURL=track-event.d.ts.map
@@ -1 +1 @@
1
- import{createKiosk as f}from"../components/Kiosk/kioskApi";import{getSavedKiosk as u}from"../components/Kiosk/SetKiosk";import{KIOSK_STATS_ID_STORAGE_KEY as c}from"../components/Kiosk/SetKiosk/constants";import l from"../data";import{getLocationHistory as p}from"../services/url-sync";import{uiState as d}from"../store";import a from"./logger";import{createTelemetry as g}from"./telemetry";let i;function S(){if(i)return i;const r=window.__efpEvent;let e;try{const t=new URL(l.trackerUrl).searchParams.get("expoId");e=t?Number(t):void 0}catch(t){a.error(t)}return i=g({url:"https://app.expofp.com/api/telemetry",expo:r,expoId:e}),i}function s(r,e){const t=p(),n=t[t.length-2];return{type:r,value:e!==void 0?String(e):"",timestamp:new Date().toISOString(),url:window.location.href,referrer:n?window.location.origin+n:""}}function v(){return!!l?.trackerUrl&&process.env.NODE_ENV==="production"&&!d.heatmap}export default async function k(r,e){if(a.log("trackEvent",r,e),!!v())try{const t=S(),n=u();if(n){const o=await I(n);if(o)t.setKioskId(o);else{t.enqueue(s(r,e));return}}else localStorage.removeItem(c),t.setKioskId("");y(t),await t.send(s(r,e))}catch(t){a.error("trackEvent",String(t))}}async function I(r){if(!r)return null;let e=localStorage.getItem(c);return e||(e=await f(r,"https://app.expofp.com/"),e?(localStorage.setItem(c,e),e):null)}let m=!1;function y(r){if(m)return;m=!0;const e="efp-track-events";try{const t=localStorage.getItem(e);if(!t)return;const n=JSON.parse(t);if(!Array.isArray(n)){localStorage.removeItem(e);return}for(const o of n)!o||typeof o!="object"||!o.headers||r.enqueue({type:o.type,value:o.value!==void 0?String(o.value):"",timestamp:o.timeStamp,url:o.headers["X-href"],referrer:o.headers["X-ref"]??""});localStorage.removeItem(e)}catch(t){localStorage.removeItem(e),a.error("Failed to migrate old events.",String(t))}}
1
+ import{getConfig as g}from"@expofp/config";import{createKiosk as v}from"../components/Kiosk/kioskApi";import{getSavedKiosk as S}from"../components/Kiosk/SetKiosk";import{KIOSK_STATS_ID_STORAGE_KEY as s}from"../components/Kiosk/SetKiosk/constants";import{getLocationHistory as h}from"../services/url-sync";import{uiState as E}from"../store";import l from"./logger";import{createTelemetry as w}from"./telemetry";let i,u;function p(){try{return g()}catch{return}}function y(){const o=window.__efpEvent;if(i&&u===o)return i;i?.flush();let e;try{const t=new URL(p()?.trackerUrl??"").searchParams.get("expoId");e=t?Number(t):void 0}catch(t){l.error(t)}return i=w({url:"https://app.expofp.com/api/telemetry",expo:o,expoId:e}),u=o,i}function I(o,e,t){const n=h(),r=n[n.length-2];return{type:o,subtype:t,value:e==null?"":String(e),timestamp:new Date().toISOString(),url:window.location.href,referrer:r?window.location.origin+r:""}}function d(){return!!window.__efpEvent&&!!p()?.trackerUrl&&process.env.NODE_ENV==="production"&&!E.heatmap}export default async function _(o,e,t){if(l.log("trackEvent",o,e,t),!!d())try{const n=I(o,e,t),r=S();let f=null;if(r?f=await k(r):localStorage.removeItem(s),!d())return;const a=y();if(r&&!f){a.enqueue(n);return}a.setKioskId(f??""),T(a),await a.send(n)}catch(n){l.error("trackEvent",String(n))}}let c;async function k(o){if(!o)return null;const e=localStorage.getItem(s);if(e)return e;if(!c){const t=window.__efpEvent;c=v(o,"https://app.expofp.com/").then(n=>!n||window.__efpEvent!==t?null:(localStorage.setItem(s,n),n)).finally(()=>{c=void 0})}return c}let m=!1;export function resetTelemetry(){i?.flush(),i=void 0,u=void 0,m=!1}function T(o){if(m)return;m=!0;const e="efp-track-events";try{const t=localStorage.getItem(e);if(!t)return;const n=JSON.parse(t);if(!Array.isArray(n)){localStorage.removeItem(e);return}for(const r of n)!r||typeof r!="object"||!r.headers||o.enqueue({type:r.type,value:r.value==null?"":String(r.value),timestamp:r.timeStamp,url:r.headers["X-href"],referrer:r.headers["X-ref"]??""});localStorage.removeItem(e)}catch(t){localStorage.removeItem(e),l.error("Failed to migrate old events.",String(t))}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expofp/floorplan",
3
- "version": "3.25.1",
3
+ "version": "3.26.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/expofp/efp-app.git",
@@ -70,14 +70,14 @@
70
70
  "tslib": "^2.3.0",
71
71
  "uuid": "^9.0.1",
72
72
  "zod": "4.4.3",
73
- "@expofp/config": "3.25.1",
74
- "@expofp/debug": "3.25.1",
75
- "@expofp/geometry": "3.25.1",
76
- "@expofp/resolve": "3.25.1",
77
- "@expofp/schema": "3.25.1",
78
- "@expofp/ui": "3.25.1",
79
- "@expofp/utils": "3.25.1",
80
- "@expofp/wayfinding": "3.25.1"
73
+ "@expofp/config": "3.26.0",
74
+ "@expofp/debug": "3.26.0",
75
+ "@expofp/geometry": "3.26.0",
76
+ "@expofp/resolve": "3.26.0",
77
+ "@expofp/schema": "3.26.0",
78
+ "@expofp/ui": "3.26.0",
79
+ "@expofp/utils": "3.26.0",
80
+ "@expofp/wayfinding": "3.26.0"
81
81
  },
82
82
  "devDependencies": {
83
83
  "@babel/plugin-proposal-decorators": "^8.0.2",