"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[745],{30745(e,a,t){t.r(a),t.d(a,{default:()=>I});var s=t(71633),r=t.n(s),n=t(36418),l=t(14778),c=t(37270),i=t(81911),d=t(85406),o=t(49664),p=t(30708),u=t(14776),m=t(7430),E=t(45222),b=t(45697);const f=(0,l.defineMessage)({id:"recaps.sidebarLink.failedTooltip",defaultMessage:"One or more recaps failed"}),I=()=>{const{formatMessage:e}=(0,l.useIntl)(),{url:a}=(0,i.useRouteMatch)(),{pathname:t}=(0,i.useLocation)(),s=(0,c.useSelector)(u.Sy),I=(0,c.useSelector)(m.WR),{count:_,hasFailed:g}=(0,c.useSelector)(p.Bq,c.shallowEqual),M=(0,E.A)("EnableAIRecaps"),h=null!=(0,i.matchPath)(t,{path:"/:team/recaps/:recapId?"});if(!s||!I||"true"!==M)return null;const R=_>0;return n.createElement("ul",{className:"SidebarRecaps NavGroupContent nav nav-pills__container"},n.createElement("li",{id:"sidebar-recaps-button",className:r()("SidebarChannel",{active:h,unread:R}),tabIndex:-1},n.createElement(i.Link,{to:`${a}/recaps`,id:"sidebarItem_recaps",draggable:"false",className:r()("SidebarLink sidebar-item",{"unread-title":R}),tabIndex:0},n.createElement("span",{className:"icon"},n.createElement(d.CreationOutlineIcon,{size:18})),n.createElement("div",{className:"SidebarChannelLinkLabel_wrapper"},n.createElement("span",{className:"SidebarChannelLinkLabel sidebar-item__name"},n.createElement(l.FormattedMessage,{id:"recaps.sidebarLink",defaultMessage:"Recaps"}))),R&&(g?n.createElement(o.WithTooltip,{title:f},n.createElement("span",{className:"RecapsFailedIcon","aria-label":e(f)},n.createElement(d.AlertOutlineIcon,{size:14}))):n.createElement(b.A,{unreadMentions:_})))))}},30708(e,a,t){t.d(a,{Bq:()=>i,Gn:()=>n,H4:()=>c,wx:()=>l}),t(43617),t(81975),t(93991);var s=t(95106),r=t(8361);function n(e){const{byId:a,allIds:t}=e.entities.recaps;return t.map(e=>a[e])}(0,r.Mz)("getRecapsByStatus",n,(e,a)=>a,(e,a)=>e.filter(e=>e.status===a)),(0,r.Mz)("getSortedRecaps",n,e=>[...e].sort((e,a)=>a.create_at-e.create_at)),(0,r.Mz)("getCompletedRecaps",n,e=>e.filter(e=>e.status===s.A.COMPLETED).sort((e,a)=>a.create_at-e.create_at)),(0,r.Mz)("getPendingRecaps",n,e=>e.filter(e=>e.status===s.A.PENDING||e.status===s.A.PROCESSING));const l=(0,r.Mz)("getUnreadRecaps",n,e=>e.filter(e=>0===e.read_at).sort((e,a)=>a.create_at-e.create_at)),c=(0,r.Mz)("getReadRecaps",n,e=>e.filter(e=>e.read_at>0).sort((e,a)=>a.read_at-e.read_at)),i=(0,r.Mz)("getUnreadFinishedRecapsBadge",e=>e.entities.recaps,({byId:e,allIds:a})=>{let t=0,r=!1;for(const n of a){const a=e[n];a&&0===a.viewed_at&&(a.status===s.A.COMPLETED?t++:a.status===s.A.FAILED&&(t++,r=!0))}return{count:t,hasFailed:r}})},95106(e,a){var t;a.A=void 0,function(e){e.PENDING="pending",e.PROCESSING="processing",e.COMPLETED="completed",e.FAILED="failed"}(t||(a.A=t={}))}}]);
//# sourceMappingURL=745.7b48282b2a18368b524f.js.map