const require_runtime = require("../../../../../../../_virtual/_rolldown/runtime.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let _pisell_utils = require("@pisell/utils");
let _pisell_materials = require("@pisell/materials");
require("./index.less");
//#region src/components/pay/toC/PaymentMethods/MWCreditCard/components/TDSErrorModal/index.tsx
/** 不同场景对应的 i18n key 映射 */
const TEXT_KEY_MAP = {
	"tds-not-supported": {
		title: "tocPay.text.tdsErrorTitle",
		desc: "tocPay.text.tdsErrorDesc"
	},
	"bank-verify-failed": {
		title: "tocPay.text.bankVerifyFailedTitle",
		desc: "tocPay.text.bankVerifyFailedDesc"
	}
};
/**
* @title: 支付错误弹窗（通用）
* @description: 根据 type 展示不同文案，按钮行为一致：
*              更换卡片 / 使用其他支付方式 / 稍后支付。
*              支持两种场景：
*              1. tds-not-supported —— 预检查发现卡不支持 3DS 验证
*              2. bank-verify-failed —— 3DS 流程中银行安全验证失败（700500）
*/
const TDSErrorModal = ({ open, type = "tds-not-supported", shopPhone, shopEmail, onUseAnotherCard, onUseAnotherPayment, onPayLater }) => {
	/** 是否展示底部联系方式（电话或邮箱至少有一个） */
	const showContact = !!(shopPhone || shopEmail);
	/** 根据 type 获取对应的 i18n key */
	const textKeys = (0, react.useMemo)(() => TEXT_KEY_MAP[type], [type]);
	return /* @__PURE__ */ react.default.createElement(_pisell_materials.PisellModal, {
		open,
		closable: false,
		footer: null,
		header: false,
		mobileModalHeight: "auto",
		headerDivider: false,
		footerDivider: false,
		bodyStyle: { padding: 24 },
		transitionName: "pisell-move-down"
	}, /* @__PURE__ */ react.default.createElement("div", { className: "tds-error-modal" }, /* @__PURE__ */ react.default.createElement("div", { className: "tds-error-modal-title" }, _pisell_utils.locales.getText(textKeys.title)), /* @__PURE__ */ react.default.createElement("div", { className: "tds-error-modal-desc" }, _pisell_utils.locales.getText(textKeys.desc)), /* @__PURE__ */ react.default.createElement("div", { className: "tds-error-modal-actions" }, /* @__PURE__ */ react.default.createElement(antd.Button, {
		type: "primary",
		block: true,
		className: "tds-error-modal-btn-primary",
		onClick: onUseAnotherCard
	}, _pisell_utils.locales.getText("tocPay.text.useAnotherCard")), /* @__PURE__ */ react.default.createElement(antd.Button, {
		block: true,
		className: "tds-error-modal-btn-secondary",
		onClick: onUseAnotherPayment
	}, _pisell_utils.locales.getText("tocPay.text.useAnotherPayment")), /* @__PURE__ */ react.default.createElement(antd.Button, {
		block: true,
		className: "tds-error-modal-btn-secondary",
		onClick: onPayLater
	}, _pisell_utils.locales.getText("tocPay.text.payLater"))), showContact && /* @__PURE__ */ react.default.createElement("div", { className: "tds-error-modal-contact" }, _pisell_utils.locales.getText("tocPay.text.paymentTroubleContact")(shopPhone || "", shopEmail || ""))));
};
//#endregion
exports.default = TDSErrorModal;
