import "../styles/reset.css";
import "./pagination.less";
import { PropTypes as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__, classes as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_classes__, withInstall as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_withInstall__ } from "../shared";
import { computed as __WEBPACK_EXTERNAL_MODULE_vue_computed__, createTextVNode as __WEBPACK_EXTERNAL_MODULE_vue_createTextVNode__, createVNode as __WEBPACK_EXTERNAL_MODULE_vue_createVNode__, defineComponent as __WEBPACK_EXTERNAL_MODULE_vue_defineComponent__, getCurrentInstance as __WEBPACK_EXTERNAL_MODULE_vue_getCurrentInstance__, isVNode as __WEBPACK_EXTERNAL_MODULE_vue_isVNode__, mergeProps as __WEBPACK_EXTERNAL_MODULE_vue_mergeProps__, nextTick as __WEBPACK_EXTERNAL_MODULE_vue_nextTick__, ref as __WEBPACK_EXTERNAL_MODULE_vue_ref__, toRefs as __WEBPACK_EXTERNAL_MODULE_vue_toRefs__, watch as __WEBPACK_EXTERNAL_MODULE_vue_watch__ } from "vue";
import { useLocale as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_useLocale__, usePrefix as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__ } from "../config-provider";
import { BkOption as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_select_1a0d1ad7_BkOption__, default as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_select_1a0d1ad7_default__ } from "../select";
import "../select/select.less";
import { AngleLeft as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_AngleLeft__, AngleRight as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_AngleRight__, Ellipsis as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_Ellipsis__ } from "../icon";
import { default as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d_default__ } from "../popover";
import "../popover/popover.less";

;// external "../shared"

;// external "vue"

;// ../../node_modules/@babel/runtime/helpers/esm/typeof.js
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);
}

;// ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js

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);
}

;// ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js


function toPropertyKey(t) {
  var i = toPrimitive(t, "string");
  return "symbol" == _typeof(i) ? i : i + "";
}

;// ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js

function _defineProperty(e, r, t) {
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : e[r] = t, e;
}

;// ../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
function _arrayWithHoles(r) {
  if (Array.isArray(r)) return r;
}

;// ../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
function _iterableToArrayLimit(r, l) {
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  if (null != t) {
    var e,
      n,
      i,
      u,
      a = [],
      f = !0,
      o = !1;
    try {
      if (i = (t = t.call(r)).next, 0 === l) {
        if (Object(t) !== t) return;
        f = !1;
      } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
    } catch (r) {
      o = !0, n = r;
    } finally {
      try {
        if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
      } finally {
        if (o) throw n;
      }
    }
    return a;
  }
}

;// ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
function _arrayLikeToArray(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
  return n;
}

;// ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js

function _unsupportedIterableToArray(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray(r, a);
    var t = {}.toString.call(r).slice(8, -1);
    return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
  }
}

;// ../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
function _nonIterableRest() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}

;// ../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js




function _slicedToArray(r, e) {
  return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
}

;// external "../config-provider"

;// external "../select"

;// external "../select/select.less"

;// ../../packages/pagination/src/use-limit.tsx



/*
 * Tencent is pleased to support the open source community by making
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
 *
 * Copyright (C) 2025 Tencent.  All rights reserved.
 *
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
 *
 * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
 *
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
 * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
 * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */





