'use strict';

Liferay.Loader.define("frontend-taglib-chart$clay-charts@2.24.1/lib/jsx/Chart", ['module', 'exports', 'require', '../ChartBase', 'frontend-js-metal-web$metal-jsx'], function (module, exports, require) {
	var define = undefined;
	var global = window;
	{
		Object.defineProperty(exports, "__esModule", {
			value: true
		});
		exports.ChartJSX = undefined;

		var _createClass = function () {
			function defineProperties(target, props) {
				for (var i = 0; i < props.length; i++) {
					var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
				}
			}return function (Constructor, protoProps, staticProps) {
				if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
			};
		}();

		var _ChartBase = require('../ChartBase');

		var _ChartBase2 = _interopRequireDefault(_ChartBase);

		var _metalJsx = require("frontend-js-metal-web$metal-jsx");

		function _interopRequireDefault(obj) {
			return obj && obj.__esModule ? obj : { default: obj };
		}

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

		function _possibleConstructorReturn(self, call) {
			if (!self) {
				throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
			}return call && (typeof call === "object" || typeof call === "function") ? call : self;
		}

		function _inherits(subClass, superClass) {
			if (typeof superClass !== "function" && superClass !== null) {
				throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
			}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
		}

		/**
   * Metal Chart component for use with JSX.
   * @extends JSXComponent
   * @extends ChartBase
   */
		var ChartJSX = function (_JSXComponent) {
			_inherits(ChartJSX, _JSXComponent);

			function ChartJSX() {
				_classCallCheck(this, ChartJSX);

				return _possibleConstructorReturn(this, (ChartJSX.__proto__ || Object.getPrototypeOf(ChartJSX)).apply(this, arguments));
			}

			_createClass(ChartJSX, [{
				key: 'render',

				/**
     * @inheritDoc
     */
				value: function render() {
					var id = this.props.id;
					var loading = this.props._loading;

					IncrementalDOM.elementOpenStart('div');
					iDOMHelpers.forOwn(id && { id: id }, iDOMHelpers.attr);
					IncrementalDOM.attr('class', 'metal-chart-container');
					IncrementalDOM.elementOpenEnd('div');
					IncrementalDOM.elementOpenStart('div');
					iDOMHelpers.forOwn(loading && { hidden: 'hidden' }, iDOMHelpers.attr);
					IncrementalDOM.attr('class', 'metal-chart');
					IncrementalDOM.attr('ref', 'chart');
					IncrementalDOM.elementOpenEnd('div');
					IncrementalDOM.elementClose('div');
					IncrementalDOM.elementOpenStart('div');
					iDOMHelpers.forOwn(!loading && { hidden: 'hidden' }, iDOMHelpers.attr);
					IncrementalDOM.attr('aria-hidden', 'true');
					IncrementalDOM.attr('class', 'loading-icon');
					IncrementalDOM.attr('ref', 'placeholder');
					IncrementalDOM.elementOpenEnd('div');
					IncrementalDOM.elementVoid('span', null, null, 'class', 'loading-animation');
					IncrementalDOM.elementClose('div');
					return IncrementalDOM.elementClose('div');
				}

				/**
     * @inheritDoc
     */

			}, {
				key: 'shouldUpdate',
				value: function shouldUpdate() {
					return false;
				}
			}]);

			return ChartJSX;
		}(_metalJsx.JSXComponent);

		Object.assign(ChartJSX.prototype, _ChartBase2.default);

		/**
   * @inheritDoc
   */
		ChartJSX.PROPS = _ChartBase2.default.STATE;

		/**
   * @inheritDoc
   */
		ChartJSX.prototype._getStateObj = function () {
			return this.props;
		};

		exports.ChartJSX = ChartJSX;
		exports.default = ChartJSX;
		//# sourceMappingURL=Chart.js.map
	}
});
//# sourceMappingURL=Chart.js.map