1import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{t as n}from"./react-DEX2qfRi.js";import{n as r}from"./dist-Q0ep0CTQ.js";import{t as i}from"./check-BH4O4BIM.js";import{t as a}from"./copy-DqWM_0E1.js";import{t as o}from"./heart-CKsZuI8J.js";import{t as s}from"./link-2-D7Plbwa4.js";import{t as c}from"./mail-BUcVDk1i.js";import{t as l}from"./share-2-DuskWaf-.js";import{t as u}from"./utils-B6KiDbIe.js";import{a as d,n as f,o as p,r as m,t as h}from"./dialog-BgYHmtC8.js";import{c as g}from"./share-kit-zNB9SRt1.js";import{n as _,r as v}from"./collections-store-liJuz9R6.js";var y=e(n(),1),b=t(),x=`tap-target inline-flex size-11 items-center justify-center rounded-full border border-border bg-card text-foreground transition-colors hover:bg-accent`;function S(e){return/^https?:\/\//.test(e)?e:`${g()}${e.startsWith(`/`)?e:`/${e}`}`}function C({collection:e,className:t,withLabel:n=!1}){let i=v().some(t=>t.id===e.id);return(0,b.jsxs)(`button`,{type:`button`,"aria-pressed":i,"aria-label":i?`Remove ${e.title} from saved`:`Save ${e.title}`,onClick:t=>{t.preventDefault(),t.stopPropagation();let n=_(e);r.success(n?`${e.title} saved to your profile.`:`${e.title} removed from saved.`)},className:u(x,n&&`w-auto gap-2 px-4 text-sm font-semibold`,i&&`text-primary`,t),children:[(0,b.jsx)(o,{className:u(`size-5`,i&&`fill-current`),"aria-hidden":`true`}),n?(0,b.jsx)(`span`,{children:i?`Saved`:`Save`}):null]})}function w({collection:e,className:t,withLabel:n=!1}){let[o,g]=(0,y.useState)(!1),[_,v]=(0,y.useState)(!1),C=S(e.href),w=`${e.title} â a curated Collection on Virtual Publicist`,T=async()=>{try{await navigator.clipboard.writeText(C),v(!0),r.success(`Link copied.`),window.setTimeout(()=>v(!1),2e3)}catch{r.error(`Could not copy the link.`)}};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`button`,{type:`button`,"aria-label":`Share ${e.title}`,onClick:e=>{e.preventDefault(),e.stopPropagation(),g(!0)},className:u(x,n&&`w-auto gap-2 px-4 text-sm font-semibold`,t),children:[(0,b.jsx)(l,{className:`size-5`,"aria-hidden":`true`}),n?(0,b.jsx)(`span`,{children:`Share`}):null]}),(0,b.jsx)(h,{open:o,onOpenChange:g,children:(0,b.jsxs)(f,{className:`w-[calc(100vw-2rem)] max-w-[420px] rounded-[18px] p-5 sm:p-6`,children:[(0,b.jsxs)(d,{className:`text-left`,children:[(0,b.jsx)(p,{className:`text-[18px]`,children:`Share this Collection`}),(0,b.jsx)(m,{className:`truncate`,children:e.title})]}),(0,b.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 rounded-[12px] border border-border bg-secondary/50 px-3 py-2`,children:[(0,b.jsx)(s,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,b.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] text-muted-foreground`,children:C})]}),(0,b.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:()=>
1void T(),className:`tap-target inline-flex flex-1 items-center justify-center gap-2 rounded-[12px] bg-primary px-4 py-3 text-sm font-semibold text-primary-foreground transition-opacity hover:opacity-90`,children:[_?(0,b.jsx)(i,{className:`size-4`,"aria-hidden":`true`}):(0,b.jsx)(a,{className:`size-4`,"aria-hidden":`true`}),_?`Link copied`:`Copy link`]}),(0,b.jsxs)(`a`,{href:`mailto:?subject=${encodeURIComponent(e.title)}&body=${encodeURIComponent(`${w}\n\n${C}`)}`,className:`tap-target inline-flex flex-1 items-center justify-center gap-2 rounded-[12px] border border-border bg-card px-4 py-3 text-sm font-semibold hover:bg-accent`,children:[(0,b.jsx)(c,{className:`size-4`,"aria-hidden":`true`}),`Email a friend`]})]})]})})]})}export{w as n,C as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.