function _isSlot(s) {
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !__WEBPACK_EXTERNAL_MODULE_vue_isVNode__(s);
}
/* harmony default export */ const use_limit = (function (t) {
  var _getCurrentInstance = __WEBPACK_EXTERNAL_MODULE_vue_getCurrentInstance__(),
    proxy = _getCurrentInstance.proxy,
    slots = _getCurrentInstance.slots;
  var localLimit = __WEBPACK_EXTERNAL_MODULE_vue_ref__(proxy.limit);
  /**
   * @desc 同步props.limit的变化
   */
  __WEBPACK_EXTERNAL_MODULE_vue_watch__(function () {
    return proxy.limit;
  }, function (limit) {
    localLimit.value = limit;
  });
  /**
   * @desc 同步props.limitlist的变化并判断props.limit的合法性
   */
  __WEBPACK_EXTERNAL_MODULE_vue_watch__(function () {
    return proxy.limitList;
  }, function (limitList) {
    __WEBPACK_EXTERNAL_MODULE_vue_nextTick__(function () {
      if (!limitList.includes(localLimit.value)) {
        var _limitList = _slicedToArray(limitList, 1);
        localLimit.value = _limitList[0];
      }
    });
  }, {
    immediate: true
  });
  /**
   * @desc 选择每页条数
   */
  var handleLimitChange = function handleLimitChange(limit) {
    localLimit.value = limit;
  };
  var _usePrefix = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__(),
    resolveClassName = _usePrefix.resolveClassName;
  var render = function render(_ref) {
    var _slots$limitAppend;
    var _slot;
    var isFirst = _ref.isFirst,
      isLast = _ref.isLast;
    if (!proxy.showLimit) {
      return null;
    }
    return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": _defineProperty(_defineProperty(_defineProperty({}, resolveClassName('pagination-limit'), true), 'is-first', isFirst), 'is-last', isLast)
    }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", null, [t.value.eachPage]), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_select_1a0d1ad7_default__, {
      "class": "".concat(resolveClassName('pagination-limit-select')),
      "clearable": false,
      "disabled": proxy.disabled,
      "filterable": false,
      "modelValue": localLimit.value,
      "size": "small",
      "withValidate": false,
      "onChange": handleLimitChange
    }, _isSlot(_slot = proxy.limitList.map(function (num, index) {
      return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_select_1a0d1ad7_BkOption__, {
        "id": num,
        "key": "".concat(index, "_").concat(num),
        "name": "".concat(num)
      }, null);
    })) ? _slot : {
      "default": function _default() {
        return [_slot];
      }
    }), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", null, [t.value.strip]), (_slots$limitAppend = slots.limitAppend) === null || _slots$limitAppend === void 0 ? void 0 : _slots$limitAppend.call(slots)]);
  };
  return {
    limit: localLimit,
    render: render
  };
});
;// external "../icon"

;// ../../packages/pagination/src/use-list.tsx


/*
 * Tencent is pleased to support the open source community by making
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
 *
 * Copyright (C) 2025 Tencent.  All rights reserved.
 *
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
 *
 * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
 *
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
 * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
 * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */



