'use strict';

Liferay.Loader.define("frontend-taglib-clay$clay-checkbox@2.24.1/lib/ClayCheckbox", ['module', 'exports', 'require', './ClayCheckboxLabel.soy', 'frontend-taglib-clay$clay-component', 'frontend-js-metal-web$metal-web-component', 'frontend-js-metal-web$metal-soy', 'frontend-js-metal-web$metal-state', './ClayCheckbox.soy'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.ClayCheckbox = 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;
      };
    }();

    require("./ClayCheckboxLabel.soy");

    var _clayComponent = require("frontend-taglib-clay$clay-component");

    var _clayComponent2 = _interopRequireDefault(_clayComponent);

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

    var _metalWebComponent2 = _interopRequireDefault(_metalWebComponent);

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

    var _metalSoy2 = _interopRequireDefault(_metalSoy);

    var _metalState = require("frontend-js-metal-web$metal-state");

    var _ClayCheckboxSoy = require("./ClayCheckbox.soy");

    var _ClayCheckboxSoy2 = _interopRequireDefault(_ClayCheckboxSoy);

    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;
    }

    /**
     * Implementation of the Metal Clay Checkbox.
     * @extends ClayComponent
     */
    var ClayCheckbox = function (_ClayComponent) {
      _inherits(ClayCheckbox, _ClayComponent);

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

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

      _createClass(ClayCheckbox, [{
        key: 'syncIndeterminate',

        /**
         * @inheritDoc
         */
        value: function syncIndeterminate() {
          this.refs.input.indeterminate = this.indeterminate;
        }
      }]);

      return ClayCheckbox;
    }(_clayComponent2.default);

    /**
     * State definition.
     * @type {!Object}
     * @static
     */

    ClayCheckbox.STATE = {
      /**
       * Aria labelled by attribute to apply to the input.
       * @default undefined
       * @instance
       * @memberof ClayCheckbox
       * @type {?(string|undefined)}
       */
      ariaLabelledBy: _metalState.Config.string(),

      /**
       * Flag to indicate if checkbox is checked.
       * @default false
       * @instance
       * @memberof ClayCheckbox
       * @type {?bool}
       */
      checked: _metalState.Config.bool().value(false),

      /**
       * Data to add to the element.
       * @default undefined
       * @instance
       * @memberof ClayCheckbox
       * @type {?object}
       */
      data: _metalState.Config.object(),

      /**
       * Object that wires events with default listeners
       * @default undefined
       * @instance
       * @memberof ClayCheckbox
       * @review
       * @type {?(object|undefined)}
       */
      defaultEventHandler: _metalState.Config.object(),

      /**
       * Flag to indicate if checkbox is disabled.
       * @default false
       * @instance
       * @memberof ClayCheckbox
       * @type {?bool}
       */
      disabled: _metalState.Config.bool().value(false),

      /**
       * CSS classes to be applied to the element.
       * @default undefined
       * @instance
       * @memberof ClayCheckbox
       * @type {?(string|undefined)}
       */
      elementClasses: _metalState.Config.string(),

      /**
       * Id to be applied to the element.
       * @default undefined
       * @instance
       * @memberof ClayCheckbox
       * @type {?(string|undefined)}
       */
      id: _metalState.Config.string(),

      /**
       * Flag to indicate if checkbox's checked state is indeterminate.
       * @default false
       * @instance
       * @memberof ClayCheckbox
       * @type {?bool}
       */
      indeterminate: _metalState.Config.bool().value(false),

      /**
       * Flag to indicate if input should be wrapped to be inline or not.
       * @default false
       * @instance
       * @memberof ClayCheckbox
       * @type {?bool}
       */
      inline: _metalState.Config.bool().value(false),

      /**
       * Label of the input. Required for accessibility.
       * @default undefined
       * @instance
       * @memberof ClayCheckbox
       * @type {?(string|undefined)}
       */
      label: _metalState.Config.string(),

      /**
       * Custom content of the checkbox label. Use it to use your custom html.
       * @default undefined
       * @instance
       * @memberof ClayCheckbox
       * @type {?(html|undefined)}
       */
      labelContent: _metalState.Config.any(),

      /**
       * Name to be applied to the element.
       * @default undefined
       * @instance
       * @memberof ClayCheckbox
       * @type {?(string|undefined)}
       */
      name: _metalState.Config.string(),

      /**
       * Flag to indicate if label should be hide.
       * @default true
       * @instance
       * @memberof ClayCheckbox
       * @type {?bool}
       */
      showLabel: _metalState.Config.bool().value(true),

      /**
       * Value to be applied to the element.
       * @default undefined
       * @instance
       * @memberof ClayCheckbox
       * @type {?(string|undefined)}
       */
      value: _metalState.Config.string()
    };

    (0, _metalWebComponent2.default)('clay-checkbox', ClayCheckbox);

    _metalSoy2.default.register(ClayCheckbox, _ClayCheckboxSoy2.default);

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