1var Ee=Object.defineProperty;var Te=(t,s,i)=>s in t?Ee(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i;var te=(t,s,i)=>Te(t,typeof s!="symbol"?s+"":s,i);import{j as e}from"./client-wT6vtYO_.js";import{r as d,u as R,d as k,i as Be}from"./index-BdTwX--g.js";import{H as $e}from"./Helmet-BPcSXOin.js";import{i as fe}from"./isEqual-DYq4e33S.js";import{c as O}from"./index.module-sM2fS0Fl.js";import{a as Le,b as De,s as Ge,c as He,S as Oe}from"./notifications-D6d4zlVK.js";import{a as p,co as pe,I as _,u as N,cp as se,cq as B,aG as F,b as U,w as Ze,i as Ue,af as me,cr as ie,cs as ge,G as ze,ct as he,cu as xe,cv as We,A as Ke,aO as Qe,cw as Ve,cx as Ye,S as Xe,cy as Je,$ as et,aX as tt,aY as st,a7 as _e,cz as it,cA as ot,b3 as nt,cB as at,aQ as lt,aP as rt,cC as oe,cD as ct,cE as dt,cF as ut,cG as Z,cH as ne,cI as ft,aa as pt,cJ as mt,cK as gt,cL as ht,v as xt,l as _t,b5 as jt}from"./useSelectableClick-WdJOc2OV.js";import{N as bt}from"./not_signed_in_indicator-CCzEFwYn.js";import{C as vt}from"./column-B4vwzadM.js";import{S as wt,m as Mt,C as yt}from"./column_header-BVb6uVLl.js";import{L as Nt}from"./load_gap-C8Ilzj1O.js";import{S as Pt}from"./scrollable_list-DCdp5hl-.js";import{c as St,L as E,S as Ct}from"./short_number-w3W5phxu.js";import{S as je}from"./inventory_2-Cl3pumXb.js";import{M as a}from"./message-UFwkQlnu.js";import{S as be}from"./close-BsPe8EbX.js";import{B as kt}from"./index-DNYQR-Vo.js";import{changeAlerts as ae}from"./push_notifications-index-DWiFAOvi.js";import{P as le,d as re}from"./permissions-CJkLQvs0.js";import{P as It}from"./policy_controls-B6M62s40.js";import{S as r}from"./setting_toggle-CPE-EXqi.js";import{i as z}from"./index.es-DT5ZLSyE.js";import{c as $}from"./index-DizoKcfL.js";import{S as At,M as Rt,R as qt}from"./relationships_severance_event-DlUUDob9.js";import{R as ve}from"./index-DgPXgYyr.js";import{S as W}from"./person_add-fill-D1U4oKl8.js";import{A as Ft}from"./avatar_group-PUipFlog.js";import{D as we}from"./status-DMyGy685.js";import{E as Et}from"./embedded_status-BH9VLe_T.js";import{F as Tt}from"./counters-BJ0cOeaq.js";import{F as Bt}from"./follow_button-u41r49wa.js";import{m as K}from"./initial_state-CaZA8Ule.js";import{ae as $t}from"./content_warning-X_Ok2zt6.js";import{S as Lt}from"./status_quoted-Dpqa_0mb.js";import{S as Dt}from"./embedded_status_content-CTmx_BJU.js";import{S as Gt}from"./notifications_active-fill-Bd5B72X1.js";import{S as Ht}from"./edit-Cyfwv5F_.js";import{S as Ot}from"./home-fill-BjwEpYg3.js";import{S as Zt}from"./insert_chart-BTwnuSdd.js";import{S as Ut}from"./person_add-Bq7Kcwwn.js";import"./api-BktM5Ego.js";import"./index-C37WzBb4.js";import"./ready-DpOgoWSg.js";import"./load_locale-BIt-_LAH.js";import"./scroll-BygYx8ga.js";import"./add-D8GR9P00.js";import"./chevron_left-CnYIoVsW.js";import"./loading_indicator-DeCSDQDQ.js";import"./scroll_container-j4wtOYuG.js";import"./react-router-scroll-4.es-DPJQ51nu.js";import"./interopRequireDefault-CdiRfGvq.js";import"./schedule_idle_task-Co3Ydhdu.js";import"./load_more-CdbAfVjI.js";import"./numbers-CGZQWBYL.js";import"./dropdown_selector-Ct4HVhrr.js";import"./info-HtHaDKcq.js";import"./index-DrhF_iyj.js";import"./card-CP-kzThV.js";import"./logo-D6Accnpz.js";import"./avatar_overlay-jXF_p4KI.js";import"./toString-Bsgmptud.js";import"./status_content-Di5eilCw.js";import"./poll-BEQimZ31.js";import"./visibility_icon-iafPHe3c.js";import"./skeleton-D9NbTYr9.js";import"./domain_blocks-CdxSDicm.js";import"./reports-BVf3k8fk.js";const zt=t=>d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...t},d.createElement("path",{d:"M268-240 42-466l57-56 170 170 56 56-57 56Zm226 0L268-466l56-57 170 170 368-368 56 57-424 424Zm0-226-57-56 198-198 57 56-198 198Z"})),ce=k({filteredNotifications:{id:"notification_requests.title",defaultMessage:"Filtered notifications"}}),Wt=({className:t})=>{const s=R(),i=St(),n=p(u=>u.notificationPolicy),o=p(pe),c=d.useCallback(()=>{i.push("/notifications/requests")},[i]);return n===null||n.summary.pending_requests_count<=0||!o?null:e.jsx("button",{"aria-label":s.formatMessage(ce.filteredNotifications),title:s.formatMessage(ce.filteredNotifications),onClick:c,className:t,children:e.jsx(_,{id:"filtered-notifications",icon:je})})},Kt=()=>{const t=N(),s=p(n=>n.notificationPolicy),i=p(pe);return d.useEffect(()=>{t(se());const n=setInterval(()=>{t(se())},12e4);return()=>{clearInterval(n)}},[t]),s===null||s.summary.pending_requests_count<=0||i?null:e.jsxs(E,{className:"filtered-notifications-banner",to:"/notifications/requests",children:[e.jsx("div",{className:"notification-group__icon",children:e.jsx(_,{icon:je,id:"filtered-notifications"})}),e.jsxs("div",{className:"filtered-notifications-banner__text",children:[e.jsx("strong",{children:e.jsx(a,{id:"filtered_notifications_banner.title",defaultMessage:"Filtered notifications"})}),e.jsx("span",{children:e.jsx(a,{id:"filtered_notifications_banner.pending_requests",defaultMessage:"From {count, plural, =0 {no one} one {one person} other {# people}} you may know",values:{count:s.summary.pending_requests_count}})})]})]})},Qt=k({close:{id:"lightbox.close",defaultMessage:"Close"}}),Vt=()=>{const t=R(),s=N(),i=d.useCallback(()=>{s(B())},[s]),n=d.useCallback(()=>{s(F(["notifications","dismissPermissionBanner"],!0))},[s]);return e.jsxs("div",{className:"notifications-permission-banner",children:[e.jsx("div",{className:"notifications-permission-banner__close",children:e.jsx(U,{icon:"times",iconComponent:be,onClick:n,title:t.formatMessage(Qt.close)})}),e.jsx("h2",{children:e.jsx(a,{id:"notifications_permission_banner.title",defaultMessage:"Never miss a thing"})}),e.jsx("p",{children:e.jsx(a,{id:"notifications_permission_banner.how_to_control",defaultMessage:"To receive notifications when Mastodon isn't open, enable desktop notifications. You can control precisely which types of interactions generate desktop notifications through the {icon} button above once they're enabled.",values:{icon:e.jsx(_,{id:"sliders",icon:wt,"aria-label":t.formatMessage(Mt.show)})}})}),e.jsx(kt,{onClick:i,children:e.jsx(a,{id:"notifications_permission_banner.enable",defaultMessage:"Enable desktop notifications"})})]})},Yt=t=>d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...t},d.createElement("path",{d:"m376-300 104-104 104 104 56-56-104-104 104-104-56-56-104 104-104-104-56 56 104 104-104 104 56 56Zm-96 180q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520Zm-400 0v520-520Z"}));class Xt extends d.PureComponent{render(){return e.jsxs("button",{className:"text-btn column-header__setting-btn",tabIndex:0,onClick:this.props.onClick,children:[e.jsx(_,{id:"eraser",icon:Yt})," ",e.jsx(a,{id:"notifications.clear",defaultMessage:"Clear notifications"})]})}}class Jt extends d.PureComponent{render(){return e.jsx("button",{className:"text-btn column-header__permission-btn",tabIndex:0,onClick:this.props.onClick,children:e.jsx(a,{id:"notifications.grant_permission",defaultMessage:"Grant permission."})})}}class es extends d.PureComponent{constructor(){super(...arguments);te(this,"onPushChange",(i,n)=>{this.props.onChange(["push",...i],n)})}render(){const{settings:i,pushSettings:n,onChange:o,onClear:c,alertsEnabled:u,browserSupport:g,browserPermission:l,onRequestNotificationPermission:b}=this.props,M=e.jsx(a,{id:"notifications.column_settings.filter_bar.advanced",defaultMessage:"Display all categories"}),P=e.jsx(a,{id:"notifications.column_settings.unread_notifications.highlight",defaultMessage:"Highlight unread notifications"}),h=e.jsx(a,{id:"notifications.column_settings.alert",defaultMessage:"Desktop notifications"}),x=e.jsx(a,{id:"notifications.column_settings.show",defaultMessage:"Show in column"}),j=e.jsx(a,{id:"notifications.column_settings.sound",defaultMessage:"Play sound"}),S=e.jsx(a,{id:"notifications.column_settings.group",defaultMessage:"Group"}),m=n.get("browserSupport")&&n.get("isSubscribed"),v=m&&e.jsx(a,{id:"notifications.column_settings.push",defaultMessage:"Push notifications"});return e.jsxs("div",{className:"column-settings",children:[e.jsx("section",{children:e.jsx(Xt,{onClick:c})}),u&&g&&l==="denied"&&e.jsx("section",{children:e.jsx("span",{className:"warning-hint",children:e.jsx(a,{id:"notifications.permission_denied",defaultMessage:"Desktop notifications are unavailable due to previously denied browser permissions request"})})}),u&&g&&l==="default"&&e.jsx("section",{children:e.jsxs("span",{className:"warning-hint",children:[e.jsx(a,{id:"notifications.permission_required",defaultMessage:"Desktop notifications are unavailable because the required permission has not been granted."})," ",e.jsx(Jt,{onClick:b})]})}),e.jsx(It,{}),e.jsxs("section",{role:"group","aria-labelledby":"notifications-unread-markers",children:[e.jsx("h3",{id:"notifications-unread-markers",children:e.jsx(a,{id:"notifications.column_settings.unread_notifications.category",defaultMessage:"Unread notifications"})}),e.jsx("div",{className:"column-settings__row",children:e.jsx(r,{id:"unread-notification-markers",prefix:"notifications",settings:i,settingPath:["showUnread"],onChange:o,label:P})})]}),e.jsxs("section",{role:"group","aria-labelledby":"notifications-filter-bar",children:[e.jsx("h3",{id:"notifications-filter-bar",children:e.jsx(a,{id:"notifications.column_settings.filter_bar.category",defaultMessage:"Quick filter bar"})}),e.jsx("div",{className:"column-settings__row",children:e.jsx(r,{id:"advanced-filter-bar",prefix:"notifications",settings:i,settingPath:["quickFilter","advanced"],onChange:o,label:M})})]}),e.jsxs("section",{role:"group","aria-labelledby":"notifications-follow",children:[e.jsx("h3",{id:"notifications-follow",children:e.jsx(a,{id:"notifications.column_settings.follow",defaultMessage:"New followers:"})}),e.jsxs("div",{className:"column-settings__row",children:[e.jsx(r,{disabled:l==="denied",prefix:"notifications_desktop",settings:i,settingPath:["alerts","follow"],onChange:o,label:h}),m&&e.jsx(r,{prefix:"notifications_push",settings:n,settingPath:["alerts","follow"],onChange:this.onPushChange,label:v}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["shows","follow"],onChange:o,label:x}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["sounds","follow"],onChange:o,label:j}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["group","follow"],onChange:o,label:S})]})]}),e.jsxs("section",{role:"group","aria-labelledby":"notifications-follow-request",children:[e.jsx("h3",{id:"notifications-follow-request",children:e.jsx(a,{id:"notifications.column_settings.follow_request",defaultMessage:"New follow requests:"})}),e.jsxs("div",{className:"column-settings__row",children:[e.jsx(r,{disabled:l==="denied",prefix:"notifications_desktop",settings:i,settingPath:["alerts","follow_request"],onChange:o,label:h}),m&&e.jsx(r,{prefix:"notifications_push",settings:n,settingPath:["alerts","follow_request"],onChange:this.onPushChange,label:v}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["shows","follow_request"],onChange:o,label:x}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["sounds","follow_request"],onChange:o,label:j})]})]}),e.jsxs("section",{role:"group","aria-labelledby":"notifications-favourite",children:[e.jsx("h3",{id:"notifications-favourite",children:e.jsx(a,{id:"notifications.column_settings.favourite",defaultMessage:"Favorites:"})}),e.jsxs("div",{className:"column-settings__row",children:[e.jsx(r,{disabled:l==="denied",prefix:"notifications_desktop",settings:i,settingPath:["alerts","favourite"],onChange:o,label:h}),m&&e.jsx(r,{prefix:"notifications_push",settings:n,settingPath:["alerts","favourite"],onChange:this.onPushChange,label:v}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["shows","favourite"],onChange:o,label:x}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["sounds","favourite"],onChange:o,label:j})]})]}),e.jsxs("section",{role:"group","aria-labelledby":"notifications-mention",children:[e.jsx("h3",{id:"notifications-mention",children:e.jsx(a,{id:"notifications.column_settings.mention",defaultMessage:"Mentions:"})}),e.jsxs("div",{className:"column-settings__row",children:[e.jsx(r,{disabled:l==="denied",prefix:"notifications_desktop",settings:i,settingPath:["alerts","mention"],onChange:o,label:h}),m&&e.jsx(r,{prefix:"notifications_push",settings:n,settingPath:["alerts","mention"],onChange:this.onPushChange,label:v}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["shows","mention"],onChange:o,label:x}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["sounds","mention"],onChange:o,label:j})]})]}),e.jsxs("section",{role:"group","aria-labelledby":"notifications-reblog",children:[e.jsx("h3",{id:"notifications-reblog",children:e.jsx(a,{id:"notifications.column_settings.reblog",defaultMessage:"Boosts:"})}),e.jsxs("div",{className:"column-settings__row",children:[e.jsx(r,{disabled:l==="denied",prefix:"notifications_desktop",settings:i,settingPath:["alerts","reblog"],onChange:o,label:h}),m&&e.jsx(r,{prefix:"notifications_push",settings:n,settingPath:["alerts","reblog"],onChange:this.onPushChange,label:v}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["shows","reblog"],onChange:o,label:x}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["sounds","reblog"],onChange:o,label:j})]})]}),e.jsxs("section",{role:"group","aria-labelledby":"notifications-poll",children:[e.jsx("h3",{id:"notifications-poll",children:e.jsx(a,{id:"notifications.column_settings.poll",defaultMessage:"Poll results:"})}),e.jsxs("div",{className:"column-settings__row",children:[e.jsx(r,{disabled:l==="denied",prefix:"notifications_desktop",settings:i,settingPath:["alerts","poll"],onChange:o,label:h}),m&&e.jsx(r,{prefix:"notifications_push",settings:n,settingPath:["alerts","poll"],onChange:this.onPushChange,label:v}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["shows","poll"],onChange:o,label:x}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["sounds","poll"],onChange:o,label:j})]})]}),e.jsxs("section",{role:"group","aria-labelledby":"notifications-status",children:[e.jsx("h3",{id:"notifications-status",children:e.jsx(a,{id:"notifications.column_settings.status",defaultMessage:"New posts:"})}),e.jsxs("div",{className:"column-settings__row",children:[e.jsx(r,{disabled:l==="denied",prefix:"notifications_desktop",settings:i,settingPath:["alerts","status"],onChange:o,label:h}),m&&e.jsx(r,{prefix:"notifications_push",settings:n,settingPath:["alerts","status"],onChange:this.onPushChange,label:v}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["shows","status"],onChange:o,label:x}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["sounds","
1status"],onChange:o,label:j})]})]}),e.jsxs("section",{role:"group","aria-labelledby":"notifications-update",children:[e.jsx("h3",{id:"notifications-update",children:e.jsx(a,{id:"notifications.column_settings.update",defaultMessage:"Edits:"})}),e.jsxs("div",{className:"column-settings__row",children:[e.jsx(r,{disabled:l==="denied",prefix:"notifications_desktop",settings:i,settingPath:["alerts","update"],onChange:o,label:h}),m&&e.jsx(r,{prefix:"notifications_push",settings:n,settingPath:["alerts","update"],onChange:this.onPushChange,label:v}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["shows","update"],onChange:o,label:x}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["sounds","update"],onChange:o,label:j})]})]}),(this.props.identity.permissions&le)===le&&e.jsxs("section",{role:"group","aria-labelledby":"notifications-admin-sign-up",children:[e.jsx("h3",{id:"notifications-status",children:e.jsx(a,{id:"notifications.column_settings.admin.sign_up",defaultMessage:"New sign-ups:"})}),e.jsxs("div",{className:"column-settings__row",children:[e.jsx(r,{disabled:l==="denied",prefix:"notifications_desktop",settings:i,settingPath:["alerts","admin.sign_up"],onChange:o,label:h}),m&&e.jsx(r,{prefix:"notifications_push",settings:n,settingPath:["alerts","admin.sign_up"],onChange:this.onPushChange,label:v}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["shows","admin.sign_up"],onChange:o,label:x}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["sounds","admin.sign_up"],onChange:o,label:j})]})]}),(this.props.identity.permissions&re)===re&&e.jsxs("section",{role:"group","aria-labelledby":"notifications-admin-report",children:[e.jsx("h3",{id:"notifications-status",children:e.jsx(a,{id:"notifications.column_settings.admin.report",defaultMessage:"New reports:"})}),e.jsxs("div",{className:"column-settings__row",children:[e.jsx(r,{disabled:l==="denied",prefix:"notifications_desktop",settings:i,settingPath:["alerts","admin.report"],onChange:o,label:h}),m&&e.jsx(r,{prefix:"notifications_push",settings:n,settingPath:["alerts","admin.report"],onChange:this.onPushChange,label:v}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["shows","admin.report"],onChange:o,label:x}),e.jsx(r,{prefix:"notifications",settings:i,settingPath:["sounds","admin.report"],onChange:o,label:j})]})]})]})}}const ts=Ze(es),de=k({permissionDenied:{id:"notifications.permission_denied_alert",defaultMessage:"Desktop notifications can't be enabled, as browser permission has been denied before"}}),ss=t=>({settings:t.getIn(["settings","notifications"]),pushSettings:t.get("push_notifications"),alertsEnabled:t.getIn(["settings","notifications","alerts"]).includes(!0),browserSupport:t.getIn(["notifications","browserSupport"]),browserPermission:t.getIn(["notifications","browserPermission"])}),is=t=>({onChange(s,i){s[0]==="push"?i&&typeof window.Notification<"u"&&Notification.permission!=="granted"?t(B(n=>{t(n==="granted"?ae(s.slice(1),i):ie({message:de.permissionDenied}))})):t(ae(s.slice(1),i)):s[0]==="quickFilter"?(t(F(["notifications",...s],i)),t(ge("all"))):s[0]==="alerts"&&i&&typeof window.Notification<"u"&&Notification.permission!=="granted"?i&&typeof window.Notification<"u"&&Notification.permission!=="granted"?t(B(n=>{t(n==="granted"?F(["notifications",...s],i):ie({message:de.permissionDenied}))})):t(F(["notifications",...s],i)):(t(F(["notifications",...s],i)),s[0]==="group"&&s[1]==="follow"&&t(ze()))},onClear(){t(me({modalType:"CONFIRM_CLEAR_NOTIFICATIONS"}))},onRequestNotificationPermission(){t(B())}}),os=Be(Ue(ss,is)(ts)),ns=k({other:{id:"report_notification.categories.other_sentence",defaultMessage:"other"},spam:{id:"report_notification.categories.spam_sentence",defaultMessage:"spam"},legal:{id:"report_notification.categories.legal_sentence",defaultMessage:"illegal content"},violation:{id:"report_notification.categories.violation_sentence",defaultMessage:"rule violation"}}),as=({notification:t,notification:{report:s},unread:i})=>{const n=R(),o=p(b=>b.accounts.get(s.targetAccountId)),c=p(b=>b.accounts.get(t.sampleAccountIds[0]??"0"));if(!c||!o)return null;const u=c.acct.split("@")[1],g={name:e.jsx("bdi",{children:u??`@${c.acct}`}),target:e.jsxs("bdi",{children:["@",o.acct]}),category:n.formatMessage(ns[s.category]),count:s.status_ids.length};let l;return s.status_ids.length>0?s.category==="other"?l=e.jsx(a,{id:"notification.admin.report_account_other",defaultMessage:"{name} reported {count, plural, one {one post} other {# posts}} from {target}",values:g}):l=e.jsx(a,{id:"notification.admin.report_account",defaultMessage:"{name} reported {count, plural, one {one post} other {# posts}} from {target} for {category}",values:g}):s.category==="other"?l=e.jsx(a,{id:"notification.admin.report_statuses_other",defaultMessage:"{name} reported {target}",values:g}):l=e.jsx(a,{id:"notification.admin.report_statuses",defaultMessage:"{name} reported {target} for {category}",values:g}),e.jsxs("a",{href:`/admin/reports/${s.id}`,target:"_blank",rel:"noopener noreferrer",className:$("notification-group notification-group--link notification-group--admin-report focusable",{"notification-group--unread":i}),children:[e.jsx("div",{className:"notification-group__icon",children:e.jsx(_,{id:"flag",icon:At})}),e.jsxs("div",{className:"notification-group__main",children:[e.jsx("div",{className:"notification-group__main__header",children:e.jsxs("div",{className:"notification-group__main__header__label",children:[l,e.jsx(ve,{timestamp:s.created_at})]})}),s.comment.length>0&&e.jsxs("div",{className:"notification-group__embedded-status__content",children:["â",s.comment,"â"]})]})]})},Me=28,ls=({accountId:t})=>{const s=p(i=>i.accounts.get(t));return s?e.jsx(Ke,{withLink:!0,account:s,size:Me}):null},T=({icon:t,iconId:s,timestamp:i,accountIds:n,actions:o,count:c,statusId:u,labelRenderer:g,labelSeeMoreHref:l,type:b,unread:M,additionalContent:P})=>{const h=N(),x=d.useMemo(()=>g(e.jsx(we,{accountIds:n}),c,l),[g,n,c,l]),j=p(m=>m.statuses.getIn([u,"visibility"])==="direct"),S=d.useMemo(()=>({open:()=>{h(xe(u))},reply:()=>{h(he(u))}}),[h,u]);return e.jsx(z.HotKeys,{handlers:S,children:e.jsxs("div",{role:"button",className:$(`notification-group focusable notification-group--${b}`,{"notification-group--unread":M,"notification-group--direct":j}),tabIndex:0,children:[e.jsx("div",{className:"notification-group__icon",children:e.jsx(_,{icon:t,id:s})}),e.jsxs("div",{className:"notification-group__main",children:[e.jsxs("div",{className:"notification-group__main__header",children:[e.jsxs("div",{className:"notification-group__main__header__wrapper",children:[e.jsx(Ft,{avatarHeight:Me,children:n.slice(0,We).map(m=>e.jsx(ls,{accountId:m},m))}),o&&e.jsx("div",{className:"notification-group__actions",children:o})]}),e.jsxs("div",{className:"notification-group__main__header__label",children:[x,i&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"notification-group__main__header__label-separator",children:"·"}),e.jsx(ve,{timestamp:i})]})]})]}),u&&e.jsx("div",{className:"notification-group__main__status",children:e.jsx(Et,{statusId:u})}),P&&e.jsx("div",{className:"notification-group__main__additional-content",children:P})]})]})})},rs=(t,s)=>s===1?e.jsx(a,{id:"notification.admin.sign_up",defaultMessage:"{name} signed up",values:{name:t}}):e.jsx(a,{id:"notification.admin.sign_up.name_and_others",defaultMessage:"{name} and {count, plural, one {# other} other {# others}} signed up",values:{name:t,count:s-1}}),cs=({notification:t,unread:s})=>e.jsx(T,{type:"admin-sign-up",icon:W,iconId:"person-add",accountIds:t.sampleAccountIds,timestamp:t.latest_page_notification_at,count:t.notifications_count,labelRenderer:rs,unread:s}),ds=t=>d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...t},d.createElement("path",{d:"m80-80 200-560 360 360L80-80Zm132-132 282-100-182-182-100 282Zm370-246-42-42 224-224q32-32 77-32t77 32l24 24-42 42-24-24q-14-14-35-14t-35 14L582-458ZM422-618l-42-42 24-24q14-14 14-34t-14-34l-26-26 42-42 26 26q32 32 32 76t-32 76l-24 24Zm80 80-42-42
1144-144q14-14 14-35t-14-35l-64-64 42-42 64 64q32 32 32 77t-32 77L502-538Zm160 160-42-42 64-64q32-32 77-32t77 32l64 64-42 42-64-64q-14-14-35-14t-35 14l-64 64ZM212-212Z"})),us=({notification:{annualReport:t},unread:s})=>{const i=N(),n=t.year,o=d.useCallback(()=>{i(me({modalType:"ANNUAL_REPORT",modalProps:{year:n}}))},[i,n]);return e.jsxs("div",{role:"button",className:$("notification-group notification-group--link notification-group--annual-report focusable",{"notification-group--unread":s}),tabIndex:0,children:[e.jsx("div",{className:"notification-group__icon",children:e.jsx(_,{id:"celebration",icon:ds})}),e.jsxs("div",{className:"notification-group__main",children:[e.jsx("p",{children:e.jsx(a,{id:"notification.annual_report.message",defaultMessage:"Your {year} #Wrapstodon awaits! Unveil your year's highlights and memorable moments on Mastodon!",values:{year:n}})}),e.jsx("button",{onClick:o,className:"link-button",children:e.jsx(a,{id:"notification.annual_report.view",defaultMessage:"View #Wrapstodon"})})]})]})},fs=(t,s,i)=>s===1?e.jsx(a,{id:"notification.favourite",defaultMessage:"{name} favorited your post",values:{name:t}}):e.jsx(a,{id:"notification.favourite.name_and_others_with_link",defaultMessage:"{name} and <a>{count, plural, one {# other} other {# others}}</a> favorited your post",values:{name:t,count:s-1,a:n=>i?e.jsx(E,{to:i,children:n}):n}}),ps=(t,s,i)=>s===1?e.jsx(a,{id:"notification.favourite_pm",defaultMessage:"{name} favorited your private mention",values:{name:t}}):e.jsx(a,{id:"notification.favourite_pm.name_and_others_with_link",defaultMessage:"{name} and <a>{count, plural, one {# other} other {# others}}</a> favorited your private mention",values:{name:t,count:s-1,a:n=>i?e.jsx(E,{to:i,children:n}):n}}),ms=({notification:t,unread:s})=>{const{statusId:i}=t,n=p(c=>{var u;return(u=c.accounts.get(c.statuses.getIn([i,"account"])))==null?void 0:u.acct}),o=p(c=>c.statuses.getIn([i,"visibility"])==="direct");return e.jsx(T,{type:"favourite",icon:Qe,iconId:"star",accountIds:t.sampleAccountIds,statusId:t.statusId,timestamp:t.latest_page_notification_at,count:t.notifications_count,labelRenderer:o?ps:fs,labelSeeMoreHref:n?`/@${n}/${i}/favourites`:void 0,unread:s})},gs=(t,s,i)=>s===1?e.jsx(a,{id:"notification.follow",defaultMessage:"{name} followed you",values:{name:t}}):e.jsx(a,{id:"notification.follow.name_and_others",defaultMessage:"{name} and <a>{count, plural, one {# other} other {# others}}</a> followed you",values:{name:t,count:s-1,a:n=>i?e.jsx(E,{to:i,children:n}):n}}),hs=({accountId:t})=>{const s=p(i=>i.accounts.get(t));return s?e.jsx(Ct,{value:s.followers_count,renderer:Tt}):null},xs=({notification:t,unread:s})=>{const i=p(c=>c.accounts.getIn([K,"username"]));let n,o;if(t.sampleAccountIds.length===1){const c=t.sampleAccountIds[0];c&&(n=e.jsx(Bt,{compact:!0,accountId:t.sampleAccountIds[0]}),o=e.jsx(hs,{accountId:c}))}return e.jsx(T,{type:"follow",icon:W,iconId:"person-add",accountIds:t.sampleAccountIds,timestamp:t.latest_page_notification_at,count:t.notifications_count,labelRenderer:gs,labelSeeMoreHref:`/@${i}/followers`,unread:s,actions:n,additionalContent:o})},ue=k({authorize:{id:"follow_request.authorize",defaultMessage:"Authorize"},reject:{id:"follow_request.reject",defaultMessage:"Reject"}}),_s=(t,s)=>s===1?e.jsx(a,{id:"notification.follow_request",defaultMessage:"{name} has requested to follow you",values:{name:t}}):e.jsx(a,{id:"notification.follow_request.name_and_others",defaultMessage:"{name} and {count, plural, one {# other} other {# others}} has requested to follow you",values:{name:t,count:s-1}}),js=({notification:t,unread:s})=>{const i=R(),n=N(),o=d.useCallback(()=>{n(Ve(t.sampleAccountIds[0]))},[n,t.sampleAccountIds]),c=d.useCallback(()=>{n(Ye(t.sampleAccountIds[0]))},[n,t.sampleAccountIds]),u=e.jsxs(e.Fragment,{children:[e.jsx(U,{title:i.formatMessage(ue.reject),icon:"times",iconComponent:be,onClick:c}),e.jsx(U,{title:i.formatMessage(ue.authorize),icon:"check",iconComponent:Xe,onClick:o})]});return e.jsx(T,{type:"follow-request",icon:W,iconId:"person-add",accountIds:t.sampleAccountIds,timestamp:t.latest_page_notification_at,count:t.notifications_count,labelRenderer:_s,actions:u,unread:s})},bs=t=>d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...t},d.createElement("path",{d:"M760-200v-160q0-50-35-85t-85-35H273l144 144-57 56-240-240 240-240 57 56-144 144h367q83 0 141.5 58.5T840-360v160h-80Z"})),L=({icon:t,iconId:s,accountIds:i,statusId:n,count:o,labelRenderer:c,type:u,unread:g})=>{const l=N(),b=d.useMemo(()=>c(e.jsx(we,{accountIds:i}
1),o),[c,i,o]),M=p(x=>x.statuses.getIn([n,"visibility"])==="direct"),P=p(x=>n&&Je(x,{id:n,contextType:"notifications"})),h=d.useMemo(()=>({open:()=>{l(xe(n))},reply:()=>{l(he(n))},boost:()=>{l(st(n))},favourite:()=>{l(tt(n))},toggleHidden:()=>{l(et(n))}}),[l,n]);return!n||P?null:e.jsx(z.HotKeys,{handlers:h,children:e.jsxs("div",{role:"button",className:$(`notification-ungrouped focusable notification-ungrouped--${u}`,{"notification-ungrouped--unread":g,"notification-ungrouped--direct":M}),tabIndex:0,children:[e.jsxs("div",{className:"notification-ungrouped__header",children:[e.jsx("div",{className:"notification-ungrouped__header__icon",children:e.jsx(_,{icon:t,id:s})}),b]}),e.jsx(Lt,{id:n,contextType:"notifications",withDismiss:!0,skipPrepend:!0,avatarSize:40,unfocusable:!0})]})})},vs=()=>e.jsx(a,{id:"notification.label.mention",defaultMessage:"Mention"}),ws=()=>e.jsx(a,{id:"notification.label.private_mention",defaultMessage:"Private mention"}),Ms=()=>e.jsx(a,{id:"notification.label.reply",defaultMessage:"Reply"}),ys=()=>e.jsx(a,{id:"notification.label.private_reply",defaultMessage:"Private reply"}),Ns=({notification:t,unread:s})=>{const[i,n]=p(c=>{const u=t.statusId?c.statuses.get(t.statusId):void 0;return u?[u.get("visibility")==="direct",u.get("in_reply_to_account_id")===K]:[!1,!1]},fe);let o=vs;return n&&i?o=ys:n?o=Ms:i&&(o=ws),e.jsx(L,{type:"mention",icon:n?bs:$t,iconId:"reply",accountIds:t.sampleAccountIds,count:t.notifications_count,statusId:t.statusId,labelRenderer:o,unread:s})},Ps=({notification:{moderationWarning:t},unread:s})=>e.jsx(Rt,{action:t.action,id:t.id,unread:s}),Ss=()=>e.jsx(a,{id:"notification.poll",defaultMessage:"A poll you voted in has ended"}),Cs=()=>e.jsx(a,{id:"notification.own_poll",defaultMessage:"Your poll has ended"}),ks=({notification:t,unread:s})=>e.jsx(L,{type:"poll",icon:Dt,iconId:"bar-chart-4-bars",accountIds:t.sampleAccountIds,count:t.notifications_count,statusId:t.statusId,labelRenderer:t.sampleAccountIds[0]===K?Cs:Ss,unread:s}),Is=(t,s,i)=>s===1?e.jsx(a,{id:"notification.reblog",defaultMessage:"{name} boosted your post",values:{name:t}}):e.jsx(a,{id:"notification.reblog.name_and_others_with_link",defaultMessage:"{name} and <a>{count, plural, one {# other} other {# others}}</a> boosted your post",values:{name:t,count:s-1,a:n=>i?e.jsx(E,{to:i,children:n}):n}}),As=({notification:t,unread:s})=>{const{statusId:i}=t,n=p(o=>{var c;return(c=o.accounts.get(o.statuses.getIn([i,"account"])))==null?void 0:c.acct});return e.jsx(T,{type:"reblog",icon:_e,iconId:"repeat",accountIds:t.sampleAccountIds,statusId:t.statusId,timestamp:t.latest_page_notification_at,count:t.notifications_count,labelRenderer:Is,labelSeeMoreHref:n?`/@${n}/${i}/reblogs`:void 0,unread:s})},Rs=({notification:{event:t},unread:s})=>e.jsx(qt,{type:t.type,target:t.target_name,followersCount:t.followers_count,followingCount:t.following_count,unread:s}),qs=t=>e.jsx(a,{id:"notification.status",defaultMessage:"{name} just posted",values:{name:t}}),Fs=({notification:t,unread:s})=>e.jsx(L,{type:"status",icon:Gt,iconId:"notifications-active",accountIds:t.sampleAccountIds,count:t.notifications_count,statusId:t.statusId,labelRenderer:qs,unread:s}),Es=t=>e.jsx(a,{id:"notification.update",defaultMessage:"{name} edited a post",values:{name:t}}),Ts=({notification:t,unread:s})=>e.jsx(L,{type:"update",icon:Ht,iconId:"edit",accountIds:t.sampleAccountIds,count:t.notifications_count,statusId:t.statusId,labelRenderer:Es,unread:s}),Bs=({notificationGroupId:t,unread:s,onMoveUp:i,onMoveDown:n})=>{const o=p(b=>b.notificationGroups.groups.find(M=>M.type!=="gap"&&M.group_key===t)),c=N(),u=(o==null?void 0:o.type)==="gap"||o==null?void 0:o.sampleAccountIds[0],g=d.useMemo(()=>({moveUp:()=>{i(t)},moveDown:()=>{n(t)},openProfile:()=>{u&&c(ot(u))},mention:()=>{u&&c(it(u))}}),[c,t,u,i,n]);if(!o||o.type==="gap")return null;let l;switch(o.type){case"reblog":l=e.jsx(As,{unread:s,notification:o});break;case"favourite":l=e.jsx(ms,{unread:s,notification:o});break;case"severed_relationships":l=e.jsx(Rs,{unread:s,notification:o});break;case"mention":l=e.jsx(Ns,{unread:s,notification:o});break;case"follow":l=e.jsx(xs,{unread:s,notification:o});break;case"follow_request":l=e.jsx(js,{unread:s,notification:o});break;case"poll":l=e.jsx(ks,{unread:s,notification:o});break;case"status":l=e.jsx(Fs,{unread:s,notification:o});break;case"update":l=e.jsx(Ts,{unread:s,notification:o});break;case"admin.sign_up":l=e.jsx(cs,{unread:s,notification:o});break;case"admin.report":l=e.jsx(as,{unread:s,notification:o});break;case"moderation_warning":l=e.jsx(Ps,{unread:s,notification:o});break;case"annual_report":l=e.jsx(us,{unread:s,notification:o});break;default:return null}return e.jsx(z.HotKeys,{handlers:g,children:l})},A=k({mentions:{id:"notifications.filter.mentions",defaultMessage:"Mentions"},favourites:{id:"notifications.filter.favourites",defaultMessage:"Favorites"},boosts:{id:"notifications.filter.boosts",defaultMessage:"Boosts"},polls:{id:"notifications.filter.polls",defaultMessage:"Poll results"},follows:{id:"notifications.filter.follows",defaultMessage:"Follows"},statuses:{id:"notifications.filter.statuses",defaultMessage:"Updates from people you follow"}}
1),y=({selectedFilter:t,type:s,title:i,children:n})=>{const o=N(),c=d.useCallback(()=>{o(ge({filterType:s}))},[o,s]);return e.jsx("button",{className:t===s?"active":"",onClick:c,title:i,children:n})},$s=()=>{const t=R(),s=p(nt);return p(at)?e.jsxs("div",{className:"notification__filter-bar",children:[e.jsx(y,{selectedFilter:s,type:"all",children:e.jsx(a,{id:"notifications.filter.all",defaultMessage:"All"})},"all"),e.jsx(y,{selectedFilter:s,type:"mention",title:t.formatMessage(A.mentions),children:e.jsx(_,{id:"reply-all",icon:lt})},"mention"),e.jsx(y,{selectedFilter:s,type:"favourite",title:t.formatMessage(A.favourites),children:e.jsx(_,{id:"star",icon:rt})},"favourite"),e.jsx(y,{selectedFilter:s,type:"reblog",title:t.formatMessage(A.boosts),children:e.jsx(_,{id:"retweet",icon:_e})},"reblog"),e.jsx(y,{selectedFilter:s,type:"poll",title:t.formatMessage(A.polls),children:e.jsx(_,{id:"tasks",icon:Zt})},"poll"),e.jsx(y,{selectedFilter:s,type:"status",title:t.formatMessage(A.statuses),children:e.jsx(_,{id:"home",icon:Ot})},"status"),e.jsx(y,{selectedFilter:s,type:"follow",title:t.formatMessage(A.follows),children:e.jsx(_,{id:"user-plus",icon:Ut})},"follow")]}):e.jsxs("div",{className:"notification__filter-bar",children:[e.jsx(y,{selectedFilter:s,type:"all",children:e.jsx(a,{id:"notifications.filter.all",defaultMessage:"All"})},"all"),e.jsx(y,{selectedFilter:s,type:"mention",children:e.jsx(a,{id:"notifications.filter.mentions",defaultMessage:"Mentions"})},"mention")]})},q=k({title:{id:"column.notifications",defaultMessage:"Notifications"},markAsRead:{id:"notifications.mark_as_read",defaultMessage:"Mark every notification as read"}}),Ji=({columnId:t,multiColumn:s})=>{var J;const i=R(),n=p(Le,fe),o=N(),c=p(f=>f.notificationGroups.isLoading),u=((J=n.at(-1))==null?void 0:J.type)==="gap",g=p(f=>oe(f)?f.notificationGroups.readMarkerId:"0"),l=p(De),b=p(Ge),M=p(He),P=p(f=>f.notificationGroups.mergedNotifications==="needs-reload"),h=b>0||P,x=p(oe)&&M,j=p(ct),S=d.useRef(null),m=d.useCallback((f,I)=>{var ee;const w=(ee=S.current)==null?void 0:ee.node;if(!w)return;const C=w.querySelector(`article:nth-of-type(${f+1}) .focusable`);C&&(I&&w.scrollTop>C.offsetTop?C.scrollIntoView(!0):!I&&w.scrollTop+w.clientHeight<C.offsetTop+C.offsetHeight&&C.scrollIntoView(!1),C.focus())},[]);d.useEffect(()=>(o(dt()),()=>{o(ut()),o(Z({top:!1}))}),[o]);const v=d.useCallback(f=>{o(ne({gap:f}))},[o]),D=O(()=>{const f=n.at(-1);(f==null?void 0:f.type)==="gap"&&o(ne({gap:f}))},300,{leading:!0}),ye=d.useCallback(()=>{o(ft())},[o]),G=O(()=>{o(Z({top:!0}))},100),H=O(()=>{o(Z({top:!1}))},100);d.useEffect(()=>()=>{D.cancel(),G.cancel(),H.cancel()},[D,G,H]);const Ne=d.useCallback(()=>{o(t?pt(t):mt("NOTIFICATIONS",{}))},[t,o]),Pe=d.useCallback(f=>{o(gt(t,f))},[o,t]),Se=d.useCallback(()=>{var f;(f=S.current)==null||f.scrollTop()},[]),Q=d.useCallback(f=>{const I=n.findIndex(w=>w.type!=="gap"&&w.group_key===f)-1;m(I,!0)},[n,m]),V=d.useCallback(f=>{const I=n.findIndex(w=>w.type!=="gap"&&w.group_key===f)+1;m(I,!1)},[n,m]),Ce=d.useCallback(()=>{o(ht()),o(xt({immediate:!0}))},[o]),Y=!!t,ke=e.jsx(a,{id:"empty_column.notifications",defaultMessage:"You don't have any notifications yet. When other people interact with you, you will see it here."}),{signedIn:X}=_t(),Ie=X?e.jsx($s,{}):null,Ae=d.useMemo(()=>n.length===0&&!u?null:n.map(f=>f.type==="gap"?e.jsx(Nt,{disabled:c,param:f,onClick:v},`${f.maxId}-${f.sinceId}`):e.jsx(Bs,{notificationGroupId:f.group_key,onMoveUp:Q,onMoveDown:V,unread:g!=="0"&&!!f.page_max_id&&jt(f.page_max_id,g)>0},f.group_key)),[n,c,u,g,v,Q,V]),Re=e.jsxs(e.Fragment,{children:[j&&e.jsx(Vt,{}),e.jsx(Kt,{})]}),qe=X?e.jsx(Pt,{scrollKey:`notifications-${t}`,trackScroll:!Y,isLoading:c,showLoading:c&&n.length===0,hasMore:u,numPending:l,prepend:Re,alwaysPrepend:!0,emptyMessage:ke,onLoadMore:D,onLoadPending:ye,onScrollToTop:G,onScroll:H,bindToDocument:!s,children:Ae}):e.jsx(bt,{}),Fe=e.jsxs(e.Fragment,{children:[e.jsx(Wt,{className:"column-header__button"}),x&&e.jsx("button",{"aria-label":i.formatMessage(q.markAsRead),title:i.formatMessage(q.markAsRead),onClick:Ce,className:"column-header__button",children:e.jsx(_,{id:"done-all",icon:zt})})]});return e.jsxs(vt,{bindToDocument:!s,ref:S,label:i.formatMessage(q.title),children:[e.jsx(yt,{icon:"bell",iconComponent:Oe,active:h,title:i.formatMessage(q.title),onPin:Ne,onMove:Pe,onClick:Se,pinned:Y,multiColumn:s,extraButton:Fe,children:e.jsx(os,{})}
1),Ie,qe,e.jsxs($e,{children:[e.jsx("title",{children:i.formatMessage(q.title)}),e.jsx("meta",{name:"robots",content:"noindex"})]})]})};export{Ji as Notifications,Ji as default}; 2//# sourceMappingURL=notifications_v2-index-SA8N2HTT.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.