var PAGE_ITEMS_NUM = 5;
/* harmony default export */ const use_list = (function () {
  var _getCurrentInstance = __WEBPACK_EXTERNAL_MODULE_vue_getCurrentInstance__(),
    proxy = _getCurrentInstance.proxy,
    slots = _getCurrentInstance.slots;
  var localCurrent = __WEBPACK_EXTERNAL_MODULE_vue_ref__(1);
  var isPagePreDisabled = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
    return localCurrent.value === 1;
  });
  var isPageNextDisabled = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
    return localCurrent.value === proxy.totalPageNum;
  });
  var showPreBatch = __WEBPACK_EXTERNAL_MODULE_vue_ref__(false);
  var showNextBatch = __WEBPACK_EXTERNAL_MODULE_vue_ref__(false);
  var list = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
    showPreBatch.value = false;
    showNextBatch.value = false;
    var stack = [];
    if (proxy.totalPageNum <= PAGE_ITEMS_NUM + 2) {
      for (var i = 2; i <= proxy.totalPageNum - 1; i++) {
        stack.push(i);
      }
      return stack;
    }
    var pageItemsNumHalf = Math.floor(PAGE_ITEMS_NUM / 2);
    if (proxy.totalPageNum > PAGE_ITEMS_NUM) {
      showPreBatch.value = localCurrent.value - pageItemsNumHalf > 2;
      showNextBatch.value = localCurrent.value + pageItemsNumHalf < proxy.totalPageNum - 1;
    }
    var start = Math.min(proxy.totalPageNum - PAGE_ITEMS_NUM, Math.max(2, localCurrent.value - pageItemsNumHalf));
    for (var _i = start; _i < start + PAGE_ITEMS_NUM; _i++) {
      stack.push(_i);
    }
    return stack;
  });
  __WEBPACK_EXTERNAL_MODULE_vue_watch__(function () {
    return proxy.modelValue;
  }, function (modelValue) {
    if (proxy.small) {
      return;
    }
    // nextTick延后执行，保证proxy.totalPageNum计算正确
    __WEBPACK_EXTERNAL_MODULE_vue_nextTick__(function () {
      if (modelValue >= 1 && modelValue <= proxy.totalPageNum) {
        localCurrent.value = modelValue;
      } else if (modelValue < 1) {
        localCurrent.value = 1;
      } else {
        localCurrent.value = proxy.totalPageNum;
      }
    });
  }, {
    immediate: true
  });
  // 切换limit时会导致totalPageNum变小旧的current可能会超出范围，修正localCurrent
  __WEBPACK_EXTERNAL_MODULE_vue_nextTick__(function () {
    __WEBPACK_EXTERNAL_MODULE_vue_watch__(function () {
      return proxy.totalPageNum;
    }, function (totalPageNum) {
      if (proxy.small) {
        return;
      }
      if (localCurrent.value > totalPageNum) {
        localCurrent.value = totalPageNum;
      }
    });
  });
  /**
   * @desc 上一页
   */
  var handlePrePage = function handlePrePage() {
    if (proxy.disabled) {
      return;
    }
    if (isPagePreDisabled.value) {
      return;
    }
    localCurrent.value = localCurrent.value - 1;
  };
  /**
   * @desc 下一页
   */
  var handleNextPage = function handleNextPage() {
    if (proxy.disabled) {
      return;
    }
    if (isPageNextDisabled.value) {
      return;
    }
    localCurrent.value = localCurrent.value + 1;
  };
  /**
   * @desc 跳转指定页码
   * @param { Number } totalPageNum
   */
  var handleItemClick = function handleItemClick(totalPageNum) {
    if (proxy.disabled) {
      return;
    }
    if (totalPageNum === localCurrent.value) {
      return;
    }
    localCurrent.value = totalPageNum;
  };
  /**
   * @desc 上一批分页
   */
  var handlePreBatch = function handlePreBatch() {
    if (proxy.disabled) {
      return;
    }
    localCurrent.value = Math.max(1, localCurrent.value - PAGE_ITEMS_NUM);
  };
  /**
   * @desc 下一批分页
   */
  var handleNextBatch = function handleNextBatch() {
    if (proxy.disabled) {
      return;
    }
    localCurrent.value = Math.min(proxy.totalPageNum, localCurrent.value + PAGE_ITEMS_NUM);
  };
  var _usePrefix = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__(),
    resolveClassName = _usePrefix.resolveClassName;
  var render = function render(_ref) {
    var _slots$listAppend;
    var isFirst = _ref.isFirst,
      isLast = _ref.isLast;
    return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": _defineProperty(_defineProperty(_defineProperty({}, "".concat(resolveClassName('pagination-list')), true), 'is-first', isFirst), 'is-last', isLast)
    }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": _defineProperty(_defineProperty({}, "".concat(resolveClassName('pagination-list-pre')), true), 'is-disabled', isPagePreDisabled.value),
      "onClick": handlePrePage
    }, [proxy.prevText || __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_AngleLeft__, null, null)]), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "key": "1",
      "class": _defineProperty(_defineProperty({}, "".concat(resolveClassName('pagination-list-item')), true), 'is-active', localCurrent.value === 1),
      "onClick": function onClick() {
        return handleItemClick(1);
      }
    }, [__WEBPACK_EXTERNAL_MODULE_vue_createTextVNode__("1")]), showPreBatch.value && __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "key": "pre-batch",
      "class": "".concat(resolveClassName('pagination-list-pre-batch')),
      "onClick": handlePreBatch
    }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_Ellipsis__, null, null)]), list.value.map(function (num) {
      return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
        "key": num,
        "class": _defineProperty(_defineProperty({}, "".concat(resolveClassName('pagination-list-item')), true), 'is-active', localCurrent.value === num),
        "onClick": function onClick() {
          return handleItemClick(num);
        }
      }, [num]);
    }), showNextBatch.value && __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "key": "next-batch",
      "class": "".concat(resolveClassName('pagination-list-next-batch')),
      "onClick": handleNextBatch
    }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_Ellipsis__, null, null)]), proxy.totalPageNum > 1 && __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "key": "last",
      "class": _defineProperty(_defineProperty({}, "".concat(resolveClassName('pagination-list-item')), true), 'is-active', localCurrent.value === proxy.totalPageNum),
      "onClick": function onClick() {
        return handleItemClick(proxy.totalPageNum);
      }
    }, [proxy.totalPageNum]), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": _defineProperty(_defineProperty({}, "".concat(resolveClassName('pagination-list-pre')), true), 'is-disabled', isPageNextDisabled.value),
      "onClick": handleNextPage
    }, [proxy.nextText || __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_AngleRight__, null, null)]), (_slots$listAppend = slots.listAppend) === null || _slots$listAppend === void 0 ? void 0 : _slots$listAppend.call(slots)]);
  };
  return {
    current: localCurrent,
    render: render
  };
});
;// external "../popover"

