import{d as M,aj as w,r as N,N as B,c as n,g as f,f as o,w as s,u as t,Y as p,t as r,i,j as d,e as m,b as l}from"./index-103db515.js";import{V as E,E as S}from"./EditConfig-f05929af.js";import{V as T,a as j}from"./VCardText-1a59cac1.js";import{a as v}from"./VCard-d4f085fd.js";import{V as k}from"./VList-cac73f62.js";import{V as I}from"./VTextField-73438668.js";import"./VExpansionPanels-dacf6c3c.js";import"./VListItem-ab7a82e2.js";import"./VCheckboxBtn-19bafbc9.js";import"./VMenu-482e7fbc.js";import"./VForm-f2e1d3c9.js";import"./VVirtualScroll-b23fb9a8.js";import"./VSpacer-adcb10ea.js";/* empty css              */import"./VDialog-08f8879f.js";import"./VAlert-4165d2e6.js";import"./_plugin-vue_export-helper-c27b6911.js";const D={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},U=["href"],F=i("br",null,null,-1),O=i("br",null,null,-1),R=i("br",null,null,-1),Y=i("br",null,null,-1),re=M({__name:"EditPlayer",props:{playerId:{}},setup($){const C=w(),e=N(),c=$;B(()=>c.playerId,async a=>{a&&(e.value=await l.getPlayerConfig(a))},{immediate:!0});const P=async function(a){a.enabled=e.value.enabled,a.name=e.value.name||null,l.savePlayerConfig(c.playerId,a),C.push({name:"playersettings"})};return(a,y)=>(n(),f("section",null,[o(j,null,{default:s(()=>{var _,g;return[e.value&&t(l).getProviderManifest(e.value.provider).domain in t(l).providerManifests?(n(),f("div",D,[o(T,null,{default:s(()=>[p(r(a.$t("settings.config_player",[e.value.name||t(l).players[e.value.player_id].name])),1)]),_:1}),o(v,null,{default:s(()=>[i("b",null,r(a.$t("settings.player_id"))+": ",1),p(r(e.value.player_id),1)]),_:1}),o(v,null,{default:s(()=>{var u,b,V,h;return[i("b",null,r(a.$t("settings.player_provider"))+": ",1),p(r((u=t(l).getProviderManifest(e.value.provider))==null?void 0:u.name)+" ( "+r((b=t(l).getProviderManifest(e.value.provider))==null?void 0:b.description)+") ",1),(V=t(l).getProviderManifest(e.value.provider))!=null&&V.documentation?(n(),f("a",{key:0,href:(h=t(l).getProviderManifest(e.value.provider))==null?void 0:h.documentation,target:"_blank"},r(a.$t("settings.check_docs")),9,U)):d("",!0)]}),_:1}),t(l).players[e.value.player_id]?(n(),m(v,{key:0},{default:s(()=>[i("b",null,r(a.$t("settings.player_model"))+": ",1),p(r(t(l).players[e.value.player_id].device_info.manufacturer)+" / "+r(t(l).players[e.value.player_id].device_info.model),1)]),_:1})):d("",!0),t(l).players[e.value.player_id]?(n(),m(v,{key:1},{default:s(()=>[i("b",null,r(a.$t("settings.player_address"))+": ",1),p(r(t(l).players[e.value.player_id].device_info.address),1)]),_:1})):d("",!0),o(v,null,{default:s(()=>[i("b",null,r(a.$t("settings.player_type_label"))+": ",1),p(r(a.$t(`player_type.${t(l).players[e.value.player_id].type}`)),1)]),_:1}),F,o(k),O,R,"name"in e.value?(n(),m(I,{key:2,modelValue:e.value.name,"onUpdate:modelValue":y[0]||(y[0]=u=>e.value.name=u),placeholder:(_=e.value)==null?void 0:_.name,label:a.$t("settings.player_name"),variant:"outlined",clearable:"",class:"configcolumnleft",style:{"margin-right":"25px"}},null,8,["modelValue","placeholder","label"])):d("",!0),"enabled"in e.value?(n(),m(E,{key:3,modelValue:e.value.enabled,"onUpdate:modelValue":y[1]||(y[1]=u=>e.value.enabled=u),label:a.$t("settings.enable_player"),color:"primary",disabled:(g=t(l).getProviderManifest(e.value.provider))==null?void 0:g.builtin},null,8,["modelValue","label","disabled"])):d("",!0)])):d("",!0),Y,o(k),e.value?(n(),m(S,{key:1,disabled:!e.value.enabled,"config-entries":Object.values(e.value.values),onSubmit:P},null,8,["disabled","config-entries"])):d("",!0)]}),_:1})]))}});export{re as default};
