UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

3 lines (2 loc) 1.96 kB
import{__esDecorate as r,__runInitializers as b}from"tslib";import u from"copy-to-clipboard";import{computed as s}from"mobx";import{t as m}from"../utils/i18n";let p=(()=>{let a=[],i,l,k,h;return class{static{const o=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;i=[s],l=[s],k=[s],h=[s],r(this,null,i,{kind:"getter",name:"bookmarkedBooths",static:!1,private:!1,access:{has:t=>"bookmarkedBooths"in t,get:t=>t.bookmarkedBooths},metadata:o},null,a),r(this,null,l,{kind:"getter",name:"total",static:!1,private:!1,access:{has:t=>"total"in t,get:t=>t.total},metadata:o},null,a),r(this,null,k,{kind:"getter",name:"hasBookmarks",static:!1,private:!1,access:{has:t=>"hasBookmarks"in t,get:t=>t.hasBookmarks},metadata:o},null,a),r(this,null,h,{kind:"getter",name:"hasRoutableBookmarks",static:!1,private:!1,access:{has:t=>"hasRoutableBookmarks"in t,get:t=>t.hasRoutableBookmarks},metadata:o},null,a),o&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})}rootStore=b(this,a);_share;constructor(o){this.rootStore=o,this._share=this.share.bind(this)}get bookmarkedBooths(){return this.rootStore.boothStore.booths.filter(o=>o.exhibitors.length===0&&o.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:o,eventStore:t,speakerStore:d}=this.rootStore,n=window.location,c=[...o.bookmarked.map(e=>e.id),...t.bookmarked.map(e=>e.id),...d.bookmarked.map(e=>e.id),...this.bookmarkedBooths.map(e=>e.id)];u(`${n.protocol}//${n.host}/?b=`+c.join("|")),alert(m("Link copied to clipboard")+`. `+m("Open it on another device to import bookmarks")+".")}}})();export default p;