const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./About-C9d04NqG.js","./index-D_pphaE2.js","./envs-CRUy-_iG.js","./index-DeQqyExs.css","./snakeCase-DwtuZqse.js","./_createCompounder-DD7kMWdY.js","./isObjectLike-DDO0-ybB.js","./Health-BMuGbl_A.js","./useTable-TKwSMNmn.js","./DebouncedInput-BeTJlfEr.js","./DeviceImage-DUp2lC9c.js","./index-DgIuNtLX.js","./defineProperty-CegpTSss.js","./InfoAlert-BjFk5zJ1.js","./Table-D3R2CttF.js","./Duration-B15qtVe-.js","./TimeAgo-Dep0UUfO.js","./Settings-DSyTPsbz.js","./SettingsList-CwQILOJa.js","./CheckboxField-Bp87NFVr.js","./InputField-B0SBdaHi.js","./NumberField-Dq3HyXeU.js","./SelectField-J0vaqEIK.js","./Tools-CzCKjBEe.js","./Bridge-CjOAlrwh.js","./Json-DpMiMSz-.js","./DevConsole-TX6plgyU.js","./TextareaField-Cqpakw89.js"])))=>i.map(i=>d[i]);
import{dG as p,dD as b,dE as f,dj as h,dq as o,bA as j,bt as x,aX as T,cQ as E,aV as N,aB as $,dm as a,S as d,o as y,R as A,J as P,a as w,a0 as S,aa as l}from"./index-D_pphaE2.js";import"./envs-CRUy-_iG.js";const z=o.lazy(async()=>await l(()=>import("./About-C9d04NqG.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),D=o.lazy(async()=>await l(()=>import("./Health-BMuGbl_A.js"),__vite__mapDeps([7,1,2,3,8,9,10,11,12,13,14,15,16]),import.meta.url)),L=o.lazy(async()=>await l(()=>import("./Settings-DSyTPsbz.js"),__vite__mapDeps([17,1,2,3,13,18,19,20,21,22]),import.meta.url)),R=o.lazy(async()=>await l(()=>import("./Tools-CzCKjBEe.js"),__vite__mapDeps([23,1,2,3,20,11]),import.meta.url)),V=o.lazy(async()=>await l(()=>import("./Bridge-CjOAlrwh.js"),__vite__mapDeps([24,1,2,3,25]),import.meta.url)),O=o.lazy(async()=>await l(()=>import("./DevConsole-TX6plgyU.js"),__vite__mapDeps([26,1,2,3,20,22,27,13]),import.meta.url));function C(t,n,s){switch(n){case"about":return a.jsx(z,{sourceIdx:t},t);case"health":return a.jsx(D,{sourceIdx:t},t);case"settings":return a.jsx(L,{sourceIdx:t,tab:s??"main"},t);case"tools":return a.jsx(R,{sourceIdx:t},t);case"bridge":return a.jsx(V,{sourceIdx:t},t);case"dev-console":return a.jsx(O,{sourceIdx:t,tab:s??"mqtt"},t)}}const _=({isActive:t})=>t?"menu-active":void 0;function q(){const{t}=p("settings"),n=b(),{sourceIdx:s,tab:i,subTab:r}=f(),[g,c]=h(s);o.useEffect(()=>{!s||!c?n(`/settings/0/${i||"about"}`,{replace:!0}):i?r||(i==="settings"?n(`/settings/${s}/settings/main`,{replace:!0}):i==="dev-console"&&n(`/settings/${s}/dev-console/mqtt`,{replace:!0})):n(`/settings/${s}/about`,{replace:!0})},[s,c,i,r,n]);const v=o.useMemo(()=>[{to:`/settings/${s}/about`,icon:j,title:t(e=>e.about)},{to:`/settings/${s}/health`,icon:x,title:t(e=>e.health)},{to:`/settings/${s}/settings`,icon:T,title:t(e=>e.settings)},{to:`/settings/${s}/tools`,icon:E,title:t(e=>e.tools)},{to:`/settings/${s}/bridge`,icon:N,title:t(e=>e.bridge)},{to:`/settings/${s}/dev-console`,icon:$,title:t(e=>e.dev_console)}],[s,t]),m=a.jsx("div",{className:"menu menu-horizontal flex-1",children:v.map(e=>a.jsx("li",{className:"tooltip tooltip-bottom","data-tip":e.title,children:a.jsxs(d,{to:e.to,className:_,children:[a.jsx(y,{icon:e.icon,size:"lg"}),a.jsx("span",{className:"hidden lg:inline",children:e.title})]})},e.to))});return a.jsxs(a.Fragment,{children:[a.jsx(A,{children:P?a.jsxs("div",{className:"flex-1 flex flex-col",children:[a.jsx("div",{className:"menu menu-horizontal flex-1 pb-0",children:w.map((e,u)=>a.jsx("li",{children:a.jsx(d,{to:`/settings/${u}/${i||"about"}${r?`/${r}`:""}`,className:_,children:a.jsx(S,{idx:u,alwaysShowName:!0})})},e))}),m]}):m}),i&&C(g,i,r)]})}export{q as default};
