const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
const require_context = require("../../context.js");
const require_index = require("../Header/index.js");
const require_index$1 = require("../Cart/index.js");
const require_index$2 = require("../Footer/index.js");
const require_index$3 = require("../VenueSelection/index.js");
const require_index$4 = require("../Addons/index.js");
const require_index$5 = require("../Checkout/index.js");
let react = require("react");
react = require_runtime.__toESM(react);
//#region src/components/venueBooking/components/Content/index.tsx
/**
* venueBooking 内容区域组件
* 负责根据当前步骤渲染对应的子视图，管理桌面端 Cart 侧边栏和移动端 Footer
*/
function Content() {
	const { currentStep, viewModel, handlePrimaryAction, isSubmittingOrder } = require_context.useVenueBookingContext();
	/** 步骤 → 组件映射 */
	const stepRegistry = {
		"select-venue": /* @__PURE__ */ react.default.createElement(require_index$3.default, null),
		addons: /* @__PURE__ */ react.default.createElement(require_index$4.default, null),
		checkout: /* @__PURE__ */ react.default.createElement(require_index$5.default, null)
	};
	const stepHeaderRef = (0, react.useRef)(null);
	/**
	* 动态测量 Step Header 高度并写入 --vb-grid-sticky-top。
	* 供 TimeGrid sticky 表头作为 top 偏移，以及 Cart 侧栏 sticky top 计算使用，
	* 保证三者不互相覆盖。
	*/
	(0, react.useEffect)(() => {
		const wrap = stepHeaderRef.current;
		if (!wrap) return void 0;
		const scope = wrap.closest(".venue-booking-scope");
		if (!scope) return void 0;
		function update() {
			if (!wrap) return;
			scope === null || scope === void 0 || scope.style.setProperty("--vb-grid-sticky-top", `${wrap.offsetHeight}px`);
		}
		update();
		const ro = typeof ResizeObserver !== "undefined" ? new ResizeObserver(update) : null;
		ro === null || ro === void 0 || ro.observe(wrap);
		window.addEventListener("resize", update);
		return () => {
			ro === null || ro === void 0 || ro.disconnect();
			window.removeEventListener("resize", update);
		};
	}, []);
	return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement("style", null, `
        @keyframes slideLeft { from { opacity: 0; transform: translateX(34px); } to { opacity: 1; transform: translateX(0); } }
        @keyframes slideRight { from { opacity: 0; transform: translateX(-34px); } to { opacity: 1; transform: translateX(0); } }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
        /* 骨架屏光条：从左到右扫过营造数据加载感 */
        @keyframes vbShimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
        .vb-skeleton-shimmer {
          position: absolute;
          inset: 0;
          background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.6) 50%, transparent 100%);
          animation: vbShimmer 1.4s ease-in-out infinite;
          pointer-events: none;
        }

        /* 作用域 reset：修复宿主环境 preflight: false 导致浏览器默认样式泄入 */
        .venue-booking-scope *,
        .venue-booking-scope *::before,
        .venue-booking-scope *::after {
          box-sizing: border-box;
        }
        .venue-booking-scope {
          --vb-primary: var(--theme-color, #ea1018);
          --vb-primary-light: color-mix(in srgb, var(--vb-primary) 12%, #fff);
          --vb-grid-sticky-top: 0px;
          font-size: 16px;
          line-height: 1.5;
        }
        .venue-booking-scope .vb-primary-text { color: var(--vb-primary); }
        .venue-booking-scope button {
          border: none;
          outline: none;
          background: transparent;
          font: inherit;
          color: inherit;
          padding: 0;
          cursor: pointer;
        }
        /* 仅重置无 class 的原生输入框，避免覆盖 Tailwind 组件显式边框 */
        .venue-booking-scope input:not([class]),
        .venue-booking-scope textarea:not([class]) {
          border: none;
          outline: none;
          font: inherit;
          color: inherit;
        }

        /* 购物车内 Promotion 区块：缩小标题字号，与 SubTotal 统一为 16px */
        .venue-booking-scope .pisell-lowcode__appointment-booking-voucher-container .voucher-title .voucher-title-left {
          font-size: 16px;
          font-weight: 600;
          line-height: 24px;
        }
        .venue-booking-scope .pisell-lowcode__appointment-booking-voucher-container .voucher-title .voucher-title-right {
          font-size: 14px;
          font-weight: 500;
        }

        /* 桌面端 embedded-footer 粘在侧边栏底部 */
        .venue-booking-scope .pisell-venue-booking-cart-embedded-footer {
          position: sticky;
          bottom: 0;
          z-index: 5;
          background: #fff;
          border-radius: 0 0 28px 28px;
        }
      `), /* @__PURE__ */ react.default.createElement("main", { className: "mx-auto max-w-[1500px] md:px-6 md:pt-6 lg:pb-12 h-full overscroll-none" }, /* @__PURE__ */ react.default.createElement("div", {
		className: "space-y-2 md:space-y-4",
		style: { minHeight: "100%" }
	}, /* @__PURE__ */ react.default.createElement("div", {
		ref: stepHeaderRef,
		className: "sticky top-0 z-40"
	}, /* @__PURE__ */ react.default.createElement(require_index.default, null)), /* @__PURE__ */ react.default.createElement("div", { className: "grid max-w-full gap-2 md:gap-4 lg:grid-cols-[minmax(0,1fr)_390px] xl:grid-cols-[minmax(0,1fr)_420px]" }, /* @__PURE__ */ react.default.createElement("section", { className: "min-w-0 space-y-3 overscroll-none md:space-y-5" }, stepRegistry[currentStep]), /* @__PURE__ */ react.default.createElement("aside", {
		className: "hidden lg:block sticky self-start z-10 rounded-[28px] bg-white shadow-[0_10px_40px_rgba(20,20,20,0.06)] ring-1 ring-black/6",
		style: { top: "calc(var(--vb-grid-sticky-top, 0px) + 1.5rem)" }
	}, /* @__PURE__ */ react.default.createElement(require_index$1.default, {
		embedded: true,
		open: true,
		items: viewModel.cartItems,
		summary: viewModel.summary,
		onCancel: () => {},
		onNext: handlePrimaryAction,
		confirmLoading: isSubmittingOrder
	})))), /* @__PURE__ */ react.default.createElement("div", { className: "sticky bottom-0 z-50 block lg:hidden" }, /* @__PURE__ */ react.default.createElement(require_index$2.default, null))));
}
//#endregion
exports.default = Content;
