import{o as e}from"./chunk-6hGRweTZ.js";import{On as t,qn as n}from"./emotion-is-prop-valid.esm-hDIrEFz4.js";import{X as r,Y as i,gr as a,n as o,ta as s}from"./McpVirtualServerWizard-H5D9aYyh.js";var c=e(n()),l=t(),u=({options:e,onChange:t,isReadOnly:n,operation:u,policyManager:d})=>{let[f]=(0,c.useState)(()=>i(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=r(e);y.current=n,t(n)};return(0,c.useEffect)(()=>{if(e===y.current)return;y.current=e;let t=i(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)(s,{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-DOX2nMtv.js.map