"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[9767],{6:function(e,t,n){n.d(t,{Z:function(){return h}});var a=n(6252),o=n(3577),l=n(9963);const i=e=>((0,a.dD)("data-v-a6396ae8"),e=e(),(0,a.Cn)(),e),c=["checked"],s=i((()=>(0,a._)("div",{class:"switch"},[(0,a._)("div",{class:"dot"})],-1))),d={class:"label"};function u(e,t,n,i,u,r){return(0,a.wg)(),(0,a.iD)("div",{class:(0,o.C_)(["power-switch",{disabled:n.disabled}]),onClick:t[0]||(t[0]=(0,l.iM)(((...e)=>r.onInput&&r.onInput(...e)),["stop"]))},[(0,a._)("input",{type:"checkbox",checked:n.value},null,8,c),(0,a._)("label",null,[s,(0,a._)("span",d,[(0,a.WI)(e.$slots,"default",{},void 0,!0)])])],2)}var r={name:"ToggleSwitch",emits:["input"],props:{value:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},methods:{onInput(e){if(this.disabled)return!1;this.$emit("input",e)}}},p=n(3744);const v=(0,p.Z)(r,[["render",u],["__scopeId","data-v-a6396ae8"]]);var h=v},9767:function(e,t,n){n.r(t),n.d(t,{default:function(){return b}});var a=n(6252),o=n(9963),l=n(3577);const i={class:"entity device-container"},c={class:"head"},s={class:"col-1 icon"},d={class:"col-2 connector"},u={class:"col-9 label"},r=["textContent"];function p(e,t,n,p,v,h){const f=(0,a.up)("EntityIcon"),g=(0,a.up)("ToggleSwitch");return(0,a.wg)(),(0,a.iD)("div",i,[(0,a._)("div",c,[(0,a._)("div",s,[(0,a.Wm)(f,{entity:e.value,loading:e.loading,error:e.error},null,8,["entity","loading","error"])]),(0,a._)("div",d,[(0,a.Wm)(g,{value:e.value.connected,disabled:e.loading,onInput:h.connect,onClick:t[0]||(t[0]=(0,o.iM)((()=>{}),["stop"]))},null,8,["value","disabled","onInput"])]),(0,a._)("div",u,[(0,a._)("div",{class:"name",textContent:(0,l.zw)(e.value.name)},null,8,r)])])])}var v=n(7909),h=n(5581),f=n(6),g={name:"BluetoothDevice",components:{EntityIcon:h["default"],ToggleSwitch:f.Z},mixins:[v["default"]],methods:{async connect(e){e.stopPropagation(),this.$emit("loading",!0);const t="bluetooth."+(this.value.connected?"disconnect":"connect");try{await this.request(t,{device:this.value.address})}finally{this.$emit("loading",!1)}}}},_=n(3744);const m=(0,_.Z)(g,[["render",p],["__scopeId","data-v-653f75c2"]]);var b=m}}]);
//# sourceMappingURL=9767.fa44e155.js.map