UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

2 lines (1 loc) • 37.8 kB
import{__decorate as e}from"tslib";import{Box as ot,Point as it}from"@expofp/geometry";import{action as d,computed as n,observable as a}from"mobx";import{setKioskUrlParams as st}from"../components/Kiosk/kioskUrlParam";import{mapScene as rt}from"../components/Map/scene";import{LANGUAGE_TYPE as E,LEGACY_PREVIEW_MODE_STORAGE_KEY as lt,LEGACY_UI_SCALE_STORAGE_KEY as N,LEGACY_VIEWER_MODE_STORAGE_KEY as at,MOBILE_BREAKPOINT as nt,PREVIEW_MODE_STORAGE_KEY as ht,UI_SCALE_STORAGE_KEY as H,VIEWER_MODE_STORAGE_KEY as ct,VISIBILITY_STORAGE_KEY as $}from"../constants";import C from"../data";import{svgArea as _,svgAreaExplicit as pt}from"../data/svg";import{readFreeBannerDismissed as dt}from"../tools/freeBanner";import{hasUserConsent as ut}from"../tools/gtag";import{hasHtmlTags as W}from"../tools/has-html-tags";import ft from"../tools/logger";import L from"../tools/settings";import{stripHtml as j}from"../tools/strip-html";import{remsToPixels as D}from"../utils";import X from"../utils/browser";import{getLocale as yt,getLocales as mt,t as S}from"../utils/i18n";import{isLocalStorageAvailable as w}from"../utils/localStorage";import{getResponsiveClass as gt}from"../utils/responsiveClass";import{sanitizeStr as Z}from"../utils/sanitizeText";import{fitRectIsFraming as St,getVenueFitMarginPercent as vt,resolveVenueFitRect as bt}from"../utils/scene-bounds";import{uiState as B}from".";import{BoothBase as I,RegularBooth as A,SpecialBooth as V}from"./BoothStore";import{EventItem as O}from"./EventStore";import{Exhibitor as x}from"./ExhibitorStore";import{findEntityByExternalId as It,Route as M}from"./RouteStore";import{SpeakerItem as K}from"./SpeakerStore";const xt=["dimensions25"];export default class t{setSelectedCategoryFilters(o){this.selectedCategoryFilters=o}resetCategoryFilter(){this.selectedCategoryFilters=[],this.categoryFilterOpen=!1}setSearchClearMode(o){this.searchClearMode=o}setRouteTitle(o){this.routeTitle=o}setRouteDescription(o){this.routeDescription=o}setIsMultiPointRoute(o){this.isMultiPointRoute=o}setTourTitle(o){this.tourTitle=o}setTourDescription(o){this.tourDescription=o}setIsMultiPointTour(o){this.isMultiPointTour=o}setPathwayOnlyMode(o){this.pathwayOnlyMode=o}setMultiPointTourList(o){this.list={type:"multi-point-tour",tourId:o}}get activePathwayLayers(){return this.list?.type==="multi-point-tour"?this.rootStore.toursStore.getTourById(this.list.tourId)?.layers?.map(s=>s.id)||[]:[]}get highlightedBooths(){const o=new Set(this.rootStore.exhibitorStore.highlightedByExternalIds),s=new Set(this.rootStore.boothStore.highlightedByExternalIds),i=new Set([...this.rootStore.exhibitorStore.exhibitors.filter(r=>o.has(r.externalId)).flatMap(r=>r.booths.filter(l=>l instanceof A)).map(r=>r.id.toString()),...this.rootStore.boothStore.booths.filter(r=>s.has(r.externalId)).map(r=>r.id.toString())]);if(this.list?.type==="search"&&this.list?.text?.trim().length){i.clear();const r=this.fuzzySearchItems.filter(l=>l.score===0).map(l=>l.item);r.length?F(r,this.rootStore.boothStore.booths,this.rootStore.eventStore.eventItems).forEach(l=>i.add(l.id.toString())):this.listBooths.forEach(l=>i.add(l.id.toString()))}if(this.list?.type==="filter"&&(i.clear(),this.list.items.flatMap(r=>r.booths.filter(l=>l instanceof A)).forEach(r=>i.add(r.id.toString()))),this.categoryFilterOpen&&this.selectedCategoryFilters.length>0?(i.clear(),this.selectedCategoryFilters.forEach(r=>{r.exhibitors.flatMap(l=>l.booths).forEach(l=>i.add(l.id.toString()))})):this.list?.type==="category"&&(i.clear(),this.list.category.exhibitors.flatMap(r=>r.booths).forEach(r=>i.add(r.id.toString()))),this.list?.type==="bookmarks"&&(i.clear(),F(this.listItems,this.rootStore.boothStore.booths,this.rootStore.eventStore.eventItems).forEach(r=>i.add(r.id.toString()))),this.list?.type==="visited"&&(i.clear(),F(this.listItems,this.rootStore.boothStore.booths,this.rootStore.eventStore.eventItems).forEach(r=>i.add(r.id.toString()))),this.list?.type==="exhibitors"){i.clear();const r=this.list.text?.toLowerCase().trim();let l=this.rootStore.exhibitorStore.exhibitors;r&&(l=l.filter(u=>u.name.toLowerCase().includes(r))),l.flatMap(u=>u.booths.filter(g=>g instanceof A)).forEach(u=>i.add(u.id.toString()))}if(this.selectedPoiTypeFilters.length>0&&(i.clear(),this.selectedPoiTypeFilters.forEach(r=>{this.rootStore.boothStore.booths.filter(l=>l.poiTypeId===r.id).forEach(l=>i.add(l.id.toString()))})),this.details instanceof M&&(i.clear(),this.details.from instanceof I&&i.add(this.details.from.id.toString()),this.details.to instanceof I&&i.add(this.details.to.id.toString()),this.details.waypoints?.forEach(r=>i.add(r.id.toString()))),this.details instanceof I&&(i.clear(),i.add(this.details.id.toString())),this.details instanceof x&&(i.clear(),this.details.booths.filter(r=>r instanceof A).forEach(r=>i.add(r.id.toString()))),this.details instanceof O){const r=this.details;if(r.boothId){i.clear();const l=this.rootStore.boothStore.booths.find(u=>u.id===r.boothId);l&&i.add(l.id.toString())}}return i}constructor(o){this.interfaceMetadata=Object.freeze([{id:"menu",className:"efp-overlay-menu",priority:80,isActive:()=>this.menu,searchBoxConfig:()=>({mode:"interface",title:S("Menu")})},{id:"exhibitor",className:"efp-overlay-exhibitor",priority:70,isActive:()=>this.details instanceof x,searchBoxConfig:()=>({mode:"details",title:this.details.name})},{id:"booth",className:"efp-overlay-booth",priority:70,isActive:()=>this.details instanceof I,searchBoxConfig:()=>{const s=this.details;return{mode:"details",title:s.title||s.name}}},{id:"event",className:"efp-overlay-event",priority:70,isActive:()=>this.details instanceof O,searchBoxConfig:()=>({mode:"details",title:this.details.name})},{id:"route",className:"efp-overlay-route",priority:70,isActive:()=>this.details instanceof M,searchBoxConfig:()=>({mode:"details",title:S("Directions")})},{id:"search",className:"efp-overlay-search",priority:60,isActive:()=>!this.details&&!this.menu&&this.list.type==="search"&&(this.rootStore.fp.alwaysShowSidebar&&!this.overlayOnDemand||this.heatmap||this.searchFocused||this.list.text.length>0||this.searchClearMode),searchBoxConfig:()=>({mode:"search",title:S("Search")})},{id:"exhibitors",className:"efp-overlay-exhibitors",priority:50,isActive:()=>this.list.type==="exhibitors"&&!this.details,searchBoxConfig:()=>({mode:"search",title:S("Exhibitors")})},{id:"filter",className:"efp-overlay-filter",priority:50,isActive:()=>this.list.type==="filter"&&!this.details,searchBoxConfig:()=>({mode:"search",title:S("Filter")})},{id:"bookmarks",className:"efp-overlay-bookmarks",priority:50,isActive:()=>this.list.type==="bookmarks"&&!this.details,searchBoxConfig:()=>({mode:"interface",title:S("Bookmarks"),badge:this.rootStore.bookmarksStore.total})},{id:"visited",className:"efp-overlay-visited",priority:50,isActive:()=>this.list.type==="visited"&&!this.details,searchBoxConfig:()=>({mode:"interface",title:S("Visited"),badge:this.rootStore.exhibitorStore.visited.length})},{id:E,className:"efp-overlay-language",priority:50,isActive:()=>this.list.type===E,searchBoxConfig:()=>({mode:"interface",title:S("Language")})},{id:"category",className:"efp-overlay-category",priority:50,isActive:()=>!B.menu&&!!B.selectedCategory,searchBoxConfig:()=>({mode:"interface",title:this.list.type==="category"&&this.list.category?.name||S("Categories")})},{id:"sessions",className:"efp-overlay-sessions",priority:50,isActive:()=>this.list.type==="sessions"&&!this.details,searchBoxConfig:()=>({mode:"search",title:S("Sessions"),subtitle:this.selectedTrack?this.selectedTrack.name:void 0})},{id:"speakers",className:"efp-overlay-speakers",priority:50,isActive:()=>this.list.type==="speakers"&&!this.details,searchBoxConfig:()=>({mode:"search",title:S("Speakers")})},{id:"speaker",className:"efp-overlay-speaker",priority:50,isActive:()=>this.details instanceof K,searchBoxConfig:()=>({mode:"details",title:this.details.name})},{id:"tours",className:"efp-overlay-tours",priority:50,isActive:()=>this.list.type==="tours"&&!this.details,searchBoxConfig:()=>({mode:"search",title:S("Guided Tours")})},{id:"multi-point-wayfinding",className:"efp-overlay-multi-point",priority:75,isActive:()=>!!(this.isMultiPointRoute&&this.selectedRoute&&this.list.type!=="route-planner"),searchBoxConfig:()=>({mode:"interface",title:this.routeTitle||S("Multi-point route")})},{id:"multi-point-tour",className:"efp-overlay-multi-point-tour",priority:75,isActive:()=>this.list.type==="multi-point-tour"&&!this.details,searchBoxConfig:()=>({mode:"interface",title:this.tourTitle||S("Multi-point route")})},{id:"route-planner",className:"efp-overlay-route-planner",priority:76,isActive:()=>this.list.type==="route-planner"&&(!this.details||this.details instanceof M),searchBoxConfig:()=>({mode:"interface",title:S("Route planner")})}].sort((s,i)=>i.priority-s.priority)),this.list={type:"search",text:"",focused:!1},this.details=null,this.hoveredExhibitor=null,this.hoveredBooth=null,this.zoomBy=null,this.rollReset=!1,this.moveToBooths=null,this.moveToRect=null,this.moveToRectPaddingPercent=null,this.moveToLocation=!1,this.menu=!1,this.searchFocused=!1,this.searchClearMode=!1,this.printingPdf=!1,this.screenSize=new it(window.innerWidth,window.innerHeight),this.overlayShowsAll=!1,this.centerMap=!1,this.zoomAfTransformK=1,this.activeListIndex=-1,this.devicePixelRatio=window.devicePixelRatio,this.previewExhibitor=null,this.wsStarted=!1,this.canvasStarted=!1,this.kiosk=!1,this.inIdle=!1,this.modalActive={share:!1},this.galleryActive=!1,this.hideOverlay=!1,this.searchButtonsOverride=null,this.hideCookieConsent=!!ut(),this.hideHeaderLogo=!1,this.hideLogoInBooth=!1,this.disableBookmarked=!1,this.hideLanguage=!1,this.monochrome=!1,this.heatmap=!1,this.heatmapYah=!1,this.rootElement=null,this.debugCircles=[],this.mapControlsHidden=!1,this.floorsControlHidden=!1,this.hideFreeOrDemo=!1,this.freeBannerDismissed=dt(sessionStorage),this.currentBanner=null,this.sceneDefReady=!1,this.categoryFilterOpen=!1,this.selectedCategoryFilters=[],this.selectedPoiTypeFilters=[],this.selectedTrack=null,this.subButtonsVisible=!1,this.searchBoxMode="search",this.searchBoxTitle="",this.isMultiPointRoute=!1,this.isMultiPointTour=!1,this.pathwayOnlyMode=!1,this.isOverlayScrolled=!1,this.listScrollTop=0,this.listScrollItemId=null,this.listScrollIndex=0,this.scrollPositions=new Map,this.scrollItemIds=new Map,this._customUIScale=null,this.searchFilterHeightPx=54,this.searchInputHeightPx=54,this.overlayUISizePx=390,this.overlayKioskSizePx=450,this.overlayMediumHeightRems=10,this.headerHeightRem=0,this.wsImageHeightPx=44,this.mapVisibleStart=0,this.forceDim=!1,this.mapSettings={},this.maxPitch=60,this.animatePitch=!0,this.forceShowDetails=!1,this.buildRoute=!1,this.globalErrorMessages=[],this.minUIScale=.8,this.maxUIScale=1.4,this.setKioskModeEnabled=!1,this.kioskData=null,this.rootStore=o,this.mapSettings={...this.defaultMapSettings},this.initializeUIScale()}get rtl(){const o=yt();return o==="ar"||o==="he"}get noOverlay(){return this.rootStore.fp.noOverlay||this.hideOverlay}get overlayOnDemand(){return this.noOverlay&&this.searchButtonsOverride===!0}get overlayHiddenNow(){return this.noOverlay&&!(this.overlayOnDemand&&this.isOverlayOpen)}get onBoothClick(){return this.rootStore.fp.onBoothClick}get onMarkerClick(){return this.rootStore.fp.onMarkerClick}get onBookmarkClick(){return this.rootStore.fp.onBookmarkClick}get onVisitedClick(){return this.rootStore.fp.onVisitedClick}get onCategoryClick(){return this.rootStore.fp.onCategoryClick}get onDirection(){return this.rootStore.fp.onDirection}get onDetails(){return this.rootStore.fp.onDetails}get onExhibitorCustomButtonClick(){return this.rootStore.fp.onExhibitorCustomButtonClick}get onGetCoordsClick(){return this.rootStore.fp.onGetCoordsClick}get selectedExhibitor(){return this.details instanceof x?this.details:null}get selectedBooth(){return this.details instanceof I?this.details:null}get selectedCategory(){return this.list.type==="category"?this.list.category:null}get selectedRoute(){return this.details instanceof M?this.details:null}get selectedSpeaker(){return this.details instanceof K?this.details:null}get uiScale(){return this._customUIScale!==null?this._customUIScale:this.kiosk?1.2:1}get isGuidedToursActive(){return this.rootStore.toursStore.isActive}get getRouteNextFloor(){const o=this.rootStore.routeStore.pathLayers,s=this.rootStore.routeStore.currentRouteLayer?.name;if(!s)return null;const i=o.findIndex(c=>c.layer?.name===s);return i===-1?null:o[i+1]?.layer?.name??null}get headerHeightPx(){return D(this.headerHeightRem)}get overlayPosition(){return this.screenSize.width>nt||this.kiosk?"left":"bottom"}get overlayCollapsed(){return this.kiosk&&this.overlayPosition==="left"&&!this.searchFocused&&!this.menu&&!this.details&&!this.selectedCategory&&!this.selectedExhibitor&&this.list.type!=="bookmarks"&&this.list.type!==E&&!("text"in this.list&&this.list.text.length)}get overlaySize(){return this.overlayLeft?"full":this.desiredOverlaySize}get overlayBottom(){return this.overlayPosition==="bottom"}get overlayLeft(){return this.overlayPosition==="left"}get overlayWidthPx(){return this.overlayHiddenNow?0:this.overlayLeft?this.kiosk?this.overlayKioskSizePx:this.overlayUISizePx:D(this.screenSize.width)}get wsPaddingPx(){return D(.25)}get wsOccupiedHeightPx(){return this.wsShown?this.wsImageHeightPx+this.wsPaddingPx*2:0}get wsShown(){return!this.hideHeaderLogo&&this.rootStore.exhibitorStore.advertised.length>0}get wsDesktopPosition(){return L.EXPO==="cbresupplypartner"?"bottom":"top"}get wsPosition(){return this.overlayBottom?"top":this.wsDesktopPosition}get responsiveClass(){return gt(this.screenSize.width)}get mapVisibleTop(){return(this.wsPosition==="top"?this.wsOccupiedHeightPx:0)+this.headerHeightPx}get mapVisibleBottom(){return this.overlayLeft||this.overlayHiddenNow?this.wsPosition==="bottom"?this.wsOccupiedHeightPx:0:D(this.overlayMediumHeightRems)}get searchActionsHeightPx(){return this.overlayPosition==="bottom"?this.searchInputHeightPx+this.searchFilterHeightPx:this.searchInputHeightPx}get shouldShowSearchButtons(){return this.rootStore.searchButtonsStore.hasAnySearchButtons&&!this.details&&!this.menu&&![E,"filter"].includes(this.list.type)}get shouldShowMobileToggle(){const o=this.list.type==="route-planner";return this.overlayPosition==="bottom"&&(o||!this.details&&!this.menu&&this.list.type!==E&&this.list.type!=="bookmarks"&&this.list.type!=="sessions")}get mobileToggleIsListMode(){return!this.isOverlayOpen||this.overlaySize!=="full"}get canvasVisibleRectPx(){const o=this.screenSize;return ot.fromMinMax({x:B.rtl?0:this.mapVisibleStart,y:this.mapVisibleTop+this.searchActionsHeightPx},{x:B.rtl?o.width-this.mapVisibleStart:o.width,y:o.height-this.mapVisibleBottom})}get shouldShiftMapRect(){return this.overlayPosition==="left"&&(this.details||this.hasAppliedFilters||this.selectedRoute)}get hasAppliedFilters(){return this.selectedCategoryFilters.length>0||this.selectedPoiTypeFilters.length>0}get canvasVisibleRectPt(){return this.canvasVisibleRectPx.scale(this.devicePixelRatio,{x:0,y:0})}get canvasSizePt(){return this.screenSize.multiply(this.devicePixelRatio)}get shouldUseBackdrop(){if(B.overlayCollapsed)return!1;if(w&&localStorage.getItem("forcebackdrop")==="1")return!0;if(this.overlayBottom||this.selectedExhibitor?.leadingImageUrl&&!this.selectedExhibitor?.leadingImageLinkUrl)return!1;const o=X.satisfies({safari:">=13"}),s=X.satisfies({chrome:">=77"});return/(android)/i.test(navigator.userAgent)?!1:o||s&&B.canvasSizePt.height*B.canvasSizePt.width<3e6}setForceDim(o){this.forceDim=o}get dimmed(){return this.forceDim||this.pathwayOnlyMode?!0:this.highlightedBooths.size>0||this.list?.type==="search"&&this.list?.text?.trim().length>0||this.list?.type==="exhibitors"}get defaultSearchItems(){const{exhibitorStore:o,categoryStore:s,boothStore:i,heatmapStore:c}=this.rootStore;let r=o.exhibitors;const l=s.categories.filter(f=>f.exhibitors.length),u=i.booths;this.selectedPoiTypeFilters.length>0&&(r=r.filter(f=>f.booths.some(y=>this.selectedPoiTypeFilters.some(v=>y.poiTypeId===v.id))));let g=[];const k=!this.selectedCategoryFilters.length&&C.showCategories?l.filter(f=>xt.includes(L.EXPO)?!f.name.includes("/"):!0):[],T=u.filter(f=>f instanceof V);return this.selectedCategoryFilters.length>0?g=[...r]:(C.showCompaniesAndBooths&&(g=g.concat(r)),C.showOtherSpaces&&(g=g.concat(T))),this.heatmap?[...r,...u].sort((y,v)=>c.getClicksByType(v)-c.getClicksByType(y)):this.heatmapYah?c.heatmapData?.yah?.sort((f,y)=>c.getClicksByType(y)-c.getClicksByType(f))||[]:r.length===0?u:[...k,...g.sort((f,y)=>{const v=f instanceof x&&f.featured!==void 0,z=y instanceof x&&y.featured!==void 0;if(v!==z)return v?-1:1;const R=f instanceof V&&f.title?f.title:f.name,U=y instanceof V&&y.title?y.title:y.name;return R.localeCompare(U,void 0,{sensitivity:"base",numeric:!0})})]}get searchItems(){if(this.list.type!=="search")return[];const o=this.list.text?.trim().toLowerCase()||"",{exhibitorStore:s,boothStore:i,eventStore:c,speakerStore:r,heatmapStore:l}=this.rootStore;let u=s.exhibitors;const g=i.booths,k=c.eventItems,T=r.speakers;if(this.selectedCategoryFilters.length>0&&(u=u.filter(h=>this.selectedCategoryFilters.some(p=>h.categories.some(m=>m.id===p.id)))),this.selectedPoiTypeFilters.length>0&&(u=u.filter(h=>h.booths.some(p=>this.selectedPoiTypeFilters.some(m=>p.poiTypeId===m.id)))),!o)return this.defaultSearchItems;const f=[o.replace(/&[^&=]+=[^&]+/g,"")];if(this.heatmapYah)return(l.heatmapData.yah??[]).filter(p=>Number.isNaN(Number(o))?p:p.viewCount>=Number(o)).sort((p,m)=>l.getClicksByType(m)-l.getClicksByType(p));const y=[],v=new Set,z=new Set,R=new Set,U=new Set;function G(h){return h?h.replace(/[!@#$%^*\-.,()^#$%:?_+'"/]/g," ").replace(/\s\s+/g," "):""}function b(h,p){return!h||!p?!1:G(h).toLowerCase().includes(G(p).toLowerCase())}function Y(h,p){return h?b(h,p)||b(C.levelTerm+" "+h,p):!1}u.forEach(h=>{f.some(p=>b(h.name,p)||h.booths.some(m=>!p&&b(m.name,p)||Y(m.layer?.name??null,p)))&&v.add(h)}),this.selectedCategoryFilters.length>0&&g.forEach(h=>{(this.heatmap||!(h instanceof A)||!Array.from(v).find(m=>m.booths.includes(h)))&&f.some(m=>b(h.title||"",m)||b(h.name,m)||b(h.fullName,m)||Y(h.layer?.name??null,m))&&z.add(h)});const q=k,tt=T;if(q.forEach(h=>{f.some(p=>b(h.name||"",p)||b(h.description||"",p))&&R.add(h)}),tt.forEach(h=>{f.some(p=>b(h.name,p)||b(h.company,p)||b(h.jobTitle,p))&&U.add(h)}),y.push(...R),y.push(...v),this.heatmap)return y.sort((h,p)=>l.getClicksByType(p)-l.getClicksByType(h));const et=new Map(y.map(h=>[h.id,h]));return y.map(h=>{if(!h.name)return null;const p=Z(h instanceof I&&h.fullName.toLowerCase()||h.name.toLowerCase()),m=p.indexOf(Z(o));if(m===-1)return null;const Q={id:h.id,position:m,lowerCaseName:p,featured:!1};return h instanceof x&&(Q.featured=h.featured),Q}).filter(h=>!!h).sort((h,p)=>(h.featured||p.featured)&&h.featured!==p.featured?h.featured?-1:1:h.position!==p.position?h.position-p.position:h.lowerCaseName.localeCompare(p.lowerCaseName)||String(h.id).localeCompare(String(p.id))).map(({id:h})=>et.get(h)).filter(h=>!!h)}get searchList(){return[...this.rootStore.eventStore.eventItems,...this.rootStore.speakerStore.speakers,...this.rootStore.categoryStore.categories.filter(o=>o.exhibitors.length),...this.rootStore.exhibitorStore.exhibitors,...this.rootStore.boothStore.booths]}get foundInDescription(){if(this.list?.type!=="search")return[];const o=this.list?.text?.trim().toLowerCase();if(!o)return[];const s=this.fuzzySearchItems.map(({item:l})=>l),i=new Set(s.map(l=>l.name)),c=this.categoryFilteredSearchList.filter(l=>!i.has(l.name)),r=[];for(const l of c){const u=J(l);if(!u)continue;const k=(W(u)?j(u):u).toLowerCase().indexOf(o);k!==-1&&r.push({item:l,pos:k})}return r.sort((l,u)=>l.pos-u.pos),r.map(l=>l.item)}get foundInDescriptionStruct(){const o={};if(this.list?.type!=="search")return o;const s=this.list?.text?.trim().toLowerCase();return this.foundInDescription.forEach(i=>{let c=J(i);if(!c)return;W(c)&&(c=j(c));const r=c.toLowerCase().indexOf(s);if(r===-1)return;const l=3,u=r>l?r-l:0,g=c.substring(u).trim();o[i.id]=r>0?`...${g}`:g}),o}get categoryFilteredSearchList(){return this.selectedCategoryFilters.length===0?this.searchList:this.searchList.filter(o=>o instanceof x&&this.selectedCategoryFilters.some(s=>o.categories.some(i=>i.id===s.id)))}get fuzzySearchItems(){if(this.list?.type!=="search")return[];const o=this.list?.text?.trim().toLowerCase();if(!o)return this.defaultSearchItems.map(r=>({item:r,score:0,matches:[]}));const s=this.rootStore.fuzzySearchEngineStore.search(this.categoryFilteredSearchList,o),i=[],c=[];for(const r of s){const l=r.item,u=l.entity.type,g=u==="booth"?l:null,k=u==="exhibitor"?l:null,T=[l.name?.toLowerCase()??"",g?.title?.toLowerCase()??"",g?.fullName?.toLowerCase()??"",...k?.booths?.map(y=>y.name?.toLowerCase()??"")??[]];let f=1/0;for(const y of T){const v=y.indexOf(o);v!==-1&&v<f&&(f=v)}f!==1/0?i.push({result:{item:l,score:0},pos:f}):c.push(r)}return i.sort((r,l)=>r.pos-l.pos),[...i.map(r=>r.result),...c]}get listItems(){if(this.details instanceof M&&this.list.type!=="multi-point-tour")return[this.details.from,this.details.to].filter(o=>o instanceof I);switch(this.list.type){case"search":{let o=!(this.heatmap||this.heatmapYah)&&this.rootStore.fuzzySearchEngineStore.engine?this.fuzzySearchItems.map(({item:s})=>s).concat(this.foundInDescription):this.searchItems;return o=o.filter(s=>s.entity.type==="booth"?!s.exhibitors.length:!0),this.hasAppliedFilters?o.filter(s=>{if(this.selectedCategoryFilters.length>0&&s instanceof x&&!this.selectedCategoryFilters.some(i=>s.categories.some(c=>c.id===i.id)))return!1;if(this.selectedPoiTypeFilters.length>0){if(s instanceof x&&!s.booths.some(i=>this.selectedPoiTypeFilters.some(c=>i.poiTypeId===c.id))||s instanceof I&&!this.selectedPoiTypeFilters.some(i=>s.poiTypeId===i.id))return!1;if(s instanceof O&&s.boothId){const i=this.rootStore.boothStore.booths.find(c=>c.id===s.boothId);if(!i||!this.selectedPoiTypeFilters.some(c=>i.poiTypeId===c.id))return!1}}return!0}):o}case"bookmarks":return[...this.rootStore.exhibitorStore.bookmarked,...this.rootStore.eventStore.bookmarked,...this.rootStore.speakerStore.bookmarked,...this.rootStore.boothStore.booths.filter(o=>o.exhibitors.length===0&&o.bookmarkedDirectly)];case"visited":return[...this.rootStore.exhibitorStore.visited,...this.rootStore.eventStore.visited];case"category":return this.list.category.exhibitors;case E:return mt();case"filter":return this.list.items;case"sessions":return this.rootStore.eventStore.eventItems;case"exhibitors":{const o=this.rootStore.exhibitorStore.exhibitors,s=this.list.text?.toLowerCase().trim();return s?o.filter(i=>i.name.toLowerCase().includes(s)):o}case"multi-point-tour":{const o=this.rootStore.toursStore.getTourById(this.list.tourId);return o?!o.points||o.points.length===0?[]:o.points.map(s=>{const i=parseInt(s);if(!isNaN(i)){const r=this.rootStore.boothStore.boothById.get(i);if(r)return r}return It(s)?.entity||null}).filter(s=>!!s):[]}case"route-planner":return this.rootStore.routePlannerStore.resolvedBooths}throw new Error("Unknown list.type")}get listBooths(){return F(this.listItems,this.rootStore.boothStore.booths,this.rootStore.eventStore.eventItems)}get selectedBooths(){let o=[];this.selectedExhibitor?o=this.selectedExhibitor.booths:this.selectedBooth&&(o=[this.selectedBooth]);const s=this.selectedRoute,i=[s?.from,s?.to,...s?.waypoints??[]].filter(c=>c instanceof I);return o.push(...i),new Set(o)}get hoveredBooths(){let o=[];return this.hoveredBooth?o=[this.hoveredBooth]:this.hoveredExhibitor&&(o=this.hoveredExhibitor.booths),new Set(o)}get visibility(){return{controls:!this.mapControlsHidden,levels:!this.floorsControlHidden,header:this.wsShown,overlay:!this.hideOverlay,searchButtons:this.searchButtonsOverride??!this.hideOverlay}}setVisibility(o){const s=["controls","levels","header","overlay"],i={...s.reduce((r,l)=>({...r,[l]:!0}),{}),...s.filter(r=>r in o).reduce((r,l)=>({...r,[l]:o[l]}),{})},c=typeof o.searchButtons=="boolean"?o.searchButtons:null;w&&(Object.values(i).every(Boolean)&&c===null?localStorage.removeItem($):localStorage.setItem($,JSON.stringify(c===null?i:{...i,searchButtons:c}))),this.mapControlsHidden=!i.controls,this.floorsControlHidden=!i.levels,this.hideHeaderLogo=!i.header,this.hideFreeOrDemo=!i.header,this.hideOverlay=!i.overlay,this.searchButtonsOverride=c}toggleMapOverlay(){this.overlayPosition==="bottom"&&this.overlaySize==="full"?this.desiredOverlaySize="medium":this.overlayPosition==="bottom"&&this.overlaySize!=="full"&&(this.desiredOverlaySize="full")}changeZoom(o){this.zoomBy=o}zoomIn(){this.changeZoom(1.5)}zoomOut(){this.changeZoom(.66)}fitBounds(){const{rect:o,source:s}=bt({layerViewbox:this.rootStore.layerStore.viewboxRectangle,explicitArea:pt?_:null,layerRectangle:this.rootStore.layerStore.rectangle,sceneDef:rt()??null,svgArea:_});this.moveToRect=o,this.moveToRectPaddingPercent=St(s)?0:vt(o,_),this.rollReset=!0}get previewMode(){const o=w?localStorage.getItem(ht)??localStorage.getItem(lt):null;return o==="true"||o==="1"||this.rootStore.fp.previewMode}get viewerMode(){const o=w?localStorage.getItem(ct)??localStorage.getItem(at):null;return o==="true"||o==="1"||this.rootStore.fp.viewerMode}get selectedEventItem(){return this.details instanceof O?this.details:null}get defaultMapSettings(){return{zoomtime:500,pitchtime:500,center:void 0,centerxy:void 0,z:void 0,bearing:0,roll:1,pitch:1,pitchdegrees:this.pitchEnabled?30:0}}setMapSettings(o){const s={};for(const i of Object.keys(o)){const c=o[i];c!=null&&(i==="zoomtime"||i==="pitchtime"?s[i]=Math.min(Math.max(o[i]||this.mapSettings[i]||0,500),5e3):Object.assign(s,{[i]:c}))}this.mapSettings={...this.mapSettings,...s}}resetMapSettings(){this.mapSettings={...this.defaultMapSettings}}get is3DView(){return!!C.allow3dView}get pitchEnabled(){return this.is3DView?this.mapSettings.pitch===void 0||Number(this.mapSettings.pitch)===1:!1}get rollEnabled(){return this.rootStore.fp.enableRotation?this.mapSettings.roll===void 0||Number(this.mapSettings.roll)===1:!1}get baseQRCodeUrl(){return`https://${L.EXPO}.expofp.com`}get viewMapOnPhoneQRCodeUrl(){if(C?.customKioskQrCodeUrl)return C.customKioskQrCodeUrl;const o=new URL(this.baseQRCodeUrl);o.search=window.location.search;const s=o.toString();return console.log("View Map On Phone QR Code Url",s),s}get routeQRCodeUrl(){const o=new URL(this.baseQRCodeUrl),s=this.selectedRoute?.from,i=this.selectedRoute?.to,c=s instanceof I?s.slug:"",r=i instanceof I?i.slug:"";o.search=`?route%3A${encodeURIComponent(r)}%3A${encodeURIComponent(c)}%3Afalse`,st(o.searchParams,this.kioskData);const l=o.toString();return console.log("Route QR Code Url",l),l}get isFeaturedExhibitorActive(){return this.details instanceof x&&!!this.details.featured}get activeInterfaceData(){for(const o of this.interfaceMetadata)if(o.isActive())return o;return null}get activeInterfaceId(){return this.activeInterfaceData?.id}get searchBoxConfig(){const o=this.activeInterfaceData;return!o||!o.searchBoxConfig?{mode:"search",title:"",subtitle:void 0,badge:void 0,icon:void 0}:o.searchBoxConfig()||{mode:"search",title:"",subtitle:void 0,badge:void 0,icon:void 0}}get searchBoxActions(){return this.activeInterfaceData?.actions?.()??[]}get overlayInterfaceClasses(){const o=[],s=this.activeInterfaceData;return s&&(o.push(s.className),s.additionalClasses&&o.push(...s.additionalClasses())),this.details&&o.push("overlay-has-details"),this.list.type&&o.push(`overlay-list-${this.list.type}`),this.isFeaturedExhibitorActive&&o.push("overlay-exhibitor-featured"),o}get isOverlayOpen(){return this.noOverlay&&!this.overlayOnDemand?!1:this.activeInterfaceData!==null}setOverlayScrolled(o){this.isOverlayScrolled=o}setListScrollTop(o,s){this.listScrollTop=s,this.scrollPositions.set(o,s)}setListScrollItemId(o,s){this.listScrollItemId=s,this.scrollItemIds.set(o,s)}getListScrollTop(o){return this.scrollPositions.get(o)||0}getListScrollItemId(o){return this.scrollItemIds.get(o)||null}clearListScroll(o){this.scrollPositions.delete(o),this.scrollItemIds.delete(o),this.list.type===o&&(this.listScrollTop=0,this.listScrollItemId=null)}get bannerType(){return this.hideFreeOrDemo||this.heatmap?null:L.EXPO==="expo"?"demo":C.expoFpAd||C.isTrial?"free":null}get isBannerVisible(){return this.bannerType!==null}setCurrentBanner(o){this.currentBanner=o}setForceShowDetails(o){this.forceShowDetails=o}get showRouteInstantly(){return!!(this.kiosk&&!this.forceShowDetails)}startBuildRoute(){this.rootStore.selectSearch(""),this.mapControlsHidden=!0,this.floorsControlHidden=!0,this.hideHeaderLogo=!0,this.hideFreeOrDemo=!0,this.hideOverlay=!0,this.hideCookieConsent=!0,this.buildRoute=!0}setGlobalErrorMessage(o){this.globalErrorMessages.push(o)}popGlobalErrorMessage(){this.globalErrorMessages.pop()}initializeUIScale(){if(new URLSearchParams(window.location.search).get("kiosk")!=="0"&&w){const s=localStorage.getItem(H)??localStorage.getItem(N);if(s){const i=parseFloat(s);!isNaN(i)&&i>=.8&&i<=1.4&&(this._customUIScale=i)}}}setUIScale(o,s=!0){if(o===void 0||isNaN(o)||o<this.minUIScale||o>this.maxUIScale){ft.warn(`Invalid ui-scale value: ${o}. Must be between ${this.minUIScale} and ${this.maxUIScale}.`);return}this._customUIScale=o,s&&w&&(localStorage.setItem(H,o.toString()),localStorage.removeItem(N))}resetUIScale(){this._customUIScale=null,w&&(localStorage.removeItem(H),localStorage.removeItem(N))}restoreUIScale(){this._customUIScale=null,this.initializeUIScale()}enableSetKioskMode(o){this.setKioskModeEnabled=o}setKioskData(o){this.kioskData=o}}e([a.struct],t.prototype,"list",void 0),e([a.ref],t.prototype,"details",void 0),e([a.ref],t.prototype,"hoveredExhibitor",void 0),e([a.ref],t.prototype,"hoveredBooth",void 0),e([a],t.prototype,"zoomBy",void 0),e([a],t.prototype,"rollReset",void 0),e([a],t.prototype,"moveToBooths",void 0),e([a],t.prototype,"moveToRect",void 0),e([a],t.prototype,"moveToRectPaddingPercent",void 0),e([a],t.prototype,"moveToLocation",void 0),e([a],t.prototype,"menu",void 0),e([a],t.prototype,"searchFocused",void 0),e([a],t.prototype,"searchClearMode",void 0),e([a],t.prototype,"printingPdf",void 0),e([a.struct],t.prototype,"screenSize",void 0),e([a],t.prototype,"desiredOverlaySize",void 0),e([a],t.prototype,"overlayShowsAll",void 0),e([a],t.prototype,"centerMap",void 0),e([a],t.prototype,"zoomAfTransformK",void 0),e([a],t.prototype,"activeListIndex",void 0),e([a],t.prototype,"devicePixelRatio",void 0),e([a],t.prototype,"wsStarted",void 0),e([a],t.prototype,"canvasStarted",void 0),e([a],t.prototype,"kiosk",void 0),e([a],t.prototype,"inIdle",void 0),e([a],t.prototype,"modalActive",void 0),e([a],t.prototype,"galleryActive",void 0),e([a],t.prototype,"hideOverlay",void 0),e([a],t.prototype,"searchButtonsOverride",void 0),e([a],t.prototype,"hideCookieConsent",void 0),e([a],t.prototype,"hideHeaderLogo",void 0),e([a],t.prototype,"hideLogoInBooth",void 0),e([a],t.prototype,"disableBookmarked",void 0),e([a],t.prototype,"hideLanguage",void 0),e([a],t.prototype,"monochrome",void 0),e([a],t.prototype,"heatmap",void 0),e([a],t.prototype,"heatmapYah",void 0),e([a],t.prototype,"debugCircles",void 0),e([a],t.prototype,"mapControlsHidden",void 0),e([a],t.prototype,"floorsControlHidden",void 0),e([a],t.prototype,"hideFreeOrDemo",void 0),e([a],t.prototype,"freeBannerDismissed",void 0),e([a],t.prototype,"currentBanner",void 0),e([a],t.prototype,"sceneDefReady",void 0),e([a],t.prototype,"categoryFilterOpen",void 0),e([a],t.prototype,"selectedCategoryFilters",void 0),e([a],t.prototype,"selectedPoiTypeFilters",void 0),e([a],t.prototype,"selectedTrack",void 0),e([a],t.prototype,"subButtonsVisible",void 0),e([a],t.prototype,"searchBoxMode",void 0),e([a],t.prototype,"searchBoxTitle",void 0),e([a],t.prototype,"searchBoxSubtitle",void 0),e([a],t.prototype,"routeTitle",void 0),e([a],t.prototype,"routeDescription",void 0),e([a],t.prototype,"isMultiPointRoute",void 0),e([a],t.prototype,"tourTitle",void 0),e([a],t.prototype,"tourDescription",void 0),e([a],t.prototype,"isMultiPointTour",void 0),e([a],t.prototype,"pathwayOnlyMode",void 0),e([a],t.prototype,"isOverlayScrolled",void 0),e([a],t.prototype,"listScrollTop",void 0),e([a],t.prototype,"listScrollItemId",void 0),e([a],t.prototype,"listScrollIndex",void 0),e([a],t.prototype,"_customUIScale",void 0),e([d],t.prototype,"setSelectedCategoryFilters",null),e([d],t.prototype,"resetCategoryFilter",null),e([d],t.prototype,"setSearchClearMode",null),e([d],t.prototype,"setRouteTitle",null),e([d],t.prototype,"setRouteDescription",null),e([d],t.prototype,"setIsMultiPointRoute",null),e([d],t.prototype,"setTourTitle",null),e([d],t.prototype,"setTourDescription",null),e([d],t.prototype,"setIsMultiPointTour",null),e([d],t.prototype,"setPathwayOnlyMode",null),e([d],t.prototype,"setMultiPointTourList",null),e([n],t.prototype,"activePathwayLayers",null),e([n],t.prototype,"highlightedBooths",null),e([n],t.prototype,"rtl",null),e([n({keepAlive:!0})],t.prototype,"noOverlay",null),e([n],t.prototype,"overlayOnDemand",null),e([n],t.prototype,"overlayHiddenNow",null),e([n({keepAlive:!0})],t.prototype,"selectedExhibitor",null),e([n({keepAlive:!0})],t.prototype,"selectedBooth",null),e([n({keepAlive:!0})],t.prototype,"selectedCategory",null),e([n({keepAlive:!0})],t.prototype,"selectedRoute",null),e([n({keepAlive:!0})],t.prototype,"selectedSpeaker",null),e([n({keepAlive:!0})],t.prototype,"uiScale",null),e([n({keepAlive:!0})],t.prototype,"isGuidedToursActive",null),e([n({keepAlive:!0})],t.prototype,"getRouteNextFloor",null),e([n],t.prototype,"headerHeightPx",null),e([n],t.prototype,"overlayPosition",null),e([n],t.prototype,"overlayCollapsed",null),e([n],t.prototype,"overlaySize",null),e([n],t.prototype,"overlayBottom",null),e([n],t.prototype,"overlayLeft",null),e([n],t.prototype,"overlayWidthPx",null),e([n],t.prototype,"wsPaddingPx",null),e([n],t.prototype,"wsOccupiedHeightPx",null),e([n({keepAlive:!0})],t.prototype,"wsShown",null),e([n],t.prototype,"wsDesktopPosition",null),e([n],t.prototype,"wsPosition",null),e([n],t.prototype,"responsiveClass",null),e([n],t.prototype,"mapVisibleTop",null),e([n],t.prototype,"mapVisibleBottom",null),e([n],t.prototype,"searchActionsHeightPx",null),e([n],t.prototype,"shouldShowSearchButtons",null),e([n],t.prototype,"shouldShowMobileToggle",null),e([n],t.prototype,"mobileToggleIsListMode",null),e([n],t.prototype,"canvasVisibleRectPx",null),e([n],t.prototype,"shouldShiftMapRect",null),e([n],t.prototype,"hasAppliedFilters",null),e([n],t.prototype,"canvasVisibleRectPt",null),e([n],t.prototype,"canvasSizePt",null),e([n({keepAlive:!0})],t.prototype,"shouldUseBackdrop",null),e([a],t.prototype,"forceDim",void 0),e([d],t.prototype,"setForceDim",null),e([n],t.prototype,"dimmed",null),e([n],t.prototype,"defaultSearchItems",null),e([n],t.prototype,"searchItems",null),e([n],t.prototype,"searchList",null),e([n],t.prototype,"foundInDescription",null),e([n],t.prototype,"foundInDescriptionStruct",null),e([n],t.prototype,"categoryFilteredSearchList",null),e([n],t.prototype,"fuzzySearchItems",null),e([n],t.prototype,"listItems",null),e([n({keepAlive:!0})],t.prototype,"listBooths",null),e([n({keepAlive:!0})],t.prototype,"selectedBooths",null),e([n({keepAlive:!0})],t.prototype,"hoveredBooths",null),e([n],t.prototype,"visibility",null),e([d],t.prototype,"setVisibility",null),e([d],t.prototype,"toggleMapOverlay",null),e([d],t.prototype,"changeZoom",null),e([d],t.prototype,"zoomIn",null),e([d],t.prototype,"zoomOut",null),e([d],t.prototype,"fitBounds",null),e([n({keepAlive:!0})],t.prototype,"selectedEventItem",null),e([a],t.prototype,"mapSettings",void 0),e([d],t.prototype,"setMapSettings",null),e([d],t.prototype,"resetMapSettings",null),e([a],t.prototype,"animatePitch",void 0),e([n({keepAlive:!0})],t.prototype,"pitchEnabled",null),e([n],t.prototype,"rollEnabled",null),e([n],t.prototype,"baseQRCodeUrl",null),e([n],t.prototype,"viewMapOnPhoneQRCodeUrl",null),e([n],t.prototype,"routeQRCodeUrl",null),e([n],t.prototype,"isFeaturedExhibitorActive",null),e([n],t.prototype,"activeInterfaceData",null),e([n],t.prototype,"activeInterfaceId",null),e([n],t.prototype,"searchBoxConfig",null),e([n],t.prototype,"searchBoxActions",null),e([n],t.prototype,"overlayInterfaceClasses",null),e([n],t.prototype,"isOverlayOpen",null),e([d],t.prototype,"setOverlayScrolled",null),e([d],t.prototype,"setListScrollTop",null),e([d],t.prototype,"setListScrollItemId",null),e([d],t.prototype,"getListScrollTop",null),e([d],t.prototype,"getListScrollItemId",null),e([d],t.prototype,"clearListScroll",null),e([n],t.prototype,"bannerType",null),e([n],t.prototype,"isBannerVisible",null),e([d],t.prototype,"setCurrentBanner",null),e([a],t.prototype,"forceShowDetails",void 0),e([d],t.prototype,"setForceShowDetails",null),e([n],t.prototype,"showRouteInstantly",null),e([a],t.prototype,"buildRoute",void 0),e([d],t.prototype,"startBuildRoute",null),e([a],t.prototype,"globalErrorMessages",void 0),e([d],t.prototype,"setGlobalErrorMessage",null),e([d],t.prototype,"popGlobalErrorMessage",null),e([d],t.prototype,"initializeUIScale",null),e([d],t.prototype,"setUIScale",null),e([d],t.prototype,"resetUIScale",null),e([d],t.prototype,"restoreUIScale",null),e([a],t.prototype,"setKioskModeEnabled",void 0),e([d],t.prototype,"enableSetKioskMode",null),e([a],t.prototype,"kioskData",void 0),e([d],t.prototype,"setKioskData",null);function J(P){return"description"in P&&typeof P.description=="string"?P.description:void 0}function F(P,o,s=[]){const i=[];return P.forEach(c=>{if(c instanceof x)i.push(...c.booths);else if(c instanceof I)i.push(c);else if(c instanceof O){const r=o.find(l=>l.id===c.boothId);c.boothId&&r&&i.push(r)}else c instanceof K&&s.filter(r=>r.speakers.some(l=>l.id===c.id)&&r.boothId).forEach(r=>{const l=o.find(u=>u.id===r.boothId);l&&i.push(l)})}),new Set(i.filter(Boolean))}