"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[745],{30745(e,a,t){t.r(a),t.d(a,{default:()=>g});var s=t(71633),r=t.n(s),n=t(36418),c=t(14778),l=t(37270),d=t(81911),i=t(85406),u=t(49664),o=t(30708),p=t(14776),m=t(7430),S=t(45222),_=t(45697);const b=(0,c.defineMessage)({id:"recaps.sidebarLink.failedTooltip",defaultMessage:"One or more recaps failed"}),g=()=>{const{formatMessage:e}=(0,c.useIntl)(),{url:a}=(0,d.useRouteMatch)(),{pathname:t}=(0,d.useLocation)(),s=(0,l.useSelector)(p.Sy),g=(0,l.useSelector)(m.WR),{count:f,hasFailed:E}=(0,l.useSelector)(o.Bq,l.shallowEqual),L=(0,S.A)("EnableAIRecaps"),h=null!=(0,d.matchPath)(t,{path:"/:team/recaps/:recapId?"});if(!s||!g||"true"!==L)return null;const M=f>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:M}),tabIndex:-1},n.createElement(d.Link,{to:`${a}/recaps`,id:"sidebarItem_recaps",draggable:"false",className:r()("SidebarLink sidebar-item",{"unread-title":M}),tabIndex:0},n.createElement("span",{className:"icon"},n.createElement(i.CreationOutlineIcon,{size:18})),n.createElement("div",{className:"SidebarChannelLinkLabel_wrapper"},n.createElement("span",{className:"SidebarChannelLinkLabel sidebar-item__name"},n.createElement(c.FormattedMessage,{id:"recaps.sidebarLink",defaultMessage:"Recaps"}))),M&&(E?n.createElement(u.WithTooltip,{title:b},n.createElement("span",{className:"RecapsFailedIcon","aria-label":e(b)},n.createElement(i.AlertOutlineIcon,{size:14}))):n.createElement(_.A,{unreadMentions:f})))))}},30708(e,a,t){t.d(a,{Bq:()=>u,Gn:()=>n,H4:()=>d,Rl:()=>c,Ve:()=>i,wx:()=>l}),t(43617),t(81975),t(93991);var s=t(95106),r=t(67091);function n(e){const{byId:a,allIds:t}=e.entities.recaps;return t.map(e=>a[e])}function c(e){return e.entities.recaps.limitStatus}(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.Ag.COMPLETED).sort((e,a)=>a.create_at-e.create_at)),(0,r.Mz)("getPendingRecaps",n,e=>e.filter(e=>e.status===s.Ag.PENDING||e.status===s.Ag.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)),d=(0,r.Mz)("getReadRecaps",n,e=>e.filter(e=>e.read_at>0).sort((e,a)=>a.read_at-e.read_at));const i=(0,r.Mz)("getAllScheduledRecaps",function(e){return e.entities.recaps.scheduledRecaps||{}},e=>Object.values(e).sort((e,a)=>a.create_at-e.create_at));(0,r.Mz)("getActiveScheduledRecaps",i,e=>e.filter(e=>e.enabled&&0===e.delete_at)),(0,r.Mz)("getPausedScheduledRecaps",i,e=>e.filter(e=>!e.enabled&&0===e.delete_at));const u=(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.Ag.COMPLETED?t++:a.status===s.Ag.FAILED&&(t++,r=!0))}return{count:t,hasFailed:r}})},95106(e,a){var t;a._7=a.kF=a.IS=a.SF=a.Sx=a.L6=a.Ag=void 0,function(e){e.PENDING="pending",e.PROCESSING="processing",e.COMPLETED="completed",e.FAILED="failed"}(t||(a.Ag=t={})),a.L6={Sunday:1,Monday:2,Tuesday:4,Wednesday:8,Thursday:16,Friday:32,Saturday:64},a.Sx=a.L6.Monday|a.L6.Tuesday|a.L6.Wednesday|a.L6.Thursday|a.L6.Friday,a.SF=a.L6.Saturday|a.L6.Sunday,a.IS=a.Sx|a.SF,a.kF={Last24h:"last_24h",LastWeek:"last_week",SinceLastRead:"since_last_read"},a._7={Specific:"specific",AllUnreads:"all_unreads"}}}]);
//# sourceMappingURL=745.2b8ed5c7be0c73034c71.js.map