1"use strict";(self.webpackChunkmangane_fe=self.webpackChunkmangane_fe||[]).push([[59],{1156:function(e,t,o){o.r(t),o.d(t,{default:function(){return B}});var n=o(1855),i=(o(1),o(7),o(5)),a=o.n(i),s=o(308),l=o(22),c=o.n(l),r=o(0),u=o(1841),f=o(1842),d=o(1871),m=o(46),p=o(127),g=o(16),v=o(104),h=o(1270),Z=o(20),M=o(2),y=o(210),b=o(1882),w=o(1881),_=function(){return(0,n.Z)("div",{className:"bg-white dark:bg-slate-800 px-4 py-6 sm:p-6"},void 0,(0,n.Z)("div",{className:"w-full animate-pulse"},void 0,(0,n.Z)("div",{className:"mb-2"},void 0,(0,n.Z)(w.Z,{minLength:20,maxLength:20})),(0,n.Z)("div",{},void 0,(0,n.Z)("div",{className:"flex space-x-3 items-center"},void 0,(0,n.Z)("div",{className:"flex-shrink-0"},void 0,(0,n.Z)(y.Z,{size:48})),(0,n.Z)("div",{className:"min-w-0 flex-1"},void 0,(0,n.Z)(b.Z,{minLength:3,maxLength:25})))),(0,n.Z)("div",{className:"mt-4"},void 0,(0,n.Z)(w.Z,{minLength:5,maxLength:120}))))},k=r.memo(_),x=o(3),j=o(1857),C=o(14),N=function(e){var t=e.onClick;return(0,n.Z)(M.zx,{theme:"ghost",onClick:t},void 0,(0,n.Z)(d.Z,{id:"notifications.clear",defaultMessage:"Clear notifications"}))},L=(0,u.vU)({all:{id:"notifications.filter.all",defaultMessage:"All"},mentions:{id:"notifications.filter.mentions",defaultMessage:"Mentions"},favourites:{id:"notifications.filter.favourites",defaultMessage:"Likes"},boosts:{id:"notifications.filter.boosts",defaultMessage:"Reposts"},polls:{id:"notifications.filter.polls",defaultMessage:"Poll results"},follows:{id:"notifications.filter.follows",defaultMessage:"Follows"},emoji_reacts:{id:"notifications.filter.emoji_reacts",defaultMessage:"Emoji reacts"},statuses:{id:"notifications.filter.statuses",defaultMessage:"Updates from people you follow"},clearHeading:{id:"notifications.clear_heading",defaultMessage:"Clear notifications"},clearMessage:{id:"notifications.clear_confirmation",defaultMessage:"Are you sure you want to permanently clear all your notifications?"},clearConfirm:{id:"notifications.clear",defaultMessage:"Clear notifications"}}),I=function(){var e=(0,f.Z)(),t=(0,x.TL)(),i=(0,x.rV)(),a=(0,x.hz)(),s=i.getIn(["notifications","quickFilter","active"]),l=i.getIn(["notifications","quickFilter","advanced"]),c=function(e){return function(){return t((0,p.Tv)(e))}},u=r.useCallback((function(){t((0,j.h7)("CONFIRM",{icon:o(606),heading:e.formatMessage(L.clearHeading),message:e.formatMessage(L.clearMessage),confirm:e.formatMessage(L.clearConfirm),onConfirm:function(){return t((0,p.L1)())}}))}),[t,j.h7,p.L1]),d=[{text:e.formatMessage(L.all),action:c("all"),name:"all"}];return l?(d.push({text:(0,n.Z)(C.Z,{src:o(202)}),title:e.formatMessage(L.mentions),action:c("mention"),name:"mention"}),d.push({text:(0,n.Z)(C.Z,{src:o(216)}),title:e.formatMessage(L.favourites),action:c("favourite"),name:"favourite"}),a.emojiReacts&&d.push({text:(0,n.Z)(C.Z,{src:o(607)}),title:e.formatMessage(L.emoji_reacts),action:c("pleroma:emoji_reaction"),name:"pleroma:emoji_reaction"}),d.push({text:(0,n.Z)(C.Z,{src:o(608)}),title:e.formatMessage(L.boosts),action:c("reblog"),name:"reblog"}),d.push({text:(0,n.Z)(C.Z,{src:o(472)}),title:e.formatMessage(L.polls),action:c("poll"),name:"poll"}),d.push({text:(0,n.Z)(C.Z,{src:o(466)}),title:e.formatMessage(L.statuses),action:c("status"),name:"status"}),d.push({text:(0,n.Z)(C.Z,{src:o(156)}),title:e.formatMessage(L.follows),action:c("follow"),name:"follow"})):d.push({text:e.formatMessage(L.mentions),action:c("mention"),name:"mention"}),r.createElement(r.Fragment,null,(0,n.Z)("div",{className:"flex justify-between items-center mb-2"},void 0,(0,n.Z)(C.Z,{className:"h-6 w-6 text-gray-500 dark:text-gray-400",src:o(154)}),(0,n.Z)(N,{onClick:u})),(0,n.Z)(M.mQ,{items:d,activeItem:s}))},q=o(207),z=o(1865),F=o(19),U=o(68),G=o(49),S=o(218),T=o(23),R=o(158),D=o(9),E=["follow","follow_request","mention","reblog","favourite","poll","status","move","pleroma:chat_mention","pleroma:emoji_reaction","user_approved","update"],H=function(e){return E.includes(e)},P=(0,D.e4)(),K={follow:o(156),follow_request:o(156),mention:o(202),favourite:o(216),reblog:o(103),status:o(466),poll:o(472),move:o(609),"pleroma:chat_mention":o(209),"pleroma:emoji_reaction":o(509),user_approved:o(156),update:o(205)},A=(0,u.vU)({follow:{id:"notification.follow",defaultMessage:"{name} followed you"},follow_request:{id:"notification.follow_request",defaultMessage:"{name} has requested to follow you"},mention:{id:"notification.mentioned",defaultMessage:"{name} mentioned you"},favourite:{id:"notification.favourite",defaultMessage:"{name} liked your post"},reblog:{id:"notification.reblog",defaultMessage:"{name} reposted your post"},status:{id:"notification.status",defaultMessage:"{name} just posted"},poll:{id:"notification.poll",defaultMessage:"A poll you have voted in has ended"},move:{id:"notification.move",defaultMessage:"{name} moved to {targetName}"},"pleroma:chat_mention":{id:"notification.pleroma:chat_mention",defaultMessage:"{name} sent you a message"},"pleroma:emoji_reaction":{id:"notification.pleroma:emoji_reaction",defaultMessage:"{name} reacted to your post"},user_approved:{id:"notification.user_approved",defaultMessage:"Welcome to {instance}!"},update:{id:"notification.update",defaultMessage:"{name} edited a post you interacted with"}}),O=function(e,t,o,i,a,s){var l=function(e){return(0,n.Z)("bdi",{},void 0,(0,n.Z)(S.Z,{className:"text-gray-800 dark:text-gray-200 font-bold hover:underline",href:"/@".concat(e.acct),title:e.acct,to:"/@".concat(e.acct),dangerouslySetInnerHTML:{__html:e.display_name_html}}
1))}(o),c=e.formatMessage({id:"notification.name",defaultMessage:"{link}{others}"},{link:l,others:i&&i>0?(0,n.Z)(d.Z,{id:"notification.others",defaultMessage:" + {count} {count, plural, one {other} other {others}}",values:{count:i-1}}):""});return e.formatMessage(A[t],{name:c,targetName:a,instance:s})},V=function(e){var t=e.hidden,o=void 0!==t&&t,i=e.onMoveUp,a=e.onMoveDown,l=(0,x.TL)(),c=(0,x.CG)((function(t){return P(t,e.notification)})),u=(0,z.k6)(),d=(0,f.Z)(),m=(0,x.CG)((function(e){return e.instance})),p=c.type,v=c.account,h=c.status,Z=function(){v&&"object"==typeof v&&u.push("/@".concat(v.acct))},y=(0,r.useCallback)((function(e){null==e||e.preventDefault(),v&&"object"==typeof v&&l((0,F.Ck)(v))}),[v]),b=(0,r.useCallback)((function(e){h&&"object"==typeof h&&(h.favourited?l((0,U.m9)(h)):l((0,U.yF)(h)))}),[h]),w=(0,r.useCallback)((function(e){h&&"object"==typeof h&&l((function(t,o){var n=(0,g.Gw)(o()).get("boostModal");h.reblogged?l((0,U.y_)(h)):null!=e&&e.shiftKey||!n?l((0,U.UM)(h)):l((0,j.h7)("BOOST",{status:h,onReblog:function(e){l((0,U.UM)(e))}}))}))}),[h]),_=(0,r.useCallback)((function(e){h&&"object"==typeof h&&(h.hidden?l((0,G.oK)(h.id)):l((0,G.E1)(h.id)))}),[h]),k=function(){i&&i(c.id)},N=function(){a&&a(c.id)},L=c.target&&"object"==typeof c.target?c.target.acct:"",I=H(p)&&v&&"object"==typeof v?O(d,p,v,c.total_count,L,m.title):null,S=H(p)?function(e,t,o){var n=[t];return n.push(e.formatDate(o,{hour:"2-digit",minute:"2-digit",month:"short",day:"numeric"})),n.join(", ")}(d,d.formatMessage(A[p],{name:v&&"object"==typeof v?v.acct:"",targetName:L}),c.created_at):"";return(0,n.Z)(q.HotKeys,{handlers:{reply:y,favourite:b,boost:w,mention:y,open:function(){h&&"object"==typeof h&&v&&"object"==typeof v?u.push("/@".concat(v.acct,"/posts/").concat(h.id)):Z()},openProfile:Z,moveUp:k,moveDown:N,toggleHidden:_},"data-testid":"notification"},void 0,(0,n.Z)("div",{className:"notification focusable",tabIndex:0,"aria-label":S},void 0,(0,n.Z)("div",{className:"p-4 focusable"},void 0,(0,n.Z)("div",{className:"mb-2"},void 0,(0,n.Z)(M.Ug,{alignItems:"center",space:1.5},void 0,"pleroma:emoji_reaction"===p&&c.emoji?(0,n.Z)(M.SF,{emoji:(0,s.Map)({name:c.emoji,url:c.emoji_url}),className:"w-4 h-4 flex-none"}):H(p)?(0,n.Z)(C.Z,{src:K[p],className:"text-primary-600 dark:text-primary-400 flex-none"}):null,(0,n.Z)("div",{className:"truncate"},void 0,(0,n.Z)(M.xv,{theme:"muted",size:"sm",truncate:!0,"data-testid":"message"},void 0,I)))),(0,n.Z)("div",{},void 0,function(){switch(p){case"follow":case"user_approved":return v&&"object"==typeof v?(0,n.Z)(T.Z,{id:v.id,hidden:o,avatarSize:48}):null;case"follow_request":return v&&"object"==typeof v?(0,n.Z)(T.Z,{id:v.id,hidden:o,avatarSize:48,actionType:"follow_request"}):null;case"move":return v&&"object"==typeof v&&c.target&&"object"==typeof c.target?(0,n.Z)(T.Z,{id:c.target.id,hidden:o,avatarSize:48}):null;case"favourite":case"mention":case"reblog":case"status":case"poll":case"update":case"pleroma:emoji_reaction":return h&&"object"==typeof h?(0,n.Z)(R.Z,{id:h.id,withDismiss:!0,hidden:o,onMoveDown:N,onMoveUp:k}):null;default:return null}}()))))},Q=(0,u.vU)({title:{id:"column.notifications",defaultMessage:"Notifications"},queue:{id:"notifications.queue_label",defaultMessage:"Click to see {count} new {count, plural, one {notification} other {notifications}}"}}),Y=(0,m.P1)([function(e){return(0,g.Gw)(e).getIn(["notifications","quickFilter","show"])},function(e){return(0,g.Gw)(e).getIn(["notifications","quickFilter","active"])},function(e){return(0,s.List)((0,g.Gw)(e).getIn(["notifications","shows"]).filter((function(e){return!e})).keys())},function(e){return e.notifications.items.toList()}],(function(e,t,o,n){return e&&"all"!==t?n.filter((function(e){return null!==e&&t===e.get("type")})):n.filterNot((function(e){return null!==e&&o.includes(e.get("type"))}))})),B=function(){var e=(0,x.TL)(),t=(0,f.Z)(),o=(0,x.rV)(),i=o.getIn(["notifications","quickFilter","show"]),s=o.getIn(["notifications","quickFilter","active"]),l=(0,x.CG)((function(e){return Y(e)})),u=(0,x.CG)((function(e){return e.notifications.isLoading})),m=(0,x.CG)((function(e){return e.notifications.hasMore})),g=(0,x.CG)((function(e){return e.notifications.totalQueuedNotificationsCount||0})),y=(0,r.useRef)(null),b=(0,r.useRef)(null),w=(0,r.useRef)(null),_=(0,r.useCallback)(c()((function(){var t=l.last();e((0,p._P)({maxId:t&&t.get("id")}))}),300,{leading:!0}),[l]),j=(0,r.useCallback)(c()((function(){e((0,p.ws)(!0))}),100),[]),C=(0,r.useCallback)(c()((function(){e((0,p.ws)(!1))}),100),[]),N=function(e){var t=l.findIndex((function(t){return null!==t&&t.get("id")===e}))-1;q(t)}
1,L=function(e){var t=l.findIndex((function(t){return null!==t&&t.get("id")===e}))+1;q(t)},q=function(e){var t;null===(t=y.current)||void 0===t||t.scrollIntoView({index:e,behavior:"smooth",done:function(){var t=b.current,o=null==t?void 0:t.querySelector('[data-index="'.concat(e,'"] .focusable'));o&&o.focus()}})},z=function(){e((0,p.JI)())};(0,r.useEffect)((function(){return z(),e((0,p.ws)(!0)),function(){_.cancel(),j.cancel(),C.cancel(),e((0,p.ws)(!1))}}),[]);var F,U="all"===s?(0,n.Z)(d.Z,{id:"empty_column.notifications",defaultMessage:"You don't have any notifications yet. Interact with others to start the conversation."}):(0,n.Z)(d.Z,{id:"empty_column.notifications_filtered",defaultMessage:"You don't have any notifications of this type yet."}),G=i?(0,n.Z)(I,{}):null;F=u&&w.current?w.current:l.size>0||m?l.map((function(e){return(0,n.Z)(V,{notification:e,onMoveUp:N,onMoveDown:L},e.id)})):null,w.current=F;var S=r.createElement(Z.Z,{ref:y,scrollKey:"notifications",isLoading:u,showLoading:u&&0===l.size,hasMore:m,emptyMessage:U,placeholderComponent:k,placeholderCount:20,onLoadMore:_,onScrollToTop:j,onScroll:C,className:a()({"divide-y divide-gray-200 dark:divide-gray-600 divide-solid":l.size>0,"space-y-2":0===l.size})},F);return r.createElement(M.sg,{ref:b,label:t.formatMessage(Q.title),withHeader:!1},G,(0,n.Z)(h.Z,{onClick:z,count:g,message:Q.queue}),(0,n.Z)(v.Z,{onRefresh:function(){return e((0,p._P)())}},void 0,S))}},609:function(e,t,o){e.exports=o.p+"packs/icons/briefcase-2191086f.svg"},606:function(e,t,o){e.exports=o.p+"packs/icons/eraser-11bc469c.svg"},607:function(e,t,o){e.exports=o.p+"packs/icons/mood-smile-86d732ef.svg"},608:function(e,t,o){e.exports=o.p+"packs/icons/repeat-4a725855.svg"}}]); 2//# sourceMappingURL=notifications-6e11161a227ac013a9b7.chunk.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.