import "../styles/reset.css";
import "./transfer.less";
import { PropTypes as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__, withInstall as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_withInstall__ } from "../shared";
import { Fragment as __WEBPACK_EXTERNAL_MODULE_vue_Fragment__, 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__, isVNode as __WEBPACK_EXTERNAL_MODULE_vue_isVNode__, ref as __WEBPACK_EXTERNAL_MODULE_vue_ref__, toRaw as __WEBPACK_EXTERNAL_MODULE_vue_toRaw__, toRefs as __WEBPACK_EXTERNAL_MODULE_vue_toRefs__, watch as __WEBPACK_EXTERNAL_MODULE_vue_watch__ } from "vue";
import { BkCheckboxGroup as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_checkbox_13b1cb4a_BkCheckboxGroup__, default as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_checkbox_13b1cb4a_default__ } from "../checkbox";
import "../checkbox/checkbox.less";
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 { AngleLeft as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_AngleLeft__, AngleRight as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_AngleRight__, ArrowsRight as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_ArrowsRight__, Error as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_Error__, Search as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_Search__, Transfer as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_Transfer__ } from "../icon";
import { default as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_input_d525237e_default__ } from "../input";
import "../input/input.less";
import { OverflowTitle as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_overflow_title_051a85a5_OverflowTitle__ } from "../overflow-title";

;// external "../shared"

;// external "vue"

;// ../../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/arrayWithoutHoles.js

function _arrayWithoutHoles(r) {
  if (Array.isArray(r)) return _arrayLikeToArray(r);
}

;// ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
function _iterableToArray(r) {
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}

;// ../../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/nonIterableSpread.js
function _nonIterableSpread() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}

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




function _toConsumableArray(r) {
  return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
}

;// external "../checkbox"

;// external "../checkbox/checkbox.less"

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

;// external "../icon"

;// external "../input"

;// external "../input/input.less"

;// external "../overflow-title"

