Loading
Showing the first 250,000 characters. Open raw for the full source.
function(e,t,n){n.d(t,{D:()=>jB});var i,l,s,r,a,o,u,d,c,g,m,A,E,h=n(419954),S=n(780964),T=n(550640),f=n(374193),p=n(477900),x=n(582128),I=n(855986),_=n(652215),b=n(346055),N=n(534514),C=n(95362),y=n(97808),v=n(778712),j=n(821609),O=n(775602),R=n(432005),D=n(963852),L=n(763754),P=n(20851),G=n(95701),M=n(486020),U=n(253932),V=n(792996),k=n(345016);let w=new G.nA({id:"1337",guild_id:"1337",type:_.rbe.GUILD_TEXT,name:"preview"}),F=[{status:_.clD.IDLE,discriminator:"2"},{status:_.clD.DND,discriminator:"3"},{status:_.clD.ONLINE,mobile:!0,discriminator:"4"}];function B(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,R.rh)({...(0,D.Ay)({channelId:w.id,content:e}),state:_.cmJ.SENT,reactions:t})}var X=n(471245);let z=(0,h.zD)(S.X.ENABLE_LEGACY_CHAT_INPUT,{useTitle:()=>V.intl.string(V.t.TZ2hZH),useSubtitle:()=>V.intl.string(V.t.Q7wgHc),useValue:()=>U.D_.useSetting(),setValue:e=>U.D_.updateSetting(e)}),H=(0,h.zD)(S.X.CHAT_INLINE_MEDIA_IMAGE_DESCRIPTIONS,{useTitle:()=>V.intl.string(V.t.XYvMIX),useSubtitle:()=>V.intl.string(V.t.T0rbtM),useValue:U._z.useSetting,setValue:U._z.updateSetting});var Y=n(100767),W=n(435558),K=n.n(W),Z=n(935399),q=n(331322),Q=n(893007),J=n(113494),$=n(782134),ee=n(54570),et=n(8880),en=n(75804);let ei=K().debounce(e=>{(0,ee.zU)(e)},250);function el(e){return 0===e?{value:e,label:V.intl.string(V.t["493lwX"])}:10===e?{value:e,label:V.intl.string(V.t.ZSZEdS)}:1===e?{value:e,label:"x1.0"}:{value:e,label:e%1==0?"":void 0}}function es(){let[e,t]=x.useState(!1);return(0,Z.l0)(()=>(0,ee.pr)()),(0,p.jsx)(j.$,{text:V.intl.string(V.t.SKNnqq),icon:e?J.PauseIcon:$.PlayIcon,size:"sm",onClick:function(){if(e){(0,ee.pr)(),t(!1);return}(0,ee.AU)(V.intl.string(V.t.PKaNJL),!0,void 0,function(){return t(!0)},function(){return t(!1)}),t(!0)}})}let er=(0,h.E2)(S.X.TTS_PLAYBACK_RATE,{useSearchTerms:()=>[V.intl.string(V.t.lsW5Ev)],Component:function(){let e=(0,I.bG)([et.A],()=>et.A.speechRate);return(0,p.jsxs)(q.B,{gap:16,children:[(0,p.jsx)(Q.A,{label:V.intl.string(V.t.lsW5Ev),description:V.intl.string(V.t.Ci4wMS),marks:en.P.map(el),defaultValue:e,defaultMark:1,snapToMarks:!0,minValue:en.P["0"],maxValue:en.P[en.P.length-1],onChangeEnd:ei,formatValue:e=>`x${e.toFixed(2)}`}),(0,p.jsx)(es,{})]})},usePredicate:()=>Y.$j}),ea=(0,h.zZ)(S.X.AUDIO_AND_SCREEN_READER_CATEGORY,{useTitle:()=>V.intl.string(V.t.XVR0Rb),buildLayout:()=>[er,H,z]}),eo=(0,h.AK)(S.X.ACCESSIBILITY_TO_DISPLAY_NAVIGATOR,{useSubtitle:()=>V.intl.string(V.t.aTfeGK),destinationKey:S.X.APPEARANCE_PANEL}),eu=(0,h.gN)(S.X.COLOR_AND_CONTRAST_RELATED_SETTINGS,{buildLayout:()=>[eo]});var ed=n(955572);let ec=(0,h.zD)(S.X.DESATURATE_CUSTOM_COLORS,{useTitle:()=>V.intl.string(V.t.OCJg5f),useSubtitle:()=>V.intl.string(V.t.HEO0s3),useValue:()=>(0,I.bG)([O.Ay],()=>O.Ay.desaturateUserColors),setValue:()=>(0,ed.YV)()});var eg=n(652525);let em=(0,h.zD)(S.X.ENABLE_CUSTOM_CURSOR,{useTitle:()=>V.intl.string(V.t["+Isihb"]),useSubtitle:()=>V.intl.string(V.t.nNZ1Tz),useValue:()=>(0,I.bG)([O.Ay],()=>O.Ay.enableCustomCursor),setValue:e=>(0,ed.ts)(e),usePredicate:()=>(0,eg.t)("EnableCustomCursorSetting")}),eA=(0,h.zD)(S.X.ENABLE_SWITCH_ICONS,{useTitle:()=>V.intl.string(V.t["S3z+pV"]),useSubtitle:()=>V.intl.string(V.t["3QuI9+"]),useValue:()=>(0,I.bG)([O.Ay],()=>O.Ay.isSwitchIconsEnabled),setValue:e=>(0,ed.Gm)(e),hasIcon:!0});var eE=n(554146);let eh=(0,h.zD)(S.X.HIGH_CONTRAST_MODE,{useTitle:()=>V.intl.string(V.t.aZlePv),useSubtitle:()=>V.intl.string(V.t["v2qF8+"]),useValue:()=>(0,I.bG)([O.Ay],()=>O.Ay.isHighContrastModeEnabled),setValue:e=>(0,ed.uh)(e?O._1.HIGH:O._1.DEFAULT),getDismissibleBadges:()=>[{badgeType:f.Xi.NEW,dismissibleContent:eE.M.ACCESSIBILITY_HIGH_CONTRAST_MODE_NEW_BADGE}]});var eS=n(406360),eT=n(964404);let ef=(0,h.Qx)(S.X.HIGH_DYNAMIC_RANGE,{useTitle:()=>V.intl.string(V.t.nemtgW),useSubtitle:()=>V.intl.string(V.t["O/Gjvn"]),usePersistentBadge:()=>({badgeType:f.Xi.BETA}),useOptions:function(){return x.useMemo(()=>[{name:V.intl.string(V.t.D5Fma9),desc:V.intl.string(V.t.Qj75ck),value:"no-limit"},{name:V.intl.string(V.t.ldcGIH),desc:V.intl.string(V.t["+V/bDk"]),value:"standard"}],[])},usePredicate:function(){return(0,eS.i)("HDRDynamicRangeSetting")},setValue:function(e){(0,ed.FU)(e)},useValue:function(){return(0,I.bG)([eT.Ay],()=>eT.Ay.hdrDynamicRange)},useSearchTerms:()=>["HDR",V.intl.string(V.t["O/Gjvn"])]}),ep=(0,h.Hn)(S.X.OFFICIAL_MESSAGE_STYLE,{useTitle:()=>V.intl.string(V.t.nC2XBl),useSubtitle:()=>V.intl.string(V.t.a3IPrX),useOptions:()=>[{id:"default",label:V.intl.string(V.t.ERaS6f),value:"default"},{id:"no_text_color",label:V.intl.string(V.t.JKfipk),value:"no_text_color"},{id:"no_gradient",label:V.intl.string(V.t.O2vBoY),value:"no_gradient"},{id:"hidden",label:V.intl.string(V.t["+loyQl"]),value:"hidden"}],useValue:()=>(0,I.bG)([O.Ay],()=>O.Ay.officialMessageStyle),setValue:e=>(0,ed.w_)(e)}),ex=(0,h.Hn)(S.X.ROLE_STYLE,{useTitle:()=>V.intl.string(V.t.uSOPWm),useSubtitle:()=>V.intl.string(V.t.u7fFKS),useOptions:()=>[{id:"username",label:V.intl.string(V.t.eDdMzJ),value:"username"},{id:"dot",label:V.intl.string(V.t.rdmJp0),value:"dot"},{id:"hidden",label:V.intl.string(V.t.Ji2EVJ),value:"hidden"}],useValue:()=>(0,I.bG)([O.Ay],()=>O.Ay.roleStyle),setValue:e=>(0,ed.IX)(e)});(0,h.Qx)(S.X.ROLE_STYLE,{useTitle:()=>V.intl.string(V.t.uSOPWm),useSubtitle:()=>V.intl.string(V.t["86hjzQ"]),useOptions:()=>[{name:V.intl.string(V.t.YEOEi6),value:"username"},{name:V.intl.string(V.t.mQaro3),value:"dot"},{name:V.intl.string(V.t.Ji2EVJ),value:"hidden"}],useValue:()=>(0,I.bG)([O.Ay],()=>O.Ay.roleStyle),setValue:e=>(0,ed.IX)(e)});let eI=(0,h.sN)(S.X.SATURATION,{useTitle:()=>V.intl.string(V.t["5PWWCY"]),useSubtitle:()=>V.intl.string(V.t.xf5S6P),markers:_.hH7.SATURATION_INCREMENTS,onMarkerRender:e=>100*e%2==0?`${100*e}%`:void 0,stickToMarkers:!0,minValue:0,maxValue:1,getInitialValue:()=>O.Ay.saturation,asValueChanges:e=>(0,ed.HU)(e)});var e_=n(964486),eb=n(839214),eN=n(502229),eC=n(975571);let ey=(0,eb.D)(()=>({syncEnabled:null,updateTimeout:null})),ev=(0,h.zD)(S.X.SYNC_FORCED_COLORS,{useTitle:()=>V.intl.string(V.t.cguiec),useSubtitle:()=>V.intl.format(V.t.GwEVE2,{learnMoreLink:eC.A.getArticleURL(_.MVz.FORCED_COLORS)}),useValue:()=>{let e=(0,I.bG)([O.Ay],()=>O.Ay.syncForcedColors);return(0,e_.Ay)(()=>{ey.setState({syncEnabled:O.Ay.syncForcedColors})}),ey.useState(e=>e.syncEnabled)??e},setValue:e=>{let{updateTimeout:t}=ey.getState();if(null!=t){clearTimeout(t),ey.setState({syncEnabled:e,updateTimeout:null});return}if(e===O.Ay.syncForcedColors)return void ey.setState({syncEnabled:e});let n=setTimeout(()=>{(0,ed.D3)(e),ey.setState({updateTimeout:null})},150);ey.setState({syncEnabled:e,updateTimeout:n})},usePredicate:()=>(0,eN.D)()}),ej=(0,h.zZ)(S.X.COLOR_AND_CONTRAST_CATEGORY,{useTitle:()=>V.intl.string(V.t.JqvyiY),buildLayout:()=>[eI,ec,eh,em,ev,ef,ex,ep,eA,eu]});var eO=n(397438),eR=n(355097),eD=n(571674);function eL(e){return(0,I.bG)([eO.A],()=>(function(e){switch(e){case eR._A.REDUCED_MOTION:return V.intl.format(V.t["1dT9V4"],{});case eR._A.REDUCED_MOTION_STICKERS:return V.intl.string(V.t["2ExvRu"]);case eR._A.GAME_MODE:return V.intl.string(eD.default.VGcdxP);default:return}})(eO.A.getAppliedOverrideReasonKey(e)))}function eP(e){return(0,I.bG)([eO.A],()=>eO.A.getAppliedOverrideReasonKey(e)===eR._A.GAME_MODE)}let eG=(0,h.zD)(S.X.ANIMATE_EMOJIS,{useTitle:()=>V.intl.string(V.t.iIaOlc),useSubtitle:()=>eL("animateEmoji"),useDisabled:()=>eP("animateEmoji"),useValue:()=>U.Sf.useSetting(),setValue:e=>U.Sf.updateSetting(e)}),eM=(0,h.zD)(S.X.ANIMATE_GIFS,{useTitle:()=>V.intl.string(V.t.wqsK7q),useSubtitle:()=>eL("gifAutoPlay"),useDisabled:()=>eP("gifAutoPlay"),useValue:()=>U.kt.useSetting(),setValue:e=>U.kt.updateSetting(e)});var eU=n(823894);let eV=(0,h.Qx)(S.X.ANIMATE_STICKERS,{useTitle:()=>V.intl.string(V.t.sBHIh0),useSubtitle:()=>eL("animateStickers"),useDisabled:()=>eP("animateStickers"),useOptions:()=>[{name:V.intl.string(V.t["Xp+X2U"]),value:eU.BJ.ALWAYS_ANIMATE},{name:V.intl.string(V.t.IlLT7e),desc:V.intl.string(V.t.bIW9Tl),value:eU.BJ.ANIMATE_ON_INTERACTION},{name:V.intl.string(V.t.IGu8x3),value:eU.BJ.NEVER_ANIMATE}],useValue:()=>U.S0.useSetting(),setValue:e=>U.S0.updateSetting(e)}),ek=(0,h.zD)(S.X.REDUCED_MOTION,{useTitle:()=>V.intl.string(V.t.b3XBzg),useSubtitle:()=>V.intl.format(V.t.XqvxJc,{helpdeskArticle:eC.A.getArticleURL(_.MVz.REDUCED_MOTION)}),useValue:()=>(0,I.bG)([O.Ay],()=>O.Ay.prefersReducedMotion),setValue:e=>(0,ed.qz)(e?"reduce":"no-preference")}),ew=(0,h.zD)(S.X.SYNC_REDUCED_MOTION,{useTitle:()=>V.intl.string(V.t.oL55A6),useValue:()=>(0,I.bG)([O.Ay],()=>"auto"===O.Ay.rawPrefersReducedMotion),setValue:e=>(0,ed.qz)(e?"auto":O.Ay.systemPrefersReducedMotion)});function eF(e){return V.intl.formatToPlainString(V.t.pyvjRp,{seconds:e})}let eB=(0,h.sN)(S.X.TOAST_DURATION,{useTitle:()=>V.intl.string(V.t["3oxlia"]),useSubtitle:()=>V.intl.string(V.t.CZ3jxp),markers:_.hH7.TOAST_DURATION_SECOND_INCREMENTS,onMarkerRender:e=>e%5==0||e===_.hH7.TOAST_DURATION_MIN_SECONDS||e===_.hH7.TOAST_DURATION_MAX_SECONDS?eF(e):void 0,onValueRender:eF,stickToMarkers:!0,minValue:_.hH7.TOAST_DURATION_MIN_SECONDS,maxValue:_.hH7.TOAST_DURATION_MAX_SECONDS,useDefaultValue:()=>_.hH7.TOAST_DURATION_DEFAULT_MS/1e3,getInitialValue:()=>O.Ay.minToastDurationMs/1e3,asValueChanges:e=>(0,ed.E7)(1e3*e)}),eX=(0,h.zZ)(S.X.MOTION_CATEGORY,{useTitle:()=>V.intl.string(V.t.e3TR1b),buildLayout:()=>[ek,ew,eB,eM,eG,eV]});var ez=n(688810),eH=n(259065),eY=n(842671);let eW=(0,h.zD)(S.X.DISPLAY_NAME_STYLES,{useTitle:()=>V.intl.string(eY.default["2gFUEw"]),useSubtitle:()=>{let{analyticsLocations:e}=(0,ez.Ay)();return V.intl.format(eY.default.aEax6P,{onClickOpenModal(){(0,eH.L)({analyticsLocations:e})}})},useValue:()=>(0,I.bG)([O.Ay],()=>O.Ay.displayNameStylesEnabled),setValue:e=>(0,ed.Dm)(e)});function eK(e){return`${e.toFixed(0)}px`}let eZ=(0,h.sN)(S.X.APPEARANCE_FONT_SCALING,{useTitle:()=>V.intl.string(V.t.rT3Pq5),useSubtitle:()=>V.intl.string(V.t.LXUhen),markers:_.hH7.FONT_SIZES,stickToMarkers:!0,minValue:_.hH7.FONT_SIZES["0"],maxValue:_.hH7.FONT_SIZES[_.hH7.FONT_SIZES.length-1],useDefaultValue:()=>_.hH7.FONT_SIZE_DEFAULT,getInitialValue:()=>O.Ay.fontSize,onValueRender:eK,onMarkerRender:eK,asValueChanges:e=>(0,ed.XS)(e)}),eq=(0,h.zD)(S.X.UNDERLINE_LINKS,{useTitle:()=>V.intl.string(V.t.OLZFB8),useSubtitle:()=>V.intl.string(V.t.DIX3ke),useValue:()=>(0,I.bG)([O.Ay],()=>O.Ay.alwaysShowLinkDecorations),setValue:e=>(0,ed.kI)(e)}),eQ=(0,h.zZ)(S.X.TEXT_READABILITY_CATEGORY,{useTitle:()=>V.intl.string(V.t["bxh/R7"]),buildLayout:()=>[eZ,eq,eW]});var eJ=n(873298);let e$=(0,h.Qx)(S.X.APPEARANCE_UI_DENSITY,{useTitle:()=>V.intl.string(V.t["C/5V0A"]),useSubtitle:()=>V.intl.string(V.t.QLZhYk),useSearchTerms:()=>["List Spacing"],useOptions:()=>[{name:V.intl.string(V.t["7iegX4"]),value:eJ.NS.COMPACT},{name:V.intl.string(V.t.bBvAEH),value:eJ.NS.DEFAULT},{name:V.intl.string(V.t["4cuYHx"]),value:eJ.NS.COZY}],useValue:()=>U.Xi.useSetting(),setValue:e=>{e!==eJ.NS.UNSET_UI_DENSITY&&U.Xi.updateSetting(e)}}),e0="cozy",e1="compact",e2=(0,h.Qx)(S.X.APPEARANCE_MESSAGE_DISPLAY_MODE,{useTitle:()=>V.intl.string(V.t.nKRoPv),useSubtitle:()=>V.intl.string(V.t.QntEEG),useSearchTerms:()=>[V.intl.string(V.t.ZEoGMd)],useOptions:()=>[{name:V.intl.string(V.t.Jqj4cZ),value:e0},{name:V.intl.string(V.t["1JNcPS"]),value:e1}],useValue:()=>U.hH.useSetting()?e1:e0,setValue:e=>{U.hH.updateSetting(e===e1),(0,ed.AC)()}});var e3=n(381941);function e5(e){return`${e.toFixed(0)}px`}let e4=(0,h.sN)(S.X.APPEARANCE_MESSAGE_GROUP_SPACING,{useTitle:()=>V.intl.string(V.t.Q6lKkg),useSubtitle:()=>V.intl.string(V.t.p7eUrb),markers:e3.qh,stickToMarkers:!0,minValue:e3.qh["0"],maxValue:e3.qh[e3.qh.length-1],useDefaultValue:()=>16*!U.hH.useSetting(),useExternalValue:()=>(0,I.bG)([O.Ay],()=>O.Ay.messageGroupSpacing),getInitialValue:()=>O.Ay.messageGroupSpacing,onValueRender:e5,onMarkerRender:e5,asValueChanges:e=>{switch(e){case 0:case 4:case 8:case 16:case 24:(0,ed.AC)(e)}}});var e6=n(775121),e8=n(723702);let e7=(0,h.sN)(S.X.APPEARANCE_ZOOM,{usePredicate:()=>e8.isPlatformEmbedded,useTitle:()=>V.intl.string(V.t.i19n5L),useSubtitle:()=>V.intl.format(V.t["x9PK/3"],{modKey:e6.A.modKey}),markers:_.hH7.ZOOM_SCALES,stickToMarkers:!0,minValue:_.hH7.ZOOM_SCALES["0"],maxValue:_.hH7.ZOOM_SCALES[_.hH7.ZOOM_SCALES.length-1],useDefaultValue:()=>_.hH7.ZOOM_DEFAULT,getInitialValue:()=>O.Ay.zoom,useExternalValue:()=>(0,I.bG)([O.Ay],()=>O.Ay.zoom),onValueRender:function(e){return`${e.toFixed(0)}%`},setValue:e=>(0,ed.Qp)(e),useSearchTerms:()=>[V.intl.string(V.t.ip0uSf)]}),e9=(0,h.zZ)(S.X.VISUAL_DENSITY_CATEGORY,{useTitle:()=>V.intl.string(V.t.VKYWk8),buildLayout:()=>[e$,e2,e4,e7]}),te=(0,h.t_)(S.X.ACCESSIBILITY_PANEL,{useTitle:()=>V.intl.string(V.t.G0neg7),buildLayout:()=>[eQ,e9,ej,eX,ea],decoration:{type:f.t9.STRONGLY_DISCOURAGED_CUSTOM,component:function(){let e=U.hH.useSetting(),t=U.jW.useSetting(),n=x.useMemo(()=>[B(V.intl.formatToPlainString(V.t.BknJRT,{}),t?[{emoji:{id:null,name:"\uD83E\uDD40",animated:!1},me:!0,count:3,me_burst:!1,burst_count:0},{emoji:{id:null,name:"\uD83E\uDEA4",animated:!1},me:!1,count:1,me_burst:!1,burst_count:0}]:[]),B(V.intl.formatToPlainString(V.t["4rDfgM"],{link:"https://discord.com/accessibility"}))],[t]),i=(0,I.bG)([O.Ay],()=>O.Ay.messageGroupSpacing);return(0,p.jsx)(b.M,{children:(0,p.jsxs)("section",{"aria-label":V.intl.string(V.t.RC22qg),children:[(0,p.jsx)(N.D,{variant:"body-md/medium",color:"text-muted",className:k.Vf,children:V.intl.string(V.t.RC22qg)}),(0,p.jsxs)(C.Ip,{className:k.VH,children:[(0,p.jsx)("ol",{className:k.DZ,style:{gap:i},"aria-label":V.intl.string(V.t.xfjsEV),children:n.map(t=>(0,p.jsx)("li",{children:(0,p.jsx)(P.A,{message:t,channel:w,compact:e,author:{...(0,L.p_)(t),colorString:"#dd80f4"}})},t.id))}),(0,p.jsxs)("div",{className:k.Jb,children:[(0,p.jsx)("div",{className:k.HD,children:F.map(e=>{let{status:t,discriminator:n,mobile:i=!1}=e;return(0,p.jsx)(y.eu,{status:t,isMobile:i,size:v._3.SIZE_32,src:M.Ay.getDefaultAvatarURL(void 0,n),"aria-label":V.intl.string(V.t.VKE5TK)},t)})}),(0,p.jsx)(j.$,{text:V.intl.string(V.t["2RHHgz"]),size:"sm",variant:"primary"})]})]})]})})},sticky:!0}}),tt=(0,h.i4)(S.X.ACCESSIBILITY_SIDEBAR_ITEM,{useTitle:()=>V.intl.string(V.t.G0neg7),icon:T.AccessibilityIcon,useMenu:X.A,buildLayout:()=>[te]});n(321073);var tn=n(650809),ti=n(477782),tl=n(620632),ts=n(73153),tr=n(74396),ta=n(269880),to=n(55619),tu=n(351906),td=n(129230),tc=n(189081);let tg=(0,h.zD)(S.X.SHOW_GAME_LIBRARY,{usePredicate:()=>(0,I.bG)([tc.A],()=>tc.A.hasLibraryApplication()),useTitle:()=>V.intl.string(V.t.fi3UQN),useSubtitle:()=>V.intl.string(V.t["8mYp37"]),useValue:()=>!U.l_.useSetting(),setValue:e=>U.l_.updateSetting(!e)}),tm=(0,h.zZ)(S.X.APPEARANCE_ADVANCED_CATEGORY,{useTitle:()=>V.intl.string(V.t["8/udY0"]),buildLayout:()=>[tg]});var tA=n(284009),tE=n.n(tA),th=n(199966),tS=n(963935);function tT(e){let{title:t}=e;return t}function tf(e){let{useTitle:t,settingKey:n,formatter:i,index:l}=e,s=t();return"string"==typeof s?i({title:s,index:l,key:n}):s}function tp(e){let{setting:t,formatter:n,index:i}=e;return()=>(0,p.jsx)(tf,{useTitle:t.useTitle,settingKey:t.key,formatter:n,index:i},t.key)}function tx(e){return e.type===tS.Z6.LIST}function tI(e,t){let{limit:n=2,formatter:i=tT}=t??{};tE()(n>0,"[useSettingCollapsibleSubtitle] Limit must be greater than 0");let{visibleDirectory:l,accessibleDirectory:s}=(0,th._)(),r=l.get(e)??s.get(e);tE()(null!=r&&(r.type===tS.Z6.ACCORDION||tx(r)),"[useSettingCollapsibleSubtitle] Node is not a collapsible settings node");let a=tx(r)?r.collapseAfter??0:0,o=r.layout;return x.useMemo(()=>{let e=a,t=[];for(let n of o)if("useTitle"in n&&null!=n.useTitle){if(e>0){e--;continue}t.push({key:n.key,useTitle:n.useTitle})}if(0===t.length)return"";let l=Math.min(n,3);if(t.length<=l)if(1===t.length)return V.intl.format(V.t["3H9tCW"],{settingOneHook:tp({setting:t[0],formatter:i,index:0})});else if(2===t.length)return V.intl.format(V.t.MWryo6,{settingOneHook:tp({setting:t[0],formatter:i,index:0}),settingTwoHook:tp({setting:t[1],formatter:i,index:1})});else return V.intl.format(V.t.a00b5G,{settingOneHook:tp({setting:t[0],formatter:i,index:0}),settingTwoHook:tp({setting:t[1],formatter:i,index:1}),settingThreeHook:tp({setting:t[2],formatter:i,index:2})});return 1===l?V.intl.format(V.t.O8vNbS,{settingOneHook:tp({setting:t[0],formatter:i,index:0})}):2===l?V.intl.format(V.t["acXG/W"],{settingOneHook:tp({setting:t[0],formatter:i,index:0}),settingTwoHook:tp({setting:t[1],formatter:i,index:1})}):V.intl.format(V.t["5+ldWc"],{settingOneHook:tp({setting:t[0],formatter:i,index:0}),settingTwoHook:tp({setting:t[1],formatter:i,index:1}),settingThreeHook:tp({setting:t[2],formatter:i,index:2})})},[n,a,o,i])}var t_=n(951260);let tb=(0,h.zD)(S.X.ENABLE_APPS_BUTTON,{useTitle:()=>V.intl.string(V.t.ZTH4j4),useValue:()=>(0,I.bG)([O.Ay],()=>O.Ay.isAppsButtonEnabled),setValue:e=>(0,ed.n8)({appsButtonEnabled:e})}),tN={useTitle:()=>V.intl.string(V.t["I/5LyL"]),useValue:()=>(0,I.bG)([O.Ay],()=>O.Ay.isSubmitButtonEnabled),setValue:()=>(0,ed.Xt)()},tC=(0,h.zD)(S.X.ENABLE_SEND_BUTTON,tN),ty=(0,h.zD)(S.X.ENABLE_SEND_BUTTON_OUTSIDE_EXPERIMENT,{...tN,usePredicate:()=>!(0,t_.n)("EnableSendButtonOutsideExperiment")}),tv=(0,h.zD)(S.X.CONDENSE_PICKER_WHEN_NARROW,{useTitle:()=>V.intl.string(V.t.WggFoO),useSubtitle:()=>V.intl.string(V.t.XpErGj),useValue:()=>(0,I.bG)([O.Ay],()=>O.Ay.condensePickerWhenNarrow),setValue:e=>(0,ed.n8)({condensePickerWhenNarrow:e}),usePredicate:()=>(0,I.bG)([O.Ay],()=>O.Ay.expressionPickerFormat===O.IG.FLEXIBLE)}),tj=(0,h.zD)(S.X.ENABLE_EMOJI_BUTTON,{useTitle:()=>V.intl.string(V.t.YErWkD),useValue:()=>(0,I.bG)([O.Ay],()=>O.Ay.isEmojiButtonEnabled),setValue:e=>(0,ed.n8)({emojiButtonEnabled:e}),usePredicate:()=>(0,I.bG)([O.Ay],()=>O.Ay.expressionPickerFormat===O.IG.FLEXIBLE)}),tO=(0,h.zD)(S.X.ENABLE_GIF_BUTTON,{useTitle:()=>V.intl.string(V.t.k7oNEz),useValue:()=>(0,I.bG)([O.Ay],()=>O.Ay.isGifButtonEnabled),setValue:e=>(0,ed.n8)({gifButtonEnabled:e}),usePredicate:()=>(0,I.bG)([O.Ay],()=>O.Ay.expressionPickerFormat===O.IG.FLEXIBLE)}),tR=(0,h.zD)(S.X.ENABLE_STICKER_BUTTON,{useTitle:()=>V.intl.string(V.t.Ar0krj),useValue:()=>(0,I.bG)([O.Ay],()=>O.Ay.isStickerButtonEnabled),setValue:e=>(0,ed.n8)({stickerButtonEnabled:e}),usePredicate:()=>(0,I.bG)([O.Ay],()=>O.Ay.expressionPickerFormat===O.IG.FLEXIBLE)}),tD=(0,h.Qx)(S.X.EXPRESSION_PICKER_FORMAT,{useTitle:()=>V.intl.string(V.t.AxRAWt),useValue:()=>(0,I.bG)([O.Ay],()=>O.Ay.expressionPickerFormat),setValue:e=>(0,ed.n8)({expressionPickerFormat:e}),useOptions:function(){return[{name:V.intl.string(V.t.k86Soy),desc:V.intl.string(V.t.bSGTTZ),value:O.IG.FLEXIBLE},{name:V.intl.string(V.t.bjwSOn),desc:V.intl.string(V.t.We36HX),value:O.IG.CONDENSED},{name:V.intl.string(V.t.FDIKss),desc:V.intl.string(V.t["rclZL/"]),value:O.IG.HIDDEN}]}}),tL=(0,h.FW)(S.X.EXPRESSION_PICKER_FIELD_SET,{variant:"compact",isTitleHiddenVisually:!0,useTitle:()=>V.intl.string(V.t["V9/cNN"]),buildLayout:()=>[tD,tv,tj,tO,tR]}),tP=(0,h.bd)(S.X.CHAT_BAR_ADVANCED_ACCORDION,{useTitle:function(e){return e?V.intl.string(V.t.IwVGQs):V.intl.string(V.t.cFNDh5)},useCollapsedSubtitle:()=>tI(S.X.CHAT_BAR_ADVANCED_ACCORDION),usePredicate:()=>(0,t_.n)("ChatBarAdvancedAccordion"),buildLayout:()=>[tC,tb,tL]});var tG=n(565645);let tM=(0,h.zD)(S.X.CHAT_EMOJI_CONVERT_EMOTICONS,{useTitle:()=>V.intl.string(V.t["79qal8"]),useSubtitle:()=>V.intl.format(V.t.GejoQK,{emojiHook:(e,t)=>(0,p.jsx)(tG.A,{emojiName:"\uD83D\uDE42"},t)}),useValue:U.j7.useSetting,setValue:U.j7.updateSetting}),tU=(0,h.zD)(S.X.CHAT_GAME_MENTIONS_AUTOCOMPLETE,{useTitle:()=>V.intl.string(V.t.c0oFDw),useValue:U.BQ.useSetting,setValue:U.BQ.updateSetting}),tV=(0,h.zD)(S.X.CHAT_TEXT_BOX_PREVIEWS,{useTitle:()=>V.intl.string(V.t.AqGrEI),useValue:U.SI.useSetting,setValue:e=>{td.default.track(_.HAw.PREVIEW_MARKDOWN_TOGGLED,{enabled:e,location:{section:_.JJy.SETTINGS_TEXT_AND_IMAGES}}),U.SI.updateSetting(e)}});var tk=n(793574);let tw=(0,h.zD)(S.X.CHAT_STICKERS_AUTOCOMPLETE,{useTitle:()=>V.intl.string(V.t["d+It2U"]),useValue:U.ML.useSetting,setValue:e=>{td.default.track(_.HAw.STICKERS_IN_AUTOCOMPLETE_TOGGLED,{enabled:e,location:{section:_.JJy.SETTINGS_TEXT_AND_IMAGES},location_stack:[tk.A.TEXT_AND_IMAGES]}),U.ML.updateSetting(e)}}),tF=(0,h.zZ)(S.X.APPEARANCE_CHAT_BOX_CATEGORY,{useTitle:()=>V.intl.string(V.t.Ob7VMB),useSearchTerms:()=>[V.intl.string(V.t.onqU6o)],buildLayout:()=>[tV,tM,tw,tU,ty,tP]});var tB=n(526162),tX=n(793943),tz=n(792656),tH=n(830543),tY=n(785007),tW=n(92533),tK=n(915089),tZ=n(739053),tq=n(82498),tQ=n(746322),tJ=n(682901);let t$=(0,h.E2)(S.X.APPEARANCE_IN_APP_ICON,{useSearchTerms:()=>[V.intl.string(V.t.gnwxvT)],Component:function(){let e=(0,tK.GV)(),{ref:t,...n}=(0,tY._u)({orientation:"horizontal",labelledBy:e}),i=(0,I.bG)([tB.A],()=>tB.A.isUpsellPreview);return(0,Z.Ay)(()=>{i&&(td.default.track(_.HAw.PREMIUM_UPSELL_VIEWED,{type:tJ.e.APP_ICON_UPSELL,location_stack:[tk.A.USER_SETTINGS]}),(0,tZ.sq)(_.U7l.PREMIUM_UPSELL_VIEWED,[tk.A.USER_SETTINGS],()=>(0,tq.uq)(tJ.e.APP_ICON_UPSELL)))}),(0,p.jsx)("div",{...n,ref:t,children:(0,p.jsx)(q.B,{direction:"horizontal",wrap:!0,gap:8,children:(0,p.jsx)(tW.m,{disabled:i,size:tQ.N8.SIZE_48})})})}});function t0(){(0,tX.nf)(tX.HP.APP_ICON),(0,tH.default)()}function t1(){return(0,p.jsx)(tz.A,{subscriptionTier:tJ.pe.TIER_2,defaultTextOverride:V.intl.string(V.t.mr4K7D),premiumModalAnalyticsLocation:{object:_.ZSU.BUTTON_CTA,objectType:_.btD.BUY},fullWidth:!0})}let t2=(0,h.zZ)(S.X.APPEARANCE_IN_APP_ICON_CATEGORY,{useTitle:()=>V.intl.string(V.t.RPh2ou),useSubtitle:()=>V.intl.string(V.t.IgENJo),useHeaderDecoration:function(){let e=(0,I.bG)([tB.A],()=>tB.A.isUpsellPreview);return x.useMemo(()=>{let t=[];return t.push({id:"preview-icon-button",type:f.UV.BUTTON,text:V.intl.string(V.t["6acvnZ"]),onClick:t0}),e&&t.push({id:"upsell-button",type:f.UV.STRONGLY_DISCOURAGED_CUSTOM,button:t1}),{type:f.WX.BUTTON_GROUP,buttons:t}},[e])},buildLayout:()=>[t$]}),t3=(0,h.AK)(S.X.APPEARANCE_CHAT_ACCESSIBLITY_NAVIGATOR,{useSubtitle:()=>V.intl.string(V.t.UDr3Iy),useSearchTerms:()=>[V.intl.string(V.t.UDr3Iy)],destinationKey:S.X.ACCESSIBILITY_PANEL}),t5=(0,h.gN)(S.X.APPEARANCE_CHAT_RELATED_SETTINGS,{buildLayout:()=>[t3]});var t4=n(143129),t6=n(794412),t8=n(749884),t7=n(708526);let t9=eC.A.getArticleURL(_.MVz.FAVORITES_GUILD),ne=(0,h.E2)(S.X.CHAT_FAVORITES_TOGGLE,{useSearchTerms:()=>[V.intl.string(t7.default.OT1NK5)],Component:function(){let e=(0,t8.A)(!1);return(0,p.jsx)(t4.d,{checked:e,description:V.intl.format(t7.default.GR2KOG,{helpCenterLink:t9}),onChange:t6.kG,label:V.intl.string(t7.default.OT1NK5),badge:"beta"})}}),nt=(0,h.zD)(S.X.CHAT_INLINE_MEDIA_LINKS,{useTitle:()=>V.intl.string(V.t.U47N1p),useValue:U.hD.useSetting,setValue:U.hD.updateSetting}),nn=(0,h.zD)(S.X.CHAT_INLINE_MEDIA_UPLOADS,{useTitle:()=>V.intl.string(V.t.VP11No),useValue:U.X6.useSetting,setValue:U.X6.updateSetting}),ni=(0,h.FW)(S.X.CHAT_INLINE_FIELD_SET,{useTitle:()=>V.intl.string(V.t["9nyle0"]),buildLayout:()=>[nt,nn]}),nl=(0,h.zD)(S.X.CHAT_EMBEDS_RENDER_EMBEDS,{useTitle:()=>V.intl.string(V.t["5bK9vw"]),useValue:U.rs.useSetting,setValue:U.rs.updateSetting}),ns=(0,h.zD)(S.X.CHAT_EMOJI_RENDER_REACTIONS,{useTitle:()=>V.intl.string(V.t["zge/fP"]),useValue:U.jW.useSetting,setValue:U.jW.updateSetting});var nr=n(28863),na=n(766075);let no=(0,h.zD)(S.X.APPEARANCE_DISPLAY_COMPACT_AVATARS,{useTitle:()=>V.intl.string(V.t.JgjNG3),useSubtitle:()=>{if(!U.hH.useSetting())return V.intl.format(V.t["31PRaj"],{a11yHook:(e,t)=>(0,p.jsx)(nr.Anchor,{onClick:()=>(0,na.openUserSettings)(S.X.APPEARANCE_MESSAGE_DISPLAY_MODE),children:e},t)})},useDisabled:()=>!U.hH.useSetting(),useValue:()=>{let e=U.aM.useSetting();return!U.hH.useSetting()||e},setValue:e=>{U.aM.updateSetting(e)}}),nu=(0,h.Hn)(S.X.CHAT_SPOILERS_SHOW_SPOILERS,{useTitle:()=>V.intl.string(V.t.QgwmVz),useOptions:()=>[{value:_.P6Q.ON_CLICK,id:_.P6Q.ON_CLICK,label:V.intl.string(V.t["KFH/me"])},{value:_.P6Q.ALWAYS,id:_.P6Q.ALWAYS,label:V.intl.string(V.t.Pe1RbL)},{value:_.P6Q.IF_MODERATOR,id:_.P6Q.IF_MODERATOR,label:V.intl.string(V.t.K5VTBE)}],useValue:U.gs.useSetting,setValue:U.gs.updateSetting}),nd=(0,h.zD)(S.X.CHAT_THREADS_SPLIT_VIEW,{useTitle:()=>V.intl.string(V.t.AInv5m),useValue:U.SY.useSetting,setValue:U.SY.updateSetting}),nc=(0,h.zZ)(S.X.APPEARANCE_MESSAGES_CATEGORY,{useTitle:()=>V.intl.string(V.t.OIgYlQ),useSearchTerms:()=>[V.intl.string(V.t["/VQax8"])],buildLayout:()=>[ni,nl,ns,nu,nd,no,ne,t5]});var ng=n(753806),nm=n(145331);let nA=(0,h.Qx)(S.X.MESSAGE_SEARCH_DEFAULT_DM_SEARCH_BEHAVIOR,{useTitle:()=>V.intl.string(V.t.VkoLsy),useSearchTerms:()=>[V.intl.string(V.t["t4+fbe"])],useOptions:function(){return[{name:V.intl.string(V.t.E9JM4J),value:0},{name:V.intl.string(V.t["Kr+lPi"]),value:1}]},useValue:()=>+!!U.Hu.useSetting(),setValue:e=>{let t=1===e;t?ng.A.cleanUpPrivateChannelSearchState():ng.A.cleanUpSearchState({type:_.I4_.DMS}),(0,nm._k)({prevIsCrossDMSettingEnabled:U.Hu.getSetting(),isCrossDMSettingEnabled:t,location:nm.vy.USER_SETTINGS}),U.Hu.updateSetting(t)}}),nE=(0,h.zZ)(S.X.APPEARANCE_SEARCH_CATEGORY,{useTitle:()=>V.intl.string(V.t["5h0QOP"]),buildLayout:()=>[nA]});var nh=n(574381);let nS=(0,h.zD)(S.X.STREAMING_AUTO_STREAMER_MODE,{useTitle:()=>V.intl.string(V.t.IxjaoF),useValue:function(){return(0,I.bG)([tu.A],()=>{let{autoToggle:e}=tu.A.getSettings();return e})},setValue:function(e){to.A.update({autoToggle:e})},usePredicate:function(){return nh.Av}}),nT=(0,h.zD)(S.X.STREAMING_STREAMER_MODE,{useTitle:()=>V.intl.string(V.t.TGNg6T),useSubtitle:()=>V.intl.string(V.t["4nXLnE"]),useValue:function(){return(0,I.bG)([tu.A],()=>{let{enabled:e}=tu.A.getSettings();return e})},setValue:function(e){to.A.update({enabled:e})}});var nf=n(77729),np=n(589051),nx=n(415173),nI=n(999834);let n_=[],nb=(0,h.Hn)(S.X.STREAMER_MODE_HIDE_OVERLAY_WIDGETS,{selectionMode:"multiple",useTitle:()=>V.intl.string(V.t.VCDSLW),useSearchTerms:()=>[V.intl.string(V.t.VCDSLW)],usePredicate:()=>{let e=(0,nI.b_)(),t=(0,np.Mn)("StreamerModeSettings");return e&&t},useOptions:function(){return x.useMemo(()=>{let e=[];for(let[t,n]of Object.entries(nx.A))!0===n.hideableInStreamerMode&&null!=n.label&&(null==n.predicate||n.predicate())&&e.push({id:t,value:t,label:n.label()});return e},[])},useValue:function(){return(0,I.bG)([tu.A],()=>tu.A.getSettings().disabledOverlayWidgets??n_)},setValue:e=>to.A.update({disabledOverlayWidgets:e}),closeOnSelect:!1,wrapTags:!0}),nN=(0,h.zD)(S.X.STREAMER_MODE_HIDE_PERSONAL_INFORMATION,{useTitle:()=>V.intl.string(V.t.LSBUGR),useValue:()=>(0,I.bG)([tu.A],()=>{let{hidePersonalInformation:e}=tu.A.getSettings();return e}),setValue:e=>to.A.update({hidePersonalInformation:e})}),nC=(0,h.zD)(S.X.STREAMER_MODE_HIDE_INVITE_LINKS,{useTitle:()=>V.intl.string(V.t.uWBOri),useValue:()=>(0,I.bG)([tu.A],()=>{let{hideInstantInvites:e}=tu.A.getSettings();return e}),setValue:e=>to.A.update({hideInstantInvites:e})}),ny=(0,h.zD)(S.X.STREAMER_MODE_DISABLE_SOUNDS,{useTitle:()=>V.intl.string(V.t.OrqYDP),useValue:()=>(0,I.bG)([tu.A],()=>{let{disableSounds:e}=tu.A.getSettings();return e}),setValue:e=>to.A.update({disableSounds:e})}),nv=(0,h.zD)(S.X.STREAMER_MODE_DISABLE_NOTIFICATIONS,{useTitle:()=>V.intl.string(V.t.sUAbLd),useValue:()=>(0,I.bG)([tu.A],()=>{let{disableNotifications:e}=tu.A.getSettings();return e}),setValue:e=>to.A.update({disableNotifications:e})}),nj=(0,h.zD)(S.X.STREAMER_MODE_HIDE_DISCORD_WINDOW_FROM_SCREEN_CAPTURE,{useTitle:()=>V.intl.string(V.t["iA81+a"]),useSubtitle:()=>V.intl.string(V.t.P4vj0h),useValue:()=>(0,I.bG)([tu.A],()=>{let{enableContentProtection:e}=tu.A.getSettings();return e}),setValue:e=>to.A.update({enableContentProtection:e}),usePredicate:()=>nf.A?.window?.supportsContentProtection?.()??!1}),nO=(0,h.FW)(S.X.STREAMER_MODE_OPTIONS_LIST,{variant:"compact",useTitle:()=>V.intl.string(V.t.xYhOEh),buildLayout:()=>[nN,nC,ny,nv,nj,nb]}),nR=(0,h.zZ)(S.X.STREAMER_MODE_CATEGORY,{useTitle:()=>V.intl.string(V.t.S5GfOW),buildLayout:()=>[nT,nS,nO]});var nD=n(850333),nL=n(141343),nP=n(665267),nG=n(414133),nM=n(557441);let nU=(0,h.Hn)(S.X.APPEARANCE_GUILD_THEME_DEFAULT_PREFERENCE,{useTitle:()=>V.intl.string(V.t.Q7mm4g),useSearchTerms:()=>[V.intl.string(nM.default["/6NbRv"])],useOptions:()=>[{id:"guild",label:V.intl.string(V.t["hrS/Pc"]),value:eJ.tI.GUILD},{id:"personal",label:V.intl.string(V.t.mlvXIq),value:eJ.tI.PERSONAL}],useValue:()=>U.zY.useSetting(),setValue:U.zY.updateSetting,usePredicate:()=>(0,nG.OS)("GuildThemeDefaultPreferenceSetting")}),nV=(0,h.zD)(S.X.SYNC_PROFILE_THEMES,{useTitle:()=>V.intl.string(V.t.C00w4l),useValue:()=>(0,I.bG)([O.Ay],()=>O.Ay.syncProfileThemeWithUserTheme),setValue:()=>(0,ed.M1)()});var nk=n(817281),nw=n(284016),nF=n(413599);let nB=(0,h.zD)(S.X.APPEARANCE_SYNC_THEME,{useTitle:()=>V.intl.string(V.t["/B+kEV"]),useSearchTerms:()=>[V.intl.string(V.t.Ksh3ik)],useValue:function(){return(0,I.bG)([nw.A],()=>!1!==nw.A.shouldSync("appearance"))},useDisabled:function(){return(0,I.bG)([nF.A],()=>nF.A.isSameAsDeviceThemeEnabled())},setValue:function(e){var t;let n=nF.A.theme,i=nD.A.gradientPreset?.id??null,l=U.eh.getSetting()?.customUserThemeSettings!=null;t=_.HAw.SYNC_ACROSS_CLIENTS_TOGGLED,ts.h.dispatch({type:"TRACK",event:t,properties:{is_sync_enabled:e,base_theme:n,client_theme:i,has_custom_theme:l}}),nk.Ay.setShouldSyncAppearanceSettings(e)}});var nX=n(569386);let nz=(0,h.AK)(S.X.APPEARANCE_THEME_ACCESSIBLITY_NAVIGATOR,{useSubtitle:()=>V.intl.string(V.t.nhVQDJ),useSearchTerms:()=>[V.intl.string(V.t.nhVQDJ)],destinationKey:S.X.ACCESSIBILITY_PANEL}),nH=(0,h.gN)(S.X.APPEARANCE_THEME_RELATED_SETTINGS,{buildLayout:()=>[nz]}),nY=(0,h.zZ)(S.X.APPEARANCE_THEME_CATEGORY,{useTitle:()=>V.intl.string(V.t.Ksh3ik),useInlineNotice:function(){return(0,I.bG)([O.Ay],()=>O.Ay.useForcedColors)?{type:f.lT.INLINE_NOTICE,noticeType:"info",role:"none",text:(0,eN.D)()?V.intl.format(V.t.Jae48E,{onClick:()=>{(0,na.openUserSettings)(S.X.SYNC_FORCED_COLORS)}}):V.intl.string(V.t.AUMSZP)}:null},useHeaderDecoration:function(){let e=(0,I.bG)([nD.A,O.Ay],()=>O.Ay.useForcedColors||nD.A.isPreview),t=(0,nL.V)();return e||t?null:{type:f.WX.BUTTON_GROUP,buttons:[{id:"open-client-themes-button",type:f.UV.BUTTON,text:V.intl.string(V.t["E+COuA"]),onClick:nP.J3}]}},buildLayout:()=>[nX.k,nB,nV,nU,nH]}),nW=(0,h.t_)(S.X.APPEARANCE_PANEL,{initialize:function(){tr.A.isFetching()||(ts.h.dispatch({type:"SAVED_CUSTOM_THEMES_FETCH_START"}),tl.Bo.get({url:_.Rsh.USERS_ME_CUSTOM_THEMES,oldFormErrors:!0,rejectWithError:!0}).then(e=>{ts.h.dispatch({type:"SAVED_CUSTOM_THEMES_FETCH_SUCCESS",themes:e.body?.custom_themes??[]})}).catch(e=>{ts.h.dispatch({type:"SAVED_CUSTOM_THEMES_FETCH_FAILURE",error:e})}))},useTitle:()=>V.intl.string(V.t["iHH+ky"]),buildLayout:()=>[nY,t2,nc,tF,nE,nR,tm]}),nK=[{badgeType:f.Xi.NEW,dismissibleContent:eE.M.CLIENT_THEMES_APPEARANCE_SETTINGS_NEW_BADGE}],nZ=(0,h.i4)(S.X.APPEARANCE_SIDEBAR_ITEM,{useTitle:()=>V.intl.string(V.t["iHH+ky"]),icon:tn.PaintPaletteIcon,useMenu:function(){let e,t,n,i=(0,ta.A)(),l=(e=U.D_.useSetting(),t=U.SI.useSetting(),e?null:(0,p.jsx)(ti.sL,{id:"preview-markdown-toggle",label:V.intl.string(V.t.sHJ9wZ),action:()=>{let e=!t;td.default.track(_.HAw.PREVIEW_MARKDOWN_TOGGLED,{enabled:e,location:{section:_.JJy.SETTINGS_CONTEXT_MENU}}),U.SI.updateSetting(e)},checked:t})),s=(n=(0,I.bG)([tu.A],()=>tu.A.enabled,[]),(0,p.jsx)(ti.sL,{id:"streamer-mode-toggle",label:V.intl.string(V.t.p9ZAJZ),action:()=>{to.A.setEnabled(!n)},checked:n}));return x.useMemo(()=>{let e=[...i];return null!=l&&e.push((0,p.jsx)(ti.rX,{label:V.intl.string(V.t.Ob7VMB),children:l},"text-and-images")),null!=s&&e.push((0,p.jsx)(ti.rX,{children:s},"streamer-mode")),e},[i,l,s])},getDismissibleBadges:()=>nK,buildLayout:()=>[nW]});var nq=n(37646),nQ=n(172471);let nJ=(0,h.t_)(S.X.LANGUAGE_AND_TIME_PANEL,{useTitle:()=>V.intl.string(V.t.KyFVyi),buildLayout:()=>[nQ.F]}),n$=(0,h.i4)(S.X.LANGUAGE_AND_TIME_SIDEBAR_ITEM,{icon:nq.LanguageIcon,useTitle:()=>V.intl.string(V.t.KyFVyi),buildLayout:()=>[nJ]});var n0=n(3137),n1=n(646514),n2=n(314116),n3=n(270003),n5=n(834730),n4=n(939249),n6=n(369606),n8=n(320448),n7=n(604121),n9=n(725951),ie=n(400492),it=n(669067),ii=n(115063),il=n(415677),is=n(927018),ir=n(591563),ia=n(532197),io=n(403362),iu=n(874486),id=n(503698),ic=n.n(id),ig=n(536637),im=n.n(ig),iA=n(5377),iE=n(906688),ih=n(98705);function iS(e){let{achievementId:t,dateUnlocked:n}=e,i=(0,is.vM)(t);if(null==i)return null;let l=null!=n,{name:s,description:r,hideDescriptionUntilUnlock:a,onAction:o}=i,u=a&&!l,d=l?"text-strong":"text-muted",c=l?"text-default":"text-muted",g=im()(n),m=null!=o&&l,A=m?n4.D:"div";return(0,p.jsxs)(A,{className:ic()(ih.kL,m&&ih.b),onClick:function(){m&&o()},children:[(0,p.jsx)("div",{className:ih.zc,children:(0,p.jsx)(iE.A,{achievementId:t,size:iE.A.Sizes.SIZE_40,unlocked:l})}),(0,p.jsxs)("div",{className:ih.VW,children:[null!=n&&(0,p.jsx)(n5.E,{variant:"footnote/semibold",color:"text-muted",className:ih.YR,children:(0,iA.mk)(g)}),(0,p.jsx)(n5.E,{variant:"body-md/medium",color:d,children:s()}),(0,p.jsx)(n5.E,{variant:"body-xs/normal",color:c,children:u?"?????":r()})]})]})}var iT=n(545744);function ip(e){let{onBackClick:t}=e,n=(0,I.bG)([iu.A],()=>iu.A.getAllUnlockedAchievements()),i=x.useMemo(()=>Object.values(n).sort((e,t)=>t.dateUnlocked-e.dateUnlocked),[n]),l=x.useMemo(()=>Object.values(is.l0).filter(io.Vq).filter(e=>null==n[e.id]).sort((e,t)=>e.rarity-t.rarity),[n]);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(n4.D,{onClick:t,className:iT.vv,children:[(0,p.jsx)(ia.A,{direction:ia.A.Directions.LEFT,className:iT.Kk}),(0,p.jsx)(n5.E,{variant:"body-lg/normal",color:"text-default",children:V.intl.string(V.t["13/7kX"])})]}),(0,p.jsxs)("div",{className:iT.N1,children:[(0,p.jsxs)("div",{className:iT.if,children:[(0,p.jsx)(N.D,{variant:"heading-lg/semibold",color:"text-strong",children:V.intl.string(V.t["6jI0hd"])}),(0,p.jsx)(n5.E,{variant:"body-md/normal",color:"text-default",children:V.intl.string(V.t.GuUItX)})]}),(0,p.jsx)("div",{className:iT.nr,children:(0,p.jsx)(n6.TrophyIcon,{size:"custom",color:n1.A.unsafe_rawColors.ORANGE_345.css,width:40,height:40})})]}),i.length>0&&(0,p.jsx)("div",{className:iT.yF,children:(0,p.jsx)("div",{className:iT.Eh,children:i.map(e=>{let{achievementId:t,dateUnlocked:n}=e;return(0,p.jsx)(iS,{achievementId:t,dateUnlocked:n},t)})})}),l.length>0&&(0,p.jsxs)("div",{className:iT.yF,children:[(0,p.jsx)("div",{className:iT.if,children:(0,p.jsx)(n5.E,{variant:"body-md/semibold",color:"text-default",children:V.intl.string(V.t.GFyMg1)})}),(0,p.jsx)("div",{className:iT.Eh,children:l.map(e=>(0,p.jsx)(iS,{achievementId:e.id},e.id))})]}),(0,p.jsx)("div",{className:iT.yF,children:(0,p.jsx)("div",{className:iT.F3})})]})}var ix=n(224964),iI=n(31408),i_=n(368588);let ib={enabled:!0,combosEnabled:!0,screenshakeEnabled:!1,confettiEnabled:!1},iN=(0,W.range)(0,11),iC=(0,W.range)(0,2.25,.25),iy=(0,W.range)(1,11),iv=(0,W.range)(1,26),ij={0:"poggermode_settings_panel",1:"poggermode_achievements_panel"};function iO(e){let{disabled:t,locations:n,settingsLocations:i,onChange:l}=e,s=n.map(e=>(0,p.jsx)(t4.d,{label:e.title,description:e.description,checked:i[e.location],disabled:t,onChange:t=>l({...i,[e.location]:t})},e.location));return(0,p.jsx)(n3.n,{label:V.intl.string(V.t.bWVN1D),children:s})}function iR(e){let{children:t}=e;return(0,p.jsx)(n5.E,{className:i_.iF,variant:"body-sm/normal",color:"text-default",children:t})}function iD(e){let{settings:{enabled:t,warningSeen:n},updateSettings:i}=e,l=(0,I.bG)([O.Ay],()=>O.Ay.useReducedMotion);return(0,p.jsx)(t4.d,{label:V.intl.string(V.t.vuiXm9),description:V.intl.string(V.t.KuYbWN),checked:t,onChange:function(e){e||(0,il._)(is.sn.DISABLE_POGGERMODE),e&&(!n||l)?(0,n2.A)({title:l?V.intl.string(V.t["FxT+p0"]):V.intl.string(V.t.TAZ4F9),subtitle:l?V.intl.string(V.t.gmixrx):V.intl.string(V.t.jN3t3K),confirmText:V.intl.string(V.t.JFfins),onConfirm:()=>i(l?ib:{enabled:!0,warningSeen:!0})}):i({enabled:e})}})}function iL(e){let{settings:{enabled:t,confettiEnabled:n,confettiCount:i,confettiSize:l,confettiEnabledLocations:s},updateSettings:r}=e,a=!t||!n;return(0,p.jsxs)(n3.n,{label:V.intl.string(V.t.mqxwJO),children:[(0,p.jsx)(t4.d,{label:V.intl.string(V.t.s0KCgF),description:V.intl.string(V.t.O1Vflg),checked:n,disabled:!t,onChange:e=>r({confettiEnabled:e},0)}),(0,p.jsxs)("div",{children:[(0,p.jsx)(n5.E,{variant:"body-md/semibold",color:a?"text-muted":"text-strong",className:i_.KF,children:V.intl.string(V.t.vd0D81)}),(0,p.jsx)(iR,{children:V.intl.string(V.t.a18Sug)}),(0,p.jsx)(Q.A,{"aria-label":V.intl.string(V.t.vd0D81),disabled:a,marks:iy,snapToMarks:!0,minValue:iy[0],maxValue:iy[iy.length-1],defaultValue:i,onChangeEnd:e=>r({confettiCount:e},0),formatValue:e=>`${e}`})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)(n5.E,{variant:"body-md/semibold",color:a?"text-muted":"text-strong",className:i_.KF,children:V.intl.string(V.t.sPO3ij)}),(0,p.jsx)(iR,{children:V.intl.string(V.t.xoldVn)}),(0,p.jsx)(Q.A,{"aria-label":V.intl.string(V.t.sPO3ij),disabled:a,marks:iv,snapToMarks:!0,minValue:iv[0],maxValue:iv[iv.length-1],defaultValue:l,onChangeEnd:e=>r({confettiSize:e},0),formatValue:e=>`${e}`})]}),(0,p.jsx)(iO,{disabled:a,locations:[{location:iI.k.CHAT_INPUT,title:V.intl.string(V.t.elTtyz),description:V.intl.string(V.t.HtKfMi)},{location:iI.k.REACTION,title:V.intl.string(V.t.Ik4VIa),description:V.intl.string(V.t.y4rqK0)},{location:iI.k.MEMBER_USER,title:V.intl.string(V.t.ZXBlAn),description:V.intl.string(V.t["m9RD+c"])},{location:iI.k.CALL_TILE,title:V.intl.string(V.t.V66giQ),description:V.intl.string(V.t.fiHV7u)}],settingsLocations:s,onChange:e=>r({confettiEnabledLocations:e},0)})]})}function iP(e){let{settings:{enabled:t,combosEnabled:n,comboSoundsEnabled:i,combosRequiredCount:l},updateSettings:s}=e,r=!t||!n;return(0,p.jsxs)(n3.n,{label:V.intl.string(V.t.Xz0ole),children:[(0,p.jsx)(t4.d,{label:V.intl.string(V.t.o3iV7B),description:V.intl.string(V.t["31Z8Ee"]),checked:n,disabled:!t,onChange:e=>s({combosEnabled:e})}),(0,p.jsx)(t4.d,{label:V.intl.string(V.t["Ax+IoW"]),description:V.intl.string(V.t["9rgQEr"]),checked:i,disabled:!t,onChange:e=>s({comboSoundsEnabled:e})}),(0,p.jsxs)("div",{children:[(0,p.jsx)(n5.E,{variant:"body-md/semibold",color:r?"text-muted":"text-strong",className:i_.KF,children:V.intl.string(V.t.L0oQuh)}),(0,p.jsx)(iR,{children:V.intl.string(V.t["/OOFpL"])}),(0,p.jsx)(Q.A,{"aria-label":V.intl.string(V.t.L0oQuh),disabled:r,marks:iN,snapToMarks:!0,minValue:iN[0],maxValue:iN[iN.length-1],defaultValue:l,onChangeEnd:e=>s({combosRequiredCount:e}),formatValue:e=>`${e}`})]})]})}function iG(e){let{settings:{enabled:t,screenshakeEnabled:n,shakeIntensity:i,screenshakeEnabledLocations:l},updateSettings:s}=e,r=(0,I.bG)([O.Ay],()=>O.Ay.useReducedMotion),a=!t||!n||r;return(0,p.jsxs)(n3.n,{label:V.intl.string(V.t.wVS5Sd),children:[(0,p.jsx)(t4.d,{label:V.intl.string(V.t.N004zO),description:r?V.intl.string(V.t.GckHGw):V.intl.string(V.t.Qq5W3v),checked:n&&!r,disabled:!t||r,onChange:e=>s({screenshakeEnabled:e},1)}),(0,p.jsxs)("div",{children:[(0,p.jsx)(n5.E,{variant:"body-md/semibold",color:a?"text-muted":"text-strong",className:i_.KF,children:V.intl.string(V.t.UxnnC4)}),(0,p.jsx)(iR,{children:V.intl.string(V.t.CEOEOb)}),(0,p.jsx)(Q.A,{"aria-label":V.intl.string(V.t.UxnnC4),disabled:a,marks:iC,snapToMarks:!0,minValue:iC[0],maxValue:iC[iC.length-1],defaultValue:i,onChangeEnd:e=>{var t;null!=(t={shakeIntensity:e}).shakeIntensity&&t.shakeIntensity>i&&(0,il._)(is.sn.MORE),s(t,1)},formatValue:e=>e===iC[iC.length-1]?V.intl.string(V.t["4rbMWc"]):`${100*e}%`})]}),(0,p.jsx)(iO,{disabled:a,locations:[{location:iI.uD.CHAT_INPUT,title:V.intl.string(V.t.vUcvPP),description:V.intl.string(V.t.y00OrF)},{location:iI.uD.VOICE_USER,title:V.intl.string(V.t.TcRO54),description:V.intl.string(V.t.YJCxVY)},{location:iI.uD.MENTION,title:V.intl.string(V.t.oW4shO),description:V.intl.string(V.t["mqfw/H"])}],settingsLocations:l,onChange:e=>s({screenshakeEnabledLocations:e},1)})]})}function iM(e){let{updateSettings:t}=e;return(0,p.jsx)(n3.n,{label:V.intl.string(V.t.EuXv2q),children:(0,p.jsxs)(q.B,{gap:16,children:[(0,p.jsx)("div",{children:V.intl.string(V.t["1SLnki"])}),(0,p.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:i_.hw,children:(0,p.jsx)(j.$,{variant:"primary",size:"sm",text:V.intl.string(V.t.qz65yY),onClick:function(){t({enabled:!1,settingsVisible:!1}),(0,tH.default)()}})})]})})}function iU(e){let{onChangePage:t}=e;return(0,p.jsxs)(n4.D,{onClick:function(){return t(1)},className:i_.Tq,children:[(0,p.jsx)("div",{className:i_.w1,children:(0,p.jsx)(n6.TrophyIcon,{size:"md",color:n1.A.unsafe_rawColors.ORANGE_345.css})}),(0,p.jsxs)("div",{className:i_.qL,children:[(0,p.jsx)(N.D,{variant:"heading-sm/semibold",color:"text-strong",children:V.intl.string(V.t["6jI0hd"])}),(0,p.jsx)(n5.E,{variant:"body-md/normal",color:"text-default",children:V.intl.string(V.t.GuUItX)})]}),(0,p.jsx)(n8.ChevronSmallRightIcon,{size:"custom",color:"currentColor",width:16,className:i_.nT})]})}function iV(){return n.e(504660).then(n.t.bind(n,662336,19)).then(e=>{let{default:t}=e;return t})}function ik(e){let{onChangePage:t,setShowEnableAnimation:n}=e,i=(0,I.cf)([n0.A],()=>n0.A.getState()),[l,s]=x.useState({x:0,y:0}),r=(0,ix.A)();function a(e,t){var s,a,o,u,d,c,g,m;if(e.enabled&&!1===i.enabled&&(n(!0),(0,ie.Ak)("poggermode_enabled"),(0,ii.fO)({duration:2e3,intensity:e.shakeIntensity??i.shakeIntensity})),(0,ir.O9)(e),null==t)return;let A=(s=i.confettiEnabled,a=e.confettiEnabled,o=i.enabled,u=e.enabled,(a??s)&&(u??o));0===t&&A&&r.fire(l.x,l.y,{settings:e});let E=(d=i.screenshakeEnabled,c=e.screenshakeEnabled,g=i.enabled,m=e.enabled,(c??d)&&(m??g));1===t&&E&&(0,ii.fO)({duration:1e3,intensity:e.shakeIntensity??i.shakeIntensity})}function o(e){s({x:e.clientX,y:e.clientY})}return x.useEffect(()=>(window.addEventListener("mousemove",o),()=>window.removeEventListener("mousemove",o)),[]),(0,p.jsxs)(q.B,{gap:24,children:[(0,p.jsx)(iD,{settings:i,updateSettings:a}),(0,p.jsx)(iU,{onChangePage:t}),(0,p.jsx)(iP,{settings:i,updateSettings:a}),(0,p.jsx)(iG,{settings:i,updateSettings:a}),(0,p.jsx)(iL,{settings:i,updateSettings:a}),(0,p.jsx)(iM,{updateSettings:a})]})}function iw(e){return 0===e?n9.f.LEFT:n9.f.RIGHT}let iF=(0,h.E2)(S.X.POGGERMODE_SETTING,{Component:function(){let[e,t]=x.useState(0),[n,i]=x.useState(iw(e)),[l,s]=x.useState(!1),r=(0,I.bG)([O.Ay],()=>O.Ay.useReducedMotion),a=l&&!r;return x.useEffect(()=>{let t=setTimeout(()=>{i(iw(e))},500);return()=>clearTimeout(t)},[e]),x.useEffect(()=>{(0,it._)(ij[e])},[e]),x.useEffect(()=>{Math.random()>.99&&(0,il._)(is.sn.VISITOR_100)},[]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n9.A,{className:i_.l3,step:e,direction:n,children:function(e,t,n){function i(e){return()=>{t(e)}}switch(e){case 0:return(0,p.jsx)(ik,{onChangePage:i(1),setShowEnableAnimation:n});case 1:return(0,p.jsx)(ip,{onBackClick:i(0)});default:return null}}(e,t,s)}),(0,p.jsx)("div",{className:a?i_.Sr:i_.IP,children:(0,p.jsx)(n7.a,{className:i_.gT,importData:iV,shouldAnimate:a,autoplay:!1,resetOnPlay:!0,loop:!1,onComplete:()=>s(!1)})})]})},useSearchTerms:()=>[V.intl.string(V.t.AtCukI),V.intl.string(V.t.mqxwJO),V.intl.string(V.t.wVS5Sd),V.intl.string(V.t.Xz0ole),V.intl.string(V.t["Ax+IoW"]),V.intl.string(V.t["6jI0hd"]),V.intl.string(V.t.s0KCgF)]}),iB=(0,h.zZ)(S.X.POGGERMODE_CATEGORY,{buildLayout:()=>[iF]});var iX=n(212043);let iz=(0,h.t_)(S.X.POGGERMODE_PANEL,{useTitle:()=>V.intl.string(V.t.AtCukI),buildLayout:()=>[iB]}),iH=(0,h.i4)(S.X.POGGERMODE_SIDEBAR_ITEM,{useTitle:()=>V.intl.string(V.t.AtCukI),icon:()=>(0,p.jsx)("img",{alt:"",src:n(724405),className:iX.$}),usePredicate:()=>(0,I.bG)([n0.A],()=>n0.A.settingsVisible),buildLayout:()=>[iz]});var iY=n(307301),iW=n(410767),iK=n(683071),iZ=n(97260),iq=n(50258),iQ=n(57757),iJ=n(188321),i$=n(695366),i0=n(812729),i1=n.n(i0),i2=n(587895),i3=n(429913),i5=n(616356),i4=n(644727);function i6(e,t){return null!=e&&null!=e.id?e.id:null!=t&&null!=t.id?t.id:void 0}function i8(){let e=(0,I.bG)([i5.A],()=>i5.A.getStreamerActiveStreamMetadata()),t=(0,I.bG)([i4.Ay],()=>{let e=i4.Ay.getVisibleGame();return null!=e?i4.Ay.getGameOrTransformedSubgameForPID(e.pid):null},[],i1()),[n]=(0,i3.A)([i6(e,t)]);return{runningGame:t??void 0,runningGameApplication:n??void 0}}var i7=n(769015),i9=n(754712),le=n(526919),lt=n(435075);function ln(e){let{game:t,application:n}=e;return null==t||null==n?(0,p.jsx)("div",{className:lt.zc,children:(0,p.jsx)(i$.CircleErrorIcon,{size:"sm",color:n1.A.colors.TEXT_FEEDBACK_WARNING})}):(0,p.jsxs)("div",{className:lt.nt,children:[(0,p.jsx)(i7.A,{game:n,pid:t.pid,size:i7.M.MEDIUM}),(0,p.jsx)("div",{className:lt.Am,children:(0,p.jsx)(i$.CircleErrorIcon,{size:"sm",color:n1.A.colors.TEXT_FEEDBACK_WARNING})})]})}function li(e){let t=(0,I.bG)([i9.Ay],()=>i9.Ay.getMode()),{runningGame:n,runningGameApplication:i}=i8();null==n||n.elevated||(n=void 0,i=void 0);let l=(0,le.NP)(),s=l&&null!=n&&t===_.TBI.PUSH_TO_TALK;return{canPrompt:"voice"===e?s:l,runningGame:n,runningGameApplication:i}}function ll(e){let{className:t,sourcePage:n}=e,{canPrompt:i,runningGame:l,runningGameApplication:s}=li(n);return i?(0,p.jsxs)("div",{className:ic()(lt.kL,t),children:[(0,p.jsx)(ln,{game:l,application:s}),(0,p.jsxs)("div",{className:lt.FS,children:[(0,p.jsx)(n5.E,{variant:"body-sm/medium",color:"text-strong",children:"voice"===n?V.intl.string(V.t.vxfv7v):null!=l?V.intl.string(V.t.fAYU2G):V.intl.string(V.t["9V4X/c"])}),(0,p.jsx)(n5.E,{variant:"body-xs/medium",color:"text-muted",children:V.intl.format(V.t["/y6htt"],{helpCenterLink:eC.A.getArticleURL(_.MVz.SYSTEM_SERVICE)})})]}),(0,p.jsx)(j.$,{variant:"secondary",size:"sm",text:V.intl.string(V.t["1iI46O"]),onClick:function(){(0,le.sL)(n+(null!=l?"-with-game":"-no-game"))}})]}):null}var ls=n(404778),lr=n(579370),la=n(532624),lo=n(691885),lu=n(452027),ld=n(408278),lc=n(241326),lg=n(866665),lm=n(140735),lA=n(489718),lE=n(827343),lh=n(368484),lS=n(350535),lT=n(189213),lf=n(192308),lp=n(95477),lx=n(128376),lI=n(290676);let l_=[];var lb=n(235986),lN=n(320264),lC=n(734057),ly=n(808728),lv=n(71393),lj=n(967198),lO=n(926140),lR=n(847893);function lD(){}let lL=[lO.rD.VOICE_CHANNEL];function lP(e){e.setOptions({voiceChannelGuildFilter:null}),e.setLimit(1/0)}function lG(){return(0,p.jsx)("div",{className:lR.i1,children:(0,p.jsx)(n5.E,{variant:"body-md/medium",color:"text-muted",className:lR.GN,children:V.intl.string(V.t.zHjCd1)})})}function lM(e){let{keybind:t,className:n}=e,i=x.useRef(t);x.useEffect(()=>{i.current=t});let[l,s]=x.useState(t.params?.channelId??void 0),r=x.useCallback(()=>{(0,lf.mM)(async()=>e=>(0,p.jsx)(lU,{...e,onSelect:e=>{s(e),iZ.A.setKeybind({...i.current,params:{channelId:e}})}}))},[]);return(0,p.jsx)("div",{className:ic()(lR.a8,n),children:(0,p.jsx)(lu.D,{label:V.intl.string(V.t.q4JpM8),children:(0,p.jsxs)(lb.A,{align:lb.A.Align.STRETCH,children:[(0,p.jsx)("div",{className:lR.$X,children:(0,p.jsx)(lV,{channelId:l})}),(0,p.jsx)(lb.A.Child,{grow:0,shrink:0,children:(0,p.jsx)(j.$,{variant:"primary",text:V.intl.string(V.t.Dm8O4e),onClick:r})})]})})})}function lU(e){let t,n,{transitionState:i,onClose:l,onSelect:s}=e,r=x.useId(),a=x.useRef(null),{query:o,updateQuery:u,queryResults:d}=function(e){let{visible:t,autocompleterResultTypes:n,autocompleterOptions:i,autocompleterBeforeCreateSearchContext:l}=e,[s,r]=x.useState(""),[a,o]=x.useState(l_),u=x.useCallback((e,t)=>{""===(t=t.trim()).trim()?o(l_):o(e)},[]);x.useEffect(()=>lx.A.addRouteChangeListener(()=>{r("")}),[]);let[d]=x.useState(()=>new lI.A(u,n,void 0,i));return x.useEffect(()=>{t?(l?.(d),d.createSearchContext()):(d.clean(),r(""))},[t,d,l]),{queryResults:a,query:s,updateQuery:x.useCallback(e=>{r(e),d.search(e)},[d])}}({visible:!0,autocompleterResultTypes:lL,autocompleterBeforeCreateSearchContext:lP}),c=(t=""!==o,n=(0,I.yK)([ly.A,lC.A,lj.A],()=>{let e=lj.A.getGuildId();if(t||null==e)return[];let n=[];for(let t of ly.A.getVocalChannelIds(e)){let e=lC.A.getChannel(t);null!=e&&n.push(e)}return n},[t]),t?null:n),{focusedIndex:g,setFocusedIndex:m}=function(e){let[t,n]=x.useState(0),i=x.useRef(e);return e!==i.current&&0!==t&&n(0),x.useEffect(()=>{i.current=e}),{focusedIndex:t,setFocusedIndex:n}}(o);x.useEffect(()=>{let{current:e}=a;null==e||e.isItemVisible(0,g,!0)||e.scrollToIndex({section:0,row:g})},[g]);let A=null!=c?c.length:d.length,E=(()=>{if(null!=c)return c[g]?.id;let e=d[g];if(e?.type===lO.rD.VOICE_CHANNEL)return e.record.id})(),h=A>0||""===o?{innerId:r,innerRole:"listbox",innerAriaLabel:V.intl.string(V.t["+N3fW7"]),ref:a,sections:[A],renderRow:function(e){let{row:t}=e,n=(()=>{if(null!=c)return c[t];let e=d[t];if(e?.type===lO.rD.VOICE_CHANNEL)return e.record})();if(null==n)return null;let i=null!=n.parent_id?lC.A.getChannel(n.parent_id):void 0,r=lv.A.getGuild(n.guild_id);return(0,p.jsx)(lN.c3,{id:n.id,channel:n,category:i,focused:g===t,onMouseEnter:()=>m(t),onClick:()=>{s(n.id),l()},onFocus:()=>m(t),children:null!=r?(0,p.jsx)("div",{className:lR.J5,children:r.name}):null},n.id)},sectionHeight:0,rowHeight:34}:{sections:[1],renderRow:()=>(0,p.jsx)(lG,{}),sectionHeight:0,rowHeight:52};return(0,p.jsx)(lT.a,{transitionState:i,onClose:l,title:V.intl.string(V.t.Dm8O4e),subtitle:V.intl.string(V.t.q4JpM8),actions:void 0,input:(0,p.jsx)(lp.k,{value:o,onChange:u,onKeyDown:function(e){let t=e.key.toLowerCase();if("arrowdown"===t||"arrowup"===t||"enter"===t||"escape"===t)switch(e.preventDefault(),t){case"escape":l();break;case"enter":{let e=(()=>{if(null!=c)return c[g];let e=d[g];if(e?.type===lO.rD.VOICE_CHANNEL)return e.record})();null==e?s(void 0):s(e.id),l();break}case"arrowup":0===g?m(A-1):m(g-1);break;case"arrowdown":g>=A-1?m(0):m(g+1)}},placeholder:V.intl.string(V.t.tG0r7g),role:"combobox","aria-controls":r,"aria-expanded":A>0,"aria-activedescendant":A>0&&null!=E?E:void 0,"aria-autocomplete":"list",spellCheck:!1,autoFocus:!0}),listProps:h})}function lV(e){let{channelId:t}=e,{channel:n,category:i,guild:l}=(0,I.cf)([lC.A,lv.A],()=>{let e=null!=t?lC.A.getChannel(t):void 0;return null!=e?{channel:e,category:null!=e.parent_id?lC.A.getChannel(e.parent_id):void 0,guild:null!=e.guild_id?lv.A.getGuild(e.guild_id):void 0}:{channel:void 0,category:void 0,guild:void 0}});return null==n?(0,p.jsx)(n5.E,{variant:"body-md/medium",color:"text-muted",className:lR.GN,children:V.intl.string(V.t["/fYIK7"])}):(0,p.jsx)(lN.c3,{channel:n,id:n.id,category:i,onClick:lD,onFocus:lD,onMouseEnter:lD,focused:!1,children:null!=l?(0,p.jsx)("div",{className:lR.J5,children:l.name}):null})}var lk=n(650583),lw=n(731854),lF=n(94451);function lB(e){let{keybind:t}=e,n=(0,I.bG)([la.Ay],()=>la.Ay.isWaylandPortalActive()),i=(0,I.bG)([la.Ay],()=>la.Ay.getWaylandPortalShortcutState(t.id));return n&&0!==t.shortcut.length&&t.enabled?la.Ay.isWaylandPortalEligibleShortcut(t.shortcut)?null==i?null:i.bound?(0,lr.Rg)(i)?(0,p.jsx)("div",{className:lF.$e,children:(0,p.jsx)(iK.w,{type:"info",message:V.intl.format(V.t.wu2lqV,{trigger:i.triggerDescription}),role:"status"})}):null:(0,p.jsx)("div",{className:lF.$e,children:(0,p.jsx)(iK.w,{type:"warning",message:V.intl.string(V.t.PTCrUP),role:"status"})}):(0,p.jsx)("div",{className:lF.$e,children:(0,p.jsx)(iK.w,{type:"warning",message:V.intl.string(V.t.J0m3aK),role:"status"})}):null}function lX(e){let{keybind:t}=e,n=lS.dI(t.shortcut);return e6.A.hasBind(n)?(0,p.jsx)("div",{className:lF.$e,children:(0,p.jsx)(iK.w,{type:"warning",message:V.intl.string(V.t["7lQlw3"]),role:"status"})}):lk.Yy.has(n)?(0,p.jsx)("div",{className:lF.$e,children:(0,p.jsx)(iK.w,{type:"warning",message:V.intl.format(V.t.MOIaNd,{keyboardNavArticle:eC.A.getArticleURL(_.MVz.KEYBOARD_NAVIGATION)}),role:"status"})}):void 0}function lz(e){let{keybind:t}=e;return t.action===_.hCu.SWITCH_TO_VOICE_CHANNEL?(0,p.jsx)(lM,{keybind:t,className:lF._M}):null}let lH=x.memo(function(e){let{keybind:t,keybindDescriptions:n,keybindActionTypes:i}=e,l=x.useCallback(e=>iZ.A.setKeybind({...t,action:e}),[t]),s=x.useCallback(e=>{if((0,lr.uL)(t.id,t.shortcut,e,la.Ay.getWaylandPortalShortcutState(t.id)),t.managed&&t.action===_.hCu.PUSH_TO_TALK){let n=t.context??lw.x.DEFAULT;lE.default.setMode(i9.Ay.getMode(n),{shortcut:e},n);return}iZ.A.setKeybind({...t,shortcut:e})},[t]),r=x.useCallback(()=>iZ.A.setKeybind({...t,enabled:!t.enabled}),[t]),a=x.useCallback(()=>iZ.A.deleteKeybind(t.id),[t.id]),o=x.useId(),u=x.useMemo(()=>i.find(e=>e.value===t.action)?.label??t.action,[t.action,i]);return(0,p.jsxs)("div",{className:lF.f_,children:[(0,p.jsx)(lX,{keybind:t}),(0,p.jsx)(lB,{keybind:t}),(0,p.jsx)("div",{className:lF.XI,children:(0,p.jsx)(lo.l,{selectionMode:"single",label:V.intl.string(V.t.XH5b12),value:t.action,options:i,onSelectionChange:l,disabled:t.managed})}),(0,p.jsx)("div",{className:lF.LE,children:(0,p.jsx)(lu.D,{label:V.intl.string(V.t["1La4tC"]),layout:"vertical",children:(0,p.jsx)(lh.A,{defaultValue:t.shortcut,onChange:s})})}),(0,p.jsxs)("div",{className:lF.ne,children:[!t.managed&&(0,p.jsx)(ld.K,{variant:"icon-only",onClick:a,icon:lc.TrashIcon,"aria-label":V.intl.string(V.t.qEHmmB)}),(0,p.jsx)(lg.m,{text:V.intl.string(t.enabled?V.t.pNYGbx:V.t["51DGkH"]),ariaHidden:!0,children:(0,p.jsxs)("div",{children:[(0,p.jsx)(lm.A,{id:o,children:V.intl.format(t.enabled?V.t["myr/Y0"]:V.t.lYhtPO,{actionName:u})}),(0,p.jsx)(lA.I,{checked:t.enabled,onChange:r,labelledBy:o})]})})]}),(0,p.jsx)(n5.E,{variant:"body-xs/normal",color:"text-subtle",className:lF.h_,children:n[t.action]}),(0,p.jsx)(lz,{keybind:t})]})});var lY=n(158781),lW=n(734066),lK=n(880144),lZ=n(994778),lq=n(244055),lQ=n(603933);function lJ(){let e=(0,I.bG)([la.Ay],()=>la.Ay.isWaylandPortalActive()),t=x.useMemo(()=>e&&(0,lr.u)(),[e]);return e?(0,p.jsx)(iK.w,{type:"info",message:V.intl.string(V.t.AcH7R7),role:"none",action:t?{text:V.intl.string(V.t.ZPHaPE),onClick:lr.qM}:void 0}):null}let l$=function(){let e,t,n,i,l,s,r,{customizableKeybinds:a,keybindDescriptions:o,keybindActionTypes:u}=(e=(0,I.bG)([la.Ay],()=>la.Ay.getState()),t=(0,I.bG)([i9.Ay],()=>(0,lK.A)(i9.Ay)),n=(0,I.bG)([i9.Ay],()=>i9.Ay.supports(lw.O5.VIDEO)),i=(0,I.bG)([lq.A],()=>lq.A.isSupported),l=(0,lW.sw)(),s=(0,lW.BW)(),{customizableKeybinds:function(e){let{keybinds:t,enableClips:n,enableScreenshotKeybind:i,allowSoundboard:l}=e;return K()(t).reject(e=>e.managed&&![_.hCu.OVERLAY_ACTIVATE_REGION_TEXT_WIDGET,_.hCu.SAVE_CLIP,_.hCu.SAVE_SCREENSHOT].includes(e.action)).reject(e=>!n&&(e.action===_.hCu.SAVE_CLIP||e.action===_.hCu.SAVE_SCREENSHOT)).reject(e=>!i&&e.action===_.hCu.SAVE_SCREENSHOT).reject(e=>!l&&(e.action===_.hCu.SOUNDBOARD||e.action===_.hCu.SOUNDBOARD_HOLD)).sortBy(e=>e.id).sortBy(e=>!0===e.managed?-1:0).value()}({keybinds:e,enableClips:l,enableScreenshotKeybind:s,allowSoundboard:r=(0,e8.uF)()}),keybindActionTypes:function(e){let{overlaySupported:t,canGoLive:n,videoSupported:i,allowSoundboard:l,enableClips:s,enableScreenshotKeybind:r}=e,a=[{id:"unassigned",value:_.hCu.UNASSIGNED},{id:"push-to-talk",value:_.hCu.PUSH_TO_TALK},{id:"push-to-talk-priority",value:_.hCu.PUSH_TO_TALK_PRIORITY},{id:"push-to-mute",value:_.hCu.PUSH_TO_MUTE},{id:"vad-priority",value:_.hCu.VAD_PRIORITY},{id:"toggle-mute",value:_.hCu.TOGGLE_MUTE},{id:"toggle-deafen",value:_.hCu.TOGGLE_DEAFEN},{id:"toggle-voice-mode",value:_.hCu.TOGGLE_VOICE_MODE},{id:"toggle-streamer-mode",value:_.hCu.TOGGLE_STREAMER_MODE},{id:"toggle-voice-channel-chat",value:_.hCu.TOGGLE_VOICE_CHANNEL_CHAT}];return i&&a.push({id:"toggle-camera",value:_.hCu.TOGGLE_CAMERA}),t&&(a.push({id:"toggle-overlay-input-lock",value:_.hCu.TOGGLE_OVERLAY_INPUT_LOCK}),a.push({id:"activate-overlay-region-text-widget",value:_.hCu.OVERLAY_ACTIVATE_REGION_TEXT_WIDGET})),n&&((0,e8.uF)()||i9.Ay.getUseSystemScreensharePicker())&&a.push({id:"toggle-go-live-streaming",value:_.hCu.TOGGLE_GO_LIVE_STREAMING}),(0,e8.xl)()&&(a.push({id:"navigate-back",value:_.hCu.NAVIGATE_BACK},{id:"navigate-forward",value:_.hCu.NAVIGATE_FORWARD},{id:"switch-to-voice-channel",value:_.hCu.SWITCH_TO_VOICE_CHANNEL},{id:"disconnect-from-voice-channel",value:_.hCu.DISCONNECT_FROM_VOICE_CHANNEL}),l&&a.push({id:"soundboard",value:_.hCu.SOUNDBOARD},{id:"soundboard-hold",value:_.hCu.SOUNDBOARD_HOLD}),s&&(a.push({id:"save-clip",value:_.hCu.SAVE_CLIP}),r&&a.push({id:"save-screenshot",value:_.hCu.SAVE_SCREENSHOT}))),a.map(e=>{let{id:t,value:n}=e;return{id:t,value:n,label:(0,lZ.B)(n)??n}})}({overlaySupported:i,canGoLive:t,videoSupported:n,allowSoundboard:r,enableClips:l,enableScreenshotKeybind:s}),keybindDescriptions:function(e){let{overlaySupported:t,canGoLive:n,videoSupported:i,enableClips:l,enableScreenshotKeybind:s}=e,r={[_.hCu.UNASSIGNED]:V.intl.string(V.t.rvlNLv),[_.hCu.PUSH_TO_MUTE]:V.intl.string(V.t.xtESim),[_.hCu.PUSH_TO_TALK]:V.intl.string(V.t.wTcBSy),[_.hCu.PUSH_TO_TALK_PRIORITY]:V.intl.string(V.t.FhHvWH),[_.hCu.TOGGLE_MUTE]:V.intl.string(V.t.X2fbUm),[_.hCu.TOGGLE_DEAFEN]:V.intl.string(V.t.MjREZV),[_.hCu.TOGGLE_VOICE_MODE]:V.intl.string(V.t.snm5YW),[_.hCu.TOGGLE_STREAMER_MODE]:V.intl.string(V.t.YszLLx),[_.hCu.VAD_PRIORITY]:V.intl.string(V.t.rSe8IZ),[_.hCu.TOGGLE_VOICE_CHANNEL_CHAT]:V.intl.string(V.t.desfB4)};return i&&(r[_.hCu.TOGGLE_CAMERA]=V.intl.string(V.t.v1JBtL)),t&&(r[_.hCu.TOGGLE_OVERLAY_INPUT_LOCK]=V.intl.string(V.t.IoP5vc)),n&&(0,e8.uF)()&&(r[_.hCu.TOGGLE_GO_LIVE_STREAMING]=V.intl.string(V.t.s4C238)),(0,e8.xl)()&&(r[_.hCu.NAVIGATE_BACK]=V.intl.string(V.t.nKDlEt),r[_.hCu.NAVIGATE_FORWARD]=V.intl.string(V.t.DK0FFk),r[_.hCu.SOUNDBOARD]=(0,e8.uF)()?V.intl.string(V.t["5wJefL"]):V.intl.string(V.t.gzjsSP),r[_.hCu.SOUNDBOARD_HOLD]=(0,e8.uF)()?V.intl.string(V.t.RRkZc9):V.intl.string(V.t.laNlTl),l&&(r[_.hCu.SAVE_CLIP]=V.intl.string(V.t.z3Wbam),s&&(r[_.hCu.SAVE_SCREENSHOT]=V.intl.string(V.t.m0zd57)))),r}({overlaySupported:i,canGoLive:t,videoSupported:n,enableClips:l,enableScreenshotKeybind:s})});return 0===a.length?(0,p.jsxs)(q.B,{gap:16,children:[(0,p.jsx)(lJ,{}),(0,p.jsx)(n5.E,{variant:"body-sm/normal",color:"text-subtle",children:V.intl.string(V.t.vyYgWp)})]}):(0,p.jsxs)(q.B,{gap:16,children:[(0,p.jsx)(lJ,{}),(0,p.jsx)("div",{className:lQ.A,children:a.map((e,t)=>(0,p.jsxs)(x.Fragment,{children:[(0,p.jsx)(lH,{keybind:e,keybindDescriptions:o,keybindActionTypes:u}),t<a.length-1?(0,p.jsx)(ls.c,{className:lQ.y,gap:24}):null]},e.id))})]})},l0=(0,h.E2)(S.X.CUSTOM_KEYBINDS_SETTING,{useSearchTerms:()=>[V.intl.string(V.t["069nVT"])],Component:function(){return nh.Av?(0,p.jsx)(l$,{}):(0,p.jsx)(iK.w,{type:"info",message:V.intl.format(V.t.mPi3F3,{downloadLink:_.X7G.DOWNLOAD}),role:"none"})}});var l1=n(475358),l2=n(552992),l3=n(793650);function l5(e){let{children:t}=e;return t([lY.Q_.MESSAGE,lY.Q_.NAVIGATION,lY.Q_.DND,lY.Q_.CHAT,lY.Q_.VOICE_AND_VIDEO,lY.Q_.MISCELLANEOUS])}function l4(e){let{showHeader:t=!0}=e,n=K()((0,lY.Bx)()).filter(e=>e.description!==V.intl.string(V.t.HnNtEI)).filter(e=>e.predicate?.()!==!1).groupBy(e=>e.group).value();return(0,p.jsxs)(q.B,{gap:48,children:[(0,p.jsx)(n3.n,{label:t?V.intl.string(V.t.Lz5KHI):void 0,children:(0,p.jsx)("div",{className:l3.jh,children:(0,p.jsxs)("div",{className:l3.yZ,children:[(0,p.jsx)(n5.E,{variant:"body-md/normal",children:V.intl.string(V.t.sMWLBj)}),(0,p.jsx)("div",{className:l3.DM,children:(0,p.jsx)(l1.e,{shortcut:l2.z.binds["0"],className:l3.LE})})]})})}),(0,p.jsx)(l5,{children:e=>(0,p.jsx)(p.Fragment,{children:e.map((e,t)=>{let i=(0,lY.Gm)(e),l=(0,lY.zF)(e),s=n[e];return(0,p.jsx)(n3.n,{label:i,description:l,children:(0,p.jsx)("div",{className:l3.jh,children:s.map((e,t)=>(0,p.jsxs)(x.Fragment,{children:[0!==t&&(0,p.jsx)(ls.c,{}),(0,p.jsxs)("div",{className:l3.yZ,children:[(0,p.jsx)(n5.E,{variant:"body-md/normal",children:e.description}),(0,p.jsx)("div",{className:l3.DM,children:e.binds.map(e=>(0,p.jsx)(l1.e,{shortcut:e,className:l3.LE},e))})]})]},e.description))})},t)})})})]})}let l6=(0,h.E2)(S.X.DEFAULT_KEYBINDS_SETTING,{useSearchTerms:()=>[V.intl.string(V.t.Lz5KHI)],Component:()=>(0,p.jsx)(l4,{showHeader:!1})}),l8=(0,h.zD)(S.X.GAME_MODE_ENABLED_SETTING,{useTitle:()=>V.intl.string(eD.default.rea2Ar),useSubtitle:()=>V.intl.string(eD.default.DwBO0x),useValue:()=>(0,I.bG)([iJ.A],()=>iJ.A.isEnabledFor(!0)),setValue:e=>{td.default.track(_.HAw.GAME_MODE_TOGGLED,{enabled:e,running_game_id:iJ.A.runningGameId}),ts.h.dispatch({type:"GAME_MODE_SET_ENABLED",enabled:e})}});var l7=n(253400),l9=n(546385);let se=(0,h.E2)(S.X.HARDWARE_ACCELERATION,{usePredicate:()=>nh.Av&&!(0,nh.cX)(),useSearchTerms:()=>[V.intl.string(V.t["/HIxyY"]),V.intl.string(V.t.B0hqpb)],Component:function(){let[e]=x.useState(()=>l7.Ay.getEnableHardwareAcceleration()),t=V.intl.string(V.t["/HIxyY"]),n=V.intl.string(V.t.B0hqpb);return(0,p.jsxs)(q.B,{children:[(0,p.jsx)(t4.d,{label:t,description:n,checked:e,onChange:st}),!e&&(0,p.jsx)(l9.A,{look:l9.k.WARNING,children:V.intl.string(V.t.j7S6IX)})]})}});function st(e){let t=e?V.intl.format(V.t.LYXRxL,{}):V.intl.format(V.t.uDP3Kz,{});(0,n2.A)({title:V.intl.string(V.t.aqpAvn),subtitle:t,confirmText:V.intl.string(V.t.vT7ckk),onConfirm:()=>{l7.Ay.setEnableHardwareAcceleration(e)}})}let sn=(0,eb.D)(()=>({openOnStartup:!0,startMinimized:!1,minimizeToTray:!0})),si=(0,h.zD)(S.X.OS_OPEN_ON_STARTUP,{useTitle:()=>V.intl.string(V.t["3BeZti"]),usePredicate:()=>nh.Av&&!(0,nh.cX)(),useValue:()=>sn.useState(e=>e.openOnStartup),setValue:function(e){sn.setState({openOnStartup:e}),l7.Ay.send("TOGGLE_OPEN_ON_STARTUP",e)},initialize:()=>{l7.Ay.getOpenOnStart().then(e=>sn.setState({openOnStartup:e}))}}),sl=(0,h.zD)(S.X.OS_MINIMIZE_TO_TRAY,{useTitle:()=>V.intl.string(V.t.dJ5MUh),useSubtitle:()=>V.intl.string(V.t.nQavHr),usePredicate:()=>nh.Av&&!(0,nh.cX)(),useValue:()=>sn.useState(e=>e.minimizeToTray),setValue:function(e){sn.setState({minimizeToTray:e}),l7.Ay.send("TOGGLE_MINIMIZE_TO_TRAY",e)},initialize:()=>{l7.Ay.getSetting("MINIMIZE_TO_TRAY",!0).then(e=>sn.setState({minimizeToTray:e}))}}),ss=(0,h.zD)(S.X.OS_START_MINIMIZED,{useTitle:()=>V.intl.string(V.t.GfBL83),useSubtitle:()=>V.intl.string(V.t.XGyhhc),usePredicate:()=>(0,nh.uF)(),useValue:()=>sn.useState(e=>!!e.openOnStartup&&e.startMinimized),setValue:function(e){sn.setState({startMinimized:e}),l7.Ay.send("TOGGLE_START_MINIMIZED",e)},useDisabled:()=>!sn.useState(e=>e.openOnStartup),initialize:()=>{l7.Ay.getSetting("START_MINIMIZED",!1).then(e=>sn.setState({startMinimized:e}))}});var sr=n(61628);let sa=new Set(["failure","unknown"]),so=(0,h.E2)(S.X.OS_SYSTEM_SERVICE,{useSearchTerms:()=>[V.intl.string(V.t.roHq80)],Component:function(){let[e,t]=x.useState(!1),[n,i]=x.useState(()=>(0,le.TC)()),l=(0,I.bG)([i4.Ay],()=>i4.Ay.getSystemServiceStatus("input-service")),s=x.useCallback(async()=>{t(!0),n?await (0,le.z8)("windows-settings"):await (0,le.sL)("windows-settings"),t(!1),i((0,le.TC)())},[n]);return(0,p.jsxs)("div",{className:sr.q,children:[(0,p.jsxs)("div",{className:sr.L,children:[(0,p.jsxs)(q.B,{direction:"horizontal",children:[(0,p.jsx)(n5.E,{variant:"body-md/medium",color:"text-strong",children:V.intl.string(V.t.roHq80)}),n&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n5.E,{variant:"body-md/medium",color:"text-strong","aria-hidden":!0,children:"\u2022"}),(0,p.jsx)(n5.E,{variant:"body-md/medium",color:"running"===l.state?"text-feedback-positive":sa.has(l.state)?"text-feedback-critical":"text-feedback-warning",children:function(e){switch(e.state){case"unknown":return V.intl.string(V.t["KW+nqT"]);case"disabled":return V.intl.string(V.t["Q/wAF7"]);case"disconnected":return V.intl.string(V.t.Xvs9IM);case"initializing":return V.intl.string(V.t.h4qz8W);case"connecting":return V.intl.string(V.t.fSu9XF);case"handshaking":return V.intl.string(V.t["00aYLJ"]);case"running":return V.intl.string(V.t["54TB7Z"]);case"waiting-for-retry":return V.intl.string(V.t["0FONwi"]);case"failure":return V.intl.string(V.t.Ic0nkd);default:(0,io.xb)(e.state)}}(l)})]})]}),(0,p.jsx)(n5.E,{variant:"body-sm/normal",color:"text-subtle",children:V.intl.format(V.t["8CAL+D"],{helpCenterLink:eC.A.getArticleURL(_.MVz.SYSTEM_SERVICE)})})]}),(0,p.jsx)(j.$,{variant:n?"critical-secondary":"primary",loading:e,onClick:s,text:n?V.intl.string(V.t.pAwbdL):V.intl.string(V.t["1iI46O"])})]})},usePredicate:le.XQ});var su=n(687813),sd=n(613412),sc=n(858899),sg=n(384077);let sm=(0,h.Tf)(S.X.CAPTURE_PERFORMANCE_TRACE,{useTitle:()=>V.intl.string(V.t.o6Qr6n),useSubtitle:()=>V.intl.string(V.t.OuGtH8),useLabel:()=>V.intl.string(V.t.bm1WjO),usePredicate:()=>nh.Av&&nf.A?.tracing?.capturePerformanceTrace!=null,onClick:()=>{(0,n2.A)({title:V.intl.string(V.t.o6Qr6n),subtitle:V.intl.string(V.t.JEHHJ1),confirmText:V.intl.string(V.t.bm1WjO),onConfirm:()=>{(0,tH.default)(),async function(){try{await async function(){var e;let t=nf.A.tracing;if(null==t)return;(0,sc.P0)({text:V.intl.string(V.t.qGRW8d)});let[n,i,l]=await Promise.all([t.capturePerformanceTrace({durationMs:3e4}),nf.A.processUtils.getSystemInfo(),nf.A.processUtils.getSystemMetrics((0,sg.uD)())]),s={captured_at:n.startedAtISO,duration_ms:n.durationMs,categories:n.categories,...(0,sd.getSuperProperties)(),native_build_number:nf.A.app.getBuildNumber()},r={systemInfo:i,systemMetrics:l,cumulativeCpuUsage:nf.A.processUtils.getCumulativeCPUUsage()??null,processTypeCpuUsage:nf.A.processUtils.getCpuUsageElectronProcessTypeDetails()??null},a=await (e={"trace.json":n.traceBytes,"system_info.json":(0,su._u)(JSON.stringify(r,null,2)),"metadata.json":(0,su._u)(JSON.stringify(s,null,2))},new Promise((t,n)=>{(0,su.yU)(e,{level:6},(e,i)=>null!=e?n(e):t(i))})),o=`Discord-Trace-${n.startedAtISO.replace(/:/g,"-").replace(/\..*$/,"")}.zip`,{filePath:u}=await t.saveTraceToDownloads(a,o);nf.A.fileManager.showItemInFolder(u),(0,sc.P0)({text:V.intl.string(V.t.gpCRFS),variant:"success"})}()}catch{(0,sc.P0)({text:V.intl.string(V.t["8ihs9i"]),variant:"critical"})}}()}})}});function sA(){ts.h.dispatch({type:"DISCORD_STATS_POPOUT_WINDOW_OPEN"})}var sE=n(287809);let sh=(0,h.Tf)(S.X.DISCORD_STATS_POPOUT,{useTitle:()=>"Discord Stats",useSubtitle:()=>"Open a floating panel showing live GPU, CPU, and memory usage.",useLabel:()=>"Open",usePredicate:()=>(0,I.bG)([sE.default],()=>sE.default.getCurrentUser()?.isStaff()??!1),onClick:()=>{sA()}});var sS=n(114129),sT=n(442325),sf=n(858760);let sp=(0,h.zD)(S.X.ENABLE_TABS_EXPERIENCE,{useTitle:()=>"Enable tabs experience",useSubtitle:()=>"Open channels as browser-style tabs in the title bar, each with its own back/forward history.",usePersistentBadge:()=>({badgeType:f.Xi.BETA}),usePredicate:()=>sf.A.useConfig({location:"EnableTabsExperienceSetting"}).enabled&&(0,nh.xl)(),useValue:()=>(0,I.bG)([sT.A],()=>sT.A.isUserOptedIn()),setValue:sS.lj});var sx=n(813645);let sI={};var s_=n(735729),sb=n(146849);let sN=(0,h.zD)(S.X.NATIVE_MARKDOWN,{useTitle:()=>V.intl.string(V.t["5CIvT4"]),usePredicate:()=>sb.wG.useConfig({location:"NativeMarkdownSetting"}).enabled,useValue:()=>(0,s_.A)(sb.XQ),setValue:e=>(function(e){let{enabled:t=!sx.A.get(e)}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sI;ts.h.dispatch({type:"LAB_FEATURE_TOGGLE",labFeature:e,enabled:t})})(sb.XQ,{enabled:e})}),sC=(0,h.zZ)(S.X.SYSTEM_ADVANCED_CATEGORY,{useTitle:()=>V.intl.string(V.t["8/udY0"]),buildLayout:()=>[sh,sm,sp,sN]}),sy=(0,h.zZ)(S.X.SYSTEM_GENERAL_CATEGORY,{useTitle:()=>V.intl.string(V.t.cg6ltt),buildLayout:()=>[si,ss,sl,se],usePredicate:()=>nh.Av&&((0,nh.uF)()||(0,nh.j9)()),initialize:()=>{!async function(){let e=await l7.Ay.getOpenOnStart(),t=await l7.Ay.getSetting("START_MINIMIZED",!1),n=await l7.Ay.getSetting("MINIMIZE_TO_TRAY",!0);sn.setState({openOnStartup:e,startMinimized:t,minimizeToTray:n})}()}}),sv=(0,h.zZ)(S.X.SYSTEM_CUSTOM_KEYBINDS_CATEGORY,{useTitle:()=>V.intl.string(V.t["069nVT"]),useSubtitle:()=>V.intl.string(V.t.T4LZVL),buildLayout:()=>[l0],initialize:()=>(iZ.A.enableAll(!1),()=>iZ.A.enableAll(!0)),useInlineNotice:function(){return nh.Av?{type:f.lT.STRONGLY_DISCOURAGED_CUSTOM,notice:()=>(0,p.jsxs)(q.B,{direction:"vertical",gap:"md",children:[(0,p.jsx)(iK.w,{type:"info",message:V.intl.string(V.t["5pkmHa"]),role:"none"}),(0,p.jsx)(ll,{sourcePage:"keybinds"})]})}:null},useHeaderDecoration:()=>nh.Av?{type:f.WX.BUTTON_GROUP,buttons:[{id:"add-keybind",type:f.UV.BUTTON,text:V.intl.string(V.t.zk6Xbs),variant:"secondary",icon:iY.PlusSmallIcon,onClick:()=>iZ.A.addKeybind()}]}:null}),sj=(0,h.zZ)(S.X.SYSTEM_DEFAULT_KEYBINDS_CATEGORY,{useTitle:()=>V.intl.string(V.t.Lz5KHI),buildLayout:()=>[l6]}),sO=(0,h.zZ)(S.X.SYSTEM_HELPER_CATEGORY,{useTitle:()=>V.intl.string(V.t["+XZgmA"]),usePredicate:()=>nh.Av&&((0,nh.uF)()||(0,nh.j9)()),buildLayout:()=>[so]}),sR=(0,h.zZ)(S.X.SYSTEM_GAME_MODE_CATEGORY,{useTitle:()=>V.intl.string(eD.default.QG0axY),usePredicate:()=>(0,I.bG)([iJ.A,iq.A],()=>e8.isPlatformEmbedded&&iJ.A.hasDetectedGame&&(0,iQ.v)({location:"GameModeCategory"}).enabled),buildLayout:()=>[l8]}),sD=(0,h.t_)(S.X.SYSTEM_PANEL,{useTitle:()=>V.intl.string(V.t["VJ/qKo"]),buildLayout:()=>[sy,sv,sj,sO,sR,sC]}),sL=(0,h.i4)(S.X.SYSTEM_SIDEBAR_ITEM,{useTitle:()=>V.intl.string(V.t["VJ/qKo"]),icon:iW.KeyboardIcon,buildLayout:()=>[sD]});var sP=n(831544),sG=n(922795),sM=n(212245),sU=n(329551),sV=n(352430),sk=n(854325),sw=n(952572),sF=n(717359);let sB=(0,h.E2)(S.X.CAMERA_BACKGROUND_SETTING,{useSearchTerms:()=>[V.intl.string(V.t.lZTUPs)],usePredicate:sw.A,Component:function(){let e=(0,sM.p)(),t=x.useRef(!1),n=(0,I.bG)([i9.Ay],()=>i9.Ay.getVideoDeviceId()),[i,l]=x.useState((0,sU.i)(sE.default.getCurrentUser())),s=x.useRef(i);return x.useEffect(()=>()=>{t.current&&(0,sV._C)(s.current)},[]),(0,p.jsx)(sF.A,{selectedBackgroundOption:i,onSelectBackgroundOption:function(n){t.current=!0,s.current=n,l(n),(0,sk.gB)(n,{location:e.location}).catch(_.tEg)},currentDeviceId:n})}}),sX=(0,h.zD)(S.X.CAMERA_PREVIEW_PREFERENCE,{useTitle:()=>V.intl.string(V.t["3Ppr1h"]),useSubtitle:()=>V.intl.string(V.t.WNbX4O),useValue:U.bm.useSetting,setValue:e=>{U.bm.updateSetting(e),td.default.track(_.HAw.UPDATE_USER_SETTINGS_LOCAL,{always_preview_video:e})}});var sz=n(625841),sH=n(74848),sY=n(204050);let sW=(0,eb.D)(()=>({previewEnabled:!1})),sK=(0,h.E2)(S.X.CAMERA_SELECTION_SETTING,{useSearchTerms:()=>[V.intl.string(V.t.FsQ3OR)],Component:function(){let e=(0,I.bG)([i9.Ay],()=>i9.Ay.isVideoAvailable()),{id:t}=(0,sH.x5)(lw.oh.VIDEO_INPUT),{analyticsLocations:n}=(0,ez.Ay)();return(0,p.jsx)(sz.U,{label:V.intl.string(V.t.FsQ3OR),deviceType:lw.oh.VIDEO_INPUT,location:"UserSettingsCameraSelect",isDisabled:!e,helperText:(0,sY.p)()?V.intl.format(V.t.aJYgRt,{onCameraSettingsClick:()=>{sW.setState({previewEnabled:!1}),window.open((0,sY.i)(t)),td.default.track(_.HAw.SYSTEM_CAMERA_SETTINGS_OPENED,{location_stack:n})}}):void 0})}});var sZ=n(745317),sq=n(9219);let sQ=(0,h.E2)(S.X.CAMERA_VIDEO_PREVIEW,{useSearchTerms:()=>[V.intl.string(V.t.JIf4v7)],Component:function(){let e=i9.Ay.getCameraComponent(),t=(0,I.bG)([i9.Ay],()=>i9.Ay.getVideoDeviceId()),n=sW.useField("previewEnabled"),i=(0,I.bG)([i9.Ay],()=>i9.Ay.isVideoAvailable());return((0,e_.l0)(()=>{sW.setState({previewEnabled:!1})}),n)?(0,p.jsx)("div",{className:sq.T9,children:(0,p.jsxs)("div",{className:sq.Xi,children:[(0,p.jsxs)("div",{className:sq.UI,children:[(0,p.jsx)(e,{deviceId:t,width:387,height:218,disabled:!n}),(0,p.jsx)(sZ.kE,{})]}),(0,p.jsx)(sZ.eK,{})]})}):(0,p.jsx)("div",{className:sq.T9,children:(0,p.jsx)(lg.m,{text:i?null:V.intl.string(V.t["8jSzSe"]),children:(0,p.jsx)(j.$,{variant:"primary",text:V.intl.string(V.t.JIf4v7),onClick:()=>sW.setState({previewEnabled:!0}),disabled:!i})})})}}),sJ=(0,h.zZ)(S.X.CAMERA_CATEGORY,{useTitle:()=>V.intl.string(V.t.uje3P9),usePredicate:()=>(0,I.bG)([i9.Ay],()=>i9.Ay.supports(lw.O5.VIDEO)),buildLayout:()=>[sQ,sX,sK,sB]}),s$=(0,h.zD)(S.X.VOICE_AND_VIDEO_OPENH264,{useTitle:()=>V.intl.string(V.t.qFphsa),useSubtitle:()=>V.intl.string(V.t.cQfwyY),usePredicate:function(){return(0,nh.j9)()},useValue:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.getOpenH264Enabled())},setValue:function(e){lE.default.setOpenH264Enabled(e),(0,n2.A)({title:V.intl.string(V.t["9jf31O"]),subtitle:V.intl.string(V.t["J2wg+X"]),confirmText:V.intl.string(V.t.BddRzS),onConfirm:()=>nf.A.app.relaunch()})},useSearchTerms:()=>["open","OpenH264","H264","codec"]}),s0=(0,h.zD)(S.X.VOICE_AND_VIDEO_AUDIO_RECORDING,{useTitle:()=>V.intl.string(V.t["r6K+TL"]),useSubtitle:()=>V.intl.string(V.t["xl9+I6"]),useValue:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.getAecDump())},setValue:lE.default.setAecDump,usePredicate:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.isAecDumpSupported())}});var s1=n(139033),s2=n(862482),s3=n(640238),s5=n(825484),s4=n(497029),s6=n(487329),s8=n(353835);let s7=(0,eb.D)(()=>({isUploading:!1,isDisabled:!1}));async function s9(){let e=await nf.A.fileManager.getLogPath();nf.A.fileManager.showItemInFolder(e)}function re(e){(0,n2.A)({title:V.intl.string(V.t["7UXEF2"]),subtitle:V.intl.string(V.t.IYPrRl),confirmText:V.intl.string(V.t.BddRzS),onConfirm:()=>lE.default.setDebugLogging(e)})}async function rt(){await async function(e){let{onUploadStart:t,onUploadFinish:n}=e;t?.();try{let e,t;await i9.Ay.getMediaEngine().writeAudioDebugState(),await s8.A.submitLiveCrashReport({message:{message:"User Live Dump"}}),await (0,s4.a)(_.Umv.RTC),e=V.intl.string(V.t["fKBB8+"]),t=V.intl.string(V.t.BvyxE7),(0,s1.A)({title:e,subtitle:t})}catch(s){var i;let e,t,n,l;i=s.displayMessage,e=V.intl.string(V.t.QZg0J7),t=i??V.intl.string(V.t.VzHcSm),n=(0,s6.B1)(s6.iy.DEBUG_LOG_UPLOAD_FAILED)?.errorCode,l=V.intl.formatToPlainString(V.t.ejOT95,{errorCode:n}),(0,lf.qf)(n=>(0,p.jsx)(s3.a,{header:e,confirmButtonColor:s2.$n.Colors.BRAND,confirmText:V.intl.string(V.t.BddRzS),...n,children:(0,p.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,p.jsx)(n5.E,{variant:"body-md/normal",children:t}),(0,p.jsx)(n5.E,{variant:"body-sm/semibold",selectable:!0,style:{marginTop:"auto"},children:l})]})}))}finally{n?.()}}({onUploadStart:()=>s7.setState({isUploading:!0}),onUploadFinish:()=>s7.setState({isUploading:!1,isDisabled:!0})})}let rn=(0,h.E2)(S.X.VOICE_AND_VIDEO_DEBUG_LOGGING,{useSearchTerms:()=>[V.intl.string(V.t["726JHL"]),V.intl.string(V.t.EbwFfR),V.intl.string(V.t.nuPtYi)],usePredicate:function(){let e=(0,I.bG)([i9.Ay],()=>i9.Ay.supports(lw.O5.DEBUG_LOGGING));return nh.Av&&e&&null!=nf.A.fileManager.readLogFiles},Component:function(){let e=(0,I.bG)([i9.Ay],()=>i9.Ay.getDebugLogging()),t=s7.useField("isUploading"),n=s7.useField("isDisabled"),i=x.useId();return(0,p.jsxs)("fieldset",{children:[(0,p.jsx)(lm.A,{tag:"legend",id:i,children:V.intl.string(V.t["FjN+et"])}),(0,p.jsxs)(q.B,{direction:"vertical",gap:4,children:[(0,p.jsx)(t4.d,{label:V.intl.string(V.t["726JHL"]),description:V.intl.string(V.t["/7ak9Q"]),checked:e,onChange:re}),(0,p.jsx)("div",{role:"group","aria-labelledby":i,children:(0,p.jsxs)(s5.e,{children:[(0,p.jsx)(j.$,{variant:"secondary",text:V.intl.string(V.t.EbwFfR),onClick:rt,loading:t,disabled:n,"aria-label":V.intl.string(V.t.aY1OH2)}),(0,p.jsx)(j.$,{variant:"secondary",text:V.intl.string(V.t.nuPtYi),onClick:s9,"aria-label":V.intl.string(V.t["L/hFOe"])})]})})]})]})}});var ri=n(233545),rl=n(58663),rs=n(412780);function rr(){return(0,I.bG)([sE.default,i9.Ay],()=>{let e=sE.default.getCurrentUser(),t=e?.isStaff()??!1,n="canary"===l7.Ay.releaseChannel||"development"===l7.Ay.releaseChannel,i=i9.Ay.supports(lw.O5.CONNECTION_REPLAY);return t&&n&&i})}let ra=(0,h.zD)(S.X.VOICE_AND_VIDEO_RECORD_CONNECTION_REPLAY,{useTitle:()=>V.intl.string(V.t.U4FgFK),useSubtitle:()=>V.intl.string(V.t.Lm72RU),useValue:function(){return(0,I.bG)([rs.Ay],()=>rs.Ay.shouldRecordNextConnection())},setValue:rl.A,usePredicate:rr}),ro=(0,h.Tf)(S.X.VOICE_AND_VIDEO_OPEN_CONNECTION_REPLAY,{useTitle:()=>V.intl.string(V.t.nJnOHO),useLabel:()=>V.intl.string(V.t["3xjX0U"]),onClick:ri.YW,usePredicate:rr});var ru=n(926919),rd=n(111162),rc=n(855302);let rg=(0,h.zD)(S.X.VOICE_AND_VIDEO_STREAM_INFO_OVERLAY,{useTitle:()=>V.intl.string(V.t["0CEP6e"]),useSubtitle:()=>V.intl.string(V.t["kBXuW+"]),useValue:function(){return(0,I.bG)([rd.default],()=>rd.default.isStreamInfoOverlayEnabled)},setValue:function(e){let t=rd.default.isStreamInfoOverlayEnabled;(0,rc.A)("stream_info_overlay_enabled",e,t),(0,ru.x)({isStreamInfoOverlayEnabled:e})},usePredicate:function(){return U.Q_.useSetting()}}),rm=(0,h.bd)(S.X.VOICE_AND_VIDEO_DIAGNOSTICS_ACCORDION,{useTitle:e=>e?V.intl.string(V.t["/B4I8H"]):V.intl.string(V.t.BTlsWH),useCollapsedSubtitle:()=>V.intl.string(V.t.la1Ys4),buildLayout:()=>[rg,s0,ra,ro,rn]});function rA(e,t,n){(0,n2.A)({title:e,subtitle:t,confirmText:V.intl.string(V.t.BddRzS),onConfirm:n})}let rE=(0,h.Tf)(S.X.VOICE_AND_VIDEO_RESET_ALL_SETTINGS,{useTitle:()=>V.intl.string(V.t.SXfv1v),useSubtitle:()=>V.intl.string(V.t["buA5/q"]),useLabel:()=>V.intl.string(V.t.yBZMsQ),onClick:function(){rA(V.intl.string(V.t["4iKQ/3"]),V.intl.string(V.t.sQ42iT),lE.default.reset)},useVariant:()=>"critical-secondary"}),rh=(0,h.zZ)(S.X.VOICE_AND_VIDEO_DIAGNOSTICS_CATEGORY,{useTitle:()=>V.intl.string(V.t.UDAU9K),buildLayout:()=>[s$,rm,rE]});var rS=n(343446),rT=n(360729),rf=n(303227),rp=n(558076),rx=n(687782);let rI=(0,h.zD)(S.X.GUILD_ROOMS_REMEMBER_LAST_VIEW_SETTING,{useTitle:()=>V.intl.string(rx.default.qYzpsI),useSubtitle:()=>V.intl.string(rx.default["+vMoL1"]),useValue:()=>(0,I.bG)([rp.A],()=>rp.A.getRememberVideoOverlayVisibility()),setValue:e=>(0,rf.Ft)(e)}),r_=(0,h.zZ)(S.X.GUILD_ROOMS_CATEGORY,{useTitle:()=>V.intl.string(rx.default.wRLmM0),usePredicate:function(){let e=(0,I.yK)([lv.A],()=>lv.A.getGuildIds()),{loaded:t,override:n}=(0,I.cf)([rS.A],()=>({loaded:rS.A.getLoadedGuildExperiment(rT.vJ),override:rS.A.getExperimentOverrideDescriptor(rT.vJ)}));return(0,x.useMemo)(()=>(null!=t||null!=n)&&e.some(e=>(0,rT.W8)({guildId:e,location:"useHasGuildRoomsEligibleGuild"},{autoTrackExposure:!1}).enabled),[e,t,n])},buildLayout:()=>[rI]});var rb=n(347481),rN=n(852712),rC=n(179172),ry=n(868162);let rv=(0,h.zD)(S.X.VOICE_AUDIO_DEVICE_SUGGESTIONS_SETTING,{useTitle:()=>V.intl.string(V.t.gF8HJo),useSubtitle:()=>V.intl.string(V.t.cfrfyZ),useValue:function(){return(0,I.bG)([ry.A],()=>!0!==ry.A.getState().neverShowModal)},setValue:function(e){rC.Bv(!e)},usePredicate:function(){return e8.isPlatformEmbedded}}),rj=(0,h.zD)(S.X.VOICE_AUTOMATIC_GAIN_CONTROL_SETTING,{useTitle:()=>V.intl.string(V.t.cUMdH0),useSubtitle:()=>V.intl.string(V.t["6EjbvA"]),useValue:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.getAutomaticGainControl())},setValue:function(e){lE.default.setAutomaticGainControl(e,{page:_.liQ.USER_SETTINGS,section:_.JJy.SETTINGS_VOICE_AND_VIDEO})},useDisabled:function(){return(0,I.bG)([i9.Ay,rb.A],()=>{let e=i9.Ay.getInputDeviceId();return rb.A.hasAutomaticGainControl(e)})},usePredicate:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.isAutomaticGainControlSupported()&&i9.Ay.isInputProfileCustom())}}),rO=(0,h.sN)(S.X.VOICE_GLOBAL_ATTENUATION_SLIDER,{useTitle:()=>V.intl.string(V.t.AlybXj),setValue:e=>lE.default.setAttenuation(e,i9.Ay.getAttenuateWhileSpeakingSelf(),i9.Ay.getAttenuateWhileSpeakingOthers()),minValue:0,maxValue:100,getInitialValue:()=>i9.Ay.getAttenuation()}),rR=(0,h.zD)(S.X.VOICE_GLOBAL_ATTENUATION_FOR_SELF_SETTING,{useTitle:()=>V.intl.string(V.t["9dHxRY"]),useValue:()=>(0,I.bG)([i9.Ay],()=>i9.Ay.getAttenuateWhileSpeakingSelf()),setValue:e=>lE.default.setAttenuation(i9.Ay.getAttenuation(),e,i9.Ay.getAttenuateWhileSpeakingOthers())}),rD=(0,h.zD)(S.X.VOICE_GLOBAL_ATTENUATION_FOR_OTHERS_SETTING,{useTitle:()=>V.intl.string(V.t.SMt0Gr),useValue:()=>(0,I.bG)([i9.Ay],()=>i9.Ay.getAttenuateWhileSpeakingOthers()),setValue:e=>lE.default.setAttenuation(i9.Ay.getAttenuation(),i9.Ay.getAttenuateWhileSpeakingSelf(),e)}),rL=(0,h.FW)(S.X.VOICE_GLOBAL_ATTENUATION_FIELD_SET,{variant:"compact",useTitle:()=>V.intl.string(V.t.oSdBvW),useSubtitle:()=>V.intl.string(V.t["0A/8Rt"]),usePredicate:()=>(0,I.bG)([i9.Ay],()=>i9.Ay.supports(lw.O5.ATTENUATION)),buildLayout:()=>[rO,rR,rD]}),rP=(0,h.zD)(S.X.VOICE_BYPASS_SYSTEM_INPUT_PROCESSING_SETTING,{useTitle:()=>V.intl.string(V.t.DFPXIG),useSubtitle:()=>V.intl.string(V.t["UyRX+C"]),useValue:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.getBypassSystemInputProcessing())},setValue:function(e){lE.default.setBypassSystemInputProcessing(e)},usePredicate:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.showBypassSystemInputProcessing()&&i9.Ay.isInputProfileCustom())}}),rG=(0,h.zD)(S.X.VOICE_SWITCH_CHANNEL_ALERT_SETTING,{useTitle:()=>V.intl.string(V.t.jrWHD3),useSubtitle:()=>V.intl.string(V.t.YCCMkJ),useValue:function(){return(0,I.bG)([eT.Ay],()=>!eT.Ay.disableVoiceChannelChangeAlert)},setValue:function(e){(0,rc.A)("switch_channel_warning_enabled",e,!eT.Ay.disableVoiceChannelChangeAlert),nk.Ay.updatedUnsyncedSettings({disableVoiceChannelChangeAlert:!e})}}),rM=(0,h.zD)(S.X.ADVANCED_VOICE_ACTIVITY_PROCESSING_SETTING,{useTitle:()=>V.intl.string(V.t.BbESsg),useSubtitle:()=>V.intl.string(V.t.LoOB1F),useValue:function(){return(0,I.bG)([i9.Ay],()=>{let{vadUseKrisp:e}=i9.Ay.getModeOptions();return e})},setValue:function(e){let t=i9.Ay.getMode();lE.default.setMode(t,{vadUseKrisp:e})},useDisabled:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.getMode()!==_.TBI.VOICE_ACTIVITY||!i9.Ay.getModeOptions().autoThreshold)},usePredicate:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.isAdvancedVoiceActivitySupported()&&i9.Ay.isInputProfileCustom())}}),rU=(0,h.Hn)(S.X.VOICE_AUDIO_SUBSYSTEM_SETTING,{useTitle:()=>V.intl.string(V.t.wVBHr0),useValue:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.getAudioSubsystem())},setValue:function(e){rA(V.intl.string(V.t.uY7AcQ),V.intl.string(V.t.gBqik6),()=>lE.default.setAudioSubsystem(e))},useOptions:function(){let{legacyAudioSubsystemSupported:e,experimentalAudioSubsystemSupported:t,automaticAudioSubsystemSupported:n}=(0,I.cf)([i9.Ay],()=>({legacyAudioSubsystemSupported:i9.Ay.supports(lw.O5.LEGACY_AUDIO_SUBSYSTEM),experimentalAudioSubsystemSupported:i9.Ay.supports(lw.O5.EXPERIMENTAL_AUDIO_SUBSYSTEM),automaticAudioSubsystemSupported:i9.Ay.supports(lw.O5.AUTOMATIC_AUDIO_SUBSYSTEM)}));return x.useMemo(()=>{let i;return i=[{id:lw.rB.STANDARD,value:lw.rB.STANDARD,label:V.intl.string(V.t.dqb2JZ)}],e&&i.push({id:lw.rB.LEGACY,value:lw.rB.LEGACY,label:V.intl.string(V.t["TYfH+5"])}),t&&i.push({id:lw.rB.EXPERIMENTAL,value:lw.rB.EXPERIMENTAL,label:V.intl.string(V.t.liQmtr)}),n&&i.push({id:lw.rB.AUTOMATIC,value:lw.rB.AUTOMATIC,label:V.intl.string(V.t.qNgtO1)}),i},[n,t,e])},usePredicate:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.shouldOfferManualSubsystemSelection())}}),rV=(0,h.zD)(S.X.VOICE_QUALITY_OF_SERVICE_SETTING,{useTitle:()=>V.intl.string(V.t.uancuJ),useSubtitle:()=>V.intl.string(V.t.I1Eoqq),useValue:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.getQoS())},setValue:function(e){lE.default.setQoS(e)},usePredicate:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.supports(lw.O5.QOS))}}),rk=(0,h.zD)(S.X.VOICE_SILENCE_WARNING_SETTING,{useTitle:()=>V.intl.string(V.t["4rsOPQ"]),useSubtitle:()=>V.intl.string(V.t.jtiiCw),useValue:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.getEnableSilenceWarning())},setValue:function(e){lE.default.setSilenceWarning(e)},usePredicate:function(){return e8.isPlatformEmbedded}}),rw=(0,h.bd)(S.X.INPUT_PROFILE_VOICE_ADVANCED_ACCORDION,{useTitle:function(e){return e?V.intl.string(V.t.KHsSWK):V.intl.string(V.t.PPDo5V)},useCollapsedSubtitle:()=>tI(S.X.INPUT_PROFILE_VOICE_ADVANCED_ACCORDION,{limit:(0,I.bG)([i9.Ay],()=>i9.Ay.isInputProfileCustom())?3:2}),buildLayout:()=>[rj,rM,rP,rv,rk,rG,rL,rU,rV]}),rF=(0,h.zD)(S.X.VOICE_ECHO_CANCELLATION_SETTING,{useTitle:()=>V.intl.string(V.t.iWTwu6),useValue:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.getEchoCancellation())},setValue:function(e){lE.default.setEchoCancellation(e,{page:_.liQ.USER_SETTINGS,section:_.JJy.SETTINGS_VOICE_AND_VIDEO})},useDisabled:function(){return(0,I.bG)([i9.Ay,rb.A],()=>{let e=i9.Ay.getInputDeviceId();return rb.A.hasEchoCancellation(e)})},usePredicate:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.isInputProfileCustom())}});var rB=n(205693),rX=n(451988),rz=n(205513),rH=n(475883),rY=n(303707);let rW=(0,tK.Ld)();function rK(e){let{isSpeaking:t,className:n,id:i,ariaDescribedBy:l,ariaLabelledBy:s,disabled:r}=e;return(0,p.jsx)("div",{role:"meter",className:ic()(rH.$I,n),id:i,"aria-describedby":l,"aria-labelledby":s,"aria-valuenow":t&&!r?100:0,"aria-valuemin":0,"aria-valuemax":100,"aria-valuetext":t&&!r?V.intl.string(V.t.haLKZ0):V.intl.string(V.t.X2hJL7),children:(0,p.jsx)("div",{className:ic()(rH.Jx,rH.NU,{[rH.zY]:t&&!r,[rH.r9]:r})})})}function rZ(e){let{volume:t,id:n,ariaDescribedBy:i,ariaLabelledBy:l,disabled:s}=e,{threshold:r,autoThreshold:a}=(0,I.cf)([i9.Ay],()=>({threshold:i9.Ay.getModeOptions().threshold,autoThreshold:i9.Ay.getModeOptions().autoThreshold})),o=(0,I.bG)([i9.Ay],()=>i9.Ay.getMode());return(0,p.jsx)("section",{className:ic()(rH.Mo,rH.jW),id:n,"aria-describedby":i,"aria-labelledby":l,children:(0,p.jsx)(rz.G,{initialValue:r+100,onValueRender:e=>`${(-((100-e)*1)).toFixed(0)}dB`,onValueChange:e=>{var t;return t=-((100-e)*1),void lE.default.setMode(o,{threshold:t,autoThreshold:a})},barStyles:{background:n1.A.unsafe_rawColors.GREEN_360.css},fillStyles:{background:n1.A.unsafe_rawColors.YELLOW_300.css},"aria-labelledby":rW,disabled:s,children:(0,p.jsxs)("div",{className:ic()(rH.NU,rH.TL,rH.Jx,rY.bar),children:[(0,p.jsx)("div",{className:ic()(rH.GS,rH.SH),style:{width:s?0:t+100+"%"}}),(0,p.jsx)("div",{className:"grow"})]})})})}let rq=(0,h.E2)(S.X.VOICE_INPUT_SENSITIVITY_FIELD_SET,{useSearchTerms:()=>[V.intl.string(V.t["sqUm+k"]),V.intl.string(V.t.I1Zuq0),V.intl.string(V.t.nuFtHH)],usePredicate:()=>(0,I.bG)([i9.Ay],()=>i9.Ay.isInputProfileCustom()),Component:function(){let{autoThreshold:e,disabled:t}=(0,I.cf)([i9.Ay],()=>({autoThreshold:i9.Ay.getModeOptions().autoThreshold,disabled:i9.Ay.getMode()!==lw.TB.VOICE_ACTIVITY})),n=x.useCallback(e=>{let t=i9.Ay.getMode(),{threshold:n}=i9.Ay.getModeOptions();lE.default.setMode(t,{autoThreshold:e,threshold:n})},[]),i=(0,I.bG)([i9.Ay],()=>i9.Ay.supports(lw.O5.AUTOMATIC_VAD)),{volume:l,isSpeaking:s}=function(){let[e,t]=x.useState(-100),[n,i]=x.useState(!1);function l(e,n){t(e),i((n&lw.ME.VOICE)===lw.ME.VOICE)}return x.useEffect(()=>{let e=new rX.Ep;return e.start(1e3,()=>{i9.Ay.getMediaEngine().on(rB.bg.VoiceActivity,l),e.stop()}),()=>{i9.Ay.getMediaEngine().removeListener(rB.bg.VoiceActivity,l),e.stop()}},[]),{volume:e,isSpeaking:n}}(),r=(0,I.bG)([i9.Ay],()=>i9.Ay.isEnabled()),a=x.useMemo(()=>!r&&(0,p.jsx)("div",{className:rH.B4,children:(0,p.jsx)(iK.w,{type:"warning",message:V.intl.format(V.t["O13I+O"],{onEnableClick:()=>lE.default.enable(!0)}),role:"status"})}),[r]),o=x.useMemo(()=>e?V.intl.string(V.t.JsbzjA):V.intl.string(V.t.MLmyMY),[e]),u=x.useId(),d=x.useId();return i?(0,p.jsxs)("fieldset",{"aria-describedby":d,children:[(0,p.jsx)(lm.A,{tag:"legend",id:u,children:V.intl.string(V.t.GByLar)}),(0,p.jsx)(lm.A,{id:d,children:o}),(0,p.jsxs)(q.B,{direction:"vertical",gap:8,children:[(0,p.jsx)(t4.d,{disabled:t,label:V.intl.string(V.t.lY6j47),description:o,checked:e,onChange:n}),e?(0,p.jsx)(rK,{isSpeaking:s,className:rH.UJ,ariaDescribedBy:d,ariaLabelledBy:u,disabled:t}):(0,p.jsx)(rZ,{volume:l,ariaDescribedBy:d,ariaLabelledBy:u,disabled:t}),a]})]}):(0,p.jsxs)(q.B,{direction:"vertical",gap:8,children:[(0,p.jsx)(lu.D,{label:V.intl.string(V.t["sqUm+k"]),description:o,layout:"vertical",children:n=>e?(0,p.jsx)(rK,{isSpeaking:s,className:rH.UJ,id:n.controlId,ariaDescribedBy:n.describedById,ariaLabelledBy:n.labelId,disabled:t}):(0,p.jsx)(rZ,{volume:l,id:n.controlId,ariaDescribedBy:n.describedById,ariaLabelledBy:n.labelId,disabled:t})}),a]})}});var rQ=n(366010);let rJ=n(993830),r$=n(413142),r0={page:_.liQ.USER_SETTINGS,section:_.JJy.SETTINGS_VOICE_AND_VIDEO};function r1(){let e=(0,I.bG)([nF.A],()=>(0,rQ.q)(nF.A.theme));return(0,p.jsx)("img",{src:e?rJ:r$,width:48,height:32,alt:""})}let r2=(0,h.E2)(S.X.VOICE_NOISE_SUPPRESSION_SETTING,{useSearchTerms:()=>[V.intl.string(V.t.t8Qhib),V.intl.string(V.t.hmfkCi)],usePredicate:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.isInputProfileCustom()&&i9.Ay.isNoiseSuppressionSupported())},Component:function(){let e=x.useCallback(e=>{lE.default.setNoiseCancellation("KRISP"===e,r0),lE.default.setNoiseSuppression("STANDARD"===e,r0)},[]),{noiseCancellation:t,noiseSuppression:n,isNoiseSuppressionSupported:i,isNoiseCancellationSupported:l}=(0,I.cf)([i9.Ay],()=>({noiseCancellation:i9.Ay.getNoiseCancellation(),noiseSuppression:i9.Ay.getNoiseSuppression(),isNoiseSuppressionSupported:i9.Ay.isNoiseSuppressionSupported(),isNoiseCancellationSupported:i9.Ay.isNoiseCancellationSupported()})),s=x.useMemo(()=>{let e=[];return l&&e.push({id:"krisp",label:V.intl.string(V.t.rdoNzt),value:"KRISP"}),i&&e.push({id:"standard",label:V.intl.string(V.t.qXeYHw),value:"STANDARD"}),e.push({id:"disabled",label:V.intl.string(V.t.wkYAlz),value:"NONE"}),e},[l,i]),r=l?V.intl.format(V.t["1q5aTp"],{helpArticle:eC.A.getArticleURL(_.MVz.NOISE_SUPPRESSION)}):V.intl.string(V.t.OWKjw5);return(0,p.jsxs)(q.B,{direction:"vertical",gap:0,children:[(0,p.jsx)(lo.l,{label:V.intl.string(V.t.t8Qhib),description:r,layout:"horizontal",value:t?"KRISP":n?"STANDARD":"NONE",onSelectionChange:e,options:s,selectionMode:"single",fullWidth:!0}),l&&(0,p.jsx)(r1,{})]})}});var r3=n(934729),r5=n(621380);let r4=!nh.Av;function r6(){return(0,I.bG)([i9.Ay],()=>i9.Ay.getMode()===lw.TB.PUSH_TO_TALK)}let r8=(0,h.zD)(S.X.VOICE_PUSH_TO_TALK_SETTING,{useTitle:function(){return nh.Av?V.intl.string(V.t.tG4Np5):V.intl.string(V.t.JMyQin)},useSubtitle:function(){let e=(0,I.bG)([i9.Ay],()=>i9.Ay.getMode());return x.useMemo(()=>{if(!nh.Av&&e===lw.TB.PUSH_TO_TALK)return V.intl.format(V.t["VHI4+Y"],{onDownloadClick:()=>(0,r3._)("Help Text PTT")})},[e])},usePredicate:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.getActiveInputProfile()!==r5.m.STUDIO)},useValue:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.getMode()===lw.TB.PUSH_TO_TALK)},setValue:function(e){var t,i;t=e?lw.TB.PUSH_TO_TALK:lw.TB.VOICE_ACTIVITY,i=[tk.A.USER_SETTINGS_VOICE_AND_VIDEO],t===lw.TB.PUSH_TO_TALK&&r4&&(0,lf.mM)(async()=>{let{Alert:e}=await Promise.all([n.e(844331),n.e(542369)]).then(n.bind(n,291064));return t=>(0,p.jsx)(e,{title:V.intl.string(V.t.Kdt0Gb),confirmText:V.intl.string(V.t["1WjMbC"]),cancelText:V.intl.string(V.t.BddRzS),onConfirm:()=>(0,r3._)("PTT Limited Modal"),body:V.intl.string(V.t.NIozvt),...t})}),lE.default.setMode(t,void 0,void 0,{analyticsLocations:i})},useSearchTerms:()=>[V.intl.string(V.t["pS+K2L"]),V.intl.string(V.t.nuFtHH)]});var r7=n(484599);function r9(e){let{shortcut:t}=e,n=(0,I.bG)([la.Ay],()=>la.Ay.isWaylandPortalActive()),i=(0,I.bG)([la.Ay],()=>{let e=la.Ay.getKeybindForAction(_.hCu.PUSH_TO_TALK,!0);return null!=e?la.Ay.getWaylandPortalShortcutState(e.id):null});return n&&0!==t.length?la.Ay.isWaylandPortalEligibleShortcut(t)?null==i||i.bound?null:(0,p.jsx)(iK.w,{type:"warning",message:V.intl.string(V.t.PTCrUP),role:"status"}):(0,p.jsx)(iK.w,{type:"warning",message:V.intl.string(V.t.J0m3aK),role:"status"}):null}let ae=(0,h.E2)(S.X.VOICE_PUSH_TO_TALK_KEYBIND_SETTING,{useSearchTerms:()=>[V.intl.string(V.t["pS+K2L"]),V.intl.string(V.t.nuFtHH)],usePredicate:r6,Component:function(){let e=(0,I.bG)([i9.Ay],()=>{let{shortcut:e}=i9.Ay.getModeOptions();return e}),t=V.intl.format(V.t.HVvn5T,{onClick:()=>(0,na.openUserSettings)(S.X.SYSTEM_CUSTOM_KEYBINDS_CATEGORY)});return(0,p.jsx)(lu.D,{label:V.intl.string(V.t["o+BJQR"]),description:t,layout:"horizontal-responsive",children:(0,p.jsxs)("div",{className:r7.e,children:[(0,p.jsx)(lh.A,{defaultValue:e,onChange:e=>{let t=la.Ay.getKeybindForAction(_.hCu.PUSH_TO_TALK,!0);null!=t&&(0,lr.uL)(t.id,t.shortcut,e,la.Ay.getWaylandPortalShortcutState(t.id)),lE.default.setMode(_.TBI.PUSH_TO_TALK,{shortcut:e})}}),(0,p.jsx)(r9,{shortcut:e})]})})}}),at=(0,h.sN)(S.X.VOICE_PUSH_TO_TALK_RELEASE_DELAY_SETTING,{useTitle:()=>V.intl.string(V.t.GCNMM8),useSearchTerms:()=>[V.intl.string(V.t["pS+K2L"]),V.intl.string(V.t.nuFtHH)],setValue:function(e){lE.default.setMode(_.TBI.PUSH_TO_TALK,{delay:e})},minValue:0,maxValue:2e3,getInitialValue:function(){let{delay:e}=i9.Ay.getModeOptions();return e},onValueRender:function(e){return e>=1e3?(e/=1e3,`${e.toFixed(2)}s`):`${e.toFixed(0)}\u00A0ms`},usePredicate:r6});var an=n(833473),ai=n(844981),al=n(610234);function as(){return(0,ai.Ay)("VoiceSettings")}let ar=(0,h.zD)(S.X.VOICE_SPATIAL_AUDIO_SETTING,{useTitle:()=>V.intl.string(al.default.LGDPhA),useSubtitle:function(){let e=as();if((0,ai.Xt)(e))return e===ai.L3.BLOCKED_MONO_OUTPUT?V.intl.string(al.default.rOXfEw):V.intl.string(al.default.O7Aa3Y)},useValue:function(){return(0,I.bG)([an.A],()=>an.A.isSpatialAudioEnabled())},setValue:function(e){lE.default.setSpatialAudio(e,[tk.A.USER_SETTINGS_VOICE_AND_VIDEO])},usePredicate:function(){return as()!==ai.L3.HIDDEN},useDisabled:function(){return(0,ai.Xt)(as())}}),aa=(0,h.Qx)(S.X.VOICE_INPUT_PROFILE_SETTING,{useTitle:()=>V.intl.string(V.t.LM3U3k),usePredicate:function(){let{enabledInputProfiles:e}=(0,rN._)({location:"SettingsRendererConfig"});return e.length>0},useSearchTerms:()=>[V.intl.string(V.t.nuFtHH),V.intl.string(V.t.VZPR0R),V.intl.string(V.t.cjPbpT)],useValue:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.getActiveInputProfile()??r5.m.CUSTOM)},setValue:function(e){let t=[tk.A.USER_SETTINGS_VOICE_AND_VIDEO];lE.default.setActiveInputProfile(e,{analyticsLocations:t})},useOptions:function(){let{enabledInputProfiles:e}=(0,rN.d)({location:"InputProfileCategory"});return[{value:r5.m.VOICE_ISOLATION,name:V.intl.string(V.t.cjPbpT),desc:V.intl.string(V.t.CzhvnE)},{value:r5.m.STUDIO,name:V.intl.string(V.t.VZPR0R),desc:V.intl.string(V.t.ZaJksS)},{value:r5.m.CUSTOM,name:V.intl.string(V.t["N/PQjv"]),desc:V.intl.string(V.t.SnBmuY)}].filter(t=>{let{value:n}=t;return e.includes(n)})}}),ao=(0,h.zZ)(S.X.VOICE_INPUT_PROFILE_CATEGORY,{useInlineNotice:function(){let e=(0,I.bG)([rb.A,i9.Ay],()=>{let e=i9.Ay.getInputDeviceId();return(rb.A.hasEchoCancellation(e)||rb.A.hasNoiseSuppression(e)||rb.A.hasAutomaticGainControl(e))&&i9.Ay.isInputProfileCustom()});return x.useMemo(()=>{if(e)return{type:f.lT.INLINE_NOTICE,noticeType:"info",role:"status",text:V.intl.string(V.t["/Whuzi"])}},[e])},buildLayout:()=>[aa,rq,r2,rF,ar,r8,ae,at,rw]});var au=n(403581),ad=n(983851),ac=n(687021),ag=n(128450),am=n(796774),aA=n(209932),aE=n(458976),ah=n(984813),aS=n(265872),aT=n(305866),af=n(22231),ap=n(342073),ax=n(722178),aI=n(792348),a_=n(233324),ab=n(340368),aN=n(327289),aC=n(533491),ay=n(647451);function av(e){let{onSelect:t}=e,[n,i]=x.useState(!1),l=(0,I.bG)([sE.default],()=>sE.default.getCurrentUser()),s=ax.Ay.canUseCustomCallSounds(l),r=x.useRef(null);function a(e){s&&(i(!1),t?.(e))}return(0,p.jsx)(aS.Y,{targetElementRef:r,shouldShow:n,position:"left",onRequestClose:()=>i(!1),renderPopout:e=>{let{closePopout:t}=e;return(0,p.jsx)(aT.l,{children:(0,p.jsx)(aN.A,{suppressPlaySound:!0,shouldShowLockedSounds:!1,guildId:null,channel:null,onClose:t,onSelect:a,gridNotice:s?null:(0,p.jsx)(a_.m,{}),analyticsSource:"call sounds edit setting"})})},children:e=>(0,p.jsx)(aC.dT,{...e,ref:r,onClick:()=>{i(!n)},text:V.intl.string(V.t.uOe0Az),children:(0,p.jsx)(af.PencilIcon,{size:"md",color:"currentColor",className:ay.Wo})})})}function aj(e){let{sound:t}=e,{previewSound:n}=(0,aI.A)(t,null),i=(0,aE.wH)(),l=(0,ab._)("SoundPreviewButton")?ap.WaveformIcon:ad.VoiceNormalIcon,s=0===i?V.intl.string(V.t.OASXjt):V.intl.formatToPlainString(V.t["/8fYO5"],{emojiName:t.emojiName,soundName:t.name});return(0,p.jsx)(aC.dT,{onClick:n,text:s,children:(0,p.jsx)(l,{size:"md",color:"currentColor",className:ay.wg})})}function aO(e){let{sound:t,isGlobal:n,onSelect:i}=e,l=null!=t,s=t?.emojiId,r=t?.emojiName,a=l&&(null!=r||null!=s),o=(0,ab._)("SoundboardCustomCallSoundSettingsPreview")?ap.WaveformIcon:ad.VoiceNormalIcon;return(0,p.jsxs)("div",{className:ay.D6,children:[(0,p.jsxs)("div",{className:ay.kL,children:[a&&(0,p.jsx)(tG.A,{emojiId:s,emojiName:r,className:ay.Zg}),(0,p.jsx)(n5.E,{variant:"body-md/normal",color:"text-strong",className:ay.dj,children:null==t?V.intl.string(V.t.PoWNfe):n?V.intl.format(V.t.B6HU6O,{soundName:t.name,subtextHook:function(e){return(0,p.jsx)(n5.E,{variant:"body-xs/medium",color:"text-default",tag:"span",children:e})}}):t.name}),l?(0,p.jsx)(aj,{sound:t}):(0,p.jsx)(o,{size:"md",color:"currentColor",className:ay.Gk})]}),(0,p.jsxs)("div",{className:ay.kL,children:[(0,p.jsx)(av,{onSelect:i}),l&&!n&&(0,p.jsx)(aC.dT,{onClick:()=>i(null),text:V.intl.string(V.t.jmtcGA),children:(0,p.jsx)(lc.TrashIcon,{size:"md",color:n1.A.unsafe_rawColors.RED_400.css,className:ay.Wo})})]})]})}var aR=n(617617);n(980504);var aD=n(806050);function aL(e){return(0,I.bG)([aA.A],()=>{if(null==e)return null;let{guildId:t,soundId:n}=e;return aA.A.getSound("0"===t?"0":t,n)})}function aP(e){let{guildId:t}=e,n=(0,I.bG)([aR.A],()=>aR.A.settings.guilds?.guilds?.[t]?.joinSound),i=aL(n);if(null==n||null==i)return null;let{emojiId:l,emojiName:s}=i,r=null!=l||null!=s;return(0,p.jsxs)("div",{className:aD.Io,children:[r?(0,p.jsx)(tG.A,{emojiId:l,emojiName:s,className:aD.nW}):(0,p.jsx)(ad.VoiceNormalIcon,{size:"md",color:"currentColor",className:aD.nW}),(0,p.jsx)(n5.E,{className:aD.dK,variant:"body-xs/medium",children:i.name})]})}let aG=(0,h.E2)(S.X.ENTRANCE_SOUNDS_SETTING,{useSearchTerms:()=>[V.intl.string(V.t.nzUc3B)],Component:function(){let{analyticsLocations:e}=(0,ez.Ay)(),[t,n]=x.useState("0"),i=(0,ah.mz)(t),l=aL(i),s=i?.type===ah.PP.GLOBAL,r=(0,I.bG)([aA.A],()=>aA.A.hasFetchedAllSounds())&&null!=i&&null==l;x.useEffect(()=>{r&&(0,aE.ND)({location:e})},[r,e]),x.useEffect(()=>{(0,am.E7)()},[]);let a=x.useCallback((e,t)=>{let{inDropdown:n}=t;return null==e?null:n?(0,p.jsx)(aP,{guildId:e.value}):null},[]);return(0,p.jsxs)(n3.n,{label:V.intl.string(V.t.nzUc3B),description:V.intl.format(V.t.u9RWmv,{helpdeskArticle:eC.A.getArticleURL(_.MVz.SOUNDBOARD)}),children:[(0,p.jsx)(ac.A,{guildId:t,className:aD.Dt,globalOption:{label:V.intl.string(V.t["CpEUP/"]),value:"0"},onChange:e=>{n(null==e?"0":e.id)},renderOptionSuffix:a,hideDivider:!0}),(0,p.jsxs)(ag.A,{title:V.intl.format(V.t.I2TsYN,{nitroWheelHook:()=>(0,p.jsx)(au.NitroWheelIcon,{size:"md",color:"currentColor",className:aD.ax})}),children:[(0,p.jsx)(aO,{sound:l,isGlobal:s,onSelect:n=>{null==n?(0,aE.Dv)(t,e):(0,aE.un)(t,n,e)}}),r&&(0,p.jsx)("div",{className:aD.lm,children:(0,p.jsx)(iK.w,{type:"warning",message:V.intl.string(V.t.WkPsFR),role:"status"})})]})]})}});var aM=n(824744);let aU=(0,h.sN)(S.X.SOUNDBOARD_VOLUME_SETTING,{useTitle:()=>V.intl.string(V.t.kbFsAD),useSubtitle:()=>V.intl.format(V.t.BPbGq7,{helpCenterArticle:eC.A.getArticleURL(_.MVz.SOUNDBOARD)}),setValue:function(e){let t=[tk.A.USER_SETTINGS_VOICE_AND_VIDEO],n=(0,aM.w)(e);(0,am.iy)(n,t)},minValue:0,maxValue:100,getInitialValue:function(){let e=(0,aE.wH)();return(0,aM.M)(e)},onValueRender:function(e){return`${e.toFixed(0)}%`}});var aV=n(864145);let ak=(0,h.sN)(S.X.SOUNDMOJI_VOLUME_SETTING,{useTitle:()=>V.intl.string(V.t["2JbvKw"]),useSubtitle:()=>V.intl.string(V.t.INenzY),setValue:function(e){let t=(0,aM.w)(e);U.HO.updateSetting(t)},minValue:0,maxValue:100,getInitialValue:function(){let e=U.HO.getSetting();return(0,aM.M)(e)},onValueRender:function(e){return`${e.toFixed(0)}%`},usePredicate:function(){return(0,aV.X)({location:"SoundmojiVolumeSetting"})}}),aw=(0,h.zZ)(S.X.SOUNDBOARD_CATEGORY,{useTitle:()=>V.intl.string(V.t.ABjMWI),buildLayout:()=>[aU,ak,aG]});var aF=n(803224),aB=n(552122);let aX=(0,h.E2)(S.X.SOUNDS_HOLIDAY_NOTICE,{useSearchTerms:()=>[V.intl.string(V.t.fgSHf8)],usePredicate:()=>null!=aB.A.useHolidaySoundpack(),Component:()=>(0,p.jsx)(n5.E,{variant:"body-md/normal",color:"text-subtle",children:V.intl.format(V.t.Eup6Wv,{onClick:()=>(0,na.openUserSettings)(S.X.NOTIFICATIONS_SOUNDS_CATEGORY)})})}),az=(0,h.AK)(S.X.VOICE_AND_VIDEO_TO_NOTIFICATION_SOUNDS_NAVIGATOR,{useSubtitle:()=>V.intl.string(V.t.eyGEE4),useSearchTerms:()=>[V.intl.string(V.t.eyGEE4)],destinationKey:S.X.NOTIFICATIONS_SOUNDS_CATEGORY}),aH=(0,h.gN)(S.X.VOICE_AND_VIDEO_SOUNDS_RELATED_SETTINGS,{buildLayout:()=>[az]});var aY=n(264686);let aW=(0,eb.D)(()=>({currentPlayingSound:null}));function aK(){let e=aW.getField("currentPlayingSound");e?.stop(),aW.setState({currentPlayingSound:null})}function aZ(e){let t=aW.getField("currentPlayingSound");t?.stop();let n=(0,ie.Ak)(e);aW.setState({currentPlayingSound:n})}function aq(e){return(0,h.zD)(`${S.X.SOUNDS_LIST_ITEM_PREFIX}${e.sound}`,{useTitle:e.useTitle,useSubtitle:()=>V.intl.format(V.t.OOiGCM,{onClick:()=>aZ(e.sound)}),useSearchTerms:e.useSearchTerms,useValue:()=>{let t=(0,I.bG)([aF.A],()=>aF.A.isSoundDisabled(e.sound)),n=e.useDisabled?.();return!t&&!n},setValue:t=>{let n=aF.A.getDisabledSounds().filter(t=>t!==e.sound);t||n.push(e.sound),aY.default.setDisabledSounds(n)},useDisabled:()=>{let t=e.useDisabled?.(),n=(0,I.bG)([aF.A],()=>aF.A.getDisableAllSounds());return t||n},useDisabledMessage:e.useDisabledMessage})}let aQ=[{useTitle:()=>V.intl.string(V.t.hK51Yg),sound:"deafen"},{useTitle:()=>V.intl.string(V.t.XiejaJ),sound:"undeafen"},{useTitle:()=>V.intl.string(V.t.w4m945),sound:"mute"},{useTitle:()=>V.intl.string(V.t.YqAjXy),sound:"unmute"},{useTitle:()=>V.intl.string(V.t.JoTq8n),sound:"camera_on"},{useTitle:()=>V.intl.string(V.t["8P6tQ6"]),sound:"camera_off"},{useTitle:()=>V.intl.string(V.t["juL9/L"]),sound:"disconnect"},{useTitle:()=>V.intl.string(V.t.x98vQq),useSearchTerms:()=>[V.intl.string(V.t.Q8gkVL)],sound:"ptt_start"},{useTitle:()=>V.intl.string(V.t["1HjRqC"]),useSearchTerms:()=>[V.intl.string(V.t.Q8gkVL)],sound:"ptt_stop"},{useTitle:()=>V.intl.string(V.t["9JB1Ck"]),sound:"user_join"},{useTitle:()=>V.intl.string(V.t.KUBBNt),sound:"user_leave"},{useTitle:()=>V.intl.string(V.t.EZjqUT),sound:"user_moved"},{useTitle:()=>V.intl.string(V.t.LnNlQh),sound:"call_calling"},{useTitle:()=>V.intl.string(V.t.Nd8P5y),sound:"stream_started"},{useTitle:()=>V.intl.string(V.t["9bYj+G"]),sound:"stream_ended"},{useTitle:()=>V.intl.string(V.t.KccUI1),sound:"stream_user_joined"},{useTitle:()=>V.intl.string(V.t.dsjkiN),sound:"stream_user_left"},{useTitle:()=>V.intl.string(V.t.nFOcf9),sound:"activity_launch"},{useTitle:()=>V.intl.string(V.t["a6lw/u"]),sound:"activity_end"},{useTitle:()=>V.intl.string(V.t.KaFxrY),sound:"activity_user_join"},{useTitle:()=>V.intl.string(V.t.S14z9n),sound:"activity_user_left"},{useTitle:()=>V.intl.string(V.t.CP3DC3),sound:"reconnect"}],aJ=(0,h.D1)(S.X.VOICE_AND_VIDEO_SOUNDS_LIST,{collapseAfter:4,useCollapsibleTitle:(e,t)=>e?V.intl.formatToPlainString(V.t["0JYT98"],{count:t}):V.intl.formatToPlainString(V.t.ji1uNt,{count:t}),useCollapsedSubtitle:()=>tI(S.X.VOICE_AND_VIDEO_SOUNDS_LIST,{limit:3}),initialize:function(){return()=>{aK()}},buildLayout:()=>aQ.map(e=>aq(e))}),a$=(0,h.zZ)(S.X.SOUNDS_CATEGORY,{useTitle:()=>V.intl.string(V.t.MKWyKc),useInlineNotice:function(){let e=(0,I.bG)([aF.A],()=>aF.A.getDisableAllSounds());return x.useMemo(()=>{if(e)return{type:f.lT.INLINE_NOTICE,noticeType:"warning",role:"none",text:V.intl.format(V.t.fRvixS,{onClick:()=>(0,na.openUserSettings)(S.X.NOTIFICATIONS_SOUNDS_CATEGORY)})}},[e])},buildLayout:()=>[aJ,aX,aH]}),a0=(0,h.zD)(S.X.STREAMING_SHOW_STREAM_PREVIEWS,{useTitle:()=>V.intl.string(V.t.e3Zz3F),useSubtitle:()=>V.intl.string(V.t.RztTjP),useValue:function(){return!U.uh.useSetting()},setValue:function(e){(0,rc.A)("stream_previews_disabled",!e,U.uh.getSetting(),[tk.A.USER_SETTINGS_VOICE_AND_VIDEO]),U.uh.updateSetting(!e)}}),a1=(0,h.zD)(S.X.STREAMING_ADVANCED_SCREENSHARE,{useTitle:()=>V.intl.string(V.t.GmWk2E),useSearchTerms:()=>[V.intl.string(V.t["Fj/xn1"])],useSubtitle:()=>V.intl.string(V.t["Fj/xn1"]),useValue:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.getVideoHook())},setValue:lE.default.setVideoHook,usePredicate:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.supportsVideoHook())}}),a2=(0,h.zD)(S.X.STREAMING_EXPERIMENTAL_SOUNDSHARE,{useTitle:()=>V.intl.string(V.t["4I0qzZ"]),useValue:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.getExperimentalSoundshare())},setValue:lE.default.setExperimentalSoundshare,usePredicate:function(){return(0,I.bG)([i9.Ay],()=>{let e=i9.Ay.supportsExperimentalSoundshare(),t=i9.Ay.supportsHookSoundshare();return e&&t})}}),a3=(0,h.zD)(S.X.STREAMING_STREAM_ATTENUATION,{useTitle:()=>V.intl.string(V.t["/jwMtn"]),useSubtitle:()=>V.intl.string(V.t.zlA23F),useValue:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.getSidechainCompression())},setValue:function(e){let t=[tk.A.USER_SETTINGS_VOICE_AND_VIDEO];lE.default.setSidechainCompression(e,{analyticsLocations:t})},usePredicate:function(){return i9.Ay.supports(lw.O5.SIDECHAIN_COMPRESSION)}}),a5=(0,h.sN)(S.X.STREAMING_STREAM_ATTENUATION_STRENGTH,{useTitle:()=>V.intl.string(V.t.fhEzfj),setValue:function(e){let t=[tk.A.USER_SETTINGS_VOICE_AND_VIDEO];lE.default.setSidechainCompressionStrength(e,{analyticsLocations:t})},minValue:1,maxValue:100,getInitialValue:i9.Ay.getSidechainCompressionStrength,usePredicate:function(){let e=(0,I.bG)([i9.Ay],()=>i9.Ay.getSidechainCompression());return i9.Ay.supports(lw.O5.SIDECHAIN_COMPRESSION)&&e}}),a4=(0,h.zD)(S.X.STREAMING_OS_MENU_SCREEN_CAPTURE,{useTitle:()=>V.intl.string(V.t.lt8rRx),useSubtitle:()=>V.intl.string(V.t.ie1mgY),useValue:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.getUseSystemScreensharePicker())},setValue:function(e){(0,nh.cX)()&&e?(0,n2.A)({title:V.intl.string(V.t["9jf31O"]),subtitle:V.intl.string(V.t.uBd6JW),variant:"primary",onConfirm:()=>{lE.default.setUseSystemScreensharePicker(e),nf.A.app.relaunch()},confirmText:V.intl.string(V.t.BddRzS)}):lE.default.setUseSystemScreensharePicker(e)},usePredicate:function(){return(0,I.bG)([i9.Ay],()=>i9.Ay.supportsSystemScreensharePicker()&&(0,nh.cX)())}}),a6=(0,h.bd)(S.X.STREAMING_ADVANCED_ACCORDION,{useTitle:e=>e?V.intl.string(V.t.qrMyvm):V.intl.string(V.t.LEtTNl),useCollapsedSubtitle:()=>tI(S.X.STREAMING_ADVANCED_ACCORDION),buildLayout:()=>[a3,a5,a4,a2,a1]}),a8=(0,h.zZ)(S.X.STREAMING_CATEGORY,{useTitle:()=>V.intl.string(V.t.KDdjou),buildLayout:()=>[a0,a6]});var a7=n(106713);let a9=(0,h.E2)(S.X.VOICE_MICROPHONE_INPUT_SELECT,{useSearchTerms:()=>[],Component:function(){let{showDeviceFormFactorIndicators:e}=a7.A.useConfig({location:"MicrophoneInputSelect"});return(0,p.jsx)(sz.U,{label:V.intl.string(V.t.UTM8VP),deviceType:lw.oh.AUDIO_INPUT,location:"UserSettingsVoiceVideo",hideDeviceTypeIcon:!e})}}),oe=(0,h.E2)(S.X.VOICE_SPEAKER_OUTPUT_SELECT,{useSearchTerms:()=>[],Component:function(){let{showDeviceFormFactorIndicators:e}=a7.A.useConfig({location:"SpeakerOutputSelect"});return(0,p.jsx)(sz.U,{label:V.intl.string(V.t.xuYQ0n),deviceType:lw.oh.AUDIO_OUTPUT,location:"UserSettingsDevices",hideDeviceTypeIcon:!e})}}),ot=(0,h.zC)(S.X.VOICE_INPUT_OUTPUT_DEVICE_SPLIT,{buildLayout:()=>[a9,oe]}),on=(0,h.sN)(S.X.VOICE_INPUT_VOLUME_SETTING,{useTitle:()=>V.intl.string(V.t.Rtsr6w),minValue:0,maxValue:100,getInitialValue:function(){let e=i9.Ay.getInputVolume();return(0,aM.M)(e)},asValueChanges:function(e){let t=[tk.A.USER_SETTINGS_VOICE_AND_VIDEO],n=(0,aM.w)(e);lE.default.setInputVolume(n,{analyticsLocations:t})}}),oi=(0,h.sN)(S.X.VOICE_OUTPUT_VOLUME_SETTING,{useTitle:()=>V.intl.string(V.t.aUJ062),minValue:0,maxValue:200,getInitialValue:function(){let e=i9.Ay.getOutputVolume();return(0,aM.M)(e)},onValueRender:function(e){return`${e.toFixed(0)}%`},asValueChanges:function(e){let t=[tk.A.USER_SETTINGS_VOICE_AND_VIDEO],n=(0,aM.w)(e);lE.default.setOutputVolume(n,{analyticsLocations:t})}}),ol=(0,h.zC)(S.X.VOICE_INPUT_OUTPUT_VOLUME_SPLIT,{buildLayout:()=>[on,oi]});var os=n(164636),or=n(782600),oa=n(804037);let oo=`${eC.A.getArticleURL(_.MVz.VOICE_VIDEO_TROUBLESHOOTING)}?utm_source=discord&utm_medium=blog&utm_campaign=2020-06_help-voice-video&utm_content=--t%3Apm`,ou=(0,h.E2)(S.X.VOICE_MICROPHONE_TEST_SETTING,{useSearchTerms:()=>[V.intl.string(V.t.nuFtHH)],usePredicate:function(){return(0,os.bG)([i9.Ay],()=>i9.Ay.supports(lw.O5.LOOPBACK))},Component:function(){return(0,os.bG)([i9.Ay],()=>i9.Ay.supports(lw.O5.LOOPBACK))?(0,p.jsx)(or.A,{size:"md",notchBackground:or.V.GRAY,captionVoice:V.intl.string(V.t.bp3JOV),captionNoVoice:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n5.E,{variant:"body-xs/semibold",color:"text-default",children:V.intl.string(V.t.bgn75v)}),V.intl.string(V.t["MA+OZh"]),(0,p.jsx)(nr.Anchor,{className:oa.X,href:eC.A.getArticleURL(_.MVz.NO_INPUT_DETECTED),children:V.intl.string(V.t.RYKKox)})]}),helpText:V.intl.format(V.t["V+B3FH"],{guideURL:oo}),buttonTest:V.intl.string(V.t.gyljWE),buttonStop:V.intl.string(V.t.I6OnJ3),buttonVariant:"primary",location:{page:_.liQ.USER_SETTINGS,section:_.JJy.SETTINGS_VOICE_AND_VIDEO}}):null}}),od=e8.uF()?["BTHENUM","BTHHFENUM"]:[];function oc(e){let{inputAndOutputAreBluetooth:t,canPromptSystemServiceInstallForVoice:n}=e;return(0,p.jsxs)(q.B,{children:[n&&(0,p.jsx)(ll,{sourcePage:"voice"}),t&&(0,p.jsx)(l9.A,{look:l9.k.WARNING,children:V.intl.string(V.t.Ioz3gx)})]})}let og=(0,h.zZ)(S.X.VOICE_CATEGORY,{useTitle:()=>V.intl.string(V.t.K3lovD),useSearchTerms:()=>[V.intl.string(V.t.hHMYbb),V.intl.string(V.t.nuFtHH),V.intl.string(V.t.dl18zb),V.intl.string(V.t["3182VD"]),V.intl.string(V.t["DGq/PR"]),V.intl.string(V.t.eATD2B),V.intl.string(V.t.Rtsr6w),V.intl.string(V.t.aUJ062)],useInlineNotice:function(){let e=li("voice"),t=(0,sH.x5)(lw.oh.AUDIO_INPUT),n=(0,sH.x5)(lw.oh.AUDIO_OUTPUT),i=x.useMemo(()=>{let e=od.some(e=>t?.hardwareId?.startsWith(e)),i=od.some(e=>n?.hardwareId?.startsWith(e));return e&&i&&t?.containerId!=null&&t.containerId===n?.containerId},[t,n]);return x.useMemo(()=>e.canPrompt||i?{type:f.lT.STRONGLY_DISCOURAGED_CUSTOM,notice:()=>(0,p.jsx)(oc,{inputAndOutputAreBluetooth:i,canPromptSystemServiceInstallForVoice:e.canPrompt})}:null,[e.canPrompt,i])},buildLayout:()=>[ot,ol,ou]}),om=(0,h.t_)(S.X.VOICE_AND_VIDEO_PANEL,{useTitle:()=>V.intl.string(V.t.B1fFpf),buildLayout:()=>[og,ao,sJ,a8,a$,aw,r_,rh]}),oA=(0,h.i4)(S.X.VOICE_AND_VIDEO_SIDEBAR_ITEM,{useTitle:()=>V.intl.string(V.t.B1fFpf),usePredicate:()=>i9.Ay.isSupported(),icon:sP.MicrophoneIcon,useMenu:sG.A,buildLayout:()=>[om]}),oE=(0,h.WI)(S.X.APP_SECTION,{useTitle:()=>V.intl.string(V.t.gcyH1J),buildLayout:()=>[oA,nZ,tt,iH,sL,n$]});var oh=n(360669),oS=n(369143),oT=n(975807),of=n(566345),op=n(139286),ox=n(534247);function oI(e){let{surface:t,title:n,children:i,actions:l,graphicSrc:s,graphicLottie:r,footnote:a,size:o="default"}=e,{analyticsLocations:u}=(0,ez.Ay)();(0,op.A)({name:sd.ImpressionNames.GIFT_CARDS_MARKETING_BANNER,type:sd.ImpressionTypes.VIEW,properties:{surface:t,location_stack:u}},{trackOnInitialLoad:!0});let d="compact"===o;return(0,p.jsxs)("div",{className:ic()(ox.kL,{[ox.oE]:d}),children:[(0,p.jsxs)(q.B,{direction:"vertical",align:"start",justify:"center",gap:d?24:16,fullWidth:!1,className:ox.Qs,children:[(0,p.jsxs)(q.B,{direction:"vertical",align:"start",gap:d?12:8,children:[(0,p.jsx)(N.D,{variant:d?"heading-lg/semibold":"heading-xl/semibold",color:"text-strong",children:n}),i]}),(l.length>0||null!=a)&&(0,p.jsxs)(q.B,{direction:"vertical",align:"start",gap:12,children:[l.length>0&&(0,p.jsx)(q.B,{direction:"horizontal",gap:d?12:16,wrap:!0,fullWidth:!1,children:l.map(e=>(0,p.jsx)(j.$,{variant:"overlay-primary",size:"sm",text:e.text,onClick:e.onClick},String(e.text)))}),null!=a&&(0,p.jsx)(n5.E,{variant:"footnote/normal",color:"text-subtle",children:a})]})]}),null!=r?(0,p.jsx)("div",{className:ox.yO,children:(0,p.jsx)(of.v,{type:"lottie",lottie:r,aspectRatio:"6/4"})}):(0,p.jsx)("img",{src:s,className:ox.fA,alt:""})]})}function o_(e){let{analyticsLocations:t}=(0,ez.Ay)();return x.useCallback((n,i)=>{td.default.track(_.HAw.GIFT_CARDS_MARKETING_BANNER_CTA_CLICKED,{surface:e,cta:n,partner:i?.partner,url:i?.url,location_stack:t})},[e,t])}var ob=n(425565),oN=n(321671),oC=n(936564),oy=n(798091),ov=n(956956),oj=n(289873),oO=n(115560),oR=n(465323),oD=n(37766),oL=n(194261),oP=n(391048),oG=n(781300),oM=n(99696),oU=n(202613),oV=n(615405),ok=n(83617),ow=n(811091),oF=n(607399),oB=n(993077),oX=n(150934),oz=n(256006),oH=n(718718),oY=n(558740);let oW=/[^0-9/]/g,oK=/[^0-9]/g;class oZ extends x.PureComponent{_inputRef;selectionStart=0;componentDidUpdate(e){let t=this._inputRef;e.value!==this.props.value&&null!=t&&t.setSelectionRange(this.selectionStart,this.selectionStart)}setRef=e=>{let{inputRef:t}=this.props;this._inputRef=e,null!=t&&t(e)};handleChange=(e,t)=>{let n,i,l,s,{value:r,onChange:a}=this.props,o=this._inputRef;if(e===r||null==o||null==r)return;let u=(i=(n=e.replace(oW,"").split("/"))[0],l=n[1],s=[],parseInt(i,10)>12&&(i=i.substring(0,1)),s.push(i),(parseInt(i,10)>1||2===i.length||null!=l&&""!==l)&&s.push("/"),null!=l&&""!==l&&parseInt(l,10)>99&&(l=(l+"").substring(0,2)),s.push(l),s.join("")),d=o.selectionStart;u===r&&u.length<=3&&r.includes("/")&&!e.includes("/")?u=u.replace(oK,""):u===r&&e.includes("/")&&!r.includes("/")&&(u+="/"),u.length>e.length&&(d+=u.length-e.length),this.selectionStart=d,null!=a&&a(u,t)};render(){return(0,p.jsx)(lp.k,{...this.props,inputMode:"numeric",onChange:this.handleChange,inputRef:this.setRef})}}var oq=n(832208),oQ=n(782328);let oJ=[{fields:[{expirationDate:{name:"expirationDate",id:(0,tK.Ld)(),title:()=>V.intl.string(V.t["CeBa/4"]),autoComplete:"cc-exp",placeholder:()=>V.intl.string(V.t.xeEWQ6),pattern:"\\d*",getClassNameForLayout:()=>oQ.ep,renderInput:e=>(0,p.jsx)(oZ,{...e})}}.expirationDate]}],o$=function(e){let{onCardInfoChange:t,className:n,expirationDate:i,error:l}=e,[s,r]=x.useState(!1),[a,o]=x.useState(null),[u,d]=x.useState(i);return x.useEffect(()=>{t({expirationDate:u},null===a)},[u,t,a]),(0,p.jsx)(oq.A,{className:n,form:oJ,values:{expirationDate:u},errors:null!=a?{expirationDate:a}:{},formError:l,onFieldChange:function(e){s||""===e||r(!0),s&&""===e||!(0,oY.So)(e)?o(V.intl.string(V.t["9/zZdl"])):o(null),d(e)}})};var o0=n(219887),o1=n(292856);let o2="isDefault";class o3 extends x.PureComponent{static defaultProps={onDelete:()=>{},onSubmit:()=>{},onCancel:()=>{}};constructor(e){super(e);let{paymentSource:t,isDefault:n}=e,i=t.billingAddress;this.state={billingAddress:{name:i.name??"",line1:i.line1??"",line2:i.line2??"",country:i.country??"",state:i.state??"",city:i.city??"",postalCode:i.postalCode??""},expiresMonth:t instanceof oU.YS?t.expiresMonth:void 0,expiresYear:t instanceof oU.YS?t.expiresYear:void 0,billingAddressValid:!1,isDefault:n,expirationValid:!0,dirtyFields:{}}}componentWillUnmount(){(0,oG.ey)(),(0,oG.tc)()}handleSubmit=e=>{if(e.preventDefault(),e.stopPropagation(),0===Object.values(this.state.dirtyFields).filter(io.Vq).length)this.props.onCancel();else{let{billingAddress:e,isDefault:t,expiresMonth:n,expiresYear:i}=this.state;this.props.onSubmit(this.props.paymentSource.id,{billingAddress:e,expiresMonth:n,expiresYear:i,isDefault:t})}};handleCancel=()=>{this.props.onCancel()};handleDelete=()=>{let{onDelete:e,paymentSource:t}=this.props;e(t.id)};handleAddressUpdate=(e,t,n)=>{this.setState({billingAddress:e,billingAddressValid:t,dirtyFields:{...this.state.dirtyFields,billingAddress:n}})};handleExpirationDateUpdate=(e,t)=>{let{expirationDate:n}=e;if(this.setState({expirationValid:t}),null==n||""===n)return;let[i,l]=n.split("/");this.handleFieldChange(Number(i),"expiresMonth"),this.handleFieldChange(Number(`${new Date().getFullYear().toString().slice(0,2)}${l}`),"expiresYear")};handleFieldChange=(e,t)=>{null!=t&&this.setState({[t]:e,dirtyFields:{...this.state.dirtyFields,[t]:!0}})};renderError(){let{updateError:e,removeError:t}=this.props;return null==e||e.hasCardError()||e.hasAddressError()?null!=t?(0,p.jsx)("div",{className:o1.zc,children:(0,p.jsx)(iK.w,{type:"critical",message:t.message,role:"alert"})}):null:(0,p.jsx)("div",{className:o1.zc,children:(0,p.jsx)(iK.w,{type:"critical",message:e.message,role:"alert"})})}renderBillingAddressSection(){let{billingAddress:e}=this.state,{updateError:t,paymentSource:n}=this.props,i=(0,oz.g)(n);return(0,p.jsxs)("div",{className:o1.yV,children:[(0,p.jsx)(n5.E,{className:o1.bV,variant:"body-sm/normal",children:V.intl.string(V.t["50Auo2"])}),(0,p.jsx)(oH.Ay,{...e,mode:oH.Ay.Modes.EDIT,layout:i,onBillingAddressChange:this.handleAddressUpdate,error:t})]})}renderCardExpirationSection(){let{expiresMonth:e,expiresYear:t}=this.state;if(null==e||null==t)return null;let n=`${e.toString().padStart(2,"0")}/${t.toString().padStart(2,"0").slice(-2)}`;return(0,p.jsxs)("div",{className:o1.yV,children:[(0,p.jsx)(n5.E,{className:o1.bV,variant:"body-sm/normal",children:V.intl.string(V.t.Fo2YP7)}),(0,p.jsx)(o$,{expirationDate:n,onCardInfoChange:this.handleExpirationDateUpdate,error:this.props.updateError})]})}renderActions(){let{submitting:e,removing:t,isForSubscription:n}=this.props,{billingAddressValid:i,expirationValid:l}=this.state;return(0,p.jsx)("div",{className:o1.AU,children:(0,p.jsxs)(q.B,{direction:"horizontal",justify:"space-between",children:[(0,p.jsx)(s5.e,{children:(0,p.jsxs)("div",{className:o1.lH,children:[n?(0,p.jsx)(lg.m,{text:V.intl.string(V.t["v6/z28"]),children:(0,p.jsx)("div",{"aria-hidden":!0,className:o1.dm})}):null,(0,p.jsx)(j.$,{type:"button",disabled:n||e,loading:t,onClick:this.handleDelete,variant:"critical-secondary",size:oF.Fr?"sm":"md",text:oF.Fr?V.intl.string(V.t.oyYWHE):V.intl.string(V.t.yk5qfb)})]})}),(0,p.jsxs)(s5.e,{children:[(0,p.jsx)(j.$,{type:"button",disabled:e||t,onClick:this.handleCancel,variant:"secondary",size:oF.Fr?"sm":"md",text:V.intl.string(V.t["ETE/oC"])}),(0,p.jsx)(j.$,{loading:e,disabled:!i||t||!l,type:"submit",variant:"active",size:oF.Fr?"sm":"md",text:V.intl.string(V.t["R3BPH+"])})]})]})})}render(){let{paymentSource:e,isDefault:t,locale:n,className:i,isForSubscription:l}=this.props,{isDefault:s}=this.state,r=e instanceof oU.SJ;return(0,p.jsx)(oB.Z,{editable:!0,className:ic()(o1.Nr,i),children:(0,p.jsxs)("form",{onSubmit:this.handleSubmit,noValidate:!0,children:[this.renderError(),(0,p.jsxs)("div",{className:o1.__invalid_paymentSection,children:[(0,p.jsx)(o0.A,{paymentSource:e,isDefault:t,isForSubscription:l,locale:n,showLabels:!0,showPaymentSourceIcon:!0}),e.invalid?(0,p.jsx)("div",{className:o1.Um,children:V.intl.string(V.t["3R0U0b"])}):null,(0,p.jsx)("div",{className:o1.Sv,children:r?V.intl.format(V.t.w9WkBl,{paypalURL:"https://www.paypal.com"}):V.intl.string(V.t.VXndyr)})]}),this.renderCardExpirationSection(),this.renderBillingAddressSection(),(0,p.jsx)("div",{className:o1.D5,children:(0,p.jsx)(oX.S,{value:o2,checked:s,onChange:e=>this.handleFieldChange(e,o2),label:V.intl.string(V.t.nag9Og),labelType:"secondary"})}),(0,p.jsx)(ls.c,{}),this.renderActions()]})})}}let o5=I.Ay.connectStores([oV.A],()=>({updateError:oV.A.editSourceError,removeError:oV.A.removeSourceError}))(o3);var o4=n(140624),o6=n(849405),o8=n(329693);function o7(){(0,oM.HF)({withRedemptionSuccessModal:!0,source:"desktop_billing_page",loadId:(0,oO.A)()})}class o9 extends x.PureComponent{static defaultProps={isEditing:!1,hideDivider:!1,onEditClick:()=>{}};handleEditClick=()=>{this.props.onEditClick(this.props.paymentSource.id)};render(){let{paymentSource:e,isDefault:t,isEditing:n,hideDivider:i,isForSubscription:l,locale:s,removing:r,submitting:a,onSubmit:o,onCancel:u,onDelete:d}=this.props;return n?(0,p.jsx)(o5,{paymentSource:e,isDefault:t,removing:r,submitting:a,locale:s,isForSubscription:l,onSubmit:o,onCancel:u,onDelete:d}):(0,p.jsxs)(p.Fragment,{children:[i?null:(0,p.jsx)(ls.c,{className:o8.__invalid_sourceDivider}),(0,p.jsxs)("div",{className:o8.Yb,children:[(0,p.jsx)(o0.A,{paymentSource:e,isDefault:t,isForSubscription:l,locale:s,showSubtext:!0,showLabels:!0,showPaymentSourceIcon:!0}),(0,p.jsx)(j.$,{variant:"secondary",onClick:this.handleEditClick,size:"sm",text:V.intl.string(V.t.bt75uw)})]})]})}}let ue=x.memo(function(e){let{paymentSource:t,hideDivider:n,isForSubscription:i,locale:l,onRedeemClick:s}=e,[r,a]=x.useState(null),o=(0,I.bG)([sE.default],()=>sE.default.getCurrentUser()?.storeCountry?.country??null),u=(0,I.bG)([oV.A],()=>oV.A.ipCountryCode),d=x.useMemo(()=>(0,oR.TW)(`-${o??u??"US"}`),[o,u]);return x.useEffect(()=>{void 0===t?a({amount:0,currency:d}):oG.YP(t.id).then(e=>{a(e)})},[t,d]),(0,p.jsxs)(p.Fragment,{children:[n?null:(0,p.jsx)(ls.c,{className:o8.__invalid_sourceDivider}),(0,p.jsxs)("div",{className:o8.Yb,children:[void 0!==t?(0,p.jsx)(o0.A,{paymentSource:t,isDefault:!1,isForSubscription:i,locale:l,showSubtext:!1,showLabels:!1,showPaymentSourceIcon:!0}):(0,p.jsxs)(lb.A,{align:lb.A.Align.CENTER,children:[(0,p.jsx)(oD.PaymentTypeGiftCardIcon,{size:"lg"}),(0,p.jsx)(n5.E,{variant:"body-sm/medium",className:o6.Wi,children:V.intl.string(o4.default["/FQWfA"])})]}),(0,p.jsxs)("div",{className:o8.zy,children:[(0,p.jsx)("div",{className:o8.Tq,children:null==r?(0,p.jsx)(oj.y,{type:oj.y.Type.SPINNING_CIRCLE}):(0,p.jsx)(n5.E,{variant:"body-sm/medium",children:function(){let{amount:e,currency:t}=r??{},n=t??d,i=(0,oR.$g)(e??0,n,l,{currencyDisplay:"narrowSymbol"});return`${String(n).toUpperCase()} ${i}`}()})}),(0,p.jsx)(j.$,{variant:"secondary",onClick:s,size:"sm",text:V.intl.string(o4.default.hnRau6)})]})]})]})});class ut extends x.PureComponent{state={editingPayment:null};handleEditClick=async e=>{try{await oG.Gr(e),this.setState({editingPayment:e})}catch(e){}};handleCancel=()=>{this.setState({editingPayment:null})};handleDelete=async e=>{try{await oG.JQ(e),this.setState({editingPayment:null})}catch(e){}};handleSubmit=async(e,t)=>{if(null!=e)try{await oG.Ps(e,t),this.setState({editingPayment:null})}catch(e){}};handlePaymentSourceAdded=async e=>{await (0,ok.c_)(e.id)};handleAddPaymentMethod=()=>{(0,lf.mM)(async()=>{let{default:e}=await Promise.resolve().then(n.bind(n,362111));return t=>(0,p.jsx)(e,{...t,onAddPaymentSource:this.handlePaymentSourceAdded})},{onCloseCallback:()=>{(0,oP.ET)()}})};renderFooter(){let{paymentSources:e}=this.props;return(0,p.jsxs)("div",{className:o8.qr,children:[0===Object.keys(e).length?(0,p.jsxs)("div",{className:o8.z8,children:[(0,p.jsx)(n5.E,{variant:"body-sm/normal",children:V.intl.string(V.t.aRHpAB)}),(0,p.jsx)(n5.E,{variant:"body-sm/normal",color:"text-subtle",className:o8.Sv,children:V.intl.string(V.t.o9bOIl)})]}):null,(0,p.jsx)(j.$,{onClick:this.handleAddPaymentMethod,text:V.intl.string(V.t.CpOiEO)})]})}render(){let e,{showHeader:t,defaultPaymentSourceId:n,paymentSources:i,locale:l,removing:s,submitting:r,premiumSubscriptionPaymentSourceId:a,showGiftCards:o}=this.props,u=K().values(i).sort((e,t)=>e.id===n?-1:t.id===n?1:ow.default.compare(e.id,t.id)),d=u.filter(e=>!(e instanceof oU.LQ)),c=u.filter(e=>e instanceof oU.LQ),g=this.state.editingPayment,m=d.findIndex(e=>e.id===g),A=d.map((e,t)=>(0,p.jsx)(o9,{locale:l,paymentSource:e,isDefault:n===e.id,onCancel:this.handleCancel,onDelete:this.handleDelete,isForSubscription:e.id===a,hideDivider:0===t||m===t-1,onSubmit:this.handleSubmit,submitting:r,removing:s,isEditing:g===e.id,onEditClick:this.handleEditClick},e.id));return e=c.length>0?c.map((e,t)=>(0,p.jsx)(ue,{paymentSource:e,hideDivider:0===d.length||m===d.length-1,isForSubscription:e.id===a,locale:l,onRedeemClick:o7},e.id)):(0,p.jsx)(ue,{hideDivider:0===d.length||m===d.length-1,isForSubscription:!1,locale:l,onRedeemClick:o7}),(0,p.jsxs)(p.Fragment,{children:[t?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(N.D,{variant:"heading-lg/semibold",children:[(0,p.jsx)(oL.LockIcon,{size:"sm",className:o8.hz})," ",V.intl.string(V.t.W26xGQ)]}),(0,p.jsx)(n5.E,{variant:"body-sm/normal",color:"text-subtle",children:V.intl.string(V.t.h6V3uK)})]}):null,A,o&&e,m!==d.length-1||o&&c.length>0?(0,p.jsx)(ls.c,{}):null,this.renderFooter()]})}}var un=n(459357),ui=n(295405),ul=n(166403),us=n(773669),ur=n(943009);function ua(){let e=(0,I.bG)([sE.default],()=>sE.default.getCurrentUser()?.storeCountry);return e?.country==null?null:{country:e.country,countryName:(0,ov.Gw)(e.country)}}let uo=(0,h.E2)(S.X.BILLING_PAYMENT_METHODS,{Component:function(e){let{showHeader:t=!1}=e,n=(0,I.bG)([oV.A],()=>oV.A.isSyncing),i=(0,I.bG)([ui.A],()=>ui.A.paymentSources),l=(0,I.bG)([ui.A],()=>ui.A.defaultPaymentSourceId),s=(0,I.bG)([us.default],()=>us.default.locale),r=(0,I.bG)([ul.A],()=>ul.A.getPremiumTypeSubscription()),a=(0,I.bG)([oV.A],()=>oV.A.isRemovingPaymentSource),o=(0,I.bG)([oV.A],()=>oV.A.isUpdatingPaymentSource),{enabled:u}=(0,un.c)({location:"UserSettingsBilling"});return(x.useEffect(()=>{oG.$o(),oG.hP()},[]),n&&0===Object.keys(i).length)?(0,p.jsx)("div",{className:ur.o,children:(0,p.jsx)(oj.y,{})}):(0,p.jsx)(ut,{showHeader:t,paymentSources:i,defaultPaymentSourceId:l,premiumSubscriptionPaymentSourceId:null!=r&&r.status!==_.Dmq.CANCELED?r.paymentSourceId:null,locale:s,removing:a,submitting:o,showGiftCards:u})},useSearchTerms:()=>[V.intl.string(V.t.W26xGQ),V.intl.string(V.t["3pIjBH"])]}),uu=(0,h.E2)(S.X.BILLING_GIFT_CARDS_MARKETING_BANNER,{Component:function(){let e=o_("billing_banner"),t=x.useMemo(()=>[{text:V.intl.string(oN.default["6bWeWP"]),onClick:()=>{e("learn_more",{url:ob.C}),(0,oT.A)(ob.C)}},{text:V.intl.string(oN.default.xYa9Y8),onClick:()=>{let t=eC.A.getArticleURL(_.MVz.BUY_GIFT_CARDS);e("where_to_buy",{url:t}),(0,oT.A)(t)}}],[e]);return(0,p.jsx)("div",{className:oC.k,children:(0,p.jsx)(oI,{surface:"billing_banner",title:V.intl.string(oN.default.w8gzZb),graphicSrc:"https://cdn.discordapp.com/assets/content/ee0bcc3ecc6d909365f70b4692752f0ac9c8a2e49c47afac16e7dbd31efe360f.png",actions:t,children:(0,p.jsx)(n5.E,{variant:"body-md/medium",color:"text-subtle",children:V.intl.string(oN.default.qtKobx)})})})},useSearchTerms:()=>[],usePredicate:()=>(0,oy.y)({location:"BillingMarketingBanner",countGiftCardWallet:!0,canFetchPaymentSources:!1})}),ud=(0,h.zZ)(S.X.BILLING_PAYMENT_METHODS_CATEGORY,{useTitle:()=>V.intl.string(V.t.W26xGQ),useSubtitle:()=>{let e=ua();return null!=e?V.intl.format(V.t.e2t1G5,{country:e.countryName}):V.intl.string(V.t.h6V3uK)},useSubtitleDecoration:function(){return null==ua()?null:{type:f.p3.INFO_POPOVER,ariaLabel:V.intl.string(V.t.PuB1W7),popoverProps:{title:"",body:V.intl.string(V.t["21skUa"]),size:"sm",position:"top",getActions:e=>[{text:V.intl.string(V.t.PuB1W7),variant:"primary",onClick:()=>{window.open("https://support.discord.com/hc/articles/39799791912087","_blank"),e()}}]}}},buildLayout:()=>[uo,uu]});var uc=n(837381),ug=n(516521),um=n(928039),uA=n(921853),uE=n(22306);function uh(e){let{currentPageIndex:t,numPages:n,onChangePage:i,children:l,showPageCount:s=!0,ref:r,...a}=e,o=t>=n-1,u=s?V.intl.format(V.t.MtpIwg,{currentPage:t+1,numPages:n}):V.intl.format(V.t.bKI77c,{currentPage:t+1});return(0,p.jsxs)("div",{ref:r,...a,children:[l,(0,p.jsx)("div",{className:uE.v,children:(0,p.jsxs)("div",{className:uE.U,children:[(0,p.jsx)(ld.K,{variant:"icon-only",icon:uA.ChevronSmallLeftIcon,disabled:t<=0,onClick:()=>i(t-1),"aria-label":V.intl.string(V.t.vgfxaA)}),(0,p.jsx)(n5.E,{variant:"body-sm/medium",children:u}),(0,p.jsx)(ld.K,{variant:"icon-only",icon:n8.ChevronSmallRightIcon,disabled:o,onClick:()=>i(t+1),"aria-label":V.intl.string(V.t.XiOHRX)})]})})]})}var uS=n(431955);n(938796);var uT=n(334279),uf=n(122817),up=n(665260),ux=n(315069),uI=n(557009),u_=n(570221),ub=n(191115);class uN extends ux.A{id;createdAt;currency;tax;taxInclusive;amount;amountRefunded;status;description;hasInvoiceURL;hasRefundInvoiceURLs;downloadableInvoice;downloadableRefundInvoices;flags;paymentSource;paymentGateway;subscription;skuId;skuPrice;sku;premiumRefundDisqualificationReasons;entitlements;invoice;static createFromServer(e){let t=null!=e.payment_source?oU.Ay.createFromServer(e.payment_source):null,n=null!=e.sku?uS.A.createFromServer(e.sku):null,i=null!=e.subscription?ub.A.createFromServer(e.subscription):null;return new uN({id:e.id,createdAt:new Date(e.created_at),currency:e.currency,tax:e.tax,taxInclusive:e.tax_inclusive,amount:e.amount,amountRefunded:e.amount_refunded,status:e.status,metadata:e.metadata,description:e.description,paymentSource:t,paymentGateway:e.payment_gateway,flags:e.flags,subscription:i,skuId:e.sku_id,skuPrice:e.sku_price,sku:n,downloadableInvoice:e.downloadable_invoice,downloadableRefundInvoices:e.downloadable_refund_invoices,hasInvoiceURL:e.has_invoice_url,hasRefundInvoiceURLs:e.has_refund_invoice_urls,premiumRefundDisqualificationReasons:e.premium_refund_disqualification_reasons,entitlements:null!=e.entitlements?e.entitlements.map(e=>uI.A.createFromServer(e)):void 0,invoice:null!=e.invoice?u_.Y.createFromServer(e.invoice):null})}constructor(e){super(),this.id=e.id,this.amount=e.amount,this.amountRefunded=e.amountRefunded,this.createdAt=e.createdAt,this.currency=e.currency,this.description=e.description,this.paymentSource=e.paymentSource,this.paymentGateway=e.paymentGateway,this.status=e.status,this.tax=e.tax,this.taxInclusive=e.taxInclusive,this.subscription=e.subscription,this.skuId=e.skuId,this.skuPrice=e.skuPrice,this.sku=e.sku,this.flags=e.flags,this.downloadableInvoice=e.downloadableInvoice,this.downloadableRefundInvoices=e.downloadableRefundInvoices,this.hasInvoiceURL=e.hasInvoiceURL,this.hasRefundInvoiceURLs=e.hasRefundInvoiceURLs,this.premiumRefundDisqualificationReasons=e.premiumRefundDisqualificationReasons,this.entitlements=e.entitlements,this.invoice=e.invoice}get isPurchasedViaApple(){return this.paymentGateway===_.kM_.APPLE}get isPurchasedViaGoogle(){return this.paymentGateway===_.kM_.GOOGLE}get isPurchasedExternally(){return this.isPurchasedViaApple||this.isPurchasedViaGoogle}get isSubscription(){return null!=this.subscription}get isPremiumSubscription(){return null!=this.subscription&&tJ.JM.has(this.subscription.planId)}get isPremiumGuildSubscription(){return null!=this.subscription&&null!=this.subscription.additionalPlans.find(e=>{let{planId:t}=e;return tJ.pW.has(t)})}get isGift(){return up.Lt(this.flags,1)}get isPremiumGift(){return this.isGift&&null!=this.skuId&&Object.values(tJ.pe).includes(this.skuId)}get isGuildProductPurchase(){return null!=this.sku&&(this.sku.productLine===_.EZt.GUILD_PRODUCT||up.Lt(this.sku.flags,uf.d.GUILD_PRODUCT))}get isSoftDeletedProduct(){return this.sku?.deleted===!0}get isCollectible(){return null!=this.sku&&this.sku.productLine===_.EZt.COLLECTIBLES}get isFractionalPremium(){return null!=this.skuId&&uT.I.ALL.has(this.skuId)}get isShopPurchase(){return this.isCollectible||this.isFractionalPremium}}var uC=((i={})[i.PENDING=1]="PENDING",i[i.PAID=2]="PAID",i[i.FAILED=3]="FAILED",i[i.CANCELED=4]="CANCELED",i[i.PARTIALLY_REFUNDED=5]="PARTIALLY_REFUNDED",i[i.REFUNDED=6]="REFUNDED",i[i.REVERSED=7]="REVERSED",i),uy=((l={})[l.NITRO=1]="NITRO",l[l.NITRO_BASIC=2]="NITRO_BASIC",l[l.SHOP=3]="SHOP",l[l.APPLICATION=4]="APPLICATION",l[l.PRODUCT=5]="PRODUCT",l),uv=((s={})[s.PARTIALLY_REFUNDED=1]="PARTIALLY_REFUNDED",s[s.REFUNDED=2]="REFUNDED",s[s.REVERSED=3]="REVERSED",s),uj=((r={})[r.PREMIUM=1]="PREMIUM",r[r.GIFT=2]="GIFT",r[r.APPLICATION=3]="APPLICATION",r[r.COLLECTIBLE=4]="COLLECTIBLE",r[r.IN_GAME_ITEM=5]="IN_GAME_ITEM",r),uO=((a={})[a.CLAIMED=1]="CLAIMED",a[a.UNCLAIMED=2]="UNCLAIMED",a[a.REDEEMED=3]="REDEEMED",a[a.FAILED=4]="FAILED",a[a.UNREDEEMED=5]="UNREDEEMED",a[a.REFUNDED=6]="REFUNDED",a);function uR(e){let t=e.payments.map(e=>({...e,payment_source:null!=e.payment_source?oU.Ay.createFromServer(e.payment_source):null})),n=t.find(t=>t.id===e.id);return{...e,sku:null!=e.sku?uS.A.createFromServer(e.sku):null,payments:t,receipt_payment:new uN({id:e.id,status:n?.status,paymentSource:n?.payment_source,hasInvoiceURL:e.has_invoice_url,hasRefundInvoiceURLs:e.has_refund_invoice_urls})}}let uD={receipts:[],cursor:null};var uL=n(34188),uP=n(597770),uG=n(724302),uM=n(291322),uU=n(147925),uV=n(707554),uk=n(957565),uw=n(250627),uF=n(871109),uB=n(571654),uX=n(411342),uz=n(179499),uH=n(362280),uY=n(95035),uW=n(317525),uK=n(460103);function uZ(e){let{description:t,detail:n}=e;return(0,p.jsx)("li",{className:uK.Iu,children:(0,p.jsxs)(lb.A,{justify:lb.A.Justify.BETWEEN,children:[(0,p.jsx)("div",{children:t}),(0,p.jsx)("div",{children:n})]})})}function uq(e){let{guildId:t,guildProductListingId:n}=e,i=(0,uw.Qi)(t,n,{requireCurrentGuild:!1}),l=(0,uB.z)(i),s=(0,I.bG)([lv.A],()=>lv.A.getGuild(t)),r=i?.role_id!=null&&i?.attachments_count===0?V.intl.string(V.t.H11qcT):l,a=x.useCallback(async()=>{s?.features.has(_.GuildFeatures.PRODUCTS_AVAILABLE_FOR_PURCHASE)?await (0,uH.A)(_.BVt.GUILD_PRODUCT(t,n)):await (0,uH.A)(_.BVt.CHANNEL(t)),(0,tH.default)()},[s,t,n]);return(0,p.jsxs)(p.Fragment,{children:[null!=r&&(0,p.jsx)(uZ,{description:V.intl.string(V.t.lXPbJb),detail:r}),null!=s&&(0,p.jsx)(uZ,{description:V.intl.string(V.t.Wpn8z8),detail:(0,p.jsx)(uY.A,{onClick:a,children:s.name})})]})}function uQ(e){let{guildId:t,guildProductListingId:n}=e,i=(0,uw.Qi)(t,n,{requireCurrentGuild:!1}),l=(0,I.bG)([uF.A],()=>uF.A.getGuildProductFetchState(n)===uF.e.FETCHING),s=i?.role_id,r=(0,I.bG)([uW.A],()=>null!=s?uW.A.getRole(t,s):void 0,[t,s]),a=(0,uz.A)({guildId:t,productId:n}),o=(i?.attachments?.length??0)>0,u=null!=r;return l?(0,p.jsx)("div",{className:uK.hT,children:(0,p.jsx)(oj.y,{})}):null!=i&&(o||u)?(0,p.jsxs)("div",{className:uK.hT,children:[o&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n5.E,{variant:"body-xs/semibold",color:"text-default",className:uK.yE,children:V.intl.string(V.t.hxawoy)}),(0,p.jsx)(j.$,{...a})]}),u&&(0,p.jsxs)(p.Fragment,{children:[o&&(0,p.jsx)("div",{className:uK.yF}),(0,p.jsx)(n5.E,{variant:"body-xs/semibold",color:"text-default",className:uK.yE,children:V.intl.string(V.t.gWBNet)}),(0,p.jsx)(uX.A,{role:r})]})]}):null}let uJ=function(e,t){(0,lf.mM)(async()=>{let{default:i}=await n.e(234138).then(n.bind(n,206049));return n=>(0,p.jsx)(i,{payment:e,paymentSource:t,...n})})};var u$=n(818348);function u0(e){let{payment:t}=e,[n,i]=x.useState(null),[l,s]=x.useState(null);async function r(e){try{let n=await async function(e){try{return(await tl.Bo.get({url:_.Rsh.BILLING_INVOICE_BREAKDOWN,query:{payment_id:e},oldFormErrors:!0,rejectWithError:!1})).body}catch(e){throw e}}(t.id);i(n);let l=e?n.refundInvoiceLinks[0]:n.invoiceLink;window.open(l,"_blank"),s(null)}catch(e){s(e.body?.message)}}let a=null!=t.paymentSource&&t.status===u$.__.COMPLETED,o=n?.invoiceLink,u=n?.refundInvoiceLinks;return t.hasInvoiceURL&&null==n?(0,p.jsxs)("div",{className:uK.It,children:[(0,p.jsx)(nr.Anchor,{onClick:()=>r(!1),children:V.intl.formatToPlainString(V.t.R0xzCN,{})}),t.hasRefundInvoiceURLs?(0,p.jsx)(nr.Anchor,{className:uK.oe,onClick:()=>r(!0),children:V.intl.formatToPlainString(V.t["3x6NGw"],{})}):null,null!=l&&""!==l&&(0,p.jsx)(iK.w,{type:"critical",message:l,role:"alert"})]}):t.hasInvoiceURL&&null!=n?(0,p.jsxs)("div",{className:uK.It,children:[(0,p.jsx)(nr.Anchor,{href:o,children:V.intl.formatToPlainString(V.t.R0xzCN,{})}),null!=u?u.map((e,t)=>(0,p.jsx)(nr.Anchor,{className:uK.oe,href:e,children:V.intl.formatToPlainString(V.t["3x6NGw"],{})},t)):null,null!=l&&""!==l&&(0,p.jsx)(iK.w,{type:"critical",message:l,role:"alert"})]}):a?(0,p.jsx)("div",{className:uK.It,children:(0,p.jsx)(nr.Anchor,{onClick:()=>{var e;e=t.paymentSource,uJ(t,e)},children:V.intl.formatToPlainString(V.t.onRIxS,{})})}):null}var u1=n(510022),u2=n(427262),u3=n(106799),u5=n(580630);let u4=e=>`https://${_.XlF}/hc/${e.toLowerCase()}/requests/new?ticket_form_id=360000118612`;function u6(e,t){return t===u$.Yr.DISCORD_ORB?(0,p.jsxs)("span",{className:uK.db,children:[(0,p.jsx)(u3.A,{customSize:16,shouldUseThemeColor:!0}),V.intl.formatToPlainString(V.t.YMor7k,{count:e})]}):(0,u5.$g)(e,t)}function u8(e){let{receipt:t,gameItem:n,locale:i,hasLinkedToApplication:l}=e,{analyticsLocations:s}=(0,ez.Ay)(tk.A.BILLING_SETTINGS_BILLING),{sku:r}=t,a=r?.application,o=n.gift_recipient;return n.status===uO.REDEEMED?null:n.status===uO.REFUNDED?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(uV.H,{className:uK.mW,children:V.intl.string(V.t["gIGB/A"])}),(0,p.jsx)("div",{className:uK.iL,children:null!=o?V.intl.format(V.t.Q1K9eg,{username:u2.Ay.getName(o)}):V.intl.format(V.t.IBtGwC,{applicationName:a?.name})})]}):n.status===uO.CLAIMED||n.status===uO.UNCLAIMED?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(uV.H,{className:uK.mW,children:V.intl.string(V.t["gIGB/A"])}),(0,p.jsx)("div",{className:uK.iL,children:null!=o?V.intl.format(V.t.vfUW65,{username:u2.Ay.getName(o)}):V.intl.string(V.t["18wIqp"])}),null==o&&(0,p.jsx)("div",{className:uK.TP,children:(0,p.jsx)(j.$,{variant:"primary",text:V.intl.string(V.t["jcSP+g"]),onClick:()=>(0,na.openUserSettings)(S.X.GIFT_PANEL)})})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(uV.H,{className:uK.mW,children:V.intl.string(V.t["gIGB/A"])}),(0,p.jsx)("div",{className:uK.iL,children:l?V.intl.format(V.t.DQQCAw,{applicationName:a?.name,skuName:r?.name}):V.intl.format(V.t.ED2BqF,{applicationName:a?.name,skuName:r?.name})}),(0,p.jsx)("div",{className:uK.TP,children:l?(0,p.jsx)(j.$,{variant:"primary",text:V.intl.string(V.t.zoztQA),onClick:()=>(0,oT.A)(u4(i))}):(0,p.jsx)(j.$,{variant:"primary",text:V.intl.string(V.t["jCqvk/"]),onClick:()=>{null!=r&&null!=a&&(td.default.track(_.HAw.PAYMENT_HISTORY_CONNECT_ACCOUNT_BUTTON_CLICKED,{sku_id:r.id,application_id:a.id,location_stack:s}),(0,u1.n)({sku:r,application:a,analyticsLocations:s}))}})})]})}var u7=n(933832),u9=n(789645);function de(e){let{refund:t,locale:n}=e,i=u4(n),l=t.eligible?u7.CheckmarkLargeIcon:u9.XSmallIcon;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(uV.H,{className:uK.mW,children:V.intl.string(V.t["n/27pr"])}),(0,p.jsxs)("div",{className:uK.iL,children:[(0,p.jsx)("div",{children:function(e,t){if(null==e.window)return e.policy===uj.IN_GAME_ITEM?V.intl.format(V.t["5lvoVS"],{supportURL:t}):V.intl.string(V.t.s9TZM1);let n=e.window.days;switch(e.policy){case uj.PREMIUM:return e.eligible?V.intl.format(V.t.EPYteX,{dateLimit:n,supportURL:t}):V.intl.formatToPlainString(V.t.dk7vyL,{dateLimit:n});case uj.GIFT:return e.eligible?V.intl.format(V.t["16eP/L"],{dateLimit:n,supportURL:t}):V.intl.formatToPlainString(V.t.owlOWc,{dateLimit:n});default:return e.eligible?V.intl.format(V.t["8uEuEe"],{dateLimit:n,supportURL:t}):V.intl.formatToPlainString(V.t.dt2jVC,{dateLimit:n})}}(t,i)}),t.policy!==uj.IN_GAME_ITEM&&(0,p.jsxs)("div",{className:uK.My,children:[(0,p.jsx)("div",{className:uK.Kf,children:null!=t.window&&(0,p.jsxs)("div",{className:uK._Z,children:[(0,p.jsx)(uV.H,{className:uK.ud,children:V.intl.string(V.t.H0RNz4)}),(0,p.jsxs)("div",{className:uK.z9,children:[(0,p.jsx)(l,{className:uK.xb,color:"currentColor"}),(0,p.jsx)("div",{children:V.intl.formatToPlainString(V.t["7dtXa/"],{daysSincePurchase:t.window.days_since_purchase})})]})]})}),(0,p.jsx)(nr.Anchor,{href:i,children:V.intl.string(V.t.re5nOB)})]})]})]})}var dt=n(679897);function dn(e){let{description:t,cost:n}=e;return(0,p.jsx)("li",{className:uK.mg,children:(0,p.jsxs)(lb.A,{justify:lb.A.Justify.BETWEEN,children:[(0,p.jsx)("div",{children:t}),(0,p.jsx)("div",{children:n})]})})}function di(e){let{value:t,copyText:n,copyFeedbackText:i}=e,[l,s]=x.useState(!1),[r,a]=x.useState(!1);return(0,p.jsx)(lg.m,{forceOpen:r,text:l?i:n,children:(0,p.jsx)(n4.D,{onMouseEnter:()=>{l&&s(!1)},onMouseLeave:()=>{a(!1)},onClick:function(){(0,uk.C)(t,()=>{a(!0),s(!0)})},children:(0,p.jsx)("div",{className:uK.l9,children:t})})})}function dl(e){let{paymentId:t}=e;return(0,p.jsx)("li",{className:uK.mg,children:(0,p.jsxs)("div",{className:uK.bx,children:[(0,p.jsx)("div",{children:V.intl.string(V.t["UQim+r"])}),(0,p.jsx)(di,{value:t,copyText:V.intl.string(V.t["Mdk9+A"]),copyFeedbackText:V.intl.string(V.t["7eIrA2"])})]})})}function ds(e){let{tag:t}=e;if(null==t)return null;let n=t===uv.REVERSED;return(0,p.jsxs)(n5.E,{variant:"footnote/semibold",color:"none",tag:"span",className:ic()(dt.XM,n?dt.aB:dt.EN),children:[t===uv.REVERSED&&V.intl.string(V.t.YQv9Li),t===uv.PARTIALLY_REFUNDED&&V.intl.string(V.t.lYbZzz),t===uv.REFUNDED&&V.intl.string(V.t.ZBb6NK)]})}function dr(e){let{payment:t,locale:n}=e,i=t.payment_source??(t.payment_gateway===u$.kM.APPLE_PARTNER?new oU.Pw({}):null);return null==i?null:(0,p.jsx)(o0.A,{paymentSource:i,locale:n,descriptionClassName:uK.iL,showLabels:!0,showPaymentSourceIcon:!0})}function da(e){let{receipt:t,locale:n}=e;return t.payments.length<=1?1===t.payments.length?(0,p.jsx)(dr,{payment:t.payments[0],locale:n}):null:(0,p.jsx)(q.B,{children:t.payments.map(e=>(0,p.jsxs)(lb.A,{justify:lb.A.Justify.BETWEEN,align:lb.A.Align.CENTER,children:[(0,p.jsx)(dr,{payment:e,locale:n}),(0,p.jsxs)(q.B,{direction:"horizontal",align:"center",gap:8,fullWidth:!1,children:[(0,p.jsx)(ds,{tag:e.tag}),(0,p.jsx)(n5.E,{variant:"body-md/normal",color:"text-subtle",children:u6(e.amount,t.currency)})]})]},e.id))})}function du(e){let{guildProduct:t,locale:n}=e;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{className:uK.ts}),t.delisted?(0,p.jsx)(iK.w,{type:"warning",message:V.intl.string(V.t["3AvulN"]),role:"none",action:{text:V.intl.string(V.t.zoztQA),onClick:()=>(0,oT.A)(u4(n))}}):null!=t.guild_id&&(0,p.jsx)(uQ,{guildId:t.guild_id,guildProductListingId:t.listing_id})]})}function dd(e){let{receipt:t,locale:n,hasLinkedToApplication:i}=e,{currency:l,guild_product:s,game_item:r,refund:a}=t;return(0,p.jsx)(n4.D,{onClick:e=>e.stopPropagation(),children:(0,p.jsxs)("div",{className:uK.WI,children:[(0,p.jsx)(uV.H,{className:uK.mW,children:V.intl.string(V.t.nyzoFb)}),(0,p.jsxs)("div",{className:ic()(uK.iL,uK.W),children:[(0,p.jsx)(da,{receipt:t,locale:n}),(0,p.jsxs)("ul",{children:[null!=t.subtotal&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(dn,{description:t.description,cost:u6(t.subtotal,l)}),(0,p.jsx)(dn,{description:V.intl.string(V.t.QgWXht),cost:u6(t.tax,l)})]}),(0,p.jsx)(dn,{description:V.intl.string(V.t.txajQG),cost:u6(t.total,l)}),t.amount_refunded>0&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(dn,{description:V.intl.string(V.t["A+I0AP"]),cost:u6(-t.amount_refunded,l)}),(0,p.jsx)(dn,{description:V.intl.string(V.t.xER6Wi),cost:u6(t.net,l)})]}),(0,p.jsx)(dl,{paymentId:t.id}),s?.guild_id!=null&&(0,p.jsx)(uq,{guildId:s.guild_id,guildProductListingId:s.listing_id})]})]}),null!=s&&(0,p.jsx)(du,{guildProduct:s,locale:n}),(0,p.jsx)(u0,{payment:t.receipt_payment}),null!=r&&(0,p.jsx)(u8,{receipt:t,gameItem:r,locale:n,hasLinkedToApplication:i}),null!=a&&(0,p.jsx)(de,{refund:a,locale:n})]})})}function dc(e){let{withGradient:t}=e;return t?(0,p.jsx)(uM.A,{size:24,iconSize:16,color:n1.A.unsafe_rawColors.NEUTRAL_1,className:uK.Sy}):(0,p.jsx)("div",{className:ic()(uK.Sy,uK.uX,uK.Xr),children:(0,p.jsx)(au.NitroWheelIcon,{size:"custom",width:16,height:16,color:n1.A.colors.ICON_DEFAULT})})}function dg(e){let{receipt:t}=e,n=t.sku?.application,i=(0,I.bG)([lv.A],()=>lv.A.getGuild(n?.guildId));switch(t.icon){case uy.NITRO:return(0,p.jsx)(dc,{withGradient:!0});case uy.NITRO_BASIC:return(0,p.jsx)(dc,{withGradient:!1});case uy.SHOP:return(0,p.jsx)(uL.ShopIcon,{size:"custom",width:23,height:23,color:"currentColor",className:uK.sV});case uy.APPLICATION:case uy.PRODUCT:return(0,p.jsx)(i7.A,{className:uK.Sy,guildClassName:uK.zA,game:t.icon===uy.APPLICATION?n:void 0,guild:i,size:i7.M.XSMALL,skuId:t.sku?.id})}}function dm(e){let{receipt:t,hasLinkedToApplication:n}=e,{game_item:i}=t;if(null!=i&&t.status===uC.PAID)switch(i.status){case uO.CLAIMED:return(0,p.jsx)("span",{className:uK.gD,children:V.intl.string(V.t.lIsIFo)});case uO.UNCLAIMED:return(0,p.jsx)("span",{className:uK.Tf,children:V.intl.string(V.t["+tqSi3"])});case uO.REDEEMED:return(0,p.jsx)("span",{className:uK.gD,children:V.intl.string(V.t.Osji1u)});case uO.FAILED:return(0,p.jsx)("span",{className:uK.ob,children:V.intl.string(V.t.Yo4ru6)});default:return n?(0,p.jsx)("span",{className:uK.Tf,children:V.intl.string(V.t.y7F0Re)}):(0,p.jsx)("span",{className:uK.Tf,children:V.intl.string(V.t.HHC5Z4)})}switch(t.status){case uC.PENDING:return(0,p.jsx)("span",{className:uK.oE,children:V.intl.string(V.t.y7F0Re)});case uC.FAILED:return(0,p.jsx)("span",{className:uK.ob,children:V.intl.string(V.t.Yo4ru6)});case uC.REVERSED:return(0,p.jsx)("span",{className:uK.ob,children:V.intl.string(V.t.YQv9Li)});case uC.CANCELED:return(0,p.jsx)("span",{className:uK.ob,children:V.intl.string(V.t.ttkBhy)});case uC.PARTIALLY_REFUNDED:return(0,p.jsx)("span",{className:uK.gD,children:V.intl.string(V.t.lYbZzz)});case uC.REFUNDED:return(0,p.jsx)("span",{className:uK.gD,children:V.intl.string(V.t.ZBb6NK)});case uC.PAID:return null}}function dA(e){let{receipt:t,locale:n,className:i}=e,[l,s]=x.useState(!1),{hasAlreadyLinked:r}=(0,uG.RD)(null!=t.game_item?t.sku?.application:void 0);return(0,p.jsx)(uc.tG,{id:t.id,children:e=>(0,p.jsxs)(n4.D,{onClick:()=>s(!l),"data-expanded":l,className:ic()(uK.Ji,i),focusProps:{offset:4},...e,children:[(0,p.jsxs)(lb.A,{className:uK.J7,align:lb.A.Align.CENTER,"data-expanded":l,children:[(0,p.jsx)(n5.E,{variant:"body-sm/normal",className:uK.p6,children:(0,iA.i$)(im()(t.created_at),"MM/DD/YYYY")}),(0,p.jsxs)("div",{className:uK.h_,children:[(0,p.jsx)(dg,{receipt:t}),(0,p.jsx)("div",{children:null!=t.subscription?function(e,t){let{paymentSource:n}=e.receipt_payment,i=null!=n&&_.AD1.has(n.type);switch(t.type){case _.rzx.PREMIUM:return t.plans.map(e=>{let{plan_id:t,quantity:n}=e;return(0,ax.xq)(t)?ax.Ay.getDisplayName(t,!1,i):`${n>1?`${n}x `:""}${ax.Ay.getDisplayName(t,!1,i)}`}).join(", ");case _.rzx.GUILD:if(null==t.plan_name)return null;return V.intl.formatToPlainString(t.interval===tJ.WT.YEAR?V.t.V6UFQM:V.t["6oq128"],{planName:t.plan_name});case _.rzx.APPLICATION:return e.sku?.application!=null?V.intl.formatToPlainString(V.t["0wL/VI"],{tier:e.sku.name}):V.intl.string(V.t["9czSYu"]);default:return null}}(t,t.subscription)??t.description:t.guild_product?.delisted===!0?V.intl.string(V.t.O7uLmw):t.description}),t.is_gift?(0,p.jsx)(lg.m,{text:V.intl.string(V.t.QddTpm),children:(0,p.jsx)(uP.GiftIcon,{size:"md",color:"currentColor",className:uK.ez})}):null]}),(0,p.jsxs)("div",{className:uK.vj,children:[(0,p.jsx)(dm,{receipt:t,hasLinkedToApplication:r}),(0,p.jsx)("span",{className:uK.q9,children:u6(t.net,t.currency)})]}),(0,p.jsx)(uU.A,{className:uK.fT,direction:l?uU.A.Directions.UP:uU.A.Directions.DOWN})]}),l?(0,p.jsx)(dd,{receipt:t,locale:n,hasLinkedToApplication:r}):null]})})}var dE=n(949779);function dh(e){let{receipts:t,locale:n,loadNextPage:i}=e,l=x.useRef(null),[s,r]=x.useState(0),a=Math.max(Math.ceil(t.length/10),1),o=t.slice(10*s,(s+1)*10);x.useEffect(()=>{l.current?.scrollTo({to:0})},[s]);let u=x.useCallback(e=>{r(e),e>=a-2&&i()},[a,i]),d=(0,um.A)("billing-history",l);return(0,p.jsx)(uc.hD,{navigator:d,children:(0,p.jsx)(uc.PR,{children:e=>{let{ref:t,...i}=e;return(0,p.jsx)(uh,{className:dE.GD,currentPageIndex:s,onChangePage:u,numPages:a,showPageCount:!1,ref:t,...i,children:(0,p.jsx)(ug.Ch,{className:dE.Bd,ref:l,overflow:"auto",children:o.map(e=>(0,p.jsx)(dA,{className:ic()(dE.Nj,dE.Bd),receipt:e,locale:n},e.id))})})}})})}function dS(e){let{subscription:t}=e;return tE()(null!=t.paymentGateway,"Expected payment gateway when rendering for external subscription"),(0,p.jsxs)(oB.Z,{className:dE.K1,children:[(0,p.jsx)("div",{className:dE.BF,children:V.intl.format(V.t["6mIX6s"],{paymentGatewayName:u$.qm[t.paymentGateway]})}),(0,p.jsx)("div",{className:dE.Q2,children:V.intl.format(V.t.eG0uZB,{paymentGatewayName:u$.qm[t.paymentGateway],billingHistoryLink:(0,ax.tW)(t.paymentGateway,"BILLING_HISTORY")})})]})}function dT(e){let{locale:t}=e,{receipts:n,hasFetched:i,hasFailed:l,loadNextPage:s}=function(){let[e,t]=x.useState(uD),[n,i]=x.useState(!1),[l,s]=x.useState(!1),[r,a]=x.useState(!1),o=x.useCallback((e,n)=>{tl.Bo.get({url:_.Rsh.BILLING_HISTORY,query:{before:e??void 0,limit:n},rejectWithError:!0}).then(n=>{let{body:i}=n,l=i.receipts.map(uR);t(t=>({receipts:null==e?l:[...t.receipts,...l],cursor:i.cursor}))}).catch(()=>{null==e&&s(!0)}).finally(()=>{i(!0),a(!1)})},[]);x.useEffect(()=>{o(null,30)},[o]);let u=x.useCallback(()=>{r||null==e.cursor||(a(!0),o(e.cursor,10))},[r,o,e.cursor]);return{receipts:e.receipts,hasFetched:n,hasFailed:l,loadNextPage:u}}(),r=(0,I.bG)([ul.A],()=>ul.A.getPremiumTypeSubscription()),a=null!=r&&r.isPurchasedExternally;return i?(0,p.jsxs)("div",{className:dE.GD,children:[null!=r&&a?(0,p.jsx)(dS,{subscription:r}):null,n.length>0?(0,p.jsxs)("div",{className:ic()(dE.PQ,dE.GD),children:[(0,p.jsx)("div",{className:ic()(dE.Nj,dE.Bd),children:(0,p.jsxs)(lb.A,{className:dE.Yi,children:[(0,p.jsx)("div",{className:uK.p6,children:V.intl.string(V.t["5t11BV"])}),(0,p.jsx)("div",{className:dE.Ir,children:V.intl.string(V.t.yAAPb2)}),(0,p.jsx)("div",{className:uK.vj,children:V.intl.string(V.t["6MqHXV"])})]})}),(0,p.jsx)(dh,{receipts:n,locale:t,loadNextPage:s})]}):l?(0,p.jsx)(n5.E,{variant:"body-sm/normal",color:"text-subtle",children:V.intl.string(V.t["fb3n+4"])}):a?null:(0,p.jsx)(n5.E,{variant:"body-sm/normal",color:"text-subtle",children:V.intl.string(V.t.GqvDkk)})]}):(0,p.jsx)(oj.y,{})}var df=n(500597);let dp=(0,h.E2)(S.X.BILLING_TRANSACTION_HISTORY,{Component:function(){let e=(0,I.bG)([us.default],()=>us.default.locale);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(df.kb,{}),(0,p.jsx)(dT,{locale:e})]})},useSearchTerms:()=>[V.intl.string(V.t.obLrcK)]}),dx=(0,h.zZ)(S.X.BILLING_TRANSACTION_HISTORY_CATEGORY,{useTitle:()=>V.intl.string(V.t.obLrcK),buildLayout:()=>[dp]}),dI=(0,h.t_)(S.X.BILLING_PANEL,{useTitle:()=>V.intl.string(V.t.oeUm2s),buildLayout:()=>[ud,dx],useObscuredNotice:oS.L}),d_=(0,h.i4)(S.X.BILLING_SIDEBAR_ITEM,{useTitle:()=>V.intl.string(V.t.oeUm2s),icon:oh.CreditCardIcon,buildLayout:()=>[dI]});var db=n(70283),dN=n(682618),dC=n(997101);let dy={[dC.d.US]:[{id:"walmart",name:"Walmart",url:"https://www.walmart.com/ip/Discord-25-Gift-Card-Digital/20844423221?classType=REGULAR&from=/search"},{id:"best_buy",name:"Best Buy\xae",url:"https://www.bestbuy.com/product/discord-25-gift-card-digital/JJG34YFV8K/sku/6685454"},{id:"target",name:"Target",url:"https://www.target.com/p/discord-gift-card-email-delivery/-/A-1013530846?preselect=1013327744"},{id:"gamestop",name:"GameStop",url:"https://www.gamestop.com/gift-cards/virtual-currency/products/discord-25-gift-card/448794.html"}],[dC.d.IT]:[{id:"gamelife",name:"Gamelife",url:"https://www.gamelife.it/cava0261-discord-25-eur-codice-di-attivazione?attribute_values=4"}],[dC.d.FR]:[{id:"micromania",name:"Micromania",url:"https://www.micromania.fr/p/carte-discord-25-euros-166241.html"}]},dv=[];function dj(e){return null==e?dv:dy[e]??dv}var dO=n(92202),dR=n(45052),dD=n(158476),dL=n(35587),dP=n(86379);let dG=(0,h.E2)(S.X.GIFT_BLOCKED_PAYMENTS_SETTING,{Component:df.uK,usePredicate:()=>(0,dP.Hp)(),useSearchTerms:()=>[V.intl.string(V.t.vwMEHS)]}),dM=(0,h.zZ)(S.X.GIFT_BLOCKED_PAYMENTS_CATEGORY,{buildLayout:()=>[dG]});var dU=n(704333),dV=n(414499),dk=n(31300);function dw(e){let{enabled:t}=(0,dO.K)({location:e}),n=(0,I.bG)([sE.default],()=>sE.default.getCurrentUser()?.storeCountry?.country);return t&&dj(n).length>0}var dF=n(178881);function dB(){return n.e(5660).then(n.bind(n,946647))}function dX(e){let{icon:t,children:n}=e;return(0,p.jsxs)(n5.E,{variant:"body-xs/normal",color:"text-default",className:dF.A,children:[(0,p.jsx)(t,{size:"xxs",color:"currentColor","aria-hidden":!0}),(0,p.jsx)("span",{children:n})]})}let dz=(0,h.zZ)(S.X.GIFT_CARDS_MARKETING_BANNER_CATEGORY,{buildLayout:()=>[dH],usePredicate:()=>dw("GiftInventoryMarketingBanner")}),dH=(0,h.E2)(S.X.GIFT_CARDS_MARKETING_BANNER,{Component:function(){let e=dw("GiftCardsGiftInventoryBanner"),t=(0,I.bG)([sE.default],()=>sE.default.getCurrentUser()?.storeCountry?.country),n=o_("gift_inventory_banner"),i=x.useMemo(()=>dj(t).map(e=>({text:e.name,onClick:()=>{n("retailer",{partner:e.id,url:e.url}),(0,oT.A)(e.url)}})),[t,n]),l=x.useCallback(()=>{n("billing_settings"),(0,na.openUserSettings)(S.X.BILLING_PANEL)},[n]),s=x.useCallback(()=>{n("learn_more",{url:ob.C}),(0,oT.A)(ob.C)},[n]);return e?(0,p.jsx)(oI,{surface:"gift_inventory_banner",size:"compact",title:V.intl.string(oN.default.Ja5Q8Z),graphicLottie:dB,actions:i,children:(0,p.jsxs)(q.B,{direction:"vertical",align:"start",gap:8,children:[(0,p.jsx)(dX,{icon:dU.ServerGridIcon,children:V.intl.string(oN.default["9xo1g9"])}),(0,p.jsx)(dX,{icon:dV.CloudIcon,children:V.intl.string(oN.default.I5UWh9)}),(0,p.jsx)(dX,{icon:uP.GiftIcon,children:V.intl.format(oN.default.ZuneBP,{onBillingSettingsClick:l})}),(0,p.jsx)(dX,{icon:dk.ScreenIcon,children:V.intl.format(oN.default.UwYHGm,{websiteUrl:s})})]})}):null},useSearchTerms:()=>[]});var dY=n(982240),dW=n(620301),dK=n(914410),dZ=n(339514),dq=n(573343);function dQ(e){let{tier:t,iconUrl:n,active:i=!1}=e;return(0,p.jsxs)("div",{className:ic()(dq.fO,{[dq.bF]:i}),children:[null!=n&&(0,p.jsx)("img",{src:n,alt:"",className:dq.si}),(0,p.jsxs)("div",{className:dq.tc,children:[(0,p.jsx)(n5.E,{variant:"body-sm/semibold",color:"text-subtle",children:t.name??""}),(0,p.jsx)(n5.E,{variant:"body-xs/normal",color:"text-muted",children:V.intl.format(dZ.default.qvx9E4,{count:(0,dY.rL)(t)})})]})]})}function dJ(e){let{tiers:t,currentTier:n}=e;return(0,p.jsx)("div",{className:dq.dw,children:t.map(e=>(0,p.jsx)(dQ,{tier:e,iconUrl:(0,dR.Se)(e),active:e.key===n?.key},e.key))})}function d$(e){let{analyticsLocation:t,location:n}=e,{analyticsLocations:i}=(0,ez.Ay)(tk.A.USER_SETTINGS_GIFT_INVENTORY),{openGiftModal:l}=(0,dW.$)({giftRecipient:void 0,analyticsLocations:i,analyticsObject:{object:_.ZSU.BUTTON_CTA,objectType:_.btD.GIFT},analyticsLocation:t,location:n});return(0,p.jsx)("div",{className:dq.NG,children:(0,p.jsx)(j.$,{variant:"primary",icon:uP.GiftIcon,text:V.intl.string(dZ.default.DZnomS),onClick:l})})}function d0(e){let t,{badgeProgress:n,currentTier:i,nextTier:l,giftsRemaining:s}=e,r=(0,dY.rL)(i),a=(0,dY.rL)(l),o=(0,dR.GZ)(n,i,l),u=(0,dR.Se)(i),d=(0,dR.Se)(l);return t=null!=l?V.intl.formatToPlainString(dZ.default.XTX3OO,{count:s,nextTier:l?.name??""}):V.intl.formatToPlainString(dZ.default.LnsdbK,{currentTier:i?.name??""}),(0,p.jsxs)("div",{className:dq.mY,children:[null!=u&&(0,p.jsx)("div",{className:dq.fC,children:(0,p.jsx)("img",{src:u,alt:"",className:dq.qS})}),(0,p.jsxs)("div",{className:dq.Qs,children:[(0,p.jsx)(n5.E,{variant:"body-md/medium",color:"text-strong",children:t}),(0,p.jsx)(dK.Ay,{variant:dK.qP.BLUE,weight:dK.fh.MEDIUM,progress:o}),(0,p.jsx)(n5.E,{variant:"body-xs/normal",color:"text-muted",className:dq.qg,children:V.intl.format(dZ.default.iIpfQe,{threshold:null!=l?a:r,count:null!=l?n:r})})]}),null!=d&&(0,p.jsx)("div",{className:dq.fC,children:(0,p.jsx)("img",{src:d,alt:"",className:dq.qS})})]})}function d1(e){let{analyticsLocation:t}=e,{badgeProgress:n,currentTier:i,nextTier:l,giftsRemaining:s,tiers:r}=(0,I.cf)([dY.Ay],()=>({badgeProgress:dY.Ay.getSingleRequirementProgress(db.$.GIFTING)?.current??0,currentTier:dY.Ay.getCurrentTier(db.$.GIFTING),nextTier:dY.Ay.getNextTier(db.$.GIFTING),giftsRemaining:dY.Ay.getRemainingToNextTier(db.$.GIFTING),tiers:dY.Ay.getBadgeById(db.$.GIFTING)?.tiers??[]}));return 0===r.length?null:(0,p.jsxs)("div",{className:dq.kL,children:[(0,p.jsxs)("div",{className:dq.Jo,children:[n>0&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(d0,{badgeProgress:n,currentTier:i,nextTier:l,giftsRemaining:s}),(0,p.jsx)("div",{className:dq.yF})]}),(0,p.jsx)(dJ,{tiers:r,currentTier:i}),(0,p.jsx)(n5.E,{variant:"body-xs/normal",color:"text-muted",className:dq.PJ,children:V.intl.string(dZ.default["4Yp0mI"])})]}),(0,p.jsx)(d$,{analyticsLocation:t,location:"UserSettingsGiftingBadgeProgress"})]})}let d2=(0,h.zZ)(S.X.GIFTING_BADGE_CATEGORY,{useTitle:()=>V.intl.string(dZ.default.sFokBp),buildLayout:()=>[d3],usePredicate:()=>{let e=(0,dR.F5)("gift_inventory"),t=(0,I.bG)([dY.Ay],()=>dY.Ay.getBadgeById(db.$.GIFTING));return e&&null!=t}}),d3=(0,h.E2)(S.X.GIFTING_BADGE_CONTENT,{useSearchTerms:()=>[V.intl.string(dZ.default.sFokBp)],Component:()=>(0,p.jsx)(d1,{})});var d5=n(264779),d4=n(412260),d6=n(555393),d8=n(725807),d7=n(212168),d9=n(976860),ce=n(469778),ct=n(45938),cn=n(109802),ci=n(869038),cl=n(380856);function cs(e){let{children:t,className:n,splashArtURL:i}=e;return(0,p.jsxs)(lb.A,{className:ic()(cl.wx,n),align:lb.A.Align.CENTER,children:[(0,p.jsx)("div",{className:cl.Bn,style:null!=i?{backgroundImage:`url(${i})`}:void 0}),t]})}function cr(e){let{children:t,className:n}=e;return(0,p.jsx)("div",{className:ic()(cl.rf,n),children:t})}class ca extends x.PureComponent{static Header=cs;static Body=cr;render(){let{children:e,className:t,onMouseEnter:n,onMouseLeave:i}=this.props;return(0,p.jsx)("div",{className:ic()(cl.Nr,t),onMouseEnter:n,onMouseLeave:i,children:e})}}var co=n(446263),cu=n(871123),cd=n(366523),cc=n(46653),cg=n(30793),cm=n(97352),cA=n(67480),cE=n(615396),ch=n(274904);class cS extends x.PureComponent{_copyModeTimeout=new rX.Ep;state={copyMode:cn.q.DEFAULT};componentWillUnmount(){this._copyModeTimeout.stop()}get copyButtonText(){switch(this.state.copyMode){case cn.q.SUCCESS:return V.intl.string(V.t.XVvPjU);case cn.q.ERROR:return V.intl.string(V.t.i4GM3L);default:return V.intl.string(V.t.OpuAlK)}}handleRevoke(e){ci.Ay.revokeGiftCode(e)}handleCopy=e=>{let{giftCode:t,sku:n}=this.props;(0,ct.AK)(t,n),(0,uk.C)(e,()=>this.setState({copyMode:cn.q.SUCCESS}),()=>this.setState({copyMode:cn.q.ERROR})),this._copyModeTimeout.start(1e3,()=>{this.setState({copyMode:cn.q.DEFAULT})})};render(){let{hideCode:e,giftCode:t}=this.props,{copyMode:n}=this.state;return(0,p.jsxs)(lb.A,{direction:lb.A.Direction.VERTICAL,className:ch.Gj,children:[(0,p.jsx)(cn.e,{className:ch.ph,value:(0,ct.Zq)(t.code),text:this.copyButtonText,mode:n,supportsCopy:uk.p5,hideMessage:e?V.intl.string(V.t["0RLn47"]):null,onCopy:this.handleCopy,buttonColor:s2.XD.BRAND,buttonLook:s2.pR.FILLED}),(0,p.jsxs)("div",{className:ch.KB,children:[null!=t.expiresAt?(0,p.jsxs)(x.Fragment,{children:[V.intl.format(V.t.ltVZcJ,{hours:t.expiresAt.diff(im()(),"h")}),(0,p.jsx)(x.Fragment,{children:" \u2014\xa0"})]}):null,(0,p.jsx)(n4.D,{tag:"a",onClick:()=>this.handleRevoke(t.code),children:V.intl.string(V.t.v6Yazx)})]})]})}}class cT extends x.PureComponent{_loadedAt=null;state={isOpen:!1,isCreating:!1,isHovered:!1};componentDidMount(){this._loadedAt=Date.now()}handleGenerateGiftCode=async e=>{e.stopPropagation();let{skuId:t,subscriptionPlanId:n,giftStyle:i}=this.props;this.setState({isCreating:!0}),await ci.Ay.createGiftCode(t,n,i),this.setState({isCreating:!1,isOpen:!0})};handleToggleOpen=()=>{let{skuId:e,subscriptionPlanId:t,loadedAt:n}=this.props,i=!this.state.isOpen;(null==n||null==this._loadedAt||n<this._loadedAt)&&i&&ci.Ay.fetchUserGiftCodesForSKU(e,t),this.setState({isOpen:!this.state.isOpen})};renderGiftIcon(){let{sku:e,giftStyle:t,application:n}=this.props;return(0,cu.bF)(e)?(0,p.jsx)(cd.e,{shape:"square",sku:e,containerClassName:ch.ez}):null!=t?(0,p.jsx)(co.A,{giftStyle:t,className:ch.ez,shouldAnimate:this.state.isHovered}):(0,p.jsx)(i7.A,{game:n,size:i7.M.MEDIUM,skuId:e.id})}renderSubtitle(){let{sku:e,entitlements:t,application:n}=this.props;return(0,cu.bF)(e)?(0,p.jsxs)("div",{className:ic()(ch.Oc,ch.ic),children:[(0,p.jsx)(i7.A,{game:n,size:i7.M.XSMALL,skuId:e.id,className:ch._u}),V.intl.format(V.t["6plpZi"],{applicationName:n.name,copies:t.length})]}):(0,p.jsx)("div",{className:ch.Oc,children:V.intl.format(V.t.zMcvcA,{copies:t.length})})}renderTitle(){let e,{sku:t,subscriptionPlan:n,giftCodeBatchId:i}=this.props;return e=i===tJ.FB?V.intl.string(V.t.odsU6W):i===tJ.Bu&&null!=n?V.intl.formatToPlainString(n.interval===tJ.WT.MONTH?V.t.uZjpiJ:V.t.bJW1EA,{skuName:t.name,intervalCount:n.intervalCount}):null==n?t.name:V.intl.formatToPlainString(n.interval===tJ.WT.MONTH?V.t.rCJvqo:V.t.Vd3Iu8,{skuName:t.name,intervalCount:n.intervalCount}),(0,p.jsx)("div",{className:ch.mO,children:e})}renderGenerateGiftCodeRow(){return(0,p.jsxs)(lb.A,{justify:lb.A.Justify.BETWEEN,align:lb.A.Align.CENTER,className:ch.pe,children:[(0,p.jsx)(n5.E,{variant:"body-md/normal",children:V.intl.string(V.t.lELyPj)}),(0,p.jsx)(j.$,{variant:"primary",size:"sm",text:V.intl.string(V.t.Q3Qguo),loading:this.state.isCreating,onClick:this.handleGenerateGiftCode})]})}setIsHovered(e){this.setState({isHovered:e})}render(){let{entitlements:e,application:t,giftCodes:n,className:i,sku:l,isFetching:s,hideCodes:r}=this.props,{isOpen:a}=this.state;return(0,p.jsxs)(ca,{className:i,children:[(0,p.jsx)(n4.D,{onClick:this.handleToggleOpen,className:ch.Nr,onMouseEnter:()=>this.setIsHovered(!0),onMouseLeave:()=>this.setIsHovered(!1),children:(0,p.jsx)(ca.Header,{splashArtURL:t.getSplashURL(512),children:(0,p.jsxs)("div",{className:ch.MY,children:[(0,p.jsxs)(lb.A,{align:lb.A.Align.CENTER,children:[this.renderGiftIcon(),(0,p.jsxs)("div",{className:ch.TK,children:[this.renderTitle(),this.renderSubtitle()]})]}),(0,p.jsx)(uU.A,{direction:a?uU.A.Directions.UP:uU.A.Directions.DOWN,className:ch.eO})]})})}),a?(0,p.jsx)(ca.Body,{children:s?(0,p.jsx)(oj.y,{className:ch.u1}):(0,p.jsxs)(x.Fragment,{children:[n.length<e.length?this.renderGenerateGiftCodeRow():null,n.map(e=>(0,p.jsx)(cS,{giftCode:e,sku:l,hideCode:r},e.code))]})}):null]})}}let cf=I.Ay.connectStores([cA.A,tu.A,cg.A,i2.A,cm.A,cc.default],e=>{let{skuId:t,subscriptionPlanId:n,giftStyle:i}=e,l=cA.A.get(t);if(null==l)throw Error("SKU was unavailable while rendering gift.");let s=cg.A.getForGifterSKUAndPlan(cc.default.getId(),t,n).filter(e=>!e.isClaimed).filter(e=>e.giftStyle===i);return{sku:l,hideCodes:tu.A.enabled,isFetching:cg.A.getUserGiftCodesFetchingForSKUAndPlan(t,n),loadedAt:cg.A.getUserGiftCodesLoadedAtForSKUAndPlan(t,n),application:i2.A.getApplication(l.applicationId),subscriptionPlan:null!=n?(0,cE.c9)(n):null,giftCodes:s}})(cT);var cp=n(725570),cx=n(736653),cI=n(46054);let c_=im().duration(30,"days");var cb=n(416052),cN=n(878309);function cC(e){let{onClose:t,transitionState:n}=e;return(0,p.jsx)(lT.a,{title:"",size:"md",input:(0,p.jsx)("div",{className:cN.aR}),onClose:async()=>await t(),actions:[{text:V.intl.string(V.t.cpT0Cq),variant:"primary",onClick:t}],transitionState:n,children:(0,p.jsxs)("div",{className:cN.t4,children:[(0,p.jsx)(N.D,{variant:"heading-xl/semibold",children:V.intl.string(V.t.iufib1)}),(0,p.jsx)(n5.E,{variant:"body-md/normal",className:cN.G3,children:V.intl.string(V.t.eAn6z2)})]})})}let cy=function(e){let{onClose:t,onClaim:n,code:i,outboundPromotion:l,transitionState:s}=e,[r,a]=x.useState(null),o=(0,tK.GV)(),{analyticsLocations:u}=(0,ez.Ay)(tk.A.USER_SETTINGS_GIFT_INVENTORY);return(x.useEffect(()=>{null==i&&(0,d5.kd)({promotionId:l.id,promotionTitle:l.outboundTitle,partnerId:l.partnerId,analyticsLocations:u}).then(e=>n(e)).catch(e=>a(e?.body?.code))},[i,l.id,l.outboundTitle,l.partnerId,n,u]),null!=r)?(0,p.jsx)(cC,{onClose:t,transitionState:s}):null==i?(0,p.jsx)(oj.y,{className:cN.Lq}):(0,p.jsx)(lT.a,{title:"",size:"md",onClose:async()=>await t(),input:(0,p.jsxs)("div",{className:cN.N1,children:[(0,p.jsx)("div",{className:cN.Qw}),(0,p.jsx)(N.D,{variant:"heading-xl/semibold",children:V.intl.string(V.t["23BfZh"])}),(0,p.jsx)(n5.E,{variant:"body-md/normal",className:cN.G3,children:l.outboundRedemptionModalBody})]}),actions:[{text:V.intl.string(V.t.TulDPl),variant:"secondary",onClick:async()=>await t()},{text:V.intl.string(V.t["+zx47d"]),variant:"primary",onClick:()=>{let e=(0,d5.kc)(i,l);window.open(e,"_blank")}}],transitionState:s,"aria-label":o,children:(0,p.jsxs)("div",{children:[(0,p.jsx)(ls.c,{className:cN.M5}),(0,p.jsx)(lu.D,{label:V.intl.string(V.t.s9LFQh),helperText:V.intl.string(V.t["F+nFTZ"]),children:(0,p.jsx)(cb.A,{value:i,buttonColor:s2.$n.Colors.BRAND,buttonLook:s2.$n.Looks.FILLED,delay:1e3})})]})})};var cv=n(136380);function cj(e){let t,{outboundPromotion:n,code:i}=e,[l,s]=x.useState(!1),[r,a]=x.useState(!1);function o(){return s(e=>!e)}let u=(0,cx.Ay)(),d=(0,d5.WD)(n.id,u),c=null!=i,g=x.useMemo(()=>(0,iA.i$)(c?null!=n.outboundRedemptionEndDate?im()(n.outboundRedemptionEndDate):im()(n.endDate).add(c_):im()(n.endDate),"LL"),[n,c]);c&&l?t=V.intl.format(V.t.pkxVx6,{endDate:g,onClickDetails:o}):c&&!l?t=V.intl.format(V.t["4sFeob"],{endDate:g,onClickDetails:o}):!c&&l?t=V.intl.format(V.t["RBnE+l"],{endDate:g,onClickDetails:o}):c||l||(t=V.intl.format(V.t["57+7Qn"],{endDate:g,onClickDetails:o}));let m=c?V.intl.string(V.t["2cHUti"]):V.intl.string(V.t.O13yhz),A=(0,d6.N)()?.isEligible===!0,E=x.useCallback(()=>a(!1),[]),{outboundTitle:h,outboundTermsAndConditions:S}=n;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:cv.AX,children:[(0,p.jsxs)("div",{className:cv.gE,children:[(0,p.jsxs)("div",{className:cv.At,children:[(0,p.jsx)("div",{className:cv.$G,children:(0,p.jsx)("img",{alt:"",src:d,className:cv.IJ})}),(0,p.jsxs)("div",{children:[(0,p.jsx)(N.D,{variant:"heading-sm/semibold",children:h}),(0,p.jsx)(n5.E,{variant:"body-sm/normal",color:"text-default",children:t})]})]}),(c||A)&&(0,p.jsx)(j.$,{text:m,onClick:()=>a(!0),size:"sm"})]}),l&&(0,p.jsx)(n5.E,{className:cv.GL,variant:"body-xs/normal",color:"text-default",children:cI.A.parse(S,!1,{allowLinks:!0})})]}),r&&(0,p.jsx)(cp.aF,{renderModal:e=>(0,p.jsx)(cy,{...e,onClose:E,onClaim:dD.Ay.addClaimedOutboundPromotionCode,code:i,outboundPromotion:n}),onCloseRequest:E})]})}function cO(e){let{redesign:t=!1}=e,n=(0,I.yK)([ce.A],()=>ce.A.getGiftable()).filter(e=>{let{giftCodeBatchId:t}=e;return null!=t}),i=(0,d6.N)()?.isEligible??null,{activeOutboundPromotions:l,claimedEndedOutboundPromotions:s,claimedOutboundPromotionCodeMap:r}=(0,dL.y7)(),a=n.find(e=>e.giftCodeBatchId===tJ.FB&&!e.consumed),o=n.filter(e=>e.giftCodeBatchId===tJ.Bu&&!e.consumed)??[],[u,d]=K().partition(o,e=>{let{subscriptionPlanId:t}=e;return t===tJ.gD.PREMIUM_YEAR_TIER_2}),c=l.length+s.length>0,g=t||!c?null:(0,p.jsxs)("div",{className:cv.N1,children:[(0,p.jsx)(N.D,{variant:"heading-sm/semibold",children:V.intl.string(V.t.wFsj3B)}),(0,p.jsx)(ls.c,{className:cv.yF})]}),m=!1===i&&c?(0,p.jsxs)("div",{className:cv.uo,children:[(0,p.jsx)(au.NitroWheelIcon,{size:"md",color:n1.A.colors.REDESIGN_BUTTON_PREMIUM_PRIMARY_PURPLE_FOR_GRADIENT_2,className:cv.PC}),(0,p.jsx)(n5.E,{variant:"body-md/normal",className:cv.Qw,children:V.intl.format(V.t.G4fwxK,{onClick:()=>{(0,tH.default)(),(0,d9.pX)(_.BVt.APPLICATION_STORE)}})}),(0,p.jsx)(d8.A,{showGradient:!0,className:cv.aA,subscriptionTier:tJ.pe.TIER_2,textOptions:{textOverride:V.intl.string(V.t.mr4K7D)}})]}):null;return(0,p.jsxs)("div",{children:[g,(0,p.jsx)(d7.A,{className:cv.Yj,isShown:!1===i&&c,type:d7.i.PREMIUM,hasBackground:!0,children:(0,p.jsxs)("div",{className:cv.DE,children:[m,s.map(e=>{let{code:t,promotion:n}=e;return(0,p.jsx)(cj,{outboundPromotion:n,code:t},n.id)}),l.map(e=>(0,p.jsx)(cj,{outboundPromotion:e,code:r[e.id]},e.id)),null!=a?(0,p.jsx)(cf,{skuId:a.skuId,subscriptionPlanId:a.subscriptionPlanId,entitlements:[a],giftCodeBatchId:tJ.FB},(0,ct.Kx)(a.skuId,a.subscriptionPlanId)):null,u.length>0?(0,p.jsx)(cf,{skuId:u[0].skuId,subscriptionPlanId:u[0].subscriptionPlanId,entitlements:u,giftCodeBatchId:tJ.Bu},(0,ct.Kx)(u[0].skuId,u[0].subscriptionPlanId)):null,d.length>0?(0,p.jsx)(cf,{skuId:d[0].skuId,subscriptionPlanId:d[0].subscriptionPlanId,entitlements:d,giftCodeBatchId:tJ.Bu},(0,ct.Kx)(d[0].skuId,d[0].subscriptionPlanId)):null]})})]})}let cR=(0,h.zZ)(S.X.MY_GIFTS_CATEGORY,{useTitle:cL,buildLayout:()=>[cD],usePredicate:()=>{let{claimedOutboundPromotionCodes:e,claimedOutboundPromotionCodesLoaded:t}=(0,I.cf)([d4.A],()=>({claimedOutboundPromotionCodes:d4.A.claimedOutboundPromotionCodes,claimedOutboundPromotionCodesLoaded:d4.A.claimedOutboundPromotionCodesLoaded})),n=(0,dL.T1)({includeClaimedPromotions:!0}),i=(0,d5.Wl)(e,n).length;return t&&n.length+i>0}}),cD=(0,h.E2)(S.X.MY_GIFTS_CONTENT,{useSearchTerms:()=>[cL()],Component:()=>(0,p.jsx)(cO,{redesign:!0})});function cL(){return V.intl.string(V.t.YzjdWJ)}var cP=n(339048),cG=((o={}).GIFT_INVENTORY="gift_inventory",o),cM=n(183636),cU=n(739508);function cV(){var e,t;let n,i,l=(0,I.yK)([ce.A],()=>ce.A.getGiftable()).filter(e=>{let{giftCodeBatchId:t}=e;return null==t}),s=K().groupBy(l,e=>(0,ct.Kx)(e.skuId,e.subscriptionPlanId,e.giftStyle)),[r,a]=x.useState(!1);if(x.useEffect(()=>{(0,cP.XJ)().then(()=>a(!0))},[]),e=cG.GIFT_INVENTORY,t=!r,n=x.useRef(null),i=x.useRef(!1),x.useEffect(()=>{if(i.current)return;if(!t){i.current=!0;return}n.current??=performance.now();let l=setTimeout(()=>{i.current=!0,"focused"===cM.A.getState()&&(0,cU.pM)(Error(`${e} load timed out`),{tags:{...void 0,source:"smag_screen_load",billing_context:function(e){if("gift_inventory"===e)return"gifting"}(e),surface:e}})},Math.max(0,1e4-(performance.now()-n.current)));return()=>clearTimeout(l)},[e,t,void 0]),!r)return(0,p.jsx)(oj.y,{className:cv.Lq});if(0===Object.keys(s).length)return(0,p.jsxs)("div",{className:cv.p$,children:[(0,p.jsx)(uV.H,{className:cv.ks,children:V.intl.string(V.t.B1qgZn)}),(0,p.jsx)("p",{className:cv.WO,children:V.intl.format(V.t.HezvJ8,{onClick:function(){(0,na.openUserSettings)(S.X.NITRO_PANEL)}})})]});let o=K().keys(s).map(e=>{let{skuId:t,subscriptionPlanId:n,giftStyle:i}=(0,ct.X6)(e);return(0,p.jsx)(cf,{skuId:t,subscriptionPlanId:n,entitlements:s[e],giftStyle:i},e)});return(0,p.jsx)(q.B,{gap:"lg",children:o})}let ck=(0,h.zZ)(S.X.PURCHASED_GIFTS_CATEGORY,{useTitle:cF,buildLayout:()=>[cw]}),cw=(0,h.E2)(S.X.PURCHASED_GIFTS_CONTENT,{useSearchTerms:()=>[cF()],Component:()=>(0,p.jsx)(cV,{})});function cF(){return V.intl.string(V.t.FWe6CP)}var cB=n(532446),cX=n(499454);class cz extends x.Component{state={codeInput:"",submitting:!1,hasError:!1,isPromoCode:!1};get analyticsLocation(){let{analyticsContext:{location:e}}=this.props;return{...e,object:_.ZSU.BUTTON_CTA}}handleChange=e=>{this.setState({codeInput:e,hasError:!1})};handleSubmit=async e=>{e.preventDefault();let{codeInput:t}=this.state;if(""===t)return;let n=t.trim();this.setState({submitting:!0});try{if(this.props.acceptGiftCardRedemption)try{await (0,oM.Qp)(n),(0,oM.HF)({initialCode:n,withRedemptionSuccessModal:!0,source:"user_settings_gift_code_redemption",loadId:(0,oO.A)()}),this.setState({codeInput:""});return}catch{}let e=(0,ct.Vd)(t);if(null==e)return void this.setState({hasError:!0});let i=await ci.Ay.resolveGiftCode(e);if(null!=i&&null!=i.giftCode.promotion)throw this.setState({isPromoCode:!0}),Error("Cannnot redeem promotion code as gift");td.default.track(_.HAw.OPEN_MODAL,{type:"gift_accept",location:{...this.analyticsLocation,section:_.JJy.LIBRARY_INVENTORY_CODE_REDEMPTION,object:_.ZSU.BUTTON_CTA}}),(0,cX.h)({processedCode:e}),this.setState({codeInput:""})}catch(e){this.setState({hasError:!0})}finally{this.setState({submitting:!1})}};render(){let{redesign:e,obscureInput:t}=this.props,{codeInput:n,submitting:i,hasError:l,isPromoCode:s}=this.state,r=e?V.intl.string(V.t["hVEn/j"]):V.intl.string(V.t.SeKIoS),a=e?V.intl.string(V.t.epHMtp):void 0;return(0,p.jsx)(n3.n,{label:e?void 0:V.intl.string(V.t["il+VCo"]),children:(0,p.jsx)("form",{onSubmit:this.handleSubmit,children:(0,p.jsxs)(cB.M,{children:[(0,p.jsx)(lp.k,{label:r,description:a,type:t?"password":"text",value:n,onChange:this.handleChange,placeholder:"WUMP-AAAAA-BBBBB-CCCCC",error:!s&&l?V.intl.string(V.t.Y11a2u):null,helperText:s?V.intl.format(V.t.gPt3PE,{promoLink:()=>{window.open(`https://discord.com/billing/promotions/${n}`)}}):null,fullWidth:!0}),(0,p.jsx)(j.$,{variant:"primary",text:V.intl.string(V.t.KIpp7M),type:"submit",loading:i,disabled:e&&0===n.length})]})})})}}function cH(e){let{redesign:t=!1}=e,{enabled:n}=(0,un.c)({location:"UserSettingsBilling"}),i=x.useContext(td.Ig),l=(0,I.bG)([tu.A],()=>tu.A.enabled);return(0,p.jsx)(cz,{analyticsContext:i,obscureInput:l,acceptGiftCardRedemption:n,redesign:t})}let cY=(0,h.zZ)(S.X.REDEEM_GIFT_CATEGORY,{useTitle:()=>V.intl.string(V.t["il+VCo"]),buildLayout:()=>[cW],usePredicate:()=>!(0,dP.Hp)()}),cW=(0,h.E2)(S.X.REDEEM_CODE_INPUT,{Component:()=>(0,p.jsx)(cH,{redesign:!0}),useSearchTerms:()=>[V.intl.string(V.t["jcSP+g"]),V.intl.string(V.t["il+VCo"])]}),cK=(0,h.t_)(S.X.GIFT_PANEL,{useTitle:()=>V.intl.string(V.t["jcSP+g"]),buildLayout:()=>[dz,cY,cR,d2,ck,dM],initialize:()=>{dD.Ay.fetchClaimedOutboundPromotionCodes(),(0,dR.Ig)("gift_inventory")&&(0,dN.o0)(db.$.GIFTING)}}),cZ=(0,h.i4)(S.X.GIFT_SIDEBAR_ITEM,{useTitle:()=>V.intl.string(V.t["jcSP+g"]),icon:uP.GiftIcon,usePersistentBadge:function(){let e=(0,dL.IO)().length;return x.useMemo(()=>({badgeType:f.Xi.COUNT,count:e}),[e])},getDismissibleBadges:()=>{let e={location:"UserSettingsGiftInventory"},t=un.A.getConfig(e).enabled,n=dO.A.getConfig(e).enabled,i=dj(sE.default.getCurrentUser()?.storeCountry?.country).length>0;return t&&n&&i?[{badgeType:f.Xi.NEW,dismissibleContent:eE.M.GIFT_INVENTORY_SETTINGS_NEW_BADGE}]:[]},buildLayout:()=>[cK]});var cq=n(659758),cQ=n(839667),cJ=n(877624),c$=n(831259),c0=n(462887),c1=n(43990),c2=n(73825),c3=n(531260),c5=n(160946),c4=n(721668),c6=n(224016),c8=n(526292),c7=n(881489),c9=n(300349),ge=n(106512),gt=n(175020),gn=n(403227),gi=n(812537),gl=n(103411),gs=n(190187),gr=n(930861),ga=n(854627),go=n(619019),gu=n(326084),gd=n(851746),gc=n(664654),gg=n(610709),gm=n(912140),gA=n(953727);let gE=e=>{let{className:t,backgroundColor:n,backgroundCircleSize:i,...l}=e;return(0,p.jsxs)("svg",{width:"100%",height:"100%",viewBox:"0 0 100 100",fill:"none",style:{overflow:"visible"},xmlns:"http://www.w3.org/2000/svg",...(0,gA.A)({...l}),children:[(0,p.jsx)("circle",{r:i??"40%",cx:"50%",cy:"50%",className:n}),(0,p.jsxs)("g",{transform:"translate(50, 50) scale(0.6) translate(-51, -52)",children:[(0,p.jsx)("path",{d:"M52.0002 11.7556L28.3402 35.4156V68.6956L52.0002 92.3556L75.6602 68.6956V35.4156L52.0002 11.7556ZM63.8302 63.7556L52.0002 75.6289L40.1702 63.7989V40.3122L52.0002 28.4822L63.8302 40.3122V63.7556Z",fill:"#FF6BFA",className:t}),(0,p.jsx)("path",{d:"M40.1702 40.3122V63.7989L52.0002 75.6289L63.8302 63.7989V40.3122L52.0002 28.4822L40.1702 40.3122Z",fill:"#FFDEF9"}),(0,p.jsx)("path",{d:"M52.0002 11.7556V28.4822L63.8302 40.3122L75.6602 35.4156L52.0002 11.7556Z",fill:"#FFB0FF"})]})]})},gh=e=>{let{ellipseOpacity:t,circleColor:n,...i}=e,l=(0,cx.Ay)(),s=(0,c0.q)(l),r=null!=n?n:s?"url(#paint0_linear_1055_83268)":"url(#paint0_linear_1282_11557)";return(0,p.jsxs)("svg",{style:{overflow:"visible"},width:"80%",height:"80%",viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",...(0,gA.A)({...i}),children:[(0,p.jsxs)("svg",{width:"100",height:"100",viewBox:"0 0 114 114",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,p.jsxs)("defs",{children:[(0,p.jsxs)("linearGradient",{id:"purple-gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,p.jsx)("stop",{offset:"0%",style:{stopColor:"#E2C7FA",stopOpacity:1}}),(0,p.jsx)("stop",{offset:"100%",style:{stopColor:"#F3D3DE",stopOpacity:1}})]}),(0,p.jsxs)("linearGradient",{id:"dark-purple-gradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[(0,p.jsx)("stop",{offset:"0%",style:{stopColor:"rgb(36,23,49)",stopOpacity:1}}),(0,p.jsx)("stop",{offset:"100%",style:{stopColor:"rgb(36,23,49)",stopOpacity:1}})]})]}),(0,p.jsx)("ellipse",{cx:"57.2768",cy:"57.0796",rx:"56.3726",ry:"56.3726",fill:null!=n?n:r,fillOpacity:null!=t?t:s?.5:.2}),(0,p.jsxs)("g",{width:"65",transform:"translate(50, 50) scale(.7) translate(-10, -39)",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,p.jsx)("path",{d:"M42.0084 14.8866L33.7687 17.7832C33.3446 17.9281 32.9766 18.2015 32.7161 18.565C32.4555 18.9285 32.3154 19.3641 32.3154 19.8109C32.3154 20.2576 32.4555 20.6932 32.7161 21.0567C32.9766 21.4203 33.3446 21.6936 33.7687 21.8385L42.0084 24.7351C42.3147 24.8404 42.593 25.0138 42.8221 25.2422C43.0512 25.4705 43.2252 25.7478 43.3309 26.053L46.2373 34.2649C46.3827 34.6875 46.657 35.0543 47.0217 35.3139C47.3865 35.5736 47.8236 35.7132 48.2718 35.7132C48.7201 35.7132 49.1572 35.5736 49.522 35.3139C49.8867 35.0543 50.161 34.6875 50.3064 34.2649L53.2128 26.053C53.3204 25.7488 53.495 25.4725 53.7239 25.2444C53.9528 25.0164 54.23 24.8423 54.5353 24.7351L62.7896 21.8385C63.2136 21.6936 63.5817 21.4203 63.8422 21.0567C64.1028 20.6932 64.2428 20.2576 64.2428 19.8109C64.2428 19.3641 64.1028 18.9285 63.8422 18.565C63.5817 18.2015 63.2136 17.9281 62.7896 17.7832L54.5353 14.8866C54.2315 14.7767 53.9557 14.6018 53.7272 14.374C53.4987 14.1463 53.3231 13.8714 53.2128 13.5687L50.3064 5.34234C50.161 4.91974 49.8867 4.55297 49.522 4.2933C49.1572 4.03363 48.7201 3.89404 48.2718 3.89404C47.8236 3.89404 47.3865 4.03363 47.0217 4.2933C46.657 4.55297 46.3827 4.91974 46.2373 5.34234L43.3309 13.5687C43.2233 13.8729 43.0487 14.1492 42.8198 14.3773C42.591 14.6054 42.3137 14.7794 42.0084 14.8866Z",fill:"white",fillOpacity:s?"0.6":"0.4"}),(0,p.jsx)("path",{d:"M34.0878 3.57968L33.0393 0.634802C32.9888 0.483384 32.8917 0.351665 32.7618 0.258321C32.6319 0.164978 32.4759 0.114746 32.3158 0.114746C32.1556 0.114746 31.9996 0.164978 31.8697 0.258321C31.7398 0.351665 31.6427 0.483384 31.5922 0.634802L30.6217 3.57968C30.5838 3.68745 30.5221 3.78534 30.4411 3.86607C30.3601 3.94681 30.2619 4.00831 30.1538 4.04602L27.1555 5.02189C27.0067 5.07415 26.8777 5.17117 26.7865 5.29956C26.6953 5.42795 26.6464 5.58137 26.6464 5.73868C26.6464 5.89598 26.6953 6.04941 26.7865 6.17779C26.8777 6.30618 27.0067 6.4032 27.1555 6.45547L30.0758 7.47451C30.1839 7.51222 30.2821 7.57373 30.3631 7.65446C30.4441 7.7352 30.5059 7.83308 30.5437 7.94085L31.5575 10.8426C31.6081 10.994 31.7052 11.1257 31.835 11.219C31.9649 11.3124 32.121 11.3626 32.2811 11.3626C32.4412 11.3626 32.5973 11.3124 32.7271 11.219C32.857 11.1257 32.9541 10.994 33.0047 10.8426L34.0878 7.94085C34.1257 7.83308 34.1874 7.7352 34.2684 7.65446C34.3494 7.57373 34.4476 7.51222 34.5558 7.47451L37.476 6.45547C37.6249 6.4032 37.7538 6.30618 37.845 6.17779C37.9362 6.04941 37.9852 5.89598 37.9852 5.73868C37.9852 5.58137 37.9362 5.42795 37.845 5.29956C37.7538 5.17117 37.6249 5.07415 37.476 5.02189L34.5211 4.00284C34.4237 3.9656 34.3349 3.90883 34.2604 3.83604C34.1859 3.76326 34.1271 3.676 34.0878 3.57968Z",fill:"white",fillOpacity:"0.8"})]})]}),(0,p.jsxs)("defs",{children:[(0,p.jsxs)("filter",{id:"filter0_d_1282_11577",x:"-6.55945",y:"0.382812",width:"89.2926",height:"70.3945",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,p.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,p.jsx)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),(0,p.jsx)("feOffset",{dy:"4"}),(0,p.jsx)("feGaussianBlur",{stdDeviation:"5"}),(0,p.jsx)("feComposite",{in2:"hardAlpha",operator:"out"}),(0,p.jsx)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),(0,p.jsx)("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_1282_11577"}),(0,p.jsx)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_1282_11577",result:"shape"})]}),(0,p.jsxs)("linearGradient",{id:"paint0_linear_1282_11577",x1:"3.44055",y1:"31.5801",x2:"72.7332",y2:"31.5801",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#B473F5"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E292AA"})]}),(0,p.jsxs)("linearGradient",{id:"paint2_linear_1986_8686",x1:"3.44073",y1:"43.8345",x2:"72.7334",y2:"43.8345",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#B473F5"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E292AA"})]}),(0,p.jsxs)("linearGradient",{id:"paint1_linear_1282_11577",x1:"3.44055",y1:"31.5801",x2:"72.7332",y2:"31.5801",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#B473F5"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E292AA"})]}),(0,p.jsxs)("linearGradient",{id:"paint1_linear_1986_8686",x1:"3.44073",y1:"43.8345",x2:"72.7334",y2:"43.8345",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#B473F5"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E292AA"})]}),(0,p.jsxs)("linearGradient",{id:"paint2_linear_1282_11577",x1:"3.44055",y1:"31.5801",x2:"72.7332",y2:"31.5801",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#B473F5"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E292AA"})]}),(0,p.jsxs)("linearGradient",{id:"paint0_linear_1986_8686",x1:"3.44073",y1:"43.8345",x2:"72.7334",y2:"43.8345",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#B473F5"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E292AA"})]}),(0,p.jsxs)("linearGradient",{id:"paint0_linear_1282_11557",x1:"0.904297",y1:"56.5004",x2:"113.649",y2:"56.5004",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#B473F5"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E292AA"})]}),(0,p.jsxs)("linearGradient",{id:"paint0_linear_684_72736",x1:"0.904236",y1:"57.0796",x2:"113.649",y2:"57.0796",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#B473F5"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E292AA"})]}),(0,p.jsxs)("linearGradient",{id:"paint0_linear_1055_83179",x1:"0.904236",y1:"56.5005",x2:"113.649",y2:"56.5005",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#B473F5"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E292AA"})]}),(0,p.jsxs)("linearGradient",{id:"paint0_linear_1055_83268",x1:"0.904236",y1:"57.2461",x2:"113.649",y2:"57.2461",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#B473F5"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E292AA"})]})]}),(0,p.jsxs)("g",{filter:s?void 0:"url(#filter0_d_1282_11577)",transform:"translate(50, 50) scale(.8) translate(-44, -30)",children:[(0,p.jsx)("path",{d:"M47.5359 37.8795C51.0149 37.8795 53.8352 35.0592 53.8352 31.5801C53.8352 28.1011 51.0149 25.2808 47.5359 25.2808C44.0568 25.2808 41.2365 28.1011 41.2365 31.5801C41.2365 35.0592 44.0568 37.8795 47.5359 37.8795Z",fill:s?"url(#paint2_linear_1986_8686)":"url(#paint0_linear_1282_11577)"}),(0,p.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.3385 6.38281C20.599 6.38281 19.1889 7.79297 19.1889 9.53248C19.1889 11.272 20.599 12.6821 22.3385 12.6821H31.7875C33.527 12.6821 34.9372 14.0923 34.9372 15.8318C34.9372 17.5713 33.527 18.9815 31.7875 18.9815L17.614 18.9815C15.8745 18.9815 14.4644 20.3916 14.4644 22.1311C14.4644 23.8706 15.8745 25.2808 17.614 25.2808L25.4882 25.2808C27.2277 25.2808 28.6379 26.691 28.6379 28.4305C28.6379 30.17 27.2277 31.5801 25.4882 31.5801H19.1889C17.4494 31.5801 16.0392 32.9903 16.0392 34.7298C16.0392 36.4693 17.4494 37.8795 19.1889 37.8795H23.1324C25.9295 48.7472 35.7949 56.7774 47.5359 56.7774C61.4519 56.7774 72.7332 45.4962 72.7332 31.5801C72.7332 17.664 61.4519 6.38281 47.5359 6.38281H22.3385ZM47.5359 44.1788C54.4939 44.1788 60.1345 38.5382 60.1345 31.5801C60.1345 24.6221 54.4939 18.9815 47.5359 18.9815C40.5778 18.9815 34.9372 24.6221 34.9372 31.5801C34.9372 38.5382 40.5778 44.1788 47.5359 44.1788Z",fill:s?"url(#paint1_linear_1986_8686)":"url(#paint1_linear_1282_11577)"}),(0,p.jsx)("path",{d:"M8.16505 25.2808C9.90456 25.2808 11.3147 23.8706 11.3147 22.1311C11.3147 20.3916 9.90456 18.9815 8.16505 18.9815H6.59022C4.8507 18.9815 3.44055 20.3916 3.44055 22.1311C3.44055 23.8706 4.8507 25.2808 6.59022 25.2808H8.16505Z",fill:s?"url(#paint0_linear_1986_8686)":"url(#paint2_linear_1282_11577)"})]}),(0,p.jsx)("g",{width:"65",transform:"translate(50, 50) scale(0.81) translate(-26, -42)",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,p.jsx)("path",{d:"M12.6686 60.7298L10.9101 55.7911C10.8254 55.5372 10.6626 55.3163 10.4448 55.1597C10.227 55.0032 9.96524 54.9189 9.69671 54.9189C9.42818 54.9189 9.16646 55.0032 8.94866 55.1597C8.73086 55.3163 8.56804 55.5372 8.48326 55.7911L6.85565 60.7298C6.7922 60.9105 6.6887 61.0747 6.55284 61.2101C6.41699 61.3455 6.25226 61.4487 6.07091 61.5119L1.04275 63.1485C0.793091 63.2361 0.576874 63.3988 0.423928 63.6141C0.270981 63.8294 0.188843 64.0868 0.188843 64.3506C0.188843 64.6144 0.270981 64.8717 0.423928 65.087C0.576874 65.3023 0.793091 65.465 1.04275 65.5527L5.94012 67.2616C6.12147 67.3249 6.2862 67.428 6.42205 67.5634C6.55791 67.6988 6.66141 67.863 6.72486 68.0437L8.42513 72.91C8.50991 73.1639 8.67273 73.3848 8.89053 73.5414C9.10833 73.6979 9.37005 73.7822 9.63858 73.7822C9.90711 73.7822 10.1688 73.6979 10.3866 73.5414C10.6044 73.3848 10.7672 73.1639 10.852 72.91L12.6686 68.0437C12.732 67.863 12.8355 67.6988 12.9714 67.5634C13.1072 67.428 13.2719 67.3249 13.4533 67.2616L18.3507 65.5527C18.6003 65.465 18.8165 65.3023 18.9695 65.087C19.1224 64.8717 19.2046 64.6144 19.2046 64.3506C19.2046 64.0868 19.1224 63.8294 18.9695 63.6141C18.8165 63.3988 18.6003 63.2361 18.3507 63.1485L13.3952 61.4395C13.2318 61.377 13.083 61.2818 12.958 61.1598C12.833 61.0377 12.7345 60.8914 12.6686 60.7298Z",fill:"white",fillOpacity:"0.8"})})]})};var gS=n(387316),gT=((u={})[u.NITRO_GEM=0]="NITRO_GEM",u[u.NITRO_LOGO=1]="NITRO_LOGO",u[u.AVATAR_DECO=2]="AVATAR_DECO",u);let gf="url(#gradient)",gp=e=>{let{percentage:t=0,children:n,animationClassName:i,initialPercentage:l=0,progressCircleStrokeSize:s=2,progressCircleVariation:r,progressCircleStroke:a}=e,o=43+s/2,u=2*Math.PI*o,[d,c]=x.useState(l);x.useEffect(()=>{let e=setTimeout(()=>{c(t)},200);return()=>clearTimeout(e)},[t]);let g=(0,cx.Ay)(),m=(0,c0.q)(g),A=function(e){switch(e){case 0:case 2:return"var(--background-base-low)";case 1:return"var(--premium-tier-2-purple)";default:return}}(r),E=1===r?m?"0.3":"0.2":void 0,h=a??function(e,t){switch(t){case 0:case 2:return gf;case 1:return e?"url(#gradient_nitro_logo)":gf;default:return}}(m,r);return(0,p.jsxs)("div",{className:gS.Ap,children:[(0,p.jsxs)("svg",{viewBox:"0 0 100 100",className:gS.fB,children:[(0,p.jsx)("circle",{className:0===r||2===r?gS.F3:void 0,fill:"transparent",strokeWidth:s,r:`${o}`,cx:"50%",cy:"50%",stroke:A,strokeOpacity:E}),(0,p.jsx)("circle",{stroke:h,strokeWidth:s,strokeLinecap:"round",strokeDasharray:`${u} ${u}`,className:i,style:{strokeDashoffset:(1-d/100)*u},r:`${o}`,cx:"50%",cy:"50%"})]}),(0,p.jsxs)("svg",{width:"0",height:"0",children:[(0,p.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,p.jsx)("stop",{offset:"0%",style:{stopColor:"#FFBDF2"}}),(0,p.jsx)("stop",{offset:"100%",style:{stopColor:"#E742E1"}})]}),(0,p.jsxs)("linearGradient",{id:"gradient_nitro_logo",x1:"2.99995",y1:"67.6298",x2:"132.55",y2:"67.6298",gradientUnits:"userSpaceOnUse",children:[(0,p.jsx)("stop",{stopColor:"#F9A0E8"}),(0,p.jsx)("stop",{offset:"1",stopColor:"#E742E1"})]}),(0,p.jsxs)("linearGradient",{id:"dark-purple-gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,p.jsx)("stop",{offset:"0%",style:{stopColor:"#241731",stopOpacity:1}}),(0,p.jsx)("stop",{offset:"100%",style:{stopColor:"#241731",stopOpacity:1}})]})]}),(0,p.jsx)("div",{className:gS.Vw,children:n})]})};var gx=n(104773);function gI(e){let{avatarDecorationLegacyAssetId:t,avatarDecorationSkuId:n,avatarDecoAssetDescription:i}=e,l=x.useMemo(()=>(0,gm.A)({legacyAssetId:t,skuId:n,size:v._3.SIZE_120,canAnimate:!1}),[t,n]);return(0,p.jsx)("div",{className:gx.Q7,children:(0,p.jsx)("div",{className:gx.Nk,children:null!=l&&(0,p.jsx)("img",{className:gx.CH,alt:i,src:l})})})}let g_=function(e){let{showAnimations:t=!0,iconClassName:n,staticPercentage:i,innerCircleClassName:l,progressCircleStrokeSize:s,backgroundCircleSize:r,percentage:a,initialPercentage:o,progressCircleVariation:u=gT.NITRO_GEM,avatarDecorationLegacyAssetId:d,avatarDecorationSkuId:c,avatarDecoAssetDescription:g,ellipseOpacity:m,customAnimationClassName:A,circleColor:E,circleStroke:h}=e,S=(0,I.bG)([O.Ay],()=>O.Ay.useReducedMotion),T=t&&!S;return(0,p.jsx)("div",{className:ic()(gx.G3,n),children:(0,p.jsx)(gp,{animationClassName:ic()(gx._0,{[gx.uJ]:T,[A??""]:T}),progressCircleStroke:h,progressCircleStrokeSize:s,percentage:i??a,initialPercentage:i??o,progressCircleVariation:u,children:function(){switch(u){case gT.NITRO_GEM:return(0,p.jsx)(gE,{className:T?gx.Ow:void 0,backgroundColor:ic()(gx.vH,l),backgroundCircleSize:r});case gT.NITRO_LOGO:return(0,p.jsx)(gh,{circleColor:E,ellipseOpacity:m});case gT.AVATAR_DECO:if(null!=c)return(0,p.jsx)(gI,{avatarDecorationLegacyAssetId:d,avatarDecorationSkuId:c,avatarDecoAssetDescription:g});return null;default:return null}}()})})};function gb(e){let{hasSentAll:t}=e;return V.intl.string(V.t.USo4s7)}function gN(e){let{helpdeskArticle:t,referralsStatuses:n}=e;return function(e){let{hasSentAll:t,hasSentAtLeastOne:n,helpdeskArticle:i}=e;return t?V.intl.format(V.t["TYu+MH"],{helpdeskArticle:i}):V.intl.format(V.t["omMr+V"],{helpdeskArticle:i})}({hasSentAll:n.sent>=3,hasSentAtLeastOne:n.sent>=1,helpdeskArticle:t})}var gC=n(14313);function gy(e){let{userRecord:t,placement:n}=e,{avatarSrc:i,eventHandlers:l}=(0,ga.A)({userId:t?.id,size:v._3.SIZE_32,animateOnHover:!0}),s=null!=t,r=s?(0,p.jsx)(y.eu,{src:i,"aria-label":t.username,size:v._3.SIZE_32,...l}):(0,p.jsx)(N.D,{variant:"heading-sm/semibold",className:gC.n5,children:n});return(0,p.jsx)(lg.m,{text:V.intl.string(V.t.UnKHdo),shouldShow:!s,children:(0,p.jsx)("div",{className:gC.Lg,children:r})})}function gv(e){let{numSentReferrals:t,placement:n}=e;return(0,p.jsxs)("div",{className:gC.Ip,children:[(0,p.jsx)("div",{className:gC.Ej}),(0,p.jsx)("div",{className:ic()({[gC.ch]:t>n,[gC.q_]:t===n})})]})}function gj(e){let{userRecords:t}=e,n=t.length,i=n<1?null:t[0],l=n<2?null:t[1],s=n<3?null:t[2];return(0,p.jsxs)("div",{className:gC.ZM,children:[(0,p.jsx)(gy,{userRecord:i,placement:1}),(0,p.jsx)(gv,{numSentReferrals:n,placement:1}),(0,p.jsx)(gy,{userRecord:l,placement:2}),(0,p.jsx)(gv,{numSentReferrals:n,placement:2}),(0,p.jsx)(gy,{userRecord:s,placement:3})]})}function gO(e){let{analyticsLocations:t}=e;td.default.track(_.HAw.REFERRAL_PROGRAM_SHARE_MODAL_CTA_CLICKED,{location_stack:t}),(0,lf.mM)(async()=>{let{default:e}=await Promise.all([n.e(647658),n.e(228304)]).then(n.bind(n,581846));return n=>(0,p.jsx)(e,{...n,sourceAnalyticsLocations:t})})}let gR=function(e){let{variant:t="default"}=e,n=(0,I.bG)([gd.A],()=>gd.A.getRecipientStatus()),{referralSentUsers:i}=(0,gc.J)(),l=x.useMemo(()=>i.map(e=>new go.A(e)),[i]),s={redeemed:0,converted:0,sent:n.size};n.forEach(e=>{e===gu.aK.REDEEMED&&s.redeemed++,e===gu.aK.CONVERTED&&(s.redeemed++,s.converted++)});let r=3===s.sent,a=eC.A.getArticleURL(_.MVz.REFERRAL_PROGRAM),{analyticsLocations:o}=(0,ez.Ay)(tk.A.PREMIUM_MARKETING_REFERALL_PROGRAM_PROGRESS_BAR),u=x.useRef(null),d=s.sent/3*100;if("settings"===t)return(0,p.jsx)(ez.f5,{value:o,children:(0,p.jsxs)("div",{className:gC.W0,children:[(0,p.jsx)("div",{className:gC.xh,children:(0,p.jsx)(gg.fx,{nReferralsSent:s.sent,imageSize:56})}),(0,p.jsxs)("div",{className:gC.z1,children:[(0,p.jsx)(N.D,{variant:"heading-lg/semibold",children:gb({hasSentAll:r})}),(0,p.jsx)(n5.E,{variant:"body-sm/normal",children:gN({helpdeskArticle:a,referralsStatuses:s})}),(0,p.jsx)(gg.ZP,{referralSentUsers:l,className:gC.D1})]}),(0,p.jsx)(j.$,{variant:"expressive",text:V.intl.string(r?V.t.SY9tyI:V.t.Lm2nFc),onClick:()=>gO({analyticsLocations:o})})]})});let c=(0,p.jsxs)("div",{className:gC.hE,children:[(0,p.jsx)(g_,{percentage:d,progressCircleVariation:gT.NITRO_LOGO,iconClassName:gC.ER}),(0,p.jsxs)("div",{className:gC.Ns,children:[(0,p.jsx)(N.D,{variant:"heading-xl/semibold",className:gC.R0,children:gb({hasSentAll:r})}),(0,p.jsx)(gj,{userRecords:l}),(0,p.jsx)(n5.E,{variant:"body-sm/normal",children:gN({helpdeskArticle:a,referralsStatuses:s})}),(0,p.jsx)("div",{className:gC.Fb,children:(0,p.jsx)(gr.wL,{"data-migration-pending":!0,className:gC.r$,color:s2.XD.CUSTOM,onClick:()=>gO({analyticsLocations:o}),onlyShineOnHover:!0,children:(0,p.jsxs)("div",{className:gC.Zn,children:[(0,p.jsx)("img",{src:"/assets/3b9b1649f78941df.svg",alt:"",className:gC.QH}),r?V.intl.string(V.t.SY9tyI):V.intl.string(V.t.Lm2nFc)]})})})]})]}),g=3===s.redeemed;return(0,p.jsx)(ez.f5,{value:o,children:(0,p.jsx)("div",{className:ic()(gC.kL,{[gC.AP]:g}),children:(0,p.jsx)("div",{ref:u,className:ic()(gC.d_,{[gC.kS]:g}),children:c})})})};var gD=n(194509),gL=n(465794),gP=n(774774),gG=n(156601),gM=n(543213),gU=n(88001),gV=n(107198),gk=n(487518),gw=n(956537),gF=n(185062);let gB="to_premium_home_button",gX="premium home page";function gz(e){let{premiumSubscription:t,isDiscountApplied:n,activeDiscountInfo:i,theme:l}=e,{enabled:s}=c9.A.useConfig({location:"PremiumManagementSettings"}),r=t.hasActiveTrial,a=t.planIdFromItems===tJ.gD.PREMIUM_YEAR_TIER_2,o=t.hasAnyPremiumGroup,u=(0,c3.A)(),d=null!=t.trialEndsAt?im()(t.trialEndsAt).diff(im()(),"d"):0,c=tJ.hd[t.planIdFromItems],g=ax.Ay.getDefaultPrice(c.id),m=ax.Ay.formatPriceString(g,c.interval);if(n||r){let e=(0,c0.M)(l)?gP.at.PREMIUM_TIER_2_WHITE_FILL:gP.at.PREMIUM_TIER_2_OLD_GRADIENT_FILL;return(0,p.jsxs)(p.Fragment,{children:[!r&&(a||o)?(0,p.jsx)(gP.e4,{text:V.intl.string(V.t.EyjDRE),className:gk.LW,colorOptions:e}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(gP.HU,{text:r?V.intl.string(V.t.qYKftX):V.intl.string(V.t.EyjDRE),className:gk.uS,colorOptions:e}),(0,p.jsx)("div",{className:gk.on})]}),(0,p.jsx)(N.D,{variant:"heading-sm/medium",color:"text-overlay-light",className:gk.KB,children:function(){if(r)return V.intl.format(V.t["2CGBri"],{remainingTime:d,price:m});if(o&&null!=i&&t.metadata?.active_discount_expires_at!=null){let e=(0,u5.$g)(g.amount,g.currency);return V.intl.format(gV.default.FwjZzr,{percent:i?.percentage??0,discountEndDate:new Date(t.metadata.active_discount_expires_at),regularPrice:e})}return a?V.intl.format(V.t.z2oQtA,{percent:i?.percentage??20,regularPrice:m,renewalDate:ax.Ay.getExpectedRenewalDate(t,u)}):V.intl.formatToPlainString(V.t["3ZiutU"],{percent:i?.percentage??30,regularPrice:m,numMonths:i?.duration??1})}()})]})}return(0,p.jsx)(gG.A,{variant:s?"body-sm/medium":void 0,className:s?gk.rf:void 0,subscriptionTier:tJ.pe.TIER_2,interval:c.interval})}function gH(){let{enabled:e}=c9.A.useConfig({location:"PremiumManagementSettings"}),t=(0,c8.k5)(),n=(0,c8.nf)(),i=(0,cx.Ay)(),l=(0,I.bG)([ul.A],()=>ul.A.getPremiumTypeSubscription()),s=(0,I.bG)([sE.default],()=>sE.default.getCurrentUser()),r=s?.isPremiumWithPremiumGroup(),a=(0,c3.A)(),o=(0,c7.ds)(),u=null!==l&&null!==l.planIdFromItems;if(!u&&!a.isFractionalPremiumActive&&!r)return null;let d=a.isFractionalPremiumActive,c=null!==l&&l.hasActiveTrial,g=(0,p.jsx)(gM.ZP,{featureSet:s?.isPremiumGroupPrimary()?gM.Nz.PREMIUM_GROUP_PRIMARY:s?.isPremiumGroupMember()?gM.Nz.PREMIUM_GROUP_MEMBER:d?gM.Nz.FRACTIONAL_PREMIUM:gM.Nz.DEFAULT,enablePremiumBrandRefresh:e,textVariant:e?"body-sm/medium":void 0});return(0,p.jsxs)("div",{className:ic()(gk.$Y,{[gk.J5]:t||c,[gk.gd]:e}),children:[(0,p.jsxs)("div",{className:gk.jp,children:[r?(0,p.jsx)(N.D,{variant:"nitro-md",color:"text-overlay-light",className:gk._K,children:(0,gU.DP)()}):(0,p.jsx)(c6.A,{className:gk.TJ}),r&&!t?(0,p.jsx)("div",{style:{marginBottom:"6px"}}):d&&!o?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(gP.e4,{text:V.intl.string(V.t.uXF4c4),className:gk.LW,colorOptions:gP.at.PREMIUM_TIER_2_OLD_GRADIENT_FILL}),(0,p.jsx)(N.D,{variant:"heading-sm/medium",color:"text-overlay-light",className:gk.sQ,children:V.intl.format(V.t.sK7fGl,{helpCenterLink:eC.A.getArticleURL(_.MVz.FRACTIONAL_PREMIUM_ABOUT)})})]}):u?(0,p.jsx)(gz,{premiumSubscription:l,isDiscountApplied:t,activeDiscountInfo:n,theme:i}):o?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(gP.HU,{text:V.intl.string(V.t.qYKftX),className:gk.uS,colorOptions:(0,c0.M)(i)?gP.at.PREMIUM_TIER_2_WHITE_FILL:gP.at.PREMIUM_TIER_2_OLD_GRADIENT_FILL}),(0,p.jsx)(N.D,{variant:"heading-sm/medium",color:"text-overlay-light",className:gk.KB,children:V.intl.format(V.t["/SfHwl"],{weeks:1})})]}):null,e?(0,p.jsx)(q.B,{direction:"vertical",gap:12,className:gk.bY,children:g}):g,d&&!u?(0,p.jsxs)(s5.e,{fullWidth:!e,direction:e?"horizontal":"vertical",padding:{top:e?32:16},children:[(0,p.jsx)(gL.A,{defaultTextOverride:o?V.intl.string(V.t.YScQSF):V.intl.string(V.t["0b3YRn"])}),(0,p.jsx)(j.$,{onClick:()=>{td.default.track(_.HAw.PREMIUM_SETTINGS_INTERACTED,{cta_type:gB,target:gX}),(0,tH.default)(),(0,d9.pX)(_.BVt.APPLICATION_STORE)},variant:e?"secondary":"overlay-secondary",fullWidth:!e,size:"md",text:o?V.intl.string(V.t.VR2iVB):V.intl.string(V.t.T1aUAX)})]}):(0,p.jsxs)(s5.e,{fullWidth:!e,direction:e?"horizontal":"vertical",padding:{top:e?32:16},children:[(0,p.jsx)(j.$,{variant:"overlay-primary",fullWidth:!e,onClick:()=>{td.default.track(_.HAw.PREMIUM_SETTINGS_INTERACTED,{cta_type:gB,target:gX}),(0,tH.default)(),(0,d9.pX)(_.BVt.APPLICATION_STORE)},text:V.intl.string(e?V.t.rVjt5j:V.t.VR2iVB),size:"md"}),(0,p.jsx)(j.$,{variant:e?"secondary":"overlay-secondary",onClick:()=>{td.default.track(_.HAw.PREMIUM_SETTINGS_INTERACTED,{cta_type:"to_subscriptions_button",target:"subscriptions settings"}),(0,na.openUserSettings)(S.X.SUBSCRIPTIONS_PANEL)},text:V.intl.string(e?V.t.FVEaqm:V.t["9uDy6C"]),fullWidth:!e,size:"md"})]})]}),(0,p.jsx)("div",{className:gk.ah,children:(0,p.jsx)("img",{className:gk.ah,alt:"",src:e?gF.A:"/assets/3aaa2c2d1874c196.svg"})})]})}function gY(){let{enabled:e}=c9.A.useConfig({location:"PremiumManagementSettings"});function t(){td.default.track(_.HAw.PREMIUM_SETTINGS_INTERACTED,{cta_type:"gifting_button",target:"payment modal"})}return e?(0,p.jsx)(gt.A,{variant:"settings",location:tk.A.PREMIUM_SETTINGS,analyticsLocation:{},onGiftClick:t}):(0,p.jsxs)("div",{className:gk.T1,children:[(0,p.jsx)("img",{className:gk.GY,alt:"",src:gw}),(0,p.jsxs)("div",{className:gk.b4,children:[(0,p.jsx)(N.D,{className:gk.Vz,variant:"heading-xl/semibold",children:V.intl.string(V.t["3KomGa"])}),(0,p.jsx)(n5.E,{className:gk.Oi,variant:"body-sm/normal",children:V.intl.string(V.t.yQ06u1)}),(0,p.jsx)(gD.A,{className:ic()(gk.Tp,gk._c),textOptions:{textOverride:V.intl.string(V.t.Ve9Ge6),textClassName:gk.VV},color:s2.$n.Colors.CUSTOM,onClick:t})]})]})}function gW(e){let{premiumSubscription:t,giftPromotion:n,showReferral:i}=e,{enabled:l}=c9.A.useConfig({location:"PremiumManagementSettings"}),{analyticsLocations:s}=(0,ez.Ay)(),r=x.useRef(null),[a,o]=x.useState(!1),u=!!t?.hasActiveTrial,d=l?(0,p.jsx)(c1.N,{theme:_.NJ8.DARK,children:e=>(0,p.jsx)("div",{className:e,children:(0,p.jsx)(gH,{})})}):(0,p.jsx)(gH,{});return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(q.B,{direction:"vertical",gap:l?24:40,className:l?gk.W0:void 0,children:[n,d,i&&(0,p.jsx)(gR,{variant:l?"settings":"default"}),null==n&&(0,p.jsx)(gY,{}),l?(0,p.jsx)(gi.A,{variant:"settings",className:gk.hM,headingOverride:V.intl.string(V.t.dnVvQS),hidePill:!u,selectedPlanTier:tJ.PremiumTypes.TIER_2}):(0,p.jsx)(gn.A,{hideCTAs:!0,headingOverride:V.intl.string(V.t.dnVvQS),hidePill:!u,selectedPlanColumnClassName:gk.JG,selectedPlanTier:tJ.PremiumTypes.TIER_2})]}),(0,p.jsx)(c$.L,{innerRef:r,onChange:e=>{e&&!a&&(td.default.track(_.HAw.PREMIUM_MARKETING_SURFACE_REACHED_BOTTOM,{location_stack:s}),o(!0))},children:(0,p.jsx)("div",{ref:r,className:gk._Z})})]})}let gK=function(){let e=(0,dP.Hp)(),{analyticsLocations:t}=(0,ez.Ay)(tk.A.PREMIUM_SETTINGS),n=(0,I.bG)([sE.default],()=>sE.default.getCurrentUser()),i=(0,I.bG)([ul.A],()=>ul.A.getPremiumTypeSubscription()),l=(0,I.bG)([ul.A],()=>ul.A.hasFetchedSubscriptions()),s=(0,c5.Y)(tJ.T7),[r,a]=x.useState(!0),o=(0,c3.A)({forceFetch:!0}),u=(0,I.bG)([d4.A],()=>{let e=d4.A.getMarketingComponentByType(cJ.C.BILLING_SETTINGS_NITRO_GIFT_BANNER);return null==e||"billingSettingsNitroGiftBanner"!==e.properties.properties.oneofKind?null:e.properties.properties.billingSettingsNitroGiftBanner}),d=!(oF.Fr||oF.v1)&&null!=u;(0,gs.i)();let c=(0,gl.m)();if(x.useEffect(()=>{!async function(){e||await Promise.all([oG.hP(),oG.$o(),(0,c2.zS)(null,null,_.tF5.DISCOVERY)]),a(!1)}()},[e]),e)return(0,p.jsx)(df.uK,{});let g=l&&null!==i&&s,m=o.fetched&&o.isFractionalPremiumActive,A=n?.isPremiumWithPremiumGroup();return g||m||r||A?null!=n&&(g||m||A)&&!r?(0,p.jsx)(ez.f5,{value:t,children:(0,p.jsx)(gW,{premiumSubscription:i,giftPromotion:d?(0,p.jsx)(ge.m,{config:u}):null,showReferral:c})}):(0,p.jsx)(oj.y,{}):(0,p.jsx)(c4.A,{title:V.intl.string(V.t.dyq9TR),note:null})},gZ=(0,h.E2)(S.X.NITRO_SETTING,{Component:function(){let e=(0,I.bG)([sE.default],()=>sE.default.getCurrentUser());return(0,ax.YE)(e,tJ.PremiumTypes.TIER_2)?(0,p.jsx)(gK,{}):(0,p.jsx)(cQ.A,{})},useSearchTerms:()=>[V.intl.string(V.t.Ipxkog)]}),gq=(0,h.zZ)(S.X.NITRO_CATEGORY,{buildLayout:()=>[gZ]}),gQ=(0,h.t_)(S.X.NITRO_PANEL,{useTitle:()=>V.intl.string(V.t.Ipxkog),useObscuredNotice:oS.L,buildLayout:()=>[gq]}),gJ=(0,h.i4)(S.X.NITRO_SIDEBAR_ITEM,{useTitle:()=>V.intl.string(V.t.Ipxkog),icon:au.NitroWheelIcon,usePersistentBadge:function(e){let t=(0,cq.e)(e);return x.useMemo(()=>({badgeType:f.Xi.STRONGLY_DISCOURAGED_CUSTOM,customBadge:t}),[t])},buildLayout:()=>[gQ]});var g$=n(104510),g0=n(559201),g1=n(859241),g2=n(527113),g3=n(338548),g5=n(504047),g4=n(711014),g6=n(178368),g8=n(809545),g7=n(168482);function g9(){return(0,p.jsxs)("div",{className:g8.iE,children:[(0,p.jsx)("img",{className:g8.Kk,alt:"",src:g7}),(0,p.jsxs)("div",{className:g8.pq,children:[(0,p.jsx)(n5.E,{variant:"body-lg/semibold",children:V.intl.string(V.t.ZHNSYf)}),(0,p.jsx)(n5.E,{variant:"body-sm/medium",color:"text-muted",children:V.intl.string(V.t.kCj5ps)})]}),(0,p.jsx)(j.$,{variant:"secondary",text:V.intl.string(V.t.JFlifp),onClick:function(){(0,d9.pX)(_.BVt.GUILD_DISCOVERY),(0,tH.default)()}})]})}var me=n(365199),mt=n(233824),mn=n(443865),mi=n(165862),ml=n(473145);function ms(e){let{guildBoostSlot:t,onClose:i,hasCancelableGuildBoostSlot:l,premiumSubscription:s,onSelect:r,fractionalState:a}=e,o={transfer:{label:null!=t.premiumGuildSubscription?V.intl.string(V.t["PR0n//"]):V.intl.string(V.t["+fmEYG"]),subtext:t.isOnCooldown()?V.intl.string(V.t.XnB8M0):null,disabled:t.isOnCooldown()},cancel:{label:V.intl.string(V.t.twFU3R),subtext:l?null:V.intl.string(V.t.oQ9lOh),disabled:!l},uncancel:{label:V.intl.string(V.t["2glQNp"]),subtext:null,disabled:!1}};switch(s.status){case _.Dmq.PAST_DUE:o.cancel.disabled=!0,o.cancel.subtext=V.intl.string(V.t.WnL6DV),o.uncancel.disabled=!0;break;case _.Dmq.PAUSE_PENDING:case _.Dmq.PAUSED:a===tJ.xc.NONE&&(o.transfer.disabled=!0,o.transfer.subtext=V.intl.string(V.t.LiLRRT),o.cancel.subtext=V.intl.string(V.t["1ywaWL"]),o.cancel.disabled=!0,o.uncancel.disabled=!0)}let u=x.useMemo(()=>s.isPausedOrPausePending&&a===tJ.xc.NONE?(0,p.jsx)(ti.Dr,{id:"manage-subscription",label:V.intl.string(V.t.obRG6Y),action:()=>(0,na.openUserSettings)(S.X.SUBSCRIPTIONS_PANEL),iconLeft:mn.LightbulbIcon,leadingAccessory:{type:"icon",icon:mn.LightbulbIcon}}):null,[a,s]);return(0,p.jsxs)(mi.W,{"data-menu-migrated-auto":!0,onSelect:r,navId:"subscription-context",variant:"fixed","aria-label":V.intl.string(V.t.ogxXGq),onClose:i,children:[(0,p.jsx)(ti.Dr,{id:"apply",label:o.transfer.label,subtext:o.transfer.subtext,action:function(){(0,lf.mM)(async()=>{let{default:e}=await Promise.all([n.e(295570),n.e(378357),n.e(870528),n.e(205896),n.e(621158),n.e(693173),n.e(418710),n.e(303439)]).then(n.bind(n,710802));return n=>(0,p.jsx)(e,{...n,guildBoostSlots:[t],locationSection:_.JJy.SETTINGS_PREMIUM})})},disabled:o.transfer.disabled}),(0,ml.I5)(t)?(0,p.jsx)(ti.Dr,{id:"uncancel",label:o.uncancel.label,subtext:o.uncancel.subtext,action:function(){(0,lf.mM)(async()=>{let{default:e}=await Promise.resolve().then(n.bind(n,342744));return n=>(0,p.jsx)(e,{...n,guildBoostSlotId:t.id})})},disabled:o.uncancel.disabled}):(0,p.jsx)(ti.Dr,{id:"cancel",label:o.cancel.label,subtext:o.cancel.subtext,action:function(){(0,lf.mM)(async()=>{let{default:e}=await Promise.resolve().then(n.bind(n,983511));return n=>(0,p.jsx)(e,{...n,guildBoostSlot:t})})},disabled:o.cancel.disabled,color:"danger"}),u]})}var mr=n(545934),ma=n(682163),mo=n(987144),mu=n(864310),md=n(290413);function mc(e){let{guild:t,className:n}=e,{total:i}=(0,mu.A)(t.id);return(0,p.jsxs)("div",{className:n??md.OA,children:[(0,p.jsx)(ma.Ay,{className:md.$f,guild:t,size:ma.Ay.Sizes.MEDIUM}),(0,p.jsxs)("div",{className:md.gI,children:[(0,p.jsx)(n5.E,{variant:"heading-sm/semibold",color:"text-default",tag:"span",children:t.name}),(0,p.jsxs)("div",{className:md.ew,children:[(0,p.jsxs)("div",{className:md.QW,children:[(0,p.jsx)(g$.BoostGemIcon,{className:md.Wz,color:n1.A.unsafe_rawColors.GUILD_BOOSTING_PINK_REFRESH}),(0,p.jsx)(n5.E,{variant:"body-xs/semibold",color:"text-subtle",children:V.intl.format(V.t["pob/cL"],{subscriptions:i})})]}),t.premiumTier!==_.TVA.NONE&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{className:md.zk}),(0,p.jsx)(n5.E,{variant:"body-xs/semibold",color:"text-subtle",children:(0,ml.gb)(t.premiumTier,{useLevels:!1})})]})]})]})]})}function mg(e){let{guildId:t}=e,n=(0,I.bG)([lv.A],()=>lv.A.getGuild(t),[t]);return null==n?null:(0,p.jsxs)("div",{className:md.Nr,children:[(0,p.jsx)(mc,{guild:n}),(0,p.jsx)(j.$,{variant:"secondary",size:"sm",icon:g$.BoostGemIcon,text:V.intl.string(V.t.aBHecF),onClick:()=>{(0,mo.g)({analyticsLocations:[],analyticsLocation:{page:_.liQ.GUILD_BOOSTING_USER_SETTINGS,section:_.JJy.GUILD_BOOSTING_RECOMMENDED_SERVER_BOOST_THIS_SERVER_CTA,object:_.ZSU.BUTTON_CTA,objectType:_.btD.BUY},guild:n})}})]})}var mm=n(747381);let mA="https://cdn.discordapp.com/assets/content/272d3fa6496aedb9dee76f2d555913bfd56c9e9aacd6de3c18449644d9749657.png";function mE(e){let{slot:t,guildTier:n,premiumSubscription:i,hasCancelableSlots:l,isLast:s}=e,r=x.useRef(null),a=(0,ml.I5)(t),o=x.useMemo(()=>null!=t.cooldownEndsAt?new Date(t.cooldownEndsAt):null,[t.cooldownEndsAt]),u=null!=o&&o>new Date,d=(0,c3.A)(),c=x.useMemo(()=>(function(e,t){if(null==e||e===_.TVA.NONE)return"";let n=[V.intl.formatToPlainString(V.t["dLlKX/"],{numEmojiSlots:tJ.TG[e].limits.emoji}),V.intl.formatToPlainString(V.t["+ANIfv"],{numStickerSlots:tJ.TG[e].limits.stickers}),V.intl.formatToPlainString(V.t["4gt60b"],{numSoundboardSlots:tJ.TG[e].limits.soundboardSounds}),V.intl.formatToPlainString(V.t.XahSjZ,{resolution:tJ.TG[e].limits.screenShareQualityResolution,framerate:tJ.TG[e].limits.screenShareQualityFramerate}),V.intl.formatToPlainString(V.t.NbNs7S,{bitrate:tJ.TG[e].limits.bitrate/1e3}),V.intl.formatToPlainString(V.t.VVKcpn,{filesize:tJ.TG[e].limits.fileSize/1024/1024}),V.intl.formatToPlainString(V.t.TbpCvv,{numVideoStageSeats:tJ.TG[e].limits.stageVideoUsers}),V.intl.string(V.t.LDyX3i),V.intl.string(V.t.YtGlPW)];e>=_.TVA.TIER_2&&(n.push(V.intl.string(V.t.SztbtN)),n.push(V.intl.string(V.t["3GK91n"]))),e>=_.TVA.TIER_3&&n.push(V.intl.string(V.t["XUUJd+"]));let i=0;for(let e=0;e<t.length;e++)i=31*i+t.charCodeAt(e)|0;let l=n[Math.abs(i)%n.length];return V.intl.formatToPlainString(V.t["/dOAmQ"],{perk:l})})(n,t.id),[n,t.id]),g=x.useMemo(()=>{if(""!==c)return c;let e=null!=t.premiumGuildSubscription?ow.default.extractTimestamp(t.premiumGuildSubscription.id):0;return V.intl.formatToPlainString(V.t.lY2Bur,{date:new Date(e)})},[c,t.premiumGuildSubscription]),m=x.useMemo(()=>a?i.isPausedForFractionalPremium?d.endsAt.toDate():i.currentPeriodEnd:null,[a,i,d]),A=null!=m&&!(u&&null!=o&&o<m);return(0,p.jsxs)("div",{className:ic()(mm.iq,{[mm.Mt]:s}),children:[(0,p.jsxs)("div",{className:mm.kd,children:[(0,p.jsx)("img",{alt:"",className:mm.bB,src:mA}),A?(0,p.jsx)(n5.E,{variant:"body-sm/medium",color:"text-subtle",children:V.intl.format(V.t.Z4ULRD,{date:m})}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n5.E,{variant:"body-sm/medium",color:"text-subtle",children:g}),u&&null!=o&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{className:mm.zk}),(0,p.jsx)(n5.E,{variant:"body-sm/medium",color:"text-feedback-info",children:V.intl.formatToPlainString(V.t.YJlswH,{date:o.toLocaleDateString()})})]}),!u&&null!=i.trialEndsAt&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{className:mm.zk}),(0,p.jsx)(n5.E,{variant:"body-sm/medium",color:"text-feedback-warning",children:V.intl.formatToPlainString(V.t.OdPSpk,{date:new Date(i.trialEndsAt).toLocaleDateString()})})]})]})]}),(0,p.jsx)(aS.Y,{targetElementRef:r,renderPopout:e=>{let{closePopout:n}=e;return(0,p.jsx)(ms,{onClose:n,guildBoostSlot:t,premiumSubscription:i,hasCancelableGuildBoostSlot:l,fractionalState:d.fractionalState})},position:"right",align:"center",children:e=>(0,p.jsx)(n4.D,{innerRef:r,"aria-label":V.intl.string(V.t.PdRCRg),className:mm.Mj,...e,children:(0,p.jsx)(me.MoreHorizontalIcon,{size:"xs",color:n1.A.colors.INTERACTIVE_TEXT_DEFAULT})})})]})}function mh(e){let{guildId:t,slots:n,premiumSubscription:i,hasCancelableSlots:l}=e,s=(0,I.bG)([lv.A],()=>lv.A.getGuild(t),[t]);return(0,p.jsxs)("div",{className:mm.Nr,children:[(0,p.jsx)("div",{className:mm.MY,children:null!=s?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(mc,{guild:s,className:mm.OA}),(0,p.jsx)(j.$,{variant:"secondary",size:"sm",text:V.intl.string(V.t.KLOhbO),onClick:()=>{(0,tH.default)(),(0,mt.K4)({guildId:s.id,location:{section:_.JJy.GUILD_BOOSTING_RECOMMENDED_SERVER_GO_TO_SERVER_CTA}})}})]}):(0,p.jsx)("div",{className:mm.OA,children:(0,p.jsx)(N.D,{variant:"heading-sm/semibold",color:"text-default",children:V.intl.string(V.t["6Kwwuo"])})})}),n.map((e,t)=>(0,p.jsx)(mE,{slot:e,guildTier:s?.premiumTier,premiumSubscription:i,hasCancelableSlots:l,isLast:t===n.length-1},e.id))]})}function mS(e){let{guildBoostSlots:t,premiumSubscription:n,pausedAppliedGuildBoosts:i,isPaused:l}=e,{boostsByGuildId:s,numActiveSlots:r}=x.useMemo(()=>{if(l&&null!=n)return{boostsByGuildId:function(e,t){let n={};for(let t of e)t.guildId in n||(n[t.guildId]=[]),n[t.guildId].push(t);let i={};for(let e of Object.keys(n)){let l=n[e];i[e]=l.map(n=>mr.A.createFromServer({id:n.id,subscription_id:t.id,canceled:!1,premium_guild_subscription:{id:n.id,guild_id:e},cooldown_ends_at:null},t))}return i}(i,n),numActiveSlots:0};let e=0,s={};for(let n of Object.keys(t)){let i=t[n];if(!(0,ml.I5)(i)&&e++,null!=i.premiumGuildSubscription){let e=i.premiumGuildSubscription.guildId;e in s||(s[e]=[]),s[e].push(i)}}return{boostsByGuildId:s,numActiveSlots:e}},[t,l,i,n]);if(null==n||0===Object.keys(s).length)return null;let a=r>ax.Ay.getNumIncludedPremiumGuildSubscriptionSlots(n.planId);return(0,p.jsx)("div",{className:mm.kR,children:ow.default.keys(s).map(e=>(0,p.jsx)(mh,{guildId:e,slots:s[e],premiumSubscription:n,hasCancelableSlots:a},e))})}var mT=n(502572),mf=n(983511),mp=n(342744),mx=n(496431);let mI=function(e){let{className:t,cooldown:n}=e,i=(0,mx.A)(n);return(0,p.jsx)(n5.E,{className:t,variant:"body-sm/medium",color:"text-muted",children:(0,iA.uN)(i,{days:V.t.WUTPDc,hours:V.t.c1qodV,minutes:V.t["2+A3dv"]})})};var m_=n(731536);function mb(e){let{guildBoostSlots:t,fractionalPremiumState:i}=e,l=(0,I.bG)([ul.A],()=>ul.A.getPremiumTypeSubscription()),{unappliedSlots:s,numActiveSlots:r}=x.useMemo(()=>{let e=[],n=0;for(let i of t)!(0,ml.I5)(i)&&n++,null==i.premiumGuildSubscription&&e.push(i);return{unappliedSlots:e,numActiveSlots:n}},[t]),a=r>(null!=l?ax.Ay.getNumIncludedPremiumGuildSubscriptionSlots(l.planId):0),o=l?.isPausedOrPausePending===!0&&i===tJ.xc.NONE;return 0===s.length?null:(0,p.jsxs)("div",{className:m_.Nr,children:[(0,p.jsxs)("div",{className:m_.MY,children:[(0,p.jsxs)("div",{className:m_._L,children:[(0,p.jsxs)("div",{className:m_.MD,children:[(0,p.jsx)("img",{alt:"",className:m_.F8,src:mA}),(0,p.jsx)("div",{className:ic()(m_.qS,"theme-dark"),children:(0,p.jsx)("span",{className:m_.Vv,children:s.length})})]}),(0,p.jsxs)("div",{className:m_.Qp,children:[(0,p.jsx)(n5.E,{variant:"heading-sm/semibold",color:"text-default",tag:"span",children:V.intl.format(V.t.BPadnO,{numUnappliedGuildBoostSlots:s.length})}),(0,p.jsx)(n5.E,{variant:"body-xs/semibold",color:"text-subtle",children:V.intl.format(V.t.Kaw82o,{numUnappliedGuildBoostSlots:s.length})})]})]}),(0,p.jsx)(mT.A,{shouldShow:o,text:V.intl.string(V.t.mOWsF1),"aria-label":V.intl.string(V.t.mOWsF1),children:e=>(0,p.jsx)(j.$,{...e,variant:"primary",size:"sm",icon:g$.BoostGemIcon,text:V.intl.string(V.t.BMx1iy),disabled:o,onClick:()=>{(0,lf.mM)(async()=>{let{default:e}=await Promise.all([n.e(378357),n.e(418710)]).then(n.bind(n,770101));return t=>(0,p.jsx)(e,{...t,onSelectGuild:e=>{t.onClose(),(0,mo.g)({analyticsLocations:[],analyticsLocation:{page:_.liQ.GUILD_BOOSTING_USER_SETTINGS,section:_.JJy.SETTINGS_PREMIUM,object:_.ZSU.BUTTON_CTA,objectType:_.btD.BUY},guild:e})}})})}})})]}),s.map((e,t)=>(0,p.jsx)(mN,{slot:e,isLast:t===s.length-1,isCancelable:a&&!(0,ml.I5)(e),isCanceled:(0,ml.I5)(e),premiumSubscription:l,modificationsDisabled:o},e.id))]})}function mN(e){let t,{slot:n,isLast:i,isCancelable:l,isCanceled:s,premiumSubscription:r,modificationsDisabled:a}=e,o=x.useRef(null),u=x.useMemo(()=>null!=n.cooldownEndsAt?new Date(n.cooldownEndsAt):null,[n.cooldownEndsAt]),d=s?r?.currentPeriodEnd:null;t=n.isOnCooldown()&&null!=u&&(null==d||u<d)?(0,p.jsx)(mI,{cooldown:u.getTime()}):null!=d?(0,p.jsx)(n5.E,{variant:"body-sm/medium",color:"text-subtle",children:V.intl.format(V.t.Z4ULRD,{date:d})}):(0,p.jsx)(n5.E,{variant:"body-sm/medium",color:"text-subtle",children:V.intl.string(V.t["2mcafz"])});let c=l||s;return(0,p.jsxs)("div",{className:ic()(m_.iq,{[m_.Mt]:i}),children:[(0,p.jsxs)("div",{className:m_.kd,children:[(0,p.jsx)("img",{alt:"",className:m_.bB,src:mA}),t]}),c&&(0,p.jsx)(aS.Y,{targetElementRef:o,renderPopout:e=>{let{closePopout:t}=e;return(0,p.jsxs)(mi.W,{navId:"unapplied-boost-actions","aria-label":V.intl.string(V.t.ogxXGq),onSelect:void 0,onClose:t,children:[l&&(0,p.jsx)(ti.Dr,{id:"cancel-boost",label:V.intl.string(V.t.twFU3R),color:"danger",disabled:a,subtext:a?V.intl.string(V.t.mOWsF1):void 0,action:()=>{t(),(0,lf.mM)(async()=>e=>(0,p.jsx)(mf.default,{...e,guildBoostSlot:n}))}}),s&&(0,p.jsx)(ti.Dr,{id:"uncancel-boost",label:V.intl.string(V.t["2glQNp"]),disabled:a,subtext:a?V.intl.string(V.t.mOWsF1):void 0,action:()=>{t(),(0,lf.mM)(async()=>e=>(0,p.jsx)(mp.default,{...e,guildBoostSlotId:n.id}))}})]})},align:"right",position:"bottom",children:e=>(0,p.jsx)(n4.D,{innerRef:o,"aria-label":V.intl.string(V.t["UKOtz+"]),className:m_.Mj,...e,children:(0,p.jsx)(me.MoreHorizontalIcon,{size:"xs",color:n1.A.colors.INTERACTIVE_TEXT_DEFAULT})})})]})}var mC=n(834612);function my(e){let{guildBoostSlots:t,guildBoostSlotsByGuildId:n,premiumSubscription:i,pausedAppliedGuildBoosts:l,fractionalPremiumState:s}=e,r=eC.A.getArticleURL(_.MVz.GUILD_BOOSTING_FAQ),a=i?.isPaused===!0&&s!==tJ.xc.FP_SUB_PAUSED,o=t.some(e=>null==e.premiumGuildSubscription),u=a&&l.length>0,d=a?u:t.some(e=>null!=e.premiumGuildSubscription);return o||d?(0,p.jsxs)("div",{className:mC.i,children:[(0,p.jsxs)("div",{className:mC.b,children:[(0,p.jsx)(N.D,{variant:"heading-sm/semibold",children:V.intl.string(V.t.W5rDjW)}),(0,p.jsx)(n5.E,{variant:"body-sm/normal",color:"text-muted",children:V.intl.format(V.t.SpDz1x,{helpdeskArticle:r})})]}),(0,p.jsx)(mS,{guildBoostSlots:n,premiumSubscription:i,pausedAppliedGuildBoosts:l,isPaused:a}),(0,p.jsx)(mb,{guildBoostSlots:t,fractionalPremiumState:s})]}):null}var mv=n(414184),mj=n(9146);function mO(){return(0,p.jsxs)("div",{className:mj.iE,children:[(0,p.jsx)(N.D,{variant:"heading-xl/medium",children:V.intl.string(V.t.IzKs3o)}),(0,p.jsx)("div",{className:mj.kR,children:mv.s.map((e,t)=>{let n=e.icon;return(0,p.jsxs)("div",{className:mj.Nr,children:[(0,p.jsx)(n,{className:mj.Kk}),(0,p.jsx)(n5.E,{className:mj.h_,color:"text-muted",variant:"body-sm/medium",children:e.getText()})]},t)})})]})}var mR=n(847374),mD=n(232122),mL=n(665984);function mP(){let[e,t]=x.useState(null),[n,i]=x.useState(null);return(0,p.jsxs)("div",{className:mL.iE,children:[(0,p.jsx)(N.D,{variant:"heading-xl/medium",children:V.intl.string(V.t.HPJ6Nj)}),(0,p.jsx)("ul",{className:mL.p_,children:mD.m.map((l,s)=>{let r=e===s,a=n===s,o=r||a?"text-strong":"text-muted";return(0,p.jsxs)(n4.D,{tag:"li",className:ic()(mL.Aw,{[mL.$K]:r}),onClick:()=>t(e=>e===s?null:s),onMouseEnter:()=>i(s),onMouseLeave:()=>i(null),children:[(0,p.jsxs)("div",{className:mL.k7,children:[(0,p.jsx)(n5.E,{className:mL.b1,color:o,variant:"heading-sm/semibold",tag:"span",children:l.getQuestion()}),(0,p.jsx)(mR.ChevronSmallDownIcon,{size:"sm",color:n1.A.colors.INTERACTIVE_ICON_DEFAULT,className:mL.q4,style:{transform:r?"rotate(180deg)":"rotate(0deg)"}})]}),r&&(0,p.jsx)(n5.E,{className:mL.ZF,color:"text-muted",variant:"body-sm/medium",children:l.getAnswer()})]},s)})})]})}var mG=n(182859),mM=n(586428),mU=n(416763);function mV(){let e=eC.A.getArticleURL(_.MVz.GUILD_SUBSCRIPTIONS);return(0,p.jsxs)("div",{className:mU.wx,children:[(0,p.jsxs)("div",{className:mU.Qs,children:[(0,p.jsxs)("div",{className:mU.B5,children:[(0,p.jsx)("img",{alt:"",className:mU.F8,src:"/assets/263e4cc9043cab70.svg"}),(0,p.jsx)(N.D,{variant:"heading-xl/medium",children:V.intl.string(mM.default.hjvcLO)})]}),(0,p.jsx)(n5.E,{variant:"body-sm/normal",color:"text-muted",children:V.intl.format(V.t.TUHyoA,{helpdeskArticle:e})})]}),(0,p.jsx)(mG.A,{variant:"member",className:mU.iO,analyticsLocation:{page:_.liQ.GUILD_BOOSTING_USER_SETTINGS,section:_.JJy.HERO,object:_.ZSU.CARD},videoPlacement:"settings_header"})]})}var mk=n(315629),mw=n(87719),mF=n(961085);function mB(){let e=(0,I.bG)([sE.default],()=>sE.default.getCurrentUser());if(null==e||ax.Ay.hasFreeBoosts(e))return null;let t=eC.A.getArticleURL(_.MVz.GUILD_BOOSTING_FAQ);return(0,p.jsxs)(mk.h,{color:"nitro-pink",className:mF.vK,children:[(0,p.jsxs)("div",{className:mF.nw,children:[(0,p.jsx)("img",{alt:"",className:mF.q3,src:mA}),(0,p.jsxs)("div",{className:mF.Tm,children:[(0,p.jsx)(n5.E,{variant:"heading-sm/semibold",color:"text-default",tag:"span",children:V.intl.format(V.t.Idh1Vs,{count:2,boostCount:2})}),(0,p.jsxs)("div",{className:mF.xv,children:[(0,p.jsx)(au.NitroWheelIcon,{className:mF.nE}),(0,p.jsx)(n5.E,{variant:"body-xs/semibold",color:"text-subtle",children:V.intl.format(V.t["6UAu+f"],{count:2,boostCount:2,helpdeskArticle:t})})]})]})]}),(0,p.jsx)(j.$,{variant:"expressive",size:"sm",icon:au.NitroWheelIcon,text:V.intl.string(V.t["8x0jKT"]),onClick:mw.e})]})}var mX=n(532991);function mz(){let e=(0,I.bG)([g5.A],()=>g5.A.affinities),t=(0,I.bG)([g4.Ay],()=>g4.Ay.getFlattenedGuildIds()),n=x.useMemo(()=>{let n=e.slice(0,3).map(e=>e.guildId);for(let e=0;e<t.length&&n.length<3;e++){let i=t[e];n.includes(i)||n.push(i)}return n},[e,t]);return 0===n.length?null:(0,p.jsxs)("div",{className:mX.i,children:[(0,p.jsx)(N.D,{variant:"heading-sm/semibold",children:V.intl.string(V.t.r90Wgo)}),(0,p.jsx)("div",{className:mX.k,children:n.map(e=>(0,p.jsx)(mg,{guildId:e},e))})]})}var mH=n(967246);function mY(e){let{count:t}=e,i=eC.A.getArticleURL(_.MVz.GUILD_BOOSTING_FAQ);return(0,p.jsxs)(mk.h,{color:"nitro-pink",className:mH.vK,children:[(0,p.jsxs)("div",{className:mH.nw,children:[(0,p.jsxs)("div",{className:mH.MD,children:[(0,p.jsx)("img",{alt:"",className:mH.F8,src:mA}),(0,p.jsx)("div",{className:ic()(mH.qS,"theme-dark"),children:(0,p.jsx)("span",{className:mH.Vv,children:t})})]}),(0,p.jsxs)("div",{className:mH.Tm,children:[(0,p.jsx)(n5.E,{variant:"heading-sm/semibold",color:"text-default",tag:"span",children:V.intl.format(V.t.KewnLu,{count:t,boostCount:t})}),(0,p.jsxs)("div",{className:mH.xv,children:[(0,p.jsx)(au.NitroWheelIcon,{className:mH.nE}),(0,p.jsx)(n5.E,{variant:"body-xs/semibold",color:"text-subtle",children:V.intl.format(V.t["6UAu+f"],{count:2,boostCount:2,helpdeskArticle:i})})]})]})]}),(0,p.jsx)(j.$,{variant:"primary",size:"sm",icon:g$.BoostGemIcon,text:V.intl.string(V.t.BMx1iy),onClick:()=>{(0,lf.mM)(async()=>{let{default:e}=await Promise.all([n.e(378357),n.e(418710)]).then(n.bind(n,770101));return t=>(0,p.jsx)(e,{...t,onSelectGuild:e=>{t.onClose(),(0,mo.g)({analyticsLocations:[],analyticsLocation:{page:_.liQ.GUILD_BOOSTING_USER_SETTINGS,section:_.JJy.SETTINGS_PREMIUM,object:_.ZSU.BUTTON_CTA,objectType:_.btD.BUY},guild:e})}})})}})]})}var mW=n(89150);function mK(e){let{premiumSubscription:t}=e,n=(0,I.bG)([g6.A],()=>g6.A.boostSlots),i=x.useMemo(()=>Object.values(n),[n]),l=(0,I.bG)([sE.default],()=>sE.default.getCurrentUser()),s=(0,I.bG)([g5.A],()=>g5.A.affinities),r=(0,I.bG)([g4.Ay],()=>g4.Ay.getFlattenedGuildIds()),a=s.length>0||r.length>0,o=(0,I.bG)([g1.A],()=>g1.A.getCurrentUserAppliedBoosts()),{fractionalState:u}=(0,c3.A)({forceFetch:!0}),d=l?.isPremiumGroupMember(),c=t?.isPausedOrPausePending===!0&&u===tJ.xc.NONE,g=x.useMemo(()=>{if(null==t||c)return 0;let e=ax.Ay.getNumIncludedPremiumGuildSubscriptionSlots(t.planId);return 0===e||e!==i.length?0:i.filter(e=>e.isAvailable()).length},[t,c,i]);return(0,p.jsxs)("div",{className:mW.GO,children:[(0,p.jsx)(df.kb,{className:mW.ek}),(0,p.jsx)(mV,{}),(0,p.jsx)(mB,{}),g>0&&(0,p.jsx)(mY,{count:g}),d&&(0,p.jsx)(g3.A,{}),!a&&(0,p.jsx)(g9,{}),(0,p.jsxs)("div",{className:mW.C_,children:[(0,p.jsx)(my,{guildBoostSlots:i,guildBoostSlotsByGuildId:n,premiumSubscription:t,pausedAppliedGuildBoosts:o,fractionalPremiumState:u}),(0,p.jsx)(mz,{}),(0,p.jsx)(g2.A,{hideHeading:!0,hideTier0:!0}),(0,p.jsx)(mO,{}),(0,p.jsx)(mP,{})]})]})}var mZ=n(819677);let mq=(0,h.E2)(S.X.PREMIUM_GUILD_SUBSCRIPTIONS_SETTING,{Component:function(){x.useEffect(()=>{oG.hP(),oG.$o(),(0,g0.CD)(),(0,c2.zS)(null,null,_.tF5.DISCOVERY),(0,g0.tO)(!0)},[]);let{hasFetchedSubscriptions:e,premiumSubscription:t}=(0,I.cf)([ul.A],()=>({hasFetchedSubscriptions:ul.A.hasFetchedSubscriptions(),premiumSubscription:ul.A.getPremiumTypeSubscription()})),n=(0,c5.Y)(),i=(0,I.bG)([ui.A],()=>ui.A.hasFetchedPaymentSources),l=(0,I.bG)([g1.A],()=>g1.A.isFetchingCurrentUserAppliedBoosts),s=!e||!n||!i||l,[r,a]=x.useState(!1);return(s||r||a(!0),s&&!r)?(0,p.jsx)("div",{className:ic()(mZ.kL,mZ.Lq),children:(0,p.jsx)(oj.y,{})}):(0,p.jsxs)("div",{className:mZ.kL,children:[(0,p.jsx)("div",{className:mZ.Tp}),(0,p.jsx)("div",{className:mZ.Qs,children:(0,p.jsx)(mK,{premiumSubscription:t})})]})},useSearchTerms:()=>[V.intl.string(V.t["+CbP2v"]),V.intl.string(V.t.Nn1lJy)]}),mQ=(0,h.zZ)(S.X.PREMIUM_GUILD_SUBSCRIPTIONS_CATEGORY,{buildLayout:()=>[mq]}),mJ=(0,h.t_)(S.X.PREMIUM_GUILD_SUBSCRIPTIONS_PANEL,{useTitle:()=>V.intl.string(V.t["+CbP2v"]),buildLayout:()=>[mQ]}),m$=(0,h.i4)(S.X.PREMIUM_GUILD_SUBSCRIPTIONS_SIDEBAR_ITEM,{useTitle:()=>V.intl.string(V.t["+CbP2v"]),icon:g$.BoostGemIcon,buildLayout:()=>[mJ]});var m0=n(153659),m1=n(155984),m2=n(357758),m3=n(262077),m5=n(281445),m4=n(624479),m6=n(626584),m8=n(263775),m7=n(945810);let m9=(0,m7.mj)({name:"2026-10-gsh-change-payment-method",kind:"user",defaultConfig:{enabled:!1},variations:{1:{enabled:!0}}});var Ae=n(196736),At=n(685743),An=n(349085),Ai=n(342942),Al=n(376205),As=n(269249),Ar=n(758836),Aa=n(49999),Ao=n(105518),Au=n(439050);let Ad=new m6.A("GameServerSubscriptionsSection");function Ac(e){return e.toLocaleDateString(void 0,{year:"numeric",month:"numeric",day:"numeric"})}function Ag(e,t){return e.hasSubscription===t.hasSubscription&&e.priceLabel===t.priceLabel&&e.dateLabel===t.dateLabel&&e.isCanceled===t.isCanceled&&e.isDanger===t.isDanger}let Am=e=>{let{subscriptionId:t,skuId:i}=e,{analyticsLocations:l}=(0,ez.Ay)(),s=function(e){let{location:t}=e;return m9.useConfig({location:t}).enabled}({location:"user_settings_subscriptions"}),r=x.useCallback(()=>{var e;e={subscriptionId:t,skuId:i,analyticsLocations:l},(0,lf.mM)(async()=>{let{default:t}=await n.e(498934).then(n.bind(n,592149));return n=>(0,p.jsx)(t,{...n,...e})})},[t,i,l]);return s?(0,p.jsx)(j.$,{variant:"secondary",size:"sm",text:V.intl.string(V.t.SgX7Ra),onClick:r}):null},AA=x.memo(function(e){let{server:t,planOptionBySkuId:n,canUseShopDiscount:i}=e,{analyticsLocations:l}=(0,ez.Ay)(),s=t.instance.subscriptionId,r=t.instance.planId,a=(0,An.A)(t.gameId,"cover")??t.coverUrl,[o,u]=(0,m8.kn)([eE.M.GAME_SERVER_HOSTING_PORTKEY_TOS]),d=o!==eE.M.GAME_SERVER_HOSTING_PORTKEY_TOS,c=cc.default.getId()??"0",{handleCopyServerIp:g,animateCopyIcon:m}=(0,At.A)(c,t.id,tk.A.GAME_SERVER_PAGE,t.serverIp),A=x.useCallback(()=>{(0,Ai.A)({provider:m5.X.SHOCKBYTE,onAccept:()=>{u(Aa.i.TAKE_ACTION),g()}})},[u,g]),{hasSubscription:E,priceLabel:h,dateLabel:S,isCanceled:T,isDanger:f}=(0,I.bG)([ul.A,cm.A],()=>{let e=null!=s?ul.A.getSubscriptionById(s):null;if(null==e)return{hasSubscription:!1,priceLabel:null,dateLabel:null,isCanceled:!1,isDanger:!1};let t=null!=e.canceledAt,l=!t&&null!=e.renewalMutations,r=l?e.renewalMutations?.items[0]?.planId:e.items[0]?.planId,a=null!=r?cm.A.get(r):null,o=null!=a?n.get(a.skuId):null,u=i&&o?.nitroPriceAmount!=null?o.nitroPriceAmount:o?.standardPriceAmount,d=null!=u&&o?.priceCurrency!=null?V.intl.formatToPlainString(V.t.AbOLNu,{price:(0,u5.$g)(u,o.priceCurrency)}):null,c=Ac(e.currentPeriodEnd);return{hasSubscription:!0,priceLabel:d,dateLabel:t?V.intl.formatToPlainString(Ao.default["3aEgK6"],{date:c}):l?V.intl.formatToPlainString(Ao.default.KFSA3M,{date:c}):V.intl.formatToPlainString(Ao.default["9A6cRW"],{date:c}),isCanceled:t,isDanger:t||l}},[s,n,i],Ag),b=x.useCallback(()=>{if(null==s)return;let e=ul.A.getSubscriptionById(s),t=null!=e?Ac(e.currentPeriodEnd):"";(0,n2.A)({title:V.intl.string(Ao.default.TEYPNR),subtitle:V.intl.formatToPlainString(Ao.default.XR1WrB,{date:t}),confirmText:V.intl.string(V.t["cY+Oob"]),cancelText:V.intl.string(Ao.default.zjfaGH),variant:"critical",onConfirm:async()=>{try{await oG.M2(s,l),await oG.hP()}catch(e){Ad.error("Failed to cancel game server subscription",e)}}})},[s,l]),N=x.useCallback(()=>{if(null==s)return;let e=ul.A.getSubscriptionById(s);if(null==e)return;let t=e.items[0]?.planId,a=null!=t?cm.A.get(t):null,o=null!=a?n.get(a.skuId):null,u=i&&o?.nitroPriceAmount!=null?o.nitroPriceAmount:o?.standardPriceAmount,d=null!=u&&o?.priceCurrency!=null?(0,u5.$g)(u,o.priceCurrency):"",c=Ac(e.currentPeriodEnd);(0,n2.A)({title:V.intl.string(Ao.default.o96qbc),subtitle:V.intl.formatToPlainString(Ao.default["7n6Qq+"],{price:d,date:c}),confirmText:V.intl.string(V.t.iIvF2z),cancelText:V.intl.string(V.t["ETE/oC"]),variant:"primary",onConfirm:async()=>{try{await (0,c2.ur)(r);let t=e.items;await oG.nV(e,{status:_.Dmq.ACTIVE,items:t,currency:e.currency},{amount:0,currency:e.currency},(0,ax.UC)(t,e.currency),l),await oG.hP()}catch(e){Ad.error("Failed to re-subscribe to game server subscription",e)}}})},[s,r,l,n,i]),C=""!==t.serverIp&&":"!==t.serverIp;return(0,p.jsxs)("div",{className:Au.nM,children:[(0,p.jsxs)("div",{className:Au.M4,children:[(0,p.jsxs)("div",{className:Au.Vs,"aria-hidden":!0,children:[null!=a&&(0,p.jsx)("img",{className:Au.uP,src:a,alt:""}),(0,p.jsx)("div",{className:Au.tw})]}),(0,p.jsxs)("div",{className:Au.CR,children:[(0,p.jsx)(n5.E,{variant:"body-md/semibold",color:"text-default",tag:"span",lineClamp:1,children:t.serverName}),(0,p.jsx)(n5.E,{variant:"body-sm/medium",color:"text-muted",tag:"span",lineClamp:1,children:`${t.gameName} \u{2022} ${t.planName}`}),C&&(d?(0,p.jsxs)("div",{className:Au.CQ,children:[(0,p.jsx)(n5.E,{variant:"body-sm/medium",color:"text-muted",tag:"span",lineClamp:1,children:t.serverIp}),(0,p.jsx)(n4.D,{className:Au.cL,onClick:g,"aria-label":V.intl.string(V.t.OpuAlK),children:m?(0,p.jsx)(u7.CheckmarkLargeIcon,{size:"custom",width:16,height:16,color:"currentColor"}):(0,p.jsx)(m4.CopyIcon,{size:"custom",width:16,height:16,color:"currentColor"})})]}):(0,p.jsx)(uY.A,{onClick:A,children:V.intl.string(Ao.default["f+F7H3"])}))]})]}),(0,p.jsxs)("div",{className:Au.Rd,children:[(0,p.jsxs)("div",{className:Au.Ff,children:[null!=h&&(0,p.jsx)(n5.E,{variant:"body-md/semibold",color:"text-default",tag:"span",children:h}),null!=S&&(f?(0,p.jsxs)("div",{className:Au.ez,children:[(0,p.jsx)(i$.CircleErrorIcon,{size:"xs",color:"text-feedback-critical"}),(0,p.jsx)(n5.E,{variant:"body-sm/medium",color:"text-feedback-critical",tag:"span",children:S})]}):(0,p.jsx)(n5.E,{variant:"body-sm/medium",color:"text-muted",tag:"span",children:S}))]}),E&&!T&&null!=s&&(0,p.jsx)(Am,{subscriptionId:s,skuId:r}),E&&(T?(0,p.jsx)(j.$,{variant:"primary",size:"sm",text:V.intl.string(V.t.iIvF2z),onClick:N}):(0,p.jsx)(j.$,{variant:"secondary",size:"sm",text:V.intl.string(V.t["ETE/oC"]),onClick:b}))]})]})});function AE(e){let{servers:t}=e,n=(0,Ae.H)({location:"user_settings_subscriptions"}),{games:i}=(0,As.Y)(),l=(0,I.bG)([sE.default],()=>ax.Ay.canUseShopDiscounts(sE.default.getCurrentUser())),s=x.useMemo(()=>{let e=new Map;for(let t of i)for(let n of t.plans??[])e.set(n.id,n);return e},[i]),r=(0,I.yK)([ul.A],()=>(0,Al.HY)(t,i,e=>ul.A.getSubscriptionById(e)),[t,i]);x.useEffect(()=>{let e=r.filter(e=>!cm.A.isLoadedForSKU(e)&&!cm.A.isFetchingForSKU(e));e.length>0&&(0,c2.jv)(e).catch(()=>{})},[r]);let a=x.useCallback(()=>{(0,tH.default)(),(0,d9.pX)(_.BVt.COLLECTIBLES_SHOP_WITH_TAB(Ar.G2.GAME_SERVERS))},[]);return(0,p.jsxs)("div",{className:Au.uW,children:[(0,p.jsxs)("div",{className:Au.wx,children:[(0,p.jsx)(n5.E,{variant:"body-lg/medium",color:"text-strong",children:V.intl.string(Ao.default.vCzwM7)}),(0,p.jsxs)("div",{className:Au.h_,children:[(0,p.jsx)(n5.E,{variant:"body-sm/normal",color:"text-default",tag:"span",children:V.intl.string(Ao.default.y85Eg9)}),n&&(0,p.jsx)(uY.A,{onClick:a,children:(0,p.jsx)(n5.E,{variant:"body-sm/normal",color:"text-link",tag:"span",children:V.intl.string(Ao.default["F/BDbC"])})})]})]}),(0,p.jsx)("div",{className:Au.p_,children:t.map(e=>(0,p.jsx)(AA,{server:e,planOptionBySkuId:s,canUseShopDiscount:l},e.id))})]})}var Ah=n(55766),AS=n(696986),AT=n(364036);function Af(e){let{onClickManageSubscription:t,count:n}=e;return(0,p.jsxs)("div",{children:[(0,p.jsx)(N.D,{variant:"heading-sm/semibold",children:V.intl.string(V.t["KzCF/6"])}),(0,p.jsx)(AS.h,{size:4}),(0,p.jsx)(n5.E,{variant:"body-md/normal",className:AT.yV,children:V.intl.string(V.t["3D7qCu"])}),(0,p.jsx)(AS.h,{size:24}),(0,p.jsxs)("div",{className:AT.Nr,children:[(0,p.jsx)("img",{src:"/assets/5a420feed295b595.svg",alt:"",className:AT.RI}),(0,p.jsxs)("div",{className:AT.FS,children:[(0,p.jsx)(N.D,{variant:"heading-xl/semibold",className:AT.wx,children:V.intl.string(V.t["KzCF/6"])}),(0,p.jsx)(n5.E,{variant:"body-md/normal",className:AT.h_,children:V.intl.format(V.t["m+pcOO"],{numSubscriptions:n})})]}),(0,p.jsx)(j.$,{size:"sm",variant:"overlay-primary",text:V.intl.string(V.t["3a8Xxj"]),onClick:t})]})]})}var Ap=n(872351),Ax=n(9113),AI=n(599941),A_=n(384684),Ab=n(2242);let AN=[];var AC=n(885574),Ay=n(805251),Av=n(912851),Aj=n(182744);let AO=function(e){let{label:t,onClick:n,submitting:i}=e;return(0,p.jsx)(n4.D,{onClick:i?void 0:n,className:Aj.x6,children:(0,p.jsxs)("div",{className:Aj.hQ,children:[i?(0,p.jsx)(oj.y,{type:oj.y.Type.PULSING_ELLIPSIS,className:Aj.__invalid_spinner}):(0,p.jsx)(n5.E,{variant:"body-md/medium",className:Aj.Pf,children:t}),(0,p.jsx)(mR.ChevronSmallDownIcon,{size:"md",color:"currentColor",className:Aj.UE})]})})};var AR=n(465932),AD=n(543767),AL=n(590885),AP=n(790284),AG=n(636194),AM=n(624456),AU=n(710144),AV=n(815332),Ak=n(31637),Aw=n(557506);function AF(e){let{transitionState:t,groupListing:n,listing:i,subscription:l,onClose:s}=e,r=(0,tK.GV)(),{analyticsLocations:a}=(0,ez.Ay)(tk.A.GUILD_ROLE_SUBSCRIPTION_CANCELLATION_MODAL),{cancelSubscription:o,error:u,submitting:d}=function(e){let[t,n]=x.useState(!1),[i,l]=x.useState(null);return{cancelSubscription:async function(t){try{return n(!0),await oG.M2(t,e),!0}catch(e){l(e)}finally{n(!1)}},error:i,submitting:t}}(a),c=i.role_benefits.benefits.filter(e=>e.ref_type===Ab.bN.CHANNEL),g=i.role_benefits.benefits.filter(e=>e.ref_type===Ab.bN.INTANGIBLE),m=im()(l.currentPeriodEnd).format("MMMM Do, YYYY"),A=V.intl.formatToPlainString(V.t.KsMRP5,{numChannels:c.length,numAdditionalBenefits:g.length,subscriptionEndDate:m});return(0,p.jsx)(lT.a,{transitionState:t,"aria-labelledby":r,actions:[{text:V.intl.string(V.t.EP6EPb),variant:"secondary",onClick:s},{variant:"critical-primary",text:V.intl.string(V.t.F6lUDF),onClick:async function(){await o(l.id)&&s()},loading:d}],title:V.intl.string(V.t.O6l5tM),subtitle:A,onClose:s,children:(0,p.jsxs)(q.B,{gap:8,children:[null!=u?(0,p.jsx)(iK.w,{type:"critical",message:u.message,role:"alert"}):null,(0,p.jsx)(Ak.x,{listingId:i.id,guildId:n.guild_id,className:Aw.P})]})})}var AB=n(319225),AX=n(746080),Az=n(883616);function AH(e){let{label:t,value:n,showInfoIcon:i,infoIconTooltipText:l}=e;return(0,p.jsxs)("div",{className:Az.L0,children:[(0,p.jsxs)("div",{className:Az.a5,children:[(0,p.jsx)(N.D,{variant:"body-xs/semibold",className:Az.HU,children:t}),i&&(0,p.jsx)(lg.m,{text:l,children:(0,p.jsx)(AC.CircleInformationIcon,{size:"xs",color:"currentColor",className:Az.Mo})})]}),(0,p.jsx)(N.D,{variant:"heading-xl/semibold",className:Az.sx,children:n})]})}function AY(e){let{subscription:t}=e,{analyticsLocations:n}=(0,ez.Ay)(),[i]=(0,AD.YV)({subscriptionId:t.id,renewal:!0,analyticsLocations:n,analyticsLocation:tk.A.GUILD_ROLE_SUBSCRIPTION_PAYMENT_SOURCE_WITH_INVOICE}),[l,s]=(0,I.yK)([ui.A],()=>[ui.A.hasFetchedPaymentSources,ui.A.paymentSourceFetchError]);return null!=i&&(l||s)?(0,p.jsx)(AL.A,{subscription:t,currentInvoicePreview:i}):(0,p.jsx)(oj.y,{})}function AW(e){let{isTrial:t,isCancelled:n,isResubscribing:i,shouldHideRoleSubscriptionEntryPoints:l,onCancelSubscriptionClick:s,onResubscribeClick:r,onChangePlanClick:a}=e;return n&&(t||l)?null:(0,p.jsx)(lu.D,{label:V.intl.string(V.t["4neDM+"]),children:(0,p.jsx)("div",{className:Az.__invalid_rowButtons,children:n?(0,p.jsx)(j.$,{variant:"primary",text:V.intl.string(V.t.y3mAE4),onClick:r,loading:i}):(0,p.jsxs)(p.Fragment,{children:[!t&&!l&&(0,p.jsx)(AO,{label:V.intl.string(V.t.FRbWR8),onClick:a}),(0,p.jsx)(AO,{label:V.intl.string(V.t.Dx0lF7),onClick:s})]})})})}let AK=function(e){let{subscription:t}=e,{listing:n,groupListing:i,guild:l,expanded:s,handleToggleExpanded:r,subscriptionInfo:a}=function(e){let t=(0,AM.M)(e),n=(0,I.bG)([AG.A],()=>AG.A.getSubscriptionListingForPlan(t)),i=(0,I.bG)([AG.A],()=>null!=n?AG.A.getSubscriptionGroupListingForSubscriptionListing(n.id):null),l=(0,I.bG)([lv.A],()=>lv.A.getGuild(i?.guild_id)),[s,r]=x.useState(!1),{fetchSubscriptionsSettings:a}=(0,AI.XE)();x.useEffect(()=>{s&&null!=l&&null==AG.A.getSubscriptionSettings(l.id)&&a(l.id)},[s,l,a]);let o=null==n?void 0:function(e){let{subscription:t}=e,n=im()(t.currentPeriodEnd).format("M/D/YY"),i=null!=t.price?(0,u5.$g)(t.price,t.currency):"",l=im()(t.createdAt).format("M/D/YY"),s=t.status===_.Dmq.CANCELED,r=t.status===_.Dmq.PAST_DUE,a=t.hasActiveTrial;return{memberSince:l,nextRenewalDate:n,nextRenewalLabel:s?V.intl.string(V.t.UAfot2):V.intl.string(V.t.CVjLcM),subscriptionPrice:i,isCancelled:s,isPastDue:r,isTrial:a}}({subscription:e});return{guild:l,expanded:s,handleToggleExpanded:function(){return r(e=>!e)},listing:n,groupListing:i,subscriptionInfo:o}}(t),[o,u]=x.useState(!1),d=(0,tK.GV)(),{analyticsLocations:c}=(0,ez.Ay)(),{shouldHideGuildPurchaseEntryPoints:g}=(0,AR.MH)(l?.id),m=t?.isPurchasedViaAppleGeneric;if(null==i||null==n||null==a)return null;let{isCancelled:A,isPastDue:E,subscriptionPrice:h,memberSince:T,nextRenewalDate:f,nextRenewalLabel:b,isTrial:N}=a,C=n.soft_deleted||null==l||m;return(0,p.jsxs)("div",{className:Az.kL,children:[(0,p.jsx)(AU.A,{onClick:r,className:Az.N1,children:e=>{let{areaRef:t,handleStopPropagation:i}=e;return(0,p.jsxs)(p.Fragment,{children:[null!=l&&(0,p.jsx)(ma.Ay,{guild:l,active:!0,size:ma.Ay.Sizes.MEDIUM}),(0,p.jsxs)("div",{className:Az.if,children:[(0,p.jsx)(n5.E,{variant:"body-md/medium",className:Az.J5,children:null!=l?l.name:V.intl.string(V.t["He+cmd"])}),(0,p.jsxs)("div",{className:Az.xp,children:[(0,p.jsx)(n5.E,{variant:"body-sm/normal",className:Az.KR,children:n.name}),A?(0,p.jsx)(Ay.E,{type:{text:V.intl.string(V.t["7uFZGt"])},variant:"critical"}):N?(0,p.jsx)(Ay.E,{type:{text:V.intl.string(V.t["6anton"])},variant:"primary"}):E?(0,p.jsx)(lg.m,{text:V.intl.string(V.t.eSuJE2),children:(0,p.jsx)("div",{className:Az.qc,children:(0,p.jsx)(Ay.E,{type:{text:V.intl.string(V.t.NrRwIl)},variant:"warning"})})}):null,m?(0,p.jsx)(lg.m,{text:V.intl.string(V.t.nv1IqK),children:(0,p.jsx)("div",{className:Az.Bi,children:(0,p.jsx)(Ay.E,{type:{text:V.intl.string(V.t["sBl3X/"])},variant:"secondary"})})}):null]})]}),(0,p.jsx)(n4.D,{onClick:i(r),"aria-label":V.intl.string(V.t.e5eQOy),"aria-controls":d,"aria-expanded":s,focusProps:{ringTarget:t},children:(0,p.jsx)(mR.ChevronSmallDownIcon,{size:"md",color:"currentColor",className:ic()(Az.D6,{[Az.S7]:s})})})]})}}),null!=i&&s?(0,p.jsxs)("div",{id:d,children:[(0,p.jsx)("div",{className:Az.yF}),(0,p.jsx)(AV.A,{groupListingId:i.id,subscription:t,className:Az.kE}),(0,p.jsxs)("div",{className:Az.Zx,children:[(0,p.jsx)(AH,{label:b,value:f}),(0,p.jsx)(AH,{label:V.intl.string(V.t.dltUMH),value:h,showInfoIcon:N,infoIconTooltipText:N?V.intl.string(V.t["/q6fpa"]):void 0}),(0,p.jsx)(AH,{label:V.intl.string(V.t.AOcwWB),value:T})]}),(0,p.jsx)(AS.h,{size:16}),!A&&!m&&(0,p.jsx)(lu.D,{label:V.intl.string(V.t.wmMFvA),children:(0,p.jsx)(AY,{subscription:t})}),!C&&(0,p.jsx)(AW,{isTrial:N,isCancelled:A,isResubscribing:o,shouldHideRoleSubscriptionEntryPoints:g,onCancelSubscriptionClick:function(){if(null!=l&&null!=i&&null!=n){var e;e={groupListing:i,listing:n,subscription:t},(0,lf.qf)(t=>(0,p.jsx)(AF,{...t,...e}))}},onChangePlanClick:function(){null!=l&&((0,d9.pX)(_.BVt.CHANNEL(l.id,AX.VV.ROLE_SUBSCRIPTIONS)),(0,tH.default)(),Av.A.show(_.kqX.BACK_TO_PREVIOUS_SCREEN,void 0,V.intl.string(V.t.DvbaM4),()=>{AP.A.setState({subsection:eR.nR}),(0,na.openUserSettings)(S.X.SUBSCRIPTIONS_PANEL)}))},onResubscribeClick:async function(){try{u(!0),await oG.QP(t,c),(0,AB.E)({title:V.intl.string(V.t.oPV2cy),body:V.intl.string(V.t.DdRizV)})}finally{u(!1)}}})]}):null]})};var AZ=n(661097);let Aq=function(e){let{onGoBack:t}=e,n=function(){let{ensureFresh:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,I.bG)([A_.A],()=>(function(){let[e]=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[A_.A],t=e.getGuildIdsWithPurchasableRoles(),n=!1;return(t.forEach(t=>{e.getUserSubscriptionRoles(t).size>0&&(n=!0)}),n)?Ab.M_.SUBSCRIBED:0===t.size?Ab.M_.NONE:Ab.M_.IN_SUBSCRIPTION_SERVER})([A_.A]))===Ab.M_.SUBSCRIBED,n=(0,I.bG)([ul.A],()=>ul.A.getActiveGuildSubscriptions()),i=x.useRef(!1);return x.useEffect(()=>{(function(e){let{ensureFresh:t,hasFetched:n,hasRoleSubscriptions:i}=e,l=ul.A.getActiveGuildSubscriptions();return(l?.length??0)===0&&!!i||!!t&&!n||!n&&!ul.A.hasFetchedSubscriptions()})({ensureFresh:e,hasRoleSubscriptions:t,hasFetched:i.current})&&(i.current=!0,oG.hP())},[e,t]),n??AN}(),{loading:i}=(0,AI.eb)(n);return((0,Ax.A)(oF.Fr?"role-subscriptions-user-setting":void 0),i)?(0,p.jsx)(oj.y,{}):0===n.length?null:(0,p.jsxs)("div",{children:[(0,p.jsx)(j.$,{text:V.intl.string(V.t.hqyhKQ),icon:Ap.ArrowSmallUpIcon,variant:"secondary",onClick:t}),(0,p.jsx)(AS.h,{size:10}),(0,p.jsx)(n3.n,{label:V.intl.string(V.t["KzCF/6"]),description:V.intl.string(V.t["Y+ucR7"]),children:(0,p.jsx)("div",{className:AZ.A,children:n.map(e=>(0,p.jsx)(AK,{subscription:e},e.id))})})]})};var AQ=n(327479),AJ=n(932012);function A$(e){let{onClickManageSubscription:t,count:n}=e;return(0,p.jsxs)("div",{children:[(0,p.jsx)(N.D,{variant:"heading-sm/semibold",children:V.intl.string(V.t["48ywCu"])}),(0,p.jsx)(AS.h,{size:4}),(0,p.jsx)(n5.E,{variant:"body-md/normal",className:AJ.yV,children:V.intl.string(V.t.VWxmSo)}),(0,p.jsx)(AS.h,{size:24}),(0,p.jsxs)("div",{className:AJ.Nr,children:[(0,p.jsx)("img",{src:"/assets/d6bcd13fb6c85425.svg",alt:"",className:AJ._e}),(0,p.jsxs)("div",{className:AJ.FS,children:[(0,p.jsx)(N.D,{variant:"heading-xl/semibold",className:AJ.wx,children:V.intl.string(V.t["48ywCu"])}),(0,p.jsx)(n5.E,{variant:"body-md/normal",className:AJ.h_,children:V.intl.format(V.t["/esXLj"],{numSubscriptions:n})})]}),(0,p.jsx)(AQ.A,{onClick:t,text:V.intl.string(V.t["z5YcJ+"])})]})]})}var A0=n(548411),A1=n(417098),A2=n(143582),A3=n(915043),A5=n(631466);function A4(e){let{className:t,header:n,headerClassName:i,children:l}=e,s=x.useMemo(()=>{let e=!1;return x.Children.forEach(l,t=>{null!=t&&(e=!0)}),e},[l]);return(0,p.jsxs)("div",{className:ic()(A5.iE,t),children:[(0,p.jsx)("div",{className:ic()(A5.wx,i),children:n}),s&&(0,p.jsx)("div",{className:A5.Qs,children:l})]})}var A6=n(885996),A8=n(251843),A7=n(664121),A9=n(950305),Ee=n(943775),Et=n(123791),En=n(900797),Ei=n(611643);let El=x.createContext({isOpen:!1,toggleOpen:()=>{}});function Es(e){let{children:t}=e,[n,i]=x.useReducer(e=>!e,!1),l=x.useMemo(()=>({isOpen:n,toggleOpen:i}),[n]);return(0,p.jsx)(El.Provider,{value:l,children:t(n)})}Es.Toggle=function(e){let{className:t,text:n}=e,{isOpen:i,toggleOpen:l}=x.useContext(El),s=i?En.ChevronSmallUpIcon:mR.ChevronSmallDownIcon,r=null!=n?n:i?V.intl.string(V.t.fgq1gs):V.intl.string(V.t.XJuakA);return(0,p.jsxs)(n4.D,{className:ic()(Ei.L,t),onClick:l,children:[(0,p.jsx)(n5.E,{variant:"heading-xs/semibold",tag:"div",color:"currentColor",children:r}),(0,p.jsx)(s,{size:"sm",color:"currentColor"})]})};var Er=n(627363),Ea=n(328968),Eo=n(163437),Eu=n(3432);function Ed(e){return e.toLocaleDateString(void 0,{dateStyle:"long"})}var Ec=n(562312),Eg=((d={})[d.LOADING=0]="LOADING",d[d.DONE=1]="DONE",d[d.ERROR=2]="ERROR",d);function Em(e){let{subscription:t,navigateToSwitchPlan:n,loadingState:i}=e,l=t.metadata?.application_subscription_guild_id,{renewalMutations:s,planId:r}=t,{appId:a,plan:o,storeListing:u,isGuildSubscription:d,subscriptionForGuild:c,sku:g,isCancelled:m,isOrphanedGuildSubscription:A,renewalPlan:E}=(0,I.cf)([cm.A,cA.A,Ea.A,lv.A],()=>{let e,n=cm.A.get(r),i=null!=n?cA.A.get(n.skuId):void 0,a=i?.applicationId,o=null!=n?Ea.A.getForSKU(n.skuId):null,u=null!=o&&(0,Eo.PJ)(o.skuFlags),d=u&&null!=l?lv.A.getGuild(l):void 0,c=(0,Eo.Uo)(t,i),g=u&&null!=l&&null==d;if(!1===c&&null!=s&&s.items.length>0){let t=s.items[0];e=cm.A.get(t.planId)??void 0}return{appId:a,isGuildSubscription:u,isOrphanedGuildSubscription:g,plan:n,sku:i,storeListing:o,subscriptionForGuild:d,isCancelled:c,renewalPlan:e}},[l,r,s,t]),{data:h}=(0,Er.YY)(a),S=x.useMemo(()=>null!=h?(0,Ee.A)(h,100):null,[h]),T=g?.deleted??!1,f=null!=g&&(0,Eo.Se)(g),b=t.status===_.Dmq.PAST_DUE,{analyticsLocations:C}=(0,ez.Ay)(),[y]=(0,AD.YV)({subscriptionId:t.id,renewal:!0,analyticsLocations:C,analyticsLocation:tk.A.APP_SUBSCRIPTION_PAYMENT_SOURCE_WITH_INVOICE}),v=Ed(t.currentPeriodEnd),j=0===i;return(0,p.jsxs)(A4,{headerClassName:Ec.dL,header:!1===j?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:Ec.VW,children:[null!=S&&(0,p.jsx)(A8._,{src:S.href,imageClassName:Ec.Z2,width:40,height:40}),(0,p.jsxs)("div",{className:Ec.aF,children:[(0,p.jsx)(N.D,{variant:"heading-sm/semibold",lineClamp:1,children:h?.name??V.intl.string(V.t["7kqy7W"])}),(0,p.jsx)(n5.E,{variant:"body-sm/medium",color:"text-default",lineClamp:1,children:o?.name??V.intl.string(V.t.sqkbMK)})]})]}),(0,p.jsx)("div",{className:Ec.Pz,children:null!=h&&null!=u&&null!=g&&(0,p.jsx)(ET,{subscription:t,app:h,guild:c,sku:g,storeListing:u,isCancelled:m,isOrphanedGuildSubscription:A,navigateToSwitchPlan:n,renewalSkuId:E?.skuId})})]}):(0,p.jsx)(oj.y,{type:oj.t.PULSING_ELLIPSIS}),children:[m&&(0,p.jsx)(ES,{type:"warning",title:f?V.intl.formatToPlainString(V.t.QOnM1y,{subscriptionPeriodEnd:v}):V.intl.formatToPlainString(V.t.HOaZu8,{subscriptionPeriodEnd:v})}),!m&&A&&(0,p.jsx)(ES,{type:"warning",title:V.intl.string(V.t.SmSP8Q)}),b&&(0,p.jsx)(ES,{type:"danger",title:V.intl.string(V.t.fvOqBo)}),(0,p.jsxs)("div",{className:Ec.zH,children:[(0,p.jsx)(Eh,{title:V.intl.string(V.t["5D/KEH"]),content:d?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("span",{className:Ec.yW,children:[(0,p.jsx)(A7.ServerIcon,{size:"xs"}),V.intl.string(V.t.QjL3vn)]}),null!=c&&(0,p.jsxs)("span",{className:Ec._t,children:[(0,p.jsx)(n5.E,{variant:"body-sm/normal",color:"text-muted",children:V.intl.format(V.t["7ZD8p1"],{guildName:c.name})}),(0,p.jsx)(ma.Ay,{guild:c,size:ma.Ay.Sizes.MINI})]})]}):(0,p.jsxs)("span",{className:Ec.yW,children:[(0,p.jsx)(A9.UserIcon,{size:"xs"}),V.intl.string(V.t["6anEVv"])]})}),(0,p.jsx)(EA,{invoicePreview:y,subscriptionPlan:o}),(0,p.jsx)(Eh,{title:V.intl.string(V.t.dnUzb6),content:Ed(t.createdAt??t.currentPeriodStart)}),(0,p.jsx)(EE,{isCancelled:m,subscriptionPeriodEnd:v,renewalPlan:E})]}),(0,p.jsx)(Ep,{subscription:t,currentInvoicePreview:y,loadingState:i,isDeleted:T,isCancelled:m}),null!=h&&u?.benefits!=null&&u.benefits.length>0&&(0,p.jsx)(Ef,{appId:h.id,listingBenefits:u.benefits})]})}function EA(e){let{subscriptionPlan:t,invoicePreview:n}=e;if(null==t)return(0,p.jsx)(Eh,{title:V.intl.string(V.t.KI7ERx),content:""});let i=(0,u5.CE)((0,u5.$g)(t.price,t.currency),t.interval,t.intervalCount),l=n?.findInvoiceItemByPlanId(t.id);if(null==l)return(0,p.jsx)(Eh,{title:V.intl.string(V.t.KI7ERx),content:i});let s=(0,u5.CE)((0,u5.$g)(l.subscriptionPlanPrice,t.currency),t.interval,t.intervalCount);return(0,p.jsx)(Eh,{title:V.intl.string(V.t.KI7ERx),content:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n5.E,{variant:"body-sm/semibold",children:s}),s!==i&&(0,p.jsx)(lg.m,{text:V.intl.format(V.t["6DoE57"],{listPrice:i}),position:"bottom",children:(0,p.jsx)(n5.E,{variant:"body-xs/medium",color:"text-muted",children:(0,p.jsx)("s",{children:i})})})]})})}function EE(e){let{isCancelled:t,subscriptionPeriodEnd:n,renewalPlan:i}=e;if(null!=i){let e=(0,u5.CE)((0,u5.$g)(i.price,i.currency),i.interval,i.intervalCount);return(0,p.jsx)(Eh,{title:V.intl.string(V.t.hIhAM3),content:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n5.E,{variant:"body-sm/medium",children:n}),(0,p.jsx)(n5.E,{variant:"body-sm/normal",children:V.intl.format(V.t.MCLbvj,{planName:i.name,price:e})})]})})}return(0,p.jsx)(Eh,{title:t?V.intl.string(V.t.enxcAl):V.intl.string(V.t["Ms+6Zq"]),content:n})}function Eh(e){let{title:t,content:n}=e;return(0,p.jsxs)("div",{className:Ec.nM,children:[(0,p.jsx)(n5.E,{variant:"body-sm/medium",children:t}),(0,p.jsx)(n5.E,{variant:"body-sm/medium",className:Ec.u4,children:n})]})}function ES(e){let{type:t,title:n}=e;return(0,p.jsx)("div",{className:Ec.Xm,children:(0,p.jsx)(iK.w,{type:"warning"===t?"warning":"critical",message:n,role:"status"})})}function ET(e){let{app:t,storeListing:i,sku:l,subscription:s,isCancelled:r,isOrphanedGuildSubscription:a,guild:o,renewalSkuId:u,navigateToSwitchPlan:d}=e,c=(0,Eo.Se)(l),{analyticsLocations:g}=(0,ez.Ay)(),[m,A]=x.useState(!1),E=(0,Et.C)(t.id),h=(0,I.bG)([cA.A],()=>cA.A.getParentSKU(i.skuId),[i.skuId]),S=x.useMemo(()=>{var e,t;let n;return null==h?[]:(e=i.id,t=E.subscriptions,n=new Set(h.bundledSkuIds),t.filter(t=>t.id!==e&&n.has(t.skuId)))},[i.id,E,h]),T=0!==S.length;return(0,p.jsxs)("div",{className:Ec.fw,children:[c||r&&a?null:r?(0,p.jsx)(j.$,{variant:"secondary",size:"sm",text:V.intl.string(V.t.QtMnkW),onClick:async function(){try{A(!0);let{subscription:e}=await (0,oG.QP)(s,g);if(null==e)return;(0,lf.mM)(async()=>{let{default:t}=await Promise.all([n.e(888454),n.e(52396)]).then(n.bind(n,115623));return n=>(0,p.jsx)(t,{...n,storeListing:i,subscription:ub.A.createFromServer(e)})})}finally{A(!1)}},loading:m}):(0,p.jsx)(j.$,{variant:"secondary",size:"sm",text:V.intl.string(V.t["E8G/tr"]),onClick:function(){(0,lf.mM)(async()=>{let{default:e}=await Promise.all([n.e(509032),n.e(299523)]).then(n.bind(n,548750));return n=>(0,p.jsx)(e,{...n,application:t,storeListing:i,subscription:s,guild:o})})}}),T&&null!=h&&!1===r&&!1===a&&(0,p.jsx)(j.$,{variant:"primary",size:"sm",text:V.intl.string(V.t.R74ZBR),onClick:()=>{d({currentSubscription:s,alternativeListings:S,app:t,subscriptionGroup:h,currentListing:i,renewalSkuId:u})}})]})}function Ef(e){let{appId:t,listingBenefits:n}=e;return(0,p.jsx)(Es,{children:e=>(0,p.jsxs)("div",{className:Ec.PX,children:[(0,p.jsxs)("div",{className:Ec.wV,children:[e&&(0,p.jsx)(n5.E,{variant:"body-sm/semibold",children:V.intl.string(V.t.mORL67)}),(0,p.jsx)(Es.Toggle,{className:Ec.Bh,text:e?V.intl.string(V.t.gsbFAw):V.intl.string(V.t.IwjfxV)})]}),e?n.map(e=>{let{id:n,name:i,description:l,icon:s}=e;return(0,p.jsx)(A6.F,{header:i,icon:(0,Eu.N)(t,s),description:l},n)}):null]})})}function Ep(e){let{subscription:t,currentInvoicePreview:n,loadingState:i,isDeleted:l,isCancelled:s}=e;return null==n?null:0===i?(0,p.jsx)("div",{className:Ec.Ji,children:(0,p.jsx)(lu.D,{label:V.intl.string(V.t.azZaZa),children:(0,p.jsx)(oj.y,{type:oj.t.PULSING_ELLIPSIS})})}):2===i?(0,p.jsx)("div",{className:Ec.Ji,children:(0,p.jsxs)(A1.$T,{color:A1.Hv.DANGER,style:{borderRadius:0},children:[V.intl.format(V.t.IIHUUF,{subscriptionId:t.id}),(0,p.jsx)("br",{}),V.intl.format(V.t.fh65ES,{helpLink:"https://support.discord.com/hc/en-us"})]})}):(0,p.jsx)("div",{className:Ec.Ji,children:(0,p.jsx)(lu.D,{label:V.intl.string(V.t.azZaZa),children:(0,p.jsx)(AL.A,{subscription:t,currentInvoicePreview:n,disabled:l||s})})})}var Ex=((c={}).HOME="HOME",c.SWITCH_APP_PLANS="SWITCH_APP_PLANS",c),EI=n(856383);let E_=(0,I.UT)(cm.A,{getQueryId:_.fic.SUBSCRIPTION_PLANS,get:e=>{if(null==e)return null;let t=cm.A.getForSKU(e);return 0===t.length?null:t},load:e=>(null==e&&EI.A.addBreadcrumb({message:"Error loading subscription plans: skuId is null"}),null!=e?(0,c2.ur)(e).then(()=>{}):Promise.reject())});var Eb=n(240248),EN=n(237218),EC=n(763064);function Ey(e){let{children:t,lineClamp:n=2,...i}=e,[l,s]=x.useState(!1),[r,a]=x.useState(null),o=null!=r&&(0,p.jsx)("button",{className:EC.x6,onClick:()=>s(e=>!e),children:(0,p.jsxs)(n5.E,{className:EC.B0,variant:"body-sm/medium",color:"text-brand",children:[l?V.intl.string(V.t["JQX/Pb"]):V.intl.string(V.t.Fbrd8J),l?(0,p.jsx)(En.ChevronSmallUpIcon,{color:n1.A.colors.TEXT_BRAND,size:"xs"}):(0,p.jsx)(mR.ChevronSmallDownIcon,{color:n1.A.colors.TEXT_BRAND,size:"xs"})]})}),[u,d]=x.useState(null),c=x.useCallback(()=>{if(null==u)return;let{scrollHeight:e,clientHeight:t}=u;e>t&&a({truncatedHeight:t,expandedHeight:e})},[u]);x.useEffect(()=>{requestAnimationFrame(c)},[c,t,n]);let g="auto";return null!=r&&(g=l?`${r.expandedHeight}px`:`${r.truncatedHeight}px`),(0,p.jsxs)("div",{children:[(0,p.jsx)(n5.E,{...i,className:EC.Qs,lineClamp:l?void 0:n,ref:d,style:{height:g},children:t}),o]})}var Ev=n(920352);function Ej(e){let{cta:t,storeListing:n,className:i}=e,{applicationId:l,benefits:s,description:r}=n,a=x.useMemo(()=>null==n.thumbnail?null:(0,EN.t)(l,n.thumbnail,256),[l,n.thumbnail]),{data:o}=E_(n.skuId),u=x.useMemo(()=>{if(null==o||0===o.length)return null;let e=o[0];return(0,ax._J)(e)},[o]);return null==u?null:(0,p.jsxs)(A4,{className:ic()(Ev.iE,i),header:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:Ev.qd,children:[null!=a&&(0,p.jsx)(A8._,{src:a.href,imageClassName:Ev.rW,width:48,height:48}),(0,p.jsxs)("div",{children:[(0,p.jsx)(N.D,{variant:"heading-sm/semibold",children:n.summary}),(0,p.jsx)(n5.E,{variant:"body-md/medium",children:u})]})]}),t]}),children:[!(0,Eb.uJ)(r)&&(0,p.jsx)("div",{className:Ev.h_,children:(0,p.jsx)(Ey,{variant:"body-sm/medium",children:r})}),null!=s&&s.length>0&&(0,p.jsx)("div",{className:Ev.PX,children:s.map(e=>{let{id:t,name:n,description:i,icon:s}=e;return(0,p.jsx)(A6.F,{header:n,icon:(0,Eu.N)(l,s),description:i},t)})})]})}var EO=n(185438),ER=n(683380);function ED(e){let{app:t,currentSubscription:n,currentListing:i,alternativeListings:l,navigateToHome:s,subscriptionGroup:r,renewalSkuId:a}=e,o=(0,Ee.A)(t,100),u=(0,Eo.PJ)(r.flags),d=u?A7.ServerIcon:A9.UserIcon,c=u?V.intl.string(V.t["46YF2D"]):V.intl.string(V.t.fFyGiA),g=n.metadata?.application_subscription_guild_id,m=(0,I.bG)([lv.A],()=>u&&null!=g?lv.A.getGuild(g):void 0,[g,u]),A=(0,I.bG)([cA.A],()=>{if(null!=a)return cA.A.get(a)},[a]),E=Ed(n.currentPeriodEnd);return(0,p.jsxs)("div",{children:[(0,p.jsxs)("div",{className:ER.wx,children:[null!=o&&(0,p.jsx)(A8._,{src:o.href,imageClassName:ER.Z2,width:48,height:48}),(0,p.jsxs)("div",{children:[(0,p.jsx)(N.D,{variant:"heading-xl/semibold",children:t.name}),(0,p.jsxs)("div",{className:ER.p4,children:[(0,p.jsxs)(N.D,{variant:"heading-sm/medium",className:ER.N4,children:[(0,p.jsx)(d,{size:"xs",color:"currentColor"})," ",c]}),null!=m&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n5.E,{variant:"body-md/normal",children:"\u2022"}),(0,p.jsxs)("span",{className:ER.vP,children:[(0,p.jsx)(ma.Ay,{guild:m,size:ma.Ay.Sizes.SMOL}),(0,p.jsx)(N.D,{variant:"heading-sm/semibold",color:"text-muted",children:V.intl.format(V.t["7ZD8p1"],{guildName:m.name})})]})]})]})]})]}),(0,p.jsx)(Es,{children:e=>(0,p.jsxs)("div",{className:ER._B,children:[(0,p.jsx)(n5.E,{variant:"body-md/normal",child