var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/pisellCardList/index.tsx
var pisellCardList_exports = {};
__export(pisellCardList_exports, {
  default: () => pisellCardList_default
});
module.exports = __toCommonJS(pisellCardList_exports);
var import_react = __toESM(require("react"));
var import_pisellCheckboxGroup = __toESM(require("../pisellCheckboxGroup"));
var import_pisellWalletPassCard = __toESM(require("../pisellWalletPassCard"));
var import_pisellEmpty = __toESM(require("../pisellEmpty"));
var import_index = require("./index.less");
var PisellCardList = (props) => {
  const {
    data = [],
    loadMoreData = () => {
    },
    endMessage,
    loader,
    hasMore,
    onChange,
    value,
    mode,
    direction = "vertical",
    fullWidth,
    type,
    showName,
    showCode,
    showCover,
    showDetail,
    showBalance,
    showRedeem,
    showQrCode,
    showStoreName,
    showValidDate,
    empty,
    showEmpty,
    showBalanceSymbol,
    onChangeDebounce,
    showStatus,
    nameTitleStyle,
    enableEditAmount,
    useExternalDetail,
    onDetail,
    formatBalance,
    formatBalanceTitle,
    formatRedeem,
    formatRedeemTitle,
    onBeforeEditAmount,
    onItemClick,
    showActiveBackground
  } = props;
  return data.length ? /* @__PURE__ */ import_react.default.createElement(
    import_pisellCheckboxGroup.default,
    {
      options: data,
      value,
      mode,
      direction,
      rowKey: "id",
      gap: 12,
      onChange,
      iconPosition: "hide",
      fullWidth,
      onChangeDebounce,
      onItemClick,
      showActiveBackground,
      renderOption: (item, active, index) => {
        return /* @__PURE__ */ import_react.default.createElement(
          import_pisellWalletPassCard.default,
          {
            ...item,
            active,
            mode,
            showActiveIcon: true,
            showStatus: showStatus || (item == null ? void 0 : item.showStatus),
            cardStatus: item == null ? void 0 : item.cardStatus,
            nameTitleStyle: nameTitleStyle || (item == null ? void 0 : item.nameTitleStyle),
            showName: showName || (item == null ? void 0 : item.showName),
            showBalance: showBalance || (item == null ? void 0 : item.showBalance),
            showCode: showCode || (item == null ? void 0 : item.showCode),
            showCover: showCover || (item == null ? void 0 : item.showCover),
            showDetail: showDetail || (item == null ? void 0 : item.showDetail),
            showQrCode: showQrCode || (item == null ? void 0 : item.showQrCode),
            showRedeem: showRedeem || (item == null ? void 0 : item.showRedeem),
            showStoreName: showStoreName || (item == null ? void 0 : item.showStoreName),
            showValidDate: showValidDate || (item == null ? void 0 : item.showValidDate),
            showBalanceSymbol: showBalanceSymbol || (item == null ? void 0 : item.showBalanceSymbol),
            showActions: props.showActions || (item == null ? void 0 : item.showActions),
            actions: props.actions || (item == null ? void 0 : item.actions),
            enableEditAmount: enableEditAmount || (item == null ? void 0 : item.enableEditAmount),
            useExternalDetail: useExternalDetail || (item == null ? void 0 : item.useExternalDetail),
            onDetail: (record) => {
              var _a;
              return (_a = props == null ? void 0 : props.onDetail) == null ? void 0 : _a.call(props, record, index);
            },
            beforeEdit: (record) => {
              var _a;
              return (_a = props == null ? void 0 : props.beforeEdit) == null ? void 0 : _a.call(props, record, index);
            },
            onConfirmEditAmount: (value2) => {
              var _a;
              (_a = props.onConfirmEditAmount) == null ? void 0 : _a.call(props, value2, index, item);
            },
            onConfirmEdit: (newVal) => {
              var _a;
              (_a = props.onConfirmEdit) == null ? void 0 : _a.call(props, newVal, index, item);
            },
            formatBalance: formatBalance || (item == null ? void 0 : item.formatBalance),
            formatBalanceTitle: formatBalanceTitle || (item == null ? void 0 : item.formatBalanceTitle),
            type,
            style: direction === "vertical" || direction === "horizontal" && fullWidth ? { width: "100%" } : {},
            formatRedeem: formatRedeem || (item == null ? void 0 : item.formatRedeem),
            formatRedeemTitle: formatRedeemTitle || (item == null ? void 0 : item.formatRedeemTitle),
            onBeforeEditAmount: (record) => {
              var _a;
              return (_a = props == null ? void 0 : props.onBeforeEditAmount) == null ? void 0 : _a.call(props, record, index, item);
            }
          }
        );
      }
    }
  ) : showEmpty && (empty || /* @__PURE__ */ import_react.default.createElement(import_pisellEmpty.default, null));
};
var pisellCardList_default = (0, import_react.memo)(PisellCardList);
