//#region src/components/ticketBooking/components/ProductDisplayAdapter/types.ts
/**
* 产品展示配置预设
* 支持通过字符串键或直接使用配置对象
*/
const ProductDisplayPresets = {
	default: {
		displayMode: "product-select",
		productSelectConfig: {
			showSearch: true,
			showTab: true,
			layout: {
				grid: true,
				config: "12:12"
			},
			productListSetting: {
				isProductCover: 1,
				isTitle: 1,
				isSubtitle: 1,
				isPrice: 1,
				isOriginPrice: 0,
				isStock: 0
			}
		}
	},
	"product-select": {
		displayMode: "product-select",
		productSelectConfig: {
			showSearch: true,
			showTab: true,
			layout: {
				grid: true,
				config: "12:12"
			},
			productListSetting: {
				isProductCover: 1,
				isTitle: 1,
				isSubtitle: 1,
				isPrice: 1,
				isOriginPrice: 0,
				isStock: 0
			}
		}
	},
	"sku-list-a1": {
		displayMode: "sku-list",
		skuListConfig: {
			listConfig: {
				layout: "grid",
				showPagination: false,
				showTab: false
			},
			skuCardAllConfig: { skuCardConfig: {
				displayMode: "display_a1",
				isFavorite: false,
				layoutDirection: "column"
			} }
		}
	},
	"sku-list-a2": {
		displayMode: "sku-list",
		skuListConfig: {
			listConfig: {
				layout: "grid",
				showPagination: false,
				showTab: false
			},
			skuCardAllConfig: { skuCardConfig: {
				displayMode: "display_a2",
				layoutDirection: "row",
				radius: 12,
				paddingX: 12,
				paddingY: 12,
				skuImageConfig: {
					isCover: true,
					width: "140px",
					height: "140px",
					radius: 8
				},
				skuNameConfig: {
					isOpen: true,
					fontSize: 16,
					fontWeight: 600,
					color: "#101828",
					ellipsisCount: 2
				},
				skuSubtitleConfig: {
					isOpen: true,
					fontSize: 14,
					color: "#667085",
					ellipsisCount: 1
				},
				skuPriceConfig: {
					isOpen: true,
					isPrice: true,
					priceFontSize: 18,
					priceFontWeight: 600,
					priceColor: "#101828",
					isOriginPrice: true,
					originPriceFontSize: 14,
					originPriceColor: "#98A2B3"
				},
				skuStockConfig: {
					isOpen: true,
					fontSize: 12,
					color: "#667085"
				}
			} }
		}
	},
	"sku-list-a5": {
		displayMode: "sku-list",
		skuListConfig: {
			listConfig: {
				layout: "grid",
				showPagination: false,
				showTab: true,
				tabStyle: "switch",
				stickyTop: true,
				columns: 4,
				tabGroup: "category"
			},
			skuCardAllConfig: {
				skuCardConfig: {
					displayMode: "display_a5",
					layoutDirection: "column",
					background: "#ffffff",
					paddingY: 8,
					paddingX: 8,
					marginY: 0,
					marginX: 0,
					radius: 12,
					isBorderVisible: false,
					borderWidth: 1,
					borderColor: "#ffffff",
					isFoldable: true
				},
				skuActionConfig: { isOpen: false },
				skuTextConfig: {
					skuSubtitleConfig: { isOpen: false },
					skuNameConfig: { isOpen: true },
					skuPriceConfig: {
						isOpen: true,
						isPrice: true,
						priceFontSize: 18,
						priceFontWeight: 600,
						priceColor: "#101828",
						isShowZeroPrice: true,
						isShowFreePrice: false,
						isOriginPrice: true,
						originPriceFontSize: 16,
						originPriceFontWeight: 400,
						originPriceColor: "#667085",
						isTaxPrice: true,
						isCustomText: false
					}
				},
				skuImageConfig: {
					isCover: true,
					width: "100%",
					height: "126px",
					isTextFallback: true,
					background: "#ffffff",
					skuImageRadius: 12,
					slotPosition: "left_top",
					radius: 12
				},
				skuExtraConfig: { isOpen: false }
			}
		}
	}
};
ProductDisplayPresets["product-select"], ProductDisplayPresets["sku-list-a1"], ProductDisplayPresets["sku-list-a2"], ProductDisplayPresets["sku-list-a5"];
/**
* 工具函数：将字符串键或配置对象解析为配置对象
*/
function resolveProductDisplayConfig(config) {
	if (!config) return ProductDisplayPresets["default"];
	if (typeof config === "string") {
		const preset = ProductDisplayPresets[config];
		if (!preset) {
			console.warn(`Unknown preset key: "${config}", falling back to default`);
			return ProductDisplayPresets["default"];
		}
		return preset;
	}
	return config;
}
//#endregion
export { resolveProductDisplayConfig };
