import{u as M}from"./vue-router-BpTQq1WE.js";import{a0 as k,a as u,u as _,i as S}from"./index-ByIRZxAe.js";import{p as U,I as m,e as B,a8 as L,l as O,a6 as E,a4 as G,m as $,q as R}from"./vuetify-BRgYuWPG.js";import{d as D,b as N,H as r,E as s,f as n,D as v,$ as y,a1 as b,c as w,u as g,r as f,I as j,e as o}from"./lucide-F1B1VpI-.js";import"./color-CcshWhNz.js";import"./qrcode-0NlyE7mq.js";import"./marked-i_gIkIP3.js";import"./vue-i18n-fACdQrNQ.js";import"./vueuse-D-YfxAQp.js";/* empty css            */import"./swiper-Bthg8aDK.js";const F={style:{"margin-left":"-5px","margin-right":"-5px"}},h=D({__name:"AddPlayerGroup",props:{provider:{}},setup(P){const T=M(),V=f(""),t=f([]),p=f(!0),c=f(!1),d=P,i=w(()=>u.getProvider(d.provider)),C=w(()=>d.provider==="universal_group"?Object.values(u.players).filter(e=>e.available&&e.type!=_.GROUP):d.provider==="sync_group"?Object.values(u.players).filter(e=>e.available&&e.type!=_.GROUP&&e.supported_features.includes(S.SET_MEMBERS)&&e.can_group_with.length>0&&(t.value.length==0||t.value.includes(e.player_id)||t.value.some(l=>e.can_group_with.includes(l)))):Object.values(u.players).filter(e=>e.available&&e.type!=_.GROUP&&e.provider==i.value?.instance_id)),H=async function(){u.createPlayerGroup(d.provider,V.value,t.value,p.value),T.push({name:"playersettings"})};return(e,l)=>(o(),N("section",null,[r(R,null,{default:s(()=>[n("div",F,[r(U,null,{default:s(()=>[y(b(e.$t("settings.add_group_player")),1)]),_:1}),i.value?.domain==="universal_group"?(o(),v(m,{key:0,style:{"white-space":"break-spaces"},innerHTML:g(k)(e.$t("settings.add_group_player_desc_universal"))},null,8,["innerHTML"])):i.value?.domain==="sync_group"?(o(),v(m,{key:1,style:{"white-space":"break-spaces"},innerHTML:g(k)(e.$t("settings.add_group_player_desc_sync"))},null,8,["innerHTML"])):(o(),v(m,{key:2,style:{"white-space":"break-spaces"},innerHTML:g(k)(e.$t("settings.add_group_player_desc",[i.value?.name]))},null,8,["innerHTML"])),l[6]||(l[6]=n("br",null,null,-1)),r(B),l[7]||(l[7]=n("br",null,null,-1)),l[8]||(l[8]=n("br",null,null,-1)),r(L,{ref:"form",modelValue:c.value,"onUpdate:modelValue":l[3]||(l[3]=a=>c.value=a),style:{"margin-right":"10px"}},{default:s(()=>[r(O,{modelValue:V.value,"onUpdate:modelValue":l[0]||(l[0]=a=>V.value=a),label:e.$t("settings.player_name"),variant:"outlined",clearable:"",required:"",rules:[a=>a.length>0||e.$t("settings.invalid_input")]},null,8,["modelValue","label","rules"]),r(E,{modelValue:t.value,"onUpdate:modelValue":l[1]||(l[1]=a=>t.value=a),clearable:"",multiple:"",items:C.value,"item-title":"display_name","item-value":"player_id",label:e.$t("settings.group_members")},null,8,["modelValue","items","label"]),r(G,{modelValue:p.value,"onUpdate:modelValue":l[2]||(l[2]=a=>p.value=a),color:"primary",label:e.$t("settings.dynamic_members.label")},null,8,["modelValue","label"]),i.value?.domain!=="universal_group"?(o(),v(m,{key:0,style:{"white-space":"break-spaces","padding-left":"0","margin-top":"-25px","margin-bottom":"35px"}},{default:s(()=>[y(b(e.$t("settings.dynamic_members.description")),1)]),_:1})):j("",!0),l[5]||(l[5]=n("br",null,null,-1)),r($,{block:"",color:"primary",disabled:!c.value||t.value.length==0&&!p.value,onClick:H},{default:s(()=>[y(b(e.$t("settings.save")),1)]),_:1},8,["disabled"])]),_:1},8,["modelValue"]),l[9]||(l[9]=n("br",null,null,-1)),r($,{block:"",onClick:l[4]||(l[4]=a=>g(T).back())},{default:s(()=>[y(b(e.$t("close")),1)]),_:1})])]),_:1})]))}});export{h as default};
