import{r as e}from"./markdown-Biq8ujIZ.js";import{t}from"./createLucideIcon-dIT_VeEb.js";import{t as n}from"./clock-DjLBWMLN.js";import{q as r}from"./index-Bh9Wgd1K.js";import{n as i,t as a}from"./Card-BKKJdAcY.js";import{n as o}from"./widgets-GyfG0yfv.js";var s=t(`monitor-check`,[[`path`,{d:`m9 10 2 2 4-4`,key:`1gnqz4`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}]]),c=t(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),l=t(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),u=e();function d(){let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}var f=e=>e>=60?`${Math.floor(e/60)}h ${e%60}m`:`${e}m`;function p(){return(0,u.jsxs)(a,{className:`flex items-center gap-3 ring-1 ring-accent-500/40`,children:[(0,u.jsx)(`span`,{className:`flex h-10 w-10 items-center justify-center rounded-xl bg-accent-500/15 text-accent-600`,children:(0,u.jsx)(s,{size:20})}),(0,u.jsxs)(`div`,{className:`flex-1`,children:[(0,u.jsx)(`p`,{className:`font-medium text-text`,children:`Desktop blocker active`}),(0,u.jsx)(`p`,{className:`text-sm text-text-muted`,children:`Distracting apps & sites are blocked on this PC during focus. Your blocklist syncs automatically.`})]})]})}function m(){let{data:e}=r(`desktopUsage/${d()}`),t=(e?.apps??[]).slice(0,8),s=e?.totalMinutes??0,l=t.reduce((e,t)=>Math.max(e,t.minutes),1);return(0,u.jsxs)(`div`,{className:`space-y-3`,children:[(0,u.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,u.jsx)(o,{icon:(0,u.jsx)(n,{size:20}),label:`Screen time today`,value:f(s),accent:`brand`}),(0,u.jsx)(o,{icon:(0,u.jsx)(c,{size:20}),label:`Apps used`,value:t.length,accent:`green`})]}),(0,u.jsxs)(a,{children:[(0,u.jsx)(i,{title:`Most used on this PC today`}),t.length===0?(0,u.jsx)(`p`,{className:`py-6 text-center text-sm text-text-muted`,children:`No screen time recorded yet today — keep the app running and it'll fill in.`}):(0,u.jsx)(`ul`,{className:`space-y-3`,children:t.map(e=>(0,u.jsxs)(`li`,{children:[(0,u.jsxs)(`div`,{className:`mb-1 flex justify-between text-sm`,children:[(0,u.jsx)(`span`,{className:`truncate text-text`,children:e.name}),(0,u.jsx)(`span`,{className:`text-text-muted`,children:f(e.minutes)})]}),(0,u.jsx)(`div`,{className:`h-2 overflow-hidden rounded-full bg-border`,children:(0,u.jsx)(`div`,{className:`h-full rounded-full bg-brand-500`,style:{width:`${e.minutes/l*100}%`}})})]},e.name))})]})]})}export{m as n,l as r,p as t};