import{o as s}from"./rolldown-runtime-iuO8RvI4.js";import{Ll as o}from"./shared-0-C4kdVF7Y.js";import{Mi as e,ki as r}from"./vendor-frame-CwiylG4Y.js";import{Xl as a}from"./shared-1-3-6x7RKF.js";import{Ha as n,Wa as i}from"./shared-6-Cf_fMhRZ.js";import{ks as c}from"./shared-4-6CEyRAHb.js";import{do as t}from"./shared-5-UQAFGbWu.js";import{kt as l}from"./shared-7-VxUxSmVa.js";var m=s(e()),u=r();function p(){}var d=(0,m.memo)(({enabled:s,onDismiss:e,onAction:r})=>{const{conversation:d}=c(),_=d?.id,f=t()?"cowork":"chat",{account:k}=o(),{lastMessage:h,previousMessage:j}=l({conversationUuid:_,isStreaming:!1}),g=(0,m.useMemo)(()=>i({lastMessage:h,previousMessage:j,isFinanceUser:"Finance"===k?.settings?.work_function}),[k?.settings?.work_function,h,j]),{dismiss:w}=a(),b=(0,m.useCallback)(()=>{w("cowork"===f?"c4excel_cowork_banner_upsell":"c4excel_chat_banner_upsell"),e()},[w,e,f]),v=(0,m.useCallback)(()=>{w("cowork"===f?"c4excel_cowork_banner_upsell":"c4excel_chat_banner_upsell"),r()},[w,r,f]);return s?(0,u.jsx)(n,{triggerType:g??"upload",surface:f,onShown:p,onDismiss:b,onAction:v}):null});export{d as C4ExcelUpsellChatBanner};