import { getIsNoSpecAndPackage } from "../../../components/booking/info2/utilsByBooking.js";
import { isBookingProduct, isNormalProductByDurationSchedule } from "../../../components/booking/info/service2/utils.js";
//#region src/plus/salesSdk/bookingEditService/canShowBookingEditProductButton.ts
/**
* 资源编辑抽屉是否展示「编辑商品」按钮。
*/
function canShowBookingEditProductButton(options) {
	const { cacheItem, bookingState, hasOpenProductDetail } = options;
	if (!cacheItem || bookingState.channelDisabledEdit) return false;
	if (getIsNoSpecAndPackage(cacheItem)) return false;
	if (isBookingProduct(cacheItem === null || cacheItem === void 0 ? void 0 : cacheItem.extension_type)) return hasOpenProductDetail;
	if (isNormalProductByDurationSchedule(cacheItem)) return true;
	return hasOpenProductDetail;
}
//#endregion
export { canShowBookingEditProductButton };
