import{D as p}from"./constants-CXMxJR4j.js";import{a2 as o,a3 as E,$ as a,a4 as f,a5 as N,w as V,_ as C}from"./index-CD1lB0z0.js";import{s as O}from"./vueuse-DIaEWNCo.js";import{u as T}from"./vue-router-BgJK_hRC.js";import{E as q}from"./EditConfig-hD03-gHr.js";import{d as B,a as D,l as L,L as A}from"./vuetify-RelkxOq-.js";import{d as M,r as g,o as x,b as R,e as y,H as i,D as $,I as G,E as d,f as r,$ as F,a1 as v,u as b}from"./lucide-C2DU1LFb.js";import"./qrcode-DSFhiIp2.js";import"./marked-C0Rlrcoy.js";import"./color-BTziYnFN.js";import"./vue-i18n-DySrp6mW.js";/* empty css            */import"./swiper-Jy9GbtzK.js";import"./index-DV1JBmju.js";import"./utils-CDN07tui.js";import"./reka-ui-GpbaI08z.js";import"./index-B_jtOnfb.js";const U={class:"frontend-config"},z={class:"header-content"},P={class:"header-icon"},j={class:"header-info"},H={class:"header-title"},K={class:"header-description"},J=M({__name:"FrontendConfig",setup(Q){const h=T(),u=g([]),c=g(!1),_=O();x(()=>{const e=localStorage.getItem("frontend.settings.menu_items"),t=e?e.split(","):p,s=localStorage.getItem("frontend.settings.theme")||"auto";_.value=s;const l=[{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:s},{key:"language",type:o.STRING,label:"language",default_value:"auto",required:!1,options:[{title:"auto",value:"auto"},...E.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:p,required:!1,options:[{title:a("home"),value:"home"},{title:a("search"),value:"search"},{title:a("artists"),value:"artists"},{title:a("albums"),value:"albums"},{title:a("tracks"),value:"tracks"},{title:a("playlists"),value:"playlists"},{title:a("audiobooks"),value:"audiobooks"},{title:a("podcasts"),value:"podcasts"},{title:a("radios"),value:"radios"},{title:a("browse"),value:"browse"},{title:a("settings.settings"),value:"settings"}],multi_value:!0,category:"generic",value:t},{key:"enable_browser_controls",type:o.BOOLEAN,label:"enable_browser_controls",default_value:!0,required:!1,multi_value:!1,category:"generic",hidden:f.value,value:localStorage.getItem("frontend.settings.enable_browser_controls")!=="false"},{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(!f.value){l.push({key:"web_player_enabled",type:o.BOOLEAN,label:"web_player_enabled",default_value:!0,required:!1,category:"web_player",value:localStorage.getItem("frontend.settings.web_player_enabled")!=="false"});const n=N();l.push({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),range:[-1e3,1e3],immediate_apply:!0,depends_on:"web_player_enabled"});const m=localStorage.getItem("frontend.settings.sendspin_output_latency_compensation");l.push({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:m!==null?m==="true":!0,depends_on:"web_player_enabled"})}u.value=l});const S=function(e){for(const t in e){const s=`frontend.settings.${t}`,l=e[t];l!=null?(localStorage.setItem(s,l.toString()),t==="theme"&&(_.value=l.toString())):localStorage.removeItem(s)}h.push({name:"home"}).then(()=>{window.location.reload()})},I=function(e){S(e)},k=async function(e,t){},w=function(e){for(const t in e)localStorage.setItem(`frontend.settings.${t}`,String(e[t]));"sendspin_sync_delay"in e&&V.setSyncDelay(e.sendspin_sync_delay)};return(e,t)=>(y(),R("section",U,[i(D,{class:"header-card mb-4",elevation:"0"},{default:d(()=>[r("div",z,[r("div",P,[i(B,{size:"32",color:"orange"},{default:d(()=>[...t[1]||(t[1]=[F("mdi-palette",-1)])]),_:1})]),r("div",j,[r("h2",H,v(b(a)("settings.frontend")),1),r("p",K,v(b(a)("settings.frontend_description")),1)])])]),_:1}),u.value.length>0?(y(),$(q,{key:0,"config-entries":u.value,disabled:!1,onSubmit:I,onAction:k,onImmediateApply:w},null,8,["config-entries"])):G("",!0),i(A,{modelValue:c.value,"onUpdate:modelValue":t[0]||(t[0]=s=>c.value=s),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:d(()=>[i(L,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}}),me=C(J,[["__scopeId","data-v-7be2d4e5"]]);export{me as default};
