import{r as e,j as o}from"./vendor-react-Dp9pL_Wn.js";import{M as r}from"./vendor-intl-D2wGIp4M.js";import{K as s,G as n,J as t}from"./index-CBEPphRm.js";import"./vendor-base-5_f7mmWg.js";import"./vendor-infra-DayZK7Ds.js";import"./vendor-zod-0xcuG3aM.js";import"./c6eedc03a-CsEFTfjy.js";import"./vendor-ant-cds-bBedrtIN.js";import"./vendor-base-ui-DNypCIlh.js";import"./vendor-radix-Ch96tRrt.js";import"./vendor-virtual-DRz8lJfQ.js";import"./vendor-zustand-BeF8W8xk.js";import"./vendor-icons-CokWnmlw.js";import"./vendor-lodash-BvMLws5K.js";import"./vendor-router-qG5OCEmI.js";import"./vendor-query-BwvgHhJ1.js";import"./vendor-zod-v3-CZy0YPWu.js";import"./vendor-motion-EDlUw66k.js";import"./vendor-luxon-CZxT8ieM.js";import"./vendor-growthbook-C66YtMMX.js";import"./caf7c7e06-DJYXCm3T.js";import"./c5669b8e4-DFSq88jr.js";import"./c5f4e1303-CiyIFgnl.js";import"./cbaad2c48-DaP34LG2.js";const a=e.memo(({onDismiss:a,onAction:i})=>{const{data:m}=s(!0),[d,j]=e.useState(!1),l=m?.organizations?.filter(e=>!e.has_pending_request)??[],c=l.length>0,u=e.useRef(!1),p=e.useCallback(()=>{u.current=!0,j(!0)},[]),v=e.useCallback(()=>{j(!1),u.current&&i()},[i]);if(!c&&!d)return null;const g=1===l.length?l[0]:null;return o.jsxs(o.Fragment,{children:[l.length>0&&o.jsx(n,{message:g?o.jsx(r,{defaultMessage:"{orgName} is on Claude. Join your team to share projects and chats.",id:"7U3S+cHC20",values:{orgName:o.jsx("strong",{children:g.name})}}):o.jsx(r,{defaultMessage:"{count, plural, one {# team from your company is on Claude.} other {# teams from your company are on Claude.}}",id:"rCfcYOkcYs",values:{count:l.length}}),button:{children:g?o.jsx(r,{defaultMessage:"Request to join",id:"CVbwp6HiQE"}):o.jsx(r,{defaultMessage:"View teams",id:"bY1U+Iziei"}),onClick:p},onDismiss:a}),o.jsx(t,{isOpen:d,onClose:v})]})});a.displayName="JoinDiscoverableOrgBanner";export{a as JoinDiscoverableOrgBanner};
