text: /*!
   * OpenUI5
   * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
   * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
   */
  sap.ui.define(["./library","sap/ui/core/Core","sap/ui/core/Control","./IconTabBarRenderer","./IconTabHeader","sap/ui/core/util/ResponsivePaddingsEnablement","sap/ui/thirdparty/jquery"],function(e,t,n,o,r,a,i){"use strict";var s=e.IconTabHeaderMode;var p=e.BackgroundDesign;var d=e.IconTabDensityMode;var l=e.TabsOverflowMode;var u=n.extend("sap.m.IconTabBar",{metadata:{interfaces:["sap.m.ObjectHeaderContainer","sap.f.IDynamicPageStickyContent"],library:"sap.m",properties:{showSelection:{type:"boolean",group:"Misc",defaultValue:true,deprecated:true},expandable:{type:"boolean",group:"Misc",defaultValue:true},expanded:{type:"boolean",group:"Misc",defaultValue:true},selectedKey:{type:"string",group:"Data",defaultValue:null},upperCase:{type:"boolean",group:"Appearance",defaultValue:false},stretchContentHeight:{type:"boolean",group:"Appearance",defaultValue:false},applyContentPadding:{type:"boolean",group:"Appearance",defaultValue:true},backgroundDesign:{type:"sap.m.BackgroundDesign",group:"Appearance",defaultValue:p.Solid},headerMode:{type:"sap.m.IconTabHeaderMode",group:"Appearance",defaultValue:s.Standard},showOverflowSelectList:{type:"boolean",group:"Appearance",defaultValue:false,deprecated:true},headerBackgroundDesign:{type:"sap.m.BackgroundDesign",group:"Appearance",defaultValue:p.Solid},enableTabReordering:{type:"boolean",group:"Behavior",defaultValue:false},maxNestingLevel:{type:"int",group:"Behavior",defaultValue:0},tabDensityMode:{type:"sap.m.IconTabDensityMode",group:"Appearance",defaultValue:d.Cozy},ariaTexts:{type:"object",group:"Accessibility",defaultValue:null},tabsOverflowMode:{type:"sap.m.TabsOverflowMode",group:"Behavior",defaultValue:l.End}},aggregations:{items:{type:"sap.m.IconTab",multiple:true,singularName:"item",forwarding:{getter:"_getIconTabHeader",aggregation:"items",forwardBinding:true}},content:{type:"sap.ui.core.Control",multiple:true,singularName:"content"},_header:{type:"sap.m.IconTabHeader",multiple:false,visibility:"hidden"}},events:{select:{parameters:{item:{type:"sap.m.IconTabFilter"},key:{type:"string"},previousKey:{type:"string"},selectedItem:{type:"sap.m.IconTabFilter"},selectedKey:{type:"string"}}},expand:{parameters:{expand:{type:"boolean"},collapse:{type:"boolean"}}}},designtime:"sap/m/designtime/IconTabBar.designtime"}});a.call(u.prototype,{header:{selector:".sapMITH"},content:{suffix:"content"}});u._CLASSES_TO_COPY=["sapUiResponsiveContentPadding","sapUiNoContentPadding","sapUiContentPadding"];u.prototype.init=function(){this._initResponsivePaddingsEnablement()};u.prototype.setExpanded=function(e){this.setProperty("expanded",e,true);if(this.$().length){this._toggleExpandCollapse(e)}return this};u.prototype.setHeaderMode=function(e){this.setProperty("headerMode",e,true);this._getIconTabHeader().setMode(e);return this};u.prototype.setTabDensityMode=function(e){this.setProperty("tabDensityMode",e);this._getIconTabHeader().setTabDensityMode(e);return this};u.prototype.setHeaderBackgroundDesign=function(e){this.setProperty("headerBackgroundDesign",e,true);this._getIconTabHeader().setBackgroundDesign(e);return this};u.prototype.setEnableTabReordering=function(e){this.setProperty("enableTabReordering",e,true);this._getIconTabHeader().setEnableTabReordering(e);return this};u.prototype.setAriaTexts=function(e){this.setProperty("ariaTexts",e,true);this._getIconTabHeader().setAriaTexts(e);return this};u.prototype.addStyleClass=function(e,t){var o=this._getIconTabHeader();if(u._CLASSES_TO_COPY.indexOf(e)!==-1){o.addStyleClass(e,true)}return n.prototype.addStyleClass.apply(this,arguments)};u.prototype.removeStyleClass=function(e,t){var o=this._getIconTabHeader();if(u._CLASSES_TO_COPY.indexOf(e)!==-1){o.removeStyleClass(e,true)}return n.prototype.removeStyleClass.apply(this,arguments)};u.prototype._rerenderContent=function(e){var n=this.$("content");if(e&&n.length>0){var o=t.createRenderManager();for(var r=0;r<e.length;r++){o.renderControl(e[r])}o.flush(n[0]);o.destroy()}};u.prototype._toggleExpandCollapse=function(e){var t=this.$("content");var n=this._getIconTabHeader().oSelectedItem;if(e===undefined){e=!this.getExpanded()}if(n){n.$().toggleClass("sapMITBSelected",e);n.$().attr({"aria-expanded":e});if(e){n.$().attr({"aria-selected":e})}else{n.$().removeAttr("aria-selected")}}this._iAnimationCounter=this._iAnimationCounter===undefined?1:++this._iAnimationCounter;if(e){if(n){if(this.$("content").children().length===0){var o=n.getContent();if(o.length>0){this._rerenderContent(o)}else{this._rerenderContent(this.getContent())}}t.stop(true,true).slideDown("400",i.proxy(this.onTransitionEnded,this,e));this.$("containerContent").toggleClass("sapMITBContentClosed",!e)}}else{this.$("contentArrow").hide();t.stop(true,true).slideUp("400",i.proxy(this.onTransitionEnded,this,e))}if(!e||n){this.setProperty("expanded",e,true)}this.fireExpand({expand:e,collapse:!e});return this};u.prototype.onTransitionEnded=function(e){var t=this.$("content"),n=this.$("containerContent"),o=this.$("contentArrow");if(this._iAnimationCounter===1){n.toggleClass("sapMITBContentClosed",!e);if(e){o.show();t.css("display","block")}else{o.hide();t.css("display","none")}}this._iAnimationCounter=this._iAnimationCounter>0?--this._iAnimationCounter:0;return this};u.prototype._getIconTabHeader=function(){var e=this.getAggregation("_header");if(!e){e=new r(this.getId()+"--header",{});this.setAggregation("_header",e,true)}return e};u.prototype._getStickyContent=function(){return this._getIconTabHeader()};u.prototype._returnStickyContent=function(){if(this.bIsDestroyed){return}this._getStickyContent().$().prependTo(this.$())};u.prototype._setStickySubheaderSticked=function(e){this._bStickyContentSticked=e};u.prototype._getStickySubheaderSticked=function(){return this._bStickyContentSticked};u.prototype.onBeforeRendering=function(){var e=this._getIconTabHeader(),t=e.$();e.setMaxNestingLevel(this.getMaxNestingLevel());e.setTabsOverflowMode(this.getTabsOverflowMode());if(this._bStickyContentSticked&&t){delete this._bStickyContentSticked;this._getIconTabHeader().$().remove()}};u.prototype.setShowSelection=function(e){this._getIconTabHeader().setShowSelection(e);return this};u.prototype.getShowSelection=function(){return this._getIconTabHeader().getShowSelection()};u.prototype.setSelectedKey=function(e){this._getIconTabHeader().setSelectedKey(e);return this};u.prototype.getSelectedKey=function(){return this._getIconTabHeader().getSelectedKey()};u.prototype.setSelectedItem=function(e,t){return this._getIconTabHeader().setSelectedItem(e,t)};return u});