import{a as t,d as o}from"./cec18ad9a-DiLjrOUd.js";import{r}from"./vendor-react-AXa6hZO5.js";import{x as e,y as i}from"./index-C_tZnXTW.js";import"./vendor-radix-glKlawmm.js";import"./vendor-zod-CMvj0_Fd.js";import"./vendor-intl-BdADXLLt.js";import"./vendor-zustand-CcZsBpBq.js";import"./vendor-icons-Dy3Nea9p.js";import"./vendor-lodash-BKAXkXVe.js";import"./vendor-motion-0BJMgYoH.js";import"./vendor-infra-CFC-WJ8N.js";import"./vendor-router-BSYVf8By.js";import"./vendor-query-D7SPXjZv.js";import"./vendor-growthbook-XJcBFzji.js";import"./cdd5b9598-juLasKsB.js";import"./c2591c98b-9UrrTnB9.js";import"./vendor-luxon-D0OkDiyb.js";import"./c51f8bc6d-BS9P5nN1.js";import"./tree-sitter-BFuuT2ac.js";const s=r.memo(({content:s,enabled:n,onDismiss:a,onAction:c})=>{const p=s,d=e(t=>t.setChatTooltip),m=e(t=>t.clearChatTooltip),j=i(),l=t(),v=r.useCallback(()=>{if(!p.ctaAction)return;const{type:t,value:r}=p.ctaAction;if("model"===t)j(r);else if("href"===t){r.startsWith("http://")||r.startsWith("https://")?o({href:r,desktopBehavior:"open-in-browser"}):l.push(r)}c({actionType:t,actionValue:r}),m(!0)},[p.ctaAction,j,l,c,m]);return r.useEffect(()=>{if(n)return d(p.type,p.nuxText,{badgeText:p.nuxBadgeText,cta:p.ctaAction?{text:p.ctaAction.text,onClick:v}:void 0,onDismiss:a}),()=>{m(!0)};m(!0)},[n,p,d,m,v,a]),null});s.displayName="ChatTooltipV1";export{s as ChatTooltipV1};
