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/pisellRecordBoard/shellFrame/Calendar/modal/BookingCalendarBlockPanel.tsx
var BookingCalendarBlockPanel_exports = {};
__export(BookingCalendarBlockPanel_exports, {
  BookingCalendarBlockPanel: () => BookingCalendarBlockPanel
});
module.exports = __toCommonJS(BookingCalendarBlockPanel_exports);
var import_react = __toESM(require("react"));
var import_antd = require("antd");
var import_icons = require("@ant-design/icons");
var import_calendarI18n = require("../calendarI18n");
var { RangePicker } = import_antd.DatePicker;
function BookingCalendarBlockPanel({
  blockPanelRef,
  isLight,
  blockFormName,
  setBlockFormName,
  blockModalNote,
  setBlockModalNote,
  blockResourceId,
  setBlockResourceId,
  blockTimeRange,
  setBlockTimeRange,
  resolvedSlotMinutes,
  visibleCourts,
  blockSaving,
  onClose,
  onSave
}) {
  return /* @__PURE__ */ import_react.default.createElement("div", { className: "fixed inset-0 z-50 bg-black/55 backdrop-blur-sm flex items-end md:items-center justify-center p-2 md:p-4" }, /* @__PURE__ */ import_react.default.createElement(
    "div",
    {
      ref: blockPanelRef,
      className: `w-full max-w-[720px] max-h-[92vh] overflow-y-auto rounded-t-3xl md:rounded-3xl border p-4 md:p-6 shadow-2xl ${isLight ? "theme-panel theme-border soft-shadow" : "border-zinc-700 bg-[#121217]"}`
    },
    /* @__PURE__ */ import_react.default.createElement("div", { className: "mb-4 flex items-center justify-between gap-3" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "text-xl font-semibold" }, (0, import_calendarI18n.tCal)("pisell2.recordBoard.calendar.block.panelTitle")), /* @__PURE__ */ import_react.default.createElement(
      "button",
      {
        type: "button",
        "aria-label": (0, import_calendarI18n.tCal)("pisell2.recordBoard.calendar.block.closeAria"),
        onClick: onClose,
        className: `rounded-xl p-2 ${isLight ? "btn-neutral" : "border border-zinc-700 text-zinc-300"}`
      },
      /* @__PURE__ */ import_react.default.createElement(import_icons.CloseOutlined, { style: { fontSize: 20 } })
    )),
    /* @__PURE__ */ import_react.default.createElement(
      "div",
      {
        className: `space-y-4 rounded-2xl border p-4 ${isLight ? "theme-panel-alt theme-border" : "border-zinc-700 bg-[#171820]"}`
      },
      /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
        "label",
        {
          className: `mb-2 block text-sm ${isLight ? "theme-text-muted" : "text-zinc-400"}`
        },
        (0, import_calendarI18n.tCal)("pisell2.recordBoard.calendar.block.fieldTitle")
      ), /* @__PURE__ */ import_react.default.createElement(
        "input",
        {
          value: blockFormName,
          onChange: (e) => setBlockFormName(e.target.value),
          placeholder: (0, import_calendarI18n.tCal)(
            "pisell2.recordBoard.calendar.block.placeholderTitle"
          ),
          className: `w-full rounded-xl px-3 py-2 outline-none ${isLight ? "theme-input theme-text" : "border border-zinc-700 bg-[#111218] text-white"}`
        }
      )),
      /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
        "label",
        {
          className: `mb-2 block text-sm ${isLight ? "theme-text-muted" : "text-zinc-400"}`
        },
        "备注"
      ), /* @__PURE__ */ import_react.default.createElement(
        "input",
        {
          value: blockModalNote,
          onChange: (e) => setBlockModalNote(e.target.value),
          placeholder: "选填",
          className: `w-full rounded-xl px-3 py-2 outline-none ${isLight ? "theme-input theme-text" : "border border-zinc-700 bg-[#111218] text-white"}`
        }
      )),
      /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
        "label",
        {
          className: `mb-2 block text-sm ${isLight ? "theme-text-muted" : "text-zinc-400"}`
        },
        (0, import_calendarI18n.tCal)("pisell2.recordBoard.calendar.block.fieldResource")
      ), /* @__PURE__ */ import_react.default.createElement(
        "select",
        {
          value: blockResourceId,
          onChange: (e) => setBlockResourceId(e.target.value),
          className: `w-full rounded-xl px-3 py-2 outline-none ${isLight ? "theme-input theme-text" : "border border-zinc-700 bg-[#111218] text-white"}`
        },
        /* @__PURE__ */ import_react.default.createElement("option", { value: "" }, (0, import_calendarI18n.tCal)("pisell2.recordBoard.calendar.block.noResource")),
        visibleCourts.map((c) => /* @__PURE__ */ import_react.default.createElement("option", { key: c.id, value: String(c.id) }, c.name))
      )),
      /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
        "label",
        {
          className: `mb-2 block text-sm ${isLight ? "theme-text-muted" : "text-zinc-400"}`
        },
        (0, import_calendarI18n.tCal)("pisell2.recordBoard.calendar.block.fieldTimeRange")
      ), /* @__PURE__ */ import_react.default.createElement(
        RangePicker,
        {
          ...{
            style: { width: "100%" },
            showTime: {
              format: "HH:mm",
              minuteStep: resolvedSlotMinutes >= 60 ? 60 : Math.max(1, resolvedSlotMinutes)
            },
            format: "YYYY-MM-DD HH:mm",
            value: blockTimeRange ?? void 0,
            onChange: (v) => setBlockTimeRange(v ?? null)
          }
        }
      ))
    ),
    /* @__PURE__ */ import_react.default.createElement("div", { className: "mt-6 flex flex-col-reverse sm:flex-row items-stretch sm:items-center justify-end gap-3" }, /* @__PURE__ */ import_react.default.createElement(
      "button",
      {
        type: "button",
        disabled: blockSaving,
        onClick: onClose,
        className: `rounded-xl px-4 py-2 ${isLight ? "btn-neutral" : "border border-zinc-700 text-zinc-300"}`
      },
      (0, import_calendarI18n.tCal)("pisell2.recordBoard.calendar.common.cancel")
    ), /* @__PURE__ */ import_react.default.createElement(
      "button",
      {
        type: "button",
        disabled: blockSaving,
        onClick: () => void onSave(),
        className: `rounded-xl px-5 py-3 text-sm font-semibold disabled:opacity-50 ${isLight ? "btn-brand" : "bg-violet-600 text-white"}`
      },
      blockSaving ? (0, import_calendarI18n.tCal)("pisell2.recordBoard.calendar.common.saving") : (0, import_calendarI18n.tCal)("pisell2.recordBoard.calendar.common.save")
    ))
  ));
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  BookingCalendarBlockPanel
});
