1import{o as e}from"./chunk-CMxvf4Kt.js";import{n as t,t as n}from"./jsx-runtime-SsSjplwM.js";import{a as r,c as i,n as a,s as o}from"./react-intl-Cop388b4.js";import{A as s,D as c,O as l,P as u,R as d,S as f,_ as p,b as m,j as h,l as g,s as _}from"./prop-types-BTvjt2rf.js";import{$ as v,J as y,M as b,Q as x,S,at as C,ct as w,g as T,nt as E,o as D,rt as ee,x as O}from"./poll-quu7nqu0.js";import{$i as k,C as te,Cr as A,Er as ne,Lt as j,Rt as M,Tr as re,Wt as ie,ir as N,j as P,ki as F,nr as I,oa as ae,or as oe}from"./render-CHiIZYnD.js";import{c as se,s as ce,u as le}from"./react-router-BzQH59UT.js";import{s as ue}from"./router-fDCYSRG8.js";import{c as de,f as L}from"./redux-toolkit.modern-DmA8smPH.js";import{U as fe}from"./accounts_typed-DlsCBf4c.js";import{n as pe,o as R,s as z}from"./typed_functions-CyAHd4bl.js";import{n as B,r as me}from"./short_number-Coj2vPT7.js";import{an as he,in as ge,nn as _e,on as ve,rn as V,sn as ye,tn as be}from"./status_quoted-CwxV3dOE.js";import{t as xe}from"./classnames-CYxIelk8.js";import{r as Se}from"./skip_links-yojFi5rh.js";import{r as Ce}from"./utils-B468qXuV.js";import{h as we,t as Te}from"./account-DbeGfCXM.js";import{t as Ee}from"./add-COFszs2T.js";import{t as De}from"./search-Vir2O0MW.js";import{n as Oe}from"./use-gesture-react.esm-CkIoXYZ6.js";import{t as ke}from"./category-DL5xfcEw.js";import{t as Ae}from"./info-fLA8QvQj.js";import{t as je}from"./index.module-y4HS80Z2.js";import{n as Me,t as Ne}from"./keyboard_arrow_up-6cXawH9y.js";import{n as Pe,t as Fe}from"./lists-BUBIxP3-.js";import{r as Ie}from"./hashtag-tYtRfHpE.js";var H=e(xe()),U=e(t()),W=n(),Le=e=>(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,W.jsx)(`path`,{d:`M160-120v-480l320-240 320 240v480H560v-280H400v280H160Z`})}),Re=e=>(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,W.jsx)(`path`,{d:`M240-200h120v-240h240v240h120v-360L480-740 240-560v360Zm-80 80v-480l320-240 320 240v480H520v-240h-80v240H160Zm320-350Z`})}),ze=e=>(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,W.jsx)(`path`,{d:`M160-200v-80h80v-280q0-83 50-147.5T420-792v-28q0-25 17.5-42.5T480-880q25 0 42.5 17.5T540-820v28q80 20 130 84.5T720-560v280h80v80H160ZM480-80q-33 0-56.5-23.5T400-160h160q0 33-23.5 56.5T480-80Z`})}),Be=e=>(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,W.jsx)(`path`,{d:`M160-200v-80h80v-280q0-83 50-147.5T420-792v-28q0-25 17.5-42.5T480-880q25 0 42.5 17.5T540-820v28q80 20 130 84.5T720-560v280h80v80H160Zm320-300Zm0 420q-33 0-56.5-23.5T400-160h160q0 33-23.5 56.5T480-80ZM320-280h320v-280q0-66-47-113t-113-47q-66 0-113 47t-47 113v280Z`})}),Ve=e=>e>40?`40+`:e,G=({id:e,icon:t,count:n,issueBadge:r,className:i})=>(0,W.jsxs)(`i`,{className:`icon-with-badge`,children:[(0,W.jsx)(v,{id:e,icon:t,className:i}),n>0&&(0,W.jsx)(`i`,{className:`icon-with-badge__badge`,children:Ve(n)}),r&&(0,W.jsx)(`i`,{className:`icon-with-badge__issue-badge`})]}),He=(e,t,n,r)=>!e||t===`all`?r.filter(e=>e.type===`gap`||!n.includes(e.type)):r.filter(e=>e.type===`gap`||t===e.type||t===`mention`&&e.type===`quote`||t===`collection`&&(e.type===`collection_update`||e.type===`added_to_collection`)),K=L([oe,N,I,e=>e.notificationGroups.groups],He),Ue=L([oe,N,I,e=>e.notificationGroups.pendingGroups],He),We=L([e=>e.notificationGroups.lastReadId,K,Ue],(e,t,n)=>t.filter(t=>t.type!==`gap`&&t.page_max_id&&k(t.page_max_id,e)>0).length+n.filter(t=>t.type!==`gap`&&t.page_max_id&&k(t.page_max_id,e)>0).length),Ge=L([e=>e.notificationGroups.readMarkerId,K],(e,t)=>t.some(t=>t.type!==`gap`&&t.page_max_id&&k(t.page_max_id,e)>0)),Ke=L([Ue],e=>e.filter(e=>e.type!==`gap`).length),qe=e=>(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,W.jsx)(`path`,{d:`M160-80v-560q0-33 23.5-56.5T240-720h320q33 0 56.5 23.5T640-640v560L400-200 160-80Zm560-160v-560H280v-80h440q33 0 56.5 23.5T800-800v560h-80Z`})}),Je=e=>(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,W.jsx)(`path`,{d:`M160-80v-560q0-33 23.5-56.5T240-720h320q33 0 56.5 23.5T640-640v560L400-200 160-80Zm80-121 160-86 160 86v-439H240v439Zm480-39v-560H280v-80h440q33 0 56.5 23.5T800-800v560h-80ZM240-640h320-320Z`})}),Ye=e=>(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,W.jsx)(`path`,{d:`m260-520 220-360 220 360H260ZM700-80q-75 0-127.5-52.5T520-260q0-75 52.5-127.5T700-440q75 0 127.5 52.5T880-260q0 75-52.5 127.5T700-80Zm
1-580-20v-320h320v320H120Z`})}),Xe=e=>(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,W.jsx)(`path`,{d:`M720-400v-120H600v-80h120v-120h80v120h120v80H800v120h-80ZM247-527q-47-47-47-113t47-113q47-47 113-47t113 47q47 47 47 113t-47 113q-47 47-113 47t-113-47ZM40-160v-112q0-34 17.5-62.5T104-378q62-31 126-46.5T360-440q66 0 130 15.5T616-378q29 15 46.5 43.5T680-272v112H40Z`})}),Ze=e=>(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,W.jsx)(`path`,{d:`M720-400v-120H600v-80h120v-120h80v120h120v80H800v120h-80ZM247-527q-47-47-47-113t47-113q47-47 113-47t113 47q47 47 47 113t-47 113q-47 47-113 47t-113-47ZM40-160v-112q0-34 17.5-62.5T104-378q62-31 126-46.5T360-440q66 0 130 15.5T616-378q29 15 46.5 43.5T680-272v112H40Zm80-80h480v-32q0-11-5.5-20T580-306q-54-27-109-40.5T360-360q-56 0-111 13.5T140-306q-9 5-14.5 14t-5.5 20v32Zm296.5-343.5Q440-607 440-640t-23.5-56.5Q393-720 360-720t-56.5 23.5Q280-673 280-640t23.5 56.5Q327-560 360-560t56.5-23.5ZM360-640Zm0 400Z`})}),Qe=e=>(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,W.jsx)(`path`,{d:`m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z`})}),$e=e=>(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,W.jsx)(`path`,{d:`m136-240-56-56 296-298 160 160 208-206H640v-80h240v240h-80v-104L536-320 376-480 136-240Z`})}),q=o({placeholder:{id:`search.placeholder`,defaultMessage:`Search`},clearSearch:{id:`search.clear`,defaultMessage:`Clear search`},placeholderSignedIn:{id:`search.search_or_paste`,defaultMessage:`Search or paste URL`}}),et=e=>{switch(e.type){case`account`:return`@${e.q}`;case`hashtag`:return`#${e.q}`;default:return e.q}},tt=({onClick:e,hasValue:t})=>{let n=i();return(0,W.jsxs)(`div`,{className:(0,H.default)(`search__icon-wrapper`,{"has-value":t}),children:[(0,W.jsx)(v,{id:`search`,icon:De,className:`search__icon`}),(0,W.jsx)(`button`,{type:`button`,onClick:e,className:`search__icon search__icon--clear-button`,tabIndex:t?void 0:-1,"aria-hidden":!t,children:(0,W.jsx)(v,{id:`times-circle`,icon:ge,"aria-label":n.formatMessage(q.clearSearch)})})]})},nt=({singleColumn:e,initialValue:t})=>{let n=i(),o=z(e=>e.search.recent),{signedIn:c}=y(),l=R(),u=ce(),d=(0,U.useRef)(null),[f,p]=(0,U.useState)(t??``),m=f.length>0,[h,_]=(0,U.useState)(!1),[b,x]=(0,U.useState)(-1),[S,C]=(0,U.useState)([]),w=(0,U.useCallback)(()=>{document.querySelector(`.ui`)?.parentElement?.focus(),_(!1)},[]),T=(0,U.useCallback)(e=>{p(t=>t===``?e:t.endsWith(` `)?`${t}${e}`:`${t} ${e}`)},[]),E=(0,U.useMemo)(()=>s?[{key:`prompt-has`,label:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`mark`,{children:`has:`}),` `,(0,W.jsx)(a,{type:`disjunction`,value:[`media`,`poll`,`embed`]})]}),action:e=>{e.preventDefault(),T(`has:`)}},{key:`prompt-is`,label:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`mark`,{children:`is:`}),` `,(0,W.jsx)(a,{type:`disjunction`,value:[`reply`,`sensitive`]})]}),action:e=>{e.preventDefault(),T(`is:`)}},{key:`prompt-language`,label:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`mark`,{children:`language:`}),` `,(0,W.jsx)(r,{id:`search_popout.language_code`,defaultMessage:`ISO language code`})]}),action:e=>{e.preventDefault(),T(`language:`)}},{key:`prompt-from`,label:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`mark`,{children:`from:`}),` `,(0,W.jsx)(r,{id:`search_popout.user`,defaultMessage:`user`})]}),action:e=>{e.preventDefault(),T(`from:`)}},{key:`prompt-before`,label:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`mark`,{children:`before:`}),` `,(0,W.jsx)(r,{id:`search_popout.specific_date`,defaultMessage:`specific date`})]}),action:e=>{e.preventDefault(),T(`before:`)}},{key:`prompt-during`,label:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`mark`,{children:`during:`}),` `,(0,W.jsx)(r,{id:`search_popout.specific_date`,defaultMessage:`specific date`})]}),action:e=>{e.preventDefault(),T(`during:`)}},{key:`prompt-after`,label:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`mark`,{children:`after:`}),` `,(0,W.jsx)(r,{id:`search_popout.specific_date`,defaultMessage:`specific date`})]}),action:e=>{e.preventDefault(),T(`after:`)}},{key:`prompt-in`,label:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`mark`,{children:`in:`}),` `,(0,W.jsx)(a,{type:`disjunction`,value:[`all`,`library`,`public`]})]}),action:e=>{e.preventDefault(),T(`in:`)}}]:[],[T]),D=(0,U.useMemo)(()=>o.map(e=>({key:`${e.type}/${e.q}`,label:et(e),action:()=>
1{if(p(e.q),e.type===`account`)u.push(`/@${e.q}`);else if(e.type===`hashtag`)u.push(`/tags/${e.q}`);else{let t=new URLSearchParams({q:e.q});e.type&&t.set(`type`,e.type),u.push({pathname:`/search`,search:t.toString()})}w()},forget:t=>{t.stopPropagation(),l(re(e))}})),[l,u,o,w]),O=(0,U.useMemo)(()=>m?S.concat(E):D.concat(S,E),[m,S,D,E]),k=(0,U.useCallback)((e,t)=>{l(A({q:e,type:t}));let n=new URLSearchParams({q:e});t&&n.set(`type`,t),u.push({pathname:`/search`,search:n.toString()}),w()},[l,u,w]),te=(0,U.useCallback)(({target:{value:e}})=>{p(e);let t=e.trim(),n=[];t.length>0&&(t.startsWith(`https://`)&&!t.includes(` `)&&n.push({key:`open-url`,label:(0,W.jsx)(r,{id:`search.quick_action.open_url`,defaultMessage:`Open URL in Mastodon`}),action:async()=>{let e=await l(ne({url:t}));de(e)&&(e.payload.accounts[0]?u.push(`/@${e.payload.accounts[0].acct}`):e.payload.statuses[0]?u.push(`/@${e.payload.statuses[0].account.acct}/${e.payload.statuses[0].id}`):e.payload.collections[0]&&u.push(Ce(e.payload.collections[0].id))),w()}}),(t.startsWith(`#`)&&t.length>1||t.match(fe))&&n.push({key:`go-to-hashtag`,label:(0,W.jsx)(r,{id:`search.quick_action.go_to_hashtag`,defaultMessage:`Go to hashtag {x}`,values:{x:(0,W.jsxs)(`mark`,{children:[`#`,t.replace(/^#/,``)]})}}),action:()=>{let e=t.replace(/^#/,``);u.push(`/tags/${e}`),l(A({q:e,type:`hashtag`})),w()}}),/^@?[a-z0-9_-]+(@[^\s]+)?$/i.exec(t)&&n.push({key:`go-to-account`,label:(0,W.jsx)(r,{id:`search.quick_action.go_to_account`,defaultMessage:`Go to profile {x}`,values:{x:(0,W.jsxs)(`mark`,{children:[`@`,t.replace(/^@/,``)]})}}),action:()=>{let e=t.replace(/^@/,``);u.push(`/@${e}`),l(A({q:e,type:`account`})),w()}}),s&&c&&n.push({key:`status-search`,label:(0,W.jsx)(r,{id:`search.quick_action.status_search`,defaultMessage:`Posts matching {x}`,values:{x:(0,W.jsx)(`mark`,{children:t})}}),action:()=>{k(t,`statuses`)}}),n.push({key:`account-search`,label:(0,W.jsx)(r,{id:`search.quick_action.account_search`,defaultMessage:`Profiles matching {x}`,values:{x:(0,W.jsx)(`mark`,{children:t})}}),action:()=>{k(t,`accounts`)}})),C(n)},[c,l,w,u,k]),j=(0,U.useCallback)(()=>{p(``),C([]),x(-1),w()},[w]),M=(0,U.useCallback)(e=>{switch(e.key){case`Escape`:e.preventDefault(),d.current?.focus(),_(!1);break;case`ArrowDown`:e.preventDefault(),h||_(!0),O.length>0&&x(Math.min(b+1,O.length-1));break;case`ArrowUp`:e.preventDefault(),O.length>0&&x(Math.max(b-1,-1));break;case`Enter`:e.preventDefault(),b===-1?k(f):O.length>0&&O[b]?.action(e);break;case`Delete`:if(b>-1&&O.length>0){let t=O[b];typeof t?.forget==`function`&&(e.preventDefault(),t.forget(e))}break}},[h,O,b,k,f]),ie=(0,U.useCallback)(()=>{if(_(!0),x(-1),d.current&&!e){let{left:e,right:t}=d.current.getBoundingClientRect();(e<0||t>(window.innerWidth||document.documentElement.clientWidth))&&d.current.scrollIntoView()}},[_,x,e]),N=(0,U.useCallback)(()=>{x(-1)},[x]),P=(0,U.useCallback)(e=>()=>{x(e)},[]),F=(0,U.useRef)(null);(0,U.useEffect)(()=>{if(h){function e(e){let t=F.current;t&&(t===e.target||t.contains(e.target))||_(!1)}return document.addEventListener(`focusin`,e),document.addEventListener(`click`,e),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`click`,e)}}return()=>null},[h]);let I=(0,U.useId)();return(0,W.jsxs)(`form`,{role:`search`,ref:F,className:(0,H.default)(`search`,{active:h}),children:[(0,W.jsx)(`input`,{ref:d,className:`search__input`,type:`text`,inputMode:`search`,placeholder:n.formatMessage(c?q.placeholderSignedIn:q.placeholder),"aria-label":n.formatMessage(c?q.placeholderSignedIn:q.placeholder),value:f,onChange:te,onKeyDown:M,onFocus:ie,onBlur:N}),(0,W.jsx)(tt,{hasValue:m,onClick:j}),(0,W.jsxs)(`div`,{className:`search__popout`,role:`dialog`,tabIndex:-1,"aria-labelledby":I,onKeyDown:M,children:[!m&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h4`,{children:(0,W.jsx)(r,{id:`search_popout.recent`,defaultMessage:`Recent searches`})}),(0,W.jsx)(`div`,{className:`search__popout__menu`,children:D.length>0?D.map(({label:e,key:t,action:n,forget:r},i)=>(0,W.jsxs)(`div`,{tabIndex:0,role:`button`,onMouseDown:n,onFocus:P(i),className:(0,H.default)(`search__popout__menu__item search__popout__menu__item--flex`,{selected:b===i}),children:[(0,W.jsx)(`span`,{children:e}),(0,W.jsx)(`button`,{className:`icon-button`,onMouseDown:r,type:`button`,children:(0,W.jsx)(v,{id:`times`,icon:ee})})]},t)):(0,W.jsx)(`div`,{className:`search__popout__menu__message`,children:(0,W.jsx)(r,{id:`search.no_recent_searches`,defaultMessage:`No recent searches`})})})]}),S.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h4`,{children:(0,W.jsx)(r,{id:`search_popout.quick_actions`,defaultMessage:`Quick actions`})}),(0,W.jsx)(`div`,{className:`search__popout__menu`,children:S.map(({key:e,label:t,action:n},r)=>(0,W.jsx)(`button`,{onMouseDown:n,onFocus:P(r),className:(0,H.default)(`search__popout__menu__item`,{selected:b===r}),type:`button`,children:t},e))})]}),(0,W.jsx)(`h4`,{id:I,children:(0,W.jsx)(r,{id:`search_popout.options`,defaultMessage:`Search options`})}),s&&c?(0,W.jsx)(`div`,{className:`search__popout__menu`,children:E.map(({key:e,label:t,action:n},r)=>{let i=(S.length||o.length)+r;return(0,W.jsx)(`button`,{onMouseDown:n,onFocus:P(i),className:(0,H.default)(`search__popout__menu__item`,{selected:b===i}),type:`button`,children:t},e)})}):(0,W.jsx)(`div`,{className:`search__popout__menu__message`,children:s?(0,W.jsx)(r,{id:`search_popout.full_text_search_logged_out_message`,defaultMessage:`Only available when logged in.`}):(0,W.jsx)(r,{id:`search_popout.full_text_search_disabled_message`,defaultMessage:`Not available on {domain}.`,values:{domain:g}})})]})]})},J=({icon:e,activeIcon:t,iconComponent:n,activeIconComponent:r,text:i,to:a,href:o,method:s,badge:c,transparent:l,...u})=>{let d=le((typeof a==`string`?a:a?.pathname)??``),f=(0,H.default)(`column-link`,{"column-link--transparent":l}),p=c===void 0?null:(0,W.jsx)(`span`,{className:`column-link__badge`,children:c}),m=n?(0,W.jsx)(v,{id:typeof e==`string`?e:``,icon:n,className:`column-link__icon`}):e,h=t??(r?(0,W.jsx)(v,{id:typeof e==`string`?e:``,icon:r,className:`column-link__icon`}):m),g=!!d;return o?(0,W.jsxs)(`a`,{href:o,className:f,"data-method":s,...u,children:[g?h:m,(0,W.jsx)(`span`,{children:i}),p]}):a?(0,W.jsxs)(me,{to:a,className:f,...u,children:[g?h:m,(0,W.jsx)(`span`,{children:i}),p]}):null},rt=e=>(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 20 20`,...e,children:(0,W.jsx)(`path`,{fill:`currentColor`,d:`M9.2 8.525c.35 0 .646-.12.888-.363.241-.241.362-.537.362-.887s-.12-.646-.362-.888a1.207 1.207 0 0 0-.888-.362c-.35 0-.646.12-.887.362a1.207 1.207 0 0 0-.363.888c0 .35.12.646.362.887.242.242.538.363.888.363ZM18.525 20c-.7 0-1.642-.292-2.825-.875-1.183-.583-2.45-1.375-3.8-2.375a7.564 7.564 0 0 1-1.95.25C8 17 6.35 16.325 5 14.975c-1.35-1.35-2.025-3-2.025-4.95 0-.333.025-.667.075-1a9.18 9.18 0 0 1 .2-.975C2.267 6.7 1.48 5.437.888 4.262.296 3.089 0 2.15 0 1.45 0 1 .125.646.375.387.625.13.967 0 1.4 0c.433 0 .996.15 1.688.45.691.3 1.645.808 2.862 1.525-.35.183-.675.375-.975.575-.3.2-.592.417-.875.65a9.777 9.777 0 0 0-.925-.475c-.3-.133-.617-.275-.95-.425.3.633.62 1.25.962 1.85.342.6.705 1.192 1.088 1.775A6.775 6.775 0 0 1 6.7 3.8c.983-.517 2.067-.775 3.25-.775 1.95 0 3.604.68 4.963 2.038 1.358 1.358 2.037 3.012 2.037 4.962 0 1.183-.262 2.267-.787 3.25a6.89 6.89 0 0 1-2.138 2.425c.583.383 1.18.75 1.787 1.1.609.35 1.23.667 1.863.95-.133-.317-.27-.625-.413-.925-.141-.3-.304-.608-.487-.925.25-.283.475-.583.675-.9.2-.317.383-.642.55-.975.767 1.3 1.288 2.27 1.563 2.912.274.642.412 1.18.412 1.613 0 .483-.133.846-.4 1.087-.267.242-.617.363-1.05.363ZM11.7 13.025c.283 0 .52-.096.713-.287a.968.968 0 0 0 .287-.713.968.968 0 0 0-.287-.713.968.968 0 0 0-.713-.287.968.968 0 0 0-.712.287.968.968 0 0 0-.288.713c0 .283.096.52.288.713.191.191.429.287.712.287Zm1.25-3.5a.728.728 0 0 0 .75-.75.728.728 0 0 0-.75-.75.728.728 0 0 0-.75.75.728.728 0 0 0 .75.75Zm-3.275 5.45a45.451 45.451 0 0 1-2.45-2.275 39.166 39.166 0 0 1-2.25-2.45 4.944 4.944 0 0 0 1.45 3.275c.433.433.925.775 1.475 1.025.55.25 1.142.392 1.775.425Zm2.575-.525c.8-.417 1.45-1.02 1.95-1.813.5-.791.75-1.67.75-2.637 0-1.383-.487-2.558-1.462-3.525-.976-.967-2.155-1.45-3.538-1.45-.967 0-1.842.25-2.625.75a5.052 5.052 0 0 0-1.8 1.95 33.58 33.58 0 0 0 3.125 3.6 33.583 33.583 0 0 0 3.6 3.125Z`})}),it=pe([e=>e.modal.getIn([`stack`,0,`modalType`])],e=>e===`ANNUAL_REPORT`),at=()=>{let{state:e,year:t}=z(e=>e.annualReport),n=z(it),i=R(),a=(0,U.useCallback)(()=>{i(F({modalType:`ANNUAL_REPORT`,modalProps:{}}))},[i]);return!t||!e||e===`ineligible`?null:(0,W.jsxs)(`button`,{type:`button`,className:(0,H.default)(`column-link column-link--transparent`,{active:n}),onClick:a,children:[(0,W.jsx)(v,{icon:rt,id:`wrapstodon-planet`,width:`24`,height:`24`}),(0,W.jsxs)(`span`,{children:[`Wrapstodon `,t]}),(0,W.jsx)(`span`,{className:(0,H.default)(`column-link__badge`,je.navItemBadge),children:(0,W.jsx)(r,{id:`annual_report.nav_item.badge`,defaultMessage:`New`})})]})},ot=()=>{let e=z(e=>_?e.accounts.get(_):void 0),t=z(e=>f?e.accounts.get(f):void 0),n=R(),i=(0,U.useCallback)(e=>(e.preventDefault(),e.stopPropagation(),n(F({modalType:`CONFIRM_LOG_OUT`,modalProps:{}})),!1),[n]),a=(0,W.jsxs)(B,{to:`/@${e?.acct}`,children:[e?.acct,`@`,g]});return(0,W.jsxs)(`div`,{className:`sign-in-banner`,children:[(0,W.jsx)(`p`,{children:t?(0,W.jsx)(r,{id:`moved_to_account_banner.text`,defaultMessage:`Your account {disabledAccount} is currently disabled because you moved to {movedToAccount}.`,values:{disabledAccount:a,movedToAccount:(0,W.jsx)(B,{to:`/@${t.acct}`,children:t.acct.includes(`@`)?t.acct:`${t.acct}@${g}`})}}):(0,W.jsx)(r,{id:`disabled_account_banner.text`,defaultMessage:`Your account {disabledAccount} is currently disabled.`,values:{disabledAccount:a}})}),(0,W.jsx)(`a`,{href:`/auth/edit`,className:`button button--block`,children:(0,W.jsx)(r,{id:`disabled_account_banner.account_settings`,defaultMessage:`Account settings`})}),(0,W.jsx)(`button`,{type:`button`,className:`button button--block button-secondary`,onClick:i,children:(0,W.jsx)(r,{id:`confirmations.logout.confirm`,defaultMessage:`Log out`})})]})},Y=e=>(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,W.jsx)(`path`,{d:`m240-160 40-160H120l20-80h160l40-160H180l20-80h160l40-160h80l-40 160h160l40-160h80l-40 160h160l-20 80H660l-40 160h160l-20 80H600l-40 160h-80l40-160H360l-40 160h-80Zm140-240h160l40-160H420l-40 160Z`})}),st=({children:e,to:t,icon:n,iconComponent:r,activeIconComponent:i,title:a,c
1ollapseTitle:o,expandTitle:s,loading:c})=>{let[l,u]=(0,U.useState)(!1),d=(0,U.useId)(),f=(0,U.useCallback)(()=>{u(e=>!e)},[u]);return(0,W.jsxs)(`li`,{className:`navigation-panel__list-panel`,children:[(0,W.jsxs)(`div`,{className:`navigation-panel__list-panel__header`,children:[(0,W.jsx)(J,{transparent:!0,to:t,icon:n,iconComponent:r,activeIconComponent:i,text:a,id:`${d}-title`}),(c||e.length>0)&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`navigation-panel__list-panel__header__sep`}),(0,W.jsx)(x,{icon:`down`,expanded:l,iconComponent:c?E:l?Ne:Me,title:l?o:s,onClick:f,ariaControls:`${d}-content`})]})]}),e.length>0&&l&&(0,W.jsx)(`div`,{className:`navigation-panel__list-panel__items`,role:`region`,id:`${d}-content`,"aria-labelledby":`${d}-title`,children:e})]})},X=o({followedTags:{id:`navigation_bar.followed_tags`,defaultMessage:`Followed hashtags`},expand:{id:`navigation_panel.expand_followed_tags`,defaultMessage:`Expand followed hashtags menu`},collapse:{id:`navigation_panel.collapse_followed_tags`,defaultMessage:`Collapse followed hashtags menu`}}),ct=4,lt=()=>{let e=i(),t=R(),{tags:n,stale:r,loading:a}=z(e=>e.followedTags);return(0,U.useEffect)(()=>{r&&t(te())},[t,r]),(0,W.jsx)(st,{to:`/followed_tags`,icon:`hashtag`,iconComponent:Y,title:e.formatMessage(X.followedTags),collapseTitle:e.formatMessage(X.collapse),expandTitle:e.formatMessage(X.expand),loading:a,children:n.slice(0,ct).map(e=>(0,W.jsx)(J,{transparent:!0,icon:`hashtag`,iconComponent:Y,text:`#${e.name}`,to:`/tags/${e.name}`},e.name))})},ut=e=>(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,W.jsx)(`path`,{d:`M348.5-291.5Q360-303 360-320t-11.5-28.5Q337-360 320-360t-28.5 11.5Q280-337 280-320t11.5 28.5Q303-280 320-280t28.5-11.5Zm0-160Q360-463 360-480t-11.5-28.5Q337-520 320-520t-28.5 11.5Q280-497 280-480t11.5 28.5Q303-440 320-440t28.5-11.5Zm0-160Q360-623 360-640t-11.5-28.5Q337-680 320-680t-28.5 11.5Q280-657 280-640t11.5 28.5Q303-600 320-600t28.5-11.5ZM440-280h240v-80H440v80Zm0-160h240v-80H440v80Zm0-160h240v-80H440v80ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z`})}),Z=o({lists:{id:`navigation_bar.lists`,defaultMessage:`Lists`},expand:{id:`navigation_panel.expand_lists`,defaultMessage:`Expand list menu`},collapse:{id:`navigation_panel.collapse_lists`,defaultMessage:`Collapse list menu`}}),dt=()=>{let e=i(),t=R(),n=z(e=>Fe(e)),[r,a]=(0,U.useState)(!0);return(0,U.useEffect)(()=>{t(ie()).then(()=>(a(!1),``))},[t]),(0,W.jsx)(st,{to:`/lists`,icon:`list-ul`,iconComponent:Pe,activeIconComponent:ut,title:e.formatMessage(Z.lists),collapseTitle:e.formatMessage(Z.collapse),expandTitle:e.formatMessage(Z.expand),loading:r,children:n.map(e=>(0,W.jsx)(J,{icon:`list-ul`,iconComponent:Pe,activeIconComponent:ut,text:e.title,to:`/lists/${e.id}`,transparent:!0},e.id))})},Q=o({blocks:{id:`navigation_bar.blocks`,defaultMessage:`Blocked users`},domainBlocks:{id:`navigation_bar.domain_blocks`,defaultMessage:`Blocked domains`},mutes:{id:`navigation_bar.mutes`,defaultMessage:`Muted users`},filters:{id:`navigation_bar.filters`,defaultMessage:`Muted words`},administration:{id:`navigation_bar.administration`,defaultMessage:`Administration`},moderation:{id:`navigation_bar.moderation`,defaultMessage:`Moderation`},logout:{id:`navigation_bar.logout`,defaultMessage:`Logout`},automatedDeletion:{id:`navigation_bar.automated_deletion`,defaultMessage:`Automated post deleti
1on`},accountSettings:{id:`navigation_bar.account_settings`,defaultMessage:`Password and security`},importExport:{id:`navigation_bar.import_export`,defaultMessage:`Import and export`},privacyAndReach:{id:`navigation_bar.privacy_and_reach`,defaultMessage:`Privacy and reach`}}),ft=()=>{let e=i(),{permissions:t}=y(),n=R();return(0,W.jsx)(T,{items:(0,U.useMemo)(()=>{let r=[{href:`/filters`,text:e.formatMessage(Q.filters)},{to:`/mutes`,text:e.formatMessage(Q.mutes)},{to:`/blocks`,text:e.formatMessage(Q.blocks)},{to:`/domain_blocks`,text:e.formatMessage(Q.domainBlocks)},null,{href:`/settings/privacy`,text:e.formatMessage(Q.privacyAndReach)},{href:`/statuses_cleanup`,text:e.formatMessage(Q.automatedDeletion)},{href:`/auth/edit`,text:e.formatMessage(Q.accountSettings)},{href:`/settings/export`,text:e.formatMessage(Q.importExport)}];return be(t)&&r.push(null,{href:`/admin/reports`,text:e.formatMessage(Q.moderation)}),_e(t)&&r.push({href:`/admin/dashboard`,text:e.formatMessage(Q.administration)}),r.push(null,{text:e.formatMessage(Q.logout),action:()=>{n(F({modalType:`CONFIRM_LOG_OUT`,modalProps:{}}))}}),r},[e,n,t]),placement:`bottom-start`,children:(0,W.jsxs)(`button`,{className:`column-link column-link--transparent`,type:`button`,children:[(0,W.jsx)(v,{id:``,icon:he,className:`column-link__icon`}),(0,W.jsx)(r,{id:`navigation_bar.more`,defaultMessage:`More`})]})})},pt=()=>{let e=R(),t=(0,U.useCallback)(()=>e(F({modalType:`CLOSED_REGISTRATIONS`,modalProps:{}})),[e]),n,i=z(e=>e.server.server.item?.registrations.url??`/auth/sign_up`);return u?(0,W.jsxs)(`div`,{className:`sign-in-banner`,children:[(0,W.jsx)(`p`,{children:(0,W.jsx)(`strong`,{children:(0,W.jsx)(r,{id:`sign_in_banner.mastodon_is`,defaultMessage:`Mastodon is the best way to keep up with what's happening.`})})}),(0,W.jsx)(`p`,{children:(0,W.jsx)(r,{id:`sign_in_banner.follow_anyone`,defaultMessage:`Follow anyone across the fediverse and see it all in chronological order. No algorithms, ads, or clickbait in sight.`})}),(0,W.jsx)(`a`,{href:u,"data-method":`post`,className:`button button--block button-secondary`,children:(0,W.jsx)(r,{id:`sign_in_banner.sso_redirect`,defaultMessage:`Login or Register`})})]}):(n=c?(0,W.jsx)(`a`,{href:i,className:`button button--block`,children:(0,W.jsx)(r,{id:`sign_in_banner.create_account`,defaultMessage:`Create account`})}):(0,W.jsx)(`button`,{className:`button button--block`,onClick:t,type:`button`,children:(0,W.jsx)(r,{id:`sign_in_banner.create_account`,defaultMessage:`Create account`})}),(0,W.jsxs)(`div`,{className:`sign-in-banner`,children:[(0,W.jsx)(`p`,{children:(0,W.jsx)(`strong`,{children:(0,W.jsx)(r,{id:`sign_in_banner.mastodon_is`,defaultMessage:`Mastodon is the best way to keep up with what's happening.`})})}),(0,W.jsx)(`p`,{children:(0,W.jsx)(r,{id:`sign_in_banner.follow_anyone`,defaultMessage:`Follow anyone across the fediverse and see it all in chronological order. No algorithms, ads, or clickbait in sight.`})}),n,(0,W.jsx)(`a`,{href:`/auth/sign_in`,className:`button button--block button-secondary`,children:(0,W.jsx)(r,{id:`sign_in_banner.sign_in`,defaultMessage:`Login`})})]}))},mt=()=>{let e=R(),t=z(e=>e.trends.getIn([`tags`,`items`]));return(0,U.useEffect)(()=>{e(P());let t=setInterval(()=>{e(P())},900*1e3);return()=>{clearInterval(t)}},[e]),!h||t.isEmpty()?null:(0,W.jsx)(`aside`,{className:`navigation-panel__portal`,children:(0,W.jsxs)(`div`,{className:`getting-started__trends`,children:[(0,W.jsx)(`h2`,{className:`getting-started__trends-heading`,children:(0,W.jsx)(B,{to:`/explore/tags`,children:(0,W.jsx)(r,{id:`trends.trending_now`,defaultMessage:`Trending now`})})}),t.take(4).map(e=>(0,W.jsx)(Ie,{hashtag:e},e.get(`name`)))]})})},$=o({home:{id:`tabs_bar.home`,defaultMessage:`Home`},notifications:{id:`tabs_bar.notifications`,defaultMessage:`Notifications`},explore:{id:`explore.title`,defaultMessage:`Trending`},firehose:{id:`column.firehose`,defaultMessage:`Live feeds`},firehose_singular:{id:`column.firehose_singular`,defaultMessage:`Live feed`},main:{id:`navigation_bar.main`,defaultMessage:`Main`},direct:{id:`navigation_bar.direct`,defaultMessage:`Private mentions`},favourites:{id:`navigation_bar.favourites`,defaultMessage:`Favorites`},bookmarks:{id:`navigation_bar.bookmarks`,defaultMessage:`Bookmarks`},collections:{id:`navigation_bar.collections`,defaultMessage:`Collections`},preferences:{id:`navigation_bar.preferences`,defaultMessage:`Preferences`},followsAndFollowers:{id:`navigation_bar.follows_and_followers`,defaultMessage:`Follows and followers`},about:{id:`navigation_bar.about`,defaultMessage:`About`},search:{id:`navigation_bar.search`,defaultMessage:`Search`},searchTrends:{id:`navigation_bar.search_trends`,defaultMessage:`Search / Trending`},advancedInterface:{id:`navigation_bar.advanced_interface`,defaultMessage:`Open in advanced web interface`},openedInClassicInterface:{id:`navigation_bar.opened_in_classic_interface`,defaultMessage:`Posts, accounts, and other specific pages are opened by default in the classic web interface.`},followRequests:{id:`navigation_bar.follow_requests`,defaultMessage:`Follow requests`},logout:{id:`navigation_bar.logout`,defaultMessage:`Logout`},compose:{id:`tabs_bar.publish`,defaultMessage:`New Post`}}),ht=()=>{let e=z(We),t=i();return(0,W.jsx)(J,{transparent:!0,to:`/notifications`,icon:(0,W.jsx)(G,{id:`bell`,icon:Be,count:e,className:`column-link__icon`}),activeIcon:(0,W.jsx)(G,{id:`bell`,icon:ze,count:e,className:`column-link__icon`}),text:t.formatMessage($.notifications)},`notifications`)},gt=()=>{let e=i(),t=z(e=>e.user_lists.getIn([`follow_requests`,`items`])?.size??0),n=R();return(0,U.useEffect)(()=>{n(ae())},[n]),t===0?null:(0,W.jsx)(J,{transparent:!0,to:`/follow_requests`,icon:(0,W.jsx)(G,{id:`user-plus`,icon:Ze,count:t,className:`column-link__icon`}),activeIcon:(0,W.jsx)(G,{id:`user-plus`,icon:Xe,count:t,className:`column-link__icon`}),text:e.formatMessage($.followRequests)})},_t=()=>m?(0,W.jsx)(`div`,{className:`navigation-bar`,children:(0,W.jsx)(Te,{id:m,minimal:!0,size:36})}):null,vt=(e,{pathname:t})=>!!e||t.startsWith(`/public`),yt=284,bt=({multiColumn:e=!1})=>{let t=i(),{signedIn:n,permissions:r,disabledAccountId:a}=y(),o=se(),s=we(`full`)&&!e,c=b(m),u;return ue&&(u=(0,W.jsxs)(`div`,{className:`switch-to-advanced`,children:[t.formatMessage($.openedInClassicInterface),` `,(0,W.jsx)(`a`,{href:`/deck${o.pathname}`,className:`switch-to-advanced__toggle`,children:t.formatMessage($.advancedInterface)})]})),(0,W.jsxs)(`nav`,{className:`navigation-panel`,"aria-label":t.formatMessage($.main),children:[(0,W.jsx)(`div`,{className:`navigation-panel__logo`,children:(0,W.jsx)(B,{to:`/`,className:`column-link column-link--logo`,id:Se(),children:(0,W.jsx)(D,{})})}),s&&(0,W.jsx)(nt,{singleColumn:!0}),!e&&(0,W.jsx)(_t,{}),u&&(0,W.jsx)(`div`,{className:`navigation-panel__banner`,children:u}),(0,W.jsxs)(`ul`,{className:`navigation-panel__menu`,children:[n&&(0,W.jsxs)(W.Fragment,{children:[!e&&(0,W.jsx)(`li`,{children:(0,W.jsx)(J,{to:{pathname:`/publish`,state:{focusTarget:!1}},icon:`plus`,iconComponent:Ee,activeIconComponent:Ee,text:t.formatMessage($.compose),className:`button navigation-panel__compose-button`})}),(0,W.jsx)(`li`,{children:(0,W.jsx)(J,{transparent:!0,to:`/home`,icon:`home`,iconComponent:Re,activeIconComponent:Le,text:t.formatMessage($.home)})})]}),d&&(0,W.jsx)(`li`,{children:(0,W.jsx)(J,{transparent:!0,to:`/explore`,icon:`explore`,iconComponent:$e,text:t.formatMessage($.explore)})}),(V(n,r,p)||V(n,r,l))&&(0,W.jsx)(`li`,{children:(0,W.jsx)(J,{transparent:!0,to:V(n,r,p)?`/public/local`:`/public/remote`,icon:`globe`,iconComponent:ve,isActive:vt,text:t.formatMessage(V(n,r,p)&&V(n,r,l)?$.firehose:$.firehose_singular)})}),n&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`li`,{children:(0,W.jsx)(ht,{})}),(0,W.jsx)(`li`,{children:(0,W.jsx)(gt,{})}),(0,W.jsx)(`li`,{children:(0,W.jsx)(at,{})}),(0,W.jsx)(`li`,{role:`separator`}),(0,W.jsx)(dt,{}),(0,W.jsx)(lt,{}),(0,W.jsx)(`li`,{children:(0,W.jsx)(J,{transparent:!0,to:`/favourites`,icon:`star`,iconComponent:O,activeIconComponent:S,text:t.formatMessage($.favourites)})}),(0,W.jsx)(`li`,{children:(0,W.jsx)(J,{transparent:!0,to:`/bookmarks`,icon:`bookmarks`,iconComponent:Je,activeIconComponent:qe,text:t.formatMessage($.bookmarks)})}),(0,W.jsx)(`li`,{children:(0,W.jsx)(J,{transparent:!0,to:`/@${c?.acct}/collections`,icon:`collections`,iconComponent:ke,activeIconComponent:Ye,text:t.formatMessage($.collections)})}),(0,W.jsx)(`li`,{children:(0,W.jsx)(J,{transparent:!0,to:`/conversations`,icon:`at`,iconComponent:ye,text:t.formatMessage($.direct)})}),(0,W.jsx)(`li`,{role:`separator`}),(0,W.jsx)(`li`,{children:(0,W.jsx)(J,{transparent:!0,href:`/settings/preferences`,icon:`cog`,iconComponent:Qe,text:t.formatMessage($.preferences)})}),(0,W.jsx)(`li`,{children:(0,W.jsx)(ft,{})})]}),(0,W.jsx)(`li`,{className:`navigation-panel__legal`,children:(0,W.jsx)(J,{transparent:!0,to:`/about`,icon:`ellipsis-h`,iconComponent:Ae,text:t.formatMessage($.about)})}),!n&&(0,W.jsxs)(`li`,{className:`navigation-panel__sign-in-banner`,children:[(0,W.jsx)(`hr`,{}),a?(0,W.jsx)(ot,{}):(0,W.jsx)(pt,{})]})]}),(0,W.jsx)(`div`,{className:`flex-spacer`}),(0,W.jsx)(mt,{})]})},xt=()=>{let e=z(e=>
1e.navigation.open),t=R(),n=we(`openable`),r=se(),i=(0,U.useRef)(null);(0,U.useEffect)(()=>{t(j())},[t,r]),(0,U.useEffect)(()=>{let e=e=>{i.current&&e.target===i.current&&t(j())},n=e=>{e.key===`Escape`&&t(j())};return document.addEventListener(`click`,e),document.addEventListener(`keyup`,n),()=>{document.removeEventListener(`click`,e),document.removeEventListener(`keyup`,n)}},[t]);let a=getComputedStyle(document.body).direction!==`rtl`,o=a?yt:-284,[{x:s},c]=w(()=>({x:e?0:o,onRest:{x({value:e}){e===0?t(M()):e===o&&t(j())}}}),[e]),l=Oe(({last:e,offset:[t],velocity:[n],direction:[r],cancel:i})=>{let s=a?r:-r,l=a?t:-t;l<-70&&i(),e?l>yt/2||n>.5&&s>0?c.start({x:o}):c.start({x:0}):c.start({x:t,immediate:!0})},{from:()=>[s.get(),0],axis:`x`,filterTaps:!0,bounds:a?{left:0}:{right:0},rubberband:!0,enabled:n}),u=(0,U.useRef)();return(0,U.useEffect)(()=>{if(e){let e=document.querySelector(`.navigation-panel__menu .column-link`);u.current=document.activeElement,e?.focus()}else u.current?.focus()},[e]),(0,W.jsx)(`div`,{className:(0,H.default)(`columns-area__panels__pane columns-area__panels__pane--start columns-area__panels__pane--navigational`,{"columns-area__panels__pane--overlay":n&&e}),ref:i,children:(0,W.jsx)(C.div,{className:`columns-area__panels__pane__inner`,...l(),style:n?{x:s}:void 0,children:(0,W.jsx)(bt,{})})})};export{ze as _,$e as a,Xe as c,Ge as d,K as f,Be as g,G as h,nt as i,Ye as l,We as m,bt as n,Qe as o,Ke as p,Y as r,Ze as s,xt as t,qe as u,Re as v,Le as y}; 2//# sourceMappingURL=navigation_panel-Cjycl1GS.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.