;// external "../popover/popover.less"

;// ../../packages/pagination/src/use-small-list.tsx


/*
 * Tencent is pleased to support the open source community by making
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
 *
 * Copyright (C) 2025 Tencent.  All rights reserved.
 *
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
 *
 * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
 *
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
 * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
 * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */





/* harmony default export */ const use_small_list = (function () {
  var _getCurrentInstance = __WEBPACK_EXTERNAL_MODULE_vue_getCurrentInstance__(),
    proxy = _getCurrentInstance.proxy,
    slots = _getCurrentInstance.slots;
  var inputRef = __WEBPACK_EXTERNAL_MODULE_vue_ref__(null);
  var isFocused = __WEBPACK_EXTERNAL_MODULE_vue_ref__(false);
  var localCurrent = __WEBPACK_EXTERNAL_MODULE_vue_ref__(1);
  var isPopoverShow = __WEBPACK_EXTERNAL_MODULE_vue_ref__(false);
  var isPagePreDisabled = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
    return localCurrent.value === 1;
  });
  var isPageNextDisabled = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
    return localCurrent.value === proxy.totalPageNum;
  });
  // 缓存input输入，失焦或者enter键触发提交
  var inputMemo = 0;
  // 页码可选列表
  var list = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
    var stack = [];
    for (var i = 1; i <= proxy.totalPageNum; i++) {
      stack.push(i);
    }
    return stack;
  });
  __WEBPACK_EXTERNAL_MODULE_vue_watch__(function () {
    return proxy.modelValue;
  }, function (modelValue) {
    if (!proxy.small) {
      return;
    }
    // nextTick延后执行，保证proxy.totalPageNum计算正确
    __WEBPACK_EXTERNAL_MODULE_vue_nextTick__(function () {
      if (modelValue >= 1 && modelValue <= proxy.totalPageNum) {
        localCurrent.value = modelValue;
      } else if (modelValue < 1) {
        localCurrent.value = 1;
      } else {
        localCurrent.value = proxy.totalPageNum;
      }
      inputMemo = localCurrent.value;
    });
  }, {
    immediate: true
  });
  // 切换limit时会导致totalPageNum变小旧的current可能会超出范围，修正localCurrent
  __WEBPACK_EXTERNAL_MODULE_vue_nextTick__(function () {
    __WEBPACK_EXTERNAL_MODULE_vue_watch__(function () {
      return proxy.totalPageNum;
    }, function (totalPageNum) {
      if (!proxy.small) {
        return;
      }
      if (localCurrent.value > totalPageNum) {
        localCurrent.value = totalPageNum;
      }
    });
  });
  /**
   * @desc 上一页
   */
  var handlePrePage = function handlePrePage() {
    if (proxy.disabled) {
      return;
    }
    if (isPagePreDisabled.value) {
      return;
    }
    localCurrent.value = localCurrent.value - 1;
  };
  /**
   * @desc 下一页
   */
  var handleNextPage = function handleNextPage() {
    if (proxy.disabled) {
      return;
    }
    if (isPageNextDisabled.value) {
      return;
    }
    localCurrent.value = localCurrent.value + 1;
  };
  /**
   * @desc 获得焦点
   */
  var handlePageEditorFocus = function handlePageEditorFocus() {
    if (proxy.disabled) {
      return;
    }
    isFocused.value = true;
  };
  /**
   * @desc 失去焦点
   */
  var handlePageEditorBlur = function handlePageEditorBlur() {
    isFocused.value = false;
    isPopoverShow.value = false;
    if (inputMemo !== localCurrent.value) {
      localCurrent.value = inputMemo;
    }
  };
  /**
   * @desc 键盘输入
   * @param { Event } event
   */
  var handlePageEditorInput = function handlePageEditorInput(event) {
    var $target = event.target;
    var value = Number($target.textContent);
    // 无效值不抛出事件
    if (!value || value < 1 || value > proxy.totalPageNum || value === localCurrent.value) {
      return;
    }
    inputMemo = value;
  };
  /**
   * @desc 处理Enter事件
   * @param { KeyboardEvent } event
   */
  var handlePageEditorKeydown = function handlePageEditorKeydown(event) {
    // 阻止默认enter事件（keycode判断可能会被弃用）
    if (['Enter', 'NumpadEnter'].includes(event.code)) {
      event.preventDefault();
      handlePageEditorBlur();
    }
  };
  /**
   * @desc 更新
   */
  var handlePageChange = function handlePageChange(item) {
    inputMemo = item;
    handlePageEditorBlur();
  };
  /**
   * @desc 点击关闭popover事件
   *  @param { boolean } isShow
   */
  var handlePopShow = function handlePopShow(isShow) {
    isPopoverShow.value = isShow;
  };
  var _usePrefix = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__(),
    resolveClassName = _usePrefix.resolveClassName;
  var render = function render() {
    var _slots$smallListAppen;
    return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": "".concat(resolveClassName('pagination-small-list'))
    }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": _defineProperty(_defineProperty({}, "".concat(resolveClassName('pagination-btn-pre')), true), 'is-disabled', isPagePreDisabled.value),
      "onClick": handlePrePage
    }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_AngleLeft__, null, null)]), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d_default__, {
      "width": 56,
      "arrow": false,
      "boundary": "body",
      "disabled": proxy.disabled,
      "isShow": isPopoverShow.value,
      "placement": "bottom",
      "theme": "light",
      "trigger": "click",
      "onAfterHidden": function onAfterHidden() {
        return handlePopShow(false);
      },
      "onAfterShow": function onAfterShow() {
        return handlePopShow(true);
      }
    }, {
      "default": function _default() {
        return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
          "class": _defineProperty(_defineProperty({}, "".concat(resolveClassName('pagination-picker')), true), 'is-focused', isFocused.value)
        }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__("span", {
          "ref": inputRef,
          "class": "".concat(resolveClassName('pagination-editor')),
          "contenteditable": !proxy.disabled,
          "innerHTML": String(localCurrent.value),
          "spellcheck": "false",
          "onBlur": handlePageEditorBlur,
          "onFocus": handlePageEditorFocus,
          "onInput": handlePageEditorInput,
          "onKeydown": handlePageEditorKeydown
        }, [localCurrent.value]), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("span", null, [__WEBPACK_EXTERNAL_MODULE_vue_createTextVNode__("/")]), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("span", {
          "class": "".concat(resolveClassName('pagination-small-list-total'))
        }, [proxy.totalPageNum])]);
      },
      content: function content() {
        return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
          "class": "".concat(resolveClassName('pagination-picker-list'))
        }, [list.value.map(function (item) {
          return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
            "key": item,
            "class": {
              item: true,
              'is-actived': item === localCurrent.value
            },
            "onClick": function onClick() {
              return handlePageChange(item);
            }
          }, [item]);
        })]);
      }
    }), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": _defineProperty(_defineProperty({}, "".concat(resolveClassName('pagination-btn-next')), true), 'is-disabled', isPageNextDisabled.value),
      "onClick": handleNextPage
    }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_AngleRight__, null, null)]), (_slots$smallListAppen = slots.smallListAppend) === null || _slots$smallListAppen === void 0 ? void 0 : _slots$smallListAppen.call(slots)]);
  };
  return {
    current: localCurrent,
    render: render
  };
});
;// ../../packages/pagination/src/use-total.tsx


