"use client";
'use strict';

var clsx = require('clsx');
var tailwindMerge = require('tailwind-merge');
var pressable = require('@page-speed/pressable');
var React = require('react');
var icon = require('@page-speed/icon');
var jsxRuntime = require('react/jsx-runtime');

function _interopNamespace(e) {
  if (e && e.__esModule) return e;
  var n = Object.create(null);
  if (e) {
    Object.keys(e).forEach(function (k) {
      if (k !== 'default') {
        var d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: function () { return e[k]; }
        });
      }
    });
  }
  n.default = e;
  return Object.freeze(n);
}

var React__namespace = /*#__PURE__*/_interopNamespace(React);

function cn(...inputs) {
  return tailwindMerge.twMerge(clsx.clsx(inputs));
}
var DEFAULT_ICON_API_KEY = "au382bi7fsh96w9h9xlrnat2jglx";
var DynamicIcon = React__namespace.memo(function DynamicIcon2({
  apiKey,
  ...props
}) {
  return /* @__PURE__ */ jsxRuntime.jsx(icon.Icon, { ...props, apiKey: apiKey ?? DEFAULT_ICON_API_KEY });
});
DynamicIcon.displayName = "DynamicIcon";
var BUTTON_SIZES = {
  sm: { buttonSize: "size-8", iconSize: 16 },
  md: { buttonSize: "size-10", iconSize: 20 },
  lg: { buttonSize: "size-12", iconSize: 24 },
  xl: { buttonSize: "size-14", iconSize: 28 }
};
function CarouselPagination({
  onPrevious,
  onNext,
  canScrollPrevious = true,
  canScrollNext = true,
  size = "md",
  mobileSize,
  iconSize: customIconSize,
  className,
  buttonClassName,
  previousIcon = "lucide/arrow-left",
  nextIcon = "lucide/arrow-right",
  previousAriaLabel = "Previous",
  nextAriaLabel = "Next"
}) {
  const desktopConfig = BUTTON_SIZES[size];
  const mobileConfig = mobileSize ? BUTTON_SIZES[mobileSize] : desktopConfig;
  const sizeClasses = mobileSize && mobileSize !== size ? `${mobileConfig.buttonSize} md:${desktopConfig.buttonSize}` : desktopConfig.buttonSize;
  const effectiveIconSize = customIconSize ?? desktopConfig.iconSize;
  const baseButtonStyles = cn(
    "relative z-40 flex items-center justify-center",
    "aspect-square !p-0 rounded-full",
    // Force perfect circle
    sizeClasses,
    "disabled:opacity-50",
    buttonClassName
  );
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex justify-end gap-2", className), children: [
    /* @__PURE__ */ jsxRuntime.jsx(
      pressable.Pressable,
      {
        onClick: onPrevious,
        disabled: !canScrollPrevious,
        "aria-label": previousAriaLabel,
        asButton: true,
        className: baseButtonStyles,
        children: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: previousIcon, size: effectiveIconSize })
      }
    ),
    /* @__PURE__ */ jsxRuntime.jsx(
      pressable.Pressable,
      {
        onClick: onNext,
        disabled: !canScrollNext,
        "aria-label": nextAriaLabel,
        asButton: true,
        className: baseButtonStyles,
        children: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: nextIcon, size: effectiveIconSize })
      }
    )
  ] });
}

exports.CAROUSEL_PAGINATION_SIZES = BUTTON_SIZES;
exports.CarouselPagination = CarouselPagination;
