var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/eventBooking/index.tsx
var eventBooking_exports = {};
__export(eventBooking_exports, {
  default: () => eventBooking_default
});
module.exports = __toCommonJS(eventBooking_exports);
var import_react = __toESM(require("react"));
var import_Header = __toESM(require("./components/Provider/Header/index"));
var import_Footer = __toESM(require("./components/Provider/Footer"));
var import_Content = __toESM(require("./components/Provider/Content"));
var import_utils = require("@pisell/utils");
var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
var import_Sales = __toESM(require("../Sales"));
var import_index = require("./index.less");
var import_locales = __toESM(require("./locales"));
var Content = () => {
  var _a;
  const context = (0, import_useEngineContext.default)();
  const utils = context.appHelper.utils || {};
  import_utils.locales.init(import_locales.default, ((_a = utils == null ? void 0 : utils.storage) == null ? void 0 : _a.get("umi_locale")) || "en");
  const { data } = (0, import_Sales.useSales)();
  const { getBoardSetting } = (0, import_Sales.useInit)();
  const { currentStepData } = (0, import_Sales.useStep)();
  const { getResourceList } = (0, import_Sales.useResource)();
  const { form_id, shop_id } = data.initData || {};
  (0, import_react.useEffect)(() => {
    getBoardSetting.run({ item_type: "event_booking_v2" });
  }, []);
  (0, import_react.useEffect)(() => {
    var _a2, _b, _c;
    const history = ((_a2 = utils == null ? void 0 : utils.getHistory) == null ? void 0 : _a2.call(utils)) || {};
    const query = (_b = history == null ? void 0 : history.location) == null ? void 0 : _b.query;
    const params = {
      front_end_cache_id: (query == null ? void 0 : query.cacheId) || ""
    };
    if (query == null ? void 0 : query.ids) {
      params.event_item_ids = (_c = query == null ? void 0 : query.ids) == null ? void 0 : _c.split(",");
    }
    getResourceList.run(params);
  }, []);
  (0, import_react.useEffect)(() => {
    const setRealVH = () => {
      const vh = window.innerHeight * 0.01;
      document.documentElement.style.setProperty("--vh", `${vh}px`);
    };
    setRealVH();
    window.addEventListener("resize", setRealVH);
    return () => {
      window.removeEventListener("resize", setRealVH);
    };
  }, []);
  return /* @__PURE__ */ import_react.default.createElement(
    "div",
    {
      className: `event-booking-wrap ${(0, import_utils.isMobile)() ? "event-booking-mobile-wrap" : ""}`
    },
    /* @__PURE__ */ import_react.default.createElement(import_Header.default, null),
    /* @__PURE__ */ import_react.default.createElement(import_Content.default, null),
    (0, import_utils.isMobile)() && (currentStepData == null ? void 0 : currentStepData.key) !== "select-category" ? /* @__PURE__ */ import_react.default.createElement(import_Footer.default, null) : null
  );
};
var EventBooking = () => {
  return /* @__PURE__ */ import_react.default.createElement(import_Sales.default, { config: { useSessionStorage: true } }, /* @__PURE__ */ import_react.default.createElement(Content, null));
};
var eventBooking_default = EventBooking;
