import{n as e}from"./rolldown-runtime-CMxvf4Kt.js";import{$n as t,Bn as n,Cn as r,Qn as i,_n as a,bn as o,gn as s,hr as c,mn as l,qt as u,rr as d,wr as f,xn as p}from"./vendor-C4JLrdLj.js";import{Bt as m,Ft as h,It as g,Jt as _,Lt as v,Nt as y,Pt as b,Rt as x,S,at as C,b as w,nt as T,ot as E,qt as D,rt as O,x as k,y as A,zt as j}from"./vendor-quasar-BMuYn1t2.js";import{Jr as M,ar as N,gr as P,hr as F,lr as I,qr as L,rr as R,ur as z}from"./ws-JRT2XE7Y.js";import{v as B,y as V}from"./index-Dhwlon97.js";var H,U=e((()=>{O(),S(),m(),g(),w(),b(),x(),_(),E(),u(),I(),B(),P(),H=r({__name:`SleepTimerBadge`,setup(e){let r=V(),u=c(!1),m=c(``);function g(){let e=new Date;m.value=`${e.getHours().toString().padStart(2,`0`)}:${e.getMinutes().toString().padStart(2,`0`)}`,u.value=!0}function _(){if(!m.value)return;let e=new Date,[t,n]=m.value.split(`:`).map(Number);if(t===void 0||n===void 0)return;let i=new Date(e);i.setHours(t,n,0,0),i<=e&&i.setDate(i.getDate()+1);let a=i.getTime()-e.getTime(),o=Math.floor(a/6e4);o>0&&r.startTimer(o),u.value=!1}function b(e){let t=new R;t.setItems([N(`15 Minutes`,()=>r.startTimer(15)),N(`30 Minutes`,()=>r.startTimer(30)),N(`45 Minutes`,()=>r.startTimer(45)),N(`1 Hour`,()=>r.startTimer(60)),N(`Custom...`,async()=>{g()}),z(),N(`Clear Timer`,()=>r.clearTimer())]),t.show(e)}return(e,c)=>f(r).isActive?(n(),a(`div`,{key:0,class:`sleep-timer-badge`,onClick:b},[p(F,{name:`sleepTimer`,size:`18px`}),p(T,null,{default:i(()=>[o(d(f(r).formattedRemainingTime)+` remaining (Ends at `+d(f(r).endTimeFormatted)+`)`,1)]),_:1}),p(D,{modelValue:u.value,"onUpdate:modelValue":c[1]||=e=>u.value=e,class:`z-top`},{default:i(()=>[p(v,{style:{"min-width":`300px`}},{default:i(()=>[p(h,{class:`row items-center`},{default:i(()=>[c[2]||=l(`div`,{class:`text-h6`},`Set Sleep Timer`,-1),p(k),t(p(j,{icon:`close`,flat:``,round:``,dense:``},null,512),[[C]])]),_:1}),p(h,{class:`flex flex-center`},{default:i(()=>[p(A,{modelValue:m.value,"onUpdate:modelValue":c[0]||=e=>m.value=e,format24h:``},null,8,[`modelValue`])]),_:1}),p(y,{align:`right`},{default:i(()=>[t(p(j,{flat:``,label:`Cancel`,color:`primary`},null,512),[[C]]),p(j,{flat:``,label:`Start`,color:`primary`,onClick:_})]),_:1})]),_:1})]),_:1},8,[`modelValue`])])):s(``,!0)}})})),W=e((()=>{})),G,K=e((()=>{U(),U(),W(),M(),G=L(H,[[`__scopeId`,`data-v-9a821224`]])}));export{K as n,G as t};