var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/plus/salesSdk/utils/discountCard.ts
var discountCard_exports = {};
__export(discountCard_exports, {
  shouldSkipCustomerRepriceForDiscountedLine: () => shouldSkipCustomerRepriceForDiscountedLine
});
module.exports = __toCommonJS(discountCard_exports);
function isDiscountCardApplied(discount) {
  var _a, _b;
  const type = String((discount == null ? void 0 : discount.type) ?? (discount == null ? void 0 : discount.tag) ?? "");
  if (type === "discount_card" || type === "product_discount_card") return true;
  const discountCardType = ((_a = discount == null ? void 0 : discount.metadata) == null ? void 0 : _a.discount_card_type) ?? ((_b = discount == null ? void 0 : discount.discount) == null ? void 0 : _b.discount_card_type);
  return typeof discountCardType === "string" && discountCardType.length > 0;
}
function shouldSkipCustomerRepriceForDiscountedLine(line) {
  return Array.isArray(line.discount_list) && line.discount_list.some(isDiscountCardApplied);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  shouldSkipCustomerRepriceForDiscountedLine
});
