import "../styles/reset.css";
import "./pop-confirm.less";
import { PlacementEnum as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PlacementEnum__, PropTypes as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__, placementType as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_placementType__, withInstall as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_withInstall__ } from "../shared";
import { Fragment as __WEBPACK_EXTERNAL_MODULE_vue_Fragment__, createVNode as __WEBPACK_EXTERNAL_MODULE_vue_createVNode__, defineComponent as __WEBPACK_EXTERNAL_MODULE_vue_defineComponent__, mergeProps as __WEBPACK_EXTERNAL_MODULE_vue_mergeProps__, ref as __WEBPACK_EXTERNAL_MODULE_vue_ref__ } from "vue";
import { default as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_button_a2ea7c9a_default__ } from "../button";
import "../button/button.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 { default as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d_default__ } from "../popover";
import "../popover/popover.less";
import { toType as __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a_toType__ } from "vue-types";

;// external "../shared"

;// external "vue"

;// external "../button"

;// external "../button/button.less"

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

;// external "../popover"

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

;// external "vue-types"

;// ../../packages/pop-confirm/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 TriggerEnum;
(function (TriggerEnum) {
  TriggerEnum["CLICK"] = "click";
  TriggerEnum["HOVER"] = "hover";
})(TriggerEnum || (TriggerEnum = {}));
function triggerType() {
  return __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a_toType__('trigger', {}).def(TriggerEnum.HOVER);
}
var PopConfirmEvent = (/* unused pure expression or super */ null && ({
  confirm: {
    type: Function,
    "default": function _default() {
      return {};
    }
  },
  cancel: {
    type: Function,
    "default": function _default() {
      return {};
    }
  }
  // ...TabNavEventProps,
}));
var PopConfirmProps = {
  /**
   * 触发方式
   * 支持 click hover
   */
  trigger: triggerType(),
  title: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string.def(''),
  content: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string.def(''),
  confirmText: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string.def(''),
  cancelText: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string.def(''),
  placement: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_placementType__().def(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PlacementEnum__.TOP_START),
  theme: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string.def('light'),
  /**
   * 自定义icon：根据确认框中提示文字的语境来选择 icon的样式，当确认操作存在风险时，可选择带警示的icon来引起用户的注意。
   */
  // icon: PropTypes.string.def(''),
  width: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.oneOfType([__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string, __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.number]).def('auto'),
  confirmConfig: __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a_toType__('ButtonPropTypes', {
    "default": {}
  }),
  cancelConfig: __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a_toType__('ButtonPropTypes', {
    "default": {}
  }),
  popoverOptions: __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a_toType__('PopoverPropTypes', {
    "default": {}
  })
};
/* harmony default export */ const props = (PopConfirmProps);
;// ../../packages/pop-confirm/src/pop-confirm.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 pop_confirm = (__WEBPACK_EXTERNAL_MODULE_vue_defineComponent__({
  name: 'PopConfirm',
  props: props,
  emits: ['confirm', 'cancel', 'after-show', 'after-hidden'],
  setup: function setup(_props, _ref) {
    var emit = _ref.emit;
    var visible = __WEBPACK_EXTERNAL_MODULE_vue_ref__(false);
    var t = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_useLocale__('popConfirm');
    function ensure(e) {
      visible.value = false;
      emit('confirm');
      e.stopPropagation();
    }
    function cancel(e) {
      visible.value = false;
      emit('cancel');
      e.stopPropagation();
    }
    function handleAfterShow() {
      visible.value = true;
      emit('after-show');
    }
    function handleAfterHidden() {
      emit('after-hidden');
    }
    // function renderIcon() {
    //   if (typeof slots.icon === 'function') {
    //     return slots.icon();
    //   }
    //   return props.icon;
    // }
    // const icon = renderIcon();
    var _usePrefix = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__(),
      resolveClassName = _usePrefix.resolveClassName;
    var popoverRef = __WEBPACK_EXTERNAL_MODULE_vue_ref__(null);
    return {
      popoverRef: popoverRef,
      visible: visible,
      t: t,
      // icon,
      resolveClassName: resolveClassName,
      ensure: ensure,
      cancel: cancel,
      handleAfterShow: handleAfterShow,
      handleAfterHidden: handleAfterHidden
    };
  },
  render: function render() {
    var _this = this;
    var titleRender = function titleRender() {
      return _this.title ? __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
        "class": "".concat(_this.resolveClassName('pop-confirm-title'))
      }, [typeof _this.$slots.icon === 'function' ? __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("span", {
        "class": "".concat(_this.resolveClassName('pop-confirm-icon'))
      }, [_this.$slots.icon()]) : null, __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("span", null, [_this.title])]) : '';
    };
    return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d_default__, __WEBPACK_EXTERNAL_MODULE_vue_mergeProps__({
      "ref": "popoverRef",
      "width": this.width,
      "extCls": "".concat(this.resolveClassName('pop-confirm-box')),
      "isShow": this.visible,
      "placement": this.placement,
      "theme": this.theme,
      "trigger": this.trigger
    }, this.popoverOptions, {
      "onAfterHidden": this.handleAfterHidden,
      "onAfterShow": this.handleAfterShow
    }), {
      "default": function _default() {
        return _this.$slots["default"]();
      },
      content: function content() {
        return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
          "class": "".concat(_this.resolveClassName('pop-confirm'))
        }, [typeof _this.$slots.content === 'function' ? __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_vue_Fragment__, null, [titleRender(), _this.$slots.content()]) : __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_vue_Fragment__, null, [titleRender(), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
          "class": "".concat(_this.resolveClassName('pop-confirm-content'))
        }, [_this.content])]), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
          "class": "".concat(_this.resolveClassName('pop-confirm-footer'))
        }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_button_a2ea7c9a_default__, __WEBPACK_EXTERNAL_MODULE_vue_mergeProps__({
          "size": "small",
          "theme": "primary"
        }, _this.confirmConfig, {
          "onClick": _this.ensure
        }), {
          "default": function _default() {
            return [_this.confirmText || _this.t.ok];
          }
        }), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_button_a2ea7c9a_default__, __WEBPACK_EXTERNAL_MODULE_vue_mergeProps__({
          "size": "small"
        }, _this.cancelConfig, {
          "onClick": _this.cancel
        }), {
          "default": function _default() {
            return [_this.cancelText || _this.t.cancel];
          }
        })])]);
      }
    });
  }
}));
;// ../../packages/pop-confirm/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 BKPopConfirm = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_withInstall__(pop_confirm);
/* harmony default export */ const src = (BKPopConfirm);
export { src as default };
