'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
var iconsVue = require('@ant-design/icons-vue');
require('../../../utils/index.cjs');
require('../../../locale/index.cjs');
require('../../../vue-components/index.cjs');
require('../../../hooks/index.cjs');
var useConfigInject = require('../../config-provider/src/hooks/useConfigInject.cjs');
require('../../locale-provider/index.cjs');
var index = require('../style/index.cjs');
var props = require('./props.cjs');
var Select = require('./Select.cjs');
var index$1 = require('../../../hooks/use-breakpoint/index.cjs');
var useLocaleReceiver = require('../../locale-provider/src/useLocaleReceiver.cjs');
var en_US = require('../../../locale/lang/en_US.cjs');
var _class = require('../../../utils/dom/class.cjs');
var Pagination = require('../../../vue-components/vc-pagination/src/Pagination.cjs');

var pagination = /* @__PURE__ */ vue.defineComponent({
  compatConfig: {
    MODE: 3
  },
  name: "APagination",
  inheritAttrs: false,
  props: props.paginationProps(),
  // emits: ['change', 'showSizeChange', 'update:current', 'update:pageSize'],
  setup(props, {
    slots,
    attrs
  }) {
    const {
      prefixCls,
      configProvider,
      direction,
      size
    } = useConfigInject.default("pagination", props);
    const [wrapSSR, hashId] = index.default(prefixCls);
    const selectPrefixCls = vue.computed(() => configProvider.getPrefixCls("select", props.selectPrefixCls));
    const breakpoint = index$1.useBreakpoint();
    const [locale] = useLocaleReceiver.useLocaleReceiver("Pagination", en_US.default.Pagination, vue.toRef(props, "locale"));
    const getIconsProps = (pre) => {
      const ellipsis = vue.createVNode("span", {
        "class": `${pre}-item-ellipsis`
      }, [vue.createTextVNode("\u2022\u2022\u2022")]);
      const prevIcon = vue.createVNode("button", {
        "class": `${pre}-item-link`,
        "type": "button",
        "tabindex": -1
      }, [direction.value === "rtl" ? vue.createVNode(iconsVue.RightOutlined, null, null) : vue.createVNode(iconsVue.LeftOutlined, null, null)]);
      const nextIcon = vue.createVNode("button", {
        "class": `${pre}-item-link`,
        "type": "button",
        "tabindex": -1
      }, [direction.value === "rtl" ? vue.createVNode(iconsVue.LeftOutlined, null, null) : vue.createVNode(iconsVue.RightOutlined, null, null)]);
      const jumpPrevIcon = vue.createVNode("a", {
        "rel": "nofollow",
        "class": `${pre}-item-link`
      }, [vue.createVNode("div", {
        "class": `${pre}-item-container`
      }, [direction.value === "rtl" ? vue.createVNode(iconsVue.DoubleRightOutlined, {
        "class": `${pre}-item-link-icon`
      }, null) : vue.createVNode(iconsVue.DoubleLeftOutlined, {
        "class": `${pre}-item-link-icon`
      }, null), ellipsis])]);
      const jumpNextIcon = vue.createVNode("a", {
        "rel": "nofollow",
        "class": `${pre}-item-link`
      }, [vue.createVNode("div", {
        "class": `${pre}-item-container`
      }, [direction.value === "rtl" ? vue.createVNode(iconsVue.DoubleLeftOutlined, {
        "class": `${pre}-item-link-icon`
      }, null) : vue.createVNode(iconsVue.DoubleRightOutlined, {
        "class": `${pre}-item-link-icon`
      }, null), ellipsis])]);
      return {
        prevIcon,
        nextIcon,
        jumpPrevIcon,
        jumpNextIcon
      };
    };
    return () => {
      var _a;
      const {
        itemRender = slots.itemRender,
        buildOptionText = slots.buildOptionText,
        selectComponentClass,
        responsive,
        ...restProps
      } = props;
      const isSmall = size.value === "small" || !!(((_a = breakpoint.value) == null ? void 0 : _a.xs) && !size.value && responsive);
      const paginationProps2 = {
        ...restProps,
        ...getIconsProps(prefixCls.value),
        prefixCls: prefixCls.value,
        selectPrefixCls: selectPrefixCls.value,
        selectComponentClass: selectComponentClass || (isSmall ? Select.MiniSelect : Select.MiddleSelect),
        locale: locale.value,
        buildOptionText,
        ...attrs,
        class: _class.classNames({
          [`${prefixCls.value}-mini`]: isSmall,
          [`${prefixCls.value}-rtl`]: direction.value === "rtl"
        }, attrs.class, hashId.value),
        itemRender
      };
      return wrapSSR(vue.createVNode(Pagination.default, paginationProps2, null));
    };
  }
});

exports.default = pagination;
//# sourceMappingURL=Pagination.cjs.map
