"use strict";var B=Object.create;var a=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var H=Object.getPrototypeOf;var j=Object.prototype.hasOwnProperty;var v=(e,o)=>a(e,"name",{value:o,configurable:true});var z=(e,o)=>{for(var t in o)a(e,t,{get:o[t],enumerable:true})};var b=(e,o,t,s)=>{if(o&&typeof o==="object"||typeof o==="function"){for(let r of $(o))if(!j.call(e,r)&&r!==t)a(e,r,{get:()=>o[r],enumerable:!(s=C(o,r))||s.enumerable})}return e};var f=(e,o,t)=>(t=e!=null?B(H(e)):{},b(o||!e||!e.__esModule?a(t,"default",{value:e,enumerable:true}):t,e));var K=e=>b(a({},"__esModule",{value:true}),e);var y=(e,o,t,s)=>{var r=s>1?void 0:s?C(o,t):o;for(var i=e.length-1,n;i>=0;i--)if(n=e[i])r=(s?n(o,t,r):n(r))||r;if(s&&r)a(o,t,r);return r};var W={};z(W,{default:()=>R});module.exports=K(W);var l=require("react/jsx-runtime");var M=require("@electron/remote");var S=require("@mdi/js");var p=f(require("classnames"));var w=require("lodash");var E=require("mobx-react");var h=require("react");var m=require("react-intl");var A=f(require("react-jss"));var T=f(require("../../../components/ui/icon"));var u=require("../../../environment");var N=require("../../../jsUtils");const I=(0,m.defineMessages)({noServicesAddedYet:{id:"workspaceDrawer.item.noServicesAddedYet",defaultMessage:"No services added yet"},contextMenuEdit:{id:"workspaceDrawer.item.contextMenuEdit",defaultMessage:"edit"},services:{id:"workspaceDrawer.item.services",defaultMessage:"services"}});const Y=window?.matchMedia("(prefers-reduced-motion: no-preference)")?"background-color 300ms ease-out":"none";const L=v(e=>({item:{height:"67px",padding:`15px ${e.workspaces.drawer.padding}px`,borderBottom:`1px solid ${e.workspaces.drawer.listItem.border}`,transition:Y,"&:first-child":{borderTop:`1px solid ${e.workspaces.drawer.listItem.border}`},"&:hover":{backgroundColor:e.workspaces.drawer.listItem.hoverBackground},"&.compact":{padding:"0px",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",fontSize:"16px"}},isActiveItem:{backgroundColor:e.workspaces.drawer.listItem.activeBackground,"&:hover":{backgroundColor:e.workspaces.drawer.listItem.activeBackground}},name:{marginTop:"4px",color:e.workspaces.drawer.listItem.name.color,"&.compact":{marginTop:0,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis"}},activeName:{color:e.workspaces.drawer.listItem.name.activeColor},services:{display:"block",fontSize:"11px",marginTop:"5px",color:e.workspaces.drawer.listItem.services.color,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",lineHeight:"15px","&.compact":{display:"none"}},activeServices:{color:e.workspaces.drawer.listItem.services.active},icon:{fill:e.workspaces.drawer.listItem.name.color},activeIcon:{fill:e.workspaces.drawer.listItem.name.activeColor}}),"styles");let c=class extends h.Component{render(){const{classes:o,isActive:t,name:s,onClick:r,onContextMenuEditClick:i=null,services:n,shortcutIndex:k,intl:x,isCompact:g}=this.props;const d=g?"compact":"";const O=[{label:s,enabled:false},{type:"separator"},{label:x.formatMessage(I.contextMenuEdit),click:i||w.noop}];const P=M.Menu.buildFromTemplate(O);return(0,l.jsxs)("div",{className:(0,p.default)([o.item,t?o.isActiveItem:null,d]),onClick:r,onContextMenu:()=>{if(i){P.popup()}},onKeyDown:w.noop,"aria-label":g?s:void 0,"data-tooltip-id":"tooltip-workspaces-drawer","data-tooltip-content":(0,N.acceleratorString)({index:k,keyCombo:`${(0,u.cmdOrCtrlShortcutKey)(false)}+${(0,u.altKey)(false)}`}),children:[(0,l.jsx)("span",{className:(0,p.default)([o.name,t?o.activeName:null,d]),children:d?k===0?(0,l.jsx)(T.default,{icon:S.mdiApps,size:1.5,className:(0,p.default)([o.icon,t?o.activeIcon:null])}):[...s][0]:s}),(0,l.jsx)("span",{className:(0,p.default)([o.services,t?o.activeServices:null,d]),children:n.length>0?n.join(", "):x.formatMessage(I.noServicesAddedYet)})]})}};v(c,"WorkspaceDrawerItem");c=y([E.observer],c);var R=(0,m.injectIntl)((0,A.default)(L,{injectTheme:true})(c));
