import{p as T,l as F,A as N,r as D,au as I,Q as _,n as R,a8 as E,m as o,ao as $,C as O,R as z,V as b,t as V,E as y,K as M,F as U,w as s,u as W,I as k,W as G,H as w,G as C,N as H}from"./index-c7452e6d.js";import{m as K,V as Q,b as x}from"./VOverlay-c72db402.js";import{f as j}from"./forwardRefs-a7e9d955.js";import{u as q}from"./lazy-4d251e90.js";import{c as J,o as X}from"./transition-cc715138.js";import{V as Y,e as A,b as h,a as Z}from"./VCard-8fba9a00.js";import{a as B}from"./VBtn-7556d2f4.js";import"./VImg-52c1c330.js";import"./VProgressCircular-f0ddae6b.js";import"./resizeObserver-45be22d5.js";const ee=T({fullscreen:Boolean,retainFocus:{type:Boolean,default:!0},scrollable:Boolean,...K({origin:"center center",scrollStrategy:"block",transition:{component:Q},zIndex:2400})},"VDialog"),ae=F()({name:"VDialog",props:ee(),emits:{"update:modelValue":a=>!0,afterLeave:()=>!0},setup(a,f){let{emit:c,slots:u}=f;const l=N(a,"modelValue"),{scopeId:d}=q(),e=D();function g(t){var i,v;const r=t.relatedTarget,m=t.target;if(r!==m&&((i=e.value)!=null&&i.contentEl)&&((v=e.value)!=null&&v.globalTop)&&![document,e.value.contentEl].includes(m)&&!e.value.contentEl.contains(m)){const n=$(e.value.contentEl);if(!n.length)return;const p=n[0],S=n[n.length-1];r===p?S.focus():p.focus()}}I&&_(()=>l.value&&a.retainFocus,t=>{t?document.addEventListener("focusin",g):document.removeEventListener("focusin",g)},{immediate:!0});function P(){var t;(t=e.value)!=null&&t.contentEl&&!e.value.contentEl.contains(document.activeElement)&&e.value.contentEl.focus({preventScroll:!0})}function L(){c("afterLeave")}return _(l,async t=>{var r;t||(await R(),(r=e.value.activatorEl)==null||r.focus({preventScroll:!0}))}),J(()=>{const t=x.filterProps(a),r=E({"aria-haspopup":"dialog","aria-expanded":String(l.value)},a.activatorProps),m=E({tabindex:-1},a.contentProps);return o(x,E({ref:e,class:["v-dialog",{"v-dialog--fullscreen":a.fullscreen,"v-dialog--scrollable":a.scrollable},a.class],style:a.style},t,{modelValue:l.value,"onUpdate:modelValue":i=>l.value=i,"aria-modal":"true",activatorProps:r,contentProps:m,role:"dialog",onAfterEnter:P,onAfterLeave:L},d),{activator:u.activator,default:function(){for(var i=arguments.length,v=new Array(i),n=0;n<i;n++)v[n]=arguments[n];return o(X,{root:"VDialog"},{default:()=>{var p;return[(p=u.default)==null?void 0:p.call(u,...v)]}})}})}),j({},e)}}),te={class:"bg-background grid grid-cols-1 p-4 md:grid-cols-2 xl:grid-cols-4"},oe={class:""},ve=O({__name:"Devices",setup(a){const f=D(),c=D(!1),u=async function(l){await b.deleteDevice(l),f.value=await b.getAllDevices(!1),c.value=!0};return z(async()=>{f.value=await b.getAllDevices(!1)}),(l,d)=>(V(),y("div",te,[(V(!0),y(M,null,U(f.value,(e,g)=>(V(),y("div",{key:g},[e.id!="9c0e0865-f3b0-488f-8d3f-b3b0cdda5de7"?(V(),W(h,{key:0,class:"elevation-2 m-4 max-w-sm"},{default:s(()=>[o(Y,null,{default:s(()=>[k("span",{class:G(["mdi pr-2",e.icon])},null,2),k("span",oe,w(e.name),1)]),_:2},1024),o(A,null,{default:s(()=>[o(B,{class:"m-2",onClick:P=>u(e.id)},{default:s(()=>[C(w(l.$t("settings.delete_action")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024)):H("",!0)]))),128)),o(ae,{modelValue:c.value,"onUpdate:modelValue":d[1]||(d[1]=e=>c.value=e),width:"auto"},{default:s(()=>[o(h,null,{default:s(()=>[o(Z,null,{default:s(()=>[C(" Please remove the device manually from the config file. ")]),_:1}),o(A,null,{default:s(()=>[o(B,{color:"primary",block:"",onClick:d[0]||(d[0]=e=>c.value=!1)},{default:s(()=>[C(" Close ")]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]))}});export{ve as default};
