import{d as P,av as U,r as i,x as f,b,P as w,c as T,h as q,f as a,w as r,g as s,D as n,t as d,u as B}from"./index-BcUYXcPq.js";import{b as N,V as _,a as g}from"./VCardText-D-aWL0fz.js";import{V as D}from"./VList-BKlimdrv.js";import{V as F}from"./VForm-Bi7XwAxc.js";import{a as y,V as c}from"./VSwitch-Dl00NZdS.js";import{V as j}from"./VTextField-rtqk6KCF.js";import{q as $}from"./VListItem-DC0X47Q4.js";import"./VCheckboxBtn-DvMOQpng.js";import"./VMenu-7bd_kTRb.js";import"./VVirtualScroll-BfIwRbDJ.js";const A={style:{"margin-left":"-5px","margin-right":"-5px"}},J=P({__name:"AddPlayerGroup",setup(E){const V=U(),u=i("universal"),p=i(""),o=i([]),m=i(!1),v=i(!1),k=f(()=>[{name:"Universal",instance_id:"universal"},...Object.values(b.providers).filter(l=>l.supported_features.includes(w.SYNC_PLAYERS))]),C=f(()=>Object.values(b.players).filter(l=>l.available&&!l.provider.startsWith("player_group")&&(l.provider==u.value||u.value=="universal"))),S=async function(){b.createPlayerGroup(u.value,p.value,o.value,m.value),V.push({name:"playersettings"})};return(l,e)=>(T(),q("section",null,[a(N,null,{default:r(()=>[s("div",A,[a(_,null,{default:r(()=>[n(d(l.$t("settings.add_group_player")),1)]),_:1}),a(g,{style:{"white-space":"break-spaces"}},{default:r(()=>[n(d(l.$t("settings.add_group_player_desc")),1)]),_:1}),e[7]||(e[7]=s("br",null,null,-1)),a(D),e[8]||(e[8]=s("br",null,null,-1)),e[9]||(e[9]=s("br",null,null,-1)),a(F,{ref:"form",modelValue:v.value,"onUpdate:modelValue":e[4]||(e[4]=t=>v.value=t),style:{"margin-right":"10px"}},{default:r(()=>[a(y,{modelValue:u.value,"onUpdate:modelValue":e[0]||(e[0]=t=>u.value=t),clearable:"",items:k.value,"item-title":"name","item-value":"instance_id",label:l.$t("settings.group_type"),required:"",disabled:o.value.length>0},null,8,["modelValue","items","label","disabled"]),a(c,{modelValue:m.value,"onUpdate:modelValue":e[1]||(e[1]=t=>m.value=t),color:"primary",label:l.$t("settings.dynamic_members.label")},null,8,["modelValue","label"]),a(g,{style:{"white-space":"break-spaces","padding-left":"0","margin-top":"-25px","margin-bottom":"35px"}},{default:r(()=>[n(d(l.$t("settings.dynamic_members.description")),1)]),_:1}),a(j,{modelValue:p.value,"onUpdate:modelValue":e[2]||(e[2]=t=>p.value=t),label:l.$t("settings.player_name"),variant:"outlined",clearable:"",required:""},null,8,["modelValue","label"]),a(y,{modelValue:o.value,"onUpdate:modelValue":e[3]||(e[3]=t=>o.value=t),clearable:"",multiple:"",items:C.value,"item-title":"display_name","item-value":"player_id",label:l.$t("settings.group_members"),required:""},null,8,["modelValue","items","label"]),e[6]||(e[6]=s("br",null,null,-1)),a($,{block:"",color:"primary",disabled:!v.value||o.value.length==0&&!m.value,onClick:S},{default:r(()=>[n(d(l.$t("settings.save")),1)]),_:1},8,["disabled"])]),_:1},8,["modelValue"]),e[10]||(e[10]=s("br",null,null,-1)),a($,{block:"",onClick:e[5]||(e[5]=t=>B(V).back())},{default:r(()=>[n(d(l.$t("close")),1)]),_:1})])]),_:1})]))}});export{J as default};
