Liferay.Loader.define("dynamic-data-mapping-form-field-type@5.0.83/FieldBase/FieldBase.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.default = exports.templates = exports.FieldBase = void 0;

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

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

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

    function _typeof(obj) {
      "@babel/helpers - typeof";
      if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
        _typeof = function _typeof(obj) {
          return typeof obj;
        };
      } else {
        _typeof = function _typeof(obj) {
          return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
        };
      }return _typeof(obj);
    }

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

    function _possibleConstructorReturn(self, call) {
      if (call && (_typeof(call) === "object" || typeof call === "function")) {
        return call;
      }return _assertThisInitialized(self);
    }

    function _assertThisInitialized(self) {
      if (self === void 0) {
        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      }return self;
    }

    function _getPrototypeOf(o) {
      _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
        return o.__proto__ || Object.getPrototypeOf(o);
      };return _getPrototypeOf(o);
    }

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

    function _setPrototypeOf(o, p) {
      _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
        o.__proto__ = p;return o;
      };return _setPrototypeOf(o, p);
    }

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

      goog.require('soydata');

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

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

      goog.module('FieldBase.incrementaldom');

      goog.require('goog.soy.data.SanitizedContent');

      var incrementalDom = goog.require('incrementaldom');

      goog.require('soy.asserts');

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

      var $templateAlias1 = _metalSoy.default.getTemplate('ClayButton.incrementaldom', 'render');

      var $templateAlias2 = _metalSoy.default.getTemplate('ClayIcon.incrementaldom', 'render');

      var $templateAlias3 = _metalSoy.default.getTemplate('Tooltip.incrementaldom', 'render');
      /**
       * @param {{
       *  name: (!goog.soy.data.SanitizedContent|string),
       *  _handleAddRepeatedFieldButtonClicked: (*|null|undefined),
       *  _handleRemoveRepeatedFieldButtonClicked: (*|null|undefined),
       *  _localizedValue: (!Array<{languageId: (!goog.soy.data.SanitizedContent|string), name: (!goog.soy.data.SanitizedContent|string), value: (?)}>|null|undefined),
       *  contentRenderer: (*|null|undefined),
       *  displayErrors: (boolean|null|undefined),
       *  errorMessage: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  id: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  tip: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  label: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  readOnly: (boolean|null|undefined),
       *  required: (boolean|null|undefined),
       *  repeatable: (boolean|null|undefined),
       *  showLabel: (boolean|null|undefined),
       *  showRepeatableRemoveButton: (boolean|null|undefined),
       *  spritemap: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  tooltip: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  valid: (boolean|null|undefined),
       *  visible: (boolean|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 {!goog.soy.data.SanitizedContent|string} */

        var name = soy.asserts.assertType(goog.isString(opt_data.name) || opt_data.name instanceof goog.soy.data.SanitizedContent, 'name', opt_data.name, '!goog.soy.data.SanitizedContent|string');
        /** @type {*|null|undefined} */

        var _handleAddRepeatedFieldButtonClicked = opt_data._handleAddRepeatedFieldButtonClicked;
        /** @type {*|null|undefined} */

        var _handleRemoveRepeatedFieldButtonClicked = opt_data._handleRemoveRepeatedFieldButtonClicked;
        /** @type {!Array<{languageId: (!goog.soy.data.SanitizedContent|string), name: (!goog.soy.data.SanitizedContent|string), value: (?)}>|null|undefined} */

        var _localizedValue = soy.asserts.assertType(opt_data._localizedValue == null || goog.isArray(opt_data._localizedValue), '_localizedValue', opt_data._localizedValue, '!Array<{languageId: (!goog.soy.data.SanitizedContent|string), name: (!goog.soy.data.SanitizedContent|string), value: (?)}>|null|undefined');
        /** @type {*|null|undefined} */

        var contentRenderer = opt_data.contentRenderer;
        /** @type {boolean|null|undefined} */

        var displayErrors = soy.asserts.assertType(opt_data.displayErrors == null || goog.isBoolean(opt_data.displayErrors) || opt_data.displayErrors === 1 || opt_data.displayErrors === 0, 'displayErrors', opt_data.displayErrors, 'boolean|null|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */

        var errorMessage = soy.asserts.assertType(opt_data.errorMessage == null || goog.isString(opt_data.errorMessage) || opt_data.errorMessage instanceof goog.soy.data.SanitizedContent, 'errorMessage', opt_data.errorMessage, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */

        var id = soy.asserts.assertType(opt_data.id == null || goog.isString(opt_data.id) || opt_data.id instanceof goog.soy.data.SanitizedContent, 'id', opt_data.id, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */

        var tip = soy.asserts.assertType(opt_data.tip == null || goog.isString(opt_data.tip) || opt_data.tip instanceof goog.soy.data.SanitizedContent, 'tip', opt_data.tip, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */

        var label = soy.asserts.assertType(opt_data.label == null || goog.isString(opt_data.label) || opt_data.label instanceof goog.soy.data.SanitizedContent, 'label', opt_data.label, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {boolean|null|undefined} */

        var readOnly = soy.asserts.assertType(opt_data.readOnly == null || goog.isBoolean(opt_data.readOnly) || opt_data.readOnly === 1 || opt_data.readOnly === 0, 'readOnly', opt_data.readOnly, 'boolean|null|undefined');
        /** @type {boolean|null|undefined} */

        var required = soy.asserts.assertType(opt_data.required == null || goog.isBoolean(opt_data.required) || opt_data.required === 1 || opt_data.required === 0, 'required', opt_data.required, 'boolean|null|undefined');
        /** @type {boolean|null|undefined} */

        var repeatable = soy.asserts.assertType(opt_data.repeatable == null || goog.isBoolean(opt_data.repeatable) || opt_data.repeatable === 1 || opt_data.repeatable === 0, 'repeatable', opt_data.repeatable, 'boolean|null|undefined');
        /** @type {boolean|null|undefined} */

        var showLabel = soy.asserts.assertType(opt_data.showLabel == null || goog.isBoolean(opt_data.showLabel) || opt_data.showLabel === 1 || opt_data.showLabel === 0, 'showLabel', opt_data.showLabel, 'boolean|null|undefined');
        /** @type {boolean|null|undefined} */

        var showRepeatableRemoveButton = soy.asserts.assertType(opt_data.showRepeatableRemoveButton == null || goog.isBoolean(opt_data.showRepeatableRemoveButton) || opt_data.showRepeatableRemoveButton === 1 || opt_data.showRepeatableRemoveButton === 0, 'showRepeatableRemoveButton', opt_data.showRepeatableRemoveButton, 'boolean|null|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */

        var spritemap = soy.asserts.assertType(opt_data.spritemap == null || goog.isString(opt_data.spritemap) || opt_data.spritemap instanceof goog.soy.data.SanitizedContent, 'spritemap', opt_data.spritemap, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */

        var tooltip = soy.asserts.assertType(opt_data.tooltip == null || goog.isString(opt_data.tooltip) || opt_data.tooltip instanceof goog.soy.data.SanitizedContent, 'tooltip', opt_data.tooltip, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {boolean|null|undefined} */

        var valid = soy.asserts.assertType(opt_data.valid == null || goog.isBoolean(opt_data.valid) || opt_data.valid === 1 || opt_data.valid === 0, 'valid', opt_data.valid, 'boolean|null|undefined');
        /** @type {boolean|null|undefined} */

        var visible = soy.asserts.assertType(opt_data.visible == null || goog.isBoolean(opt_data.visible) || opt_data.visible === 1 || opt_data.visible === 0, 'visible', opt_data.visible, 'boolean|null|undefined');
        var fieldCssClassAttribute__soy23 = '';
        fieldCssClassAttribute__soy23 += 'form-group';
        fieldCssClassAttribute__soy23 += displayErrors && errorMessage && valid == false ? ' has-error' : '';
        fieldCssClassAttribute__soy23 += visible == false ? ' hide' : '';
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', fieldCssClassAttribute__soy23);
        incrementalDom.attr('data-field-name', name);
        incrementalDom.elementOpenEnd();

        if (repeatable) {
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'lfr-ddm-form-field-repeatable-toolbar');
          incrementalDom.elementOpenEnd();

          if (showRepeatableRemoveButton) {
            $templateAlias1({
              disabled: readOnly,
              elementClasses: 'ddm-form-field-repeatable-delete-button p-0',
              events: {
                click: _handleRemoveRepeatedFieldButtonClicked
              },
              icon: 'trash',
              size: 'sm',
              spritemap: spritemap,
              type: 'button'
            }, null, opt_ijData);
          }

          $templateAlias1({
            disabled: readOnly,
            elementClasses: 'ddm-form-field-repeatable-add-button p-0',
            events: {
              click: _handleAddRepeatedFieldButtonClicked
            },
            icon: 'plus',
            size: 'sm',
            spritemap: spritemap,
            type: 'button'
          }, null, opt_ijData);
          incrementalDom.elementClose('div');
        }

        var attributes__soy64 = function attributes__soy64() {
          if (id) {
            incrementalDom.attr('for', id);
          }

          if (!showLabel && !required) {
            incrementalDom.attr('class', 'ddm-empty');
          } else {
            incrementalDom.attr('class', 'ddm-label');
          }
        };

        incrementalDom.elementOpen('fieldset');

        if (label && showLabel || required || tooltip || repeatable) {
          incrementalDom.elementOpen('legend');
          incrementalDom.elementOpenStart('p');
          attributes__soy64();
          incrementalDom.elementOpenEnd();

          if (label && showLabel) {
            soyIdom.print(label);
            incrementalDom.text(' ');
          }

          if (required && spritemap) {
            incrementalDom.elementOpenStart('span');
            incrementalDom.attr('class', 'reference-mark');
            incrementalDom.elementOpenEnd();
            $templateAlias2({
              spritemap: spritemap,
              symbol: 'asterisk'
            }, null, opt_ijData);
            incrementalDom.elementClose('span');
          }

          if (tooltip) {
            $templateAlias3({
              icon: 'question-circle-full',
              spritemap: spritemap,
              text: tooltip
            }, null, opt_ijData);
          }

          incrementalDom.elementClose('p');
          incrementalDom.elementClose('legend');
        }

        soyIdom.print(contentRenderer);
        incrementalDom.elementClose('fieldset');

        if (_localizedValue && _localizedValue.length > 0) {
          var language122List = _localizedValue;
          var language122ListLen = language122List.length;

          for (var language122Index = 0; language122Index < language122ListLen; language122Index++) {
            var language122Data = language122List[language122Index];

            if (language122Data.value != '') {
              incrementalDom.elementOpenStart('input');
              incrementalDom.attr('type', 'hidden');
              incrementalDom.attr('name', language122Data.name);
              incrementalDom.attr('value', language122Data.value);
              incrementalDom.elementOpenEnd();
              incrementalDom.elementClose('input');
            }
          }
        }

        if (tip) {
          incrementalDom.elementOpenStart('span');
          incrementalDom.attr('class', 'form-text');
          incrementalDom.elementOpenEnd();
          soyIdom.print(tip);
          incrementalDom.elementClose('span');
        }

        if (displayErrors && errorMessage && valid == false) {
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'form-feedback-group');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'form-feedback-item');
          incrementalDom.elementOpenEnd();
          soyIdom.print(errorMessage);
          incrementalDom.elementClose('div');
          incrementalDom.elementClose('div');
        }

        incrementalDom.elementClose('div');
      }

      exports.render = $render;
      /**
       * @typedef {{
       *  name: (!goog.soy.data.SanitizedContent|string),
       *  _handleAddRepeatedFieldButtonClicked: (*|null|undefined),
       *  _handleRemoveRepeatedFieldButtonClicked: (*|null|undefined),
       *  _localizedValue: (!Array<{languageId: (!goog.soy.data.SanitizedContent|string), name: (!goog.soy.data.SanitizedContent|string), value: (?)}>|null|undefined),
       *  contentRenderer: (*|null|undefined),
       *  displayErrors: (boolean|null|undefined),
       *  errorMessage: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  id: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  tip: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  label: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  readOnly: (boolean|null|undefined),
       *  required: (boolean|null|undefined),
       *  repeatable: (boolean|null|undefined),
       *  showLabel: (boolean|null|undefined),
       *  showRepeatableRemoveButton: (boolean|null|undefined),
       *  spritemap: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  tooltip: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  valid: (boolean|null|undefined),
       *  visible: (boolean|null|undefined)
       * }}
       */

      $render.Params;

      if (goog.DEBUG) {
        $render.soyTemplateName = 'FieldBase.render';
      }

      exports.render.params = ["name", "_handleAddRepeatedFieldButtonClicked", "_handleRemoveRepeatedFieldButtonClicked", "_localizedValue", "contentRenderer", "displayErrors", "errorMessage", "id", "tip", "label", "readOnly", "required", "repeatable", "showLabel", "showRepeatableRemoveButton", "spritemap", "tooltip", "valid", "visible"];
      exports.render.types = {
        "name": "string",
        "_handleAddRepeatedFieldButtonClicked": "any",
        "_handleRemoveRepeatedFieldButtonClicked": "any",
        "_localizedValue": "list<[\n\t\tlanguageId: string,\n\t\tname: string,\n\t\tvalue: ?\n\t]>",
        "contentRenderer": "any",
        "displayErrors": "bool",
        "errorMessage": "string",
        "id": "string",
        "tip": "string",
        "label": "string",
        "readOnly": "bool",
        "required": "bool",
        "repeatable": "bool",
        "showLabel": "bool",
        "showRepeatableRemoveButton": "bool",
        "spritemap": "string",
        "tooltip": "string",
        "valid": "bool",
        "visible": "bool"
      };
      exports.templates = templates = exports;
      return exports;
    });

    var FieldBase = /*#__PURE__*/function (_Component) {
      _inherits(FieldBase, _Component);

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

        return _possibleConstructorReturn(this, _getPrototypeOf(FieldBase).apply(this, arguments));
      }

      return FieldBase;
    }(_metalComponent.default);

    exports.FieldBase = FieldBase;

    _metalSoy.default.register(FieldBase, templates);

    var _default = templates;
    /* jshint ignore:end */

    exports.default = _default;
    //# sourceMappingURL=FieldBase.soy.js.map
  }
});
//# sourceMappingURL=FieldBase.soy.js.map