import{r as o,j as e}from"./vendor-react-Dp9pL_Wn.js";import{a}from"./cd27d5348-DPZVK3vw.js";import{q as s,ah as r,ai as t,aj as n,ak as i,ag as d,D as c}from"./c2ee0272b-DPDuX889.js";import{u as m}from"./vendor-intl-D2wGIp4M.js";import{R as p,aB as l,T as j,U as f,aA as u}from"./index-XoaBlZfC.js";import{u as k,f as b,C as v}from"./vendor-ant-cds-BLsR_p72.js";import{m as h}from"./vendor-motion-EDlUw66k.js";import"./c9a5287df-D_Z7ffFR.js";import"./vendor-zod-B8MhECV7.js";import"./c62933a29-BTmwOnJk.js";import"./caf7c7e06-DiSIOZ2Y.js";import"./vendor-base-5_f7mmWg.js";import"./ca4e68303-2GEI1XEE.js";import"./ce5824dc6-DCrxq2nV.js";import"./cb3073067-VsOwq8wi.js";import"./c1e35bcba-VJ15EpPv.js";import"./c80791b3a-C9RrC3yS.js";import"./c7d6fc21a-XgEBZrGw.js";import"./c86a1b907-DGD2pwio.js";import"./vendor-luxon-CZxT8ieM.js";import"./c33b2042a-BXM4oh1L.js";import"./c6a992d55-BwJodww6.js";import"./cba0eac33-DiCKjNP1.js";import"./vendor-base-ui-N1VQ4ctE.js";import"./vendor-radix-Dv3qPI0v.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-infra-DayZK7Ds.js";import"./vendor-growthbook-HDTqppl-.js";import"./c51e217b4-CQax1dv1.js";import"./c627fcdb6-1_bsVTpt.js";import"./vendor-virtual-DRz8lJfQ.js";function w(){}const g=o.memo(({content:g,enabled:x,onDismiss:C,onAction:M})=>{const D=g,_=k(50),q=m(),y=s("claude_ai_sot_has_desktop"),E=r(),T=t(),U=n(),z=p(),A="cowork-upsell"===D.ctaType,O=l({when:x&&A}),B=i(),I=b(),[N,P]=o.useState(null);o.useEffect(()=>{j().then(o=>P(o))},[]);const[Y,S]=o.useState(!1),{downloadAndOpenModal:F,modal:H}=f("home_nudge_v1",{onClose:()=>{S(!1),M({cta:"download"})}}),R=o.useCallback(()=>{M()},[M]),Z=o.useCallback(()=>{M({cta:"open-cowork"})},[M]),$=o.useCallback(()=>{M({cta:"open-desktop"})},[M]),G=o.useCallback(o=>{o.preventDefault(),F(N),S(!0)},[F,N]),J=o.useCallback(o=>{o.preventDefault(),o.stopPropagation(),C()},[C]);if(!x)return null;const K=!U&&(E||T);let L,Q,V;if(A&&O.routesInApp)L={kind:"open-cowork"};else if(A&&K&&y)L={kind:"open-desktop"};else if(A&&K&&z)L={kind:"download"};else{const o=D.buttonHref,e=/^https?:\/\//i.test(o);L={kind:"href",href:e?o:d(o),isExternal:e}}let W,X=!1;switch(L.kind){case"open-cowork":Q=B,V=D.buttonText??q.formatMessage({defaultMessage:"Open Cowork",id:"PfEq6+YMsC"}),W=Z;break;case"open-desktop":Q="claude://cowork/new",V=q.formatMessage({defaultMessage:"Open Cowork",id:"PfEq6+YMsC"}),W=$;break;case"download":Q="#",V=q.formatMessage({defaultMessage:"Download",id:"5q3qC0sC3r"}),W=G;break;case"href":Q=L.href,V=D.buttonText,X=L.isExternal,W=R}const oo={...D,buttonText:V,imageUrl:"dark"===I&&D.imageUrlDark?D.imageUrlDark:D.imageUrl};return e.jsxs(e.Fragment,{children:[!Y&&e.jsx(h.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"fixed bottom-10 right-10",style:{zIndex:_},children:e.jsx(v,{children:e.jsx(c,{href:Q,webBehavior:X?"new-tab":"navigate",desktopBehavior:X?"open-in-browser":"navigate",rel:"noreferrer",onClick:W,className:"block cursor-pointer",children:e.jsx(a,{content:oo,onCtaClick:"href"===L.kind?R:w,onDismiss:J,ImageComponent:u})})})}),"download"===L.kind&&H]})});export{g as HomeNudgeV1};
