import{ay as e,az as s,k as a,g as t}from"../../../../../vendor-element-plus.js?ver=3.1.0";import{S as l}from"../../../../../SettingsHeader.js?ver=3.1.0";import{_ as i,I as o}from"../../../../../fc-bits-ui.js?ver=3.1.0";import{r,c,o as n,d,b as m,P as f,K as _,w as u,O as g}from"../../../../../vendor.js?ver=3.1.0";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"},P={class:"icon"},U={class:"fcrm-cleanup-preview"},F={class:"fcrm-preview-header"},H={class:"fcrm-preview-body"},W={class:"fcrm-preview-content"},B={class:"fcrm_secondary_text"},q={class:"fcrm-preview-footer"},z={class:"fcrm-preview-actions"};const K=i({name:"DatabaseReset",components:{Icons:o,SettingsHeader:l},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(l,i,o,K,L,N){const O=r("SettingsHeader"),Y=s,G=r("Icons"),J=a,Q=t,X=e;return n(),c("div",p,[d(O,{title:l.$t("CRM Database Reset")},null,8,["title"]),m("div",v,[m("div",b,[m("div",D,[m("div",h,[m("div",R,f(l.$t("Developer Mode Required:")),1),m("div",$,[m("span",null,f(l.$t("Add")),1),i[3]||(i[3]=m("code",null,"define('FLUENTCRM_IS_DEV_FEATURES', true);",-1)),m("span",null,f(l.$t("DBReset_WpConfig_Enable_Desc")),1)])])]),m("div",y,[m("div",C,[m("div",w,[m("h4",null,f(l.$t("Complete Data Removal")),1)])]),_((n(),c("div",k,[m("div",x,f(l.$t("The Deleted Modules will be:")),1),m("div",V,[m("div",E,[m("div",I,[m("ul",null,[m("li",null,f(l.$t("All contacts and subscriber data")),1),m("li",null,f(l.$t("Automation workflows and triggers")),1),m("li",null,f(l.$t("System logs and analytics data")),1)])]),m("div",M,[m("ul",null,[m("li",null,f(l.$t("Campaign history and email templates")),1),m("li",null,f(l.$t("Tags, lists, and custom fields")),1)])])])]),m("div",S,[d(Y,{modelValue:L.confirmDelete,"onUpdate:modelValue":i[0]||(i[0]=e=>L.confirmDelete=e),class:"fcrm_checkbox"},{default:u(()=>[m("div",A,[m("span",T,f(l.$t("Include Contact Info in Personal Data export by WP")),1),m("span",j,f(l.$t("DBReset_Erase_Data_Warn")),1)])],void 0),_:1},8,["modelValue"])]),d(J,{disabled:!L.confirmDelete,type:"danger",onClick:N.openResetDialog},{default:u(()=>[m("span",P,[d(G,{"icon-name":"delete"})]),g(" "+f(l.$t("Permanently Erase FluentCRM Data")),1)],void 0),_:1},8,["disabled","onClick"]),d(Q,{modelValue:L.resetDialogVisible,"onUpdate:modelValue":i[2]||(i[2]=e=>L.resetDialogVisible=e),"modal-class":"fcrm_cleanup-preview_dialog","append-to-body":"","show-close":!1},{default:u(()=>[m("div",U,[m("div",F,[m("h4",null,f(l.$t("Confirm Database Reset")),1),m("button",{class:"fcrm-close-button",onClick:i[1]||(i[1]=(...e)=>N.closeResetDialog&&N.closeResetDialog(...e))},[d(G,{"icon-name":"close"})])]),m("div",H,[m("div",W,[m("p",B,f(l.$t("Are you sure, you want to reset the CRM Database?")),1)])]),m("div",q,[m("div",z,[d(J,{onClick:N.closeResetDialog},{default:u(()=>[g(f(l.$t("Cancel")),1)],void 0,!0),_:1},8,["onClick"]),d(J,{type:"danger",loading:L.loading,onClick:N.confirmResetDatabase},{default:u(()=>[g(f(l.$t("Yes")),1)],void 0,!0),_:1},8,["loading","onClick"])])])])],void 0),_:1},8,["modelValue"])])),[[X,L.loading]])])])])])}],["__scopeId","data-v-242852de"]]);export{K as default};
