EVOLUTION-MANAGER
Edit File: 2.b874fd45aab5c64eee6f.js
(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{1343:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(4),r=o(10),s=o(180),a=o(20);t.autoUpdateTimezone=function(e){var t=this;return function(o,i){return n.__awaiter(t,void 0,void 0,(function(){var t,c,d,p,u;return n.__generator(this,(function(m){return t=r.getCurrentUser(i()),c=s.getUserTimezone(i(),t.id),d=c.automaticTimezone!==e,c.useAutomaticTimezone&&d&&(p={useAutomaticTimezone:"true",automaticTimezone:e,manualTimezone:c.manualTimezone},u=n.__assign(n.__assign({},t),{timezone:p}),a.updateMe(u)(o,i)),[2]}))}))}}},1488:function(e,t,o){"use strict";o.r(t);o(138);var n=o(309),r=o(6),s=o(1343),a=o(13),i=o(15),c=o(10),d=o(1399),p=o(96),u=o.n(p),m=o(33),l=o.n(m),h=o(7),f=o.n(h),v=o(1105),w=o(36),b=o(333),_=o.n(b),g=o(1120),C=o(1210),y=o(17),T=o(1119),k=o(184),O=o(11),U=o(1348),z=o(95),j=o(14);function L(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const E=O.a.dispatch,R=O.a.getState,x=8;class I extends f.a.PureComponent{constructor(e){super(e),L(this,"onDesktopMessageListener",({origin:e,data:{type:t,message:o={}}={}}={})=>{if(this.props.currentUser&&e===window.location.origin)switch(t){case"register-desktop":{const{version:e}=o;window.desktop||(window.desktop={}),window.desktop.version=_.a.valid(_.a.coerce(e));break}case"user-activity-update":{const{userIsActive:e,manual:t}=o;!0!==e&&!1!==e||U.a.userUpdateActiveStatus(e,t);break}case"notification-clicked":{const{channel:e,teamId:t}=o;window.focus(),z.a.push(Object(j.q)(e,t));break}}});const t=document.getElementById("root");t&&(t.className+=" channel-view")}isValidState(){return null!=this.props.currentUser}componentDidMount(){C.b(),this.props.enableTimezone&&this.props.actions.autoUpdateTimezone(Object(k.a)()),u()(window).on("beforeunload",()=>{u()(window).off("beforeunload"),document.cookie.indexOf("MMUSERID=")>-1&&Object(w.viewChannel)("",this.props.currentChannelId||"")(E,R),C.a()}),window.addEventListener("focus",this.onFocusListener),window.addEventListener("blur",this.onBlurListener),window.addEventListener("message",this.onDesktopMessageListener),window.postMessage({type:"webapp-ready"},window.location.origin),y.h()?u()("body").addClass("ios"):y.a()&&u()("body").addClass("android"),this.props.currentUser||(u()("#root").attr("class",""),g.e("/login?redirect_to="+encodeURIComponent(this.props.location.pathname),!0,!1)),u()("body").on("mouseenter mouseleave",":not(.post-list__dynamic) .post",(function(e){"mouseenter"===e.type?(u()(this).prev(".date-separator, .new-separator").addClass("hovered--after"),u()(this).next(".date-separator, .new-separator").addClass("hovered--before")):(u()(this).prev(".date-separator, .new-separator").removeClass("hovered--after"),u()(this).next(".date-separator, .new-separator").removeClass("hovered--before"))})),u()("body").on("mouseenter mouseleave",".search-item__container .post",(function(e){"mouseenter"===e.type?(u()(this).closest(".search-item__container").find(".date-separator").addClass("hovered--after"),u()(this).closest(".search-item__container").next("div").find(".date-separator").addClass("hovered--before")):(u()(this).closest(".search-item__container").find(".date-separator").removeClass("hovered--after"),u()(this).closest(".search-item__container").next("div").find(".date-separator").removeClass("hovered--before"))})),u()("body").on("mouseenter mouseleave",":not(.post-list__dynamic) .post.post--comment.same--root",(function(e){"mouseenter"===e.type?(u()(this).prev(".date-separator, .new-separator").addClass("hovered--comment"),u()(this).next(".date-separator, .new-separator").addClass("hovered--comment")):(u()(this).prev(".date-separator, .new-separator").removeClass("hovered--comment"),u()(this).next(".date-separator, .new-separator").removeClass("hovered--comment"))})),u()(window).on("keydown.preventBackspace",e=>{e.which!==x||u()(e.target).is("input, textarea")||e.preventDefault()})}componentWillUnmount(){C.a(),u()("body").off("click.userpopover"),u()("body").off("mouseenter mouseleave",".post"),u()("body").off("mouseenter mouseleave",".post.post--comment.same--root"),u()(".modal").off("show.bs.modal"),u()(window).off("keydown.preventBackspace"),window.removeEventListener("focus",this.onFocusListener),window.removeEventListener("blur",this.onBlurListener),window.removeEventListener("message",this.onDesktopMessageListener)}render(){if(!this.isValidState())return f.a.createElement(T.a,null);if(this.props.mfaRequired){if("/mfa/setup"!==this.props.location.pathname)return f.a.createElement(v.a,{to:"/mfa/setup"})}else if("/mfa/confirm"===this.props.location.pathname);else if(this.props.showTermsOfService&&"/terms_of_service"!==this.props.location.pathname)return f.a.createElement(v.a,{to:"/terms_of_service?redirect_to="+encodeURIComponent(this.props.location.pathname)});return this.props.children}onFocusListener(){g.a(!0)}onBlurListener(){g.a(!1)}}L(I,"propTypes",{currentUser:l.a.object,currentChannelId:l.a.string,children:l.a.object,mfaRequired:l.a.bool.isRequired,enableTimezone:l.a.bool.isRequired,actions:l.a.shape({autoUpdateTimezone:l.a.func.isRequired}).isRequired,showTermsOfService:l.a.bool.isRequired});t.default=Object(n.connect)((function(e,t){const o=Object(i.getLicense)(e),n=Object(i.getConfig)(e),r=Object(c.shouldShowTermsOfService)(e);return{currentUser:Object(c.getCurrentUser)(e),currentChannelId:Object(a.getCurrentChannelId)(e),mfaRequired:Object(d.a)(Object(c.getCurrentUser)(e),o,n,t.match.url),enableTimezone:"true"===n.ExperimentalTimezone,showTermsOfService:r}}),(function(e){return{actions:Object(r.bindActionCreators)({autoUpdateTimezone:s.autoUpdateTimezone},e)}}))(I)}}]); //# sourceMappingURL=2.b874fd45aab5c64eee6f.js.map