Loading
Showing the first 250,000 characters. Open raw for the full source.
function(e,t,a){a.d(t,{x:()=>j$}),a(321073);var n,l,i,s,r,o=a(477900),c=a(582128),d=a(17928),u=a(314116),m=a(270003),h=a(193249),x=a(532446),p=a(821609),g=a(834730),v=a(364522),j=a(611677),f=a(691885),b=a(95477),y=a(404778),E=a(77729),S=a(952818),C=a(905552),_=a(360906),A=a(157257),N=a(507868),k=a(274372),I=a(341923),D=a(614584),T=a(423341),R=a(574206),w=a(564973),O=a(227628),M=a(468550);let P=(0,a(196765).v)(()=>({enabled:!1,pending:null,lastResult:null}));function L(e){P.setState({enabled:e})}function U(e){P.setState({pending:e})}function G(e){P.setState({lastResult:e})}var F=a(781710),B=a(696016),$=a(264572).Buffer;function V(){let e=P(e=>e.enabled),t=P(e=>e.pending),a=P(e=>e.lastResult),n=c.useCallback(async(e,t,a,n)=>{let l=_.Ay.getMediaEngine();if(null==l.setClipsPerfMonitoring)return G("setClipsPerfMonitoring unsupported in this build"),null;U(n);try{let n=await l.setClipsPerfMonitoring(e,t,a);return L(n.enabled),n}catch(e){return G(`${n} failed: ${e instanceof Error?e.message:String(e)}`),null}finally{U(null)}},[]),l=c.useCallback(async t=>{L(t);let a=await n(t,!1,!1,t?"enable":"disable");null!=a?G(`recorder ${a.enabled?"enabled":"disabled"}`):L(e)},[n,e]),i=c.useCallback(async()=>{let t=await n(e,!0,!1,"save");if(null==t)return;if(""===t.html)return void G("save: server returned empty html");let a=`clips-perf-${new Date().toISOString().replace(/[:.]/g,"-")}.html`;try{let e=$.from(t.html,"utf8"),n=await E.A.fileManager.saveWithDialog2(e,a);if(null!=n&&!0===n.canceledByUser)return void G("save: canceled");G(`saved ${t.eventCount} events (${t.html.length} bytes)`)}catch(e){G(`save failed: ${e instanceof Error?e.message:String(e)}`)}},[n,e]),s=c.useCallback(async()=>{let t=await n(e,!1,!0,"clear");null!=t&&G(`cleared ${t.eventCount} events`)},[n,e]);return(0,o.jsxs)(m.n,{label:"Clips v3 Performance",children:[(0,o.jsx)(h.d,{label:"Record Clips v3 performance",description:"Toggles the in-process perf recorder inside discord_clips.exe.",checked:e,disabled:null!=t,onChange:l}),(0,o.jsxs)(x.M,{children:[(0,o.jsx)(p.$,{text:"Save as file...",disabled:null!=t,onClick:i}),(0,o.jsx)(p.$,{text:"Clear recording",variant:"secondary",disabled:null!=t,onClick:s})]}),(null!=t||null!=a)&&(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-muted",children:null!=t?`working: ${t}...`:a})]})}let W=[{label:"Laughter Model",flag:B.pZ.LAUGHTER},{label:"Shouting Model",flag:B.pZ.SHOUTING},{label:"Events",flag:B.pZ.GAME_EVENTS}];function H(){let e=(0,d.bG)([N.A],()=>N.A.isStaffBypassDisabled()),t=(0,d.bG)([N.A],()=>N.A.isStaffBypassActive()),a=(0,d.bG)([N.A],()=>N.A.hasLoadedCapabilities()),n=(0,d.bG)([N.A],()=>N.A.getGameCapabilities().size),l=(0,d.bG)([S.Ay],()=>S.Ay.getVisibleGame()),i=l?.id,s=(0,d.bG)([N.A],()=>N.A.getCapabilities(i),[i]),r=(0,d.bG)([N.A],()=>null!=i&&N.A.getGameCapabilities().has(i),[i]),c=(0,I.GZ)(i);return(0,o.jsxs)(m.n,{label:"Autoclipping Game Capabilities",children:[(0,o.jsx)(h.d,{label:"Ignore staff bypass",description:"Staff normally get autoclipping for every game. Turn this on to be treated as a regular user, so autoclipping follows the server capabilities map. Resets to off each time Discord launches.",checked:e,onChange:D.jE}),(0,o.jsxs)(g.E,{variant:"text-md/normal",children:["capabilities: ",a?`loaded, ${n} game(s)`:"not loaded yet"]}),(0,o.jsxs)(g.E,{variant:"text-md/normal",children:["staff bypass active: ",String(t)]}),null==l?(0,o.jsx)(g.E,{variant:"text-md/normal",children:"no visible game running"}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(g.E,{variant:"text-md/normal",children:[l.name," (",l.id,")"]}),(0,o.jsxs)(g.E,{variant:"text-md/normal",children:["autoclipping: ",c?"Yes":"No"]}),(0,o.jsxs)(g.E,{variant:"text-md/normal",children:["in capabilities map: ",r?"Yes":"No"," (bitmask ",s,")"]}),W.map(e=>{let{label:t,flag:a}=e;return(0,o.jsxs)(g.E,{variant:"text-md/normal",children:[t,": ",(s&a)!=0?"Yes":"No"]},t)}),!r&&c&&(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-muted",children:'This game isn\'t in the map \u2014 autoclipping is on via the staff bypass, so every capability above reads No. Turn on "Ignore staff bypass" to see what a regular user gets.'})]}),(0,o.jsx)(p.$,{text:"refetch capabilities",variant:"secondary",disabled:null==i,onClick:()=>{null!=i&&w.b.refetchMany([i])}})]})}function z(e,t){let a=new R.k(e);for(let e of t)a.recordSavedClip(e);return a.end(),a}function K(){let e=(0,O.MZ)(e=>e.isOpen),t=(0,M.sY)(e=>e.isOpen),[a,n]=c.useState(3),l=c.useCallback(e=>{let t=Object.values(k.Ay.getClips()),a=t.find(e=>null!=e.applicationId);if(a?.applicationId==null)return;let n=a.applicationId,l=t.filter(e=>e.applicationId===n).slice(0,e);k.Ay.devSetLastClipsSession(z(n,l)),(0,M.M8)(n)},[]),i=c.useCallback(e=>{e?l(a):(0,M.kF)()},[l,a]),s=c.useCallback(()=>{let e=Object.values(k.Ay.getClips()),t=(0,C.A)(S.Ay,A.A),a=(t?.id!=null?e.find(e=>e.applicationId===t.id):void 0)??e.find(e=>null!=e.applicationId);if(a?.applicationId==null)return;let n=a.applicationId,l=e.filter(e=>e.applicationId===n).slice(0,10);k.Ay.devSetLastClipsSession(z(n,l)),(0,O.w9)()},[]),r=c.useCallback(e=>{e?s():(0,O.yj)()},[s]),g=c.useCallback(e=>{n(e),t&&l(e)},[l,t]),[_,N]=c.useState(B.rb.KILL),[I,R]=c.useState(1),[w,P]=c.useState(""),L=(0,d.bG)([k.Ay],()=>k.Ay.isAutoStashEnabled()),U=c.useCallback(e=>{e?(0,u.A)({title:"Stash all gaming sessions?",subtitle:"Every gaming session will be stashed to your Desktop (inside the `decider_stash` folder) when it ends. This setting is not persistent \u2014 it resets to off each time Discord launches.",confirmText:"Enable",variant:"primary",onConfirm:()=>{D.mN(!0)}}):D.mN(!1)},[]),[G,$]=c.useState([]),[W,K]=c.useState(void 0),Y=c.useCallback(e=>{$(e),K(t=>null!=t&&e.includes(t)?t:e[0])},[]),q=c.useCallback(async()=>{let e=E.A.clips.debugListStashedClipDeciderSessions;null!=e&&Y(await e())},[Y]);return c.useEffect(()=>{let e=!0,t=E.A.clips.debugListStashedClipDeciderSessions;if(null!=t)return t().then(t=>{e&&Y(t)}),()=>{e=!1}},[Y]),(0,o.jsx)(v.Ip,{children:(0,o.jsxs)(j.l,{children:[(0,o.jsx)(m.n,{label:"Send Test Signals",children:(0,o.jsxs)(x.M,{children:[(0,o.jsx)(p.$,{text:"Manual",onClick:()=>D.Ts({type:B.Gy.MANUAL})}),(0,o.jsx)(p.$,{text:"Distributed",onClick:()=>D.Ts({type:B.Gy.DISTRIBUTED,remoteTriggerUserId:"123",remoteTriggerClipId:"456"})}),(0,o.jsx)(p.$,{text:"Shouting",onClick:()=>D.Ts({type:B.Gy.SHOUTING,userId:"123",confidence:1})}),(0,o.jsx)(p.$,{text:"Laughter",onClick:()=>T.A.debugCreateRankableLaughterClip()})]})}),(0,o.jsxs)(m.n,{label:"Game Event Creator",children:[(0,o.jsxs)(x.M,{children:[(0,o.jsx)(f.l,{label:"Event Type",value:_,onSelectionChange:e=>N(e),options:[{id:"kill",label:"Kill",value:B.rb.KILL},{id:"multikill",label:"Multikill",value:B.rb.MULTIKILL},{id:"death",label:"Death",value:B.rb.DEATH},{id:"assist",label:"Assist",value:B.rb.ASSIST},{id:"item",label:"Item",value:B.rb.ITEM},{id:"victory",label:"Victory",value:B.rb.VICTORY},{id:"defeat",label:"Defeat",value:B.rb.DEFEAT},{id:"level_up",label:"Level Up",value:B.rb.LEVEL_UP},{id:"treasure",label:"Treasure",value:B.rb.TREASURE},{id:"objective_kill",label:"Objective Kill",value:B.rb.OBJECTIVE_KILL}],selectionMode:"single",fullWidth:!0}),(0,o.jsx)(f.l,{label:"Importance",value:I,onSelectionChange:R,options:[{id:"low",label:"Low",value:0},{id:"medium",label:"Medium",value:.5},{id:"high",label:"High",value:1}],selectionMode:"single",fullWidth:!0})]}),(0,o.jsx)(b.k,{label:"Description (optional)",value:w,onChange:P,placeholder:"e.g., Killed enemy ADC in bot lane"}),(0,o.jsx)(p.$,{text:"Create Game Event",onClick:()=>{D.Ts({type:B.Gy.GAME_EVENT,eventType:_,importance:I,description:w})}}),(0,o.jsx)(h.d,{label:"Auto-stash decider data",description:"Stashes every gaming session to your Desktop when it ends. Resets to off on each Discord launch.",checked:L,onChange:U}),(0,o.jsx)(f.l,{label:"Stash session (re-run ranking)",value:W,onSelectionChange:e=>K(e),options:G.map(e=>({id:e,label:e,value:e})),placeholder:0===G.length?"No stashed sessions":"Most recent",disabled:0===G.length,selectionMode:"single",fullWidth:!0}),(0,o.jsxs)(x.M,{children:[(0,o.jsx)(p.$,{text:"re-run ranking",onClick:()=>{T.i.debugRerunRanking(W).catch(e=>{B.nx.error("re-run ranking failed",e)})}}),(0,o.jsx)(p.$,{text:"run automontage",onClick:()=>{T.i.debugRunAutoMontage(W).catch(e=>{B.nx.error("run automontage failed",e)})}}),(0,o.jsx)(p.$,{text:"refresh sessions",variant:"secondary",onClick:()=>{q()}})]})]}),(0,o.jsx)(m.n,{label:"Clip Metadata Tool",children:(0,o.jsx)(F.A,{})}),(0,o.jsx)(y.c,{}),(0,o.jsx)(V,{}),(0,o.jsx)(y.c,{}),(0,o.jsx)(H,{}),(0,o.jsx)(y.c,{}),(0,o.jsxs)(m.n,{label:"Reminder UI",children:[(0,o.jsx)(h.d,{label:"Clips Quick Bar",description:"Force-show the inline quick bar above the account panel. Fabricates a session (up to 10 clips) from your recent clips so it can be tested without capturing a real game session.",checked:e,onChange:r}),(0,o.jsx)(h.d,{label:"Clips Reminder",description:"Force-show the post-session ClipsReminder panel. Fabricates a session from your most recent clips (and game) so it can be tested without capturing a real game session.",checked:t,onChange:i}),(0,o.jsx)(f.l,{label:"Clip count",value:a,onSelectionChange:g,options:[{id:"1",label:"1 clip",value:1},{id:"2",label:"2 clips",value:2},{id:"3",label:"3 clips",value:3}],selectionMode:"single",fullWidth:!0})]})]})})}var Y=a(503698),q=a.n(Y),J=a(939249),Q=a(683071),X=a(297264),Z=a(538064),ee=a(265059),et=a(869146);a(323874),a(14289),a(35956);var ea=a(789645),en=a(589158),el=a(65593),ei=a(377980),es=a(581298),er=a(393284),eo=a(287809),ec=a(901139),ed=a(641886),eu=a(780898),em=a(652215),eh=a(964570),ex=a(427262);function ep(e){let{nameplate:t}=e,a=(0,d.bG)([eo.default],()=>eo.default.getCurrentUser()),n=ex.Ay.useName(a)??"";return(0,o.jsx)(eh.g,{username:n,selfMute:!1,selfDeaf:!1,serverMute:!1,serverDeaf:!1,suppress:!1,speaking:!1,streaming:!1,status:em.clD.ONLINE,currentUser:a,activities:[],applicationStream:void 0,userTag:"",speakingWhileMuted:!1,occluded:!1,dismissibleContents:{avatar:[],settings:[]},isOrbchievementsEnabled:!1,awaitingRemote:!1,nameplate:t,voiceChannel:null,isQuestBarEmpty:!0,isListenAlongVisible:!1})}var eg=a(736653),ev=a(653523),ej=a(475601);function ef(e){let{selected:t,onSelect:a}=e,n=(0,eg.Ay)();return(0,o.jsxs)("div",{className:ej.N,children:[(0,o.jsx)(g.E,{variant:"text-sm/semibold",children:"Preselected Gradient"}),(0,o.jsx)("div",{className:ej.Z,children:ed.Z6.map(e=>{let l=n!==em.NJ8.LIGHT?e.darkBackground:e.lightBackground,i=t===e.name;return(0,o.jsx)(ev.S4,{onSelect:()=>a(e),style:{background:l},name:e.name,isSelected:i},e.name)})})]})}var eb=a(834058),ey=a(95701),eE=a(331884);function eS(e){let{selected:t,nameplate:a}=e,n=(0,eE.i)(),l=new ey.cq({id:"0",type:em.rbe.DM,name:"self",guild_id:"0",recipients:[n.id]});return(0,o.jsx)(eb.th,{selected:t,channel:l,user:n,nameplate:a})}var eC=a(698638),e_=a(52940);function eA(){let[e,t]=(0,c.useState)(!1),[a,n]=(0,c.useState)(!1),[l,i]=(0,c.useState)(null),{node:s}=(0,es.Ay)(er.k,""),r=(0,ec.Ay)(e=>e.toolsCache),{setToolsCache:d,removeToolsCache:u}=(0,ec.DE)(),{setImgCache:m}=(0,ec.TW)(),h=(0,c.useCallback)(e=>{let t=r[e];null!=t?i({previewToolKey:t.url,palette:t.palette,skuId:"0"}):i(t=>null==t?{previewToolKey:e,palette:ed.Wj,skuId:"0"}:{...t,previewToolKey:e})},[r]),x=(0,c.useCallback)(e=>{i(t=>null==t?null:{...t,palette:e})},[]),v=(0,c.useCallback)(e=>{u(e)},[u]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:e_.ne,children:[(0,o.jsxs)("div",{className:e_.gO,children:[(0,o.jsx)(p.$,{size:"sm",onClick:()=>{n(!1),t(e=>!e)},variant:"secondary",text:"Toggle Themes"}),(0,o.jsx)(p.$,{size:"sm",onClick:()=>{t(!1),n(e=>!e)},variant:"secondary",text:"Toggle Gradients"})]}),(0,o.jsxs)("div",{className:e_.uQ,children:[e&&(0,o.jsx)(ei.A,{node:s}),a&&(0,o.jsx)(ef,{selected:l?.palette?.name,onSelect:e=>{l?.previewToolKey!=null&&d(l.previewToolKey,l.previewToolKey,e),x(e)}})]})]}),(0,o.jsxs)("div",{className:e_.iW,children:[(0,o.jsx)(eN,{nameplate:l},l?.palette?.name),(0,o.jsxs)("div",{className:e_.Uo,children:[(0,o.jsx)(g.E,{variant:"text-sm/semibold",children:"Drag background image to screen"}),(0,o.jsx)(el.A,{title:"upload image",description:"upload the background",icons:eC.xi,onDrop:async e=>{let t=URL.createObjectURL(e[0]),a=e[0],n=await a.arrayBuffer();m(t,t,(0,eu.nI)(n)),d(t,t,ed.Wj)}}),(0,o.jsx)("div",{className:e_.is,children:Object.values(r).map(e=>{let{url:t}=e;return(0,o.jsx)(ek,{src:t,onSetStatic:h,removeAsset:v},t)})}),(0,o.jsx)(eD,{label:"gradient override",onChange:e=>x({name:ed.AK,darkBackground:e,lightBackground:e})}),(0,o.jsx)(eI,{label:"set",onClick:()=>{}})]})]})]})}function eN(e){let{nameplate:t}=e,[a,n]=(0,c.useState)(320),l=(0,c.useRef)(null),i=(0,c.useRef)(null),s=(0,c.useRef)(null),r=(0,c.useRef)(document),d=(0,c.useCallback)(e=>{if(null!=l.current){let t=l.current.getBoundingClientRect();n(Math.max(264,Math.min(432,e.clientX-t.left)))}},[]),u=(0,c.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let t=e.currentTarget.ownerDocument;function a(e){e.preventDefault(),d(e)}function n(){null!=i.current&&(t.removeEventListener("mousemove",i.current),i.current=null),null!=s.current&&(t.removeEventListener("mouseup",s.current),s.current=null)}r.current=t,i.current=a,s.current=n,t.addEventListener("mousemove",a),t.addEventListener("mouseup",n)},[d]);return(0,c.useEffect)(()=>()=>{null!=i.current&&(r.current.removeEventListener("mousemove",i.current),i.current=null),null!=s.current&&(r.current.removeEventListener("mouseup",s.current),s.current=null)},[]),(0,o.jsx)(v.Ip,{className:e_.Fp,orientation:"horizontal",children:(0,o.jsxs)("div",{ref:l,className:e_.ey,style:{width:`${a}px`},children:[(0,o.jsx)(g.E,{variant:"text-sm/semibold",children:"Memberlist"}),(0,o.jsx)(eT,{nameplate:t}),(0,o.jsx)(g.E,{variant:"text-sm/semibold",children:"DMs"}),(0,o.jsx)(eR,{nameplate:t}),(0,o.jsx)(g.E,{variant:"text-sm/semibold",children:"RTC"}),(0,o.jsx)(ew,{nameplate:t}),(0,o.jsx)("div",{className:e_.Di,onMouseDown:u})]})})}function ek(e){let{src:t,onSetStatic:a,removeAsset:n}=e;return(0,o.jsxs)("div",{className:e_.xO,children:[(0,o.jsx)(J.D,{onClick:()=>n(t),className:e_.yV,children:(0,o.jsx)(ea.P,{size:"custom",width:16,height:16,name:"x"})}),(0,o.jsx)("img",{className:e_.Ez,src:t,alt:""}),(0,o.jsx)("div",{className:e_.Lu,children:(0,o.jsx)(p.$,{onClick:()=>a(t),size:"sm",variant:"secondary",text:"set nameplate"})})]})}function eI(e){let{label:t,onClick:a}=e;return(0,o.jsxs)("div",{className:e_.Uu,children:[(0,o.jsx)(g.E,{variant:"text-sm/normal",children:"coming soon"}),(0,o.jsx)(p.$,{variant:"secondary",size:"sm",text:t,disabled:!0,onClick:a})]})}function eD(e){let{label:t,onChange:a}=e;return(0,o.jsxs)("div",{className:e_.Im,children:[(0,o.jsx)(g.E,{variant:"text-sm/normal",children:t}),(0,o.jsx)("input",{onChange:e=>{a(e.target.value)},className:e_.QL,placeholder:"#000000"})]})}function eT(e){let{nameplate:t}=e,a=(0,d.bG)([eo.default],()=>eo.default.getCurrentUser());return(0,o.jsx)("div",{className:e_.VH,children:(0,o.jsxs)("div",{className:e_.H1,children:[(0,o.jsx)(g.E,{className:e_.Pf,variant:"text-sm/semibold",children:"DEFAULT"}),(0,o.jsx)(en.A,{nameplate:t,user:a,currentUser:a}),(0,o.jsx)(g.E,{className:e_.Pf,variant:"text-sm/semibold",children:"FOCUSED"}),(0,o.jsxs)("div",{children:[(0,o.jsx)(en.A,{nameplate:t,selected:!0,user:a,currentUser:a}),(0,o.jsx)(en.A,{selected:!0,user:a,currentUser:a})]})]})})}function eR(e){let{nameplate:t}=e;return(0,o.jsx)("div",{className:e_.VH,children:(0,o.jsxs)("div",{className:e_.H1,children:[(0,o.jsx)(g.E,{className:e_.Pf,variant:"text-sm/semibold",children:"DEFAULT"}),(0,o.jsx)(eS,{nameplate:t}),(0,o.jsx)(g.E,{className:e_.Pf,variant:"text-sm/semibold",children:"FOCUSED"}),(0,o.jsxs)("div",{children:[(0,o.jsx)(eS,{selected:!0,nameplate:t}),(0,o.jsx)(eS,{selected:!0})]})]})})}function ew(e){let{nameplate:t}=e;return(0,o.jsx)("div",{className:e_.VH,children:(0,o.jsx)("div",{className:e_.X2,children:(0,o.jsx)(ep,{nameplate:t})})})}a(508300);var eO=a(132500),eM=a(157559),eP=a(780777),eL=a(993408),eU=a(579151),eG=a(559474),eF=a(816866),eB=a(87558),e$=a(575593),eV=a(631903),eW=a(224640),eH=a(408278),ez=a(972213),eK=a(43990),eY=a(192308),eq=a(661531),eJ=a(231723),eQ=a(900686),eX=a(986687),eZ=a(796366),e0=a(435558),e1=a.n(e0),e2=a(855915),e5=a(480335);let e3=e=>{let{profileEffect:t}=e,a=c.useMemo(()=>(0,e0.cloneDeep)(t),[t]),n=c.useMemo(()=>t.effects.some(e=>null!=e.randomizedSources&&e.randomizedSources.length>0),[t.effects]),l=c.useMemo(()=>{if(n){var e;let n=1===(e=a.effects.reduce((e,t)=>{let a=1+(t.randomizedSources??[]).length;return a>1?1===e?a:Math.min(a,e):e},1))?-1:Math.floor(Math.random()*e);n>0&&t.effects.forEach((e,t)=>{null!=e.randomizedSources&&e.randomizedSources.length>0&&(a.effects[t].src=e.randomizedSources[n-1].src)})}return a},[t.effects,a,n]),i="debug",{layerData:s}=(0,e2.A)({skuId:i,layers:l.effects});return(0,o.jsx)(e5.p,{profileEffect:l,skuId:i,layerData:s})};var e6=a(586886),e8=a(778765);let e4="https://cdn.discordapp.com/assets/content/ad2a252a6866e1ecb3bab521e2baaabbf13ab2d1ecaa8af67862c53c91f76761.png",e7={[eB.qH.THUMBNAIL]:null,[eB.qH.STATIC]:null,[eB.qH.REDUCED_MOTION]:null},e9="debug",te="reduced-motion-preview-modal";function tt(e){let{transitionState:t,onClose:a,frameSrc:n,theme:l}=e;return(0,o.jsx)(eW.d,{transitionState:t,size:"md",onClose:a,maxHeight:"viewport",children:(0,o.jsxs)("div",{className:e6.Xd,children:[(0,o.jsx)("div",{className:e6.y6,children:(0,o.jsx)(eH.K,{"aria-label":"Close",onClick:a,icon:ez.XLargeIcon,variant:"overlay-secondary",size:"sm"})}),(0,o.jsxs)("div",{className:e6.rU,children:[(0,o.jsx)(eK.N,{theme:l,children:e=>(0,o.jsx)("img",{src:e4,alt:"",className:q()(e6.aM,e),"aria-hidden":!0})}),null!=n&&""!==n&&(0,o.jsx)("img",{src:n,className:e6.SD,alt:"Reduced motion preview"})]})]})})}function ta(e){let{type:t,frame:a,theme:n,onClear:l}=e,i=t===eB.qH.REDUCED_MOTION,s=i?e4:e8.A,r=(0,o.jsx)(eK.N,{theme:n,children:e=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("img",{src:s,alt:"",className:q()(e6.aM,e),"aria-hidden":!0}),a?.src!=null&&""!==a.src&&(0,o.jsx)("img",{src:a.src,className:q()(e6.SD,e),alt:""})]})});return(0,o.jsxs)("div",{className:e6.pK,children:[(0,o.jsx)(X.D,{variant:"heading-sm/bold",children:t}),i?(0,o.jsx)(J.D,{className:q()(e6.zd,e6.eB),onClick:function(){(0,eY.hasModalOpen)(te)?(0,eY.closeModal)(te):(0,eY.openModalLazy)(()=>Promise.resolve(e=>(0,o.jsx)(tt,{...e,frameSrc:a?.src??null,theme:n})),{modalKey:te,onCloseRequest:()=>(0,eY.closeModal)(te)})},children:r}):(0,o.jsx)("div",{className:e6.zd,children:r}),null!=a&&(0,o.jsx)(p.$,{variant:"critical-secondary",size:"sm",text:"Clear",onClick:l})]})}let tn=e=>{let{profileEffect:t}=e,{upsertProfileEffect:a}=(0,eF.wu)(),n=(0,d.bG)([eo.default],()=>eo.default.getCurrentUser()),[l,i]=c.useState(!0),s=c.useRef({}),[r,u]=c.useState(!1),[m,h]=c.useState(!1),[x,v]=c.useState(8),[j,f]=c.useState([]),[b,y]=c.useState(e7),E=c.useRef([]),[S,C]=c.useState(t.name),_=S.toLowerCase().replace(/\s+/g,"_"),A=c.useMemo(()=>({type:e$.R.PROFILE_EFFECT,skuId:e9,title:e9,description:e9,accessibilityLabel:e9,reducedMotionSrc:"",thumbnailPreviewSrc:"",effects:j,animationType:eV.l.ANIMATION_TYPE_UNSPECIFIED}),[j]),N=r?eq.A.themes.DARK:eq.A.themes.LIGHT;function k(e){let t=e.currentTarget.files;return null==t?null:t[0]}function I(e,t){let a=k(t);null!=a&&(0,eB.Mz)(a,t=>{y(n=>({...n,[e]:(0,eB.GT)(t,a)}))})}c.useEffect(()=>{let e=t.effects;e.length>0&&f(e.map(e=>({...e,name:e.name??(0,eB.XG)(e.src),randomizedSources:e.randomizedSources?.map(e=>({...e,filename:e.filename??(0,eB.XG)(e.src)}))})))},[t.effects]),c.useEffect(()=>{let e=t.stillFrames;null!=e&&Object.entries(e).forEach(e=>{let[t,a]=e;if(null!=a){if(""!==a.src&&null!=a.src&&(""===a.base64||null==a.base64))y(e=>({...e,[t]:a}));else if(""!==a.base64&&null!=a.base64){let e=(0,eB.fB)(a.base64);a.src=e,E.current.push(e),y(e=>({...e,[t]:a}))}}})},[t.stillFrames]);let D={profileEffect:t,upsertProfileEffect:a},T=c.useRef(D);return(c.useEffect(()=>{T.current=D}),c.useEffect(()=>{let{profileEffect:e,upsertProfileEffect:t}=T.current;e.readonly||t({skuId:e.skuId,name:S,effects:j,stillFrames:b})},[j,b,S]),c.useEffect(()=>()=>{E.current.forEach(e=>{URL.revokeObjectURL(e)}),E.current=[]},[]),null==n)?(0,o.jsx)("div",{}):(0,o.jsxs)("div",{className:e6.zr,children:[(0,o.jsxs)("div",{style:{display:"none"},children:[(0,o.jsx)(eP.A,{ref:e=>{s.current.animated=e},onChange:function(e){let t=k(e);null!=t&&(0,eB.Mz)(t,async e=>{let a=await (0,eB.Ay)(e,t,j.length);f(e=>[...e,a])})},multiple:!1}),(0,o.jsx)(eP.A,{ref:e=>{s.current.thumbnail=e},onChange:e=>I(eB.qH.THUMBNAIL,e),multiple:!1}),(0,o.jsx)(eP.A,{ref:e=>{s.current.static=e},onChange:e=>I(eB.qH.STATIC,e),multiple:!1}),(0,o.jsx)(eP.A,{ref:e=>{s.current.reducedMotion=e},onChange:e=>I(eB.qH.REDUCED_MOTION,e),multiple:!1})]}),(0,o.jsxs)("div",{className:e6.Vg,children:[(0,o.jsxs)("div",{className:q()(e6.nM,e6.uW),children:[(0,o.jsx)(g.E,{variant:"text-md/normal",children:"Profile Effect Name"}),(0,o.jsx)("input",{type:"text",value:S,className:e6.hF,onChange:e=>{C(e.target.value)}})]}),(0,o.jsxs)("div",{className:e6.nM,children:[(0,o.jsx)(g.E,{variant:"text-md/normal",children:"Dark Theme"}),(0,o.jsx)("input",{type:"checkbox",checked:r,className:e6.OO,onChange:()=>{u(!r)}}),(0,o.jsx)(g.E,{variant:"text-md/normal",children:"Show User Profile"}),(0,o.jsx)("input",{type:"checkbox",checked:m,className:e6.OO,onChange:()=>{h(!m)}})]}),(0,o.jsxs)("div",{className:e6.nM,children:[(0,o.jsx)(g.E,{variant:"text-md/normal",children:"Border Radius"}),(0,o.jsx)("input",{type:"range",min:4,max:24,step:2,value:x,onChange:e=>v(+e.target.value)}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",children:[x,"px"]})]}),(0,o.jsxs)("div",{className:q()(e6.nz,e6.VH),style:{borderRadius:x},children:[m?(0,o.jsx)("div",{className:e6.jq,children:(0,o.jsx)(eZ.A,{user:n,currentUser:n,transitionState:eJ.ip.ENTERED,onClose:()=>{},themeContainerClassName:e6.JB})}):(0,o.jsx)(eK.N,{theme:N,children:e=>(0,o.jsx)("div",{className:q()(e6.aM,e),children:(0,o.jsx)("img",{src:e8.A,alt:"",width:400})})}),l&&(0,o.jsx)("div",{className:e6.KJ,children:(0,o.jsx)(e3,{profileEffect:A})})]}),(0,o.jsx)("div",{children:m&&(0,o.jsxs)("div",{className:q()(e6.f5,e6.VH),style:{borderRadius:x},children:[(0,o.jsx)(eX.A,{user:n,pendingAvatar:void 0,pendingProfileEffect:null,hideProfileFrame:!0,canUsePremiumCustomization:!0,isTryItOut:!0}),(0,o.jsx)(e3,{profileEffect:A})]})}),(0,o.jsxs)("div",{className:e6.nz,children:[(0,o.jsxs)("div",{className:e6.nM,children:[(0,o.jsx)(p.$,{variant:"active",text:"Upload Animated Layer",onClick:()=>s.current.animated?.activateUploadDialogue()}),(0,o.jsx)(g.E,{variant:"text-sm/semibold",children:"Make sure to upload the bottommost layer first!"})]}),(0,o.jsxs)("div",{className:e6.nM,children:[(0,o.jsx)(p.$,{variant:"active",text:"Upload thumbnail.png",onClick:()=>s.current.thumbnail?.activateUploadDialogue()}),(0,o.jsx)(p.$,{variant:"active",text:"Upload static.png",onClick:()=>s.current.static?.activateUploadDialogue()}),(0,o.jsx)(p.$,{variant:"active",text:"Upload reduced_motion.png",onClick:()=>s.current.reducedMotion?.activateUploadDialogue()})]}),(0,o.jsx)("div",{className:e6.q6,children:(0,o.jsx)("div",{className:e6.nM,children:(0,o.jsx)(p.$,{variant:"primary",text:"Replay Animation",onClick:()=>{i(!1),setTimeout(()=>i(!0),100)}})})}),(0,o.jsxs)("div",{className:q()(e6.q6,e6.XA),children:[(0,o.jsx)(g.E,{variant:"text-sm/semibold",children:"Please download both configs for the drop package!"}),(0,o.jsx)(g.E,{variant:"text-sm/bold",color:"text-feedback-critical",children:"WARNING: The full config is really big :0"}),(0,o.jsxs)("div",{className:e6.nM,children:[(0,o.jsx)(eQ.A,{fileContents:()=>(0,eB.rs)(j),contentType:"text/plain",fileName:`${_}_timing_config.txt`,children:(0,o.jsx)(p.$,{variant:"primary",size:"sm",text:"Download Timing Config"})}),(0,o.jsx)(eQ.A,{fileContents:function(){return JSON.stringify({...t,name:S,readonly:!1,effects:j,stillFrames:b})},contentType:"text/plain",fileName:`${_}_config.txt`,children:(0,o.jsx)(p.$,{variant:"primary",size:"sm",text:"Download Full Config"})})]})]}),(0,o.jsxs)("div",{className:e6.uW,children:[(0,o.jsx)(X.D,{variant:"heading-lg/bold",children:"Still Frames"}),(0,o.jsx)("div",{className:e6.mv,children:Object.entries(b).map(e=>{let[t,a]=e;return(0,o.jsx)(ta,{type:t,frame:a,theme:N,onClear:()=>{y(e=>({...e,[t]:null}))}},t)})})]}),j.some(e=>(e.randomizedSources??[]).length>0)&&(0,o.jsxs)("div",{className:q()(e6.uW,e6.l7),children:[(0,o.jsx)(g.E,{variant:"text-md/bold",children:"Rules of Randomized Effects"}),(0,o.jsxs)("ol",{children:[(0,o.jsx)("li",{children:"When an effect has randomization, all layers with random options must have the same number of options."}),(0,o.jsx)("li",{children:"The duration for the random options of a layer must be the same"}),(0,o.jsx)("li",{children:"If multiple layers have randomization, the same option will be used for all layers. (For example, the second option will be used for ALL layers)"}),(0,o.jsx)("li",{children:'Click "Replay Animation" to "reroll" the randomization'})]})]})]}),(0,o.jsxs)("div",{className:q()(e6.Vg,e6.ZF),children:[(0,o.jsx)("div",{className:e6.cD,children:(0,o.jsx)(p.$,{variant:"critical-secondary",text:"Clear Assets",onClick:function(){f([]),y(e7)}})}),j.map((e,t)=>(0,o.jsxs)("div",{className:e6.ec,children:[(0,o.jsxs)("div",{className:e6.D1,children:[(0,o.jsx)(X.D,{variant:"heading-md/bold",children:e.name}),(0,o.jsx)("img",{src:e.src,className:e6.oq,alt:""}),null!=e.randomizedSources&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(X.D,{variant:"heading-md/bold",children:"Alternatives"}),e.randomizedSources.map((e,t)=>(0,o.jsxs)("div",{children:[null!=e.filename&&(0,o.jsx)(X.D,{variant:"heading-sm/semibold",children:e.filename}),(0,o.jsx)("img",{src:e.src,className:e6.oq,alt:""})]},e.filename??`randomized-${t}`))]})]}),(0,o.jsxs)("div",{className:q()(e6.Vg,e6.uW),children:[(0,o.jsxs)("div",{className:e6.nz,children:[(0,o.jsx)(g.E,{variant:"text-md/bold",children:"Start"}),(0,o.jsx)("input",{type:"number",value:e.start,className:e6.hF,onChange:e=>{f(a=>{let n=[...a],l=a[t];return l.start=+e.target.value,n[t]=l,n})},contentEditable:!0})]}),(0,o.jsxs)("div",{className:e6.nz,children:[(0,o.jsx)(g.E,{variant:"text-md/bold",children:"Duration"}),(0,o.jsx)("input",{type:"number",value:e.duration,className:e6.hF,onChange:e=>{f(a=>{let n=[...a],l=a[t];return l.duration=+e.target.value,n[t]=l,n})},contentEditable:!0})]})]}),(0,o.jsxs)("div",{className:q()(e6.Vg,e6.uW),children:[(0,o.jsxs)("div",{className:e6.nz,children:[(0,o.jsx)(g.E,{variant:"text-md/bold",children:"Loop"}),(0,o.jsx)("input",{type:"checkbox",checked:e.loop,className:e6.OO,onChange:e=>{f(a=>{let n=[...a],l=a[t];return l.loop=e.target.checked,n[t]=l,n})}})]}),(0,o.jsx)("div",{className:e6.nz,children:e.loop&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(g.E,{variant:"text-md/bold",children:"Loop Delay"}),(0,o.jsx)("input",{type:"number",value:e.loopDelay,className:e6.hF,onChange:e=>{f(a=>{let n=[...a],l=a[t];return l.loopDelay=+e.target.value,n[t]=l,n})},contentEditable:!0})]})})]}),(0,o.jsx)("div",{style:{display:"none"},children:(0,o.jsx)(eP.A,{ref:e=>{s.current[`randomized-${t}`]=e},onChange:e=>{let a;null!=(a=k(e))&&(0,eB.Mz)(a,e=>{f(n=>{let l=[...n],i=n[t];if(null==i)return n;let s={...i};return null==s.randomizedSources&&(s.randomizedSources=[]),s.randomizedSources.push({src:e,filename:a.name}),l[t]=s,l})})},multiple:!1})}),(0,o.jsxs)("div",{className:q()(e6.nM,e6._N),children:[(0,o.jsx)(p.$,{variant:"secondary",text:"Add Alternative",onClick:()=>s.current[`randomized-${t}`]?.activateUploadDialogue()}),(0,o.jsx)(p.$,{variant:"critical-secondary",text:"Remove Layer",onClick:()=>{f(t=>t.filter(t=>t!==e))}})]})]},t))]})]})]})},tl="Make sure you're only uploading text files!";function ti(e){let{profileEffect:t,onClick:a}=e,{deleteProfileEffect:n}=(0,eF.wu)();return(0,o.jsxs)(J.D,{className:e6.B0,onClick:a,children:[(0,o.jsx)("div",{className:e6.yV,style:{backgroundImage:`url(${t.effects?.[0]?.base64})`}}),(0,o.jsxs)("div",{className:e6.eL,children:[(0,o.jsx)(g.E,{variant:"text-md/bold",children:t.name}),(0,o.jsx)(p.$,{variant:"critical-secondary",text:"Delete",onClick:e=>{e.preventDefault(),e.stopPropagation(),n(t.skuId)}})]})]})}function ts(){let{profileEffects:e,upsertProfileEffect:t,clearAll:a}=(0,eF.wu)(),[n,l]=c.useState(),i=c.useRef(null),{categories:s}=(0,eU.A)(),r=c.useMemo(()=>(0,eL.Wj)(s),[s]),[d,u]=c.useState(""),m=c.useMemo(()=>""===d?r:r.filter(e=>{let t=d.toLowerCase(),a=e.title?.toLowerCase()??"",n=e.description?.toLowerCase()??"";return a.includes(t)||n.includes(t)}),[d,r]),h=c.useCallback((e,a)=>{if(null==a||!e.type.startsWith("text/"))return(0,eG.Ni)(tl);let[n,l]=a.split(",");if(!n.includes("text/plain"))return(0,eG.Ni)(tl);let i=JSON.parse(atob(l));i.skuId=(0,eO.A)(),t(i),(0,eG.GF)("Profile Effect (maybe??) imported!")},[t]),x=c.useCallback(e=>{e.currentTarget?.files==null?(0,eG.Ni)("Error uploading file. Try again!"):(0,eG.KE)(e.currentTarget.files,h,eG.Ni)},[h]);return(0,o.jsxs)("div",{className:e6.zr,children:[null==n&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:e6.nz,children:[(0,o.jsxs)("div",{className:q()(e6.uW,e6.nM),children:[(0,o.jsx)(X.D,{variant:"heading-xl/bold",children:"Custom Profile Effects"}),(0,o.jsx)(p.$,{variant:"critical-secondary",text:"Clear All",onClick:async()=>{await eM.A.confirm({title:"Clear All Profile Effects",body:"Are you sure you want to clear all profile effects? This cannot be undone.",confirmText:"Clear All",confirmVariant:"critical-primary"})&&(a(),(0,eG.GF)("All profile effects cleared!"))}})]}),(0,o.jsx)("div",{className:e6.Iv,children:Object.values(e).map(e=>(0,o.jsx)(ti,{profileEffect:e,onClick:()=>l(e)},e.skuId))})]}),(0,o.jsxs)("div",{className:q()(e6.nM,e6._N,e6.uW),children:[(0,o.jsxs)("div",{className:e6.au,children:[(0,o.jsx)(g.E,{variant:"text-md/normal",color:"text-overlay-light",children:"Import Shared Config"}),(0,o.jsx)(eP.A,{ref:i,onChange:x,multiple:!1})]}),(0,o.jsx)(p.$,{variant:"primary",text:"Create New Effect",onClick:function(){t({skuId:(0,eO.A)(),name:"New Profile Effect",effects:[]})}})]}),(0,o.jsx)("hr",{}),(0,o.jsxs)("div",{className:e6.uW,children:[(0,o.jsx)(X.D,{variant:"heading-xl/bold",children:"All Effects"}),(0,o.jsx)(b.k,{value:d,onChange:e=>{u(e)}}),(0,o.jsx)("div",{className:e6.xm,children:m.map(e=>(0,o.jsx)(J.D,{className:e6.S5,style:{backgroundImage:`url(${e.thumbnailPreviewSrc})`},onClick:()=>{let t={[eB.qH.THUMBNAIL]:null!=e.thumbnailPreviewSrc&&""!==e.thumbnailPreviewSrc?{src:e.thumbnailPreviewSrc,name:"thumbnail.png",base64:""}:null,[eB.qH.STATIC]:null!=e.staticFrameSrc&&""!==e.staticFrameSrc?{src:e.staticFrameSrc,name:"static.png",base64:""}:null,[eB.qH.REDUCED_MOTION]:null!=e.reducedMotionSrc&&""!==e.reducedMotionSrc?{src:e.reducedMotionSrc,name:"reduced_motion.png",base64:""}:null};l({skuId:e.skuId,name:e.title,effects:e.effects,stillFrames:t,readonly:!0})},children:(0,o.jsx)("div",{className:e6.Hd,children:(0,o.jsx)(g.E,{variant:"text-md/normal",color:"text-overlay-light",children:e.title})})},e.skuId))})]})]}),null!=n&&(0,o.jsx)(tn,{profileEffect:n})]})}var tr=a(935399),to=a(462887),tc=a(289873),td=a(478016),tu=a(565645),tm=a(7584),th=a(619499),tx=a(207803),tp=a(84540),tg=a(836602),tv=a(999291),tj=a(903209),tf=a(841702),tb=a(892118),ty=a(744808),tE=a(965452),tS=a(626768),tC=a(464896);function t_(){let e=(0,eg.Ay)();return(0,o.jsxs)("div",{className:tE.z3,children:[(0,o.jsx)("img",{src:(0,to.M)(e)?tS:tC,alt:""}),(0,o.jsx)(g.E,{variant:"text-sm/normal",children:"No frames found on your account. You must be granted test profile frame entitlements to use this tool."})]})}function tA(){let e=(0,d.bG)([eo.default],()=>eo.default.getCurrentUser()),t=(0,tv.Ay)(e?.id);c.useEffect(()=>{e?.id!=null&&(0,tj.A)(e.id)},[e?.id]);let{purchases:a,isFetchingPurchases:n}=(0,tf.Bf)(),l=c.useMemo(()=>(0,eL.MG)(a,new Map),[a]),[{pendingProfileFrame:i},s]=(0,d.yK)([tg.A],()=>[tg.A.getPendingChanges(),tg.A.showNotice()]),r=void 0===i?t?.profileFrame:i,u=null!=r?a.get(r.skuId):void 0,m=(0,tb.s)(u?.items[0])?u.items[0]:void 0;return(0,tr.l0)(tx.RE),(0,o.jsxs)("div",{className:tE.kL,children:[(0,o.jsxs)(X.D,{variant:"heading-xl/bold",children:[(0,o.jsx)(tu.A,{emojiName:tm.Ay.getByName("frame_with_picture")?.surrogates,className:tE.Zg}),"Profile Frames!"]}),0===l.length&&n&&(0,o.jsx)(tc.y,{}),0===l.length&&!n&&(0,o.jsx)(t_,{}),l.length>0&&(0,o.jsxs)("div",{className:tE.MK,children:[(0,o.jsx)(g.E,{variant:"text-sm/normal",children:"Select a frame to preview. Save to apply the frame to your main profile."}),(0,o.jsxs)("ul",{className:tE.p_,children:[(0,o.jsx)("li",{children:(0,o.jsx)(p.$,{text:"None",variant:"secondary",fullWidth:!0,icon:null==r?td.U:void 0,disabled:null==r,onClick:()=>(0,tp.p)({profileFrame:null})})},"none"),l.map(e=>{let t=a.get(e.skuId);return null==t?null:(0,o.jsx)("li",{children:(0,o.jsx)(p.$,{text:t.name,variant:"secondary",fullWidth:!0,icon:r?.skuId===e.skuId?td.U:void 0,disabled:r?.skuId===e.skuId,onClick:()=>(0,tp.p)({profileFrame:e})})},e.skuId)})]}),s&&(0,o.jsx)(th.A,{}),(0,o.jsxs)("div",{className:tE.VH,children:[(0,o.jsx)(g.E,{variant:"text-sm/normal",children:"Preview:"}),(0,o.jsxs)("div",{className:tE.ME,children:[(0,o.jsx)("img",{src:e8.A,alt:""}),null!=m&&(0,o.jsx)(ty.A,{frame:m,isPreview:!0})]})]})]})]})}var tN=a(702841),tk=a(793574),tI=a(590180),tD=a(4227),tT=a(258245),tR=a(61750),tw=a(73153),tO=a(499454),tM=a(202541);let tP="devtools-collectibles-gift";async function tL(e){let{skuId:t,sender:a}=e,n={code:tP,user:{id:a.id},sku_id:t,uses:0,max_uses:1,expires_at:null,redeemed:!1,application_id:em.FYj,gift_style:tM.o2.STANDARD_BOX};await tw.h.dispatch({type:"GIFT_CODE_RESOLVE_SUCCESS",giftCode:n}),(0,tO.h)({processedCode:tP})}var tU=a(80101);let tG=e=>{let[t,a]=c.useState(0);return c.useLayoutEffect(()=>{let e=tD.A.getPurchase;return tD.A.getPurchase=e=>void 0,tD.A.emitChange(),a(1),()=>{tD.A.getPurchase=e,tD.A.emitChange()}},[]),(0,o.jsx)("div",{className:tU.Do,children:(0,o.jsx)(tT.A,{...e},t)})},tF=()=>{let e=(0,tN.bG)([eo.default],()=>eo.default.getCurrentUser()),t=(0,tN.bG)([tI.A],()=>tI.A.categories),a=(0,tN.bG)([tD.A],()=>tD.A.purchases),n=(0,tN.bG)([tI.A],()=>tI.A.lastSuccessfulFetch),l=t.size>0&&a.size>0&&null!=n,{isFetching:i,categories:s}=(0,tf.Ay)({logPerf:!1,stalePurchasesOK:!0,noOp:l}),r=l?t:s,d=l||!i&&r.size>0,[u,m]=c.useState(""),[h,x]=c.useState(null),[v,j]=c.useState(null);return(c.useEffect(()=>{if(""===u.trim()||!d){x(null),j(null);return}let e=tI.A.getProduct(u),t=tI.A.getCategoryForProduct(u);null!=e&&null!=t?(x(e),j(t)):(x(null),j(null))},[u,d]),i)?(0,o.jsx)(g.E,{variant:"text-md/normal",children:"Loading categories and collectibles..."}):null==e?(0,o.jsx)(g.E,{variant:"text-md/normal",children:"No user found"}):(0,o.jsxs)("div",{className:tU.kL,children:[(0,o.jsxs)("div",{className:tU.uW,children:[(0,o.jsx)(X.D,{variant:"heading-lg/semibold",children:"Product Configuration"}),(0,o.jsxs)("div",{className:tU.qp,children:[(0,o.jsx)(g.E,{variant:"text-md/semibold",className:tU.NB,children:"Primary Product SKU ID"}),(0,o.jsx)(b.k,{value:u,onChange:m,placeholder:"Enter product SKU ID"}),!d&&""!==u.trim()&&(0,o.jsx)(g.E,{variant:"text-sm/normal",className:tU.KQ,children:"Loading products..."}),d&&""!==u.trim()&&null==h&&(0,o.jsx)(g.E,{variant:"text-sm/normal",className:tU.kc,children:"Product not found"}),null!=h&&(0,o.jsxs)(g.E,{variant:"text-sm/normal",className:tU.xT,children:["Found: ",h.name]})]})]}),(0,o.jsxs)("div",{className:tU.uW,children:[(0,o.jsx)(X.D,{variant:"heading-lg/semibold",children:"Product Preview"}),null!=h&&null!=v?(0,o.jsxs)("div",{className:tU.i1,children:[(0,o.jsx)(tG,{skuId:h.skuId}),(0,o.jsx)(p.$,{variant:"primary",onClick:function(){null!=h&&null!=e&&(0,tR.A)({product:h,analyticsLocations:[tk.A.COLLECTIBLES_SHOP_CARD]})},text:"Show Collectibles Collected Modal"}),(0,o.jsx)(p.$,{variant:"primary",onClick:function(){null!=h&&null!=e&&tL({skuId:h.skuId,sender:e})},text:"Show Gift Accept Modal"})]}):(0,o.jsx)("div",{className:tU.qf,children:(0,o.jsx)(g.E,{variant:"text-md/normal",className:tU.X2,children:"Enter a valid product SKU ID to see the preview"})})]})]})};var tB=a(646695);let t$={profile_effects:1,nameplates:2,profile_frames:3,product_preview:4};function tV(e){let{setTab:t}=e,n=(0,d.bG)([et.A],()=>et.A.getWindowOpen(em.MLl.DEVTOOLS_POPOUT));return(0,o.jsxs)("div",{className:tB.Qs,children:[(0,o.jsx)(J.D,{onClick:()=>{t(1)},children:(0,o.jsx)("div",{className:q()(tB.vK,tB.Dg),children:(0,o.jsx)(g.E,{variant:"text-md/bold",color:"text-overlay-light",children:"Profile Effects"})})}),(0,o.jsx)(J.D,{onClick:()=>{t(2)},children:(0,o.jsx)("div",{className:q()(tB.vK,tB.st),children:(0,o.jsx)(g.E,{variant:"text-md/bold",color:"text-overlay-light",children:"Nameplates"})})}),(0,o.jsx)(J.D,{onClick:()=>{t(3)},children:(0,o.jsx)("div",{className:q()(tB.vK,tB.BW),children:(0,o.jsx)(g.E,{variant:"text-md/bold",color:"text-overlay-light",children:"Profile Frames"})})}),(0,o.jsx)(J.D,{onClick:()=>{t(4)},children:(0,o.jsx)("div",{className:q()(tB.vK,tB.IP),children:(0,o.jsx)(g.E,{variant:"text-md/bold",color:"text-overlay-light",children:"Products"})})}),!n&&(0,o.jsx)("div",{style:{marginTop:16},children:(0,o.jsx)(Q.w,{type:"warning",title:"Not enough space?",message:"You can pop out the DevTools to see the full layout.",action:{text:"Popout DevTools",onClick:()=>Promise.all([a.e("868577"),a.e("253209")]).then(a.bind(a,902592)).then(e=>{let{openDevToolsPopout:t}=e;return t()})},role:"none"})})]})}let tW=function(){let[e,t]=c.useState(()=>{let e=ee.A.lastOpenSubTabId;return null!=e&&e in t$?t$[e]:0});return c.useEffect(()=>{null!=ee.A.lastOpenSubTabId&&(0,Z.Jt)({lastOpenSubTabId:null})},[]),(0,o.jsxs)(v.Ip,{className:tB.iE,children:[(0,o.jsxs)("div",{className:tB.C$,children:[(0,o.jsx)(X.D,{variant:"heading-xxl/medium",children:"Collectibles DevTools"}),0!==e&&(0,o.jsx)(p.$,{variant:"primary",onClick:()=>t(0),text:"Back"})]}),function(){switch(e){case 1:return(0,o.jsx)(ts,{});case 2:return(0,o.jsx)(eA,{});case 3:return(0,o.jsx)(tA,{});case 4:return(0,o.jsx)(tF,{});default:return(0,o.jsx)(tV,{setTab:t})}}()]})};var tH=a(681154),tz=a(306264),tK=a(506774),tY=a(331322),tq=a(587895),tJ=a(429913),tQ=a(475825),tX=a(730441);function tZ(e){let{columns:t,data:a,className:n,rowClassName:l,onClickRow:i,selectedRowKey:s,rowHeight:r=40}=e,d=c.useMemo(()=>t.map(e=>({renderHeader:()=>(0,o.jsx)(g.E,{variant:"text-sm/semibold",children:e.key}),...e})),[t]),u=0===a.length?[1]:[a.length];return(0,o.jsx)("div",{className:tX.CZ,children:(0,o.jsx)(tQ.OZ,{className:n,innerClassName:tX.tp,sections:u,sectionHeight:40,renderSection:e=>{let{section:t}=e,n=tX.ZR;return(0,o.jsx)("div",{className:n,children:d.map(e=>{let n=e.cellClassName,l={width:`calc(${e.cellWidth??"1fr"} - 16px)`};return(0,o.jsx)("div",{className:n,style:l,children:e.renderHeader?.(e,a)},`dev-tools-th-${t}-${e.key}`)})},`dev-tools-header-${t}`)},rowHeight:r,renderRow:e=>{let{rowIndex:t}=e,n=a[t];if(null==n)return null;let c=n.key,u=q()(tX.jD,{[tX.wD]:c===s,rowClassName:l});return(0,o.jsx)(J.D,{className:u,onClick:()=>i?.(n),children:d.map(e=>{let a=e.cellClassName,l={width:`calc(${e.cellWidth??"1fr"} - 16px)`,height:`calc(${r}px - 16px)`};return(0,o.jsx)("div",{className:a,style:l,children:e.render?.(n,void 0,t)},`dev-tools-td-${t}-${e.key}`)})},`dev-tools-tr-${t}`)}})})}var t0=a(409626),t1=a(692969),t2=a(760751),t5=a(403362),t3=a(435738),t6=a(99753),t8=a(402860),t4=a(574520),t7=a(808323),t9=a(583846),ae=a(424994),at=a(14570);function aa(e){let{id:t}=e,a=(0,d.bG)([eo.default],()=>eo.default.getUser(t));return null==a?null:(0,o.jsx)(J.D,{className:at._,onClick:function(){(0,t8.openUserProfileModal)({sourceAnalyticsLocations:[tk.A.DEV_TOOLS],userId:t})},children:(0,o.jsx)(g.E,{variant:"text-md/semibold",children:a.username})})}function an(){let e=(0,d.bG)([t6.A],()=>t6.A.getFeed(ae.X1.GLOBAL_FEED)),t=(0,d.bG)([t6.A],()=>t6.A.getFilters()),a=(0,d.cf)([t4.A],()=>{let t={};for(let a of e?.entries??[])t[(0,t4.$)(a.content)]=t4.A.canRenderContent(a.content);return t},[e]),n=(0,d.bG)([t3.A],()=>t3.A.getImpressionCappedItemIds());if(null==t)return null;let l=e?.entries?.flatMap(e=>{let{content:l}=e;if(!(0,t7.l)(t,l))return[];let i=a[(0,t4.$)(l)];return(0,o.jsxs)("li",{className:at.p,children:[(0,o.jsx)(aa,{type:l.author_type,id:l.author_id}),!i&&(0,o.jsx)(g.E,{variant:"text-md/normal",children:"Expired or no matching presence"}),(0,t9.I5)(l)&&(0,o.jsxs)(g.E,{variant:"text-md/normal",children:["Expired at ",l.expires_at]}),n.has(l.id)&&(0,o.jsx)(g.E,{variant:"text-md/normal",children:"Impression capped"})]},l.id)});return(0,o.jsxs)("div",{children:[(0,o.jsx)(X.D,{variant:"heading-md/semibold",children:"Selected Content"}),null!=l?(0,o.jsx)("ul",{children:l}):(0,o.jsx)("div",{children:"(none?)"})]})}var al=a(576470),ai=a(693879);function as(){let e=(0,d.bG)([t6.A],()=>t6.A.getFeed(ae.X1.GLOBAL_FEED)?.refresh_stale_inbox_after_ms!=null),{loading:t,nextFetchDate:a}=(0,d.cf)([t6.A],()=>t6.A.getFeedState(ae.X1.GLOBAL_FEED)??{loading:!1}),n=(0,d.bG)([t6.A],()=>t6.A.getLastFeedFetchDate(ae.X1.GLOBAL_FEED));return(0,o.jsxs)("div",{children:[t?(0,o.jsx)(g.E,{variant:"text-md/normal",children:"(fetching)"}):(0,o.jsxs)(g.E,{variant:"text-md/normal",children:["Next fetch: ",null!=a?(0,o.jsx)(al.A,{deadline:a}):e?"(awaiting push)":"(unscheduled)"]}),(0,o.jsxs)(g.E,{variant:"text-md/normal",children:["Last fetch:"," ",null!=n?(0,o.jsx)(ai.z,{inline:!0,entry:{start:n.getTime()}}):"(never)"]})]})}var ar=a(225418);let ao=[{key:"type",cellClassName:q()(ar.Hn,ar.T$),render(e){let{type:t}=e;return(0,o.jsx)(g.E,{variant:"text-md/semibold",children:tH.ContentInventoryEntryType[t]})}},{key:"count",cellClassName:q()(ar.Hn,ar.MX),render(e){let{entries:t}=e;return(0,o.jsx)("div",{children:(0,o.jsx)(g.E,{variant:"text-md/normal",children:t.length})})}},{key:"only?",cellClassName:ar.Hn,render(e){let{type:t}=e;return(0,o.jsx)(ac,{type:t})}}];function ac(e){let{type:t}=e,a=(0,d.bG)([t6.A],()=>t6.A.getFilters()),n=a?.types?.has(t)??!1;return(0,o.jsx)(h.d,{checked:n,onChange:function(){n?tw.h.dispatch({type:"CONTENT_INVENTORY_SET_FILTERS",filters:void 0}):tw.h.dispatch({type:"CONTENT_INVENTORY_SET_FILTERS",filters:{types:new Set([t])}})}})}function ad(){var e;let t,a=(0,d.bG)([t6.A],()=>t6.A.getFeed(ae.X1.GLOBAL_FEED)),n=(0,d.bG)([t6.A],()=>t6.A.getDebugImpressionCappingDisabled()),l=(0,d.bG)([t3.A],()=>t3.A.getDebugFastImpressionCappingEnabled()),i=(e=a?.entries?.map(e=>e.content),Object.keys(t=e1().groupBy(e,e=>e.content_type)).map(e=>{let a=t[e];return{key:`${e}`,type:a[0].content_type,entries:a}})),s=(0,d.bG)([t6.A],()=>t6.A.getFeedState(ae.X1.GLOBAL_FEED)?.loading===!0),[r,u]=c.useState(""),m=(0,d.bG)([t2.A,tq.A],()=>parseInt(r)>0?r:t2.A.searchGamesByName(r)[0]??tq.A.getApplicationByName(r)?.id,[r]),h=(0,t1.A)({applicationId:m,location:"DevToolsContentInventory",source:t0.GameProfileSources.DevTools}),x=Object.entries(tK.w.get("GameProfileModal")??{}).filter(e=>{let[t,a]=e;return a}).map(e=>{let[t]=e;return t}),j=(0,tJ.A)(x).filter(t5.Vq);return(0,o.jsx)("div",{className:tX.nd,children:(0,o.jsxs)(v.Ip,{className:ar.Qs,children:[(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsx)(g.E,{variant:"text-md/semibold",children:"Inventory"}),i.length>0&&(0,o.jsx)(tZ,{columns:ao,data:i}),(0,o.jsx)(as,{}),(0,o.jsx)(p.$,{variant:"primary",text:"Refresh Now",fullWidth:!0,onClick:function(){tw.h.dispatch({type:"CONTENT_INVENTORY_MANUAL_REFRESH",feedId:ae.X1.GLOBAL_FEED,feature:tz.M.INBOX})},loading:s})]}),(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsx)(g.E,{variant:"text-md/semibold",children:"Impression Capping"}),(0,o.jsx)(p.$,{variant:"primary",text:"Clear Impressions",fullWidth:!0,onClick:function(){tw.h.dispatch({type:"CONTENT_INVENTORY_DEBUG_CLEAR_IMPRESSIONS"})}}),(0,o.jsx)(p.$,{variant:"primary",text:"Log Impressions",fullWidth:!0,onClick:function(){tw.h.dispatch({type:"CONTENT_INVENTORY_DEBUG_LOG_IMPRESSIONS"})}}),(0,o.jsx)(p.$,{variant:"primary",text:n?"Enable Impression Capping":"Disable Impression Capping",fullWidth:!0,onClick:function(){tw.h.dispatch({type:"CONTENT_INVENTORY_DEBUG_TOGGLE_IMPRESSION_CAPPING"})}}),(0,o.jsx)(p.$,{variant:"primary",text:l?"Disable Fast Impression Capping":"Enable Fast Impression Capping",fullWidth:!0,onClick:function(){tw.h.dispatch({type:"CONTENT_INVENTORY_DEBUG_TOGGLE_FAST_IMPRESSION_CAPPING"})}})]}),!1,(0,o.jsx)(an,{}),(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsx)(g.E,{variant:"text-md/semibold",children:"Game Profile"}),(0,o.jsx)(b.k,{placeholder:"App ID or full name",onChange:e=>(0===e.length||e.length>=18)&&u(e),onKeyDown:e=>{"Enter"===e.key&&(r===e.currentTarget.value?h?.(e):u(e.currentTarget.value))},error:r.length>0&&null==h?`No game profile for ${m??r+" - try by id"}.`:void 0,helperText:null!=h?"Game profile found":void 0}),(0,o.jsx)("ul",{children:j.map(e=>(0,o.jsx)("li",{children:(0,o.jsx)(au,{application:e})},`follow-game-${e.id}`))})]})]})})}function au(e){let{application:t}=e,a=(0,t1.A)({applicationId:t.id,location:"DevToolsContentInventory",source:t0.GameProfileSources.DevTools});return(0,o.jsx)(J.D,{onClick:a,children:(0,o.jsx)(g.E,{variant:"text-xs/normal",color:"text-muted",children:t.name})})}var am=a(267355),ah=a(233741),ax=a(222506),ap=a(567249),ag=a(188321),av=a(25202);function aj(e){let{label:t,value:a}=e;return(0,o.jsxs)(tY.B,{direction:"horizontal",gap:8,children:[(0,o.jsx)(g.E,{variant:"text-md/normal",color:"text-muted",children:t}),(0,o.jsx)(g.E,{variant:"text-md/medium",children:a})]})}function af(e){return e?"yes":"no"}function ab(e){return e>0?`${e} fps`:"uncapped"}function ay(){let e=(0,d.cf)([ag.A,ah.A,ax.A,ap.A],()=>({storedEnabledChoice:ag.A.getStoredEnabledChoice(),hasRunningGame:ag.A.hasRunningGame,isThrottling:ag.A.isThrottling,frameRate:(0,av.A)(),overlayFrameRate:(0,av.j)(),isOverlayOpen:(0,am.D)(),isDiscordFocused:ag.A.isDiscordFocused,isDiscordHovered:ag.A.isDiscordHovered})),t=e.isThrottling?null:!1===e.storedEnabledChoice?"Turned off in Settings > System > Game Mode.":e.hasRunningGame?e.isDiscordFocused?"Relaxed: levers lift while Discord is focused.":e.isDiscordHovered?"Relaxed: levers lift while the cursor is over Discord.":"The 2026-08-game-mode experiment is off for this account.":"No non-launcher game is running.";return(0,o.jsxs)(tY.B,{gap:32,padding:12,fullWidth:!1,children:[(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsx)(X.D,{variant:"heading-md/bold",children:"Status"}),(0,o.jsx)(aj,{label:"Throttling",value:af(e.isThrottling)}),(0,o.jsx)(aj,{label:"Running game detected",value:af(e.hasRunningGame)}),(0,o.jsx)(aj,{label:"Discord focused",value:af(e.isDiscordFocused)}),(0,o.jsx)(aj,{label:"Discord hovered",value:af(e.isDiscordHovered)}),null!=t&&(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-muted",children:t}),(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-muted",children:"Set a debug running game from the Detected Games tab to simulate a game."})]}),(0,o.jsx)(y.c,{}),(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsx)(X.D,{variant:"heading-md/bold",children:"Applied Levers"}),(0,o.jsx)(aj,{label:"Frame rate cap",value:ab(e.frameRate)}),(0,o.jsx)(aj,{label:"Overlay frame rate cap",value:ab(e.overlayFrameRate)}),(0,o.jsx)(aj,{label:"Reduce motion",value:af(e.isThrottling)}),(0,o.jsx)(aj,{label:"Pause animated media",value:af(e.isThrottling)}),(0,o.jsx)(aj,{label:"Overlay open",value:af(e.isOverlayOpen)}),(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-muted",children:"Levers key off Throttling, except the frame rate caps: the main cap also lifts while the overlay is open, and the overlay cap holds whenever game mode is active, ignoring focus and hover. Values live in GameModeConstants.tsx."})]})]})}var aE=a(890497),aS=a(769015),aC=a(311043),a_=a(454908),aA=a(282435);function aN(e){return aA.jN.get(e)??0}function ak(e){let{gameId:t}=e,{data:a,isLoading:n}=(0,a_.I)(t),l=(0,d.bG)([aC.A],()=>aC.A.hasNoData(t),[t]);return n||null==a&&!l?(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-muted",children:"Loading\u2026"}):null==a?(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-feedback-critical",children:["No game found for ID ",t]}):(0,o.jsxs)(tY.B,{direction:"horizontal",gap:8,align:"center",children:[(0,o.jsx)(aS.A,{game:a,size:aS.M.SMALL}),(0,o.jsxs)(tY.B,{gap:0,children:[(0,o.jsx)(g.E,{variant:"text-md/semibold",children:a.name}),(0,o.jsx)(g.E,{variant:"text-xxs/normal",color:"text-muted",children:a.id})]})]})}function aI(){let[e,t]=c.useState(null),[a,n]=c.useState(""),l=(0,d.bG)([t2.A],()=>t2.A.games),i=c.useMemo(()=>l.filter(e=>null!=e.name&&""!==e.name).map(e=>({id:e.id,value:e.id,label:e.name})).sort((e,t)=>aN(t.value)-aN(e.value)),[l]),s=c.useMemo(()=>({baseSort:(e,t)=>aN(t.item.value)-aN(e.item.value),keys:["label"]}),[]),r=c.useCallback(e=>{t(e),null!=e&&n("")},[]),u=c.useCallback(e=>{n(e),e.trim().length>0&&t(null)},[]),m=a.trim(),h=m.length>0?m:e??void 0,x=(0,t1.A)({gameId:h,location:"DevToolsGameProfile",source:t0.GameProfileSources.DevTools});return(0,o.jsx)("div",{className:tX.nd,children:(0,o.jsxs)(tY.B,{gap:32,padding:12,fullWidth:!1,children:[(0,o.jsxs)(tY.B,{gap:4,children:[(0,o.jsx)(X.D,{variant:"heading-md/bold",children:"Game Profile"}),(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-muted",children:"Search for a game by name, or paste a game ID, then open its profile."})]}),(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsx)(X.D,{variant:"heading-sm/bold",children:"Search"}),(0,o.jsx)(aE.Z,{label:"Search games",hideLabel:!0,placeholder:"Search for a game\u2026",options:i,value:m.length>0?void 0:e??void 0,onSelectionChange:r,selectionMode:"single",clearable:!0,matchSorterOptions:s})]}),(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsx)(X.D,{variant:"heading-sm/bold",children:"Game ID"}),(0,o.jsx)(b.k,{label:"Game ID",hideLabel:!0,placeholder:"Paste a game ID",value:a,onChange:u}),m.length>0&&(0,o.jsx)(ak,{gameId:m})]}),(0,o.jsx)(p.$,{variant:"primary",text:"Open Game Profile",fullWidth:!0,disabled:null==x,onClick:x??void 0})]})})}var aD=a(923477),aT=a(750672);function aR(){let e=(0,aD.O)(e=>e.requestHighlightFirstCard);return(0,o.jsxs)("div",{className:q()(tX.nd,aT.k),children:[(0,o.jsx)(X.D,{variant:"heading-lg/normal",children:"Game Server Hosting"}),(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-muted",children:'Replays the post-purchase scroll + highlight on the first card in the "Your game servers" list, exactly like clicking "View game server" after checkout. Open the Game Servers shop tab (/shop?tab=game-servers) with at least one owned server first.'}),(0,o.jsx)(p.$,{variant:"secondary",text:"Run post-purchase highlight (first card)",onClick:e})]})}var aw=a(554146),aO=a(594061),aM=a(617617),aP=a(355898),aL=a(644103),aU=a(574560),aG=a(434265);let aF=[aw.M.GAME_ACCOUNT_LINK_RECURRING_UPSELL,aw.M.APP_WIDGET_V2_PROFILE_UPSELL_COACHMARK,aw.M.APP_WIDGET_V2_PROFILE_UPSELL_SUGGESTED].map(e=>({id:String(e),label:aw.M[e],value:e})),aB={"global-cooldown":"global cooldown","per-game-cooldown":"per-game cooldown",disabled:"disabled"};function a$(){let[e,t]=c.useState("dismissals"),[a,n]=c.useState(aw.M.GAME_ACCOUNT_LINK_RECURRING_UPSELL),l=(0,d.bG)([aM.A],()=>aM.A.settings.userContent?.recurringDismissibleContentStates[a]??null),i=(0,d.bG)([aU.A],()=>aU.A.getAllGameUpsellDismissals(a)),s=c.useMemo(()=>Object.keys(i??{}),[i]),r=(0,tJ.A)(s),[u,m]=c.useState(""),[h,x]=c.useState([]);c.useEffect(()=>(0,aL.Y)(e=>{x(t=>[e,...t].slice(0,100))}),[]);let v=c.useMemo(()=>{let e=new Set;for(let t of h)for(let a of t.applicationIds)e.add(a);return[...e]},[h]),j=(0,tJ.A)(v),E=c.useMemo(()=>Object.fromEntries(v.map((e,t)=>[e,j[t]])),[v,j]),S=l?.lastDismissedAtMs!=null&&"0"!==l.lastDismissedAtMs?new Date(Number(l.lastDismissedAtMs)).toLocaleString():"Never";return(0,o.jsxs)("div",{className:aG.nd,children:[(0,o.jsxs)("div",{className:aG.$H,children:[(0,o.jsx)(J.D,{className:q()(aG.V3,{[aG.u7]:"dismissals"===e}),onClick:()=>t("dismissals"),children:"Dismissals"}),(0,o.jsxs)(J.D,{className:q()(aG.V3,{[aG.u7]:"call-log"===e}),onClick:()=>t("call-log"),children:["Call Log ",h.length>0?`(${h.length})`:""]})]}),"dismissals"===e?(0,o.jsxs)("div",{className:aG.Lj,children:[(0,o.jsx)("div",{className:aG.uW,children:(0,o.jsx)(f.l,{label:"Dismissible Content",value:a,onSelectionChange:e=>n(e),options:aF,selectionMode:"single",fullWidth:!0})}),(0,o.jsxs)("div",{className:aG.uW,children:[(0,o.jsx)(X.D,{variant:"heading-md/bold",children:"Global DCF State"}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",children:["Last dismissed: ",S]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",children:["Times dismissed: ",l?.numTimesDismissed??0]}),(0,o.jsx)(p.$,{variant:"secondary",text:"Reset Global DCF State",onClick:()=>(0,aO._N)(a)})]}),(0,o.jsxs)("div",{className:aG.uW,children:[(0,o.jsx)(X.D,{variant:"heading-md/bold",children:"Mark as Dismissed"}),(0,o.jsx)(b.k,{label:"Game ID",value:u,onChange:e=>m(e),placeholder:"Enter Game ID"}),(0,o.jsx)(p.$,{variant:"secondary",text:"Mark as Dismissed",disabled:""===u.trim(),onClick:()=>{(0,aP.M)([u.trim()],a),m("")}})]}),(0,o.jsx)(y.c,{}),(0,o.jsxs)("div",{className:q()(aG.uW,aG.LY),children:[(0,o.jsxs)(X.D,{variant:"heading-md/bold",children:["Per-Game Dismissals (",s.length,")"]}),0===s.length?(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-muted",children:"No dismissal data for this content type."}):(0,o.jsxs)(o.Fragment,{children:[s.map((e,t)=>{let n=r[t],l=i?.[e];if(null==l)return null;let s=n?.getIconURL(32);return(0,o.jsxs)("div",{className:aG.Nr,children:[(0,o.jsxs)("div",{className:aG.MY,children:[null!=s&&(0,o.jsx)("img",{src:s,alt:"",className:aG.Z2}),(0,o.jsxs)("div",{className:aG.qi,children:[(0,o.jsx)(g.E,{variant:"text-sm/semibold",children:n?.name??"Unknown App"}),(0,o.jsx)(g.E,{variant:"text-xs/normal",color:"text-muted",children:e})]}),(0,o.jsx)(p.$,{variant:"secondary",text:"Clear",onClick:()=>(0,aP.e)(e,a)})]}),(0,o.jsxs)(g.E,{variant:"text-xs/normal",children:["Last dismissed: ",new Date(l.dismissedAt).toLocaleString()]}),(0,o.jsxs)(g.E,{variant:"text-xs/normal",children:["Times dismissed: ",l.timesDismissed]})]},e)}),(0,o.jsx)(p.$,{variant:"critical-primary",text:"Clear All",onClick:()=>{for(let e of s)(0,aP.e)(e,a)}})]})]})]}):(0,o.jsx)("div",{className:aG.Lj,children:(0,o.jsxs)("div",{className:aG.uW,children:[(0,o.jsxs)("div",{className:aG.aq,children:[(0,o.jsxs)(X.D,{variant:"heading-md/bold",children:["Hook Calls (",h.length,")"]}),(0,o.jsx)(p.$,{variant:"secondary",text:"Clear",onClick:()=>x([])})]}),0===h.length?(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-muted",children:"No calls recorded yet. Hook calls to useShouldShowGameUpsellForMultipleGames will appear here."}):h.map((e,t)=>(0,o.jsxs)("div",{className:aG.Nr,children:[(0,o.jsxs)("div",{className:aG.O9,children:[(0,o.jsx)(g.E,{variant:"text-xs/semibold",children:new Date(e.timestamp).toLocaleTimeString()}),e.disabled&&(0,o.jsx)("span",{className:aG.t7,children:"(disabled)"}),(0,o.jsx)(g.E,{variant:"text-xs/normal",color:"text-muted",children:aw.M[e.dismissibleContent]})]}),0===e.applicationIds.length?(0,o.jsx)(g.E,{variant:"text-xs/normal",color:"text-muted",children:"No apps"}):e.applicationIds.map(t=>{let a=E[t],n=a?.getIconURL(20),l=e.eligibleToShow.includes(t),i=e.excludedReasons[t];return(0,o.jsxs)("div",{className:aG.Ss,children:[null!=n&&(0,o.jsx)("img",{src:n,alt:"",className:aG.rb}),(0,o.jsx)("span",{className:aG.Jd,children:a?.name??t}),l?(0,o.jsx)("span",{className:aG.OK,children:"eligible"}):null!=i?(0,o.jsx)("span",{className:aG.t7,children:aB[i]}):null]},t)})]},t))]})})]})}var aV=a(696986),aW=a(47167),aH=a(734057),az=a(994500),aK=a(310031),aY=a(394953),aq=a(618216);let aJ=[{key:"channelName",cellClassName:q()(aq.Hn,aq.HA),render(e){let{channelName:t}=e;return(0,o.jsx)(g.E,{variant:"text-md/normal",children:t})}},{key:"channelId",cellClassName:q()(aq.Hn,aq.Zm),render(e){let{channelId:t}=e;return(0,o.jsx)(g.E,{variant:"text-md/normal",children:t})}}],aQ=[{key:"channelName",cellClassName:q()(aq.Hn,aq.HA),render(e){let{channelName:t}=e;return(0,o.jsx)(g.E,{variant:"text-md/normal",children:t})}},{key:"loadState",cellClassName:q()(aq.Hn,aq.C7),render(e){let{loadState:t}=e;return(0,o.jsx)(g.E,{variant:"text-md/normal",children:t})}},{key:"channelId",cellClassName:q()(aq.Hn,aq.Zm),render(e){let{channelId:t}=e;return(0,o.jsx)(g.E,{variant:"text-md/normal",children:t})}}];function aX(){let{unreadRecentMentionsCount:e,unreadChannelIds:t}=(0,aY.U4)(),{isLoading:a,hasLoadedEver:n,hasPreloaded:l,hasMoreToLoad:i,isLoadingComplete:s}=(0,tN.cf)([aK.A],()=>({isLoading:aK.A.isLoading,hasLoadedEver:aK.A.hasLoadedEver,hasPreloaded:aK.A.hasPreloaded,hasMoreToLoad:aK.A.hasMoreToLoad,isLoadingComplete:aK.A.isLoadingComplete})),r=(0,tN.bG)([aK.A],()=>aK.A.currentRequestAnalyticsPayload),c=(0,tN.cf)([aK.A],()=>aK.A.getChannelInfoMap()),d=(0,tN.cf)([aH.A],()=>{let e={};return Object.entries(c).forEach(t=>{let[a]=t,n=aH.A.getChannel(a);e[a]=n??null}),e}),u=(0,tN.cf)([aH.A],()=>t.reduce((e,t)=>{let a=aH.A.getChannel(t);return e[t]=a??null,e},{})),m=(0,tN.bG)([aK.A],()=>aK.A.getInboxMessages()),x=(0,tN.bG)([aK.A],()=>aK.A.getDevOverrides().navOnClick);return(0,o.jsx)("div",{className:tX.nd,children:(0,o.jsxs)(v.Ip,{className:aq.Qs,children:[(0,o.jsxs)("div",{children:[(0,o.jsx)(X.D,{variant:"heading-lg/semibold",children:"Inbox"}),(0,o.jsxs)("div",{children:["Inbox Message Count: ",m.length]})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(X.D,{variant:"heading-lg/semibold",children:"Dev Overrides"}),(0,o.jsx)("div",{style:{display:"flex",alignItems:"center",marginTop:8},children:(0,o.jsx)(h.d,{label:"Nav On Click",checked:!!x,onChange:e=>{tw.h.dispatch({type:"NOTIFICATIONS_INBOX_SET_DEV_OVERRIDES",navOnClick:e})}})})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(X.D,{variant:"heading-lg/semibold",children:"Unreads and Badging"}),(0,o.jsx)(aV.h,{size:8}),(0,o.jsxs)("div",{children:["Unread Recent Mentions Count: ",e]}),(0,o.jsxs)("div",{children:["Unread Channel Count: ",t.length]}),(0,o.jsx)(tZ,{columns:aJ,data:Object.entries(u).map(e=>{let[t,a]=e;return{key:t,channelId:t,channelName:null!=a?(0,aW.m1)(a,eo.default,az.A):""}})})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(X.D,{variant:"heading-lg/semibold",children:"Store State"}),(0,o.jsxs)("div",{children:["Is Loading: ",a?"\u2705":"\u274C"]}),(0,o.jsxs)("div",{children:["Has Preloaded: ",l?"\u2705":"\u274C"]}),(0,o.jsxs)("div",{children:["Has Loaded Ever: ",n?"\u2705":"\u274C"]}),(0,o.jsxs)("div",{children:["Has More To Load: ",i?"\u2705":"\u274C"]}),(0,o.jsxs)("div",{children:["Is Loading Complete: ",s?"\u2705":"\u274C"]}),(0,o.jsxs)("div",{children:["Last Loading Trigger: ",r?.loadingTrigger]})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(X.D,{variant:"heading-lg/semibold",children:"Channel Info Map"}),(0,o.jsxs)("div",{children:["Total Channels: ",Object.keys(c).length]}),(0,o.jsx)(tZ,{columns:aQ,data:Object.entries(c).map(e=>{let t,[a,n]=e;return{key:a,channelId:a,channelName:null!=(t=d[a])?(0,aW.m1)(t,eo.default,az.A):"",loadState:n.loadState}})})]})]})})}var aZ=a(976860),a0=a(396813),a1=a(786800);let a2=function(){return(0,o.jsxs)("div",{className:a1.k,children:[(0,o.jsx)(g.E,{variant:"text-md/normal",color:"text-feedback-info",style:{marginBottom:"8px"},children:"Click the button below to clear your Minor Reward Capping History."}),(0,o.jsx)(p.$,{onClick:()=>{(0,a0.Ov)(),(0,aZ.pX)(em.BVt.QUEST_HOME)},text:"Clear History"}),(0,o.jsx)(g.E,{variant:"text-md/normal",color:"text-feedback-info",children:"Your may have to refresh your client after being redirected to the Quest Home in order to see these changes."})]})};var a5=a(271866),a3=a(868511),a6=a(147964),a8=a(713913),a4=a(13981),a7=a(760716),a9=a(115093),ne=a(970628);let nt=window.GLOBAL_ENV.RELEASE_CHANNEL===a9.B.STAGING?"1438571444891025408":"1346069614634864772";function na(){let e=(0,a7.i)(e=>e.overrideApplicationId),t=(0,a7.i)(e=>e.setOverrideApplicationId),a=null!=e,n=(0,a7.i)(e=>e.overrideNitroEligibilityForSocialLayerStorefront),l=(0,a7.i)(e=>e.setOverrideNitroEligibilityForSocialLayerStorefront),i=(0,a7.i)(e=>e.isNitroEligibleForSocialLayerStorefront),s=(0,a7.i)(e=>e.setIsNitroEligibleForSocialLayerStorefront),[r,u]=c.useState(nt),[m,x]=c.useState(em.FYj),g=c.useCallback(e=>{e?t(r):t(null)},[r,t]),v=c.useCallback(e=>{u(e),a&&t(e)},[a,t]),j=(0,a7.i)(e=>e.showSelfActivity),f=(0,a7.i)(e=>e.setShowSelfActivity),y=(0,a7.i)(e=>e.recommendationApplicationIds),E=(0,a7.i)(e=>e.setRecommendationApplicationIds),S=c.useCallback(e=>{e?E(m):E(null)},[m,E]),C=(0,d.bG)([a6.A],()=>null!=a6.A.testModeApplicationId),_=c.useCallback(e=>{e?(0,eY.openModal)(e=>(0,o.jsx)(a3.A,{...e})):a5.cL()},[]),A=(0,t1.A)({location:"DevToolsSlayerStorefrontPanel",applicationId:r,source:t0.GameProfileSources.Embed,trackEntryPointImpression:!0}),N=c.useCallback(e=>{A?.(e)},[A]),k=c.useCallback(()=>{(0,aZ.pX)(em.BVt.COLLECTIBLES_SHOP_GAME_SHOP(r))},[r]);return(0,o.jsx)("div",{className:q()(tX.nd,ne.n),children:(0,o.jsxs)("div",{className:ne.k,children:[(0,o.jsx)(b.k,{label:"Application ID",value:r,onChange:v}),(0,o.jsx)(X.D,{variant:"heading-lg/normal",children:"Activity Override"}),(0,o.jsx)(h.d,{label:"Override activity application ID",checked:a,onChange:g}),(0,o.jsx)(h.d,{label:"Show own voice activity (bypass self check)",checked:j,onChange:f}),(0,o.jsx)(h.d,{label:"Enable application test mode",checked:C,onChange:_}),(0,o.jsx)(p.$,{text:"Open Game Profile Modal",onClick:N}),(0,o.jsx)(p.$,{text:"Navigate to App Game Shop",onClick:k}),(0,o.jsx)(X.D,{variant:"heading-lg/normal",children:"Game Exit Promo"}),Object.values(a8.U3).map(e=>(0,o.jsx)(p.$,{text:"Preview",onClick:()=>{(0,a4.ik)({type:"replaced"}),(0,a4.sC)(e.id,{isPreview:!0})}},e.id)),(0,o.jsx)(X.D,{variant:"heading-lg/normal",children:"Wishlists"}),(0,o.jsx)(b.k,{label:"Recommendation application IDs",value:m,onChange:x,disabled:null==y}),(0,o.jsx)(h.d,{label:"Enable recommendation application IDs override",checked:null!=y,onChange:S}),(0,o.jsx)(h.d,{label:"Override nitro eligibility for social layer storefront",checked:n,onChange:l}),(0,o.jsx)(h.d,{label:"Is nitro eligible for social layer storefront",checked:i,onChange:s})]})})}var nn=a(540999),nl=a(723702),ni=a(865116);a(79455),a(772958);var ns=a(58736);a(558179),a(21574);var nr=a(231545),no=a(761929),nc=a(180808);function nd(e){let{resizableNode:t,minHeight:a,onResize:n}=e,l=(0,no.A)({minDimension:a,resizableDomNodeRef:t,onElementResize:n,orientation:no.R.VERTICAL_TOP,usePointerEvents:!0});return(0,o.jsx)("div",{onPointerDown:l,className:nc.Di})}function nu(e){let{children:t,className:a,initialHeight:n,minHeight:l}=e,i=c.useRef(null),[s,r]=c.useState(n);return(0,o.jsxs)("div",{ref:i,className:nc.kL,style:{minHeight:l,height:s},children:[(0,o.jsx)(nd,{resizableNode:i,minHeight:l,onResize:r}),(0,o.jsx)("div",{className:q()(nc.KZ,a),children:t})]})}var nm=a(231643),nh=a(362688);a(140346),nh.fu.NONE,nh.fu.NONE;var nx=a(825484),np=a(688810),ng=a(975460),nv=a(206828),nj=a(487431),nf=a(712440),nb=a(733110),ny=a(134861),nE=a(71393),nS=a(967198),nC=a(942370),n_=a(105292),nA=a(538524),nN=a(681135);function nk(){var e;let t,a,n=c.useRef(null),{analyticsLocations:l}=(0,np.Ay)(tk.A.DEV_TOOLS),[i,s]=c.useState(""),r=(0,d.bG)([nS.A],()=>nS.A.getGuildId()),u=(0,d.bG)([nE.A],()=>nE.A.getGuild(r)),m=u?.gameApplicationIds??[],h=(0,tJ.A)(m).filter(e=>null!=e),x=(0,d.bG)([S.Ay,A.A],()=>(0,C.A)(S.Ay,A.A)),v=(0,tJ.h)(i),j=(0,ng.g)(v),f=(0,d.yK)([tq.A],()=>v?.linkedGames?.map(e=>tq.A.getApplication(e.id)).filter(e=>null!=e)??[]),E=(0,nv.RD)(v,{allowedFlows:[nC._.RPC],debug:!0}),_=(0,nv.RD)(v,{allowedFlows:[nC._.WEB],debug:!0}),N=(0,d.bG)([ny.A],()=>null!=j&&ny.A.isConnected(j.id)),k=(0,nv.RD)(v,{debug:!0}),{canDeauthorize:I,deauthorize:D}=(e=k.connectionApp?.id,t=(0,d.bG)([nb.default],()=>nb.default.getNewestTokenForApplication(e)),a=c.useCallback(()=>{null!=t&&nf.A.delete(t.id)},[t]),{canDeauthorize:null!=t,deauthorize:a});return(0,o.jsxs)("div",{ref:n,className:q()(tX.nd,nN.nd),children:[(0,o.jsxs)("div",{className:nN.kL,children:[(0,o.jsx)(X.D,{variant:"heading-lg/normal",children:"Application"}),(0,o.jsx)(b.k,{label:"Application ID",value:i,onChange:s}),null!=x&&null!=x.id?(0,o.jsx)(p.$,{onClick:()=>s(x.id),variant:"primary",text:`Use detected game: ${x.name} (${x.id})`}):null,null!=u?h.length>0?(0,o.jsxs)("div",{className:nN.Mc,children:[(0,o.jsxs)(g.E,{variant:"text-sm/semibold",color:"text-subtle",children:[u.name," (",u.id,") \xb7 Official games"]}),(0,o.jsx)(nx.e,{size:"sm",wrap:!0,children:h.map(e=>(0,o.jsx)(p.$,{onClick:()=>s(e.id),variant:i===e.id?"primary":"secondary",text:`${e.name} (${e.id})`},e.id))})]}):(0,o.jsxs)(g.E,{variant:"text-md/normal",color:"text-subtle",children:[u.name," (",u.id,") \xb7 No official games"]}):(0,o.jsx)(g.E,{variant:"text-md/normal",color:"text-subtle",children:"No guild selected"}),(0,o.jsx)(y.c,{}),(0,o.jsxs)("div",{className:nN.J3,children:[(0,o.jsxs)(g.E,{variant:"text-md/normal",children:["Application Name: ",null!=v?v.name:"N/A"]}),(0,o.jsxs)(g.E,{variant:"text-md/normal",children:["Linked Games:"," ",f.length>0?f.map(e=>(0,ng.t)(v)?.id===e.id?`${e.name}*`:e.name).join(", "):"N/A"]})]})]}),(0,o.jsx)(y.c,{}),(0,o.jsxs)("div",{className:nN.kL,children:[(0,o.jsx)(X.D,{variant:"heading-lg/normal",children:"Authorization status"}),(0,o.jsx)(nj.VT,{flow:nC._.RPC,showGlobalFlowToggle:!0,overallStatus:E.debug.isSubscribedToAuthorizeRequest?nj.nW.OVERALL_GOOD:N?nj.nW.WARN:nj.nW.OVERALL_BAD,name:n_.intl.string(nA.default.AGLx00),steps:[{status:N?nj.nW.GOOD:nj.nW.BAD,text:n_.intl.string(nA.default.kxF9br),description:N?null:n_.intl.string(nA.default.PFxxJa),learnMoreLink:N?null:"https://discord.com/developers/docs/discord-social-sdk/how-to/debug-log"},{status:E.debug.isSubscribedToAuthorizeRequest?nj.nW.GOOD:N?nj.nW.WARN:nj.nW.BAD,text:n_.intl.string(nA.default.S94dzs),description:E.debug.isSubscribedToAuthorizeRequest||!N?null:n_.intl.string(nA.default.aTULMB),learnMoreLink:E.debug.isSubscribedToAuthorizeRequest||!N?null:"https://discord.com/developers/docs/discord-social-sdk/how-to/debug-log"}],isChosen:k.chosenFlow===nC._.RPC}),(0,o.jsx)(nj.VT,{flow:nC._.WEB,showGlobalFlowToggle:!0,overallStatus:_.debug.hasConnectionEntrypointUrl?nj.nW.OVERALL_GOOD:nj.nW.OVERALL_BAD,name:n_.intl.string(nA.default.K3ObrU),steps:[{status:_.debug.hasConnectionEntrypointUrl?nj.nW.GOOD:nj.nW.BAD,text:n_.intl.string(nA.default["8a7IrV"]),description:_.debug.hasConnectionEntrypointUrl?n_.intl.formatToPlainString(nA.default["9iLeL2"],{url:_.connectionApp?.connectionEntrypointUrl}):null}],isChosen:k.chosenFlow===nC._.WEB}),(0,o.jsx)(nj.Sy,{status:k.hasAlreadyLinked?nj.nW.OVERALL_GOOD:nj.nW.OVERALL_BAD,text:n_.intl.string(n_.t["Vu/zmQ"])}),0===k.debug.validFlows.length&&(0,o.jsx)(g.E,{style:{minWidth:0,overflow:"hidden"},variant:"text-md/medium",children:n_.intl.string(nA.default.eg0mNa)}),(0,o.jsx)(p.$,{disabled:!k.canStartAuthorization,fullWidth:!0,onClick:()=>k.startAuthorization({analyticsLocations:l}),variant:"primary",text:"Start Authorization"}),(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-subtle",children:"This will start whichever authorization flow is available. RPC authorization takes precedence over web."}),(0,o.jsxs)(nx.e,{fullWidth:!0,children:[(0,o.jsx)(p.$,{disabled:!E.canStartAuthorization,onClick:()=>E.startAuthorization({analyticsLocations:l}),variant:"secondary",text:"Start In-App Authorization"}),(0,o.jsx)(p.$,{disabled:!_.canStartAuthorization,onClick:()=>_.startAuthorization({analyticsLocations:l}),variant:"secondary",text:"Start Web Authorization"})]}),(0,o.jsx)(p.$,{disabled:!I,fullWidth:!0,onClick:D,variant:"critical-primary",text:"Deauthorize"})]}),v?.applicationAccountLinkBenefitConfig!=null&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(y.c,{}),(0,o.jsxs)("div",{className:nN.kL,children:[(0,o.jsx)(X.D,{variant:"heading-lg/normal",children:"Benefit configuration"}),(0,o.jsx)("div",{className:nN.Nr,children:(0,o.jsxs)("div",{className:nN.Tc,children:[null!=v.applicationAccountLinkBenefitConfig.reward_image&&(0,o.jsx)("img",{src:v.applicationAccountLinkBenefitConfig.reward_image,alt:"Reward",className:nN.L8}),(0,o.jsx)(g.E,{variant:"text-md/semibold",children:v.applicationAccountLinkBenefitConfig.reward_name??"Unnamed Reward"})]})})]})]})]})}var nI=a(427358),nD=a(584454),nT=a(175452);function nR(){let e=(0,d.bG)([nI.A],()=>nI.A.getDevToolsOverride()),t=(0,d.bG)([eo.default],()=>null!=e?eo.default.getUser(e.otherUserId)??null:null,[e]),[a,n]=c.useState(t?.username??""),[l,i]=c.useState(e?.communicationProbability??1),[s,r]=c.useState(e?.vcProbability??1),u=a.trim(),m=(0,d.bG)([eo.default],()=>u.length>0?eo.default.findByTag(u)??null:null,[u]),h=u.length>0&&null==m,x=null!=m&&null!=l&&null!=s;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(tY.B,{gap:8,padding:8,children:[(0,o.jsx)(g.E,{variant:"text-md/semibold",children:"User Affinity Override"}),(0,o.jsx)(g.E,{variant:"text-xs/normal",color:"text-muted",children:"Injects a temporary affinity entry for the given user, resets on reload or logout."}),(0,o.jsx)(b.k,{label:"Target username",value:a,onChange:n,placeholder:"pomelo_name",error:h?"No local user matches that username.":void 0}),(0,o.jsxs)(tY.B,{gap:8,direction:"horizontal",align:"end",children:[(0,o.jsx)(nD.Q,{label:"Comm. affinity",mode:"decimal",min:0,max:1,step:.1,value:l,onChange:i}),(0,o.jsx)(nD.Q,{label:"Voice affinity",mode:"decimal",min:0,max:1,step:.1,value:s,onChange:r}),(0,o.jsxs)(nx.e,{children:[(0,o.jsx)(p.$,{variant:"primary",size:"sm",text:null==e?"Apply":"Update",onClick:function(){x&&null!=m&&null!=l&&null!=s&&(0,nT.C)({userId:m.id,communicationProbability:l,vcProbability:s})},disabled:!x}),(0,o.jsx)(p.$,{variant:"critical-secondary",size:"sm",text:"Clear",onClick:function(){(0,nT.C)(null),n(""),i(1),r(1)},disabled:null==e})]})]}),null!=e&&(0,o.jsxs)(g.E,{variant:"text-xs/normal",color:"text-feedback-positive",children:["Active: user ",t?.username??"unknown"]})]}),(0,o.jsx)(y.c,{})]})}var nw=a(541660);function nO(e){let{title:t,sortKey:a,activeSortKey:n,sortDir:l,onClick:i}=e,s=n===a?"desc"===l?" \u25BC":" \u25B2":"";return(0,o.jsx)(J.D,{className:nw.K8,onClick:()=>i(a),children:(0,o.jsx)(g.E,{variant:"text-sm/semibold",children:t+s})})}function nM(){let[e,t]=c.useState("affinity"),[a,n]=c.useState("desc"),l=c.useCallback(a=>{e===a?n(e=>"asc"===e?"desc":"asc"):(t(a),n("username"===a?"asc":"desc"))},[e]),i=(0,d.yK)([nI.A,eo.default],()=>nI.A.getUserAffinities().map(e=>{let{otherUserId:t,communicationProbability:a,vcProbability:n,isFriend:l}=e;return{user:eo.default.getUser(t),affinity:a,vcProbability:n,isFriend:l,key:t}})),s=c.useMemo(()=>[...i].sort((t,n)=>{let l;if("username"===e){let e=t.user?.username??t.key,a=n.user?.username??n.key;l=e.localeCompare(a)}else l=t[e]-n[e];return"desc"===a?-l:l}),[i,e,a]),r=c.useMemo(()=>[{key:"user",cellClassName:nw.iL,renderHeader:()=>(0,o.jsx)(nO,{title:"USER",sortKey:"username",activeSortKey:e,sortDir:a,onClick:l}),render(e){let{user:t,key:a}=e;return t?.username??a}},{key:"affinity",renderHeader:()=>(0,o.jsx)(nO,{title:"COMMUNICATION AFFINITY",sortKey:"affinity",activeSortKey:e,sortDir:a,onClick:l}),cellClassName:nw.nz,render(e){let{affinity:t}=e;return t.toFixed(5)}},{key:"vcProbability",renderHeader:()=>(0,o.jsx)(nO,{title:"VOICE AFFINITY",sortKey:"vcProbability",activeSortKey:e,sortDir:a,onClick:l}),cellClassName:nw.nz,render(e){let{vcProbability:t}=e;return t.toFixed(5)}},{key:"isFriend",renderHeader:()=>(0,o.jsx)(g.E,{variant:"text-sm/semibold",children:"IS FRIEND"}),cellClassName:nw.nz,render(e){let{isFriend:t}=e;return t.toString()}}],[e,a,l]);return(0,o.jsxs)("div",{className:nw.nd,children:[(0,o.jsx)(nR,{}),i.length>0&&(0,o.jsx)(tZ,{columns:r,rowClassName:nw.nM,data:s})]})}var nP=a(379257),nL=a(306537),nU=a(486866);function nG(){return(0,o.jsx)("div",{className:q()(tX.nd,nU.k),children:(0,o.jsxs)("div",{children:[(0,o.jsx)(X.D,{variant:"heading-lg/semibold",children:"Quick Actions"}),(0,o.jsx)(y.c,{gap:16}),(0,o.jsxs)("div",{className:nU.h,children:[(0,o.jsx)(p.$,{variant:"primary",size:"sm",text:"Launch Age Verification Test Tool",onClick:()=>void(0,eY.openModalLazy)(async()=>{let{default:e}=await a.e("629079").then(a.bind(a,357578));return t=>(0,o.jsx)(e,{...t})},{onCloseCallback:void 0}),fullWidth:!0}),(0,o.jsx)(p.$,{variant:"primary",size:"sm",text:"Launch Age Verification Modal",onClick:()=>nP.A.showAgeVerificationGetStartedModal({entryPoint:nL.q1.DEV_TOOLS_QUICK_ACTIONS}),fullWidth:!0})]})]})})}var nF=a(536637),nB=a.n(nF),n$=a(862482),nV=a(624479),nW=a(555704),nH=a(285796),nz=a(241326),nK=a(683438),nY=a(297413),nq=a(379078),nJ=a(704554),nQ=a(957565),nX=a(58703),nZ=a(80703),n0=a(280450);let n1=0,n2=[],n5=0,n3=[],n6=!1;class n8 extends d.Ay.Store{static displayName="AnalyticsLogStore";initialize(){this.waitFor(n0.default,nn.A)}get loggedEvents(){return n2}get loggedEventsVersion(){return n5}get loggedTriggers(){return n3}get trackTriggers(){return n6}}let n4=new n8(tw.h,{TRACK:function(e){let{event:t,properties:a,fingerprint:n}=e;nn.A.isDeveloper&&(n2.push({key:(n1++).toString(),event:t,properties:a,fingerprint:null!=n?(0,nZ.d)(n):n0.default.getId(),timestamp:new Date}),n5++,n2.length>500&&(n2=n2.slice(-Math.floor(250))))},TRACK_TRIGGER:function(e){let{experimentId:t,descriptor:a,exposureType:n,excluded:l,location:i,previouslyTracked:s}=e;!nn.A.isDeveloper||n6&&(n3=[...n3,{key:(0,eO.A)(),experimentId:t,descriptor:a,exposureType:n,excluded:l,location:i,previouslyTracked:s,timestamp:new Date}]).length>500&&n3.shift()},SET_TRACK_TRIGGERS:function(e){let{enabled:t}=e;n6=t},ANALYTICS_LOG_CLEAR:function(){n2=[],n5++,n3=[]}});var n7=a(658675);function n9(e){let{className:t,children:a}=e;return(0,o.jsx)("dl",{className:q()(tX.qo,t),children:a})}function le(e){let{name:t,children:a,copyValue:n}=e,[l,i]=c.useState(!1);return c.useEffect(()=>{if(l){let e=setTimeout(()=>i(!1),1e3);return()=>clearTimeout(e)}},[l]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("dt",{className:tX.Bz,children:t}),(0,o.jsxs)("dd",{className:tX.Nw,children:[a,null!=n?(0,o.jsx)(J.D,{tag:"span",className:tX.nH,onClick:()=>(0,nQ.C)(n,()=>i(!0)),children:l?(0,o.jsx)(td.U,{color:"currentColor",size:"sm"}):(0,o.jsx)(nV.CopyIcon,{color:"currentColor",size:"sm"})}):null]})]})}function lt(e){let{value:t}=e;return(0,o.jsx)(n7.P,{checked:t})}var la=a(412966);let ln=[{key:"Event",cellClassName:la.Hz,render(e){let{event:t}=e;return t}},{key:"Location",cellClassName:la.QN,render(e){let{properties:t}=e;return null==t.location?null:t.location}}];function ll(e){let{children:t}=e;return(0,o.jsx)(v.Ip,{orientation:"auto",className:la._D,children:(0,o.jsx)("dl",{children:t})})}function li(e){let{name:t,children:a,copyValue:n}=e,[l,i]=c.useState(!1);return c.useEffect(()=>{if(l){let e=setTimeout(()=>i(!1),1e3);return()=>clearTimeout(e)}},[l]),(0,o.jsxs)("div",{className:la.fY,children:[(0,o.jsx)("dt",{className:la.m2,children:t}),(0,o.jsx)("dd",{children:a}),(0,o.jsx)(J.D,{tag:"span",className:la.nH,onClick:()=>(0,nQ.C)(JSON.stringify(n),()=>i(!0)),children:l?(0,o.jsx)(td.U,{color:"currentColor",size:"sm"}):(0,o.jsx)(nV.CopyIcon,{color:"currentColor",size:"sm"})})]})}let ls=new Set(["client_performance_cpu","client_performance_memory"]),lr=[{id:"details",name:"Details",group:nh.fu.NONE,render:e=>{let{loggedEvent:{event:t,properties:a,timestamp:n,fingerprint:l},onClose:i,filteredEvents:s}=e,r=eo.default.getUser(l),c=nB()(n);return(0,o.jsxs)("div",{className:la.sw,"data-mtctest-ignore":"true",children:[(0,o.jsxs)(ns.Ay,{className:q()(tX.jr,la.nZ),children:[(0,o.jsx)(ns.Ay.Icon,{icon:nW.U,tooltip:t}),(0,o.jsxs)(ns.Ay.Title,{wrapperClassName:la.qd,children:[t,(0,o.jsx)(J.D,{tag:"span",className:la.KE,onClick:()=>(0,nQ.C)(t),children:(0,o.jsx)(nV.CopyIcon,{color:"currentColor",size:"sm"})})]}),(0,o.jsx)(ns.Ay.Icon,{icon:nV.CopyIcon,tooltip:"Copy all properties",onClick:()=>{(0,nQ.C)(JSON.stringify({event:t,timestamp:n,fingerprint:l,user:r?.id,...a},(e,t)=>void 0===t?null:t,2))}}),(0,o.jsx)(ns.Ay.Icon,{icon:nH.a,tooltip:"Close",onClick:i})]}),(0,o.jsxs)(n9,{className:la.ZK,children:[(0,o.jsx)(le,{name:"Timestamp (local)",copyValue:n.toISOString(),children:(0,o.jsxs)("time",{dateTime:n.toISOString(),title:(0,nX.i$)(c,"LLLL"),children:["(",nB().locale(),") ",(0,nX.mk)(c)]})}),null!=r&&(0,o.jsx)(le,{name:"User",copyValue:r.id,children:(0,o.jsx)(nY.A,{user:r})}),(0,o.jsx)(le,{name:"Fingerprint",copyValue:l,children:(0,o.jsx)("code",{children:l})})]}),(0,o.jsx)(ll,{children:Object.entries(a).map(e=>{let[a,n]=e,l=ls.has(a)?function(e,t,a){let n=e.filter(e=>e.event===t);if(0===n.length)return{average:null,count:0};let l=null,i=0;for(let e of n){let t=e.properties[a];"number"==typeof t&&(i+=1,null==l?l=t:l+=t)}return{average:null!==l?l/n.length:null,count:i}}(s,t,a):null;return(0,o.jsxs)("div",{children:[(0,o.jsx)(li,{name:`${a}:`,copyValue:{[a]:n||null},children:null!=n?(0,o.jsx)("code",{children:JSON.stringify(n)}):(0,o.jsx)("code",{className:la.HO,children:"null"})},a),null!==l&&null!==l.average&&(0,o.jsx)(li,{name:`${a}_avg:`,copyValue:{[a]:n||null},children:(0,o.jsxs)("code",{children:[l.average.toFixed(3)," (",l.count,")"]})},`${a}_avg`)]},`${a}_container`)})})]})}}],lo={events:{label:"Events",filter:e=>Object.entries(lo).filter(e=>{let[t]=e;return"events"!==t}).map(t=>{let[a,{filter:n}]=t;return!n(e)}).every(e=>e)},experiments:{label:"Experiments",filter:e=>["experiment_user_triggered","experiment_guild_triggered"].includes(e.event)},impressions:{label:"Impressions",filter:e=>e.event.startsWith("impression_")},networkActions:{label:"Network",filter:e=>e.event.startsWith("network_action")}},lc={searchType:nq.n.REGEX,searchStringGenerator:e=>{let{event:t,properties:a}=e;return null!=a.location?[t,a.location]:t},throttleMs:100};function ld(){let e=c.useRef(null),[t,a]=c.useState(""),n=(0,d.bG)([n4],()=>n4.loggedEventsVersion),[l,i]=c.useState(()=>Object.keys(lo)),[s,r]=c.useState(n4.loggedEvents),u=c.useCallback(e=>{r(e)},[]);(0,nJ.RT)(t,n4.loggedEvents,u,lc,[n]);let m=s.filter(e=>{for(let t of l)if(lo[t].filter(e))return!0;return!1}),[h,x]=c.useState(void 0),p=m.find(e=>e.key===h),{TabBar:g,renderSelectedTab:v}=(0,nm.A)({tabs:lr},[]);return(0,o.jsxs)("div",{ref:e,className:q()(tX.nd,la.nd),children:[(0,o.jsxs)("div",{className:la.rh,children:[(0,o.jsx)(n$.$n,{className:la.Q$,look:n$.$n.Looks.BLANK,size:n$.$n.Sizes.ICON,onClick:Z.eY,children:(0,o.jsx)("span",{title:n_.intl.string(n_.t.VkKicb),children:(0,o.jsx)(nz.TrashIcon,{size:"md",color:"currentColor","aria-label":n_.intl.string(n_.t.VkKicb)})})}),(0,o.jsx)("div",{className:la.Bi}),(0,o.jsx)("div",{className:la.uW,children:Object.entries(lo).map(e=>{let[t,a]=e;return(0,o.jsx)(J.D,{className:q()(la.pb,l.includes(t)&&la.bx),onClick:()=>{i(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},children:a.label},t)})})]}),(0,o.jsx)("div",{className:la.rh,children:(0,o.jsx)(nK.I,{size:"sm",query:t,onChange:a,onClear:()=>a(""),placeholder:"Search by event name"})}),(0,o.jsx)(tZ,{columns:ln,data:m,selectedRowKey:h,onClickRow:e=>x(e.key)}),null!=p&&(0,o.jsxs)(nu,{className:la.rf,minHeight:100,initialHeight:null!=e.current?e.current.clientHeight/2:300,children:[(0,o.jsx)(g,{}),v({loggedEvent:p,onClose:()=>x(void 0),filteredEvents:m})]})]})}var lu=a(382483),lm=a(385113),lh=a(317672);function lx(e){let{config:t}=e,a=Object.entries(t.surfaces??{});return(0,o.jsxs)(tY.B,{gap:8,padding:8,className:lh.lt,children:[(0,o.jsx)(g.E,{variant:"text-sm/semibold",color:"text-strong",children:t.display_name}),(0,o.jsxs)(g.E,{variant:"text-xs/normal",color:"text-muted",children:["Config ID: ",t.config_id]}),(0,o.jsxs)(g.E,{variant:"text-xs/normal",color:"text-muted",children:["App ID: ",t.application_id]}),(0,o.jsxs)(g.E,{variant:"text-xs/normal",color:"text-muted",children:["Status: ",t.status]}),null!=t.updated_at&&(0,o.jsxs)(g.E,{variant:"text-xs/normal",color:"text-muted",children:["Updated: ",t.updated_at]}),null!=t.published_at&&(0,o.jsxs)(g.E,{variant:"text-xs/normal",color:"text-muted",children:["Published: ",t.published_at]}),(0,o.jsx)(y.c,{}),(0,o.jsxs)(g.E,{variant:"text-xs/semibold",color:"text-strong",children:["Surfaces (",a.length,")"]}),0===a.length?(0,o.jsx)(g.E,{variant:"text-xs/normal",color:"text-muted",children:"No surfaces configured"}):a.map(e=>{let[t,a]=e;return(0,o.jsxs)(tY.B,{gap:4,padding:4,className:lh.YL,children:[(0,o.jsx)(g.E,{variant:"text-xs/semibold",color:"text-default",children:t}),(0,o.jsxs)(g.E,{variant:"text-xs/normal",color:"text-muted",children:["Layout: ",a.layout]})]},t)})]})}function lp(e){let{config:t,isSelected:a,onSelect:n}=e;return(0,o.jsxs)(tY.B,{direction:"horizontal",align:"center",gap:8,padding:8,className:a?lh.FM:lh.gt,children:[(0,o.jsx)(J.D,{className:lh.Av,onClick:n,children:(0,o.jsxs)(tY.B,{gap:4,children:[(0,o.jsx)(g.E,{variant:"text-sm/medium",color:"text-strong",children:t.display_name}),(0,o.jsxs)(g.E,{variant:"text-xs/normal",color:"text-muted",children:[t.config_id," \xb7 ",t.application_id]})]})}),(0,o.jsx)(p.$,{variant:"secondary",size:"sm",text:"Refetch",onClick:()=>(0,lu.un)(t.application_id,{force:!0})})]})}function lg(){let e=(0,d.bG)([lm.A],()=>lm.A.getFeaturedFetchState());return(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsxs)(tY.B,{direction:"horizontal",gap:8,align:"center",children:[(0,o.jsx)(g.E,{variant:"text-md/semibold",color:"text-strong",children:"Featured Configs"}),(0,o.jsxs)(g.E,{variant:"text-xs/normal",color:"text-muted",children:["(",e,")"]})]}),(0,o.jsx)(p.$,{variant:"primary",size:"sm",text:"Force Refetch",onClick:()=>(0,lu.Wq)({force:!0})})]})}function lv(){let e=(0,d.bG)([lm.A],()=>lm.A.getDeveloperFetchState());return(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsxs)(tY.B,{direction:"horizontal",gap:8,align:"center",children:[(0,o.jsx)(g.E,{variant:"text-md/semibold",color:"text-strong",children:"Developer Configs"}),(0,o.jsxs)(g.E,{variant:"text-xs/normal",color:"text-muted",children:["(",e,")"]})]}),(0,o.jsx)(p.$,{variant:"primary",size:"sm",text:"Force Refetch",onClick:()=>(0,lu.i$)({force:!0})})]})}function lj(){let[e,t]=c.useState(""),a=(0,d.bG)([lm.A],()=>e.length>0?lm.A.getFetchState(e):null),n=(0,d.bG)([lm.A],()=>e.length>0?lm.A.getConfigs(e):null);return(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsx)(g.E,{variant:"text-md/semibold",color:"text-strong",children:"Fetch by Application ID"}),(0,o.jsx)(b.k,{placeholder:"Application ID",value:e,onChange:e=>t(e)}),(0,o.jsx)(p.$,{variant:"primary",size:"sm",text:"Fetch",disabled:0===e.length,onClick:()=>(0,lu.un)(e,{force:!0})}),null!=a&&(0,o.jsxs)(g.E,{variant:"text-xs/normal",color:"text-muted",children:["Status: ",a]}),null!=n&&n.length>0&&(0,o.jsx)(tY.B,{gap:4,children:n.map(e=>(0,o.jsx)(lx,{config:e},e.config_id))})]})}function lf(e){let{configs:t,selectedConfigId:a,onSelectConfig:n}=e,l=(0,d.bG)([lm.A],()=>lm.A.getFeaturedFetchState());return(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsxs)(g.E,{variant:"text-md/semibold",color:"text-strong",children:["All Loaded Configs (",t.length,")"]}),l===lm.e.FETCHING&&(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-muted",children:"Loading..."}),t.map(e=>(0,o.jsx)(lp,{config:e,isSelected:a===e.config_id,onSelect:()=>n(a===e.config_id?null:e.config_id)},e.config_id))]})}function lb(e){let{config:t}=e;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(y.c,{}),(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsx)(g.E,{variant:"text-md/semibold",color:"text-strong",children:"Config Details"}),(0,o.jsx)(lx,{config:t})]})]})}function ly(){let[e,t]=c.useState(null),a=Object.values((0,d.bG)([lm.A],()=>lm.A.getAllConfigsByApplication())).flat(),n=null!=e?a.find(t=>t.config_id===e):null;return(0,o.jsx)(v.Ar,{children:(0,o.jsxs)(tY.B,{gap:16,padding:8,className:lh.zr,children:[(0,o.jsx)(X.D,{variant:"heading-lg/semibold",color:"text-strong",children:"Application Widget Configs"}),(0,o.jsx)(p.$,{size:"sm",variant:"critical-secondary",text:"Reset store",onClick:()=>tw.h.dispatch({type:"APPLICATION_WIDGET_CONFIG_DEBUG_RESET"})}),(0,o.jsx)(lg,{}),(0,o.jsx)(y.c,{}),(0,o.jsx)(lv,{}),(0,o.jsx)(y.c,{}),(0,o.jsx)(lj,{}),(0,o.jsx)(y.c,{}),(0,o.jsx)(lf,{configs:a,selectedConfigId:e,onSelectConfig:t}),null!=n&&(0,o.jsx)(lb,{config:n})]})})}var lE=a(513520),lS=a(130100),lC=a(468747);let l_=[{key:"Channel",cellClassName:lC._w,render(e){let{channelName:t}=e;return t}},{key:"score",renderHeader:()=>(0,o.jsx)(g.E,{variant:"text-sm/semibold",children:"SCORE"}),cellClassName:lC.t6,render(e){let{score:t}=e;return t.toFixed(5)}}];function lA(){c.useEffect(()=>{(0,lE.I)()},[]);let e=(0,d.yK)([lS.A,aH.A],()=>lS.A.getChannelAffinities().map(e=>{let{channelId:t,score:a}=e;return{key:t,channelName:aH.A.getChannel(t)?.name??t,score:a}}).sort((e,t)=>t.score-e.score));return 0===e.length?null:(0,o.jsx)(tZ,{className:tX.nd,columns:l_,rowClassName:lC.nM,data:e})}function lN(){return(0,o.jsxs)(g.E,{variant:"text-lg/normal",children:["Under Construction"," ",(0,o.jsx)("span",{role:"img","aria-label":"Construction",children:"\uD83D\uDEA7"})]})}var lk=a(105565),lI=a(47899),lD=a(333714);function lT(e){switch(e){case lk.r.DC_DISMISSED:return"DISMISS:";case lk.r.DC_SHOWN:return"SHOW:";case lk.r.DC_SHOW_REQUEST:return"REQUEST TO SHOW:";default:return"UNKNOWN TYPE:"}}let lR=[{key:"events",render(e){let{event:t,dismissibleContent:a}=e;return`${t} ${aw.M[a]}`}}],lw=[{key:"candidates",render(e){let{dismissibleContent:t}=e;return`${aw.M[t]}`}}];function lO(){let e=(0,d.bG)([lk.A],()=>lk.A.getDCFEvents()),t=(0,lI.Ay)(e=>e.candidates),a=(0,lI.Ay)(e=>e.lastWinnerTime),n=0!==a?nB()(a).fromNow():"n/a",l=(0,lI.Ay)(e=>0===e.lastWinnerTime?null:e.recentlyShown[0]),i=e.map(e=>{let{eventType:t,dismissibleContent:a}=e;return{key:lT(t)+a.toString(),event:lT(t),dismissibleContent:a}}),s=Array.from(t.keys()).map(e=>({key:e.toString(),dismissibleContent:e}));return(0,o.jsxs)("div",{className:lD.KE,children:[(0,o.jsxs)("div",{className:lD.pq,children:["Last winner time: ",n]}),(0,o.jsx)("br",{}),(0,o.jsxs)("div",{className:lD.pq,children:["Last winner: ",null!=l?aw.M[l]:"None"]}),(0,o.jsx)("br",{}),(0,o.jsx)("div",{className:lD.uI,children:(0,o.jsx)(tZ,{className:lD.Th,columns:lw,data:s})}),(0,o.jsx)("br",{}),(0,o.jsx)(tZ,{columns:lR,data:i})]})}var lM=a(689175),lP=a(541689),lL=a(199773);function lU(){let e=(0,c.useCallback)(e=>{let t=new Set(lG());t.delete(e);let a=Array.from(t).slice(0,4);a.unshift(e),tK.w.set("RecentDismissibleOverrides",a)},[]);return[lG(),e]}function lG(){return tK.w.get("RecentDismissibleOverrides")??[]}a(667532);var lF=a(662546),lB=a(643278),l$=a(256787),lV=a(20439);let lW=c.memo(function(e){let{className:t,content:a,onChange:n}=e,l=aw.M[a],{isDismissed:i,handleToggleDismissState:s}=(0,lV.A)(l),[r,d]=c.useState(!1),u=c.useCallback(()=>{n?.(a),s()},[n,s,a]),m=c.useCallback(e=>{e.preventDefault(),d(!0),navigator.clipboard.writeText(a.toLowerCase())},[a]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(tY.B,{className:t,direction:"horizontal",align:"center",children:[(0,o.jsx)(eH.K,{size:"sm",variant:"icon-only",icon:r?lF.O:lB.ClipboardListIcon,onClick:m,"aria-label":r?"Copied":"Copy"}),(0,o.jsx)(h.d,{label:`${a.toLowerCase()} (${aw.M[a]})`,description:(0,l$.Zm)(l)?function(e){let t=aM.A.settings.userContent?.recurringDismissibleContentStates?.[e];if(null==t)return null;let a=[],{lastDismissedVersion:n,lastDismissedAtMs:l,lastDismissedObjectId:i}=t;if(void 0!==n&&0!==n&&a.push(`last_dismissed_version: ${n}`),void 0!==l){let e=Number(l),t=Number.isNaN(e)?"n/a":new Date(e).toLocaleString();a.push(`last_dismissed_at: ${t}`)}return(void 0!==i&&"0"!==i&&a.push(`last_dismissed_object_id: ${i}`),0===a.length)?null:a.join(", ")}(l):null,checked:i,onChange:u})]}),(0,o.jsx)(y.c,{})]})});function lH(e){let{items:t,onChange:a}=e,[n,l]=lU(),i=(0,c.useCallback)(e=>{l(e),a?.(e)},[l,a]);return(0,o.jsx)(tY.B,{gap:16,children:t.filter(e=>isNaN(Number(e))).map(e=>(0,o.jsx)(lW,{content:e,onChange:i},e))})}function lz(e){let{searchQuery:t=""}=e,a=(0,lI.Ay)(e=>e.recentlyShown),[n,l]=lU(),i=n.filter(e=>e.toLowerCase().includes(t.toLowerCase())).filter(e=>!a.includes(aw.M[e])).slice(0,3);return 0===i.length?null:(0,o.jsx)(m.n,{label:"Recent Overrides",children:(0,o.jsx)(lH,{items:i})})}function lK(e){let{searchQuery:t=""}=e,a=(0,lI.Ay)(e=>e.recentlyShown).map(e=>aw.M[e]).filter(e=>e.toLowerCase().includes(t.toLowerCase())).slice(0,3);return 0===a.length?null:(0,o.jsx)(m.n,{label:"Recently Shown",children:(0,o.jsx)(lH,{items:a})})}var lY=a(607734);function lq(){let{dailyCapReached:e,dailyCapOverridden:t,newUserMinAgeRequiredOverridden:a,upsellBackoffOverridden:n}=(0,d.cf)([lL.A],()=>({dailyCapReached:lL.A.hasUserHitDCCap(),dailyCapOverridden:lL.A.dailyCapOverridden,newUserMinAgeRequiredOverridden:lL.A.newUserMinAgeRequiredOverridden,upsellBackoffOverridden:lL.A.upsellBackoffOverridden})),[l,i]=c.useState(""),[s,r]=c.useState(20),u=c.useMemo(()=>Object.keys(aw.M).filter(e=>e.toLowerCase().includes(l.toLowerCase())).reverse(),[l]),x=c.useCallback(e=>{let t=e.currentTarget;t.scrollHeight-t.scrollTop<=t.clientHeight+100&&s<u.length&&r(e=>e+100)},[s,u.length]);return(0,o.jsx)(lM.Ch,{onScroll:x,children:(0,o.jsxs)("div",{className:lY.KE,children:[(0,o.jsxs)(m.n,{label:"Dismissible Content Overrides",children:[(0,o.jsxs)(tY.B,{gap:4,children:[(0,o.jsx)(p.$,{variant:"primary",text:"Reset Daily Cap",onClick:()=>(0,lP.Ab)()}),(0,o.jsx)(p.$,{variant:"primary",text:"Undismiss All DCs",onClick:()=>(0,aO.nT)()}),(0,o.jsx)(p.$,{variant:"primary",text:"Dismiss All DCs",onClick:()=>(0,aO.D1)()}),(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-subtle",children:`Daily Cap Reached: ${e?"Yes":"No"}`})]}),(0,o.jsx)(h.d,{label:"Override Dismissible Content Daily Cap",checked:t,onChange:lP.SE}),(0,o.jsx)(h.d,{label:"Override Minimum User Account Age Requirement",checked:a,onChange:lP.U$}),(0,o.jsx)(h.d,{label:"Override 60-Minute Backoff Between DC Displays",checked:n,onChange:lP.M1})]}),(0,o.jsx)(lK,{}),(0,o.jsx)(lz,{}),(0,o.jsxs)(m.n,{label:"All Dismissible Contents",children:[(0,o.jsx)(nK.I,{query:l,onChange:i,onClear:()=>i("")}),(0,o.jsx)(lH,{items:u.slice(0,s)})]})]})})}var lJ=a(276086),lQ=a(154323),lX=a(504565);function lZ(){let e=(0,d.bG)([lQ.A],()=>lQ.A.allWithDescriptions(),[],d.My),t=c.useMemo(()=>e.map(e=>{let[t,a,n]=e;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(h.d,{label:n,description:t,checked:a,onChange:e=>(0,lJ.L)(t,e)},t),(0,o.jsx)(y.c,{gap:16})]})}),[e]);return(0,o.jsxs)("div",{className:lX.kL,children:[(0,o.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:lX.x6,children:(0,o.jsx)(p.$,{variant:"primary",text:"Clear all",onClick:lJ.$,fullWidth:!0})}),(0,o.jsx)("div",{className:lX.vu,children:t})]})}var l0=a(106839);function l1(){let e=(0,d.bG)([t2.A],()=>t2.A.detectableGamesEtag),t=(0,d.bG)([t2.A],()=>t2.A.lastFetched),a=(0,d.bG)([t2.A],()=>t2.A.games.length);return(0,o.jsxs)(tY.B,{gap:4,children:[(0,o.jsx)(X.D,{variant:"heading-sm/bold",children:"Cache Status"}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",children:[(0,o.jsx)("strong",{children:"Total games:"})," ",a]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",children:[(0,o.jsx)("strong",{children:"ETag:"})," ",""===e?"(empty)":(0,o.jsx)("span",{className:l0.ti,children:e})]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",children:[(0,o.jsx)("strong",{children:"Last fetched:"})," ",null==t?"never":new Date(t).toLocaleString()]})]})}function l2(e){let{game:t}=e,{data:a}=(0,a_.I)(t.id),n=null!=a&&a.name!==t.name;return(0,o.jsxs)(tY.B,{gap:12,className:l0.f_,children:[(0,o.jsxs)(tY.B,{direction:"horizontal",gap:12,align:"center",children:[(0,o.jsx)(aS.A,{game:a,size:aS.M.LARGE}),(0,o.jsxs)(tY.B,{gap:4,children:[(0,o.jsx)(X.D,{variant:"heading-lg/bold",children:t.name}),(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-muted",children:t.id})]})]}),(0,o.jsxs)(tY.B,{gap:4,children:[(0,o.jsx)(g.E,{variant:"text-sm/semibold",children:"GameStore"}),(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-muted",children:null==a?"No record fetched. The icon above comes from here, not from the detectable payload, so it is blank.":`name: ${a.name}`}),n&&(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-feedback-critical",children:"Differs from the detectable name above."})]}),(0,o.jsxs)(tY.B,{gap:4,className:l0.Uq,children:[(0,o.jsx)(g.E,{variant:"text-sm/semibold",children:"DetectableGameStore"}),(0,o.jsx)("pre",{className:l0.aY,children:JSON.stringify(t,null,2)})]})]})}function l5(){let[e,t]=c.useState(null),[a,n]=c.useState(""),l=(0,d.bG)([t2.A],()=>t2.A.games),i=c.useMemo(()=>l.filter(e=>null!=e.name&&""!==e.name).map(e=>({id:e.id,value:e.id,label:e.name})),[l]),s=c.useCallback(e=>{t(e),null!=e&&n("")},[]),r=c.useCallback(e=>{n(e),e.trim().length>0&&t(null)},[]),u=a.trim(),m=u.length>0?u:e??void 0,h=(0,d.bG)([t2.A],()=>null!=m?t2.A.getDetectableGame(m)??null:null,[m]);return(0,o.jsx)("div",{className:q()(tX.nd,l0.kL),children:(0,o.jsxs)(tY.B,{gap:16,padding:12,className:l0.rf,children:[(0,o.jsxs)(tY.B,{gap:4,children:[(0,o.jsx)(X.D,{variant:"heading-md/bold",children:"Detectable Cache"}),(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-muted",children:"Inspect the local detectable games cache. Use this to verify whether a SKU or executable change has propagated to your client."})]}),(0,o.jsx)(l1,{}),(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsx)(X.D,{variant:"heading-sm/bold",children:"Search"}),(0,o.jsx)(aE.Z,{label:"Search games",hideLabel:!0,placeholder:"Search for a game\u2026",options:i,value:u.length>0?void 0:e??void 0,onSelectionChange:s,selectionMode:"single",clearable:!0})]}),(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsx)(X.D,{variant:"heading-sm/bold",children:"Game ID"}),(0,o.jsx)(b.k,{label:"Game ID",hideLabel:!0,placeholder:"Paste a game ID",value:a,onChange:r})]}),null!=m&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(y.c,{}),null!=h?(0,o.jsx)(l2,{game:h}):(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-feedback-critical",children:["No entry in cache for ID ",m,"."]})]})]})})}var l3=a(858899),l6=a(123292),l8=a(780907),l4=a(56562);let l7=[{label:"Wuthering Waves",value:"1247227126416146462"},{label:"Marvel Rivals",value:"1314395942253756416"},{label:"VALORANT",value:"700136079562375258"},{label:"League of Legends",value:"1402418696126992445"},{label:"World of Warcraft",value:"356875762940379136"}];function l9(e){let{runningGame:t,isDebugGame:a}=e,{data:n}=(0,a_.I)(t.id);return(0,o.jsxs)(tY.B,{direction:"horizontal",gap:8,children:[null!=n&&(0,o.jsx)(aS.A,{game:n}),(0,o.jsxs)(tY.B,{justify:"center",gap:0,children:[(0,o.jsx)(g.E,{variant:"text-md/normal",children:n?.name}),a&&(0,o.jsx)(g.E,{variant:"text-xxs/normal",children:"Debug"})]})]})}function ie(){let e=(0,d.bG)([S.Ay],()=>S.Ay.getRunningGames()),t=(0,d.bG)([S.Ay],()=>S.Ay.getDebugRunningGame()),[a,n]=(0,c.useState)(t?.id??""),l=(0,c.useMemo)(()=>l7.map(e=>{let{label:t,value:a}=e;return{label:t,value:a,id:a}}),[]);function i(e){if(null==e||""===e)return void(0,l8.xt)(null);let t=t2.A.getDetectableGame(e),a=t?.executables[0],n=t?.thirdPartySkus[0]?.distributor;if(null==t||null==a)return(0,l3.P0)({text:"Invalid Game ID",variant:"critical"});(0,l8.xt)({id:t.id,name:t.name,exeName:a.name,exePath:"",lastFocused:Date.now()/1e3,pid:-1,pidPath:[],hidden:!1,elevated:!1,processName:a.name,distributor:n,windowHandle:void 0,fullscreenType:l4.aI.UNKNOWN,cmdLine:"",nativeProcessObserverId:-1})}return(0,o.jsxs)(tY.B,{gap:32,padding:12,fullWidth:!1,children:[(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsx)(X.D,{variant:"heading-md/bold",children:"Running Games"}),e.length>0&&(0,o.jsx)("div",{children:e.map(e=>(0,o.jsx)(l9,{runningGame:e,isDebugGame:t?.id===e.id},e.id))})]}),(0,o.jsx)(y.c,{}),(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsx)(X.D,{variant:"heading-md/bold",children:"Set Debug Running Game"}),(0,o.jsx)(b.k,{label:"Custom Game ID",value:a,onChange:n}),(0,o.jsx)(aE.Z,{label:"Pick a Preset Game",options:l,value:t?.id??"",onSelectionChange:function(e){i(e)},selectionMode:"single",clearable:!0}),(0,o.jsxs)(tY.B,{direction:"horizontal",gap:16,justify:"end",align:"end",children:[null!=t&&(0,o.jsx)(l6.Q,{variant:"secondary",text:"Clear",onClick:()=>i(null)}),(0,o.jsx)(p.$,{variant:"primary",text:"Detect Game",onClick:()=>i(a)})]})]})]})}var it=a(636537),ia=a(240248),il=a(974009);function ii(){let[e,t]=c.useState(!1),[a,n]=c.useState(null),[l,i]=c.useState(null),s=c.useCallback(async()=>{try{t(!0),n(null),i(null);let e=await it.Bo.put({url:"/users/@me/developer-portal/onboarding",body:{completed:!1},rejectWithError:!0});n(`${e.status}: ${e.text}`)}catch(e){i(e instanceof Error?e.message:String(e))}finally{t(!1)}},[]);return(0,o.jsxs)(tY.B,{direction:"vertical",gap:4,children:[(0,o.jsx)(p.$,{variant:"primary",onClick:s,text:"Reset Onboarding",disabled:e,fullWidth:!0}),!(0,ia.uJ)(a)&&(0,o.jsx)(g.E,{variant:"text-md/normal",color:"status-positive",children:a}),!(0,ia.uJ)(l)&&(0,o.jsx)(g.E,{variant:"text-md/normal",color:"text-feedback-critical",children:l})]})}function is(){return(0,o.jsx)("div",{className:il.n,children:(0,o.jsx)(tY.B,{direction:"vertical",gap:16,children:(0,o.jsx)(ii,{})})})}a(172879);var ir=a(64015),io=a.n(ir),ic=a(874804),id=a(866665),iu=a(782134),im=a(113494),ih=a(603349),ix=a(108715);function ip(e){return parseFloat(e.toFixed(3))}let ig=[{key:"Store",cellClassName:ix.lA,render(e){let{trace:t}=e;return t.name}},{key:"Time",cellClassName:ix.i7,render(e){let{trace:t}=e;return`${ip(t.time)} ms`}}];function iv(e){let{actionLog:t}=e,a=c.useMemo(()=>t.traces.map(e=>({key:e.name,trace:e})),[t]);return(0,o.jsx)(v.Ip,{children:(0,o.jsx)(tZ,{columns:ig,data:a})})}let ij=[{id:"action",name:"Action",group:nh.fu.NONE,render(e){let{actionLog:t}=e,a=nB()(t.createdAt);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n9,{className:ix.mP,children:[(0,o.jsx)(le,{name:"Created at",children:(0,o.jsx)("time",{dateTime:t.createdAt?.toISOString(),title:(0,nX.i$)(a,"LLLL"),children:(0,nX.mk)(a)})}),(0,o.jsxs)(le,{name:"Total Time",children:[ip(t.totalTime)," ms"]})]}),(0,o.jsx)(v.Ip,{className:ix.Dx,children:(0,o.jsx)(nr.A,{data:t.action})})]})}},{id:"traces",name:"Store Handlers",group:nh.fu.NONE,render(e){let{actionLog:t}=e;return(0,o.jsx)(iv,{actionLog:t})}}];function ib(e){let{actionLog:t,initialHeight:a}=e,n=c.useMemo(()=>t.error?[...ij,{id:"error",name:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ih.A,{className:ix.ik}),"Error"]}),group:nh.fu.NONE,render(e){let{actionLog:t}=e;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:q()(ix.u4,tX.KE),children:(0,o.jsx)("div",{className:tX.R5,children:(0,o.jsx)(n$.$n,{className:tX.Q$,size:n$.$n.Sizes.MIN,onClick:()=>console.error(t.error),children:"Log to Console"})})}),(0,o.jsx)(v.Ip,{className:ix.Dx,children:(0,o.jsx)(nr.A,{data:t.error})})]})}}]:ij,[t]),{TabBar:l,renderSelectedTab:i}=(0,nm.A)({tabs:n},[n]);return(0,o.jsxs)(nu,{className:ix.rf,minHeight:100,initialHeight:a,children:[(0,o.jsx)(l,{}),(0,o.jsxs)(ns.Ay,{className:q()(tX.jr,ix.nZ),children:[(0,o.jsx)(ns.Ay.Icon,{icon:ic.K,tooltip:t.name}),(0,o.jsx)(ns.Ay.Title,{wrapperClassName:q()(tX.qd,tX.ZE),className:tX.Pz,children:t.name}),(0,o.jsx)(ns.Ay.Icon,{icon:nV.CopyIcon,tooltip:"Copy event data",onClick:()=>{var e;let a=JSON.stringify(Object.keys(e=t.action).reduce((t,a)=>{var n;return t[a]=(n=e[a],em.AKn.test(n)?"REDACTED":n),t},{}),null,2);(0,nQ.C)(a,()=>(0,l3.P0)({text:"Copied action log data to clipboard",variant:"success"}))}})]}),i({actionLog:t})]})}let iy=[{key:"Action",cellClassName:ix.lA,render(e){let{actionLog:t}=e;return(0,o.jsxs)(o.Fragment,{children:[t.error&&(0,o.jsx)(ih.A,{className:ix.ik}),t.name]})}},{key:"Total Time",cellClassName:ix.i7,render(e){let{actionLog:t}=e;return`${ip(t.totalTime)} ms`}},{key:"Timestamp",cellClassName:ix.i7,render(e){let{actionLog:t}=e;return nB()(t.createdAt).format("HH:mm:ss.SSS")}}],iE={searchType:nq.n.REGEX,searchStringGenerator:e=>{let{actionLog:t}=e;return t.name},throttleMs:100};function iS(){let e=c.useRef(null),[t,a]=c.useState(""),n=function(e){let[t,a]=c.useState(e.logs);return c.useEffect(()=>{let t=io()(()=>{a([...e.logs])},500);return e.on("log",t),()=>{e.off("log",t)}},[e]),t}(tw.h.actionLogger),l=c.useMemo(()=>n.map(e=>({key:e.id.toString(),actionLog:e})).toReversed(),[n]),[i,s]=c.useState(l),[r,d]=c.useState(l),[u,m]=c.useState(!1),[h,x]=c.useState(),p=c.useCallback(e=>{d(e)},[]);(0,nJ.RT)(t,u?i:l,p,iE);let g=c.useCallback(e=>{s(l),m(e)},[l]),v=t.trim().length>0,j=c.useMemo(()=>v?r:u?i:l,[l,r,v,u,i]),f=u?"Enable Event Tracking":"Pause Event Tracking";return(0,o.jsxs)("div",{ref:e,className:q()(tX.nd,ix.nd),children:[(0,o.jsxs)("div",{className:ix.KE,children:[(0,o.jsx)(id.m,{text:f,children:(0,o.jsx)(eH.K,{size:"sm",variant:u?"primary":"active",icon:u?iu.PlayIcon:im.PauseIcon,"aria-label":f,onClick:()=>g(!u)})}),(0,o.jsx)(nK.I,{size:"sm",query:t,onChange:a,onClear:()=>a(""),placeholder:"Search by action name"})]}),(0,o.jsx)(tZ,{columns:iy,data:j,selectedRowKey:h?.id.toString(),onClickRow:e=>x(e.actionLog)}),null!=h&&(0,o.jsx)(ib,{actionLog:h,initialHeight:null!=e.current?e.current.clientHeight/2:300})]})}var iC=a(936388),i_=a(269248);function iA(){let e=c.useRef(null);return(0,o.jsx)("div",{ref:e,className:q()(tX.nd,i_.n),children:(0,o.jsx)(p.$,{variant:"primary",size:"sm",text:"Reset Uploaded Key Versions Cache",onClick:iC.A.clearUploadedKeyVersions})})}var iN=a(409181),ik=a(881520),iI=a(670455),iD=a(932661);let iT=[{id:"seconds",label:"second(s)",value:1e3},{id:"minutes",label:"minute(s)",value:6e4},{id:"hours",label:"hour(s)",value:36e5},{id:"days",label:"day(s)",value:864e5}];function iR(){let[e,t]=c.useState(null),[a,n]=c.useState(0),[l,i]=c.useState(1e3),[s,r]=c.useState(0),u=(0,d.bG)([ik.A],()=>null===e?null:ik.A.getFeedbackConfig(iI.MW[e])??iN.u[iI.MW[e]]),h=Object.entries(iI.MW),x=h.slice(h.length/2).map(e=>{let[t]=e;return{id:t,label:t,value:t}}),v=c.useMemo(()=>null!=e&&s>=0&&s<=100&&a>=0,[e,s,a]);return(0,o.jsx)("div",{className:iD.kL,children:(0,o.jsxs)(tY.B,{gap:32,children:[(0,o.jsx)(f.l,{label:"Feedback Survey",options:x,value:e,onSelectionChange:t,placeholder:"Select Feedback Survey",selectionMode:"single",fullWidth:!0}),(0,o.jsxs)(m.n,{label:"Override Survey Cooldown",children:[null!=u&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(g.E,{variant:"text-sm/semibold",children:"Current cooldown"}),(0,o.jsx)(g.E,{variant:"text-sm/normal",children:`${u.cooldown/1e3} second(s) or`}),(0,o.jsx)(g.E,{variant:"text-sm/normal",children:`${u.cooldown/6e4} minute(s) or`}),(0,o.jsx)(g.E,{variant:"text-sm/normal",children:`${u.cooldown/36e5} hour(s) or`}),(0,o.jsx)(g.E,{variant:"text-sm/normal",children:`${u.cooldown/864e5} day(s)`})]}),(0,o.jsxs)(tY.B,{direction:"horizontal",align:"end",children:[(0,o.jsx)(b.k,{label:"Override cooldown",min:0,value:a.toString(),type:"number",placeholder:"Duration length",onChange:e=>n(parseFloat(e))}),(0,o.jsx)(f.l,{label:"Override cooldown duration type",hideLabel:!0,options:iT,value:l,onSelectionChange:i,selectionMode:"single",fullWidth:!0})]})]}),(0,o.jsx)(y.c,{}),(0,o.jsx)(m.n,{label:"Override Survey Chance",children:(0,o.jsx)(b.k,{label:"Override chance",description:null!=u?`Current chance: ${100*u.chance}%`:void 0,helperText:"As a percentage",min:0,max:100,value:s.toString(),type:"number",onChange:e=>r(parseFloat(e))})}),(0,o.jsxs)(nx.e,{children:[(0,o.jsx)(p.$,{variant:"critical-primary",text:"Clear Override",onClick:()=>void(null!=u&&tw.h.dispatch({type:"FEEDBACK_OVERRIDE_CLEAR",feedbackType:u.feedbackType})),disabled:!v}),(0,o.jsx)(p.$,{variant:"primary",text:"Update",onClick:()=>void(null!=u&&tw.h.dispatch({type:"FEEDBACK_OVERRIDE_SET",feedbackType:u.feedbackType,cooldown:a*l,chance:s/100})),disabled:!v})]}),null==e&&(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-feedback-critical",children:"Error: need to select a survey"}),!(a>=0)&&(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-feedback-critical",children:"Error: cooldown needs to be a number greater than 0"}),!(s>=0&&s<=100)&&(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-feedback-critical",children:"Error: chance needs to be a number between 0 and 100"}),(0,o.jsx)(g.E,{variant:"text-sm/normal",children:"Clear override resets a feedback survey to its default values"})]})})}var iw=a(334279),iO=a(663417),iM=a(147925),iP=a(557009);async function iL(){return(await it.Bo.get({url:em.Rsh.ENTITLEMENTS_FOR_APPLICATION(tM.tv),oldFormErrors:!0,query:{exclude_consumed:!0,exclude_ended:!0},rejectWithError:!0})).body.map(e=>iP.A.createFromServer(e))}async function iU(e){await it.Bo.post({url:"/debug/entitlements/fractional-premium",body:{count:1,sku_id:e},rejectWithError:!1})}async function iG(e){let t="/debug/entitlements/fractional-premium";null!=e&&(t=`${t}/${e}`),await it.Bo.del({url:t,rejectWithError:!0})}async function iF(){await it.Bo.post({url:"/debug/entitlements/fulfillment",rejectWithError:!1})}function iB(){let[e,t]=c.useState([]),[a,n]=c.useState(!1),l=(0,c.useCallback)(async()=>{try{n(!0);let e=await iL();t(e)}finally{n(!1)}},[]),i=(0,c.useCallback)(async e=>{await iU(e),await l()},[l]);return{grantFractionalPremium:i,deleteFractionalPremium:(0,c.useCallback)(async e=>{await iG(e),await l()},[l]),triggerNextEntitlementFulfillment:(0,c.useCallback)(async()=>{await iF(),await l()},[l]),refreshEntitlementList:l,entitlements:e,loading:a}}var i$=a(267577),iV=a(370109);let iW={[em.GD.QUEST_REWARD]:"Quest Reward",[em.GD.DEVELOPER_GIFT]:"Developer Gift",[em.GD.INVOICE]:"Invoice",[em.GD.REVERSE_TRIAL]:"Reverse Trial",[em.GD.FRACTIONAL_PREMIUM_GIVEBACK]:"Giveback",[em.GD.SUBSCRIPTION]:"Subscription",[em.GD.SUBSCRIPTION_MEMBER]:"Subscription Member"};function iH(e){let t,{entitlement:a,active:n,onDelete:l}=e;function i(e){return null!=e?(0,nX.i$)(e,"LLL"):"---"}return(0,o.jsxs)("div",{className:q()(i$.Nr,n?iV.C1:""),children:[(0,o.jsxs)(g.E,{variant:"text-md/normal",children:["ID: ",a.id," "]}),!n&&(0,o.jsxs)(g.E,{variant:"text-md/normal",children:["SKU: ",iz.find(e=>e.value===a.skuId)?.label]}),null!=a.startsAt&&null!=a.endsAt&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(g.E,{variant:"text-md/normal",children:["Start: ",i(a.startsAt)," "]}),(0,o.jsxs)(g.E,{variant:"text-md/normal",children:["End: ",i(a.endsAt)," "]})]}),(0,o.jsxs)(g.E,{variant:"text-md/normal",children:["Entitlement source type: ",null!=(t=a.sourceType)&&t in iW?iW[t]:`Unknown source type ${t}`]}),n&&null!=l&&(0,o.jsx)(n$.$n,{className:i$.RW,size:n$.$n.Sizes.TINY,color:n$.$n.Colors.RED,look:n$.$n.Looks.OUTLINED,onClick:l,children:"Delete"})]})}let iz=[{id:"1h",label:"1 hour",value:iw.j.PREMIUM_TIER_2_1_HOUR},{id:"1d",label:"1 day",value:iw.j.PREMIUM_TIER_2_1_DAY},{id:"3d",label:"3 days",value:iw.j.PREMIUM_TIER_2_3_DAY}];function iK(){let[e,t]=c.useState(!1),[a,n]=c.useState(iw.j.PREMIUM_TIER_2_1_HOUR),[l,i]=c.useState([]),[s,r]=c.useState([]),{refreshEntitlementList:d,grantFractionalPremium:u,deleteFractionalPremium:m,triggerNextEntitlementFulfillment:h,entitlements:x,loading:j}=iB();return c.useEffect(()=>{d()},[d]),c.useEffect(()=>{i(x.filter(e=>null!=e.endsAt&&e.endsAt>new Date&&e.type===em.zF_.FRACTIONAL_REDEMPTION)),r(x.filter(e=>Object.values(iw.j).includes(e.skuId)&&null==e.startsAt))},[x]),(0,o.jsx)(v.Ip,{className:tX.nd,children:(0,o.jsxs)("div",{className:iV.l$,children:[(0,o.jsxs)("div",{className:iV.dL,children:[(0,o.jsx)(g.E,{style:{marginBottom:"8px"},variant:"text-lg/bold",children:"Manage Fractional Nitro"}),(0,o.jsxs)(J.D,{onClick:()=>t(!e),className:i$.As,children:[(0,o.jsx)("div",{children:(0,o.jsx)(g.E,{variant:"text-md/normal",children:"Info"})}),(0,o.jsx)(iM.A,{direction:e?iM.A.Directions.UP:iM.A.Directions.DOWN})]})]}),e&&(0,o.jsxs)("div",{style:{margin:"8px 0"},children:[(0,o.jsx)(g.E,{variant:"text-md/normal",style:{fontStyle:"italic"},color:"text-muted",children:"Subscriptions paused by Fractional Nitro do not automatically resume in local or staging environments. Subscription has to be resumed manually via Admin."}),(0,o.jsx)("br",{}),(0,o.jsx)(g.E,{variant:"text-md/normal",style:{fontStyle:"italic"},color:"text-muted",children:"Entitlement fulfillment tasks do not run automatically in local environments. This task is required to handle the scheduled unfulfillment of Fractional Nitro after it's time has elapsed."})]}),(0,o.jsxs)("section",{style:{marginBottom:"8px"},className:q()([i$.uW,iV.Uo]),children:[(0,o.jsx)(f.l,{label:"Fractional Premium SKU",value:a,options:iz,onSelectionChange:n,selectionMode:"single",fullWidth:!0}),(0,o.jsx)(p.$,{variant:"primary",text:"Grant Fractional Nitro",onClick:()=>u(a)})]}),(0,o.jsxs)("section",{className:i$.uW,children:[(0,o.jsxs)("div",{style:{flexWrap:"wrap"},className:iV.dL,children:[(0,o.jsx)(g.E,{style:{marginBottom:"8px"},variant:"text-lg/semibold",children:"Entitlements"}),(0,o.jsxs)("div",{className:i$.GC,children:[(0,o.jsx)(n$.$n,{disabled:j,size:n$.$n.Sizes.TINY,color:n$.$n.Colors.PRIMARY,look:n$.$n.Looks.OUTLINED,onClick:()=>h(),children:"Run fulfillment"}),(0,o.jsx)(n$.$n,{disabled:j,size:n$.$n.Sizes.TINY,color:n$.$n.Colors.RED,look:n$.$n.Looks.OUTLINED,onClick:()=>m(),children:"Delete all"}),(0,o.jsx)(n$.$n,{disabled:j,look:n$.$n.Looks.BLANK,size:n$.$n.Sizes.ICON,onClick:d,children:(0,o.jsx)("span",{title:"Refresh",children:(0,o.jsx)(iO.RefreshIcon,{size:"xs",color:"currentColor"})})})]})]}),l.length>0&&(0,o.jsxs)("div",{children:[(0,o.jsx)(g.E,{style:{marginTop:"15px"},variant:"text-md/bold",children:"Active premium"}),(0,o.jsx)("div",{children:l.map(e=>(0,o.jsx)(iH,{entitlement:e,active:!0,onDelete:()=>m(e.id)},e.id))})]}),s.length>0&&(0,o.jsxs)("div",{children:[(0,o.jsx)(g.E,{style:{marginTop:"15px"},variant:"text-md/bold",children:"Unconsumed Fractional Premium"}),(0,o.jsx)("div",{children:s.map(e=>(0,o.jsx)(iH,{entitlement:e},e.id))})]})]})]})})}var iY=a(832604),iq=a(264572).Buffer;let iJ=/[^a-zA-Z0-9_.-]+/g;function iQ(e){let{runningGame:t}=e,a=(0,iY.A)(t.pid,void 0),[n,l]=(0,c.useState)(!1),i=t.name??t.exeName??"",s=null!=a&&!n;async function r(){if(null!=a){l(!0);try{let e,t=await E.A.fileManager.saveWithDialog2(iq.from(a.slice(a.indexOf(",")+1),"base64"),(e=i.trim().replace(iJ,"_"),`${e.length>0?e:"icon"}.png`),void 0);null==t||t.canceledByUser||(0,l3.P0)({text:`Saved icon to ${t.directory}`,variant:"success"})}catch{(0,l3.P0)({text:"Failed to save icon",variant:"critical"})}finally{l(!1)}}}return(0,o.jsxs)(tY.B,{direction:"horizontal",align:"center",justify:"space-between",gap:12,children:[(0,o.jsxs)(tY.B,{direction:"horizontal",align:"center",gap:12,fullWidth:!1,children:[null!=a?(0,o.jsx)("img",{src:a,alt:i,width:48,height:48}):(0,o.jsx)(g.E,{variant:"text-xxs/normal",color:"text-muted",children:"no icon"}),(0,o.jsxs)(tY.B,{direction:"vertical",gap:0,fullWidth:!1,children:[(0,o.jsx)(g.E,{variant:"text-md/normal",children:i}),(0,o.jsxs)(g.E,{variant:"text-xxs/normal",color:"text-muted",children:[t.id??"(no id)"," \xb7 ",t.distributor??"unknown",":",t.sku??"\u2014"]}),(0,o.jsx)(g.E,{variant:"text-xxs/normal",color:"text-muted",children:t.exePath})]})]}),(0,o.jsx)(p.$,{variant:"primary",text:"Save Icon",onClick:r,disabled:!s})]})}function iX(){let e=(0,d.bG)([S.Ay],()=>S.Ay.getRunningGames());return(0,o.jsxs)(tY.B,{gap:16,padding:12,fullWidth:!1,children:[(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsx)(X.D,{variant:"heading-md/bold",children:"Game Icon Extractor"}),(0,o.jsx)(g.E,{variant:"text-sm/normal",children:"Save a running game's locally-detected icon as a PNG."})]}),(0,o.jsx)(y.c,{}),(0,o.jsxs)(tY.B,{gap:12,children:[(0,o.jsx)(X.D,{variant:"heading-sm/bold",children:"Running Games"}),0===e.length?(0,o.jsx)(g.E,{variant:"text-sm/normal",children:"No games detected. Launch a game first."}):e.map(e=>(0,o.jsx)(iQ,{runningGame:e},`${e.pid}-${e.exePath}`))]})]})}var iZ=a(390544),i0=a(498480),i1=a(475669),i2=a(486223);function i5(){let e=(0,d.bG)([nS.A],()=>nS.A.getGuildId()),t=(0,d.bG)([nE.A],()=>nE.A.getGuild(e)?.name),a=(0,d.bG)([i1.A],()=>i1.A.getStateForGuild(e)?.instances),n=c.useMemo(()=>Object.values(a??{})[0],[a]),l=c.useCallback(t=>{null!=n&&null!=e&&tw.h.dispatch({type:"GAME_SERVER_UPDATE_INSTANCE_SUCCESS",guildId:e,instance:{...n,status:t}})},[n,e]),i=c.useMemo(()=>Object.values(iZ.M).map(e=>(0,o.jsx)(p.$,{variant:"primary",text:e,onClick:()=>{l(e)}},e)),[l]),s=c.useCallback(()=>{null!=n&&null!=e&&tw.h.dispatch({type:"GAME_SERVER_UPDATE_INSTANCE_SUCCESS",guildId:e,instance:{...n,serverIP:void 0,port:void 0,gameServerPanelUrl:void 0}})},[n,e]);return null==e?null:(0,o.jsxs)(v.Ip,{className:i2.kL,children:[(0,o.jsx)("div",{className:i2.uW,children:(0,o.jsx)(X.D,{variant:"heading-md/normal",children:`Current guild: ${t}`})}),(0,o.jsxs)("div",{className:i2.uW,children:[(0,o.jsx)(g.E,{variant:"eyebrow",children:`Set server state for first server: ${n?.name}`}),(0,o.jsx)("div",{className:i2.UD,children:i}),(0,o.jsx)(g.E,{variant:"eyebrow",children:"Remove Server Info"}),(0,o.jsx)("div",{className:i2.UD,children:(0,o.jsx)(p.$,{variant:"primary",text:"Remove IP Address & Game Server Panel URL",onClick:s})}),(0,o.jsx)(g.E,{variant:"eyebrow",children:"Reset server"}),(0,o.jsx)(p.$,{variant:"primary",text:"Reset",onClick:()=>{(0,i0.cq)(e)}})]})]})}function i3(e,t){let a="boolean"==typeof t?t:!ni.Ay.get(e);tw.h.dispatch({type:"DEV_TOOLS_DEV_SETTING_SET",toggle:e,value:a})}var i6=a(257446);function i8(e){let{devSettingsCategory:t}=e,a=(0,d.bG)([ni.Ay],()=>ni.Ay.allByCategory(t),[t],d.My),n=c.useMemo(()=>a.map(e=>{let[t,a,{label:n}]=e;return(0,o.jsx)(h.d,{label:n,description:t,checked:a,onChange:e=>i3(t,e)},t)}),[a]);return(0,o.jsx)("div",{className:q()(tX.nd,i6.n),children:n})}var i4=a(950305),i7=a(231483),i9=a(597770),se=a(433492),st=a(695458),sa=a(796140),sn=a(268791),sl=a(836480),si=a(855473),ss=a(626258),sr=a(420854),so=a(373846),sc=a(657044),sd=a(141060),su=a(608599),sm=a(685761),sh=a(157225),sx=a(362704),sp=a(625903),sg=a(628284),sv=a(320448),sj=a(562708),sf=a(830215),sb=a(662502),sy=a(889227),sE=a(499785),sS=a(315069);class sC extends sS.A{id;summary;userIds;password;constructor(e){super(),this.id=e.pool_id,this.summary=e.summary,this.userIds=e.user_ids}static fromServer(e){return new sC(e)}setPassword(e){return this.password=e,this}}let s_={pools:null,users:null};function sA(e){null==s_.users&&(s_.users=new Map),s_.users.set(e.id,new sy.A(e))}class sN extends d.Ay.PersistedStore{static displayName="GeneratedTestUsersStore";static persistKey="GeneratedTestUsersStore";initialize(e){null!=e&&(null!=e.pools&&(s_.pools=new Map(Object.entries(e.pools))),null!=e.users&&(s_.users=new Map(Object.entries(e.users))))}getState(){return{pools:null!=s_.pools?Object.fromEntries(s_.pools):null,users:null!=s_.users?Object.fromEntries(s_.users):null}}getUsersForPool(e){return Array.from(s_.users?.values()??[]).filter(t=>s_.pools?.get(e)?.userIds.includes(t.id))}getPool(e){return s_.pools?.get(e)??null}getUser(e){return s_.users?.get(e)??null}getPools(){return null===s_.pools?null:Array.from(s_.pools.values())}}let sk=new sN(tw.h,{GENERATED_POOL_BY_ID_FETCH_SUCCESS:function(e){let{pool:t,users:a}=e;null==s_.pools&&(s_.pools=new Map),s_.pools.set(t.id,t),a.forEach(sA)},GENERATED_POOL_REMOVE_FROM_LIST:function(e){let{poolId:t}=e,a=s_.pools?.get(t);if(null==a)return!1;a.userIds.length>0&&a.userIds.forEach(e=>{s_.users?.delete(e)}),s_.pools?.delete(t)}});var sI=a(835002);async function sD(e,t){return await sE.A.get({url:em.Rsh.GENERATED_POOL_BY_ID(e),trackedActionData:{event:sj.NetworkActionNames.USER_LOGIN},rejectWithError:!1}).then(e=>{let{ok:a,body:n}=e;if(!a)return void sb.A.showFailedToast(sI.OB.GENERIC_ERROR);let{generated_pool:l,users:i}=n;tw.h.dispatch({type:"GENERATED_POOL_BY_ID_FETCH_SUCCESS",pool:sC.fromServer(l).setPassword(t),users:i.map(e=>new sy.A(e))})}).catch(()=>(sb.A.showFailedToast(sI.OB.GENERIC_ERROR),null))}var sT=a(844330),sR=a(157416);let sw=[i4.UserIcon,i7.ShieldIcon,i9.GiftIcon,se.K,st.m,sa.c,sn.$,sl.CompassIcon,si.Z,ss.A,sr.E,so.C,sc._,sd.i,su.L,sm.f,sh.N,sx.Y,sp.SettingsIcon],sO=["text-default","text-feedback-positive","text-feedback-warning","text-feedback-info","text-feedback-critical"];function sM(){let[e,t]=c.useState(""),[a,n]=c.useState(""),[l,i]=c.useState(!1);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("form",{onSubmit:async l=>{l.preventDefault(),i(!0);try{await sD(e,a),t(""),n("")}finally{i(!1)}},children:(0,o.jsxs)(tY.B,{direction:"vertical",align:"center",gap:8,children:[(0,o.jsxs)(tY.B,{direction:"horizontal",align:"center",gap:4,children:[(0,o.jsx)(b.k,{fullWidth:!0,value:e,onChange:t,placeholder:"Pool ID",disabled:l}),(0,o.jsx)(b.k,{type:"password",fullWidth:!0,value:a,onChange:n,placeholder:"Password",disabled:l})]}),(0,o.jsxs)(tY.B,{direction:"horizontal",align:"center",gap:4,children:[(0,o.jsx)(p.$,{type:"button",size:"md",fullWidth:!0,variant:"secondary",text:"Clear",onClick:()=>{t(""),n("")},disabled:0===e.length||0===a.length||l}),(0,o.jsx)(p.$,{type:"submit",size:"md",fullWidth:!0,variant:"primary",text:"Add Pool",disabled:0===e.length||0===a.length||l,loading:l})]})]})}),(0,o.jsx)(y.c,{gap:4})]})}function sP(e){let{pool:t}=e,{id:a,summary:n}=t,l=sk.getUsersForPool(a),i=(0,d.bG)([n0.default],()=>n0.default.getId()),s=sw[Number(a)%sw.length],r=sO[Number(a)%sO.length],u=c.useCallback(()=>{tw.h.dispatch({type:"GENERATED_POOL_REMOVE_FROM_LIST",poolId:a})},[a]);return(0,o.jsx)(tY.B,{direction:"horizontal",align:"start",justify:"space-between",children:(0,o.jsx)(sT.A,{icon:(0,o.jsx)(g.E,{variant:"text-md/medium",color:r,className:sR.td,children:(0,o.jsx)(s,{size:"custom",width:24,height:24,color:"currentColor"})}),title:n,className:sR.JC,subtitle:`${l.length} users`,children:(0,o.jsxs)(tY.B,{direction:"vertical",gap:4,padding:{left:24,right:8,bottom:16},fullWidth:!1,children:[l.map((e,a)=>(0,o.jsxs)(c.Fragment,{children:[0!==a&&(0,o.jsx)(y.c,{gap:4}),(0,o.jsx)(J.D,{onClick:a=>{a.stopPropagation(),function(e,t){let a=sk.getUser(t);if(null==a)throw Error("User not found");let n=sk.getPool(e)?.password;if(null==n)throw Error("Pool password not found");if(null==a.email)throw Error("User email not found");sf.A.login({login:a.email,password:n,isMultiAccount:!0,source:"generated_test_user"}).catch(()=>(sb.A.showFailedToast(sI.OB.GENERIC_ERROR),null))}(t.id,e.id)},"aria-disabled":i===e.id,className:q()(sR.vk,{[sR.Pe]:i===e.id}),children:(0,o.jsxs)(tY.B,{direction:"horizontal",align:"center",justify:"space-between",gap:8,padding:{right:8},fullWidth:!1,children:[(0,o.jsxs)(tY.B,{direction:"horizontal",align:"center",gap:8,fullWidth:!1,className:q()({[sR.WP]:i===e.id}),children:[(0,o.jsx)(i4.UserIcon,{size:"custom",width:20,height:20,color:"currentColor"}),(0,o.jsxs)("div",{children:[(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-default",children:e.username}),(0,o.jsx)(g.E,{variant:"text-xs/normal",color:"text-muted",className:sR.c1,children:e.email})]})]}),i===e.id?(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-feedback-positive",children:(0,o.jsx)(sg.y,{size:"sm",color:"currentColor"})}):(0,o.jsx)(sv._,{size:"sm",color:"currentColor"})]},e.id)},e.id)]},e.id)),(0,o.jsx)("div",{className:sR.UD,children:(0,o.jsx)(p.$,{icon:nz.TrashIcon,text:"",size:"sm",variant:"secondary",onClick:u})})]})})})}function sL(){let e=(0,d.yK)([sk],()=>sk.getPools()??[]);return(0,o.jsxs)(tY.B,{padding:16,gap:16,fullWidth:!1,className:sR.kL,children:[(0,o.jsx)(sM,{}),(0,o.jsx)(v.Ip,{className:sR.Ik,children:e?.map(e=>(0,o.jsx)(sP,{pool:e},e.id))})]})}var sU=a(582306),sG=a(507104),sF=a(846466);function sB(e){let t=new Date(e);return t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})+" "+t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}function s$(e,t){return null!=t?`/users/@me/gift-intents/dismissals/${e}/${t}`:`/users/@me/gift-intents/dismissals/${e}`}let sV=tM.np.FRIEND_ANNIVERSARY;function sW(e){return 403===e?.status?"Forbidden (403). This account is likely not in the backend-persistence experiment; clearing also requires a staff account.":e instanceof Error?e.message:String(e)}function sH(){let e=(0,d.bG)([sG.Ay],()=>sG.Ay.getDevToolTotalFriendAnniversaries()),t=(0,d.bG)([sG.Ay],()=>sG.Ay.getDevToolCurrentDate()),a=(0,d.bG)([sG.Ay],()=>sG.Ay.getMessageGiftIntentLastShownMap()),n=(0,d.bG)([sG.Ay],()=>sG.Ay.getHighestAffinityFriendAnniversaries()),l=(0,d.bG)([sG.Ay],()=>sG.Ay.getHighAffinityFriendAnniversaries()),i=(0,d.bG)([eo.default],()=>eo.default.getCurrentUser()?.isStaff()??!1),s=(0,d.bG)([az.A],()=>az.A.getFriendIDs().filter(e=>!az.A.isIgnored(e)&&null!=az.A.getSince(e)).length),r=(0,d.bG)([aM.A],()=>{let e=Number(aM.A.settings.userContent?.lastGiftIntentDismissedAtMs??"0");return Number.isNaN(e)||0===e?null:e}),[u,m]=c.useState([]),[h,x]=c.useState(null),[j,b]=c.useState(!1),[y,E]=c.useState(!1),[S,C]=c.useState(!1),[_,A]=c.useState(void 0),N=c.useCallback(async()=>{E(!0);try{let{body:e}=await it.Bo.get({url:"/users/@me/gift-intent-dismissals",rejectWithError:!0});m(e.dismissals??[]),x(null),b(!1)}catch(t){let e=t.status;x(sW(t)),b(403===e),403===e&&m([])}finally{E(!1)}},[]);async function k(e){C(!0);try{await e(),x(null),await N()}catch(e){x(sW(e))}finally{C(!1)}}c.useEffect(()=>{N()},[N,r]);let I=u.filter(e=>e.intent_type===sV),D=new Map(I.map(e=>[e.target_id,Number(e.dismissed_at_ms)])),T=Array.from(new Set([...Object.keys(a),...D.keys()])),R=Array.from(new Set([...n,...l])),w=R.map(e=>({id:e,value:e,label:eo.default.getUser(e)?.username??`Unknown User (${e})`})),O=y||S;function M(e){tw.h.dispatch({type:"DEV_TOOLS_SET_FRIEND_ANNIVERSARY_COUNT",total:e})}function P(e){let t=nI.A.getUserAffinity(e);return t?.dmProbability!=null?`${(100*t.dmProbability).toFixed(3)}%`:"N/A"}return(0,o.jsx)(v.Ip,{className:tX.nd,children:(0,o.jsxs)("div",{className:sF.l$,children:[(0,o.jsx)(g.E,{className:sF.Iv,variant:"text-lg/bold",children:"Friend Anniversary"}),(0,o.jsx)("div",{className:sF.Pm,children:(0,o.jsxs)(tY.B,{gap:8,direction:"horizontal",style:{flex:1},children:[(0,o.jsx)(f.l,{label:"Number of anniversaries to generate",selectionMode:"single",options:[{id:"none",label:"None",value:null},{id:"1",label:"1",value:1},{id:"2",label:"2",value:2},{id:"3",label:"3",value:3},{id:"4",label:"4",value:4},{id:"5",label:"5",value:5},{id:"10",label:"10",value:10},{id:"25",label:"25",value:25}],value:e,onSelectionChange:e=>{M(e)}}),(0,o.jsx)(p.$,{size:"sm",variant:"secondary",text:"Re-randomize",disabled:null==e,onClick:function(){tw.h.dispatch({type:"DEV_TOOLS_RESAMPLE_FRIEND_ANNIVERSARIES"})}}),(0,o.jsx)(p.$,{size:"sm",variant:"secondary",text:"Clear",onClick:()=>{M(null)}})]})}),null!=e&&(0,o.jsx)("div",{className:sF.Pm,children:(0,o.jsxs)(tY.B,{gap:8,children:[0===s?(0,o.jsx)(g.E,{variant:"text-xs/normal",color:"text-feedback-warning",children:"No friends with an anniversary date, so no anniversaries can be generated."}):(0,o.jsxs)(g.E,{variant:"text-xs/normal",children:["Generated ",R.length," of ",e," requested",R.length<e?` (only ${s} friend${1===s?"":"s"} with an anniversary date).`:"."]}),(0,o.jsx)(g.E,{variant:"text-xs/normal",children:"Affinity is the percent chance that User A will DM or GDM User B in the next 7 days."}),(0,o.jsx)(g.E,{variant:"text-xs/normal",children:"The devtool automatically assigns users as high affinity regardless of actual affinity for testing."}),n.length>0&&(0,o.jsxs)(tY.B,{gap:4,children:[(0,o.jsx)(g.E,{variant:"text-xs/semibold",children:"Highest Affinity Friend Anniversaries:"}),n.map(e=>{let t=eo.default.getUser(e),a=t?.username??`Unknown User (${e})`;return(0,o.jsxs)(g.E,{variant:"text-xs/normal",children:[a," (",P(e),")"]},e)})]}),l.length>0&&(0,o.jsxs)(tY.B,{gap:4,children:[(0,o.jsx)(g.E,{variant:"text-xs/semibold",children:"High Affinity Friend Anniversaries:"}),l.map(e=>{let t=eo.default.getUser(e),a=t?.username??`Unknown User (${e})`;return(0,o.jsxs)(g.E,{variant:"text-xs/normal",children:[a," (",P(e),")"]},e)})]})]})}),(0,o.jsx)("div",{className:sF.Pm,children:(0,o.jsxs)(tY.B,{gap:8,direction:"horizontal",children:[(0,o.jsx)(sU.J,{label:"Override current date used for cooldowns",value:null!=t?nB()(t):void 0,onSelect:function(e){let t=nB()(),a=e.clone().hours(t.hours()).minutes(t.minutes()).seconds(t.seconds()).milliseconds(t.milliseconds());tw.h.dispatch({type:"DEV_TOOLS_SET_CURRENT_DATE",date:a.valueOf()})}}),(0,o.jsx)(p.$,{variant:"secondary",size:"sm",text:"Clear",onClick:function(){tw.h.dispatch({type:"DEV_TOOLS_RESET_CURRENT_DATE"})}})]})}),(0,o.jsxs)("div",{className:sF.Pm,children:[(0,o.jsx)(g.E,{variant:"text-md/normal",children:"Reset gift message cooldown (per-user, 14d)"}),(0,o.jsx)(p.$,{variant:"primary",size:"sm",text:"Reset",onClick:function(){tw.h.dispatch({type:"DEV_TOOLS_GIFT_MESSAGE_COOLDOWN_RESET"})}})]}),(0,o.jsxs)("div",{className:sF.Pm,children:[(0,o.jsx)(g.E,{variant:"text-md/normal",children:"Clear last seen friend anniversaries in All Friends"}),(0,o.jsx)(p.$,{variant:"primary",size:"sm",text:"Clear",onClick:function(){tw.h.dispatch({type:"DEV_TOOLS_FRIENDS_LIST_GIFT_INTENTS_SHOWN_RESET"})}})]}),(0,o.jsx)("div",{className:sF.Pm,children:(0,o.jsxs)(tY.B,{gap:12,fullWidth:!0,children:[(0,o.jsx)(g.E,{variant:"text-md/semibold",children:"Backend dismissal sync"}),(0,o.jsxs)(tY.B,{gap:4,children:[j&&(0,o.jsx)(g.E,{variant:"text-xs/normal",color:"text-feedback-warning",children:"This account is not in the backend-persistence experiment, so nothing here will persist to the server."}),!i&&(0,o.jsx)(g.E,{variant:"text-xs/normal",color:"text-feedback-warning",children:"Clearing server dismissals requires a staff account."}),(0,o.jsxs)(g.E,{variant:"text-xs/normal",children:["Server last recorded a dismissal:"," ",null!=r?sB(r):"never"]})]}),(0,o.jsxs)(tY.B,{gap:8,direction:"horizontal",align:"end",children:[(0,o.jsx)(p.$,{size:"sm",variant:"secondary",text:"Refresh",onClick:()=>{N()},disabled:O}),(0,o.jsx)(p.$,{size:"sm",variant:"primary",text:"Clear all",onClick:function(){k(()=>it.Bo.del({url:s$(sV),rejectWithError:!0}))},disabled:O||!i||j||0===I.length})]}),(0,o.jsxs)(tY.B,{gap:8,direction:"horizontal",align:"end",children:[(0,o.jsx)(f.l,{label:"Dismiss a generated anniversary on the server",selectionMode:"single",options:w,value:_,onSelectionChange:e=>{A(e)}}),(0,o.jsx)(p.$,{size:"sm",variant:"secondary",text:"Dismiss on server",onClick:function(){null!=_&&k(()=>it.Bo.post({url:"/users/@me/gift-intents/dismiss",body:{intent_type:sV,target_id:_},rejectWithError:!0}))},disabled:O||j||null==_})]}),0===w.length&&(0,o.jsx)(g.E,{variant:"text-xs/normal",children:"Generate friend anniversaries above to pick a target to dismiss."}),null!=h&&(0,o.jsx)(g.E,{variant:"text-xs/normal",color:"text-feedback-critical",children:h}),y&&(0,o.jsx)(g.E,{variant:"text-xs/normal",children:"Loading..."}),!y&&0===T.length&&(0,o.jsx)(g.E,{variant:"text-xs/normal",children:"No dismissals recorded locally or on the server."}),!y&&T.length>0&&(0,o.jsxs)(tY.B,{gap:4,children:[(0,o.jsx)(g.E,{variant:"text-xs/semibold",children:"Local vs. server (per friend):"}),T.map(e=>{let t=eo.default.getUser(e),n=t?.username??`Unknown User (${e})`,l=a[e],s=D.get(e);return(0,o.jsxs)(tY.B,{gap:8,direction:"horizontal",justify:"space-between",align:"center",children:[(0,o.jsxs)(g.E,{variant:"text-xs/normal",children:[n,": local ",null!=l?sB(l):"none",", server"," ",null!=s?sB(s):"none"]}),null!=s&&(0,o.jsx)(p.$,{size:"sm",variant:"secondary",text:"Clear",onClick:()=>{k(()=>it.Bo.del({url:s$(sV,e),rejectWithError:!0}))},disabled:O||!i||j})]},e)})]})]})})]})})}var sz=a(460890),sK=a(28863),sY=a(517461),sq=a(214947),sJ=a(403581),sQ=a(34188);let sX=["ILLO_BLUE","ILLO_GREEN","ILLO_PINK","ILLO_ORANGE","ILLO_PURPLE","ILLO_YELLOW","BLUE_NEW","GREEN_NEW","NEUTRAL","ORANGE_NEW","RED_NEW","TEAL_NEW","YELLOW_NEW"];var sZ=a(277583);let s0=[0,.5,1],s1=["Center","Inner ring","Outer ring"],s2=s0.length,s5="ILLO_BLUE",s3="ILLO_BLUE_40",s6=Array.from({length:s2},()=>s3),s8=Array.from({length:s2},()=>s5),s4=["1","0.5","0"],s7=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i,s9=[{label:"Light",value:em.NJ8.LIGHT,id:em.NJ8.LIGHT},{label:"Ash",value:em.NJ8.ASH,id:em.NJ8.ASH},{label:"Dark",value:em.NJ8.DARK,id:em.NJ8.DARK},{label:"Onyx",value:em.NJ8.ONYX,id:em.NJ8.ONYX}],re={[em.NJ8.ASH]:em.NJ8.DARK,[em.NJ8.ONYX]:em.NJ8.DARK,[em.NJ8.LIGHT]:em.NJ8.DARK},rt={[em.NJ8.LIGHT]:"light",[em.NJ8.ASH]:"ash",[em.NJ8.DARK]:"dark",[em.NJ8.ONYX]:"onyx"},ra=[{id:"friends",icon:sq.$,text:"Friends"},{id:"nitro",icon:sJ.t,text:"Nitro Home",nitroHoverGradient:!0},{id:"shop",icon:sQ.U,text:"Shop",useCustomGradient:!0}],rn=sX.map(e=>({label:e,value:e,id:e})),rl=Object.fromEntries(sX.map(e=>[e,Object.keys(eq.A.unsafe_rawColors).filter(t=>String(t).startsWith(e+"_")).sort((e,t)=>parseInt(String(e).split("_").pop()??"0",10)-parseInt(String(t).split("_").pop()??"0",10)).map(e=>{let t=String(e).split("_").pop()??e,[a,n,l]=eq.A.unsafe_rawColors[e].resolve().rgba(),i=(.299*a+.587*n+.114*l)/255>.5?eq.A.unsafe_rawColors.OPACITY_BLACK_28:eq.A.unsafe_rawColors.OPACITY_WHITE_28,s=(0,o.jsx)("span",{className:sZ.oP,style:{background:`rgb(${a}, ${n}, ${l})`,border:`1px solid ${i.css}`}});return{label:t,value:e,id:String(e),leading:s}})]));var ri=a(306327);function rs(e,t,a){return e.map((e,n)=>n===t?a:e)}function rr(e,t){let[a,n,l,i]=eq.A.unsafe_rawColors[e].resolve().rgba({opacity:t});return{r:a,g:n,b:l,a:i}}function ro(e,t){let a=eq.A.unsafe_rawColors[e].resolve();return null!=t?a.hex({opacity:t}):a.hex()}function rc(e){let{yaml:t,label:a}=e,n=c.useCallback(()=>{navigator.clipboard.writeText(t)},[t]);return(0,o.jsxs)(tY.B,{gap:4,children:[(0,o.jsxs)(tY.B,{direction:"horizontal",gap:8,align:"center",justify:"space-between",children:[(0,o.jsx)(g.E,{variant:"text-md/semibold",children:a}),(0,o.jsx)(eH.K,{icon:nV.CopyIcon,"aria-label":`Copy ${a} YAML`,onClick:n,variant:"secondary",size:"sm"})]}),(0,o.jsx)("pre",{className:sZ.RP,children:t})]})}function rd(e){let{allResolvedStops:t}=e,a=c.useMemo(()=>s1.map((e,a)=>{let n;return n=s9.map(e=>{let n,l,{value:i}=e,s=rt[i],r=t[i];return` ${s}:
color: ${-1===(l=(n=String(r.colors[a]).toLowerCase()).lastIndexOf("_"))?n.replace(/_/g,"-"):n.slice(0,l).replace(/_/g,"-")+"."+n.slice(l+1)}
opacity: ${r.opacities[a]}`}).join("\n"),`type: background
colors:
${n}
gradient-colors:
color-mix: false
codegen:
web: true
mobile: false`}),[t]);return(0,o.jsxs)(tY.B,{gap:16,children:[(0,o.jsx)(X.D,{variant:"heading-sm/semibold",children:"Token YAML"}),s1.map((e,t)=>(0,o.jsx)(rc,{yaml:a[t],label:e},e))]})}function ru(e,t,a){let{r:n,g:l,b:i,a:s}=function(e,t){if(t<=e[0].position){let t=e[0];return{r:t.r,g:t.g,b:t.b,a:t.opacity}}for(let a=0;a<e.length-1;a++){let n=e[a],l=e[a+1];if(t<=l.position){if(l.position===n.position)return{r:n.r,g:n.g,b:n.b,a:n.opacity};let e=(t-n.position)/(l.position-n.position);return{r:n.r+(l.r-n.r)*e,g:n.g+(l.g-n.g)*e,b:n.b+(l.b-n.b)*e,a:n.opacity+(l.opacity-n.opacity)*e}}}let a=e[e.length-1];return{r:a.r,g:a.g,b:a.b,a:a.opacity}}(t,a),r=.5*s;return new ri.A("srgb",[(e.r*(1-r)+n*r)/255,(e.g*(1-r)+l*r)/255,(e.b*(1-r)+i*r)/255])}function rm(e,t,a){var n;let l=a.map(e=>{let[t,a,n]=eq.A.unsafe_rawColors[e.color].resolve().rgba();return{r:t,g:a,b:n,opacity:e.opacity,position:e.position}}),i=1/0;for(let a of l)(n=e.contrast(ru(t,l,a.position),"WCAG21"))<i&&(i=n);for(let a=0;a<l.length-1;a++){let{contrast:n}=function(e,t,a,n,l){let i=1/0,s=n;for(let r=0;r<=100;r++){let o=n+r/100*(l-n),c=a.contrast(ru(e,t,o),"WCAG21");c<i&&(i=c,s=o)}return{contrast:i,position:s}}(t,l,e,l[a].position,l[a+1].position);n<i&&(i=n)}return Math.round(100*i)/100}function rh(e){let[t,a,n]=eq.A.colors.TEXT_DEFAULT.resolve(e).rgba(),[l,i,s]=eq.A.colors.BACKGROUND_BASE_LOWEST.resolve(e).rgba(),[r,o,c,d]=eq.A.colors.INTERACTIVE_BACKGROUND_HOVER.resolve(e).rgba();return{text:new ri.A("srgb",[t/255,a/255,n/255]),background:{r:l*(1-d)+r*d,g:i*(1-d)+o*d,b:s*(1-d)+c*d}}}function rx(){return{colors:Array.from({length:s2},()=>void 0),scales:Array.from({length:s2},()=>void 0),opacities:Array.from({length:s2},()=>void 0)}}function rp(){return{[em.NJ8.LIGHT]:rx(),[em.NJ8.ASH]:{colors:[...s6],scales:[...s8],opacities:[...s4]},[em.NJ8.DARK]:rx(),[em.NJ8.ONYX]:rx()}}function rg(){let e=(0,sz.G9)(),[t,a]=c.useState(em.NJ8.DARK),[n,l]=(0,sY.V)("DevToolsGradientContrastPanel_themeStops",rp()),i=n??rp(),[s,r]=c.useState(["","",""]),[d,u]=c.useState([null,null,null]),[m,h]=c.useState(null),{images:x,renderPickers:j}=function(){let[e,t]=c.useState(null),a=c.useRef(null),n=c.useCallback(e=>{let a=e.target.files?.[0];if(null==a)return;let n=new FileReader;n.onload=()=>t({src:n.result,name:a.name}),n.readAsDataURL(a),e.target.value=""},[]),l=c.useCallback(()=>(0,o.jsxs)(tY.B,{direction:"horizontal",gap:8,align:"center",children:[(0,o.jsx)("input",{ref:a,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp,image/avif",onChange:n,style:{display:"none"}}),null!=e?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(g.E,{variant:"text-sm/normal",children:e.name}),(0,o.jsx)(l6.Q,{text:"Remove",variant:"critical",textVariant:"text-sm/medium",onClick:()=>t(null)})]}):(0,o.jsx)(p.$,{variant:"secondary",size:"sm",text:"Upload button hover image",onClick:()=>a.current?.click()})]}),[e,n]);return{images:{buttonBackground:e},renderPickers:l}}(),f=c.useMemo(()=>Object.fromEntries(s9.map(e=>{let{value:t}=e;return[t,function(e,t){let a=[],n=[],l=[];for(let i=0;i<s2;i++){let s,r,o,c=t;for(;null!=c;){let t=e[c];if(s??=t.colors[i],r??=t.scales[i],o??=t.opacities[i],null!=s&&null!=r&&null!=o)break;c=re[c]}a.push(s??s6[i]),n.push(r??s8[i]),l.push(o??s4[i])}return{colors:a,scales:n,opacities:l}}(i,t)]})),[i]),y=f[t],E=c.useCallback(e=>{l({...i,[t]:e(i[t])})},[t,l,i]),S=c.useMemo(()=>rh({theme:t,saturation:1}),[t]),C=c.useMemo(()=>{let e=[];for(let t=0;t<s2;t++){let a=parseFloat(y.opacities[t]);if(isNaN(a)||a<0||a>1)return null;e.push({color:y.colors[t],opacity:a,position:s0[t]})}return e},[y]),_=c.useMemo(()=>{if(null==C)return null;let{text:e,background:t}=S;return s1.map((a,n)=>rl[y.scales[n]].map(a=>{let l=rm(e,t,rs(C,n,{...C[n],color:a.value}));return{...a,trailing:`(${l}:1)`}}))},[C,S,y.scales]),A=c.useMemo(()=>{try{return s9.map(e=>{let{value:t,label:a}=e,n=f[t],l=[];for(let e=0;e<s2;e++){let i=parseFloat(n.opacities[e]);if(isNaN(i)||i<0||i>1)return{theme:t,label:a,result:null};l.push({color:n.colors[e],opacity:i,position:s0[e]})}return{theme:t,label:a,result:function(e,t){let a,{text:n,background:l}=rh(t),i=rm(n,l,e),s=i>=4.5;if(!s)for(let t=0;t<e.length;t++){let i=function(e){let t=String(e).match(/^(.+)_\d+$/);if(null==t)return null;let a=t[1];return sX.includes(a)?a:null}(e[t].color);if(null==i)continue;let s=parseInt(String(e[t].color).split("_").pop()??"0",10),r=1/0;for(let{value:o}of rl[i]){if(o===e[t].color)continue;let i=rm(n,l,rs(e,t,{...e[t],color:o}));if(i>=4.5){let e=Math.abs(parseInt(String(o).split("_").pop()??"0",10)-s);e<r&&(r=e,a={stopIndex:t,suggestedColor:o,resultingMinContrast:i})}}}return{passes:s,minContrastRatio:i,suggestion:a}}(l,{theme:t,saturation:1})}})}catch{return null}},[f]);return(0,o.jsx)(v.Ar,{className:sZ.XG,children:(0,o.jsxs)(tY.B,{gap:24,padding:8,className:sZ.zr,children:[(0,o.jsx)(X.D,{variant:"heading-lg/medium",children:"Tab Hover Gradient Token Generator & Contrast Checker"}),(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsx)(g.E,{variant:"text-md/normal",children:"Checks that tab hover gradients pass WCAG AA (4.5:1) contrast against the text in the tab, accounting for opacities and hover states."}),(0,o.jsx)(g.E,{variant:"text-sm/normal",children:"Pick colors for each gradient stop (center, inner ring, outer ring) per theme. Each color in the dropdown will show the minimum contrast ratio for the gradient if the color were selected. Dark-family themes inherit: values set on Dark cascade to Darker and Onyx unless overridden."}),(0,o.jsx)(g.E,{variant:"text-sm/normal",children:"Use the hex field to paste in a hex color \u2014 it will snap to the closest allowed token and show the deltaE distance."}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",children:["Copy the generated YAML at the bottom to create your token definitions to be used by the"," ",(0,o.jsx)(sK.Anchor,{href:"https://design.discord.tools/foundations/color/token-pipeline",children:"token pipeline"}),"."]})]}),(0,o.jsx)(aE.Z,{selectionMode:"single",label:"Theme",value:t,onSelectionChange:e=>a(e),closeOnSelect:!0,options:s9}),(0,o.jsxs)(tY.B,{gap:16,children:[(0,o.jsx)(X.D,{variant:"heading-sm/semibold",children:"Gradient Stops"}),(0,o.jsx)("div",{className:sZ.G9,children:s1.map((e,t)=>{let a=""!==s[t];return(0,o.jsxs)(c.Fragment,{children:[(0,o.jsxs)(tY.B,{gap:0,className:sZ.hi,children:[(0,o.jsx)(g.E,{variant:"text-md/medium",children:e}),(0,o.jsx)(l6.Q,{variant:"secondary",textVariant:"text-xs/normal",text:`(${ro(y.colors[t],parseFloat(y.opacities[t]))})`,onClick:()=>navigator.clipboard.writeText(ro(y.colors[t],parseFloat(y.opacities[t])))})]}),(0,o.jsx)(aE.Z,{selectionMode:"single",label:"Scale",disabled:a,value:y.scales[t],onSelectionChange:e=>{let a=rl[e][0]?.value;E(n=>({...n,scales:rs(n.scales,t,e),colors:null!=a?rs(n.colors,t,a):n.colors}))},closeOnSelect:!0,options:rn}),(0,o.jsx)(aE.Z,{selectionMode:"single",label:"Value",disabled:a,value:y.colors[t],onSelectionChange:e=>E(a=>({...a,colors:rs(a.colors,t,e)})),closeOnSelect:!0,options:_?.[t]??rl[y.scales[t]]}),(0,o.jsx)(b.k,{label:"Opacity",name:`opacity-${t}`,value:y.opacities[t],onChange:e=>E(a=>({...a,opacities:rs(a.opacities,t,e)})),placeholder:"0\u20131"}),(0,o.jsx)(b.k,{label:`Hex${a&&null!=d[t]?` (dE: ${d[t]})`:""}`,name:`hex-${t}`,value:s[t],onChange:e=>{r(a=>rs(a,t,e));let a=function(e){if(!s7.test(e))return null;try{return new ri.A(e.startsWith("#")?e:`#${e}`)}catch{return null}}(e);if(null!=a){let e=function(e){let t=s3,a=s5,n=1/0;for(let l of sX)for(let i of rl[l]){let s=e.deltaE(function(e){let[t,a,n]=eq.A.unsafe_rawColors[e].resolve().rgba();return new ri.A("srgb",[t/255,a/255,n/255])}(i.value),"2000");s<n&&(n=s,t=i.value,a=l)}return{color:t,scale:a,deltaE:Math.round(100*n)/100}}(a);u(a=>rs(a,t,e.deltaE)),E(a=>({...a,scales:rs(a.scales,t,e.scale),colors:rs(a.colors,t,e.color)}))}else u(e=>rs(e,t,null))},placeholder:"#hex"})]},t)})})]}),j(),(0,o.jsx)(X.D,{variant:"heading-sm/semibold",children:"Preview"}),(0,o.jsx)(sz.GE,{value:{...e,theme:t},children:(0,o.jsx)(eK.N,{theme:t,children:e=>(0,o.jsx)("div",{className:e,children:(0,o.jsx)(tY.B,{gap:16,children:(0,o.jsx)("ul",{className:sZ.$8,style:{background:eq.A.colors.BACKGROUND_BASE_LOWEST.css},children:ra.map((e,t)=>(0,o.jsx)(eb.z9,{route:"",selected:m===e.id,onClick:()=>h(e.id),icon:e.icon,text:e.text,showHoverGradient:!0,nitroHoverGradient:"nitroHoverGradient"in e,role:"listitem",tabIndex:0,onFocus:()=>{},..."useCustomGradient"in e&&{hoverGradientStart:rr(y.colors[0],parseFloat(y.opacities[0])),hoverGradientMiddle:rr(y.colors[1],parseFloat(y.opacities[1])),hoverGradientEnd:rr(y.colors[2],parseFloat(y.opacities[2]))},...{"data-list-item-id":`devtools-preview-${t}`},children:"useCustomGradient"in e&&x.buttonBackground?.src!=null&&(0,o.jsx)("div",{style:{position:"absolute",height:"100%",bottom:0,insetInlineEnd:0,pointerEvents:"none",borderRadius:"inherit"},children:(0,o.jsx)("img",{src:x.buttonBackground.src,alt:"","aria-hidden":!0,style:{height:"100%",maxWidth:"100%",objectFit:"cover",objectPosition:"bottom right",borderRadius:"inherit"}})})},e.id))})})})})}),null!=A&&(0,o.jsxs)(tY.B,{gap:16,children:[(0,o.jsx)(X.D,{variant:"heading-sm/semibold",children:"Results"}),A.map(e=>{let{theme:t,label:a,result:n}=e;return null!=n?(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsx)(g.E,{variant:"text-md/semibold",children:a}),(0,o.jsx)(Q.w,{type:n.passes?"success":"critical",message:`${n.passes?"\u2713 Passes":"\u2717 Fails"} WCAG AA \u{2014} Min contrast: ${n.minContrastRatio} : 1`,role:"status"}),!n.passes&&null!=n.suggestion&&(0,o.jsxs)(tY.B,{gap:4,children:[(0,o.jsx)(g.E,{variant:"text-sm/semibold",children:"Suggestion:"}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",children:[s1[n.suggestion.stopIndex],": ",(0,o.jsx)("strong",{children:n.suggestion.suggestedColor})," \u2192"," ",n.suggestion.resultingMinContrast," : 1"]})]}),!n.passes&&null==n.suggestion&&(0,o.jsx)(g.E,{variant:"text-sm/normal",children:"No single swap from the same color scale would fix the contrast ratio."})]},t):null})]}),(0,o.jsx)(rd,{allResolvedStops:f})]})})}var rv=a(820739),rj=a(230135),rf=a(45780),rb=a(868652),ry=a(859241);let rE=[aw.M.GUILD_POWERUP_PERKS_COACHMARK,aw.M.GUILD_POWERUPS_OVERVIEW_SIDEBAR_COACHMARK,aw.M.GUILD_POWERUP_NOTIFICATION,aw.M.GUILD_POWERUP_NEW_PERK_AVAILABLE_COACHMARK,aw.M.GUILD_POWERUP_NEW_PERK_AVAILABLE_BADGE],rS=[aw.V.GUILD_POWERUP_LEVEL_1_COACHMARK,aw.V.GUILD_POWERUP_LEVEL_2_COACHMARK,aw.V.GUILD_POWERUP_LEVEL_3_COACHMARK,aw.V.GUILD_POWERUP_SINGLE_SKU_PURCHASE_COACHMARK,aw.V.GUILD_POWERUP_CHOICE_SKU_PURCHASE_COACHMARK],rC=[aw.V.ADOPT_CLAN_IDENTITY_NOTICE];function r_(e){switch(e){case aw.V.GUILD_POWERUP_LEVEL_1_COACHMARK:return"GUILD_POWERUP_LEVEL_1_COACHMARK";case aw.V.GUILD_POWERUP_LEVEL_2_COACHMARK:return"GUILD_POWERUP_LEVEL_2_COACHMARK";case aw.V.GUILD_POWERUP_LEVEL_3_COACHMARK:return"GUILD_POWERUP_LEVEL_3_COACHMARK";case aw.V.GUILD_POWERUP_SINGLE_SKU_PURCHASE_COACHMARK:return"GUILD_POWERUP_SINGLE_SKU_PURCHASE_COACHMARK";case aw.V.GUILD_POWERUP_CHOICE_SKU_PURCHASE_COACHMARK:return"GUILD_POWERUP_CHOICE_SKU_PURCHASE_COACHMARK";case aw.V.ADOPT_CLAN_IDENTITY_NOTICE:return"ADOPT_CLAN_IDENTITY_NOTICE";default:return String(e)}}var rA=a(374336);async function rN(e,t,a){await it.Bo.patch({url:em.Rsh.APPLIED_BOOST_MODIFY_END_DATE,body:{applied_boost_ids:t.map(e=>e.id),ends_at:a?null:nB()().add(1,"day")},rejectWithError:!0}),(0,rv.VU)(e),(0,rb.Xd)(e,!0)}async function rk(e){await it.Bo.post({url:em.Rsh.SEND_POWERUPS_SYSTEM_MESSAGE(e),rejectWithError:!0})}function rI(){let e=(0,d.bG)([nS.A],()=>nS.A.getGuildId()),t=(0,d.bG)([nE.A],()=>nE.A.getGuild(e)?.name),a=(0,d.yK)([aM.A],()=>[...rS,...rC].filter(t=>null!=e&&(0,rf.zs)(t,e))),n=(0,d.yK)([ry.A],()=>null!=e?ry.A.getAppliedGuildBoostsForGuild(e)??[]:[]);if(null!=e)return(0,o.jsxs)(v.Ip,{className:rA.kL,children:[(0,o.jsx)("div",{className:rA.uW,children:(0,o.jsx)(X.D,{variant:"heading-md/normal",children:`Current guild: ${t}`})}),(0,o.jsxs)("div",{className:rA.uW,children:[(0,o.jsx)(g.E,{variant:"eyebrow",className:rA.wx,children:"Reset Notification Indicators"}),(0,o.jsx)(p.$,{variant:"primary",text:"Reset",onClick:()=>{(0,rb.qM)()}})]}),(0,o.jsxs)("div",{className:rA.uW,children:[(0,o.jsx)(g.E,{variant:"eyebrow",className:rA.wx,children:"Reset Progress Bar State"}),(0,o.jsx)(p.$,{variant:"primary",text:"Reset",onClick:rj.O})]}),(0,o.jsxs)("div",{className:rA.uW,children:[(0,o.jsx)(g.E,{variant:"eyebrow",children:"Set Warning State"}),(0,o.jsxs)("div",{children:[(0,o.jsx)(p.$,{variant:"primary",text:"Set Half Boosts expiring in 1 day",onClick:()=>{rN(e,n.slice(Math.floor(n.length/2)),!1)}}),(0,o.jsx)(p.$,{variant:"primary",text:"Reset End Date",onClick:()=>{rN(e,n,!0)}})]})]}),(0,o.jsxs)("div",{className:rA.uW,children:[(0,o.jsx)(g.E,{variant:"eyebrow",className:rA.wx,children:"Reset User Level DCs"}),(0,o.jsx)(tY.B,{gap:16,children:rE.map(e=>(0,o.jsx)(lW,{className:rA.z6,content:aw.M[e]},aw.M[e]))})]}),(0,o.jsx)("div",{className:rA.uW,children:(0,o.jsx)(m.n,{label:"Reset Guild Level DCs",children:rS.map(t=>(0,o.jsx)(h.d,{label:r_(t),checked:a.includes(t),onChange:a=>{a?(0,rf._$)(t,e,!1):((0,aO._N)(aw.M.GUILD_POWERUP_NOTIFICATION),(0,rf.hk)(t,e))}},t))})}),(0,o.jsx)("div",{className:rA.uW,children:(0,o.jsx)(m.n,{label:"Reset Server Tag Guild Level DCs",children:rC.map(t=>(0,o.jsx)(h.d,{label:r_(t),checked:a.includes(t),onChange:a=>{a?(0,rf._$)(t,e,!1):((0,aO._N)(aw.M.GUILD_POWERUP_NOTIFICATION),(0,rf.hk)(t,e))}},t))})}),(0,o.jsxs)("div",{className:rA.uW,children:[(0,o.jsx)(g.E,{variant:"eyebrow",className:rA.wx,children:"Send Powerups System Message"}),(0,o.jsx)(p.$,{variant:"primary",text:"Send System Message",onClick:()=>{rk(e)}})]}),(0,o.jsx)(p.$,{variant:"primary",text:"Reset GameServer ToS",onClick:()=>{(0,i0.Wp)(!1)}})]})}var rD=a(450510),rT=a(648048);function rR(e){let{hotspotLocation:t}=e,[a,n]=(0,d.yK)([rD.HP],()=>[rD.HP.hasHotspot(t,!0),rD.HP.getHotspotOverride(t)]);return(0,o.jsx)(f.l,{label:t,errorMessage:a?"Inactive":void 0,successMessage:a?"Active":void 0,value:n,options:[{id:"none",value:void 0,label:"No Override"},{id:"active",value:!0,label:"Force Active"},{id:"inactive",value:!1,label:"Force Inactive"}],onSelectionChange:e=>null!=e?(0,rD.Kl)(t,e):(0,rD.LF)(t),selectionMode:"single",fullWidth:!0})}function rw(){return(0,o.jsx)(v.Ip,{className:tX.nd,children:(0,o.jsx)(m.n,{label:"Hotspots",description:"All the 'hotspots' in app, and their current status. Use the select menu to override them on or off.",className:rT.IN,children:(0,o.jsx)(tY.B,{gap:20,children:Object.keys(rD._2).sort((e,t)=>e.localeCompare(t)).map(e=>(0,o.jsx)(rR,{hotspotLocation:e},e))})})})}var rO=a(632296),rM=a(855522),rP=a(37646),rL=a(773669);function rU(){let e=(0,d.bG)([rL.default],()=>rL.default.locale),[t,a]=c.useState(),n=(0,rO.runtimeHashMessageKey)(t??""),l=c.useMemo(()=>n_.t[n],[n]);return(0,o.jsxs)("div",{children:[(0,o.jsxs)(ns.Ay,{children:[(0,o.jsx)(ns.Ay.Icon,{icon:rP.U,tooltip:"Locale"}),(0,o.jsx)(ns.Ay.Title,{children:"Locale"})]}),(0,o.jsxs)(n9,{children:[(0,o.jsx)(le,{name:"Active System",children:"@discord/intl"}),(0,o.jsx)(le,{name:"App",children:e}),(0,o.jsx)(le,{name:"System",children:n_.systemLocale}),(0,o.jsx)(le,{name:"@discord/intl",children:n_.intl.currentLocale}),(0,o.jsx)(le,{name:"common i18n",children:rM.A.getLocale()}),(0,o.jsx)(le,{name:"Moment",children:nB().locale()})]}),(0,o.jsxs)(ns.Ay,{children:[(0,o.jsx)(ns.Ay.Icon,{icon:rP.U,tooltip:"Messages"}),(0,o.jsx)(ns.Ay.Title,{children:"New System Messages"})]}),(0,o.jsx)(n9,{children:(0,o.jsx)(le,{name:"Unique Rendered Main Messages",children:Object.keys(n_.t).length})}),(0,o.jsx)("div",{style:{margin:16},children:(0,o.jsx)(b.k,{onChange:function(e){a(e)},name:"Message name",placeholder:"Find a message"})}),(0,o.jsxs)(n9,{children:[(0,o.jsx)(le,{name:"Hashed key",children:n}),(0,o.jsx)(le,{name:"Exists?",children:null!=l?"yes":"no"})]}),(0,o.jsx)(nr.A,{data:l?.(e)})]})}var rG=a(434404);function rF(){let{node:e}=(0,es.Ay)(rG.F,"");return(0,o.jsx)(v.Ip,{className:tX.nd,children:(0,o.jsx)("div",{style:{padding:"var(--space-8)"},children:(0,o.jsx)(ei.A,{node:e},e.key)})})}var rB=a(361158),r$=a(80556),rV=a(219503),rW=a(665095),rH=a(87404);function rz(){return(0,o.jsx)(v.Ip,{className:tX.nd,children:(0,o.jsxs)("div",{className:iV.l$,children:[(0,o.jsxs)("section",{className:iV.uW,children:[(0,o.jsx)(X.D,{variant:"heading-md/semibold",children:"Verification Layer"}),(0,o.jsx)("div",{className:iV.bd,children:(0,o.jsx)(p.$,{variant:"primary",text:"Open Verification Layer",onClick:function(){(0,rB.B8)(()=>(0,o.jsx)(rW.A,{}),{layerKey:rH._s,Layer:r$.Ay})}})})]}),(0,o.jsxs)("section",{className:iV.uW,children:[(0,o.jsx)(X.D,{variant:"heading-md/semibold",children:"Safety Flow"}),(0,o.jsx)("div",{className:iV.bd,children:(0,o.jsx)(p.$,{variant:"primary",text:"Open Safety Flow",onClick:function(){(0,rB.B8)(e=>{let{closeLayer:t}=e;return(0,o.jsx)(rV.A,{onClose:t})},{layerKey:rH._s,Layer:r$.Ay})}})})]}),(0,o.jsxs)("section",{className:iV.uW,children:[(0,o.jsx)(X.D,{variant:"heading-md/semibold",children:"Layer Controls"}),(0,o.jsx)("div",{className:iV.bd,children:(0,o.jsx)(p.$,{variant:"primary",text:"Close All Layers",onClick:function(){rB.xr.setState({fullScreenLayers:[]})}})})]})]})})}a(393431),a(532706),a(42231),a(232424),a(949626),a(767709),a(65162);var rK=a(687813),rY=a(604121);let rq={"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/Lottie_Navigation_Messages_Opt.lottie":()=>a.e("136508").then(a.t.bind(a,655671,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/Lottie_Navigation_Notifications_Opt.lottie":()=>a.e("405252").then(a.t.bind(a,323823,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/Lottie_Navigation_Servers_CombinedEE.lottie":()=>a.e("565154").then(a.t.bind(a,670649,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/Lottie_Navigation_Servers_Opt.lottie":()=>a.e("277248").then(a.t.bind(a,342787,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/Lottie_Navigation_You_Opt.lottie":()=>a.e("393401").then(a.t.bind(a,959328,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/Lottie_Requests_Messages.lottie":()=>a.e("748614").then(a.t.bind(a,713893,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/Activities.lottie":()=>a.e("32431").then(a.t.bind(a,857778,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/AppsIcon.lottie":()=>a.e("337415").then(a.t.bind(a,996858,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/Camera.lottie":()=>a.e("475913").then(a.t.bind(a,999344,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/Deafen.lottie":()=>a.e("61309").then(a.t.bind(a,433356,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/EndCall.lottie":()=>a.e("727847").then(a.t.bind(a,72922,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/GIF.lottie":()=>a.e("932886").then(a.t.bind(a,456309,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/Gift.lottie":()=>a.e("243734").then(a.t.bind(a,733813,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/Microphone.lottie":()=>a.e("926620").then(a.t.bind(a,890007,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/OrbsEarnSpend.lottie":()=>a.e("492568").then(a.t.bind(a,149707,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/OrbsEarnSpendLightTheme.lottie":()=>a.e("282715").then(a.t.bind(a,147734,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/Screenshare.lottie":()=>a.e("829721").then(a.t.bind(a,218048,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/Settings.lottie":()=>a.e("494483").then(a.t.bind(a,155806,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/Soundboard.lottie":()=>a.e("350115").then(a.t.bind(a,313281,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/Sticker.lottie":()=>a.e("897473").then(a.t.bind(a,956248,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/web/Waveform.lottie":()=>a.e("665373").then(a.t.bind(a,914028,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/gems/Lottie_NitroGems_Badge01.lottie":()=>a.e("875199").then(a.t.bind(a,904066,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/gems/Lottie_NitroGems_Badge02.lottie":()=>a.e("633900").then(a.t.bind(a,185319,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/gems/Lottie_NitroGems_Badge03.lottie":()=>a.e("665405").then(a.t.bind(a,743372,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/gems/Lottie_NitroGems_Badge06.lottie":()=>a.e("227648").then(a.t.bind(a,195011,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/gems/Lottie_NitroGems_Badge09.lottie":()=>a.e("729095").then(a.t.bind(a,619578,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/gems/Lottie_NitroGems_Badge12.lottie":()=>a.e("994131").then(a.t.bind(a,676574,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/gems/Lottie_NitroGems_Badge15.lottie":()=>a.e("765404").then(a.t.bind(a,384407,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/gems/Lottie_NitroGems_Badge18.lottie":()=>a.e("911817").then(a.t.bind(a,110320,17)),"discord_common/js/packages/tokens/tools/platforms/lottie/originals/native/gems/Lottie_NitroGems_Badge24.lottie":()=>a.e("284996").then(a.t.bind(a,248476,17)),"discord_common/js/shared/animations/app/gifts/seasonal/box/box-action.lottiejson":()=>a.e("719534").then(a.t.bind(a,87037,19)),"discord_common/js/shared/animations/app/gifts/seasonal/box/box-idle.lottiejson":()=>a.e("812250").then(a.t.bind(a,553998,19)),"discord_common/js/shared/animations/app/gifts/seasonal/box/box-loop.lottiejson":()=>a.e("58526").then(a.t.bind(a,138157,19)),"discord_common/js/shared/animations/app/gifts/seasonal/cake/cake-action.lottiejson":()=>a.e("964376").then(a.t.bind(a,37259,19)),"discord_common/js/shared/animations/app/gifts/seasonal/cake/cake-idle.lottiejson":()=>a.e("730800").then(a.t.bind(a,683891,19)),"discord_common/js/shared/animations/app/gifts/seasonal/cake/cake-loop.lottiejson":()=>a.e("852436").then(a.t.bind(a,45887,19)),"discord_common/js/shared/animations/app/gifts/seasonal/chest/chest-action.lottiejson":()=>a.e("403086").then(a.t.bind(a,118301,19)),"discord_common/js/shared/animations/app/gifts/seasonal/chest/chest-idle.lottiejson":()=>a.e("437690").then(a.t.bind(a,733057,19)),"discord_common/js/shared/animations/app/gifts/seasonal/chest/chest-loop.lottiejson":()=>a.e("582078").then(a.t.bind(a,553101,19)),"discord_common/js/shared/animations/app/gifts/seasonal/coffee/coffee-action.lottiejson":()=>a.e("751992").then(a.t.bind(a,558251,19)),"discord_common/js/shared/animations/app/gifts/seasonal/coffee/coffee-idle.lottiejson":()=>a.e("264400").then(a.t.bind(a,94995,19)),"discord_common/js/shared/animations/app/gifts/seasonal/coffee/coffee-loop.lottiejson":()=>a.e("239476").then(a.t.bind(a,367327,19)),"discord_common/js/shared/animations/app/gifts/seasonal/marketing/gift_icon/seasonal-gifting-wumpus-action.lottiejson":()=>a.e("827568").then(a.t.bind(a,579571,19)),"discord_common/js/shared/animations/app/gifts/seasonal/marketing/gift_icon/seasonal-gifting-wumpus-loop.lottiejson":()=>a.e("525676").then(a.t.bind(a,322151,19)),"discord_common/js/shared/animations/app/gifts/seasonal/marketing/seasonal_wumpus/seasonal-wumpus-action.lottiejson":()=>a.e("710803").then(a.t.bind(a,27870,19)),"discord_common/js/shared/animations/app/gifts/seasonal/marketing/seasonal_wumpus/seasonal-wumpus-idle.lottiejson":()=>a.e("410191").then(a.t.bind(a,837074,19)),"discord_common/js/shared/animations/app/gifts/seasonal/marketing/seasonal_wumpus/seasonal-wumpus-loop.lottiejson":()=>a.e("761223").then(a.t.bind(a,547450,19)),"discord_common/js/shared/animations/app/gifts/seasonal/nitroween/halloween-action.lottiejson":()=>a.e("969842").then(a.t.bind(a,809865,19)),"discord_common/js/shared/animations/app/gifts/seasonal/nitroween/halloween-idle.lottiejson":()=>a.e("699166").then(a.t.bind(a,334829,19)),"discord_common/js/shared/animations/app/gifts/standard/box/box-action.lottiejson":()=>a.e("698287").then(a.t.bind(a,380082,19)),"discord_common/js/shared/animations/app/gifts/standard/box/box-idle.lottiejson":()=>a.e("212427").then(a.t.bind(a,676614,19)),"discord_common/js/shared/animations/app/gifts/standard/box/box-loop.lottiejson":()=>a.e("831939").then(a.t.bind(a,900110,19)),"discord_common/js/shared/animations/app/gifts/standard/cake/cake-action.lottiejson":()=>a.e("371305").then(a.t.bind(a,629456,19)),"discord_common/js/shared/animations/app/gifts/standard/cake/cake-idle.lottiejson":()=>a.e("170625").then(a.t.bind(a,254424,19)),"discord_common/js/shared/animations/app/gifts/standard/cake/cake-loop.lottiejson":()=>a.e("233449").then(a.t.bind(a,690576,19)),"discord_common/js/shared/animations/app/gifts/standard/chest/chest-action.lottiejson":()=>a.e("346791").then(a.t.bind(a,690842,19)),"discord_common/js/shared/animations/app/gifts/standard/chest/chest-idle.lottiejson":()=>a.e("828115").then(a.t.bind(a,755678,19)),"discord_common/js/shared/animations/app/gifts/standard/chest/chest-loop.lottiejson":()=>a.e("408891").then(a.t.bind(a,778422,19)),"discord_common/js/shared/animations/app/gifts/standard/coffee/coffee-action.lottiejson":()=>a.e("958009").then(a.t.bind(a,433504,19)),"discord_common/js/shared/animations/app/gifts/standard/coffee/coffee-idle.lottiejson":()=>a.e("702897").then(a.t.bind(a,976584,19)),"discord_common/js/shared/animations/app/gifts/standard/coffee/coffee-loop.lottiejson":()=>a.e("252793").then(a.t.bind(a,858464,19)),"discord_app/images/burst_reactions/BurstReaction_Anime_v01_Lottie.lottiejson":()=>a.e("674149").then(a.t.bind(a,965892,19)),"discord_app/images/burst_reactions/BurstReaction_Arcade_v01.lottiejson":()=>a.e("517087").then(a.t.bind(a,44194,19)),"discord_app/images/burst_reactions/BurstReaction_BlackHoles_v01.lottiejson":()=>a.e("4289").then(a.t.bind(a,141208,19)),"discord_app/images/burst_reactions/BurstReaction_BlastOff_v04.lottiejson":()=>a.e("277339").then(a.t.bind(a,420054,19)),"discord_app/images/burst_reactions/BurstReaction_Crystal_v04.lottiejson":()=>a.e("366414").then(a.t.bind(a,33565,19)),"discord_app/images/burst_reactions/BurstReaction_Fireworks_v03.lottiejson":()=>a.e("331165").then(a.t.bind(a,414956,19)),"discord_app/images/burst_reactions/BurstReaction_Fusion_v03.lottiejson":()=>a.e("158541").then(a.t.bind(a,221340,19)),"discord_app/images/burst_reactions/BurstReaction_Pop_v04.lottiejson":()=>a.e("910169").then(a.t.bind(a,710208,19)),"discord_app/images/burst_reactions/BurstReaction_PowerUp_v05.lottiejson":()=>a.e("276601").then(a.t.bind(a,333984,19)),"discord_app/images/burst_reactions/BurstReaction_Puzzle_v01_Lottie.lottiejson":()=>a.e("484163").then(a.t.bind(a,211342,19)),"discord_app/images/burst_reactions/BurstReaction_Spotlight_v01_Lottie.lottiejson":()=>a.e("252029").then(a.t.bind(a,714316,19)),"discord_app/images/burst_reactions/BurstReaction_StarBlast_v03.lottiejson":()=>a.e("623997").then(a.t.bind(a,851404,19)),"discord_app/images/burst_reactions/BurstReaction_Tube_v01_Lottie.lottiejson":()=>a.e("667133").then(a.t.bind(a,821644,19)),"discord_app/images/burst_reactions/BurstReaction_UFO_v01_Lottie.lottiejson":()=>a.e("684765").then(a.t.bind(a,51244,19)),"discord_app/images/burst_reactions/BurstReaction_Whirlwind_v01_Lottie.lottiejson":()=>a.e("235583").then(a.t.bind(a,668994,19)),"discord_app/images/burst_reactions/mobile/fullscreen/SuperReactions_Mobile_Send_Spotlight_v1.lottiejson":()=>a.e("47862").then(a.t.bind(a,911573,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Anime_v1.lottiejson":()=>a.e("946711").then(a.t.bind(a,23434,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Arcade_v1.lottiejson":()=>a.e("751153").then(a.t.bind(a,743496,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_BlackHoles_v1.lottiejson":()=>a.e("32803").then(a.t.bind(a,252462,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_BlastOff_v1.lottiejson":()=>a.e("819842").then(a.t.bind(a,341529,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Crystal_v1.lottiejson":()=>a.e("585529").then(a.t.bind(a,762464,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Fireworks_v1.lottiejson":()=>a.e("697197").then(a.t.bind(a,47036,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Fusion_v1.lottiejson":()=>a.e("192933").then(a.t.bind(a,279172,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Pop_v1.lottiejson":()=>a.e("905560").then(a.t.bind(a,824888,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_PowerUp_v1.lottiejson":()=>a.e("863011").then(a.t.bind(a,432302,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Puzzle_v1.lottiejson":()=>a.e("369845").then(a.t.bind(a,854420,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Spotlight_v1.lottiejson":()=>a.e("888607").then(a.t.bind(a,997730,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_StarBlast_v2.lottiejson":()=>a.e("696874").then(a.t.bind(a,281073,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Tube_v1.lottiejson":()=>a.e("894147").then(a.t.bind(a,192718,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_UFO_v2.lottiejson":()=>a.e("84992").then(a.t.bind(a,513667,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Whirlwind_v1.lottiejson":()=>a.e("349693").then(a.t.bind(a,754124,19)),"discord_app/modules/guild_member_verification/images/islandMiddleAnimation.lottiejson":()=>a.e("244678").then(a.t.bind(a,144759,19)),"discord_app/modules/premium/web/animations/guild_sidebar_premium_entrypoint_dt.json":()=>a.e("515048").then(a.t.bind(a,366043,19)),"discord_app/modules/premium/web/animations/guild_sidebar_premium_entrypoint_lt.json":()=>a.e("612512").then(a.t.bind(a,789091,19)),"discord_common/js/shared/animations/app/activities/AppsIconWordlePromo.lottiejson":()=>a.e("173550").then(a.t.bind(a,527613,19)),"discord_common/js/shared/animations/app/nearby/nearby.lottiejson":()=>a.e("293780").then(a.t.bind(a,957439,19)),"discord_common/js/shared/animations/app/premium_guild_subscribe/dark.lottiejson":()=>a.e("245470").then(a.t.bind(a,622637,19)),"discord_common/js/shared/animations/app/premium_guild_subscribe/light.lottiejson":()=>a.e("23478").then(a.t.bind(a,262037,19)),"discord_common/js/shared/animations/app/premium_guild_subscription_system_message_easter_egg/index.lottiejson":()=>a.e("698150").then(a.t.bind(a,633343,19)),"discord_common/js/shared/animations/app/premium_marketing_surface/hd_streaming.lottiejson":()=>a.e("520795").then(a.t.bind(a,551574,19)),"discord_common/js/shared/animations/app/premium-payment-tier-2/index.lottiejson":()=>a.e("869421").then(a.t.bind(a,548375,19)),"discord_app/images/burst_reactions/BurstReaction_Bubbles_v03.lottiejson":()=>a.e("91770").then(a.t.bind(a,95553,19)),"discord_app/images/burst_reactions/BurstReaction_Portal_v03.lottiejson":()=>a.e("196515").then(a.t.bind(a,178862,19)),"discord_app/images/burst_reactions/BurstReaction_Slime_v02.lottiejson":()=>a.e("109302").then(a.t.bind(a,16341,19)),"discord_app/images/burst_reactions/mobile/fullscreen/SuperReactions_Mobile_Send_Slime_v1.lottiejson":()=>a.e("247554").then(a.t.bind(a,748761,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Bubbles_v2.lottiejson":()=>a.e("807739").then(a.t.bind(a,106870,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Portal_v1.lottiejson":()=>a.e("979067").then(a.t.bind(a,458486,19)),"discord_app/images/burst_reactions/mobile/SuperReactions_Mobile_Slime_v2.lottiejson":()=>a.e("924584").then(a.t.bind(a,388059,19)),"discord_app/modules/app_launcher/native/images/onboarding_glow.lottiejson":()=>a.e("507985").then(a.t.bind(a,9640,19)),"discord_app/modules/global_discovery_apps/discovering-dabatouille-animation.lottiejson":()=>a.e("995947").then(a.t.bind(a,604902,19)),"discord_app/modules/guild_boosting/animations/animated_guild_icon.lottiejson":()=>a.e("24645").then(a.t.bind(a,624420,19)),"discord_app/modules/guild_member_verification/images/wavingHandLottieAnimation.lottiejson":()=>a.e("515423").then(a.t.bind(a,155147,19)),"discord_app/modules/guild_onboarding/native/animations/landing.lottiejson":()=>a.e("124093").then(a.t.bind(a,280780,19)),"discord_app/modules/guild_onboarding/web/animations/balloon-dog.lottiejson":()=>a.e("225961").then(a.t.bind(a,739408,19)),"discord_app/modules/guild_onboarding/web/animations/bubble-island-02.lottiejson":()=>a.e("187356").then(a.t.bind(a,194199,19)),"discord_app/modules/guild_onboarding/web/animations/grilling-island-02.lottiejson":()=>a.e("556026").then(a.t.bind(a,113473,19)),"discord_app/modules/guild_onboarding/web/animations/main-island-02.lottiejson":()=>a.e("416301").then(a.t.bind(a,694268,19)),"discord_app/modules/guild_onboarding/web/animations/waffle-island-02.lottiejson":()=>a.e("722191").then(a.t.bind(a,896018,19)),"discord_app/modules/poggermode/images/enable_animation.lottiejson":()=>a.e("504660").then(a.t.bind(a,662336,19)),"discord_app/modules/premium/powerups/web/images/server_boost_highlight.json":()=>a.e("867807").then(a.t.bind(a,217762,19)),"discord_app/modules/quests/images/confetti.lottiejson":()=>a.e("40119").then(a.t.bind(a,718698,19)),"discord_app/modules/quests/web/images/quest_bar_background.json":()=>a.e("837316").then(a.t.bind(a,599279,19)),"discord_app/modules/quests/web/images/quest_bar_sparkle.json":()=>a.e("897536").then(a.t.bind(a,478979,19)),"discord_app/modules/self_mod/inappropriate_conversation/images/vibing_wumpus.lottiejson":()=>a.e("114823").then(a.t.bind(a,718074,19)),"discord_common/js/shared/animations/app/everyone_popout/dark.lottiejson":()=>a.e("480467").then(a.t.bind(a,661022,19)),"discord_common/js/shared/animations/app/everyone_popout/light.lottiejson":()=>a.e("892705").then(a.t.bind(a,111992,19)),"discord_common/js/shared/animations/app/gifts/seasonal/marketing/coachmark/seasonal-gifting-coachmark.lottiejson":()=>a.e("561250").then(a.t.bind(a,762361,19)),"discord_common/js/shared/animations/app/playstation/playstation_connecting.lottiejson":()=>a.e("435066").then(a.t.bind(a,844512,19)),"discord_common/js/shared/animations/app/premium_marketing_surface/emoji.lottiejson":()=>a.e("717124").then(a.t.bind(a,616175,19)),"discord_common/js/shared/animations/app/premium_marketing_surface/interstitial_wheel_dark.lottiejson":()=>a.e("394675").then(a.t.bind(a,735678,19)),"discord_common/js/shared/animations/app/premium_marketing_surface/interstitial_wheel_light.lottiejson":()=>a.e("278465").then(a.t.bind(a,247704,19)),"discord_common/js/shared/animations/app/premium_marketing_surface/profile_customization.lottiejson":()=>a.e("762807").then(a.t.bind(a,202282,19)),"discord_common/js/shared/animations/app/premium_marketing_surface/unlock.lottiejson":()=>a.e("131838").then(a.t.bind(a,650125,19)),"discord_common/js/shared/animations/app/premium_marketing/index.lottiejson":()=>a.e("406954").then(a.t.bind(a,964529,19)),"discord_common/js/shared/animations/app/premium_payment_guild/index.lottiejson":()=>a.e("945870").then(a.t.bind(a,738503,19)),"discord_common/js/shared/animations/app/premium-activated-tier-1/premium-activated-tier-1.lottiejson":()=>a.e("505642").then(a.t.bind(a,242993,19)),"discord_common/js/shared/animations/app/premium-payment-tier-0/index.lottiejson":()=>a.e("678503").then(a.t.bind(a,635489,19)),"discord_common/js/shared/animations/app/premium-payment-tier-1/index.lottiejson":()=>a.e("119898").then(a.t.bind(a,262546,19)),"discord_common/js/shared/animations/app/xbox/voice_connect.lottiejson":()=>a.e("40348").then(a.t.bind(a,971799,19)),"discord_common/js/shared/animations/app/xbox/xbox_connecting.lottiejson":()=>a.e("876121").then(a.t.bind(a,709376,19))};function rJ(e){let{default:t}=e;return fetch(t).then(e=>e.arrayBuffer()).then(e=>new Promise((t,a)=>{let n=new Uint8Array(e);rK.$1(n,(e,n)=>{null!=e&&a(e);let l=Object.keys(n).reduce((e,t)=>({...e,[t]:JSON.parse(rK.he(n[t]))}),{}),i=l["manifest.json"];t(l[`animations/${i.animations[0].id}.json`])})}))}function rQ(){let[e,t]=c.useState(void 0),[a,n]=c.useState(400),[l,i]=c.useState(400);return(0,o.jsx)("div",{style:{margin:24},children:(0,o.jsxs)(tY.B,{gap:24,children:[(0,o.jsx)(aE.Z,{options:Object.keys(rq).map(e=>({id:e,label:e,value:e})),value:e,onSelectionChange:t,selectionMode:"single"}),(0,o.jsxs)(tY.B,{gap:8,direction:"horizontal",children:[(0,o.jsx)(b.k,{value:a.toString(),onChange:e=>n(Number(e)),label:"Width"}),(0,o.jsx)(b.k,{value:l.toString(),onChange:e=>i(Number(e)),label:"Height"})]}),(0,o.jsx)(p.$,{size:"sm",disabled:null==e,onClick:async()=>{if(null==e)return;let t=rq[e],a=new Blob([JSON.stringify(e.endsWith(".lottie")?await t().then(rJ).then(e1().cloneDeep):await t().then(e=>e1().cloneDeep(e.default)))],{type:"application/json"}),n=URL.createObjectURL(a),l=document.createElement("a");l.href=n,l.download=`${e.split("/").pop()}.json`,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(n)},text:"Download"}),null!=e&&(0,o.jsx)("div",{style:{width:a,height:l},children:(0,o.jsx)(rY.a,{importData:()=>{let t=rq[e];return e.endsWith(".lottie")?t().then(rJ).then(e1().cloneDeep):t().then(e=>e1().cloneDeep(e.default))}},e)})]})})}var rX=a(442433),rZ=a(395671);let r0={ClipsContextMenu:async()=>{let{default:e}=await a.e("344751").then(a.bind(a,575538));return t=>(0,o.jsx)(e,{...t})},ActivityPopoutHeaderOverflowMenu:async()=>{let{default:e}=await a.e("832986").then(a.bind(a,728033)),t=new rZ.kJ({id:"123456789",name:"Test Activity",icon:null,description:"A test activity for devtools",type:1,coverImage:void 0,primarySkuId:void 0,bot:void 0,splash:void 0,thirdPartySkus:[],isMonetized:!1,isVerified:!1,roleConnectionsVerificationUrl:void 0,parentId:void 0,connectionEntrypointUrl:void 0});return()=>(0,o.jsx)(e,{application:t,channelId:"987654321",onClose:rX.Z_})},GuildChannelListContextMenu:async()=>{let{default:e}=await Promise.all([a.e("309004"),a.e("419690"),a.e("845322"),a.e("110758")]).then(a.bind(a,455557)),t=Object.values(nE.A.getGuilds())[0];return null==t?()=>null:a=>(0,o.jsx)(e,{...a,guild:t})},GuildContextMenu:async()=>{let{default:e}=await Promise.all([a.e("876364"),a.e("996907"),a.e("8159"),a.e("361922"),a.e("403032"),a.e("684290"),a.e("301850"),a.e("936875"),a.e("862179"),a.e("722784"),a.e("906470"),a.e("774550"),a.e("923981"),a.e("331696"),a.e("806391"),a.e("803511"),a.e("424216"),a.e("840100"),a.e("304350"),a.e("22865"),a.e("173896"),a.e("57358"),a.e("722765"),a.e("33909"),a.e("754596"),a.e("191601"),a.e("401106"),a.e("498589"),a.e("21486"),a.e("304419"),a.e("45268"),a.e("617281"),a.e("733199"),a.e("804510"),a.e("655327"),a.e("335532"),a.e("138545"),a.e("536490"),a.e("771137"),a.e("403655"),a.e("212037"),a.e("577154"),a.e("877730"),a.e("611899"),a.e("527552"),a.e("769266"),a.e("487873"),a.e("765626"),a.e("683302"),a.e("660608"),a.e("744554"),a.e("118203"),a.e("331212"),a.e("638259"),a.e("635958"),a.e("683621"),a.e("711162"),a.e("275179"),a.e("289789"),a.e("116125"),a.e("977412"),a.e("19385"),a.e("692811"),a.e("249681"),a.e("996382"),a.e("771657"),a.e("122218"),a.e("869047"),a.e("449145"),a.e("309004"),a.e("356664"),a.e("430997"),a.e("728136"),a.e("343116"),a.e("216084"),a.e("273669"),a.e("284819"),a.e("466147"),a.e("50342"),a.e("256373"),a.e("387634"),a.e("161058"),a.e("333097"),a.e("409391"),a.e("479971"),a.e("810262"),a.e("346313"),a.e("463726"),a.e("553203"),a.e("115368"),a.e("343233"),a.e("756684"),a.e("419690"),a.e("583827"),a.e("806354"),a.e("556026"),a.e("416301"),a.e("722191"),a.e("225961"),a.e("359702"),a.e("708364"),a.e("452823"),a.e("8422"),a.e("556967"),a.e("647011"),a.e("269178"),a.e("553584"),a.e("466913"),a.e("583518"),a.e("736621"),a.e("752695"),a.e("71719"),a.e("893767"),a.e("213848"),a.e("588307"),a.e("514878"),a.e("676376"),a.e("426508"),a.e("361347"),a.e("842935"),a.e("73091"),a.e("37786"),a.e("886692"),a.e("916373"),a.e("528038"),a.e("623522"),a.e("925172"),a.e("232347"),a.e("8458"),a.e("11810"),a.e("591977"),a.e("890152"),a.e("174337"),a.e("646570"),a.e("287973"),a.e("357197"),a.e("314863"),a.e("623386"),a.e("384951"),a.e("560165"),a.e("712390"),a.e("71167"),a.e("113446"),a.e("637038"),a.e("161309"),a.e("694529"),a.e("303807"),a.e("995210"),a.e("497743"),a.e("784853"),a.e("966016"),a.e("218489"),a.e("838336"),a.e("317699"),a.e("257032"),a.e("772238"),a.e("845322"),a.e("945651"),a.e("114748"),a.e("426386"),a.e("204665"),a.e("652191"),a.e("639855"),a.e("214530"),a.e("269786"),a.e("149409"),a.e("928246"),a.e("632607"),a.e("935277")]).then(a.bind(a,237600)),t=Object.values(nE.A.getGuilds())[0];return null==t?()=>null:a=>(0,o.jsx)(e,{...a,guild:t})},GuildFolderContextMenu:async()=>{let{default:e}=await Promise.all([a.e("114748"),a.e("906240")]).then(a.bind(a,595139));return t=>(0,o.jsx)(e,{...t,folderId:1,folderColor:void 0,folderName:void 0,unread:!1})},DeveloperContextMenu:async()=>{let{default:e}=await a.e("715687").then(a.bind(a,646938));return t=>(0,o.jsx)(e,{...t,id:"123456789",label:"Copy Test ID"})},UserSettingsMenu:async()=>{let{default:e}=await Promise.all([a.e("594045"),a.e("926132"),a.e("44491")]).then(a.bind(a,907206));return t=>(0,o.jsx)(e,{...t,onClose:rX.Z_})},ExpressionPickerContextMenu:async()=>{let{default:e}=await a.e("446132").then(a.bind(a,233503));return t=>(0,o.jsx)(e,{...t})},ForumTagContextMenu:async()=>{let{default:e}=await a.e("432612").then(a.bind(a,960015)),t={id:"123456789",name:"Test Forum Tag"};return()=>(0,o.jsx)(e,{tag:t})},GuildRoleConnectionsModalContextMenu:async()=>{let{default:e}=await a.e("868001").then(a.bind(a,699896));return t=>(0,o.jsx)(e,{...t,roleId:"123456789",onLeaveRole:()=>{console.log("Leave role clicked"),(0,rX.Z_)()}})},StaffOnlyEntryDebugMenu:async()=>{let{default:e}=await Promise.all([a.e("886456"),a.e("789346")]).then(a.bind(a,949881)),{ContentInventoryEntryType:t}=await Promise.resolve().then(a.bind(a,681154)),{ContentInventoryAuthorType:n}=await Promise.resolve().then(a.bind(a,6161)),l=eo.default.getCurrentUser(),i={id:"mock-entry-123",author_id:l?.id??"123456789",author_type:n.USER,content_type:t.PLAYED_GAME,participants:[],traits:[],extra:{type:"played_game_extra",game_name:"Test Game",application_id:"123456789"}};return()=>(0,o.jsx)(e,{entry:i,requestId:"mock-request-123"})},AddQuestionsContextMenu:async()=>{let{AddQuestionsContextMenu:e}=await Promise.all([a.e("289789"),a.e("722765"),a.e("11810"),a.e("838336"),a.e("269786")]).then(a.bind(a,892921)),t=Object.values(nE.A.getGuilds())[0];return null==t?()=>null:a=>(0,o.jsx)(e,{...a,addFormField:e=>{console.log("Add form field:",e),(0,rX.Z_)()},guild:t,allowTerms:!0})},ChannelListThreadContextMenu:async()=>{let{default:e}=await Promise.all([a.e("926132"),a.e("955557"),a.e("947502"),a.e("343266"),a.e("965789"),a.e("412255"),a.e("63340"),a.e("285802"),a.e("65200"),a.e("703869"),a.e("51212"),a.e("584615")]).then(a.bind(a,612826)),t=nE.A.getGuilds(),n=null;for(let e of Object.values(t)){for(let t of Object.values(aH.A.getMutableGuildChannelsForGuild(e.id))){let e=aH.A.getAllThreadsForParent(t.id);if(e.length>0){n=e[0];break}}if(null!=n)break}return null==n?(console.log("No thread channel found for ChannelListThreadContextMenu"),()=>null):t=>(0,o.jsx)(e,{...t,channel:n})},MembersTableSortContextMenu:async()=>{let{default:e}=await Promise.all([a.e("73091"),a.e("945651")]).then(a.bind(a,779662)),t=Object.values(nE.A.getGuilds())[0];return null==t?()=>null:()=>(0,o.jsx)(e,{guildId:t.id,onClose:rX.Z_})},MembersTableJoinTypeContextMenu:async()=>{let{default:e}=await Promise.all([a.e("118203"),a.e("71719"),a.e("514878"),a.e("966016"),a.e("945651")]).then(a.bind(a,316173)),t=Object.values(nE.A.getGuilds())[0];return null==t?()=>null:()=>(0,o.jsx)(e,{guildId:t.id,onClose:rX.Z_})}},r1={GuildShopSortOptions:c.lazy(async()=>{let{default:e}=await Promise.all([a.e("583518"),a.e("255197"),a.e("250974")]).then(a.bind(a,324269)),{default:t}=await a.e("255197").then(a.bind(a,558060));return{default:()=>(0,o.jsx)(t,{defaultSortOption:void 0,children:(0,o.jsx)(e,{})})}})};function r2(){let e=c.useMemo(()=>Object.keys(r0).map(e=>({label:e,value:e,id:e})).sort((e,t)=>e.label.localeCompare(t.label)),[]),t=c.useMemo(()=>Object.keys(r1).map(e=>({label:e,value:e,id:e})).sort((e,t)=>e.label.localeCompare(t.label)),[]),[a,n]=c.useState(null),[l,i]=c.useState(null),s=c.useCallback(e=>{null!=a&&(0,rX.L3)(e,r0[a])},[a]),r=null!=l?r1[l]:null;return(0,o.jsx)(v.Ip,{className:tX.nd,children:(0,o.jsxs)(tY.B,{className:iV.l$,gap:16,children:[(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsx)(g.E,{variant:"eyebrow",children:"Context Menus"}),(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-muted",children:"Select a menu and click Open to trigger it as a context menu at the button position."})]}),(0,o.jsxs)(tY.B,{direction:"horizontal",gap:8,align:"end",children:[(0,o.jsx)(aE.Z,{label:"Open a Context Menu",placeholder:"Select a menu",options:e,value:a,onSelectionChange:n,selectionMode:"single"}),(0,o.jsx)(p.$,{variant:"primary",text:"Open",disabled:null==a,onClick:s})]}),(0,o.jsxs)(tY.B,{gap:8,children:[(0,o.jsx)(g.E,{variant:"eyebrow",children:"Popout Menus"}),(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-muted",children:"Select a popout menu to render it. Click the rendered button to open the popout."})]}),(0,o.jsx)(tY.B,{direction:"horizontal",gap:8,align:"end",children:(0,o.jsx)(aE.Z,{label:"Render a Popout Menu",placeholder:"Select a popout",options:t,value:l,onSelectionChange:i,selectionMode:"single"})}),null!=r&&(0,o.jsx)(c.Suspense,{fallback:(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-muted",children:"Loading..."}),children:(0,o.jsx)(r,{})})]})})}var r5=a(253506),r3=a(665260),r6=a(97808),r8=a(778712),r4=a(308528),r7=a(148494),r9=a(571694),oe=a(963852),ot=a(704844),oa=a(309010),on=a(645959),ol=a(716371),oi=a(32946);let os=[{id:"USER_JOIN",value:em.lAJ.USER_JOIN,label:"User Join"},{id:"CHANNEL_PINNED_MESSAGE",value:em.lAJ.CHANNEL_PINNED_MESSAGE,label:"Channel Pinned Message"},{id:"GUILD_BOOST",value:em.lAJ.GUILD_BOOST,label:"Guild Boost"},{id:"GUILD_BOOST_TIER_1",value:em.lAJ.GUILD_BOOST_TIER_1,label:"Guild Boost Tier 1"},{id:"GUILD_BOOST_TIER_2",value:em.lAJ.GUILD_BOOST_TIER_2,label:"Guild Boost Tier 2"},{id:"GUILD_BOOST_TIER_3",value:em.lAJ.GUILD_BOOST_TIER_3,label:"Guild Boost Tier 3"},{id:"THREAD_CREATED",value:em.lAJ.THREAD_CREATED,label:"Thread Created"},{id:"CHANNEL_FOLLOW_ADD",value:em.lAJ.CHANNEL_FOLLOW_ADD,label:"Channel Follow Add"},{id:"STAGE_START",value:em.lAJ.STAGE_START,label:"Stage Start"},{id:"STAGE_END",value:em.lAJ.STAGE_END,label:"Stage End"},{id:"STAGE_SPEAKER",value:em.lAJ.STAGE_SPEAKER,label:"Stage Speaker"},{id:"STAGE_RAISE_HAND",value:em.lAJ.STAGE_RAISE_HAND,label:"Stage Raise Hand"},{id:"STAGE_TOPIC",value:em.lAJ.STAGE_TOPIC,label:"Stage Topic"},{id:"VOICE_SESSION",value:em.lAJ.VOICE_SESSION,label:"Voice Session"},{id:"FRIEND_REQUEST_ACCEPTED",value:em.lAJ.FRIEND_REQUEST_ACCEPTED,label:"Friend Request Accepted"},{id:"GUILD_DISCOVERY_DISQUALIFIED",value:em.lAJ.GUILD_DISCOVERY_DISQUALIFIED,label:"Discovery Disqualified"},{id:"GUILD_DISCOVERY_REQUALIFIED",value:em.lAJ.GUILD_DISCOVERY_REQUALIFIED,label:"Discovery Requalified"},{id:"GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING",value:em.lAJ.GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING,label:"Discovery Grace Initial Warning"},{id:"GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING",value:em.lAJ.GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING,label:"Discovery Grace Final Warning"},{id:"RECIPIENT_ADD",value:em.lAJ.RECIPIENT_ADD,label:"Recipient Add"},{id:"RECIPIENT_REMOVE",value:em.lAJ.RECIPIENT_REMOVE,label:"Recipient Remove"},{id:"CALL",value:em.lAJ.CALL,label:"Call"}];function or(){let[e,t]=c.useState(em.lAJ.USER_JOIN),a=(0,d.bG)([oa.Ay],()=>oa.Ay.getChannelId(),[]),n=c.useCallback(()=>{if(null==a||null==e)return;let t=(0,oe.Ay)({channelId:a,content:"",type:e,state:em.cmJ.SENT});r7.A.receiveMessage(a,t,!1)},[a,e]),l=c.useCallback(()=>{if(null!=a)for(let{value:e}of os){let t=(0,oe.Ay)({channelId:a,content:"",type:e,state:em.cmJ.SENT});r7.A.receiveMessage(a,t,!1)}},[a]);return(0,o.jsxs)("div",{className:oi.gs,children:[(0,o.jsx)(aE.Z,{label:"Inject System Message",selectionMode:"single",options:os,placeholder:"Select type",value:e,onSelectionChange:t}),(0,o.jsx)(p.$,{variant:"primary",size:"sm",text:"Inject",onClick:n,disabled:null==a||null==e}),(0,o.jsx)(p.$,{variant:"secondary",size:"sm",text:"Inject All",onClick:l,disabled:null==a})]})}function oo(){let e=(0,d.yK)([on.A],()=>on.A.getSortedChannels()[1]),[t,a]=c.useState(e.length>0?e[0].channelId:void 0),{selectedChannel:n,options:l}=(0,d.cf)([aH.A,eo.default,az.A],()=>({selectedChannel:aH.A.getChannel(t),options:e.map(e=>{let t=aH.A.getChannel(e.channelId);return{id:e.channelId,value:e.channelId,label:null!=t?(0,aW.m1)(t,eo.default,az.A):e.channelId,leading:null!=t?(0,o.jsx)(r6.eu,{src:(0,r9.Y)(t),"aria-hidden":!0,size:r8._3.SIZE_16}):void 0}})})),i=c.useCallback(()=>{if(null==n||!n.isPrivate())return;let e=(0,r3.PQ)(n.recipientFlags??0,r5.o.DISMISSED_IN_GAME_MESSAGE_NUX);ot.A.updatePrivateChannelRecipientFlags(n.id,e)},[n]),s=!!n?.isPrivate()&&(0,r3.Lt)(n.recipientFlags??0,r5.o.DISMISSED_IN_GAME_MESSAGE_NUX);return(0,o.jsxs)("div",{className:oi.gs,children:[(0,o.jsx)(aE.Z,{label:"In-Game NUX Message for DMs",selectionMode:"single",options:l,placeholder:"Select DM",value:t,onSelectionChange:a}),(0,o.jsx)(p.$,{variant:"primary",size:"sm",text:s?"Clear NUX Flag":"Set NUX Flag",onClick:i,disabled:null==t})]})}function oc(){let e=c.useCallback(()=>{r4.A.openPrivateChannel({recipientIds:[ol.K]})},[]);return(0,o.jsx)(p.$,{variant:"primary",size:"sm",text:"Open System DM",onClick:e})}function od(){let e=(0,d.bG)([ni.Ay],()=>ni.Ay.allByCategory(ni.xW.MESSAGING),[],d.My).map(e=>{let[t,a,{label:n}]=e;return(0,o.jsx)(h.d,{label:n,description:t,checked:a,onChange:e=>i3(t,e)},t)});return(0,o.jsxs)("div",{className:q()(tX.nd,oi.nd),children:[e,(0,o.jsx)("div",{className:oi.yF}),(0,o.jsx)(or,{}),(0,o.jsx)("div",{className:oi.yF}),(0,o.jsx)(oo,{}),(0,o.jsx)("div",{className:oi.yF}),(0,o.jsx)(oc,{})]})}var ou=a(205693),om=a(772707),oh=a(150934),ox=a(598653),op=a(166403),og=a(625494),ov=a(204925),oj=a(325278);let of={EmailEnterModal:async()=>{let{default:e}=await a.e("429232").then(a.bind(a,180275));return t=>(0,o.jsx)(e,{...t,headerText:n_.intl.string(n_.t.ZLRYGU),confirmButtonText:n_.intl.string(n_.t.PDTjLN),confirmButtonVariant:"primary"})},EmailPincodeModal:async()=>{let{default:e}=await a.e("919840").then(a.bind(a,79779));return t=>(0,o.jsx)(e,{...t,headerText:n_.intl.string(n_.t.H3Q7U8),onFormSubmit:()=>{},onResend:()=>{},onSuccess:()=>{},confirmButtonText:n_.intl.string(n_.t["13ofGu"]),impression:{impressionName:sj.ImpressionNames.URF_CONFIRM_EMAIL_CODE}})},AgeVerificationRetryModal:async()=>{let{default:e}=await Promise.all([a.e("469663"),a.e("518467")]).then(a.bind(a,297102));return t=>(0,o.jsx)(e,{...t,entryPoint:nL.q1.DEV_TOOLS_AGE_VERIFICATION_RETRY_MODAL})},ExistingUserAgeGatePrompt:async()=>{let{default:e}=await Promise.all([a.e("533651"),a.e("682758"),a.e("280022"),a.e("810136")]).then(a.bind(a,776971));return t=>(0,o.jsx)(e,{...t,source:ov.w_.NSFW_SERVER})},ExistingUserAgeGateUnderage:async()=>{let{default:e}=await a.e("280959").then(a.bind(a,784578));return t=>(0,o.jsx)(e,{...t})},NewUserAgeGate:async()=>{let{default:e}=await Promise.all([a.e("533651"),a.e("682758"),a.e("319623"),a.e("280022"),a.e("401143")]).then(a.bind(a,284778));return t=>(0,o.jsx)(e,{...t})},NUFModal:async()=>{let{default:e}=await Promise.all([a.e("188406"),a.e("538288"),a.e("122326"),a.e("533651"),a.e("944492"),a.e("419580"),a.e("197804"),a.e("756856"),a.e("682758"),a.e("999574"),a.e("280022"),a.e("250475"),a.e("993265"),a.e("258118")]).then(a.bind(a,111185));return t=>(0,o.jsx)(e,{...t,onSlideChange:()=>{}})},ClaimAccountModal:async()=>{let{default:e}=await Promise.all([a.e("213042"),a.e("319623"),a.e("121007")]).then(a.bind(a,110744));return t=>(0,o.jsx)(e,{claimRequired:!0,...t})},AutomatedUnderageAppealModal:async()=>{let{default:e}=await Promise.all([a.e("51194"),a.e("909018")]).then(a.bind(a,466702));return t=>(0,o.jsx)(e,{...t,classificationId:"123"})},AutomodRaidResolveModal:async()=>{let{default:e}=await Promise.all([a.e("513221"),a.e("273669"),a.e("307133")]).then(a.bind(a,580812));return t=>(0,o.jsx)(e,{...t,guildId:"123",messageId:null})},AutomodUserProfileQuarantineAlert:async()=>{let{default:e}=await a.e("452343").then(a.bind(a,725034));return t=>(0,o.jsx)(e,{...t,guildId:"123"})},PhoneVerificationModal:async()=>{let{default:e}=await Promise.all([a.e("590275"),a.e("766806"),a.e("989545"),a.e("311493")]).then(a.bind(a,914724));return t=>(0,o.jsx)(e,{error:null,working:!1,validPhone:!1,...t})},VoiceSettingsModal:async()=>{let{default:e}=await a.e("796531").then(a.bind(a,880510));return t=>(0,o.jsx)(e,{...t,mediaEngineContext:ou.x.DEFAULT,subtitle:"Devtools subtitle"})},DynamicGraphicDemo:async()=>{let{DynamicGraphicComponent:e}=await Promise.resolve().then(a.bind(a,116833));return t=>(0,o.jsx)(om.k,{...t,title:"Dynamic Graphics Demo",subtitle:"This modal demonstrates the dynamic graphics system",graphic:{type:"dynamic",component:e.DEMO,aspectRatio:"6/4",props:{text:"Dynamic Content Loaded!"}},actions:[{variant:"primary",text:"Close",onClick:t.onClose}],children:(0,o.jsx)("div",{children:"This modal showcases the new dynamic graphics system where components can be loaded dynamically based on enum values, providing type safety while maintaining runtime flexibility."})})},OverlayDisabledSurveyModal:async()=>{let{default:e}=await Promise.all([a.e("914052"),a.e("82318")]).then(a.bind(a,387101)),{OverlayToggledClientSettingType:t}=await Promise.resolve().then(a.bind(a,918825));return a=>(0,o.jsx)(e,{...a,clientSettingType:t.LEGACY_GAME,gameId:"123456789"})},PremiumSubscriptionPauseModal:async()=>{let{PremiumSubscriptionPauseModalSelect:e}=await Promise.all([a.e("489361"),a.e("80347")]).then(a.bind(a,318998)),{CancellationContext:t}=await Promise.resolve().then(a.bind(a,916974)),{PremiumTypes:n}=await Promise.resolve().then(a.bind(a,202541)),l={id:"test-subscription-id",userId:"test-user-id",status:1,currency:"usd",currentPeriodStart:new Date,currentPeriodEnd:new Date(Date.now()+2592e6),items:[{id:"test-item-id",planId:"511651880837840896",quantity:1}],paymentSourceId:"test-payment-source",renewalMutations:null,hasActiveTrial:!1};function i(a){let{ref:i,...s}=a,[r,d]=c.useState(null),{onClose:u,transitionState:m}=s,h=c.useMemo(()=>({setStep:()=>{},premiumType:n.TIER_2,onClose:u,transitionState:m,premiumSubscription:l,analyticsLocations:[],analyticsLocation:void 0,confettiCanvas:null,churnUserDiscountOffer:null,isFetchingChurnDiscountOffer:!1,fullPrice:"$9.99",discountedPrice:void 0,planId:"511651880837840896",paymentsBlocked:!1,renewalInvoice:null,renewalInvoiceDetails:null,handleCancellation:async()=>{},applyOffer:async()=>{},pauseDuration:r,setPauseDuration:d}),[u,m,r]);return(0,o.jsx)(t.Provider,{value:h,children:(0,o.jsx)(e,{})})}return i.displayName="PremiumSubscriptionPauseModalWrapper",e=>(0,o.jsx)(i,{...e})},NewMemberActionModal:async()=>{let{default:e}=await Promise.all([a.e("266281"),a.e("287973"),a.e("652191"),a.e("813949"),a.e("354569")]).then(a.bind(a,251632)),{NewMemberActionTypes:t}=await Promise.resolve().then(a.bind(a,374084)),n={channelId:"123456789",title:"Welcome to the server!",description:"Say hello in the welcome channel",actionType:t.CHAT,emoji:null,icon:null};return t=>(0,o.jsx)(e,{...t,guildId:"123456789",action:n,onSave:(e,t,a)=>{console.log("NewMemberActionModal onSave:",{action:e,iconData:t,shouldSaveIcon:a})},onDelete:()=>{console.log("NewMemberActionModal onDelete")}})},PlayStationModal:async()=>{let{default:e}=await Promise.all([a.e("187880"),a.e("465694"),a.e("398816")]).then(a.bind(a,855170)),t=await Promise.resolve().then(a.bind(a,643501)),{createChannelRecord:n}=await Promise.resolve().then(a.bind(a,95701)),l=n({id:"123456789",name:"test-voice-channel",type:2,guild_id:"987654321",position:0,permissionOverwrites:{},parent_id:void 0,nsfw:!1,topic:void 0,lastMessageId:void 0,bitrate:64e3,userLimit:0,rateLimitPerUser:0,icon:null,ownerId:null,application_id:null,lastPinTimestamp:null,rtcRegion:null,videoQualityMode:null,messageCount:0,memberCount:0,threadMetadata:void 0,member:void 0,defaultAutoArchiveDuration:void 0,flags:0,totalMessageSent:0,availableTags:[],appliedTags:[],defaultReactionEmoji:null,defaultThreadRateLimitPerUser:0,defaultSortOrder:null,defaultForumLayout:0}),i={"device-1":{id:"device-1",name:"PS5 - Living Room",platform:"playstation"},"device-2":{id:"device-2",name:"PS5 - Bedroom",platform:"playstation"},"device-3":{id:"device-3",name:"PS4 - Office",platform:"playstation"}},s=a=>{let n=t.default.getDevicesForPlatform,s=t.default.getFetchingDevices,r=t.default.getLastSelectedDeviceByPlatform,c=t.default.getAwaitingRemoteSessionInfo;t.default.getDevicesForPlatform=e=>e===em.fg2.PLAYSTATION?i:n.call(t.default,e),t.default.getFetchingDevices=e=>e!==em.fg2.PLAYSTATION&&s.call(t.default,e),t.default.getLastSelectedDeviceByPlatform=e=>e===em.fg2.PLAYSTATION?"device-1":r.call(t.default,e),t.default.getAwaitingRemoteSessionInfo=()=>null;let d=a.onClose;return a.onClose=async()=>{t.default.getDevicesForPlatform=n,t.default.getFetchingDevices=s,t.default.getLastSelectedDeviceByPlatform=r,t.default.getAwaitingRemoteSessionInfo=c,await d()},(0,o.jsx)(e,{...a,channel:l,platform:em.fg2.PLAYSTATION})};return s.displayName="PlayStationModalWrapper",s},GameDetectionReportModal:async()=>{let{default:e}=await Promise.all([a.e("568035"),a.e("627495")]).then(a.bind(a,651930));return t=>(0,o.jsx)(e,{...t,detected:{applicationId:"123456789",name:"Test Game"}})},AppealIngestionModal:async()=>{let{default:e}=await Promise.all([a.e("726464"),a.e("292030"),a.e("51471")]).then(a.bind(a,550560));return t=>(0,o.jsx)(e,{...t,classificationId:"123456789"})},CreateTagModal:async()=>{let{default:e}=await Promise.all([a.e("143172"),a.e("347326")]).then(a.bind(a,950989));return t=>(0,o.jsx)(e,{...t,channelId:"123456789",guildId:"987654321"})},CreateTagModalEdit:async()=>{let{default:e}=await Promise.all([a.e("143172"),a.e("347326")]).then(a.bind(a,950989)),t={id:"tag-123",name:"Bug Report",emojiId:"123456789",emojiName:"\uD83D\uDC1B",moderated:!0};return a=>(0,o.jsx)(e,{...a,channelId:"123456789",guildId:"987654321",tag:t})},ConfirmModal:async()=>{let{ConfirmModal:e}=await Promise.all([a.e("304823"),a.e("223976"),a.e("977260")]).then(a.bind(a,397927));return t=>(0,o.jsx)(e,{...t,title:"Confirm Action",subtitle:"Are you sure you want to perform this action? This action cannot be undone.",confirmText:"Confirm",onConfirm:()=>console.log("ConfirmModal: Confirmed"),onCancel:()=>console.log("ConfirmModal: Cancelled")})},AlertModal:async()=>{let{Alert:e}=await Promise.all([a.e("844331"),a.e("21553")]).then(a.bind(a,381512));return t=>(0,o.jsx)(e,{...t,title:"Alert",body:"This is an alert message with a single action.",confirmText:"OK",onConfirm:()=>console.log("AlertModal: Confirmed")})},AlertModalWithCancel:async()=>{let{Alert:e}=await Promise.all([a.e("844331"),a.e("21553")]).then(a.bind(a,381512));return t=>(0,o.jsx)(e,{...t,title:"Confirm Action",body:"Are you sure you want to proceed with this action?",confirmText:"Yes",cancelText:"No",onConfirm:()=>console.log("AlertModalWithCancel: Confirmed"),onCancel:()=>console.log("AlertModalWithCancel: Cancelled")})},AlertModalWithSecondary:async()=>{let{Alert:e}=await Promise.all([a.e("844331"),a.e("21553")]).then(a.bind(a,381512));return t=>(0,o.jsx)(e,{...t,title:"Settings Change",body:"This will change your account settings.",confirmText:"Apply",cancelText:"Cancel",secondaryConfirmText:"Don't show this again",onConfirm:()=>console.log("AlertModalWithSecondary: Confirmed"),onCancel:()=>console.log("AlertModalWithSecondary: Cancelled"),onConfirmSecondary:()=>console.log("AlertModalWithSecondary: Secondary action confirmed")})},GuildDisableCommunicationModal:async()=>{let{Button:e,Text:t,Heading:n,Checkbox:l,ButtonGroup:i}=await Promise.all([a.e("304823"),a.e("223976"),a.e("977260")]).then(a.bind(a,397927)),{DisableCommunicationDuration:s,getFriendlyDurationString:r}=await Promise.resolve().then(a.bind(a,200700)),c=await Promise.resolve().then(a.t.bind(a,582128,19)),d="TestUser";function u(a){let[u,m]=c.useState(s.DURATION_60_SEC),[h,x]=c.useState(""),[p,g]=c.useState(!1),[v,j]=c.useState(!1),f=[{value:s.DURATION_60_SEC,label:r(s.DURATION_60_SEC)},{value:s.DURATION_5_MIN,label:r(s.DURATION_5_MIN)},{value:s.DURATION_10_MIN,label:r(s.DURATION_10_MIN)},{value:s.DURATION_1_HOUR,label:r(s.DURATION_1_HOUR)},{value:s.DURATION_1_DAY,label:r(s.DURATION_1_DAY)},{value:s.DURATION_1_WEEK,label:r(s.DURATION_1_WEEK)}],b=c.useCallback(async()=>{g(!0),console.log("GuildDisableCommunicationModal: Timing out user",{user:d,duration:r(u),reason:null!=h?h:"No reason provided",resolveFlag:v}),await new Promise(e=>setTimeout(e,1e3)),g(!1),a.onClose()},[u,h,v,a]);return(0,o.jsxs)("div",{style:{padding:"20px",maxWidth:"500px"},children:[(0,o.jsxs)(n,{variant:"heading-lg/semibold",className:"mb-2",children:["Disable Communication for ",d,"#","0001"]}),(0,o.jsx)(t,{variant:"text-sm/normal",className:"mb-4",color:"text-subtle",children:"This will temporarily disable the user's ability to communicate in this server."}),(0,o.jsxs)("div",{className:"mb-4",children:[(0,o.jsx)(n,{variant:"heading-sm/semibold",className:"mb-2",children:"Duration"}),(0,o.jsx)(i,{children:f.map(t=>(0,o.jsx)(e,{variant:u===t.value?"primary":"secondary",size:"sm",text:t.label,onClick:()=>m(t.value)},t.value))})]}),(0,o.jsxs)("div",{className:"mb-4",children:[(0,o.jsx)(n,{variant:"heading-sm/semibold",className:"mb-2",children:"Reason (Optional)"}),(0,o.jsx)("textarea",{value:h,onChange:e=>x(e.target.value),placeholder:"Enter reason for timeout...",style:{width:"100%",minHeight:"80px",padding:"8px",border:"1px solid var(--border-subtle)",borderRadius:"4px",backgroundColor:"var(--background-base-low)",color:"var(--text-strong)",resize:"vertical"}})]}),(0,o.jsx)("div",{className:"mb-4",children:(0,o.jsx)(l,{checked:v,onChange:j,label:"Resolve associated mod report"})}),(0,o.jsxs)("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end"},children:[(0,o.jsx)(e,{variant:"secondary",text:"Cancel",onClick:a.onClose}),(0,o.jsx)(e,{variant:"primary",text:"Timeout User",onClick:b,disabled:p})]})]})}return e=>(0,o.jsx)(u,{...e})},GuildPowerupDeactivateModal:async()=>{let{Button:e,Text:t,Heading:n,Checkbox:l}=await Promise.all([a.e("304823"),a.e("223976"),a.e("977260")]).then(a.bind(a,397927)),i=await Promise.resolve().then(a.t.bind(a,582128,19)),s="Level 3 Server Boost",r=200,c=60,d=8;function u(a){let[u,m]=i.useState(!1),[h,x]=i.useState(!1),p=i.useCallback(async()=>{x(!0),console.log("GuildPowerupDeactivateModal: Deactivating powerup",{powerup:s,guildId:"123456789"}),await new Promise(e=>setTimeout(e,2e3)),x(!1),a.onClose()},[a]);return(0,o.jsxs)("div",{style:{padding:"20px",maxWidth:"500px"},children:[(0,o.jsxs)(n,{variant:"heading-lg/semibold",className:"mb-2",children:["Deactivate ",s]}),(0,o.jsxs)(t,{variant:"text-sm/normal",className:"mb-4",color:"text-subtle",children:["This will remove the ",s," from your server and disable all associated features."]}),(0,o.jsxs)("div",{className:"mb-4",style:{backgroundColor:"var(--background-base-lower)",padding:"16px",borderRadius:"8px",border:"1px solid var(--border-subtle)"},children:[(0,o.jsx)(n,{variant:"heading-sm/semibold",className:"mb-2",children:"Current Features"}),(0,o.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px"},children:[(0,o.jsxs)(t,{variant:"text-sm/normal",color:"text-subtle",children:["\u2022 ",r," emoji slots"]}),(0,o.jsxs)(t,{variant:"text-sm/normal",color:"text-subtle",children:["\u2022 ",c," sticker slots"]}),(0,o.jsxs)(t,{variant:"text-sm/normal",color:"text-subtle",children:["\u2022 ",d," sound slots"]}),(0,o.jsx)(t,{variant:"text-sm/normal",color:"text-subtle",children:"\u2022 Custom server banner"})]})]}),(0,o.jsxs)("div",{className:"mb-4",style:{backgroundColor:"var(--background-danger)",padding:"16px",borderRadius:"8px",border:"1px solid var(--border-feedback-critical)"},children:[(0,o.jsxs)(t,{variant:"eyebrow",color:"text-feedback-critical",className:"mb-2",children:[(0,o.jsx)("span",{role:"img","aria-label":"Warning",children:"\u26A0\uFE0F"})," ","Warning"]}),(0,o.jsx)(t,{variant:"text-sm/medium",color:"text-feedback-critical",children:"Deactivating this powerup will immediately remove all Level 3 features from your server. Members will lose access to custom emojis, stickers, and other premium features. This action cannot be undone."})]}),(0,o.jsx)("div",{className:"mb-4",children:(0,o.jsx)(l,{checked:u,onChange:m,label:"I understand that deactivating this powerup will remove all Level 3 features from my server",labelType:"secondary"})}),(0,o.jsxs)("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end"},children:[(0,o.jsx)(e,{variant:"secondary",text:"Cancel",onClick:a.onClose}),(0,o.jsx)(e,{variant:"critical-primary",text:"Deactivate Level",onClick:p,disabled:!u,loading:h})]})]})}return e=>(0,o.jsx)(u,{...e})},DataHarvestModal:async()=>{let{default:e}=await a.e("292063").then(a.bind(a,970018));return t=>(0,o.jsx)(e,{modalProps:t,onConfirm:e=>{console.log("DataHarvestModal: Requesting data export for:",e),setTimeout(()=>{console.log("DataHarvestModal: Data export request submitted successfully")},1e3)}})},EnableCommunityModal:async()=>{let{default:e}=await Promise.all([a.e("443159"),a.e("553203"),a.e("82721"),a.e("452823"),a.e("674832")]).then(a.bind(a,709779));return t=>(0,o.jsx)(e,{...t,onClose:async()=>{console.log("EnableCommunityModal: Closed"),await t.onClose()}})},DeprivateModal:async()=>{let e=(await Promise.all([a.e("315273"),a.e("254857")]).then(a.bind(a,147696))).default;return t=>(0,o.jsx)(e,{...t,guildId:"123456789012345678",startingChannelId:"987654321098765432"})},CameraPreviewModal:async()=>{let{default:e}=await Promise.all([a.e("650100"),a.e("410534")]).then(a.bind(a,308229));return t=>(0,o.jsx)(e,{...t,videoEnabled:!1,onEnable:()=>console.log("Camera enabled")})},CameraPreviewModalWithVideo:async()=>{let{default:e}=await Promise.all([a.e("650100"),a.e("410534")]).then(a.bind(a,308229));return t=>(0,o.jsx)(e,{...t,videoEnabled:!0,onEnable:()=>console.log("Camera enabled")})},ModeratorReportResolveConfirmModal:async()=>{let{default:e}=await Promise.resolve().then(a.bind(a,390897));return t=>(0,o.jsx)(e,{...t,handleResolveFlag:()=>console.log("ModeratorReportResolveConfirmModal: Flag resolved")})},SelectFriendsModal:async()=>{let{default:e,SelectFriendsModalScreens:t}=await Promise.resolve().then(a.bind(a,303682));return a=>{let{onClose:n,...l}=a;return(0,o.jsx)(e,{onClose:async()=>{console.log("SelectFriendsModal: Closed"),await n()},startingScreen:t.SELECT_FRIENDS,...l})}},SelectFriendsModalReminder:async()=>{let{default:e,SelectFriendsModalScreens:t}=await Promise.resolve().then(a.bind(a,303682));return a=>{let{onClose:n,...l}=a;return(0,o.jsx)(e,{onClose:async()=>{console.log("SelectFriendsModalReminder: Closed"),await n()},startingScreen:t.REMINDER,...l})}},FavoritesGuildAddChannelModal:async()=>{let{default:e}=await Promise.all([a.e("866475"),a.e("267732"),a.e("850979"),a.e("236946"),a.e("692639"),a.e("890480"),a.e("440963"),a.e("766031"),a.e("394317"),a.e("79362"),a.e("276340")]).then(a.bind(a,826271));return t=>(0,o.jsx)(e,{...t,parentId:null,source:"devtools"})},ActivityShareMomentModal:async()=>{let{default:e}=await Promise.all([a.e("866475"),a.e("267732"),a.e("58243"),a.e("236946"),a.e("692639"),a.e("890480"),a.e("440963"),a.e("766031"),a.e("394317"),a.e("521743")]).then(a.bind(a,190930));return t=>(0,o.jsx)(e,{...t,applicationId:"123456789",mediaUrl:"https://picsum.photos/400/300.jpg"})},CallUserConfirmationModal:async()=>{let{default:e}=await a.e("19106").then(a.bind(a,502054));return t=>(0,o.jsx)(e,{...t,onSubmit:()=>{console.log("CallUserConfirmationModal: Call confirmed"),t.onClose()}})},OptInReorderAttemptModal:async()=>{let{default:e}=await Promise.all([a.e("57729"),a.e("697585"),a.e("24848")]).then(a.bind(a,354643));return t=>(0,o.jsx)(e,{...t,onClose:()=>(console.log("OptInReorderAttemptModal: Modal closed"),t.onClose())})},GuildAntiRaidReportModal:async()=>{let{default:e}=await Promise.all([a.e("273669"),a.e("364499")]).then(a.bind(a,296222));return t=>(0,o.jsx)(e,{...t,guildId:"123456789",onClose:()=>(console.log("GuildAntiRaidReportModal: Modal closed"),t.onClose())})},ConsentCheckBoxModal:async()=>{let{ConfirmModal:e}=await Promise.all([a.e("304823"),a.e("223976"),a.e("977260")]).then(a.bind(a,397927)),{Text:t,Heading:n}=await Promise.all([a.e("304823"),a.e("223976"),a.e("977260")]).then(a.bind(a,397927)),l=await Promise.resolve().then(a.t.bind(a,582128,19));function i(a){let[i,s]=l.useState(!1),[r,c]=l.useState(!1);return(0,o.jsx)(e,{...a,title:"Consent CheckBox Examples",confirmText:"Close",cancelText:"",onConfirm:()=>(console.log("ConsentCheckBoxModal: Modal closed"),a.onClose()),onCancel:()=>{},children:(0,o.jsxs)("div",{style:{padding:"20px",display:"flex",flexDirection:"column",gap:"20px"},children:[(0,o.jsxs)("div",{children:[(0,o.jsx)(n,{variant:"heading-md/semibold",style:{marginBottom:"12px"},children:"Terms of Service Consent"}),(0,o.jsx)(oh.S,{label:"I agree to Discord's Terms of Service and Privacy Policy",checked:i,onChange:e=>s(e),labelType:"secondary"}),(0,o.jsxs)(t,{variant:"text-sm/normal",color:"text-subtle",style:{marginTop:"8px"},children:["Consent status: ",i?"Agreed":"Not agreed"]})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(n,{variant:"heading-md/semibold",style:{marginBottom:"12px"},children:"Promotional Email Consent"}),(0,o.jsx)(oh.S,{label:"I would like to receive promotional emails from Discord about new features, events, and other updates.",checked:r,onChange:e=>c(e),labelType:"secondary"}),(0,o.jsxs)(t,{variant:"text-sm/normal",color:"text-subtle",style:{marginTop:"8px"},children:["Promo consent status: ",r?"Opted in":"Not opted in"]})]})]})})}return i.displayName="ConsentCheckBoxModalContent",e=>(0,o.jsx)(i,{...e})},GuildRaidLockdownFeedbackModal:async()=>{let{default:e}=await Promise.all([a.e("660608"),a.e("346313")]).then(a.bind(a,336496));return t=>(0,o.jsx)(e,{...t,guildId:"123456789",onClose:()=>(console.log("GuildRaidLockdownFeedbackModal: Modal closed"),t.onClose())})},GuildVerificationLevelModal:async()=>{let{default:e}=await Promise.all([a.e("955424"),a.e("623386"),a.e("78618"),a.e("149409"),a.e("970232")]).then(a.bind(a,313003)),{dangerouslyConstructGuildRecordFromUntypedObject:t}=await Promise.resolve().then(a.bind(a,149790)),n=t({id:"123456789",name:"Test Server",description:"A test server for development",ownerId:"987654321",icon:null,splash:null,banner:null,homeHeader:null,features:[],preferredLocale:"en-US",afkChannelId:null,afkTimeout:300,systemChannelId:null,verificationLevel:2,joinedAt:new Date,defaultMessageNotifications:0,mfaLevel:0,application_id:null,explicitContentFilter:0,vanityURLCode:null,premiumTier:0,premiumSubscriberCount:0,premiumProgressBarEnabled:!1,systemChannelFlags:0,discoverySplash:null,rulesChannelId:null,safetyAlertsChannelId:null,publicUpdatesChannelId:null,maxStageVideoChannelUsers:10,maxVideoChannelUsers:25,maxMembers:5e5,nsfwLevel:0,ownerConfiguredContentLevel:null,hubType:null,latestOnboardingQuestionId:null,profile:null,premiumFeatures:null,moderatorReporting:null});return t=>(0,o.jsx)(e,{...t,guild:n})},GuildVerificationLevelModalCommunity:async()=>{let{default:e}=await Promise.all([a.e("955424"),a.e("623386"),a.e("78618"),a.e("149409"),a.e("970232")]).then(a.bind(a,313003)),{dangerouslyConstructGuildRecordFromUntypedObject:t}=await Promise.resolve().then(a.bind(a,149790)),{GuildFeatures:n}=await Promise.resolve().then(a.bind(a,652215)),l=t({id:"123456789",name:"Test Community Server",description:"A test community server for development",ownerId:"987654321",icon:null,splash:null,banner:null,homeHeader:null,features:[n.COMMUNITY],preferredLocale:"en-US",afkChannelId:null,afkTimeout:300,systemChannelId:null,verificationLevel:3,joinedAt:new Date,defaultMessageNotifications:0,mfaLevel:0,application_id:null,explicitContentFilter:0,vanityURLCode:null,premiumTier:0,premiumSubscriberCount:0,premiumProgressBarEnabled:!1,systemChannelFlags:0,discoverySplash:null,rulesChannelId:null,safetyAlertsChannelId:null,publicUpdatesChannelId:null,maxStageVideoChannelUsers:10,maxVideoChannelUsers:25,maxMembers:5e5,nsfwLevel:0,ownerConfiguredContentLevel:null,hubType:null,latestOnboardingQuestionId:null,profile:null,premiumFeatures:null,moderatorReporting:null});return t=>(0,o.jsx)(e,{...t,guild:l})},EmojiAddModal:async()=>{let{EmojiAddModal:e}=await Promise.all([a.e("225560"),a.e("990410")]).then(a.bind(a,126033));return t=>(0,o.jsx)(e,{...t,guildId:"123456789",initialTierEmojiIds:new Set(["emoji1"]),onSubmit:e=>{console.log("EmojiAddModal: Selected emojis:",Array.from(e))},transitionToManageEmoji:()=>{console.log("EmojiAddModal: Transition to manage emoji clicked")},onClose:()=>(console.log("EmojiAddModal: Modal closed"),t.onClose())})},StreamFullModal:async()=>{let{default:e}=await a.e("425894").then(a.bind(a,166789));return t=>(0,o.jsx)(e,{...t})},VoiceCallFeedback:async()=>{let{default:e}=await Promise.all([a.e("36781"),a.e("713710"),a.e("803461"),a.e("155925"),a.e("137381"),a.e("259375"),a.e("64054")]).then(a.bind(a,47893)),t={channel_id:"123456789",channel_type:em.rbe.GUILD_VOICE,guild_id:"987654321",rtc_connection_id:"devtools-rtc-connection",duration:6e4,voice_state_count:2,video_stream_count:0,video_enabled:!1,media_session_id:"devtools-media-session",duration_muted_ms:0,output_audio_route_type:null};return a=>(0,o.jsx)(e,{...a,analyticsData:t})},StreamFeedback:async()=>{let{default:e}=await Promise.all([a.e("36781"),a.e("713710"),a.e("803461"),a.e("155925"),a.e("137381"),a.e("259375"),a.e("617171"),a.e("862767")]).then(a.bind(a,218738)),t={ownerId:"987654321",guildId:"123456789",channelId:"123456789",streamType:oj.U4.GUILD},n={id:"123456789",name:"Test Game"},l={rtc_connection_id:"devtools-rtc-connection",media_session_id:"devtools-media-session",duration:6e4,stream_region:"us-west",max_viewers:3,avg_bitrate:2500,avg_fps:60,avg_resolution:1080,inbound_bitrate_estimate_percentile99:3e3,parent_media_session_id:null};return a=>(0,o.jsx)(e,{...a,isStreamer:!1,stream:t,streamApplication:n,analyticsData:l})},FamilyCenterAcceptLinkModal:async()=>{let e=eo.default.getUser("12345"),t=eo.default.getUser("67890");if(void 0===e||void 0===t)return()=>null;let{default:n}=await Promise.all([a.e("916131"),a.e("155738"),a.e("331385")]).then(a.bind(a,58144));return a=>(0,o.jsx)(n,{...a,currentUser:t,otherUser:e})},FamilyCenterDeclineLinkModal:async()=>{let e=eo.default.getUser("12345"),t=eo.default.getUser("67890");if(void 0===e||void 0===t)return()=>null;let{default:n}=await Promise.all([a.e("916131"),a.e("155738"),a.e("384811")]).then(a.bind(a,389094));return a=>(0,o.jsx)(n,{...a,currentUser:t,otherUser:e})},FamilyCenterCancelLinkModal:async()=>{let e=eo.default.getUser("12345"),t=eo.default.getUser("67890");if(void 0===e||void 0===t)return()=>null;let{default:n}=await Promise.all([a.e("916131"),a.e("155738"),a.e("817219")]).then(a.bind(a,187278));return a=>(0,o.jsx)(n,{...a,currentUser:e,otherUser:t})},FamilyCenterDisconnectLinkModal:async()=>{let e=eo.default.getUser("12345"),t=eo.default.getUser("67890");if(void 0===e||void 0===t)return()=>null;let{default:n}=await Promise.all([a.e("321855"),a.e("943139")]).then(a.bind(a,179950));return a=>(0,o.jsx)(n,{...a,currentUser:e,otherUser:t})},FamilyCenterQRCodeModal:async()=>{let{default:e}=await Promise.all([a.e("683023"),a.e("272875")]).then(a.bind(a,320742));return t=>(0,o.jsx)(e,{...t})},PremiumGroupFriendsSelectorModal:async()=>{let{default:e}=await Promise.all([a.e("634508"),a.e("485579")]).then(a.bind(a,785606)),t=op.A.getPremiumGroupSubscription();return null==t?()=>null:a=>(0,o.jsx)(e,{...a,subscription:t})},PremiumGroupAcceptInviteModal:async()=>{let{default:e}=await Promise.all([a.e("56498"),a.e("399910")]).then(a.bind(a,826181));return t=>(0,o.jsx)(e,{...t,premiumGroupSubscriptionId:"1234567890",premiumGroupInviteId:"1234567890",isExistingSub:!1,premiumGroupPrimaryName:"Test User"})},QuarantineModeInfoModal:async()=>{let{default:e}=await a.e("474575").then(a.bind(a,218642));return t=>(0,o.jsx)(e,{...t})},CaptchaTestModal:async()=>{let{default:e}=await a.e("417724").then(a.bind(a,563255));return t=>(0,o.jsx)(e,{...t})},PasswordConfirm:async()=>{let{default:e}=await Promise.resolve().then(a.bind(a,662758));return t=>(0,o.jsx)(e,{...t,title:"Confirm Password",actionText:"Submit",handleSubmit:async e=>{console.log("PasswordConfirm: Password submitted:",e),await new Promise(e=>setTimeout(e,1e3))}})},BlockedDomainModal:async()=>{let{default:e}=await Promise.all([a.e("364956"),a.e("420577"),a.e("335681"),a.e("520723")]).then(a.bind(a,667934));return t=>(0,o.jsx)(e,{...t,url:"https://example-phishing-site.com/malicious-page"})},DmSettingsUpsellModal:async()=>{let{default:e}=await Promise.all([a.e("494150"),a.e("962684")]).then(a.bind(a,228855)),t=Object.keys(nE.A.getGuilds())[0];return a=>(0,o.jsx)(e,{...a,guildId:t})},UrgentMessageModal:async()=>{let{default:e}=await Promise.all([a.e("689913"),a.e("136724")]).then(a.bind(a,531519));return t=>(0,o.jsx)(e,{...t})},UserAgreementsModal:async()=>{let{default:e}=await Promise.all([a.e("50726"),a.e("482911"),a.e("922220")]).then(a.bind(a,639719));return t=>(0,o.jsx)(e,{...t})},DisableRiskyPermsModal:async()=>{let{default:e}=await Promise.all([a.e("796057"),a.e("553203"),a.e("452823"),a.e("971905")]).then(a.bind(a,868952)),t=Object.values(nE.A.getGuilds())[0];return null==t?()=>null:a=>(0,o.jsx)(e,{...a,guild:t})},OtherFriendRequestsModal:async()=>{let{default:e}=await Promise.all([a.e("605395"),a.e("979862"),a.e("791370"),a.e("548018"),a.e("773152"),a.e("625281")]).then(a.bind(a,516259));return t=>(0,o.jsx)(e,{...t})},AcceptInviteModal:async()=>{let{default:e}=await Promise.all([a.e("444038"),a.e("807432"),a.e("601495"),a.e("807265"),a.e("549106"),a.e("901352"),a.e("579023"),a.e("248672")]).then(a.bind(a,777307));return t=>(0,o.jsx)(e,{...t})},PremiumGroupSubscribeModal:async()=>{let{default:e}=await Promise.all([a.e("499709"),a.e("569595")]).then(a.bind(a,526710));return t=>(0,o.jsx)(e,{...t})},NewUserOnboarding:async()=>{let{default:e}=await Promise.all([a.e("188406"),a.e("538288"),a.e("122326"),a.e("533651"),a.e("260634"),a.e("194399"),a.e("419580"),a.e("82721"),a.e("197804"),a.e("756856"),a.e("319623"),a.e("999574"),a.e("457794"),a.e("908768")]).then(a.bind(a,189411));return t=>(0,o.jsx)(e,{...t})}};function ob(){let e=c.useMemo(()=>Object.keys(of).map(e=>({label:e,value:e,id:e})).sort((e,t)=>e.label.localeCompare(t.label)),[]),[t,a]=c.useState(null);return(0,o.jsx)(v.Ip,{className:tX.nd,children:(0,o.jsxs)("div",{className:iV.l$,children:[(0,o.jsx)("section",{className:iV.uW,children:(0,o.jsxs)(tY.B,{direction:"horizontal",gap:8,align:"end",children:[(0,o.jsx)(aE.Z,{label:"Open a Modal",placeholder:"Select a modal",options:e,value:t,onSelectionChange:a,selectionMode:"single"}),(0,o.jsx)(p.$,{variant:"primary",text:"Open",disabled:null==t,onClick:()=>null!=t&&(0,eY.openModalLazy)(of[t])})]})}),(0,o.jsxs)("section",{className:iV.uW,children:[(0,o.jsx)(X.D,{variant:"heading-md/semibold",children:"Wow moment"}),(0,o.jsx)("div",{className:iV.bd,children:(0,o.jsx)(p.$,{variant:"primary",text:"Open",onClick:function(){(0,ox.o)(!0),og._.dispatch(em.jej.PREMIUM_SUBSCRIPTION_CREATED)}})})]})]})})}var oy=a(933832),oE=a(472229),oS=a(10392),oC=a(669316),o_=a(959165),oA=a(354670),oN=a(158045);async function ok(){try{let{body:e}=await it.Bo.get({url:em.Rsh.USER_OFFER_IDS,rejectWithError:!0});return e}catch(e){return[]}}async function oI(){try{let{body:e}=await it.Bo.get({url:em.Rsh.USER_OFFERS,rejectWithError:!0});return{trial:e.trial.map(o_.A.createFromServer),discount:e.discount.map(oC.A.createFromServer)}}catch(e){return{trial:[],discount:[]}}}async function oD(e,t){try{await it.Bo.post({url:em.Rsh.CREATE_USER_OFFER(e,t),rejectWithError:!0})}catch{}finally{await (0,oS._D)()}}async function oT(e,t){try{await it.Bo.del({url:em.Rsh.UPDATE_USER_OFFER(e,t),rejectWithError:!0})}catch{}finally{await (0,oS._D)()}}async function oR(){try{await it.Bo.del({url:em.Rsh.USER_OFFERS,rejectWithError:!0})}catch{}finally{await oA.A.forceReset(),await (0,oS._D)()}}async function ow(e){await it.Bo.post({url:em.Rsh.CREATE_REVERSE_TRIAL,body:{ends_at:e},rejectWithError:!0})}function oO(e){let{acked:t,expired:a,inStore:n,onClick:l,secondaryBadge:i}=e,s="Created";return a?s="Expired":t?s="Acked":n&&(s="Active"),(0,o.jsxs)("div",{className:iV.fC,children:[(0,o.jsx)(J.D,{onClick:l,className:q()(iV.qS,iV.vk,{[iV.vu]:n,[iV.R1]:t,[iV._7]:a}),children:(0,o.jsxs)(g.E,{variant:"eyebrow",color:t?void 0:"text-overlay-light",children:[s,n?" *":""]})}),null!=i&&i.active&&(0,o.jsx)("div",{className:q()(iV.qS,iV.k3),children:(0,o.jsx)(g.E,{variant:"eyebrow",color:"text-overlay-light",children:i.label})})]})}function oM(e){let{offer:t,offerOptions:a,forceRefetch:n,inStore:l=!1}=e,[i,s]=c.useState(!1),[r,d]=c.useState(!1),[u,m]=c.useState(!1),[h,x]=c.useState(!1);c.useEffect(()=>{u&&x(!0);let e=setTimeout(()=>{x(!1)},500);return()=>{clearTimeout(e)}},[u]);let{id:p,expiresAt:v,trialId:j,subscriptionTrial:f,referrer:b}=t,y=a.find(e=>{let{value:t}=e;return t===j})?.label??"Unknown";null!=b&&(y=`${y} from @${b.username}`);let E=null!=v,S=t.hasExpired,C=t.isRedeemed,_=f?.skuId===tM.pe.TIER_0;async function A(){m(!0),E?await N({expiresAt:null}):await (0,oS.u1)(t),n(),m(!1)}async function N(e){m(!0);try{await it.Bo.patch({url:em.Rsh.UPDATE_USER_OFFER(p,"trial"),body:{..."expiresAt"in e&&{expires_at:e.expiresAt},..."referrerId"in e&&{referrer_id:e.referrerId}},rejectWithError:!0})}finally{n(),m(!1)}}return c.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!1)},3e3);return()=>{clearTimeout(e)}}if(r){let e=setTimeout(()=>{d(!1)},3e3);return()=>{clearTimeout(e)}}},[i,r]),(0,o.jsxs)("div",{className:q()(iV.Nr,_?iV.Qf:iV.C1),children:[(0,o.jsx)("div",{className:q()(iV.nM,iV.S7),children:(0,o.jsx)(X.D,{variant:"heading-lg/semibold",color:"text-overlay-light",children:y})}),(0,o.jsxs)(J.D,{className:q()(iV.nM,iV.QB),onClick:()=>{(0,nQ.C)(p,()=>s(!0))},children:[(0,o.jsxs)(g.E,{variant:"eyebrow",color:"text-overlay-light",children:["Offer: ",p]}),i?(0,o.jsx)(oy.CheckmarkLargeIcon,{size:"md",color:"currentColor",className:iV.Kk}):(0,o.jsx)(nV.CopyIcon,{size:"xs",color:"currentColor",className:iV.Kk})]}),(0,o.jsxs)(J.D,{className:q()(iV.nM,iV.QB),onClick:()=>{(0,nQ.C)(j,()=>d(!0))},children:[(0,o.jsxs)(g.E,{variant:"eyebrow",color:"text-overlay-light",children:["Trial: ",j]}),r?(0,o.jsx)(oy.CheckmarkLargeIcon,{size:"md",color:"currentColor",className:iV.Kk}):(0,o.jsx)(nV.CopyIcon,{size:"xs",color:"currentColor",className:iV.Kk})]}),(0,o.jsx)("div",{className:iV.nM,children:(0,o.jsxs)(g.E,{variant:"eyebrow",color:"text-overlay-light",children:["Trial Length:"," ",(0,oN.re)({intervalType:f?.interval??tM.WT.MONTH,intervalCount:f?.intervalCount??1,capitalize:!1})]})}),(0,o.jsxs)("div",{className:iV.nM,children:[(0,o.jsxs)(g.E,{variant:"eyebrow",color:"text-overlay-light",children:["Expires (",(0,oE.A)(),"):"]}),(0,o.jsx)("input",{type:"datetime-local",value:(0,nX.Xm)(v?.toISOString()),onChange:e=>{N({expiresAt:""!==e.target.value?new Date(e.target.value).toISOString():null})}})]}),(0,o.jsxs)("div",{className:iV.nM,children:[(0,o.jsx)(g.E,{variant:"eyebrow",color:"text-overlay-light",children:"Referrer ID:"}),(0,o.jsx)("input",{type:"text",value:b?.id??"",onChange:e=>N({referrerId:e.target.value})})]}),(0,o.jsx)(oO,{acked:E,expired:S,inStore:l,onClick:A,secondaryBadge:{active:C,label:"Redeemed"}}),(0,o.jsx)(J.D,{onClick:async()=>{m(!0),await oT(p,"trial"),n(),m(!1)},children:(0,o.jsx)(nz.TrashIcon,{size:"md",color:"currentColor",className:q()(iV.Kk,iV.IT)})}),(0,o.jsx)("div",{className:q()(iV.g4,{[iV.VP]:u||h}),children:(0,o.jsx)(tc.y,{})})]})}function oP(e){let{offer:t,offerOptions:a,forceRefetch:n,inStore:l=!1}=e,[i,s]=c.useState(!1),[r,d]=c.useState(!1),[u,m]=c.useState(!1),[h,x]=c.useState(!1);c.useEffect(()=>{u&&x(!0);let e=setTimeout(()=>{x(!1)},500);return()=>{clearTimeout(e)}},[u]);let{id:p,expiresAt:v,discountId:j,discount:f}=t,b=a.find(e=>{let{value:t}=e;return t===j})?.label??"Unknown",y=null!=v,E=t.hasExpired(),S=t.isApplied();async function C(){m(!0),y?await _({expiresAt:null}):await (0,oS.u1)(void 0,t),n(),m(!1)}async function _(e){let{expiresAt:t}=e;m(!0);try{await it.Bo.patch({url:em.Rsh.UPDATE_USER_OFFER(p,"discount"),body:{expires_at:t},rejectWithError:!0})}finally{n(),m(!1)}}return c.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!1)},3e3);return()=>{clearTimeout(e)}}if(r){let e=setTimeout(()=>{d(!1)},3e3);return()=>{clearTimeout(e)}}},[i,r]),(0,o.jsxs)("div",{className:q()(iV.Nr,iV.id),children:[(0,o.jsx)("div",{className:q()(iV.nM,iV.S7),children:(0,o.jsx)(X.D,{variant:"heading-lg/semibold",color:"text-default",children:b})}),(0,o.jsxs)(J.D,{className:q()(iV.nM,iV.QB),onClick:()=>{(0,nQ.C)(p,()=>s(!0))},children:[(0,o.jsxs)(g.E,{variant:"eyebrow",color:"text-default",children:["Offer: ",p]}),i?(0,o.jsx)(oy.CheckmarkLargeIcon,{size:"md",color:"currentColor",className:q()(iV.Kk,iV.mK)}):(0,o.jsx)(nV.CopyIcon,{size:"xs",color:"currentColor",className:iV.Kk})]}),(0,o.jsxs)(J.D,{className:q()(iV.nM,iV.QB),onClick:()=>{(0,nQ.C)(j,()=>d(!0))},children:[(0,o.jsxs)(g.E,{variant:"eyebrow",color:"text-default",children:["Discount: ",j]}),r?(0,o.jsx)(oy.CheckmarkLargeIcon,{size:"md",color:"currentColor",className:q()(iV.Kk,iV.mK)}):(0,o.jsx)(nV.CopyIcon,{size:"xs",color:"currentColor",className:iV.Kk})]}),f?.amount!=null&&(0,o.jsx)("div",{children:(0,o.jsxs)(g.E,{variant:"eyebrow",color:"text-default",children:[f.amount,"% off"]})}),(0,o.jsxs)("div",{className:iV.nM,children:[(0,o.jsxs)(g.E,{variant:"eyebrow",color:"text-overlay-light",children:["Expires (",(0,oE.A)(),"):"]}),(0,o.jsx)("input",{type:"datetime-local",value:(0,nX.Xm)(v?.toISOString()),onChange:e=>_({expiresAt:""!==e.target.value?new Date(e.target.value).toISOString():null})})]}),(0,o.jsx)(oO,{acked:y,expired:E,inStore:l,onClick:C,secondaryBadge:{active:S,label:"Applied"}}),(0,o.jsx)(J.D,{className:iV.aR,onClick:async()=>{m(!0),await oT(p,"discount"),n(),m(!1)},children:(0,o.jsx)(nz.TrashIcon,{size:"md",color:"currentColor",className:q()(iV.Kk,iV.fy)})}),(0,o.jsx)("div",{className:q()(iV.g4,{[iV.VP]:u||h}),children:(0,o.jsx)(tc.y,{})})]})}function oL(){let[e,t]=c.useState([]),[a,n]=c.useState([]),[l,i]=c.useState(),[s,r]=c.useState(),[u,m]=c.useState(!0),{discountOffers:h,trialOffers:x}=(0,d.cf)([oA.A],()=>({discountOffers:Object.values(oA.A.getState().userDiscountOffers).sort((e,t)=>e.id.localeCompare(t.id)),trialOffers:Object.values(oA.A.getState().userTrialOffers).sort((e,t)=>e.id.localeCompare(t.id))})),[j,b]=c.useState([]),[y,E]=c.useState([]),[S,C]=c.useState(10080),[_,A]=c.useState([]),N=c.useMemo(()=>new Set([...x,...h].map(e=>e.id)),[x,h]),k=c.useMemo(()=>[...x,...j.filter(e=>!N.has(e.id))],[x,j,N]),I=c.useMemo(()=>[...h,...y.filter(e=>!N.has(e.id))],[h,y,N]),{entitlements:D,deleteFractionalPremium:T,refreshEntitlementList:R}=iB();async function w(){null!=l&&(await oD(l,"trial"),m(!0))}async function O(){null!=s&&(await oD(s,"discount"),m(!0))}async function M(){await oR(),m(!0)}async function P(){let e=new Date(Date.now()+60*S*1e3).toISOString();await ow(e),R()}return c.useEffect(()=>{R()},[R]),c.useEffect(()=>{A(D.filter(e=>e.sourceType===em.GD.REVERSE_TRIAL&&null!=e.endsAt&&e.endsAt>new Date))},[D]),c.useEffect(()=>{(0===e.length||0===a.length||u)&&ok().then(e=>{let a=Object.keys(e.trial).map(t=>({label:t,value:e.trial[t]})),o=Object.keys(e.discount).map(t=>({label:t,value:e.discount[t]}));t(a),n(o),null==l&&i(a[0].value),null==s&&r(o[0].value)})},[e,a,l,s,u]),c.useEffect(()=>{u&&(m(!1),oA.A.forceReset(),(0,oS._D)(),oI().then(e=>{b(e.trial.sort((e,t)=>e.id.localeCompare(t.id))),E(e.discount.sort((e,t)=>e.id.localeCompare(t.id)))}))},[u]),(0,o.jsx)(v.Ip,{className:tX.nd,children:(0,o.jsxs)("div",{className:iV.l$,children:[(0,o.jsxs)("section",{className:iV.uW,children:[(0,o.jsx)(X.D,{variant:"heading-md/semibold",children:"Utils"}),(0,o.jsxs)("div",{className:iV.Uo,children:[(0,o.jsx)(p.$,{variant:"primary",size:"sm",text:"Clear all User Offers",onClick:M}),(0,o.jsx)(p.$,{variant:"primary",size:"sm",text:"Clear Mobile Trials DismissibleContent",onClick:()=>(0,aO.xB)(aw.M.PREMIUM_MOBILE_TRIAL_USER_SETTINGS_AVATAR_BADGE)}),(0,o.jsx)(p.$,{variant:"primary",size:"sm",text:"Clear Offer Nagbar DismissibleContent",onClick:()=>(0,aO._N)(aw.M.NAGBAR_NOTICE_OFFER_EXPIRING)}),(0,o.jsx)(p.$,{variant:"primary",size:"sm",text:"Refresh DevTools",onClick:()=>m(!0)})]})]}),(0,o.jsx)("section",{className:iV.uW,children:(0,o.jsxs)("div",{className:iV.bd,children:[(0,o.jsx)(f.l,{label:"Create a Trial Offer",options:e,formatOption:e=>{let{label:t,value:a}=e;return{label:t,value:a,id:a}},value:l,placeholder:"Trial Type",onSelectionChange:i,selectionMode:"single",fullWidth:!0}),(0,o.jsx)(p.$,{variant:"primary",text:"Create",onClick:w})]})}),(0,o.jsx)("section",{className:iV.uW,children:(0,o.jsxs)("div",{className:iV.bd,children:[(0,o.jsx)(f.l,{label:"Create a Discount Offer",options:a,formatOption:e=>{let{label:t,value:a}=e;return{label:t,value:a,id:a}},value:s,placeholder:"Discount Type",onSelectionChange:r,selectionMode:"single",fullWidth:!0}),(0,o.jsx)(p.$,{variant:"primary",text:"Create",onClick:O})]})}),k.length>0&&(0,o.jsxs)("section",{className:iV.uW,children:[(0,o.jsx)(X.D,{variant:"heading-md/semibold",children:"Existing Trial Offers"}),(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-muted",children:"* indicates the offer is currently in UserOfferStore."}),k.map(t=>(0,o.jsx)(oM,{offer:t,offerOptions:e,forceRefetch:()=>m(!0),inStore:N.has(t.id)},t.id))]}),I.length>0&&(0,o.jsxs)("section",{className:iV.uW,children:[(0,o.jsx)(X.D,{variant:"heading-md/semibold",children:"Existing Discount Offers"}),(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-muted",children:"* indicates the offer is currently in UserOfferStore."}),I.map(e=>(0,o.jsx)(oP,{offer:e,offerOptions:a,forceRefetch:()=>m(!0),inStore:N.has(e.id)},e.id))]}),(0,o.jsx)("section",{className:iV.uW,children:(0,o.jsxs)("div",{className:iV.bd,children:[(0,o.jsx)(f.l,{label:"Create a Reverse Trial Entitlement",options:[{id:"5min",label:"5 minutes",value:5},{id:"1hour",label:"1 hour",value:60},{id:"1day",label:"1 day",value:1440},{id:"1week",label:"1 week",value:10080}],value:S,placeholder:"Reverse Trial Length",onSelectionChange:C,selectionMode:"single",fullWidth:!0}),(0,o.jsx)(p.$,{variant:"primary",text:"Create",onClick:P})]})}),_.length>0&&(0,o.jsxs)("div",{children:[(0,o.jsx)(g.E,{style:{marginTop:"15px"},variant:"text-md/bold",children:"Active reverse trial"}),(0,o.jsx)("div",{children:_.map(e=>(0,o.jsx)(iH,{entitlement:e,active:!0,onDelete:()=>T(e.id)},e.id))})]})]})})}var oU=a(872162),oG=a(26279),oF=a(628577);let oB={[oG.Re.UNSPECIFIED]:"Unspecified",[oG.Re.DRAFT]:"Draft",[oG.Re.SIGNED]:"Signed",[oG.Re.DISCARDED]:"Discarded",[oG.Re.SIGNING_IN_PROGRESS]:"Signing In Progress",[oG.Re.SIGNING_FAILED]:"Signing Failed"},o$={[oG.BM.UNSPECIFIED]:"Unspecified",[oG.BM.ONE_TIME]:"One Time",[oG.BM.SUBSCRIPTION]:"Subscription"};function oV(){let[e,t]=c.useState(null),[a,n]=c.useState(!0),[l,i]=c.useState(null),s=c.useCallback(async()=>{n(!0),i(null);try{let e=await it.Bo.get({url:`${em.Rsh.ORDER_LIST}?limit=5`,rejectWithError:!0});t(e.body??[])}catch(e){i(e instanceof Error?e.message:"Failed to fetch orders")}finally{n(!1)}},[]);c.useEffect(()=>{s()},[s]);let[r,d]=c.useState(!1),[u,m]=c.useState(null),[h,x]=c.useState(()=>{let e=oa.Ay.getChannelId();return null!=e?e:""}),j=c.useCallback(async()=>{d(!0),m(null);try{let e=h.trim(),t=await it.Bo.post({url:em.Rsh.DEBUG_TEMPORAL_INFRA_PROOF_OF_CONCEPT,body:""!==e?{channel_id:e}:{},rejectWithError:!0}),a=null!=t.body?t.body.run_id:"unknown";m(`Started workflow run ${a}`)}catch(e){m(e instanceof Error?e.message:"Failed to start workflow")}finally{d(!1)}},[h]);return(0,o.jsx)(v.Ip,{className:tX.nd,children:(0,o.jsxs)("div",{className:iV.l$,children:[(0,o.jsxs)("div",{className:iV.dL,style:{marginBottom:"16px"},children:[(0,o.jsxs)(g.E,{variant:"text-lg/bold",children:["Orders (last ",5,")"]}),(0,o.jsx)(p.$,{variant:"secondary",size:"sm",text:"Refresh",onClick:s,loading:a})]}),null!=l&&(0,o.jsx)(Q.w,{type:"critical",message:l,role:"alert"}),!a&&null!=e&&0===e.length&&(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-muted",children:"No orders found."}),null!=e&&e.map(e=>(0,o.jsx)(oW,{order:e},e.id)),(0,o.jsxs)(tY.B,{direction:"vertical",gap:8,style:{marginTop:"16px"},children:[(0,o.jsx)(b.k,{fullWidth:!0,value:h,onChange:x,placeholder:"Channel ID (blank to skip the message)"}),(0,o.jsx)(p.$,{variant:"primary",size:"sm",text:"Run Temporal Infra Proof of Concept",onClick:j,loading:r}),null!=u&&(0,o.jsx)(g.E,{variant:"text-xs/normal",color:"text-muted",children:u})]})]})})}function oW(e){let{order:t}=e,[a,n]=c.useState(!1),[l,i]=c.useState(!1),s=oB[t.status]??`Unknown (${t.status})`,r=[{id:"status",label:`Status: ${s}`,isDisabled:!1},{id:"revision",label:`Revision: ${t.revision}`,isDisabled:!1},{id:"created",label:`Created: ${new Date(t.created_at).toLocaleString()}`,isDisabled:!1}],d=c.useCallback(()=>{navigator.clipboard.writeText(t.id),i(!0),setTimeout(()=>i(!1),2e3)},[t.id]);return(0,o.jsxs)("div",{className:iV.Nr,children:[(0,o.jsxs)(tY.B,{direction:"horizontal",gap:8,align:"center",style:{marginBottom:"4px"},children:[(0,o.jsx)(g.E,{variant:"text-md/semibold",children:t.id}),(0,o.jsx)(p.$,{variant:"secondary",size:"sm",text:l?"Copied!":"Copy ID",onClick:d})]}),(0,o.jsx)(oU.C,{items:r,label:"Order information",layout:"inline"}),(0,o.jsxs)(tY.B,{direction:"vertical",gap:4,style:{marginTop:"8px"},children:[(0,o.jsx)(g.E,{variant:"text-sm/semibold",children:"Line Items"}),0===t.order_line_items.length?(0,o.jsx)(g.E,{variant:"text-xs/normal",color:"text-muted",children:"No line items"}):t.order_line_items.map(e=>(0,o.jsxs)(tY.B,{direction:"horizontal",gap:12,children:[(0,o.jsxs)(g.E,{variant:"text-xs/normal",children:["SKU: ",e.sku_id]}),(0,o.jsxs)(g.E,{variant:"text-xs/normal",children:["Qty: ",e.quantity]}),(0,o.jsxs)(g.E,{variant:"text-xs/normal",children:["Type: ",o$[e.purchase_type]??`Unknown (${e.purchase_type})`]}),null!=e.subscription_plan_id&&(0,o.jsxs)(g.E,{variant:"text-xs/normal",children:["Plan: ",e.subscription_plan_id]})]},e.id))]}),null!=t.billing_facet&&(0,o.jsxs)("div",{className:oF.VK,style:{marginTop:"8px"},children:[(0,o.jsxs)(J.D,{onClick:()=>n(e=>!e),className:oF.Eh,children:[(0,o.jsx)(g.E,{variant:"text-sm/semibold",children:"Billing Facet"}),(0,o.jsx)(iM.A,{direction:a?iM.A.Directions.UP:iM.A.Directions.DOWN})]}),a&&(0,o.jsxs)("ul",{className:oF.j3,children:[(0,o.jsxs)("li",{children:[(0,o.jsx)(g.E,{variant:"text-xs/semibold",children:"payment_gateway"}),(0,o.jsx)(g.E,{variant:"text-xs/normal",children:String(t.billing_facet.payment_gateway)})]}),null!=t.billing_facet.payment_source_id&&(0,o.jsxs)("li",{children:[(0,o.jsx)(g.E,{variant:"text-xs/semibold",children:"payment_source_id"}),(0,o.jsx)(g.E,{variant:"text-xs/normal",children:t.billing_facet.payment_source_id})]}),null!=t.billing_facet.currency&&(0,o.jsxs)("li",{children:[(0,o.jsx)(g.E,{variant:"text-xs/semibold",children:"selected currency"}),(0,o.jsx)(g.E,{variant:"text-xs/normal",children:t.billing_facet.currency})]}),null!=t.billing_facet.invoice_preview&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("li",{children:[(0,o.jsx)(g.E,{variant:"text-xs/semibold",children:"currency"}),(0,o.jsx)(g.E,{variant:"text-xs/normal",children:t.billing_facet.invoice_preview.currency})]}),(0,o.jsxs)("li",{children:[(0,o.jsx)(g.E,{variant:"text-xs/semibold",children:"subtotal"}),(0,o.jsx)(g.E,{variant:"text-xs/normal",children:t.billing_facet.invoice_preview.subtotal})]}),(0,o.jsxs)("li",{children:[(0,o.jsx)(g.E,{variant:"text-xs/semibold",children:"tax"}),(0,o.jsx)(g.E,{variant:"text-xs/normal",children:t.billing_facet.invoice_preview.tax})]}),(0,o.jsxs)("li",{children:[(0,o.jsx)(g.E,{variant:"text-xs/semibold",children:"total"}),(0,o.jsx)(g.E,{variant:"text-xs/normal",children:t.billing_facet.invoice_preview.total})]}),t.billing_facet.invoice_preview.line_items.length>0&&(0,o.jsxs)("li",{children:[(0,o.jsx)(g.E,{variant:"text-xs/semibold",children:"invoice line items"}),(0,o.jsx)(tY.B,{direction:"vertical",gap:4,style:{marginTop:"4px"},children:t.billing_facet.invoice_preview.line_items.map(e=>(0,o.jsxs)(tY.B,{direction:"horizontal",gap:12,children:[(0,o.jsxs)(g.E,{variant:"text-xs/normal",children:["ref: ",e.ref_order_line_item_id]}),(0,o.jsxs)(g.E,{variant:"text-xs/normal",children:["unit: ",e.unit_price]}),(0,o.jsxs)(g.E,{variant:"text-xs/normal",children:["qty: ",e.quantity]})]},e.ref_order_line_item_id))})]})]})]})]})]})}var oH=a(935462),oz=a(103557),oK=a(93688),oY=a(717400),oq=a(676955),oJ=a(31300),oQ=a(500060),oX=a(391973),oZ=a(684013),o0=a(765671),o1=a(235986),o2=a(742589),o5=a(41984),o3=a(181435),o6=a(435736),o8=a(661886),o4=a(296027),o7=a(515183),o9=a(127242),ce=a(869014),ct=a(528772),ca=a(32584),cn=a(532624),cl=a(773371),ci=a(927813),cs=a(996439),cr=a(350535),co=a(9302),cc=a(644434),cd=a(998798);let cu={[em.uss.CLICK_ZONE_DEBUG]:e=>({type:em.uss.CLICK_ZONE_DEBUG,id:(0,eO.A)(),layoutId:e,anchor:{top:.35,right:.35},size:{width:100,height:100},...ca.A.getWidgetDefaultSettings(em.uss.CLICK_ZONE_DEBUG),pinned:!0}),[em.uss.PERFORMANCE_DEBUG]:e=>({type:em.uss.PERFORMANCE_DEBUG,id:(0,eO.A)(),layoutId:e,anchor:{top:.1,right:.1},size:{fixed:!1,width:"auto",height:"auto"},...ca.A.getWidgetDefaultSettings(em.uss.PERFORMANCE_DEBUG),pinned:!0})},cm={};function ch(e){let{id:t}=e,[a,n]=c.useState(!1);return c.useEffect(()=>{let e;return a&&(e=setTimeout(()=>{n(!1)},1e3)),()=>{null!=e&&clearTimeout(e)}},[a]),(0,o.jsxs)(n$.$n,{look:n$.$n.Looks.LINK,color:n$.$n.Colors.LINK,size:n$.$n.Sizes.MIN,onClick:function(){(0,nQ.C)(t,()=>n(!0))},className:cd.DT,children:["Game Id: ",t," ",a?n_.intl.string(n_.t.t5VZ88):null]})}let cx=c.memo(function(e){let{trackedGame:t}=e,a=(0,d.bG)([S.Ay],()=>S.Ay.getGameOrTransformedSubgameForPID(t.pid)),n=(0,d.bG)([A.A],()=>A.A.getGameForPID(t.pid)),{data:l}=(0,a_.I)(n?.id),i=(0,d.bG)([S.Ay],()=>null==a?null:S.Ay.getGameOverlayStatus(a));return(0,o.jsxs)("div",{className:cd.st,children:[(0,o.jsx)(g.E,{variant:"text-md/bold",color:"text-strong",children:t.gameName}),(0,o.jsx)(g.E,{variant:"text-sm/bold",color:"text-subtle",children:t.pid}),(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-subtle",children:a?.exeName}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-default",children:["isLauncher: ",a?.isLauncher?"Yes":"No"]}),null!=t.gameId&&(0,o.jsx)(g.E,{variant:"text-md/bold",color:"text-strong",children:(0,o.jsx)(ch,{id:t.gameId})}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-default",children:["fullscreenType: ",(0,o7.wR)(t.fullscreenType)]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-default",children:["state: ",t.state]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-default",children:["successfullyShown: ",t.successfullyShown?"Yes":"No"]}),(0,o.jsxs)("div",{className:cd.st,children:[(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-default",children:["source: ",t.source]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-default",children:["legacyEnabled: ",t.legacyEnabled?"Yes":"No"]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-default",children:["oopEnabled: ",t.oopEnabled?"Yes":"No"]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-default",children:["overlayMethod: ",(0,o7.gK)(t.overlayMethod)]})]}),null!=i&&(0,o.jsxs)("div",{className:cd.st,children:[(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-default",children:["raw source: ",i.source]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-default",children:["raw enabledLegacy: ",i.enabledLegacy?"Yes":"No"]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-default",children:["raw enabledOOP: ",i.enabledOOP?"Yes":"No"]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-default",children:["raw overlayMethod: ",(0,o7.gK)(i.overlayMethod)]})]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-default",children:["hidden: ",a?.hidden?"Yes":"No"]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-default",children:["hook: ",l?.hook?"Yes":"No"]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-default",children:["overlay: ",l?.overlay?"Yes":"No"]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-default",children:["overlayCompatibilityHook: ",l?.overlayCompatibilityHook?"Yes":"No"]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-default",children:["supportsOutOfProcessOverlay: ",l?.supportsOutOfProcessOverlay?"Yes":"No"]})]})}),cp=c.memo(function(e){let{pid:t}=e,a=(0,d.cf)([cl.default],()=>cl.default.getOverlayPIDStatuses()),n=(0,d.cf)([o4.default],()=>o4.default.getTrackedGames()),l=(0,d.bG)([cl.default],()=>cl.default.isInputLocked(t),[t]),i=(0,d.bG)([cl.default],()=>cl.default.DEV_isInputLockedV3(t),[t]),s=(0,d.bG)([cl.default],()=>cl.default.DEV_isInputLocked(t),[t]),r=(0,d.bG)([cl.default],()=>cl.default.isReady(t),[t]);return(0,o.jsxs)("div",{className:cd.st,children:[(0,o.jsx)(g.E,{variant:"text-md/semibold",color:"text-strong",children:`${t}`}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-subtle",children:["Screen Type Resolution: ",function(e){let t=n[e]?.timer;if(null==t||null==t.screenTypeResolutionTimestamp)return"...";let a=t.screenTypeResolutionTimestamp-t.startTrackingTimestamp;return`${a.toFixed(2)}ms`}(t)]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-subtle",children:["Window Creation: ",function(e){let t=n[e]?.timer;if(null==t||null==t.moduleTrackingTimestamp||null==t.screenTypeResolutionTimestamp)return"...";let a=t.moduleTrackingTimestamp-t.screenTypeResolutionTimestamp;return`${a.toFixed(2)}ms`}(t)]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-subtle",children:["Rendering: ",function(e){let t=n[e]?.timer;if(null==t||null==t.overlayRenderingTimestamp||null==t.moduleTrackingTimestamp)return"...";let a=t.overlayRenderingTimestamp-t.moduleTrackingTimestamp;return`${a.toFixed(2)}ms`}(t)]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-strong",children:["Bridge Status: ",a.get(Number(t))]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-strong",children:["isInputLocked: ",l]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-strong",children:["isInputLockedV3: ",i]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-strong",children:["isInputLockedV2: ",s]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-strong",children:["isReady: ",r]})]})});function cg(e){var t;let a=(t=Object.values((0,d.yK)([ca.A],()=>ca.A.getWidgetsForLayout(cc.GJ))),t.find(t=>t.type===e));return[a,function(){if(null!=a)(0,oX.uv)(a.id);else{let t=cu[e];if(null==t)return;let a=t(cc.GJ);(0,oX.jn)(a)}}]}function cv(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?`${e.toFixed(2)}ms`:(0,nX.i$)(nB()(e),"h:mm:ss.SSS")}let cj=c.memo(function(e){let{pid:t,...a}=e,n=(0,d.bG)([o4.default],()=>{if(null==t)return"Unknown";let e=o4.default.getTrackedGameByPid(t)?.gameName;return null!=e?(cm[t]=e,e):cm[t]??"Unknown"},[t]);return(0,o.jsx)(g.E,{...a,variant:"text-md/semibold",color:"text-strong",children:n})});function cf(){let e=(0,d.bG)([o9.A],()=>o9.A.hasRenderDebugMode(o5.x7.TrackFocusPIDs)),t=(0,d.yK)([o4.default],()=>o4.default.getDevToolsFocusedPidsWithTimestamp());return(0,o.jsxs)("div",{className:cd.st,children:[(0,o.jsxs)("div",{className:cd.Iv,children:[(0,o.jsx)(h.d,{checked:e,onChange:()=>void oZ.A.setRenderDebugMode(!o9.A.hasRenderDebugMode(o5.x7.TrackFocusPIDs),o5.x7.TrackFocusPIDs),label:"Track Focus Pids"}),(0,o.jsx)(J.D,{className:cd.LL,onClick:()=>oZ.A.clearTrackedPids(),children:(0,o.jsx)(nz.TrashIcon,{size:"md",color:"currentColor"})})]}),(0,o.jsxs)(v.Ip,{className:q()(cd.st,cd.XG),children:[0===t.length&&(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-default",children:"No recent focused pids"}),[...t].reverse().map(e=>{let[t,a,n]=e;return(0,o.jsx)(c.Fragment,{children:(0,o.jsx)(id.m,{position:"left",text:n===o5.su.TRACK_FOCUS?"Tracked Focus Event":"Clear Focus Event",children:(0,o.jsx)("div",{children:(0,o.jsxs)(g.E,{variant:"text-sm/medium",color:n===o5.su.TRACK_FOCUS?"text-default":"text-feedback-critical",children:[(0,o.jsx)(cj,{pid:a,tag:"span"})," - ",a?.toString()??"null"," @ ",cv(t)]})})})},`${a}-${t}`)})]})]})}let cb=c.memo(function(e){let{pid:t}=e,a=(0,d.bG)([o4.default,S.Ay],()=>{if(null==t)return null;let e=o4.default.getTrackedGameByPid(t)?.fullscreenType;if(null!=e)return e;let a=S.Ay.getGameOrTransformedSubgameForPID(t);return a?.fullscreenType??l4.aI.UNKNOWN},[t]);return(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-subtle",tag:"span",children:["Original Screen Type: ",null!=a?(0,o7.wR)(a):"Unknown"]})}),cy=c.memo(function(){let e=(0,d.cf)([o4.default],()=>o4.default.getTrackedGames()),[t,a]=c.useState({}),n=c.useRef(null);return c.useEffect(()=>(n.current=setInterval(async()=>{let e=S.Ay.getRunningGames(),t=[],n=Date.now();for(let a of e)t.push((0,o7.E1)(a.pid,0).then(e=>[a.pid,e,n]));let l=await Promise.all(t);a(e=>l.reduce((e,t)=>{let[a,n,l]=t;if(null==n||null==a)return e;let i=e[a]??[],s=i[i.length-1]?.screenType;return(0===i.length||s!==n)&&(e[a]=[...i,{pid:a,screenType:n,timestamp:l}]),e},{...e}))},+ci.A.Millis.SECOND),()=>clearInterval(n.current)),[]),(0,o.jsx)(id.m,{position:"left",text:"The most recent screen types we've logged, indexed by pid",children:(0,o.jsx)("div",{children:(0,o.jsxs)(v.Ip,{className:q()(cd.st,cd.XG),children:[0===Object.keys(e).length&&(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-default",children:"No recent screen types"}),Object.values(e).map(e=>(0,o.jsxs)("div",{children:[(0,o.jsx)(cj,{tag:"div",pid:e.pid}),(0,o.jsx)(cb,{pid:e.pid}),null!=t[e.pid]&&[...t[e.pid]].reverse().map(t=>{let{screenType:a,timestamp:n}=t;return(0,o.jsx)(g.E,{variant:"text-xs/normal",color:"text-default",children:`${a}:${(0,o7.wR)(a)} @ ${cv(n)}`},`${e.pid}-${a}-${n}`)})]},e.pid))]})})})}),cE=c.memo(function(){let e=(0,d.cf)([o4.default],()=>o4.default.getTrackedGames()),t=(0,co.getPID)(),a=(0,d.bG)([o4.default],()=>o4.default.isOverlayOOPEnabledForPid(t),[t]),[n,l]=(0,d.yK)([ct.A],()=>[ct.A.enabled,ct.A.keepOpen]),i=(0,d.bG)([cl.default],()=>cl.default.getFocusedPID()),s=(0,d.bG)([cl.default],()=>cl.default.isFocusedPidOutOfProcess());return(0,o.jsxs)("div",{className:cd.st,children:[0===Object.keys(e).length&&(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-default",children:"No tracked game times"}),Object.values(e).map(e=>(0,o.jsx)(cp,{pid:e.pid},e.pid)),(0,o.jsxs)("div",{children:[(0,o.jsxs)(g.E,{variant:"text-sm/medium",color:"text-strong",children:["focusedPID: ",i?.toString()??"null"]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-subtle",children:["isFocusedPidOutOfProcess: ",s?"Yes":"No"]}),(0,o.jsxs)(g.E,{variant:"text-sm/medium",color:"text-strong",children:["processPid: ",t?.toString()??"unknown"]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-subtle",children:["isOOPEnabledForPid: ",a?"Yes":"No"]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-subtle",children:["SoundboardOverlay.enabled: ",n?"Yes":"No"]}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-subtle",children:["SoundboardOverlay.keepOpen: ",l?"Yes":"No"]})]})]})}),cS=[{mode:o5.x7.ClickZones,label:"Click Zone Debug Mode",tooltip:"Enables a red border around click zones to help with debugging."},{mode:o5.x7.WidgetAreas,label:"Render Debug Mode",tooltip:"Enables a border around any widgets that are rendered on screen that are pinned (even if they are hidden). Blue = pinned widgets, Gray = unpinned widgets"},{mode:o5.x7.WindowContainer,label:"Window Container Debug Mode",tooltip:"Enables a border the overlay window"},{mode:o5.x7.DisabledGPUBoost,label:"Disable GPU Boost",tooltip:"Disables GPU Boost, which can help with performance when games compete for GPU resources."},{mode:o5.x7.ForceGPUBoost,label:"Force GPU Boost",tooltip:"Forces GPU Boost, which can help with performance when games compete for GPU resources."},{mode:o5.x7.OverlayRafManagerForceEnabled,label:"Overlay SmartRAF",tooltip:"Creates a widget that has a clickzone inside of it, which will show/hide every few seconds."},{mode:o5.x7.LegacyOverlayLogging,label:"Legacy Overlay Logging",tooltip:"Enables legacy overlay logging, which will forward all legacy logging to the main apps console."}],cC=c.memo(function(){let[e,t]=cg(em.uss.CLICK_ZONE_DEBUG),[a,n]=cg(em.uss.PERFORMANCE_DEBUG),l=(0,d.bG)([o9.A],()=>o9.A.getRenderDebugModes()),[i,s]=c.useState({});return c.useEffect(()=>{let e=setInterval(()=>{s({})},200);return()=>clearInterval(e)},[]),(0,o.jsx)("div",{className:cd.st,children:cS.map(i=>{let s=i.mode===o5.x7.OverlayRafManagerForceEnabled?`${i.label} (${ce.A.getLastRAFCallbackReason()})`:i.label;function r(){return i.mode===o5.x7.ClickZones?null!=e:i.mode===o5.x7.WidgetAreas?null!=a:l.has(i.mode)}return(0,o.jsx)(c.Fragment,{children:(0,o.jsx)(h.d,{checked:r(),onChange:function(){var e;let a=r();i.mode===o5.x7.ClickZones&&t(),i.mode===o5.x7.WidgetAreas&&n(),e=i.mode,oZ.A.setRenderDebugMode(!a,e)},label:s,description:i.tooltip})},i.mode)})})}),c_=c.memo(function(){let e=(0,d.cf)([o4.default],()=>o4.default.getTrackedGames()),t=(0,d.bG)([S.Ay],()=>S.Ay.getRunningGames()).filter(t=>null==e[t.pid]);return(0,o.jsxs)(o.Fragment,{children:[t.length>0&&(0,o.jsx)(id.m,{position:"left",text:"Games that are running but not tracked by the overlay",children:(0,o.jsx)("div",{children:(0,o.jsxs)("div",{className:cd.st,children:[(0,o.jsx)(g.E,{variant:"text-md/bold",color:"text-feedback-critical",children:"Untracked Running Games"}),t.map(e=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-feedback-critical",children:`${e.pid} - ${e.name} (${e.exeName})`},e.pid),(0,o.jsx)(cb,{pid:e.pid})]}))]})})}),(0,o.jsx)(id.m,{position:"left",text:"The current running games process information",children:(0,o.jsx)("div",{children:(0,o.jsxs)("div",{className:cd.st,children:[0===Object.keys(e).length&&(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-default",children:"No running games"}),Object.values(e).map(e=>(0,o.jsx)(cx,{trackedGame:e},e.pid))]})})})]})}),cA=c.memo(function(){let e=(0,d.bG)([o4.default],()=>o4.default.getForcedRenderMode()),[t,a]=c.useState(e),n=[{label:o5.V6.UNSET,value:o5.V6.UNSET,id:o5.V6.UNSET},{label:o5.V6.IN_PROCESS_V2,value:o5.V6.IN_PROCESS_V2,id:o5.V6.IN_PROCESS_V2},{label:o5.V6.OUT_OF_PROCESS_V3,value:o5.V6.OUT_OF_PROCESS_V3,id:o5.V6.OUT_OF_PROCESS_V3},{label:o5.V6.OUT_OF_PROCESS_V3_LIMITED_INTERACTION,value:o5.V6.OUT_OF_PROCESS_V3_LIMITED_INTERACTION,id:o5.V6.OUT_OF_PROCESS_V3_LIMITED_INTERACTION}].map(t=>({...t,label:`${t.label} ${e===t.value?"(current)":""}`}));return(0,o.jsx)(f.l,{label:"Override the overlay render mode",value:t,options:n,onSelectionChange:function(e){a(e),oZ.A.forceRenderMode(e)},selectionMode:"single",fullWidth:!0})});function cN(e){let{modalProps:t,onClose:a}=e,[n,l]=c.useState(null);function i(){a(null)}return(0,o.jsxs)(oH.EO,{size:oH.rI.LARGE,"aria-label":"Breadcrumb Import",...t,transitionState:t.transitionState,parentComponent:"BreadcrumbImportPanel",children:[(0,o.jsxs)(oH.rQ,{align:o1.A.Align.CENTER,justify:o1.A.Justify.BETWEEN,children:[(0,o.jsx)(g.E,{variant:"text-md/bold",color:"text-feedback-critical",children:"Breadcrumb Import"}),(0,o.jsx)(oH.s_,{onClick:i})]}),(0,o.jsx)(oH.$m,{children:(0,o.jsx)("div",{className:cd.st,children:(0,o.jsx)(oz.f,{label:"Paste JSON Here",onChange:l,value:n??"",rows:12})})}),(0,o.jsx)(oH.jl,{children:(0,o.jsxs)(nx.e,{direction:"horizontal-reverse",children:[(0,o.jsx)(p.$,{variant:"primary",text:"Import",onClick:function(){a(n)}}),(0,o.jsx)(p.$,{variant:"secondary",text:"Clear",onClick:i})]})})]})}let ck={native:{label:"Native",filter:e=>e.type===o3.ON.NativeLegacy||e.type===o3.ON.NativeOOP},render:{label:"Render",filter:e=>e.type===o3.ON.Renderer},flux:{label:"Flux",filter:e=>e.type===o3.ON.Flux},client:{label:"Client",filter:e=>e.type===o3.ON.OOPModule||e.type===o3.ON.LegacyModule}};function cI(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o3.QJ.Info;if(t===o3.QJ.Error)return"var(--text-feedback-critical)";switch(e){case o3.ON.NativeLegacy:return"var(--yellow-500)";case o3.ON.NativeOOP:return"var(--green-500)";case o3.ON.Flux:return"var(--brand-400)";case o3.ON.Renderer:return"var(--brand-500)";case o3.ON.LegacyModule:return"var(--yellow-300)";case o3.ON.OOPModule:return"var(--green-300)";default:return"var(--gray-400)"}}let cD=[{key:"type",cellClassName:cd.SZ,renderHeader:()=>null,render(e){let{type:t,logType:a}=e,n=cT(t);return(0,o.jsx)("div",{className:cd.g$,style:{color:cI(t,a)},children:(0,o.jsx)(n,{color:"currentColor",size:"sm"})})}},{key:"Name",cellClassName:cd.Cm,render(e){let{name:t,type:a,logType:n}=e;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(g.E,{variant:"text-md/normal",color:function(e){switch(e){case o3.QJ.Info:return"text-strong";case o3.QJ.Warning:return"text-feedback-warning";case o3.QJ.Error:return"text-feedback-critical";default:return"text-subtle"}}(n),children:t}),(0,o.jsxs)(g.E,{variant:"text-sm/normal",color:"text-subtle",children:["(",a,")"]})]})}},{key:"Timestamp",cellClassName:cd.DK,render(e){let{timestamp:t}=e;return(0,nX.i$)(nB()(t),"h:mm:ss.SSS")}}];function cT(e){switch(e){case o3.ON.NativeLegacy:return oK.W;case o3.ON.NativeOOP:return oY.q;case o3.ON.Renderer:case o3.ON.Flux:return oq.v;case o3.ON.LegacyModule:return oJ.k;case o3.ON.OOPModule:return oQ.o;default:return oJ.k}}function cR(e){return JSON.stringify(e,(e,t)=>void 0===t?null:t,2)}let cw=["__webpack_require__","fn"],cO=["web.js","web.js.map"],cM=[{id:"details",name:"Details",group:nh.fu.NONE,render:e=>{let{breadcrumb:t,onClose:a}=e,{name:n,type:l,logType:i,nativeId:s,stack:r,data:c,timestamp:d,pid:u}=t,m=nB()(d),h=cT(l);return(0,o.jsxs)(v.Ar,{className:cd.bW,children:[(0,o.jsxs)(o2.A,{className:q()(tX.jr,cd.nZ),children:[(0,o.jsx)("div",{style:{color:cI(l,i)},className:cd.nr,children:(0,o.jsx)(h,{color:"currentColor",size:"sm"})}),(0,o.jsxs)(o2.A.Title,{wrapperClassName:cd.qd,children:[n," (",l,")",(0,o.jsx)(J.D,{tag:"span",className:cd.KE,onClick:()=>(0,nQ.C)(n),children:(0,o.jsx)(nV.CopyIcon,{color:"currentColor",size:"sm"})})]}),(0,o.jsx)(o2.A.Icon,{icon:nV.CopyIcon,tooltip:"Copy all properties",onClick:()=>{(0,nQ.C)(cR(t))}}),(0,o.jsx)(o2.A.Icon,{icon:nH.a,tooltip:"Close",onClick:a})]}),(0,o.jsxs)(n9,{className:cd.ZK,children:[(0,o.jsx)(le,{name:"Timestamp",copyValue:m.toISOString(),children:(0,o.jsx)("time",{dateTime:m.toISOString(),title:(0,nX.i$)(m,"LLLL"),children:(0,nX.i$)(m,"L h:mm:ss.SSS")})}),(0,o.jsx)(le,{name:"Log Type",copyValue:i,children:(0,o.jsx)("code",{children:i})}),(0,o.jsx)(le,{name:"PID",copyValue:u?.toString()??"null",children:(0,o.jsx)("code",{children:u?.toString()??"null"})}),(0,o.jsx)(le,{name:"Native ID",copyValue:s?.toString()??"null",children:(0,o.jsx)("code",{children:s?.toString()??"null"})}),(0,o.jsx)(le,{name:"Data",copyValue:cR(c),children:(0,o.jsx)("code",{children:cR(c)})}),null!=r&&(0,o.jsx)(le,{name:"Stack Trace",copyValue:r,children:(0,o.jsx)("code",{children:r.split("\n").map((e,t)=>{let a=e.match(/at (.*) \((.*):(\d+):(\d+)\)/);if(null!=a){let[,e,n,l,i]=a,s=n.split(/[\\/]/).pop();return cw.includes(e.trim())?null:(0,o.jsxs)("div",{children:[(0,o.jsx)("span",{className:cd.e0,children:e.trim()}),!cO.includes(s??"")&&(0,o.jsxs)(o.Fragment,{children:[" (",(0,o.jsxs)("span",{className:cd.lz,title:n,children:[s,":",l,":",i]}),")"]})]},t)}return(0,o.jsx)("div",{children:e},t)})})})]})]})}}],cP={searchType:nq.n.REGEX,searchStringGenerator:e=>{let{name:t,type:a,stack:n,data:l}=e,i=[t,a,JSON.stringify(l)];return null!=n&&i.push(n),i},throttleMs:100};function cL(){let{ref:e,height:t}=(0,o0.Ay)(),a=(0,d.bG)([o9.A],()=>o9.A.isModuleLoggingEnabled()),[n,l]=c.useState(a),[i,s]=c.useState(!1),[r,u]=c.useState(null),[m,h]=c.useState(Object.keys(ck)),[x,p]=(0,d.bG)([o9.A],()=>o9.A.getOverlayLoggingBreadcrumbs(),[],cs.D),[v,j]=c.useState(null),f=v??x,b=null!=v?-1:p;c.useEffect(()=>{0!==b&&(i?u(f.reduce((e,t)=>"game_tracking_starting"===t.name?Math.max(e,t.timestamp):e,0)):u(null))},[i,f,b]);let[y,E]=c.useState(""),S=c.useMemo(()=>0===b?[]:f.filter(e=>{if(i&&null!=r&&e.timestamp<r)return!1;for(let t of m){let{filter:a}=ck[t];if(a(e))return!0}return!1}),[f,m,r,i,b]),[C,_]=c.useState(S),[A,N]=c.useState(null),k=c.useMemo(()=>f.find(e=>e.key===A),[f,A]),I=c.useCallback(e=>{_(e)},[]),{renderSelectedTab:D}=(0,nm.A)({tabs:cM},[]);(0,nJ.RT)(y,S,I,cP,[f]);let T=c.useCallback(e=>{l(e),oZ.A.setModuleLogging(e)},[]),[R,w]=c.useState(!1),O=c.useRef(null),M=c.useCallback(()=>{(0,nQ.C)(JSON.stringify(S)),w(!0)},[S]);c.useEffect(()=>{if(R)return O.current=setTimeout(()=>{w(!1)},4e3),()=>{null!=O.current&&clearTimeout(O.current)}},[R]);let P=c.useCallback(e=>{j(null!=e?JSON.parse(e):null)},[]),L=c.useCallback(e=>{if(e)return j(null);(0,eY.openModal)(e=>(0,o.jsx)(cN,{modalProps:e,onClose:t=>{P(t),e.onClose()}}),{modalKey:"breadcrumb-import-panel"},eJ.SY)},[P]);return(0,o.jsxs)("div",{ref:e,className:cd.rh,children:[(0,o.jsxs)("div",{className:cd.st,children:[(0,o.jsxs)("div",{className:q()(cd._V,cd.XQ),children:[(0,o.jsx)("div",{title:"Toggles the Polling of Native",className:cd.iR,children:(0,o.jsx)(oh.S,{label:"Poll Native",checked:n,onChange:e=>T(e)})}),(0,o.jsx)("div",{title:"Only show breadcrumbs for active games",className:cd.iR,children:(0,o.jsx)(oh.S,{label:"Only Active Games",checked:i,onChange:e=>s(e)})}),(0,o.jsxs)(J.D,{className:cd.ny,onClick:M,children:[(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"text-subtle",children:R?"Copied":"Copy All"}),R?(0,o.jsx)(oy.CheckmarkLargeIcon,{size:"sm",color:eq.A.unsafe_rawColors.GREEN_330.css}):(0,o.jsx)(nV.CopyIcon,{color:"currentColor",size:"sm"})]}),(0,o.jsx)(J.D,{className:cd.ny,onClick:()=>L(null!=v),children:(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"currentColor",children:null!=v?"Clear":"Import"})})]}),(0,o.jsx)("div",{className:q()(cd._V,cd.XQ),children:Object.entries(ck).map(e=>{let[t,a]=e;return(0,o.jsx)(J.D,{className:q()(cd.pb,m.includes(t)&&cd.bx),onClick:()=>{h(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},children:(0,o.jsx)(g.E,{variant:"text-sm/normal",color:"currentColor",children:a.label})},t)})}),(0,o.jsx)("div",{className:cd._V,children:(0,o.jsx)(nK.I,{query:y,onChange:E,onClear:()=>E(""),placeholder:"Regex search by breadcrumb name and data"})})]}),(0,o.jsx)("div",{className:q()(cd.st,cd.CZ),children:(0,o.jsx)(tZ,{columns:cD,data:C,selectedRowKey:A??void 0,onClickRow:e=>N(e.key)})}),null!=k&&(0,o.jsx)(nu,{className:q()(cd.st,cd.rf),minHeight:100,initialHeight:null!=t?t/3:300,children:D({breadcrumb:k,onClose:()=>N(null)})})]})}let cU=c.memo(function(){let e=(0,d.bG)([o8.A],()=>o8.A.getPopoutInitializationStages());return(0,o.jsxs)("div",{className:cd.st,children:[(0,o.jsx)("div",{className:cd.Iv,children:(0,o.jsx