(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[850],{80850:function(e,n,t){"use strict";t.r(n),t.d(n,{UserDropdown:function(){return j}});var o=t(85893),r=t(66516),a=t(13013),i=t(71577),l=t(4480),c=t(67294),s=t(46977),u=t(5152),d=t.n(u),f=t(77466),p=t(79252),h=t.n(p);let v=d()(()=>Promise.all([t.e(2074),t.e(8244)]).then(t.t.bind(t,18244,23)),{loadableGenerated:{webpack:()=>[18244]},ssr:!1}),m=d()(()=>Promise.all([t.e(2074),t.e(775)]).then(t.t.bind(t,10775,23)),{loadableGenerated:{webpack:()=>[10775]},ssr:!1}),y=d()(()=>Promise.all([t.e(2074),t.e(6275)]).then(t.t.bind(t,6275,23)),{loadableGenerated:{webpack:()=>[6275]},ssr:!1}),b=d()(()=>Promise.all([t.e(2074),t.e(5672)]).then(t.t.bind(t,65672,23)),{loadableGenerated:{webpack:()=>[65672]},ssr:!1}),k=d()(()=>Promise.all([t.e(2074),t.e(5412)]).then(t.t.bind(t,95412,23)),{loadableGenerated:{webpack:()=>[95412]},ssr:!1}),w=d()(()=>Promise.all([t.e(164),t.e(5402),t.e(4761)]).then(t.bind(t,14761)).then(e=>e.Modal),{loadableGenerated:{webpack:()=>[14761]},ssr:!1}),C=d()(()=>Promise.all([t.e(173),t.e(164),t.e(6386),t.e(9292),t.e(6331)]).then(t.bind(t,59096)).then(e=>e.NameChangeModal),{loadableGenerated:{webpack:()=>[59096]},ssr:!1}),g=d()(()=>Promise.all([t.e(173),t.e(164),t.e(2231),t.e(5818),t.e(4381),t.e(2033)]).then(t.bind(t,50261)).then(e=>e.AuthModal),{loadableGenerated:{webpack:()=>[50261]},ssr:!1}),j=e=>{let{username:n}=e,[t,u]=(0,c.useState)(!1),[d,p]=(0,c.useState)(!1),[j,x]=(0,l.FV)(f.ZA),E=(0,l.sJ)(f.Q),L=()=>{x(!j)},A=()=>{u(!0)};(0,s.y1)("c",L,{enableOnContentEditable:!1},[j]);let _=(0,l.sJ)(f.db);if(!_)return null;let{displayName:P}=_,S=(0,o.jsxs)(r.Z,{children:[(0,o.jsx)(r.Z.Item,{icon:(0,o.jsx)(m,{}),onClick:()=>A(),children:"Change name"},"0"),(0,o.jsx)(r.Z.Item,{icon:(0,o.jsx)(y,{}),onClick:()=>p(!0),children:"Authenticate"},"1"),E.chatAvailable&&(0,o.jsx)(r.Z.Item,{icon:(0,o.jsx)(b,{}),onClick:()=>L(),children:j?"Hide Chat":"Show Chat"},"3")]});return(0,o.jsxs)("div",{id:"user-menu",className:"".concat(h().root),children:[(0,o.jsx)(a.Z,{overlay:S,trigger:["click"],children:(0,o.jsxs)(i.Z,{type:"primary",icon:(0,o.jsx)(k,{className:h().userIcon}),children:[(0,o.jsx)("span",{className:h().username,children:n||P}),(0,o.jsx)(v,{})]})}),(0,o.jsx)(w,{title:"Change Chat Display Name",open:t,handleCancel:()=>u(!1),children:(0,o.jsx)(C,{})}),(0,o.jsx)(w,{title:"Authenticate",open:d,handleCancel:()=>p(!1),children:(0,o.jsx)(g,{})})]})}},79252:function(e){e.exports={root:"UserDropdown_root__IdxfQ","ant-space":"UserDropdown_ant-space__XJTZ3","ant-space-item":"UserDropdown_ant-space-item__w4nC2",userIcon:"UserDropdown_userIcon__A5XgE",username:"UserDropdown_username__nVyPA"}},46977:function(e,n,t){"use strict";t.d(n,{y1:function(){return w}});var o=t(67294);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var n=1;n'),!0):!!(!t||n.some(function(e){return t.includes(e)})||n.includes("*")))){var n,t,o=function(n,t){var o;if(void 0===t&&(t=!1),!h(n,["input","textarea","select"])||h(n,null==C?void 0:C.enableOnFormTags)){if(null!==i.current&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){b(n);return}(null==(o=n.target)||!o.isContentEditable||null!=C&&C.enableOnContentEditable)&&c(e,null==C?void 0:C.splitKey).forEach(function(e){var o,r,a,i=s(e,null==C?void 0:C.combinationKey);if((v(n,i,null==C?void 0:C.ignoreModifiers)||null!=(a=i.keys)&&a.includes("*"))&&!u.current){if(("function"==typeof(o=null==C?void 0:C.preventDefault)&&o(n,i)||!0===o)&&n.preventDefault(),"function"==typeof(r=null==C?void 0:C.enabled)?!r(n,i):!0!==r&&void 0!==r){b(n);return}w(n,i),t||(u.current=!0)}})}},r=function(e){void 0!==e.key&&(f(l(e.code)),((null==C?void 0:C.keydown)===void 0&&(null==C?void 0:C.keyup)!==!0||null!=C&&C.keydown)&&o(e))},a=function(e){void 0!==e.key&&(p(l(e.code)),u.current=!1,null!=C&&C.keyup&&o(e,!0))};return(i.current||(null==d?void 0:d.document)||document).addEventListener("keyup",a),(i.current||(null==d?void 0:d.document)||document).addEventListener("keydown",r),j&&c(e,null==C?void 0:C.splitKey).forEach(function(e){return j.addHotkey(s(e,null==C?void 0:C.combinationKey))}),function(){(i.current||(null==d?void 0:d.document)||document).removeEventListener("keyup",a),(i.current||(null==d?void 0:d.document)||document).removeEventListener("keydown",r),j&&c(e,null==C?void 0:C.splitKey).forEach(function(e){return j.removeHotkey(s(e,null==C?void 0:C.combinationKey))})}}},[e,w,C,g]),i}}}]); //# sourceMappingURL=850.9026c10adc59e0b0.js.map