Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/cvetdv.ru/bitrix/js/im/v2/component/navigation/dist/ |
Upload File : |
this.BX=this.BX||{};this.BX.Messenger=this.BX.Messenger||{};this.BX.Messenger.v2=this.BX.Messenger.v2||{};(function(t,e,n,i,s,o,a,r,c,l,u,p,d,m,g,v,h,_,I,M,S,C,b,x,T,k,P,A){"use strict";const f={name:"ButtonPanel",components:{ChatButton:c.ChatButton},emits:["openProfile","logout"],computed:{ButtonSize:()=>c.ButtonSize,ButtonColor:()=>c.ButtonColor,currentUserId(){return M.Core.getUserId()},profileUri(){return l.Utils.user.getProfileLink(this.currentUserId)},isDesktop(){return m.DesktopApi.isDesktop()}},methods:{loc(t){return this.$Bitrix.Loc.getMessage(t)},onLogoutClick(){void m.DesktopApi.logout()}},template:`\n\t\t<div class="bx-im-user-settings-popup__button-panel">\n\t\t\t<a :href="profileUri" target="_blank" class="bx-im-user-settings-popup__user_link">\n\t\t\t\t<ChatButton\n\t\t\t\t\t:color="ButtonColor.PrimaryBorder"\n\t\t\t\t\t:size="ButtonSize.M"\n\t\t\t\t\t:isUppercase="false"\n\t\t\t\t\t:isRounded="true"\n\t\t\t\t\t:text="loc('IM_USER_SETTINGS_OPEN_PROFILE')"\n\t\t\t\t\t@click="$emit('openProfile')"\n\t\t\t\t/>\n\t\t\t</a>\n\t\t\t<ChatButton\n\t\t\t\tv-if="isDesktop" \n\t\t\t\t:color="ButtonColor.DangerBorder"\n\t\t\t\t:size="ButtonSize.M"\n\t\t\t\t:isUppercase="false"\n\t\t\t\t:isRounded="true"\n\t\t\t\t:text="loc('IM_USER_SETTINGS_LOGOUT')"\n\t\t\t\t@click="onLogoutClick"\n\t\t\t/>\n\t\t</div>\n\t`};const N={S:"S",M:"M",L:"L",XL:"XL",XXL:"XXL"};const L={name:"UserStatus",props:{status:{type:String,required:true,validator(t){return Object.values(x.UserStatus).includes(t)}},size:{type:String,default:N.M,validator(t){return Object.values(N).includes(t)}}},computed:{containerClasses(){return[`--size-${this.size.toLowerCase()}`,`--${this.status}`]}},template:`\n\t\t<div :class="containerClasses" class="bx-im-user-status__container bx-im-user-status__scope"></div>\n\t`};const U={name:"UserStatusContent",components:{UserStatus:L},emits:["close"],computed:{UserStatusSize:()=>N,statusList(){return[x.UserStatus.online,x.UserStatus.dnd]}},methods:{onStatusClick(t){this.getSettingsService().changeStatus(t);this.$emit("close")},getSettingsService(){if(!this.settingsService){this.settingsService=new u.SettingsService}return this.settingsService},getStatusText(t){return l.Utils.user.getStatusText(t)}},template:`\n\t\t<div class="bx-im-user-status-popup__scope bx-im-user-status-popup__container">\n\t\t\t<div\n\t\t\t\tv-for="status in statusList"\n\t\t\t\t:key="status"\n\t\t\t\t@click="onStatusClick(status)"\n\t\t\t\tclass="bx-im-user-status-popup__item"\n\t\t\t>\n\t\t\t\t<UserStatus :status="status" :size="UserStatusSize.M" />\n\t\t\t\t<div class="bx-im-user-status-popup__text">{{ getStatusText(status) }}</div>\n\t\t\t</div>\n\t\t</div>\n\t`};const B="im-user-status-popup";const E={name:"UserStatusPopup",components:{MessengerPopup:P.MessengerPopup,UserStatusContent:U},props:{bindElement:{type:Object,required:true}},emits:["close"],computed:{POPUP_ID:()=>B,config(){return{width:190,bindElement:this.bindElement,offsetTop:4,padding:0}}},template:`\n\t\t<MessengerPopup\n\t\t\t:config="config"\n\t\t\t@close="$emit('close')"\n\t\t\t:id="POPUP_ID"\n\t\t>\n\t\t\t<UserStatusContent @close="$emit('close')" />\n\t\t</MessengerPopup>\n\t`};var O=babelHelpers.classPrivateFieldLooseKey("getConnectItem");var y=babelHelpers.classPrivateFieldLooseKey("getDeleteItem");var w=babelHelpers.classPrivateFieldLooseKey("connect");var D=babelHelpers.classPrivateFieldLooseKey("disconnect");class X extends d.BaseMenu{constructor(){super();Object.defineProperty(this,D,{value:z});Object.defineProperty(this,w,{value:F});Object.defineProperty(this,y,{value:H});Object.defineProperty(this,O,{value:$});this.id=x.PopupType.desktopItemMenu}getMenuItems(){return[babelHelpers.classPrivateFieldLooseBase(this,O)[O](),babelHelpers.classPrivateFieldLooseBase(this,y)[y]()]}close(){var t;(t=C.PopupManager.getPopupById(x.PopupType.userProfile))==null?void 0:t.setAutoHide(true);super.close()}}function $(){const t=this.context.connected?p.Loc.getMessage("IM_USER_SETTINGS_DESKTOP_CONTEXT_MENU_DISCONNECT_V2"):p.Loc.getMessage("IM_USER_SETTINGS_DESKTOP_CONTEXT_MENU_CONNECT_V2");return{text:t,onclick:function(){var t;if(this.context.connected){babelHelpers.classPrivateFieldLooseBase(this,D)[D]()}else{babelHelpers.classPrivateFieldLooseBase(this,w)[w]()}this.menuInstance.close();(t=C.PopupManager.getPopupById(x.PopupType.userProfile))==null?void 0:t.close()}.bind(this)}}function H(){return{text:p.Loc.getMessage("IM_USER_SETTINGS_DESKTOP_CONTEXT_MENU_DELETE_V2"),onclick:async function(){const t=await g.showDesktopDeleteConfirm();if(t===true){var e;m.DesktopApi.deleteAccount(this.context.host,this.context.login);(e=C.PopupManager.getPopupById(x.PopupType.userProfile))==null?void 0:e.close()}}.bind(this)}}function F(){const{host:t,login:e,protocol:n}=this.context;const i=navigator.language;m.DesktopApi.connectAccount(t,e,n,i)}function z(){const{host:t}=this.context;m.DesktopApi.disconnectAccount(t)}const G={name:"DesktopAccountItem",props:{account:{type:Object,required:true}},emits:["contextMenuClick"],data(){return{errorLoadAvatar:false}},computed:{accountItem(){return this.account},avatarUrl(){if(this.errorLoadAvatar||!this.hasAvatar){return""}if(this.accountItem.avatar.startsWith("http")){return this.accountItem.avatar}return`${this.accountItem.protocol}://${this.accountItem.host}${this.accountItem.avatar}`},isConnected(){return this.accountItem.connected},hasAvatar(){return this.accountItem.avatar&&this.accountItem.avatar!=="/bitrix/js/im/images/blank.gif"}},methods:{onContextMenuClick(t){this.$emit("contextMenuClick",{account:this.account,target:t.target})},onDomainClick(){if(!this.isConnected){return}v.DesktopManager.getInstance().openAccountTab(this.accountItem.portal)},onError(){this.errorLoadAvatar=true}},template:`\n\t\t<div class="bx-im-desktop-connection-list-item__container bx-im-desktop-connection-list-item__scope">\n\t\t\t<div class="bx-im-desktop-connection-list-item__content" :class="{'--disconnected': !isConnected}">\n\t\t\t\t<img \n\t\t\t\t\tv-if="avatarUrl" \n\t\t\t\t\t:src="avatarUrl"\n\t\t\t\t\t:alt="accountItem.portal"\n\t\t\t\t\t@error="onError"\n\t\t\t\t\tclass="bx-im-desktop-connection-list-item__avatar" \n\t\t\t\t/>\n\t\t\t\t<span v-else class="bx-im-desktop-connection-list-item__avatar-default"></span>\n\t\t\t\t<div class="bx-im-desktop-connection-list-item__title-container">\n\t\t\t\t\t<span class="bx-im-desktop-connection-list-item__title" @click="onDomainClick">\n\t\t\t\t\t\t{{ accountItem.portal }}\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class="bx-im-desktop-connection-list-item__login">{{ accountItem.login }}</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<button\n\t\t\t\tclass="bx-im-messenger__context-menu-icon bx-im-desktop-connection-list-item__context-menu"\n\t\t\t\t@click="onContextMenuClick"\n\t\t\t></button>\n\t\t</div>\n\t`};const R={name:"DesktopAccountList",components:{DesktopAccountItem:G},emits:["openContextMenu"],data(){return{accounts:[]}},computed:{isEmptyState(){return this.accounts.length===0}},created(){this.contextMenu=new X;this.accounts=m.DesktopApi.getAccountList()},beforeUnmount(){this.contextMenu.destroy()},methods:{openLoginTab(){var t;this.contextMenu.destroy();(t=C.PopupManager.getPopupById(x.PopupType.userProfile))==null?void 0:t.close();m.DesktopApi.openAddAccountTab()},onContextMenuClick(t){const{account:e,target:n}=t;this.contextMenu.openMenu(e,n);this.$emit("openContextMenu")}},template:`\n\t\t<div class="bx-im-desktop-connection-list__container bx-im-desktop-connection-list__scope">\n\t\t\t<div class="bx-im-desktop-connection-list__header">\n\t\t\t\t<span class="bx-im-desktop-connection-list__title">\n\t\t\t\t\t{{ $Bitrix.Loc.getMessage('IM_USER_SETTINGS_CONNECTED_BITRIX24') }}\n\t\t\t\t</span>\n\t\t\t\t<span class="bx-im-desktop-connection-list__add" @click="openLoginTab">\n\t\t\t\t\t{{ $Bitrix.Loc.getMessage('IM_USER_SETTINGS_CONNECT_BITRIX24') }}\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t<div class="bx-im-desktop-connection-list__items">\n\t\t\t\t<DesktopAccountItem \n\t\t\t\t\tv-for="account in accounts" \n\t\t\t\t\t:account="account" \n\t\t\t\t\t@contextMenuClick="onContextMenuClick"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t`};const V={name:"UserSettingsContent",components:{ChatAvatar:r.ChatAvatar,UserStatus:L,ButtonPanel:f,UserStatusPopup:E,DesktopAccountList:R,ScrollWithGradient:a.ScrollWithGradient},emits:["closePopup","enableAutoHide","disableAutoHide"],data(){return{showStatusPopup:false}},computed:{AvatarSize:()=>r.AvatarSize,UserStatusSize:()=>N,currentUserId(){return M.Core.getUserId()},currentUserDialogId(){return this.currentUserId.toString()},currentUser(){return this.$store.getters["users/get"](this.currentUserId,true)},currentUserPosition(){return this.$store.getters["users/getPosition"](this.currentUserId)},userStatus(){const t=this.$store.getters["application/settings/get"](x.Settings.user.status);if(t){return t}return x.UserStatus.online},currentHost(){return location.hostname},userStatusText(){return l.Utils.user.getStatusText(this.userStatus)},isDesktopAccountManagementAvailable(){return m.DesktopApi.isFeatureSupported(m.DesktopFeature.accountManagement.id)}},methods:{onStatusClick(){this.showStatusPopup=true;this.$emit("disableAutoHide")},onStatusPopupClose(){this.showStatusPopup=false;this.$emit("enableAutoHide")},loc(t){return this.$Bitrix.Loc.getMessage(t)},onScroll(){var t;(t=C.MenuManager.getMenuById(x.PopupType.desktopItemMenu))==null?void 0:t.close()}},template:`\n\t\t<div class="bx-im-user-settings-popup__scope bx-im-user-settings-popup__container">\n\t\t\t<div class="bx-im-user-settings-popup__header">\n\t\t\t\t<div class="bx-im-user-settings-popup__header_left">\n\t\t\t\t\t<ChatAvatar \n\t\t\t\t\t\t:avatarDialogId="currentUserDialogId" \n\t\t\t\t\t\t:contextDialogId="currentUserDialogId" \n\t\t\t\t\t\t:size="AvatarSize.XL" \n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div class="bx-im-user-settings-popup__header_right">\n\t\t\t\t\t<div class="bx-im-user-settings-popup__domain">{{ currentHost }}</div>\n\t\t\t\t\t<div class="bx-im-user-settings-popup__user_name" :title="currentUser.name">{{ currentUser.name }}</div>\n\t\t\t\t\t<div class="bx-im-user-settings-popup__user_title" :title="currentUserPosition">{{ currentUserPosition }}</div>\n\t\t\t\t\t<ButtonPanel @openProfile="$emit('closePopup')" />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<ScrollWithGradient :containerMaxHeight="328" :gradientHeight="24" @scroll="onScroll">\n\t\t\t\t<div class="bx-im-user-settings-popup__list">\n\t\t\t\t\t<div class="bx-im-user-settings-popup__separator"></div>\n\t\t\t\t\t\x3c!-- Status select --\x3e\n\t\t\t\t\t<div @click="onStatusClick" class="bx-im-user-settings-popup__list-item --with-icon">\n\t\t\t\t\t\t<div class="bx-im-user-settings-popup__list-item_left">\n\t\t\t\t\t\t\t<div class="bx-im-user-settings-popup__list-item_status">\n\t\t\t\t\t\t\t\t<UserStatus :status="userStatus" :size="UserStatusSize.M" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="bx-im-user-settings-popup__list-item_text">{{ userStatusText }}</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="bx-im-user-settings-popup__list-item_icon --chevron" ref="status-select"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="bx-im-user-settings-popup__separator"></div>\n\t\t\t\t<DesktopAccountList \n\t\t\t\t\tv-if="isDesktopAccountManagementAvailable"\n\t\t\t\t\t@openContextMenu="$emit('disableAutoHide')"\n\t\t\t\t/>\n\t\t\t</ScrollWithGradient>\n\t\t</div>\n\t\t<UserStatusPopup\n\t\t\tv-if="showStatusPopup"\n\t\t\t:bindElement="$refs['status-select'] || {}"\n\t\t\t@close="onStatusPopupClose"\n\t\t/>\n\t`};const j="im-user-settings-popup";const K={name:"UserSettingsPopup",components:{MessengerPopup:P.MessengerPopup,UserSettingsContent:V},props:{bindElement:{type:Object,required:true}},emits:["close"],computed:{POPUP_ID:()=>j,config(){return{width:313,bindElement:this.bindElement,offsetTop:4,padding:0}}},template:`\n\t\t<MessengerPopup\n\t\t\tv-slot="{enableAutoHide, disableAutoHide}"\n\t\t\t:config="config"\n\t\t\t@close="$emit('close')"\n\t\t\t:id="POPUP_ID"\n\t\t>\n\t\t\t<UserSettingsContent \n\t\t\t\t@closePopup="$emit('close')" \n\t\t\t\t@enableAutoHide="enableAutoHide" \n\t\t\t\t@disableAutoHide="disableAutoHide" \n\t\t\t/>\n\t\t</MessengerPopup>\n\t`};const W={name:"UserSettings",components:{UserSettingsPopup:K,UserStatusPopup:E,ChatAvatar:r.ChatAvatar},data(){return{showSettingsPopup:false,showStatusPopup:false}},computed:{AvatarSize:()=>r.AvatarSize,currentUserDialogId(){return M.Core.getUserId().toString()},userStatus(){const t=this.$store.getters["application/settings/get"](x.Settings.user.status);if(t){return t}return x.UserStatus.online}},methods:{onAvatarClick(){this.showSettingsPopup=true},onStatusClick(){this.showStatusPopup=true}},template:`\n\t\t<div class="bx-im-navigation__user">\n\t\t\t<div @click="onAvatarClick" class="bx-im-navigation__user_avatar" ref="avatar">\n\t\t\t\t<ChatAvatar \n\t\t\t\t\t:avatarDialogId="currentUserDialogId"\n\t\t\t\t\t:contextDialogId="currentUserDialogId" \n\t\t\t\t\t:size="AvatarSize.M" \n\t\t\t\t/>\n\t\t\t\t<div @click.stop="onStatusClick" :class="'--' + userStatus" class="bx-im-navigation__user_status" ref="status"></div>\n\t\t\t</div>\n\t\t\t<UserStatusPopup\n\t\t\t\tv-if="showStatusPopup"\n\t\t\t\t:bindElement="$refs['status'] || {}"\n\t\t\t\t@close="showStatusPopup = false"\n\t\t\t/>\n\t\t\t<UserSettingsPopup\n\t\t\t\tv-if="showSettingsPopup"\n\t\t\t\t:bindElement="$refs['avatar'] || {}"\n\t\t\t\t@close="showSettingsPopup = false" \n\t\t\t/>\n\t\t</div>\n\t`};const q={name:"MarketApps",emits:["clickMarketItem"],computed:{marketMenuItems(){const t=S.MarketManager.getInstance().getAvailablePlacementsByType(x.PlacementType.navigation);return t.map((t=>({id:t.id,text:t.title,counter:0,active:true,iconName:t.options.iconName||"",loadConfiguration:t.loadConfiguration})))},layout(){return this.$store.getters["application/getLayout"]},canShowMarket(){return M.Core.isCloud()}},methods:{onMarketClick(){this.$emit("clickMarketItem",{id:x.Layout.market.name})},onMarketItemClick(t){this.$emit("clickMarketItem",{id:x.Layout.market.name,entityId:t.id})},getMenuItemClasses(t){return{"--selected":this.isItemSelected(t.id),"--active":t.active}},isItemSelected(t){return this.layout.name===x.Layout.market.name&&this.layout.entityId===t},getIconClassNames(t){return t.iconName.toString()},loc(t){return this.$Bitrix.Loc.getMessage(t)}},template:`\n\t\t<div\n\t\t\tv-if="canShowMarket"\n\t\t\t@click="onMarketClick"\n\t\t\tclass="bx-im-navigation__item_container"\n\t\t>\n\t\t\t<div class="bx-im-navigation__item --active">\n\t\t\t\t<div class="bx-im-navigation__item_icon --market"></div>\n\t\t\t\t<div class="bx-im-navigation__item_text" :title="loc('IM_NAVIGATION_MARKET_TITLE')">\n\t\t\t\t\t{{ loc('IM_NAVIGATION_MARKET_TITLE') }}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div\n\t\t\tv-for="item in marketMenuItems"\n\t\t\t:key="item.id"\n\t\t\t@click="onMarketItemClick(item)"\n\t\t\tclass="bx-im-navigation__item_container"\n\t\t>\n\t\t\t<div :class="getMenuItemClasses(item)" class="bx-im-navigation__item">\n\t\t\t\t<div class="bx-im-navigation__market-item_icon-container">\n\t\t\t\t\t<i \n\t\t\t\t\t\tclass="bx-im-navigation__market-item_icon fa" \n\t\t\t\t\t\t:class="getIconClassNames(item)" \n\t\t\t\t\t\taria-hidden="true"\n\t\t\t\t\t></i>\n\t\t\t\t</div>\n\t\t\t\t<div class="bx-im-navigation__item_text" :title="item.text">{{item.text}}</div>\n\t\t\t</div>\n\t\t</div>\n\t`};const J="im-copilot-promo-hint-popup";const Q="copilot_assistant";const Y={name:"CopilotPromoHint",components:{MessengerPopup:P.MessengerPopup,Spinner:A.Spinner},props:{bindElement:{type:Object,required:true}},emits:["close"],data(){return{isCreatingChat:false}},computed:{SpinnerSize:()=>A.SpinnerSize,SpinnerColor:()=>A.SpinnerColor,POPUP_ID:()=>J,config(){return{darkMode:true,bindElement:this.bindElement,angle:true,width:346,closeIcon:true,className:"bx-im-copilot-promo-hint__scope",contentBorderRadius:0,offsetTop:9}}},methods:{loc(t){return this.$Bitrix.Loc.getMessage(t)},async close(){await T.PromoManager.getInstance().markAsWatched(x.PromoId.copilotInRecentTab);this.$emit("close")},async createCopilot(){this.isCreatingChat=true;const t=await this.getCopilotService().createChat({roleCode:Q}).catch((()=>{this.isCreatingChat=false}));this.isCreatingChat=false;await this.close();void b.Messenger.openChat(t)},getCopilotService(){if(!this.copilotService){this.copilotService=new k.CopilotService}return this.copilotService}},template:`\n\t\t<MessengerPopup\n\t\t\t:config="config"\n\t\t\t:id="POPUP_ID"\n\t\t\t@close="close"\n\t\t>\n\t\t\t<div class="bx-im-copilot-promo-hint__title">\n\t\t\t\t{{ loc('IM_CONTENT_COPILOT_PROMO_HINT_TITLE') }}\n\t\t\t</div>\n\t\t\t<div class="bx-im-copilot-promo-hint__description">\n\t\t\t\t{{ loc('IM_CONTENT_COPILOT_PROMO_HINT_DESCRIPTION') }}\n\t\t\t</div>\n\t\t\t<button\n\t\t\t\tclass="bx-im-copilot-promo-hint__action"\n\t\t\t\t@click="createCopilot"\n\t\t\t>\n\t\t\t\t<Spinner\n\t\t\t\t\tv-if="isCreatingChat"\n\t\t\t\t\t:size="SpinnerSize.XS"\n\t\t\t\t\t:color="SpinnerColor.copilot"\n\t\t\t\t/>\n\t\t\t\t<span v-else>\n\t\t\t\t\t{{ loc('IM_CONTENT_COPILOT_PROMO_HINT_ACTION') }}\n\t\t\t\t</span>\n\t\t\t</button>\n\t\t</MessengerPopup>\n\t`};const Z=Object.freeze({[x.Layout.market.name]:x.ActionByUserType.getMarket,[x.Layout.openlines.name]:x.ActionByUserType.getOpenlines,[x.Layout.channel.name]:x.ActionByUserType.getChannels});const tt={name:"MessengerNavigation",components:{UserSettings:W,MarketApps:q,CopilotPromoHint:Y},props:{currentLayoutName:{type:String,required:true}},emits:["navigationClick"],data(){return{needTopShadow:false,needBottomShadow:false,showCopilotPromoHint:false}},computed:{NavigationMenuItem:()=>x.NavigationMenuItem,menuItems(){return[{id:x.NavigationMenuItem.chat,text:this.prepareNavigationText("IM_NAVIGATION_CHATS"),counter:this.formatCounter(this.$store.getters["counters/getTotalChatCounter"])},{id:x.NavigationMenuItem.copilot,text:this.prepareNavigationText("IM_NAVIGATION_COPILOT"),counter:this.formatCounter(this.$store.getters["counters/getTotalCopilotCounter"]),showCondition:()=>s.FeatureManager.isFeatureAvailable(s.Feature.copilotAvailable)},{id:x.NavigationMenuItem.collab,text:this.prepareNavigationText("IM_NAVIGATION_COLLAB"),counter:this.formatCounter(this.$store.getters["counters/getTotalCollabCounter"]),showCondition:()=>s.FeatureManager.isFeatureAvailable(s.Feature.collabAvailable)},{id:x.NavigationMenuItem.channel,text:this.prepareNavigationText("IM_NAVIGATION_CHANNELS")},{id:x.NavigationMenuItem.openlines,text:this.prepareNavigationText("IM_NAVIGATION_OPENLINES"),counter:this.formatCounter(this.$store.getters["counters/getTotalLinesCounter"]),showCondition:()=>!this.isOptionOpenLinesV2Activated()},{id:x.NavigationMenuItem.openlinesV2,text:this.prepareNavigationText("IM_NAVIGATION_OPENLINES"),counter:this.formatCounter(this.$store.getters["counters/getTotalLinesCounter"]),showCondition:this.isOptionOpenLinesV2Activated},{id:x.NavigationMenuItem.notification,text:this.prepareNavigationText("IM_NAVIGATION_NOTIFICATIONS"),counter:this.formatCounter(this.$store.getters["notifications/getCounter"]),showCondition:()=>!s.FeatureManager.isFeatureAvailable(s.Feature.isNotificationsStandalone)},{id:x.NavigationMenuItem.call,text:this.prepareNavigationText("IM_NAVIGATION_CALLS_V2"),showCondition:i.PhoneManager.getInstance().canCall.bind(i.PhoneManager.getInstance())},{id:x.NavigationMenuItem.timemanager,text:this.prepareNavigationText("IM_NAVIGATION_TIMEMANAGER"),showCondition:this.isTimeManagerActive},{id:x.NavigationMenuItem.homepage,text:this.prepareNavigationText("IM_NAVIGATION_MAIN_PAGE"),showCondition:this.isMainPageActive},{id:x.NavigationMenuItem.market},{id:x.NavigationMenuItem.settings,text:this.prepareNavigationText("IM_NAVIGATION_SETTINGS")}]},showCloseIcon(){return!m.DesktopApi.isChatTab()},isCopilotChatsInRecentTabEnabled(){return s.FeatureManager.isFeatureAvailable(s.Feature.showCopilotChatsInRecentTab)}},created(){e.Logger.warn("Navigation created")},mounted(){const t=this.$refs.navigation;this.needBottomShadow=t&&t.scrollTop+t.clientHeight!==t.scrollHeight;this.showCopilotPromoHint=this.isCopilotChatsInRecentTabEnabled&&T.PromoManager.getInstance().needToShow(x.PromoId.copilotInRecentTab)},methods:{onItemClick(t,e){this.$emit("navigationClick",{id:t.id,target:e.target})},onMarketItemClick(t){this.$emit("navigationClick",t)},closeSlider(){n.MessengerSlider.getInstance().getCurrent().close()},getMenuItemClasses(t){return{"--selected":t.id===this.currentLayoutName,"--with-counter":t.counter&&t.id!==this.currentLayoutName}},formatCounter(t){if(t===0){return""}return t>99?"99+":String(t)},prepareNavigationText(t){return this.loc(t,{"#BR#":"</br>"})},needToShowMenuItem(t){if(!this.hasLayoutAccess(t)){return false}if(!p.Type.isFunction(t.showCondition)){return true}return t.showCondition()===true},hasLayoutAccess(t){const e=Z[t.id];return o.PermissionManager.getInstance().canPerformActionByUserType(e)},onScroll(t){const e=Math.round(t.target.scrollTop+t.target.clientHeight);this.needBottomShadow=e!==t.target.scrollHeight;if(t.target.scrollTop===0){this.needTopShadow=false;return}this.needTopShadow=true},onClickScrollDown(){this.$refs.navigation.scrollTo({top:this.$refs.navigation.scrollHeight,behavior:"smooth"})},onClickScrollUp(){this.$refs.navigation.scrollTo({top:0,behavior:"smooth"})},isTimeManagerActive(){var t,e;return Boolean((t=BX.Timeman)==null?void 0:(e=t.Monitor)==null?void 0:e.isEnabled())},isOptionOpenLinesV2Activated(){return s.FeatureManager.isFeatureAvailable(s.Feature.openLinesV2)},isMainPageActive(){return m.DesktopApi.isChatWindow()},closeHint(){this.showCopilotPromoHint=false},loc(t,e={}){return this.$Bitrix.Loc.getMessage(t,e)}},template:`\n\t\t<div class="bx-im-navigation__scope bx-im-navigation__container">\n\t\t\t<div v-if="needTopShadow" class="bx-im-navigation__shadow --top">\n\t\t\t\t<div class="bx-im-navigation__scroll-button" @click="onClickScrollUp"></div>\n\t\t\t</div>\n\t\t\t<div class="bx-im-navigation__top" @scroll="onScroll" ref="navigation">\n\t\t\t\t<template v-if="showCloseIcon">\n\t\t\t\t\t\x3c!-- Close --\x3e\n\t\t\t\t\t<div class="bx-im-navigation__close_container" @click="closeSlider">\n\t\t\t\t\t\t<div class="bx-im-navigation__close"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t\x3c!-- Separator --\x3e\n\t\t\t\t\t<div class="bx-im-navigation__separator_container">\n\t\t\t\t\t\t<div class="bx-im-navigation__close_separator"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</template>\n\t\t\t\t\x3c!-- Menu items --\x3e\n\t\t\t\t<template v-for="item in menuItems">\n\t\t\t\t\t<MarketApps\n\t\t\t\t\t\tv-if="needToShowMenuItem(item) && item.id === NavigationMenuItem.market"\n\t\t\t\t\t\t@clickMarketItem="onMarketItemClick"\n\t\t\t\t\t/>\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-else-if="needToShowMenuItem(item)"\n\t\t\t\t\t\t:key="item.id"\n\t\t\t\t\t\t:ref="item.id"\n\t\t\t\t\t\t@click="onItemClick(item, $event)"\n\t\t\t\t\t\tclass="bx-im-navigation__item_container"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div :class="getMenuItemClasses(item)" class="bx-im-navigation__item">\n\t\t\t\t\t\t\t<div :class="'--' + item.id" class="bx-im-navigation__item_icon"></div>\n\t\t\t\t\t\t\t<div class="bx-im-navigation__item_text" :title="item.text" v-html="item.text"></div>\n\t\t\t\t\t\t\t<div v-if="item.counter" class="bx-im-navigation__item_counter">\n\t\t\t\t\t\t\t\t<div class="bx-im-navigation__item_counter-text">\n\t\t\t\t\t\t\t\t\t{{ item.counter }}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</template>\n\t\t\t\t<CopilotPromoHint\n\t\t\t\t\tv-if="showCopilotPromoHint"\n\t\t\t\t\t:bindElement="$refs.chat[0]"\n\t\t\t\t\t@close="closeHint"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div v-if="needBottomShadow" class="bx-im-navigation__shadow --bottom">\n\t\t\t\t<div class="bx-im-navigation__scroll-button --bottom" @click="onClickScrollDown"></div>\n\t\t\t</div>\n\t\t\t\x3c!-- Avatar --\x3e\n\t\t\t<div class="bx-im-navigation__user_container">\n\t\t\t\t<UserSettings />\n\t\t\t</div>\n\t\t</div>\n\t`};t.MessengerNavigation=tt})(this.BX.Messenger.v2.Component=this.BX.Messenger.v2.Component||{},BX.Messenger.v2.Lib,BX.Messenger.v2.Lib,BX.Messenger.v2.Lib,BX.Messenger.v2.Lib,BX.Messenger.v2.Lib,BX.Messenger.v2.Component.Elements,BX.Messenger.v2.Component.Elements,BX.Messenger.v2.Component.Elements,BX.Messenger.v2.Lib,BX.Messenger.v2.Service,BX,BX.Messenger.v2.Lib,BX.Messenger.v2.Lib,BX.Messenger.v2.Lib,BX.Messenger.v2.Lib,BX.UI,BX.UI.Feedback,BX,BX.Messenger.v2.Application,BX.Messenger.v2.Lib,BX.Main,BX.Messenger.v2.Lib,BX.Messenger.v2.Const,BX.Messenger.v2.Lib,BX.Messenger.v2.Service,BX.Messenger.v2.Component.Elements,BX.Messenger.v2.Component.Elements); //# sourceMappingURL=navigation.bundle.map.js