import{ay as e,az as a,k as s,g as t}from"../../../../../vendor-element-plus.js?ver=3.1.8";import{aQ as l,W as i,X as o,ab as r,Z as c,aa as n,a6 as d,a5 as m,a9 as f}from"../../../../../vendor.js?ver=3.1.8";import{S as _}from"../../../../../SettingsHeader.js?ver=3.1.8";import{_ as u,I as g}from"../../../../../fc-bits-ui.js?ver=3.1.8";const p={class:"fcrm_settings fcrm_min_bg fcrm_view"},v={class:"fcrm_body"},b={class:"fcrm_max_w_800"},D={class:"fcrm_report_card"},h={class:"fcrm_report_card_body"},R={class:"font-semibold fcrm_mb_4"},$={class:"d-flex items-center gap-4 flex-wrap"},y={class:"fcrm_report_card fcrm_danger_border"},C={class:"fcrm_report_card_header"},w={class:"fcrm_report_card_title_group"},k={class:"fcrm_report_card_body"},x={class:"font-medium fcrm_mb_10"},V={class:"fcrm-danger-list"},E={class:"fcrm-danger-list-row"},I={class:"fcrm-danger-column"},M={class:"fcrm-danger-column"},S={class:"fcrm-danger-confirm"},A={class:"fcrm_checkbox_text"},T={class:"fcrm_checkbox_text_title"},j={class:"fcrm_checkbox_text_desc"},U={class:"icon"},W={class:"fcrm-cleanup-preview"},F={class:"fcrm-preview-header"},H={class:"fcrm-preview-body"},P={class:"fcrm-preview-content"},B={class:"fcrm_secondary_text"},q={class:"fcrm-preview-footer"},z={class:"fcrm-preview-actions"};const L=u({name:"DatabaseReset",components:{Icons:g,SettingsHeader:_},data:()=>({loading:!1,confirmDelete:!1,resetDialogVisible:!1}),methods:{openResetDialog(){this.resetDialogVisible=!0},closeResetDialog(){this.resetDialogVisible=!1},confirmResetDatabase(){this.resetDialogVisible=!1,this.resetDatabase()},resetDatabase(){this.loading=!0,this.$post("setting/reset_db").then(e=>{this.$notify.success(e.message),this.loading=!1,this.confirmDelete=!1}).catch(e=>{this.handleError(e),this.loading=!1}).finally(()=>{this.loading=!1})}},mounted(){this.changeTitle(this.$t("CRM Database Reset"))}},[["render",function(_,u,g,L,N,Q){const X=l("SettingsHeader"),Y=a,Z=l("Icons"),G=s,J=t,K=e;return i(),o("div",p,[r(X,{title:_.$t("CRM Database Reset")},null,8,["title"]),c("div",v,[c("div",b,[c("div",D,[c("div",h,[c("div",R,n(_.$t("Developer Mode Required:")),1),c("div",$,[c("span",null,n(_.$t("Add")),1),u[3]||(u[3]=c("code",null,"define('FLUENTCRM_IS_DEV_FEATURES', true);",-1)),c("span",null,n(_.$t("DBReset_WpConfig_Enable_Desc")),1)])])]),c("div",y,[c("div",C,[c("div",w,[c("h4",null,n(_.$t("Complete Data Removal")),1)])]),d((i(),o("div",k,[c("div",x,n(_.$t("The Deleted Modules will be:")),1),c("div",V,[c("div",E,[c("div",I,[c("ul",null,[c("li",null,n(_.$t("All contacts and subscriber data")),1),c("li",null,n(_.$t("Automation workflows and triggers")),1),c("li",null,n(_.$t("System logs and analytics data")),1)])]),c("div",M,[c("ul",null,[c("li",null,n(_.$t("Campaign history and email templates")),1),c("li",null,n(_.$t("Tags, lists, and custom fields")),1)])])])]),c("div",S,[r(Y,{modelValue:N.confirmDelete,"onUpdate:modelValue":u[0]||(u[0]=e=>N.confirmDelete=e),class:"fcrm_checkbox"},{default:m(()=>[c("div",A,[c("span",T,n(_.$t("Include Contact Info in Personal Data export by WP")),1),c("span",j,n(_.$t("DBReset_Erase_Data_Warn")),1)])],void 0),_:1},8,["modelValue"])]),r(G,{disabled:!N.confirmDelete,type:"danger",onClick:Q.openResetDialog},{default:m(()=>[c("span",U,[r(Z,{"icon-name":"delete"})]),f(" "+n(_.$t("Permanently Erase FluentCRM Data")),1)],void 0),_:1},8,["disabled","onClick"]),r(J,{modelValue:N.resetDialogVisible,"onUpdate:modelValue":u[2]||(u[2]=e=>N.resetDialogVisible=e),"modal-class":"fcrm_cleanup-preview_dialog","append-to-body":"","show-close":!1},{default:m(()=>[c("div",W,[c("div",F,[c("h4",null,n(_.$t("Confirm Database Reset")),1),c("button",{class:"fcrm-close-button",onClick:u[1]||(u[1]=(...e)=>Q.closeResetDialog&&Q.closeResetDialog(...e))},[r(Z,{"icon-name":"close"})])]),c("div",H,[c("div",P,[c("p",B,n(_.$t("Are you sure, you want to reset the CRM Database?")),1)])]),c("div",q,[c("div",z,[r(G,{onClick:Q.closeResetDialog},{default:m(()=>[f(n(_.$t("Cancel")),1)],void 0,!0),_:1},8,["onClick"]),r(G,{type:"danger",loading:N.loading,onClick:Q.confirmResetDatabase},{default:m(()=>[f(n(_.$t("Yes")),1)],void 0,!0),_:1},8,["loading","onClick"])])])])],void 0),_:1},8,["modelValue"])])),[[K,N.loading]])])])])])}],["__scopeId","data-v-242852de"]]);export{L as default};
