Liferay.Loader.define("commerce-frontend-taglib@10.1.16/product_card/ProductCard.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.ProductCard = 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 ProductCard.soy.
      // Please don't edit this file by hand.

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

      goog.module('ProductCard.incrementaldom');

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

      goog.require('goog.string');

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

      goog.require('soy.asserts');

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

      var $templateAlias4 = _metalSoy.default.getTemplate('AddToCartButton.incrementaldom', 'render');

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

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

      var $templateAlias3 = _metalSoy.default.getTemplate('Price.incrementaldom', 'render');
      /**
       * @param {{
       *  id: (!goog.soy.data.SanitizedContent|string),
       *  accountId: (!goog.soy.data.SanitizedContent|null|number|string|undefined),
       *  addedToWishlist: (boolean|null|undefined),
       *  addToCartButtonVisible: (boolean|null|undefined),
       *  addToWishlistButtonVisible: (boolean|null|undefined),
       *  productId: (!goog.soy.data.SanitizedContent|null|number|string|undefined),
       *  orderId: (!goog.soy.data.SanitizedContent|null|number|string|undefined),
       *  orderQuantity: number,
       *  availability: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  sku: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  skuId: (!goog.soy.data.SanitizedContent|null|number|string|undefined),
       *  pictureUrl: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  name: (!goog.soy.data.SanitizedContent|string),
       *  cartAPI: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  detailsLink: (!goog.soy.data.SanitizedContent|string),
       *  categories: (!Array<{name: (!goog.soy.data.SanitizedContent|string)}>|null|undefined),
       *  description: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  compareState: (null|undefined|{checkboxVisible: boolean, compareAvailable: boolean, inCompare: boolean}),
       *  deleteButtonVisible: (boolean|null|undefined),
       *  settings: (?),
       *  spritemap: (!goog.soy.data.SanitizedContent|string),
       *  prices: (?),
       *  _handleRemoveProduct: (*|null|undefined),
       *  _handleCheckboxCompareUpdate: (*|null|undefined),
       *  _handleWishListButtonClick: (*|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 id = soy.asserts.assertType(goog.isString(opt_data.id) || opt_data.id instanceof goog.soy.data.SanitizedContent, 'id', opt_data.id, '!goog.soy.data.SanitizedContent|string');
        /** @type {!goog.soy.data.SanitizedContent|null|number|string|undefined} */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        var compareState = soy.asserts.assertType(opt_data.compareState == null || goog.isObject(opt_data.compareState), 'compareState', opt_data.compareState, 'null|undefined|{checkboxVisible: boolean, compareAvailable: boolean, inCompare: boolean}');
        /** @type {boolean|null|undefined} */

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

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

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

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

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

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

        var _handleWishListButtonClick = opt_data._handleWishListButtonClick;
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'minium-card product-card');
        incrementalDom.attr('data-href', detailsLink);
        incrementalDom.attr('data-onkeypress', '_handleCardKeypress');
        incrementalDom.attr('id', id);
        incrementalDom.attr('tabindex', '0');
        incrementalDom.elementOpenEnd();
        var availabilityDotClasses__soy2823 = '';
        var $tmp = availability;

        switch (goog.isObject($tmp) ? $tmp.toString() : $tmp) {
          case 'inStock':
            availabilityDotClasses__soy2823 += 'good';
            break;

          case 'available':
            availabilityDotClasses__soy2823 += 'neutral';
            break;

          default:
            availabilityDotClasses__soy2823 += 'bad';
        }

        if (deleteButtonVisible && spritemap != null) {
          incrementalDom.elementOpenStart('span');
          incrementalDom.attr('class', 'minium-card__delete');
          incrementalDom.attr('data-onclick', _handleRemoveProduct);
          incrementalDom.elementOpenEnd();
          $templateAlias1({
            spritemap: spritemap,
            symbol: 'times'
          }, null, opt_ijData);
          incrementalDom.elementClose('span');
        } else {
          if (compareState != null && productId != null && pictureUrl != null) {
            incrementalDom.elementOpenStart('div');
            incrementalDom.attr('class', 'minium-card__compare');
            incrementalDom.elementOpenEnd();
            $templateAlias2({
              events: {
                checkboxCompareUpdated: _handleCheckboxCompareUpdate
              },
              productId: productId,
              checkboxVisible: compareState.checkboxVisible,
              compareAvailable: compareState.compareAvailable,
              inCompare: compareState.inCompare,
              labelVisible: false,
              pictureUrl: pictureUrl
            }, null, opt_ijData);
            incrementalDom.elementClose('div');
          }
        }

        if (addToWishlistButtonVisible) {
          var addToWishlistClasses__soy2862 = '';
          addToWishlistClasses__soy2862 += 'minium-card__add-to-wishlist-button';
          addToWishlistClasses__soy2862 += addedToWishlist ? ' minium-card__add-to-wishlist-button--added' : '';
          incrementalDom.elementOpenStart('button');
          incrementalDom.attr('data-onclick', _handleWishListButtonClick);
          incrementalDom.attr('class', addToWishlistClasses__soy2862);
          incrementalDom.elementOpenEnd();
          $templateAlias1({
            spritemap: spritemap,
            symbol: 'heart'
          }, null, opt_ijData);
          $templateAlias1({
            spritemap: spritemap,
            symbol: 'heart-full'
          }, null, opt_ijData);
          incrementalDom.elementClose('button');
        }

        if (pictureUrl != null) {
          incrementalDom.elementOpenStart('a');
          incrementalDom.attr('class', 'minium-card__picture');
          incrementalDom.attr('href', detailsLink);
          incrementalDom.attr('style', 'background-image: url(' + pictureUrl + ')');
          incrementalDom.attr('tabindex', '-1');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementClose('a');
        } else {
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'minium-card__picture');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementClose('div');
        }

        if (availability != null) {
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'minium-card__availability');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'commerce-dot commerce-dot--big commerce-dot--' + availabilityDotClasses__soy2823);
          incrementalDom.elementOpenEnd();
          incrementalDom.elementClose('div');
          incrementalDom.elementClose('div');
        }

        if (sku != null) {
          incrementalDom.elementOpenStart('p');
          incrementalDom.attr('class', 'minium-card__sku');
          incrementalDom.elementOpenEnd();
          soyIdom.print(sku);
          incrementalDom.elementClose('p');
        } else {
          incrementalDom.elementOpenStart('p');
          incrementalDom.attr('class', 'minium-card__empty_sku');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementClose('p');
        }

        incrementalDom.elementOpenStart('a');
        incrementalDom.attr('class', 'minium-card__name');
        incrementalDom.attr('href', detailsLink);
        incrementalDom.attr('tabindex', '-1');
        incrementalDom.elementOpenEnd();
        soyIdom.print(name);
        incrementalDom.elementClose('a');

        if (categories != null && categories.length > 0) {
          incrementalDom.elementOpenStart('p');
          incrementalDom.attr('class', 'minium-card__categories');
          incrementalDom.elementOpenEnd();
          var category2920List = categories;
          var category2920ListLen = category2920List.length;

          for (var category2920Index = 0; category2920Index < category2920ListLen; category2920Index++) {
            var category2920Data = category2920List[category2920Index];

            if (category2920Index != 0) {
              incrementalDom.text(', ');
            }

            soyIdom.print(category2920Data.name);
          }

          incrementalDom.elementClose('p');
        }

        incrementalDom.elementOpenStart('p');
        incrementalDom.attr('class', 'minium-card__description');
        incrementalDom.elementOpenEnd();

        if (description != null && description != '') {
          soyIdom.print(description);
        }

        incrementalDom.elementClose('p');

        if (prices != null && prices != null) {
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'minium-card__price');
          incrementalDom.elementOpenEnd();
          $templateAlias3({
            prices: prices,
            additionalPriceClasses: 'price-value-big',
            additionalDiscountClasses: 'price-value-big',
            additionalPromoPriceClasses: 'price-value-big'
          }, null, opt_ijData);
          incrementalDom.elementClose('div');
        }

        if (addToCartButtonVisible) {
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'minium-card__actions card-actions');
          incrementalDom.elementOpenEnd();

          if (sku != null && skuId != null) {
            $templateAlias4({
              accountId: accountId,
              orderId: orderId,
              cartAPI: cartAPI,
              quantity: orderQuantity,
              editMode: false,
              settings: settings,
              productId: skuId,
              spritemap: spritemap,
              buttonStyle: 'block'
            }, null, opt_ijData);
          } else {
            incrementalDom.elementOpenStart('a');
            incrementalDom.attr('class', 'btn btn-add-to-cart btn-lg btn-secondary');
            incrementalDom.attr('href', detailsLink);
            incrementalDom.elementOpenEnd();
            /** @desc View All Variants */

            var MSG_EXTERNAL_6561071405745687992 = Liferay.Language.get('view-all-variants');
            incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_6561071405745687992));
            incrementalDom.elementClose('a');
          }

          incrementalDom.elementClose('div');
        }

        incrementalDom.elementClose('div');
      }

      exports.render = $render;
      /**
       * @typedef {{
       *  id: (!goog.soy.data.SanitizedContent|string),
       *  accountId: (!goog.soy.data.SanitizedContent|null|number|string|undefined),
       *  addedToWishlist: (boolean|null|undefined),
       *  addToCartButtonVisible: (boolean|null|undefined),
       *  addToWishlistButtonVisible: (boolean|null|undefined),
       *  productId: (!goog.soy.data.SanitizedContent|null|number|string|undefined),
       *  orderId: (!goog.soy.data.SanitizedContent|null|number|string|undefined),
       *  orderQuantity: number,
       *  availability: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  sku: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  skuId: (!goog.soy.data.SanitizedContent|null|number|string|undefined),
       *  pictureUrl: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  name: (!goog.soy.data.SanitizedContent|string),
       *  cartAPI: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  detailsLink: (!goog.soy.data.SanitizedContent|string),
       *  categories: (!Array<{name: (!goog.soy.data.SanitizedContent|string)}>|null|undefined),
       *  description: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  compareState: (null|undefined|{checkboxVisible: boolean, compareAvailable: boolean, inCompare: boolean}),
       *  deleteButtonVisible: (boolean|null|undefined),
       *  settings: (?),
       *  spritemap: (!goog.soy.data.SanitizedContent|string),
       *  prices: (?),
       *  _handleRemoveProduct: (*|null|undefined),
       *  _handleCheckboxCompareUpdate: (*|null|undefined),
       *  _handleWishListButtonClick: (*|null|undefined)
       * }}
       */

      $render.Params;

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

      exports.render.params = ["id", "accountId", "addedToWishlist", "addToCartButtonVisible", "addToWishlistButtonVisible", "productId", "orderId", "orderQuantity", "availability", "sku", "skuId", "pictureUrl", "name", "cartAPI", "detailsLink", "categories", "description", "compareState", "deleteButtonVisible", "settings", "spritemap", "prices", "_handleRemoveProduct", "_handleCheckboxCompareUpdate", "_handleWishListButtonClick"];
      exports.render.types = {
        "id": "string",
        "accountId": "number|string",
        "addedToWishlist": "bool",
        "addToCartButtonVisible": "bool",
        "addToWishlistButtonVisible": "bool",
        "productId": "number|string",
        "orderId": "number|string",
        "orderQuantity": "int",
        "availability": "string",
        "sku": "string",
        "skuId": "number|string",
        "pictureUrl": "string",
        "name": "string",
        "cartAPI": "string",
        "detailsLink": "string",
        "categories": "list<[\n\t\tname: string\n\t]>",
        "description": "string",
        "compareState": "[\n\t\tcheckboxVisible: bool,\n\t\tcompareAvailable: bool,\n\t\tinCompare: bool\n\t]",
        "deleteButtonVisible": "bool",
        "settings": "? ",
        "spritemap": "string",
        "prices": "? ",
        "_handleRemoveProduct": "any",
        "_handleCheckboxCompareUpdate": "any",
        "_handleWishListButtonClick": "any"
      };
      exports.templates = templates = exports;
      return exports;
    });

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

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

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

      return ProductCard;
    }(_metalComponent.default);

    exports.ProductCard = ProductCard;

    _metalSoy.default.register(ProductCard, templates);

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

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