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(["sap/m/ToolbarSpacer","sap/m/library","./SemanticContainer"],function(t,n,e){"use strict";var o=n.ButtonType;var i=e.extend("sap.f.semantic.SemanticFooter",{constructor:function(t,n){e.call(this,t,n);this._aCustomContent=[];this._aSemanticLeftContent=[];this._aSemanticRightContent=[];this._iSemanticLeftContentCount=1;this._fnParentSubstitute=function(){return this._oParent}.bind(this);this._insertSpacer()}});i.mPlacementMethodMap={footerLeft:"LeftContent",footerRight:"RightContent"};i.prototype.addCustomAction=function(t){t.setType(o.Transparent);this._callContainerAggregationMethod("addContent",t);this._aCustomContent.push(t);return this};i.prototype.insertCustomAction=function(t,n){var e=this._getCustomContentInsertIndex(n);t.setType(o.Transparent);this._callContainerAggregationMethod("insertContent",t,e);this._aCustomContent.splice(n,0,t);return this};i.prototype.getCustomActions=function(){return this._aCustomContent};i.prototype.indexOfCustomAction=function(t){return this._aCustomContent.indexOf(t)};i.prototype.removeCustomAction=function(t){var n=this._callContainerAggregationMethod("removeContent",t);this._aCustomContent.splice(this._aCustomContent.indexOf(t),1);return n};i.prototype.removeAllCustomActions=function(){var t=[];this._aCustomContent.forEach(function(n){var e=this._callContainerAggregationMethod("removeContent",n);if(e){t.push(n)}},this);this._aCustomContent=[];return t};i.prototype.destroyCustomActions=function(){this.removeAllCustomActions(true).forEach(function(t){t.destroy()});return this};i.prototype.addContent=function(t,n){this["_insertSemantic"+i.mPlacementMethodMap[n]].call(this,t);return this};i.prototype.removeContent=function(t,n){this["_removeSemantic"+i.mPlacementMethodMap[n]].call(this,t);return this};i.prototype.destroy=function(){this._aCustomContent=null;this._aSemanticLeftContent=null;this._aSemanticRightContent=null;this._oSpacer=null;return e.prototype.destroy.call(this)};i.prototype._insertSemanticLeftContent=function(t){var n=this._getControl(t),e=this._getControlOrder(t),o=this._getSemanticLeftContentInsertIndex(e);this._callContainerAggregationMethod("insertContent",n,o);this._iSemanticLeftContentCount++;this._aSemanticLeftContent.push(t);return this};i.prototype._insertSemanticRightContent=function(t){var n=this._getControl(t);this._aSemanticRightContent.push(t);this._callContainerAggregationMethod("insertContent",n,this._getSemanticRightContentInsertIndex(t));if(this._shouldBePreprocessed(t)){this._preProcessControl(n)}return this};i.prototype._removeSemanticLeftContent=function(t){var n=this._getControl(t);this._callContainerAggregationMethod("removeContent",n);this._iSemanticLeftContentCount--;this._aSemanticLeftContent.splice(this._aSemanticLeftContent.indexOf(n),1);return t};i.prototype._removeSemanticRightContent=function(t){var n=this._getControl(t);this._callContainerAggregationMethod("removeContent",n);this._aSemanticRightContent.splice(this._aSemanticRightContent.indexOf(t),1);this._postProcessControl(n);return t};i.prototype._getSemanticLeftContentInsertIndex=function(t){return this._iSemanticLeftContentCount>1?t:0};i.prototype._getSemanticRightContentInsertIndex=function(t){this._aSemanticRightContent.sort(this._sortControlByOrder.bind(this));return this._iSemanticLeftContentCount+this._aSemanticRightContent.indexOf(t)};i.prototype._getCustomContentInsertIndex=function(t){return t+this._iSemanticLeftContentCount+this._aSemanticRightContent.length};i.prototype._insertSpacer=function(){this._callContainerAggregationMethod("addContent",this._getSpacer());return this};i.prototype._getSpacer=function(){if(!this._oSpacer){this._oSpacer=new t}return this._oSpacer};i.prototype._preProcessControl=function(t){if(!(typeof t._fnOriginalGetParent==="function")){t._fnOriginalGetParent=t.getParent;t.getParent=this._fnParentSubstitute}};i.prototype._postProcessControl=function(t){if(t._fnOriginalGetParent){t.getParent=t._fnOriginalGetParent;delete t._fnOriginalGetParent}};return i});