var _excluded = ["gridDataSourceKey", "dataSources", "scheduleValue", "onScheduleChange", "reservationBiz", "associatedMenuListIds", "toolBar", "floorMap", "scheduleStartSlot", "scheduleEndSlot", "onNewReservation", "timeNavigatorProps", "scheduleProps", "fab", "defaultBodyView", "data", "total", "pagination", "onPageChange", "onSearch", "onReset", "searchParams", "loading", "rowKey", "__id", "className", "style", "floorPlanId", "floorPlanCanvasWidth", "floorPlanCanvasHeight", "floorPlanCode", "floorPlanName", "floorPlanSort", "floorPlanStatus", "onFloorPlanPersisted", "putFloorPlan", "onFloorMapBookingClick", "bodyViewSwitchable", "lockedBodyView", "bodyViewStorageKey", "floorMapHudTableDrawer", "variant", "forceFollowWallClock", "resourceSelectMode"];
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
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; }
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
import React, { useEffect, useMemo, useState, useCallback, useRef } from 'react';
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
import 'dayjs/locale/en';
import 'dayjs/locale/zh-tw';
import classNames from 'classnames';
import { LocalizationProvider } from '@pisell/date-picker';
import { AdapterDayjs } from '@pisell/date-picker/es/AdapterDayjs';
import { locales } from '@pisell/utils';
import { PisellRecordBoard, DEFAULT_RESOURCE_WALL_FILTER_FIELD_KEY } from '@pisell/materials';
import useEngineContext, { usePisellOS } from "../../hooks/useEngineContext";
import { ReservationBookingDetailModal } from "./components/bookingDetailModal/ReservationBookingDetailModal";
import { PISELL_RESERVATION_FLOOR_PLAN_CODE, RESERVATION_DEFAULT_FLOOR_PLAN_ID } from "./floorMap/floorPlanApi";
import { useBookingPerspective } from "../pisellSalesManagement/hooks/useBookingPerspective";
import { resolveBookingMonitorColumnStorageKey } from "../pisellSalesManagement/config/booking";
import { getDefaultMonitorSearchParams, getGridTableBookingSearchParams, usePisellReservationBookingData } from "./hooks/usePisellReservationBookingData";
import { usePisellReservationResourceTableData } from "./hooks/usePisellReservationResourceTableData";
import { request } from "../../utils";
import "./PisellReservation.less";
import { useRequest } from 'ahooks';
import { getRelationTables } from "../pisellSalesManagement/serve";
import { buildReservationMergedTableRows } from "./data/reservationTablesMerge";
import { extractResourceRecordIds } from "./data/bookingToReservationTables";
import { buildCalendarResourcesFromMergedTables, mapFloorDayBookingsToCalendarItems, orderedCanvasResourceRecordIdStrings } from "./data/calendarAdapter";
import { mergeGridBookingSearchParams, mergeSearchParamsBookingWindow, readBodyViewFromStorageKey, readReservationFloorMapAppearanceMode, writeReservationFloorMapAppearanceMode, shouldUseBuiltinReservationList } from "./data/reservationDataUtils";
import { sceneElementsToBoundFormRecordIds } from "./floorMap/floorMapBoundRecordIds";
import { RecordBoardBodyViewCapture, ScheduleSyncOnFloorEnter } from "./components/PisellReservationSubcomponents";
import { useReservationFloorPlan } from "./floorMap/useReservationFloorPlan";
import { useReservationFloorMapMerged } from "./floorMap/useReservationFloorMapMerged";
import { GRID_DS_KEY, PISELL_RESERVATION_DEFAULT_PAGE_SIZE, PISELL_RESERVATION_PAGE_LOCALES } from "./reservationConstants";
import { mapReservationRowsToVenueWallCards } from "./data/mapReservationToVenueWallCards";
import { resolveOperatingDayBoundaryFromCoreModel, timelineRangeFromOperatingDayBoundary, timelineReferenceDateForScheduleDay } from "./data/reservationOperatingDayRange";
import { useReservationScheduleDebounced } from "./hooks/useReservationScheduleDebounced";
import { useReservationSalesHostData } from "./hooks/useReservationSalesHostData";
import { useReservationLoadingShownDebounced } from "./hooks/useReservationLoadingShownDebounced";
import { useFloorMapBookingInteraction } from "./hooks/useFloorMapBookingInteraction";
import { useReservationCalendarSlot } from "./hooks/useReservationCalendarSlot";
import { useReservationToolBarMerged } from "./hooks/useReservationToolBarMerged";
import { ReservationNewReservationModal } from "./components/ReservationNewReservationModal";
import { usePicoCodingOpenData } from "./hooks/usePicoCodingOpenData";
import { useReservationWallClockFollow } from "./hooks/useReservationWallClockFollow";
import { useReservationHudDrawer } from "./hooks/useReservationHudDrawer";
import { useReservationResourceWallPersist } from "./hooks/useReservationResourceWallPersist";
import { useReservationDebugLoggers } from "./hooks/useReservationDebugLoggers";
import { ReservationHudDrawer } from "./components/ReservationHudDrawer";
import { buildReservationMobileTableGridConfig } from "./mobileTable/buildReservationMobileTableConfig";
import { useReservationPhoneGridInfiniteData } from "./hooks/useReservationPhoneGridInfiniteData";

/**
 * Dumi / Story 等无低代码引擎时，`utils` 的 request 未被注入；
 * 子模块仍会调用 `request.getRequest().post/get`，未 setRequest 会抛错。
 * 仅在无引擎请求实例时使用占位（返回空 data），不影响真实环境中 `appHelper.utils.request` 优先注入。
 */
var PREVIEW_HTTP_CLIENT = {
  get: function () {
    var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
      return _regeneratorRuntime().wrap(function _callee$(_context) {
        while (1) switch (_context.prev = _context.next) {
          case 0:
            return _context.abrupt("return", {
              data: {}
            });
          case 1:
          case "end":
            return _context.stop();
        }
      }, _callee);
    }));
    function get() {
      return _get.apply(this, arguments);
    }
    return get;
  }(),
  post: function () {
    var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
      return _regeneratorRuntime().wrap(function _callee2$(_context2) {
        while (1) switch (_context2.prev = _context2.next) {
          case 0:
            return _context2.abrupt("return", {
              data: {}
            });
          case 1:
          case "end":
            return _context2.stop();
        }
      }, _callee2);
    }));
    function post() {
      return _post.apply(this, arguments);
    }
    return post;
  }(),
  put: function () {
    var _put = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
      return _regeneratorRuntime().wrap(function _callee3$(_context3) {
        while (1) switch (_context3.prev = _context3.next) {
          case 0:
            return _context3.abrupt("return", {
              data: {}
            });
          case 1:
          case "end":
            return _context3.stop();
        }
      }, _callee3);
    }));
    function put() {
      return _put.apply(this, arguments);
    }
    return put;
  }(),
  remove: function () {
    var _remove = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
      return _regeneratorRuntime().wrap(function _callee4$(_context4) {
        while (1) switch (_context4.prev = _context4.next) {
          case 0:
            return _context4.abrupt("return", {
              data: {}
            });
          case 1:
          case "end":
            return _context4.stop();
        }
      }, _callee4);
    }));
    function remove() {
      return _remove.apply(this, arguments);
    }
    return remove;
  }(),
  custom: function () {
    var _custom = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
      return _regeneratorRuntime().wrap(function _callee5$(_context5) {
        while (1) switch (_context5.prev = _context5.next) {
          case 0:
            return _context5.abrupt("return", {
              data: {}
            });
          case 1:
          case "end":
            return _context5.stop();
        }
      }, _callee5);
    }));
    function custom() {
      return _custom.apply(this, arguments);
    }
    return custom;
  }()
};

/**
 * 预约看板 Core：内置 Sales 预约列表 + 时间轴 + 平面图。
 * 页面壳 {@link PisellReservationBookingPage} / {@link PisellVenueControlPage} /
 * {@link PisellVenueWallPage} / {@link PisellReservationTablePage} 通过 props 组合默认行为。
 */
