text: /*!
   * OpenUI5
   * (c) Copyright 2009-2019 SAP SE or an SAP affiliate company.
   * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
   */
  sap.ui.define(["sap/ui/core/Control","sap/ui/model/json/JSONModel","sap/m/List","sap/m/StandardListItem","sap/ui/base/ManagedObject","sap/f/cards/Data","sap/base/Log"],function(t,e,i,a,n,o,r){"use strict";var s=t.extend("sap.f.cards.ListContent",{metadata:{properties:{configuration:{type:"object"}},aggregations:{_content:{multiple:false,visibility:"hidden"}}},constructor:function(e,i){if(typeof e!=="string"){i=e}if(i&&i.serviceManager){this._oServiceManager=i.serviceManager;delete i.serviceManager}t.apply(this,arguments)},renderer:function(t,e){t.write("<div");t.writeElementData(e);t.write(">");t.renderControl(e.getAggregation("_content"));t.write("</div>")}});s.prototype._getList=function(){if(this._bIsBeingDestroyed){return null}var t=this.getAggregation("_content");if(!t){t=new i({id:this.getId()+"-list",growing:false,showNoData:false,showSeparators:"None"});this.setAggregation("_content",t)}return t};s.prototype.init=function(){var t=this._getList();var i=this;t.attachUpdateFinished(function(){if(i._iVisibleItems){var e=t.getItems();for(var a=i._iVisibleItems+1;a<e.length;a++){e[a].setVisible(false)}}});var n=new e;this.setModel(n);this._oItemTemplate=new a({iconDensityAware:false})};s.prototype.exit=function(){if(this._oItemTemplate){this._oItemTemplate.destroy();this._oItemTemplate=null}};s.prototype.destroy=function(){this.setAggregation("_content",null);this.setModel(null);return t.prototype.destroy.apply(this,arguments)};s.prototype.setConfiguration=function(t){this.setProperty("configuration",t);if(!t){return this}if(t.data){this._setData(t.data)}if(t.item){this._setItem(t.item)}return this};s.prototype._setItem=function(t){t.title&&this._bindItemProperty("title",t.title.value);t.description&&this._bindItemProperty("description",t.description.value);t.icon&&t.icon.src&&this._bindItemProperty("icon",t.icon.src);t.highlight&&this._bindItemProperty("highlight",t.highlight);t.info&&this._bindItemProperty("info",t.info.value);t.info&&this._bindItemProperty("infoState",t.info.state);t.interactionType&&this._bindItemProperty("type",t.interactionType);this._attachActions(t);var e=this._getList();if(e.isBound("items")){e.bindItems({path:e.getBindingInfo("items").path,template:this._oItemTemplate})}};s.prototype._bindItemProperty=function(t,e){if(!e){return}var i=n.bindingParser(e);if(i){this._oItemTemplate.bindProperty(t,i)}else{this._oItemTemplate.setProperty(t,e)}};s.prototype._attachActions=function(t){if(!t.actions){return}var e=t.actions[0];if(e.type==="Navigation"&&e.enabled){this._attachNavigationAction(e)}};s.prototype._attachNavigationAction=function(t){if(t.service){this._oItemTemplate.attachPress(function(e){this.getParent()._oServiceManager.getService("sap.ui.integration.services.Navigation").then(function(i){if(i){i.navigate({parameters:e.getParameters(),manifestParameters:t.parameters})}}).catch(function(){r.error("Navigation service unavailable")})}.bind(this))}else if(t.url){this._oItemTemplate.attachPress(function(){window.open(t.url,t.target||"_blank")})}};s.prototype._setData=function(t){var e=t.request;var i=t.service;if(t.json&&!e){this._updateModel(t.json,t.path)}if(i){this._oServiceManager.getService("sap.ui.integration.services.Data").then(function(e){if(e){e.getData().then(function(e){this._updateModel(e,t.path)}.bind(this)).catch(function(){r.error("Card content data service failed to get data")});e.attachDataChanged(function(e){this._updateModel(e.data,t.path)}.bind(this),t.service.parameters)}}.bind(this)).catch(function(){r.error("Data service unavailable")})}else if(e){o.fetch(e).then(function(e){this._updateModel(e,t.path)}.bind(this)).catch(function(t){r.error("Card content data request failed")})}};s.prototype._updateModel=function(t,e){this.getModel().setData(t);this._getList().bindItems({path:e||"/",template:this._oItemTemplate});this.fireEvent("_updated")};return s});