var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarAxis.ts
var bookingCalendarAxis_exports = {};
__export(bookingCalendarAxis_exports, {
  dayGridUnit: () => dayGridUnit,
  mapAxisSpan: () => mapAxisSpan,
  resolveTickFillMode: () => resolveTickFillMode
});
module.exports = __toCommonJS(bookingCalendarAxis_exports);
var EPS = 1e-9;
function mapAxisSpan(axis, startUnit, endUnit, mode) {
  let s = startUnit - axis.originUnit;
  let e = Math.max(startUnit, endUnit) - axis.originUnit;
  if (mode === "snap") {
    const t = axis.tickUnit > 0 ? axis.tickUnit : 1;
    s = Math.floor(s / t + EPS) * t;
    e = Math.ceil(e / t - EPS) * t;
    if (e <= s) e = s + t;
  }
  const offset = s * axis.scalePerUnit;
  const size = Math.max(axis.minSize, (e - s) * axis.scalePerUnit);
  return { offset, size };
}
function dayGridUnit(colIndex, hour, dayGridMin, dayGridSpan) {
  if (dayGridSpan <= 0) return colIndex;
  let rel = (hour - dayGridMin) % 24;
  if (rel < 0) rel += 24;
  const frac = Math.min(1, Math.max(0, rel / dayGridSpan));
  return colIndex + frac;
}
var VIEW_DEFAULT_FILL_MODE = {
  day: "proportional",
  week: "snap",
  resource: "snap",
  month: "snap"
};
function resolveTickFillMode(view, override) {
  return override ?? VIEW_DEFAULT_FILL_MODE[view];
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  dayGridUnit,
  mapAxisSpan,
  resolveTickFillMode
});
