Files
gustavoo-me/wp-content/plugins/fluent-crm/assets/admin/Modules/Dashboard/Dashboard.js
T
2026-07-23 22:56:30 -03:00

2 lines
47 KiB
JavaScript

import{ay as t,at as e,j as a,k as s,E as i,h as n,i as o,aC as r,aB as l,aA as c,aD as d,aj as m,a4 as h,ag as _,y as u,aY as f,aJ as p,g}from"../../../vendor-element-plus.js?ver=3.1.8";import{aQ as b,a6 as y,W as v,X as C,ab as w,Y as x,a5 as k,J as L,az as $,Z as T,aa as S,$ as E,a9 as A,a0 as I,a8 as V,ad as D,a7 as H,b2 as M,ax as B,av as R}from"../../../vendor.js?ver=3.1.8";import{E as O}from"../../../_eChart.js?ver=3.1.8";import{f as P,b as q,$ as F,d as j,g as W}from"../../../data_config.js?ver=3.1.8";import{_ as N,a as z,T as Z,I as G}from"../../../fc-bits-ui.js?ver=3.1.8";import{C as U}from"../../../CustomIcon.js?ver=3.1.8";import{C as K}from"../../../CalendarIcon.js?ver=3.1.8";import{B as Y}from"../../../Badge.js?ver=3.1.8";import{B as Q}from"../../../BaseCard.js?ver=3.1.8";import{f as J}from"../../../fluentcrm-logo.js?ver=3.1.8";const X=N({name:"SubscribersGrowth",components:{EChart:O},props:{date_range:{type:[String,Object,Array],required:!0}},data:()=>({fetching:!1,initialLoad:!0,stats:{},maxCumulativeValue:0,freshOptions:null,current_mode:"system"===Z.getCurrentTheme()?Z.getSystemTheme():Z.getCurrentTheme()}),mounted(){this.fetchReport(),this.onThemeChanged=t=>{var e;this.current_mode=(null==(e=t.detail)?void 0:e.effective)||Z.getCurrentTheme(),this.stats&&Object.keys(this.stats).length&&this.setupChartItems()},window.addEventListener(z,this.onThemeChanged)},beforeUnmount(){this.onThemeChanged&&window.removeEventListener(z,this.onThemeChanged)},watch:{date_range(){this.fetchReport()}},methods:{fetchReport(){this.fetching=!0,this.$get("reports/subscribers",{date_range:this.date_range}).then(t=>{var e,a;this.stats=(null==(a=null==(e=t.data_sets)?void 0:e[0])?void 0:a.data)||{},this.setupChartItems()}).finally(()=>{this.fetching=!1,this.initialLoad=!1})},setupChartItems(){const t=[],e={label:this.$t("By Date"),backgroundColor:"#ff7f0e",borderColor:"#ff7f0e",data:[],fill:!1,type:"line"},a={label:this.$t("Cumulative"),backgroundColor:"rgba(111, 66, 193, 0.1)",borderColor:"#6f42c1",data:[],type:"line"};let s=0;this.each(this.stats,(i,n)=>{e.data.push(i),t.push(n),s+=parseInt(i,10),a.data.push(s)});const i=/^[A-Za-z]{3} \d{4}$/;t.every(t=>i.test(t))||t.sort(),this.maxCumulativeValue=s+10;const n=q(t,this.date_range);this.renderChart(n,e,a)},renderChart(t,e,a){const s=this.date_range;this.freshOptions={tooltip:{show:!0,showContent:!0,appendToBody:!0,confine:!1,triggerOn:"mousemove|click",transitionDuration:.1,trigger:"axis",backgroundColor:"light"===this.current_mode?"#ffffff":"#283b56",borderColor:"light"===this.current_mode?"#ffffff":"#283b56",borderWidth:1,color:"#ffffff",formatter:t=>{const e=t[0]&&t[0].axisValue;return P(e,s)+"<br/>"+t.map(t=>`<span style="display:inline-block;margin-right:4px;border-radius:4px;width:10px;height:10px;background-color:${t.color};"></span>`+" "+t.seriesName+": "+t.value).join("<br/>")},axisPointer:{type:"cross",label:{backgroundColor:"#283b56"},crossStyle:{color:"#999"}},extraCssText:"z-index:10000; pointer-events:auto;",textStyle:{color:"light"===this.current_mode?"#0E121B":"#ffffff"}},legend:{top:10,left:"center",data:[e.label,a.label],icon:"roundRect",itemWidth:12,itemHeight:12,itemGap:20,textStyle:{color:"light"===this.current_mode?"#0E121B":"#ffffff"}},grid:{top:40,left:40,right:40,bottom:40,containLabel:!0},xAxis:{type:"category",data:t,axisPointer:{type:"shadow"},splitLine:{show:!1},axisLabel:{color:"light"===this.current_mode?"#0E121B":"#9CA3AF"}},yAxis:[{type:"value",min:0,name:e.label,minInterval:1,axisLabel:{formatter:t=>Number.isInteger(t)?t:""},splitLine:{lineStyle:{color:"light"===this.current_mode?"#E1E4EA":"#2c3c4e",type:"dashed"}}},{type:"value",min:0,name:a.label,max:this.maxCumulativeValue||null,minInterval:1,axisLabel:{formatter:t=>Number.isInteger(t)?t:""},splitLine:{lineStyle:{color:"light"===this.current_mode?"#E1E4EA":"#2c3c4e",type:"dashed"}}}],series:[{name:e.label,type:"line",data:e.data,yAxisIndex:0,itemStyle:{color:e.backgroundColor},emphasis:{focus:"series"}},{name:a.label,type:"line",data:a.data,yAxisIndex:1,smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:a.borderColor},lineStyle:{color:a.borderColor,width:2}}]}}}},[["render",function(e,a,s,i,n,o){const r=b("EChart"),l=t;return y((v(),C("div",null,[w(r,{options:n.freshOptions},null,8,["options"])])),[[l,n.fetching&&!n.initialLoad]])}]]);const tt=N({name:"email-sent-growth",props:["date_range"],components:{EChart:O},data:()=>({fetching:!1,initialLoad:!0,stats:{},maxCumulativeValue:0,freshOptions:null,current_mode:"system"===Z.getCurrentTheme()?Z.getSystemTheme():Z.getCurrentTheme()}),computed:{},methods:{fetchReport(){this.fetching=!0,this.$get("reports/email-sents",{date_range:this.date_range}).then(t=>{this.stats=t.stats,this.setupChartItems()}).finally(()=>{this.fetching=!1,this.initialLoad=!1})},setupChartItems(){const t=[],e={label:this.$t("By Date"),borderColor:"#ff7f0e",data:[]},a={label:this.$t("Cumulative"),borderColor:"#6f42c1",data:[]};let s=0;this.each(this.stats,(i,n)=>{e.data.push(i),t.push(n),s+=parseInt(i),a.data.push(s)}),this.maxCumulativeValue=s+10;const i=q(t,this.date_range),n=this.date_range;this.freshOptions={tooltip:{show:!0,showContent:!0,appendToBody:!0,confine:!1,triggerOn:"mousemove|click",transitionDuration:.1,trigger:"axis",backgroundColor:"light"===this.current_mode?"#ffffff":"#283b56",borderColor:"light"===this.current_mode?"#ffffff":"#283b56",borderWidth:1,color:"#ffffff",formatter:t=>{const e=t[0]&&t[0].axisValue;return P(e,n)+"<br/>"+t.map(t=>`<span style="display:inline-block;margin-right:4px;border-radius:4px;width:10px;height:10px;background-color:${t.color};"></span>`+" "+t.seriesName+": "+t.value).join("<br/>")},axisPointer:{type:"cross",label:{backgroundColor:"#283b56"},crossStyle:{color:"#999"}},extraCssText:"z-index:10000; pointer-events:auto;",textStyle:{color:"light"===this.current_mode?"#0E121B":"#ffffff"}},legend:{top:10,left:"center",data:[e.label,a.label],icon:"roundRect",itemWidth:12,itemHeight:12,itemGap:20,textStyle:{color:"light"===this.current_mode?"#0E121B":"#ffffff"}},grid:{top:40,left:40,right:40,bottom:40,containLabel:!0},xAxis:{type:"category",data:i,axisPointer:{type:"shadow"},splitLine:{show:!1},axisLabel:{color:"light"===this.current_mode?"#0E121B":"#9CA3AF"}},yAxis:[{type:"value",min:0,name:e.label,minInterval:1,axisLabel:{formatter:t=>Number.isInteger(t)?t:""},splitLine:{lineStyle:{color:"light"===this.current_mode?"#E1E4EA":"#2c3c4e",type:"dashed"}}},{type:"value",min:0,name:a.label,max:this.maxCumulativeValue||null,minInterval:1,axisLabel:{formatter:t=>Number.isInteger(t)?t:""},splitLine:{lineStyle:{color:"light"===this.current_mode?"#E1E4EA":"#2c3c4e",type:"dashed"}}}],series:[{name:e.label,type:"line",data:e.data,yAxisIndex:0,itemStyle:{color:e.borderColor},emphasis:{focus:"series"}},{name:a.label,type:"line",data:a.data,yAxisIndex:1,smooth:!1,symbol:"circle",symbolSize:4,itemStyle:{color:a.borderColor},lineStyle:{color:a.borderColor,width:2}}]}}},mounted(){this.fetchReport(),this.onThemeChanged=t=>{var e;this.current_mode=(null==(e=t.detail)?void 0:e.effective)||Z.getCurrentTheme(),this.stats&&Object.keys(this.stats).length&&this.setupChartItems()},window.addEventListener(z,this.onThemeChanged)},beforeUnmount(){this.onThemeChanged&&window.removeEventListener(z,this.onThemeChanged)}},[["render",function(e,a,s,i,n,o){const r=b("EChart"),l=t;return y((v(),C("div",null,[w(r,{options:n.freshOptions},null,8,["options"])])),[[l,n.fetching&&!n.initialLoad]])}]]);const et=N({name:"email-open-chart",props:["date_range"],components:{EChart:O},data:()=>({fetching:!1,initialLoad:!0,stats:{},maxCumulativeValue:0,freshOptions:null,current_mode:"system"===Z.getCurrentTheme()?Z.getSystemTheme():Z.getCurrentTheme()}),computed:{},methods:{fetchReport(){this.fetching=!0,this.$get("reports/email-opens",{date_range:this.date_range}).then(t=>{this.stats=t.stats,this.setupChartItems()}).finally(()=>{this.fetching=!1,this.initialLoad=!1})},setupChartItems(){const t=[],e={label:this.$t("By Date"),borderColor:"#ff7f0e",data:[]},a={label:this.$t("Cumulative"),borderColor:"#6f42c1",data:[]};let s=0;this.each(this.stats,(i,n)=>{e.data.push(i),t.push(n),s+=parseInt(i),a.data.push(s)}),this.maxCumulativeValue=s+10;const i=q(t,this.date_range),n=this.date_range;this.freshOptions={tooltip:{show:!0,showContent:!0,appendToBody:!0,confine:!1,triggerOn:"mousemove|click",transitionDuration:.1,trigger:"axis",backgroundColor:"light"===this.current_mode?"#ffffff":"#283b56",borderColor:"light"===this.current_mode?"#ffffff":"#283b56",borderWidth:1,color:"#ffffff",formatter:t=>{const e=t[0]&&t[0].axisValue;return P(e,n)+"<br/>"+t.map(t=>`<span style="display:inline-block;margin-right:4px;border-radius:4px;width:10px;height:10px;background-color:${t.color};"></span>`+" "+t.seriesName+": "+t.value).join("<br/>")},axisPointer:{type:"cross",label:{backgroundColor:"#283b56"},crossStyle:{color:"#999"}},extraCssText:"z-index:10000; pointer-events:auto;",textStyle:{color:"light"===this.current_mode?"#0E121B":"#ffffff"}},legend:{top:10,left:"center",data:[e.label,a.label],icon:"roundRect",itemWidth:12,itemHeight:12,itemGap:20,textStyle:{color:"light"===this.current_mode?"#0E121B":"#ffffff"}},grid:{top:40,left:40,right:40,bottom:40,containLabel:!0},xAxis:{type:"category",data:i,axisPointer:{type:"shadow"},splitLine:{show:!1},axisLabel:{color:"light"===this.current_mode?"#0E121B":"#9CA3AF"}},yAxis:[{type:"value",min:0,name:e.label,minInterval:1,axisLabel:{formatter:t=>Number.isInteger(t)?t:""},splitLine:{lineStyle:{color:"light"===this.current_mode?"#E1E4EA":"#2c3c4e",type:"dashed"}}},{type:"value",min:0,name:a.label,max:this.maxCumulativeValue||null,minInterval:1,axisLabel:{formatter:t=>Number.isInteger(t)?t:""},splitLine:{lineStyle:{color:"light"===this.current_mode?"#E1E4EA":"#2c3c4e",type:"dashed"}}}],series:[{name:e.label,type:"line",data:e.data,yAxisIndex:0,itemStyle:{color:e.borderColor},emphasis:{focus:"series"}},{name:a.label,type:"line",data:a.data,yAxisIndex:1,smooth:!1,symbol:"circle",symbolSize:4,itemStyle:{color:a.borderColor},lineStyle:{color:a.borderColor,width:2}}]}}},mounted(){this.fetchReport(),this.onThemeChanged=t=>{var e;this.current_mode=(null==(e=t.detail)?void 0:e.effective)||Z.getCurrentTheme(),this.stats&&Object.keys(this.stats).length&&this.setupChartItems()},window.addEventListener(z,this.onThemeChanged)},beforeUnmount(){this.onThemeChanged&&window.removeEventListener(z,this.onThemeChanged)}},[["render",function(e,a,s,i,n,o){const r=b("EChart"),l=t;return y((v(),C("div",null,[w(r,{options:n.freshOptions},null,8,["options"])])),[[l,n.fetching&&!n.initialLoad]])}]]);const at=N({name:"email-click-chart",props:["date_range"],components:{EChart:O},data:()=>({fetching:!1,initialLoad:!0,stats:{},maxCumulativeValue:0,freshOptions:null,current_mode:"system"===Z.getCurrentTheme()?Z.getSystemTheme():Z.getCurrentTheme()}),computed:{},methods:{fetchReport(){this.fetching=!0,this.$get("reports/email-clicks",{date_range:this.date_range}).then(t=>{this.stats=t.stats,this.setupChartItems()}).finally(()=>{this.fetching=!1,this.initialLoad=!1})},setupChartItems(){const t=[],e={label:this.$t("By Date"),borderColor:"#ff7f0e",data:[]},a={label:this.$t("Cumulative"),borderColor:"#6f42c1",data:[]};let s=0;this.each(this.stats,(i,n)=>{e.data.push(i),t.push(n),s+=parseInt(i),a.data.push(s)}),this.maxCumulativeValue=s+10;const i=q(t,this.date_range),n=this.date_range;this.freshOptions={tooltip:{show:!0,showContent:!0,appendToBody:!0,confine:!1,triggerOn:"mousemove|click",transitionDuration:.1,trigger:"axis",backgroundColor:"light"===this.current_mode?"#ffffff":"#283b56",borderColor:"light"===this.current_mode?"#ffffff":"#283b56",borderWidth:1,color:"#ffffff",formatter:t=>{const e=t[0]&&t[0].axisValue;return P(e,n)+"<br/>"+t.map(t=>`<span style="display:inline-block;margin-right:4px;border-radius:4px;width:10px;height:10px;background-color:${t.color};"></span>`+" "+t.seriesName+": "+t.value).join("<br/>")},axisPointer:{type:"cross",label:{backgroundColor:"#283b56"},crossStyle:{color:"#999"}},extraCssText:"z-index:10000; pointer-events:auto;",textStyle:{color:"light"===this.current_mode?"#0E121B":"#ffffff"}},legend:{top:10,left:"center",data:[e.label,a.label],icon:"roundRect",itemWidth:12,itemHeight:12,itemGap:20,textStyle:{color:"light"===this.current_mode?"#0E121B":"#ffffff"}},grid:{top:40,left:40,right:40,bottom:40,containLabel:!0},xAxis:{type:"category",data:i,axisPointer:{type:"shadow"},splitLine:{show:!1},axisLabel:{color:"light"===this.current_mode?"#0E121B":"#9CA3AF"}},yAxis:[{type:"value",min:0,name:e.label,minInterval:1,axisLabel:{formatter:t=>Number.isInteger(t)?t:""},splitLine:{lineStyle:{color:"light"===this.current_mode?"#E1E4EA":"#2c3c4e",type:"dashed"}}},{type:"value",min:0,name:a.label,max:this.maxCumulativeValue||null,minInterval:1,axisLabel:{formatter:t=>Number.isInteger(t)?t:""},splitLine:{lineStyle:{color:"light"===this.current_mode?"#E1E4EA":"#2c3c4e",type:"dashed"}}}],series:[{name:e.label,type:"line",data:e.data,yAxisIndex:0,itemStyle:{color:e.borderColor},emphasis:{focus:"series"}},{name:a.label,type:"line",data:a.data,yAxisIndex:1,smooth:!1,symbol:"circle",symbolSize:4,itemStyle:{color:a.borderColor},lineStyle:{color:a.borderColor,width:2}}]}}},mounted(){this.fetchReport(),this.onThemeChanged=t=>{var e;this.current_mode=(null==(e=t.detail)?void 0:e.effective)||Z.getCurrentTheme(),this.stats&&Object.keys(this.stats).length&&this.setupChartItems()},window.addEventListener(z,this.onThemeChanged)},beforeUnmount(){this.onThemeChanged&&window.removeEventListener(z,this.onThemeChanged)}},[["render",function(e,a,s,i,n,o){const r=b("EChart"),l=t;return y((v(),C("div",null,[w(r,{options:n.freshOptions},null,8,["options"])])),[[l,n.fetching&&!n.initialLoad]])}]]),st={class:"icon"},it={class:"fcrm_perf_bars"},nt={class:"fcrm_perf_bar_header"},ot={class:"fcrm_perf_bar_label"},rt={class:"fcrm_perf_value"},lt={class:"fcrm_perf_count"},ct={class:"fcrm_perf_pct"},dt={class:"fcrm_perf_bar"};const mt=N({name:"_EmailPerformance",components:{ArrowDown:e,BaseCard:Q},data:()=>({fetching:!1,period:"30d",periodOptions:{"30d":"30 Days","60d":"60 Days","90d":"90 Days",all:"All Time"},statsTotals:{sent:0,delivered:0,opened:0,clicked:0,bounced:0}}),computed:{funnelData(){const t=this.statsTotals.sent;return[{name:"Sent",value:t,color:"#7B61FF"},{name:"Delivered",value:this.statsTotals.delivered,color:"#F6B51E"},{name:"Opened",value:this.statsTotals.opened,color:"#22D3BB"},{name:"Clicked",value:this.statsTotals.clicked,color:"#F6B51E"},{name:"Bounced",value:this.statsTotals.bounced,color:"#335CFF"}].map(e=>({...e,percent:t?Math.min(e.value/t*100,100):0,pctText:t?(e.value/t*100).toFixed(1):"0.0"}))},periodDays(){return{"30d":30,"60d":60,"90d":90}[this.period]||0}},methods:{fetchReport(){this.fetching=!0;const t={days:this.periodDays};this.$get("reports/email-performance",t).then(t=>{this.statsTotals.sent=t.stats.totals.sent,this.statsTotals.delivered=t.stats.totals.delivered,this.statsTotals.opened=t.stats.totals.opened,this.statsTotals.clicked=t.stats.totals.clicked,this.statsTotals.bounced=t.stats.totals.bounced}).catch(t=>{this.handleError(t)}).finally(()=>{this.fetching=!1})},handlePeriodChange(t){this.period=t,this.fetchReport()},formatNumber:t=>Number(t).toLocaleString()},mounted(){this.fetchReport()}},[["render",function(e,r,l,c,d,m){const h=b("ArrowDown"),_=i,u=s,f=o,p=n,g=a,V=b("BaseCard"),D=t;return v(),x(V,null,{title:k(()=>[T("h4",null,S(e.$t("Email Performance")),1)]),header_action:k(()=>[w(g,{trigger:"click",onCommand:m.handlePeriodChange},{dropdown:k(()=>[w(p,{class:"fc_dropdown"},{default:k(()=>[(v(!0),C(L,null,$(d.periodOptions,(t,a)=>(v(),x(f,{key:a,command:a,class:I({"is-active":d.period===a})},{default:k(()=>[A(S(e.$t(t)),1)],void 0,!0),_:2},1032,["command","class"]))),128))],void 0,!0),_:1})]),default:k(()=>[w(u,{size:"small","aria-label":e.$t("Select Period")},{default:k(()=>[A(S(e.$t(d.periodOptions[d.period]))+" ",1),T("span",st,[w(_,null,{default:k(()=>[w(h)],void 0,!0),_:1})])],void 0,!0),_:1},8,["aria-label"])],void 0,!0),_:1},8,["onCommand"])]),body:k(()=>[y((v(),C("div",it,[(v(!0),C(L,null,$(m.funnelData,t=>(v(),C("div",{key:t.name,class:"fcrm_perf_row"},[T("div",nt,[T("span",ot,S(e.$t(t.name)),1),T("div",rt,[T("span",lt,S(m.formatNumber(t.value)),1),T("span",ct,S(t.pctText)+"%",1)])]),T("div",dt,[T("div",{class:"fcrm_perf_bar_inner",style:E({width:t.percent+"%",backgroundColor:t.color})},null,4)])]))),128))])),[[D,d.fetching]])]),_:1})}]]),ht={class:"fcrm_dashboard_loader"},_t={class:"fcrm_dashboard_user"},ut={class:"fcrm_dashboard_user_image"},ft={class:"fcrm_dashboard_user_info"},pt={class:"fcrm_card_widgets"},gt={class:"fcrm_card_widgets--header"},bt={class:"fcrm_card_widget_icon fcrm_p_0"},yt={class:"fcrm_card_widget_title"},vt={class:"fcrm_card_widget_content",style:{"margin-top":"15px"}},Ct={class:"el-dropdown-link cursor_pointer"},wt={class:"icon"},xt={class:"fluentcrm-templates-action-buttons fluentcrm-actions fcrm-dashboard-filters"},kt={class:"w-full d-flex flex-column gap-4"},Lt={class:"fcrm_dashboard_entity_card__item_content"},$t={class:"fcrm_dashboard_entity_card__item_title"},Tt={class:"fcrm_dashboard_entity_card__stats"},St={class:"fcrm_dashboard_entity_card__stat"},Et={class:"fcrm_dashboard_entity_card__stat"},At={class:"fcrm_dashboard_entity_card__stat"},It={class:"fcrm_dashboard_entity_card__stat fcrm_dashboard_entity_card__stat_open_rate"},Vt={class:"fcrm_contact_automation_stats"},Dt={class:"w-full d-flex flex-column gap-4"},Ht={class:"fcrm_dashboard_entity_card__item_media"},Mt={class:"fcrm_dashboard_user_image"},Bt={class:"fcrm_dashboard_entity_card__item_content"},Rt={class:"fcrm_dashboard_entity_card__item_title"},Ot={class:"fcrm_dashboard_entity_card__item_subtitle"},Pt={class:"fcrm_dashboard_entity_card__item_meta"},qt={class:"w-full d-flex flex-column gap-4"},Ft={class:"fcrm_dashboard_entity_card__item_content"},jt={class:"fcrm_dashboard_entity_card__item_title"},Wt={class:"fcrm_dashboard_entity_card__item_subtitle"},Nt={class:"fc_lined_items"},zt={class:"fc_li_title"},Zt={class:"fc_li_value",style:{float:"none"}};const Gt=N({name:"DashboardLoader",components:{ArrowDown:e,BaseCard:Q},data:()=>({widgets:[1,2,3,4]})},[["render",function(t,e,a,s,n,o){const m=r,h=l,_=b("ArrowDown"),u=i,f=b("BaseCard"),p=c,g=d;return v(),C("div",ht,[T("div",_t,[T("div",ut,[w(h,{animated:""},{template:k(()=>[w(m,{variant:"circle",style:{width:"48px",height:"48px","border-radius":"50%"}})]),_:1})]),T("div",ft,[w(h,{animated:""},{template:k(()=>[w(m,{style:{width:"200px","margin-bottom":"4px"}})]),_:1}),w(h,{animated:""},{template:k(()=>[w(m,{style:{width:"150px"}})]),_:1})])]),w(g,{gutter:24},{default:k(()=>[w(p,{sm:24,md:16,lg:16},{default:k(()=>[T("div",pt,[(v(!0),C(L,null,$(n.widgets,t=>(v(),C("div",{key:t,class:"fcrm_card_widget"},[T("div",gt,[T("div",bt,[w(h,{animated:"",style:{height:"100%",width:"100%"}},{template:k(()=>[w(m,{variant:"circle",style:{width:"100%",height:"100%","border-radius":"8px"}})]),_:1})]),T("div",yt,[w(h,{animated:""},{template:k(()=>[w(m,{style:{width:"80px"}})]),_:1})])]),T("div",vt,[w(h,{animated:""},{template:k(()=>[w(m,{style:{width:"70%"}})]),_:1})])]))),128))]),w(f,{class:"fcrm_subscriber_growth_card"},{title:k(()=>[T("h4",Ct,[A(S(t.$t("Subscribers Growth"))+" ",1),T("span",wt,[w(u,null,{default:k(()=>[w(_)],void 0,!0),_:1})])])]),header_action:k(()=>[T("div",xt,[w(h,{animated:""},{template:k(()=>[w(m,{style:{width:"200px",height:"36px"}})]),_:1})])]),body:k(()=>[w(h,{animated:"",rows:10})]),_:1}),w(f,{body_class:"fcrm_p_12",class:"fc_m_24"},{title:k(()=>[T("h4",null,S(t.$t("Recent Campaigns")),1)]),header_action:k(()=>[w(h,{animated:""},{template:k(()=>[w(m,{style:{width:"80px",height:"28px"}})]),_:1})]),body:k(()=>[T("div",kt,[(v(),C(L,null,$(3,t=>T("div",{key:t,class:"fcrm_dashboard_entity_card__item"},[T("div",Lt,[T("p",$t,[w(h,{animated:"",style:{width:"300px"}},{template:k(()=>[w(m,{style:{width:"70%"}})]),_:1})]),T("div",Tt,[T("div",St,[w(h,{animated:""},{template:k(()=>[w(m,{style:{width:"30px"}})]),_:1})]),e[0]||(e[0]=T("span",{class:"fcrm_dashboard_entity_card__stat_dot"},null,-1)),T("div",Et,[w(h,{animated:""},{template:k(()=>[w(m,{style:{width:"30px"}})]),_:1})]),e[1]||(e[1]=T("span",{class:"fcrm_dashboard_entity_card__stat_dot"},null,-1)),T("div",At,[w(h,{animated:""},{template:k(()=>[w(m,{style:{width:"30px"}})]),_:1})]),T("div",It,[w(h,{animated:""},{template:k(()=>[w(m,{style:{width:"50px"}})]),_:1})])])])])),64))])]),_:1}),T("div",Vt,[w(f,{body_class:"fcrm_p_12"},{title:k(()=>[T("h4",null,S(t.$t("Recent Contacts")),1)]),header_action:k(()=>[w(h,{animated:""},{template:k(()=>[w(m,{style:{width:"80px",height:"28px"}})]),_:1})]),body:k(()=>[T("div",Dt,[(v(),C(L,null,$(3,t=>T("div",{key:t,class:"fcrm_dashboard_entity_card__item"},[T("div",Ht,[T("div",Mt,[w(h,{animated:""},{template:k(()=>[w(m,{variant:"circle",style:{width:"40px",height:"40px","border-radius":"50%"}})]),_:1})])]),T("div",Bt,[T("p",Rt,[w(h,{animated:"",style:{width:"200px"}},{template:k(()=>[w(m,{style:{width:"40%",height:"10px","margin-bottom":"4px"}})]),_:1})]),T("span",Ot,[w(h,{animated:"",style:{width:"200px"}},{template:k(()=>[w(m,{style:{width:"60%",height:"10px"}})]),_:1})])]),T("div",Pt,[w(h,{animated:""},{template:k(()=>[w(m,{style:{width:"80px",height:"14px","margin-bottom":"4px"}})]),_:1})])])),64))])]),_:1}),w(f,{body_class:"fcrm_p_12"},{title:k(()=>[T("h4",null,S(t.$t("Active Automations")),1)]),header_action:k(()=>[w(h,{animated:""},{template:k(()=>[w(m,{style:{width:"80px",height:"28px"}})]),_:1})]),body:k(()=>[T("div",qt,[(v(),C(L,null,$(3,t=>T("div",{key:t,class:"fcrm_dashboard_entity_card__item"},[T("div",Ft,[T("p",jt,[w(h,{animated:"",style:{width:"200px"}},{template:k(()=>[w(m,{style:{width:"40%",height:"14px","margin-bottom":"4px"}})]),_:1})]),T("span",Wt,[e[2]||(e[2]=T("span",{class:"icon"},[T("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[T("path",{d:"M8.60001 6.19999H13.4L7.40001 15.2V9.79999H3.20001L8.60001 0.799988V6.19999ZM7.40001 7.39999V5.13199L5.31921 8.59999H8.60001V11.2364L11.1578 7.39999H7.40001Z",fill:"var(--fc-secondary-text)"})])],-1)),w(h,{animated:"",style:{width:"200px"}},{template:k(()=>[w(m,{style:{width:"60%",height:"12px"}})]),_:1})])])])),64))])]),_:1})])],void 0,!0),_:1}),w(p,{sm:24,md:8,lg:8},{default:k(()=>[w(f,null,{title:k(()=>[T("h4",null,S(t.$t("Sales")),1)]),body:k(()=>[T("ul",Nt,[(v(),C(L,null,$(3,t=>T("li",{key:t,style:{display:"flex","align-items":"center","justify-content":"space-between"}},[T("span",zt,[w(h,{animated:""},{template:k(()=>[w(m,{style:{width:"100px",height:"17px"}})]),_:1})]),T("span",Zt,[w(h,{animated:""},{template:k(()=>[w(m,{style:{width:"40px",height:"17px"}})]),_:1})])])),64))])]),_:1}),w(f,null,{title:k(()=>[T("h4",null,S(t.$t("Quick Links")),1)]),body:k(()=>[w(h,{animated:"",rows:4})]),_:1}),w(f,null,{title:k(()=>[T("h4",null,S(t.$t("Email Performance")),1)]),body:k(()=>[w(h,{animated:"",rows:6})]),_:1})],void 0,!0),_:1})],void 0),_:1})])}]]);class Ut{static greeting(t=new Date){const e=t.getHours();if(e>=5&&e<12)return F("Good morning");if(e>=12&&e<17)return F("Good afternoon");if(e>=17&&e<21)return F("Good evening");{const t=[F("Step into the moonlight!"),F("Evening vibes!"),F("The night's still young!")];return t[Math.floor(Math.random()*t.length)]}}}const Kt={class:"fluentcrm_admin_dashboard fcrm-layout-width",style:{position:"relative"}},Yt={key:0,style:{"margin-bottom":"20px"},class:"dashboard_notices"},Qt=["innerHTML"],Jt={class:"fcrm_dashboard_user"},Xt=["innerHTML"],te={class:"fcrm_dashboard_user_info"},ee={class:"fcrm_card_widgets"},ae=["onClick"],se={class:"fcrm_card_widgets--header"},ie=["innerHTML"],ne=["innerHTML"],oe={class:"el-dropdown-link cursor_pointer"},re={class:"icon"},le={class:"w-full d-flex flex-column gap-4"},ce=["onClick","onKeydown"],de={class:"fcrm_dashboard_entity_card__item_content"},me={class:"fcrm_dashboard_entity_card__item_title"},he={class:"fcrm_dashboard_entity_card__stats"},_e={class:"fcrm_dashboard_entity_card__stat"},ue={class:"fcrm_dashboard_entity_card__stat_icon"},fe={class:"fcrm_dashboard_entity_card__stat"},pe={class:"fcrm_dashboard_entity_card__stat_icon"},ge={class:"fcrm_dashboard_entity_card__stat"},be={class:"fcrm_dashboard_entity_card__stat_icon"},ye={class:"fcrm_dashboard_entity_card__stat fcrm_dashboard_entity_card__stat_open_rate"},ve={key:1,class:"text-center d-flex flex-column gap-10 justify-center h-full w-full fcrm_p_20"},Ce={class:"icon"},we={class:"fcrm_secondary_text"},xe={class:"fcrm_contact_automation_stats"},ke={class:"w-full d-flex flex-column gap-4"},Le=["onClick","onKeydown"],$e={class:"fcrm_dashboard_entity_card__item_media"},Te={class:"fcrm_dashboard_user_image"},Se=["title","src"],Ee={class:"fcrm_dashboard_entity_card__item_content"},Ae={class:"fcrm_dashboard_entity_card__item_title"},Ie=["title"],Ve={class:"fcrm_dashboard_entity_card__item_meta"},De={key:1,class:"text-center d-flex flex-column gap-10 justify-center h-full w-full fcrm_p_20"},He={class:"icon"},Me={class:"fcrm_secondary_text"},Be={class:"w-full d-flex flex-column gap-4"},Re=["onClick","onKeydown"],Oe={class:"fcrm_dashboard_entity_card__item_content"},Pe={class:"fcrm_dashboard_entity_card__item_title"},qe={class:"fcrm_dashboard_entity_card__item_subtitle"},Fe={key:1,class:"text-center d-flex flex-column gap-10 justify-center h-full w-full fcrm_p_20"},je={class:"icon"},We={class:"fcrm_secondary_text"},Ne={class:"fcrm_secondary_text small"},ze={class:"fcrm_onboarding_steps--lists"},Ze=["onClick"],Ge={class:"icon"},Ue={class:"fc_lined_items"},Ke=["innerHTML"],Ye=["innerHTML"],Qe=["innerHTML"],Je={key:0,class:"fcrm_secondary_text small fcrm_mb_16"},Xe=["href"],ta={class:"el-button el-button--primary",href:"https://fluentcrm.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=pro&utm_id=wp",target:"_blank",rel:"noopener"},ea={class:"fcrm_quick_links"},aa={class:"fcrm_quick_link_icon"},sa={key:1,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ia=["target","rel","href"],na={class:"d-flex flex-column items-center text-center"},oa={class:"fcrm_mb_16"},ra={class:"fcrm_primary_text font-medium fcrm_mb_4"},la={class:"fcrm_secondary_text small fcrm_mb_16"},ca={class:"d-flex flex-column items-center text-center"},da={class:"fcrm_mb_16"},ma={class:"fcrm_primary_text font-medium fcrm_mb_4"},ha={class:"fcrm_secondary_text small fcrm_mb_16"},_a={class:"text-align-center"},ua={class:"el-button el-button--primary",href:"https://fluentcrm.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=pro&utm_id=wp",target:"_blank",rel:"noopener"},fa=["innerHTML"],pa={class:"fcrm_review_card"},ga={class:"icon"},ba={class:"fcrm_review_card--title"},ya={class:"fcrm_review_card--body"},va={href:"https://wordpress.org/support/plugin/fluent-crm/reviews/#new-post",target:"_blank",class:"el-button"},Ca={class:"icon"},wa={class:"fcrm_onboarding_complete_popover_content"},xa=["src"],ka={class:"fcrm_onboarding--quick-actions"},La={class:"fcrm_onboarding--quick-actions-item-icon"},$a={class:"fcrm_onboarding--quick-actions-item-content"},Ta={class:"fcrm_onboarding--quick-actions-item-title"},Sa={class:"fcrm_onboarding--quick-actions-item-description fcrm_secondary_text"},Ea={class:"fcrm_onboarding--quick-actions-item-arrow"},Aa={class:"fcrm_onboarding--quick-actions-item-icon"},Ia={class:"fcrm_onboarding--quick-actions-item-content"},Va={class:"fcrm_onboarding--quick-actions-item-title"},Da={class:"fcrm_onboarding--quick-actions-item-description fcrm_secondary_text"},Ha={class:"fcrm_onboarding--quick-actions-item-arrow"};const Ma=N({name:"Dashboard",components:{DashboardLoader:Gt,EmailPerformance:mt,Badge:Y,BaseCard:Q,SubscribersChart:X,EmailSentChart:tt,EmailOpenChart:et,EmailClickChart:at,Icons:G,ArrowDown:e,SuccessFilled:u,CircleClose:_,CustomIcon:U,Download:h,Check:m},data(){return{logoIcon:J,greeting:Ut.greeting(),CalendarIcon:R(K),loading:!0,stats:[],quick_links:[],date_range:W(),currently_showing:"SubscribersChart",chartMaps:{SubscribersChart:this.$t("Subscribers Growth"),EmailSentChart:this.$t("Email Sending Stats"),EmailOpenChart:this.$t("Email Open Stats"),EmailClickChart:this.$t("Email Link Click Stats")},showing_charts:!0,chartKey:0,ff_config:{is_installed:!0,create_form_link:""},installing_ff:!1,sales:[],onboarding:null,data_ready:!1,dashboard_notices:[],recommendation:!1,system_tips:null,showReviewWidget:!0,dateShortcuts:j,recent_contacts:[],active_automations:[],recent_campaigns:[],triggers:[],isCongratsPopoverOpen:!1}},methods:{getCongratsPopover(){try{const t=window.localStorage.getItem("fcrm_onboarding_congratulations_shown"),e=window.localStorage.getItem("fcrm_onboarding_congratulations_pending");"yes"!==t&&"yes"===e&&(this.isCongratsPopoverOpen=!0,window.localStorage.setItem("fcrm_onboarding_congratulations_shown","yes")),window.localStorage.removeItem("fcrm_onboarding_congratulations_pending")}catch(t){}},fetchDashBoardData(t=!0){t&&(this.loading=!0),this.$get("reports/dashboard-stats").then(t=>{this.stats=t.stats,this.sales=t.sales,this.quick_links=t.quick_links,this.ff_config=t.ff_config,this.onboarding=t.onboarding,this.dashboard_notices=t.dashboard_notices,this.recommendation=t.recommendation,this.system_tips=t.system_tips,this.recent_contacts=t.recent_contacts,this.active_automations=t.active_automations,this.triggers=t.triggers,this.recent_campaigns=t.recent_campaigns,this.getCongratsPopover(),this.stats.email_pending&&delete this.stats.email_pending}).finally(()=>{t&&(this.loading=!1),this.data_ready=!0})},goToRoute(t){t&&this.$router.push(t)},maybeRouteStep(t){t.completed||this.goToRoute(t.route)},handleComponentChange(t){this.currently_showing=t},filterReport(){this.chartKey+=1},refreshData(){this.fetchDashBoardData(!1)},installFF(){this.installing_ff=!0,this.$post("setting/install-fluentform").then(t=>{this.ff_config=t.ff_config,this.$notify.success(t.message)}).catch(t=>{this.handleError(t)}).finally(()=>{this.installing_ff=!1})},closeReviewWidget(){this.showReviewWidget=!1;let t="";const e=new Date;e.setTime(e.getTime()+6048e5),t="; expires="+e.toUTCString(),document.cookie="showReviewWidget=false"+t},checkIfReviewWidgetEnabled(){const t=document.cookie.split(";");for(let e=0;e<t.length;e++){-1!==t[e].trim().indexOf("showReviewWidget=")&&(this.showReviewWidget=!1)}},addCampaign(){this.$router.push({name:"campaigns",query:{create:"1"}})},viewAllCampaigns(){this.$router.push({name:"campaigns",query:{statuses:["archived"]}})},viewAllContacts(){this.$router.push({name:"subscribers"})},viewContact(t){this.$router.push({name:"subscriber",params:{id:t.id}})},addContact(){this.$router.push({name:"subscribers",query:{add:"1"}})},viewAllAutomations(){this.$router.push({name:"funnels"})},viewAutomation(t){this.$router.push({name:"edit_funnel",params:{funnel_id:t.id}})},createAutomation(){this.$router.push({name:"funnels",query:{add:"1"}})},getTriggerTitle(t){if(this.triggers[t])return this.triggers[t].label},getPercent:(t,e)=>e&&t?parseFloat(t/e*100).toFixed(2)+"%":"0%",maybeRepairDbIndexes(){window.fcAdmin&&!window.fcAdmin.db_index_health_ok&&(window.__fcDbIndexRepairTried||(window.__fcDbIndexRepairTried=!0,this.$post("setting/db-index-health/repair").then(()=>{window.fcAdmin.db_index_health_ok="1"}).catch(()=>{this.$notify({type:"warning",duration:0,title:this.$t("Database needs attention"),message:this.$t("Some performance indexes are missing and could not be created automatically. Click here to open Database Health."),onClick:()=>{this.$router.push({name:"database_health"})}})})))},handleCampaignClick(t){let e="campaign-view";"draft"===t.status&&(e="campaign"),this.$router.push({name:e,params:{id:t.id},query:{t:(new Date).getTime(),step:t.next_step&&parseInt(t.next_step)<=3?t.next_step:0}})}},mounted(){this.fetchDashBoardData(),this.checkIfReviewWidgetEnabled(),this.maybeRepairDbIndexes(),this.timerId=setInterval(()=>{this.refreshData()},3e5),this.changeTitle(this.$t("Dashboard"))},beforeUnmount(){this.timerId&&clearInterval(this.timerId)}},[["render",function(t,e,r,l,m,h){const _=b("DashboardLoader"),u=b("custom-icon"),y=b("Icons"),R=o,O=n,P=a,q=f,F=b("BaseCard"),j=s,W=p,N=b("Badge"),z=c,Z=b("Check"),G=i,U=b("EmailPerformance"),K=b("icons"),Y=d,Q=g;return v(),C("div",Kt,[w(D,{name:"fcrm-fade"},{default:k(()=>[m.loading?(v(),x(_,{key:0,class:"fcrm-loader-overlay"})):V("",!0)],void 0),_:1}),T("div",{style:E(m.loading?"visibility:hidden":"")},[m.dashboard_notices&&m.dashboard_notices.length?(v(),C("div",Yt,[(v(!0),C(L,null,$(m.dashboard_notices,(t,e)=>(v(),C("div",{class:"fcrm_notice",key:e,innerHTML:t},null,8,Qt))),128))])):V("",!0),T("div",Jt,[T("div",{class:"fcrm_dashboard_user_image",innerHTML:t.appVars.auth.avatar},null,8,Xt),T("div",te,[T("h3",null,S(m.greeting)+", "+S(t.appVars.auth.first_name)+" 👋🏻",1),T("p",null,S(t.$t("Welcome to"))+" FluentCRM ",1)])]),w(Y,{gutter:24},{default:k(()=>[w(z,{sm:24,md:16,lg:16},{default:k(()=>[T("div",ee,[(v(!0),C(L,null,$(m.stats,(e,a)=>(v(),C("div",{key:a,class:"fcrm_card_widget",onClick:t=>h.goToRoute(e.route)},[T("div",se,[T("div",{class:I(["fcrm_card_widget_icon","fcrm_icon_background_"+a])},[w(u,{type:a},null,8,["type"])],2),T("div",{class:"fcrm_card_widget_title",innerHTML:e.title},null,8,ie)]),T("div",{class:"fcrm_card_widget_content",innerHTML:t.formatMoney(e.count)},null,8,ne)],8,ae))),128))]),w(F,{class:"fcrm_subscriber_growth_card","no-body-padding":!0},{title:k(()=>[w(P,{onCommand:h.handleComponentChange},{dropdown:k(()=>[w(O,{class:"fc_dropdown"},{default:k(()=>[(v(!0),C(L,null,$(m.chartMaps,(t,e)=>(v(),x(R,{key:e,command:e},{default:k(()=>[A(S(t),1)],void 0,!0),_:2},1032,["command"]))),128))],void 0,!0),_:1})]),default:k(()=>[T("h4",oe,[A(S(m.chartMaps[m.currently_showing])+" ",1),T("span",re,[w(y,{"icon-name":"downIcon"})])])],void 0,!0),_:1},8,["onCommand"])]),header_action:k(()=>[w(q,{modelValue:m.date_range,"onUpdate:modelValue":e[0]||(e[0]=t=>m.date_range=t),type:"daterange","range-separator":"-","start-placeholder":t.$t("Start date"),"end-placeholder":t.$t("End date"),format:"MMM DD","value-format":"YYYY-MM-DD",size:"large",shortcuts:m.dateShortcuts,onChange:h.filterReport,"prefix-icon":m.CalendarIcon},null,8,["modelValue","start-placeholder","end-placeholder","shortcuts","onChange","prefix-icon"])]),body:k(()=>[m.showing_charts?(v(),x(H(m.currently_showing),{class:"fcrm_mt_10",date_range:m.date_range,key:m.chartKey},null,8,["date_range"])):V("",!0)]),_:1}),w(F,{body_class:"fcrm_p_12"},{title:k(()=>[T("h4",null,S(t.$t("Recent Campaigns")),1)]),header_action:k(()=>[w(j,{onClick:h.viewAllCampaigns,size:"small","aria-label":t.$t("View All")},{default:k(()=>[A(S(t.$t("View All")),1)],void 0,!0),_:1},8,["onClick","aria-label"])]),body:k(()=>[T("div",le,[m.recent_campaigns.length?(v(!0),C(L,{key:0},$(m.recent_campaigns,(a,s)=>(v(),C("div",{class:"fcrm_dashboard_entity_card__item",key:s,onClick:t=>h.handleCampaignClick(a),onKeydown:[M(B(t=>h.handleCampaignClick(a),["prevent"]),["enter"]),M(B(t=>h.handleCampaignClick(a),["prevent"]),["space"])],role:"button",tabindex:"0"},[T("div",de,[T("p",me,S(a.title),1),T("div",he,[w(W,{content:t.$t("Total emails sent"),placement:"top"},{default:k(()=>[T("div",_e,[T("span",ue,[w(y,{"icon-name":"envelope"})]),T("span",null,S(a.stats.sent||"0"),1)])],void 0,!0),_:2},1032,["content"]),e[6]||(e[6]=T("span",{class:"fcrm_dashboard_entity_card__stat_dot"},null,-1)),w(W,{content:t.$t("Total emails opened"),placement:"top"},{default:k(()=>[T("div",fe,[T("span",pe,[w(y,{"icon-name":"envelopeOpen"})]),T("span",null,S(a.stats.views||"0"),1)])],void 0,!0),_:2},1032,["content"]),e[7]||(e[7]=T("span",{class:"fcrm_dashboard_entity_card__stat_dot"},null,-1)),w(W,{content:t.$t("Total clicks"),placement:"top"},{default:k(()=>[T("div",ge,[T("span",be,[w(y,{"icon-name":"click"})]),T("span",null,S(a.stats.clicks||"0"),1)])],void 0,!0),_:2},1032,["content"]),w(W,{content:t.$t("Percentage of emails opened"),placement:"top"},{default:k(()=>[T("div",ye,S(t.$t("Open rate:"))+" "+S(h.getPercent(a.stats.views,a.stats.sent)),1)],void 0,!0),_:2},1032,["content"])])])],40,ce))),128)):(v(),C("div",ve,[T("span",Ce,[w(y,{"icon-name":"common-empty-state"})]),T("p",we,S(t.$t("Looks like you don't have any campaigns now.")),1),w(j,{onClick:h.addCampaign,link:""},{default:k(()=>[A(S(t.$t("Add a Campaign")),1)],void 0,!0),_:1},8,["onClick"])]))])]),_:1}),T("div",xe,[w(F,{body_class:"fcrm_p_12"},{title:k(()=>[T("h4",null,S(t.$t("Recent Contacts")),1)]),header_action:k(()=>[w(j,{onClick:h.viewAllContacts,size:"small","aria-label":t.$t("View All")},{default:k(()=>[A(S(t.$t("View All")),1)],void 0,!0),_:1},8,["onClick","aria-label"])]),body:k(()=>[T("div",ke,[m.recent_contacts.length?(v(!0),C(L,{key:0},$(m.recent_contacts,(e,a)=>(v(),C("div",{class:"fcrm_dashboard_entity_card__item",key:a,onClick:t=>h.viewContact(e),onKeydown:[M(B(t=>h.viewContact(e),["prevent"]),["enter"]),M(B(t=>h.viewContact(e),["prevent"]),["space"])],role:"button",tabindex:"0"},[T("div",$e,[T("div",Te,[T("img",{title:t.$t("Contact ID:")+" "+e.id,src:e.photo},null,8,Se)])]),T("div",Ee,[T("p",Ae,S(e.full_name),1),T("span",{class:"fcrm_dashboard_entity_card__item_subtitle",title:e.email},S(e.email),9,Ie)]),T("div",Ve,[w(N,{type:e.status},null,8,["type"])])],40,Le))),128)):(v(),C("div",De,[T("span",He,[w(y,{"icon-name":"common-empty-state"})]),T("p",Me,S(t.$t("Looks like you don't have any Contacts now.")),1),w(j,{onClick:h.addContact,link:"","aria-label":t.$t("Add a Contact")},{default:k(()=>[A(S(t.$t("Add a Contact")),1)],void 0,!0),_:1},8,["onClick","aria-label"])]))])]),_:1}),w(F,{body_class:"fcrm_p_12"},{title:k(()=>[T("h4",null,S(t.$t("Active Automations")),1)]),header_action:k(()=>[w(j,{onClick:h.viewAllAutomations,size:"small","aria-label":t.$t("View All")},{default:k(()=>[A(S(t.$t("View All")),1)],void 0,!0),_:1},8,["onClick","aria-label"])]),body:k(()=>[T("div",Be,[m.active_automations.length?(v(!0),C(L,{key:0},$(m.active_automations,(t,a)=>(v(),C("div",{class:"fcrm_dashboard_entity_card__item",key:a,onClick:e=>h.viewAutomation(t),onKeydown:[M(B(e=>h.viewAutomation(t),["prevent"]),["enter"]),M(B(e=>h.viewAutomation(t),["prevent"]),["space"])],role:"button",tabindex:"0"},[T("div",Oe,[T("p",Pe,S(t.title),1),T("span",qe,[e[8]||(e[8]=T("span",{class:"icon"},[T("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[T("path",{d:"M8.60001 6.19999H13.4L7.40001 15.2V9.79999H3.20001L8.60001 0.799988V6.19999ZM7.40001 7.39999V5.13199L5.31921 8.59999H8.60001V11.2364L11.1578 7.39999H7.40001Z",fill:"var(--fc-secondary-text)"})])],-1)),A(" "+S(h.getTriggerTitle(t.trigger_name)),1)])])],40,Re))),128)):(v(),C("div",Fe,[T("span",je,[w(y,{"icon-name":"common-empty-state"})]),T("p",We,S(t.$t("Looks like you don't have any active automations now.")),1),w(j,{onClick:h.createAutomation,link:"","aria-label":t.$t("Create an Automation")},{default:k(()=>[A(S(t.$t("Create an Automation")),1)],void 0,!0),_:1},8,["onClick","aria-label"])]))])]),_:1})])],void 0,!0),_:1}),w(z,{sm:24,md:8,lg:8},{default:k(()=>[m.onboarding?(v(),x(F,{key:0},{title:k(()=>[T("h4",null,S(t.$t("Getting Started")),1)]),header_action:k(()=>[T("span",Ne,S(t.$t("%s out of %s Done",m.onboarding.completed,m.onboarding.total)),1)]),body:k(()=>[T("div",ze,[(v(!0),C(L,null,$(m.onboarding.steps,(t,e)=>(v(),C("div",{class:I(["fcrm_onboarding_steps--item",{completed_step:t.completed}]),key:e,onClick:e=>h.maybeRouteStep(t)},[T("span",Ge,[t.completed?(v(),x(G,{key:0},{default:k(()=>[w(Z)],void 0,!0),_:1})):V("",!0)]),A(" "+S(t.label),1)],10,Ze))),128))])]),_:1})):V("",!0),m.sales&&m.sales.length?(v(),x(F,{key:1,class:"fcrm_mb_24"},{title:k(()=>[T("h4",null,S(t.$t("Sales")),1)]),body:k(()=>[T("ul",Ue,[(v(!0),C(L,null,$(m.sales,t=>(v(),C("li",{key:t.title},[T("span",{class:"fc_li_title",innerHTML:t.title},null,8,Ke),e[9]||(e[9]=A()),T("span",{class:"fc_li_value",innerHTML:t.content},null,8,Ye)]))),128))])]),_:1})):V("",!0),m.recommendation?(v(),x(F,{key:2,class:"text-center"},{title:k(()=>[T("h4",null,S(m.recommendation.title),1)]),body:k(()=>[T("p",{innerHTML:m.recommendation.description,class:"fcrm_secondary_text small fcrm_mb_16"},null,8,Qe),m.recommendation.learn_more?(v(),C("p",Je,[T("a",{target:"_blank",rel:"noopener",class:"font-medium",href:m.recommendation.learn_more},"Learn more",8,Xe),A(" and "+S(m.recommendation.base_title),1)])):V("",!0),T("a",ta,S(m.recommendation.btn_text),1)]),_:1})):V("",!0),w(U),w(F,{class:"fcrm_quick_links_wrap",body_class:"fcrm_p_12"},{title:k(()=>[T("h4",null,S(t.$t("Quick Links")),1)]),body:k(()=>[T("ul",ea,[(v(!0),C(L,null,$(m.quick_links,(t,a)=>(v(),C("li",{key:a},[T("div",aa,[t.icon?(v(),x(K,{key:0,iconName:t.icon},null,8,["iconName"])):(v(),C("svg",sa,[...e[10]||(e[10]=[T("path",{d:"M14.773 12.652L13.7125 11.59L14.773 10.5295C15.1237 10.1818 15.4023 9.76832 15.5928 9.3127C15.7833 8.85707 15.8819 8.36831 15.883 7.87447C15.8841 7.38063 15.7876 6.89145 15.5991 6.43499C15.4106 5.97854 15.1338 5.56381 14.7846 5.21461C14.4355 4.86541 14.0207 4.58863 13.5643 4.40014C13.1078 4.21166 12.6186 4.11519 12.1248 4.11627C11.6309 4.11735 11.1422 4.21596 10.6866 4.40644C10.2309 4.59693 9.81742 4.87553 9.46976 5.22625L8.40926 6.2875L7.34801 5.227L8.41001 4.1665C9.39462 3.18188 10.7301 2.62873 12.1225 2.62873C13.515 2.62873 14.8504 3.18188 15.835 4.1665C16.8196 5.15112 17.3728 6.48654 17.3728 7.879C17.3728 9.27146 16.8196 10.6069 15.835 11.5915L14.7738 12.652H14.773ZM12.652 14.773L11.5908 15.8335C10.6061 16.8181 9.27072 17.3713 7.87826 17.3713C6.4858 17.3713 5.15037 16.8181 4.16576 15.8335C3.18114 14.8489 2.62799 13.5135 2.62799 12.121C2.62799 10.7285 3.18114 9.39312 4.16576 8.4085L5.22701 7.348L6.28751 8.41L5.22701 9.4705C4.87629 9.81816 4.59769 10.2317 4.4072 10.6873C4.21672 11.1429 4.11811 11.6317 4.11703 12.1255C4.11595 12.6194 4.21242 13.1086 4.4009 13.565C4.58939 14.0215 4.86617 14.4362 5.21537 14.7854C5.56457 15.1346 5.9793 15.4114 6.43575 15.5999C6.89221 15.7883 7.38139 15.8848 7.87523 15.8837C8.36907 15.8826 8.85783 15.784 9.31346 15.5936C9.76908 15.4031 10.1826 15.1245 10.5303 14.7737L11.5908 13.7132L12.652 14.7737V14.773ZM12.121 6.81775L13.1823 7.879L7.87901 13.1815L6.81776 12.121L12.121 6.8185V6.81775Z",fill:"var(--fc-secondary-text)"},null,-1)])]))]),T("a",{target:t.is_external?"_blank":"_self",rel:t.is_external?"noopener noreferrer":null,href:t.url},S(t.title),9,ia)]))),128))])]),_:1}),t.appVars.disable_fluentmail_suggest?V("",!0):(v(),x(F,{key:3},{title:k(()=>[T("h4",null,S(t.$t("The Ultimate SMTP")),1)]),body:k(()=>[T("div",na,[T("div",oa,[w(K,{iconName:"FluentSMTPIcon"})]),T("h3",ra,S(t.$t("Set Up FluentSMTP")),1),T("p",la,S(t.$t("fluentsmtp.new_desc")),1),w(j,{tag:"router-link",to:{name:"smtp_settings"}},{default:k(()=>[e[11]||(e[11]=T("span",{class:"icon"},[T("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[T("path",{d:"M16 6.4285L10.054 11.7535L4 6.412V15.25H11.5V16.75H3.25C3.05109 16.75 2.86032 16.671 2.71967 16.5303C2.57902 16.3897 2.5 16.1989 2.5 16V4C2.5 3.80109 2.57902 3.61032 2.71967 3.46967C2.86032 3.32902 3.05109 3.25 3.25 3.25H16.75C16.9489 3.25 17.1397 3.32902 17.2803 3.46967C17.421 3.61032 17.5 3.80109 17.5 4V10.75H16V6.4285ZM15.6257 4.75H4.38325L10.0457 9.7465L15.6265 4.75H15.6257ZM13.7875 15.661C13.7373 15.3893 13.7373 15.1107 13.7875 14.839L13.027 14.3995L13.777 13.1005L14.5375 13.54C14.746 13.3615 14.9867 13.2213 15.25 13.1275V12.25H16.75V13.1275C17.0132 13.2213 17.254 13.3615 17.4625 13.54L18.223 13.1005L18.973 14.3995L18.2125 14.839C18.2627 15.1107 18.2627 15.3893 18.2125 15.661L18.973 16.1005L18.223 17.3995L17.4625 16.96C17.2524 17.1402 17.0109 17.28 16.75 17.3725V18.25H15.25V17.3725C14.9891 17.28 14.7476 17.1402 14.5375 16.96L13.777 17.3995L13.027 16.1005L13.7875 15.661ZM16 16C16.1989 16 16.3897 15.921 16.5303 15.7803C16.671 15.6397 16.75 15.4489 16.75 15.25C16.75 15.0511 16.671 14.8603 16.5303 14.7197C16.3897 14.579 16.1989 14.5 16 14.5C15.8011 14.5 15.6103 14.579 15.4697 14.7197C15.329 14.8603 15.25 15.0511 15.25 15.25C15.25 15.4489 15.329 15.6397 15.4697 15.7803C15.6103 15.921 15.8011 16 16 16Z",fill:"var(--fc-secondary-text)"})])],-1)),A(" "+S(t.$t("Das_View_ESSS")),1)],void 0,!0),_:1})])]),_:1})),m.ff_config.is_installed?t.has_campaign_pro?V("",!0):(v(),x(F,{key:5,class:"text-center"},{title:k(()=>[T("h4",null,"Hi "+S(t.appVars.auth.first_name)+" "+S(t.appVars.auth.last_name)+",",1)]),body:k(()=>[e[13]||(e[13]=T("p",{class:"fcrm_secondary_text small fcrm_mb_16"},[A("Do more with "),T("b",{class:"fcrm_primary_text small"},"FluentCRM Pro"),A(" by using more integrations, advanced automations, sequence emails and in-detailed analytics.")],-1)),T("a",ua,S(t.$t("Upgrade to Pro")),1)]),_:1})):(v(),x(F,{key:4},{title:k(()=>[T("h4",null,S(t.$t("Grow Your Audience")),1)]),body:k(()=>[T("div",ca,[T("div",da,[w(K,{iconName:"FluentFormIcon"})]),T("h3",ma,S(t.$t("Looks like you did not install FluentForms yet !!!")),1),T("p",ha,S(t.$t("quick_links.ff_desc")),1),T("div",_a,[w(j,{onClick:e[1]||(e[1]=t=>h.installFF())},{default:k(()=>[e[12]||(e[12]=T("span",{class:"icon"},[T("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[T("path",{d:"M10.75 8.5H14.5L10 13L5.5 8.5H9.25V3.25H10.75V8.5ZM4 15.25H16V10H17.5V16C17.5 16.1989 17.421 16.3897 17.2803 16.5303C17.1397 16.671 16.9489 16.75 16.75 16.75H3.25C3.05109 16.75 2.86032 16.671 2.71967 16.5303C2.57902 16.3897 2.5 16.1989 2.5 16V10H4V15.25Z",fill:"var(--fc-secondary-text)"})])],-1)),A(" "+S(t.$t("Activate Fluent Forms")),1)],void 0,!0),_:1})])])]),_:1})),m.system_tips?(v(),x(F,{key:6,class:"fcrm_system_tips_wrap"},{title:k(()=>[T("h4",null,S(m.system_tips.title),1)]),body:k(()=>[T("div",{innerHTML:m.system_tips.body},null,8,fa)]),_:1})):V("",!0),m.showReviewWidget?(v(),x(F,{key:7,"no-body-padding":!0},{body:k(()=>[T("div",pa,[w(j,{onClick:h.closeReviewWidget,class:"close_card"},{default:k(()=>[T("span",ga,[w(y,{iconName:"close"})])],void 0,!0),_:1},8,["onClick"]),T("div",ba,S(t.$t("Help Us Grow"))+" 🚀 ",1),T("div",ya,[T("p",null,S(t.$t("Share your experience with a quick review on the WordPress directory.")),1),T("a",va,[T("span",null,[T("span",Ca,[w(y,{iconName:"star"})]),A(" "+S(t.$t("Write a Review")),1)])])])])]),_:1})):V("",!0)],void 0,!0),_:1})],void 0),_:1})],4),w(Q,{modelValue:m.isCongratsPopoverOpen,"onUpdate:modelValue":e[5]||(e[5]=t=>m.isCongratsPopoverOpen=t),class:"fcrm_onboarding_complete_dialog",width:"440px","show-close":!1,"close-on-click-modal":!0,"append-to-body":!0,"modal-class":"fcrm_onboarding_complete_dialog_mask"},{default:k(()=>[T("div",wa,[T("img",{src:m.logoIcon,alt:"FluentCRM"},null,8,xa),T("h3",null,S(t.$t("You're All Set!"))+" 🥳",1),T("p",null,S(t.$t("You are all set up and ready to start. Here are a few quick things you can do to get started.")),1),T("div",ka,[T("div",{class:"fcrm_onboarding--quick-actions-item d-flex items-center gap-12",onClick:e[2]||(e[2]=e=>t.$router.push({name:"subscribers"}))},[T("div",La,[w(y,{"icon-name":"contacts"})]),T("div",$a,[T("div",Ta,S(t.$t("Create a contact")),1),T("div",Sa,S(t.$t("Create your first contact.")),1)]),T("div",Ea,[w(y,{"icon-name":"chevron-right"})])]),T("div",{class:"fcrm_onboarding--quick-actions-item d-flex items-center gap-12",onClick:e[3]||(e[3]=e=>t.$router.push({name:"campaigns"}))},[T("div",Aa,[w(y,{"icon-name":"campaigns"})]),T("div",Ia,[T("div",Va,S(t.$t("Create a campaign")),1),T("div",Da,S(t.$t("Design and send your first email.")),1)]),T("div",Ha,[w(y,{"icon-name":"chevron-right"})])])]),w(j,{type:"primary",onClick:e[4]||(e[4]=t=>m.isCongratsPopoverOpen=!1),class:"w-full"},{default:k(()=>[A(S(t.$t("Go to My Dashboard")),1)],void 0,!0),_:1})])],void 0),_:1},8,["modelValue"])])}],["__scopeId","data-v-523b0015"]]);export{Ma as default};