require("../../../_virtual/_rolldown/runtime.js");
let react = require("react");
//#region src/components/checkout/hooks/useCustomerGuard.ts
function isWalletPassPayment(payment) {
	return (payment === null || payment === void 0 ? void 0 : payment.voucher_id) !== void 0 && Number(payment.voucher_id) !== 0;
}
function hasNonWalletPassPayment(paymentItems = []) {
	return paymentItems.some((payment) => {
		if (!payment || payment.status === "voided") return false;
		return !isWalletPassPayment(payment);
	});
}
function useCustomerGuard(paymentItems = []) {
	const isCustomerChangeLocked = (0, react.useMemo)(() => hasNonWalletPassPayment(paymentItems), [paymentItems]);
	return {
		isCustomerChangeLocked,
		canChangeCustomer: !isCustomerChangeLocked,
		shouldReloadWalletPassAfterCustomerChange: !isCustomerChangeLocked
	};
}
//#endregion
exports.isWalletPassPayment = isWalletPassPayment;
exports.useCustomerGuard = useCustomerGuard;
