import{o as e}from"./chunk-6hGRweTZ.js";import{On as t,qn as n}from"./emotion-is-prop-valid.esm-CFWuvN_7.js";import{R as r,Wi as i,ar as a,n as o,z as s}from"./McpVirtualServerWizard-DVZxJibZ.js";var c=e(n()),l=t(),u=({options:e,onChange:t,isReadOnly:n,operation:u,policyManager:d})=>{let[f]=(0,c.useState)(()=>r(e)),[p,m]=(0,c.useState)(f.catalog),[h,g]=(0,c.useState)(f.accessControlMode),_=(0,c.useMemo)(()=>{if(!u||!d)return;let e=o({operationPath:u.additionalOperationContext.path,operation:u,policyList:d.getPolicyListEnforced()});if(e)return{mcpUrl:e.step1.mcpUrl,upstreamAuth:e.step1}},[u,d]),v=h===`rolesAndGroups`,y=(0,c.useRef)(e),b=e=>{m(e.catalog),g(e.accessControlMode);let n=s(e);y.current=n,t(n)};return(0,c.useEffect)(()=>{if(e===y.current)return;y.current=e;let t=r(e);m(t.catalog),g(t.accessControlMode)},[e]),(0,l.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-md border bg-card px-3 py-2`,children:[(0,l.jsxs)(`div`,{className:`min-w-0`,children:[(0,l.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Roles & groups access control`}),(0,l.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Mark each capability public, or restrict it to specific roles or groups. Anything left unclassified won't be exposed — nothing is public by default.`})]}),(0,l.jsx)(i,{checked:v,disabled:n,onCheckedChange:e=>b({catalog:p,accessControlMode:e?`rolesAndGroups`:`allPublic`}),"aria-label":`Enable roles and groups access control`})]}),(0,l.jsx)(a,{catalog:p,onChange:e=>b({catalog:e,accessControlMode:h}),accessControlEnabled:v,isReadOnly:n,upstream:_})]})};export{u as default};
//# sourceMappingURL=McpCapabilityFilterDesigner-Do_8eIMH.js.map