@expofp/floorplan
Version:
Interactive floor plan library for expos and events
3 lines (2 loc) • 1.21 kB
JavaScript
import{__decorate as e}from"tslib";import l from"copy-to-clipboard";import{computed as a}from"mobx";import{t as s}from"../utils/i18n";export default class r{constructor(t){this.rootStore=t,this._share=this.share.bind(this)}get bookmarkedBooths(){return this.rootStore.boothStore.booths.filter(t=>t.exhibitors.length===0&&t.bookmarkedDirectly)}get total(){return this.rootStore.exhibitorStore.bookmarked.length+this.rootStore.eventStore.bookmarked.length+this.rootStore.speakerStore.bookmarked.length+this.bookmarkedBooths.length}get hasBookmarks(){return this.total>0}get hasRoutableBookmarks(){return this.rootStore.exhibitorStore.bookmarked.length>0||this.bookmarkedBooths.length>0}share(){const{exhibitorStore:t,eventStore:h,speakerStore:k}=this.rootStore,i=window.location,m=[...t.bookmarked.map(o=>o.id),...h.bookmarked.map(o=>o.id),...k.bookmarked.map(o=>o.id),...this.bookmarkedBooths.map(o=>o.id)];l(`${i.protocol}//${i.host}/?b=`+m.join("|")),alert(s("Link copied to clipboard")+`.
`+s("Open it on another device to import bookmarks")+".")}}e([a],r.prototype,"bookmarkedBooths",null),e([a],r.prototype,"total",null),e([a],r.prototype,"hasBookmarks",null),e([a],r.prototype,"hasRoutableBookmarks",null);