Liferay.Loader.define("commerce-product-options-web@3.0.22/CPOptionsEditor.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.CPOptionsEditor = 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 CPOptionsEditor.soy.
      // Please don't edit this file by hand.

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

      goog.module('CPOptionsEditor.incrementaldom');

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

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

      goog.require('soy.asserts');

      goog.require('soy.idom');

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

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

      var $templateAlias3 = _metalSoy.default.getTemplate('CPOptionValuesEditor.incrementaldom', 'render');
      /**
       * @param {{
       *  hasEditPermission: (boolean|null|undefined),
       *  id: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  namespace: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  optionURL: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  optionValuesURL: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  optionValueURL: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  pathThemeImages: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  successMessage: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  _currentOption: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  _handleAddOption: (*|null|undefined),
       *  _handleCancelEditing: (*|null|undefined),
       *  _handleCloseValueEditor: (*|null|undefined),
       *  _handleEditValues: (*|null|undefined),
       *  _handleoptionDeleted: (*|null|undefined),
       *  _handleOptionSaved: (*|null|undefined),
       *  _handleOptionSelected: (*|null|undefined),
       *  _handleNameChange: (*|null|undefined),
       *  _newOptionName: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  _options: (?),
       *  _showValues: (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;
        opt_data = opt_data || {};
        /** @type {boolean|null|undefined} */

        var hasEditPermission = soy.asserts.assertType(opt_data.hasEditPermission == null || goog.isBoolean(opt_data.hasEditPermission) || opt_data.hasEditPermission === 1 || opt_data.hasEditPermission === 0, 'hasEditPermission', opt_data.hasEditPermission, 'boolean|null|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 namespace = soy.asserts.assertType(opt_data.namespace == null || goog.isString(opt_data.namespace) || opt_data.namespace instanceof goog.soy.data.SanitizedContent, 'namespace', opt_data.namespace, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */

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

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

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

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

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

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

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

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

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

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

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

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

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

        var _handleNameChange = opt_data._handleNameChange;
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */

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

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

        var _showValues = soy.asserts.assertType(opt_data._showValues == null || goog.isBoolean(opt_data._showValues) || opt_data._showValues === 1 || opt_data._showValues === 0, '_showValues', opt_data._showValues, 'boolean|null|undefined');

        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'commerce-product-option-editor');
        incrementalDom.attr('id', id);
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'row');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'col-md-6');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'card');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'card-body');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'form-container');
        incrementalDom.elementOpenEnd();
        $templateAlias1({
          currentCPOptionId: _currentOption,
          hasEditPermission: hasEditPermission,
          newOptionName: _newOptionName,
          options: _options,
          pathThemeImages: pathThemeImages,
          events: {
            addOption: _handleAddOption,
            editValues: _handleEditValues,
            optionSelected: _handleOptionSelected
          }
        }, null, opt_ijData);
        incrementalDom.elementClose('div');
        incrementalDom.elementClose('div');
        incrementalDom.elementClose('div');
        incrementalDom.elementClose('div');
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'col-md-6');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'card');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'card-body');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'form-container');
        incrementalDom.elementOpenEnd();

        if (_currentOption) {
          $templateAlias2({
            cpOptionId: _currentOption,
            hasEditPermission: hasEditPermission,
            namespace: namespace,
            optionURL: optionURL,
            pathThemeImages: pathThemeImages,
            events: {
              cancel: _handleCancelEditing,
              optionDeleted: _handleoptionDeleted,
              optionSaved: _handleOptionSaved,
              nameChange: _handleNameChange
            }
          }, null, opt_ijData);
        }

        incrementalDom.elementClose('div');
        incrementalDom.elementClose('div');
        incrementalDom.elementClose('div');
        incrementalDom.elementClose('div');

        if (_currentOption) {
          $templateAlias3({
            show: _showValues,
            cpOptionId: _currentOption,
            optionValuesURL: optionValuesURL,
            optionValueURL: optionValueURL,
            namespace: namespace,
            pathThemeImages: pathThemeImages,
            successMessage: successMessage,
            events: {
              close: _handleCloseValueEditor
            }
          }, null, opt_ijData);
        }

        incrementalDom.elementClose('div');
        incrementalDom.elementClose('div');
      }

      exports.render = $render;
      /**
       * @typedef {{
       *  hasEditPermission: (boolean|null|undefined),
       *  id: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  namespace: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  optionURL: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  optionValuesURL: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  optionValueURL: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  pathThemeImages: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  successMessage: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  _currentOption: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  _handleAddOption: (*|null|undefined),
       *  _handleCancelEditing: (*|null|undefined),
       *  _handleCloseValueEditor: (*|null|undefined),
       *  _handleEditValues: (*|null|undefined),
       *  _handleoptionDeleted: (*|null|undefined),
       *  _handleOptionSaved: (*|null|undefined),
       *  _handleOptionSelected: (*|null|undefined),
       *  _handleNameChange: (*|null|undefined),
       *  _newOptionName: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  _options: (?),
       *  _showValues: (boolean|null|undefined)
       * }}
       */

      $render.Params;

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

      exports.render.params = ["hasEditPermission", "id", "namespace", "optionURL", "optionValuesURL", "optionValueURL", "pathThemeImages", "successMessage", "_currentOption", "_handleAddOption", "_handleCancelEditing", "_handleCloseValueEditor", "_handleEditValues", "_handleoptionDeleted", "_handleOptionSaved", "_handleOptionSelected", "_handleNameChange", "_newOptionName", "_options", "_showValues"];
      exports.render.types = {
        "hasEditPermission": "bool",
        "id": "string",
        "namespace": "string",
        "optionURL": "string",
        "optionValuesURL": "string",
        "optionValueURL": "string",
        "pathThemeImages": "string",
        "successMessage": "string",
        "_currentOption": "string",
        "_handleAddOption": "any ",
        "_handleCancelEditing": "any ",
        "_handleCloseValueEditor": "any ",
        "_handleEditValues": "any ",
        "_handleoptionDeleted": "any ",
        "_handleOptionSaved": "any ",
        "_handleOptionSelected": "any ",
        "_handleNameChange": "any ",
        "_newOptionName": "string",
        "_options": "?",
        "_showValues": "bool"
      };
      exports.templates = templates = exports;
      return exports;
    });

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

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

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

      return CPOptionsEditor;
    }(_metalComponent.default);

    exports.CPOptionsEditor = CPOptionsEditor;

    _metalSoy.default.register(CPOptionsEditor, templates);

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

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