import{d as M,a1 as w,r as B,I,c as n,h as f,f as o,w as s,u as t,m as p,t as r,g as i,j as d,e as m,b as l}from"./index-0ae84607.js";import{V as N,_ as S}from"./EditConfig.vue_vue_type_style_index_0_lang-991e1055.js";import{a as T,V as j}from"./VCardText-b1a0de89.js";import{a as v}from"./VCard-e96ab32b.js";import{a as k}from"./forwardRefs-d0d7c5bd.js";import{V as D}from"./VTextField-4bf39c0d.js";import"./VExpansionPanel-4cf67b18.js";import"./VInput-00e20677.js";import"./VSlideGroup-18f8a11f.js";import"./VMenu-f26d3a19.js";import"./VForm-272c3dd0.js";/* empty css              */import"./VDialog-2b5eada8.js";import"./VAlert-212471f5.js";import"./VSelect-2b6c5c22.js";import"./VVirtualScroll-06bbaaf5.js";const E={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),q=i("br",null,null,-1),te=M({__name:"EditPlayer",props:{playerId:{}},setup($){const P=w(),e=B(),_=$;I(()=>_.playerId,async a=>{a&&(e.value=await l.getPlayerConfig(a))},{immediate:!0});const C=async function(a){a.enabled=e.value.enabled,a.name=e.value.name||null,l.savePlayerConfig(_.playerId,a),P.push({name:"playersettings"})};return(a,y)=>(n(),f("section",null,[o(j,null,{default:s(()=>{var c,b;return[e.value&&t(l).getProviderManifest(e.value.provider).domain in t(l).providerManifests?(n(),f("div",E,[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,g,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((g=t(l).getProviderManifest(e.value.provider))==null?void 0:g.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(D,{key:2,modelValue:e.value.name,"onUpdate:modelValue":y[0]||(y[0]=u=>e.value.name=u),placeholder:(c=e.value)==null?void 0:c.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(N,{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:(b=t(l).getProviderManifest(e.value.provider))==null?void 0:b.builtin},null,8,["modelValue","label","disabled"])):d("",!0)])):d("",!0),q,o(k),e.value?(n(),m(S,{key:1,disabled:!e.value.enabled,"config-entries":Object.values(e.value.values),onSubmit:C},null,8,["disabled","config-entries"])):d("",!0)]}),_:1})]))}});export{te as default};
