"use strict";var b=Object.create;var n=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var y=Object.getPrototypeOf;var B=Object.prototype.hasOwnProperty;var l=(e,s)=>n(e,"name",{value:s,configurable:true});var v=(e,s)=>{for(var t in s)n(e,t,{get:s[t],enumerable:true})};var d=(e,s,t,o)=>{if(s&&typeof s==="object"||typeof s==="function"){for(let r of p(s))if(!B.call(e,r)&&r!==t)n(e,r,{get:()=>s[r],enumerable:!(o=g(s,r))||o.enumerable})}return e};var w=(e,s,t)=>(t=e!=null?b(y(e)):{},d(s||!e||!e.__esModule?n(t,"default",{value:e,enumerable:true}):t,e));var C=e=>d(n({},"__esModule",{value:true}),e);var T={};v(T,{default:()=>u});module.exports=C(T);var c=require("@electron/remote");var h=require("mobx");var m=w(require("semver"));var a=require("../environment");class u{stores;actions;build;constructor(s,t){this.stores=s;this.actions=t;try{if(a.isMac&&m.default.gt(a.osRelease,"16.6.0")){this.build=(0,h.autorun)(this._build.bind(this))}}catch(o){console.error(o)}}_build(){const s=(0,c.getCurrentWindow)();if(this.stores.user.isLoggedIn){const{TouchBarButton:t,TouchBarSpacer:o}=c.TouchBar;const r=[];for(const i of this.stores.services.allDisplayed){r.push(new t({label:`${i.name}${i.unreadDirectMessageCount>0?" \u{1F534}":""} ${i.unreadDirectMessageCount===0&&i.unreadIndirectMessageCount>0?" \u26AA\uFE0F":""}`,backgroundColor:i.isActive&&"#3498DB",click:()=>{this.actions.service.setActive({serviceId:i.id})}}),new o({size:"small"}))}const f=new c.TouchBar({items:r});s.setTouchBar(f)}else{s.setTouchBar(null)}}}l(u,"FranzTouchBar");
