import { j as e } from "../../../../_virtual/jsx-runtime.js";
import { getId as f } from "../../../../utils/index.js";
import { Chip as A } from "../../../Chip/Chip.js";
import { YEARS_TO_DISPLAY as h } from "../../dateUtils.js";
import { PeriodWrapper as j, PeriodName as _ } from "../../styles.js";
function g({
  width: a,
  height: i,
  currentYear: o,
  minimumYear: m,
  maximumYear: p,
  "data-testid": s,
  updateCurrentYear: d
}) {
  const l = f(s), n = (r) => {
    d(r);
  }, c = (r) => r >= (m || Number.MIN_VALUE) && r <= (p || Number.MAX_VALUE);
  return /* @__PURE__ */ e.jsx(j, { style: { width: a, height: i }, "data-testid": s, children: [...Array(h)].map((r, t) => /* @__PURE__ */ e.jsx(_, { children: /* @__PURE__ */ e.jsx(
    A,
    {
      selected: t === 0,
      onClick: () => n(t + o),
      label: `${t + o}`,
      disabled: !c(t + o),
      variant: "ghost",
      "data-testid": l(`chip-${t}`)
    }
  ) }, t)) });
}
export {
  g as Year
};
