FR.components.infoPanel=Ext.extend(Ext.Panel,{cls:"fr-info-panel",title:"&nbsp;",layout:"fit",collapsible:true,collapseAction:"customCollapse",collapseToolIconCls:"fa-arrow-to-right",target:false,initComponent:function(){var c=FR.components;this.tabs={detailsPanel:new c.detailsPanel(Ext.apply({infoPanel:this,hidden:true},this.initialConfig.detailsPanelOptions)),activityPanel:new c.activityPanel({infoPanel:this,hidden:true,style:"padding:0px;"}),commentsPanel:new c.commentsPanel({infoPanel:this,hidden:true})};Ext.apply(this,{headerStyle:"min-height:"+FR.UI.layout.northBarsHeight+"px",listeners:{beforestatesave:function(p,v){if(v&&Object.keys(v).length===0&&v.constructor===Object){return false}}},items:{xtype:"tabpanel",ref:"tabPanel",cls:"fr-info-tabpanel",items:Object.values(this.tabs)}});c.infoPanel.superclass.initComponent.apply(this,arguments)},customCollapse:function(){FR.UI.collapseInfo()},refresh:function(gridItem){if(this.collapsed&&!this.isSlid){return false}if(gridItem){this.target=FR.Context.getTarget("grid",[gridItem])}else{this.target=FR.UI.gridPanel.target}if(!this.target){return false}this.countSel=this.target.items.length;this.fileInfo=Ext.apply({},this.target.getFileInfo());this.updateTabs();this.updateTitle();Ext.iterate(this.tabs,function(tabName,tab){tab.onInfoPanelRefresh()})},updateTabs:function(){var showTabDetails=false;var showTabComments=false;var showTabActivity=false;if(this.target){showTabDetails=true;if(this.countSel<2){if(this.countSel==1||this.countSel==0&&!FR.UI.gridPanel.view.searchMode){if(this.target.checkRequirement("isFileOrFolder")){if(User.perms.file_history&&!(FR.currentSection=="sharedFolder"&&!Settings.filelog_for_shares)){showTabActivity=true}if(this.target.perms.read_comments||this.target.perms.comment){showTabComments=true}}}}}var tp=this.tabPanel;tp.setTabVisible(0,showTabDetails);tp.setTabVisible(1,showTabActivity);tp.setTabVisible(2,showTabComments);if(!this.tabPanel.activeTab){this.tabPanel.setActiveTab(0)}},updateTitle:function(){var title;if(this.countSel>1){title=FR.T("%1 items").replace("%1",this.target.items.length)}else{title=this.fileInfo.filename}if(this.countSel!=1){if(this.countSel==0&&FR.UI.gridPanel.view.searchMode){title=FR.T("Search")+": "+title}title='<span style="color:var(--theme-textLighter)">'+title+"</span>"}this.setTitle(title)},folderChange:function(){this.tabs.detailsPanel.moreDetailsCache.clear();if(this.tabPanel.getActiveTab()==this.tabs.activityPanel){this.tabs.activityPanel.onInfoPanelRefresh()}},applyFileUpdates:function(path,updates){if(this.fileInfo&&this.fileInfo.path==path){if(updates.hasOwnProperty("label")){var labelButton=this.tabs.detailsPanel.labelButton;if(labelButton){labelButton.applyLabel(FR.utils.parseRawLabel(updates.label));return false}}this.refresh()}}});