1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{n as t,t as n}from"./jsx-runtime-CKeovgl0.js";import{a as r,c as i,s as a}from"./react-intl-C-SARy9S.js";import{u as o}from"./initial_state-Bw8LfuSU.js";import{i as s,k as c,r as l}from"./logo-CrExCFnR.js";import{nn as u}from"./dist-C0ScUieF.js";import{Gi as d,N as f,P as ee,Si as p,Yi as m,xi as h}from"./time-CeaVCaMt.js";import{b as g}from"./react-router-MZ31fgC0.js";import{t as _}from"./defineProperty-C0YrXxyM.js";import{o as v,s as y}from"./typed_functions-kg_akIEI.js";import{t as b}from"./react-router-dom-UToIjw8I.js";import{$t as x,M as S,n as C}from"./status_quoted-pFGW53kw.js";import{t as w}from"./classnames-CfLRLWYq.js";import{F as T,P as E,R as D,b as O}from"./poll-D_l0QHG5.js";import{d as k,i as A,u as te}from"./account-BBeMh33R.js";import{t as ne}from"./display_name-G2jqycn2.js";import{t as re}from"./gif-BmHrde0J.js";import{t as ie}from"./info-Jlkt-j5H.js";import{x as ae}from"./bookmark-D2wbecf3.js";import{t as oe}from"./chevron_left-D0AYmAQ6.js";import{n as j,t as M}from"./useObserver-dTVRk2IS.js";import{t as N}from"./icon_pinned-BOFvE-CQ.js";import{t as P}from"./load_gap-BZ-JS0Z2.js";import{t as F}from"./scrollable_list-DEmeeA1H.js";var I=e(g()),L=e(u()),R=e(l()),z=n(),B=()=>(0,z.jsxs)(`div`,{className:`regeneration-indicator`,children:[(0,z.jsx)(re,{src:`/loading.gif`,staticSrc:`/loading.png`,className:`regeneration-indicator__figure`}),(0,z.jsxs)(`div`,{className:`regeneration-indicator__label`,children:[(0,z.jsx)(`strong`,{children:(0,z.jsx)(r,{id:`regeneration_indicator.preparing_your_home_feed`,defaultMessage:`Preparing your home feedâ¦`})}),(0,z.jsx)(r,{id:`regeneration_indicator.please_stand_by`,defaultMessage:`Please stand by.`,tagName:`span`})]})]}),V=e(t());function H({autoResize:e,padding:t=4}={}){let[n,r]=(0,V.useState)(-1),[i,a]=(0,V.useState)(0),[o,s]=(0,V.useState)(`none`),c=(0,V.useRef)(null),l=(0,V.useCallback)(()=>{let e=c.current;if(!e)return;let n=()=>{r(-1),a(0),s(`none`)},i=(e.parentElement?.offsetWidth??0)-(e.nextElementSibling?.scrollWidth??0)-t;if(i<=0){n();return}let o=0,l=0,u=0;for(let t of e.children){if(t instanceof HTMLElement){let e=t.offsetLeft+t.offsetWidth;if(e<=i)o+=1,u=e;else break}l++}if(o===e.children.length){n();return}r(l),a(e.children.length-o),s(u)},[t]);(0,V.useEffect)(()=>{c.current&&e&&(c.current.style.maxWidth=typeof o==`number`?`${o}px`:o)},[e,o]);let{listRefCallback:u,wrapperRefCallback:d}=W({onRecalculate:l,onListRef:c});return{hiddenCount:i,hasOverflow:i>0,wrapperRef:d,hiddenIndex:n,maxWidth:o,listRef:u,recalculate:l}}function U({widthOffset:e=200,absoluteDistance:t=!1}={}){let[n,r]=(0,V.useState)(!1),[i,a]=(0,V.useState)(!1),o=(0,V.useRef)(null),s=(0,V.useCallback)(()=>{o.current&&(getComputedStyle(o.current).direction===`rtl`?(r(o.current.clientWidth-o.current.scrollLeft<o.current.scrollWidth),a(o.current.scrollLeft<0)):(r(o.current.scrollLeft>0),a(o.current.scrollLeft+o.current.clientWidth<o.current.scrollWidth)))},[]),{wrapperRefCallback:c}=W({onRecalculate:s,onWrapperRef:o});(0,V.useEffect)(()=>{s()},[s]);let l=(0,V.useCallback)(()=>{requestAnimationFrame(s)},[s]);return{bodyRef:c,canScrollLeft:n,canScrollRight:i,handleLeftNav:(0,V.useCallback)(()=>{o.current&&(o.current.scrollLeft-=t?e:Math.max(e,o.current.clientWidth-e))},[t,e]),handleRightNav:(0,V.useCallback)(()=>{o.current&&(o.current.scrollLeft+=t?e:Math.max(e,o.current.clientWidth-e))},[t,e]),handleScroll:l}}function W({onRecalculate:e,onListRef:t,onWrapperRef:n}){let r=(0,V.useRef)(null),i=j(e),a=(0,V.useCallback)(()=>{let t=r.current;if(t)for(let e of t.children)e instanceof HTMLElement&&i.observe(e);e()},[e,i]),o=M(a),s=(0,V.useCallback)(()=>{c.current&&i.observe(c.current),r.current&&(o.observe(r.current,{childList:!0}),a())},[a,o,i]),c=(0,V.useRef)(null);return{wrapperRefCallback:(0,V.useCallback)(e=>{e&&(c.current=e,s(),typeof n==`function`?n(e):n&&`current`in n&&(n.current=e))},[s,n]),listRefCallback:(0,V.useCallback)(e=>{e&&(r.current=e,s(),typeof t==`function`?t(e):t&&`current`in t&&(t.current=e))},[s,t])}}var G=a({previous:{id:`lightbox.previous`,defaultMessage:`Previous`},next:{id:`lightbox.next`,defaultMessage:`Next`},dismiss:{id:`follow_suggestions.dismiss`,defaultMessage:`Don't show again`},friendsOfFriendsHint:{id:`follow_suggestions.hints.friends_of_friends`,defaultMessage:`This profile is popular among the people you follow.`}
1,similarToRecentlyFollowedHint:{id:`follow_suggestions.hints.similar_to_recently_followed`,defaultMessage:`This profile is similar to the profiles you have most recently followed.`},featuredHint:{id:`follow_suggestions.hints.featured`,defaultMessage:`This profile has been hand-picked by the {domain} team.`},mostFollowedHint:{id:`follow_suggestions.hints.most_followed`,defaultMessage:`This profile is one of the most followed on {domain}.`},mostInteractionsHint:{id:`follow_suggestions.hints.most_interactions`,defaultMessage:`This profile has been recently getting a lot of attention on {domain}.`}}),K=({id:e})=>{let t=i(),n,a;switch(e){case`friends_of_friends`:a=t.formatMessage(G.friendsOfFriendsHint),n=(0,z.jsx)(r,{id:`follow_suggestions.personalized_suggestion`,defaultMessage:`Personalized suggestion`});break;case`similar_to_recently_followed`:a=t.formatMessage(G.similarToRecentlyFollowedHint),n=(0,z.jsx)(r,{id:`follow_suggestions.personalized_suggestion`,defaultMessage:`Personalized suggestion`});break;case`featured`:a=t.formatMessage(G.featuredHint,{domain:o}),n=(0,z.jsx)(r,{id:`follow_suggestions.curated_suggestion`,defaultMessage:`Staff pick`});break;case`most_followed`:a=t.formatMessage(G.mostFollowedHint,{domain:o}),n=(0,z.jsx)(r,{id:`follow_suggestions.popular_suggestion`,defaultMessage:`Popular suggestion`});break;case`most_interactions`:a=t.formatMessage(G.mostInteractionsHint,{domain:o}),n=(0,z.jsx)(r,{id:`follow_suggestions.popular_suggestion`,defaultMessage:`Popular suggestion`})}return(0,z.jsx)(A,{className:`inline-follow-suggestions__body__scrollable__card__text-stack__source`,title:a,label:n,icon:(0,z.jsx)(ie,{})})},se=({id:e,sources:t})=>{let n=i(),r=y(t=>t.accounts.get(e)),a=r?.fields.find(e=>!!e.verified_at),o=v(),s=(0,V.useCallback)(()=>{o(f({accountId:e}))},[e,o]);return(0,z.jsxs)(`div`,{className:`inline-follow-suggestions__body__scrollable__card`,children:[(0,z.jsx)(E,{icon:``,iconComponent:c,onClick:s,title:n.formatMessage(G.dismiss)}),(0,z.jsx)(`div`,{className:`inline-follow-suggestions__body__scrollable__card__avatar`,children:(0,z.jsx)(b,{to:`/@${r?.acct}`,"data-hover-card-account":r?.id,children:(0,z.jsx)(O,{account:r,size:72})})}),(0,z.jsxs)(`div`,{className:`inline-follow-suggestions__body__scrollable__card__text-stack`,children:[(0,z.jsx)(b,{to:`/@${r?.acct}`,"data-hover-card-account":r?.id,children:(0,z.jsx)(ne,{account:r})}),a?(0,z.jsx)(te,{link:a.value}):(0,z.jsx)(K,{id:t[0]})]}),(0,z.jsx)(k,{accountId:e})]})},q=`home/follow-suggestions`,ce=({hidden:e})=>{let t=i(),n=(0,V.useId)(),a=v(),o=y(e=>e.suggestions.items),c=y(e=>e.suggestions.isLoading),l=y(e=>!!e.settings.getIn([`dismissed_banners`,q]));(0,V.useEffect)(()=>{a(ee())},[a]);let u=(0,V.useCallback)(()=>{a(m([`dismissed_banners`,q],!0))},[a]),{bodyRef:d,handleScroll:f,canScrollLeft:p,canScrollRight:h,handleLeftNav:g,handleRightNav:_}=U({absoluteDistance:!0});return l||!c&&o.length===0?null:e?(0,z.jsx)(`div`,{className:`inline-follow-suggestions`}):(0,z.jsxs)(`div`,{role:`group`,"aria-labelledby":n,className:`inline-follow-suggestions focusable`,tabIndex:-1,children:[(0,z.jsxs)(`div`,{className:`inline-follow-suggestions__header`,children:[(0,z.jsx)(`h2`,{id:n,className:`inline-follow-suggestions__title`,children:(0,z.jsx)(r,{id:`follow_suggestions.who_to_follow`,defaultMessage:`Who to follow`})}),(0,z.jsxs)(`div`,{className:`inline-follow-suggestions__header__actions`,children:[(0,z.jsx)(`button`,{className:`link-button`,onClick:u,type:`button`,children:(0,z.jsx)(r,{id:`follow_suggestions.dismiss`,defaultMessage:`Don't show again`})}),(0,z.jsx)(b,{to:`/explore/suggestions`,className:`link-button`,children:(0,z.jsx)(r,{id:`follow_suggestions.view_all`,defaultMessage:`View all`})})]})]}),(0,z.jsxs)(`div`,{className:`inline-follow-suggestions__body`,children:[(0,z.jsx)(`div`,{className:`inline-follow-suggestions__body__scrollable`,ref:d,onScroll:f,children:c?(0,z.jsx)(D,{}):o.map(e=>(0,z.jsx)(se,{id:e.account_id,sources:e.sources},e.account_id))}),p&&(0,z.jsx)(`button`,{className:`inline-follow-suggestions__body__scroll-button left`,onClick:g,"aria-label":t.formatMessage(G.previous),type:`button`,children:(0,z.jsx)(`div`,{className:`inline-follow-suggestions__body__scroll-button__icon`,children:(0,z.jsx)(T,{id:``,icon:oe})})}),h&&(0,z.jsx)(`button`,{className:`inline-follow-suggestions__body__scroll-button right`,onClick:_,"aria-label":t.formatMessage(G.next),type:`button`,children:(0,z.jsx)(`div`,{className:`inline-follow-suggestions__body__scroll-button__icon`,children:(0,z.jsx)(T,{id:``,icon:s})})})]})]})},le=e(w());function ue({type:e=`local`,prefix:t=``}={}){let n=e===`local`?`localStorage`:`sessionStorage`,r=(0,V.useMemo)(()=>Y(n),[n]);return{isAvailable:r,getItem:(0,V.useCallback)(e=>{if(!r)return null;try{return window[n].getItem(t?`${t};${e}`:e)}catch{return null}},[r,n,t]),setItem:(0,V.useCallback)((e,i)=>{if(r)try{window[n].setItem(t?`${t};${e}`:e,i)}catch{}},[r,n,t]),removeItem:(0,V.useCallback)(e=>{if(r)try{window[n].removeItem(t?`${t};${e}`:e)}catch{}},[r,n,t])}}function J(e,t,n){let{getItem:r,setItem:i,removeItem:a}=ue(n),[o,s]=(0,V.useState)(()=>fe(r(e))??t);return[o,(0,V.useCallback)(t=>{i(e,de(t)),s(t)},[e,i]),(0,V.useCallback)(()=>{a(e),s(t)},[t,e,a])]}function Y(e){let t;try{t=window[e];let n=`__storage_test__`;return t.setItem(n,n),t.removeItem(n),!0}catch(e){return e instanceof DOMException&&e.name===`QuotaExceededError`&&t&&t.length!==0}}function de(e){return typeof e==`boolean`?e?`1`:`0`:e}function fe(e){return e===`1`||e!==`0`&&e}var X=(0,V.createContext)(null);function Z(){let e=(0,V.useContext)(X);if(!e)throw Error(`useAccountFilters must be used within an AccountTimelineProvider`);return e}var pe=e=>{let t={type:`local`,prefix:`account-filters`},[n,r]=J(`boosts`,!0,t),[i,a]=J(`replies`,!1,t),o=(0,V.useCallback)(e=>{r(e)},[r]),s=(0,V.useCallback)(e=>{a(e)},[a]),[c,l]=(0,V.useState)(!1),u=(0,V.useCallback)(()=>{l(!0)},[]);return(0,V.useMemo)(()=>({accountId:e??null,boosts:n,replies:i,showAllPinned:c,setBoosts:o,setReplies:s,onShowAllPinned:u}),[e,n,o,s,u,i,c])},Q={filtersWrapper:`_feat_account_timeline__filtersWrapper`,filterSelectButton:`_feat_account_timeline__filterSelectButton`,filterSelectIcon:`_feat_account_timeline__filterSelectIcon`,filterOverlay:`_feat_account_timeline__filterOverlay`,tagsWrapper:`_feat_account_timeline__tagsWrapper`,tagSuggestions:`_feat_account_timeline__tagSuggestions`,tagsList:`_feat_account_timeline__tagsList`,tagsListShowAll:`_feat_account_timeline__tagsListShowAll`,statusWrapper:`_feat_account_timeline__statusWrapper`,pinnedViewAllButton:`_feat_account_timeline__pinnedViewAllButton`,pinnedStatusHeader:`_feat_account_timeline__pinnedStatusHeader`,pinnedBadge:`_feat_account_timeline__pinnedBadge`},me=({featured:e,...t})=>e?(0,z.jsx)(S,{...t,className:Q.pinnedStatusHeader,contentBeforeDate:(0,z.jsx)(A,{className:Q.pinnedBadge,icon:(0,z.jsx)(T,{id:`pinned`,icon:N}),label:(0,z.jsx)(r,{id:`account.timeline.pinned`,defaultMessage:`Pinned`})})}):(0,z.jsx)(S,{...t}),he=()=>{let{onShowAllPinned:e}=Z();return(0,z.jsxs)(x,{onClick:e,className:(0,le.default)(Q.pinnedViewAllButton,`focusable`),children:[(0,z.jsx)(T,{id:`pinned`,icon:N}),(0,z.jsx)(r,{id:`account.timeline.pinned.view_all`,defaultMessage:`View all pinned posts`})]})},$=class extends ae{constructor(...e){super(...e),_(this,`handleLoadOlder`,(0,L.default)(()=>{let{statusIds:e,lastId:t,onLoadMore:n}=this.props;n(t||e.findLast(e=>!d(e)))},300,{leading:!0})),_(this,`setRef`,e=>{this.node=e})}render(){let{statusIds:e,featuredStatusIds:t,onLoadMore:n,timelineId:r,statusProps:i,...a}=this.props,{isLoading:o,isPartial:s}=a;if(s)return(0,z.jsx)(B,{});let c=o||e.size>0?e.map((t,a)=>{switch(t){case p:return(0,z.jsx)(ce,{},p);case null:return(0,z.jsx)(P,{disabled:o,param:a>0?e.get(a-1):null,onClick:n},`gap:`+e.get(a+1));default:return(0,z.jsx)(C,{id:t,contextType:r,scrollKey:this.props.scrollKey,withCounters:this.props.withCounters,...i},t)}}):null;return c&&t&&(c=t.map(e=>e===`pinned-view-all`?(0,z.jsx)(he,{},h):(0,z.jsx)(C,{id:e,featured:!0,contextType:r,scrollKey:this.props.scrollKey,withCounters:this.props.withCounters,...i},`f-${e}`)).concat(c)),(0,z.jsx)(F,{...a,showLoading:o&&e.size===0,onLoadMore:n&&this.handleLoadOlder,ref:this.setRef,children:c})}};_($,`propTypes`,{scrollKey:I.default.string.isRequired,statusIds:R.default.list.isRequired,featuredStatusIds:R.default.list,onLoadMore:I.default.func,onScrollToTop:I.default.func,onScroll:I.default.func,trackScroll:I.default.bool,isLoading:I.default.bool,isPartial:I.default.bool,hasMore:I.default.bool,prepend:I.default.node,emptyMessage:I.default.node,alwaysPrepend:I.default.bool,withCounters:I.default.bool,timelineId:I.default.string.isRequired,lastId:I.default.string,bindToDocument:I.default.bool,statusProps:I.default.object,regex:I.default.string}),_($,`defaultProps`,{trackScroll:!0});export{Z as a,X as i,me as n,pe as o,Q as r,H as s,$ as t}; 2//# sourceMappingURL=status_list-ClUxwuDs.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.