import{r as e,j as s}from"./vendor-react-Dp9pL_Wn.js";import{aG as a,aH as n,h as t,aA as r,aI as i,M as c,w as o,T as l,D as d,aJ as u,aK as m}from"./c6eedc03a-CsEFTfjy.js";import{M as f}from"./vendor-intl-D2wGIp4M.js";import{t as x}from"./c1f96d614-Drir305U.js";import{I as p,f as j}from"./vendor-ant-cds-bBedrtIN.js";function h({scim:e=!1}={}){const s=a(),o=n(),{activeOrganization:l}=t(),d=s&&!o,{data:u}=r({enabled:d,cached:!0}),m=!!l?.parent_organization_uuid,{data:f}=i({enabled:e&&d&&m}),p=d&&x(u)>50,j=c("__gb__1741461476",p);return{showSeatGatedUpsells:j,showScimUpsells:e&&j&&!0===f?.sso_enabled}}function g(e){return`/upgrade?from=ent_preview_${e}`}const _=u??e.createContext(null);function v(a){return function(n){const t=e.useContext(_);return null==t?null:s.jsx(a,{...n})}}function w(s){const{track:a}=o();return e.useCallback(()=>{a({event_key:"claudeai.admin_settings.ent_upgrade_preview.clicked",upsell_surface:s})},[s,a])}function b(s,a){const{track:n}=o(),t=e.useRef(!1);e.useEffect(()=>{a&&!t.current&&(t.current=!0,n({event_key:"claudeai.admin_settings.ent_upgrade_preview.shown",upsell_surface:s}))},[a,s,n])}function y({surface:e,children:a}){const n=w(e);return s.jsx(l,{external:!0,render:s.jsx(d,{href:g(e),onClick:n,webBehavior:"new-tab"}),children:a??s.jsx(f,{defaultMessage:"Available on Enterprise",id:"fwHS3jwKLa"})})}function k(s,a){const{showScimUpsells:n}=h({scim:!0}),{track:t}=o(),[r,i]=e.useState(!1);!r&&a&&n&&s>=5&&i(!0);const c=a&&r&&n,l=e.useRef(!1);return e.useEffect(()=>{if(!a)return i(!1),void(l.current=!1);c&&!l.current&&(l.current=!0,t({event_key:"claudeai.admin_settings.ent_upgrade_preview.shown",upsell_surface:"add_members_scim_tip"}))},[a,c,t]),c}function M({className:e}){return s.jsxs("div",{className:`animate-in fade-in slide-in-from-top-1 duration-200 motion-reduce:animate-none flex flex-wrap items-center gap-x-1.5 text-footnote text-muted ${e??""}`,children:[s.jsx(f,{defaultMessage:"Adding people one by one?",id:"8rUmxzZqsP"}),s.jsx(y,{surface:"add_members_scim_tip",children:s.jsx(f,{defaultMessage:"Auto-provision with SCIM on Enterprise",id:"KqVaGPVP6s"})})]})}const S=v(function({surface:e,label:a,description:n}){const{showSeatGatedUpsells:t}=h();return b(e,t),t?s.jsx(m,{label:s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-muted",children:[s.jsx(p,{name:"Lock",size:"sm"}),a]}),description:n,control:s.jsx(y,{surface:e})}):null}),N=v(function(){const{showScimUpsells:e}=h({scim:!0});return b("scim_provisioning",e),e?s.jsxs("div",{className:"-mt-1 rounded-xl shadow-card-ring flex items-start gap-3 px-4 py-3.5 text-muted",children:[s.jsx(p,{name:"Lock",size:"sm",className:"mt-0.5 shrink-0"}),s.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[s.jsx("div",{className:"text-body font-medium",children:s.jsx(f,{defaultMessage:"SCIM directory sync",id:"772a2Sk1gY"})}),s.jsx("div",{className:"text-body",children:s.jsx(f,{defaultMessage:"Sync members, groups, and removals automatically from your identity provider.",id:"byHr1214sm"})}),s.jsx("div",{className:"mt-1",children:s.jsx(y,{surface:"scim_provisioning"})})]})]}):null}),C=v(function({surface:e,label:a}){const{showSeatGatedUpsells:n}=h(),t=w(e);return b(e,n),n?s.jsx("li",{children:s.jsxs(d,{href:g(e),onClick:t,webBehavior:"new-tab",className:"font-base whitespace-nowrap overflow-hidden transition-colors ease-in-out rounded-lg px-3 h-9 flex gap-2 items-center hover:bg-bg-200 text-muted",children:[a,s.jsx(p,{name:"Lock",size:"sm"}),s.jsx(j,{variant:"neutral",size:"xs",children:s.jsx(f,{defaultMessage:"Enterprise",id:"CDLJ0Wjq0x"})}),s.jsx("span",{className:"sr-only",children:s.jsx(f,{defaultMessage:"(opens in new tab)",id:"yZs9WUVaoC"})})]})}):null});function z(){return s.jsx(C,{surface:"groups_nav",label:s.jsx(f,{defaultMessage:"Groups",id:"hzmswIqs+i"})})}function U(){return s.jsx(C,{surface:"analytics_chat",label:s.jsx(f,{defaultMessage:"Analytics Chat",id:"corudiYNBg"})})}export{S as L,M as S,U as a,z as b,N as c,k as u};
