import{d as G,r as V,O as x,cf as f,$ as a,cj as r,ae as b,c as C,b as s,a as H,u as P,h as q,e as W,w as l,bq as X,o as c,b5 as d,t as m,j as B,aW as I,l as L,F as N,g as D,k as F,b1 as S,V as M,f as Y}from"./index-Bn2Tzsay.js";import{V as J}from"./VTextField-fPA0WAHx.js";import{V as $}from"./VBtn-BQk37KYJ.js";import{a as R}from"./VInput-C_1AW61Q.js";import{_ as K}from"./_plugin-vue_export-helper-DlAUqK2U.js";const Z={class:"filters-container"},Q={class:"d-flex ga-2 filter-buttons"},ee=G({__name:"ProviderFilters",props:{showStageFilter:{type:Boolean,default:!1}},emits:["update:search","update:types","update:stages"],setup(U,{emit:j}){const g=Y(),o=X(),v=V(""),n=V([]),u=V([]);let h=null,y=null,_=null;const O=x(()=>[{title:a("settings.musicprovider"),value:f.MUSIC},{title:a("settings.playerprovider"),value:f.PLAYER},{title:a("settings.metadataprovider"),value:f.METADATA},{title:a("settings.pluginprovider"),value:f.PLUGIN}]),w=x(()=>[{title:a("settings.stage.options.stable"),value:r.STABLE},{title:a("settings.stage.options.beta"),value:r.BETA},{title:a("settings.stage.options.alpha"),value:r.ALPHA},{title:a("settings.stage.options.experimental"),value:r.EXPERIMENTAL},{title:a("settings.stage.options.unmaintained"),value:r.UNMAINTAINED},{title:a("settings.stage.options.deprecated"),value:r.DEPRECATED}]),k=j,A=function(t){const e=n.value.indexOf(t);e>-1?n.value.splice(e,1):n.value.push(t)},E=function(t){const e=u.value.indexOf(t);e>-1?u.value.splice(e,1):u.value.push(t)},z=function(){if(o.query.search&&(v.value=o.query.search),o.query.types){const t=o.query.types;n.value=t.split(",")}if(o.query.stages){const t=o.query.stages;u.value=t.split(",")}};return b(v,t=>{k("update:search",t),h&&clearTimeout(h),h=setTimeout(()=>{const e={...o.query};t?e.search=t:delete e.search,g.replace({query:e})},750)}),b(n,t=>{k("update:types",t),y&&clearTimeout(y),y=setTimeout(()=>{const e={...o.query};t.length>0?e.types=t.join(","):delete e.types,g.replace({query:e})},750)},{deep:!0}),b(u,t=>{k("update:stages",t),_&&clearTimeout(_),_=setTimeout(()=>{const e={...o.query};t.length>0?e.stages=t.join(","):delete e.stages,g.replace({query:e})},750)},{deep:!0}),z(),(t,e)=>(c(),C("div",Z,[s(J,{modelValue:v.value,"onUpdate:modelValue":e[0]||(e[0]=i=>v.value=i),"prepend-inner-icon":"mdi-magnify",label:P(a)("search"),variant:"outlined",density:"compact",clearable:"","hide-details":"",class:"search-field"},null,8,["modelValue","label"]),H("div",Q,[s($,{height:"40",elevation:"0"},{default:l(()=>[d(m(P(a)("settings.provider_type"))+" ",1),s(B,{end:""},{default:l(()=>[...e[1]||(e[1]=[d("mdi-chevron-down",-1)])]),_:1}),s(I,{activator:"parent","close-on-content-click":!1},{default:l(()=>[s(L,null,{default:l(()=>[(c(!0),C(N,null,D(O.value,(i,p)=>(c(),q(M,{key:p,value:p,onClick:T=>A(i.value)},{append:l(()=>[s(R,{"model-value":n.value.includes(i.value),onClick:S(T=>A(i.value),["stop"])},null,8,["model-value","onClick"])]),default:l(()=>[s(F,null,{default:l(()=>[d(m(i.title),1)]),_:2},1024)]),_:2},1032,["value","onClick"]))),128))]),_:1})]),_:1})]),_:1}),U.showStageFilter?(c(),q($,{key:0,height:"40",elevation:"0"},{default:l(()=>[d(m(P(a)("settings.stage.label"))+" ",1),s(B,{end:""},{default:l(()=>[...e[2]||(e[2]=[d("mdi-chevron-down",-1)])]),_:1}),s(I,{activator:"parent","close-on-content-click":!1},{default:l(()=>[s(L,null,{default:l(()=>[(c(!0),C(N,null,D(w.value,(i,p)=>(c(),q(M,{key:p,value:p,onClick:T=>E(i.value)},{append:l(()=>[s(R,{"model-value":u.value.includes(i.value),onClick:S(T=>E(i.value),["stop"])},null,8,["model-value","onClick"])]),default:l(()=>[s(F,null,{default:l(()=>[d(m(i.title),1)]),_:2},1024)]),_:2},1032,["value","onClick"]))),128))]),_:1})]),_:1})]),_:1})):W("",!0)])]))}}),oe=K(ee,[["__scopeId","data-v-730d2954"]]);export{oe as P};