export var PisellReservationCore = function PisellReservationCore(props) {
  var _engineCtx$appHelper, _engineCtx$engine, _engineCtx$appHelper2, _engineCtx$appHelper3, _app$router, _app$router$getRoutes, _app$history, _app$history$useParam, _engineCtx$appHelper8, _floorMapProp$mode, _scroll$autoCalc, _scroll;
  var _props$gridDataSource = props.gridDataSourceKey,
    gridDataSourceKey = _props$gridDataSource === void 0 ? GRID_DS_KEY : _props$gridDataSource,
    dataSourcesProp = props.dataSources,
    scheduleValueProp = props.scheduleValue,
    onScheduleChange = props.onScheduleChange,
    reservationBizProp = props.reservationBiz,
    associatedMenuListIdsProp = props.associatedMenuListIds,
    toolBarProp = props.toolBar,
    floorMapProp = props.floorMap,
    scheduleStartSlotProp = props.scheduleStartSlot,
    scheduleEndSlotProp = props.scheduleEndSlot,
    onNewReservation = props.onNewReservation,
    timeNavigatorPropsProp = props.timeNavigatorProps,
    schedulePropsProp = props.scheduleProps,
    fab = props.fab,
    _unusedDefaultBodyView = props.defaultBodyView,
    dataProp = props.data,
    totalProp = props.total,
    paginationProp = props.pagination,
    onPageChangeProp = props.onPageChange,
    onSearchProp = props.onSearch,
    onResetProp = props.onReset,
    searchParamsProp = props.searchParams,
    loadingProp = props.loading,
    _props$rowKey = props.rowKey,
    rowKey = _props$rowKey === void 0 ? 'id' : _props$rowKey,
    __id = props.__id,
    className = props.className,
    style = props.style,
    floorPlanIdProp = props.floorPlanId,
    floorPlanCanvasWidth = props.floorPlanCanvasWidth,
    floorPlanCanvasHeight = props.floorPlanCanvasHeight,
    floorPlanCode = props.floorPlanCode,
    floorPlanName = props.floorPlanName,
    floorPlanSort = props.floorPlanSort,
    floorPlanStatus = props.floorPlanStatus,
    onFloorPlanPersisted = props.onFloorPlanPersisted,
    putFloorPlan = props.putFloorPlan,
    onFloorMapBookingClick = props.onFloorMapBookingClick,
    _props$bodyViewSwitch = props.bodyViewSwitchable,
    bodyViewSwitchable = _props$bodyViewSwitch === void 0 ? true : _props$bodyViewSwitch,
    lockedBodyView = props.lockedBodyView,
    bodyViewStorageKey = props.bodyViewStorageKey,
    _props$floorMapHudTab = props.floorMapHudTableDrawer,
    floorMapHudTableDrawer = _props$floorMapHudTab === void 0 ? false : _props$floorMapHudTab,
    variant = props.variant,
    forceFollowWallClockProp = props.forceFollowWallClock,
    resourceSelectMode = props.resourceSelectMode,
    rest = _objectWithoutProperties(props, _excluded);
  void _unusedDefaultBodyView;
  var isPhoneLayout = variant === 'phone';

  // --- 模式与平面图 id：内置请求 vs 低代码完全受控 data / 分页 ---

  var isInternalListData = shouldUseBuiltinReservationList(dataProp, totalProp, paginationProp, onPageChangeProp);
  var resolvedFloorPlanId = floorPlanIdProp === null ? null : floorPlanIdProp === undefined ? RESERVATION_DEFAULT_FLOOR_PLAN_ID : floorPlanIdProp;

  // --- 引擎：locale、request、路由（新建预约）、勿将 pisellos 作 effect 依赖 ---

  var engineCtx = useEngineContext();
  var r = engineCtx === null || engineCtx === void 0 || (_engineCtx$appHelper = engineCtx.appHelper) === null || _engineCtx$appHelper === void 0 || (_engineCtx$appHelper = _engineCtx$appHelper.utils) === null || _engineCtx$appHelper === void 0 ? void 0 : _engineCtx$appHelper.request;
  request.setRequest(r !== null && r !== void 0 ? r : PREVIEW_HTTP_CLIENT);
  var pisellos = usePisellOS();
  /** 低代码里 context 常每次给新 `pisellos` 对象，勿把 `pisellos` 放进 effect 依赖 */
  var pisellosRef = useRef(pisellos);
  pisellosRef.current = pisellos;
  var hasPisellosGetModule = typeof (pisellos === null || pisellos === void 0 ? void 0 : pisellos.getModule) === 'function';
  var engineLocale = (engineCtx === null || engineCtx === void 0 || (_engineCtx$engine = engineCtx.engine) === null || _engineCtx$engine === void 0 || (_engineCtx$engine = _engineCtx$engine.props) === null || _engineCtx$engine === void 0 ? void 0 : _engineCtx$engine.locale) || 'zh-CN';
  var app = engineCtx === null || engineCtx === void 0 || (_engineCtx$appHelper2 = engineCtx.appHelper) === null || _engineCtx$appHelper2 === void 0 || (_engineCtx$appHelper2 = _engineCtx$appHelper2.utils) === null || _engineCtx$appHelper2 === void 0 || (_engineCtx$appHelper3 = _engineCtx$appHelper2.getApp) === null || _engineCtx$appHelper3 === void 0 ? void 0 : _engineCtx$appHelper3.call(_engineCtx$appHelper2);
  var router = app === null || app === void 0 || (_app$router = app.router) === null || _app$router === void 0 || (_app$router$getRoutes = _app$router.getRoutes) === null || _app$router$getRoutes === void 0 ? void 0 : _app$router$getRoutes.call(_app$router);
  var params = app === null || app === void 0 || (_app$history = app.history) === null || _app$history === void 0 || (_app$history$useParam = _app$history.useParams) === null || _app$history$useParam === void 0 ? void 0 : _app$history$useParam.call(_app$history);
  var BIZ = reservationBizProp !== null && reservationBizProp !== void 0 ? reservationBizProp : params === null || params === void 0 ? void 0 : params.business_code;

  /** 路由有 business_code 时，表格/平面图两路 booking 列表请求扁平带上 business_code */
  var bookingListBusinessCodeExtra = useMemo(function () {
    var s = BIZ != null && BIZ !== '' ? String(BIZ).trim() : '';
    if (!s) return {};
    return {
      business_code: s
    };
  }, [BIZ]);
  var _usePicoCodingOpenDat = usePicoCodingOpenData(engineCtx, BIZ),
    reservationRuleProduct = _usePicoCodingOpenDat.reservationRuleProduct,
    picoAssociatedMenuListIds = _usePicoCodingOpenDat.reservationAssociatedMenuListIds;
  var reservationAssociatedMenuListIds = associatedMenuListIdsProp !== null && associatedMenuListIdsProp !== void 0 ? associatedMenuListIdsProp : picoAssociatedMenuListIds;

  /**
   * effectiveFloorPlanCode：用作按 code 拉/创建店铺平面图的 code。
   * 优先级：路由 business_code → props.floorPlanCode → 兜底常量。
   * 当 GET 404 时 `ensureShopFloorPlanByCode` 会用同一 code 走 POST 兜底创建。
   */
  var effectiveFloorPlanCode = BIZ || floorPlanCode || PISELL_RESERVATION_FLOOR_PLAN_CODE;
  var muiDatePickerAdapterLocale = useMemo(function () {
    var loc = String(engineLocale).toLowerCase();
    if (loc.startsWith('zh-cn')) return 'zh-cn';
    if (loc.startsWith('zh-tw') || loc.startsWith('zh-hk')) return 'zh-tw';
    return 'en';
  }, [engineLocale]);
  var operatingDayBoundary = useMemo(function () {
    try {
      var _engineCtx$appHelper4, _engineCtx$appHelper5, _engineCtx$appHelper6, _store$getDataByModel;
      var store = engineCtx === null || engineCtx === void 0 || (_engineCtx$appHelper4 = engineCtx.appHelper) === null || _engineCtx$appHelper4 === void 0 || (_engineCtx$appHelper4 = _engineCtx$appHelper4.utils) === null || _engineCtx$appHelper4 === void 0 || (_engineCtx$appHelper5 = _engineCtx$appHelper4.getApp) === null || _engineCtx$appHelper5 === void 0 || (_engineCtx$appHelper5 = _engineCtx$appHelper5.call(_engineCtx$appHelper4)) === null || _engineCtx$appHelper5 === void 0 || (_engineCtx$appHelper5 = _engineCtx$appHelper5.data) === null || _engineCtx$appHelper5 === void 0 || (_engineCtx$appHelper5 = _engineCtx$appHelper5.store) === null || _engineCtx$appHelper5 === void 0 || (_engineCtx$appHelper6 = _engineCtx$appHelper5.getStore) === null || _engineCtx$appHelper6 === void 0 ? void 0 : _engineCtx$appHelper6.call(_engineCtx$appHelper5);
      var coreData = store === null || store === void 0 || (_store$getDataByModel = store.getDataByModel) === null || _store$getDataByModel === void 0 ? void 0 : _store$getDataByModel.call(store, 'core', 'core');
      var boundary = resolveOperatingDayBoundaryFromCoreModel(coreData);
      if (process.env.NODE_ENV !== 'production') {
        var coreSnapshot = coreData;
        try {
          coreSnapshot = JSON.parse(JSON.stringify(coreData));
        } catch (_unused) {
          coreSnapshot = coreData;
        }
        var rec = coreData;
        var underCore = (rec === null || rec === void 0 ? void 0 : rec.core) != null && _typeof(rec.core) === 'object' ? rec.core.operating_day_boundary : undefined;
        var onRoot = rec === null || rec === void 0 ? void 0 : rec.operating_day_boundary;
        // eslint-disable-next-line no-console -- 调试：打印引擎 store 中 core 模型返回值
        console.info('[PisellReservation][engine store getDataByModel("core","core")]', {
          hasStore: Boolean(store),
          coreSnapshot: coreSnapshot,
          operating_day_boundary_under_core: underCore,
          operating_day_boundary_on_model_root: onRoot,
          operating_day_boundary_RESOLVED: boundary
        });
      }
      return boundary;
    } catch (e) {
      if (process.env.NODE_ENV !== 'production') {
        // eslint-disable-next-line no-console
        console.warn('[PisellReservation][engine] read core / operating_day_boundary failed', e);
      }
      return undefined;
    }
  }, [engineCtx]);
  var timelineRangeFromCore = useMemo(function () {
    var range = timelineRangeFromOperatingDayBoundary(operatingDayBoundary);
    if (process.env.NODE_ENV !== 'production') {
      // eslint-disable-next-line no-console
      console.info('[PisellReservation][timeline] derived from operating_day_boundary', {
        operatingDayBoundary: operatingDayBoundary,
        timelineRangeFromCore: range
      });
    }
    return range;
  }, [operatingDayBoundary]);
  var effectiveTimelineRange = useMemo(function () {
    var fromProp = timeNavigatorPropsProp === null || timeNavigatorPropsProp === void 0 ? void 0 : timeNavigatorPropsProp.range;
    var effective = fromProp !== null && fromProp !== void 0 ? fromProp : timelineRangeFromCore;
    if (process.env.NODE_ENV !== 'production') {
      // eslint-disable-next-line no-console
      console.info('[PisellReservation][timeline] effective (timeNavigatorProps.range overrides core)', {
        timeNavigatorPropsRange: fromProp,
        effectiveTimelineRange: effective
      });
    }
    return effective;
  }, [timeNavigatorPropsProp === null || timeNavigatorPropsProp === void 0 ? void 0 : timeNavigatorPropsProp.range, timelineRangeFromCore]);
  useEffect(function () {
    var _engineCtx$appHelper7;
    var r = engineCtx === null || engineCtx === void 0 || (_engineCtx$appHelper7 = engineCtx.appHelper) === null || _engineCtx$appHelper7 === void 0 || (_engineCtx$appHelper7 = _engineCtx$appHelper7.utils) === null || _engineCtx$appHelper7 === void 0 ? void 0 : _engineCtx$appHelper7.request;
    if (r) {
      request.setRequest(r);
    }
  }, [engineCtx === null || engineCtx === void 0 || (_engineCtx$appHelper8 = engineCtx.appHelper) === null || _engineCtx$appHelper8 === void 0 || (_engineCtx$appHelper8 = _engineCtx$appHelper8.utils) === null || _engineCtx$appHelper8 === void 0 ? void 0 : _engineCtx$appHelper8.request]);
  locales.init(PISELL_RESERVATION_PAGE_LOCALES, engineLocale);
  var getGridBookingInitialSearchParams = useCallback(function () {
    return getGridTableBookingSearchParams(operatingDayBoundary, effectiveTimelineRange);
  }, [operatingDayBoundary, effectiveTimelineRange]);

  // --- 三套 booking 相关数据：表格列表 / 平面图绑定桌当日列表 / 远程 floor plan ---

  var resourceBoardData = usePisellReservationResourceTableData(isInternalListData);
  var gridBookingData = usePisellReservationBookingData(isInternalListData, {
    listPageSize: 50,
    getInitialSearchParams: getGridBookingInitialSearchParams,
    extraRequestParams: bookingListBusinessCodeExtra,
    /**
     * 必须为 false：与 `floorDayBookingData` 两路并发开 `osServer` 时，宿主侧常共用一个
     * booking 订阅槽或同 URL 请求互 abort，平面图那路 HTTP/推送会被挤掉，表现为 floor map 无预约。
     * 表格只信 HTTP；实时合并以 `floorDayBookingData`（带 form_record_ids）为准。
     */
    subscribeRealtimePush: true
  });

  /** 与 RecordBoard 当前子视图同步，用于资源墙下按所选资源切换 floorDayBooking 的 form_record_ids */
  var _useState = useState(function () {
      return readBodyViewFromStorageKey(bodyViewStorageKey);
    }),
    _useState2 = _slicedToArray(_useState, 2),
    shellBodyView = _useState2[0],
    setShellBodyView = _useState2[1];

  /** 锁定大屏子视图、显式 prop、或 Segmented 切到「大屏」：强制墙钟跟随且不可关 */
  var wallClockFollowLocked = useMemo(function () {
    return Boolean(forceFollowWallClockProp) || lockedBodyView === 'resourceWall' || shellBodyView === 'resourceWall';
  }, [forceFollowWallClockProp, lockedBodyView, shellBodyView]);
  var _useReservationFloorP = useReservationFloorPlan({
      resolvedFloorPlanId: resolvedFloorPlanId,
      effectiveFloorPlanCode: effectiveFloorPlanCode,
      gridDataSourceKey: gridDataSourceKey,
      floorMapConfigFromProp: floorMapProp === null || floorMapProp === void 0 ? void 0 : floorMapProp.floorMapConfig,
      engineLocale: engineLocale
    }),
    baseFloorConfig = _useReservationFloorP.baseFloorConfig,
    floorPlanRemoteId = _useReservationFloorP.floorPlanRemoteId,
    setRemoteFloorPlanView = _useReservationFloorP.setRemoteFloorPlanView;

  /**
   * 画布绑定 / 日历列：须与平面图实际 `sceneElements` 一致。
   * 勿直接用 `floorMapProp.floorMapConfig` 整块覆盖 `baseFloorConfig`：低代码常只传部分字段或
   * `sceneElements: []`，会盖掉 `useReservationFloorPlan` 已合并的远程布局，导致 form_record_ids 与
   * 日历画布 id 全空、三视图无数据。
   */
  var floorConfigForBindings = useMemo(function () {
    var _baseFloorConfig$scen;
    var patch = floorMapProp === null || floorMapProp === void 0 ? void 0 : floorMapProp.floorMapConfig;
    if (!patch) return baseFloorConfig;
    var patchScene = patch.sceneElements;
    var usePatchScene = Array.isArray(patchScene) && patchScene.length > 0;
    return _objectSpread(_objectSpread(_objectSpread({}, baseFloorConfig), patch), {}, {
      sceneElements: usePatchScene ? patchScene : (_baseFloorConfig$scen = baseFloorConfig.sceneElements) !== null && _baseFloorConfig$scen !== void 0 ? _baseFloorConfig$scen : patchScene
    });
  }, [floorMapProp === null || floorMapProp === void 0 ? void 0 : floorMapProp.floorMapConfig, baseFloorConfig]);
  var floorBoundFormRecordIds = useMemo(function () {
    return sceneElementsToBoundFormRecordIds(floorConfigForBindings.sceneElements, gridDataSourceKey);
  }, [floorConfigForBindings.sceneElements, gridDataSourceKey]);

  /** 资源墙筛选里选中的资源 id（与 grid 侧 searchParams.filter 同源） */
  var resourceWallFilterIdsForFloorBooking = useMemo(function () {
    if (!isInternalListData) return [];
    var sp = gridBookingData.searchParams;
    var fv = sp === null || sp === void 0 ? void 0 : sp.filter;
    if (!fv || _typeof(fv) !== 'object' || fv === null) return [];
    var vals = fv.values;
    if (!vals || _typeof(vals) !== 'object') return [];
    var raw = vals[DEFAULT_RESOURCE_WALL_FILTER_FIELD_KEY];
    if (!Array.isArray(raw)) return [];
    return raw.map(String).filter(Boolean);
  }, [isInternalListData, gridBookingData.searchParams]);

  /** 平面图：画布绑定 id；资源墙：所选资源 id（与画布一致走同一套 booking 推送 + mutate） */
  var floorBookingResourceReady = isInternalListData && !resourceBoardData.loading;
  var floorBookingExtraParams = useMemo(function () {
    var normalizeIds = function normalizeIds(ids) {
      var out = [];
      var _iterator = _createForOfIteratorHelper(ids),
        _step;
      try {
        for (_iterator.s(); !(_step = _iterator.n()).done;) {
          var id = _step.value;
          var t = String(id).trim();
          if (!t) continue;
          var n = Number(t);
          if (Number.isFinite(n) && n > 0 && /^\d+$/.test(t)) {
            out.push(Math.trunc(n));
          } else {
            out.push(t);
          }
        }
      } catch (err) {
        _iterator.e(err);
      } finally {
        _iterator.f();
      }
      return out;
    };
    if (shellBodyView === 'resourceWall' && resourceWallFilterIdsForFloorBooking.length > 0) {
      return _objectSpread(_objectSpread({}, bookingListBusinessCodeExtra), {}, {
        form_record_ids: normalizeIds(resourceWallFilterIdsForFloorBooking)
      });
    }
    return _objectSpread(_objectSpread({}, bookingListBusinessCodeExtra), {}, {
      form_record_ids: floorBoundFormRecordIds
    });
  }, [bookingListBusinessCodeExtra, shellBodyView, resourceWallFilterIdsForFloorBooking, floorBoundFormRecordIds]);
  var getFloorDayBookingInitialSearchParams = useCallback(function () {
    return getDefaultMonitorSearchParams(dayjs(), operatingDayBoundary, effectiveTimelineRange);
  }, [operatingDayBoundary, effectiveTimelineRange]);
  var floorDayBookingData = usePisellReservationBookingData(floorBookingResourceReady, {
    listPageSize: 9999,
    extraRequestParams: floorBookingExtraParams,
    getInitialSearchParams: getFloorDayBookingInitialSearchParams
  });
  var _getRelationTables = useRequest(getRelationTables);
  var bookingPerspectiveParams = useMemo(function () {
    return {
      relationTables: _getRelationTables.data
    };
  }, [_getRelationTables.data]);
  var bookingPerspective = useBookingPerspective(bookingPerspectiveParams);
  var runtimeContext = useMemo(function () {
    return {
      refresh: function refresh() {
        resourceBoardData.refresh();
        gridBookingData.refresh();
        floorDayBookingData.refresh();
      },
      refreshAsync: function () {
        var _refreshAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
          return _regeneratorRuntime().wrap(function _callee6$(_context6) {
            while (1) switch (_context6.prev = _context6.next) {
              case 0:
                _context6.next = 2;
                return Promise.all([resourceBoardData.refreshAsync(), gridBookingData.refreshAsync(), floorDayBookingData.refreshAsync()]);
              case 2:
              case "end":
                return _context6.stop();
            }
          }, _callee6);
        }));
        function refreshAsync() {
          return _refreshAsync.apply(this, arguments);
        }
        return refreshAsync;
      }(),
      currentPerspective: 'monitor'
    };
  }, [resourceBoardData.refresh, resourceBoardData.refreshAsync, gridBookingData.refresh, gridBookingData.refreshAsync, floorDayBookingData.refresh, floorDayBookingData.refreshAsync]);
  var bookingChildProps = useMemo(function () {
    var build = bookingPerspective.getChildComponentProps;
    return build ? build(runtimeContext) : {};
  }, [bookingPerspective, runtimeContext]);

  /** 预约 Monitor 列序 bump 专用 key，避免沿用旧 `column_order`（低代码 `__id` 派生） */
  var bookingColumnStorageKey = useMemo(function () {
    return resolveBookingMonitorColumnStorageKey(__id);
  }, [__id]);

  // --- 日程：schedule（UI）与 debouncedSchedule（接口/宿主）；sales 高光与合并行 ---

  var _useReservationSchedu = useReservationScheduleDebounced({
      scheduleValueProp: scheduleValueProp
    }),
    internalSchedule = _useReservationSchedu.internalSchedule,
    setInternalSchedule = _useReservationSchedu.setInternalSchedule,
    schedule = _useReservationSchedu.schedule,
    debouncedSchedule = _useReservationSchedu.debouncedSchedule,
    flushCommittedSchedule = _useReservationSchedu.flushCommittedSchedule,
    queueCommittedSchedule = _useReservationSchedu.queueCommittedSchedule;

  /**
   * 顶栏时间轴透传配置。
   *
   * 关于 `snapToStep`：预约场景下时间轴需要支持任意分钟（甚至秒级）的连续拖拽，
   * 不允许松手时把时间「吸附」回 0/15/30/45 等 step 刻度，否则会造成用户拖到 12:07
   * 松手后跳到 12:00 / 12:15 的体感断裂，并破坏与服务端原始时间戳的精度。
   *
   * 关于 `cursorMode`：桌面默认 `cursor-moves`；`variant="phone"` 时改为 `axis-moves`（拖刻度轴）。
   * 合并层始终强制 `snapToStep: false`，并覆盖 lowcode 误传的 `cursorMode`。
   * 下游 `PisellReservationSubcomponents` 中还会再按 `phoneLayout` 覆盖一次 cursorMode。
   *
   * 关于 `referenceDate`：`operating_day_boundary.type === 'end_time'` 时须与
   * `bookingTimeWindowForAnchorDay` 一致，锚到选中日 D−1，使 `getRangeBounds` 展开为
   * [D−1 界钟, D 界钟)；`start_time` 时为选中日 D。
   *
   * 因此这里在合并时**始终**写死 `snapToStep: false` 和 `cursorMode: 'cursor-moves'`，
   * 覆盖业务层（lowcode / 接入方）任何可能传入的相反值，作为整条链路的最外层强制关闭点。
   * 下游 `PisellReservationSubcomponents` 中还会再做一次同名兜底，
   * 避免新增中间层时因 spread 顺序失误把吸附 / axis-moves 打开。
   */
  var mergedTimeNavigatorProps = useMemo(function () {
    var _timeNavigatorPropsPr;
    /**
     * 用户当前查看的日历日 == 真实自然日 时，认为是在「今天」视图：
     * 此时把 `referenceDate` 留给 timeline 自动按 `now` 挑（pickReferenceDateContainingNow），
     * 这样无论 now 是 02:00（处于上一个营业日尾部）还是 14:00（当前营业日中段），
     * 时间轴窗口都能覆盖 now，橙色「现在」高亮永远可见；且 timeline 每分钟 tick 重算一次，
     * 跨过营业边界（如 04:00）时自动切到下一个营业日窗口。
     *
     * 用户在日历切到其它日期（看过去/未来某一天）时，仍按 `schedule.date` + 营业边界类型派生，
     * 不让自动逻辑把视图拉回今天。
     */
    var isViewingToday = dayjs(schedule.date).startOf('day').isSame(dayjs().startOf('day'), 'day');
    return _objectSpread(_objectSpread({}, timeNavigatorPropsProp !== null && timeNavigatorPropsProp !== void 0 ? timeNavigatorPropsProp : {}), {}, {
      range: effectiveTimelineRange,
      snapToStep: false,
      cursorMode: isPhoneLayout ? 'axis-moves' : 'cursor-moves',
      referenceDate: (_timeNavigatorPropsPr = timeNavigatorPropsProp === null || timeNavigatorPropsProp === void 0 ? void 0 : timeNavigatorPropsProp.referenceDate) !== null && _timeNavigatorPropsPr !== void 0 ? _timeNavigatorPropsPr : isViewingToday ? undefined : timelineReferenceDateForScheduleDay(schedule.date, operatingDayBoundary)
    });
  }, [timeNavigatorPropsProp, effectiveTimelineRange, schedule.date, operatingDayBoundary, isPhoneLayout]);
  var _useReservationWallCl = useReservationWallClockFollow(scheduleValueProp, setInternalSchedule, flushCommittedSchedule, onScheduleChange, wallClockFollowLocked),
    followWallClock = _useReservationWallCl.followWallClock,
    setFollowWallClock = _useReservationWallCl.setFollowWallClock,
    onFollowWallClockToggle = _useReservationWallCl.onFollowWallClockToggle,
    onTimeNavigatorUserInteraction = _useReservationWallCl.onTimeNavigatorUserInteraction;
  var _useReservationSalesH = useReservationSalesHostData({
      isInternalListData: isInternalListData,
      pisellosRef: pisellosRef,
      hasPisellosGetModule: hasPisellosGetModule,
      debouncedSchedule: debouncedSchedule,
      followWallClock: followWallClock,
      resourceBoardLoading: resourceBoardData.loading,
      floorDayBookingLoading: floorDayBookingData.loading,
      floorDayBookingData: floorDayBookingData.data,
      /**
       * 兜底：每次 WS 推送 mutate 都让 `floorDayBookingDataVersion` 自增，
       * 哪怕 cheap hash 没捕获到字段变化也能强制刷新宿主 sales 列表。
       */
      floorDayBookingDataVersion: floorDayBookingData.pushDataVersion,
      scheduleDate: schedule.date,
      timeNavigatorPropsProp: timeNavigatorPropsProp,
      timelineRange: effectiveTimelineRange,
      operatingDayBoundary: operatingDayBoundary
    }),
    salesResourceBookings = _useReservationSalesH.salesResourceBookings,
    salesTimelineHighlights = _useReservationSalesH.salesTimelineHighlights;

  /** 合并资源行 + 当日预约列表（接口已按画布 form_record_ids + 营业日窗约束，不按顶栏 at 游标筛） */
  var tables = useMemo(function () {
    return buildReservationMergedTableRows({
      dataSourcesProp: dataSourcesProp,
      gridDataSourceKey: gridDataSourceKey,
      isInternalListData: isInternalListData,
      resourceList: resourceBoardData.data,
      floorDayBookingList: floorDayBookingData.data,
      schedule: schedule,
      dataProp: dataProp,
      salesResourceBookings: salesResourceBookings
    });
  }, [dataSourcesProp, gridDataSourceKey, isInternalListData, resourceBoardData.data, floorDayBookingData.data, salesResourceBookings, dataProp]);

  /**
   * 日历列顺序：优先 sceneElements 绑定 id；若无（漏写 dataSourceKey、与 tables key 不一致等），
   * 回退到合并 tables 行 id，再回退到 floorDayBooking 中出现的 relation_id，避免画布有预约但日历全空。
   */
  var calendarOrderedResourceIds = useMemo(function () {
    var fromScene = orderedCanvasResourceRecordIdStrings(floorConfigForBindings.sceneElements, gridDataSourceKey);
    if (fromScene.length > 0) return fromScene;
    var fromTables = _toConsumableArray(new Set(tables.map(function (r) {
      return String(r.id);
    }).filter(function (id) {
      return id !== '' && id !== 'undefined' && id !== 'null';
    })));
    if (fromTables.length > 0) return fromTables;
    var fromBookings = new Set();
    var list = floorDayBookingData.data;
    if (Array.isArray(list)) {
      var _iterator2 = _createForOfIteratorHelper(list),
        _step2;
      try {
        for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
          var raw = _step2.value;
          if (!raw || _typeof(raw) !== 'object') continue;
          var _iterator3 = _createForOfIteratorHelper(extractResourceRecordIds(raw)),
            _step3;
          try {
            for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
              var id = _step3.value;
              if (id) fromBookings.add(id);
            }
          } catch (err) {
            _iterator3.e(err);
          } finally {
            _iterator3.f();
          }
        }
      } catch (err) {
        _iterator2.e(err);
      } finally {
        _iterator2.f();
      }
    }
    return _toConsumableArray(fromBookings);
  }, [floorConfigForBindings.sceneElements, gridDataSourceKey, tables, floorDayBookingData.data]);
  var calendarCanvasIdSet = useMemo(function () {
    return new Set(calendarOrderedResourceIds);
  }, [calendarOrderedResourceIds]);
  var calendarResources = useMemo(function () {
    return buildCalendarResourcesFromMergedTables({
      orderedResourceIds: calendarOrderedResourceIds,
      tables: tables
    });
  }, [calendarOrderedResourceIds, tables]);
  var calendarBookings = useMemo(function () {
    return mapFloorDayBookingsToCalendarItems({
      bookings: floorDayBookingData.data,
      canvasResourceIdSet: calendarCanvasIdSet
    });
  }, [floorDayBookingData.data, calendarCanvasIdSet]);
  var venueWallCards = useMemo(function () {
    return mapReservationRowsToVenueWallCards(tables);
  }, [tables]);

  /** 顶栏日程防抖落定后的时间键，避免 dayjs 引用抖动 */
  var debouncedScheduleKey = useMemo(function () {
    return "".concat(dayjs(debouncedSchedule.date).startOf('day').valueOf(), "_").concat(dayjs(debouncedSchedule.at).valueOf());
  }, [debouncedSchedule.date, debouncedSchedule.at]);

  // --- RecordBoard 视图：grid / floorMap；新建预约路由 ---

  var bodyViewRef = useRef(readBodyViewFromStorageKey(bodyViewStorageKey));
  var floorMapLayoutRef = useRef(null);
  var newReservationModalRef = useRef(null);
  var searchParamsRefControlled = useRef(searchParamsProp);
  useEffect(function () {
    searchParamsRefControlled.current = searchParamsProp;
  }, [searchParamsProp]);
  var onSearchRef = useRef(onSearchProp);
  var onScheduleChangeRef = useRef(onScheduleChange);
  /** 每帧同步，供 interval / effect 内调用最新 onSearch、onScheduleChange，避免闭包陈旧 */
  useEffect(function () {
    onSearchRef.current = onSearchProp;
    onScheduleChangeRef.current = onScheduleChange;
  });

  /**
   * `debouncedSchedule` 更新后执行（用户停手约 300ms 或 flush）：
   * - 内置列表：非日历视图下，将 floorDayBooking 的 `booking_time_start_between` 与时间轴营业窗对齐
   *   （「今天」用 pickReferenceDateContainingNow，与 TimeNavigator 一致；其它日仍按锚定营业日）；
   * - **日历视图**下可见区间由 `onViewportChange` → `mergeSearchParamsBookingRange` 维护；此处若再合并单日窗
   *   会在防抖后覆盖整月/整周区间；
   * - 外部 data + 当前 bodyView 为平面图：把 reservationDate/At 透传给外部 onSearch。
   */
  useEffect(function () {
    if (isInternalListData && bodyViewRef.current !== 'calendar') {
      var d = debouncedSchedule.date;
      floorDayBookingData.patchSearchParams(function (prevParams) {
        return mergeSearchParamsBookingWindow(prevParams, d, operatingDayBoundary, effectiveTimelineRange, dayjs());
      });
    }
    if ((bodyViewRef.current === 'floorMap' || bodyViewRef.current === 'calendar' || bodyViewRef.current === 'resourceWall') && !isInternalListData) {
      var _onSearchRef$current, _searchParamsRefContr;
      (_onSearchRef$current = onSearchRef.current) === null || _onSearchRef$current === void 0 || _onSearchRef$current.call(onSearchRef, _objectSpread(_objectSpread({}, (_searchParamsRefContr = searchParamsRefControlled.current) !== null && _searchParamsRefContr !== void 0 ? _searchParamsRefContr : {}), {}, {
        reservationDate: debouncedSchedule.date.toISOString(),
        reservationAt: debouncedSchedule.at.toISOString()
      }));
    }
  }, [debouncedSchedule, isInternalListData, floorDayBookingData.patchSearchParams, operatingDayBoundary, effectiveTimelineRange]);
  var handleScheduleChange = useCallback(function (next) {
    if (!wallClockFollowLocked) {
      setFollowWallClock(false);
    }
    if (scheduleValueProp === undefined) {
      setInternalSchedule(next);
    }
    onScheduleChange === null || onScheduleChange === void 0 || onScheduleChange(next);
    queueCommittedSchedule(next);
  }, [scheduleValueProp, onScheduleChange, setFollowWallClock, queueCommittedSchedule, wallClockFollowLocked]);

  // --- 平面图：合并 props、点击预约、HUD；RecordBoard loading 仅受控模式可选 ---

  /** 先展开外部 dataSources，再用合并后的 `tables` 覆盖同名 key，避免低代码默认的 `tables: []` 盖掉 resource+booking 合并结果 */
  var dataSources = useMemo(function () {
    return _objectSpread(_objectSpread({}, dataSourcesProp), {}, _defineProperty({}, gridDataSourceKey, tables));
  }, [gridDataSourceKey, tables, dataSourcesProp]);
  var isFloorModeControlled = (floorMapProp === null || floorMapProp === void 0 ? void 0 : floorMapProp.mode) !== undefined;
  var _useState3 = useState(false),
    _useState4 = _slicedToArray(_useState3, 2),
    mapEditInternal = _useState4[0],
    setMapEditInternal = _useState4[1];
  var effectiveMapMode = (_floorMapProp$mode = floorMapProp === null || floorMapProp === void 0 ? void 0 : floorMapProp.mode) !== null && _floorMapProp$mode !== void 0 ? _floorMapProp$mode : mapEditInternal ? 'edit' : 'read';
  var _useReservationHudDra = useReservationHudDrawer({
      floorMapHudTableDrawer: floorMapHudTableDrawer,
      dataSources: dataSources,
      gridDataSourceKey: gridDataSourceKey,
      isInternalListData: isInternalListData,
      floorDayBookingData: floorDayBookingData,
      searchParamsProp: searchParamsProp,
      dataProp: dataProp,
      loadingProp: loadingProp,
      bookingChildProps: bookingChildProps,
      resourceBoardData: resourceBoardData,
      phoneLayout: isPhoneLayout,
      hideViewportHudStats: isPhoneLayout && effectiveMapMode === 'edit'
    }),
    showVenueHudDock = _useReservationHudDra.showVenueHudDock,
    handleOpenHudTableDrawer = _useReservationHudDra.handleOpenHudTableDrawer,
    closeHudTableDrawer = _useReservationHudDra.closeHudTableDrawer,
    hudDrawerRef = _useReservationHudDra.hudDrawerRef,
    hudDrawerOpen = _useReservationHudDra.hudDrawerOpen,
    hudMapItems = _useReservationHudDra.hudMapItems,
    hudDrawerResourceRootBuckets = _useReservationHudDra.hudDrawerResourceRootBuckets,
    hudDrawerPagedRows = _useReservationHudDra.hudDrawerPagedRows,
    hudDrawerFilteredTotal = _useReservationHudDra.hudDrawerFilteredTotal,
    hudDrawerLoading = _useReservationHudDra.hudDrawerLoading,
    hudDrawerBookingPagination = _useReservationHudDra.hudDrawerBookingPagination,
    hudDrawerOnSearch = _useReservationHudDra.hudDrawerOnSearch,
    hudDrawerOnReset = _useReservationHudDra.hudDrawerOnReset,
    hudDrawerOnPageChange = _useReservationHudDra.hudDrawerOnPageChange,
    hudDrawerToolBar = _useReservationHudDra.hudDrawerToolBar,
    hudDrawerLocalSearchParams = _useReservationHudDra.hudDrawerLocalSearchParams,
    handleHudDrawerFormRecordIdsChange = _useReservationHudDra.handleHudDrawerFormRecordIdsChange,
    reservationFloorMapViewportOverlay = _useReservationHudDra.reservationFloorMapViewportOverlay,
    renderItemByKind = _useReservationHudDra.renderItemByKind;

  /**
   * 平面图操作栏「暗色背景」偏好：按门店/平面图 code 持久化到 localStorage（与视口/网格同维度）。
   * - 初值按当前 code 读盘；
   * - code 变化（切门店/平面图）时重读，避免停留在上一家的偏好；
   * - 切换时写回。
   */
  var _useState5 = useState(function () {
      return readReservationFloorMapAppearanceMode(effectiveFloorPlanCode);
    }),
    _useState6 = _slicedToArray(_useState5, 2),
    floorMapAppearanceMode = _useState6[0],
    setFloorMapAppearanceMode = _useState6[1];
  useEffect(function () {
    setFloorMapAppearanceMode(readReservationFloorMapAppearanceMode(effectiveFloorPlanCode));
  }, [effectiveFloorPlanCode]);
  var toggleFloorMapAppearanceMode = useCallback(function () {
    setFloorMapAppearanceMode(function (prev) {
      var next = prev === 'light' ? 'dark' : 'light';
      writeReservationFloorMapAppearanceMode(effectiveFloorPlanCode, next);
      return next;
    });
  }, [effectiveFloorPlanCode]);
  var _useFloorMapBookingIn = useFloorMapBookingInteraction({
      engineCtx: engineCtx,
      onFloorMapBookingClick: onFloorMapBookingClick,
      dataSources: dataSources,
      mergedTableRows: tables,
      reservationBiz: BIZ,
      resourceSelectMode: resourceSelectMode,
      associatedMenuListIds: reservationAssociatedMenuListIds,
      reservationRuleProduct: reservationRuleProduct
    }),
    bookingDetailOpen = _useFloorMapBookingIn.bookingDetailOpen,
    bookingDetailRaw = _useFloorMapBookingIn.bookingDetailRaw,
    bookingDetailRow = _useFloorMapBookingIn.bookingDetailRow,
    bookingDetailSceneName = _useFloorMapBookingIn.bookingDetailSceneName,
    closeBookingDetailModal = _useFloorMapBookingIn.closeBookingDetailModal,
    closeBookingDetailNow = _useFloorMapBookingIn.closeBookingDetailNow,
    floorMapItemClickBefore = _useFloorMapBookingIn.floorMapItemClickBefore,
    openBookingDetailFromRaw = _useFloorMapBookingIn.openBookingDetailFromRaw,
    readModeSelectedFloorItemId = _useFloorMapBookingIn.readModeSelectedFloorItemId;

  /**
   * 详情 Modal 内动作（complete / start / cancel 等）成功后：
   *
   * 1. 立刻同步关 Modal —— 不要先 `await refreshAsync()` 再关。否则在 refresh 期间
   *    `useFloorMapBookingInteraction` 里 `useEffect[bookingDetailOpen, mergedTableRows]`
   *    会用 `extractFloorMapSourceBookingForRow` 把 `bookingDetailRaw` 回灌成「completed
   *    新 raw」，弹窗内容再亮一帧；叠加 `closeBookingDetailModal` 的 50ms `setTimeout`
   *    与上层 `Modal.confirm` 的 fade out，all 视图下视觉上就成了「弹窗消失 → 又出现 → 再消失」。
   * 2. 走 `closeBookingDetailNow`（不带 50ms 延迟），程序化路径不存在 click 冒泡风险。
   * 3. 关完再去 refresh，`bookingDetailOpen=false` 后 effect 自然短路，回灌不会再发生。
   */
  var handleBookingDetailActionSuccess = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
    return _regeneratorRuntime().wrap(function _callee7$(_context7) {
      while (1) switch (_context7.prev = _context7.next) {
        case 0:
          closeBookingDetailNow();
          _context7.next = 3;
          return runtimeContext.refreshAsync();
        case 3:
        case "end":
          return _context7.stop();
      }
    }, _callee7);
  })), [closeBookingDetailNow, runtimeContext]);
  var _useReservationCalend = useReservationCalendarSlot({
      isInternalListData: isInternalListData,
      floorDayBookingData: floorDayBookingData,
      operatingDayBoundary: operatingDayBoundary,
      tables: tables,
      openBookingDetailFromRaw: openBookingDetailFromRaw,
      schedule: schedule,
      handleScheduleChange: handleScheduleChange,
      calendarResources: calendarResources,
      calendarBookings: calendarBookings,
      effectiveTimelineRange: effectiveTimelineRange,
      runtimeContext: runtimeContext
    }),
    reservationCalendarSlotProps = _useReservationCalend.reservationCalendarSlotProps,
    calendarGranularity = _useReservationCalend.calendarGranularity,
    setCalendarGranularity = _useReservationCalend.setCalendarGranularity;
  var floorMapMerged = useReservationFloorMapMerged({
    floorMapProp: floorMapProp,
    baseFloorConfig: baseFloorConfig,
    dataSources: dataSources,
    renderItemByKind: renderItemByKind,
    gridDataSourceKey: gridDataSourceKey,
    effectiveMapMode: effectiveMapMode,
    resolvedFloorPlanId: resolvedFloorPlanId,
    floorPlanRemoteId: floorPlanRemoteId,
    effectiveFloorPlanCode: effectiveFloorPlanCode,
    floorPlanCanvasWidth: floorPlanCanvasWidth,
    floorPlanCanvasHeight: floorPlanCanvasHeight,
    floorPlanName: floorPlanName,
    floorPlanSort: floorPlanSort,
    floorPlanStatus: floorPlanStatus,
    onFloorPlanPersisted: onFloorPlanPersisted,
    putFloorPlan: putFloorPlan,
    isFloorModeControlled: isFloorModeControlled,
    mapEditInternal: mapEditInternal,
    setMapEditInternal: setMapEditInternal,
    floorMapLayoutRef: floorMapLayoutRef,
    reservationFloorMapViewportOverlay: reservationFloorMapViewportOverlay,
    setRemoteFloorPlanView: setRemoteFloorPlanView,
    floorMapItemClickBefore: floorMapItemClickBefore,
    engineLocale: engineLocale,
    floorMapHudTableDrawer: floorMapHudTableDrawer,
    readModeSelectedItemId: readModeSelectedFloorItemId,
    editTopBarPhoneLayout: isPhoneLayout,
    appearanceMode: floorMapAppearanceMode,
    onToggleAppearanceMode: toggleFloorMapAppearanceMode
  });
  var data = isInternalListData ? gridBookingData.data : dataProp !== null && dataProp !== void 0 ? dataProp : [];
  /** 内置 booking 列表请求不展示 RecordBoard 全表 Spin；受控模式仍可用 props.loading */
  var loadingShown = useReservationLoadingShownDebounced(isInternalListData ? false : loadingProp !== null && loadingProp !== void 0 ? loadingProp : false);
  var total = isInternalListData ? gridBookingData.total : totalProp !== null && totalProp !== void 0 ? totalProp : 0;
  var pagination = isInternalListData ? gridBookingData.pagination : paginationProp !== null && paginationProp !== void 0 ? paginationProp : {
    pageNumber: 1,
    pageSize: PISELL_RESERVATION_DEFAULT_PAGE_SIZE
  };
  var onPageChange = isInternalListData ? gridBookingData.onPageChange : onPageChangeProp;
  var searchParams = isInternalListData ? gridBookingData.searchParams : searchParamsProp !== null && searchParamsProp !== void 0 ? searchParamsProp : {};
  var phoneGridInfiniteData = useReservationPhoneGridInfiniteData({
    enabled: isPhoneLayout,
    isInternalListData: isInternalListData,
    rowKey: rowKey,
    data: data,
    pagination: pagination,
    searchParams: searchParams
  });
  var recordBoardListData = isPhoneLayout ? phoneGridInfiniteData : data;
  var onGridBookingSearch = useCallback(function (params) {
    gridBookingData.onSearch(mergeGridBookingSearchParams(params));
  }, [gridBookingData.onSearch]);
  var onSearch = isInternalListData ? onGridBookingSearch : onSearchProp;
  var onReset = isInternalListData ? gridBookingData.onReset : onResetProp;
  var _useReservationResour = useReservationResourceWallPersist({
      bodyViewStorageKey: bodyViewStorageKey,
      isInternalListData: isInternalListData,
      searchParams: searchParams,
      onSearch: onSearch,
      venueWallCards: venueWallCards,
      floorDayBookingLoading: floorDayBookingData.loading
    }),
    venueWallAppearanceTheme = _useReservationResour.venueWallAppearanceTheme,
    setVenueWallAppearanceTheme = _useReservationResour.setVenueWallAppearanceTheme,
    venueWallAppearanceMode = _useReservationResour.venueWallAppearanceMode,
    setVenueWallAppearanceMode = _useReservationResour.setVenueWallAppearanceMode,
    venueWallResourceLayout = _useReservationResour.venueWallResourceLayout,
    setVenueWallResourceLayout = _useReservationResour.setVenueWallResourceLayout;
  useReservationDebugLoggers({
    isInternalListData: isInternalListData,
    resourceList: resourceBoardData.data,
    resourceListLoading: resourceBoardData.loading,
    salesResourceBookings: salesResourceBookings,
    debouncedScheduleKey: debouncedScheduleKey,
    debouncedSchedule: debouncedSchedule,
    gridBookingData: gridBookingData,
    floorDayBookingData: floorDayBookingData,
    tables: tables,
    dataProp: dataProp !== null && dataProp !== void 0 ? dataProp : undefined,
    dataSourcesProp: dataSourcesProp,
    gridDataSourceKey: gridDataSourceKey,
    floorConfigForBindings: floorConfigForBindings,
    floorBoundFormRecordIds: floorBoundFormRecordIds,
    shellBodyView: shellBodyView,
    calendarGranularity: calendarGranularity,
    schedule: schedule,
    effectiveTimelineRange: effectiveTimelineRange,
    calendarOrderedResourceIds: calendarOrderedResourceIds,
    calendarResources: calendarResources,
    calendarBookings: calendarBookings,
    venueWallCards: venueWallCards,
    searchParams: searchParams,
    floorBookingExtraParams: floorBookingExtraParams
  });

  // --- 顶栏工具栏（新建预约见 ReservationNewReservationModal） ---

  var _useReservationToolBa = useReservationToolBarMerged({
      toolBarProp: toolBarProp,
      bookingToolBar: bookingChildProps.toolBar,
      isInternalListData: isInternalListData,
      tables: tables,
      schedule: schedule,
      handleScheduleChange: handleScheduleChange,
      scheduleStartSlotProp: scheduleStartSlotProp,
      scheduleEndSlotProp: scheduleEndSlotProp,
      schedulePropsProp: schedulePropsProp,
      mergedTimeNavigatorProps: mergedTimeNavigatorProps,
      followWallClock: followWallClock,
      onFollowWallClockToggle: onFollowWallClockToggle,
      onTimeNavigatorUserInteraction: onTimeNavigatorUserInteraction,
      calendarGranularity: calendarGranularity,
      setCalendarGranularity: setCalendarGranularity,
      onNewReservation: function onNewReservation() {
        var _newReservationModalR;
        return (_newReservationModalR = newReservationModalRef.current) === null || _newReservationModalR === void 0 ? void 0 : _newReservationModalR.requestOpen();
      },
      salesTimelineHighlights: salesTimelineHighlights,
      floorDayBookingData: floorDayBookingData.data,
      data: data,
      effectiveTimelineRange: effectiveTimelineRange,
      phoneLayout: isPhoneLayout,
      bodyView: shellBodyView
    }),
    toolBarMerged = _useReservationToolBa.toolBarMerged;

  // --- 渲染：RecordBoard + 新建弹窗 + 平面图预约详情 + FAB ---

  var recordBoardGrid = useMemo(function () {
    return bookingChildProps.grid;
  }, [bookingChildProps.grid]);
  var mobileRecordBoardGrid = useMemo(function () {
    if (!isPhoneLayout || recordBoardGrid == null || _typeof(recordBoardGrid) !== 'object') {
      return recordBoardGrid;
    }
    return buildReservationMobileTableGridConfig(recordBoardGrid);
  }, [isPhoneLayout, recordBoardGrid]);

  /**
   * HUD 抽屉（Today sales）始终为窄抽屉（≤ 540px），即使主页面在桌面视口下也应使用手机布局；
   * 因此独立从 `recordBoardGrid` 派生 mobile 配置，不依赖 `isPhoneLayout`。
   */
  var hudDrawerMobileGrid = useMemo(function () {
    if (recordBoardGrid == null || _typeof(recordBoardGrid) !== 'object') {
      return recordBoardGrid;
    }
    return buildReservationMobileTableGridConfig(recordBoardGrid);
  }, [recordBoardGrid]);

  /**
   * HUD 内嵌表：小号密度 + 无限滚动；列宽由 `buildReservationMobileTableGridConfig`
   *（`adaptColumnsForPhoneLayout` + 列 key 上限）统一收窄，勿在 HUD 层二次缩放。
   */
  var hudDrawerGrid = useMemo(function () {
    var g = hudDrawerMobileGrid;
    var scrollBase = g != null && _typeof(g) === 'object' && 'scroll' in g && g.scroll != null && _typeof(g.scroll) === 'object' ? _objectSpread({}, g.scroll) : {};
    if (g == null || _typeof(g) !== 'object') {
      return {
        size: 'small',
        infiniteScroll: true,
        scroll: _objectSpread(_objectSpread({}, scrollBase), {}, {
          autoCalc: true
        })
      };
    }
    return _objectSpread(_objectSpread({}, g), {}, {
      size: 'small',
      infiniteScroll: true,
      scroll: _objectSpread(_objectSpread({}, scrollBase), {}, {
        autoCalc: true
      })
    });
  }, [hudDrawerMobileGrid]);
  var fillHeight = (_scroll$autoCalc = mobileRecordBoardGrid === null || mobileRecordBoardGrid === void 0 || (_scroll = mobileRecordBoardGrid.scroll) === null || _scroll === void 0 ? void 0 : _scroll.autoCalc) !== null && _scroll$autoCalc !== void 0 ? _scroll$autoCalc : true;
  var reservationResourceWallSlotProps = useMemo(function () {
    return {
      cards: venueWallCards,
      loading: floorDayBookingData.loading,
      filterFieldKey: DEFAULT_RESOURCE_WALL_FILTER_FIELD_KEY,
      appearanceTheme: venueWallAppearanceTheme,
      onAppearanceThemeChange: setVenueWallAppearanceTheme,
      appearanceMode: venueWallAppearanceMode,
      onAppearanceModeChange: setVenueWallAppearanceMode,
      resourceWallLayout: venueWallResourceLayout,
      onResourceWallLayoutChange: setVenueWallResourceLayout
    };
  }, [venueWallCards, floorDayBookingData.loading, venueWallAppearanceTheme, venueWallAppearanceMode, venueWallResourceLayout]);
  return /*#__PURE__*/React.createElement(LocalizationProvider, {
    dateAdapter: AdapterDayjs,
    adapterLocale: muiDatePickerAdapterLocale
  }, /*#__PURE__*/React.createElement("div", {
    className: classNames('pisell-reservation-page', isPhoneLayout && 'pisell-reservation-page--phone', className),
    style: style
  }, /*#__PURE__*/React.createElement(PisellRecordBoard, _extends({}, rest, {
    columnVisibilityStorageKey: bookingColumnStorageKey,
    layoutVariant: isPhoneLayout ? 'phone' : 'default',
    fillHeight: fillHeight,
    rowKey: rowKey,
    data: recordBoardListData,
    dataSources: dataSources,
    loading: loadingShown,
    total: total,
    pagination: pagination,
    onPageChange: onPageChange,
    searchParams: searchParams,
    onSearch: onSearch,
    onReset: onReset,
    grid: mobileRecordBoardGrid,
    toolBar: toolBarMerged,
    search: bookingChildProps.search,
    batchActionBar: bookingChildProps.batchActionBar,
    floorMap: floorMapMerged,
    calendar: reservationCalendarSlotProps,
    resourceWall: reservationResourceWallSlotProps,
    defaultBodyView: "floorMap",
    bodyViewStorageKey: bodyViewStorageKey,
    bodyViewSwitchable: bodyViewSwitchable,
    lockedBodyView: lockedBodyView,
    floorMapLayoutRef: floorMapLayoutRef
  }), /*#__PURE__*/React.createElement(RecordBoardBodyViewCapture, {
    bodyViewRef: bodyViewRef,
    onBodyViewChange: setShellBodyView
  }), /*#__PURE__*/React.createElement(ScheduleSyncOnFloorEnter, {
    schedule: schedule,
    isInternalListData: isInternalListData,
    patchSearchParams: floorDayBookingData.patchSearchParams,
    operatingDayBoundary: operatingDayBoundary,
    timelineRange: effectiveTimelineRange
  }), /*#__PURE__*/React.createElement(PisellRecordBoard.ShellFrame, null, /*#__PURE__*/React.createElement(PisellRecordBoard.GridLayout, null), /*#__PURE__*/React.createElement(PisellRecordBoard.FloorMap, null), /*#__PURE__*/React.createElement(PisellRecordBoard.Calendar, reservationCalendarSlotProps), /*#__PURE__*/React.createElement(PisellRecordBoard.ResourceWall, null))), /*#__PURE__*/React.createElement(ReservationNewReservationModal, {
    ref: newReservationModalRef,
    router: router,
    app: app
  }), /*#__PURE__*/React.createElement(ReservationBookingDetailModal, {
    open: bookingDetailOpen,
    onClose: closeBookingDetailModal,
    onActionSuccess: handleBookingDetailActionSuccess,
    raw: bookingDetailRaw,
    tableRow: bookingDetailRow,
    sceneElementName: bookingDetailSceneName,
    reservationBiz: BIZ,
    associatedMenuListIds: reservationAssociatedMenuListIds,
    reservationRuleProduct: reservationRuleProduct
    /**
     * 平面图当日全量预约列表 + 时间游标，透传给宿主 `getResourceBookingItem` 用作
     * `bookingList / currentTime / deviceTime`。`followWallClock` 与
     * `getResourceBookingList` 同源：跟随墙钟时 `deviceTime` 与 `currentTime` 一致，
     * 否则 `deviceTime` 走实时设备时间。
     */,
    floorDayBookingList: floorDayBookingData.data,
    currentTime: debouncedSchedule.at,
    followWallClock: followWallClock
  }), fab ? /*#__PURE__*/React.createElement("div", {
    className: "pisell-reservation-fab"
  }, fab) : null, /*#__PURE__*/React.createElement(ReservationHudDrawer, {
    floorMapHudTableDrawer: floorMapHudTableDrawer,
    showVenueHudDock: showVenueHudDock,
    hudDrawerOpen: hudDrawerOpen,
    hudDrawerRef: hudDrawerRef,
    hudMapItems: hudMapItems,
    dataSources: dataSources,
    handleOpenHudTableDrawer: handleOpenHudTableDrawer,
    closeHudTableDrawer: closeHudTableDrawer,
    rowKey: rowKey,
    hudDrawerPagedRows: hudDrawerPagedRows,
    hudDrawerLoading: hudDrawerLoading,
    hudDrawerFilteredTotal: hudDrawerFilteredTotal,
    hudDrawerBookingPagination: hudDrawerBookingPagination,
    hudDrawerOnPageChange: hudDrawerOnPageChange,
    hudDrawerLocalSearchParams: hudDrawerLocalSearchParams,
    hudDrawerOnSearch: hudDrawerOnSearch,
    hudDrawerOnReset: hudDrawerOnReset,
    hudDrawerGrid: hudDrawerGrid,
    hudDrawerToolBar: hudDrawerToolBar,
    batchActionBar: bookingChildProps.batchActionBar,
    hudDrawerResourceRootBuckets: hudDrawerResourceRootBuckets,
    handleHudDrawerFormRecordIdsChange: handleHudDrawerFormRecordIdsChange
  })));
};