import{x as w,az as I,r as S,w as D,y as o,D as g,n as p,A as u,I as a,G as t,S as m,J as r,B as s,K as d,z as y}from"./index-CFvoaD7J.js";import{E}from"./EditConfig-Ct-cJfRC.js";import{b as N,V as T,a as v}from"./VCardText-CpOuj25H.js";import{V as C}from"./VList-fGk9SRdf.js";import{V as h}from"./VTextField-DF4u_eMy.js";import{V as z}from"./VSwitch-Cbz5zuOr.js";import{v as U}from"./VListItem-CSPID7yq.js";import"./VExpansionPanels-BsT7TGi_.js";import"./VMenu-9pSrU4Fo.js";import"./VCheckboxBtn-CRgZyCzV.js";import"./VAlert-CIiIOQza.js";import"./VSlider-ka6goZbo.js";import"./VVirtualScroll-BDBVEoUv.js";import"./VChip-Ccz1-bmn.js";import"./VForm-B86dz_JX.js";import"./VCard-DxLPF-Ra.js";import"./VSpacer-UYEiyhN7.js";/* empty css              */import"./VDialog-CdvGeqlS.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const j={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},A=["href"],ie=w({__name:"EditPlayer",props:{playerId:{}},setup(P){const b=I(),e=S(),f=P;D(()=>f.playerId,async l=>{l&&(e.value=await a.getPlayerConfig(l))},{immediate:!0});const B=async function(l){l.enabled=e.value.enabled,l.name=e.value.name||null,a.savePlayerConfig(f.playerId,l),b.push({name:"playersettings"})},M=function(){b.push(`/settings/editplayer/${f.playerId}/dsp`)};return(l,i)=>(o(),g("section",null,[p(N,null,{default:u(()=>{var _,V,c;return[e.value&&t(a).getProviderManifest(e.value.provider).domain in t(a).providerManifests?(o(),g("div",j,[p(T,null,{default:u(()=>{var n;return[m(r(l.$t("settings.config_player",[e.value.name||((n=t(a).players[e.value.player_id])==null?void 0:n.name)||e.value.default_name])),1)]}),_:1}),p(v,null,{default:u(()=>[s("b",null,r(l.$t("settings.player_id"))+": ",1),m(r(e.value.player_id),1)]),_:1}),p(v,null,{default:u(()=>{var n,k,$;return[s("b",null,r(l.$t("settings.player_provider"))+": ",1),m(r((n=t(a).getProviderManifest(e.value.provider))==null?void 0:n.name)+" ",1),(k=t(a).getProviderManifest(e.value.provider))!=null&&k.documentation?(o(),g("a",{key:0,href:($=t(a).getProviderManifest(e.value.provider))==null?void 0:$.documentation,target:"_blank"}," ["+r(l.$t("settings.check_docs"))+"]",9,A)):d("",!0)]}),_:1}),t(a).players[e.value.player_id]?(o(),y(v,{key:0},{default:u(()=>[s("b",null,r(l.$t("settings.player_model"))+": ",1),m(r(t(a).players[e.value.player_id].device_info.manufacturer)+" / "+r(t(a).players[e.value.player_id].device_info.model),1)]),_:1})):d("",!0),(_=t(a).players[e.value.player_id])!=null&&_.device_info.ip_address?(o(),y(v,{key:1},{default:u(()=>[s("b",null,r(l.$t("settings.player_address"))+": ",1),m(r(t(a).players[e.value.player_id].device_info.ip_address),1)]),_:1})):d("",!0),t(a).players[e.value.player_id]?(o(),y(v,{key:2},{default:u(()=>[s("b",null,r(l.$t("settings.player_type_label"))+": ",1),m(r(l.$t(`player_type.${t(a).players[e.value.player_id].type}`)),1)]),_:1})):d("",!0),i[2]||(i[2]=s("br",null,null,-1)),p(C),i[3]||(i[3]=s("br",null,null,-1)),i[4]||(i[4]=s("br",null,null,-1)),"name"in e.value?(o(),y(h,{key:3,modelValue:e.value.name,"onUpdate:modelValue":i[0]||(i[0]=n=>e.value.name=n),placeholder:(V=e.value)==null?void 0:V.name,label:l.$t("settings.player_name"),variant:"outlined",clearable:"",class:"configcolumnleft",style:{"margin-right":"25px"}},null,8,["modelValue","placeholder","label"])):d("",!0),"enabled"in e.value?(o(),y(z,{key:4,modelValue:e.value.enabled,"onUpdate:modelValue":i[1]||(i[1]=n=>e.value.enabled=n),label:l.$t("settings.enable_player"),color:"primary",disabled:(c=t(a).getProviderManifest(e.value.provider))==null?void 0:c.builtin},null,8,["modelValue","label","disabled"])):d("",!0),p(U,{onClick:M},{default:u(()=>[m(r(l.$t("open_dsp_settings")),1)]),_:1})])):d("",!0),i[5]||(i[5]=s("br",null,null,-1)),p(C),e.value?(o(),y(E,{key:1,disabled:!e.value.enabled,"config-entries":Object.values(e.value.values),onSubmit:B},null,8,["disabled","config-entries"])):d("",!0)]}),_:1})]))}});export{ie as default};
