"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[2974],{92974:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var E=n(37270),r=n(78451),c=n(36418);const a={emitBrowserWindowResized:function(e){let t=e;if(!e){const e=window.innerWidth;switch(!0){case e>r.YM.TABLET_SCREEN_WIDTH&&e<=r.YM.DESKTOP_SCREEN_WIDTH:t=r.$x.SMALL_DESKTOP_VIEW;break;case e>r.YM.MOBILE_SCREEN_WIDTH&&e<=r.YM.TABLET_SCREEN_WIDTH:t=r.$x.TABLET_VIEW;break;case e<=r.YM.MOBILE_SCREEN_WIDTH:t=r.$x.MOBILE_VIEW;break;default:t=r.$x.DESKTOP_VIEW}}return{type:r.Q3.BROWSER_WINDOW_RESIZED,data:t}}},i=(0,E.connect)(null,a)((function(e){const t=(0,c.useRef)(window.matchMedia("(min-width: ".concat(r.Ay.DESKTOP_SCREEN_WIDTH+1,"px)"))),n=(0,c.useRef)(window.matchMedia("(min-width: ".concat(r.Ay.TABLET_SCREEN_WIDTH+1,"px) and (max-width: ").concat(r.Ay.DESKTOP_SCREEN_WIDTH,"px)"))),E=(0,c.useRef)(window.matchMedia("(min-width: ".concat(r.Ay.MOBILE_SCREEN_WIDTH+1,"px) and (max-width: ").concat(r.Ay.TABLET_SCREEN_WIDTH,"px)"))),a=(0,c.useRef)(window.matchMedia("(max-width: ".concat(r.Ay.MOBILE_SCREEN_WIDTH,"px)"))),i=(0,c.useCallback)((()=>{t.current.matches?e.emitBrowserWindowResized(r.$x.DESKTOP_VIEW):n.current.matches?e.emitBrowserWindowResized(r.$x.SMALL_DESKTOP_VIEW):E.current.matches?e.emitBrowserWindowResized(r.$x.TABLET_VIEW):a.current.matches&&e.emitBrowserWindowResized(r.$x.MOBILE_VIEW)}),[]);return(0,c.useLayoutEffect)((()=>{i()}),[i]),(0,c.useEffect)((()=>{const e=e=>{e.matches&&i()};return t.current.addEventListener("change",e),n.current.addEventListener("change",e),E.current.addEventListener("change",e),a.current.addEventListener("change",e),()=>{t.current.removeEventListener("change",e),n.current.removeEventListener("change",e),E.current.removeEventListener("change",e),a.current.removeEventListener("change",e)}}),[i]),null}))}}]);
//# sourceMappingURL=2974.d224de60982443bb90ad.js.map