import{a6 as e,k as t,E as i,aO as s}from"./vendor-element-plus.js?ver=3.1.10";import{aQ as n,W as o,Y as r,a5 as a,Z as c,ab as d,a9 as l,aa as m,_ as f}from"./vendor.js?ver=3.1.10";import{_ as p}from"./fc-bits-ui.js?ver=3.1.10";const u=["innerHTML"],h={class:"action-buttons"};const v=p({name:"Confirm",components:{Delete:e},emits:["no","yes"],props:{placement:{type:String,default:"top-end"},message:{type:String,default:"Are you sure to delete this?"},width:{type:[Number,String],default:180},confirmText:{type:String,default:""},cancelText:{type:String,default:""},confirmType:{type:String,default:"danger"}},data:()=>({visible:!1,_confirmed:!1}),computed:{confirmTextComputed(){return this.confirmText||this.$t("Yes")},cancelTextComputed(){return this.cancelText||this.$t("No")},confirmButtonType(){return this.confirmType||"danger"}},methods:{show(){this._confirmed=!1,this.visible=!0},hide(){this.visible=!1},confirm(){this._confirmed=!0,this.hide(),this.$emit("yes")},cancel(){this._confirmed=!1,this.hide(),this.$emit("no")},onHide(){this._confirmed||this.$emit("no")}}},[["render",function(e,p,v,y,_,b){const T=t,g=n("Delete"),x=i,C=s;return o(),r(C,{width:v.width,onHide:b.onHide,visible:_.visible,"onUpdate:visible":p[2]||(p[2]=e=>_.visible=e),placement:v.placement,trigger:"click"},{reference:a(()=>[f(e.$slots,"reference",{},()=>[f(e.$slots,"default",{},()=>[d(x,{style:{cursor:"pointer"}},{default:a(()=>[d(g)],void 0,!0),_:1})])])]),default:a(()=>[c("p",{innerHTML:v.message,class:"fcrm_secondary_text fcrm_mb_12"},null,8,u),c("div",h,[d(T,{size:"small",class:"fcrm_secondary_btn",onClick:p[0]||(p[0]=e=>b.cancel())},{default:a(()=>[l(m(b.cancelTextComputed),1)],void 0,!0),_:1}),d(T,{type:b.confirmButtonType,size:"small",onClick:p[1]||(p[1]=e=>b.confirm())},{default:a(()=>[l(m(b.confirmTextComputed),1)],void 0,!0),_:1},8,["type"])])],void 0),_:3},8,["width","onHide","visible","placement"])}]]);export{v as C};
