import{o as e}from"./rolldown-runtime-iuO8RvI4.js";import{Ei as t,Mi as s,ki as a}from"./vendor-frame-CwiylG4Y.js";import{br as r}from"./shared-6-Cf_fMhRZ.js";import{rn as o}from"./vendor-all-2-BJdkbLSj.js";import{N as i,T as n,w as l}from"./shared-frame-DbQbH4Yr.js";import{gn as d}from"./shared-4-6CEyRAHb.js";import{t as c}from"./c8f0d167d-KHK-RME8.js";var u=e(s()),m=a(),f=`fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 flex flex-col w-[calc(100vw-2rem)] ${n} ${i("popover")} shadow-panel-lg cds-reset text-body text-primary outline-none`,p={sm:"max-w-[400px]",md:"max-w-[520px]",lg:"max-w-[720px]",xl:"max-w-[880px]","2xl":"max-w-[1024px]","3xl":"max-w-[1152px]"},x=(0,u.memo)(({render:e,onDismiss:s,onAction:a,size:o="xl",maxWidth:i,popupClassName:n,backdropClassName:d,dismissible:c=!0,unstyled:x=!1})=>{const[h,g]=(0,u.useState)(!0),y=r()()?.setSpotlightActive,k=(0,u.useRef)(y);k.current=y;const w=void 0!==y;(0,u.useEffect)(()=>{if(!w||!h)return;const e=k.current;return e?.(!0),()=>e?.(!1)},[h,w]);const v=(0,u.useRef)(null),b=(0,u.useRef)(!1),j=(0,u.useRef)(a);j.current=a;const C=(0,u.useCallback)(()=>!!v.current&&(j.current(v.current.metadata),v.current=null,!0),[]),M=(0,u.useCallback)(()=>{b.current||(b.current=!0,C(),g(!1))},[C]),A=(0,u.useCallback)(()=>{b.current||(b.current=!0,C()||s(),g(!1))},[C,s]);(0,u.useEffect)(()=>()=>{b.current||C()},[C]);const P=(0,u.useCallback)(e=>{if(b.current)return;const{keepOpen:t,...s}=e??{},r=Object.keys(s).length>0?s:void 0;t?v.current={metadata:r}:(v.current=null,a(r),M())},[a,M]),D=(0,u.useCallback)(e=>{e||A()},[A]),N=e({handleDismiss:A,handleAction:P}),R=void 0!==i?{maxWidth:i}:void 0,q=R?{...R,width:"calc(100vw - 2rem)"}:void 0;return(0,m.jsx)(l.Root,{open:h,onOpenChange:D,dismissible:c,children:(0,m.jsx)(l.Popup,{size:o,unstyled:x,backdropClassName:d,className:t(x&&[f,"transition-[opacity,transform] duration-base ease-out data-[starting-style]:opacity-0 data-[starting-style]:scale-[0.98] data-[ending-style]:opacity-0 data-[ending-style]:scale-[0.98]",p[o]],"overflow-hidden !border-0",void 0!==i&&"!max-w-fit",n),children:x?(0,m.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto rounded-[inherit]",children:q?(0,m.jsx)("div",{style:q,children:N}):N}):R?(0,m.jsx)("div",{style:R,children:N}):N})})}),h=(0,u.memo)(function({onDismiss:e,onUpgrade:t}){const s=o(),a=(0,u.useMemo)(()=>({layout:"vertical",maxWidth:640,title:s.formatMessage({defaultMessage:"Don\u2019t just chat. Cowork.",id:"6zhJS6JZlH"}),bodyText:s.formatMessage({defaultMessage:"With Cowork, Claude tackles complex tasks independently. It can organize files, draft docs, and more.",id:"b3c1n4ee56"}),bulletPoints:[{text:s.formatMessage({defaultMessage:"Point Claude at a folder and let it work",id:"r7PmBqqkcB"})},{text:s.formatMessage({defaultMessage:"Runs in the background while you do other things",id:"xI7A14X+gA"})},{text:s.formatMessage({defaultMessage:"Claude checks in when it needs your input",id:"B33QiHqTkv"})}],ctaActions:[{text:s.formatMessage({defaultMessage:"Later",id:"uQDRsYlg+S"}),type:"href",value:""},{text:s.formatMessage({defaultMessage:"Upgrade",id:"0h/lPMeYkq"}),type:"upgrade",value:"/upgrade?feature=cowork&hide_free=true",isPrimary:!0}]}),[s]);return(0,m.jsx)(x,{unstyled:!0,popupClassName:"!max-w-fit",onDismiss:e,onAction:s=>{s?.isPrimary?t():e()},render:({handleDismiss:e,handleAction:t})=>(0,m.jsx)(c,{content:a,videoAsset:d["desktop-cowork-tab"],onDismiss:e,onCtaClick:e=>t({isPrimary:e.isPrimary}),classNames:{bulletList:"space-y-1.5"}})})});export{h as CoworkUpsellModalChorus};