import{r as e,j as o}from"./vendor-react-Dp9pL_Wn.js";import{O as r,P as t,K as s,Q as i}from"./index-XoaBlZfC.js";import{s as n}from"./c2ee0272b-DPDuX889.js";import{u as d}from"./vendor-intl-D2wGIp4M.js";import{u as a}from"./cd2515372-DcNahI8b.js";import{ChatTooltipV1 as m}from"./c8ce600ec-Dsn8CGV_.js";import"./vendor-infra-DayZK7Ds.js";import"./vendor-zod-B8MhECV7.js";import"./vendor-router-qG5OCEmI.js";import"./vendor-ant-cds-BLsR_p72.js";import"./vendor-base-ui-N1VQ4ctE.js";import"./vendor-radix-Dv3qPI0v.js";import"./vendor-base-5_f7mmWg.js";import"./vendor-virtual-DRz8lJfQ.js";import"./vendor-query-CRl6sF7K.js";import"./vendor-zustand-BeF8W8xk.js";import"./c9a5287df-D_Z7ffFR.js";import"./vendor-icons-DGChWNxR.js";import"./vendor-motion-EDlUw66k.js";import"./vendor-lodash-BvMLws5K.js";import"./vendor-luxon-CZxT8ieM.js";import"./c51e217b4-CQax1dv1.js";import"./c627fcdb6-1_bsVTpt.js";import"./vendor-growthbook-HDTqppl-.js";import"./vendor-zod-v3-CZy0YPWu.js";const u=e.memo(({enabled:u,onDismiss:l,onAction:c})=>{const{model:p,isSettled:j}=a(),f=r(),v=t("chat-tooltip"),b=j&&f(p),g=e.useRef(!1);e.useEffect(()=>{!j||b||g.current||(g.current=!0,l())},[j,b,l]);const{shouldGate:x,memberCanRequest:y,isUsageCreditsFunded:h,creditsRequiredClickRoute:q,isBillingStateSettled:k,creditPromoOutranksGate:R}=s({enabled:b}),M=x||y,A=d(),D=e.useMemo(()=>{if(!p)return;const e={model:i(p)},o={type:"model-selector",nuxTitle:n({id:"fxw77i",intl:A,dangerouslyVisiblePublicValues:e}),nuxText:n({id:h?"1yod0ea":"request"===q?y?"p3jdos":"1o1tfnn":"enable"===q?"1g2ehd2":"1o1tfnn",intl:A,dangerouslyVisiblePublicValues:e})};return M?{...o,ctaAction:{text:"request"===q?A.formatMessage({defaultMessage:"Request usage credits",id:"3gNFS1DF0J"}):"enable"===q?A.formatMessage({defaultMessage:"Turn on usage credits",id:"RF538op5DA"}):n({id:"hgk1x2",intl:A}),type:"credits_required_modal",value:p}}:o},[p,M,y,h,q,A]);return b&&u&&k&&!R&&D?o.jsx(m,{experienceKey:v?.key??v?.id??"",experienceId:v?.id??"",content:D,enabled:u,onDismiss:l,onAction:c}):null});export{u as CreditsTransitionTooltip};
