import{v as t,w as o,x as e}from"./c2ee0272b-DPDuX889.js";import{r}from"./vendor-react-Dp9pL_Wn.js";import{I as i,K as s}from"./index-XoaBlZfC.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-intl-D2wGIp4M.js";import"./vendor-zod-B8MhECV7.js";import"./vendor-zustand-BeF8W8xk.js";import"./vendor-icons-DGChWNxR.js";import"./vendor-lodash-BvMLws5K.js";import"./vendor-router-qG5OCEmI.js";import"./vendor-query-CRl6sF7K.js";import"./vendor-zod-v3-CZy0YPWu.js";import"./vendor-motion-EDlUw66k.js";import"./vendor-luxon-CZxT8ieM.js";import"./vendor-infra-DayZK7Ds.js";import"./vendor-growthbook-HDTqppl-.js";import"./c9a5287df-D_Z7ffFR.js";import"./c51e217b4-CQax1dv1.js";import"./c627fcdb6-1_bsVTpt.js";const n=r.memo(({content:n,enabled:d,onDismiss:a,onAction:c})=>{const m=n,p=i(t=>t.setChatTooltip),l=i(t=>t.clearChatTooltip),{setStoredModel:j}=t(),v=o(),u="credits_required_modal"===m.ctaAction?.type,{onCreditsRequiredClick:f}=s({enabled:u}),h=r.useCallback(()=>{if(!m.ctaAction)return;const{type:t,value:o}=m.ctaAction;if("model"===t)j(o);else if("credits_required_modal"===t)f(o,{offerModelSwitch:!0,currentModelId:o});else if("href"===t){o.startsWith("http://")||o.startsWith("https://")?e({href:o,desktopBehavior:"open-in-browser"}):v.push(o)}c({actionType:t,actionValue:o}),l(!0)},[m.ctaAction,j,f,v,c,l]);return r.useEffect(()=>{if(d)return p(m.type,m.nuxText,{title:m.nuxTitle,badgeText:m.nuxBadgeText,cta:m.ctaAction?{text:m.ctaAction.text,onClick:h}:void 0,onDismiss:a}),()=>{l(!0)};l(!0)},[d,m,p,l,h,a]),null});export{n as ChatTooltipV1};
