import{av as g,r as t,aw as p,j as e,ay as h,az as u,ac as x,aA as y,aB as j,aj as S,aC as v}from"./LoginDialog-Dm7KvmeV.js";const C=()=>{const r=g("(prefers-color-scheme: dark)"),[a,i]=t.useState(!1),[c,l]=t.useState("NuGet Server"),m=p({palette:{mode:r?"dark":"light",primary:{main:"#1976d2"},secondary:{main:"#dc004e"}},typography:{fontFamily:["-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial","sans-serif"].join(",")},components:{MuiButton:{styleOverrides:{root:{textTransform:"none"}}}}});t.useEffect(()=>{(async()=>{try{const o=await S("api/config",{credentials:"same-origin"});if(o.ok){const s=await o.json();l(s.realm||"NuGet Server"),s.realm&&(document.title=s.realm)}}catch(o){console.error("Failed to fetch server config:",o)}})(),i(!0)},[]);const d=()=>{window.location.href="."},f=()=>{};return e.jsxs(h,{theme:m,children:[e.jsx(u,{}),e.jsxs(x,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{maxWidth:"sm"}),e.jsx(j,{open:a,onClose:f,onLoginSuccess:d,realm:c,disableBackdropClick:!0})]})]})},n=document.getElementById("root");if(!n)throw new Error("Root element not found");const k=v.createRoot(n);k.render(e.jsx(t.StrictMode,{children:e.jsx(C,{})}));
