import{o as e}from"./rolldown-runtime-iuO8RvI4.js";import{S_ as r,j_ as n}from"./shared-0-C4kdVF7Y.js";import{Mi as s,ki as t}from"./vendor-frame-CwiylG4Y.js";import{Dh as a,lv as o,ov as i}from"./shared-1-3-6x7RKF.js";import{qi as l}from"./shared-6-Cf_fMhRZ.js";import{nn as c,rn as u}from"./vendor-all-2-BJdkbLSj.js";import{$ as m,V as p}from"./shared-frame-DbQbH4Yr.js";import{Ol as f}from"./shared-2-CMUBhYOn.js";import{t as d}from"./ca1ce32a0-IlirXYWw.js";var h=e(s()),j=t(),x="https://support.claude.com/en/articles/13641943-visual-and-interactive-content";var k=(0,h.memo)(function({variant:e="full",onOpen:s}={}){const t=u(),o=(0,h.useRef)(!1),i=(0,h.useRef)(!1),l=(0,h.useRef)(!1),f=(0,h.useRef)(!1),d=(0,h.useCallback)(()=>{l.current||(l.current=!0,s?.())},[s]),k=(0,h.useCallback)(e=>{"touch"!==e.pointerType&&"pen"!==e.pointerType&&(o.current=!0,d())},[d]),g=(0,h.useCallback)(e=>{o.current=!1,"touch"!==e.pointerType&&"pen"!==e.pointerType&&(f.current=!1),i.current||(l.current=!1)},[]),v=(0,h.useCallback)(()=>{f.current=!0},[]),b=(0,h.useCallback)(()=>{const e=f.current;f.current=!1,i.current=!0,e||d()},[d]),w=(0,h.useCallback)(()=>{i.current=!1,f.current=!1,o.current||(l.current=!1)},[]),y=a(a(n("image_search_help_center","url","",r))??x)??x,C=e=>(0,j.jsx)("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 hover:opacity-80",children:e});return(0,j.jsx)(p,{delay:0,align:"end",multiline:!0,className:"max-w-[280px] -translate-y-1",content:"short"===e?(0,j.jsx)(c,{defaultMessage:"Results from the web. <link>Learn more</link>",id:"ICs/DFJLFl",values:{link:C}}):(0,j.jsx)(c,{defaultMessage:"Results from the web. Listings are not sponsored and do not generate advertising revenue for Anthropic. <link>Learn more</link>",id:"G9SSLg/Q1C",values:{link:C}}),children:(0,j.jsx)("button",{type:"button","aria-label":t.formatMessage({defaultMessage:"About these sources",id:"SGNSIq+G0H"}),onPointerEnter:k,onPointerLeave:g,onPointerDown:v,onFocus:b,onBlur:w,className:"flex size-4 shrink-0 items-center justify-center text-muted transition-colors hover:text-secondary",children:(0,j.jsx)(m,{name:"Info",size:"sm"})})})}),g=(0,h.memo)(function({safeHref:e,price:r,onSourceClick:n,onSourcesInfoOpen:s}){const t=u();o();const c=a(e);if(!c)return null;const m=d(c),p=m&&r?t.formatMessage({defaultMessage:"{vendor} \xb7 {price}",id:"fmnYlj2OqC"},{vendor:m,price:r}):m||r;return(0,j.jsxs)("span",{className:"flex h-4 min-w-0 items-center justify-between gap-sm text-footnote leading-none text-muted",children:[(0,j.jsxs)(l,{href:c,linkTarget:"_blank",target:"_blank",onLinkClick:n,className:"group/source inline-flex min-w-0 items-center gap-1.5 decoration-transparent",children:[(0,j.jsx)("span",{className:"flex shrink-0",children:(0,j.jsx)(f,{url:i(c,16),size:16},c)}),p&&(0,j.jsx)("span",{className:"min-w-0 overflow-x-clip text-ellipsis whitespace-nowrap group-hover/source:underline group-focus-visible/source:underline",children:p})]}),(0,j.jsx)(k,{onOpen:s})]})});export{k as n,g as t};