import{D as m}from"./constants-CXMxJR4j.js";import{az as k,J as f,d4 as E,a3 as V,d5 as o,d6 as w,bh as e,bc as N,d7 as C,aP as T,aG as g,o as r,aF as q,aK as A,aH as d,E as i,bp as B,aV as D,aW as y,aE as v,bg as G,by as M,bV as O,ba as R,_ as x}from"./index-D2rF_80D.js";import{E as L}from"./EditConfig-DwDuuRhd.js";import"./VCheckbox-DccbdgFZ.js";import"./VCheckboxBtn-Dik76WyM.js";import"./VSelectionControl-BHjDOTFl.js";import"./VSlider-N-Vl7wpy.js";import"./VSelect-Cz5ACGBh.js";import"./VVirtualScroll-CG155sfU.js";import"./VForm-BPHMcC1Q.js";import"./VExpansionPanels-BYnWit6K.js";const F={class:"frontend-config"},z={class:"header-content"},P={class:"header-icon"},U={class:"header-info"},K={class:"header-title"},$={class:"header-description"},j=k({__name:"FrontendConfig",setup(H){const b=R(),u=f([]),c=f(!1),p=E();V(()=>{const a=localStorage.getItem("frontend.settings.menu_items"),t=a?a.split(","):m,l=localStorage.getItem("frontend.settings.theme")||"auto";p.value=l;const s=[{key:"theme",type:o.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:l},{key:"language",type:o.STRING,label:"language",default_value:"auto",required:!1,options:[{title:"auto",value:"auto"},...w.global.availableLocales.map(n=>({title:n,value:n}))],multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.language")},{key:"menu_items",type:o.STRING,label:"menu_items",default_value:m,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:o.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(N.getProvider("sendspin")?.available??!1){s.splice(3,0,{key:"web_player_mode",type:o.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 n=C();s.splice(4,0,{key:"sendspin_sync_delay",type:o.INTEGER,label:"sendspin_sync_delay",default_value:n,required:!1,multi_value:!1,category:"web_player",value:parseInt(localStorage.getItem("frontend.settings.sendspin_sync_delay")||String(n),10)});const _=localStorage.getItem("frontend.settings.sendspin_output_latency_compensation");s.splice(5,0,{key:"sendspin_output_latency_compensation",type:o.BOOLEAN,label:"sendspin_output_latency_compensation",default_value:!0,required:!1,multi_value:!1,category:"web_player",value:_!==null?_==="true":!0})}u.value=s});const h=function(a){for(const t in a){const l=`frontend.settings.${t}`,s=a[t];s!=null?(localStorage.setItem(l,s.toString()),t==="theme"&&(p.value=s.toString())):localStorage.removeItem(l)}b.push({name:"home"}).then(()=>{window.location.reload()})},S=function(a){h(a)},I=async function(a,t){};return(a,t)=>(g(),T("section",F,[r(G,{class:"header-card mb-4",elevation:"0"},{default:d(()=>[i("div",z,[i("div",P,[r(B,{size:"32",color:"orange"},{default:d(()=>[...t[1]||(t[1]=[D("mdi-palette",-1)])]),_:1})]),i("div",U,[i("h2",K,y(v(e)("settings.frontend")),1),i("p",$,y(v(e)("settings.frontend_description")),1)])])]),_:1}),u.value.length>0?(g(),q(L,{key:0,"config-entries":u.value,disabled:!1,onSubmit:S,onAction:I},null,8,["config-entries"])):A("",!0),r(O,{modelValue:c.value,"onUpdate:modelValue":t[0]||(t[0]=l=>c.value=l),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:d(()=>[r(M,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}}),ne=x(j,[["__scopeId","data-v-b69c4e3f"]]);export{ne as default};
