const require_runtime = require("../../../../../../_virtual/_rolldown/runtime.js");
const require_index = require("../../../../components/pisellPriceText/index.js");
const require_status = require("../../status.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_utils = require("@pisell/utils");
let _pisell_materials = require("@pisell/materials");
require("./index.less");
//#region src/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.tsx
const MemberPrice = ({ props }) => {
	const { dataSource, skuTextConfig } = props;
	const { isOpen, isMemberPrice, isIndicator, isIndicatorBorder, indicatorBackground, indicatorPaddingY, indicatorPaddingX, indicatorMarginX, indicatorRadius, indicatorBorderWidth, indicatorBorderColor, indicatorFontSize, indicatorFontWeight, indicatorColor, fontSize, fontWeight, color, indicatorIcon, customText } = (skuTextConfig === null || skuTextConfig === void 0 ? void 0 : skuTextConfig.skuMemberPriceConfig) || {};
	if (!isOpen) return null;
	if (customText) return customText;
	const memberPriceStyle = (0, react.useMemo)(() => {
		return {
			fontSize,
			fontWeight,
			color
		};
	}, [
		fontSize,
		fontWeight,
		color
	]);
	/**
	* @title: 标识样式
	* @description:
	* @param {*} useMemo
	* @return {*}
	* @Author: WangHan
	* @Date: 2025-09-08 11:50
	*/
	const indicatorStyle = (0, react.useMemo)(() => {
		return {
			backgroundColor: indicatorBackground,
			padding: `${indicatorPaddingY}px ${indicatorPaddingX}px`,
			margin: `0 ${indicatorMarginX}px`,
			border: isIndicatorBorder ? `${indicatorBorderWidth}px solid ${indicatorBorderColor}` : "none",
			borderRadius: indicatorRadius,
			fontSize: indicatorFontSize,
			fontWeight: indicatorFontWeight,
			color: indicatorColor
		};
	}, [
		indicatorBackground,
		indicatorPaddingY,
		indicatorPaddingX,
		indicatorMarginX,
		indicatorRadius,
		indicatorBorderWidth,
		indicatorBorderColor,
		indicatorFontSize,
		indicatorFontWeight,
		indicatorColor,
		isIndicatorBorder
	]);
	return /* @__PURE__ */ react.default.createElement("div", { className: `${require_status.PREFIX}__card-member-price` }, isMemberPrice ? /* @__PURE__ */ react.default.createElement("div", {
		className: `${require_status.PREFIX}__card-member-price-text`,
		style: memberPriceStyle
	}, /* @__PURE__ */ react.default.createElement(require_index.default, { value: (dataSource === null || dataSource === void 0 ? void 0 : dataSource.member_price) || 0 })) : null, isIndicator ? /* @__PURE__ */ react.default.createElement(_pisell_materials.PisellTags, {
		type: "pill_color",
		style: indicatorStyle
	}, /* @__PURE__ */ react.default.createElement("div", { className: `${require_status.PREFIX}__card-member-price-tag` }, indicatorIcon ? indicatorIcon : /* @__PURE__ */ react.default.createElement(_pisell_materials.Icon, {
		type: "pisell2-check-verified-02",
		size: 12,
		rotate: 0,
		spin: false,
		color: "#CA8504"
	}), /* @__PURE__ */ react.default.createElement("span", null, _pisell_utils.locales.getText("pisell2.sku-card.member-price")))) : null);
};
//#endregion
exports.default = MemberPrice;
