import{d as k,i as m,j as S,cf as s,cg as V,$ as e,c as I,o as c,b as o,w as i,bI as C,bl as N,b4 as d,t as g,u as p,a as f,e as T,q as h,b5 as E,p as w,bJ as q}from"./index-LFx1jIjH.js";import{E as x}from"./EditConfig-UygF_D1P.js";import{D as v}from"./constants-BXWEQHoz.js";import{V as B}from"./VToolbar-Dc2WDt1C.js";import{b as M}from"./VBtn-BYKkZzw0.js";import"./VForm-DI6jEBhI.js";import"./VInput-B3Z2GK8Z.js";import"./VExpansionPanels-DUWI7Gyy.js";import"./VAlert-Cyb25ra3.js";import"./VSwitch-B-ONWUbe.js";import"./VTextField-DyzwZgKh.js";import"./VVirtualScroll-DYZmdOFl.js";import"./VSlider-B0DY4XNd.js";import"./VDialog-zNF2U_x9.js";import"./VSpacer-Cg-cZSyv.js";/* empty css              */import"./_plugin-vue_export-helper-DlAUqK2U.js";const Y=k({__name:"FrontendConfig",setup(D){const b=q(),n=m([]),r=m(!1);S(()=>{const a=localStorage.getItem("frontend.settings.menu_items"),t=a?a.split(","):v;n.value=[{key:"theme",type:s.STRING,label:"theme",default_value:"auto",required:!1,options:[{title:"auto",value:"auto"},{title:"dark",value:"dark"},{title:"light",value:"light"}],multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.theme")},{key:"language",type:s.STRING,label:"language",default_value:"auto",required:!1,options:[{title:"auto",value:"auto"},...V.global.availableLocales.map(l=>({title:l,value:l}))],multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.language")},{key:"menu_items",type:s.STRING,label:"menu_items",default_value:v,required:!1,options:[{title:e("home"),value:"home"},{title:e("search"),value:"search"},{title:e("artists"),value:"artists"},{title:e("albums"),value:"albums"},{title:e("tracks"),value:"tracks"},{title:e("playlists"),value:"playlists"},{title:e("audiobooks"),value:"audiobooks"},{title:e("podcasts"),value:"podcasts"},{title:e("radios"),value:"radios"},{title:e("browse"),value:"browse"},{title:e("settings.settings"),value:"settings"}],multi_value:!0,category:"generic",value:t},{key:"enable_builtin_player",type:s.BOOLEAN,label:"enable_builtin_player",default_value:!0,required:!0,multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.enable_builtin_player")!="false"}]});const y=async function(a){for(const t in a){const l=`frontend.settings.${t}`,u=a[t];u!=null?localStorage.setItem(l,u.toString()):localStorage.removeItem(l)}b.push({name:"home"}).then(()=>{window.location.reload()})},_=async function(a,t){};return(a,t)=>(c(),I("section",null,[o(B,{color:"transparent"},{title:i(()=>[d(g(p(e)("settings.frontend")),1)]),_:1}),o(C,null,{default:i(()=>[o(E,null,{default:i(()=>[d(g(p(e)("settings.frontend_desc")),1)]),_:1}),t[1]||(t[1]=f("br",null,null,-1)),t[2]||(t[2]=f("br",null,null,-1)),o(w),n.value?(c(),T(x,{key:0,"config-entries":n.value,disabled:!1,onSubmit:y,onAction:_},null,8,["config-entries"])):h("",!0)]),_:1}),o(N,{modelValue:r.value,"onUpdate:modelValue":t[0]||(t[0]=l=>r.value=l),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:i(()=>[o(M,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{Y as default};
