var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/plus/pisellReservation/hooks/useNewReservationRoutesFromEngine.ts
var useNewReservationRoutesFromEngine_exports = {};
__export(useNewReservationRoutesFromEngine_exports, {
  useNewReservationRoutesFromEngine: () => useNewReservationRoutesFromEngine
});
module.exports = __toCommonJS(useNewReservationRoutesFromEngine_exports);
var import_react = require("react");
var import_reservationConstants = require("../reservationConstants");
function useNewReservationRoutesFromEngine(router) {
  return (0, import_react.useMemo)(() => {
    if (!router || typeof router !== "object") return [];
    const routeMap = router;
    return Object.entries(routeMap).reduce(
      (acc, [routeKey, routeConfig]) => {
        if (!routeConfig || typeof routeConfig !== "object") return acc;
        const routeItem = routeConfig;
        const pageType = routeItem.page_type;
        const proCodeId = routeItem.proCodeId;
        if (pageType !== "proCode" || typeof proCodeId !== "string" || !import_reservationConstants.RESERVATION_NEW_MODAL_PRO_CODE_IDS.has(proCodeId)) {
          return acc;
        }
        const pageName = typeof routeItem.page_name === "string" && routeItem.page_name.trim() ? routeItem.page_name.trim() : routeKey;
        const routePath = typeof routeItem.router === "string" && routeItem.router.trim() ? routeItem.router.trim() : routeKey;
        if (!routePath) return acc;
        if (routePath.toLowerCase().includes("food")) return acc;
        if (/\/:[^/]+/.test(routePath)) return acc;
        acc.push({ pageName, router: routePath });
        return acc;
      },
      []
    );
  }, [router]);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  useNewReservationRoutesFromEngine
});
