import{i as t}from"./_virtual___federation_fn_import-DB-0B1B_.js";import{j as e}from"./jsx-runtime-u17CrQMm.js";import{a as S}from"./zod-DVFqTTZn.js";import{R as j}from"./admin-CJNCYv7V.js";const{authConfigSpec:A,createWebAppSchema:w}=await t("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:v,useDefinitionSchema:C,useProjectDefinition:g,useResettableForm:R}=await t("@baseplate-dev/project-builder-lib/web"),{FormActionBar:F,InputFieldController:L,MultiComboboxFieldController:P,SectionList:y,SectionListSection:D,SectionListSectionContent:W,SectionListSectionDescription:E,SectionListSectionHeader:N,SectionListSectionTitle:k,SwitchFieldController:B}=await t("@baseplate-dev/ui-components");function O(){const{webDefinition:o}=j.useRouteContext(),{definition:m,saveDefinitionWithFeedback:p,pluginContainer:d}=g(),u=C(w),a=R({resolver:S(u),values:o}),{control:n,handleSubmit:b,reset:h,watch:f}=a,s=b(i=>p(c=>{c.apps=c.apps.map(l=>l.id===o.id?i:l)}));v({control:n,reset:h,onSubmit:s});const r=d.use(A).getAuthConfig(m)?.roles.filter(i=>i.name!=="system").map(i=>({label:i.name,value:i.id})),x=f("adminApp.enabled");return e.jsxs("form",{className:"w-full max-w-7xl space-y-4 p-4",onSubmit:s,children:[e.jsx(y,{children:e.jsxs(D,{children:[e.jsxs(N,{children:[e.jsx(k,{children:"Admin Configuration"}),e.jsx(E,{children:"Configure administrative features for your web application."})]}),e.jsxs(W,{className:"space-y-6",children:[e.jsx(B,{label:"Enable Admin Panel",description:"Add administrative interface to your web application",control:n,name:"adminApp.enabled"}),x&&e.jsxs(e.Fragment,{children:[e.jsx(L,{label:"Admin Path Prefix",placeholder:"/admin",description:"URL prefix for admin routes (e.g. /admin)",control:n,name:"adminApp.pathPrefix"}),r&&e.jsx(P,{label:"Admin Access Roles",description:"Which roles can access the admin panel",control:n,options:r,name:"adminApp.allowedRoles"})]})]})]})}),e.jsx(F,{form:a})]})}export{O as component};
//# sourceMappingURL=admin-BFX8uzl3.js.map
