var _excluded = ["normalHost"];
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
import { isNormalProductByDurationSchedule } from "../../../components/booking/info/service2/utils";
import { createLegacyOpenProductDetailHost } from "../demo/hosts/legacyOpenProductDetail";
/**
 * 组合商品详情 Host：普通商品走 SkuDetailModal，预约商品走 legacy Info2 弹窗。
 * 对齐 ticketBooking `openProductModal` 分支逻辑。
 *
 * @example
 * createCompositeOpenProductDetailHost({ action, getRuntime, normalHost });
 */
export function createCompositeOpenProductDetailHost(deps) {
  var normalHost = deps.normalHost,
    legacyDeps = _objectWithoutProperties(deps, _excluded);
  var legacyHost = createLegacyOpenProductDetailHost(legacyDeps);
  return function (payload) {
    var _payload$productData;
    var item = (_payload$productData = payload.productData) !== null && _payload$productData !== void 0 ? _payload$productData : payload.item;
    if (isNormalProductByDurationSchedule(item)) {
      return normalHost(payload);
    }
    return legacyHost(payload);
  };
}