import{n as o,o as t,q as e}from"./c6eedc03a-CsEFTfjy.js";import{r}from"./vendor-react-Dp9pL_Wn.js";import{B as i,E as s}from"./index-CBEPphRm.js";import"./vendor-ant-cds-bBedrtIN.js";import"./vendor-base-ui-DNypCIlh.js";import"./vendor-radix-Ch96tRrt.js";import"./vendor-base-5_f7mmWg.js";import"./vendor-virtual-DRz8lJfQ.js";import"./vendor-intl-D2wGIp4M.js";import"./vendor-zod-0xcuG3aM.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"./vendor-infra-DayZK7Ds.js";import"./caf7c7e06-DJYXCm3T.js";import"./c5669b8e4-DFSq88jr.js";import"./c5f4e1303-CiyIFgnl.js";import"./cbaad2c48-DaP34LG2.js";const n=r.memo(({content:n,enabled:d,onDismiss:a,onAction:c})=>{const p=n,m=i(o=>o.setChatTooltip),l=i(o=>o.clearChatTooltip),{setStoredModel:j}=o(),v=t(),u="credits_required_modal"===p.ctaAction?.type,{onCreditsRequiredClick:f}=s({enabled:u}),h=r.useCallback(()=>{if(!p.ctaAction)return;const{type:o,value:t}=p.ctaAction;if("model"===o)j(t);else if("credits_required_modal"===o)f(t,{offerModelSwitch:!0,currentModelId:t});else if("href"===o){t.startsWith("http://")||t.startsWith("https://")?e({href:t,desktopBehavior:"open-in-browser"}):v.push(t)}c({actionType:o,actionValue:t}),l(!0)},[p.ctaAction,j,f,v,c,l]);return r.useEffect(()=>{if(d)return m(p.type,p.nuxText,{title:p.nuxTitle,badgeText:p.nuxBadgeText,cta:p.ctaAction?{text:p.ctaAction.text,onClick:h}:void 0,onDismiss:a}),()=>{l(!0)};l(!0)},[d,p,m,l,h,a]),null});n.displayName="ChatTooltipV1";export{n as ChatTooltipV1};
