1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{n as t,t as n}from"./jsx-runtime-D3F0h15I.js";import{a as r,c as i,s as a}from"./react-intl-CZJDGRhA.js";import{b as o}from"./initial_state-IJJyCPA3.js";import{H as s,R as c,Z as l,j as u,l as d,ot as f}from"./poll-rj_1n99k.js";import{Qa as p,Va as m,ao as h,eo as g,h as _,ha as v,io as ee,no as te,xa as y}from"./render-DyBowztl.js";import{o as b,s as x}from"./typed_functions-D7HVi0V_.js";import{at as S,s as C}from"./accounts_typed-DDRWvPXa.js";import{n as ne,t as re}from"./short_number-BgjDzBct.js";import{Qt as w,Yt as ie}from"./content-D3UIwcbY.js";import{t as T}from"./classnames-CfLRLWYq.js";import{t as ae}from"./counters-Do56yhcU.js";import{t as E}from"./skeleton-B7DUl0I_.js";import{t as D}from"./follow_button-DaMA2yQa.js";import{l as O}from"./badge-4MEB6Ux-.js";var k=e(t()),A=e(T()),j=n(),M=a({follow:{id:`account.follow`,defaultMessage:`Follow`},unfollow:{id:`account.unfollow`,defaultMessage:`Unfollow`},cancel_follow_request:{id:`account.cancel_follow_request`,defaultMessage:`Withdraw follow request`},unblock:{id:`account.unblock_short`,defaultMessage:`Unblock`},unmute:{id:`account.unmute_short`,defaultMessage:`Unmute`},mute_notifications:{id:`account.mute_notifications_short`,defaultMessage:`Mute notifications`},unmute_notifications:{id:`account.unmute_notifications_short`,defaultMessage:`Unmute notifications`},mute:{id:`account.mute_short`,defaultMessage:`Mute`},block:{id:`account.block_short`,defaultMessage:`Block`},more:{id:`status.more`,defaultMessage:`More`},addToLists:{id:`account.add_or_remove_from_list`,defaultMessage:`Add or Remove from lists`},openOriginalPage:{id:`account.open_original_page`,defaultMessage:`Open original page`}}),N=({id:e,size:t=46,hidden:n,minimal:a,defaultAction:T,withBio:N,withMenu:P=!0,withBorder:F=!0,extraAccountInfo:I,className:L,children:R,reference:z})=>{let B=i(),{signedIn:V}=f(),H=x(t=>t.accounts.get(e)),U=x(t=>t.relationships.get(e)),W=b(),G=H?.url,K=H?.acct!==H?.username,q=(0,k.useCallback)(()=>{U?.blocking?W(te(e)):W(m(e))},[W,e,U]),oe=(0,k.useCallback)(()=>{U?.muting?W(ee(e)):W(_(H))},[W,e,H,U]),J=(0,k.useMemo)(()=>{let t=[];return T===`mute`?t=[{text:B.formatMessage(U?.muting_notifications?M.unmute_notifications:M.mute_notifications),action:U?.muting_notifications?()=>{W(p(e,!1))}:()=>{W(p(e,!0))}}]:T!==`block`&&(K&&G&&t.push({text:B.formatMessage(M.openOriginalPage),href:G}),V&&(t.push({text:B.formatMessage(M.addToLists),action:()=>{let t=()=>{W(v({modalType:`LIST_ADDER`,modalProps:{accountId:e}}))};U?.following||U?.requested||e===o?t():W(v({modalType:`CONFIRM_FOLLOW_TO_LIST`,modalProps:{accountId:e,onConfirm:()=>{S(e,{ref:z}).then(e=>{W(C({relationship:e,alreadyFollowing:!1})),t()}).catch(e=>{W(y(e))})}}}))}}),e!==o&&(U?.following||U?.requested)&&t.push({text:B.formatMessage(U.endorsed?{id:`account.unendorse`}:{id:`account.endorse`}),action:()=>{U.endorsed?W(h(e)):W(g(e))}}))),t},[W,B,e,G,U,T,K,V,z]);if(n)return(0,j.jsxs)(j.Fragment,{children:[H?.display_name,H?.username]});let Y,X;J.length>0&&P&&(X=(0,j.jsx)(u,{items:J,icon:`ellipsis-h`,iconComponent:ie,title:B.formatMessage(M.more)})),Y=T===`block`?(0,j.jsx)(w,{text:B.formatMessage(U?.blocking?M.unblock:M.block),onClick:q}):T===`mute`?(0,j.jsx)(w,{text:B.formatMessage(U?.muting?M.unmute:M.mute),onClick:oe}):(0,j.jsx)(D,{accountId:e,reference:z});let Z;H?.mute_expires_at&&(Z=(0,j.jsxs)(j.Fragment,{children:[`· `,(0,j.jsx)(d,{hasFuture:!0,timestamp:H.mute_expires_at})]}));let Q,$=H?.fields.find(e=>!!e.verified_at);return $&&(Q=(0,j.jsx)(O,{link:$.value})),(0,j.jsx)(`div`,{className:(0,A.default)(`account`,L,{"account--minimal":a,"account--without-border":!F}),children:(0,j.jsxs)(`div`,{className:(0,A.default)(`account__wrapper`,{"account__wrapper--with-bio":H&&N}),children:[(0,j.jsxs)(`div`,{className:`account__info-wrapper`,children:[(0,j.jsxs)(ne,{className:`account__display-name focusable`,title:H?.acct,to:{pathname:`/@${H?.acct}`,state:{reference:z}},"data-hover-card-account":e,"data-hover-card-reference":z,children:[(0,j.jsx)(`div`,{className:`account__avatar-wrapper`,children:H?(0,j.jsx)(s,{account:H,size:t}):(0,j.jsx)(E,{width:t,height:t})}),(0,j.jsxs)(`div`,{className:`account__contents`,children:[(0,j.jsx)(c,{account:H}),!a&&(0,j.jsx)(`div`,{className:`account__details`,children:H?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(re,{value:H.followers_count,renderer:ae}),` `,Q,` `,Z]}):(0,j.jsx)(E,{width:`7ch`})})]})]}),H&&N&&(H.note.length>0?(0,j.jsx)(l,{className:`account__note translate`,htmlString:H.note_emojified,extraEmojis:H.emojis}):(0,j.jsx)(`div`,{className:`account__note account__note--missing`,children:(0,j.jsx)(r,{id:`account.no_bio`,defaultMessage:`No description provided.`})})),I]}),!a&&(0,j.jsxs)(`div`,{className:`account__relationship`,children:[X,Y]}),R]})})};export{N as t}; 2//# sourceMappingURL=account-DQx8zadi.js.map
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.