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 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); }
/**
 * 日视图 / 周视图共用的分组头左侧 sticky 单元（折叠箭头 + 分组名 + 数量角标）。
 * 样式单点维护，与 {@link buildGroupedCourtRows} 的 group 行对应。
 */
import React from 'react';
import { DownOutlined } from '@ant-design/icons';
/** 左侧分组列：周与日共用同一套 gradient / 字号 / 角标，避免分叉维护 */
var STICKY_GROUP_SHELL = 'sticky left-0 z-30 flex h-full min-h-0 w-[132px] min-w-[132px] max-w-[132px] items-center border-b px-2 py-1 shadow-[8px_0_16px_rgba(0,0,0,0.08)]';
var STICKY_GROUP_LIGHT = 'border-slate-200 bg-gradient-to-b from-slate-100 to-slate-50';
var STICKY_GROUP_DARK = 'border-zinc-800/80 bg-gradient-to-b from-[#252038] to-[#1a1628]';
export function BookingCalendarGroupRowHeader(props) {
  var isLight = props.isLight,
    view = props.view,
    row = props.row,
    renderResourceCell = props.renderResourceCell,
    setCollapsedGroups = props.setCollapsedGroups,
    style = props.style;
  return /*#__PURE__*/React.createElement("div", {
    className: "".concat(STICKY_GROUP_SHELL, " ").concat(isLight ? STICKY_GROUP_LIGHT : STICKY_GROUP_DARK),
    style: style
  }, renderResourceCell ? renderResourceCell({
    view: view,
    row: {
      kind: 'group',
      id: row.id,
      label: row.label,
      count: row.count,
      collapsed: row.collapsed
    },
    isLight: isLight,
    onToggleGroup: function onToggleGroup(label) {
      return setCollapsedGroups(function (prev) {
        return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, label, !prev[label]));
      });
    }
  }) : /*#__PURE__*/React.createElement("button", {
    type: "button",
    "aria-expanded": !row.collapsed,
    onClick: function onClick() {
      return setCollapsedGroups(function (prev) {
        return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, row.label, !prev[row.label]));
      });
    },
    className: "flex w-full min-h-0 items-center gap-2 rounded-lg px-1 py-0.5 text-left transition-colors ".concat(isLight ? '' : 'active:bg-white/[0.07]')
  }, /*#__PURE__*/React.createElement(DownOutlined, {
    style: {
      fontSize: 14
    },
    className: "shrink-0 self-center transition-transform duration-200 ".concat(isLight ? 'text-slate-500' : 'text-zinc-500', " ").concat(row.collapsed ? '-rotate-90' : 'rotate-0'),
    "aria-hidden": true
  }), /*#__PURE__*/React.createElement("div", {
    className: "flex min-h-0 min-w-0 flex-1 items-center gap-1.5"
  }, /*#__PURE__*/React.createElement("span", {
    className: "pisell-rb-cal-week-resource-name min-w-0 flex-1 truncate text-[13px] font-semibold leading-snug ".concat(isLight ? 'text-slate-800' : 'text-zinc-100')
  }, row.label), /*#__PURE__*/React.createElement("span", {
    className: "shrink-0 rounded-md px-1.5 py-0.5 text-[10px] font-semibold tabular-nums ".concat(isLight ? 'bg-violet-100 text-violet-800' : 'bg-zinc-800/90 text-zinc-300 ring-1 ring-zinc-600/40')
  }, row.count))));
}