import{ay as I,J as _,a3 as k,cQ as l,cR as E,aU as e,aP as w,cS as N,az as V,aA as m,o as i,aI as C,aB as T,aG as c,E as n,aL as q,bi as A,aN as f,aD as g,aT as B,b9 as D,by as R,aE as G,_ as L}from"./index-D-FY8Yx2.js";import{E as O}from"./EditConfig-BeVcr9VT.js";import{D as y}from"./constants-CXMxJR4j.js";import"./VCheckbox-W6o6QHjE.js";import"./VCheckboxBtn-DpMGI-si.js";import"./VSelectionControl-CyrHFsUF.js";import"./VSlider-CGKKjACx.js";import"./VSelect-Y8F8SAQI.js";import"./VVirtualScroll-cGuYysLa.js";import"./VForm-DYLmSGkE.js";import"./VExpansionPanels-CuU7p-4b.js";const x={class:"frontend-config"},M={class:"header-content"},U={class:"header-icon"},z={class:"header-info"},F={class:"header-title"},P={class:"header-description"},$=I({__name:"FrontendConfig",setup(j){const v=G(),r=_([]),d=_(!1);k(()=>{const a=localStorage.getItem("frontend.settings.menu_items"),t=a?a.split(","):y,s=[{key:"theme",type:l.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:l.STRING,label:"language",default_value:"auto",required:!1,options:[{title:"auto",value:"auto"},...E.global.availableLocales.map(o=>({title:o,value:o}))],multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.language")},{key:"menu_items",type:l.STRING,label:"menu_items",default_value:y,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:l.BOOLEAN,label:"force_mobile_layout",default_value:!1,required:!1,multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.force_mobile_layout")==="true"}];if(w.getProvider("sendspin")?.available??!1){s.splice(3,0,{key:"web_player_mode",type:l.STRING,label:"web_player_mode",default_value:"sendspin",required:!1,options:[{title:e("settings.web_player_mode.options.sendspin"),value:"sendspin"},{title:e("settings.web_player_mode.options.disabled"),value:"disabled"}],multi_value:!1,category:"web_player",value:localStorage.getItem("frontend.settings.web_player_mode")||"sendspin"});const o=N();s.splice(4,0,{key:"sendspin_sync_delay",type:l.INTEGER,label:"sendspin_sync_delay",default_value:o,required:!1,multi_value:!1,category:"web_player",value:parseInt(localStorage.getItem("frontend.settings.sendspin_sync_delay")||String(o),10)});const p=localStorage.getItem("frontend.settings.sendspin_output_latency_compensation");s.splice(5,0,{key:"sendspin_output_latency_compensation",type:l.BOOLEAN,label:"sendspin_output_latency_compensation",default_value:!0,required:!1,multi_value:!1,category:"web_player",value:p!==null?p==="true":!0})}r.value=s});const b=function(a){for(const t in a){const s=`frontend.settings.${t}`,u=a[t];u!=null?localStorage.setItem(s,u.toString()):localStorage.removeItem(s)}v.push({name:"home"}).then(()=>{window.location.reload()})},h=function(a){b(a)},S=async function(a,t){};return(a,t)=>(m(),V("section",x,[i(B,{class:"header-card mb-4",elevation:"0"},{default:c(()=>[n("div",M,[n("div",U,[i(q,{size:"32",color:"orange"},{default:c(()=>[...t[1]||(t[1]=[A("mdi-palette",-1)])]),_:1})]),n("div",z,[n("h2",F,f(g(e)("settings.frontend")),1),n("p",P,f(g(e)("settings.frontend_description")),1)])])]),_:1}),r.value.length>0?(m(),C(O,{key:0,"config-entries":r.value,disabled:!1,onSubmit:h,onAction:S},null,8,["config-entries"])):T("",!0),i(R,{modelValue:d.value,"onUpdate:modelValue":t[0]||(t[0]=s=>d.value=s),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:c(()=>[i(D,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}}),se=L($,[["__scopeId","data-v-4f1aaf55"]]);export{se as default};
