//#region src/components/PisellSteps/utils/index.ts
/**
* 判断步骤是否可点击
* 
* @param index - 步骤索引
* @param current - 当前步骤索引
* @param status - 步骤状态
* @param clickable - 全局是否可点击
* @param allowClickFinished - 是否允许点击已完成步骤
* @returns 是否可点击
*/
function isStepClickable(index, current, status, clickable, allowClickFinished) {
	if (!clickable) return false;
	if (index === current) return false;
	if (status === "finish" || index < current) return allowClickFinished;
	if (status === "wait") return false;
	if (status === "error") return true;
	return true;
}
/**
* 获取步骤状态
* 
* @param index - 步骤索引
* @param current - 当前步骤索引
* @param customStatus - 自定义状态（优先级最高）
* @returns 步骤状态
*/
function getStepStatus(index, current, customStatus) {
	if (customStatus) return customStatus;
	if (index < current) return "finish";
	else if (index === current) return "process";
	else return "wait";
}
/**
* 合并步骤类名
* 
* @param baseClass - 基础类名
* @param status - 步骤状态
* @param customClass - 自定义类名
* @returns 合并后的类名
*/
function mergeStepClassName(baseClass, status, customClass) {
	const classes = [baseClass];
	classes.push(`${baseClass}-${status}`);
	if (customClass) classes.push(customClass);
	return classes.join(" ");
}
//#endregion
exports.getStepStatus = getStepStatus;
exports.isStepClickable = isStepClickable;
exports.mergeStepClassName = mergeStepClassName;
