"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[2731],{62731:(e,a,t)=>{t.r(a),t.d(a,{default:()=>S}),t(17046);var i=t(36418),l=t.n(i),s=t(14778),o=t(37270),n=t(44785),r=t.n(n),d=t(35631),m=t(45955),u=t(77440),_=t(7430),c=t(44553),p=t(11039),f=t(47551),g=t(19408),y=t(61436),v=t(78451),E=t(60088);const w=r().div.withConfig({displayName:"StyledDiv"})(["width:100%;padding:0 24px;margin:12px auto;"]),S=function(){var e;const[a,t]=(0,i.useState)(!0),{formatMessage:n,formatNumber:r}=(0,s.useIntl)(),S=(0,o.useDispatch)(),M=(0,f.A)(),[h]=(0,p.A)(),{openPricingModal:b,isAirGapped:T}=(0,g.A)(),k=(0,o.useSelector)(_.HW),D=(0,o.useSelector)(_.J1),N=(0,o.useSelector)(m.I0),A=(0,o.useSelector)(m.Pd),F=(null==A?void 0:A.sku)===v.YE.STARTER,z=(0,o.useSelector)((e=>(0,u.Jt)(e,v.pm.CLOUD_USER_EPHEMERAL_INFO,"file_limit_banner_snooze")));let R=!0;if(""!==z){const e=JSON.parse(z);R=Date.now()-e.lastSnoozeTimestamp>=864e6}if(!a)return null;if(!R)return null;if(!N||!F)return null;const I=null==h||null===(e=h.files)||void 0===e?void 0:e.total_storage,L=M.files.totalStorage;if(void 0===I||!(L>I))return null;const O=l().createElement(s.FormattedMessage,{id:"create_post.file_limit_sticky_banner.messageTitle",defaultMessage:"Your free plan is limited to {storageGB} of files.",values:{storageGB:(0,E.Lh)(I,r)}}),C=T?l().createElement(s.FormattedMessage,{id:"create_post.file_limit_sticky_banner.admin_message_airgapped",defaultMessage:"New uploads will automatically archive older files. To view them again, you can delete older files."}):l().createElement(s.FormattedMessage,{id:"create_post.file_limit_sticky_banner.admin_message",defaultMessage:"New uploads will automatically archive older files. To view them again, you can delete older files or <a>upgrade to a paid plan.</a>",values:{a:e=>l().createElement("a",{onClick:e=>{e.preventDefault(),b()}},e)}}),P=T?l().createElement(s.FormattedMessage,{id:"create_post.file_limit_sticky_banner.non_admin_message_airgapped",defaultMessage:"New uploads will automatically archive older files. To view them again, contact your admin."}):l().createElement(s.FormattedMessage,{id:"create_post.file_limit_sticky_banner.non_admin_message",defaultMessage:"New uploads will automatically archive older files. To view them again, <a>notify your admin to upgrade to a paid plan.</a>",values:{a:e=>l().createElement(y.A,{ctaText:e,notifyRequestData:{required_plan:v.gS.Professional,required_feature:v.W0.UNLIMITED_FILE_STORAGE,trial_notification:!1}})}});return l().createElement(w,{id:"cloud_file_limit_banner"},l().createElement(c.A,{mode:"warning",variant:"app",onDismiss:()=>{const e={lastSnoozeTimestamp:Date.now()};S((0,d.SF)(k.id,[{category:v.pm.CLOUD_USER_EPHEMERAL_INFO,name:"file_limit_banner_snooze",user_id:k.id,value:JSON.stringify(e)}])),t(!1)},closeBtnTooltip:n({id:"create_post.file_limit_sticky_banner.snooze_tooltip",defaultMessage:"Snooze for {snoozeDays} days"},{snoozeDays:10}),title:O,message:D?C:P}))}}}]);
//# sourceMappingURL=2731.ebe2c87fbcf45ff5a0ad.js.map