import{m as z}from"./vendor-apexcharts-Dhew1LZV.js";import{u as s,C as B}from"./index-BzV9LDkq.js";import{g as G,a as P}from"./periods-BQA0Ghpg.js";import{S as T}from"./Skeleton-DgK7k6Ot.js";import{u as V}from"./analytics-DsW96Oy3.js";import{d as A,e as o,a as D,f as p,i as d,k as L,t as m,x as r,j as h}from"./vendor-vue-runtime-core-DwK6Ry68.js";import{t as M,r as v,u as n}from"./vendor-vue-reactivity-CheHbvBM.js";import{a as f,t as N}from"./vendor-vue-shared-DrzsEcag.js";import"./convert-case-to-camel-case.utils-CK5dBN7n.js";import"./vendor-vue3-html2pdf-KR020wX8.js";import"./vendor-html2pdf.js-B-tok4Ns.js";import"./vendor-jspdf-UFhKzYHA.js";import"./vendor-bootstrap-CCU-90um.js";import"./vendor-html2canvas-BfYXEYrK.js";import"./vendor-vue-runtime-dom-B2rky8vu.js";import"./vendor-datepicker--1DmXemW.js";import"./vendor-date-fns-DoIqsk4U.js";import"./vendor-pinia-BSPefQhS.js";import"./vendor-axios-xsH4HHeE.js";/* empty css               */const O={class:"ccb-dashboard-card ccb-dashboard-card-chart ccb-dashboard-col-12"},j={class:"ccb-dashboard-chart-controls"},E={key:0,class:"ccb-dashboard-chart-periods"},R={class:"ccb-dashboard-large-chart"},ne=A({__name:"LinearChart",props:{chart:{},page:{}},setup(g){const b=g,{chart:e,page:x}=M(b),i=v("hour"),y=o(()=>Math.min(...e.value.series,...e.value.extraSeries)),k=o(()=>Math.max(...e.value.series,...e.value.extraSeries)),C=v({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:y.value,max:k.value}],legend:{position:"top",horizontalAlign:"center",floating:!0,offsetY:-50,offsetX:0}}),S=o(()=>{const t=V();return e.value.extraSeries&&e.value.extraSeries.length>0?[{name:t.getTranslations.interactions,type:"line",data:e.value.series},{name:t.getTranslations.orders,type:"line",data:e.value.extraSeries}]:[{name:t.getTranslations.revenue,type:"line",data:e.value.series}]}),u=o(()=>{const t=s(),a=G(t.getPeriod);return a.map(c=>c.value).includes(i.value)||(i.value=P(a)),a}),_=t=>{const a=s(),c=t;a.updateChartsGrouping(e.value.key,c)},w=o(()=>{const t=s();return u.value.length>0&&e.value.key in t.getDashboardChartsGrouping}),l=o(()=>s().isLoading);return D(()=>{const t=s();i.value=x.value==="dashboard"?t.getDashboardChartsGrouping[e.value.key]:t.getSingleChartsGrouping[e.value.key]}),(t,a)=>(d(),p("div",O,[l.value?(d(),L(n(T),{key:0})):m("",!0),r("div",{class:f(["ccb-dashboard-card-wrapper",{"ccb-is-loading":l.value}])},[r("div",{class:f(["ccb-dashboard-chart-header",{"ccb-is-loading":l.value}])},[r("div",j,[r("span",null,N(n(e).title),1)]),w.value?(d(),p("div",E,[h(n(B),{items:u.value,current:i.value,placeholder:"",onUpdate:_},null,8,["items","current"])])):m("",!0)],2),r("div",R,[h(n(z),{type:"line",height:"100%",options:C.value,series:S.value},null,8,["options","series"])])],2)]))}});export{ne as default};
//# sourceMappingURL=LinearChart-BRFIzREt.js.map
