import{l as Y,p as Z,y as P,r as b,aj as ee,c as x,d as ae,a3 as te,m as a,a4 as B,K as E,B as le,P as se,o as oe,R as C,E as ne,w as i,t as ie,H as h,I as k,J as _,$ as w,G as D}from"./index-Cp3-A7ao.js";import{b as I,V as A,f as F}from"./VCard-D5wKeDng.js";import{c as re}from"./index-DkrqsE6v.js";import{G as ue,a as de,t as ce,V as me,L as ve}from"./transition-BAtvBeuS.js";import{u as fe,V as N,m as Ve}from"./VInput-BVhPJyoq.js";import{V as R,m as ge}from"./VSelectionControl-Cd3GaTT-.js";import{V as Ce}from"./VProgressCircular-DvjORuMu.js";import"./VImg-tOz2PgiP.js";import"./resizeObserver-BoHHG32A.js";const he=Z({indeterminate:Boolean,inset:Boolean,flat:Boolean,loading:{type:[Boolean,String],default:!1},...Ve(),...ge()},"VSwitch"),ke=Y()({name:"VSwitch",inheritAttrs:!1,props:he(),emits:{"update:focused":e=>!0,"update:modelValue":e=>!0,"update:indeterminate":e=>!0},setup(e,u){let{attrs:o,slots:t}=u;const l=P(e,"indeterminate"),n=P(e,"modelValue"),{loaderClasses:M}=ue(e),{isFocused:T,focus:U,blur:z}=fe(e),y=b(),p=ee&&window.matchMedia("(forced-colors: active)").matches,L=x(()=>typeof e.loading=="string"&&e.loading!==""?e.loading:e.color),$=ae(),G=x(()=>e.id||`switch-${$}`);function j(){l.value&&(l.value=!1)}function H(d){var c,m;d.stopPropagation(),d.preventDefault(),(m=(c=y.value)==null?void 0:c.input)==null||m.click()}return de(()=>{const[d,c]=te(o),m=N.filterProps(e),J=R.filterProps(e);return a(N,B({class:["v-switch",{"v-switch--flat":e.flat},{"v-switch--inset":e.inset},{"v-switch--indeterminate":l.value},M.value,e.class]},d,m,{modelValue:n.value,"onUpdate:modelValue":v=>n.value=v,id:G.value,focused:T.value,style:e.style}),{...t,default:v=>{let{id:K,messagesId:O,isDisabled:W,isReadonly:q,isValid:S}=v;const f={model:n,isValid:S};return a(R,B({ref:y},J,{modelValue:n.value,"onUpdate:modelValue":[r=>n.value=r,j],id:K.value,"aria-describedby":O.value,type:"checkbox","aria-checked":l.value?"mixed":void 0,disabled:W.value,readonly:q.value,onFocus:U,onBlur:z},c),{...t,default:r=>{let{backgroundColorClasses:V,backgroundColorStyles:s}=r;return a("div",{class:["v-switch__track",p?void 0:V.value],style:s.value,onClick:H},[t["track-true"]&&a("div",{key:"prepend",class:"v-switch__track-true"},[t["track-true"](f)]),t["track-false"]&&a("div",{key:"append",class:"v-switch__track-false"},[t["track-false"](f)])])},input:r=>{let{inputNode:V,icon:s,backgroundColorClasses:Q,backgroundColorStyles:X}=r;return a(E,null,[V,a("div",{class:["v-switch__thumb",{"v-switch__thumb--filled":s||e.loading},e.inset||p?void 0:Q.value],style:e.inset?void 0:X.value},[t.thumb?a(ce,{defaults:{VIcon:{icon:s,size:"x-small"}}},{default:()=>[t.thumb({...f,icon:s})]}):a(re,null,{default:()=>[e.loading?a(ve,{name:"v-switch",active:!0,color:S.value===!1?void 0:L.value},{default:g=>t.loader?t.loader(g):a(Ce,{active:g.isActive,color:g.color,indeterminate:!0,size:"16",width:"2"},null)}):s&&a(me,{key:String(s),icon:s,size:"x-small"},null)]})])])}})}})}),{}}}),_e={class:"my-2"},Ie=le({__name:"CoreConfigs",setup(e){const u=b(""),o=b(!1);return se(o,()=>{C.setDeviceControlDisabled(o.value)}),oe(async()=>{u.value=await C.getVersion(),o.value=(await C.getDeviceControlDisabled()).disable_device_control}),(t,l)=>(ie(),ne(E,null,[a(I,{class:"elevation-2 ma-4 max-w-sm"},{default:i(()=>[a(A,null,{default:i(()=>[h(k(_(w)("settings.device_control")),1)]),_:1}),a(F,null,{default:i(()=>[a(ke,{modelValue:o.value,"onUpdate:modelValue":l[0]||(l[0]=n=>o.value=n),label:_(w)("settings.disableDeviceControl")},null,8,["modelValue","label"])]),_:1})]),_:1}),a(I,{class:"elevation-2 ma-4 max-w-sm"},{default:i(()=>[a(A,null,{default:i(()=>[h(k(_(w)("settings.about")),1)]),_:1}),a(F,null,{default:i(()=>[D("div",_e,[l[1]||(l[1]=h(" Energy Assistant Copyright © 2025 by Paul Frank ")),D("p",null,"Version: "+k(u.value),1)])]),_:1})]),_:1})],64))}});export{Ie as default};