/*
 * Tencent is pleased to support the open source community by making
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
 *
 * Copyright (C) 2025 Tencent.  All rights reserved.
 *
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
 *
 * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
 *
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
 * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
 * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */


/* harmony default export */ const use_total = (function (t) {
  return function (_ref) {
    var _slots$totalAppend;
    var isFirst = _ref.isFirst,
      isLast = _ref.isLast;
    var _getCurrentInstance = __WEBPACK_EXTERNAL_MODULE_vue_getCurrentInstance__(),
      props = _getCurrentInstance.props,
      slots = _getCurrentInstance.slots;
    if (!props.showTotalCount) {
      return null;
    }
    var _usePrefix = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__(),
      resolveClassName = _usePrefix.resolveClassName;
    return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", __WEBPACK_EXTERNAL_MODULE_vue_mergeProps__({
      "class": _defineProperty(_defineProperty(_defineProperty({}, "".concat(resolveClassName('pagination-total')), true), 'is-first', isFirst), 'is-last', isLast)
    }, {
      disabled: props.disabled
    }), [t.value.total, __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": "".concat(resolveClassName('pagination-total-num'))
    }, [props.count]), t.value.strip, (_slots$totalAppend = slots.totalAppend) === null || _slots$totalAppend === void 0 ? void 0 : _slots$totalAppend.call(slots)]);
  };
});
;// ../../packages/pagination/src/pagination.tsx



