import{r as e,j as o}from"./vendor-react-Dp9pL_Wn.js";import{a as s}from"./cd27d5348-CvI1KOlQ.js";import{l as a,a9 as r,aa as t,ab as n,ac as i,a8 as d,D as c}from"./c6eedc03a-CsEFTfjy.js";import{u as m}from"./vendor-intl-D2wGIp4M.js";import{Q as p,aw as l,R as f,T as j,av as u}from"./index-CBEPphRm.js";import{u as k,e as v,C as b}from"./vendor-ant-cds-bBedrtIN.js";import{m as h}from"./vendor-motion-EDlUw66k.js";import"./caf7c7e06-DJYXCm3T.js";import"./vendor-zod-0xcuG3aM.js";import"./c62933a29-BojHUSii.js";import"./c60f5ad19-R8w-svgU.js";import"./vendor-base-5_f7mmWg.js";import"./c32c0d97f-BRKlKuDE.js";import"./ca4e68303-2GEI1XEE.js";import"./ce5824dc6-DCrxq2nV.js";import"./c393cb7f5-B9bpbpka.js";import"./c41323917-D2qX4YRv.js";import"./c57c2877c-CDK50aMX.js";import"./cd78d010c-Dyg6Wpc_.js";import"./c5f3f4681-re2ND0pU.js";import"./vendor-base-ui-DNypCIlh.js";import"./vendor-radix-Ch96tRrt.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-luxon-CZxT8ieM.js";import"./vendor-growthbook-C66YtMMX.js";import"./vendor-infra-DayZK7Ds.js";import"./c5669b8e4-DFSq88jr.js";import"./c5f4e1303-CiyIFgnl.js";import"./cbaad2c48-DaP34LG2.js";import"./vendor-virtual-DRz8lJfQ.js";function w(){}const g=e.memo(({content:g,enabled:x,onDismiss:C,onAction:M})=>{const y=g,D=k(50),_=m(),q=a("claude_ai_sot_has_desktop"),z=r(),E=t(),T=n(),U=p(),A="cowork-upsell"===y.ctaType,N=l({when:x&&A}),I=i(),O=v(),[P,Y]=e.useState(null);e.useEffect(()=>{f().then(e=>Y(e))},[]);const[B,H]=e.useState(!1),{downloadAndOpenModal:S,modal:V}=j("home_nudge_v1",{onClose:()=>{H(!1),M({cta:"download"})}}),F=e.useCallback(()=>{M()},[M]),Q=e.useCallback(()=>{M({cta:"open-cowork"})},[M]),R=e.useCallback(()=>{M({cta:"open-desktop"})},[M]),W=e.useCallback(e=>{e.preventDefault(),S(P),H(!0)},[S,P]),X=e.useCallback(e=>{e.preventDefault(),e.stopPropagation(),C()},[C]);if(!x)return null;const Z=!T&&(z||E);let $,G,J;if(A&&N.routesInApp)$={kind:"open-cowork"};else if(A&&Z&&q)$={kind:"open-desktop"};else if(A&&Z&&U)$={kind:"download"};else{const e=y.buttonHref,o=/^https?:\/\//i.test(e);$={kind:"href",href:o?e:d(e),isExternal:o}}let K,L=!1;switch($.kind){case"open-cowork":G=I,J=y.buttonText??_.formatMessage({defaultMessage:"Open Cowork",id:"PfEq6+YMsC"}),K=Q;break;case"open-desktop":G="claude://cowork/new",J=_.formatMessage({defaultMessage:"Open Cowork",id:"PfEq6+YMsC"}),K=R;break;case"download":G="#",J=_.formatMessage({defaultMessage:"Download",id:"5q3qC0sC3r"}),K=W;break;case"href":G=$.href,J=y.buttonText,L=$.isExternal,K=F}const ee={...y,buttonText:J,imageUrl:"dark"===O&&y.imageUrlDark?y.imageUrlDark:y.imageUrl};return o.jsxs(o.Fragment,{children:[!B&&o.jsx(h.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"fixed bottom-10 right-10",style:{zIndex:D},children:o.jsx(b,{children:o.jsx(c,{href:G,webBehavior:L?"new-tab":"navigate",desktopBehavior:L?"open-in-browser":"navigate",rel:"noreferrer",onClick:K,className:"block cursor-pointer",children:o.jsx(s,{content:ee,onCtaClick:"href"===$.kind?F:w,onDismiss:X,ImageComponent:u})})})}),"download"===$.kind&&V]})});g.displayName="HomeNudgeV1";export{g as HomeNudgeV1};
