Module 164942

6,513 characters · in no known chunk
Dependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{e:()=>P}),n(321073);var i,r=n(627968),s=n(64700),a=n(919523),o=n(503698),l=n.n(o),u=n(17928),c=n(116833);n(938796);var d=((i={})[i.MOBILE_DARK_GRADIENT_THEME_ENABLED=4]="MOBILE_DARK_GRADIENT_THEME_ENABLED",i[i.MOBILE_LIGHT_GRADIENT_THEME_ENABLED=8]="MOBILE_LIGHT_GRADIENT_THEME_ENABLED",i[i.REDUCED_CONTRAST_ENABLED=16]="REDUCED_CONTRAST_ENABLED",i[i.INCREASED_CONTRAST_ENABLED=32]="INCREASED_CONTRAST_ENABLED",i[i.REDUCE_SATURATION_ENABLED=64]="REDUCE_SATURATION_ENABLED",i),_=n(460890),f=n(38021),h=n(818348);function p(e){let{children:t,theme:n=h.NJ.DARK,primaryColor:i=null,secondaryColor:a=null,gradient:o=null,flags:l=0,contrast:u=1,saturation:c=1,density:d="compact",disableAdaptiveTheme:_=!1,reduceAdaptiveTheme:p=!1}=e,E=s.useMemo(()=>(0,f.dI)({theme:n,primaryColor:i,secondaryColor:a,gradient:o,flags:l,contrast:u,saturation:c,density:d,disableAdaptiveTheme:_,reduceAdaptiveTheme:p}),[n,i,a,o,l,u,c,d,_,p]);return(0,r.jsx)(f.Dx.Provider,{value:E,children:t})}var E=n(775602),m=n(989395),g=n(71855),A=n(267102),I=n(652215);let T=["Shift","Alt","Meta","Control"];var S=n(534409),N=n(614738),y=n(750506),C=n(869146),v=n(773669),O=n(363195),R=n(531685),b=n(19575),D=n(418842),L=n(597619),w=n(571247),M=n(375708);function P(e){let{windowKey:t,themeOverride:n,children:i}=e,o=null!=t,[f]=s.useState(()=>b.Ay.getEnableHardwareAcceleration()),{locale:h,theme:P,focused:x,currentWindow:U,fontScale:k,fontScaleClass:G,keyboardModeEnabled:F,saturation:V,desaturateUserColors:B,useForcedColors:H,systemForcedColors:j,useReducedMotion:Y,alwaysShowLinkDecorations:W,highContrastMode:K}=(0,u.cf)([v.default,E.A,O.A,C.A,R.A],()=>({locale:v.default.locale,theme:n??O.A.theme,focused:o?C.A.getWindowFocused(t):R.A.isFocused(),currentWindow:o?C.A.getWindow(t)??window:window,fontScale:E.A.fontScale,fontScaleClass:E.A.fontScaleClass,keyboardModeEnabled:E.A.keyboardModeEnabled,saturation:E.A.saturation,desaturateUserColors:E.A.desaturateUserColors,useForcedColors:E.A.useForcedColors,systemForcedColors:E.A.systemForcedColors,useReducedMotion:E.A.useReducedMotion,alwaysShowLinkDecorations:E.A.alwaysShowLinkDecorations,highContrastMode:E.A.isHighContrastModeEnabled})),z=function(e,t){let[n,i]=s.useState(0),r=(0,A.aL)();s.useEffect(()=>{let e=()=>i(e=>e+1),t=()=>i(e=>Math.max(0,e-1));return r.subscribe(I.jej.POPOUT_SHOW,e),r.subscribe(I.jej.POPOUT_HIDE,t),()=>{r.unsubscribe(I.jej.POPOUT_SHOW,e),r.unsubscribe(I.jej.POPOUT_HIDE,t)}},[r]);let[a,o]=s.useState(!1);return s.useLayoutEffect(()=>{let i=e=>{(!t||n>0)&&a?o(!1):!a&&n>0||e instanceof KeyboardEvent&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||T.indexOf(e.key)>=0)||o(e=>!e)},r=a?"keyup":"mousemove";return t&&e.addEventListener(r,i),()=>e?.removeEventListener(r,i)},[e,a,n,t]),t&&0===n&&a}(U,__OVERLAY__||x),$=0;1!==V&&($|=d.REDUCE_SATURATION_ENABLED);let q=(0,D.C)(),Z=(0,S.qK)("RootThemeContextProvider"),X=(0,S.k5)("RootThemeContextProvider"),Q=(0,S.lV)("RootThemeContextProvider"),J=(0,N.y)("RootThemeContextProvider"),ee=(0,g.m2)({isPopoutWindow:o}),et=function(e,t,n,i,r){let o=s.useContext(m.A),l=s.useCallback(()=>({i18n:{CANCEL:M.intl.string(M.t["ETE/oC"]),BACK:M.intl.string(M.t["13/7kX"]),NEXT:M.intl.string(M.t.PDTjLN),SUBMIT:M.intl.string(M.t.geKm7t),SPINNER_LOADING_LABEL:M.intl.string(M.t.ZTNur7),BUTTON_LOADING_STARTED_LABEL:M.intl.string(M.t.pfChQr),BUTTON_LOADING_FINISHED_LABEL:M.intl.string(M.t.SVParY),CLOSE_BUTTON_LABEL:M.intl.string(M.t.cpT0Cq),PLAY_BUTTON_LABEL:M.intl.string(M.t.RscU7I),PAUSE_BUTTON_LABEL:M.intl.string(M.t.ZcgDJX),NEW:M.intl.string(M.t.y2b7CA),BETA:M.intl.string(M.t.oW0eUd),EARLY_ACCESS:M.intl.string(M.t.EYxi0o),BILLING_TRIAL_FREE_TRIAL_TEXT:M.intl.string(M.t.IBYG5U),MODAL_DONT_SHOW_AGAIN:M.intl.string(w.default.m3Vfcs),LISTBOX_EMPTY_STATE:M.intl.string(w.default.db85vU),LISTBOX_EMPTY_STATE_WITH_QUERY:e=>M.intl.formatToPlainString(w.default.bPKiId,{query:e}),KEY_CTRL_A11Y_LABEL:M.intl.string(M.t.jm6v8i),KEY_CMD_A11Y_LABEL:M.intl.string(M.t.pYkiQq),KEY_ALT_A11Y_LABEL:M.intl.string(M.t.R2n7d3),KEY_OPTION_A11Y_LABEL:M.intl.string(M.t.FMYSJY),KEY_SHIFT:M.intl.string(M.t["L+jWo5"]),KEY_SHIFT_A11Y_LABEL:M.intl.string(M.t["q+/2+S"]),KEY_UP_A11Y_LABEL:M.intl.string(M.t.HxzHDb),KEY_DOWN_A11Y_LABEL:M.intl.string(M.t["a+iRlH"]),KEY_LEFT_A11Y_LABEL:M.intl.string(M.t.xFjIVC),KEY_RIGHT_A11Y_LABEL:M.intl.string(M.t["BT3jf/"]),KEY_PAGEUP:M.intl.string(M.t.VdCWGI),KEY_PAGEDOWN:M.intl.string(M.t.gpSh3U),KEY_ANY:M.intl.string(M.t.CkGpcV),KEY_ENTER:M.intl.string(M.t.SUweGy),KEY_ENTER_A11Y_LABEL:M.intl.string(M.t.yLNala),KEY_RETURN_A11Y_LABEL:M.intl.string(M.t.V7nPj0),KEY_ESCAPE:M.intl.string(M.t.cQmsQF),KEY_ESCAPE_A11Y_LABEL:M.intl.string(M.t["2qsw5/"]),KEY_BACKSPACE:M.intl.string(M.t["L+36+h"]),KEY_BACKSPACE_A11Y_LABEL:M.intl.string(M.t["9c/Ikv"]),KEY_DELETE_A11Y_LABEL:M.intl.string(M.t.BTFDmq),DATE_INPUT_OPEN_CALENDAR_LABEL:M.intl.string(w.default.I8kUqR),CALENDAR_PREVIOUS_MONTH_LABEL:M.intl.string(w.default.raS6yf),CALENDAR_NEXT_MONTH_LABEL:M.intl.string(w.default["/cp93l"]),INLINE_NOTICE_GENERIC_ERROR:M.intl.string(M.t["rTU7/z"]),STEP_INDICATOR:(e,t)=>M.intl.formatToPlainString(w.default["v2YSk/"],{stepNumber:e,stepCount:t}),SELECT_PLACEHOLDER:M.intl.string(w.default["A+pfVR"]),CLEAR_SELECTION:M.intl.string(w.default.JA5C7L),SELECTED_TAGS_HEADING:M.intl.string(w.default.VMNfsY),PERCENT_COMPLETE:e=>M.intl.formatToPlainString(w.default["2L/ygS"],{percent:e})},locale:r,theme:e,saturation:t,defaultLayerContext:y.uY,experiments:{enabledExperiments:n},trackImpression:o,isWindowFocused:()=>i,dynamicGraphicComponents:c.Q}),[e,t,n,o,i,r]),[u,d]=s.useState(l);return s.useLayoutEffect(()=>{function e(){d(l)}(0,a.waitForAllDefaultIntlMessagesLoaded)().then(e),M.intl.onLocaleChange(e)},[l]),u}(P,V,s.useMemo(()=>{let e=[];return Z&&e.push("refresh-fast-follow-avatars"),X&&e.push("refresh-fast-follow-guild-bg"),Q&&e.push("refresh-fast-follow-distinct-borders"),J&&e.push("mana-toggle-inputs"),e},[Z,X,Q,J]),x,h);return(0,r.jsx)(_.GE,{value:et,children:(0,r.jsx)(p,{theme:P,flags:$,saturation:V,density:q,children:(0,r.jsx)(L.fs,{lang:h,theme:P,density:q,focused:x,fontScale:k,fontScaleClass:G,keyboardModeEnabled:F,mouseMode:z,saturation:V,desaturateUserColors:B,useForcedColors:H,systemForcedColors:j,useReducedMotion:Y,alwaysShowLinkDecorations:W,hardwareAccelerationEnabled:f,highContrastMode:K,isPopoutWindow:o,rootClassName:l()(ee,{"refresh-fast-follow-avatars":Z,"refresh-fast-follow-guild-bg":X,"refresh-fast-follow-distinct-borders":Q}),children:i})})})}}