import{r as e}from"./rolldown-runtime-BM3Ffeng.js";import{it as t,nt as n}from"./element-plus-vendor-BF9PNysW.js";import{A as r,D as i,E as a,I as o,N as s,O as c,P as l,Xt as u,et as d,ht as f,k as p,qt as m}from"./vue-vendor-DMUmTARL.js";import{Lt as h,Rt as g}from"./icons-vendor-Db5MGAkr.js";var _={class:`mb-4 flex flex-col items-center justify-between gap-3 rounded-xl border border-border-light bg-surface p-3 shadow-sm sm:flex-row sm:gap-4`},v={class:`flex w-full items-center justify-between gap-3 sm:w-auto sm:justify-start`},y={class:`relative flex h-2 w-2`},b={key:0,class:`absolute inline-flex h-full w-full animate-ping rounded-full bg-blue-400 opacity-75`},x={class:`whitespace-nowrap text-xs text-placeholder`},S={class:`flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end sm:gap-3`},C={class:`flex items-center gap-2`},w={class:`flex items-center gap-2`},T=[`aria-label`,`aria-pressed`],E=[`aria-label`],D=o({__name:`MonitorToolbar`,props:{isPaused:{type:Boolean},lastUpdateTime:{},refreshInterval:{},countdown:{}},emits:[`update:refreshInterval`,`change-interval`,`toggle-pause`],setup(e,{emit:o}){let D=e,O=o,k=a({get:()=>D.refreshInterval,set:e=>O(`update:refreshInterval`,e)}),A=e=>{O(`change-interval`,e)};return(a,o)=>{let D=n,j=t,M=h,N=g;return d(),r(`div`,_,[i(`div`,v,[i(`div`,{class:m([`flex items-center gap-1.5 rounded-full bg-blue-50 px-3 py-1.5 text-xs font-medium text-blue-600 transition-colors`,e.isPaused?`bg-orange-50 text-orange-600 dark:bg-orange-500/20 dark:text-orange-300`:`bg-blue-50 text-blue-600 dark:bg-blue-500/20 dark:text-blue-300`])},[i(`span`,y,[e.isPaused?p(``,!0):(d(),r(`span`,b)),i(`span`,{class:m([`relative inline-flex h-2 w-2 rounded-full`,e.isPaused?`bg-orange-500 dark:bg-orange-400`:`bg-blue-500 dark:bg-blue-400`])},null,2)]),s(` `+u(e.isPaused?`已暂停刷新`:`实时监控中`),1)],2),i(`span`,x,`最后更新: `+u(e.lastUpdateTime||`-`),1)]),i(`div`,S,[i(`div`,C,[o[2]||=i(`span`,{class:`hidden whitespace-nowrap text-xs text-secondary sm:inline`},`刷新间隔`,-1),l(j,{modelValue:k.value,"onUpdate:modelValue":o[0]||=e=>k.value=e,size:`small`,class:`!w-20 sm:!w-24`,"aria-label":`刷新间隔`,onChange:A},{default:f(()=>[l(D,{label:`1秒`,value:1}),l(D,{label:`3秒`,value:3}),l(D,{label:`5秒`,value:5}),l(D,{label:`10秒`,value:10}),l(D,{label:`30秒`,value:30}),l(D,{label:`60秒`,value:60})]),_:1},8,[`modelValue`])]),o[3]||=i(`div`,{class:`hidden h-4 w-px bg-border sm:block`},null,-1),i(`div`,w,[i(`button`,{type:`button`,class:m([`flex items-center gap-1.5 whitespace-nowrap rounded-md border px-3 py-1.5 text-xs font-medium transition-all`,e.isPaused?`border-blue-100 bg-blue-50 text-blue-600 hover:bg-blue-100 dark:border-blue-400/30 dark:bg-blue-500/20 dark:text-blue-300 dark:hover:bg-blue-500/25`:`border-border bg-surface text-regular hover:bg-zf-hover`]),"aria-label":e.isPaused?`继续实时刷新`:`暂停实时刷新`,"aria-pressed":e.isPaused,onClick:o[1]||=e=>O(`toggle-pause`)},[e.isPaused?(d(),c(M,{key:0,class:`h-3.5 w-3.5`})):(d(),c(N,{key:1,class:`h-3.5 w-3.5`})),s(` `+u(e.isPaused?`继续`:`暂停`),1)],10,T),i(`div`,{class:m([`flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-border-light bg-page font-mono text-xs tabular-nums text-secondary`,{"font-bold !text-blue-600":!e.isPaused&&e.countdown<=3,"dark:!text-blue-300":!e.isPaused&&e.countdown<=3}]),"aria-label":e.isPaused?`实时刷新已暂停`:`自动刷新中`},u(e.isPaused?`-`:e.countdown),11,E)])])])}}}),O=e({default:()=>k}),k=D;export{O as n,k as t};