import{S as z,m as B}from"./vue3-apexcharts-DJaiVsL5.js";import{u as o,C as G}from"./index-BzKDSPoe.js";import{g as P,a as T}from"./periods-CPwunCIo.js";import{u as V}from"./analytics-CiIjvCz9.js";import{a as A,C as D,k as h,b as t,o as L,m as p,g as d,f as M,q as m,p as r,u as i,I as v,D as N,n as g}from"./convert-case-to-camel-case.utils-DDUpNI96.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./vue-datepicker-DJOolBJW.js";/* empty css             */import"./index-xsH4HHeE.js";/* empty css               */const O={class:"ccb-dashboard-card ccb-dashboard-card-chart ccb-dashboard-col-12"},q={class:"ccb-dashboard-chart-controls"},E={key:0,class:"ccb-dashboard-chart-periods"},I={class:"ccb-dashboard-large-chart"},Q=A({__name:"LinearChart",props:{chart:{},page:{}},setup(f){const b=f,{chart:e,page:y}=D(b),n=h("hour"),k=t(()=>Math.min(...e.value.series,...e.value.extraSeries)),x=t(()=>Math.max(...e.value.series,...e.value.extraSeries)),C=h({chart:{type:"line",height:350,toolbar:{show:!0,tools:{download:!1,selection:!1,zoom:!1,zoomin:!1,zoomout:!1,pan:!1,reset:!1}}},stroke:{width:[2,2],curve:"smooth"},colors:["#27ae60","#2980b9"],grid:{borderColor:"#f1f1f1",padding:{top:10,right:0,bottom:0,left:10}},markers:{size:4,colors:["#27ae60","#2980b9"],strokeColors:"#fff",strokeWidth:2,hover:{size:6}},xaxis:{categories:e.value.categories,labels:{style:{colors:"#888",fontSize:"12px"}},axisBorder:{show:!0},axisTicks:{show:!0}},yaxis:[{title:{style:{color:"#27ae60"}},labels:{style:{colors:"#888"}},min:k.value,max:x.value}],legend:{position:"top",horizontalAlign:"center",floating:!0,offsetY:-50,offsetX:0}}),S=t(()=>{const a=V();return e.value.extraSeries&&e.value.extraSeries.length>0?[{name:a.getTranslations.interactions,type:"line",data:e.value.series},{name:a.getTranslations.orders,type:"line",data:e.value.extraSeries}]:[{name:a.getTranslations.revenue,type:"line",data:e.value.series}]}),u=t(()=>{const a=o(),s=P(a.getPeriod);return s.map(c=>c.value).includes(n.value)||(n.value=T(s)),s}),_=a=>{const s=o(),c=a;s.updateChartsGrouping(e.value.key,c)},w=t(()=>{const a=o();return u.value.length>0&&e.value.key in a.getDashboardChartsGrouping}),l=t(()=>o().isLoading);return L(()=>{const a=o();n.value=y.value==="dashboard"?a.getDashboardChartsGrouping[e.value.key]:a.getSingleChartsGrouping[e.value.key]}),(a,s)=>(d(),p("div",O,[l.value?(d(),M(i(z),{key:0})):m("",!0),r("div",{class:v(["ccb-dashboard-card-wrapper",{"ccb-is-loading":l.value}])},[r("div",{class:v(["ccb-dashboard-chart-header",{"ccb-is-loading":l.value}])},[r("div",q,[r("span",null,N(i(e).title),1)]),w.value?(d(),p("div",E,[g(i(G),{items:u.value,current:n.value,placeholder:"",onUpdate:_},null,8,["items","current"])])):m("",!0)],2),r("div",I,[g(i(B),{type:"line",height:"100%",options:C.value,series:S.value},null,8,["options","series"])])],2)]))}});export{Q as default};
//# sourceMappingURL=LinearChart-CvHuMiWn.js.map