/*
 * Tencent is pleased to support the open source community by making
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
 *
 * Copyright (C) 2025 Tencent.  All rights reserved.
 *
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
 *
 * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
 *
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
 * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
 * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */







var paginationProps = {
  modelValue: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.number.def(1),
  count: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.number.def(0).isRequired,
  limit: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.number.def(10),
  limitList: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.arrayOf(Number).def([10, 20, 50, 100]),
  showLimit: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool.def(true),
  type: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.oneOf(['default', 'compact']).def('default'),
  location: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.oneOf(['left', 'right']).def('right'),
  align: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.oneOf(['left', 'center', 'right']).def('left'),
  small: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool.def(false),
  showTotalCount: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool.def(true),
  prevText: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string,
  nextText: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string,
  disabled: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool.def(false),
  layout: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.custom(function (value) {
    var layoutNameMap = {
      total: true,
      list: true,
      limit: true
    };
    return value.some(function (item) {
      return layoutNameMap[item];
    });
  }, 'layout 的值只支持 * total、list、limit *').def(['total', 'list', 'limit'])
};
/* harmony default export */ const pagination = (__WEBPACK_EXTERNAL_MODULE_vue_defineComponent__({
  name: 'Pagination',
  props: paginationProps,
  emits: ['update:modelValue', 'change', 'update:limit', 'limitChange'],
  setup: function setup(props, context) {
    var t = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_useLocale__('pagination');
    var totalPageNum = __WEBPACK_EXTERNAL_MODULE_vue_ref__(0);
    var _toRefs = __WEBPACK_EXTERNAL_MODULE_vue_toRefs__(props),
      count = _toRefs.count,
      limit = _toRefs.limit;
    var renderTotal = use_total(t);
    var _useList = use_list(),
      listCurrent = _useList.current,
      renderList = _useList.render;
    var _useSmallList = use_small_list(),
      smallListCurrent = _useSmallList.current,
      renderSmallList = _useSmallList.render;
    var _useLimit = use_limit(t),
      localLimit = _useLimit.limit,
      renderLimit = _useLimit.render;
    __WEBPACK_EXTERNAL_MODULE_vue_watch__([count, localLimit, limit], function (_ref) {
      var _ref2 = _slicedToArray(_ref, 2),
        count = _ref2[0],
        localLimit = _ref2[1];
      var total = Math.ceil(count / localLimit);
      totalPageNum.value = total < 1 ? 1 : total;
    }, {
      immediate: true
    });
    __WEBPACK_EXTERNAL_MODULE_vue_watch__(listCurrent, function (listCurrent) {
      if (props.small) {
        return;
      }
      context.emit('update:modelValue', listCurrent);
      context.emit('change', listCurrent);
    });
    __WEBPACK_EXTERNAL_MODULE_vue_watch__(smallListCurrent, function (smallListCurrent) {
      if (!props.small) {
        return;
      }
      context.emit('update:modelValue', smallListCurrent);
      context.emit('change', smallListCurrent);
    });
    __WEBPACK_EXTERNAL_MODULE_vue_watch__(localLimit, function (localLimit) {
      context.emit('limitChange', localLimit);
    });
    var _usePrefix = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__(),
      resolveClassName = _usePrefix.resolveClassName;
    return {
      totalPageNum: totalPageNum,
      renderTotal: renderTotal,
      renderList: renderList,
      renderLimit: renderLimit,
      renderSmallList: renderSmallList,
      resolveClassName: resolveClassName
    };
  },
  render: function render() {
    var _this = this;
    var paginationClass = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_classes__(_defineProperty(_defineProperty(_defineProperty({}, "".concat(this.resolveClassName('pagination')), true), "is-align-".concat(this.align), true), 'is-disabled', this.disabled));
    var layoutMap = {
      total: this.renderTotal,
      list: this.small ? this.renderSmallList : this.renderList,
      limit: this.renderLimit
    };
    return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": paginationClass
    }, [this.layout.map(function (layout, index) {
      return layoutMap[layout]({
        isFirst: index === 0,
        isLast: index === _this.layout.length - 1
      });
    })]);
  }
}));
;// ../../packages/pagination/src/index.ts
/*
 * Tencent is pleased to support the open source community by making
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
 *
 * Copyright (C) 2025 Tencent.  All rights reserved.
 *
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
 *
 * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
 *
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
 * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
 * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */


var BkPagination = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_withInstall__(pagination);
/* harmony default export */ const src = (BkPagination);

export { BkPagination, src as default };
