import{d as k,r as m,m as S,ci as s,cj as V,$ as e,c as I,b as o,w as r,bJ as C,bm as N,o as c,b5 as d,t as f,u as g,a as p,h,e as E,b6 as T,y as w,f as B}from"./index-CD7iYaFT.js";import{E as q}from"./EditConfig-BoSMCX1M.js";import{D as v}from"./constants-CXMxJR4j.js";import{V as x}from"./VToolbar-BQejIjUR.js";import{b as M}from"./VBtn-B0XatuYF.js";import"./VForm-CSOJ83b-.js";import"./VInput-DDFZ8lhb.js";import"./VExpansionPanels-TUY6dJc5.js";import"./VAlert-cuze2JsR.js";import"./VSwitch-Bf96mRby.js";import"./VTextField-CVfOZKc3.js";import"./VVirtualScroll-BREm3RjH.js";import"./VSlider-Vu2fOVGH.js";import"./VDialog-3VB6G7S5.js";import"./VSpacer-B8t0Vh55.js";/* empty css              */import"./_plugin-vue_export-helper-DlAUqK2U.js";const Y=k({__name:"FrontendConfig",setup(O){const y=B(),i=m([]),n=m(!1);S(()=>{const a=localStorage.getItem("frontend.settings.menu_items"),t=a?a.split(","):v;i.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"},{key:"force_mobile_layout",type:s.BOOLEAN,label:"force_mobile_layout",default_value:!1,required:!1,multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.force_mobile_layout")!="false"}]});const b=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)}y.push({name:"home"}).then(()=>{window.location.reload()})},_=async function(a,t){};return(a,t)=>(c(),I("section",null,[o(x,{color:"transparent"},{title:r(()=>[d(f(g(e)("settings.frontend")),1)]),_:1}),o(C,null,{default:r(()=>[o(T,null,{default:r(()=>[d(f(g(e)("settings.frontend_desc")),1)]),_:1}),t[1]||(t[1]=p("br",null,null,-1)),t[2]||(t[2]=p("br",null,null,-1)),o(w),i.value?(c(),h(q,{key:0,"config-entries":i.value,disabled:!1,onSubmit:b,onAction:_},null,8,["config-entries"])):E("",!0)]),_:1}),o(N,{modelValue:n.value,"onUpdate:modelValue":t[0]||(t[0]=l=>n.value=l),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:r(()=>[o(M,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{Y as default};
