Loading
function(e,t,r){r.r(t),r.d(t,{default:()=>eT});var n=r(477900),a=r(582128),i=r(853757);r(321073),r(667532);var s=r(435558),l=r.n(s),o=r(855986),d=r(97808),u=r(778712),c=r(534514),m=r(233545),p=r(83257),h=r(361739),y=r(47167),f=r(235986),F=r(97469),g=r(413599),A=r(734057),D=r(696451),b=r(495867),v=r(412780),E=r(994500),x=r(287809),C=r(427262),S=r(289873),R=r(331322),j=r(503698),P=r.n(j),N=r(23339),k=r(691885),I=r(761508),B=r(684339),w=r(259264),M=r(754712);r(134528),r(947204);var T=r(796873),G=r.n(T),L=r(229659),U=r(646514),O=r(707554),q=r(404778),W=r(603349),$=r(378885);let V=["firCount","nackCount"];class H extends a.PureComponent{renderValueIcon(){let{label:e}=this.props;return V.includes(e)?(0,n.jsx)(W.A,{color:U.A.unsafe_rawColors.YELLOW_300.css,className:$.nm}):null}render(){let{children:e,className:t,valueRendered:r,section:a,label:i,renderGraph:s}=this.props;return(0,n.jsxs)(f.A,{className:P()($.AS,t),direction:f.A.Direction.VERTICAL,basis:"50%",children:[(0,n.jsxs)(f.A,{className:$.l5,align:f.A.Align.START,children:[(0,n.jsx)(f.A.Child,{children:(0,n.jsx)(O.H,{className:$.DD,children:e})}),Array.isArray(r)?(0,n.jsx)(f.A.Child,{grow:1,wrap:!0,children:r}):(0,n.jsxs)(f.A.Child,{grow:0,shrink:0,children:[this.renderValueIcon(),(0,n.jsx)("span",{className:$.R$,title:r,children:r})]})]}),null!==s&&(0,n.jsx)(f.A.Child,{className:$.JB,children:s},null!=a?`${a}-${i}`:i),(0,n.jsx)(q.c,{className:$.yF})]})}}let K={accelerateRate:"Accelerate Rate",activityFrames:"Activity GPU Frames",activityFramesDropped:"Activity GPU Frames Dropped",audioDetected:"Audio Detected",audioLevel:"Audio Level",availableOutgoingBitrate:"Available Outgoing Bitrate",averageDecodeTime:"Average Decode Time",averageEncodeTime:"Average Encode Time",bandwidthLimitedFrameRate:"Bandwidth Limited Frame Rate",bandwidthLimitedResolution:"Bandwidth Limited Resolution",bitrate:"Bitrate",bitrateTarget:"Bitrate (Target)",bytesReceived:"Bytes Received",bytesSent:"Bytes Sent",capturedFramesCount:"Captured Frames per Second",capturedFramesDropped:"Captured Frames Dropped",capturedFramesMean:"Captured Frames Mean",capturedFramesStdev:"Captured Frames Standard Deviation",codec:"Codec",cpuLimitedResolution:"CPU Limited Resolution",currentDelay:"Current Delay",currentSampleRate:"Current Sample Rate",decoderImplementationName:"Decoder",decodingCNG:"Decoding CNG",decodingMutedOutput:"Decoding Muted Output",decodingNormal:"Decoding Normal",decodingPLC:"Decoding PLC",decodingPLCCNG:"Decoding PLC CNG",decryptFailureCount:"Decrypt Failures",decryptionFailures:"Decryption Failures",decryptSuccessCount:"Decrypt Successes",delayEstimate:"Delay Estimate",encoderImplementationName:"Encoder",encoderQualityPsnr:"Encoder PSNR",encoderQualityVmaf:"Encoder VMAF",encodeUsage:"Encode Usage",encryptFailureCount:"Encrypt Failures",encryptSuccessCount:"Encrypt Successes",expandRate:"Expand Rate",fecPacketsDiscarded:"FEC Packets Discarded",fecPacketsReceived:"FEC Packets Received",filter:"Filter",firCount:"FIR",fractionLost:"Packet Loss",frameRateDecode:"Frame Rate (Decode)",frameRateEncode:"Frame Rate (Encode)",frameRateInput:"Frame Rate (Input)",frameRateNetwork:"Frame Rate (Network)",frameRateRender:"Frame Rate (Render)",framesDecoded:"Frames Decoded",framesDecodeErrors:"Decoder Error Count",framesDropped:"Frames Dropped",framesDroppedCongestionWindow:"Frames Dropped by Congestion Window",framesDroppedEncoder:"Frames Dropped by Encoder",framesDroppedEncoderQueue:"Frames Dropped by Encoder Queue",framesDroppedRateLimiter:"Frames Dropped by Bitrate Limiter",framesEncoded:"Frames Encoded",framesReceived:"Frames Received",framesSent:"Frames Sent",freezeCount:"Freeze Count",hdrFrames:"HDR Frames",hostname:"Hostname",hybridCaptureMethodSwitches:"Hybrid Capture Method Switches",hybridDxgiFrames:"Hybrid DXGI Frames",hybridExternalFrames:"Hybrid External Frames",hybridGdiBitBltFrames:"Hybrid GDI BitBlt Frames",hybridGdiFrames:"Hybrid GDI Frames",hybridGdiPrintWindowFrames:"Hybrid GDI PrintWindow Frames",hybridGraphicsCaptureFrames:"Hybrid Graphics Capture Frames",hybridVideohookFrames:"Hybrid Videohook Frames",inboundBitrateEstimate:"Inbound Bitrate Estimate",jitter:"Jitter",jitterBuffer:"Jitter Buffer",jitterBufferPreferred:"Jitter Buffer (Preferred)",keyFrameInterval:"Key Frame Interval",keyFramesDecoded:"Key Frames Decoded",keyFramesEncoded:"Key Frames Encoded",localAddress:"Local Address",minPlayoutDelay:"Minimum Playout Delay",nackCount:"NACK",networkFramesDropped:"Frames Dropped By Network",opAccelerate:"Accelerated Frames",opCNG:"CNG Frames",opExpand:"Expand Frames",opMerge:"Merge Frames",opNormal:"Normal Frames",opPreemptiveExpand:"Preemptive Expand Frames",opSilence:"Silent Frames",outboundBitrateEstimate:"Outbound Bitrate Estimate",outputDeviceUnderruns:"Output Device Underruns",pacerDelay:"Pacer Delay",packetsLost:"Packets Lost",packetsReceived:"Packets Received",packetsSent:"Packets Sent",passthroughCount:"Passthrough",pauseCount:"Pause Count",ping:"Ping",pliCount:"PLI",powerEfficientDecoder:"Power Efficient Decoder",powerEfficientEncoder:"Power Efficient Encoder",preemptiveExpandRate:"Pre-emptive Expand Rate",qpSum:"QP Sum",qualityDecodeErrors:"Encoder Quality Decode Errors",qualityDecoderReboots:"Encoder Quality Decoder Reboots",qualityFrameDrops:"Encoder Quality Frame Drops",qualityScoreErrors:"Encoder Quality Score Errors",qualitySizeMismatches:"Encoder Quality Size Mismatches",quartzFrames:"Quartz Frames",receiverBitrateEstimate:"Receiver Bitrate Estimate (REMB)",relativePlayoutDelay:"Relative Playout Delay",relativeReceptionDelay:"Relative Reception Delay",renderDelay:"Render Delay",resolution:"Resolution",routingFailures:"Routing Failures",sampleRateMismatchPercent:"Sample Rate Mismatch",screenCaptureKitFrames:"ScreenCaptureKit frames",screenshareCapturedFps:"Captured FPS",screenshareCapturedFpsUnique:"Unique Captured FPS",screenshareFrames:"WebRTC Frames",secondaryDecodedRate:"Secondary Decode Rate",secureFramesProtocolVersion:"DAVE Protocol",sinkWant:"Sink Quality Level (Remote)",sinkWantLocal:"Sink Quality Level (Local)",speechExpandRate:"Speech Expand Rate",ssrc:"SSRC",targetDelay:"Target Delay",totalFramesDuration:"Frames Duration",totalFreezesDuration:"Freezes Duration",totalPausesDuration:"Pauses Duration",videoEntropy:"Video Entropy",videohookBackend:"Videohook Backend",videohookFrames:"Videohook Frames",voiceQualityMos:"Voice Quality (mean DNSMOS)",x11Frames:"X11 Frames",pipewireFrames:"Pipewire Frames"};function z(e){return`${(e/1e3).toFixed(2)} Kbps`}function Q(e){return G().filesize(e)}function J(e){return e}function _(e){return`${e} ms`}function X(e){return`${e.toFixed(0)}%`}function Y(e){return e?"Yes":"No"}function Z(e){return 20*Math.log(e)}function ee(e){let{last:t}=e;return`${t} ms`}function et(e){return e.toFixed(2)}let er={apmFrameCount:!0,apmProcessTimeMs:!0,audioJitterBuffer:!0,audioJitterBufferSamples:!0,audioJitterDelay:!0,audioJitterDelaySamples:!0,audioJitterTarget:!0,audioJitterTargetSamples:!0,audioPlayoutUnderruns:!0,audioReceiverDelayMs:!0,audioReceiverPacketCount:!0,captureProcessingDelayMs:!0,captureProcessingFrameCount:!0,consecutiveStaticColorFrames:!0,decryptAttempts:!0,decryptDuration:!0,decryptInvalidNonceCount:!0,decryptMissingKeyCount:!0,encryptAttempts:!0,encryptDuration:!0,encryptMaxAttempts:!0,encryptMissingKeyCount:!0,fractionLost:!0,framesCaptured:!0,framesDecodeErrorsFallback:!0,framesDecodeErrorsGeneric:!0,framesDecodeErrorsNoOutput:!0,framesDecodeErrorsOther:!0,framesDecodeErrorsParameter:!0,framesDecodeErrorsTimeout:!0,framesRendered:!0,hqSimulcastStreamEncoded:!0,lqSimulcastStreamEncoded:!0,noiseCancellerFrames:!0,noiseCancellerProcessTime:!0,sendDelayMs:!0,sendPacketCount:!0,sinkWantAsInt:!0,sinkWantLocalAsInt:!0,skipHistoryJson:!0,sumOfSquaredFramesDurations:!0,targetWindowElevated:!0,timestamp:!0,totalDecodeTime:!0,totalPacketSendDelayMs:!0,transportDelayMs:!0,transportPacketCount:!0,type:!0,videoJitterBuffer:!0,videoJitterDelay:!0,videoJitterTarget:!0,voiceActivityDetectorProcessTime:!0,voiceQuality:!0},en={accelerateRate:X,audioDetected:Y,audioLevel:function(e){return e<=0?"-\u221E dB":`${Z(e).toFixed(2)} dB`},availableOutgoingBitrate:z,averageDecodeTime:_,averageEncodeTime:_,bandwidthLimitedFrameRate:Y,bandwidthLimitedResolution:Y,bitrate:z,bitrateTarget:z,bytesReceived:Q,bytesSent:Q,capturedFramesMean:_,capturedFramesStdev:_,codec:function(e){let{id:t,name:r}=e;return r=(r=""===r?"unknown":r)??"unknown",`${r[0].toUpperCase()}${r.slice(1)} (${t})`},cpuLimitedResolution:Y,currentDelay:_,currentSampleRate:function(e){return e%100==0?`${e/1e3} kHz`:`${e} Hz`},decoderImplementationName:J,delayEstimate:_,encoderImplementationName:J,encoderQualityPsnr:function(e){return`${Math.max(e,0).toFixed(2)} dB`},encoderQualityVmaf:et,encoderReady:Y,encodeUsage:X,expandRate:X,filter:J,fractionLost:X,inboundBitrateEstimate:z,jitter:_,jitterBuffer:_,jitterBufferPreferred:_,keyFrameInterval:_,minPlayoutDelay:_,outboundBitrateEstimate:z,pacerDelay:_,ping:_,powerEfficientDecoder:Y,powerEfficientEncoder:Y,preemptiveExpandRate:X,processRunning:Y,receiverBitrateEstimate:z,relativePlayoutDelay:ee,relativeReceptionDelay:ee,renderDelay:_,resolution:e=>{let{width:t,height:r}=e;return`${t}x${r}`},sampleRateMismatchPercent:X,screenshareCapturedFps:et,screenshareCapturedFpsUnique:et,secondaryDecodedRate:X,secureFramesProtocolVersion:function(e){return e>0?`Version ${e}`:"Disabled"},speechExpandRate:X,targetDelay:_,totalFramesDuration:_,totalFreezesDuration:_,totalPausesDuration:_,videoEntropy:et,videohookBackend:function(e){let t=["N/A","Direct3D 9","Direct3D 10","Direct3D 11","Direct3D 12","OpenGL","Vulkan"];return e<t.length?t[e]:"Unknown"},voiceQualityMos:et},ea={audioLevel:function(e){return Math.max(Z(e),-100)+100}};function ei(e){return e}let es=e=>{let[t]=a.useState([]);return t.push({value:e.value,time:Date.now()}),t.length>600&&t.shift(),(0,n.jsx)(L.A,{converter:e.converter,dataPoints:t,width:e.width,height:e.height})};function el(e){let{label:t,value:r,section:a}=e,i=en[t]??ei,s=ea[t],l=v.iA[t]&&(Array.isArray(r)&&r.length>0&&"number"==typeof r[0].value?(0,n.jsx)(L.A,{converter:s,dataPoints:r,width:300,height:100}):"number"==typeof r?(0,n.jsx)(es,{converter:s,value:r,width:300,height:100}):void 0),o=Array.isArray(r)?r.at(-1)?.value:r;return(0,n.jsx)(H,{label:t,valueRendered:i(o),section:a,renderGraph:l,children:K[t]??t})}var eo=r(731854),ed=r(221851);let eu={[eo.r8.NO_OVERRIDE]:"None",[eo.r8.LOW]:"Low Quality Stream",[eo.r8.HIGH]:"High Quality Stream"};function ec(e){let t=[],r=0;for(e.length%2!=0&&e.push((0,n.jsx)(f.A,{basis:"50%",grow:0},r++));e.length>0;)t.push((0,n.jsx)(f.A,{basis:"50%",grow:0,children:e.splice(0,2)},r++));return t}let em={ssrc:1,codec:2};function ep(e){let{streams:t,context:r,mediaEngineConnectionId:i,userId:s,videoStreams:l,title:d,showUserInfo:u=!1,showSimulcastOverride:p=!1}=e,[h,y]=a.useState("0"),F=(0,o.bG)([b.A],()=>u?b.A.getGuildId():null),g=(0,o.bG)([x.default],()=>u&&null!=s?x.default.getUser(s):null),A=(0,o.bG)([D.Ay],()=>u&&null!=F&&null!=s?D.Ay.getNick(F,s):null);if(null==t||u&&null==s||0===t.length)return(0,n.jsx)(S.y,{type:S.y.Type.SPINNING_CIRCLE});let E=d;u&&null!=g&&(E=`${d} \u{2014} ${A??C.Ay.getName(g)}`);let j=t.map((e,t)=>{let r,a;return(0,n.jsx)(I.V.Item,{id:t.toString(),children:(r=(0,N.$G)(e.type),a="","resolution"in e&&null!=e.resolution&&0!==e.resolution.width&&0!==e.resolution.height&&(a=` (${e.resolution.width}x${e.resolution.height})`),r+a)},t.toString())}),T=Math.min(parseInt(h,10),t.length-1),G=t[T],L=function(e,t,r,a){let i,s=[];for(let t of Object.keys(e).sort((e,t)=>{let r=em[e],n=em[t];return r!==n?void 0===r?1:void 0===n?-1:r-n:v.iA[e]!==v.iA[t]?v.iA[e]?1:-1:e>t?1:-1})){let a=e[t];er[t]||void 0===a||s.push((0,n.jsx)(el,{section:r,label:t,value:a},t))}return(0,n.jsxs)("div",{className:ed.C2,children:["video"===e.type&&null!=t&&null!=r&&null!=a&&(null!=(i=a.get(t,r,e.ssrc))?(0,n.jsx)("div",{className:P()($.tN,ed.C2),children:(0,n.jsx)(w.A,{streamId:i,videoComponent:M.Ay.getMediaEngine().Video,paused:!1,videoSpinnerContext:B.u.REPLAY_VIDEO_STREAM,userId:r})}):null),ec(s)]},`${e.type} + ${e.ssrc}`)}(G,i,s,l),U=p&&"video"===G.type&&null!=i&&null!=s&&null!=l&&r===eo.x.DEFAULT&&(0,n.jsx)(f.A,{className:ed.SX,children:(0,n.jsx)(f.A.Child,{basis:"100%",children:(0,n.jsx)(k.l,{label:"Simulcast Override",value:v.Ay.getSimulcastDebugOverride(s,r),onSelectionChange:e=>{m.z0(s,r,e)},options:Object.values(eo.r8).map(e=>({id:e,value:e,label:eu[e]})),selectionMode:"single",fullWidth:!0})})});return(0,n.jsxs)(R.B,{gap:16,children:[(0,n.jsx)(c.D,{variant:"heading-sm/medium",children:E}),(0,n.jsx)(I.V,{type:"top",look:"brand",selectedItem:h,onItemSelect:y,className:$.$H,children:j}),L,U]})}var eh=r(792996);function ey(e){let{camera:t}=e;if(null==t)return(0,n.jsx)(S.y,{type:S.y.Type.SPINNING_CIRCLE});let r=l().map(t,(e,t)=>{if(!(er[t]||void 0===e))return(0,n.jsx)(el,{label:t,value:e},t)});return(0,n.jsxs)(R.B,{children:[(0,n.jsx)(c.D,{variant:"heading-sm/medium",children:eh.intl.string(eh.t["2AGBWH"])}),ec(r)]})}let ef={userId:1,dataType:2,savedKB:3,numFrames:4,startTimestampMs:5,endTimestampMs:6,width:7,height:8,audioChannels:9,sampleRate:10},eF={processRunning:1,encoderReady:2,encodeWidth:3,encodeHeight:4,encodeFps:5,measuredFps:6,encoderImplementationName:7,referenceBitrateKbps:8,bitrateKbps:9,maxBitrateKbps:10,submittedFrames:11,encodedFrames:12,droppedFrames:13,recentEncodedFrames:14,recentDroppedFrames:15,recentDurationMs:16,clipDurationMs:17,totalSavedKB:18};function eg(e,t){return Object.keys(e).sort((e,r)=>{let n=t[e],a=t[r];return n!==a?void 0===n?1:void 0===a?-1:n-a:e>r?1:-1})}function eA(e){let{clips:t}=e;if(null==t)return(0,n.jsx)(S.y,{type:S.y.Type.SPINNING_CIRCLE});let r=function(e){let t=[];for(let r of eg(e,eF)){let a=e[r];void 0!==a&&"buffers"!==r&&("bitrateKbps"===r&&t.length%2!=0&&t.push((0,n.jsx)(f.A,{basis:"50%",grow:0},"bitrate-alignment")),t.push((0,n.jsx)(el,{label:r,value:a},r)))}return t}(t);return null!=t.recentEncodedFrames&&null!=t.recentDurationMs&&t.recentDurationMs>0&&r.push((0,n.jsx)(el,{label:"Frames Per Second",value:t.recentEncodedFrames/(t.recentDurationMs/1e3)},"framerate")),(0,n.jsxs)(R.B,{children:[(0,n.jsx)(c.D,{variant:"heading-sm/medium",children:eh.intl.string(eh.t.MKrFKE)}),ec(r),function(e){if(null!=e.buffers)return e.buffers.map(e=>{let t=[];for(let r of eg(e,ef)){let a=e[r];null!==a&&"key"!==r&&t.push((0,n.jsx)(el,{label:r,value:a},r))}return(0,n.jsxs)("div",{className:ed.C2,children:[(0,n.jsx)(c.D,{variant:"heading-sm/medium",children:`Buffer: ${e.key}`}),ec(t)]},`Buffer: ${e.key}`)})}(t)]})}let eD=o.Ay.connectStores([v.Ay],e=>{let{context:t,index:r,videoStreams:n}=e,a=v.Ay.getAllStats(t)[r],{section:i}=(0,v.Bz)(v.Ay.getSection());if(null==i)throw Error("Unrecognized section format");let s=null;return null!=a&&null!=a.rtp.inbound&&(s=a.rtp.inbound[i]??[]),{mediaEngineConnectionId:a?.mediaEngineConnectionId,userId:i,streams:s,videoStreams:n}})(function(e){let{streams:t,context:r,index:a,userId:i,mediaEngineConnectionId:s,videoStreams:l}=e;return(0,n.jsx)(ep,{streams:t,context:r,index:a,mediaEngineConnectionId:s,userId:i,videoStreams:l,title:eh.intl.string(eh.t.SJmZaq),showUserInfo:!0})}),eb=o.Ay.connectStores([v.Ay],e=>{let{context:t,index:r}=e,n=v.Ay.getAllStats(t)[r];return{outbound:null!=n?n.rtp.outbound:null}})(function(e){let{outbound:t,context:r,index:a}=e;return(0,n.jsx)(ep,{streams:t,context:r,index:a,title:eh.intl.string(eh.t["3u0gII"]),showUserInfo:!1,showSimulcastOverride:!1})}),ev={activityFrames:{key:"activityFramesConsumed",suffix:"Consumed"},hdrFrames:{key:"hdrFramesCapable",suffix:"Capable"},hybridDxgiFrames:{key:"hybridDxgiFramesUnique",suffix:"Unique"},hybridExternalFrames:{key:"hybridExternalFramesUnique",suffix:"Unique"},hybridGdiBitBltFrames:{key:"hybridGdiBitBltFramesUnique",suffix:"Unique"},hybridGdiPrintWindowFrames:{key:"hybridGdiPrintWindowFramesUnique",suffix:"Unique"},hybridGraphicsCaptureFrames:{key:"hybridGraphicsCaptureFramesUnique",suffix:"Unique"},hybridVideohookFrames:{key:"hybridVideohookFramesUnique",suffix:"Unique"}},eE=["activityFrames","activityFramesDropped","hdrFrames","hybridCaptureMethodSwitches","hybridDxgiFrames","hybridExternalFrames","hybridGdiBitBltFrames","hybridGdiPrintWindowFrames","hybridGraphicsCaptureFrames","hybridVideohookFrames","hybridGdiFrames","quartzFrames","screenCaptureKitFrames","screenshareFrames","videohookFrames","videohookBackend","screenshareCapturedFps","screenshareCapturedFpsUnique","x11Frames","pipewireFrames"],ex=new Set([...eE,...Object.values(ev).map(e=>e.key)]);class eC extends a.PureComponent{render(){let{screenshare:e}=this.props;return null==e?(0,n.jsx)(S.y,{type:S.y.Type.SPINNING_CIRCLE}):(0,n.jsxs)(R.B,{children:[(0,n.jsx)(c.D,{variant:"heading-sm/medium",children:eh.intl.string(eh.t["gWbr/U"])}),ec(function(e){let t=null!=e.hybridGdiBitBltFrames&&null!=e.hybridGdiPrintWindowFrames,r=[];for(let a of eE){if("hybridGdiFrames"===a&&t)continue;let i=e[a];if(void 0===i)continue;let s=ev[a],l=null!=s?e[s.key]:void 0;null!=s&&void 0!==l?r.push((0,n.jsx)(H,{label:a,valueRendered:`${i} (${l})`,renderGraph:null,children:`${K[a]??a} (${s.suffix})`},a)):r.push((0,n.jsx)(el,{label:a,value:i},a))}for(let[t,a]of Object.entries(e))ex.has(t)||er[t]||void 0===a||r.push((0,n.jsx)(el,{label:t,value:a},t));return r}(e))]})}}var eS=r(967198),eR=r(753181),ej=r(351906),eP=r(562153),eN=r(917592);class ek extends a.PureComponent{render(){let{transport:e,outputDeviceUnderruns:t,mediaSessionId:r,hidePersonalInformation:a,hostname:i}=this.props;if(null==e)return(0,n.jsx)(S.y,{type:S.y.Type.SPINNING_CIRCLE});let s={...e,hostname:i,...null!=t&&{outputDeviceUnderruns:t}},o=l().map(s,(e,t)=>{if("receiverReports"!==t&&!er[t]&&(!a||"localAddress"!==t))return(0,n.jsx)(el,{label:t,value:e},t)}),d=new Map;l().forEach(s.receiverReports,e=>{let t=Array.isArray(e.bitrate)?e.bitrate.at(-1)?.value:e.bitrate,r=d.get(e.id)??{};null!=t&&(r.bitrate=t/1e3),null!=e.fractionLost&&(r.lost=100*e.fractionLost/256),null!=e.rtt&&(r.rtt=e.rtt),d.set(e.id,r)});let u=Array.from(d,e=>{let[t,r]=e,n=x.default.getUser(t);var a=eP.Ay.getNickname(eS.A.getGuildId(),void 0,n);return null==a&&(a=null!=n?n.username:t),{id:t,displayName:a,...r}}),m=l().sortBy(u,e=>e.displayName),p=l().map(m,function(e){let{id:t,displayName:r,bitrate:a,lost:i,rtt:s}=e,l=[];return null!=a&&l.push((0,n.jsxs)(f.A,{className:$.A0,justify:f.A.Justify.BETWEEN,children:[(0,n.jsx)("span",{children:"Bitrate:"}),(0,n.jsxs)("span",{children:[a.toFixed(0)," Kbps"]})]},"bitrate")),null!=i&&l.push((0,n.jsxs)(f.A,{className:$.A0,justify:f.A.Justify.BETWEEN,children:[(0,n.jsx)("span",{children:"Packet Loss:"}),(0,n.jsxs)("span",{children:[i.toFixed(0),"%"]})]},"lost")),null!=s&&l.push((0,n.jsxs)(f.A,{className:$.A0,justify:f.A.Justify.BETWEEN,children:[(0,n.jsx)("span",{children:"RTT:"}),(0,n.jsx)("span",{children:s>0?`${s} ms`:"-"})]},"rtt")),(0,n.jsx)(H,{label:r,valueRendered:l,children:r},t)});return(0,n.jsxs)(R.B,{className:$._8,children:[(0,n.jsx)(c.D,{variant:"heading-sm/medium",children:eh.intl.string(eh.t.wU9IN2)+(null!=r?" - "+r:"")}),ec(o),0===p.length?null:(0,n.jsx)(q.c,{className:ed.SX}),ec(p)]})}}let eI=o.Ay.connectStores([v.Ay,b.A,ej.A,eR.A],e=>{let{context:t,index:r}=e,n=v.Ay.getAllStats(t)[r],a=t===eo.x.STREAM?Object.values(eR.A.getRTCConnections()).find(e=>e.getMediaEngineConnectionId()===n.mediaEngineConnectionId)?.hostname:b.A.getHostname();return{hidePersonalInformation:ej.A.hidePersonalInformation,transport:null!=n?n.transport:null,outputDeviceUnderruns:n?.audioDevice?.output?.bufferViolations,mediaSessionId:b.A.getMediaSessionId(),hostname:eN.A.getShortHostname(a)}})(ek);var eB=r(652215);function ew(e,t,r,a,i){let s=[];if(null==t)return s;let{transport:o,rtp:{inbound:c,outbound:p},camera:y}=t;if(s.push({section:h.Fq.HEADER,label:eh.intl.formatToPlainString(eh.t.PK5fOC,{context:e})}),null!=o&&s.push({section:(0,v.Xi)(e,eB.zWA.TRANSPORT,r),label:eh.intl.string(eh.t.wU9IN2),element:eI,elementProps:{context:e,index:r}}),null==p||l().isEmpty(p)||s.push({section:(0,v.Xi)(e,eB.zWA.OUTBOUND,r),label:eh.intl.string(eh.t["3u0gII"]),element:eb,elementProps:{context:e,index:r}}),null!=y&&s.push({section:(0,v.Xi)(e,eB.zWA.CAMERA,r),label:eh.intl.string(eh.t["2AGBWH"]),element:ey,elementProps:{context:e,index:r,camera:y}}),null!=c&&!l().isEmpty(c)){let t=[];Object.keys(c).forEach(s=>{var l;let o=x.default.getUser(s),p=D.Ay.getNick(i,s),h=(0,v.Xi)(e,s,r);null!=c[s]&&c[s].length>0&&t.push({section:h,label:null!=o?(0,n.jsx)(f.A,{align:f.A.Align.CENTER,children:(0,n.jsx)(f.A.Child,{children:(0,n.jsxs)(f.A,{align:f.A.Align.CENTER,children:[(0,n.jsx)(d.eu,{size:u._3.SIZE_24,src:o.getAvatarURL(i,24),"aria-label":o.username,className:$.my}),(0,n.jsx)("span",{className:$.Xh,children:p??C.Ay.getName(o)})]})})}):(l=p??s,(0,n.jsx)(f.A,{align:f.A.Align.CENTER,children:(0,n.jsx)(f.A.Child,{children:(0,n.jsx)(f.A,{align:f.A.Align.CENTER,children:(0,n.jsx)("span",{className:$.Xh,children:l})})})})),ariaLabel:null!=o?o.tag:s,onClick:()=>{m.c4(h)},element:eD,elementProps:{context:e,index:r,videoStreams:a}})}),t.length>0&&(s.push({section:h.Fq.HEADER,label:eh.intl.string(eh.t.SJmZaq)}),s.push(...t))}return s}function eM(){let{defaultStats:e,streamStats:t}=(0,o.bG)([v.Ay],()=>({defaultStats:v.Ay.getAllStats(eo.x.DEFAULT),streamStats:v.Ay.getAllStats(eo.x.STREAM)}),[],o.My),r=(0,o.bG)([b.A,A.A],()=>A.A.getChannel(b.A.getChannelId())),i=e.concat(t).find(e=>null!=e.screenshare)?.screenshare,s=t.find(e=>null!=e.clips)?.clips,l=(0,o.bG)([g.A],()=>g.A.theme),d=(0,F.NC)(),u=(0,o.bG)([v.Ay],()=>v.Ay.getSection()),f=function(e){let{defaultStats:t,streamStats:r,videoStreams:a,screenshare:i,clips:s,channel:l,connectionState:o}=e,d=t.flatMap((e,t)=>ew(eo.x.DEFAULT,e,t,a,l?.getGuildId())),u=r.flatMap((e,t)=>ew(eo.x.STREAM,e,t,a,l?.getGuildId())),m=[],p=[],f={section:h.Fq.DIVIDER};null!=i&&(m.push(f),m.push({section:eB.zWA.SCREENSHARE,label:eh.intl.string(eh.t["gWbr/U"]),element:eC,elementProps:{screenshare:i}})),null!=s&&(p.push(f),p.push({section:eB.zWA.CLIPS,label:eh.intl.string(eh.t.MKrFKE),element:eA,elementProps:{clips:s}})),u.length>0&&u.unshift(f);let F=null!=l?[{section:h.Fq.CUSTOM,label:"Channel Name",element:()=>(0,n.jsx)(c.D,{className:$.HA,variant:"heading-lg/semibold",children:(0,y.m1)(l,x.default,E.A)})}]:[],g=[{section:h.Fq.CUSTOM,label:"Connection State",element:()=>(0,n.jsx)(c.D,{className:$.HA,variant:"heading-sm/medium",children:o===eB.S7L.RTC_CONNECTED?"Connected":"Disconnected"})}];return[...F,...g,...d,...u,...m,...p]}({defaultStats:e,streamStats:t,videoStreams:(0,o.bG)([v.Ay],()=>v.Ay.getVideoStreams()),screenshare:i,clips:s,channel:r,connectionState:(0,o.bG)([b.A],()=>b.A.getState())});return a.useEffect(()=>()=>{m.VN()},[]),a.useEffect(()=>{f.some(e=>e.section===u)||u===v.EM||m.c4(v.EM)},[f,u]),(0,n.jsx)(p.A,{theme:l,sidebarTheme:d,section:u,onSetSection:m.c4,sections:f})}function eT(e){let{windowKey:t}=e;return(0,n.jsx)(i.A,{withTitleBar:!0,windowKey:t,title:eh.intl.string(eh.t["5I/1fl"]),children:(0,n.jsx)(eM,{})})}}