2 lines
7.7 KiB
JavaScript
2 lines
7.7 KiB
JavaScript
(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<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e}).apply(this,arguments)}t(85893);var a=["shift","alt","meta","mod"],i={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function l(e){return(i[e]||e).trim().toLowerCase().replace("key","").replace("digit","").replace("numpad","").replace("arrow","")}function c(e,n){return(void 0===n&&(n=","),"string"==typeof e)?e.split(n):e}function s(e,n){void 0===n&&(n="+");var t=e.toLocaleLowerCase().split(n).map(function(e){return l(e)});return r({},{alt:t.includes("alt"),shift:t.includes("shift"),meta:t.includes("meta"),mod:t.includes("mod")},{keys:t.filter(function(e){return!a.includes(e)})})}var u=new Set;function d(e,n){return void 0===n&&(n=","),(Array.isArray(e)?e:e.split(n)).every(function(e){return u.has(e.trim().toLowerCase())})}function f(e){var n=Array.isArray(e)?e:[e];u.has("meta")&&u.forEach(function(e){return!a.includes(e)&&u.delete(e.toLowerCase())}),n.forEach(function(e){return u.add(e.toLowerCase())})}function p(e){var n=Array.isArray(e)?e:[e];"meta"===e?u.clear():n.forEach(function(e){return u.delete(e.toLowerCase())})}function h(e,n){var t=e.target;void 0===n&&(n=!1);var o=t&&t.tagName;return n instanceof Array?Boolean(o&&n&&n.some(function(e){return e.toLowerCase()===o.toLowerCase()})):Boolean(o&&n&&!0===n)}"undefined"!=typeof document&&(document.addEventListener("keydown",function(e){void 0!==e.key&&f([l(e.key),l(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&p([l(e.key),l(e.code)])})),"undefined"!=typeof window&&window.addEventListener("blur",function(){u.clear()});var v=function(e,n,t){void 0===t&&(t=!1);var o=n.alt,r=n.meta,a=n.mod,i=n.shift,c=n.keys,s=e.key,u=e.code,f=d("alt"),p=d("shift"),h=d("meta"),v=d("ctrl"),m=l(u),y=s.toLowerCase();if(!t){if(f!==o&&"alt"!==y||p!==i&&"shift"!==y)return!1;if(a){if(!h&&!v)return!1}else if(h!==r&&v!==r&&"meta"!==m&&"ctrl"!==m)return!1}return!!(c&&1===c.length&&(c.includes(y)||c.includes(m)))||(c?d(c):!c)},m=(0,o.createContext)(void 0),y=(0,o.createContext)({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),b=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},k="undefined"!=typeof window?o.useLayoutEffect:o.useEffect;function w(e,n,t,r){var a,i=(0,o.useRef)(null),u=(0,o.useRef)(!1),d=t instanceof Array?r instanceof Array?void 0:r:t,w=(0,o.useCallback)(n,[].concat(t instanceof Array?t:r instanceof Array?r:[])),C=(!function e(n,t){return n&&t&&"object"==typeof n&&"object"==typeof t?Object.keys(n).length===Object.keys(t).length&&Object.keys(n).reduce(function(o,r){return o&&e(n[r],t[r])},!0):n===t}((a=(0,o.useRef)(void 0)).current,d)&&(a.current=d),a.current),g=(0,o.useContext)(y).enabledScopes,j=(0,o.useContext)(m);return k(function(){if((null==C?void 0:C.enabled)!==!1&&(n=g,t=null==C?void 0:C.scopes,0===n.length&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!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
|