'use strict';

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

/**
 * Licensed Materials - Property of IBM
 * IBM Cognos Products: Dashboard
 * IBM Business Analytics (C) Copyright IBM Corp. 2019
 * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
 */

/**
 * @class InternalRecommenderAPI
 * @hideconstructor
 *
 */
define(['../../../lib/@waca/dashboard-common/dist/core/APIFactory', './api/InternalRecommenderAPI', '../../../visualizations/recommender/VisRecommenderUtils'], function (APIFactory, InternalRecommenderAPI, VisRecommenderUtils) {
	var InternalRecommender = function () {
		function InternalRecommender(options) {
			_classCallCheck(this, InternalRecommender);

			this._api = APIFactory.createAPI(this, [InternalRecommenderAPI]);
			this.features = options.features;
		}

		InternalRecommender.prototype.getAPI = function getAPI() {
			return this._api;
		};

		InternalRecommender.prototype.getChartTypeList = function getChartTypeList() {
			var chartTypes = [];
			//TODO: add dependency on VisDefinitions
			try {
				var visDefinitions = this.features['VisDefinitions'].getList();
				chartTypes = VisRecommenderUtils.buildChartTypes(visDefinitions);
			} catch (err) {
				this.features['Logger'].error(err);
			}
			return chartTypes;
		};

		return InternalRecommender;
	}();

	return InternalRecommender;
});
//# sourceMappingURL=InternalRecommender.js.map