import _ from"./ThemePicker-82c99768.js";import{d as b,r,s as h,i as d,_ as T,f as u,a as S,c as g,b as s,g as m,p as i,q as k,u as H}from"./index-b1308428.js";import I from"./Updater-38554013.js";const U=b({components:{ThemePicker:_,Updater:I},setup(){const e=r(d("settingsStore")),o=r(d("updateStore")),c=r(d("websocket")),n=()=>{c.value.send(JSON.stringify({type:"settings",settings:e.value}))};return{settingsStore:e,updateStore:o,setTheme:t=>{t!==e.value.selectedTheme&&(e.value.selectedTheme=t,h(e.value.selectedTheme),n())},setTfFormat:t=>{t!==e.value.tfHourTime&&(e.value.tfHourTime=t,n())},setMetric:t=>{t!==e.value.metricUnits&&(e.value.metricUnits=t,n())},updateHasInfo:t=>!!(t.error||t.update)}}});const a=e=>(k("data-v-9f91e494"),e=e(),H(),e),$={id:"settings-container"},C={class:"option",id:"theme"},y=a(()=>s("p",{class:"option-title"},"Themes",-1)),F={class:"option",id:"tf-time"},M=a(()=>s("p",{class:"option-title"},"Time Format",-1)),w={class:"bool-btns btns"},B={class:"option",id:"units"},N=a(()=>s("p",{class:"option-title"},"Units",-1)),P={class:"bool-btns btns"},V={class:"option",id:"updates"},q=a(()=>s("p",{class:"option-title"},"Updates",-1));function z(e,o,c,n,v,f){const l=u("ThemePicker"),p=u("Updater");return S(),g("div",$,[s("div",C,[y,m(l,{setTheme:e.setTheme},null,8,["setTheme"])]),s("div",F,[M,s("div",w,[s("div",{class:i(["bool-btn",e.settingsStore.tfHourTime?"active":"inactive"]),onClick:o[0]||(o[0]=t=>e.setTfFormat(!0))},"24-Hour",2),s("div",{class:i(["bool-btn",e.settingsStore.tfHourTime?"inactive":"active"]),onClick:o[1]||(o[1]=t=>e.setTfFormat(!1))},"12-Hour",2)])]),s("div",B,[N,s("div",P,[s("div",{class:i(["bool-btn",e.settingsStore.metricUnits?"active":"inactive"]),onClick:o[2]||(o[2]=t=>e.setMetric(!0))},"Metric",2),s("div",{class:i(["bool-btn",e.settingsStore.metricUnits?"inactive":"active"]),onClick:o[3]||(o[3]=t=>e.setMetric(!1))},"Imperial",2)])]),s("div",V,[q,s("div",{class:i(["single-btns btns",e.updateHasInfo(e.updateStore)&&e.updateStore.error?"failed-btn":e.updateHasInfo(e.updateStore)&&e.updateStore.update?"ready-btn":""])},[m(p)],2)])])}const j=T(U,[["render",z],["__scopeId","data-v-9f91e494"]]);export{j as default};
