(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{41788:function(t,e,r){"use strict";r.d(e,{Z:function(){return E}});var n=r(77837),o=r(26304),u=r(62243),c=r(29385),i=r(80022),s=r(99177),f=r(93189),a=r(15544),p=r(82394),l=r(38860),h=r.n(l),y=r(82684),b=r(56663),v=r.n(b),O=r(35490),d=r(55361),w=r(30332),Z=r(9736),_=r(59e3),P=r(28598),g=["auth"];function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function k(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?j(Object(r),!0).forEach((function(e){(0,p.Z)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function m(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,a.Z)(t);if(e){var o=(0,a.Z)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,f.Z)(this,r)}}function E(t){return function(e){(0,s.Z)(f,e);var r=m(f);function f(){var t;(0,u.Z)(this,f);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=r.call.apply(r,[this].concat(n)),(0,p.Z)((0,i.Z)(t),"state",{auth:new O.Z(t.props.token)}),t}return(0,c.Z)(f,[{key:"componentDidMount",value:function(){this.setState({auth:new O.Z(this.props.token)})}},{key:"render",value:function(){var e=this.props,r=(e.auth,(0,o.Z)(e,g));return(0,P.jsx)(t,k({auth:this.state.auth},r))}}],[{key:"getInitialProps",value:function(){var e=(0,n.Z)(h().mark((function e(r){var n,o,u,c,i,s,f,a,p;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=v()(r),o=(0,Z.ex)(r),u=o.id,c=n[d.Mv],i=n[w.qt],s=new O.Z(c),f=k(k({},r),{},{auth:s,currentGroupId:u,theme:i}),(0,Z.YB)(r)&&s.isExpired&&(console.log("OAuth token has expired."),a=k(k({},r.query),{},{redirect_url:r.asPath}),(0,_.nL)("/sign-in?".concat((0,_.uM)(a)),r.res)),!t.getInitialProps){e.next=12;break}return e.next=10,t.getInitialProps(f);case 10:return p=e.sent,e.abrupt("return",k(k({},p),{},{auth:s,currentGroupId:u,theme:i}));case 12:return e.abrupt("return",f);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),f}(y.Component)}},76449:function(t,e,r){"use strict";r.r(e);var n=r(77837),o=r(38860),u=r.n(o),c=r(82684),i=r(34376),s=r(41788),f=function(){var t=(0,i.useRouter)();(0,c.useEffect)((function(){t.replace("/settings/workspace/preferences")}),[t])};f.getInitialProps=(0,n.Z)(u().mark((function t(){return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{});case 1:case"end":return t.stop()}}),t)}))),e.default=(0,s.Z)(f)},73406:function(t,e,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings",function(){return r(76449)}])},80022:function(t,e,r){"use strict";function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}r.d(e,{Z:function(){return n}})},15544:function(t,e,r){"use strict";function n(t){return n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}r.d(e,{Z:function(){return n}})},99177:function(t,e,r){"use strict";function n(t,e){return n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(t,e)}function o(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)}r.d(e,{Z:function(){return o}})},93189:function(t,e,r){"use strict";r.d(e,{Z:function(){return u}});var n=r(12539),o=r(80022);function u(t,e){if(e&&("object"===n(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return(0,o.Z)(t)}}},function(t){t.O(0,[9774,2888,179],(function(){return e=73406,t(t.s=e);var e}));var e=t.O();_N_E=e}]);