import{a}from"./dayjs.min.1703796278973.js";import{L as s}from"./index.1703796278973314.js";const b=e=>{switch(e){case"hour":return a().subtract(1,"hours");case"week":return a().subtract(6,"days");case"month":return a().subtract(29,"days");case"year":return a().subtract(365,"days");default:return a().startOf("day")}},d=e=>{const o=[];for(let r=e.length-1;r>=0;r--)o.push(e[r]);return o},h=e=>{let o="1h",r=12;const t=Number(e.time.time[1])-Number(e.time.time[0]),n=60*60*1e3,i=n*24,l=i*30,c=365*i;return t<=n?(o="1m",r=30):t>n&&t<=i?(r=Math.abs(Math.ceil(t/n)),r=24):t>i&&t<=l*3?(r=Math.abs(Math.ceil(t/i))+1,o="1d"):t>l*3&&t=c&&(r=Math.abs(Math.floor(t/l)),o="1M"),[{dashboard:"systemMonitor",object:"network",measurement:"traffic",dimension:"agg",group:"network-group",params:{type:e.type,interval:o,from:Number(e.time.time[0]),to:Number(e.time.time[1]),limit:r,format:"YYYY-MM-dd HH:mm"}}]},u=(e,o)=>[{dashboard:"systemMonitor",object:"stats",measurement:"info",dimension:"history",group:e,params:{from:a(o.time[0]).valueOf(),to:a(o.time[1]).valueOf(),format:"YYYY-MM-dd HH:mm"}}],g={color:new s(0,0,0,1,[{offset:1,color:"rgba(151, 154, 255, 0)"},{offset:0,color:"rgba(151, 154, 255, .24)"}])},y={color:new s(0,0,0,1,[{offset:1,color:"rgba(44, 182, 224, 0)"},{offset:0,color:"rgba(44, 182, 224, .24)"}])},w={color:new s(0,0,0,1,[{offset:1,color:"rgba(96, 223, 199, 0)"},{offset:0,color:"rgba(96, 223, 199, .24)"}])},p=[{data:[],type:"line"}],M={type:"gauge",min:0,startAngle:200,endAngle:-20,center:["50%","67%"],title:{show:!1},axisTick:{distance:-20,lineStyle:{width:1,color:"rgba(0,0,0,0.15)"}},splitLine:{distance:-22,length:9,lineStyle:{width:1,color:"#000"}},pointer:{length:"80%",width:4,itemStyle:{color:"auto"}},anchor:{show:!0,showAbove:!0,size:20,itemStyle:{borderWidth:3,borderColor:"#fff",shadowBlur:20,shadowColor:"rgba(0, 0, 0, .25)",color:"auto"}},axisLine:{lineStyle:{width:10,color:[[.25,"rgba(36, 178, 118, 1)"],[.4,new s(0,0,0,1,[{offset:0,color:"rgba(66, 147, 255, 1)"},{offset:1,color:"rgba(36, 178, 118, 1)"}])],[.5,new s(0,0,0,1,[{offset:0,color:"rgba(250, 178, 71, 1)"},{offset:1,color:"rgba(66, 147, 255, 1)"}])],[1,new s(0,0,0,1,[{offset:0,color:"rgba(250, 178, 71, 1)"},{offset:1,color:"rgba(247, 111, 93, 1)"}])]]}},detail:{show:!1}};export{d as a,y as b,w as c,u as d,g as e,M as f,b as g,h as n,p as t};