import{ay as v,J as u,a3 as y,cF as i,cG as _,aT as e,aP as b,az as k,aA as c,o as n,aG as m,aI as I,aB as S,c3 as h,b8 as E,bx as C,aE as N}from"./index-It2prjj_.js";import{E as T}from"./EditConfig-AqtgCPWj.js";import{D as g}from"./constants-CXMxJR4j.js";import"./VForm-DKXj3-MG.js";import"./VExpansionPanels-B67U9Twr.js";import"./VDialog-iiGPeNfY.js";import"./VAlert-C9ByNQuJ.js";import"./VSwitch-waJefBL-.js";import"./VSelectionControl-B-NDe8ob.js";import"./VSlider-6wOgLsYG.js";import"./VSelect-BDLVApWU.js";import"./VVirtualScroll-OOfSuXB2.js";import"./VCheckboxBtn-CeJlTA3J.js";const D=v({__name:"FrontendConfig",setup(V){const f=N(),s=u([]),r=u(!1);y(()=>{const a=localStorage.getItem("frontend.settings.menu_items"),t=a?a.split(","):g,l=[{key:"theme",type:i.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:i.STRING,label:"language",default_value:"auto",required:!1,options:[{title:"auto",value:"auto"},..._.global.availableLocales.map(o=>({title:o,value:o}))],multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.language")},{key:"menu_items",type:i.STRING,label:"menu_items",default_value:g,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:"force_mobile_layout",type:i.BOOLEAN,label:"force_mobile_layout",default_value:!1,required:!1,multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.force_mobile_layout")==="true"}];b.isRemoteConnection.value||l.splice(3,0,{key:"enable_builtin_player",type:i.BOOLEAN,label:"enable_builtin_player",default_value:!0,required:!0,multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.enable_builtin_player")!="false"}),s.value=l});const d=async function(a){for(const t in a){const l=`frontend.settings.${t}`,o=a[t];o!=null?localStorage.setItem(l,o.toString()):localStorage.removeItem(l)}f.push({name:"home"}).then(()=>{window.location.reload()})},p=async function(a,t){};return(a,t)=>(c(),k("section",null,[n(h,null,{default:m(()=>[s.value?(c(),I(T,{key:0,"config-entries":s.value,disabled:!1,onSubmit:d,onAction:p},null,8,["config-entries"])):S("",!0)]),_:1}),n(C,{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:m(()=>[n(E,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{D as default};
