import{c as h,u as i,q as p,aD as g,r as c,H as d,j as e,aA as f,as as j,at as v,T as n,aB as b,e as y,m as N,$ as A,aE as w,aF as m}from"./index-B2TpLIOm.js";import{A as k,a as S,b as E}from"./alert-CTyk4gGY.js";const $=h("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),F=()=>{const t=i(p),l=i(g),{activeAlerts:o,alertsKey:u}=c.useMemo(()=>{const s=[],a=[];for(const x of Object.keys(t))for(const r of t[x].values())r.triggered&&r.name in d&&(s.push(r),a.push(`${r.system}${r.value}${r.min}`));return{activeAlerts:s,alertsKey:a}},[t]);return c.useMemo(()=>o.length===0?null:e.jsxs(f,{children:[e.jsx(j,{className:"pb-4 px-2 sm:px-6 max-sm:pt-5 max-sm:pb-1",children:e.jsx("div",{className:"px-2 sm:px-1",children:e.jsx(v,{children:e.jsx(n,{id:"BF9frx"})})})}),e.jsx(b,{className:"max-sm:p-2",children:o.length>0&&e.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4 gap-3",children:o.map(s=>{const a=d[s.name];return e.jsxs(k,{className:"hover:-translate-y-px duration-200 bg-transparent border-foreground/10 hover:shadow-md shadow-black/5",children:[e.jsx(a.icon,{className:"h-4 w-4"}),e.jsxs(S,{children:[l[s.system]?.name," ",a.name()]}),e.jsx(E,{children:s.name==="Status"?e.jsx(n,{id:"yBWEoH"}):a.invert?e.jsx(n,{id:"SiSrMr",values:{0:s.value,1:a.unit,2:s.min}}):e.jsx(n,{id:"5KrEtU",values:{0:s.value,1:a.unit,2:s.min}})}),e.jsx(y,{href:N(A,"system",{id:l[s.system]?.id}),className:"absolute inset-0 w-full h-full","aria-label":"View system"})]},s.id)})})})]}),[u.join("")])};function H(){const t=i(w);return e.jsxs("div",{className:"flex gap-1.5 justify-end items-center pe-3 sm:pe-6 mt-3.5 mb-4 text-xs opacity-80",children:[e.jsxs("a",{href:"https://github.com/henrygd/beszel",target:"_blank",className:"flex items-center gap-0.5 text-muted-foreground hover:text-foreground duration-75",rel:"noopener",children:[e.jsx($,{className:"h-3 w-3"})," GitHub"]}),e.jsx(m,{orientation:"vertical",className:"h-2.5 bg-muted-foreground opacity-70"}),e.jsxs("a",{href:"https://github.com/henrygd/beszel/releases",target:"_blank",className:"text-muted-foreground hover:text-foreground duration-75",rel:"noopener",children:["Beszel ",globalThis.BESZEL.HUB_VERSION]}),t?.v&&e.jsxs(e.Fragment,{children:[e.jsx(m,{orientation:"vertical",className:"h-2.5 bg-muted-foreground opacity-70"}),e.jsx("a",{href:t.url,target:"_blank",className:"text-yellow-500 hover:text-yellow-400 duration-75",rel:"noopener",children:e.jsx(n,{id:"bwbJYS",values:{0:t.v}})})]})]})}export{F as A,H as F};
