import{u as k,r as o,m as t,au as u,av as f,aw as h,n as E,o as x,ax as S,ay as O,H as K,a0 as Y,az as L,aA as M,aB as H,aC as y,aD as F,aE as R,aF as W,j as a,M as U,N as G,a6 as N}from"./index-ClCsMWbS.js";import{C as r}from"./CheckboxField-BxtT6ttj.js";import{N as b}from"./NumberField-Bv80Uoa9.js";import"./envs-CSqIi4cL.js";function J(){const{t:s}=k(["settings","navbar","network","common"]),[i,p]=o.useState(t.get(u,254)),[l,g]=o.useState(t.get(f,3)),[m,C]=o.useState(t.get(h,!1)),[c,T]=o.useState(t.get(E,!0)),[_,w]=o.useState(t.get(x,!0)),[d,v]=o.useState(t.get(S,!0));o.useEffect(()=>{t.set(u,i)},[i]),o.useEffect(()=>{t.set(f,l)},[l]),o.useEffect(()=>{t.set(h,m)},[m]),o.useEffect(()=>{t.set(E,c)},[c]),o.useEffect(()=>{t.set(x,_)},[_]),o.useEffect(()=>{t.set(S,d)},[d]);const A=o.useCallback(()=>{const e=t.keys();t.remove(O),t.remove(u),t.remove(f),t.remove(h),t.remove(K),t.remove(E),t.remove(x),t.remove(Y),t.remove(L),t.remove(S),t.remove(M);for(const n of e)(n.startsWith(H)||n.startsWith(y)||n.startsWith(F))&&t.remove(n);window.location.reload()},[]),I=o.useCallback(()=>{const e=t.keys();for(const n of e)(n.startsWith(R)||n.startsWith(W))&&t.remove(n);window.location.reload()},[]),j=o.useCallback(()=>{t.clearAll(),window.location.reload()},[]);return a.jsxs(a.Fragment,{children:[a.jsx(G,{children:a.jsxs("div",{className:"flex flex-row flex-wrap flex-1 gap-1.5",children:[a.jsx(N,{className:"btn btn-sm btn-outline btn-error tooltip-bottom",onClick:A,title:s(e=>e.reset_settings),modalDescription:s(e=>e.dialog_confirmation_prompt,{ns:"common"}),modalCancelLabel:s(e=>e.cancel,{ns:"common"}),children:s(e=>e.reset_settings)}),a.jsx(N,{className:"btn btn-sm btn-outline btn-error tooltip-bottom",onClick:I,title:s(e=>e.reset_auth),modalDescription:s(e=>e.dialog_confirmation_prompt,{ns:"common"}),modalCancelLabel:s(e=>e.cancel,{ns:"common"}),children:s(e=>e.reset_auth)}),a.jsx(N,{className:"btn btn-sm btn-outline btn-error tooltip-bottom",onClick:j,title:s(e=>e.reset_all),modalDescription:s(e=>e.dialog_confirmation_prompt,{ns:"common"}),modalCancelLabel:s(e=>e.cancel,{ns:"common"}),children:s(e=>e.reset_all)})]})}),a.jsx("div",{className:"alert alert-info alert-vertical sm:alert-horizontal",children:s(e=>e.frontend_notice)}),a.jsxs("div",{className:"flex flex-row flex-wrap gap-4 mt-3",children:[a.jsx(b,{type:"number",name:"permit_join_time",label:s(e=>e.permit_join_time),min:10,max:254,required:!0,minimal:!0,initialValue:i,onSubmit:(e,n)=>n&&e!==""&&p(e)}),a.jsx(b,{type:"number",name:"max_on_screen_notifications",label:s(e=>e.max_on_screen_notifications),min:1,max:5,required:!0,minimal:!0,initialValue:l,onSubmit:(e,n)=>n&&e!==""&&g(e)}),a.jsx(r,{name:"hide_static_info_alerts",label:s(e=>e.hide_static_info_alerts,{ns:"common"}),onChange:e=>C(e.target.checked),defaultChecked:m})]}),a.jsx("h2",{className:"text-lg mt-2",children:s(e=>e.home,{ns:"navbar"})}),a.jsxs("div",{className:"flex flex-row flex-wrap gap-4",children:[a.jsx(r,{name:"show_activity",label:`${s(e=>e.show,{ns:"common"})}: ${s(e=>e.activity,{ns:"navbar"})}`,onChange:e=>T(e.target.checked),defaultChecked:c}),a.jsx(r,{name:"show_group_scenes",label:`${s(e=>e.show,{ns:"common"})}: ${s(e=>e.group_scenes,{ns:"common"})}`,onChange:e=>w(e.target.checked),defaultChecked:_})]}),U&&a.jsxs(a.Fragment,{children:[a.jsx("h2",{className:"text-lg mt-2",children:s(e=>e.multi_instance,{ns:"common"})}),a.jsx("div",{className:"flex flex-row flex-wrap gap-4",children:a.jsx(r,{name:"show_source_name",label:s(e=>e.show_source_name,{ns:"common"}),onChange:e=>v(e.target.checked),defaultChecked:d})})]})]})}export{J as default};