;// ../../packages/transfer/src/const.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 ArrayType;
(function (ArrayType) {
  ArrayType["BASE_ARRAY"] = "baseArray";
  ArrayType["NOT_ARRAY"] = "notArray";
  ArrayType["OBJECT_ARRAY"] = "objectArray";
})(ArrayType || (ArrayType = {}));
;// ../../packages/transfer/src/props.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 transferProps = {
  // 顶部title(title[0]: 左侧title,title[1]: 右侧title,)
  title: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.arrayOf(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string).def([]),
  // 自定义class
  extCls: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string.def(''),
  // 搜索框 placeholder
  searchPlaceholder: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string.def(''),
  // 唯一key值
  settingKey: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string.def('id'),
  // 循环list时，显示字段的key值(当list为普通数组时可不传传了也无效)
  displayKey: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string.def('value'),
  // 排序所依据的key(当list为普通数组时可不传，默认按照index值排序)
  sortKey: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string.def('value'),
  // 是否开启搜索
  searchable: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool.def(false),
  // 是否开启排序功能
  sortable: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool.def(false),
  // 穿梭框数据源(支持普通数组)
  sourceList: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.arrayOf(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.any).def([]),
  // 默认已选择的数据源
  targetList: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.arrayOf(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.any).def([]),
  // 穿梭框无数据时提示文案
  emptyContent: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.arrayOf(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string).def([]),
  // 支持checkbox多选模式
  multiple: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool.def(false)
};
;// ../../packages/transfer/src/transfer.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);
}
function useTransferData(sourceData, targetList, settingCode) {
  var selectList = __WEBPACK_EXTERNAL_MODULE_vue_ref__([]);
  var selectedList = __WEBPACK_EXTERNAL_MODULE_vue_ref__([]);
  var transformData = function transformData() {
    var isChange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
    if (isChange) {
      // watch监听时需要清空重新按照targetList赋值
      selectList.value = [];
      selectedList.value = [];
    }
    sourceData.value.forEach(function (s) {
      var keyId = s[settingCode.value];
      if (targetList.value.includes(keyId)) {
        selectedList.value.push(s);
      } else {
        selectList.value.push(s);
      }
    });
  };
  transformData();
  __WEBPACK_EXTERNAL_MODULE_vue_watch__(function () {
    return [sourceData, targetList, settingCode];
  }, function () {
    transformData(true);
  }, {
    deep: true
  });
  return {
    selectList: selectList,
    selectedList: selectedList
  };
}
// 搜索
function useSelectListSearch(selectList, displayCode) {
  var selectSearchQuery = __WEBPACK_EXTERNAL_MODULE_vue_ref__('');
  var selectListSearch = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
    return selectList.value.filter(function (select) {
      var val = select[displayCode.value];
      if (val instanceof Object) return false;
      return val.toString().includes(selectSearchQuery.value);
    });
  });
  return {
    selectSearchQuery: selectSearchQuery,
    selectListSearch: selectListSearch
  };
}
/* harmony default export */ const transfer = (__WEBPACK_EXTERNAL_MODULE_vue_defineComponent__({
  name: 'Transfer',
  props: transferProps,
  emits: ['change', 'update:targetList'],
  setup: function setup(props, _ref) {
    var emit = _ref.emit;
    var t = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_useLocale__('transfer');
    var multipleSelectAllValue = __WEBPACK_EXTERNAL_MODULE_vue_ref__({
      source: false,
      target: false
    });
    var multipleSelectList = __WEBPACK_EXTERNAL_MODULE_vue_ref__({
      source: [],
      target: []
    });
    // 区分数据是基础数据数组(false)还是对象数组(true)
    var sourceListType = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
      if (Array.isArray(props.sourceList)) {
        var isObjectArray = props.sourceList.every(function (s) {
          return s.toString().includes('[object Object]');
        });
        return isObjectArray ? ArrayType.OBJECT_ARRAY : ArrayType.BASE_ARRAY;
      }
      return ArrayType.NOT_ARRAY;
    });
    var settingCode = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
      return sourceListType.value === ArrayType.BASE_ARRAY ? 'value' : props.settingKey;
    });
    var displayCode = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
      return sourceListType.value === ArrayType.BASE_ARRAY ? 'value' : props.displayKey;
    });
    var sortCode = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
      return props.sortKey || displayCode.value;
    });
    // 处理为统一格式
    var sourceData = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
      switch (sourceListType.value) {
        case ArrayType.BASE_ARRAY:
          // 封装为对象
          return _toConsumableArray(new Set(props.sourceList)).map(function (s) {
            return {
              value: s
            };
          });
        case ArrayType.OBJECT_ARRAY:
          return _toConsumableArray(props.sourceList);
        default:
          return [];
      }
    });
    // 获取左右列表
    var _toRefs = __WEBPACK_EXTERNAL_MODULE_vue_toRefs__(props),
      targetList = _toRefs.targetList;
    var _useTransferData = useTransferData(sourceData, targetList, settingCode),
      selectList = _useTransferData.selectList,
      selectedList = _useTransferData.selectedList;
    // 使用搜索
    var _useSelectListSearch = useSelectListSearch(selectList, displayCode),
      selectSearchQuery = _useSelectListSearch.selectSearchQuery,
      selectListSearch = _useSelectListSearch.selectListSearch;
    var selectListSort = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
      return _toConsumableArray(selectListSearch.value).sort(function (a, b) {
        var va = a[sortCode.value];
        var vb = b[sortCode.value];
        return va > vb ? 1 : -1;
      });
    });
    var selectedListSort = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
      return _toConsumableArray(selectedList.value).sort(function (a, b) {
        var va = a[sortCode.value];
        var vb = b[sortCode.value];
        return va > vb ? 1 : -1;
      });
    });
    __WEBPACK_EXTERNAL_MODULE_vue_watch__(function () {
      return [selectList, selectedList];
    }, function () {
      if (!props.multiple) {
        handleEmitUpdateTargetList();
      }
    }, {
      deep: true
    });
    /** 全选、清空操作过滤禁用选项 */
    var handleCheckAllItemSelect = function handleCheckAllItemSelect(list, source) {
      var itemKey = settingCode.value;
      return list.some(function (val) {
        return val[itemKey] === source[itemKey];
      }) && source.disabled;
    };
    /** 全选 */
    var allToRight = function allToRight() {
      // 清空源列表 除源列表禁用选项
      selectList.value = _toConsumableArray(sourceData.value.filter(function (source) {
        return handleCheckAllItemSelect(selectList.value, source);
      }));
      // 填满目标列表 除源列表禁用选项
      selectedList.value = _toConsumableArray(sourceData.value.filter(function (source) {
        return !handleCheckAllItemSelect(selectList.value, source);
      }));
      // 全选搜索结果
      // selectedList.value.push(...selectListSearch.value)
      handleEmitUpdateTargetList();
    };
    /** 移除 */
    var allToLeft = function allToLeft() {
      // 填满源列表 除目标列表禁用选项
      selectList.value = _toConsumableArray(sourceData.value.filter(function (source) {
        return !handleCheckAllItemSelect(selectedList.value, source);
      }));
      // 清空目标列表 除目标列表禁用选项
      selectedList.value = _toConsumableArray(sourceData.value.filter(function (source) {
        return handleCheckAllItemSelect(selectedList.value, source);
      }));
      handleEmitUpdateTargetList();
    };
    /**
     * @desc 列表项 click 事件
     * @param { string } itemKey settingCode值
     * @param { boolean } isLeft 左右面板
     */
    var handleItemClick = function handleItemClick(item, isLeft) {
      var _to$value;
      if (item.disabled) return;
      var itemKey = item[settingCode.value];
      var from = isLeft ? selectList : selectedList;
      var to = isLeft ? selectedList : selectList;
      var index = from.value.findIndex(function (item) {
        return item[settingCode.value] === itemKey;
      });
      (_to$value = to.value).push.apply(_to$value, _toConsumableArray(from.value.splice(index, 1)));
      handleEmitUpdateTargetList();
    };
    // emit事件，只有用户交互才会触发，如果是程序修改不会触发
    var handleEmitUpdateTargetList = function handleEmitUpdateTargetList() {
      var restList = selectList.value.map(function (item) {
        return item[settingCode.value];
      });
      var targetList = selectedList.value.map(function (item) {
        return item[settingCode.value];
      });
      emit('update:targetList', targetList);
      emit('change', sourceListType.value === ArrayType.BASE_ARRAY ? restList : selectList.value.map(function (v) {
        return __WEBPACK_EXTERNAL_MODULE_vue_toRaw__(v);
      }), sourceListType.value === ArrayType.BASE_ARRAY ? targetList : selectedList.value.map(function (v) {
        return __WEBPACK_EXTERNAL_MODULE_vue_toRaw__(v);
      }), targetList);
    };
    /**
     * @desc checkboxGroup 变化事件
     * @param { string } dirct 左右面板
     */
    var handleItemChecked = function handleItemChecked(dirct) {
      var target = dirct === 'source' ? selectList : selectedList;
      // 计算非 disabled 项的数量
      var enabledItems = target.value.filter(function (item) {
        return !item.disabled;
      });
      multipleSelectAllValue.value[dirct] = enabledItems.length > 0 && multipleSelectList.value[dirct].length === enabledItems.length;
    };
    /**
     * @desc checkbox 全选
     * @param { boolean } value checked
     * @param { string } dirct 左右面板
     */
    var handleAllChecked = function handleAllChecked(value, dirct) {
      var target = dirct === 'source' ? selectList : selectedList;
      // 全选时只选择非 disabled 的项
      multipleSelectList.value[dirct] = value ? target.value.filter(function (item) {
        return !item.disabled;
      }).map(function (item) {
        return item[settingCode.value];
      }) : [];
    };
    /**
     * @desc 多选后点击穿梭事件
     * @param { string } dirct 左右面板
     */
    var handleMultipleChange = function handleMultipleChange(dirct) {
      var _to$value2;
      var isLeft = dirct === 'left';
      var from = isLeft ? selectList : selectedList;
      var to = isLeft ? selectedList : selectList;
      var checkeds = multipleSelectList.value[isLeft ? 'source' : 'target'];
      // 过滤掉 disabled 的项，只穿梭非 disabled 的项
      var items = from.value.filter(function (val) {
        return checkeds.includes(val[settingCode.value]) && !val.disabled;
      });
      // 从源列表中移除已选中的非 disabled 项，保留 disabled 项
      from.value = from.value.filter(function (val) {
        return !checkeds.includes(val[settingCode.value]) || val.disabled;
      });
      (_to$value2 = to.value).push.apply(_to$value2, _toConsumableArray(items));
      multipleSelectList.value[isLeft ? 'source' : 'target'] = [];
      handleEmitUpdateTargetList();
    };
    var _usePrefix = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__(),
      resolveClassName = _usePrefix.resolveClassName;
    return {
      selectSearchQuery: selectSearchQuery,
      selectListSearch: selectListSearch,
      selectedList: selectedList,
      selectListSort: selectListSort,
      selectedListSort: selectedListSort,
      settingCode: settingCode,
      displayCode: displayCode,
      allToRight: allToRight,
      allToLeft: allToLeft,
      handleItemClick: handleItemClick,
      t: t,
      handleAllChecked: handleAllChecked,
      multipleSelectAllValue: multipleSelectAllValue,
      multipleSelectList: multipleSelectList,
      handleMultipleChange: handleMultipleChange,
      handleItemChecked: handleItemChecked,
      resolveClassName: resolveClassName
    };
  },
  render: function render() {
    var _this = this;
    var multiple = this.$props.multiple;
    var leftList = this.sortable ? this.selectListSort : this.selectListSearch;
    var rightList = this.sortable ? this.selectedListSort : this.selectedList;
    var getHeaderHtml = function getHeaderHtml(dirct) {
      var _this$title$, _this$title$2;
      var isLeft = dirct === 'left-header';
      var selectField = isLeft ? 'source' : 'target';
      var titleText = isLeft ? "".concat((_this$title$ = _this.title[0]) !== null && _this$title$ !== void 0 ? _this$title$ : _this.t.sourceList) : "".concat((_this$title$2 = _this.title[1]) !== null && _this$title$2 !== void 0 ? _this$title$2 : _this.t.targetList);
      var isDisabled = isLeft ? !leftList.length : !rightList.length;
      // 计算非 disabled 项的数量，用于全选状态判断
      var enabledItems = (isLeft ? leftList : rightList).filter(function (item) {
        return !item.disabled;
      });
      var enabledCount = enabledItems.length;
      var selectedEnabledCount = _this.multipleSelectList[selectField].filter(function (key) {
        var currentItem = (isLeft ? leftList : rightList).find(function (item) {
          return item[_this.settingCode] === key;
        });
        return currentItem && !currentItem.disabled;
      }).length;
      var isIndeterminate = selectedEnabledCount > 0 && selectedEnabledCount < enabledCount;
      var selectCount = _this.multipleSelectList[selectField].length;
      var headerClick = function headerClick() {
        if (isDisabled) return;
        isLeft ? _this.allToRight() : _this.allToLeft();
      };
      return _this.$slots[dirct] ? __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
        "class": "slot-header"
      }, [_this.$slots[dirct]()]) : __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
        "class": "header"
      }, [_this.multiple ? __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_checkbox_13b1cb4a_default__, {
        "class": "header-checkbox",
        "modelValue": _this.multipleSelectAllValue[selectField],
        "onUpdate:modelValue": function onUpdateModelValue($event) {
          return _this.multipleSelectAllValue[selectField] = $event;
        },
        "disabled": enabledCount === 0,
        "indeterminate": isIndeterminate,
        "label": titleText,
        "onChange": function onChange(val) {
          return _this.handleAllChecked(val, selectField);
        }
      }, null) : __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_vue_Fragment__, null, ["".concat(titleText, "\uFF08").concat(isLeft ? leftList.length : rightList.length, "\uFF09")]), _this.multiple ? __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
        "class": "select-total-count"
      }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__("span", {
        "class": "select-count"
      }, [selectCount]), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("span", {
        "class": "count-delimiter"
      }, [__WEBPACK_EXTERNAL_MODULE_vue_createTextVNode__("/")]), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("span", {
        "class": "total-count"
      }, [isLeft ? leftList.length : rightList.length])]) : __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("span", {
        "class": {
          'select-all': true,
          disabled: isDisabled
        },
        "onClick": function onClick() {
          return headerClick();
        }
      }, [isLeft ? _this.t.selectAll : _this.t.removeAll])]);
    };
    var getEmptyHtml = function getEmptyHtml(dirct) {
      var _ref2;
      var isLeft = dirct === 'left-empty-content';
      var emptyText = (_ref2 = isLeft ? _this.emptyContent[0] : _this.emptyContent[1]) !== null && _ref2 !== void 0 ? _ref2 : isLeft ? _this.t.noData : _this.t.noSelected;
      return _this.$slots[dirct] ? __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", null, [_this.$slots[dirct]()]) : __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
        "class": "empty"
      }, [emptyText]);
    };
    var getDefaultListHtml = function getDefaultListHtml(item) {
      var isLeft = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
      return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
        "class": ['item-content', {
          'is-disabled': item.disabled
        }]
      }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__("span", {
        "class": "content-text"
      }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_overflow_title_051a85a5_OverflowTitle__, {
        "resizeable": true
      }, {
        "default": function _default() {
          return [item[_this.displayCode]];
        }
      })]), !multiple && __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("span", {
        "class": "icon-wrapper"
      }, [isLeft ? // <ArrowsRight class={`${this.resolveClassName('icon')} icon-move`} />
      __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_ArrowsRight__, {
        "class": _this.resolveClassName('icon')
      }, null) : // <Error class={`${this.resolveClassName('icon')} icon-delete`} />
      __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_Error__, {
        "class": [_this.resolveClassName('icon'), _this.resolveClassName('icon-delete')]
      }, null)])]);
    };
    var getListContentHtml = function getListContentHtml(dirct) {
      var _slot;
      var isLeft = dirct === 'left';
      var selectField = dirct === 'left' ? 'source' : 'target';
      var list = isLeft ? leftList : rightList;
      var slotName = isLeft ? 'source-option' : 'target-option';
      var emptySlotName = isLeft ? 'left-empty-content' : 'right-empty-content';
      var contentMode = multiple ? __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_checkbox_13b1cb4a_BkCheckboxGroup__, {
        "class": "content is-flex",
        "modelValue": _this.multipleSelectList[selectField],
        "onUpdate:modelValue": function onUpdateModelValue($event) {
          return _this.multipleSelectList[selectField] = $event;
        },
        "onChange": function onChange() {
          return _this.handleItemChecked(selectField);
        }
      }, _isSlot(_slot = list.map(function (item) {
        var _this$$slots$slotName, _this$$slots$slotName2, _this$$slots;
        return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_checkbox_13b1cb4a_default__, {
          "key": item[_this.settingCode],
          "class": "checkbox-item",
          "disabled": item.disabled,
          "label": item[_this.settingCode]
        }, {
          "default": function _default() {
            return [(_this$$slots$slotName = (_this$$slots$slotName2 = (_this$$slots = _this.$slots)[slotName]) === null || _this$$slots$slotName2 === void 0 ? void 0 : _this$$slots$slotName2.call(_this$$slots, item)) !== null && _this$$slots$slotName !== void 0 ? _this$$slots$slotName : getDefaultListHtml(item, isLeft)];
          }
        });
      })) ? _slot : {
        "default": function _default() {
          return [_slot];
        }
      }) : __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("ul", {
        "class": ['content', _this.searchable && isLeft ? 'is-search' : '']
      }, [list.map(function (item) {
        var _this$$slots$slotName3, _this$$slots$slotName4, _this$$slots2;
        return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("li", {
          "key": item[_this.settingCode],
          "class": [_this.$slots[slotName] ? 'custom-item' : ''],
          "onClick": function onClick() {
            return _this.handleItemClick(item, isLeft);
          }
        }, [(_this$$slots$slotName3 = (_this$$slots$slotName4 = (_this$$slots2 = _this.$slots)[slotName]) === null || _this$$slots$slotName4 === void 0 ? void 0 : _this$$slots$slotName4.call(_this$$slots2, item)) !== null && _this$$slots$slotName3 !== void 0 ? _this$$slots$slotName3 : getDefaultListHtml(item, isLeft)]);
      })]);
      return list.length ? contentMode : getEmptyHtml(emptySlotName);
    };
    return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": ["".concat(this.resolveClassName('transfer')), this.extCls]
    }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": "source-list"
    }, [getHeaderHtml('left-header'), this.searchable && __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_input_d525237e_default__, {
      "class": "transfer-search-input",
      "modelValue": _this.selectSearchQuery,
      "onUpdate:modelValue": function onUpdateModelValue($event) {
        return _this.selectSearchQuery = $event;
      },
      "clearable": true,
      "placeholder": this.searchPlaceholder || this.t.search
    }, {
      prefix: function prefix() {
        return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_Search__, {
          "class": _this.resolveClassName('icon-search')
        }, null);
      }
    }), getListContentHtml('left')]), multiple ? __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": "transfer-button-group"
    }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": ['transfer-button', {
        disabled: !this.multipleSelectList.source.length
      }],
      "onClick": function onClick() {
        return _this.handleMultipleChange('left');
      }
    }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_AngleRight__, null, null)]), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": ['transfer-button', {
        disabled: !this.multipleSelectList.target.length
      }],
      "onClick": function onClick() {
        return _this.handleMultipleChange('right');
      }
    }, [__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_icon_a97c79c3_Transfer__, {
      "class": this.resolveClassName('transfer-icon')
    }, null), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": "target-list"
    }, [getHeaderHtml('right-header'), getListContentHtml('right')])]);
  }
}));
;// ../../packages/transfer/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 Transfer = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_withInstall__(transfer);
/* harmony default export */ const src = (Transfer);
export { src as default };
