import{Q as g}from"./chunk-C2blguT0.js";import{Q as S}from"./chunk-BmZ_dvqz.js";import{u as W,a as X,d as Z}from"./chunk-CusLMHK2.js";import{B as H,_ as R,L as q,a as w,c as J,M as D,t as n,m as z,N as P}from"./app-CPb3bToC.js";import{b as K}from"./chunk-DIiNYqqq.js";import{m as Y,a as y,l as k,D as v,E as h,V as i,ab as ee,B as te,q as l,as as o,an as d,u as p,F as I,ah as M,Z as ie,au as T,at as A,X as $}from"./chunk-DhYw-kuD.js";import{Q as F}from"./chunk-CUANlmUG.js";import{Q as re}from"./chunk-fMotqvPG.js";import{Q as B,a as se}from"./chunk-Cetswyy9.js";import{Q as ae}from"./chunk-D-EdmasP.js";import{Q as le}from"./chunk-DyHcsQzx.js";import{C as oe}from"./chunk-CsOl3O8E.js";import{a as ne,b as de,m as ce}from"./chunk-GGPowwzA.js";import{g as O}from"./chunk-CcMVSZaG.js";import{k as ue}from"./chunk-BsM38hVX.js";import"./chunk-C7mbSHwF.js";import"./chunk-DfTn_VfD.js";import"./chunk-CoZXVP_c.js";import"./chunk-8e5kB75k.js";import"./chunk-D3Pjrapm.js";import"./chunk-DbbZ0htz.js";import"./chunk-BjYP5sR0.js";import"./chunk-DBKH8df9.js";import"./chunk-xwEmqXCW.js";import"./chunk-DOJZQpJk.js";const _e={...W,min:{type:Number,default:0},max:{type:Number,default:100},color:String,centerColor:String,trackColor:String,fontSize:String,rounded:Boolean,thickness:{type:Number,default:.2,validator:e=>e>=0&&e<=1},angle:{type:Number,default:0},showValue:Boolean,reverse:Boolean,instantFeedback:Boolean},V=50,L=2*V,E=L*Math.PI,me=Math.round(E*1e3)/1e3,ve=H({name:"QCircularProgress",props:{..._e,value:{type:Number,default:0},animationSpeed:{type:[String,Number],default:600},indeterminate:Boolean},setup(e,{slots:s}){const{proxy:{$q:t}}=Y(),x=X(e),a=y(()=>{const _=(t.lang.rtl===!0?-1:1)*e.angle;return{transform:e.reverse!==(t.lang.rtl===!0)?`scale3d(-1, 1, 1) rotate3d(0, 0, 1, ${-90-_}deg)`:`rotate3d(0, 0, 1, ${_-90}deg)`}}),m=y(()=>e.instantFeedback!==!0&&e.indeterminate!==!0?{transition:`stroke-dashoffset ${e.animationSpeed}ms ease 0s, stroke ${e.animationSpeed}ms ease`}:""),r=y(()=>L/(1-e.thickness/2)),c=y(()=>`${r.value/2} ${r.value/2} ${r.value} ${r.value}`),u=y(()=>K(e.value,e.min,e.max)),C=y(()=>e.max-e.min),f=y(()=>e.thickness/2*r.value),Q=y(()=>{const _=(e.max-u.value)/C.value,b=e.rounded===!0&&u.value{const _=[];e.centerColor!==void 0&&e.centerColor!=="transparent"&&_.push(k("circle",{class:`q-circular-progress__center text-${e.centerColor}`,fill:"currentColor",r:V-f.value/2,cx:r.value,cy:r.value})),e.trackColor!==void 0&&e.trackColor!=="transparent"&&_.push(N({cls:"track",thickness:f.value,offset:0,color:e.trackColor})),_.push(N({cls:"circle",thickness:f.value,offset:Q.value,color:e.color,rounded:e.rounded===!0?"round":void 0}));const b=[k("svg",{class:"q-circular-progress__svg",style:a.value,viewBox:c.value,"aria-hidden":"true"},_)];return e.showValue===!0&&b.push(k("div",{class:"q-circular-progress__text absolute-full row flex-center content-center",style:{fontSize:e.fontSize}},s.default!==void 0?s.default():[k("div",u.value)])),k("div",{class:`q-circular-progress q-circular-progress--${e.indeterminate===!0?"in":""}determinate`,style:x.value,role:"progressbar","aria-valuemin":e.min,"aria-valuemax":e.max,"aria-valuenow":e.indeterminate===!0?void 0:u.value},Z(s.internal,b))}}}),fe={props:["level"]},he={class:"battery"};function ge(e,s,t,x,a,m){return v(),h("div",he,[i("div",{class:"battery-level",style:ee({height:t.level+"%"})},null,4)])}const ye=R(fe,[["render",ge],["__scopeId","data-v-8a789231"]]),pe={style:{width:"100%",height:"919px",display:"flex","justify-content":"center","align-items":"center","background-image":"url('src/assets/img/bg-splash.webp')","background-repeat":"repeat"}},be={class:"flex-col"},we={class:"row justify-between"},ke={class:"col-3"},xe={style:{display:"flex","justify-content":"center","align-items":"center","font-size":"2rem",color:"var(--color-70)","margin-top":"1rem","margin-left":"2rem",width:"12rem"}},Ce={class:"col-3",style:{display:"flex","justify-content":"center","align-items":"center"}},Se={style:{display:"flex","justify-content":"center","align-items":"center"}},$e={class:"flex-col",style:{height:"100%",width:"100%"}},Qe={style:{height:"80%",width:"100%",display:"flex","justify-content":"center","align-items":"center"}},Be={style:{height:"80%",width:"100%","justify-content":"center","align-items":"center"}},Ve={key:0,style:{height:"80%",width:"100%","justify-content":"center","align-items":"center"}},Ne=["src"],je={style:{display:"flex","flex-direction":"row",height:"4rem",width:"100%","align-items":"center"}},qe={style:{"margin-left":"1rem",height:"100%",display:"flex","flex-direction":"row","align-items":"center",width:"55%"}},De={key:0,style:{width:"13%",display:"flex","flex-direction":"row","align-items":"center"}},ze={style:{width:"20%","margin-left":"1rem",height:"100%",display:"flex","flex-direction":"row","align-items":"center"}},Pe={key:0,style:{"margin-left":"1rem",height:"100%",display:"flex","flex-direction":"row","align-items":"center"}},Ie={key:1,style:{"margin-left":"1rem",height:"100%",display:"flex","flex-direction":"row","align-items":"center"}},Me={key:2},Te={class:"text-h6"},Ae={class:"text-h8"},Fe={data(){return{device_refresh_dialog:!1,device_history_dialog:!1,devices:[],devices_history:[]}},methods:{async on_device_refresh(){this.$router.go(0)},async refresh_device(){const e=q();try{let s=w();await s.update_device(),this.devices=s.online_devices;for(let t=0;t{window.sessionStorage.removeItem("polling-rate-change-time"),this.$router.go(0)},1e3);return}try{let m=w();await m.update_device(),this.devices=m.online_devices;for(let r=0;r{const x=te("el-scrollbar");return v(),h("div",pe,[l(S,{bordered:"",style:{width:"115rem",height:"54rem","user-select":"none","background-color":"rgba(255, 255, 255, 0.5)"}},{default:o(()=>[i("div",be,[i("div",we,[i("div",ke,[i("div",xe,[t[5]||(t[5]=i("i",{class:"fa-solid fa-tachograph-digital"},null,-1)),i("div",null,d(p(n)("device_center")),1)])]),i("div",Ce,[l(g,{color:"red",onClick:t[0]||(t[0]=a=>s.on_device_add()),id:"guider_device_add"},{default:o(()=>[t[6]||(t[6]=i("i",{class:"fa-solid fa-plus"},null,-1)),i("div",null,d(p(n)("add_device")),1)]),_:1}),l(g,{color:"orange",style:{"margin-left":"0.5rem"},onClick:t[1]||(t[1]=a=>s.on_device_history()),id:"guider_device_history"},{default:o(()=>[t[7]||(t[7]=i("i",{class:"fa-solid fa-clock-rotate-left"},null,-1)),i("div",null,d(p(n)("granted_log")),1)]),_:1}),l(g,{color:"green",style:{"margin-left":"0.5rem"},onClick:t[2]||(t[2]=a=>s.on_device_refresh()),id:"guider_device_refresh"},{default:o(()=>[t[8]||(t[8]=i("i",{class:"fa-solid fa-rotate-right"},null,-1)),i("div",null,d(p(n)("refresh_device")),1)]),_:1})])]),i("div",Se,[l(x,{style:{height:"42rem","margin-top":"4rem",width:"105rem"}},{default:o(()=>[(v(!0),h(I,null,M(s.devices,(a,m)=>(v(),T(S,{class:"card-device-item",onClick:r=>s.on_device_select(m)},{default:o(()=>[i("div",$e,[i("div",Qe,[i("div",Be,[a.thumb?(v(),h("div",Ve,[i("img",{src:a.thumb.backgroundImage,style:{width:"100%",height:"100%","object-fit":"contain"},draggable:"false"},null,8,Ne)])):A("",!0)])]),i("div",je,[i("div",qe,d(a.product_name_text.length>20?a.product_name_text.substring(0,20)+"...":a.product_name_text),1),s.devices[m].battery_show?(v(),h("div",De,[l(ye,{level:s.devices[m].battery_value},null,8,["level"]),i("div",null,d(s.devices[m].battery_value),1)])):A("",!0),i("div",ze,[a.type_connection==="wireless"?(v(),h("div",Pe,[t[9]||(t[9]=i("i",{class:"fa-solid fa-wifi"},null,-1)),i("div",null,d(p(n)("wireless")),1)])):a.type_connection==="wired"?(v(),h("div",Ie,[t[10]||(t[10]=i("i",{class:"fa-brands fa-usb"},null,-1)),i("div",null,d(p(n)("wired")),1)])):(v(),h("div",Me,t[11]||(t[11]=[i("i",{class:"fa-regular fa-circle-question"},null,-1)])))])])])]),_:2},1032,["onClick"]))),256))]),_:1})])]),l(F,{modelValue:s.device_refresh_dialog,"onUpdate:modelValue":t[3]||(t[3]=a=>s.device_refresh_dialog=a),persistent:""},{default:o(()=>[l(S,{class:"dialog-card"},{default:o(()=>[l(ve,{indeterminate:"",rounded:"",size:"50px",color:"lime",class:"q-ma-md"})]),_:1})]),_:1},8,["modelValue"])]),_:1}),l(F,{modelValue:s.device_history_dialog,"onUpdate:modelValue":t[4]||(t[4]=a=>s.device_history_dialog=a),"backdrop-filter":"blur(4px)"},{default:o(()=>[l(S,{class:"dialog-card",style:{width:"60rem"}},{default:o(()=>[l(B,{class:"row items-center q-pb-none"},{default:o(()=>[i("div",Te,d(p(n)("granted_device")),1),l(re),ie(l(g,{icon:"close",flat:"",round:"",dense:""},null,512),[[oe]])]),_:1}),l(B,null,{default:o(()=>[l(le,{style:{height:"40rem",width:"100%"}},{default:o(()=>[(v(!0),h(I,null,M(s.devices_history,a=>(v(),T(S,{class:"dialog-card",style:{"margin-bottom":"4px"}},{default:o(()=>[l(B,{class:"bg-primary text-white"},{default:o(()=>[i("div",Ae,d(a.product_name_device),1)]),_:2},1024),l(ae),l(se,{align:"right"},{default:o(()=>[l(g,{"no-caps":"",flat:""},{default:o(()=>[$("connect:"+d(a.type_connection),1)]),_:2},1024),l(g,{"no-caps":"",flat:""},{default:o(()=>[$("device:"+d(a.type_device),1)]),_:2},1024),l(g,{"no-caps":"",flat:""},{default:o(()=>[$("VID:"+d(Number(a.vendor_id).toString(16).padStart(4,"0")),1)]),_:2},1024),l(g,{"no-caps":"",flat:""},{default:o(()=>[$("PID:"+d(Number(a.product_id).toString(16).padStart(4,"0")),1)]),_:2},1024)]),_:2},1024)]),_:2},1024))),256))]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])])}}}),mt=R(Oe,[["__scopeId","data-v-5cbd993f"]]);export{mt as default};