'use strict';

Liferay.Loader.define('frontend-taglib-clay$clay-data-provider@2.24.1/lib/ClayDataProvider.soy', ['module', 'exports', 'require', 'frontend-js-metal-web$metal-component', 'frontend-js-metal-web$metal-soy'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.templates = exports.ClayDataProvider = undefined;

    var _metalComponent = require('frontend-js-metal-web$metal-component');

    var _metalComponent2 = _interopRequireDefault(_metalComponent);

    var _metalSoy = require('frontend-js-metal-web$metal-soy');

    var _metalSoy2 = _interopRequireDefault(_metalSoy);

    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;
    } /* jshint ignore:start */

    var templates;
    goog.loadModule(function (exports) {
      var soy = goog.require('soy');

      goog.require('soydata');

      // This file was automatically generated from ClayDataProvider.soy.
      // Please don't edit this file by hand.

      /**
       * @fileoverview Templates in namespace ClayDataProvider.
       * @public
       */

      goog.module('ClayDataProvider.incrementaldom');

      var incrementalDom = goog.require('incrementaldom');
      goog.require('soy.asserts');
      var soyIdom = goog.require('soy.idom');

      /**
       * @param {{
       *  content: *,
       *  errorContent: (*|null|undefined),
       *  isError: (boolean|null|undefined),
       *  isLoading: (boolean|null|undefined),
       *  loadingContent: (*|null|undefined)
       * }} opt_data
       * @param {Object<string, *>=} opt_ijData
       * @param {Object<string, *>=} opt_ijData_deprecated
       * @return {void}
       * @suppress {checkTypes}
       */
      function $render(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        /** @type {*} */
        var content = opt_data.content;
        /** @type {*|null|undefined} */
        var errorContent = opt_data.errorContent;
        /** @type {boolean|null|undefined} */
        var isError = soy.asserts.assertType(opt_data.isError == null || goog.isBoolean(opt_data.isError) || opt_data.isError === 1 || opt_data.isError === 0, 'isError', opt_data.isError, 'boolean|null|undefined');
        /** @type {boolean|null|undefined} */
        var isLoading = soy.asserts.assertType(opt_data.isLoading == null || goog.isBoolean(opt_data.isLoading) || opt_data.isLoading === 1 || opt_data.isLoading === 0, 'isLoading', opt_data.isLoading, 'boolean|null|undefined');
        /** @type {*|null|undefined} */
        var loadingContent = opt_data.loadingContent;
        incrementalDom.elementOpen('div');
        if (isLoading && loadingContent) {
          soyIdom.print(loadingContent);
        } else if (isError && errorContent) {
          soyIdom.print(errorContent);
        } else {
          soyIdom.print(content);
        }
        incrementalDom.elementClose('div');
      }
      exports.render = $render;
      /**
       * @typedef {{
       *  content: *,
       *  errorContent: (*|null|undefined),
       *  isError: (boolean|null|undefined),
       *  isLoading: (boolean|null|undefined),
       *  loadingContent: (*|null|undefined)
       * }}
       */
      $render.Params;
      if (goog.DEBUG) {
        $render.soyTemplateName = 'ClayDataProvider.render';
      }

      exports.render.params = ["content", "errorContent", "isError", "isLoading", "loadingContent"];
      exports.render.types = { "content": "any", "errorContent": "any", "isError": "bool", "isLoading": "bool", "loadingContent": "any" };
      exports.templates = templates = exports;
      return exports;
    });

    var ClayDataProvider = function (_Component) {
      _inherits(ClayDataProvider, _Component);

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

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

      return ClayDataProvider;
    }(_metalComponent2.default);

    _metalSoy2.default.register(ClayDataProvider, templates);
    exports.ClayDataProvider = ClayDataProvider;
    exports.templates = templates;
    exports.default = templates;
    /* jshint ignore:end */
    //# sourceMappingURL=ClayDataProvider.soy.js.map
  }
});
//# sourceMappingURL=ClayDataProvider.soy.js.map