@yang__yj/pixelstreaming-core 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1,2 @@
1
- import*as e from"sdp";var t,s,n={d:(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},r={};n.d(r,{Dz:()=>Ee,g$:()=>F,Lt:()=>L,Q9:()=>A,qf:()=>x,hV:()=>Ae,z$:()=>Pe,J0:()=>Re,De:()=>fe,$C:()=>Te,al:()=>H,_W:()=>W,Gv:()=>se,m:()=>ne,tz:()=>_,Nu:()=>be,zg:()=>We,vp:()=>ce,vU:()=>he,wF:()=>Y,rv:()=>Me,Nh:()=>we,ss:()=>_e,qW:()=>re,QL:()=>te,cf:()=>Ne,eM:()=>J,Yd:()=>i,Tk:()=>Ue,iM:()=>p,qy:()=>a,ce:()=>C,sK:()=>ue,Ok:()=>pe,q5:()=>ke,g:()=>bt,xl:()=>$,I:()=>X,bx:()=>j,dD:()=>de,Ib:()=>w,Az:()=>b,Iw:()=>R,qY:()=>k,db:()=>P,mR:()=>ie,Tn:()=>f,rV:()=>Z,gh:()=>N,Mi:()=>K,j:()=>Q,YB:()=>q,i5:()=>ee,x_:()=>Se,Am:()=>St,eR:()=>D,r8:()=>V,u3:()=>Ve,vd:()=>I,iV:()=>U,jZ:()=>G,SW:()=>B,ZH:()=>z,Ni:()=>pt,lh:()=>O,bq:()=>T,$f:()=>Et,eu:()=>le,Ax:()=>oe,Mc:()=>ae});class i{static GetStackTrace(){const e=new Error;let t="No Stack Available for this browser";return e.stack&&(t=e.stack.toString().replace(/Error/g,"")),t}static SetLoggerVerbosity(e){null!=this.verboseLogLevel&&(this.verboseLogLevel=e)}static Log(e,t,s){if(s>this.verboseLogLevel)return;const n=`Level: Log\nMsg: ${t}\nCaller: ${e}`;console.log(n)}static Info(e,t,s){if(s>this.verboseLogLevel)return;const n=`Level: Info\nMsg: ${t}`;console.info(n)}static Error(e,t){const s=`Level: Error\nMsg: ${t}\nCaller: ${e}`;console.error(s)}static Warning(e,t){const s=`Level: Warning\nCaller: ${e}\nMsg: ${t}`;console.warn(s)}}i.verboseLogLevel=5,function(e){e.LIST_STREAMERS="listStreamers",e.SUBSCRIBE="subscribe",e.UNSUBSCRIBE="unsubscribe",e.ICE_CANDIDATE="iceCandidate",e.OFFER="offer",e.ANSWER="answer",e.DATACHANNELREQUEST="dataChannelRequest",e.SFURECVDATACHANNELREADY="peerDataChannelsReady",e.PONG="pong"}(t||(t={}));class a{payload(){return i.Log(i.GetStackTrace(),"Sending => \n"+JSON.stringify(this,void 0,4),6),JSON.stringify(this)}}class o extends a{constructor(){super(),this.type=t.LIST_STREAMERS}}class l extends a{constructor(e){super(),this.type=t.LIST_STREAMERS,this.streamerName=e}}class d extends a{constructor(e){super(),this.type=t.SUBSCRIBE,this.streamerId=e}}class c extends a{constructor(){super(),this.type=t.UNSUBSCRIBE}}class h extends a{constructor(e){super(),this.type=t.PONG,this.time=e}}class g extends a{constructor(e){super(),this.type=t.OFFER,e&&(this.type=e.type,this.sdp=e.sdp)}}class u extends a{constructor(e){super(),this.type=t.ANSWER,e&&(this.type=e.type,this.sdp=e.sdp)}}class m extends a{constructor(){super(),this.type=t.DATACHANNELREQUEST}}class S extends a{constructor(){super(),this.type=t.SFURECVDATACHANNELREADY}}class v{constructor(e){this.type=t.ICE_CANDIDATE,this.candidate=e}payload(){return i.Log(i.GetStackTrace(),"Sending => \n"+JSON.stringify(this,void 0,4),6),JSON.stringify(this)}}!function(e){e.CONFIG="config",e.STREAMER_LIST="streamerList",e.PLAYER_COUNT="playerCount",e.OFFER="offer",e.ANSWER="answer",e.ICE_CANDIDATE="iceCandidate",e.PEER_DATA_CHANNELS="peerDataChannels",e.PING="ping",e.WARNING="warning"}(s||(s={}));class p{}class C extends p{}class f{constructor(){this.FromUEMessageHandlers=new Map}addMessageHandler(e,t){this.FromUEMessageHandlers.set(e,t)}handleMessage(e,t){this.FromUEMessageHandlers.has(e)?this.FromUEMessageHandlers.get(e)(t):i.Error(i.GetStackTrace(),`Message type of ${e} does not have a message handler registered on the frontend - ignoring message.`)}static setupDefaultHandlers(e){e.signallingProtocol.addMessageHandler(s.PING,(t=>{const n=new h((new Date).getTime()).payload();i.Log(i.GetStackTrace(),s.PING+": "+t,6),e.webSocket.send(n)})),e.signallingProtocol.addMessageHandler(s.CONFIG,(t=>{i.Log(i.GetStackTrace(),s.CONFIG,6);const n=JSON.parse(t);e.onConfig(n)})),e.signallingProtocol.addMessageHandler(s.STREAMER_LIST,(t=>{i.Log(i.GetStackTrace(),s.STREAMER_LIST,6);const n=JSON.parse(t);e.onStreamerList(n)})),e.signallingProtocol.addMessageHandler(s.PLAYER_COUNT,(t=>{i.Log(i.GetStackTrace(),s.PLAYER_COUNT,6);const n=JSON.parse(t);i.Log(i.GetStackTrace(),"Player Count: "+n.count,6),e.onPlayerCount(n)})),e.signallingProtocol.addMessageHandler(s.ANSWER,(t=>{i.Log(i.GetStackTrace(),s.ANSWER,6);const n=JSON.parse(t);e.onWebRtcAnswer(n)})),e.signallingProtocol.addMessageHandler(s.OFFER,(t=>{i.Log(i.GetStackTrace(),s.OFFER,6);const n=JSON.parse(t);e.onWebRtcOffer(n)})),e.signallingProtocol.addMessageHandler(s.ICE_CANDIDATE,(t=>{i.Log(i.GetStackTrace(),s.ICE_CANDIDATE,6);const n=JSON.parse(t);e.onIceCandidate(n.candidate)})),e.signallingProtocol.addMessageHandler(s.WARNING,(e=>{i.Warning(i.GetStackTrace(),`Warning received: ${e}`)})),e.signallingProtocol.addMessageHandler(s.PEER_DATA_CHANNELS,(t=>{i.Log(i.GetStackTrace(),s.PEER_DATA_CHANNELS,6);const n=JSON.parse(t);e.onWebRtcPeerDataChannels(n)}))}}class T{constructor(){this.WS_OPEN_STATE=1,this.onOpen=new EventTarget,this.onClose=new EventTarget,this.signallingProtocol=new f,f.setupDefaultHandlers(this)}connect(e){i.Log(i.GetStackTrace(),e,6);try{return this.webSocket=new WebSocket(e),this.webSocket.onopen=e=>this.handleOnOpen(e),this.webSocket.onerror=()=>this.handleOnError(),this.webSocket.onclose=e=>this.handleOnClose(e),this.webSocket.onmessage=e=>this.handleOnMessage(e),this.webSocket.onmessagebinary=e=>this.handleOnMessageBinary(e),!0}catch(e){return i.Error(e,e),!1}}handleOnMessageBinary(e){e&&e.data&&e.data.text().then((e=>{const t=new MessageEvent("messageFromBinary",{data:e});this.handleOnMessage(t)})).catch((e=>{i.Error(i.GetStackTrace(),`从websocket解析二进制blob失败,原因: ${e}`)}))}handleOnMessage(e){if(e.data&&e.data instanceof Blob)return void this.handleOnMessageBinary(e);const t=JSON.parse(e.data);i.Log(i.GetStackTrace(),"received => \n"+JSON.stringify(JSON.parse(e.data),void 0,4),6),this.signallingProtocol.handleMessage(t.type,e.data)}handleOnOpen(e){i.Log(i.GetStackTrace(),"通过WebSocket连接到信令服务器",6),this.onOpen.dispatchEvent(new Event("open"))}handleOnError(){i.Error(i.GetStackTrace(),"WebSocket error")}handleOnClose(e){console.log(e),i.Log(i.GetStackTrace(),"通过WebSocket与信令服务器断开连接: "+JSON.stringify(e.code)+" - "+e.reason),4004==e.code&&(this.onOpen.dispatchEvent(new Event("close",e)),this.onClose.dispatchEvent(new CustomEvent("close",{detail:e})))}requestStreamerList(){const e=new o;this.webSocket.send(e.payload())}requestStreamerObject(e){const t=new l(e);this.webSocket.send(t.payload())}sendSubscribe(e){const t=new d(e);this.webSocket.send(t.payload())}sendUnsubscribe(){const e=new c;this.webSocket.send(e.payload())}sendWebRtcOffer(e){const t=new g(e);this.webSocket.send(t.payload())}sendWebRtcAnswer(e){const t=new u(e);this.webSocket.send(t.payload())}sendWebRtcDatachannelRequest(){const e=new m;this.webSocket.send(e.payload())}sendSFURecvDataChannelReady(){const e=new S;this.webSocket.send(e.payload())}sendIceCandidate(e){if(i.Log(i.GetStackTrace(),"Sending Ice Candidate(发送Ice候选人)"),this.webSocket&&this.webSocket.readyState===this.WS_OPEN_STATE){const t=new v(e);this.webSocket.send(t.payload())}}close(){var e;null===(e=this.webSocket)||void 0===e||e.close()}onConfig(e){}onStreamerList(e){}onIceCandidate(e){}onWebRtcAnswer(e){}onWebRtcOffer(e){}onWebRtcPeerDataChannels(e){}onPlayerCount(e){}}class E{constructor(e){this.videoElementProvider=e,this.audioElement=document.createElement("Audio"),this.videoElementProvider.setAudioElement(this.audioElement)}handleOnTrack(e){i.Log(i.GetStackTrace(),"handleOnTrack "+JSON.stringify(e.streams),6);const t=this.videoElementProvider.getVideoElement();if(e.track&&i.Log(i.GetStackTrace(),"Got track - "+e.track.kind+" id="+e.track.id+" readyState="+e.track.readyState,6),"audio"!=e.track.kind)return"video"==e.track.kind&&t.srcObject!==e.streams[0]?(t.srcObject=e.streams[0],void i.Log(i.GetStackTrace(),"Set video source from video track ontrack.")):void 0;this.CreateAudioTrack(e.streams[0])}CreateAudioTrack(e){const t=this.videoElementProvider.getVideoElement();t.srcObject!=e&&t.srcObject&&t.srcObject!==e&&(this.audioElement.srcObject=e,i.Log(i.GetStackTrace(),"Created new audio element to play separate audio stream."))}}class y{constructor(e){this.freezeFrameHeight=0,this.freezeFrameWidth=0,this.rootDiv=e,this.rootElement=document.createElement("div"),this.rootElement.id="freezeFrame",this.rootElement.style.display="none",this.rootElement.style.pointerEvents="none",this.rootElement.style.position="absolute",this.rootElement.style.zIndex="20",this.imageElement=document.createElement("img"),this.imageElement.style.position="absolute",this.rootElement.appendChild(this.imageElement),this.rootDiv.appendChild(this.rootElement)}setElementForShow(){this.rootElement.style.display="block"}setElementForHide(){this.rootElement.style.display="none"}updateImageElementSource(e){const t=btoa(e.reduce(((e,t)=>e+String.fromCharCode(t)),""));this.imageElement.src="data:image/jpeg;base64,"+t}setDimensionsFromElementAndResize(){this.freezeFrameHeight=this.imageElement.naturalHeight,this.freezeFrameWidth=this.imageElement.naturalWidth,this.resize()}resize(){if(0!==this.freezeFrameWidth&&0!==this.freezeFrameHeight){let e=0,t=0,s=0,n=0;const r=this.rootDiv.clientWidth/this.rootDiv.clientHeight,i=this.freezeFrameWidth/this.freezeFrameHeight;r<i?(e=this.rootDiv.clientWidth,t=Math.floor(this.rootDiv.clientWidth/i),s=Math.floor(.5*(this.rootDiv.clientHeight-t)),n=0):(e=Math.floor(this.rootDiv.clientHeight*i),t=this.rootDiv.clientHeight,s=0,n=Math.floor(.5*(this.rootDiv.clientWidth-e))),this.rootElement.style.width=this.rootDiv.offsetWidth+"px",this.rootElement.style.height=this.rootDiv.offsetHeight+"px",this.rootElement.style.left="0px",this.rootElement.style.top="0px",this.imageElement.style.width=e+"px",this.imageElement.style.height=t+"px",this.imageElement.style.left=n+"px",this.imageElement.style.top=s+"px"}}}class M{constructor(e){this.receiving=!1,this.size=0,this.jpeg=void 0,this.valid=!1,this.freezeFrameDelay=50,this.freezeFrame=new y(e)}showFreezeFrame(){this.valid&&this.freezeFrame.setElementForShow()}hideFreezeFrame(){this.valid=!1,this.freezeFrame.setElementForHide()}updateFreezeFrameAndShow(e,t){this.freezeFrame.updateImageElementSource(e),this.freezeFrame.imageElement.onload=()=>{this.freezeFrame.setDimensionsFromElementAndResize(),t()}}processFreezeFrameMessage(e,t){this.receiving||(this.receiving=!0,this.valid=!1,this.size=0,this.jpeg=void 0),this.size=new DataView(e.slice(1,5).buffer).getInt32(0,!0);const s=e.slice(5);if(this.jpeg){const e=new Uint8Array(this.jpeg.length+s.length);e.set(this.jpeg,0),e.set(s,this.jpeg.length),this.jpeg=e}else this.jpeg=s,this.receiving=!0,i.Log(i.GetStackTrace(),`received first chunk of freeze frame: ${this.jpeg.length}/${this.size}`,6);this.jpeg.length===this.size?(this.receiving=!1,this.valid=!0,i.Log(i.GetStackTrace(),`received complete freeze frame ${this.size}`,6),this.updateFreezeFrameAndShow(this.jpeg,t)):this.jpeg.length>this.size&&(i.Error(i.GetStackTrace(),`received bigger freeze frame than advertised: ${this.jpeg.length}/${this.size}`),this.jpeg=void 0,this.receiving=!1)}}class w{constructor(e,t,s,n,r=(()=>{})){this.onChange=r,this.onChangeEmit=()=>{},this.id=e,this.description=s,this.label=t,this.value=n}set label(e){this._label=e,this.onChangeEmit(this._value)}get label(){return this._label}get value(){return this._value}set value(e){this._value=e,this.onChange(this._value,this),this.onChangeEmit(this._value)}}class b extends w{constructor(e,t,s,n,r,i=(()=>{})){super(e,t,s,n,i);const a=new URLSearchParams(window.location.search);if(r&&a.has(this.id)){const e=this.getUrlParamFlag();this.flag=e}else this.flag=n;this.useUrlParams=r}getUrlParamFlag(){const e=new URLSearchParams(window.location.search);return!!e.has(this.id)&&"false"!==e.get(this.id)&&"False"!==e.get(this.id)}updateURLParams(){if(this.useUrlParams){const e=new URLSearchParams(window.location.search);!0===this.flag?e.set(this.id,"true"):e.set(this.id,"false"),window.history.replaceState({},"",""!==e.toString()?`${location.pathname}?${e}`:`${location.pathname}`)}}enable(){this.flag=!0}get flag(){return!!this.value}set flag(e){this.value=e}}class R extends w{constructor(e,t,s,n,r,i,a,o=(()=>{})){super(e,t,s,i,o),this._min=n,this._max=r;const l=new URLSearchParams(window.location.search);if(a&&l.has(this.id)){const e=Number.parseInt(l.get(this.id));this.number=Number.isNaN(e)?i:e}else this.number=i;this.useUrlParams=a}updateURLParams(){if(this.useUrlParams){const e=new URLSearchParams(window.location.search);e.set(this.id,this.number.toString()),window.history.replaceState({},"",""!==e.toString()?`${location.pathname}?${e}`:`${location.pathname}`)}}set number(e){this.value=this.clamp(e)}get number(){return this.value}clamp(e){return Math.max(Math.min(this._max,e),this._min)}get min(){return this._min}get max(){return this._max}addOnChangedListener(e){this.onChange=e}}class P extends w{constructor(e,t,s,n,r,i=(()=>{})){super(e,t,s,n,i);const a=new URLSearchParams(window.location.search);if(r&&a.has(this.id)){const e=this.getUrlParamText();this.text=e}else this.text=n;this.useUrlParams=r}getUrlParamText(){var e;const t=new URLSearchParams(window.location.search);return t.has(this.id)&&null!==(e=t.get(this.id))&&void 0!==e?e:""}updateURLParams(){if(this.useUrlParams){const e=new URLSearchParams(window.location.search);e.set(this.id,this.text),window.history.replaceState({},"",""!==e.toString()?`${location.pathname}?${e}`:`${location.pathname}`)}}get text(){return this.value}set text(e){this.value=e}}class k extends w{constructor(e,t,s,n,r,i,a=(()=>{})){super(e,t,s,[n,n],a),this.options=r;const o=new URLSearchParams(window.location.search),l=i&&o.has(this.id)?this.getUrlParamText():n;this.selected=l,this.useUrlParams=i}getUrlParamText(){var e;const t=new URLSearchParams(window.location.search);return t.has(this.id)&&null!==(e=t.get(this.id))&&void 0!==e?e:""}updateURLParams(){if(this.useUrlParams){const e=new URLSearchParams(window.location.search);e.set(this.id,this.selected),window.history.replaceState({},"",""!==e.toString()?`${location.pathname}?${e}`:`${location.pathname}`)}}addOnChangedListener(e){this.onChange=e}get options(){return this._options}set options(e){this._options=e,this.onChangeEmit(this.selected)}get selected(){return this.value}set selected(e){let t=this.options.filter((t=>-1!==t.indexOf(e)));t.length?this.value=t[0]:(t=this.options.filter((t=>-1!==t.indexOf(e.split(" ")[0]))),t.length&&(this.value=t[0]))}}class L extends Event{constructor(e){super("afkWarningActivate"),this.data=e}}class x extends Event{constructor(e){super("afkWarningUpdate"),this.data=e}}class A extends Event{constructor(){super("afkWarningDeactivate")}}class F extends Event{constructor(){super("afkTimedOut")}}class D extends Event{constructor(e){super("videoEncoderAvgQP"),this.data=e}}class O extends Event{constructor(){super("webRtcSdp")}}class I extends Event{constructor(){super("webRtcAutoConnect")}}class G extends Event{constructor(){super("webRtcConnecting")}}class U extends Event{constructor(){super("webRtcConnected")}}class z extends Event{constructor(){super("webRtcFailed")}}class B extends Event{constructor(e){super("webRtcDisconnected"),this.data=e}}class _ extends Event{constructor(e){super("dataChannelOpen"),this.data=e}}class H extends Event{constructor(e){super("dataChannelClose"),this.data=e}}class W extends Event{constructor(e){super("dataChannelError"),this.data=e}}class V extends Event{constructor(){super("videoInitialized")}}class N extends Event{constructor(){super("streamLoading")}}class K extends Event{constructor(){super("streamConnect")}}class Q extends Event{constructor(){super("streamDisconnect")}}class q extends Event{constructor(){super("streamReconnect")}}class $ extends Event{constructor(e){super("playStreamError"),this.data=e}}class X extends Event{constructor(){super("playStream")}}class j extends Event{constructor(e){super("playStreamRejected"),this.data=e}}class J extends Event{constructor(e){super("loadFreezeFrame"),this.data=e}}class Y extends Event{constructor(){super("hideFreezeFrame")}}class Z extends Event{constructor(e){super("statsReceived"),this.data=e}}class ee extends Event{constructor(e){super("streamerListMessage"),this.data=e}}class te extends Event{constructor(e){super("latencyTestResult"),this.data=e}}class se extends Event{constructor(e){super("dataChannelLatencyTestResponse"),this.data=e}}class ne extends Event{constructor(e){super("dataChannelLatencyTestResult"),this.data=e}}class re extends Event{constructor(e){super("initialSettings"),this.data=e}}class ie extends Event{constructor(e){super("settingsChanged"),this.data=e}}class ae extends Event{constructor(){super("xrSessionStarted")}}class oe extends Event{constructor(){super("xrSessionEnded")}}class le extends Event{constructor(e){super("xrFrame"),this.data=e}}class de extends Event{constructor(e){super("playerCount"),this.data=e}}class ce extends EventTarget{dispatchEvent(e){return super.dispatchEvent(e)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}}class he{}he.AutoConnect="AutoConnect",he.AutoPlayVideo="AutoPlayVideo",he.AFKDetection="TimeoutIfIdle",he.BrowserSendOffer="OfferToReceive",he.HoveringMouseMode="HoveringMouse",he.ForceMonoAudio="ForceMonoAudio",he.ForceTURN="ForceTURN",he.FakeMouseWithTouches="FakeMouseWithTouches",he.IsQualityController="ControlsQuality",he.MatchViewportResolution="MatchViewportRes",he.StartVideoMuted="StartVideoMuted",he.SuppressBrowserKeys="SuppressBrowserKeys",he.UseMic="UseMic",he.KeyboardInput="KeyboardInput",he.MouseInput="MouseInput",he.TouchInput="TouchInput",he.GamepadInput="GamepadInput",he.XRControllerInput="XRControllerInput",he.WaitForStreamer="WaitForStreamer";const ge=e=>Object.getOwnPropertyNames(he).some((t=>he[t]===e));class ue{}ue.AFKTimeoutSecs="AFKTimeout",ue.MinQP="MinQP",ue.MaxQP="MaxQP",ue.WebRTCFPS="WebRTCFPS",ue.WebRTCMinBitrate="WebRTCMinBitrate",ue.WebRTCMaxBitrate="WebRTCMaxBitrate",ue.MaxReconnectAttempts="MaxReconnectAttempts",ue.StreamerAutoJoinInterval="StreamerAutoJoinInterval";const me=e=>Object.getOwnPropertyNames(ue).some((t=>ue[t]===e));class Se{}Se.SignallingServerUrl="ss";const ve=e=>Object.getOwnPropertyNames(Se).some((t=>Se[t]===e));class pe{}pe.PreferredCodec="PreferredCodec",pe.StreamerId="StreamerId";const Ce=e=>Object.getOwnPropertyNames(pe).some((t=>pe[t]===e));class fe{constructor(e={}){this.flags=new Map,this.numericParameters=new Map,this.textParameters=new Map,this.optionParameters=new Map;const{initialSettings:t,useUrlParams:s}=e;this._useUrlParams=!!s,this.populateDefaultSettings(this._useUrlParams),t&&this.setSettings(t)}get useUrlParams(){return this._useUrlParams}populateDefaultSettings(e){this.textParameters.set(Se.SignallingServerUrl,new P(Se.SignallingServerUrl,"Signalling url","Url of the signalling server",("https:"===location.protocol?"wss://":"ws://")+window.location.hostname+("80"===window.location.port||""===window.location.port?"":`:${window.location.port}`),e)),this.optionParameters.set(pe.StreamerId,new k(pe.StreamerId,"Streamer ID","The ID of the streamer to stream.","",[],e)),this.optionParameters.set(pe.PreferredCodec,new k(pe.PreferredCodec,"Preferred Codec","The preferred codec to be used during codec negotiation","H264 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f",function(){const e=[];if(!RTCRtpReceiver.getCapabilities)return e.push("Only available on Chrome"),e;const t=/(VP\d|H26\d|AV1).*/;return RTCRtpReceiver.getCapabilities("video").codecs.forEach((s=>{const n=s.mimeType.split("/")[1]+" "+(s.sdpFmtpLine||"");null!==t.exec(n)&&e.push(n)})),e}(),e)),this.flags.set(he.AutoConnect,new b(he.AutoConnect,"Auto connect to stream","Whether we should attempt to auto connect to the signalling server or show a click to start prompt.",!1,e)),this.flags.set(he.AutoPlayVideo,new b(he.AutoPlayVideo,"Auto play video","When video is ready automatically start playing it as opposed to showing a play button.",!0,e)),this.flags.set(he.BrowserSendOffer,new b(he.BrowserSendOffer,"Browser send offer","Browser will initiate the WebRTC handshake by sending the offer to the streamer",!1,e)),this.flags.set(he.UseMic,new b(he.UseMic,"Use microphone","Make browser request microphone access and open an input audio track.",!1,e)),this.flags.set(he.StartVideoMuted,new b(he.StartVideoMuted,"Start video muted","Video will start muted if true.",!1,e)),this.flags.set(he.SuppressBrowserKeys,new b(he.SuppressBrowserKeys,"Suppress browser keys","Suppress certain browser keys that we use in UE, for example F5 to show shader complexity instead of refresh the page.",!0,e)),this.flags.set(he.IsQualityController,new b(he.IsQualityController,"Is quality controller?","True if this peer controls stream quality",!0,e)),this.flags.set(he.ForceMonoAudio,new b(he.ForceMonoAudio,"Force mono audio","Force browser to request mono audio in the SDP",!1,e)),this.flags.set(he.ForceTURN,new b(he.ForceTURN,"Force TURN","Only generate TURN/Relayed ICE candidates.",!1,e)),this.flags.set(he.AFKDetection,new b(he.AFKDetection,"AFK if idle","Timeout the experience if user is AFK for a period.",!1,e)),this.flags.set(he.MatchViewportResolution,new b(he.MatchViewportResolution,"Match viewport resolution","Pixel Streaming will be instructed to dynamically resize the video stream to match the size of the video element.",!1,e)),this.flags.set(he.HoveringMouseMode,new b(he.HoveringMouseMode,"Control Scheme: Locked Mouse","Either locked mouse, where the pointer is consumed by the video and locked to it, or hovering mouse, where the mouse is not consumed.",!1,e,((e,t)=>{t.label=`Control Scheme: ${e?"Hovering":"Locked"} Mouse`}))),this.flags.set(he.FakeMouseWithTouches,new b(he.FakeMouseWithTouches,"Fake mouse with touches","A single finger touch is converted into a mouse event. This allows a non-touch application to be controlled partially via a touch device.",!1,e)),this.flags.set(he.KeyboardInput,new b(he.KeyboardInput,"Keyboard input","If enabled, send keyboard events to streamer",!0,e)),this.flags.set(he.MouseInput,new b(he.MouseInput,"Mouse input","If enabled, send mouse events to streamer",!0,e)),this.flags.set(he.TouchInput,new b(he.TouchInput,"Touch input","If enabled, send touch events to streamer",!0,e)),this.flags.set(he.GamepadInput,new b(he.GamepadInput,"Gamepad input","If enabled, send gamepad events to streamer",!0,e)),this.flags.set(he.XRControllerInput,new b(he.XRControllerInput,"XR controller input","If enabled, send XR controller events to streamer",!0,e)),this.flags.set(he.WaitForStreamer,new b(he.WaitForStreamer,"等待拖缆","将继续尝试连接到第一个可用的流媒体.",!0,e)),this.numericParameters.set(ue.AFKTimeoutSecs,new R(ue.AFKTimeoutSecs,"AFK timeout","The time (in seconds) it takes for the application to time out if AFK timeout is enabled.",0,600,120,e)),this.numericParameters.set(ue.MaxReconnectAttempts,new R(ue.MaxReconnectAttempts,"Max Reconnects","Maximum number of reconnects the application will attempt when a streamer disconnects.",0,999,3,e)),this.numericParameters.set(ue.MinQP,new R(ue.MinQP,"Min QP","The lower bound for the quantization parameter (QP) of the encoder. 0 = Best quality, 51 = worst quality.",0,51,0,e)),this.numericParameters.set(ue.MaxQP,new R(ue.MaxQP,"Max QP","The upper bound for the quantization parameter (QP) of the encoder. 0 = Best quality, 51 = worst quality.",0,51,51,e)),this.numericParameters.set(ue.WebRTCFPS,new R(ue.WebRTCFPS,"Max FPS","The maximum FPS that WebRTC will try to transmit frames at.",1,999,60,e)),this.numericParameters.set(ue.WebRTCMinBitrate,new R(ue.WebRTCMinBitrate,"Min Bitrate (kbps)","The minimum bitrate that WebRTC should use.",0,5e5,0,e)),this.numericParameters.set(ue.WebRTCMaxBitrate,new R(ue.WebRTCMaxBitrate,"Max Bitrate (kbps)","The maximum bitrate that WebRTC should use.",0,5e5,0,e)),this.numericParameters.set(ue.StreamerAutoJoinInterval,new R(ue.StreamerAutoJoinInterval,"Streamer Auto Join Interval (ms)","Delay between retries when waiting for an available streamer.",500,9e5,3e3,e))}_addOnNumericSettingChangedListener(e,t){this.numericParameters.has(e)&&this.numericParameters.get(e).addOnChangedListener(t)}_addOnOptionSettingChangedListener(e,t){this.optionParameters.has(e)&&this.optionParameters.get(e).addOnChangedListener(t)}getNumericSettingValue(e){if(this.numericParameters.has(e))return this.numericParameters.get(e).number;throw new Error(`There is no numeric setting with the id of ${e}`)}getTextSettingValue(e){if(this.textParameters.has(e))return this.textParameters.get(e).value;throw new Error(`There is no numeric setting with the id of ${e}`)}setNumericSetting(e,t){if(!this.numericParameters.has(e))throw new Error(`There is no numeric setting with the id of ${e}`);this.numericParameters.get(e).number=t}_addOnSettingChangedListener(e,t){this.flags.has(e)&&(this.flags.get(e).onChange=t)}_addOnTextSettingChangedListener(e,t){this.textParameters.has(e)&&(this.textParameters.get(e).onChange=t)}getSettingOption(e){return this.optionParameters.get(e)}isFlagEnabled(e){return this.flags.get(e).flag}setFlagEnabled(e,t){this.flags.has(e)?this.flags.get(e).flag=t:i.Warning(i.GetStackTrace(),`Cannot toggle flag called ${e} - it does not exist in the Config.flags map.`)}setTextSetting(e,t){this.textParameters.has(e)?this.textParameters.get(e).text=t:i.Warning(i.GetStackTrace(),`Cannot set text setting called ${e} - it does not exist in the Config.textParameters map.`)}setOptionSettingOptions(e,t){this.optionParameters.has(e)?(console.log(t),this.optionParameters.get(e).options=t):i.Warning(i.GetStackTrace(),`Cannot set text setting called ${e} - it does not exist in the Config.optionParameters map.`)}setOptionSettingValue(e,t){this.optionParameters.has(e)?this.optionParameters.get(e).selected=t:i.Warning(i.GetStackTrace(),`Cannot set text setting called ${e} - it does not exist in the Config.enumParameters map.`)}setFlagLabel(e,t){this.flags.has(e)?this.flags.get(e).label=t:i.Warning(i.GetStackTrace(),`Cannot set label for flag called ${e} - it does not exist in the Config.flags map.`)}setSettings(e){for(const t of Object.keys(e))ge(t)?this.setFlagEnabled(t,e[t]):me(t)?this.setNumericSetting(t,e[t]):ve(t)?this.setTextSetting(t,e[t]):Ce(t)&&this.setOptionSettingValue(t,e[t])}getSettings(){const e={};for(const[t,s]of this.flags.entries())e[t]=s.flag;for(const[t,s]of this.numericParameters.entries())e[t]=s.number;for(const[t,s]of this.textParameters.entries())e[t]=s.text;for(const[t,s]of this.optionParameters.entries())e[t]=s.selected;return e}getFlags(){return Array.from(this.flags.values())}getTextSettings(){return Array.from(this.textParameters.values())}getNumericSettings(){return Array.from(this.numericParameters.values())}getOptionSettings(){return Array.from(this.optionParameters.values())}_registerOnChangeEvents(e){for(const t of this.flags.keys()){const s=this.flags.get(t);s&&(s.onChangeEmit=t=>e.dispatchEvent(new ie({id:s.id,type:"flag",value:t,target:s})))}for(const t of this.numericParameters.keys()){const s=this.numericParameters.get(t);s&&(s.onChangeEmit=t=>e.dispatchEvent(new ie({id:s.id,type:"number",value:t,target:s})))}for(const t of this.textParameters.keys()){const s=this.textParameters.get(t);s&&(s.onChangeEmit=t=>e.dispatchEvent(new ie({id:s.id,type:"text",value:t,target:s})))}for(const t of this.optionParameters.keys()){const s=this.optionParameters.get(t);s&&(s.onChangeEmit=t=>e.dispatchEvent(new ie({id:s.id,type:"option",value:t,target:s})))}}}var Te;!function(e){e[e.LockedMouse=0]="LockedMouse",e[e.HoveringMouse=1]="HoveringMouse"}(Te||(Te={}));class Ee{constructor(e,t,s){this.closeTimeout=10,this.active=!1,this.countdownActive=!1,this.warnTimer=void 0,this.countDown=0,this.countDownTimer=void 0,this.config=e,this.pixelStreaming=t,this.onDismissAfk=s,this.onAFKTimedOutCallback=()=>{console.log("AFK timed out, did you want to override this callback?")}}onAfkClick(){clearInterval(this.countDownTimer),(this.active||this.countdownActive)&&(this.startAfkWarningTimer(),this.pixelStreaming.dispatchEvent(new A))}startAfkWarningTimer(){this.config.getNumericSettingValue(ue.AFKTimeoutSecs)>0&&this.config.isFlagEnabled(he.AFKDetection)?this.active=!0:this.active=!1,this.resetAfkWarningTimer()}stopAfkWarningTimer(){this.active=!1,this.countdownActive=!1,clearTimeout(this.warnTimer),clearInterval(this.countDownTimer)}pauseAfkWarningTimer(){this.active=!1}resetAfkWarningTimer(){this.active&&this.config.isFlagEnabled(he.AFKDetection)&&(clearTimeout(this.warnTimer),this.warnTimer=setTimeout((()=>this.activateAfkEvent()),1e3*this.config.getNumericSettingValue(ue.AFKTimeoutSecs)))}activateAfkEvent(){this.pauseAfkWarningTimer(),this.pixelStreaming.dispatchEvent(new L({countDown:this.countDown,dismissAfk:this.onDismissAfk})),this.countDown=this.closeTimeout,this.countdownActive=!0,this.pixelStreaming.dispatchEvent(new x({countDown:this.countDown})),this.config.isFlagEnabled(he.HoveringMouseMode)||document.exitPointerLock&&document.exitPointerLock(),this.countDownTimer=setInterval((()=>{this.countDown--,0==this.countDown?(this.pixelStreaming.dispatchEvent(new F),this.onAFKTimedOutCallback(),i.Log(i.GetStackTrace(),"You have been disconnected due to inactivity"),this.stopAfkWarningTimer()):this.pixelStreaming.dispatchEvent(new x({countDown:this.countDown}))}),1e3)}}class ye{constructor(){this.isReceivingFreezeFrame=!1}getDataChannelInstance(){return this}createDataChannel(e,t,s){this.peerConnection=e,this.label=t,this.datachannelOptions=s,null==s&&(this.datachannelOptions={},this.datachannelOptions.ordered=!0),this.dataChannel=this.peerConnection.createDataChannel(this.label,this.datachannelOptions),this.setupDataChannel()}setupDataChannel(){this.dataChannel.binaryType="arraybuffer",this.dataChannel.onopen=e=>this.handleOnOpen(e),this.dataChannel.onclose=e=>this.handleOnClose(e),this.dataChannel.onmessage=e=>this.handleOnMessage(e),this.dataChannel.onerror=e=>this.handleOnError(e)}handleOnOpen(e){var t;i.Log(i.GetStackTrace(),`Data Channel (${this.label}) opened.`,7),this.onOpen(null===(t=this.dataChannel)||void 0===t?void 0:t.label,e)}handleOnClose(e){var t;i.Log(i.GetStackTrace(),`Data Channel (${this.label}) closed.`,7),this.onClose(null===(t=this.dataChannel)||void 0===t?void 0:t.label,e)}handleOnMessage(e){i.Log(i.GetStackTrace(),`Data Channel (${this.label}) message: ${e}`,8)}handleOnError(e){var t;i.Log(i.GetStackTrace(),`Data Channel (${this.label}) error: ${e}`,7),this.onError(null===(t=this.dataChannel)||void 0===t?void 0:t.label,e)}onOpen(e,t){}onClose(e,t){}onError(e,t){}}class Me{}class we{}class be{}class Re{}class Pe{}class ke{}class Le{}class xe{}class Ae{constructor(){this.inboundVideoStats=new we,this.inboundAudioStats=new Me,this.candidatePair=new Pe,this.DataChannelStats=new be,this.outBoundVideoStats=new ke,this.sessionStats=new Le,this.streamStats=new xe,this.codecs=new Map}processStats(e){this.localCandidates=new Array,this.remoteCandidates=new Array,e.forEach((e=>{switch(e.type){case"candidate-pair":this.handleCandidatePair(e);break;case"certificate":case"media-source":case"media-playout":case"outbound-rtp":case"peer-connection":case"remote-inbound-rtp":case"transport":break;case"codec":this.handleCodec(e);break;case"data-channel":this.handleDataChannel(e);break;case"inbound-rtp":this.handleInBoundRTP(e);break;case"local-candidate":this.handleLocalCandidate(e);break;case"remote-candidate":this.handleRemoteCandidate(e);break;case"remote-outbound-rtp":this.handleRemoteOutBound(e);break;case"track":this.handleTrack(e);break;case"stream":this.handleStream(e);break;default:i.Error(i.GetStackTrace(),"unhandled Stat Type"),i.Log(i.GetStackTrace(),e)}}))}handleStream(e){this.streamStats=e}handleCandidatePair(e){this.candidatePair.bytesReceived=e.bytesReceived,this.candidatePair.bytesSent=e.bytesSent,this.candidatePair.localCandidateId=e.localCandidateId,this.candidatePair.remoteCandidateId=e.remoteCandidateId,this.candidatePair.nominated=e.nominated,this.candidatePair.readable=e.readable,this.candidatePair.selected=e.selected,this.candidatePair.writable=e.writable,this.candidatePair.state=e.state,this.candidatePair.currentRoundTripTime=e.currentRoundTripTime}handleDataChannel(e){this.DataChannelStats.bytesReceived=e.bytesReceived,this.DataChannelStats.bytesSent=e.bytesSent,this.DataChannelStats.dataChannelIdentifier=e.dataChannelIdentifier,this.DataChannelStats.id=e.id,this.DataChannelStats.label=e.label,this.DataChannelStats.messagesReceived=e.messagesReceived,this.DataChannelStats.messagesSent=e.messagesSent,this.DataChannelStats.protocol=e.protocol,this.DataChannelStats.state=e.state,this.DataChannelStats.timestamp=e.timestamp}handleLocalCandidate(e){const t=new Re;t.label="local-candidate",t.address=e.address,t.port=e.port,t.protocol=e.protocol,t.candidateType=e.candidateType,t.id=e.id,this.localCandidates.push(t)}handleRemoteCandidate(e){const t=new Re;t.label="local-candidate",t.address=e.address,t.port=e.port,t.protocol=e.protocol,t.id=e.id,t.candidateType=e.candidateType,this.remoteCandidates.push(t)}handleInBoundRTP(e){switch(e.kind){case"video":this.inboundVideoStats=e,null!=this.lastVideoStats&&(this.inboundVideoStats.bitrate=8*(this.inboundVideoStats.bytesReceived-this.lastVideoStats.bytesReceived)/(this.inboundVideoStats.timestamp-this.lastVideoStats.timestamp),this.inboundVideoStats.bitrate=Math.floor(this.inboundVideoStats.bitrate)),this.lastVideoStats=Object.assign({},this.inboundVideoStats);break;case"audio":this.inboundAudioStats=e,null!=this.lastAudioStats&&(this.inboundAudioStats.bitrate=8*(this.inboundAudioStats.bytesReceived-this.lastAudioStats.bytesReceived)/(this.inboundAudioStats.timestamp-this.lastAudioStats.timestamp),this.inboundAudioStats.bitrate=Math.floor(this.inboundAudioStats.bitrate)),this.lastAudioStats=Object.assign({},this.inboundAudioStats);break;default:i.Log(i.GetStackTrace(),"Kind is not handled")}}handleRemoteOutBound(e){"video"===e.kind&&(this.outBoundVideoStats.bytesSent=e.bytesSent,this.outBoundVideoStats.id=e.id,this.outBoundVideoStats.localId=e.localId,this.outBoundVideoStats.packetsSent=e.packetsSent,this.outBoundVideoStats.remoteTimestamp=e.remoteTimestamp,this.outBoundVideoStats.timestamp=e.timestamp)}handleTrack(e){"track"!==e.type||"video_label"!==e.trackIdentifier&&"video"!==e.kind||(this.inboundVideoStats.framesDropped=e.framesDropped,this.inboundVideoStats.framesReceived=e.framesReceived,this.inboundVideoStats.frameHeight=e.frameHeight,this.inboundVideoStats.frameWidth=e.frameWidth)}handleCodec(e){const t=e.id,s=`${e.mimeType.replace("video/","").replace("audio/","")}${e.sdpFmtpLine?` ${e.sdpFmtpLine}`:""}`;this.codecs.set(t,s)}handleSessionStatistics(e,t,s){const n=Date.now()-e;this.sessionStats.runTime=new Date(n).toISOString().substr(11,8).toString();const r=null===t?"Not sent yet":t?"true":"false";this.sessionStats.controlsStreamInput=r,this.sessionStats.videoEncoderAvgQP=s}isNumber(e){return"number"==typeof e&&isFinite(e)}}const Fe=(De={parseRtpParameters:()=>e.parseRtpParameters,splitSections:()=>e.splitSections},Oe={},n.d(Oe,De),Oe);var De,Oe;class Ie{static isVideoTransciever(e){return this.canTransceiverReceiveVideo(e)||this.canTransceiverSendVideo(e)}static canTransceiverReceiveVideo(e){return!!e&&("sendrecv"===e.direction||"recvonly"===e.direction)&&e.receiver&&e.receiver.track&&"video"===e.receiver.track.kind}static canTransceiverSendVideo(e){return!!e&&("sendrecv"===e.direction||"sendonly"===e.direction)&&e.sender&&e.sender.track&&"video"===e.sender.track.kind}static isAudioTransciever(e){return this.canTransceiverReceiveAudio(e)||this.canTransceiverSendAudio(e)}static canTransceiverReceiveAudio(e){return!!e&&("sendrecv"===e.direction||"recvonly"===e.direction)&&e.receiver&&e.receiver.track&&"audio"===e.receiver.track.kind}static canTransceiverSendAudio(e){return!!e&&("sendrecv"===e.direction||"sendonly"===e.direction)&&e.sender&&e.sender.track&&"audio"===e.sender.track.kind}}var Ge,Ue,ze=function(e,t,s,n){return new(s||(s=Promise))((function(r,i){function a(e){try{l(n.next(e))}catch(e){i(e)}}function o(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(a,o)}l((n=n.apply(e,t||[])).next())}))};class Be{constructor(e,t,s){this.config=t,this.createPeerConnection(e,s)}createPeerConnection(e,t){this.config.isFlagEnabled(he.ForceTURN)&&(e.iceTransportPolicy="relay",i.Log(i.GetStackTrace(),"Forcing TURN usage by setting ICE Transport Policy in peer connection config.")),this.peerConnection=new RTCPeerConnection(e),this.peerConnection.onsignalingstatechange=e=>this.handleSignalStateChange(e),this.peerConnection.oniceconnectionstatechange=e=>this.handleIceConnectionStateChange(e),this.peerConnection.onicegatheringstatechange=e=>this.handleIceGatheringStateChange(e),this.peerConnection.ontrack=e=>this.handleOnTrack(e),this.peerConnection.onicecandidate=e=>this.handleIceCandidate(e),this.peerConnection.ondatachannel=e=>this.handleDataChannel(e),this.aggregatedStats=new Ae,this.preferredCodec=t,this.updateCodecSelection=!0}createOffer(e,t){return ze(this,void 0,void 0,(function*(){i.Log(i.GetStackTrace(),"Create Offer",6);const s="localhost"===location.hostname||"127.0.0.1"===location.hostname,n="https:"===location.protocol;let r=t.isFlagEnabled(he.UseMic);!r||s||n||(r=!1,i.Error(i.GetStackTrace(),"Microphone access in the browser will not work if you are not on HTTPS or localhost. Disabling mic access."),i.Error(i.GetStackTrace(),"For testing you can enable HTTP microphone access Chrome by visiting chrome://flags/ and enabling 'unsafely-treat-insecure-origin-as-secure'")),this.setupTransceiversAsync(r).finally((()=>{var t;null===(t=this.peerConnection)||void 0===t||t.createOffer(e).then((e=>{var t;this.showTextOverlayConnecting(),e.sdp=this.mungeSDP(e.sdp,r),null===(t=this.peerConnection)||void 0===t||t.setLocalDescription(e),this.onSendWebRTCOffer(e)})).catch((()=>{this.showTextOverlaySetupFailure()}))}))}))}receiveOffer(e,t){var s;return ze(this,void 0,void 0,(function*(){i.Log(i.GetStackTrace(),"Receive Offer",6),null===(s=this.peerConnection)||void 0===s||s.setRemoteDescription(e).then((()=>{const e="localhost"===location.hostname||"127.0.0.1"===location.hostname,s="https:"===location.protocol;let n=t.isFlagEnabled(he.UseMic);!n||e||s||(n=!1,i.Error(i.GetStackTrace(),"Microphone access in the browser will not work if you are not on HTTPS or localhost. Disabling mic access."),i.Error(i.GetStackTrace(),"For testing you can enable HTTP microphone access Chrome by visiting chrome://flags/ and enabling 'unsafely-treat-insecure-origin-as-secure'")),this.setupTransceiversAsync(n).finally((()=>{var e;null===(e=this.peerConnection)||void 0===e||e.createAnswer().then((e=>{var t;return e.sdp=this.mungeSDP(e.sdp,n),null===(t=this.peerConnection)||void 0===t?void 0:t.setLocalDescription(e)})).then((()=>{var e;this.onSendWebRTCAnswer(null===(e=this.peerConnection)||void 0===e?void 0:e.currentLocalDescription)})).catch((()=>{i.Error(i.GetStackTrace(),"createAnswer() failed")}))}))})),this.config.setOptionSettingOptions(pe.PreferredCodec,this.parseAvailableCodecs(e).filter((e=>this.config.getSettingOption(pe.PreferredCodec).options.includes(e))))}))}receiveAnswer(e){var t;null===(t=this.peerConnection)||void 0===t||t.setRemoteDescription(e),this.config.setOptionSettingOptions(pe.PreferredCodec,this.parseAvailableCodecs(e).filter((e=>this.config.getSettingOption(pe.PreferredCodec).options.includes(e))))}generateStats(){var e;null===(e=this.peerConnection)||void 0===e||e.getStats(null).then((e=>{this.aggregatedStats.processStats(e),this.onVideoStats(this.aggregatedStats),this.updateCodecSelection&&this.config.setOptionSettingValue(pe.PreferredCodec,this.aggregatedStats.codecs.get(this.aggregatedStats.inboundVideoStats.codecId))}))}close(){this.peerConnection&&(this.peerConnection.close(),this.peerConnection=null)}mungeSDP(e,t){let s=e.replace(/(a=fmtp:\d+ .*level-asymmetry-allowed=.*)\r\n/gm,"$1;x-google-start-bitrate=10000;x-google-max-bitrate=100000\r\n"),n="maxaveragebitrate=510000;";return t&&(n+="sprop-maxcapturerate=48000;"),n+=this.config.isFlagEnabled(he.ForceMonoAudio)?"stereo=0;":"stereo=1;",n+="useinbandfec=1",s=s.replace("useinbandfec=1",n),s}handleOnIce(e){var t;i.Log(i.GetStackTrace(),"peerconnection handleOnIce",6),this.config.isFlagEnabled(he.ForceTURN)&&e.candidate.indexOf("relay")<0?i.Info(i.GetStackTrace(),`Dropping candidate because it was not TURN relay. | Type= ${e.type} | Protocol= ${e.protocol} | Address=${e.address} | Port=${e.port} |`,6):null===(t=this.peerConnection)||void 0===t||t.addIceCandidate(e)}handleSignalStateChange(e){i.Log(i.GetStackTrace(),"signaling state change: "+e,6)}handleIceConnectionStateChange(e){i.Log(i.GetStackTrace(),"ice connection state change: "+e,6),this.onIceConnectionStateChange(e)}handleIceGatheringStateChange(e){i.Log(i.GetStackTrace(),"ice gathering state change: "+JSON.stringify(e),6)}handleOnTrack(e){this.onTrack(e)}handleIceCandidate(e){this.onPeerIceCandidate(e)}handleDataChannel(e){this.onDataChannel(e)}onTrack(e){}onIceConnectionStateChange(e){}onPeerIceCandidate(e){}onDataChannel(e){}setupTransceiversAsync(e){var t,s,n,r,i,a,o,l,d;return ze(this,void 0,void 0,(function*(){const c=(null===(t=this.peerConnection)||void 0===t?void 0:t.getTransceivers().length)>0;if(null===(s=this.peerConnection)||void 0===s||s.addTransceiver("video",{direction:"recvonly"}),RTCRtpReceiver.getCapabilities&&""!=this.preferredCodec)for(const e of null!==(r=null===(n=this.peerConnection)||void 0===n?void 0:n.getTransceivers())&&void 0!==r?r:[])if(e&&e.receiver&&e.receiver.track&&"video"===e.receiver.track.kind&&e.setCodecPreferences){const t=this.preferredCodec.split(" "),s=[{mimeType:"video/"+t[0],clockRate:9e4,sdpFmtpLine:t[1]?t[1]:""}];this.config.getSettingOption(pe.PreferredCodec).options.filter((e=>e!=this.preferredCodec)).forEach((e=>{const t=e.split(" ");s.push({mimeType:"video/"+t[0],clockRate:9e4,sdpFmtpLine:t[1]?t[1]:""})}));for(const e of s)""===e.sdpFmtpLine&&delete e.sdpFmtpLine;e.setCodecPreferences(s)}if(e){const e={video:!1,audio:{autoGainControl:!1,channelCount:1,echoCancellation:!1,latency:0,noiseSuppression:!1,sampleRate:48e3,sampleSize:16,volume:1}},t=yield navigator.mediaDevices.getUserMedia(e);if(t)if(c){for(const e of null!==(o=null===(a=this.peerConnection)||void 0===a?void 0:a.getTransceivers())&&void 0!==o?o:[])if(Ie.canTransceiverReceiveAudio(e))for(const s of t.getTracks())s.kind&&"audio"==s.kind&&(e.sender.replaceTrack(s),e.direction="sendrecv")}else for(const e of t.getTracks())e.kind&&"audio"==e.kind&&(null===(l=this.peerConnection)||void 0===l||l.addTransceiver(e,{direction:"sendrecv"}));else null===(d=this.peerConnection)||void 0===d||d.addTransceiver("audio",{direction:"recvonly"})}else null===(i=this.peerConnection)||void 0===i||i.addTransceiver("audio",{direction:"recvonly"})}))}onVideoStats(e){}onSendWebRTCOffer(e){}onSendWebRTCAnswer(e){}showTextOverlayConnecting(){}showTextOverlaySetupFailure(){}parseAvailableCodecs(e){if(!RTCRtpReceiver.getCapabilities)return["Only available on Chrome"];const t=[],s=(0,Fe.splitSections)(e.sdp);return s.shift(),s.forEach((e=>{const{codecs:s}=(0,Fe.parseRtpParameters)(e),n=/(VP\d|H26\d|AV1).*/;s.forEach((e=>{const s=e.name+" "+Object.keys(e.parameters||{}).map((t=>t+"="+e.parameters[t])).join(";");if(null!==n.exec(s)){"VP9"==e.name&&(e.parameters={"profile-id":"0"});const s=e.name+" "+Object.keys(e.parameters||{}).map((t=>t+"="+e.parameters[t])).join(";");t.push(s)}}))})),t}}class _e{constructor(){this.PixelStreamingSettings=new He,this.EncoderSettings=new We,this.WebRTCSettings=new Ve}ueCompatible(){null!=this.WebRTCSettings.MaxFPS&&(this.WebRTCSettings.FPS=this.WebRTCSettings.MaxFPS)}}class He{}class We{}class Ve{}class Ne{constructor(){this.ReceiptTimeMs=null,this.TransmissionTimeMs=null,this.PreCaptureTimeMs=null,this.PostCaptureTimeMs=null,this.PreEncodeTimeMs=null,this.PostEncodeTimeMs=null,this.EncodeMs=null,this.CaptureToSendMs=null,this.testStartTimeMs=0,this.browserReceiptTimeMs=0,this.latencyExcludingDecode=0,this.testDuration=0,this.networkLatency=0,this.browserSendLatency=0,this.frameDisplayDeltaTimeMs=0,this.endToEndLatency=0,this.encodeLatency=0}setFrameDisplayDeltaTime(e){0==this.frameDisplayDeltaTimeMs&&(this.frameDisplayDeltaTimeMs=Math.round(e))}processFields(){null!=this.EncodeMs||null==this.PreEncodeTimeMs&&null==this.PostEncodeTimeMs||(i.Log(i.GetStackTrace(),`Setting Encode Ms \n ${this.PostEncodeTimeMs} \n ${this.PreEncodeTimeMs}`,6),this.EncodeMs=this.PostEncodeTimeMs-this.PreEncodeTimeMs),null!=this.CaptureToSendMs||null==this.PreCaptureTimeMs&&null==this.PostCaptureTimeMs||(i.Log(i.GetStackTrace(),`Setting CaptureToSendMs Ms \n ${this.PostCaptureTimeMs} \n ${this.PreCaptureTimeMs}`,6),this.CaptureToSendMs=this.PostCaptureTimeMs-this.PreCaptureTimeMs)}}class Ke{static setExtensionFromBytes(e,t){t.receiving||(t.mimetype="",t.extension="",t.receiving=!0,t.valid=!1,t.size=0,t.data=[],t.timestampStart=(new Date).getTime(),i.Log(i.GetStackTrace(),"Received first chunk of file",6));const s=new TextDecoder("utf-16").decode(e.slice(1));i.Log(i.GetStackTrace(),s,6),t.extension=s}static setMimeTypeFromBytes(e,t){t.receiving||(t.mimetype="",t.extension="",t.receiving=!0,t.valid=!1,t.size=0,t.data=[],t.timestampStart=(new Date).getTime(),i.Log(i.GetStackTrace(),"Received first chunk of file",6));const s=new TextDecoder("utf-16").decode(e.slice(1));i.Log(i.GetStackTrace(),s,6),t.mimetype=s}static setContentsFromBytes(e,t){if(!t.receiving)return;t.size=Math.ceil(new DataView(e.slice(1,5).buffer).getInt32(0,!0)/16379);const s=e.slice(5);if(t.data.push(s),i.Log(i.GetStackTrace(),`Received file chunk: ${t.data.length}/${t.size}`,6),t.data.length===t.size){t.receiving=!1,t.valid=!0,i.Log(i.GetStackTrace(),"Received complete file",6);const e=(new Date).getTime()-t.timestampStart,s=Math.round(16*t.size*1024/e);i.Log(i.GetStackTrace(),`Average transfer bitrate: ${s}kb/s over ${e/1e3} seconds`,6);const n=new Blob(t.data,{type:t.mimetype}),r=document.createElement("a");r.setAttribute("href",URL.createObjectURL(n)),r.setAttribute("download",`transfer.${t.extension}`),document.body.append(r),r.remove()}else t.data.length>t.size&&(t.receiving=!1,i.Error(i.GetStackTrace(),`Received bigger file than advertised: ${t.data.length}/${t.size}`))}}class Qe{constructor(){this.mimetype="",this.extension="",this.receiving=!1,this.size=0,this.data=[],this.valid=!1}}class qe{}qe.mainButton=0,qe.auxiliaryButton=1,qe.secondaryButton=2,qe.fourthButton=3,qe.fifthButton=4;class $e{}$e.primaryButton=1,$e.secondaryButton=2,$e.auxiliaryButton=4,$e.fourthButton=8,$e.fifthButton=16;class Xe{constructor(){this.unregisterCallbacks=[]}addUnregisterCallback(e){this.unregisterCallbacks.push(e)}unregisterAll(){for(const e of this.unregisterCallbacks)e();this.unregisterCallbacks=[]}}class je{constructor(e,t,s){this.touchEventListenerTracker=new Xe,this.toStreamerMessagesProvider=e,this.videoElementProvider=t,this.coordinateConverter=s;const n=e=>this.onTouchStart(e),r=e=>this.onTouchEnd(e),i=e=>this.onTouchMove(e);document.addEventListener("touchstart",n,{passive:!1}),document.addEventListener("touchend",r,{passive:!1}),document.addEventListener("touchmove",i,{passive:!1}),this.touchEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("touchstart",n))),this.touchEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("touchend",r))),this.touchEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("touchmove",i)))}unregisterTouchEvents(){this.touchEventListenerTracker.unregisterAll()}setVideoElementParentClientRect(e){this.videoElementParentClientRect=e}onTouchStart(e){if(this.videoElementProvider.isVideoReady()){if(null==this.fakeTouchFinger){const t=e.changedTouches[0];this.fakeTouchFinger=new Je(t.identifier,t.clientX-this.videoElementParentClientRect.left,t.clientY-this.videoElementParentClientRect.top);const s=this.videoElementProvider.getVideoParentElement(),n=new MouseEvent("mouseenter",t);s.dispatchEvent(n);const r=this.coordinateConverter.normalizeAndQuantizeUnsigned(this.fakeTouchFinger.x,this.fakeTouchFinger.y);this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDown")([qe.mainButton,r.x,r.y])}e.preventDefault()}}onTouchEnd(e){if(!this.videoElementProvider.isVideoReady())return;const t=this.videoElementProvider.getVideoParentElement(),s=this.toStreamerMessagesProvider.toStreamerHandlers;for(let n=0;n<e.changedTouches.length;n++){const r=e.changedTouches[n];if(r.identifier===this.fakeTouchFinger.id){const e=r.clientX-this.videoElementParentClientRect.left,n=r.clientY-this.videoElementParentClientRect.top,i=this.coordinateConverter.normalizeAndQuantizeUnsigned(e,n);s.get("MouseUp")([qe.mainButton,i.x,i.y]);const a=new MouseEvent("mouseleave",r);t.dispatchEvent(a),this.fakeTouchFinger=null;break}}e.preventDefault()}onTouchMove(e){if(!this.videoElementProvider.isVideoReady())return;const t=this.toStreamerMessagesProvider.toStreamerHandlers;for(let s=0;s<e.touches.length;s++){const n=e.touches[s];if(n.identifier===this.fakeTouchFinger.id){const e=n.clientX-this.videoElementParentClientRect.left,s=n.clientY-this.videoElementParentClientRect.top,r=this.coordinateConverter.normalizeAndQuantizeUnsigned(e,s),i=this.coordinateConverter.normalizeAndQuantizeSigned(e-this.fakeTouchFinger.x,s-this.fakeTouchFinger.y);t.get("MouseMove")([r.x,r.y,i.x,i.y]),this.fakeTouchFinger.x=e,this.fakeTouchFinger.y=s;break}}e.preventDefault()}}class Je{constructor(e,t,s){this.id=e,this.x=t,this.y=s}}class Ye{}Ye.backSpace=8,Ye.shift=16,Ye.control=17,Ye.alt=18,Ye.rightShift=253,Ye.rightControl=254,Ye.rightAlt=255;class Ze{constructor(e,t,s){this.keyboardEventListenerTracker=new Xe,this.CodeToKeyCode={Escape:27,Digit0:48,Digit1:49,Digit2:50,Digit3:51,Digit4:52,Digit5:53,Digit6:54,Digit7:55,Digit8:56,Digit9:57,Minus:173,Equal:187,Backspace:8,Tab:9,KeyQ:81,KeyW:87,KeyE:69,KeyR:82,KeyT:84,KeyY:89,KeyU:85,KeyI:73,KeyO:79,KeyP:80,BracketLeft:219,BracketRight:221,Enter:13,ControlLeft:17,KeyA:65,KeyS:83,KeyD:68,KeyF:70,KeyG:71,KeyH:72,KeyJ:74,KeyK:75,KeyL:76,Semicolon:186,Quote:222,Backquote:192,ShiftLeft:16,Backslash:220,KeyZ:90,KeyX:88,KeyC:67,KeyV:86,KeyB:66,KeyN:78,KeyM:77,Comma:188,Period:190,Slash:191,ShiftRight:253,AltLeft:18,Space:32,CapsLock:20,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,Pause:19,ScrollLock:145,NumpadDivide:111,NumpadMultiply:106,NumpadSubtract:109,NumpadAdd:107,NumpadDecimal:110,Numpad9:105,Numpad8:104,Numpad7:103,Numpad6:102,Numpad5:101,Numpad4:100,Numpad3:99,Numpad2:98,Numpad1:97,Numpad0:96,NumLock:144,ControlRight:254,AltRight:255,Home:36,End:35,ArrowUp:38,ArrowLeft:37,ArrowRight:39,ArrowDown:40,PageUp:33,PageDown:34,Insert:45,Delete:46,ContextMenu:93},this.toStreamerMessagesProvider=e,this.config=t,this.activeKeysProvider=s}registerKeyBoardEvents(){const e=e=>this.handleOnKeyDown(e),t=e=>this.handleOnKeyUp(e),s=e=>this.handleOnKeyPress(e);document.addEventListener("keydown",e),document.addEventListener("keyup",t),document.addEventListener("keypress",s),this.keyboardEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("keydown",e))),this.keyboardEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("keyup",t))),this.keyboardEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("keypress",s)))}unregisterKeyBoardEvents(){this.keyboardEventListenerTracker.unregisterAll()}handleOnKeyDown(e){const t=this.getKeycode(e);t&&(i.Log(i.GetStackTrace(),`key down ${t}, repeat = ${e.repeat}`,6),this.toStreamerMessagesProvider.toStreamerHandlers.get("KeyDown")([this.getKeycode(e),e.repeat?1:0]),this.activeKeysProvider.getActiveKeys().push(t),t===Ye.backSpace&&document.dispatchEvent(new KeyboardEvent("keypress",{charCode:Ye.backSpace})),this.config.isFlagEnabled(he.SuppressBrowserKeys)&&this.isKeyCodeBrowserKey(t)&&e.preventDefault())}handleOnKeyUp(e){const t=this.getKeycode(e);t&&(i.Log(i.GetStackTrace(),`key up ${t}`,6),this.toStreamerMessagesProvider.toStreamerHandlers.get("KeyUp")([t]),this.config.isFlagEnabled(he.SuppressBrowserKeys)&&this.isKeyCodeBrowserKey(t)&&e.preventDefault())}handleOnKeyPress(e){if(!("charCode"in e))return void i.Warning(i.GetStackTrace(),"KeyboardEvent.charCode is deprecated in this browser, cannot send key press.");const t=e.charCode;i.Log(i.GetStackTrace(),`key press ${t}`,6),this.toStreamerMessagesProvider.toStreamerHandlers.get("KeyPress")([t])}getKeycode(e){if(!("keyCode"in e)){const t=e;return t.code in this.CodeToKeyCode?this.CodeToKeyCode[t.code]:(i.Warning(i.GetStackTrace(),`Keyboard code of ${t.code} is not supported in our mapping, ignoring this key.`),null)}return e.keyCode===Ye.shift&&"ShiftRight"===e.code?Ye.rightShift:e.keyCode===Ye.control&&"ControlRight"===e.code?Ye.rightControl:e.keyCode===Ye.alt&&"AltRight"===e.code?Ye.rightAlt:e.keyCode}isKeyCodeBrowserKey(e){return e>=112&&e<=123||9===e}}class et{constructor(e,t,s){this.x=0,this.y=0,this.updateMouseMovePositionEvent=e=>{this.updateMouseMovePosition(e)},this.mouseEventListenerTracker=new Xe,this.videoElementProvider=e,this.mouseController=t,this.activeKeysProvider=s;const n=this.videoElementProvider.getVideoParentElement();this.x=n.getBoundingClientRect().width/2,this.y=n.getBoundingClientRect().height/2,this.coord=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(this.x,this.y)}unregisterMouseEvents(){this.mouseEventListenerTracker.unregisterAll()}lockStateChange(){const e=this.videoElementProvider.getVideoParentElement(),t=this.mouseController.toStreamerMessagesProvider.toStreamerHandlers;if(document.pointerLockElement===e||document.mozPointerLockElement===e)i.Log(i.GetStackTrace(),"Pointer locked",6),document.addEventListener("mousemove",this.updateMouseMovePositionEvent,!1),this.mouseEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("mousemove",this.updateMouseMovePositionEvent,!1)));else{i.Log(i.GetStackTrace(),"The pointer lock status is now unlocked",6),document.removeEventListener("mousemove",this.updateMouseMovePositionEvent,!1);let e=this.activeKeysProvider.getActiveKeys();const s=new Set(e),n=[];s.forEach((e=>{n[e]})),n.forEach((e=>{t.get("KeyUp")([e])})),e=[]}}updateMouseMovePosition(e){if(!this.videoElementProvider.isVideoReady())return;const t=this.mouseController.toStreamerMessagesProvider.toStreamerHandlers,s=this.videoElementProvider.getVideoParentElement().clientWidth,n=this.videoElementProvider.getVideoParentElement().clientHeight;this.x+=e.movementX,this.y+=e.movementY,this.x>s&&(this.x-=s),this.y>n&&(this.y-=n),this.x<0&&(this.x=s+this.x),this.y<0&&(this.y=n-this.y),this.coord=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(this.x,this.y);const r=this.mouseController.coordinateConverter.normalizeAndQuantizeSigned(e.movementX,e.movementY);t.get("MouseMove")([this.coord.x,this.coord.y,r.x,r.y])}handleMouseDown(e){this.videoElementProvider.isVideoReady()&&this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDown")([e.button,this.coord.x,this.coord.y])}handleMouseUp(e){this.videoElementProvider.isVideoReady()&&this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp")([e.button,this.coord.x,this.coord.y])}handleMouseWheel(e){this.videoElementProvider.isVideoReady()&&this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseWheel")([e.wheelDelta,this.coord.x,this.coord.y])}handleMouseDouble(e){this.videoElementProvider.isVideoReady()&&this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDouble")([e.button,this.coord.x,this.coord.y])}handlePressMouseButtons(e){this.videoElementProvider.isVideoReady()&&this.mouseController.pressMouseButtons(e.buttons,this.x,this.y)}handleReleaseMouseButtons(e){this.videoElementProvider.isVideoReady()&&this.mouseController.releaseMouseButtons(e.buttons,this.x,this.y)}}class tt{constructor(e){this.mouseController=e}unregisterMouseEvents(){}updateMouseMovePosition(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;i.Log(i.GetStackTrace(),"MouseMove",6);const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY),s=this.mouseController.coordinateConverter.normalizeAndQuantizeSigned(e.movementX,e.movementY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseMove")([t.x,t.y,s.x,s.y]),e.preventDefault()}handleMouseDown(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;i.Log(i.GetStackTrace(),"onMouse Down",6);const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDown")([e.button,t.x,t.y]),e.preventDefault()}handleMouseUp(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;i.Log(i.GetStackTrace(),"onMouse Up",6);const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp")([e.button,t.x,t.y]),e.preventDefault()}handleContextMenu(e){this.mouseController.videoElementProvider.isVideoReady()&&e.preventDefault()}handleMouseWheel(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseWheel")([e.wheelDelta,t.x,t.y]),e.preventDefault()}handleMouseDouble(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDouble")([e.button,t.x,t.y])}handlePressMouseButtons(e){this.mouseController.videoElementProvider.isVideoReady()&&(i.Log(i.GetStackTrace(),"onMouse press",6),this.mouseController.pressMouseButtons(e.buttons,e.offsetX,e.offsetY))}handleReleaseMouseButtons(e){this.mouseController.videoElementProvider.isVideoReady()&&(i.Log(i.GetStackTrace(),"onMouse release",6),this.mouseController.releaseMouseButtons(e.buttons,e.offsetX,e.offsetY))}}class st{constructor(e,t,s,n){this.mouseEventListenerTracker=new Xe,this.toStreamerMessagesProvider=e,this.coordinateConverter=s,this.videoElementProvider=t,this.activeKeysProvider=n,this.registerMouseEnterAndLeaveEvents()}unregisterMouseEvents(){this.mouseEventListenerTracker.unregisterAll()}registerLockedMouseEvents(e){const t=this.videoElementProvider.getVideoParentElement(),s=new et(this.videoElementProvider,e,this.activeKeysProvider);if(t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock,document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock,t.requestPointerLock){const e=()=>{t.requestPointerLock()};t.addEventListener("click",e),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("click",e)))}const n=()=>s.lockStateChange();document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),this.mouseEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("pointerlockchange",n,!1))),this.mouseEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("mozpointerlockchange",n,!1)));const r=e=>s.handleMouseDown(e),i=e=>s.handleMouseUp(e),a=e=>s.handleMouseWheel(e),o=e=>s.handleMouseDouble(e);t.addEventListener("mousedown",r),t.addEventListener("mouseup",i),t.addEventListener("wheel",a),t.addEventListener("dblclick",o),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("mousedown",r))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("mouseup",i))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("wheel",a))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("dblclick",o))),this.mouseEventListenerTracker.addUnregisterCallback((()=>s.unregisterMouseEvents())),this.mouseEventListenerTracker.addUnregisterCallback((()=>{!document.exitPointerLock||document.pointerLockElement!==t&&document.mozPointerLockElement!==t||document.exitPointerLock()}))}registerHoveringMouseEvents(e){const t=this.videoElementProvider.getVideoParentElement(),s=new tt(e),n=e=>s.updateMouseMovePosition(e),r=e=>s.handleMouseDown(e),i=e=>s.handleMouseUp(e),a=e=>s.handleContextMenu(e),o=e=>s.handleMouseWheel(e),l=e=>s.handleMouseDouble(e);t.addEventListener("mousemove",n),t.addEventListener("mousedown",r),t.addEventListener("mouseup",i),t.addEventListener("contextmenu",a),t.addEventListener("wheel",o),t.addEventListener("dblclick",l),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("mousemove",n))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("mousedown",r))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("mouseup",i))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("contextmenu",a))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("wheel",o))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("dblclick",l))),this.mouseEventListenerTracker.addUnregisterCallback((()=>s.unregisterMouseEvents()))}registerMouseEnterAndLeaveEvents(){const e=this.videoElementProvider.getVideoParentElement(),t=e=>{this.videoElementProvider.isVideoReady()&&(i.Log(i.GetStackTrace(),"Mouse Entered",6),this.sendMouseEnter(),this.pressMouseButtons(e.buttons,e.x,e.y))},s=e=>{this.videoElementProvider.isVideoReady()&&(i.Log(i.GetStackTrace(),"Mouse Left",6),this.sendMouseLeave(),this.releaseMouseButtons(e.buttons,e.x,e.y))};e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",s),this.mouseEventListenerTracker.addUnregisterCallback((()=>e.removeEventListener("mouseenter",t))),this.mouseEventListenerTracker.addUnregisterCallback((()=>e.removeEventListener("mouseleave",s)))}releaseMouseButtons(e,t,s){const n=this.coordinateConverter.normalizeAndQuantizeUnsigned(t,s);e&$e.primaryButton&&this.sendMouseUp(qe.mainButton,n.x,n.y),e&$e.secondaryButton&&this.sendMouseUp(qe.secondaryButton,n.x,n.y),e&$e.auxiliaryButton&&this.sendMouseUp(qe.auxiliaryButton,n.x,n.y),e&$e.fourthButton&&this.sendMouseUp(qe.fourthButton,n.x,n.y),e&$e.fifthButton&&this.sendMouseUp(qe.fifthButton,n.x,n.y)}pressMouseButtons(e,t,s){if(!this.videoElementProvider.isVideoReady())return;const n=this.coordinateConverter.normalizeAndQuantizeUnsigned(t,s);e&$e.primaryButton&&this.sendMouseDown(qe.mainButton,n.x,n.y),e&$e.secondaryButton&&this.sendMouseDown(qe.secondaryButton,n.x,n.y),e&$e.auxiliaryButton&&this.sendMouseDown(qe.auxiliaryButton,n.x,n.y),e&$e.fourthButton&&this.sendMouseDown(qe.fourthButton,n.x,n.y),e&$e.fifthButton&&this.sendMouseDown(qe.fifthButton,n.x,n.y)}sendMouseEnter(){this.videoElementProvider.isVideoReady()&&this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseEnter")()}sendMouseLeave(){this.videoElementProvider.isVideoReady()&&this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseLeave")()}sendMouseDown(e,t,s){this.videoElementProvider.isVideoReady()&&(i.Log(i.GetStackTrace(),`mouse button ${e} down at (${t}, ${s})`,6),this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDown")([e,t,s]))}sendMouseUp(e,t,s){if(!this.videoElementProvider.isVideoReady())return;i.Log(i.GetStackTrace(),`mouse button ${e} up at (${t}, ${s})`,6);const n=this.coordinateConverter.normalizeAndQuantizeUnsigned(t,s);this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp")([e,n.x,n.y])}}class nt{constructor(e,t,s){this.fingers=[9,8,7,6,5,4,3,2,1,0],this.fingerIds=new Map,this.maxByteValue=255,this.touchEventListenerTracker=new Xe,this.toStreamerMessagesProvider=e,this.videoElementProvider=t,this.coordinateConverter=s,this.videoElementParent=t.getVideoElement();const n=e=>this.onTouchStart(e),r=e=>this.onTouchEnd(e),a=e=>this.onTouchMove(e);this.videoElementParent.addEventListener("touchstart",n),this.videoElementParent.addEventListener("touchend",r),this.videoElementParent.addEventListener("touchmove",a),this.touchEventListenerTracker.addUnregisterCallback((()=>this.videoElementParent.removeEventListener("touchstart",n))),this.touchEventListenerTracker.addUnregisterCallback((()=>this.videoElementParent.removeEventListener("touchend",r))),this.touchEventListenerTracker.addUnregisterCallback((()=>this.videoElementParent.removeEventListener("touchmove",a))),i.Log(i.GetStackTrace(),"Touch Events Registered",6);const o=e=>{e.preventDefault()};document.addEventListener("touchmove",o),this.touchEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("touchmove",o)))}unregisterTouchEvents(){this.touchEventListenerTracker.unregisterAll()}rememberTouch(e){const t=this.fingers.pop();void 0===t&&i.Log(i.GetStackTrace(),"exhausted touch identifiers",6),this.fingerIds.set(e.identifier,t)}forgetTouch(e){this.fingers.push(this.fingerIds.get(e.identifier)),this.fingers.sort((function(e,t){return t-e})),this.fingerIds.delete(e.identifier)}onTouchStart(e){if(this.videoElementProvider.isVideoReady()){for(let t=0;t<e.changedTouches.length;t++)this.rememberTouch(e.changedTouches[t]);i.Log(i.GetStackTrace(),"touch start",6),this.emitTouchData("TouchStart",e.changedTouches),e.preventDefault()}}onTouchEnd(e){if(this.videoElementProvider.isVideoReady()){i.Log(i.GetStackTrace(),"touch end",6),this.emitTouchData("TouchEnd",e.changedTouches);for(let t=0;t<e.changedTouches.length;t++)this.forgetTouch(e.changedTouches[t]);e.preventDefault()}}onTouchMove(e){this.videoElementProvider.isVideoReady()&&(i.Log(i.GetStackTrace(),"touch move",6),this.emitTouchData("TouchMove",e.touches),e.preventDefault())}emitTouchData(e,t){let s=document.querySelector(".screen"),n=Math.floor(s.getBoundingClientRect().width*window.devicePixelRatio),r=Math.floor(s.getBoundingClientRect().height*window.devicePixelRatio),a=Math.floor(window.screen.width*window.devicePixelRatio),o=Math.floor(window.screen.height*window.devicePixelRatio),l=(Math.floor(document.documentElement.clientWidth*window.devicePixelRatio),o-Math.floor(document.documentElement.clientHeight*window.devicePixelRatio)),d=document.querySelector(".screen").clientWidth/r,c=document.querySelector(".screen").clientHeight/n;if(!this.videoElementProvider.isVideoReady())return;this.videoElementProvider.getVideoParentElement().getBoundingClientRect();const h=this.toStreamerMessagesProvider.toStreamerHandlers;for(let s=0;s<t.length;s++){const g=1,u=t[s];let m,S;m=c*(Math.floor(u.clientY*window.devicePixelRatio)-Math.floor((o-l-r)/2)),S=d*(n-(Math.floor(u.clientX*window.devicePixelRatio)-Math.floor((a-n)/2))),i.Log(i.GetStackTrace(),`F${this.fingerIds.get(u.identifier)}=(${m}, ${S})`,6);const v=this.coordinateConverter.normalizeAndQuantizeUnsigned(m,S);switch(e){case"TouchStart":h.get("TouchStart")([g,v.x,v.y,this.fingerIds.get(u.identifier),this.maxByteValue*u.force,v.inRange?1:0]);break;case"TouchEnd":h.get("TouchEnd")([g,v.x,v.y,this.fingerIds.get(u.identifier),this.maxByteValue*u.force,v.inRange?1:0]);break;case"TouchMove":h.get("TouchMove")([g,v.x,v.y,this.fingerIds.get(u.identifier),this.maxByteValue*u.force,v.inRange?1:0])}}}}class rt{constructor(e){this.gamePadEventListenerTracker=new Xe,this.toStreamerMessagesProvider=e,this.requestAnimationFrame=(window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.requestAnimationFrame).bind(window);const t=window;if("GamepadEvent"in t){const e=e=>this.gamePadConnectHandler(e),t=e=>this.gamePadDisconnectHandler(e);window.addEventListener("gamepadconnected",e),window.addEventListener("gamepaddisconnected",t),this.gamePadEventListenerTracker.addUnregisterCallback((()=>window.removeEventListener("gamepadconnected",e))),this.gamePadEventListenerTracker.addUnregisterCallback((()=>window.removeEventListener("gamepaddisconnected",t)))}else if("WebKitGamepadEvent"in t){const e=e=>this.gamePadConnectHandler(e),t=e=>this.gamePadDisconnectHandler(e);window.addEventListener("webkitgamepadconnected",e),window.addEventListener("webkitgamepaddisconnected",t),this.gamePadEventListenerTracker.addUnregisterCallback((()=>window.removeEventListener("webkitgamepadconnected",e))),this.gamePadEventListenerTracker.addUnregisterCallback((()=>window.removeEventListener("webkitgamepaddisconnected",t)))}if(this.controllers=[],navigator.getGamepads)for(const e of navigator.getGamepads())e&&this.gamePadConnectHandler(new GamepadEvent("gamepadconnected",{gamepad:e}))}unregisterGamePadEvents(){this.gamePadEventListenerTracker.unregisterAll();for(const e of this.controllers)void 0!==e.id&&this.onGamepadDisconnected(e.id);this.controllers=[],this.onGamepadConnected=()=>{},this.onGamepadDisconnected=()=>{}}gamePadConnectHandler(e){i.Log(i.GetStackTrace(),"Gamepad connect handler",6);const t=e.gamepad,s={currentState:t,prevState:t,id:void 0};this.controllers.push(s),this.controllers[t.index].currentState=t,this.controllers[t.index].prevState=t,i.Log(i.GetStackTrace(),"gamepad: "+t.id+" connected",6),window.requestAnimationFrame((()=>this.updateStatus())),this.onGamepadConnected()}gamePadDisconnectHandler(e){i.Log(i.GetStackTrace(),"Gamepad disconnect handler",6),i.Log(i.GetStackTrace(),"gamepad: "+e.gamepad.id+" disconnected",6);const t=this.controllers[e.gamepad.index];delete this.controllers[e.gamepad.index],this.controllers=this.controllers.filter((e=>void 0!==e)),this.onGamepadDisconnected(t.id)}scanGamePads(){const e=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads():[];for(let t=0;t<e.length;t++)e[t]&&e[t].index in this.controllers&&(this.controllers[e[t].index].currentState=e[t])}updateStatus(){this.scanGamePads();const e=this.toStreamerMessagesProvider.toStreamerHandlers;for(const t of this.controllers){const s=void 0===t.id?this.controllers.indexOf(t):t.id,n=t.currentState;for(let n=0;n<t.currentState.buttons.length;n++){const r=t.currentState.buttons[n],i=t.prevState.buttons[n];r.pressed?n==Ge.LeftTrigger?e.get("GamepadAnalog")([s,5,r.value]):n==Ge.RightTrigger?e.get("GamepadAnalog")([s,6,r.value]):e.get("GamepadButtonPressed")([s,n,i.pressed?1:0]):!r.pressed&&i.pressed&&(n==Ge.LeftTrigger?e.get("GamepadAnalog")([s,5,0]):n==Ge.RightTrigger?e.get("GamepadAnalog")([s,6,0]):e.get("GamepadButtonReleased")([s,n]))}for(let t=0;t<n.axes.length;t+=2){const r=parseFloat(n.axes[t].toFixed(4)),i=-parseFloat(n.axes[t+1].toFixed(4));e.get("GamepadAnalog")([s,t+1,r]),e.get("GamepadAnalog")([s,t+2,i])}this.controllers[s].prevState=n}this.controllers.length>0&&this.requestAnimationFrame((()=>this.updateStatus()))}onGamepadResponseReceived(e){for(const t of this.controllers)if(void 0===t.id){t.id=e;break}}onGamepadConnected(){}onGamepadDisconnected(e){}}!function(e){e[e.RightClusterBottomButton=0]="RightClusterBottomButton",e[e.RightClusterRightButton=1]="RightClusterRightButton",e[e.RightClusterLeftButton=2]="RightClusterLeftButton",e[e.RightClusterTopButton=3]="RightClusterTopButton",e[e.LeftShoulder=4]="LeftShoulder",e[e.RightShoulder=5]="RightShoulder",e[e.LeftTrigger=6]="LeftTrigger",e[e.RightTrigger=7]="RightTrigger",e[e.SelectOrBack=8]="SelectOrBack",e[e.StartOrForward=9]="StartOrForward",e[e.LeftAnalogPress=10]="LeftAnalogPress",e[e.RightAnalogPress=11]="RightAnalogPress",e[e.LeftClusterTopButton=12]="LeftClusterTopButton",e[e.LeftClusterBottomButton=13]="LeftClusterBottomButton",e[e.LeftClusterLeftButton=14]="LeftClusterLeftButton",e[e.LeftClusterRightButton=15]="LeftClusterRightButton",e[e.CentreButton=16]="CentreButton",e[e.LeftStickHorizontal=0]="LeftStickHorizontal",e[e.LeftStickVertical=1]="LeftStickVertical",e[e.RightStickHorizontal=2]="RightStickHorizontal",e[e.RightStickVertical=3]="RightStickVertical"}(Ge||(Ge={}));class it{constructor(e,t,s){this.activeKeys=new at,this.toStreamerMessagesProvider=e,this.videoElementProvider=t,this.coordinateConverter=s}registerKeyBoard(e){i.Log(i.GetStackTrace(),"Register Keyboard Events",7);const t=new Ze(this.toStreamerMessagesProvider,e,this.activeKeys);return t.registerKeyBoardEvents(),t}registerMouse(e){i.Log(i.GetStackTrace(),"Register Mouse Events",7);const t=new st(this.toStreamerMessagesProvider,this.videoElementProvider,this.coordinateConverter,this.activeKeys);switch(e){case Te.LockedMouse:t.registerLockedMouseEvents(t);break;case Te.HoveringMouse:t.registerHoveringMouseEvents(t);break;default:i.Info(i.GetStackTrace(),"unknown Control Scheme Type Defaulting to Locked Mouse Events"),t.registerLockedMouseEvents(t)}return t}registerTouch(e,t){if(i.Log(i.GetStackTrace(),"Registering Touch",6),e){const e=new je(this.toStreamerMessagesProvider,this.videoElementProvider,this.coordinateConverter);return e.setVideoElementParentClientRect(t),e}return new nt(this.toStreamerMessagesProvider,this.videoElementProvider,this.coordinateConverter)}registerGamePad(){return i.Log(i.GetStackTrace(),"Register Game Pad",7),new rt(this.toStreamerMessagesProvider)}}class at{constructor(){this.activeKeys=[],this.activeKeys=[]}getActiveKeys(){return this.activeKeys}}class ot{constructor(e,t){this.lastTimeResized=(new Date).getTime(),this.videoElement=document.createElement("video"),this.config=t,this.videoElement.id="streamingVideo",this.videoElement.disablePictureInPicture=!0,this.videoElement.playsInline=!0,this.videoElement.style.width="100%",this.videoElement.style.height="100%",this.videoElement.style.position="absolute",this.videoElement.style.pointerEvents="all",e.appendChild(this.videoElement),this.onResizePlayerCallback=()=>{console.log("Resolution changed, restyling player, did you forget to override this function?")},this.onMatchViewportResolutionCallback=()=>{console.log("Resolution changed and match viewport resolution is turned on, did you forget to override this function?")},this.videoElement.onclick=()=>{null!=this.audioElement&&this.audioElement.paused&&this.audioElement.play(),this.videoElement.paused&&this.videoElement.play()},this.videoElement.onloadedmetadata=()=>{this.onVideoInitialized()},window.addEventListener("resize",(()=>this.resizePlayerStyle()),!0),window.addEventListener("orientationchange",(()=>this.onOrientationChange()))}setAudioElement(e){this.audioElement=e}play(){return this.videoElement.muted=this.config.isFlagEnabled(he.StartVideoMuted),this.videoElement.autoplay=this.config.isFlagEnabled(he.AutoPlayVideo),this.videoElement.play()}isPaused(){return this.videoElement.paused}isVideoReady(){return void 0!==this.videoElement.readyState&&this.videoElement.readyState>0}hasVideoSource(){return void 0!==this.videoElement.srcObject&&null!==this.videoElement.srcObject}getVideoElement(){return this.videoElement}getVideoParentElement(){return this.videoElement.parentElement}setVideoEnabled(e){this.videoElement.srcObject.getTracks().forEach((t=>t.enabled=e))}onVideoInitialized(){}onOrientationChange(){clearTimeout(this.orientationChangeTimeout),this.orientationChangeTimeout=window.setTimeout((()=>{this.resizePlayerStyle()}),500)}resizePlayerStyle(){const e=this.getVideoParentElement();e&&(this.updateVideoStreamSize(),e.classList.contains("fixed-size")||this.resizePlayerStyleToFillParentElement(),this.onResizePlayerCallback())}resizePlayerStyleToFillParentElement(){this.getVideoParentElement().setAttribute("style","top: 0px; left: 0px; width: 100%; height: 100%; cursor: default;")}updateVideoStreamSize(){if(this.config.isFlagEnabled(he.MatchViewportResolution))if((new Date).getTime()-this.lastTimeResized>300){const e=this.getVideoParentElement();if(!e)return;this.onMatchViewportResolutionCallback(e.clientWidth,e.clientHeight),this.lastTimeResized=(new Date).getTime()}else i.Log(i.GetStackTrace(),"Resizing too often - skipping",6),clearTimeout(this.resizeTimeoutHandle),this.resizeTimeoutHandle=window.setTimeout((()=>this.updateVideoStreamSize()),100)}}class lt{constructor(){this.toStreamerHandlers=new Map,this.fromStreamerHandlers=new Map,this.toStreamerMessages=new Map,this.fromStreamerMessages=new Map}populateDefaultProtocol(){this.toStreamerMessages.set("IFrameRequest",{id:0,structure:[]}),this.toStreamerMessages.set("RequestQualityControl",{id:1,structure:[]}),this.toStreamerMessages.set("FpsRequest",{id:2,structure:[]}),this.toStreamerMessages.set("AverageBitrateRequest",{id:3,structure:[]}),this.toStreamerMessages.set("StartStreaming",{id:4,structure:[]}),this.toStreamerMessages.set("StopStreaming",{id:5,structure:[]}),this.toStreamerMessages.set("LatencyTest",{id:6,structure:["string"]}),this.toStreamerMessages.set("RequestInitialSettings",{id:7,structure:[]}),this.toStreamerMessages.set("TestEcho",{id:8,structure:[]}),this.toStreamerMessages.set("DataChannelLatencyTest",{id:9,structure:[]}),this.toStreamerMessages.set("UIInteraction",{id:50,structure:["string"]}),this.toStreamerMessages.set("Command",{id:51,structure:["string"]}),this.toStreamerMessages.set("KeyDown",{id:60,structure:["uint8","uint8"]}),this.toStreamerMessages.set("KeyUp",{id:61,structure:["uint8"]}),this.toStreamerMessages.set("KeyPress",{id:62,structure:["uint16"]}),this.toStreamerMessages.set("MouseEnter",{id:70,structure:[]}),this.toStreamerMessages.set("MouseLeave",{id:71,structure:[]}),this.toStreamerMessages.set("MouseDown",{id:72,structure:["uint8","uint16","uint16"]}),this.toStreamerMessages.set("MouseUp",{id:73,structure:["uint8","uint16","uint16"]}),this.toStreamerMessages.set("MouseMove",{id:74,structure:["uint16","uint16","int16","int16"]}),this.toStreamerMessages.set("MouseWheel",{id:75,structure:["int16","uint16","uint16"]}),this.toStreamerMessages.set("MouseDouble",{id:76,structure:["uint8","uint16","uint16"]}),this.toStreamerMessages.set("TouchStart",{id:80,structure:["uint8","uint16","uint16","uint8","uint8","uint8"]}),this.toStreamerMessages.set("TouchEnd",{id:81,structure:["uint8","uint16","uint16","uint8","uint8","uint8"]}),this.toStreamerMessages.set("TouchMove",{id:82,structure:["uint8","uint16","uint16","uint8","uint8","uint8"]}),this.toStreamerMessages.set("GamepadConnected",{id:93,structure:[]}),this.toStreamerMessages.set("GamepadButtonPressed",{id:90,structure:["uint8","uint8","uint8"]}),this.toStreamerMessages.set("GamepadButtonReleased",{id:91,structure:["uint8","uint8","uint8"]}),this.toStreamerMessages.set("GamepadAnalog",{id:92,structure:["uint8","uint8","double"]}),this.toStreamerMessages.set("GamepadDisconnected",{id:94,structure:["uint8"]}),this.fromStreamerMessages.set(0,"QualityControlOwnership"),this.fromStreamerMessages.set(1,"Response"),this.fromStreamerMessages.set(2,"Command"),this.fromStreamerMessages.set(3,"FreezeFrame"),this.fromStreamerMessages.set(4,"UnfreezeFrame"),this.fromStreamerMessages.set(5,"VideoEncoderAvgQP"),this.fromStreamerMessages.set(6,"LatencyTest"),this.fromStreamerMessages.set(7,"InitialSettings"),this.fromStreamerMessages.set(8,"FileExtension"),this.fromStreamerMessages.set(9,"FileMimeType"),this.fromStreamerMessages.set(10,"FileContents"),this.fromStreamerMessages.set(11,"TestEcho"),this.fromStreamerMessages.set(12,"InputControlOwnership"),this.fromStreamerMessages.set(13,"GamepadResponse"),this.fromStreamerMessages.set(14,"DataChannelLatencyTest"),this.fromStreamerMessages.set(255,"Protocol")}registerMessageHandler(e,t,s){switch(e){case Ue.ToStreamer:this.toStreamerHandlers.set(t,s);break;case Ue.FromStreamer:this.fromStreamerHandlers.set(t,s);break;default:i.Log(i.GetStackTrace(),`Unknown message direction ${e}`)}}}!function(e){e[e.ToStreamer=0]="ToStreamer",e[e.FromStreamer=1]="FromStreamer"}(Ue||(Ue={}));class dt{constructor(){this.responseEventListeners=new Map}addResponseEventListener(e,t){this.responseEventListeners.set(e,t)}removeResponseEventListener(e){this.responseEventListeners.delete(e)}onResponse(e){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.Response",6);const t=new TextDecoder("utf-16").decode(e.slice(1));i.Log(i.GetStackTrace(),t,6),this.responseEventListeners.forEach((e=>{e(t)}))}}class ct{constructor(e,t){this.dataChannelSender=e,this.toStreamerMessagesMapProvider=t}sendMessageToStreamer(e,t){void 0===t&&(t=[]);const s=this.toStreamerMessagesMapProvider.toStreamerMessages.get(e);if(void 0===s)return void i.Error(i.GetStackTrace(),`Attempted to send a message to the streamer with message type: ${e}, but the frontend hasn't been configured to send such a message. Check you've added the message type in your cpp`);if(s.structure&&t&&s.structure.length!==t.length)return void i.Error(i.GetStackTrace(),`Provided message data doesn't match expected layout. Expected [ ${s.structure.map((e=>{switch(e){case"uint8":case"uint16":case"int16":case"float":case"double":return"number";case"string":return"string"}})).toString()} ] but received [ ${t.map((e=>typeof e)).toString()} ]`);let n=0;const r=new TextEncoder;t.forEach(((e,t)=>{switch(s.structure[t]){case"uint8":n+=1;break;case"uint16":case"int16":n+=2;break;case"float":n+=4;break;case"double":n+=8;break;case"string":n+=2,n+=2*r.encode(e).length}}));const a=new DataView(new ArrayBuffer(n+1));a.setUint8(0,s.id);let o=1;t.forEach(((e,t)=>{switch(s.structure[t]){case"uint8":a.setUint8(o,e),o+=1;break;case"uint16":a.setUint16(o,e,!0),o+=2;break;case"int16":a.setInt16(o,e,!0),o+=2;break;case"float":a.setFloat32(o,e,!0),o+=4;break;case"double":a.setFloat64(o,e,!0),o+=8;break;case"string":a.setUint16(o,e.length,!0),o+=2;for(let t=0;t<e.length;t++)a.setUint16(o,e.charCodeAt(t),!0),o+=2}})),this.dataChannelSender.canSend()?this.dataChannelSender.sendData(a.buffer):i.Info(i.GetStackTrace(),`Data channel cannot send yet, skipping sending message: ${e} - ${new Uint8Array(a.buffer)}`)}}class ht{constructor(e){this.sendMessageController=e}SendRequestQualityControl(){this.sendMessageController.sendMessageToStreamer("RequestQualityControl")}SendMaxFpsRequest(){this.sendMessageController.sendMessageToStreamer("FpsRequest")}SendAverageBitrateRequest(){this.sendMessageController.sendMessageToStreamer("AverageBitrateRequest")}SendStartStreaming(){this.sendMessageController.sendMessageToStreamer("StartStreaming")}SendStopStreaming(){this.sendMessageController.sendMessageToStreamer("StopStreaming")}SendRequestInitialSettings(){this.sendMessageController.sendMessageToStreamer("RequestInitialSettings")}}class gt{constructor(e){this.dataChannelProvider=e}canSend(){return void 0!==this.dataChannelProvider.getDataChannelInstance().dataChannel&&"open"==this.dataChannelProvider.getDataChannelInstance().dataChannel.readyState}sendData(e){const t=this.dataChannelProvider.getDataChannelInstance();"open"==t.dataChannel.readyState?(t.dataChannel.send(e),i.Log(i.GetStackTrace(),`Message Sent: ${new Uint8Array(e)}`,6),this.resetAfkWarningTimerOnDataSend()):i.Error(i.GetStackTrace(),`Message Failed: ${new Uint8Array(e)}`)}resetAfkWarningTimerOnDataSend(){}}class ut{constructor(e){this.videoElementProvider=e,this.normalizeAndQuantizeUnsignedFunc=()=>{throw new Error("Normalize and quantize unsigned, method not implemented.")},this.normalizeAndQuantizeSignedFunc=()=>{throw new Error("Normalize and unquantize signed, method not implemented.")},this.denormalizeAndUnquantizeUnsignedFunc=()=>{throw new Error("Denormalize and unquantize unsigned, method not implemented.")}}normalizeAndQuantizeUnsigned(e,t){return this.normalizeAndQuantizeUnsignedFunc(e,t)}unquantizeAndDenormalizeUnsigned(e,t){return this.denormalizeAndUnquantizeUnsignedFunc(e,t)}normalizeAndQuantizeSigned(e,t){return this.normalizeAndQuantizeSignedFunc(e,t)}setupNormalizeAndQuantize(){if(this.videoElementParent=this.videoElementProvider.getVideoParentElement(),this.videoElement=this.videoElementProvider.getVideoElement(),this.videoElementParent&&this.videoElement){const e=this.videoElementParent.clientHeight/this.videoElementParent.clientWidth,t=this.videoElement.videoHeight/this.videoElement.videoWidth;e>t?(i.Log(i.GetStackTrace(),"Setup Normalize and Quantize for playerAspectRatio > videoAspectRatio",6),this.ratio=e/t,this.normalizeAndQuantizeUnsignedFunc=(e,t)=>this.normalizeAndQuantizeUnsignedPlayerBigger(e,t),this.normalizeAndQuantizeSignedFunc=(e,t)=>this.normalizeAndQuantizeSignedPlayerBigger(e,t),this.denormalizeAndUnquantizeUnsignedFunc=(e,t)=>this.denormalizeAndUnquantizeUnsignedPlayerBigger(e,t)):(i.Log(i.GetStackTrace(),"Setup Normalize and Quantize for playerAspectRatio <= videoAspectRatio",6),this.ratio=t/e,this.normalizeAndQuantizeUnsignedFunc=(e,t)=>this.normalizeAndQuantizeUnsignedPlayerSmaller(e,t),this.normalizeAndQuantizeSignedFunc=(e,t)=>this.normalizeAndQuantizeSignedPlayerSmaller(e,t),this.denormalizeAndUnquantizeUnsignedFunc=(e,t)=>this.denormalizeAndUnquantizeUnsignedPlayerSmaller(e,t))}}normalizeAndQuantizeUnsignedPlayerBigger(e,t){const s=e/this.videoElementParent.clientWidth,n=this.ratio*(t/this.videoElementParent.clientHeight-.5)+.5;return s<0||s>1||n<0||n>1?new mt(!1,65535,65535):new mt(!0,65536*s,65536*n)}denormalizeAndUnquantizeUnsignedPlayerBigger(e,t){const s=e/65536,n=(t/65536-.5)/this.ratio+.5;return new St(s*this.videoElementParent.clientWidth,n*this.videoElementParent.clientHeight)}normalizeAndQuantizeSignedPlayerBigger(e,t){const s=e/(.5*this.videoElementParent.clientWidth),n=this.ratio*t/(.5*this.videoElementParent.clientHeight);return new vt(32767*s,32767*n)}normalizeAndQuantizeUnsignedPlayerSmaller(e,t){const s=this.ratio*(e/this.videoElementParent.clientWidth-.5)+.5,n=t/this.videoElementParent.clientHeight;return s<0||s>1||n<0||n>1?new mt(!1,65535,65535):new mt(!0,65536*s,65536*n)}denormalizeAndUnquantizeUnsignedPlayerSmaller(e,t){const s=(e/65536-.5)/this.ratio+.5,n=t/65536;return new St(s*this.videoElementParent.clientWidth,n*this.videoElementParent.clientHeight)}normalizeAndQuantizeSignedPlayerSmaller(e,t){const s=this.ratio*e/(.5*this.videoElementParent.clientWidth),n=t/(.5*this.videoElementParent.clientHeight);return new vt(32767*s,32767*n)}}class mt{constructor(e,t,s){this.inRange=e,this.x=t,this.y=s}}class St{constructor(e,t){this.x=e,this.y=t}}class vt{constructor(e,t){this.x=e,this.y=t}}class pt{constructor(e,t){this.shouldShowPlayOverlay=!0,this.autoJoinTimer=void 0,this.config=e,this.pixelStreaming=t,this.responseController=new dt,this.file=new Qe,this.sdpConstraints={offerToReceiveAudio:!0,offerToReceiveVideo:!0},this.afkController=new Ee(this.config,this.pixelStreaming,this.onAfkTriggered.bind(this)),this.afkController.onAFKTimedOutCallback=()=>{this.closeSignalingServer("You have been disconnected due to inactivity")},this.freezeFrameController=new M(this.pixelStreaming.videoElementParent),this.videoPlayer=new ot(this.pixelStreaming.videoElementParent,this.config),this.videoPlayer.onVideoInitialized=()=>this.handleVideoInitialized(),this.videoPlayer.onMatchViewportResolutionCallback=(e,t)=>{const s={"Resolution.Width":e,"Resolution.Height":t};this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify(s)])},this.videoPlayer.onResizePlayerCallback=()=>{this.setUpMouseAndFreezeFrame()},this.streamController=new E(this.videoPlayer),this.coordinateConverter=new ut(this.videoPlayer),this.sendrecvDataChannelController=new ye,this.recvDataChannelController=new ye,this.registerDataChannelEventEmitters(this.sendrecvDataChannelController),this.registerDataChannelEventEmitters(this.recvDataChannelController),this.dataChannelSender=new gt(this.sendrecvDataChannelController),this.dataChannelSender.resetAfkWarningTimerOnDataSend=()=>this.afkController.resetAfkWarningTimer(),this.streamMessageController=new lt,this.webSocketController=new T,this.webSocketController.onConfig=e=>this.handleOnConfigMessage(e),this.webSocketController.onStreamerList=e=>this.handleStreamerListMessage(e),this.webSocketController.onPlayerCount=e=>{this.pixelStreaming._onPlayerCount(e.count)},this.webSocketController.onOpen.addEventListener("open",(()=>{this.config.isFlagEnabled(he.BrowserSendOffer)||this.webSocketController.requestStreamerObject(sessionStorage.getItem("streamerName"))})),this.webSocketController.onClose.addEventListener("close",(e=>{const t=this.shouldReconnect&&1001!=e.detail.code&&this.config.getNumericSettingValue(ue.MaxReconnectAttempts)>0,s=this.disconnectMessage?this.disconnectMessage:e.detail.reason;this.pixelStreaming._onDisconnect(s,!t&&!this.isReconnecting),this.afkController.stopAfkWarningTimer(),this.statsTimerHandle&&void 0!==this.statsTimerHandle&&window.clearInterval(this.statsTimerHandle),this.setVideoEncoderAvgQP(0),this.setTouchInputEnabled(!1),this.setMouseInputEnabled(!1),this.setKeyboardInputEnabled(!1),this.setGamePadInputEnabled(!1),t&&setTimeout((()=>{this.isReconnecting=!0,this.reconnectAttempt++,this.tryReconnect(e.detail.reason)}),2e3)})),this.sendMessageController=new ct(this.dataChannelSender,this.streamMessageController),this.toStreamerMessagesController=new ht(this.sendMessageController),this.registerMessageHandlers(),this.streamMessageController.populateDefaultProtocol(),this.inputClassesFactory=new it(this.streamMessageController,this.videoPlayer,this.coordinateConverter),this.isUsingSFU=!1,this.isQualityController=!1,this.preferredCodec="",this.shouldReconnect=!0,this.isReconnecting=!1,this.reconnectAttempt=0,this.config._addOnOptionSettingChangedListener(pe.StreamerId,(e=>{""!==e&&(this.peerConnectionController.peerConnection.close(),this.peerConnectionController.createPeerConnection(this.peerConfig,this.preferredCodec),this.subscribedStream=e,this.webSocketController.sendSubscribe(e))})),this.setVideoEncoderAvgQP(-1),this.signallingUrlBuilder=()=>{let e=this.config.getTextSettingValue(Se.SignallingServerUrl);return this.config.isFlagEnabled(he.BrowserSendOffer)&&(e+="?"+he.BrowserSendOffer+"=true"),e}}requestUnquantizedAndDenormalizeUnsigned(e,t){return this.coordinateConverter.unquantizeAndDenormalizeUnsigned(e,t)}handleOnMessage(e){const t=new Uint8Array(e.data);i.Log(i.GetStackTrace(),"Message incoming:"+t,6);const s=this.streamMessageController.fromStreamerMessages.get(t[0]);this.streamMessageController.fromStreamerHandlers.get(s)(e.data)}registerMessageHandlers(){this.streamMessageController.registerMessageHandler(Ue.FromStreamer,"QualityControlOwnership",(e=>this.onQualityControlOwnership(e))),this.streamMessageController.registerMessageHandler(Ue.FromStreamer,"Response",(e=>this.responseController.onResponse(e))),this.streamMessageController.registerMessageHandler(Ue.FromStreamer,"Command",(e=>{this.onCommand(e)})),this.streamMessageController.registerMessageHandler(Ue.FromStreamer,"FreezeFrame",(e=>this.onFreezeFrameMessage(e))),this.streamMessageController.registerMessageHandler(Ue.FromStreamer,"UnfreezeFrame",(()=>this.invalidateFreezeFrameAndEnableVideo())),this.streamMessageController.registerMessageHandler(Ue.FromStreamer,"VideoEncoderAvgQP",(e=>this.handleVideoEncoderAvgQP(e))),this.streamMessageController.registerMessageHandler(Ue.FromStreamer,"LatencyTest",(e=>this.handleLatencyTestResult(e))),this.streamMessageController.registerMessageHandler(Ue.FromStreamer,"DataChannelLatencyTest",(e=>this.handleDataChannelLatencyTestResponse(e))),this.streamMessageController.registerMessageHandler(Ue.FromStreamer,"InitialSettings",(e=>this.handleInitialSettings(e))),this.streamMessageController.registerMessageHandler(Ue.FromStreamer,"FileExtension",(e=>this.onFileExtension(e))),this.streamMessageController.registerMessageHandler(Ue.FromStreamer,"FileMimeType",(e=>this.onFileMimeType(e))),this.streamMessageController.registerMessageHandler(Ue.FromStreamer,"FileContents",(e=>this.onFileContents(e))),this.streamMessageController.registerMessageHandler(Ue.FromStreamer,"TestEcho",(()=>{})),this.streamMessageController.registerMessageHandler(Ue.FromStreamer,"InputControlOwnership",(e=>this.onInputControlOwnership(e))),this.streamMessageController.registerMessageHandler(Ue.FromStreamer,"GamepadResponse",(e=>this.onGamepadResponse(e))),this.streamMessageController.registerMessageHandler(Ue.FromStreamer,"Protocol",(e=>this.onProtocolMessage(e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"IFrameRequest",(()=>this.sendMessageController.sendMessageToStreamer("IFrameRequest"))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"RequestQualityControl",(()=>this.sendMessageController.sendMessageToStreamer("RequestQualityControl"))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"FpsRequest",(()=>this.sendMessageController.sendMessageToStreamer("FpsRequest"))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"AverageBitrateRequest",(()=>this.sendMessageController.sendMessageToStreamer("AverageBitrateRequest"))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"StartStreaming",(()=>this.sendMessageController.sendMessageToStreamer("StartStreaming"))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"StopStreaming",(()=>this.sendMessageController.sendMessageToStreamer("StopStreaming"))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"LatencyTest",(e=>this.sendMessageController.sendMessageToStreamer("LatencyTest",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"RequestInitialSettings",(()=>this.sendMessageController.sendMessageToStreamer("RequestInitialSettings"))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"TestEcho",(()=>{})),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"UIInteraction",(e=>this.sendMessageController.sendMessageToStreamer("UIInteraction",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"Command",(e=>this.sendMessageController.sendMessageToStreamer("Command",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"TextboxEntry",(e=>this.sendMessageController.sendMessageToStreamer("TextboxEntry",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"KeyDown",(e=>this.sendMessageController.sendMessageToStreamer("KeyDown",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"KeyUp",(e=>this.sendMessageController.sendMessageToStreamer("KeyUp",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"KeyPress",(e=>this.sendMessageController.sendMessageToStreamer("KeyPress",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"MouseEnter",(e=>this.sendMessageController.sendMessageToStreamer("MouseEnter",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"MouseLeave",(e=>this.sendMessageController.sendMessageToStreamer("MouseLeave",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"MouseDown",(e=>this.sendMessageController.sendMessageToStreamer("MouseDown",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"MouseUp",(e=>this.sendMessageController.sendMessageToStreamer("MouseUp",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"MouseMove",(e=>this.sendMessageController.sendMessageToStreamer("MouseMove",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"MouseWheel",(e=>this.sendMessageController.sendMessageToStreamer("MouseWheel",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"MouseDouble",(e=>this.sendMessageController.sendMessageToStreamer("MouseDouble",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"TouchStart",(e=>this.sendMessageController.sendMessageToStreamer("TouchStart",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"TouchEnd",(e=>this.sendMessageController.sendMessageToStreamer("TouchEnd",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"TouchMove",(e=>this.sendMessageController.sendMessageToStreamer("TouchMove",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"GamepadConnected",(()=>this.sendMessageController.sendMessageToStreamer("GamepadConnected"))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"GamepadButtonPressed",(e=>this.sendMessageController.sendMessageToStreamer("GamepadButtonPressed",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"GamepadButtonReleased",(e=>this.sendMessageController.sendMessageToStreamer("GamepadButtonReleased",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"GamepadAnalog",(e=>this.sendMessageController.sendMessageToStreamer("GamepadAnalog",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"GamepadDisconnected",(e=>this.sendMessageController.sendMessageToStreamer("GamepadDisconnected",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"XRHMDTransform",(e=>this.sendMessageController.sendMessageToStreamer("XRHMDTransform",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"XRControllerTransform",(e=>this.sendMessageController.sendMessageToStreamer("XRControllerTransform",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"XRSystem",(e=>this.sendMessageController.sendMessageToStreamer("XRSystem",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"XRButtonTouched",(e=>this.sendMessageController.sendMessageToStreamer("XRButtonTouched",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"XRButtonPressed",(e=>this.sendMessageController.sendMessageToStreamer("XRButtonPressed",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"XRButtonReleased",(e=>this.sendMessageController.sendMessageToStreamer("XRButtonReleased",e))),this.streamMessageController.registerMessageHandler(Ue.ToStreamer,"XRAnalog",(e=>this.sendMessageController.sendMessageToStreamer("XRAnalog",e)))}onCommand(e){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.Command",6);const t=new TextDecoder("utf-16").decode(e.slice(1));i.Log(i.GetStackTrace(),"Data Channel Command: "+t,6);const s=JSON.parse(t);"onScreenKeyboard"===s.command&&this.pixelStreaming._activateOnScreenKeyboard(s)}onProtocolMessage(e){try{const t=new TextDecoder("utf-16").decode(e.slice(1)),s=JSON.parse(t);Object.prototype.hasOwnProperty.call(s,"Direction")||i.Error(i.GetStackTrace(),"Malformed protocol received. Ensure the protocol message contains a direction");const n=s.Direction;delete s.Direction,i.Log(i.GetStackTrace(),`Received new ${n==Ue.FromStreamer?"FromStreamer":"ToStreamer"} protocol. Updating existing protocol...(更新现有协议)`),Object.keys(s).forEach((e=>{const t=s[e];switch(n){case Ue.ToStreamer:if(!Object.prototype.hasOwnProperty.call(t,"id"))return void i.Error(i.GetStackTrace(),`ToStreamer->${e} protocol definition was malformed as it didn't contain at least an id\n\n Definition was: ${JSON.stringify(t,null,2)}`);if("UIInteraction"===e||"Command"===e||"LatencyTest"===e)return;this.streamMessageController.toStreamerHandlers.get(e)?this.streamMessageController.toStreamerMessages.set(e,t):i.Error(i.GetStackTrace(),`There was no registered handler for "${e}" - try adding one using registerMessageHandler(MessageDirection.ToStreamer, "${e}", myHandler)`);break;case Ue.FromStreamer:if(!Object.prototype.hasOwnProperty.call(t,"id"))return void i.Error(i.GetStackTrace(),`FromStreamer->${e} protocol definition was malformed as it didn't contain at least an id\n\n Definition was: ${JSON.stringify(t,null,2)}`);this.streamMessageController.fromStreamerHandlers.get(e)?this.streamMessageController.fromStreamerMessages.set(t.id,e):i.Error(i.GetStackTrace(),`There was no registered handler for "${t}" - try adding one using registerMessageHandler(MessageDirection.FromStreamer, "${e}", myHandler)`);break;default:i.Error(i.GetStackTrace(),`Unknown direction: ${n}`)}})),this.toStreamerMessagesController.SendRequestInitialSettings(),this.toStreamerMessagesController.SendRequestQualityControl()}catch(e){i.Log(i.GetStackTrace(),e)}}onInputControlOwnership(e){const t=new Uint8Array(e);i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.InputControlOwnership",6);const s=new Boolean(t[1]).valueOf();i.Log(i.GetStackTrace(),`Received input controller message - will your input control the stream: ${s}`),this.pixelStreaming._onInputControlOwnership(s)}onGamepadResponse(e){const t=new TextDecoder("utf-16").decode(e.slice(1)),s=JSON.parse(t);this.gamePadController.onGamepadResponseReceived(s.controllerId)}onAfkTriggered(){this.afkController.onAfkClick(),this.videoPlayer.isPaused()&&this.videoPlayer.hasVideoSource()&&this.playStream()}setAfkEnabled(e){e?this.onAfkTriggered():this.afkController.stopAfkWarningTimer()}tryReconnect(e){this.webSocketController?(this.isReconnecting=!0,this.webSocketController.webSocket&&this.webSocketController.webSocket.readyState!=WebSocket.CLOSED?(this.closeSignalingServer(`${e} Restarting stream...`),setTimeout((()=>{this.tryReconnect(e)}),3e3)):(this.pixelStreaming._onWebRtcAutoConnect(),this.connectToSignallingServer())):i.Log(i.GetStackTrace(),"The Web Socket Controller does not exist so this will not work right now.")}loadFreezeFrameOrShowPlayOverlay(){this.pixelStreaming.dispatchEvent(new J({shouldShowPlayOverlay:this.shouldShowPlayOverlay,isValid:this.freezeFrameController.valid,jpegData:this.freezeFrameController.jpeg})),!0===this.shouldShowPlayOverlay?(i.Log(i.GetStackTrace(),"showing play overlay"),this.resizePlayerStyle()):(i.Log(i.GetStackTrace(),"showing freeze frame"),this.freezeFrameController.showFreezeFrame()),setTimeout((()=>{this.videoPlayer.setVideoEnabled(!1)}),this.freezeFrameController.freezeFrameDelay)}onFreezeFrameMessage(e){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.FreezeFrame",6);const t=new Uint8Array(e);this.freezeFrameController.processFreezeFrameMessage(t,(()=>this.loadFreezeFrameOrShowPlayOverlay()))}invalidateFreezeFrameAndEnableVideo(){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.FreezeFrame",6),setTimeout((()=>{this.pixelStreaming.dispatchEvent(new Y),this.freezeFrameController.hideFreezeFrame()}),this.freezeFrameController.freezeFrameDelay),this.videoPlayer.getVideoElement()&&this.videoPlayer.setVideoEnabled(!0)}onFileExtension(e){const t=new Uint8Array(e);Ke.setExtensionFromBytes(t,this.file)}onFileMimeType(e){const t=new Uint8Array(e);Ke.setMimeTypeFromBytes(t,this.file)}onFileContents(e){const t=new Uint8Array(e);Ke.setContentsFromBytes(t,this.file)}playStream(){if(!this.videoPlayer.getVideoElement()){const e="Could not play video stream because the video player was not initialized correctly.";return this.pixelStreaming.dispatchEvent(new $({message:e})),i.Error(i.GetStackTrace(),e),void this.closeSignalingServer("Stream not initialized correctly")}if(this.videoPlayer.hasVideoSource()){if(this.setTouchInputEnabled(this.config.isFlagEnabled(he.TouchInput)),this.pixelStreaming.dispatchEvent(new X),this.streamController.audioElement.srcObject){const e=this.config.isFlagEnabled(he.StartVideoMuted);this.streamController.audioElement.muted=e,e?this.playVideo():this.streamController.audioElement.play().then((()=>{this.playVideo()})).catch((e=>{i.Log(i.GetStackTrace(),e),i.Log(i.GetStackTrace(),"Browser does not support autoplaying video without interaction - to resolve this we are going to show the play button overlay."),this.pixelStreaming.dispatchEvent(new j({reason:e}))}))}else this.playVideo();this.shouldShowPlayOverlay=!1,this.freezeFrameController.showFreezeFrame()}else i.Warning(i.GetStackTrace(),"Cannot play stream, the video element has no srcObject to play.")}playVideo(){this.videoPlayer.play().catch((e=>{this.streamController.audioElement.srcObject&&this.streamController.audioElement.pause(),i.Log(i.GetStackTrace(),e),i.Log(i.GetStackTrace(),"Browser does not support autoplaying video without interaction - to resolve this we are going to show the play button overlay."),this.pixelStreaming.dispatchEvent(new j({reason:e}))}))}autoPlayVideoOrSetUpPlayOverlay(){this.config.isFlagEnabled(he.AutoPlayVideo)&&this.playStream(),this.resizePlayerStyle()}connectToSignallingServer(){this.locallyClosed=!1,this.shouldReconnect=!0,this.disconnectMessage=null;const e=this.signallingUrlBuilder();this.webSocketController.connect(e)}startSession(e){if(this.peerConfig=e,this.config.isFlagEnabled(he.ForceTURN)&&!this.checkTurnServerAvailability(e))return i.Info(i.GetStackTrace(),"No turn server was found in the Peer Connection Options. TURN cannot be forced, closing connection. Please use STUN instead"),void this.closeSignalingServer("TURN cannot be forced, closing connection. Please use STUN instead.");this.peerConnectionController=new Be(this.peerConfig,this.config,this.preferredCodec),this.peerConnectionController.onVideoStats=e=>this.handleVideoStats(e),this.peerConnectionController.onSendWebRTCOffer=e=>this.handleSendWebRTCOffer(e),this.peerConnectionController.onSendWebRTCAnswer=e=>this.handleSendWebRTCAnswer(e),this.peerConnectionController.onPeerIceCandidate=e=>this.handleSendIceCandidate(e),this.peerConnectionController.onDataChannel=e=>this.handleDataChannel(e),this.peerConnectionController.showTextOverlayConnecting=()=>this.pixelStreaming._onWebRtcConnecting(),this.peerConnectionController.showTextOverlaySetupFailure=()=>this.pixelStreaming._onWebRtcFailed();let t=!1;this.peerConnectionController.onIceConnectionStateChange=()=>{!t&&["connected","completed"].includes(this.peerConnectionController.peerConnection.iceConnectionState)&&(this.pixelStreaming._onWebRtcConnected(),t=!0)},this.peerConnectionController.onTrack=e=>this.streamController.handleOnTrack(e),this.config.isFlagEnabled(he.BrowserSendOffer)&&(this.sendrecvDataChannelController.createDataChannel(this.peerConnectionController.peerConnection,"cirrus",this.datachannelOptions),this.sendrecvDataChannelController.handleOnMessage=e=>this.handleOnMessage(e),this.peerConnectionController.createOffer(this.sdpConstraints,this.config))}checkTurnServerAvailability(e){if(!e.iceServers)return i.Info(i.GetStackTrace(),"A turn sever was not found"),!1;for(const t of e.iceServers)for(const e of t.urls)if(e.includes("turn"))return i.Log(i.GetStackTrace(),`A turn sever was found at ${e}`),!0;return i.Info(i.GetStackTrace(),"A turn sever was not found"),!1}handleOnConfigMessage(e){this.resizePlayerStyle(),this.startSession(e.peerConnectionOptions),this.webSocketController.onWebRtcAnswer=e=>this.handleWebRtcAnswer(e),this.webSocketController.onWebRtcOffer=e=>this.handleWebRtcOffer(e),this.webSocketController.onWebRtcPeerDataChannels=e=>this.handleWebRtcSFUPeerDatachannels(e),this.webSocketController.onIceCandidate=e=>this.handleIceCandidate(e)}handleStreamerListMessage(e){var t;console.log(e,"====="),i.Log(i.GetStackTrace(),`Got streamer list ${e.ids}`,6);const s=null!==(t=e.streamerBusyList)&&void 0!==t?t:[];if(s.length>0){if(console.log(window.location.href,"======"),-1!==window.location.href.indexOf("home"))return;window.confirm("监测到当前窗口有人在使用,是否强制进入?")&&this.webSocketController.sendSubscribe(s[0].streamerId)}const n=[...e.ids];console.log(n),this.config.setOptionSettingOptions(pe.StreamerId,n);let r=null,a=null;const o=this.config.isFlagEnabled(he.WaitForStreamer),l=this.config.getNumericSettingValue(ue.MaxReconnectAttempts),d=this.config.getNumericSettingValue(ue.StreamerAutoJoinInterval),c=new URLSearchParams(window.location.search);c.has(pe.StreamerId)?r=c.get(pe.StreamerId):this.subscribedStream&&(r=this.subscribedStream),r&&e.ids.includes(r)?a=r:r&&o||1!=e.ids.length||(a=e.ids[0]),a?(this.isReconnecting=!1,this.reconnectAttempt=0,this.config.setOptionSettingValue(pe.StreamerId,a)):o&&(this.reconnectAttempt<l?(this.isReconnecting=!0,this.reconnectAttempt++,setTimeout((()=>{this.webSocketController.requestStreamerList()}),d)):(this.reconnectAttempt=0,this.isReconnecting=!1,this.shouldReconnect=!1)),this.pixelStreaming.dispatchEvent(new ee({messageStreamerList:e,autoSelectedStreamerId:a,wantedStreamerId:r}))}handleWebRtcAnswer(e){i.Log(i.GetStackTrace(),`Got answer sdp ${e.sdp}`,6);const t={sdp:e.sdp,type:"answer"};this.peerConnectionController.receiveAnswer(t),this.handlePostWebrtcNegotiation()}handleWebRtcOffer(e){i.Log(i.GetStackTrace(),`Got offer sdp ${e.sdp}`,6),this.isUsingSFU=!!e.sfu&&e.sfu,this.isUsingSFU&&(this.peerConnectionController.preferredCodec="");const t={sdp:e.sdp,type:"offer"};this.peerConnectionController.receiveOffer(t,this.config),this.handlePostWebrtcNegotiation()}handleWebRtcSFUPeerDatachannels(e){const t={ordered:!0,negotiated:!0,id:e.sendStreamId},s=e.sendStreamId!=e.recvStreamId;if(this.sendrecvDataChannelController.createDataChannel(this.peerConnectionController.peerConnection,s?"send-datachannel":"datachannel",t),s){const t={ordered:!0,negotiated:!0,id:e.recvStreamId};this.recvDataChannelController.createDataChannel(this.peerConnectionController.peerConnection,"recv-datachannel",t),this.recvDataChannelController.handleOnOpen=()=>this.webSocketController.sendSFURecvDataChannelReady(),this.recvDataChannelController.handleOnMessage=e=>this.handleOnMessage(e)}else this.sendrecvDataChannelController.handleOnMessage=e=>this.handleOnMessage(e)}handlePostWebrtcNegotiation(){this.afkController.startAfkWarningTimer(),this.pixelStreaming._onWebRtcSdp(),this.statsTimerHandle&&void 0!==this.statsTimerHandle&&window.clearInterval(this.statsTimerHandle),this.statsTimerHandle=window.setInterval((()=>this.getStats()),1e3),this.setMouseInputEnabled(this.config.isFlagEnabled(he.MouseInput)),this.setKeyboardInputEnabled(this.config.isFlagEnabled(he.KeyboardInput)),this.setGamePadInputEnabled(this.config.isFlagEnabled(he.GamepadInput))}handleIceCandidate(e){i.Log(i.GetStackTrace(),"Web RTC Controller: onWebRtcIce",6);const t=new RTCIceCandidate(e);this.peerConnectionController.handleOnIce(t)}handleSendIceCandidate(e){i.Log(i.GetStackTrace(),"OnIceCandidate",6),e.candidate&&e.candidate.candidate&&this.webSocketController.sendIceCandidate(e.candidate)}handleDataChannel(e){i.Log(i.GetStackTrace(),"Data channel created for us by browser as we are a receiving peer.",6),this.sendrecvDataChannelController.dataChannel=e.channel,this.sendrecvDataChannelController.setupDataChannel(),this.sendrecvDataChannelController.handleOnMessage=e=>this.handleOnMessage(e)}handleSendWebRTCOffer(e){i.Log(i.GetStackTrace(),"Sending the offer to the Server",6),this.webSocketController.sendWebRtcOffer(e)}handleSendWebRTCAnswer(e){i.Log(i.GetStackTrace(),"Sending the answer to the Server",6),this.webSocketController.sendWebRtcAnswer(e),this.isUsingSFU&&this.webSocketController.sendWebRtcDatachannelRequest()}setUpMouseAndFreezeFrame(){this.videoElementParentClientRect=this.videoPlayer.getVideoParentElement().getBoundingClientRect(),this.coordinateConverter.setupNormalizeAndQuantize(),this.freezeFrameController.freezeFrame.resize()}closeSignalingServer(e){var t;this.locallyClosed=!0,this.shouldReconnect=!1,this.disconnectMessage=e,null===(t=this.webSocketController)||void 0===t||t.close()}closePeerConnection(){var e;null===(e=this.peerConnectionController)||void 0===e||e.close()}close(){this.closeSignalingServer(""),this.closePeerConnection()}getStats(){this.peerConnectionController.generateStats()}sendLatencyTest(){this.latencyStartTime=Date.now(),this.streamMessageController.toStreamerHandlers.get("LatencyTest")([JSON.stringify({StartTime:this.latencyStartTime})])}sendDataChannelLatencyTest(e){this.streamMessageController.toStreamerHandlers.get("DataChannelLatencyTest")([JSON.stringify(e)])}sendEncoderMinQP(e){i.Log(i.GetStackTrace(),`MinQP=${e}\n`,6),null!=e&&this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"Encoder.MinQP":e})])}sendEncoderMaxQP(e){i.Log(i.GetStackTrace(),`MaxQP=${e}\n`,6),null!=e&&this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"Encoder.MaxQP":e})])}sendWebRTCMinBitrate(e){i.Log(i.GetStackTrace(),`WebRTC Min Bitrate=${e}`,6),null!=e&&this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"WebRTC.MinBitrate":e})])}sendWebRTCMaxBitrate(e){i.Log(i.GetStackTrace(),`WebRTC Max Bitrate=${e}`,6),null!=e&&this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"WebRTC.MaxBitrate":e})])}sendWebRTCFps(e){i.Log(i.GetStackTrace(),`WebRTC FPS=${e}`,6),null!=e&&(this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"WebRTC.Fps":e})]),this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"WebRTC.MaxFps":e})]))}sendShowFps(){i.Log(i.GetStackTrace(),"---- Sending show stat to UE ----",6),this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"stat.fps":""})])}sendIframeRequest(){i.Log(i.GetStackTrace(),"---- Sending Request for an IFrame ----",6),this.streamMessageController.toStreamerHandlers.get("IFrameRequest")()}emitUIInteraction(e){i.Log(i.GetStackTrace(),"---- Sending custom UIInteraction message ----",6),this.streamMessageController.toStreamerHandlers.get("UIInteraction")([JSON.stringify(e)])}emitCommand(e){i.Log(i.GetStackTrace(),"---- Sending custom Command message ----",6),this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify(e)])}emitConsoleCommand(e){i.Log(i.GetStackTrace(),"---- Sending custom Command:ConsoleCommand message ----",6),this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({ConsoleCommand:e})])}sendRequestQualityControlOwnership(){i.Log(i.GetStackTrace(),"---- Sending Request to Control Quality ----",6),this.toStreamerMessagesController.SendRequestQualityControl()}handleLatencyTestResult(e){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.latencyTest",6);const t=new TextDecoder("utf-16").decode(e.slice(1)),s=new Ne;Object.assign(s,JSON.parse(t)),s.processFields(),s.testStartTimeMs=this.latencyStartTime,s.browserReceiptTimeMs=Date.now(),s.latencyExcludingDecode=~~(s.browserReceiptTimeMs-s.testStartTimeMs),s.testDuration=~~(s.TransmissionTimeMs-s.ReceiptTimeMs),s.networkLatency=~~(s.latencyExcludingDecode-s.testDuration),s.frameDisplayDeltaTimeMs&&s.browserReceiptTimeMs&&(s.endToEndLatency=(s.frameDisplayDeltaTimeMs,s.networkLatency,~~+s.CaptureToSendMs)),this.pixelStreaming._onLatencyTestResult(s)}handleDataChannelLatencyTestResponse(e){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.dataChannelLatencyResponse",6);const t=new TextDecoder("utf-16").decode(e.slice(1)),s=JSON.parse(t);this.pixelStreaming._onDataChannelLatencyTestResponse(s)}handleInitialSettings(e){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.InitialSettings",6);const t=new TextDecoder("utf-16").decode(e.slice(1)),s=JSON.parse(t),n=new _e;s.Encoder&&(n.EncoderSettings=s.Encoder),s.WebRTC&&(n.WebRTCSettings=s.WebRTC),s.PixelStreaming&&(n.PixelStreamingSettings=s.PixelStreaming),s.ConfigOptions&&void 0!==s.ConfigOptions.DefaultToHover&&this.config.setFlagEnabled(he.HoveringMouseMode,!!s.ConfigOptions.DefaultToHover),n.ueCompatible(),i.Log(i.GetStackTrace(),t,6),this.pixelStreaming._onInitialSettings(n)}handleVideoEncoderAvgQP(e){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.VideoEncoderAvgQP",6);const t=Number(new TextDecoder("utf-16").decode(e.slice(1)));this.setVideoEncoderAvgQP(t)}handleVideoInitialized(){this.pixelStreaming._onVideoInitialized(),this.autoPlayVideoOrSetUpPlayOverlay(),this.resizePlayerStyle(),this.videoPlayer.updateVideoStreamSize()}onQualityControlOwnership(e){const t=new Uint8Array(e);i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.QualityControlOwnership",6),this.isQualityController=new Boolean(t[1]).valueOf(),i.Log(i.GetStackTrace(),`Received quality controller message, will control quality: ${this.isQualityController}`),this.pixelStreaming._onQualityControlOwnership(this.isQualityController)}handleVideoStats(e){this.pixelStreaming._onVideoStats(e)}resizePlayerStyle(){this.videoPlayer.resizePlayerStyle()}setPreferredCodec(e){this.preferredCodec=e,this.peerConnectionController&&(this.peerConnectionController.preferredCodec=e,this.peerConnectionController.updateCodecSelection=!1)}setVideoEncoderAvgQP(e){this.videoAvgQp=e,this.pixelStreaming._onVideoEncoderAvgQP(this.videoAvgQp)}setKeyboardInputEnabled(e){var t;null===(t=this.keyboardController)||void 0===t||t.unregisterKeyBoardEvents(),e&&(this.keyboardController=this.inputClassesFactory.registerKeyBoard(this.config))}setMouseInputEnabled(e){var t;if(null===(t=this.mouseController)||void 0===t||t.unregisterMouseEvents(),e){const e=this.config.isFlagEnabled(he.HoveringMouseMode)?Te.HoveringMouse:Te.LockedMouse;this.mouseController=this.inputClassesFactory.registerMouse(e)}}setTouchInputEnabled(e){var t;null===(t=this.touchController)||void 0===t||t.unregisterTouchEvents(),e&&(this.touchController=this.inputClassesFactory.registerTouch(this.config.isFlagEnabled(he.FakeMouseWithTouches),this.videoElementParentClientRect))}setGamePadInputEnabled(e){var t;null===(t=this.gamePadController)||void 0===t||t.unregisterGamePadEvents(),e&&(this.gamePadController=this.inputClassesFactory.registerGamePad(),this.gamePadController.onGamepadConnected=()=>{this.streamMessageController.toStreamerHandlers.get("GamepadConnected")()},this.gamePadController.onGamepadDisconnected=e=>{this.streamMessageController.toStreamerHandlers.get("GamepadDisconnected")([e])})}registerDataChannelEventEmitters(e){e.onOpen=(e,t)=>this.pixelStreaming.dispatchEvent(new _({label:e,event:t})),e.onClose=(e,t)=>this.pixelStreaming.dispatchEvent(new H({label:e,event:t})),e.onError=(e,t)=>this.pixelStreaming.dispatchEvent(new W({label:e,event:t}))}registerMessageHandler(e,t,s){t===Ue.FromStreamer&&void 0===s&&i.Warning(i.GetStackTrace(),`Unable to register handler for ${e} as no handler was passed`),this.streamMessageController.registerMessageHandler(t,e,(n=>void 0===s&&t===Ue.ToStreamer?this.sendMessageController.sendMessageToStreamer(e,n):s(n)))}}class Ct{static vertexShader(){return"\n\t\tattribute vec2 a_position;\n\t\tattribute vec2 a_texCoord;\n\n\t\t// input\n\t\tuniform vec2 u_resolution;\n\t\tuniform vec4 u_offset;\n\n\t\t//\n\t\tvarying vec2 v_texCoord;\n\n\t\tvoid main() {\n\t\t // convert the rectangle from pixels to 0.0 to 1.0\n\t\t vec2 zeroToOne = a_position / u_resolution;\n\n\t\t // convert from 0->1 to 0->2\n\t\t vec2 zeroToTwo = zeroToOne * 2.0;\n\n\t\t // convert from 0->2 to -1->+1 (clipspace)\n\t\t vec2 clipSpace = zeroToTwo - 1.0;\n\n\t\t gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);\n\t\t // pass the texCoord to the fragment shader\n\t\t // The GPU will interpolate this value between points.\n\t\t v_texCoord = (a_texCoord * u_offset.xy) + u_offset.zw;\n\t\t}\n\t\t"}static fragmentShader(){return"\n\t\tprecision mediump float;\n\n\t\t// our texture\n\t\tuniform sampler2D u_image;\n\n\t\t// the texCoords passed in from the vertex shader.\n\t\tvarying vec2 v_texCoord;\n\n\t\tvoid main() {\n\t\t gl_FragColor = texture2D(u_image, v_texCoord);\n\t\t}\n\t\t"}}class ft{static deepCopyGamepad(e){return JSON.parse(JSON.stringify({buttons:e.buttons.map((e=>JSON.parse(JSON.stringify({pressed:e.pressed,touched:e.touched})))),axes:e.axes}))}}class Tt{constructor(e){this.toStreamerMessagesProvider=e,this.controllers=[]}updateStatus(e,t,s){if(e.gamepad){const n=t.getPose(e.gripSpace,s);if(!n)return;let r=0;e.profiles.includes("htc-vive")?r=1:e.profiles.includes("oculus-touch")&&(r=2),this.toStreamerMessagesProvider.toStreamerHandlers.get("XRSystem")([r]);let i=2;switch(e.handedness){case"left":i=0;break;case"right":i=1}const a=n.transform.matrix,o=[];for(let e=0;e<16;e++)o[e]=new Float32Array([a[e]])[0];this.toStreamerMessagesProvider.toStreamerHandlers.get("XRControllerTransform")([o[0],o[4],o[8],o[12],o[1],o[5],o[9],o[13],o[2],o[6],o[10],o[14],o[3],o[7],o[11],o[15],i]),void 0===this.controllers[i]&&(this.controllers[i]={prevState:void 0,currentState:void 0,id:void 0},this.controllers[i].prevState=ft.deepCopyGamepad(e.gamepad)),this.controllers[i].currentState=ft.deepCopyGamepad(e.gamepad);const l=this.controllers[i],d=l.currentState,c=l.prevState;for(let e=0;e<d.buttons.length;e++){const t=d.buttons[e],s=c.buttons[e];t.pressed?this.toStreamerMessagesProvider.toStreamerHandlers.get("XRButtonPressed")([i,e,s.pressed?1:0]):!t.pressed&&s.pressed&&this.toStreamerMessagesProvider.toStreamerHandlers.get("XRButtonReleased")([i,e,0]),t.touched&&!t.pressed?this.toStreamerMessagesProvider.toStreamerHandlers.get("XRButtonPressed")([i,3,s.touched?1:0]):!t.touched&&s.touched&&this.toStreamerMessagesProvider.toStreamerHandlers.get("XRButtonReleased")([i,3,0])}for(let e=0;e<d.axes.length;e++)this.toStreamerMessagesProvider.toStreamerHandlers.get("XRAnalog")([i,e,d.axes[e]]);this.controllers[i].prevState=d}}}class Et{constructor(e){this.xrSession=null,this.webRtcController=e,this.xrControllers=[],this.xrGamepadController=new Tt(this.webRtcController.streamMessageController),this.onSessionEnded=new EventTarget,this.onSessionStarted=new EventTarget,this.onFrame=new EventTarget}xrClicked(){this.xrSession?this.xrSession.end():navigator.xr.requestSession("immersive-vr").then((e=>{this.onXrSessionStarted(e)}))}onXrSessionEnded(){i.Log(i.GetStackTrace(),"XR Session ended"),this.xrSession=null,this.onSessionEnded.dispatchEvent(new Event("xrSessionEnded"))}onXrSessionStarted(e){i.Log(i.GetStackTrace(),"XR Session started"),this.xrSession=e,this.xrSession.addEventListener("end",(()=>{this.onXrSessionEnded()}));const t=document.createElement("canvas");this.gl=t.getContext("webgl2",{xrCompatible:!0}),this.xrSession.updateRenderState({baseLayer:new XRWebGLLayer(this.xrSession,this.gl)});const s=this.gl.createShader(this.gl.VERTEX_SHADER);this.gl.shaderSource(s,Ct.vertexShader()),this.gl.compileShader(s);const n=this.gl.createShader(this.gl.FRAGMENT_SHADER);this.gl.shaderSource(n,Ct.fragmentShader()),this.gl.compileShader(n);const r=this.gl.createProgram();this.gl.attachShader(r,s),this.gl.attachShader(r,n),this.gl.linkProgram(r),this.gl.useProgram(r),this.positionLocation=this.gl.getAttribLocation(r,"a_position"),this.texcoordLocation=this.gl.getAttribLocation(r,"a_texCoord"),this.positionBuffer=this.gl.createBuffer(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.positionBuffer),this.gl.enableVertexAttribArray(this.positionLocation);const a=this.gl.createTexture();this.gl.bindTexture(this.gl.TEXTURE_2D,a),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.NEAREST),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.NEAREST),this.texcoordBuffer=this.gl.createBuffer(),this.resolutionLocation=this.gl.getUniformLocation(r,"u_resolution"),this.offsetLocation=this.gl.getUniformLocation(r,"u_offset"),e.requestReferenceSpace("local").then((e=>{this.xrRefSpace=e,this.xrSession.requestAnimationFrame(((e,t)=>this.onXrFrame(e,t)))})),this.onSessionStarted.dispatchEvent(new Event("xrSessionStarted"))}onXrFrame(e,t){const s=t.getViewerPose(this.xrRefSpace);if(s){const e=s.transform.matrix,t=[];for(let s=0;s<16;s++)t[s]=new Float32Array([e[s]])[0];this.webRtcController.streamMessageController.toStreamerHandlers.get("XRHMDTransform")([t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15]]);const n=this.xrSession.renderState.baseLayer;this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,n.framebuffer),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,this.webRtcController.videoPlayer.getVideoElement()),this.render(this.webRtcController.videoPlayer.getVideoElement())}this.webRtcController.config.isFlagEnabled(he.XRControllerInput)&&this.xrSession.inputSources.forEach(((e,s,n)=>{this.xrGamepadController.updateStatus(e,t,this.xrRefSpace)}),this),this.xrSession.requestAnimationFrame(((e,t)=>this.onXrFrame(e,t))),this.onFrame.dispatchEvent(new le({time:e,frame:t}))}render(e){if(!this.gl)return;const t=this.xrSession.renderState.baseLayer;let s,n,r,i,a;this.gl.viewport(0,0,t.framebufferWidth,t.framebufferHeight),this.gl.uniform4f(this.offsetLocation,1,1,0,0),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array([0,0,e.videoWidth,0,0,e.videoHeight,0,e.videoHeight,e.videoWidth,0,e.videoWidth,e.videoHeight]),this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.texcoordBuffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.positionBuffer),s=2,n=this.gl.FLOAT,r=!1,i=0,a=0,this.gl.vertexAttribPointer(this.positionLocation,s,n,r,i,a),this.gl.enableVertexAttribArray(this.texcoordLocation),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.texcoordBuffer),s=2,n=this.gl.FLOAT,r=!1,i=0,a=0,this.gl.vertexAttribPointer(this.texcoordLocation,s,n,r,i,a),this.gl.uniform2f(this.resolutionLocation,e.videoWidth,e.videoHeight);const o=this.gl.TRIANGLES;a=0,this.gl.drawArrays(o,a,6)}static isSessionSupported(e){return navigator.xr?navigator.xr.isSessionSupported(e):new Promise((()=>!1))}}class yt{constructor(e){this.editTextButton=null,this.hiddenInput=null,"ontouchstart"in document.documentElement&&this.createOnScreenKeyboardHelpers(e)}unquantizeAndDenormalizeUnsigned(e,t){return null}createOnScreenKeyboardHelpers(e){this.hiddenInput||(this.hiddenInput=document.createElement("input"),this.hiddenInput.id="hiddenInput",this.hiddenInput.maxLength=0,e.appendChild(this.hiddenInput)),this.editTextButton||(this.editTextButton=document.createElement("button"),this.editTextButton.id="editTextButton",this.editTextButton.innerHTML="edit text",e.appendChild(this.editTextButton),this.editTextButton.classList.add("hiddenState"),this.editTextButton.addEventListener("touchend",(e=>{this.hiddenInput.focus(),e.preventDefault()})))}showOnScreenKeyboard(e){if(e.showOnScreenKeyboard){this.editTextButton.classList.remove("hiddenState");const t=this.unquantizeAndDenormalizeUnsigned(e.x,e.y);this.editTextButton.style.top=t.y.toString()+"px",this.editTextButton.style.left=(t.x-40).toString()+"px"}else this.editTextButton.classList.add("hiddenState"),this.hiddenInput.blur()}}class Mt{constructor(e){this.seq=e.Seq,this.playerSentTimestamp=Date.now(),this.requestFillerSize=e.Filler?e.Filler.length:0}update(e){this.playerReceivedTimestamp=Date.now(),this.streamerReceivedTimestamp=e.ReceivedTimestamp,this.streamerSentTimestamp=e.SentTimestamp,this.responseFillerSize=e.Filler?e.Filler.length:0}}class wt{constructor(e,t){this.sink=e,this.callback=t,this.records=new Map,this.seq=0}start(e){return!this.isRunning()&&(this.startTime=Date.now(),this.records.clear(),this.interval=setInterval((()=>{Date.now()-this.startTime>=e.duration?this.stop():this.sendRequest(e.requestSize,e.responseSize)}).bind(this),Math.floor(1e3/e.rps)),!0)}stop(){this.interval&&(clearInterval(this.interval),this.interval=void 0,this.callback(this.produceResult()))}produceResult(){const e=new Map(this.records);return{records:e,dataChannelRtt:Math.ceil(Array.from(this.records.values()).reduce(((e,t)=>e+(t.playerReceivedTimestamp-t.playerSentTimestamp)),0)/this.records.size),playerToStreamerTime:Math.ceil(Array.from(this.records.values()).reduce(((e,t)=>e+(t.streamerReceivedTimestamp-t.playerSentTimestamp)),0)/this.records.size),streamerToPlayerTime:Math.ceil(Array.from(this.records.values()).reduce(((e,t)=>e+(t.playerReceivedTimestamp-t.streamerSentTimestamp)),0)/this.records.size),exportLatencyAsCSV:()=>{let t="Timestamp;RTT;PlayerToStreamer;StreamerToPlayer;\n";return e.forEach((e=>{t+=e.playerSentTimestamp+";",t+=e.playerReceivedTimestamp-e.playerSentTimestamp+";",t+=e.streamerReceivedTimestamp-e.playerSentTimestamp+";",t+=e.playerReceivedTimestamp-e.streamerSentTimestamp+";",t+="\n"})),t}}}isRunning(){return!!this.interval}receive(e){if(!this.isRunning())return;if(!e)return void i.Error(i.GetStackTrace(),"Undefined response from server");let t=this.records.get(e.Seq);t&&t.update(e)}sendRequest(e,t){let s=this.createRequest(e,t),n=new Mt(s);this.records.set(n.seq,n),this.sink(s)}createRequest(e,t){return{Seq:this.seq++,FillResponseSize:t,Filler:e?"A".repeat(e):""}}}class bt{constructor(e,t){this.allowConsoleCommands=!1,this.config=e,(null==t?void 0:t.videoElementParent)&&(this._videoElementParent=t.videoElementParent),this._eventEmitter=new ce,this.configureSettings(),this.setWebRtcPlayerController(new pt(this.config,this)),this.onScreenKeyboardHelper=new yt(this.videoElementParent),this.onScreenKeyboardHelper.unquantizeAndDenormalizeUnsigned=(e,t)=>this._webRtcController.requestUnquantizedAndDenormalizeUnsigned(e,t),this._activateOnScreenKeyboard=e=>this.onScreenKeyboardHelper.showOnScreenKeyboard(e),this._webXrController=new Et(this._webRtcController)}get videoElementParent(){return this._videoElementParent||(this._videoElementParent=document.createElement("div"),this._videoElementParent.id="videoElementParent"),this._videoElementParent}configureSettings(){this.config._addOnSettingChangedListener(he.IsQualityController,(e=>{!0!==e||this._webRtcController.isQualityController||this._webRtcController.sendRequestQualityControlOwnership()})),this.config._addOnSettingChangedListener(he.AFKDetection,(e=>{this._webRtcController.setAfkEnabled(e)})),this.config._addOnSettingChangedListener(he.MatchViewportResolution,(()=>{this._webRtcController.videoPlayer.updateVideoStreamSize()})),this.config._addOnSettingChangedListener(he.HoveringMouseMode,(e=>{this.config.setFlagLabel(he.HoveringMouseMode,`Control Scheme: ${e?"Hovering":"Locked"} Mouse`),this._webRtcController.setMouseInputEnabled(this.config.isFlagEnabled(he.MouseInput))})),this.config._addOnSettingChangedListener(he.KeyboardInput,(e=>{this._webRtcController.setKeyboardInputEnabled(e)})),this.config._addOnSettingChangedListener(he.MouseInput,(e=>{this._webRtcController.setMouseInputEnabled(e)})),this.config._addOnSettingChangedListener(he.TouchInput,(e=>{this._webRtcController.setTouchInputEnabled(e)})),this.config._addOnSettingChangedListener(he.GamepadInput,(e=>{this._webRtcController.setGamePadInputEnabled(e)})),this.config._addOnNumericSettingChangedListener(ue.MinQP,(e=>{i.Log(i.GetStackTrace(),"-------- Sending MinQP --------",7),this._webRtcController.sendEncoderMinQP(e),i.Log(i.GetStackTrace(),"-------------------------------------------",7)})),this.config._addOnNumericSettingChangedListener(ue.MaxQP,(e=>{i.Log(i.GetStackTrace(),"-------- Sending encoder settings --------",7),this._webRtcController.sendEncoderMaxQP(e),i.Log(i.GetStackTrace(),"-------------------------------------------",7)})),this.config._addOnNumericSettingChangedListener(ue.WebRTCMinBitrate,(e=>{i.Log(i.GetStackTrace(),"-------- Sending web rtc settings --------",7),this._webRtcController.sendWebRTCMinBitrate(1e3*e),i.Log(i.GetStackTrace(),"-------------------------------------------",7)})),this.config._addOnNumericSettingChangedListener(ue.WebRTCMaxBitrate,(e=>{i.Log(i.GetStackTrace(),"-------- Sending web rtc settings --------",7),this._webRtcController.sendWebRTCMaxBitrate(1e3*e),i.Log(i.GetStackTrace(),"-------------------------------------------",7)})),this.config._addOnNumericSettingChangedListener(ue.WebRTCFPS,(e=>{i.Log(i.GetStackTrace(),"-------- Sending web rtc settings --------",7),this._webRtcController.sendWebRTCFps(e),i.Log(i.GetStackTrace(),"-------------------------------------------",7)})),this.config._addOnOptionSettingChangedListener(pe.PreferredCodec,(e=>{this._webRtcController&&this._webRtcController.setPreferredCodec(e)})),this.config._registerOnChangeEvents(this._eventEmitter)}_activateOnScreenKeyboard(e){throw new Error("Method not implemented.")}_onInputControlOwnership(e){this._inputController=e}setWebRtcPlayerController(e){this._webRtcController=e,this._webRtcController.setPreferredCodec(this.config.getSettingOption(pe.PreferredCodec).selected),this._webRtcController.resizePlayerStyle(),this.checkForAutoConnect()}connect(){this._eventEmitter.dispatchEvent(new K),this._webRtcController.connectToSignallingServer()}reconnect(){this._eventEmitter.dispatchEvent(new q),this._webRtcController.tryReconnect("Reconnecting...")}disconnect(){this._eventEmitter.dispatchEvent(new Q),this._webRtcController.close()}play(){this._onStreamLoading(),this._webRtcController.playStream()}checkForAutoConnect(){console.log(this.config.isFlagEnabled(he.AutoConnect),"====ssss"),this.config.isFlagEnabled(he.AutoConnect)&&(this._onWebRtcAutoConnect(),this._webRtcController.connectToSignallingServer())}unmuteMicrophone(e=!1){if(!this.config.isFlagEnabled("UseMic"))return e?(this.config.setFlagEnabled("UseMic",!0),void this.reconnect()):void i.Warning(i.GetStackTrace(),"Trying to unmute mic, but PixelStreaming was initialized with no microphone track. Call with forceEnable == true to re-connect with a mic track.");this.setMicrophoneMuted(!1)}muteMicrophone(){this.config.isFlagEnabled("UseMic")?this.setMicrophoneMuted(!0):i.Info(i.GetStackTrace(),"Trying to mute mic, but PixelStreaming has no microphone track, so sending sound is already disabled.")}setMicrophoneMuted(e){var t,s,n,r;for(const i of null!==(r=null===(n=null===(s=null===(t=this._webRtcController)||void 0===t?void 0:t.peerConnectionController)||void 0===s?void 0:s.peerConnection)||void 0===n?void 0:n.getTransceivers())&&void 0!==r?r:[])Ie.canTransceiverSendAudio(i)&&(i.sender.track.enabled=!e)}_onWebRtcAutoConnect(){this._eventEmitter.dispatchEvent(new I)}_onWebRtcSdp(){this._eventEmitter.dispatchEvent(new O)}_onStreamLoading(){this._eventEmitter.dispatchEvent(new N)}_onDisconnect(e,t){this._eventEmitter.dispatchEvent(new B({eventString:e,allowClickToReconnect:t}))}_onWebRtcConnecting(){this._eventEmitter.dispatchEvent(new G)}_onWebRtcConnected(){this._eventEmitter.dispatchEvent(new U)}_onWebRtcFailed(){this._eventEmitter.dispatchEvent(new z)}_onVideoInitialized(){this._eventEmitter.dispatchEvent(new V),this._videoStartTime=Date.now()}_onLatencyTestResult(e){this._eventEmitter.dispatchEvent(new te({latencyTimings:e}))}_onDataChannelLatencyTestResponse(e){this._eventEmitter.dispatchEvent(new se({response:e}))}_onVideoStats(e){this._videoStartTime&&void 0!==this._videoStartTime||(this._videoStartTime=Date.now()),e.handleSessionStatistics(this._videoStartTime,this._inputController,this._webRtcController.videoAvgQp),this._eventEmitter.dispatchEvent(new Z({aggregatedStats:e}))}_onVideoEncoderAvgQP(e){this._eventEmitter.dispatchEvent(new D({avgQP:e}))}_onInitialSettings(e){var t;this._eventEmitter.dispatchEvent(new re({settings:e})),e.PixelStreamingSettings&&(this.allowConsoleCommands=null!==(t=e.PixelStreamingSettings.AllowPixelStreamingCommands)&&void 0!==t&&t,!1===this.allowConsoleCommands&&i.Info(i.GetStackTrace(),"-AllowPixelStreamingCommands=false, sending arbitrary console commands from browser to UE is disabled."));const s=this.config.useUrlParams,n=new URLSearchParams(window.location.search);e.EncoderSettings&&(this.config.setNumericSetting(ue.MinQP,s&&n.has(ue.MinQP)?Number.parseInt(n.get(ue.MinQP)):e.EncoderSettings.MinQP),this.config.setNumericSetting(ue.MaxQP,s&&n.has(ue.MaxQP)?Number.parseInt(n.get(ue.MaxQP)):e.EncoderSettings.MaxQP)),e.WebRTCSettings&&(this.config.setNumericSetting(ue.WebRTCMinBitrate,s&&n.has(ue.WebRTCMinBitrate)?Number.parseInt(n.get(ue.WebRTCMinBitrate)):e.WebRTCSettings.MinBitrate/1e3),this.config.setNumericSetting(ue.WebRTCMaxBitrate,s&&n.has(ue.WebRTCMaxBitrate)?Number.parseInt(n.get(ue.WebRTCMaxBitrate)):e.WebRTCSettings.MaxBitrate/1e3),this.config.setNumericSetting(ue.WebRTCFPS,s&&n.has(ue.WebRTCFPS)?Number.parseInt(n.get(ue.WebRTCFPS)):e.WebRTCSettings.FPS))}_onQualityControlOwnership(e){this.config.setFlagEnabled(he.IsQualityController,e)}_onPlayerCount(e){this._eventEmitter.dispatchEvent(new de({count:e}))}requestLatencyTest(){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._webRtcController.sendLatencyTest(),!0)}requestDataChannelLatencyTest(e){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._dataChannelLatencyTestController||(this._dataChannelLatencyTestController=new wt(this._webRtcController.sendDataChannelLatencyTest.bind(this._webRtcController),(e=>{this._eventEmitter.dispatchEvent(new ne({result:e}))})),this.addEventListener("dataChannelLatencyTestResponse",(({data:{response:e}})=>{this._dataChannelLatencyTestController.receive(e)}))),this._dataChannelLatencyTestController.start(e))}requestShowFps(){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._webRtcController.sendShowFps(),!0)}requestIframe(){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._webRtcController.sendIframeRequest(),!0)}emitUIInteraction(e){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._webRtcController.emitUIInteraction(e),!0)}emitCommand(e){return!(!this._webRtcController.videoPlayer.isVideoReady()||!this.allowConsoleCommands&&"ConsoleCommand"in e||(this._webRtcController.emitCommand(e),0))}emitConsoleCommand(e){return!(!this.allowConsoleCommands||!this._webRtcController.videoPlayer.isVideoReady()||(this._webRtcController.emitConsoleCommand(e),0))}addResponseEventListener(e,t){this._webRtcController.responseController.addResponseEventListener(e,t)}removeResponseEventListener(e){this._webRtcController.responseController.removeResponseEventListener(e)}dispatchEvent(e){return this._eventEmitter.dispatchEvent(e)}addEventListener(e,t){this._eventEmitter.addEventListener(e,t)}removeEventListener(e,t){this._eventEmitter.removeEventListener(e,t)}toggleXR(){this.webXrController.xrClicked()}setSignallingUrlBuilder(e){this._webRtcController.signallingUrlBuilder=e}get webSocketController(){return this._webRtcController.webSocketController}get webXrController(){return this._webXrController}registerMessageHandler(e,t,s){t!==Ue.FromStreamer||void 0!==s?t===Ue.ToStreamer&&void 0===s?this._webRtcController.streamMessageController.registerMessageHandler(t,e,(t=>this._webRtcController.sendMessageController.sendMessageToStreamer(e,t))):this._webRtcController.streamMessageController.registerMessageHandler(t,e,(e=>s(e))):i.Warning(i.GetStackTrace(),`Unable to register an undefined handler for ${e}`)}get toStreamerHandlers(){return this._webRtcController.streamMessageController.toStreamerHandlers}isReconnecting(){return this._webRtcController.isReconnecting}}var Rt=r.Dz,Pt=r.g$,kt=r.Lt,Lt=r.Q9,xt=r.qf,At=r.hV,Ft=r.z$,Dt=r.J0,Ot=r.De,It=r.$C,Gt=r.al,Ut=r._W,zt=r.Gv,Bt=r.m,_t=r.tz,Ht=r.Nu,Wt=r.zg,Vt=r.vp,Nt=r.vU,Kt=r.wF,Qt=r.rv,qt=r.Nh,$t=r.ss,Xt=r.qW,jt=r.QL,Jt=r.cf,Yt=r.eM,Zt=r.Yd,es=r.Tk,ts=r.iM,ss=r.qy,ns=r.ce,rs=r.sK,is=r.Ok,as=r.q5,os=r.g,ls=r.xl,ds=r.I,cs=r.bx,hs=r.dD,gs=r.Ib,us=r.Az,ms=r.Iw,Ss=r.qY,vs=r.db,ps=r.mR,Cs=r.Tn,fs=r.rV,Ts=r.gh,Es=r.Mi,ys=r.j,Ms=r.YB,ws=r.i5,bs=r.x_,Rs=r.Am,Ps=r.eR,ks=r.r8,Ls=r.u3,xs=r.vd,As=r.iV,Fs=r.jZ,Ds=r.SW,Os=r.ZH,Is=r.Ni,Gs=r.lh,Us=r.bq,zs=r.$f,Bs=r.eu,_s=r.Ax,Hs=r.Mc;export{Rt as AfkLogic,Pt as AfkTimedOutEvent,kt as AfkWarningActivateEvent,Lt as AfkWarningDeactivateEvent,xt as AfkWarningUpdateEvent,At as AggregatedStats,Ft as CandidatePairStats,Dt as CandidateStat,Ot as Config,It as ControlSchemeType,Gt as DataChannelCloseEvent,Ut as DataChannelErrorEvent,zt as DataChannelLatencyTestResponseEvent,Bt as DataChannelLatencyTestResultEvent,_t as DataChannelOpenEvent,Ht as DataChannelStats,Wt as EncoderSettings,Vt as EventEmitter,Nt as Flags,Kt as HideFreezeFrameEvent,Qt as InboundAudioStats,qt as InboundVideoStats,$t as InitialSettings,Xt as InitialSettingsEvent,jt as LatencyTestResultEvent,Jt as LatencyTestResults,Yt as LoadFreezeFrameEvent,Zt as Logger,es as MessageDirection,ts as MessageRecv,ss as MessageSend,ns as MessageStreamerList,rs as NumericParameters,is as OptionParameters,as as OutBoundVideoStats,os as PixelStreaming,ls as PlayStreamErrorEvent,ds as PlayStreamEvent,cs as PlayStreamRejectedEvent,hs as PlayerCountEvent,gs as SettingBase,us as SettingFlag,ms as SettingNumber,Ss as SettingOption,vs as SettingText,ps as SettingsChangedEvent,Cs as SignallingProtocol,fs as StatsReceivedEvent,Ts as StreamLoadingEvent,Es as StreamPreConnectEvent,ys as StreamPreDisconnectEvent,Ms as StreamReconnectEvent,ws as StreamerListMessageEvent,bs as TextParameters,Rs as UnquantizedAndDenormalizeUnsigned,Ps as VideoEncoderAvgQPEvent,ks as VideoInitializedEvent,Ls as WebRTCSettings,xs as WebRtcAutoConnectEvent,As as WebRtcConnectedEvent,Fs as WebRtcConnectingEvent,Ds as WebRtcDisconnectedEvent,Os as WebRtcFailedEvent,Is as WebRtcPlayerController,Gs as WebRtcSdpEvent,Us as WebSocketController,zs as WebXRController,Bs as XrFrameEvent,_s as XrSessionEndedEvent,Hs as XrSessionStartedEvent};
1
+ /*! For license information please see lib-pixelstreamingfrontend.esm.js.LICENSE.txt */
2
+ import*as e from"sdp";var t={d:(e,n)=>{for(var s in n)t.o(n,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:n[s]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),t.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};function s(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return e=>e in t}t.d(n,{Dz:()=>Mh,g$:()=>Du,Lt:()=>Ou,Q9:()=>Iu,qf:()=>Fu,hV:()=>Ih,z$:()=>Lh,J0:()=>Rh,De:()=>Eh,$C:()=>Th,al:()=>Wu,_W:()=>ju,Gv:()=>ih,m:()=>ah,tz:()=>$u,Nu:()=>Ph,zg:()=>jh,vp:()=>mh,vU:()=>ph,wF:()=>nh,rv:()=>kh,Nh:()=>xh,ss:()=>$h,qW:()=>lh,QL:()=>oh,cf:()=>qh,eM:()=>th,Yd:()=>au,Tk:()=>Nh,iM:()=>Cu,qy:()=>du,ce:()=>wu,sK:()=>vh,Ok:()=>Ch,q5:()=>Ah,g:()=>Pg,xl:()=>Yu,I:()=>Zu,bx:()=>eh,dD:()=>gh,Ib:()=>xu,Az:()=>Pu,Iw:()=>Ru,qY:()=>Au,db:()=>Lu,mR:()=>ch,Tn:()=>Eu,rV:()=>sh,gh:()=>qu,Mi:()=>Qu,j:()=>Xu,YB:()=>Ju,i5:()=>rh,x_:()=>yh,Am:()=>yg,eR:()=>Bu,r8:()=>Ku,u3:()=>Kh,vd:()=>Uu,iV:()=>Nu,jZ:()=>Vu,SW:()=>Gu,ZH:()=>Hu,Ni:()=>Cg,lh:()=>zu,bq:()=>Tu,$f:()=>Mg,eu:()=>hh,Ax:()=>uh,Mc:()=>dh});const r={},o=[],i=()=>{},a=()=>!1,l=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),c=e=>e.startsWith("onUpdate:"),d=Object.assign,u=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},h=Object.prototype.hasOwnProperty,g=(e,t)=>h.call(e,t),m=Array.isArray,p=e=>"[object Map]"===T(e),f=e=>"[object Set]"===T(e),v=e=>"[object Date]"===T(e),S=e=>"function"==typeof e,y=e=>"string"==typeof e,b=e=>"symbol"==typeof e,C=e=>null!==e&&"object"==typeof e,w=e=>(C(e)||S(e))&&S(e.then)&&S(e.catch),E=Object.prototype.toString,T=e=>E.call(e),M=e=>"[object Object]"===T(e),_=e=>y(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,k=s(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),x=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},P=/-\w/g,R=x((e=>e.replace(P,(e=>e.slice(1).toUpperCase())))),L=/\B([A-Z])/g,A=x((e=>e.replace(L,"-$1").toLowerCase())),O=x((e=>e.charAt(0).toUpperCase()+e.slice(1))),F=x((e=>e?`on${O(e)}`:"")),I=(e,t)=>!Object.is(e,t),D=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},B=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},z=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let U;const V=()=>U||(U="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t.g?t.g:{});function N(e){if(m(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=y(s)?W(s):N(s);if(r)for(const e in r)t[e]=r[e]}return t}if(y(e)||C(e))return e}const H=/;(?![^(]*\))/g,G=/:([^]+)/,$=/\/\*[^]*?\*\//g;function W(e){const t={};return e.replace($,"").split(H).forEach((e=>{if(e){const n=e.split(G);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function j(e){let t="";if(y(e))t=e;else if(m(e))for(let n=0;n<e.length;n++){const s=j(e[n]);s&&(t+=s+" ")}else if(C(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const K=s("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function q(e){return!!e||""===e}function Q(e,t){if(e===t)return!0;let n=v(e),s=v(t);if(n||s)return!(!n||!s)&&e.getTime()===t.getTime();if(n=b(e),s=b(t),n||s)return e===t;if(n=m(e),s=m(t),n||s)return!(!n||!s)&&function(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=Q(e[s],t[s]);return n}(e,t);if(n=C(e),s=C(t),n||s){if(!n||!s)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e){const s=e.hasOwnProperty(n),r=t.hasOwnProperty(n);if(s&&!r||!s&&r||!Q(e[n],t[n]))return!1}}return String(e)===String(t)}const X=e=>!(!e||!0!==e.__v_isRef),J=e=>y(e)?e:null==e?"":m(e)||C(e)&&(e.toString===E||!S(e.toString))?X(e)?J(e.value):JSON.stringify(e,Y,2):String(e),Y=(e,t)=>X(t)?Y(e,t.value):p(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n],s)=>(e[Z(t,s)+" =>"]=n,e)),{})}:f(t)?{[`Set(${t.size})`]:[...t.values()].map((e=>Z(e)))}:b(t)?Z(t):!C(t)||m(t)||M(t)?t:String(t),Z=(e,t="")=>{var n;return b(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};let ee,te;class ne{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&ee&&(ee.active?(this.parent=ee,this.index=(ee.scopes||(ee.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){let e,t;if(this._isPaused=!1,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=ee;try{return ee=this,e()}finally{ee=t}}}on(){1==++this._on&&(this.prevScope=ee,ee=this)}off(){if(this._on>0&&0==--this._on){if(ee===this)ee=this.prevScope;else{let e=ee;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){let t,n;for(this._active=!1,t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}}function se(){return ee}function re(e,t=!1){ee&&ee.cleanups.push(e)}const oe=new WeakSet;class ie{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,ee&&(ee.active?ee.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,oe.has(this)&&(oe.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||de(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,Ee(this),ge(this);const e=te,t=ye;te=this,ye=!0;try{return this.fn()}finally{me(this),te=e,ye=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)ve(e);this.deps=this.depsTail=void 0,Ee(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?oe.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){pe(this)&&this.run()}get dirty(){return pe(this)}}let ae,le,ce=0;function de(e,t=!1){if(e.flags|=8,t)return e.next=le,void(le=e);e.next=ae,ae=e}function ue(){ce++}function he(){if(--ce>0)return;if(le){let e=le;for(le=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;ae;){let t=ae;for(ae=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}function ge(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function me(e){let t,n=e.depsTail,s=n;for(;s;){const e=s.prevDep;-1===s.version?(s===n&&(n=e),ve(s),Se(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=e}e.deps=t,e.depsTail=n}function pe(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(fe(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function fe(e){if(4&e.flags&&!(16&e.flags))return;if(e.flags&=-17,e.globalVersion===Te)return;if(e.globalVersion=Te,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!pe(e)))return;e.flags|=2;const t=e.dep,n=te,s=ye;te=e,ye=!0;try{ge(e);const r=e.fn(e._value);(0===t.version||I(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(e){throw t.version++,e}finally{te=n,ye=s,me(e),e.flags&=-3}}function ve(e,t=!1){const{dep:n,prevSub:s,nextSub:r}=e;if(s&&(s.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)ve(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function Se(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let ye=!0;const be=[];function Ce(){be.push(ye),ye=!1}function we(){const e=be.pop();ye=void 0===e||e}function Ee(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const e=te;te=void 0;try{t()}finally{te=e}}}let Te=0;class Me{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class _e{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!te||!ye||te===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==te)t=this.activeLink=new Me(te,this),te.deps?(t.prevDep=te.depsTail,te.depsTail.nextDep=t,te.depsTail=t):te.deps=te.depsTail=t,ke(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){const e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=te.depsTail,t.nextDep=void 0,te.depsTail.nextDep=t,te.depsTail=t,te.deps===t&&(te.deps=e)}return t}trigger(e){this.version++,Te++,this.notify(e)}notify(e){ue();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{he()}}}function ke(e){if(e.dep.sc++,4&e.sub.flags){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)ke(e)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const xe=new WeakMap,Pe=Symbol(""),Re=Symbol(""),Le=Symbol("");function Ae(e,t,n){if(ye&&te){let t=xe.get(e);t||xe.set(e,t=new Map);let s=t.get(n);s||(t.set(n,s=new _e),s.map=t,s.key=n),s.track()}}function Oe(e,t,n,s,r,o){const i=xe.get(e);if(!i)return void Te++;const a=e=>{e&&e.trigger()};if(ue(),"clear"===t)i.forEach(a);else{const r=m(e),o=r&&_(n);if(r&&"length"===n){const e=Number(s);i.forEach(((t,n)=>{("length"===n||n===Le||!b(n)&&n>=e)&&a(t)}))}else switch((void 0!==n||i.has(void 0))&&a(i.get(n)),o&&a(i.get(Le)),t){case"add":r?o&&a(i.get("length")):(a(i.get(Pe)),p(e)&&a(i.get(Re)));break;case"delete":r||(a(i.get(Pe)),p(e)&&a(i.get(Re)));break;case"set":p(e)&&a(i.get(Pe))}}he()}function Fe(e){const t=vt(e);return t===e?t:(Ae(t,0,Le),pt(e)?t:t.map(yt))}function Ie(e){return Ae(e=vt(e),0,Le),e}function De(e,t){return mt(e)?gt(e)?bt(yt(t)):bt(t):yt(t)}const Be={__proto__:null,[Symbol.iterator](){return ze(this,Symbol.iterator,(e=>De(this,e)))},concat(...e){return Fe(this).concat(...e.map((e=>m(e)?Fe(e):e)))},entries(){return ze(this,"entries",(e=>(e[1]=De(this,e[1]),e)))},every(e,t){return Ve(this,"every",e,t,void 0,arguments)},filter(e,t){return Ve(this,"filter",e,t,(e=>e.map((e=>De(this,e)))),arguments)},find(e,t){return Ve(this,"find",e,t,(e=>De(this,e)),arguments)},findIndex(e,t){return Ve(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ve(this,"findLast",e,t,(e=>De(this,e)),arguments)},findLastIndex(e,t){return Ve(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ve(this,"forEach",e,t,void 0,arguments)},includes(...e){return He(this,"includes",e)},indexOf(...e){return He(this,"indexOf",e)},join(e){return Fe(this).join(e)},lastIndexOf(...e){return He(this,"lastIndexOf",e)},map(e,t){return Ve(this,"map",e,t,void 0,arguments)},pop(){return Ge(this,"pop")},push(...e){return Ge(this,"push",e)},reduce(e,...t){return Ne(this,"reduce",e,t)},reduceRight(e,...t){return Ne(this,"reduceRight",e,t)},shift(){return Ge(this,"shift")},some(e,t){return Ve(this,"some",e,t,void 0,arguments)},splice(...e){return Ge(this,"splice",e)},toReversed(){return Fe(this).toReversed()},toSorted(e){return Fe(this).toSorted(e)},toSpliced(...e){return Fe(this).toSpliced(...e)},unshift(...e){return Ge(this,"unshift",e)},values(){return ze(this,"values",(e=>De(this,e)))}};function ze(e,t,n){const s=Ie(e),r=s[t]();return s===e||pt(e)||(r._next=r.next,r.next=()=>{const e=r._next();return e.done||(e.value=n(e.value)),e}),r}const Ue=Array.prototype;function Ve(e,t,n,s,r,o){const i=Ie(e),a=i!==e&&!pt(e),l=i[t];if(l!==Ue[t]){const t=l.apply(e,o);return a?yt(t):t}let c=n;i!==e&&(a?c=function(t,s){return n.call(this,De(e,t),s,e)}:n.length>2&&(c=function(t,s){return n.call(this,t,s,e)}));const d=l.call(i,c,s);return a&&r?r(d):d}function Ne(e,t,n,s){const r=Ie(e),o=r!==e&&!pt(e);let i=n,a=!1;r!==e&&(o?(a=0===s.length,i=function(t,s,r){return a&&(a=!1,t=De(e,t)),n.call(this,t,De(e,s),r,e)}):n.length>3&&(i=function(t,s,r){return n.call(this,t,s,r,e)}));const l=r[t](i,...s);return a?De(e,l):l}function He(e,t,n){const s=vt(e);Ae(s,0,Le);const r=s[t](...n);return-1!==r&&!1!==r||!ft(n[0])?r:(n[0]=vt(n[0]),s[t](...n))}function Ge(e,t,n=[]){Ce(),ue();const s=vt(e)[t].apply(e,n);return he(),we(),s}const $e=s("__proto__,__v_isRef,__isVue"),We=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(b));function je(e){b(e)||(e=String(e));const t=vt(this);return Ae(t,0,e),t.hasOwnProperty(e)}class Ke{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;const s=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!s;if("__v_isReadonly"===t)return s;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(s?r?ct:lt:r?at:it).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const o=m(e);if(!s){let e;if(o&&(e=Be[t]))return e;if("hasOwnProperty"===t)return je}const i=Reflect.get(e,t,Ct(e)?e:n);if(b(t)?We.has(t):$e(t))return i;if(s||Ae(e,0,t),r)return i;if(Ct(i)){const e=o&&_(t)?i:i.value;return s&&C(e)?ut(e):e}return C(i)?s?ut(i):dt(i):i}}class qe extends Ke{constructor(e=!1){super(!1,e)}set(e,t,n,s){let r=e[t];const o=m(e)&&_(t);if(!this._isShallow){const e=mt(r);if(pt(n)||mt(n)||(r=vt(r),n=vt(n)),!o&&Ct(r)&&!Ct(n))return e||(r.value=n),!0}const i=o?Number(t)<e.length:g(e,t),a=Reflect.set(e,t,n,Ct(e)?e:s);return e===vt(s)&&(i?I(n,r)&&Oe(e,"set",t,n):Oe(e,"add",t,n)),a}deleteProperty(e,t){const n=g(e,t),s=(e[t],Reflect.deleteProperty(e,t));return s&&n&&Oe(e,"delete",t,void 0),s}has(e,t){const n=Reflect.has(e,t);return b(t)&&We.has(t)||Ae(e,0,t),n}ownKeys(e){return Ae(e,0,m(e)?"length":Pe),Reflect.ownKeys(e)}}class Qe extends Ke{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const Xe=new qe,Je=new Qe,Ye=new qe(!0),Ze=e=>e,et=e=>Reflect.getPrototypeOf(e);function tt(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function nt(e,t){const n=function(e,t){const n={get(n){const s=this.__v_raw,r=vt(s),o=vt(n);e||(I(n,o)&&Ae(r,0,n),Ae(r,0,o));const{has:i}=et(r),a=t?Ze:e?bt:yt;return i.call(r,n)?a(s.get(n)):i.call(r,o)?a(s.get(o)):void(s!==r&&s.get(n))},get size(){const t=this.__v_raw;return!e&&Ae(vt(t),0,Pe),t.size},has(t){const n=this.__v_raw,s=vt(n),r=vt(t);return e||(I(t,r)&&Ae(s,0,t),Ae(s,0,r)),t===r?n.has(t):n.has(t)||n.has(r)},forEach(n,s){const r=this,o=r.__v_raw,i=vt(o),a=t?Ze:e?bt:yt;return!e&&Ae(i,0,Pe),o.forEach(((e,t)=>n.call(s,a(e),a(t),r)))}};return d(n,e?{add:tt("add"),set:tt("set"),delete:tt("delete"),clear:tt("clear")}:{add(e){const n=vt(this),s=et(n),r=vt(e),o=t||pt(e)||mt(e)?e:r;return s.has.call(n,o)||I(e,o)&&s.has.call(n,e)||I(r,o)&&s.has.call(n,r)||(n.add(o),Oe(n,"add",o,o)),this},set(e,n){t||pt(n)||mt(n)||(n=vt(n));const s=vt(this),{has:r,get:o}=et(s);let i=r.call(s,e);i||(e=vt(e),i=r.call(s,e));const a=o.call(s,e);return s.set(e,n),i?I(n,a)&&Oe(s,"set",e,n):Oe(s,"add",e,n),this},delete(e){const t=vt(this),{has:n,get:s}=et(t);let r=n.call(t,e);r||(e=vt(e),r=n.call(t,e)),s&&s.call(t,e);const o=t.delete(e);return r&&Oe(t,"delete",e,void 0),o},clear(){const e=vt(this),t=0!==e.size,n=e.clear();return t&&Oe(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach((s=>{n[s]=function(e,t,n){return function(...s){const r=this.__v_raw,o=vt(r),i=p(o),a="entries"===e||e===Symbol.iterator&&i,l="keys"===e&&i,c=r[e](...s),u=n?Ze:t?bt:yt;return!t&&Ae(o,0,l?Re:Pe),d(Object.create(c),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[u(e[0]),u(e[1])]:u(e),done:t}}})}}(s,e,t)})),n}(e,t);return(t,s,r)=>"__v_isReactive"===s?!e:"__v_isReadonly"===s?e:"__v_raw"===s?t:Reflect.get(g(n,s)&&s in t?n:t,s,r)}const st={get:nt(!1,!1)},rt={get:nt(!1,!0)},ot={get:nt(!0,!1)},it=new WeakMap,at=new WeakMap,lt=new WeakMap,ct=new WeakMap;function dt(e){return mt(e)?e:ht(e,!1,Xe,st,it)}function ut(e){return ht(e,!0,Je,ot,lt)}function ht(e,t,n,s,r){if(!C(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;if(e.__v_skip||!Object.isExtensible(e))return e;const o=r.get(e);if(o)return o;const i=function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(T(e).slice(8,-1));if(0===i)return e;const a=new Proxy(e,2===i?s:n);return r.set(e,a),a}function gt(e){return mt(e)?gt(e.__v_raw):!(!e||!e.__v_isReactive)}function mt(e){return!(!e||!e.__v_isReadonly)}function pt(e){return!(!e||!e.__v_isShallow)}function ft(e){return!!e&&!!e.__v_raw}function vt(e){const t=e&&e.__v_raw;return t?vt(t):e}function St(e){return!g(e,"__v_skip")&&Object.isExtensible(e)&&B(e,"__v_skip",!0),e}const yt=e=>C(e)?dt(e):e,bt=e=>C(e)?ut(e):e;function Ct(e){return!!e&&!0===e.__v_isRef}function wt(e){return Tt(e,!1)}function Et(e){return Tt(e,!0)}function Tt(e,t){return Ct(e)?e:new Mt(e,t)}class Mt{constructor(e,t){this.dep=new _e,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:vt(e),this._value=t?e:yt(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||pt(e)||mt(e);e=n?e:vt(e),I(e,t)&&(this._rawValue=e,this._value=n?e:yt(e),this.dep.trigger())}}function _t(e){return Ct(e)?e.value:e}function kt(e){return S(e)?e():_t(e)}const xt={get:(e,t,n)=>"__v_raw"===t?e:_t(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return Ct(r)&&!Ct(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function Pt(e){return gt(e)?e:new Proxy(e,xt)}function Rt(e){const t=m(e)?new Array(e.length):{};for(const n in e)t[n]=Ft(e,n);return t}class Lt{constructor(e,t,n){this._object=e,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=b(t)?t:String(t),this._raw=vt(e);let s=!0,r=e;if(!m(e)||b(this._key)||!_(this._key))do{s=!ft(r)||pt(r)}while(s&&(r=r.__v_raw));this._shallow=s}get value(){let e=this._object[this._key];return this._shallow&&(e=_t(e)),this._value=void 0===e?this._defaultValue:e}set value(e){if(this._shallow&&Ct(this._raw[this._key])){const t=this._object[this._key];if(Ct(t))return void(t.value=e)}this._object[this._key]=e}get dep(){return function(e,t){const n=xe.get(e);return n&&n.get(t)}(this._raw,this._key)}}class At{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Ot(e,t,n){return Ct(e)?e:S(e)?new At(e):C(e)&&arguments.length>1?Ft(e,t,n):wt(e)}function Ft(e,t,n){return new Lt(e,t,n)}class It{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new _e(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Te-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags||te===this))return de(this,!0),!0}get value(){const e=this.dep.track();return fe(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}const Dt={},Bt=new WeakMap;let zt;function Ut(e,t=1/0,n){if(t<=0||!C(e)||e.__v_skip)return e;if(((n=n||new Map).get(e)||0)>=t)return e;if(n.set(e,t),t--,Ct(e))Ut(e.value,t,n);else if(m(e))for(let s=0;s<e.length;s++)Ut(e[s],t,n);else if(f(e)||p(e))e.forEach((e=>{Ut(e,t,n)}));else if(M(e)){for(const s in e)Ut(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Ut(e[s],t,n)}return e}function Vt(e,t,n,s){try{return s?e(...s):e()}catch(e){Ht(e,t,n)}}function Nt(e,t,n,s){if(S(e)){const r=Vt(e,t,n,s);return r&&w(r)&&r.catch((e=>{Ht(e,t,n)})),r}if(m(e)){const r=[];for(let o=0;o<e.length;o++)r.push(Nt(e[o],t,n,s));return r}}function Ht(e,t,n,s=!0){t&&t.vnode;const{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||r;if(t){let s=t.parent;const r=t.proxy,i=`https://vuejs.org/error-reference/#runtime-${n}`;for(;s;){const t=s.ec;if(t)for(let n=0;n<t.length;n++)if(!1===t[n](e,r,i))return;s=s.parent}if(o)return Ce(),Vt(o,null,10,[e,r,i]),void we()}!function(e,t,n,s=!0,r=!1){if(r)throw e;console.error(e)}(e,0,0,s,i)}const Gt=[];let $t=-1;const Wt=[];let jt=null,Kt=0;const qt=Promise.resolve();let Qt=null;function Xt(e){const t=Qt||qt;return e?t.then(this?e.bind(this):e):t}function Jt(e){if(!(1&e.flags)){const t=tn(e),n=Gt[Gt.length-1];!n||!(2&e.flags)&&t>=tn(n)?Gt.push(e):Gt.splice(function(e){let t=$t+1,n=Gt.length;for(;t<n;){const s=t+n>>>1,r=Gt[s],o=tn(r);o<e||o===e&&2&r.flags?t=s+1:n=s}return t}(t),0,e),e.flags|=1,Yt()}}function Yt(){Qt||(Qt=qt.then(nn))}function Zt(e,t,n=$t+1){for(;n<Gt.length;n++){const t=Gt[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;Gt.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function en(e){if(Wt.length){const e=[...new Set(Wt)].sort(((e,t)=>tn(e)-tn(t)));if(Wt.length=0,jt)return void jt.push(...e);for(jt=e,Kt=0;Kt<jt.length;Kt++){const e=jt[Kt];4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}jt=null,Kt=0}}const tn=e=>null==e.id?2&e.flags?-1:1/0:e.id;function nn(e){try{for($t=0;$t<Gt.length;$t++){const e=Gt[$t];!e||8&e.flags||(4&e.flags&&(e.flags&=-2),Vt(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;$t<Gt.length;$t++){const e=Gt[$t];e&&(e.flags&=-2)}$t=-1,Gt.length=0,en(),Qt=null,(Gt.length||Wt.length)&&nn(e)}}let sn,rn=[],on=!1;function an(e,...t){sn?sn.emit(e,...t):on||rn.push({event:e,args:t})}function ln(e,t){var n,s;sn=e,sn?(sn.enabled=!0,rn.forEach((({event:e,args:t})=>sn.emit(e,...t))),rn=[]):"undefined"!=typeof window&&window.HTMLElement&&!(null==(s=null==(n=window.navigator)?void 0:n.userAgent)?void 0:s.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push((e=>{ln(e,t)})),setTimeout((()=>{sn||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,on=!0,rn=[])}),3e3)):(on=!0,rn=[])}const cn=hn("component:added"),dn=hn("component:updated"),un=hn("component:removed");function hn(e){return t=>{an(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let gn=null,mn=null;function pn(e){const t=gn;return gn=e,mn=e&&e.type.__scopeId||null,t}function fn(e,t=gn,n){if(!t)return e;if(e._n)return e;const s=(...n)=>{s._d&&xr(-1);const r=pn(t);let o;try{o=e(...n)}finally{pn(r),s._d&&xr(1)}return __VUE_PROD_DEVTOOLS__&&dn(t),o};return s._n=!0,s._c=!0,s._d=!0,s}function vn(e,t){if(null===gn)return e;const n=io(gn),s=e.dirs||(e.dirs=[]);for(let e=0;e<t.length;e++){let[o,i,a,l=r]=t[e];o&&(S(o)&&(o={mounted:o,updated:o}),o.deep&&Ut(i),s.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function Sn(e,t,n,s){const r=e.dirs,o=t&&t.dirs;for(let i=0;i<r.length;i++){const a=r[i];o&&(a.oldValue=o[i].value);let l=a.dir[s];l&&(Ce(),Nt(l,n,8,[e.el,a,e,t]),we())}}function yn(e,t){if(qr){let n=qr.provides;const s=qr.parent&&qr.parent.provides;s===n&&(n=qr.provides=Object.create(s)),n[e]=t}}function bn(e,t,n=!1){const s=Qr();if(s||Ns){let r=Ns?Ns._context.provides:s?null==s.parent||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return n&&S(t)?t.call(s&&s.proxy):t}}const Cn=Symbol.for("v-scx");function wn(e,t){return Tn(e,null,t)}function En(e,t,n){return Tn(e,t,n)}function Tn(e,t,n=r){const{immediate:s,deep:o,flush:a,once:l}=n,c=d({},n),h=t&&s||!t&&"post"!==a;let g;if(to)if("sync"===a){const e=bn(Cn);g=e.__watcherHandles||(e.__watcherHandles=[])}else if(!h){const e=()=>{};return e.stop=i,e.resume=i,e.pause=i,e}const p=qr;c.call=(e,t,n)=>Nt(e,p,t,n);let f=!1;"post"===a?c.scheduler=e=>{ur(e,p&&p.suspense)}:"sync"!==a&&(f=!0,c.scheduler=(e,t)=>{t?e():Jt(e)}),c.augmentJob=e=>{t&&(e.flags|=4),f&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};const v=function(e,t,n=r){const{immediate:s,deep:o,once:a,scheduler:l,augmentJob:c,call:d}=n,h=e=>o?e:pt(e)||!1===o||0===o?Ut(e,1):Ut(e);let g,p,f,v,y=!1,b=!1;if(Ct(e)?(p=()=>e.value,y=pt(e)):gt(e)?(p=()=>h(e),y=!0):m(e)?(b=!0,y=e.some((e=>gt(e)||pt(e))),p=()=>e.map((e=>Ct(e)?e.value:gt(e)?h(e):S(e)?d?d(e,2):e():void 0))):p=S(e)?t?d?()=>d(e,2):e:()=>{if(f){Ce();try{f()}finally{we()}}const t=zt;zt=g;try{return d?d(e,3,[v]):e(v)}finally{zt=t}}:i,t&&o){const e=p,t=!0===o?1/0:o;p=()=>Ut(e(),t)}const C=se(),w=()=>{g.stop(),C&&C.active&&u(C.effects,g)};if(a&&t){const e=t;t=(...t)=>{const n=e(...t);return w(),n}}let E=b?new Array(e.length).fill(Dt):Dt;const T=e=>{if(1&g.flags&&(g.dirty||e))if(t){const n=g.run();if(e||o||y||(b?n.some(((e,t)=>I(e,E[t]))):I(n,E))){f&&f();const e=zt;zt=g;try{const s=[n,E===Dt?void 0:b&&E[0]===Dt?[]:E,v];E=n,d?d(t,3,s):t(...s)}finally{zt=e}}}else g.run()};return c&&c(T),g=new ie(p),g.scheduler=l?()=>l(T,!1):T,v=e=>function(e,t=!1,n=zt){if(n){let t=Bt.get(n);t||Bt.set(n,t=[]),t.push(e)}}(e,!1,g),f=g.onStop=()=>{const e=Bt.get(g);if(e){if(d)d(e,4);else for(const t of e)t();Bt.delete(g)}},t?s?T(!0):E=g.run():l?l(T.bind(null,!0),!0):g.run(),w.pause=g.pause.bind(g),w.resume=g.resume.bind(g),w.stop=w,w}(e,t,c);return to&&(g?g.push(v):h&&v()),v}function Mn(e,t,n){const s=this.proxy,r=y(e)?e.includes(".")?_n(s,e):()=>s[e]:e.bind(s,s);let o;S(t)?o=t:(o=t.handler,n=t);const i=Yr(this),a=Tn(r,o.bind(s),n);return i(),a}function _n(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}const kn=Symbol("_vte"),xn=e=>e.__isTeleport,Pn=Symbol("_leaveCb"),Rn=Symbol("_enterCb");const Ln=[Function,Array],An={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ln,onEnter:Ln,onAfterEnter:Ln,onEnterCancelled:Ln,onBeforeLeave:Ln,onLeave:Ln,onAfterLeave:Ln,onLeaveCancelled:Ln,onBeforeAppear:Ln,onAppear:Ln,onAfterAppear:Ln,onAppearCancelled:Ln},On=e=>{const t=e.subTree;return t.component?On(t.component):t};function Fn(e){let t=e[0];if(e.length>1){let n=!1;for(const s of e)if(s.type!==wr){t=s,n=!0;break}}return t}const In={name:"BaseTransition",props:An,setup(e,{slots:t}){const n=Qr(),s=function(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ss((()=>{e.isMounted=!0})),is((()=>{e.isUnmounting=!0})),e}();return()=>{const r=t.default&&Nn(t.default(),!0),o=r&&r.length?Fn(r):n.subTree?Vr():void 0;if(!o)return;const i=vt(e),{mode:a}=i;if(s.isLeaving)return zn(o);const l=Un(o);if(!l)return zn(o);let c=Bn(l,i,s,n,(e=>c=e));l.type!==wr&&Vn(l,c);let d=n.subTree&&Un(n.subTree);if(d&&d.type!==wr&&!Or(d,l)&&On(n).type!==wr){let e=Bn(d,i,s,n);if(Vn(d,e),"out-in"===a&&l.type!==wr)return s.isLeaving=!0,e.afterLeave=()=>{s.isLeaving=!1,8&n.job.flags||n.update(),delete e.afterLeave,d=void 0},zn(o);"in-out"===a&&l.type!==wr?e.delayLeave=(e,t,n)=>{Dn(s,d)[String(d.key)]=d,e[Pn]=()=>{t(),e[Pn]=void 0,delete c.delayedLeave,d=void 0},c.delayedLeave=()=>{n(),delete c.delayedLeave,d=void 0}}:d=void 0}else d&&(d=void 0);return o}}};function Dn(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Bn(e,t,n,s,r){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:d,onEnterCancelled:u,onBeforeLeave:h,onLeave:g,onAfterLeave:p,onLeaveCancelled:f,onBeforeAppear:v,onAppear:S,onAfterAppear:y,onAppearCancelled:b}=t,C=String(e.key),w=Dn(n,e),E=(e,t)=>{e&&Nt(e,s,9,t)},T=(e,t)=>{const n=t[1];E(e,t),m(e)?e.every((e=>e.length<=1))&&n():e.length<=1&&n()},M={mode:i,persisted:a,beforeEnter(t){let s=l;if(!n.isMounted){if(!o)return;s=v||l}t[Pn]&&t[Pn](!0);const r=w[C];r&&Or(e,r)&&r.el[Pn]&&r.el[Pn](),E(s,[t])},enter(t){if(w[C]===e)return;let s=c,r=d,i=u;if(!n.isMounted){if(!o)return;s=S||c,r=y||d,i=b||u}let a=!1;t[Rn]=e=>{a||(a=!0,E(e?i:r,[t]),M.delayedLeave&&M.delayedLeave(),t[Rn]=void 0)};const l=t[Rn].bind(null,!1);s?T(s,[t,l]):l()},leave(t,s){const r=String(e.key);if(t[Rn]&&t[Rn](!0),n.isUnmounting)return s();E(h,[t]);let o=!1;t[Pn]=n=>{o||(o=!0,s(),E(n?f:p,[t]),t[Pn]=void 0,w[r]===e&&delete w[r])};const i=t[Pn].bind(null,!1);w[r]=e,g?T(g,[t,i]):i()},clone(e){const o=Bn(e,t,n,s,r);return r&&r(o),o}};return M}function zn(e){if(Qn(e))return(e=zr(e)).children=null,e}function Un(e){if(!Qn(e))return xn(e.type)&&e.children?Fn(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(16&t)return n[0];if(32&t&&S(n.default))return n.default()}}function Vn(e,t){6&e.shapeFlag&&e.component?(e.transition=t,Vn(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Nn(e,t=!1,n){let s=[],r=0;for(let o=0;o<e.length;o++){let i=e[o];const a=null==n?i.key:String(n)+String(null!=i.key?i.key:o);i.type===br?(128&i.patchFlag&&r++,s=s.concat(Nn(i.children,t,a))):(t||i.type!==wr)&&s.push(null!=a?zr(i,{key:a}):i)}if(r>1)for(let e=0;e<s.length;e++)s[e].patchFlag=-2;return s}function Hn(e,t){return S(e)?(()=>d({name:e.name},t,{setup:e}))():e}function Gn(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function $n(e,t){let n;return!(!(n=Object.getOwnPropertyDescriptor(e,t))||n.configurable)}const Wn=new WeakMap;function jn(e,t,n,s,o=!1){if(m(e))return void e.forEach(((e,r)=>jn(e,t&&(m(t)?t[r]:t),n,s,o)));if(qn(s)&&!o)return void(512&s.shapeFlag&&s.type.__asyncResolved&&s.component.subTree.component&&jn(e,t,n,s.component.subTree));const i=4&s.shapeFlag?io(s.component):s.el,l=o?null:i,{i:c,r:d}=e,h=t&&t.r,p=c.refs===r?c.refs={}:c.refs,f=c.setupState,v=vt(f),b=f===r?a:e=>!$n(p,e)&&g(v,e),C=(e,t)=>!t||!$n(p,t);if(null!=h&&h!==d)if(Kn(t),y(h))p[h]=null,b(h)&&(f[h]=null);else if(Ct(h)){const e=t;C(0,e.k)&&(h.value=null),e.k&&(p[e.k]=null)}if(S(d))Vt(d,c,12,[l,p]);else{const t=y(d),s=Ct(d);if(t||s){const r=()=>{if(e.f){const n=t?b(d)?f[d]:p[d]:C()||!e.k?d.value:p[e.k];if(o)m(n)&&u(n,i);else if(m(n))n.includes(i)||n.push(i);else if(t)p[d]=[i],b(d)&&(f[d]=p[d]);else{const t=[i];C(0,e.k)&&(d.value=t),e.k&&(p[e.k]=t)}}else t?(p[d]=l,b(d)&&(f[d]=l)):s&&(C(0,e.k)&&(d.value=l),e.k&&(p[e.k]=l))};if(l){const t=()=>{r(),Wn.delete(e)};t.id=-1,Wn.set(e,t),ur(t,n)}else Kn(e),r()}}}function Kn(e){const t=Wn.get(e);t&&(t.flags|=8,Wn.delete(e))}V().requestIdleCallback,V().cancelIdleCallback;const qn=e=>!!e.type.__asyncLoader,Qn=e=>e.type.__isKeepAlive;function Xn(e,t){Yn(e,"a",t)}function Jn(e,t){Yn(e,"da",t)}function Yn(e,t,n=qr){const s=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(es(t,s,n),n){let e=n.parent;for(;e&&e.parent;)Qn(e.parent.vnode)&&Zn(s,t,n,e),e=e.parent}}function Zn(e,t,n,s){const r=es(t,e,s,!0);as((()=>{u(s[t],r)}),n)}function es(e,t,n=qr,s=!1){if(n){const r=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...s)=>{Ce();const r=Yr(n),o=Nt(t,n,e,s);return r(),we(),o});return s?r.unshift(o):r.push(o),o}}RegExp,RegExp;const ts=e=>(t,n=qr)=>{to&&"sp"!==e||es(e,((...e)=>t(...e)),n)},ns=ts("bm"),ss=ts("m"),rs=ts("bu"),os=ts("u"),is=ts("bum"),as=ts("um"),ls=ts("sp"),cs=ts("rtg"),ds=ts("rtc");function us(e,t=qr){es("ec",e,t)}const hs="components";function gs(e,t){return fs(hs,e,!0,t)||e}const ms=Symbol.for("v-ndc");function ps(e){return y(e)?fs(hs,e,!1)||e:e||ms}function fs(e,t,n=!0,s=!1){const r=gn||qr;if(r){const n=r.type;if(e===hs){const e=function(e,t=!0){return S(e)?e.displayName||e.name:e.name||t&&e.__name}(n,!1);if(e&&(e===t||e===R(t)||e===O(R(t))))return n}const o=vs(r[e]||n[e],t)||vs(r.appContext[e],t);return!o&&s?n:o}}function vs(e,t){return e&&(e[t]||e[R(t)]||e[O(R(t))])}function Ss(e,t,n={},s,r){if(gn.ce||gn.parent&&qn(gn.parent)&&gn.parent.ce){const e=Object.keys(n).length>0;return"default"!==t&&(n.name=t),_r(),Lr(br,null,[Br("slot",n,s&&s())],e?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),_r();const i=o&&ys(o(n)),a=n.key||i&&i.key,l=Lr(br,{key:(a&&!b(a)?a:`_${t}`)+(!i&&s?"_fb":"")},i||(s?s():[]),i&&1===e._?64:-2);return!r&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),o&&o._c&&(o._d=!0),l}function ys(e){return e.some((e=>!Ar(e)||e.type!==wr&&!(e.type===br&&!ys(e.children))))?e:null}const bs=e=>e?eo(e)?io(e):bs(e.parent):null,Cs=d(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>bs(e.parent),$root:e=>bs(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>__VUE_OPTIONS_API__?Rs(e):e.type,$forceUpdate:e=>e.f||(e.f=()=>{Jt(e.update)}),$nextTick:e=>e.n||(e.n=Xt.bind(e.proxy)),$watch:e=>__VUE_OPTIONS_API__?Mn.bind(e):i}),ws=(e,t)=>e!==r&&!e.__isScriptSetup&&g(e,t),Es={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:n,setupState:s,data:o,props:i,accessCache:a,type:l,appContext:c}=e;if("$"!==t[0]){const e=a[t];if(void 0!==e)switch(e){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(ws(s,t))return a[t]=1,s[t];if(__VUE_OPTIONS_API__&&o!==r&&g(o,t))return a[t]=2,o[t];if(g(i,t))return a[t]=3,i[t];if(n!==r&&g(n,t))return a[t]=4,n[t];__VUE_OPTIONS_API__&&!ks||(a[t]=0)}}const d=Cs[t];let u,h;return d?("$attrs"===t&&Ae(e.attrs,0,""),d(e)):(u=l.__cssModules)&&(u=u[t])?u:n!==r&&g(n,t)?(a[t]=4,n[t]):(h=c.config.globalProperties,g(h,t)?h[t]:void 0)},set({_:e},t,n){const{data:s,setupState:o,ctx:i}=e;return ws(o,t)?(o[t]=n,!0):__VUE_OPTIONS_API__&&s!==r&&g(s,t)?(s[t]=n,!0):!(g(e.props,t)||"$"===t[0]&&t.slice(1)in e||(i[t]=n,0))},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:i,type:a}},l){let c;return!!(n[l]||__VUE_OPTIONS_API__&&e!==r&&"$"!==l[0]&&g(e,l)||ws(t,l)||g(i,l)||g(s,l)||g(Cs,l)||g(o.config.globalProperties,l)||(c=a.__cssModules)&&c[l])},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:g(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Ts(){return Ms().slots}function Ms(e){const t=Qr();return t.setupContext||(t.setupContext=oo(t))}function _s(e){return m(e)?e.reduce(((e,t)=>(e[t]=null,e)),{}):e}let ks=!0;function xs(e,t,n){Nt(m(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,n)}function Ps(e,t,n,s){let r=s.includes(".")?_n(n,s):()=>n[s];if(y(e)){const n=t[e];S(n)&&En(r,n)}else if(S(e))En(r,e.bind(n));else if(C(e))if(m(e))e.forEach((e=>Ps(e,t,n,s)));else{const s=S(e.handler)?e.handler.bind(n):t[e.handler];S(s)&&En(r,s,e)}}function Rs(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,a=o.get(t);let l;return a?l=a:r.length||n||s?(l={},r.length&&r.forEach((e=>Ls(l,e,i,!0))),Ls(l,t,i)):l=t,C(t)&&o.set(t,l),l}function Ls(e,t,n,s=!1){const{mixins:r,extends:o}=t;o&&Ls(e,o,n,!0),r&&r.forEach((t=>Ls(e,t,n,!0)));for(const r in t)if(s&&"expose"===r);else{const s=As[r]||n&&n[r];e[r]=s?s(e[r],t[r]):t[r]}return e}const As={data:Os,props:Bs,emits:Bs,methods:Ds,computed:Ds,beforeCreate:Is,created:Is,beforeMount:Is,mounted:Is,beforeUpdate:Is,updated:Is,beforeDestroy:Is,beforeUnmount:Is,destroyed:Is,unmounted:Is,activated:Is,deactivated:Is,errorCaptured:Is,serverPrefetch:Is,components:Ds,directives:Ds,watch:function(e,t){if(!e)return t;if(!t)return e;const n=d(Object.create(null),e);for(const s in t)n[s]=Is(e[s],t[s]);return n},provide:Os,inject:function(e,t){return Ds(Fs(e),Fs(t))}};function Os(e,t){return t?e?function(){return d(S(e)?e.call(this,this):e,S(t)?t.call(this,this):t)}:t:e}function Fs(e){if(m(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Is(e,t){return e?[...new Set([].concat(e,t))]:t}function Ds(e,t){return e?d(Object.create(null),e,t):t}function Bs(e,t){return e?m(e)&&m(t)?[...new Set([...e,...t])]:d(Object.create(null),_s(e),_s(null!=t?t:{})):t}function zs(){return{app:null,config:{isNativeTag:a,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Us=0;function Vs(e,t){return function(n,s=null){S(n)||(n=d({},n)),null==s||C(s)||(s=null);const r=zs(),o=new WeakSet,i=[];let a=!1;const l=r.app={_uid:Us++,_component:n,_props:s,_container:null,_context:r,_instance:null,version:co,get config(){return r.config},set config(e){},use:(e,...t)=>(o.has(e)||(e&&S(e.install)?(o.add(e),e.install(l,...t)):S(e)&&(o.add(e),e(l,...t))),l),mixin:e=>(__VUE_OPTIONS_API__&&(r.mixins.includes(e)||r.mixins.push(e)),l),component:(e,t)=>t?(r.components[e]=t,l):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,l):r.directives[e],mount(o,i,c){if(!a){const d=l._ceVNode||Br(n,s);return d.appContext=r,!0===c?c="svg":!1===c&&(c=void 0),i&&t?t(d,o):e(d,o,c),a=!0,l._container=o,o.__vue_app__=l,__VUE_PROD_DEVTOOLS__&&(l._instance=d.component,function(e,t){an("app:init",e,t,{Fragment:br,Text:Cr,Comment:wr,Static:Er})}(l,co)),io(d.component)}},onUnmount(e){i.push(e)},unmount(){a&&(Nt(i,l._instance,16),e(null,l._container),__VUE_PROD_DEVTOOLS__&&(l._instance=null,function(e){an("app:unmount",e)}(l)),delete l._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,l),runWithContext(e){const t=Ns;Ns=l;try{return e()}finally{Ns=t}}};return l}}let Ns=null;function Hs(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||r;let o=n;const i=t.startsWith("update:"),a=i&&((e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${R(t)}Modifiers`]||e[`${A(t)}Modifiers`])(s,t.slice(7));let l;a&&(a.trim&&(o=n.map((e=>y(e)?e.trim():e))),a.number&&(o=n.map(z))),__VUE_PROD_DEVTOOLS__&&function(e,t,n){an("component:emit",e.appContext.app,e,t,n)}(e,t,o);let c=s[l=F(t)]||s[l=F(R(t))];!c&&i&&(c=s[l=F(A(t))]),c&&Nt(c,e,6,o);const d=s[l+"Once"];if(d){if(e.emitted){if(e.emitted[l])return}else e.emitted={};e.emitted[l]=!0,Nt(d,e,6,o)}}const Gs=new WeakMap;function $s(e,t,n=!1){const s=__VUE_OPTIONS_API__&&n?Gs:t.emitsCache,r=s.get(e);if(void 0!==r)return r;const o=e.emits;let i={},a=!1;if(__VUE_OPTIONS_API__&&!S(e)){const s=e=>{const n=$s(e,t,!0);n&&(a=!0,d(i,n))};!n&&t.mixins.length&&t.mixins.forEach(s),e.extends&&s(e.extends),e.mixins&&e.mixins.forEach(s)}return o||a?(m(o)?o.forEach((e=>i[e]=null)):d(i,o),C(e)&&s.set(e,i),i):(C(e)&&s.set(e,null),null)}function Ws(e,t){return!(!e||!l(t))&&(t=t.slice(2).replace(/Once$/,""),g(e,t[0].toLowerCase()+t.slice(1))||g(e,A(t))||g(e,t))}function js(e){const{type:t,vnode:n,proxy:s,withProxy:r,propsOptions:[o],slots:i,attrs:a,emit:l,render:d,renderCache:u,props:h,data:g,setupState:m,ctx:p,inheritAttrs:f}=e,v=pn(e);let S,y;try{if(4&n.shapeFlag){const e=r||s,t=e;S=Nr(d.call(t,e,u,h,m,g,p)),y=a}else{const e=t;S=Nr(e.length>1?e(h,{attrs:a,slots:i,emit:l}):e(h,null)),y=t.props?a:Ks(a)}}catch(t){Tr.length=0,Ht(t,e,1),S=Br(wr)}let b=S;if(y&&!1!==f){const e=Object.keys(y),{shapeFlag:t}=b;e.length&&7&t&&(o&&e.some(c)&&(y=qs(y,o)),b=zr(b,y,!1,!0))}return n.dirs&&(b=zr(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&Vn(b,n.transition),S=b,pn(v),S}const Ks=e=>{let t;for(const n in e)("class"===n||"style"===n||l(n))&&((t||(t={}))[n]=e[n]);return t},qs=(e,t)=>{const n={};for(const s in e)c(s)&&s.slice(9)in t||(n[s]=e[s]);return n};function Qs(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let r=0;r<s.length;r++){const o=s[r];if(Xs(t,e,o)&&!Ws(n,o))return!0}return!1}function Xs(e,t,n){const s=e[n],r=t[n];return"style"===n&&C(s)&&C(r)?!Q(s,r):s!==r}const Js={},Ys=()=>Object.create(Js),Zs=e=>Object.getPrototypeOf(e)===Js;function er(e,t,n,s){const[o,i]=e.propsOptions;let a,l=!1;if(t)for(let r in t){if(k(r))continue;const c=t[r];let d;o&&g(o,d=R(r))?i&&i.includes(d)?(a||(a={}))[d]=c:n[d]=c:Ws(e.emitsOptions,r)||r in s&&c===s[r]||(s[r]=c,l=!0)}if(i){const t=vt(n),s=a||r;for(let r=0;r<i.length;r++){const a=i[r];n[a]=tr(o,t,a,s[a],e,!g(s,a))}}return l}function tr(e,t,n,s,r,o){const i=e[n];if(null!=i){const e=g(i,"default");if(e&&void 0===s){const e=i.default;if(i.type!==Function&&!i.skipFactory&&S(e)){const{propsDefaults:o}=r;if(n in o)s=o[n];else{const i=Yr(r);s=o[n]=e.call(null,t),i()}}else s=e;r.ce&&r.ce._setProp(n,s)}i[0]&&(o&&!e?s=!1:!i[1]||""!==s&&s!==A(n)||(s=!0))}return s}const nr=new WeakMap;function sr(e,t,n=!1){const s=__VUE_OPTIONS_API__&&n?nr:t.propsCache,i=s.get(e);if(i)return i;const a=e.props,l={},c=[];let u=!1;if(__VUE_OPTIONS_API__&&!S(e)){const s=e=>{u=!0;const[n,s]=sr(e,t,!0);d(l,n),s&&c.push(...s)};!n&&t.mixins.length&&t.mixins.forEach(s),e.extends&&s(e.extends),e.mixins&&e.mixins.forEach(s)}if(!a&&!u)return C(e)&&s.set(e,o),o;if(m(a))for(let e=0;e<a.length;e++){const t=R(a[e]);rr(t)&&(l[t]=r)}else if(a)for(const e in a){const t=R(e);if(rr(t)){const n=a[e],s=l[t]=m(n)||S(n)?{type:n}:d({},n),r=s.type;let o=!1,i=!0;if(m(r))for(let e=0;e<r.length;++e){const t=r[e],n=S(t)&&t.name;if("Boolean"===n){o=!0;break}"String"===n&&(i=!1)}else o=S(r)&&"Boolean"===r.name;s[0]=o,s[1]=i,(o||g(s,"default"))&&c.push(t)}}const h=[l,c];return C(e)&&s.set(e,h),h}function rr(e){return"$"!==e[0]&&!k(e)}const or=e=>"_"===e||"_ctx"===e||"$stable"===e,ir=e=>m(e)?e.map(Nr):[Nr(e)],ar=(e,t,n)=>{if(t._n)return t;const s=fn(((...e)=>ir(t(...e))),n);return s._c=!1,s},lr=(e,t,n)=>{const s=e._ctx;for(const n in e){if(or(n))continue;const r=e[n];if(S(r))t[n]=ar(0,r,s);else if(null!=r){const e=ir(r);t[n]=()=>e}}},cr=(e,t)=>{const n=ir(t);e.slots.default=()=>n},dr=(e,t,n)=>{for(const s in t)!n&&or(s)||(e[s]=t[s])},ur=function(e,t){t&&t.pendingBranch?m(e)?t.effects.push(...e):t.effects.push(e):(n=e,m(n)?Wt.push(...n):jt&&-1===n.id?jt.splice(Kt+1,0,n):1&n.flags||(Wt.push(n),n.flags|=1),Yt());var n};function hr(e,t){"boolean"!=typeof __VUE_OPTIONS_API__&&(V().__VUE_OPTIONS_API__=!0),"boolean"!=typeof __VUE_PROD_DEVTOOLS__&&(V().__VUE_PROD_DEVTOOLS__=!1),"boolean"!=typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&(V().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__=!1);const n=V();n.__VUE__=!0,__VUE_PROD_DEVTOOLS__&&ln(n.__VUE_DEVTOOLS_GLOBAL_HOOK__,n);const{insert:s,remove:a,patchProp:l,createElement:c,createText:d,createComment:u,setText:h,setElementText:m,parentNode:p,nextSibling:f,setScopeId:v=i,insertStaticContent:S}=e,y=(e,t,n,s=null,r=null,o=null,i,a=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!Or(e,t)&&(s=Y(e),K(e,r,o,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:c,ref:d,shapeFlag:u}=t;switch(c){case Cr:b(e,t,n,s);break;case wr:C(e,t,n,s);break;case Er:null==e&&E(t,n,s,i);break;case br:F(e,t,n,s,r,o,i,a,l);break;default:1&u?T(e,t,n,s,r,o,i,a,l):6&u?I(e,t,n,s,r,o,i,a,l):(64&u||128&u)&&c.process(e,t,n,s,r,o,i,a,l,te)}null!=d&&r?jn(d,e&&e.ref,o,t||e,!t):null==d&&e&&null!=e.ref&&jn(e.ref,null,o,e,!0)},b=(e,t,n,r)=>{if(null==e)s(t.el=d(t.children),n,r);else{const n=t.el=e.el;t.children!==e.children&&h(n,t.children)}},C=(e,t,n,r)=>{null==e?s(t.el=u(t.children||""),n,r):t.el=e.el},E=(e,t,n,s)=>{[e.el,e.anchor]=S(e.children,t,n,s,e.el,e.anchor)},T=(e,t,n,s,r,o,i,a,l)=>{if("svg"===t.type?i="svg":"math"===t.type&&(i="mathml"),null==e)M(t,n,s,r,o,i,a,l);else{const n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),P(e,t,r,o,i,a,l)}finally{n&&n._endPatch()}}},M=(e,t,n,r,o,i,a,d)=>{let u,h;const{props:g,shapeFlag:p,transition:f,dirs:v}=e;if(u=e.el=c(e.type,i,g&&g.is,g),8&p?m(u,e.children):16&p&&x(e.children,u,null,r,o,gr(e,i),a,d),v&&Sn(e,null,r,"created"),_(u,e,e.scopeId,a,r),g){for(const e in g)"value"===e||k(e)||l(u,e,null,g[e],i,r);"value"in g&&l(u,"value",null,g.value,i),(h=g.onVnodeBeforeMount)&&Wr(h,r,e)}__VUE_PROD_DEVTOOLS__&&(B(u,"__vnode",e,!0),B(u,"__vueParentComponent",r,!0)),v&&Sn(e,null,r,"beforeMount");const S=function(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}(o,f);S&&f.beforeEnter(u),s(u,t,n),((h=g&&g.onVnodeMounted)||S||v)&&ur((()=>{try{h&&Wr(h,r,e),S&&f.enter(u),v&&Sn(e,null,r,"mounted")}finally{}}),o)},_=(e,t,n,s,r)=>{if(n&&v(e,n),s)for(let t=0;t<s.length;t++)v(e,s[t]);if(r){let n=r.subTree;if(t===n||yr(n.type)&&(n.ssContent===t||n.ssFallback===t)){const t=r.vnode;_(e,t,t.scopeId,t.slotScopeIds,r.parent)}}},x=(e,t,n,s,r,o,i,a,l=0)=>{for(let c=l;c<e.length;c++){const l=e[c]=a?Hr(e[c]):Nr(e[c]);y(null,l,t,n,s,r,o,i,a)}},P=(e,t,n,s,o,i,a)=>{const c=t.el=e.el;__VUE_PROD_DEVTOOLS__&&(c.__vnode=t);let{patchFlag:d,dynamicChildren:u,dirs:h}=t;d|=16&e.patchFlag;const g=e.props||r,p=t.props||r;let f;if(n&&mr(n,!1),(f=p.onVnodeBeforeUpdate)&&Wr(f,n,t,e),h&&Sn(t,e,n,"beforeUpdate"),n&&mr(n,!0),(g.innerHTML&&null==p.innerHTML||g.textContent&&null==p.textContent)&&m(c,""),u?L(e.dynamicChildren,u,c,n,s,gr(t,o),i):a||G(e,t,c,null,n,s,gr(t,o),i,!1),d>0){if(16&d)O(c,g,p,n,o);else if(2&d&&g.class!==p.class&&l(c,"class",null,p.class,o),4&d&&l(c,"style",g.style,p.style,o),8&d){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const s=e[t],r=g[s],i=p[s];i===r&&"value"!==s||l(c,s,r,i,o,n)}}1&d&&e.children!==t.children&&m(c,t.children)}else a||null!=u||O(c,g,p,n,o);((f=p.onVnodeUpdated)||h)&&ur((()=>{f&&Wr(f,n,t,e),h&&Sn(t,e,n,"updated")}),s)},L=(e,t,n,s,r,o,i)=>{for(let a=0;a<t.length;a++){const l=e[a],c=t[a],d=l.el&&(l.type===br||!Or(l,c)||198&l.shapeFlag)?p(l.el):n;y(l,c,d,null,s,r,o,i,!0)}},O=(e,t,n,s,o)=>{if(t!==n){if(t!==r)for(const r in t)k(r)||r in n||l(e,r,t[r],null,o,s);for(const r in n){if(k(r))continue;const i=n[r],a=t[r];i!==a&&"value"!==r&&l(e,r,a,i,o,s)}"value"in n&&l(e,"value",t.value,n.value,o)}},F=(e,t,n,r,o,i,a,l,c)=>{const u=t.el=e?e.el:d(""),h=t.anchor=e?e.anchor:d("");let{patchFlag:g,dynamicChildren:m,slotScopeIds:p}=t;p&&(l=l?l.concat(p):p),null==e?(s(u,n,r),s(h,n,r),x(t.children||[],n,h,o,i,a,l,c)):g>0&&64&g&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(L(e.dynamicChildren,m,n,o,i,a,l),(null!=t.key||o&&t===o.subTree)&&pr(e,t,!0)):G(e,t,n,h,o,i,a,l,c)},I=(e,t,n,s,r,o,i,a,l)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?r.ctx.activate(t,n,s,i,l):z(t,n,s,r,o,i,l):U(e,t,l)},z=(e,t,n,s,o,i,a)=>{const l=e.component=function(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||jr,i={uid:Kr++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new ne(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:sr(s,o),emitsOptions:$s(s,o),emit:null,emitted:null,propsDefaults:r,inheritAttrs:s.inheritAttrs,ctx:r,data:r,props:r,attrs:r,slots:r,refs:r,setupState:r,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=Hs.bind(null,i),e.ce&&e.ce(i),i}(e,s,o);if(Qn(e)&&(l.ctx.renderer=te),function(e,t=!1,n=!1){t&&Jr(t);const{props:s,children:r}=e.vnode,o=eo(e);(function(e,t,n,s=!1){const r={},o=Ys();e.propsDefaults=Object.create(null),er(e,t,r,o);for(const t in e.propsOptions[0])t in r||(r[t]=void 0);n?e.props=s?r:ht(r,!1,Ye,rt,at):e.type.props?e.props=r:e.props=o,e.attrs=o})(e,s,o,t),((e,t,n)=>{const s=e.slots=Ys();if(32&e.vnode.shapeFlag){const e=t._;e?(dr(s,t,n),n&&B(s,"_",e,!0)):lr(t,s)}else t&&cr(e,t)})(e,r,n||t);const i=o?function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Es);const{setup:s}=n;if(s){Ce();const n=e.setupContext=s.length>1?oo(e):null,r=Yr(e),o=Vt(s,e,0,[e.props,n]),i=w(o);if(we(),r(),!i&&!e.sp||qn(e)||Gn(e),i){if(o.then(Zr,Zr),t)return o.then((n=>{no(e,n,t)})).catch((t=>{Ht(t,e,0)}));e.asyncDep=o}else no(e,o,t)}else so(e,t)}(e,t):void 0;t&&Jr(!1)}(l,!1,a),l.asyncDep){if(o&&o.registerDep(l,N,a),!e.el){const s=l.subTree=Br(wr);C(null,s,t,n),e.placeholder=s.el}}else N(l,e,t,n,o,i,a)},U=(e,t,n)=>{const s=t.component=e.component;if(function(e,t,n){const{props:s,children:r,component:o}=e,{props:i,children:a,patchFlag:l}=t,c=o.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!r&&!a||a&&a.$stable)||s!==i&&(s?!i||Qs(s,i,c):!!i);if(1024&l)return!0;if(16&l)return s?Qs(s,i,c):!!i;if(8&l){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const n=e[t];if(Xs(i,s,n)&&!Ws(c,n))return!0}}return!1}(e,t,n)){if(s.asyncDep&&!s.asyncResolved)return void H(s,t,n);s.next=t,s.update()}else t.el=e.el,s.vnode=t},N=(e,t,n,s,r,o,i)=>{e.scope.on();const a=e.effect=new ie((()=>{if(e.isMounted){let{next:t,bu:n,u:s,parent:a,vnode:c}=e;{const n=fr(e);if(n)return t&&(t.el=c.el,H(e,t,i)),void n.asyncDep.then((()=>{ur((()=>{e.isUnmounted||l()}),r)}))}let d,u=t;mr(e,!1),t?(t.el=c.el,H(e,t,i)):t=c,n&&D(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&Wr(d,a,t,c),mr(e,!0);const h=js(e),g=e.subTree;e.subTree=h,y(g,h,p(g.el),Y(g),e,r,o),t.el=h.el,null===u&&function({vnode:e,parent:t,suspense:n},s){for(;t;){const n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=s,e=n),n!==e)break;(e=t.vnode).el=s,t=t.parent}n&&n.activeBranch===e&&(n.vnode.el=s)}(e,h.el),s&&ur(s,r),(d=t.props&&t.props.onVnodeUpdated)&&ur((()=>Wr(d,a,t,c)),r),__VUE_PROD_DEVTOOLS__&&dn(e)}else{let i;const{el:a,props:l}=t,{bm:c,m:d,parent:u,root:h,type:g}=e,m=qn(t);if(mr(e,!1),c&&D(c),!m&&(i=l&&l.onVnodeBeforeMount)&&Wr(i,u,t),mr(e,!0),a&&re){const t=()=>{e.subTree=js(e),re(a,e.subTree,e,r,null)};m&&g.__asyncHydrate?g.__asyncHydrate(a,e,t):t()}else{h.ce&&h.ce._hasShadowRoot()&&h.ce._injectChildStyle(g,e.parent?e.parent.type:void 0);const i=e.subTree=js(e);y(null,i,n,s,e,r,o),t.el=i.el}if(d&&ur(d,r),!m&&(i=l&&l.onVnodeMounted)){const e=t;ur((()=>Wr(i,u,e)),r)}(256&t.shapeFlag||u&&qn(u.vnode)&&256&u.vnode.shapeFlag)&&e.a&&ur(e.a,r),e.isMounted=!0,__VUE_PROD_DEVTOOLS__&&cn(e),t=n=s=null}}));e.scope.off();const l=e.update=a.run.bind(a),c=e.job=a.runIfDirty.bind(a);c.i=e,c.id=e.uid,a.scheduler=()=>Jt(c),mr(e,!0),l()},H=(e,t,n)=>{t.component=e;const s=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,s){const{props:r,attrs:o,vnode:{patchFlag:i}}=e,a=vt(r),[l]=e.propsOptions;let c=!1;if(!(s||i>0)||16&i){let s;er(e,t,r,o)&&(c=!0);for(const o in a)t&&(g(t,o)||(s=A(o))!==o&&g(t,s))||(l?!n||void 0===n[o]&&void 0===n[s]||(r[o]=tr(l,a,o,void 0,e,!0)):delete r[o]);if(o!==a)for(const e in o)t&&g(t,e)||(delete o[e],c=!0)}else if(8&i){const n=e.vnode.dynamicProps;for(let s=0;s<n.length;s++){let i=n[s];if(Ws(e.emitsOptions,i))continue;const d=t[i];if(l)if(g(o,i))d!==o[i]&&(o[i]=d,c=!0);else{const t=R(i);r[t]=tr(l,a,t,d,e,!1)}else d!==o[i]&&(o[i]=d,c=!0)}}c&&Oe(e.attrs,"set","")}(e,t.props,s,n),((e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,a=r;if(32&s.shapeFlag){const e=t._;e?n&&1===e?i=!1:dr(o,t,n):(i=!t.$stable,lr(t,o)),a=t}else t&&(cr(e,t),a={default:1});if(i)for(const e in o)or(e)||null!=a[e]||delete o[e]})(e,t.children,n),Ce(),Zt(e),we()},G=(e,t,n,s,r,o,i,a,l=!1)=>{const c=e&&e.children,d=e?e.shapeFlag:0,u=t.children,{patchFlag:h,shapeFlag:g}=t;if(h>0){if(128&h)return void W(c,u,n,s,r,o,i,a,l);if(256&h)return void $(c,u,n,s,r,o,i,a,l)}8&g?(16&d&&J(c,r,o),u!==c&&m(n,u)):16&d?16&g?W(c,u,n,s,r,o,i,a,l):J(c,r,o,!0):(8&d&&m(n,""),16&g&&x(u,n,s,r,o,i,a,l))},$=(e,t,n,s,r,i,a,l,c)=>{t=t||o;const d=(e=e||o).length,u=t.length,h=Math.min(d,u);let g;for(g=0;g<h;g++){const s=t[g]=c?Hr(t[g]):Nr(t[g]);y(e[g],s,n,null,r,i,a,l,c)}d>u?J(e,r,i,!0,!1,h):x(t,n,s,r,i,a,l,c,h)},W=(e,t,n,s,r,i,a,l,c)=>{let d=0;const u=t.length;let h=e.length-1,g=u-1;for(;d<=h&&d<=g;){const s=e[d],o=t[d]=c?Hr(t[d]):Nr(t[d]);if(!Or(s,o))break;y(s,o,n,null,r,i,a,l,c),d++}for(;d<=h&&d<=g;){const s=e[h],o=t[g]=c?Hr(t[g]):Nr(t[g]);if(!Or(s,o))break;y(s,o,n,null,r,i,a,l,c),h--,g--}if(d>h){if(d<=g){const e=g+1,o=e<u?t[e].el:s;for(;d<=g;)y(null,t[d]=c?Hr(t[d]):Nr(t[d]),n,o,r,i,a,l,c),d++}}else if(d>g)for(;d<=h;)K(e[d],r,i,!0),d++;else{const m=d,p=d,f=new Map;for(d=p;d<=g;d++){const e=t[d]=c?Hr(t[d]):Nr(t[d]);null!=e.key&&f.set(e.key,d)}let v,S=0;const b=g-p+1;let C=!1,w=0;const E=new Array(b);for(d=0;d<b;d++)E[d]=0;for(d=m;d<=h;d++){const s=e[d];if(S>=b){K(s,r,i,!0);continue}let o;if(null!=s.key)o=f.get(s.key);else for(v=p;v<=g;v++)if(0===E[v-p]&&Or(s,t[v])){o=v;break}void 0===o?K(s,r,i,!0):(E[o-p]=d+1,o>=w?w=o:C=!0,y(s,t[o],n,null,r,i,a,l,c),S++)}const T=C?function(e){const t=e.slice(),n=[0];let s,r,o,i,a;const l=e.length;for(s=0;s<l;s++){const l=e[s];if(0!==l){if(r=n[n.length-1],e[r]<l){t[s]=r,n.push(s);continue}for(o=0,i=n.length-1;o<i;)a=o+i>>1,e[n[a]]<l?o=a+1:i=a;l<e[n[o]]&&(o>0&&(t[s]=n[o-1]),n[o]=s)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}(E):o;for(v=T.length-1,d=b-1;d>=0;d--){const e=p+d,o=t[e],h=t[e+1],g=e+1<u?h.el||Sr(h):s;0===E[d]?y(null,o,n,g,r,i,a,l,c):C&&(v<0||d!==T[v]?j(o,n,g,2):v--)}}},j=(e,t,n,r,o=null)=>{const{el:i,type:l,transition:c,children:d,shapeFlag:u}=e;if(6&u)j(e.component.subTree,t,n,r);else if(128&u)e.suspense.move(t,n,r);else if(64&u)l.move(e,t,n,te);else if(l!==br)if(l!==Er)if(2!==r&&1&u&&c)if(0===r)c.persisted&&!i[Pn]?s(i,t,n):(c.beforeEnter(i),s(i,t,n),ur((()=>c.enter(i)),o));else{const{leave:r,delayLeave:o,afterLeave:l}=c,d=()=>{e.ctx.isUnmounted?a(i):s(i,t,n)},u=()=>{const e=i._isLeaving||!!i[Pn];i._isLeaving&&i[Pn](!0),c.persisted&&!e?d():r(i,(()=>{d(),l&&l()}))};o?o(i,d,u):u()}else s(i,t,n);else(({el:e,anchor:t},n,r)=>{let o;for(;e&&e!==t;)o=f(e),s(e,n,r),e=o;s(t,n,r)})(e,t,n);else{s(i,t,n);for(let e=0;e<d.length;e++)j(d[e],t,n,r);s(e.anchor,t,n)}},K=(e,t,n,s=!1,r=!1)=>{const{type:o,props:i,ref:a,children:l,dynamicChildren:c,shapeFlag:d,patchFlag:u,dirs:h,cacheIndex:g,memo:m}=e;if(-2===u&&(r=!1),null!=a&&(Ce(),jn(a,null,n,e,!0),we()),null!=g&&(t.renderCache[g]=void 0),256&d)return void t.ctx.deactivate(e);const p=1&d&&h,f=!qn(e);let v;if(f&&(v=i&&i.onVnodeBeforeUnmount)&&Wr(v,t,e),6&d)X(e.component,n,s);else{if(128&d)return void e.suspense.unmount(n,s);p&&Sn(e,null,t,"beforeUnmount"),64&d?e.type.remove(e,t,n,te,s):c&&!c.hasOnce&&(o!==br||u>0&&64&u)?J(c,t,n,!1,!0):(o===br&&384&u||!r&&16&d)&&J(l,t,n),s&&q(e)}const S=null!=m&&null==g;(f&&(v=i&&i.onVnodeUnmounted)||p||S)&&ur((()=>{v&&Wr(v,t,e),p&&Sn(e,null,t,"unmounted"),S&&(e.el=null)}),n)},q=e=>{const{type:t,el:n,anchor:s,transition:r}=e;if(t===br)return void Q(n,s);if(t===Er)return void(({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=f(e),a(e),e=n;a(t)})(e);const o=()=>{a(n),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&e.shapeFlag&&r&&!r.persisted){const{leave:t,delayLeave:s}=r,i=()=>t(n,o);s?s(e.el,o,i):i()}else o()},Q=(e,t)=>{let n;for(;e!==t;)n=f(e),a(e),e=n;a(t)},X=(e,t,n)=>{const{bum:s,scope:r,job:o,subTree:i,um:a,m:l,a:c}=e;var d;vr(l),vr(c),s&&D(s),r.stop(),o&&(o.flags|=8,K(i,e,t,n)),a&&ur(a,t),ur((()=>{e.isUnmounted=!0}),t),__VUE_PROD_DEVTOOLS__&&(d=e,sn&&"function"==typeof sn.cleanupBuffer&&!sn.cleanupBuffer(d)&&un(d))},J=(e,t,n,s=!1,r=!1,o=0)=>{for(let i=o;i<e.length;i++)K(e[i],t,n,s,r)},Y=e=>{if(6&e.shapeFlag)return Y(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=f(e.anchor||e.el),n=t&&t[kn];return n?f(n):t};let Z=!1;const ee=(e,t,n)=>{let s;null==e?t._vnode&&(K(t._vnode,null,null,!0),s=t._vnode.component):y(t._vnode||null,e,t,null,null,null,n),t._vnode=e,Z||(Z=!0,Zt(s),en(),Z=!1)},te={p:y,um:K,m:j,r:q,mt:z,mc:x,pc:G,pbc:L,n:Y,o:e};let se,re;return t&&([se,re]=t(te)),{render:ee,hydrate:se,createApp:Vs(ee,se)}}function gr({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function mr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function pr(e,t,n=!1){const s=e.children,r=t.children;if(m(s)&&m(r))for(let e=0;e<s.length;e++){const t=s[e];let o=r[e];1&o.shapeFlag&&!o.dynamicChildren&&((o.patchFlag<=0||32===o.patchFlag)&&(o=r[e]=Hr(r[e]),o.el=t.el),n||-2===o.patchFlag||pr(t,o)),o.type===Cr&&(-1===o.patchFlag&&(o=r[e]=Hr(o)),o.el=t.el),o.type!==wr||o.el||(o.el=t.el)}}function fr(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:fr(t)}function vr(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Sr(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Sr(t.subTree):null}const yr=e=>e.__isSuspense;const br=Symbol.for("v-fgt"),Cr=Symbol.for("v-txt"),wr=Symbol.for("v-cmt"),Er=Symbol.for("v-stc"),Tr=[];let Mr=null;function _r(e=!1){Tr.push(Mr=e?null:[])}let kr=1;function xr(e,t=!1){kr+=e,e<0&&Mr&&t&&(Mr.hasOnce=!0)}function Pr(e){return e.dynamicChildren=kr>0?Mr||o:null,Tr.pop(),Mr=Tr[Tr.length-1]||null,kr>0&&Mr&&Mr.push(e),e}function Rr(e,t,n,s,r,o){return Pr(Dr(e,t,n,s,r,o,!0))}function Lr(e,t,n,s,r){return Pr(Br(e,t,n,s,r,!0))}function Ar(e){return!!e&&!0===e.__v_isVNode}function Or(e,t){return e.type===t.type&&e.key===t.key}const Fr=({key:e})=>null!=e?e:null,Ir=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?y(e)||Ct(e)||S(e)?{i:gn,r:e,k:t,f:!!n}:e:null);function Dr(e,t=null,n=null,s=0,r=null,o=(e===br?0:1),i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Fr(t),ref:t&&Ir(t),scopeId:mn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:gn};return a?(Gr(l,n),128&o&&e.normalize(l)):n&&(l.shapeFlag|=y(n)?8:16),kr>0&&!i&&Mr&&(l.patchFlag>0||6&o)&&32!==l.patchFlag&&Mr.push(l),l}const Br=function(e,t=null,n=null,s=0,r=null,o=!1){if(e&&e!==ms||(e=wr),Ar(e)){const s=zr(e,t,!0);return n&&Gr(s,n),kr>0&&!o&&Mr&&(6&s.shapeFlag?Mr[Mr.indexOf(e)]=s:Mr.push(s)),s.patchFlag=-2,s}if(i=e,S(i)&&"__vccOpts"in i&&(e=e.__vccOpts),t){t=function(e){return e?ft(e)||Zs(e)?d({},e):e:null}(t);let{class:e,style:n}=t;e&&!y(e)&&(t.class=j(e)),C(n)&&(ft(n)&&!m(n)&&(n=d({},n)),t.style=N(n))}var i;return Dr(e,t,n,s,r,y(e)?1:yr(e)?128:xn(e)?64:C(e)?4:S(e)?2:0,o,!0)};function zr(e,t,n=!1,s=!1){const{props:r,ref:o,patchFlag:i,children:a,transition:l}=e,c=t?$r(r||{},t):r,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Fr(c),ref:t&&t.ref?n&&o?m(o)?o.concat(Ir(t)):[o,Ir(t)]:Ir(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==br?-1===i?16:16|i:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&zr(e.ssContent),ssFallback:e.ssFallback&&zr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&s&&Vn(d,l.clone(d)),d}function Ur(e=" ",t=0){return Br(Cr,null,e,t)}function Vr(e="",t=!1){return t?(_r(),Lr(wr,null,e)):Br(wr,null,e)}function Nr(e){return null==e||"boolean"==typeof e?Br(wr):m(e)?Br(br,null,e.slice()):Ar(e)?Hr(e):Br(Cr,null,String(e))}function Hr(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:zr(e)}function Gr(e,t){let n=0;const{shapeFlag:s}=e;if(null==t)t=null;else if(m(t))n=16;else if("object"==typeof t){if(65&s){const n=t.default;return void(n&&(n._c&&(n._d=!1),Gr(e,n()),n._c&&(n._d=!0)))}{n=32;const s=t._;s||Zs(t)?3===s&&gn&&(1===gn.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=gn}}else S(t)?(t={default:t,_ctx:gn},n=32):(t=String(t),64&s?(n=16,t=[Ur(t)]):n=8);e.children=t,e.shapeFlag|=n}function $r(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const e in s)if("class"===e)t.class!==s.class&&(t.class=j([t.class,s.class]));else if("style"===e)t.style=N([t.style,s.style]);else if(l(e)){const n=t[e],r=s[e];!r||n===r||m(n)&&n.includes(r)?null!=r||null!=n||c(e)||(t[e]=r):t[e]=n?[].concat(n,r):r}else""!==e&&(t[e]=s[e])}return t}function Wr(e,t,n,s=null){Nt(e,t,7,[n,s])}const jr=zs();let Kr=0;let qr=null;const Qr=()=>qr||gn;let Xr,Jr;{const e=V(),t=(t,n)=>{let s;return(s=e[t])||(s=e[t]=[]),s.push(n),e=>{s.length>1?s.forEach((t=>t(e))):s[0](e)}};Xr=t("__VUE_INSTANCE_SETTERS__",(e=>qr=e)),Jr=t("__VUE_SSR_SETTERS__",(e=>to=e))}const Yr=e=>{const t=qr;return Xr(e),e.scope.on(),()=>{e.scope.off(),Xr(t)}},Zr=()=>{qr&&qr.scope.off(),Xr(null)};function eo(e){return 4&e.vnode.shapeFlag}let to=!1;function no(e,t,n){S(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:C(t)&&(__VUE_PROD_DEVTOOLS__&&(e.devtoolsRawSetupState=t),e.setupState=Pt(t)),so(e,n)}function so(e,t,n){const s=e.type;if(e.render||(e.render=s.render||i),__VUE_OPTIONS_API__){const t=Yr(e);Ce();try{!function(e){const t=Rs(e),n=e.proxy,s=e.ctx;ks=!1,t.beforeCreate&&xs(t.beforeCreate,e,"bc");const{data:r,computed:o,methods:a,watch:l,provide:c,inject:d,created:u,beforeMount:h,mounted:g,beforeUpdate:p,updated:f,activated:v,deactivated:y,beforeDestroy:b,beforeUnmount:w,destroyed:E,unmounted:T,render:M,renderTracked:_,renderTriggered:k,errorCaptured:x,serverPrefetch:P,expose:R,inheritAttrs:L,components:A,directives:O,filters:F}=t;if(d&&function(e,t,n=i){m(e)&&(e=Fs(e));for(const n in e){const s=e[n];let r;r=C(s)?"default"in s?bn(s.from||n,s.default,!0):bn(s.from||n):bn(s),Ct(r)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[n]=r}}(d,s,null),a)for(const e in a){const t=a[e];S(t)&&(s[e]=t.bind(n))}if(r){const t=r.call(n,n);C(t)&&(e.data=dt(t))}if(ks=!0,o)for(const e in o){const t=o[e],r=S(t)?t.bind(n,n):S(t.get)?t.get.bind(n,n):i,a=!S(t)&&S(t.set)?t.set.bind(n):i,l=ao({get:r,set:a});Object.defineProperty(s,e,{enumerable:!0,configurable:!0,get:()=>l.value,set:e=>l.value=e})}if(l)for(const e in l)Ps(l[e],s,n,e);if(c){const e=S(c)?c.call(n):c;Reflect.ownKeys(e).forEach((t=>{yn(t,e[t])}))}function I(e,t){m(t)?t.forEach((t=>e(t.bind(n)))):t&&e(t.bind(n))}if(u&&xs(u,e,"c"),I(ns,h),I(ss,g),I(rs,p),I(os,f),I(Xn,v),I(Jn,y),I(us,x),I(ds,_),I(cs,k),I(is,w),I(as,T),I(ls,P),m(R))if(R.length){const t=e.exposed||(e.exposed={});R.forEach((e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})}))}else e.exposed||(e.exposed={});M&&e.render===i&&(e.render=M),null!=L&&(e.inheritAttrs=L),A&&(e.components=A),O&&(e.directives=O),P&&Gn(e)}(e)}finally{we(),t()}}}const ro={get:(e,t)=>(Ae(e,0,""),e[t])};function oo(e){return{attrs:new Proxy(e.attrs,ro),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function io(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Pt(St(e.exposed)),{get:(t,n)=>n in t?t[n]:n in Cs?Cs[n](e):void 0,has:(e,t)=>t in e||t in Cs})):e.proxy}const ao=(e,t)=>{const n=function(e,t,n=!1){let s,r;return S(e)?s=e:(s=e.get,r=e.set),new It(s,r,n)}(e,0,to);return n};function lo(e,t,n){try{xr(-1);const s=arguments.length;return 2===s?C(t)&&!m(t)?Ar(t)?Br(e,null,[t]):Br(e,t):Br(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):3===s&&Ar(n)&&(n=[n]),Br(e,t,n))}finally{xr(1)}}const co="3.5.38",uo=i;const ho="undefined"!=typeof window&&"undefined"!=typeof document,go=("undefined"!=typeof WorkerGlobalScope&&(globalThis,WorkerGlobalScope),Object.prototype.toString);function mo(e){return Array.isArray(e)?e:[e]}function po(e){const t=Object.create(null);return n=>t[n]||(t[n]=e(n))}const fo=/\B([A-Z])/g,vo=(po((e=>e.replace(fo,"-$1").toLowerCase())),/-(\w)/g);po((e=>e.replace(vo,((e,t)=>t?t.toUpperCase():""))));const So=e=>"number"==typeof e,yo=e=>"undefined"!=typeof Element&&e instanceof Element;var bo=class extends Error{constructor(e){super(e),this.name="ElementPlusError"}};function Co(e,t){{const n=y(e)?new bo(`[${e}] ${t}`):e;console.warn(n)}}var wo=(e,t)=>{const n=e.__vccOpts||e;for(const[e,s]of t)n[e]=s;return n};const Eo="object"==typeof global&&global&&global.Object===Object&&global;var To="object"==typeof self&&self&&self.Object===Object&&self;const Mo=Eo||To||Function("return this")(),_o=Mo.Symbol;var ko=Object.prototype,xo=ko.hasOwnProperty,Po=ko.toString,Ro=_o?_o.toStringTag:void 0;var Lo=Object.prototype.toString;var Ao=_o?_o.toStringTag:void 0;const Oo=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Ao&&Ao in Object(e)?function(e){var t=xo.call(e,Ro),n=e[Ro];try{e[Ro]=void 0;var s=!0}catch(e){}var r=Po.call(e);return s&&(t?e[Ro]=n:delete e[Ro]),r}(e):function(e){return Lo.call(e)}(e)},Fo=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Io=Mo["__core-js_shared__"];var Do=function(){var e=/[^.]+$/.exec(Io&&Io.keys&&Io.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var Bo=Function.prototype.toString;var zo=/^\[object .+?Constructor\]$/,Uo=Function.prototype,Vo=Object.prototype,No=Uo.toString,Ho=Vo.hasOwnProperty,Go=RegExp("^"+No.call(Ho).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const $o=function(e){return!(!Fo(e)||(t=e,Do&&Do in t))&&(function(e){if(!Fo(e))return!1;var t=Oo(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?Go:zo).test(function(e){if(null!=e){try{return Bo.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t},Wo=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return $o(n)?n:void 0},jo=function(){try{var e=Wo(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Ko=function(e,t,n){"__proto__"==t&&jo?jo(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},qo=function(e){for(var t=-1,n=null==e?0:e.length,s={};++t<n;){var r=e[t];Ko(s,r[0],r[1])}return s},Qo=(e,t)=>{if(!C(e)||C(n=e)&&n.__epPropKey)return e;var n;const{values:s,required:r,default:o,type:i,validator:a}=e,l={type:i,required:!!r,validator:s||a?n=>{let r=!1,i=[];if(s&&(i=Array.from(s),g(e,"default")&&i.push(o),r||=i.includes(n)),a&&(r||=a(n)),!r&&i.length>0){const e=[...new Set(i)].map((e=>JSON.stringify(e))).join(", ");uo(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${e}], got value ${JSON.stringify(n)}.`)}return r}:void 0,__epPropKey:!0};return g(e,"default")&&(l.default=o),l},Xo=e=>qo(Object.entries(e).map((([e,t])=>[e,Qo(t,e)])));var Jo=Hn({name:"CircleCheck",__name:"circle-check",setup:e=>(e,t)=>(_r(),Rr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[Dr("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),Dr("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752z"})]))}),Yo=Hn({name:"CircleCloseFilled",__name:"circle-close-filled",setup:e=>(e,t)=>(_r(),Rr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[Dr("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}),Zo=Hn({name:"CircleClose",__name:"circle-close",setup:e=>(e,t)=>(_r(),Rr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[Dr("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),Dr("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}),ei=Hn({name:"Close",__name:"close",setup:e=>(e,t)=>(_r(),Rr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[Dr("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}),ti=Hn({name:"Hide",__name:"hide",setup:e=>(e,t)=>(_r(),Rr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[Dr("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176S0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6q-43.2 72-153.6 172.8c-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176S1024 528 1024 512s-48.001-73.6-134.401-176"}),Dr("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112s-67.2 48-112 48"})]))}),ni=Hn({name:"InfoFilled",__name:"info-filled",setup:e=>(e,t)=>(_r(),Rr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[Dr("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.99 12.99 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}),si=Hn({name:"Loading",__name:"loading",setup:e=>(e,t)=>(_r(),Rr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[Dr("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"})]))}),ri=Hn({name:"SuccessFilled",__name:"success-filled",setup:e=>(e,t)=>(_r(),Rr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[Dr("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}),oi=Hn({name:"View",__name:"view",setup:e=>(e,t)=>(_r(),Rr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[Dr("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}),ii=Hn({name:"WarningFilled",__name:"warning-filled",setup:e=>(e,t)=>(_r(),Rr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[Dr("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.43 58.43 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.43 58.43 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))});const ai=[String,Object,Function],li={Close:ei,SuccessFilled:ri,InfoFilled:ni,WarningFilled:ii,CircleCloseFilled:Yo},ci={primary:ni,success:ri,warning:ii,error:Yo,info:ni},di={validating:si,success:Jo,error:Zo},ui=["","default","small","large"],hi=e=>"undefined"!=typeof Element&&e instanceof Element,gi=e=>Array.from(e.querySelectorAll('a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])')).filter((e=>mi(e)&&(e=>"fixed"!==getComputedStyle(e).position&&null!==e.offsetParent)(e))),mi=e=>{if(e.tabIndex>0||0===e.tabIndex&&null!==e.getAttribute("tabIndex"))return!0;if(e.tabIndex<0||e.hasAttribute("disabled")||"true"===e.getAttribute("aria-disabled"))return!1;switch(e.nodeName){case"A":return!!e.href&&"ignore"!==e.rel;case"INPUT":return!("hidden"===e.type||"file"===e.type);case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},pi=(e="")=>e.split(" ").filter((e=>!!e.trim()));function fi(e,t="px"){return e||0===e?So(e)||y(n=e)&&!Number.isNaN(Number(n))?`${e}${t}`:y(e)?e:void Co("utils/dom/style","binding value must be a string or number"):"";var n}var vi=/\s/;var Si=/^\s+/;const yi=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&vi.test(e.charAt(t)););return t}(e)+1).replace(Si,""):e},bi=function(e){return null!=e&&"object"==typeof e},Ci=function(e){return"symbol"==typeof e||bi(e)&&"[object Symbol]"==Oo(e)};var wi=/^[-+]0x[0-9a-f]+$/i,Ei=/^0b[01]+$/i,Ti=/^0o[0-7]+$/i,Mi=parseInt;const _i=function(e){if("number"==typeof e)return e;if(Ci(e))return NaN;if(Fo(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Fo(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=yi(e);var n=Ei.test(e);return n||Ti.test(e)?Mi(e.slice(2),n?2:8):wi.test(e)?NaN:+e},ki=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=_i(n))==n?n:0),void 0!==t&&(t=(t=_i(t))==t?t:0),function(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}(_i(e),t,n)};let xi;const Pi=e=>{if(!ho)return 0;if(void 0!==xi)return xi;const t=document.createElement("div");t.className=`${e}-scrollbar__wrap`,t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);const n=t.offsetWidth;t.style.overflow="scroll";const s=document.createElement("div");s.style.width="100%",t.appendChild(s);const r=s.offsetWidth;return t.parentNode?.removeChild(t),xi=n-r,xi},Ri=(e,t,n,s,r)=>{let o=`${e}-${t}`;return n&&(o+=`-${n}`),s&&(o+=`__${s}`),r&&(o+=`--${r}`),o},Li=Symbol("namespaceContextKey"),Ai=e=>{const t=e||(Qr()?bn(Li,wt("el")):wt("el"));return ao((()=>_t(t)||"el"))},Oi=(e,t)=>{const n=Ai(t);return{namespace:n,b:(t="")=>Ri(n.value,e,t,"",""),e:t=>t?Ri(n.value,e,"",t,""):"",m:t=>t?Ri(n.value,e,"","",t):"",be:(t,s)=>t&&s?Ri(n.value,e,t,s,""):"",em:(t,s)=>t&&s?Ri(n.value,e,"",t,s):"",bm:(t,s)=>t&&s?Ri(n.value,e,t,"",s):"",bem:(t,s,r)=>t&&s&&r?Ri(n.value,e,t,s,r):"",is:(e,...t)=>{const n=!(t.length>=1)||t[0];return e&&n?`is-${e}`:""},cssVar:e=>{const t={};for(const s in e)e[s]&&(t[`--${n.value}-${s}`]=e[s]);return t},cssVarName:e=>`--${n.value}-${e}`,cssVarBlock:t=>{const s={};for(const r in t)t[r]&&(s[`--${n.value}-${e}-${r}`]=t[r]);return s},cssVarBlockName:t=>`--${n.value}-${e}-${t}`}},Fi=(e,t={})=>{Ct(e)||function(e,t){throw new bo("[[useLockscreen]] You need to pass a ref param to this function")}();const n=t.ns||Oi("popup"),s=ao((()=>n.bm("parent","hidden")));let r=0,o=!1,i="0",a=!1;const l=()=>{a||(a=!0,setTimeout((()=>{var e,t;"undefined"!=typeof document&&o&&document&&(document.body.style.width=i,e=document.body,t=s.value,e&&t.trim()&&e.classList.remove(...pi(t)))}),200))};En(e,(e=>{if(!e)return void l();var t,c;a=!1,o=!((e,t)=>{if(!e||!t)return!1;if(t.includes(" "))throw new Error("className should not contain space.");return e.classList.contains(t)})(document.body,s.value),o&&(i=document.body.style.width,t=document.body,c=s.value,t&&c.trim()&&t.classList.add(...pi(c))),r=Pi(n.namespace.value);const d=document.documentElement.clientHeight<document.body.scrollHeight,u=((e,t)=>{if(!ho||!e||!t||"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot)return"";let n=R(t);"float"===n&&(n="cssFloat");try{const t=e.style[n];if(t)return t;const s=document.defaultView?.getComputedStyle(e,"");return s?s[n]:""}catch{return e.style[n]}})(document.body,"overflowY");r>0&&(d||"scroll"===u)&&o&&(document.body.style.width=`calc(100% - ${r}px)`)})),re((()=>l()))},Ii=e=>{if(!e)return{onClick:i,onMousedown:i,onMouseup:i};let t=!1,n=!1;return{onClick:s=>{t&&n&&e(s),t=n=!1},onMousedown:e=>{t=e.target===e.currentTarget},onMouseup:e=>{n=e.target===e.currentTarget}}},Di={prefix:Math.floor(1e4*Math.random()),current:0},Bi=Symbol("elIdInjection"),zi=e=>{const t=Qr()?bn(Bi,Di):Di;ho||t!==Di||Co("IdInjection","Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed\nusage: app.provide(ID_INJECTION_KEY, {\n prefix: number,\n current: number,\n})");const n=Ai();return function(e,t){var n;const s=Et();return wn((()=>{s.value=e()}),{...t,flush:null!==(n=null==t?void 0:t.flush)&&void 0!==n?n:"sync"}),ut(s)}((()=>_t(e)||`${n.value}-id-${t.prefix}-${t.current++}`))},Ui=(Vi=Object.getPrototypeOf,Ni=Object,function(e){return Vi(Ni(e))});var Vi,Ni,Hi=Function.prototype,Gi=Object.prototype,$i=Hi.toString,Wi=Gi.hasOwnProperty,ji=$i.call(Object);const Ki=function(e){if(!bi(e)||"[object Object]"!=Oo(e))return!1;var t=Ui(e);if(null===t)return!0;var n=Wi.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&$i.call(n)==ji},qi=e=>{const t=e.props,n=m(t)?qo(t.map((e=>[e,{}]))):t;e.setPropsDefaults=t=>{if(n){for(const[e,s]of Object.entries(t)){const t=n[e];g(n,e)&&(Ki(t)?n[e]={...t,default:s}:n[e]={type:t,default:s})}e.props=n}}},Qi=(e,t)=>{if(e.install=n=>{for(const s of[e,...Object.values(t??{})])n.component(s.name,s)},t)for(const[n,s]of Object.entries(t))e[n]=s;return qi(e),e},Xi=Qi(Hn({name:"ElIcon",inheritAttrs:!1,__name:"icon",props:Xo({size:{type:[Number,String]},color:{type:String}}),setup(e){const t=e,n=Oi("icon"),s=ao((()=>{const{size:e,color:n}=t,s=fi(e);return s||n?{fontSize:s,"--color":n}:{}}));return(e,t)=>(_r(),Rr("i",$r({class:_t(n).b(),style:s.value},e.$attrs),[Ss(e.$slots,"default")],16))}})),Ji={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},Yi=()=>ho&&/firefox/i.test(window.navigator.userAgent),Zi=e=>{if(e.code&&"Unidentified"!==e.code)return e.code;const t=ea(e);return t?Object.values(Ji).includes(t)?t:" "===t?Ji.space:"":""},ea=e=>{let t=e.key&&"Unidentified"!==e.key?e.key:"";if(!t&&"keyup"===e.type&&ho&&/android/i.test(window.navigator.userAgent)){const n=e.target;t=n.value.charAt(n.selectionStart-1)}return t};let ta=[];const na=e=>{Zi(e)===Ji.esc&&ta.forEach((t=>t(e)))},sa="focus-trap.focus-after-trapped",ra="focus-trap.focus-after-released",oa={cancelable:!0,bubbles:!1},ia={cancelable:!0,bubbles:!1},aa="focusAfterTrapped",la="focusAfterReleased",ca=Symbol("elFocusTrap"),da=wt(),ua=wt(0),ha=wt(0);let ga=0;const ma=e=>{const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0||e===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t},pa=(e,t)=>{for(const n of e)if(!fa(n,t))return n},fa=(e,t)=>{if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1},va=(e,t)=>{if(e){const n=document.activeElement;((e,t)=>{if(!e||!e.focus)return;let n=!1;!hi(e)||mi(e)||e.getAttribute("tabindex")||(e.setAttribute("tabindex","-1"),n=!0),e.focus(t),hi(e)&&n&&e.removeAttribute("tabindex")})(e,{preventScroll:!0}),ha.value=window.performance.now(),e!==n&&(e=>e instanceof HTMLInputElement&&"select"in e)(e)&&t&&e.select()}};function Sa(e,t){const n=[...e],s=e.indexOf(t);return-1!==s&&n.splice(s,1),n}const ya=(()=>{let e=[];return{push:t=>{const n=e[0];n&&t!==n&&n.pause(),e=Sa(e,t),e.unshift(t)},remove:t=>{e=Sa(e,t),e[0]?.resume?.()}}})(),ba=()=>{da.value="pointer",ua.value=window.performance.now()},Ca=()=>{da.value="keyboard",ua.value=window.performance.now()},wa=()=>(ss((()=>{0===ga&&(document.addEventListener("mousedown",ba),document.addEventListener("touchstart",ba),document.addEventListener("keydown",Ca)),ga++})),is((()=>{ga--,ga<=0&&(document.removeEventListener("mousedown",ba),document.removeEventListener("touchstart",ba),document.removeEventListener("keydown",Ca))})),{focusReason:da,lastUserFocusTimestamp:ua,lastAutomatedFocusTimestamp:ha}),Ea=e=>new CustomEvent("focus-trap.focusout-prevented",{...ia,detail:e}),Ta=function(e){return null==e};var Ma=Hn({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[aa,la,"focusin","focusout","focusout-prevented","release-requested"],setup(e,{emit:t}){const n=wt();let s,r;const{focusReason:o}=wa();var i;i=n=>{e.trapped&&!a.paused&&t("release-requested",n)},ss((()=>{0===ta.length&&document.addEventListener("keydown",na),ho&&ta.push(i)})),is((()=>{ta=ta.filter((e=>e!==i)),0===ta.length&&ho&&document.removeEventListener("keydown",na)}));const a={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=n=>{if(!e.loop&&!e.trapped)return;if(a.paused)return;const{altKey:s,ctrlKey:r,metaKey:i,currentTarget:l,shiftKey:c}=n,{loop:d}=e,u=Zi(n)===Ji.tab&&!s&&!r&&!i,h=document.activeElement;if(u&&h){const e=l,[s,r]=(e=>{const t=ma(e);return[pa(t,e),pa(t.reverse(),e)]})(e);if(s&&r)if(c||h!==r){if(c&&[s,e].includes(h)){const e=Ea({focusReason:o.value});t("focusout-prevented",e),e.defaultPrevented||(n.preventDefault(),d&&va(r,!0))}}else{const e=Ea({focusReason:o.value});t("focusout-prevented",e),e.defaultPrevented||(n.preventDefault(),d&&va(s,!0))}else if(h===e){const e=Ea({focusReason:o.value});t("focusout-prevented",e),e.defaultPrevented||n.preventDefault()}}};yn(ca,{focusTrapRef:n,onKeydown:l}),En((()=>e.focusTrapEl),(e=>{e&&(n.value=e)}),{immediate:!0}),En([n],(([e],[t])=>{e&&(e.addEventListener("keydown",l),e.addEventListener("focusin",u),e.addEventListener("focusout",h)),t&&(t.removeEventListener("keydown",l),t.removeEventListener("focusin",u),t.removeEventListener("focusout",h))}));const c=e=>{t(aa,e)},d=e=>t(la,e),u=o=>{const i=_t(n);if(!i)return;const l=o.target,c=o.relatedTarget,d=l&&i.contains(l);e.trapped||c&&i.contains(c)||(s=c),d&&t("focusin",o),a.paused||e.trapped&&(d?r=l:va(r,!0))},h=s=>{const i=_t(n);if(!a.paused&&i)if(e.trapped){const n=s.relatedTarget;Ta(n)||i.contains(n)||setTimeout((()=>{if(!a.paused&&e.trapped){const e=Ea({focusReason:o.value});t("focusout-prevented",e),e.defaultPrevented||va(r,!0)}}),0)}else{const e=s.target;e&&i.contains(e)||t("focusout",s)}};async function g(){await Xt();const t=_t(n);if(t){ya.push(a);const n=t.contains(document.activeElement)?s:document.activeElement;if(s=n,!t.contains(n)){const s=new Event(sa,oa);t.addEventListener(sa,c),t.dispatchEvent(s),s.defaultPrevented||Xt((()=>{let s=e.focusStartEl;y(s)||(va(s),document.activeElement!==s&&(s="first")),"first"===s&&((e,t=!1)=>{const n=document.activeElement;for(const s of e)if(va(s,t),document.activeElement!==n)return})(ma(t),!0),document.activeElement!==n&&"container"!==s||va(t)}))}}}function m(){const e=_t(n);if(e){e.removeEventListener(sa,c);const t=new CustomEvent(ra,{...oa,detail:{focusReason:o.value}});e.addEventListener(ra,d),e.dispatchEvent(t),t.defaultPrevented||"keyboard"!=o.value&&ua.value>ha.value&&!e.contains(document.activeElement)||va(s??document.body),e.removeEventListener(ra,d),ya.remove(a),s=null,r=null}}return ss((()=>{e.trapped&&g(),En((()=>e.trapped),(e=>{e?g():m()}))})),is((()=>{e.trapped&&m(),n.value&&(n.value.removeEventListener("keydown",l),n.value.removeEventListener("focusin",u),n.value.removeEventListener("focusout",h),n.value=void 0),s=null,r=null})),{onKeydown:l}}}),_a=wo(Ma,[["render",function(e,t,n,s,r,o){return Ss(e.$slots,"default",{handleKeydown:e.onKeydown})}]]);const ka="update:modelValue",xa="change",Pa="input",Ra=e=>ho?window.cancelAnimationFrame(e):clearTimeout(e),La=["class","style"],Aa=/^on[A-Z]/,Oa=ho?window:void 0;function Fa(e){var t;const n=kt(e);return null!==(t=null==n?void 0:n.$el)&&void 0!==t?t:n}function Ia(...e){const t=ao((()=>{const t=mo(kt(e[0])).filter((e=>null!=e));return t.every((e=>"string"!=typeof e))?t:void 0}));return n=([e,t,n,s],r,o)=>{if(!(null==e?void 0:e.length)||!(null==t?void 0:t.length)||!(null==n?void 0:n.length))return;const i=(l=s,"[object Object]"===go.call(l)?{...s}:s),a=e.flatMap((e=>t.flatMap((t=>n.map((n=>((e,t,n,s)=>(e.addEventListener(t,n,s),()=>e.removeEventListener(t,n,s)))(e,t,n,i)))))));var l;o((()=>{a.forEach((e=>e()))}))},s={flush:"post"},En((()=>{var n,s;return[null!==(n=null===(s=t.value)||void 0===s?void 0:s.map((e=>Fa(e))))&&void 0!==n?n:[Oa].filter((e=>null!=e)),mo(kt(t.value?e[1]:e[0])),mo(_t(t.value?e[2]:e[1])),kt(t.value?e[3]:e[2])]}),n,{...s,immediate:!0});var n,s}function Da(e){const t=function(){const e=Et(!1),t=Qr();return t&&ss((()=>{e.value=!0}),t),e}();return ao((()=>(t.value,Boolean(e()))))}function Ba(e,t,n={}){const{window:s=Oa,...r}=n;let o;const i=Da((()=>s&&"ResizeObserver"in s)),a=()=>{o&&(o.disconnect(),o=void 0)},l=En(ao((()=>{const t=kt(e);return Array.isArray(t)?t.map((e=>Fa(e))):[Fa(t)]})),(e=>{if(a(),i.value&&s){o=new ResizeObserver(t);for(const t of e)t&&o.observe(t,r)}}),{immediate:!0,flush:"post"}),c=()=>{a(),l()};return d=c,!!se()&&re(d,u),{isSupported:i,stop:c};var d,u}ho&&window.document,ho&&window.navigator,ho&&window.location,Symbol("vueuse-ssr-width"),"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self,Number.POSITIVE_INFINITY;const za=e=>{const t=Qr();return ao((()=>t?.proxy?.$props?.[e]))},Ua=Qo({type:String,values:ui,required:!1}),Va=Symbol("size"),Na=Symbol("formContextKey"),Ha=Symbol("formItemContextKey"),Ga=(e,t={})=>{const n=wt(void 0),s=t.prop?n:za("size"),r=t.global?n:(()=>{const e=bn(Va,{});return ao((()=>_t(e.size)||""))})(),o=t.form?{size:void 0}:bn(Na,void 0),i=t.formItem?{size:void 0}:bn(Ha,void 0);return ao((()=>s.value||_t(e)||i?.size||o?.size||r.value||""))},$a=e=>{const t=za("disabled"),n=bn(Na,void 0);return ao((()=>t.value??_t(e)??n?.disabled??!1))},Wa=()=>({form:bn(Na,void 0),formItem:bn(Ha,void 0)}),ja=Array.isArray;var Ka=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qa=/^\w*$/;const Qa=Wo(Object,"create");var Xa=Object.prototype.hasOwnProperty;var Ja=Object.prototype.hasOwnProperty;function Ya(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}Ya.prototype.clear=function(){this.__data__=Qa?Qa(null):{},this.size=0},Ya.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ya.prototype.get=function(e){var t=this.__data__;if(Qa){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Xa.call(t,e)?t[e]:void 0},Ya.prototype.has=function(e){var t=this.__data__;return Qa?void 0!==t[e]:Ja.call(t,e)},Ya.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Qa&&void 0===t?"__lodash_hash_undefined__":t,this};const Za=Ya,el=function(e,t){return e===t||e!=e&&t!=t},tl=function(e,t){for(var n=e.length;n--;)if(el(e[n][0],t))return n;return-1};var nl=Array.prototype.splice;function sl(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}sl.prototype.clear=function(){this.__data__=[],this.size=0},sl.prototype.delete=function(e){var t=this.__data__,n=tl(t,e);return!(n<0||(n==t.length-1?t.pop():nl.call(t,n,1),--this.size,0))},sl.prototype.get=function(e){var t=this.__data__,n=tl(t,e);return n<0?void 0:t[n][1]},sl.prototype.has=function(e){return tl(this.__data__,e)>-1},sl.prototype.set=function(e,t){var n=this.__data__,s=tl(n,e);return s<0?(++this.size,n.push([e,t])):n[s][1]=t,this};const rl=sl,ol=Wo(Mo,"Map"),il=function(e,t){var n,s,r=e.__data__;return("string"==(s=typeof(n=t))||"number"==s||"symbol"==s||"boolean"==s?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map};function al(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}al.prototype.clear=function(){this.size=0,this.__data__={hash:new Za,map:new(ol||rl),string:new Za}},al.prototype.delete=function(e){var t=il(this,e).delete(e);return this.size-=t?1:0,t},al.prototype.get=function(e){return il(this,e).get(e)},al.prototype.has=function(e){return il(this,e).has(e)},al.prototype.set=function(e,t){var n=il(this,e),s=n.size;return n.set(e,t),this.size+=n.size==s?0:1,this};const ll=al;function cl(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var s=arguments,r=t?t.apply(this,s):s[0],o=n.cache;if(o.has(r))return o.get(r);var i=e.apply(this,s);return n.cache=o.set(r,i)||o,i};return n.cache=new(cl.Cache||ll),n}cl.Cache=ll;var dl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ul=/\\(\\)?/g;const hl=(gl=cl((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(dl,(function(e,n,s,r){t.push(s?r.replace(ul,"$1"):n||e)})),t}),(function(e){return 500===ml.size&&ml.clear(),e})),ml=gl.cache,gl);var gl,ml;var pl=_o?_o.prototype:void 0,fl=pl?pl.toString:void 0;const vl=function e(t){if("string"==typeof t)return t;if(ja(t))return function(e,t){for(var n=-1,s=null==e?0:e.length,r=Array(s);++n<s;)r[n]=t(e[n],n,e);return r}(t,e)+"";if(Ci(t))return fl?fl.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n},Sl=function(e,t){return ja(e)?e:function(e,t){if(ja(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ci(e))||qa.test(e)||!Ka.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:hl(function(e){return null==e?"":vl(e)}(e))},yl=function(e){if("string"==typeof e||Ci(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},bl=function(e,t){for(var n=0,s=(t=Sl(t,e)).length;null!=e&&n<s;)e=e[yl(t[n++])];return n&&n==s?e:void 0};var Cl=Object.prototype.hasOwnProperty;const wl=function(e,t,n){var s=e[t];Cl.call(e,t)&&el(s,n)&&(void 0!==n||t in e)||Ko(e,t,n)};var El=/^(?:0|[1-9]\d*)$/;const Tl=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&El.test(e))&&e>-1&&e%1==0&&e<t},Ml=function(e,t,n,s){if(!Fo(e))return e;for(var r=-1,o=(t=Sl(t,e)).length,i=o-1,a=e;null!=a&&++r<o;){var l=yl(t[r]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(r!=i){var d=a[l];void 0===(c=s?s(d,l,a):void 0)&&(c=Fo(d)?d:Tl(t[r+1])?[]:{})}wl(a,l,c),a=a[l]}return e},_l=function(e,t){return null!=e&&t in Object(e)},kl=function(e){return bi(e)&&"[object Arguments]"==Oo(e)};var xl=Object.prototype,Pl=xl.hasOwnProperty,Rl=xl.propertyIsEnumerable;const Ll=kl(function(){return arguments}())?kl:function(e){return bi(e)&&Pl.call(e,"callee")&&!Rl.call(e,"callee")},Al=function(e,t){return null!=e&&function(e,t,n){for(var s=-1,r=(t=Sl(t,e)).length,o=!1;++s<r;){var i=yl(t[s]);if(!(o=null!=e&&n(e,i)))break;e=e[i]}return o||++s!=r?o:!!(r=null==e?0:e.length)&&"number"==typeof(a=r)&&a>-1&&a%1==0&&a<=9007199254740991&&Tl(i,r)&&(ja(e)||Ll(e));var a}(e,t,_l)},Ol=function(e,t){return function(e,t,n){for(var s=-1,r=t.length,o={};++s<r;){var i=t[s],a=bl(e,i);n(a,i)&&Ml(o,Sl(i,e),a)}return o}(e,t,(function(t,n){return Al(e,n)}))},Fl=function(e,t){for(var n=-1,s=t.length,r=e.length;++n<s;)e[r+n]=t[n];return e};var Il=_o?_o.isConcatSpreadable:void 0;const Dl=function(e){return ja(e)||Ll(e)||!!(Il&&e&&e[Il])},Bl=function e(t,n,s,r,o){var i=-1,a=t.length;for(s||(s=Dl),o||(o=[]);++i<a;){var l=t[i];n>0&&s(l)?n>1?e(l,n-1,s,r,o):Fl(o,l):r||(o[o.length]=l)}return o},zl=function(e){return null!=e&&e.length?Bl(e,1):[]},Ul=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)};var Vl=Math.max;const Nl=jo?function(e,t){return jo(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:function(e){return e};var Hl=Date.now;const Gl=function(e){var t=0,n=0;return function(){var s=Hl(),r=16-(s-n);if(n=s,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Nl),$l=function(e){return Gl(function(e,t,n){return t=Vl(void 0===t?e.length-1:t,0),function(){for(var s=arguments,r=-1,o=Vl(s.length-t,0),i=Array(o);++r<o;)i[r]=s[t+r];r=-1;for(var a=Array(t+1);++r<t;)a[r]=s[r];return a[t]=n(i),Ul(e,this,a)}}(e,void 0,zl),e+"")}((function(e,t){return null==e?{}:Ol(e,t)})),Wl=Xo({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),jl=Xo({id:{type:String,default:void 0},size:Ua,disabled:{type:Boolean,default:void 0},modelValue:{type:[String,Number,Object],default:""},modelModifiers:{type:Object,default:()=>({})},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:[Boolean,Object],default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,clearIcon:{type:ai,default:Zo},showPassword:Boolean,showWordLimit:Boolean,wordLimitPosition:{type:String,values:["inside","outside"],default:"inside"},suffixIcon:{type:ai},prefixIcon:{type:ai},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:[Object,Array,String,Boolean],default:()=>({})},countGraphemes:{type:Function},autofocus:Boolean,rows:{type:Number,default:2},...(Kl=["ariaLabel"],$l(Wl,Kl)),inputmode:{type:String,default:void 0},name:String});var Kl;const ql={[ka]:e=>y(e),input:e=>y(e),change:(e,t)=>y(e)&&(t instanceof Event||void 0===t),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent,clear:e=>void 0===e||e instanceof MouseEvent,mouseleave:e=>e instanceof MouseEvent,mouseenter:e=>e instanceof MouseEvent,keydown:e=>e instanceof Event,compositionstart:e=>e instanceof CompositionEvent,compositionupdate:e=>e instanceof CompositionEvent,compositionend:e=>e instanceof CompositionEvent};let Ql;St(Zo);const Xl={height:"0",visibility:"hidden",overflow:Yi()?"":"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},Jl=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],Yl=e=>{const t=Number.parseFloat(e);return Number.isNaN(t)?e:t};function Zl(e,t=1,n){if(!Ql){Ql=document.createElement("textarea");let t=document.body;!Yi()&&e.parentNode&&(t=e.parentNode),t.appendChild(Ql)}const{paddingSize:s,borderSize:r,boxSizing:o,contextStyle:i}=function(e){const t=window.getComputedStyle(e),n=t.getPropertyValue("box-sizing"),s=Number.parseFloat(t.getPropertyValue("padding-bottom"))+Number.parseFloat(t.getPropertyValue("padding-top")),r=Number.parseFloat(t.getPropertyValue("border-bottom-width"))+Number.parseFloat(t.getPropertyValue("border-top-width"));return{contextStyle:Jl.map((e=>[e,t.getPropertyValue(e)])),paddingSize:s,borderSize:r,boxSizing:n}}(e);i.forEach((([e,t])=>Ql?.style.setProperty(e,t))),Object.entries(Xl).forEach((([e,t])=>Ql?.style.setProperty(e,t,"important"))),Ql.value=e.value||e.placeholder||"";let a=Ql.scrollHeight;const l={};"border-box"===o?a+=r:"content-box"===o&&(a-=s),Ql.value="";const c=Ql.scrollHeight-s;if(So(t)){let e=c*t;"border-box"===o&&(e=e+s+r),a=Math.max(e,a),l.minHeight=`${e}px`}if(So(n)){let e=c*n;"border-box"===o&&(e=e+s+r),a=Math.min(e,a)}return l.height=`${a}px`,Ql.parentNode?.removeChild(Ql),Ql=void 0,l}let ec;const tc="undefined"!=typeof window&&window.trustedTypes;if(tc)try{ec=tc.createPolicy("vue",{createHTML:e=>e})}catch(e){}const nc=ec?e=>ec.createHTML(e):e=>e,sc="undefined"!=typeof document?document:null,rc=sc&&sc.createElement("template"),oc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r="svg"===t?sc.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?sc.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?sc.createElement(e,{is:n}):sc.createElement(e);return"select"===e&&s&&null!=s.multiple&&r.setAttribute("multiple",s.multiple),r},createText:e=>sc.createTextNode(e),createComment:e=>sc.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>sc.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,o){const i=n?n.previousSibling:t.lastChild;if(r&&(r===o||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==o&&(r=r.nextSibling););else{rc.innerHTML=nc("svg"===s?`<svg>${e}</svg>`:"mathml"===s?`<math>${e}</math>`:e);const r=rc.content;if("svg"===s||"mathml"===s){const e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},ic="transition",ac="animation",lc=Symbol("_vtc"),cc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},dc=d({},An,cc),uc=(e=>(e.displayName="Transition",e.props=dc,e))(((e,{slots:t})=>lo(In,function(e){const t={};for(const n in e)n in cc||(t[n]=e[n]);if(!1===e.css)return t;const{name:n="v",type:s,duration:r,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=o,appearActiveClass:c=i,appearToClass:u=a,leaveFromClass:h=`${n}-leave-from`,leaveActiveClass:g=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=e,p=function(e){if(null==e)return null;if(C(e))return[mc(e.enter),mc(e.leave)];{const t=mc(e);return[t,t]}}(r),f=p&&p[0],v=p&&p[1],{onBeforeEnter:S,onEnter:y,onEnterCancelled:b,onLeave:w,onLeaveCancelled:E,onBeforeAppear:T=S,onAppear:M=y,onAppearCancelled:_=b}=t,k=(e,t,n,s)=>{e._enterCancelled=s,fc(e,t?u:a),fc(e,t?c:i),n&&n()},x=(e,t)=>{e._isLeaving=!1,fc(e,h),fc(e,m),fc(e,g),t&&t()},P=e=>(t,n)=>{const r=e?M:y,i=()=>k(t,e,n);hc(r,[t,i]),vc((()=>{fc(t,e?l:o),pc(t,e?u:a),gc(r)||yc(t,s,f,i)}))};return d(t,{onBeforeEnter(e){hc(S,[e]),pc(e,o),pc(e,i)},onBeforeAppear(e){hc(T,[e]),pc(e,l),pc(e,c)},onEnter:P(!1),onAppear:P(!0),onLeave(e,t){e._isLeaving=!0;const n=()=>x(e,t);pc(e,h),e._enterCancelled?(pc(e,g),wc(e)):(wc(e),pc(e,g)),vc((()=>{e._isLeaving&&(fc(e,h),pc(e,m),gc(w)||yc(e,s,v,n))})),hc(w,[e,n])},onEnterCancelled(e){k(e,!1,void 0,!0),hc(b,[e])},onAppearCancelled(e){k(e,!0,void 0,!0),hc(_,[e])},onLeaveCancelled(e){x(e),hc(E,[e])}})}(e),t))),hc=(e,t=[])=>{m(e)?e.forEach((e=>e(...t))):e&&e(...t)},gc=e=>!!e&&(m(e)?e.some((e=>e.length>1)):e.length>1);function mc(e){return(e=>{const t=y(e)?Number(e):NaN;return isNaN(t)?e:t})(e)}function pc(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.add(t))),(e[lc]||(e[lc]=new Set)).add(t)}function fc(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.remove(t)));const n=e[lc];n&&(n.delete(t),n.size||(e[lc]=void 0))}function vc(e){requestAnimationFrame((()=>{requestAnimationFrame(e)}))}let Sc=0;function yc(e,t,n,s){const r=e._endId=++Sc,o=()=>{r===e._endId&&s()};if(null!=n)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=function(e,t){const n=window.getComputedStyle(e),s=e=>(n[e]||"").split(", "),r=s(`${ic}Delay`),o=s(`${ic}Duration`),i=bc(r,o),a=s(`${ac}Delay`),l=s(`${ac}Duration`),c=bc(a,l);let d=null,u=0,h=0;return t===ic?i>0&&(d=ic,u=i,h=o.length):t===ac?c>0&&(d=ac,u=c,h=l.length):(u=Math.max(i,c),d=u>0?i>c?ic:ac:null,h=d?d===ic?o.length:l.length:0),{type:d,timeout:u,propCount:h,hasTransform:d===ic&&/\b(?:transform|all)(?:,|$)/.test(s(`${ic}Property`).toString())}}(e,t);if(!i)return s();const c=i+"end";let d=0;const u=()=>{e.removeEventListener(c,h),o()},h=t=>{t.target===e&&++d>=l&&u()};setTimeout((()=>{d<l&&u()}),a+1),e.addEventListener(c,h)}function bc(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map(((t,n)=>Cc(t)+Cc(e[n]))))}function Cc(e){return"auto"===e?0:1e3*Number(e.slice(0,-1).replace(",","."))}function wc(e){return(e?e.ownerDocument:document).body.offsetHeight}const Ec=Symbol("_vod"),Tc=Symbol("_vsh"),Mc={name:"show",beforeMount(e,{value:t},{transition:n}){e[Ec]="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):_c(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),_c(e,!0),s.enter(e)):s.leave(e,(()=>{_c(e,!1)})):_c(e,t))},beforeUnmount(e,{value:t}){_c(e,t)}};function _c(e,t){e.style.display=t?e[Ec]:"none",e[Tc]=!t}const kc=Symbol(""),xc=/(?:^|;)\s*display\s*:/,Pc=/\s*!important$/;function Rc(e,t,n){if(m(n))n.forEach((n=>Rc(e,t,n)));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=function(e,t){const n=Ac[t];if(n)return n;let s=R(t);if("filter"!==s&&s in e)return Ac[t]=s;s=O(s);for(let n=0;n<Lc.length;n++){const r=Lc[n]+s;if(r in e)return Ac[t]=r}return t}(e,t);Pc.test(n)?e.setProperty(A(s),n.replace(Pc,""),"important"):e[s]=n}}const Lc=["Webkit","Moz","ms"],Ac={};function Oc(e,t,n,s){return"TEXTAREA"===e.tagName&&("width"===t||"height"===t)&&y(s)&&n===s}const Fc="http://www.w3.org/1999/xlink";function Ic(e,t,n,s,r,o=K(t)){s&&t.startsWith("xlink:")?null==n?e.removeAttributeNS(Fc,t.slice(6,t.length)):e.setAttributeNS(Fc,t,n):null==n||o&&!q(n)?e.removeAttribute(t):e.setAttribute(t,o?"":b(n)?String(n):n)}function Dc(e,t,n,s,r){if("innerHTML"===t||"textContent"===t)return void(null!=n&&(e[t]="innerHTML"===t?nc(n):n));const o=e.tagName;if("value"===t&&"PROGRESS"!==o&&!o.includes("-")){const s="OPTION"===o?e.getAttribute("value")||"":e.value,r=null==n?"checkbox"===e.type?"on":"":String(n);return s===r&&"_value"in e||(e.value=r),null==n&&e.removeAttribute(t),void(e._value=n)}let i=!1;if(""===n||null==n){const s=typeof e[t];"boolean"===s?n=q(n):null==n&&"string"===s?(n="",i=!0):"number"===s&&(n=0,i=!0)}try{e[t]=n}catch(e){}i&&e.removeAttribute(r||t)}const Bc=Symbol("_vei");const zc=/(?:Once|Passive|Capture)$/;let Uc=0;const Vc=Promise.resolve(),Nc=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123;"undefined"!=typeof HTMLElement&&HTMLElement;const Hc=["ctrl","shift","alt","meta"],Gc={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>Hc.some((n=>e[`${n}Key`]&&!t.includes(n)))},$c=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(n,...s)=>{for(let e=0;e<t.length;e++){const s=Gc[t[e]];if(s&&s(n,t))return}return e(n,...s)})},Wc={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},jc=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=n=>{if(!("key"in n))return;const s=A(n.key);return t.some((e=>e===s||Wc[e]===s))?e(n):void 0})},Kc=d({patchProp:(e,t,n,s,r,o)=>{const i="svg"===r;"class"===t?function(e,t,n){const s=e[lc];s&&(t=(t?[t,...s]:[...s]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,s,i):"style"===t?function(e,t,n){const s=e.style,r=y(n);let o=!1;if(n&&!r){if(t)if(y(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&Rc(s,t,"")}else for(const e in t)null==n[e]&&Rc(s,e,"");for(const r in n){"display"===r&&(o=!0);const i=n[r];null!=i?Oc(e,r,!y(t)&&t?t[r]:void 0,i)||Rc(s,r,i):Rc(s,r,"")}}else if(r){if(t!==n){const e=s[kc];e&&(n+=";"+e),s.cssText=n,o=xc.test(n)}}else t&&e.removeAttribute("style");Ec in e&&(e[Ec]=o?s.display:"",e[Tc]&&(s.display="none"))}(e,n,s):l(t)?c(t)||function(e,t,n,s,r=null){const o=e[Bc]||(e[Bc]={}),i=o[t];if(s&&i)i.value=s;else{const[n,a]=function(e){let t;if(zc.test(e)){let n;for(t={};n=e.match(zc);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):A(e.slice(2)),t]}(t);if(s){const i=o[t]=function(e,t){const n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();const s=n.value;if(m(s)){const n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};const r=s.slice(),o=[e];for(let n=0;n<r.length&&!e._stopped;n++){const e=r[n];e&&Nt(e,t,5,o)}}else Nt(s,t,5,[e])};return n.value=e,n.attached=Uc||(Vc.then((()=>Uc=0)),Uc=Date.now()),n}(s,r);!function(e,t,n,s){e.addEventListener(t,n,s)}(e,n,i,a)}else i&&(function(e,t,n,s){e.removeEventListener(t,n,s)}(e,n,i,a),o[t]=void 0)}}(e,t,0,s,o):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,s){if(s)return"innerHTML"===t||"textContent"===t||!!(t in e&&Nc(t)&&S(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"autocorrect"===t)return!1;if("sandbox"===t&&"IFRAME"===e.tagName)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return(!Nc(t)||!y(n))&&t in e}(e,t,s,i))?(Dc(e,t,s),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||Ic(e,t,s,i,0,"value"!==t)):e._isVueCE&&(function(e,t){const n=e._def.props;if(!n)return!1;const s=R(t);return Array.isArray(n)?n.some((e=>R(e)===s)):Object.keys(n).some((e=>R(e)===s))}(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!y(s)))?Dc(e,R(t),s,0,t):("true-value"===t?e._trueValue=s:"false-value"===t&&(e._falseValue=s),Ic(e,t,s,i))}},oc);let qc;const Qc=(...e)=>{(qc||(qc=hr(Kc))).render(...e)},Xc=["id","name","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","role","inputmode"],Jc=["id","name","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","role","inputmode"],Yc="ElInput";var Zc=Hn({name:Yc,inheritAttrs:!1,__name:"input",props:jl,emits:ql,setup(e,{expose:t,emit:n}){const s=e,r=n,o=Ms().attrs,a=Ts(),l=ao((()=>["textarea"===s.type?y.b():v.b(),v.m(p.value),v.is("disabled",f.value),v.is("exceed",Q.value),{[v.b("group")]:a.prepend||a.append,[v.m("prefix")]:a.prefix||s.prefixIcon,[v.m("suffix")]:a.suffix||s.suffixIcon||s.clearable||s.showPassword,[v.bm("suffix","password-clear")]:$.value&&W.value,[v.b("hidden")]:"hidden"===s.type},o.class])),c=ao((()=>[v.e("wrapper"),v.is("focus",A.value)])),d=((e={})=>{const{excludeListeners:t=!1,excludeKeys:n}=e,s=ao((()=>(n?.value||[]).concat(La))),r=Qr();return r?ao((()=>qo(Object.entries(r.proxy?.$attrs).filter((([e])=>!(s.value.includes(e)||t&&Aa.test(e))))))):(Co("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),ao((()=>({}))))})(),u=ao((()=>s.maxlength?.toString())),{form:h,formItem:g}=Wa(),{inputId:m}=((e,{formItemContext:t,disableIdGeneration:n,disableIdManagement:s})=>{n||(n=wt(!1)),s||(s=wt(!1));const r=Qr(),o=wt();let i;const a=ao((()=>!!(!e.label&&!e.ariaLabel&&t&&t.inputIds&&t.inputIds?.length<=1)));return ss((()=>{i=En([Ot(e,"id"),n],(([e,n])=>{const i=e??(n?void 0:zi().value);i!==o.value&&(t?.removeInputId&&!(()=>{let e=r?.parent;for(;e;){if("ElFormItem"===e.type.name)return!1;if("ElLabelWrap"===e.type.name)return!0;e=e.parent}return!1})()&&(o.value&&t.removeInputId(o.value),s?.value||n||!i||t.addInputId(i)),o.value=i)}),{immediate:!0})})),as((()=>{i&&i(),t?.removeInputId&&o.value&&t.removeInputId(o.value)})),{isLabeledByFormItem:a,inputId:o}})(s,{formItemContext:g}),p=Ga(),f=$a(),v=Oi("input"),y=Oi("textarea"),b=Et(),w=Et(),E=wt(!1),T=wt(!1),M=wt(),_=wt(),k=Et(s.inputStyle),x=wt(""),P=wt(),R=ao((()=>b.value||w.value)),{wrapperRef:L,isFocused:A,handleFocus:O,handleBlur:F}=function(e,{disabled:t,beforeFocus:n,afterFocus:s,beforeBlur:r,afterBlur:o}={}){const{emit:i}=Qr(),a=Et(),l=wt(!1),c=e=>{const r=!!S(n)&&n(e);_t(t)||l.value||r||(l.value=!0,i("focus",e),s?.())},d=e=>{const n=!!S(r)&&r(e);_t(t)||e.relatedTarget&&a.value?.contains(e.relatedTarget)||n||(l.value=!1,i("blur",e),o?.())};return En([a,()=>_t(t)],(([e,t])=>{e&&(t?e.removeAttribute("tabindex"):e.setAttribute("tabindex","-1"))})),Ia(a,"focus",c,!0),Ia(a,"blur",d,!0),Ia(a,"click",(n=>{_t(t)||mi(n.target)||a.value?.contains(document.activeElement)&&a.value!==document.activeElement||e.value?.focus()}),!0),{isFocused:l,wrapperRef:a,handleFocus:c,handleBlur:d}}(R,{disabled:f,afterBlur(){s.validateEvent&&g?.validate?.("blur").catch(i)}}),I=ao((()=>h?.statusIcon??!1)),D=ao((()=>g?.validateState||"")),B=ao((()=>D.value&&di[D.value])),z=ao((()=>T.value?oi:ti)),U=ao((()=>[o.style])),V=ao((()=>[s.inputStyle,k.value,{resize:s.resize},P.value?{height:P.value}:void 0])),H=ao((()=>Ta(s.modelValue)?"":String(s.modelValue))),G=ao((()=>s.clearable&&!f.value&&!s.readonly)),$=ao((()=>G.value&&!!H.value&&(A.value||E.value))),W=ao((()=>s.showPassword&&!f.value&&!!H.value)),K=ao((()=>s.showWordLimit&&!!u.value&&("text"===s.type||"textarea"===s.type)&&!f.value&&!s.readonly&&!s.showPassword)),q=ao((()=>s.countGraphemes&&s.showWordLimit?s.countGraphemes(H.value):H.value.length)),Q=ao((()=>!!K.value&&q.value>Number(u.value))),X=ao((()=>!!a.suffix||!!s.suffixIcon||s.clearable||s.showPassword||K.value||!!D.value&&I.value)),Y=ao((()=>!!Object.keys(s.modelModifiers).length)),[Z,ee]=function(e){let t;return[function(){if(null==e.value)return;const{selectionStart:n,selectionEnd:s,value:r}=e.value;null!=n&&null!=s&&(t={selectionStart:n,selectionEnd:s,value:r,beforeTxt:r.slice(0,Math.max(0,n)),afterTxt:r.slice(Math.max(0,s))})},function(){if(null==e.value||null==t)return;const{value:n}=e.value,{beforeTxt:s,afterTxt:r,selectionStart:o}=t;if(null==s||null==r||null==o)return;let i=n.length;if(n.endsWith(r))i=n.length-r.length;else if(n.startsWith(s))i=s.length;else{const e=s[o-1],t=n.indexOf(e,o-1);-1!==t&&(i=t+1)}e.value.setSelectionRange(i,i)}]}(b);let te;Ba(w,(e=>{if(se(),!K.value&&!G.value||"both"!==s.resize&&"horizontal"!==s.resize)return;const{width:t}=e[0].target.getBoundingClientRect();var n;te&&Ra(te),n=()=>{te=void 0,M.value={right:`calc(100% - ${t-10}px)`},_.value={right:`calc(100% - ${t-11}px)`}},te=ho?window.requestAnimationFrame(n):setTimeout(n,16)}));const ne=()=>{const{type:e,autosize:t}=s;if(ho&&"textarea"===e&&w.value)if(t){const e=C(t)?t.minRows:void 0,n=C(t)?t.maxRows:void 0,s=Zl(w.value,e,n);k.value={overflowY:"hidden",...s},Xt((()=>{w.value.offsetHeight,k.value=s}))}else k.value={minHeight:Zl(w.value).minHeight}},se=(e=>{let t=!1;return()=>{!t&&s.autosize?null!==w.value?.offsetParent&&(setTimeout(e),t=!0):"none"!==s.resize&&setTimeout((()=>{P.value=w.value?.style.height}))}})(ne),re=()=>{const e=R.value,t=s.formatter?s.formatter(H.value):H.value;e&&e.value!==t&&"file"!==s.type&&(e.value=t)},oe=e=>{const{trim:t,number:n}=s.modelModifiers;return t&&(e=e.trim()),n&&(e=`${Yl(e)}`),s.formatter&&s.parser&&(e=s.parser(e)),e},ie=async e=>{if(le.value)return;const{lazy:t}=s.modelModifiers;let{value:n}=e.target,o=!1;if(t)r(Pa,n);else{if(n=oe(n),s.countGraphemes&&null!=u.value){const e=Number(u.value),t=s.countGraphemes(n),r=s.countGraphemes(x.value);if(t>e&&t>r)if(r>e)n=x.value,o=!0;else{const t=x.value,i=n;let a=0;for(;a<t.length&&a<i.length&&t[a]===i[a];)a++;let l=t.length,c=i.length;for(;l>a&&c>a&&t[l-1]===i[c-1];)l--,c--;const d=i.slice(0,a),u=t.slice(a,l),h=i.slice(a,c),g=i.slice(c),m=r-s.countGraphemes(u),p=Math.max(0,e-m);let f="";if(p>0)if("undefined"!=typeof Intl&&"Segmenter"in Intl){const e=new Intl.Segmenter(void 0,{granularity:"grapheme"});for(const{segment:t}of e.segment(h)){const e=f+t;if(s.countGraphemes(e)>p)break;f=e}}else for(const e of Array.from(h)){const t=f+e;if(s.countGraphemes(t)>p)break;f=t}n=d+f+g,o=!0}}if(String(n)!==H.value)x.value=n,Z(),r(ka,n),r(Pa,n),await Xt(),(s.formatter&&s.parser||!Y.value)&&re(),ee();else if(s.formatter||o){const t=e.target,n=t.value,s=t.selectionStart,r=t.selectionEnd;if(re(),o&&R.value&&null!=s&&null!=r){const e=R.value.value,t=n.slice(Math.max(0,r));let o=Math.min(s,e.length);t&&e.endsWith(t)&&(o=e.length-t.length),R.value.setSelectionRange(o,o)}}}},ae=async e=>{let{value:t}=e.target;t=oe(t),s.modelModifiers.lazy&&r(ka,t),r(xa,t,e),await Xt(),re()},{isComposing:le,handleCompositionStart:ce,handleCompositionUpdate:de,handleCompositionEnd:ue}=function({afterComposition:e,emit:t}){const n=wt(!1),s=e=>{t?.("compositionupdate",e),n.value=!0},r=s=>{t?.("compositionend",s),n.value&&(n.value=!1,Xt((()=>e(s))))};return{isComposing:n,handleComposition:e=>{"compositionend"===e.type?r(e):s(e)},handleCompositionStart:e=>{t?.("compositionstart",e),n.value=!0},handleCompositionUpdate:s,handleCompositionEnd:r}}({emit:r,afterComposition:ie}),he=()=>{T.value=!T.value},ge=e=>{E.value=!1,r("mouseleave",e)},me=e=>{E.value=!0,r("mouseenter",e)},pe=e=>{r("keydown",e)},fe=e=>{r(ka,""),r(xa,""),r("clear",e),r(Pa,"")};return En((()=>s.modelValue),(()=>{Xt((()=>{ne(),s.autosize&&(P.value=void 0)})),s.validateEvent&&g?.validate?.("change").catch(i)})),En((()=>H.value),(e=>{x.value=e}),{immediate:!0}),En(H,(e=>{if(!R.value)return;const{trim:t,number:n}=s.modelModifiers,r=R.value.value,o=!n&&"number"!==s.type||/^0\d/.test(r)?r:`${Yl(r)}`;o!==e&&(document.activeElement===R.value&&"range"!==R.value.type&&t&&o.trim()===e||re())})),En((()=>s.type),(async()=>{await Xt(),re(),ne()})),ss((()=>{!s.formatter&&s.parser&&Co(Yc,"If you set the parser, you also need to set the formatter."),re(),Xt(ne)})),is((()=>{te&&Ra(te)})),t({input:b,textarea:w,ref:R,textareaStyle:V,autosize:Ot(s,"autosize"),isComposing:le,passwordVisible:T,focus:()=>R.value?.focus(),blur:()=>R.value?.blur(),select:()=>{R.value?.select()},clear:fe,resizeTextarea:ne}),(t,n)=>(_r(),Rr("div",{class:j([l.value,{[_t(v).bm("group","append")]:t.$slots.append,[_t(v).bm("group","prepend")]:t.$slots.prepend}]),style:N(U.value),onMouseenter:me,onMouseleave:ge},[Vr(" input "),"textarea"!==e.type?(_r(),Rr(br,{key:0},[Vr(" prepend slot "),t.$slots.prepend?(_r(),Rr("div",{key:0,class:j(_t(v).be("group","prepend"))},[Ss(t.$slots,"prepend")],2)):Vr("v-if",!0),Dr("div",{ref_key:"wrapperRef",ref:L,class:j(c.value)},[Vr(" prefix slot "),t.$slots.prefix||e.prefixIcon?(_r(),Rr("span",{key:0,class:j(_t(v).e("prefix"))},[Dr("span",{class:j(_t(v).e("prefix-inner"))},[Ss(t.$slots,"prefix"),e.prefixIcon?(_r(),Lr(_t(Xi),{key:0,class:j(_t(v).e("icon"))},{default:fn((()=>[(_r(),Lr(ps(e.prefixIcon)))])),_:1},8,["class"])):Vr("v-if",!0)],2)],2)):Vr("v-if",!0),Dr("input",$r({id:_t(m),ref_key:"input",ref:b,class:_t(v).e("inner")},_t(d),{name:e.name,minlength:e.countGraphemes?void 0:e.minlength,maxlength:e.countGraphemes?void 0:u.value,type:e.showPassword?T.value?"text":"password":e.type,disabled:_t(f),readonly:e.readonly,autocomplete:e.autocomplete,tabindex:e.tabindex,"aria-label":e.ariaLabel,placeholder:e.placeholder,style:e.inputStyle,form:e.form,autofocus:e.autofocus,role:e.containerRole,inputmode:e.inputmode,onCompositionstart:n[0]||(n[0]=(...e)=>_t(ce)&&_t(ce)(...e)),onCompositionupdate:n[1]||(n[1]=(...e)=>_t(de)&&_t(de)(...e)),onCompositionend:n[2]||(n[2]=(...e)=>_t(ue)&&_t(ue)(...e)),onInput:ie,onChange:ae,onKeydown:pe}),null,16,Xc),Vr(" suffix slot "),X.value?(_r(),Rr("span",{key:1,class:j(_t(v).e("suffix"))},[Dr("span",{class:j(_t(v).e("suffix-inner"))},[G.value?(_r(),Lr(_t(Xi),{key:0,class:j([_t(v).e("icon"),_t(v).e("clear")]),style:N({visibility:$.value?"visible":"hidden"}),onMousedown:$c(_t(i),["prevent"]),onClick:fe},{default:fn((()=>[(_r(),Lr(ps(e.clearIcon)))])),_:1},8,["class","style","onMousedown"])):Vr("v-if",!0),$.value&&W.value&&K.value?Vr("v-if",!0):(_r(),Rr(br,{key:1},[Ss(t.$slots,"suffix"),e.suffixIcon?(_r(),Lr(_t(Xi),{key:0,class:j(_t(v).e("icon"))},{default:fn((()=>[(_r(),Lr(ps(e.suffixIcon)))])),_:1},8,["class"])):Vr("v-if",!0)],64)),W.value?(_r(),Lr(_t(Xi),{key:2,class:j([_t(v).e("icon"),_t(v).e("password")]),onClick:he,onMousedown:$c(_t(i),["prevent"]),onMouseup:$c(_t(i),["prevent"])},{default:fn((()=>[Ss(t.$slots,"password-icon",{visible:T.value},(()=>[(_r(),Lr(ps(z.value)))]))])),_:3},8,["class","onMousedown","onMouseup"])):Vr("v-if",!0),K.value?(_r(),Rr("span",{key:3,class:j([_t(v).e("count"),_t(v).is("outside","outside"===e.wordLimitPosition)])},[Dr("span",{class:j(_t(v).e("count-inner"))},J(q.value)+" / "+J(u.value),3)],2)):Vr("v-if",!0),D.value&&B.value&&I.value?(_r(),Lr(_t(Xi),{key:4,class:j([_t(v).e("icon"),_t(v).e("validateIcon"),_t(v).is("loading","validating"===D.value)])},{default:fn((()=>[(_r(),Lr(ps(B.value)))])),_:1},8,["class"])):Vr("v-if",!0)],2)],2)):Vr("v-if",!0)],2),Vr(" append slot "),t.$slots.append?(_r(),Rr("div",{key:1,class:j(_t(v).be("group","append"))},[Ss(t.$slots,"append")],2)):Vr("v-if",!0)],64)):(_r(),Rr(br,{key:1},[Vr(" textarea "),Dr("textarea",$r({id:_t(m),ref_key:"textarea",ref:w,class:[_t(y).e("inner"),_t(v).is("focus",_t(A)),_t(y).is("clearable",e.clearable)]},_t(d),{name:e.name,minlength:e.countGraphemes?void 0:e.minlength,maxlength:e.countGraphemes?void 0:u.value,tabindex:e.tabindex,disabled:_t(f),readonly:e.readonly,autocomplete:e.autocomplete,style:V.value,"aria-label":e.ariaLabel,placeholder:e.placeholder,form:e.form,autofocus:e.autofocus,rows:e.rows,role:e.containerRole,inputmode:e.inputmode,onCompositionstart:n[3]||(n[3]=(...e)=>_t(ce)&&_t(ce)(...e)),onCompositionupdate:n[4]||(n[4]=(...e)=>_t(de)&&_t(de)(...e)),onCompositionend:n[5]||(n[5]=(...e)=>_t(ue)&&_t(ue)(...e)),onInput:ie,onFocus:n[6]||(n[6]=(...e)=>_t(O)&&_t(O)(...e)),onBlur:n[7]||(n[7]=(...e)=>_t(F)&&_t(F)(...e)),onChange:ae,onKeydown:pe}),null,16,Jc),$.value?(_r(),Lr(_t(Xi),{key:0,class:j([_t(y).e("icon"),_t(y).e("clear")]),style:N(_.value),onMousedown:$c(_t(i),["prevent"]),onClick:fe},{default:fn((()=>[(_r(),Lr(ps(e.clearIcon)))])),_:1},8,["class","style","onMousedown"])):Vr("v-if",!0),K.value?(_r(),Rr("span",{key:1,style:N(M.value),class:j([_t(v).e("count"),_t(v).is("outside","outside"===e.wordLimitPosition)])},J(q.value)+" / "+J(u.value),7)):Vr("v-if",!0)],64))],38))}});const ed=Qi(Zc),td=e=>Object.keys(e);var nd={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value",alphaDescription:"alpha {alpha}, current color is {color}",hueLabel:"pick hue value",hueDescription:"hue {hue}, current color is {color}",svLabel:"pick saturation and brightness value",svDescription:"saturation {saturation}, brightness {brightness}, current color is {color}",predefineDescription:"select {value} as the color"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum",selectAllLabel:"Select all rows",selectRowLabel:"Select this row",expandRowLabel:"Expand this row",collapseRowLabel:"Collapse this row",sortLabel:"Sort by {column}",filterLabel:"Filter by {column}"},tag:{close:"Close this tag"},tour:{next:"Next",previous:"Previous",finish:"Finish",close:"Close this dialog"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"},inputOTP:{groupLabel:"OTP Input",defaultLabel:"Please enter OTP character {index}"}}};const sd=e=>(t,n)=>rd(t,n,_t(e)),rd=(e,t,n)=>function(e,t,n){var s=null==e?void 0:bl(e,t);return void 0===s?n:s}(n,e,e).replace(/\{(\w+)\}/g,((e,n)=>`${t?.[n]??`{${n}}`}`)),od=Symbol("localeContextKey"),id={current:0},ad=wt(0),ld=Symbol("elZIndexContextKey"),cd=Symbol("zIndexContextKey"),dd=e=>{const t=Qr()?bn(ld,id):id,n=e||(Qr()?bn(cd,void 0):void 0),s=ao((()=>{const e=_t(n);return So(e)?e:2e3})),r=ao((()=>s.value+ad.value));return ho||bn(ld)||Co("ZIndexInjection","Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed\nusage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })"),{initialZIndex:s,currentZIndex:r,nextZIndex:()=>(t.current++,ad.value=t.current,r.value)}},ud=Symbol("emptyValuesContextKey"),hd=(Xo({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:e=>(e=S(e)?e():e,m(e)?e.every((e=>!e)):!e)}}),Symbol()),gd=wt();function md(e,t){const n=Qr()?bn(hd,gd):gd;return e?ao((()=>n.value?.[e]??t)):n}const pd=(e,t)=>{const n=[...new Set([...td(e),...td(t)])],s={};for(const r of n)s[r]=void 0!==t[r]?t[r]:e[r];return s},fd=Xo({size:Ua,disabled:{type:Boolean,default:void 0},type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:ai},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:ai,default:()=>si},plain:{type:Boolean,default:void 0},text:{type:Boolean,default:void 0},link:Boolean,bg:Boolean,autofocus:Boolean,round:{type:Boolean,default:void 0},circle:Boolean,dashed:{type:Boolean,default:void 0},color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:[String,Object],default:"button"}}),vd={click:e=>e instanceof MouseEvent},Sd=Symbol("buttonGroupContextKey");function yd(e,t){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");const n=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function bd(e){return Math.min(1,Math.max(0,e))}function Cd(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function wd(e){return Number(e)<=1?100*Number(e)+"%":e}function Ed(e){return 1===e.length?"0"+e:String(e)}function Td(e,t,n){e=yd(e,255),t=yd(t,255),n=yd(n,255);const s=Math.max(e,t,n),r=Math.min(e,t,n);let o=0,i=0;const a=(s+r)/2;if(s===r)i=0,o=0;else{const l=s-r;switch(i=a>.5?l/(2-s-r):l/(s+r),s){case e:o=(t-n)/l+(t<n?6:0);break;case t:o=(n-e)/l+2;break;case n:o=(e-t)/l+4}o/=6}return{h:o,s:i,l:a}}function Md(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function _d(e,t,n){e=yd(e,255),t=yd(t,255),n=yd(n,255);const s=Math.max(e,t,n),r=Math.min(e,t,n);let o=0;const i=s,a=s-r,l=0===s?0:a/s;if(s===r)o=0;else{switch(s){case e:o=(t-n)/a+(t<n?6:0);break;case t:o=(n-e)/a+2;break;case n:o=(e-t)/a+4}o/=6}return{h:o,s:l,v:i}}function kd(e,t,n,s){const r=[Ed(Math.round(e).toString(16)),Ed(Math.round(t).toString(16)),Ed(Math.round(n).toString(16))];return s&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function xd(e,t,n){let s=1-e/255,r=1-t/255,o=1-n/255,i=Math.min(s,r,o);return 1===i?(s=0,r=0,o=0):(s=(s-i)/(1-i)*100,r=(r-i)/(1-i)*100,o=(o-i)/(1-i)*100),i*=100,{c:Math.round(s),m:Math.round(r),y:Math.round(o),k:Math.round(i)}}function Pd(e){return Rd(e)/255}function Rd(e){return parseInt(e,16)}const Ld={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};const Ad="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",Od="[\\s|\\(]+("+Ad+")[,|\\s]+("+Ad+")[,|\\s]+("+Ad+")\\s*\\)?",Fd="[\\s|\\(]+("+Ad+")[,|\\s]+("+Ad+")[,|\\s]+("+Ad+")[,|\\s]+("+Ad+")\\s*\\)?",Id={CSS_UNIT:new RegExp(Ad),rgb:new RegExp("rgb"+Od),rgba:new RegExp("rgba"+Fd),hsl:new RegExp("hsl"+Od),hsla:new RegExp("hsla"+Fd),hsv:new RegExp("hsv"+Od),hsva:new RegExp("hsva"+Fd),cmyk:new RegExp("cmyk"+Fd),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Dd(e){return"number"==typeof e?!Number.isNaN(e):Id.CSS_UNIT.test(e)}class Bd{constructor(e="",t={}){if(e instanceof Bd)return e;"number"==typeof e&&(e=function(e){return{r:e>>16,g:(65280&e)>>8,b:255&e}}(e)),this.originalInput=e;const n=function(e){let t={r:0,g:0,b:0},n=1,s=null,r=null,o=null,i=!1,a=!1;var l,c,d;return"string"==typeof e&&(e=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;let t=!1;if(Ld[e])e=Ld[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};let n=Id.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Id.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Id.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Id.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Id.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Id.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Id.cmyk.exec(e),n?{c:n[1],m:n[2],y:n[3],k:n[4]}:(n=Id.hex8.exec(e),n?{r:Rd(n[1]),g:Rd(n[2]),b:Rd(n[3]),a:Pd(n[4]),format:t?"name":"hex8"}:(n=Id.hex6.exec(e),n?{r:Rd(n[1]),g:Rd(n[2]),b:Rd(n[3]),format:t?"name":"hex"}:(n=Id.hex4.exec(e),n?{r:Rd(n[1]+n[1]),g:Rd(n[2]+n[2]),b:Rd(n[3]+n[3]),a:Pd(n[4]+n[4]),format:t?"name":"hex8"}:(n=Id.hex3.exec(e),!!n&&{r:Rd(n[1]+n[1]),g:Rd(n[2]+n[2]),b:Rd(n[3]+n[3]),format:t?"name":"hex"}))))))))))}(e)),"object"==typeof e&&(Dd(e.r)&&Dd(e.g)&&Dd(e.b)?(l=e.r,c=e.g,d=e.b,t={r:255*yd(l,255),g:255*yd(c,255),b:255*yd(d,255)},i=!0,a="%"===String(e.r).substr(-1)?"prgb":"rgb"):Dd(e.h)&&Dd(e.s)&&Dd(e.v)?(s=wd(e.s),r=wd(e.v),t=function(e,t,n){e=6*yd(e,360),t=yd(t,100),n=yd(n,100);const s=Math.floor(e),r=e-s,o=n*(1-t),i=n*(1-r*t),a=n*(1-(1-r)*t),l=s%6;return{r:255*[n,i,o,o,a,n][l],g:255*[a,n,n,i,o,o][l],b:255*[o,o,a,n,n,i][l]}}(e.h,s,r),i=!0,a="hsv"):Dd(e.h)&&Dd(e.s)&&Dd(e.l)?(s=wd(e.s),o=wd(e.l),t=function(e,t,n){let s,r,o;if(e=yd(e,360),t=yd(t,100),n=yd(n,100),0===t)r=n,o=n,s=n;else{const i=n<.5?n*(1+t):n+t-n*t,a=2*n-i;s=Md(a,i,e+1/3),r=Md(a,i,e),o=Md(a,i,e-1/3)}return{r:255*s,g:255*r,b:255*o}}(e.h,s,o),i=!0,a="hsl"):Dd(e.c)&&Dd(e.m)&&Dd(e.y)&&Dd(e.k)&&(t=function(e,t,n,s){const r=s/100;return{r:255*(1-e/100)*(1-r),g:255*(1-t/100)*(1-r),b:255*(1-n/100)*(1-r)}}(e.c,e.m,e.y,e.k),i=!0,a="cmyk"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=Cd(n),{ok:i,format:e.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}(e);this.originalInput=e,this.r=n.r,this.g=n.g,this.b=n.b,this.a=n.a,this.roundA=Math.round(100*this.a)/100,this.format=t.format??n.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=n.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3}getLuminance(){const e=this.toRgb();let t,n,s;const r=e.r/255,o=e.g/255,i=e.b/255;return t=r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4),n=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),s=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4),.2126*t+.7152*n+.0722*s}getAlpha(){return this.a}setAlpha(e){return this.a=Cd(e),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:e}=this.toHsl();return 0===e}toHsv(){const e=_d(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}}toHsvString(){const e=_d(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.v);return 1===this.a?`hsv(${t}, ${n}%, ${s}%)`:`hsva(${t}, ${n}%, ${s}%, ${this.roundA})`}toHsl(){const e=Td(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}}toHslString(){const e=Td(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.l);return 1===this.a?`hsl(${t}, ${n}%, ${s}%)`:`hsla(${t}, ${n}%, ${s}%, ${this.roundA})`}toHex(e=!1){return kd(this.r,this.g,this.b,e)}toHexString(e=!1){return"#"+this.toHex(e)}toHex8(e=!1){return function(e,t,n,s,r){const o=[Ed(Math.round(e).toString(16)),Ed(Math.round(t).toString(16)),Ed(Math.round(n).toString(16)),Ed((i=s,Math.round(255*parseFloat(i)).toString(16)))];var i;return r&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this.r,this.g,this.b,this.a,e)}toHex8String(e=!1){return"#"+this.toHex8(e)}toHexShortString(e=!1){return 1===this.a?this.toHexString(e):this.toHex8String(e)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return 1===this.a?`rgb(${e}, ${t}, ${n})`:`rgba(${e}, ${t}, ${n}, ${this.roundA})`}toPercentageRgb(){const e=e=>`${Math.round(100*yd(e,255))}%`;return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}}toPercentageRgbString(){const e=e=>Math.round(100*yd(e,255));return 1===this.a?`rgb(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%)`:`rgba(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%, ${this.roundA})`}toCmyk(){return{...xd(this.r,this.g,this.b)}}toCmykString(){const{c:e,m:t,y:n,k:s}=xd(this.r,this.g,this.b);return`cmyk(${e}, ${t}, ${n}, ${s})`}toName(){if(0===this.a)return"transparent";if(this.a<1)return!1;const e="#"+kd(this.r,this.g,this.b,!1);for(const[t,n]of Object.entries(Ld))if(e===n)return t;return!1}toString(e){const t=Boolean(e);e=e??this.format;let n=!1;const s=this.a<1&&this.a>=0;return t||!s||!e.startsWith("hex")&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),"cmyk"===e&&(n=this.toCmykString()),n||this.toHexString()):"name"===e&&0===this.a?this.toName():this.toRgbString()}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new Bd(this.toString())}lighten(e=10){const t=this.toHsl();return t.l+=e/100,t.l=bd(t.l),new Bd(t)}brighten(e=10){const t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(-e/100*255))),t.g=Math.max(0,Math.min(255,t.g-Math.round(-e/100*255))),t.b=Math.max(0,Math.min(255,t.b-Math.round(-e/100*255))),new Bd(t)}darken(e=10){const t=this.toHsl();return t.l-=e/100,t.l=bd(t.l),new Bd(t)}tint(e=10){return this.mix("white",e)}shade(e=10){return this.mix("black",e)}desaturate(e=10){const t=this.toHsl();return t.s-=e/100,t.s=bd(t.s),new Bd(t)}saturate(e=10){const t=this.toHsl();return t.s+=e/100,t.s=bd(t.s),new Bd(t)}greyscale(){return this.desaturate(100)}spin(e){const t=this.toHsl(),n=(t.h+e)%360;return t.h=n<0?360+n:n,new Bd(t)}mix(e,t=50){const n=this.toRgb(),s=new Bd(e).toRgb(),r=t/100,o={r:(s.r-n.r)*r+n.r,g:(s.g-n.g)*r+n.g,b:(s.b-n.b)*r+n.b,a:(s.a-n.a)*r+n.a};return new Bd(o)}analogous(e=6,t=30){const n=this.toHsl(),s=360/t,r=[this];for(n.h=(n.h-(s*e>>1)+720)%360;--e;)n.h=(n.h+s)%360,r.push(new Bd(n));return r}complement(){const e=this.toHsl();return e.h=(e.h+180)%360,new Bd(e)}monochromatic(e=6){const t=this.toHsv(),{h:n}=t,{s}=t;let{v:r}=t;const o=[],i=1/e;for(;e--;)o.push(new Bd({h:n,s,v:r})),r=(r+i)%1;return o}splitcomplement(){const e=this.toHsl(),{h:t}=e;return[this,new Bd({h:(t+72)%360,s:e.s,l:e.l}),new Bd({h:(t+216)%360,s:e.s,l:e.l})]}onBackground(e){const t=this.toRgb(),n=new Bd(e).toRgb(),s=t.a+n.a*(1-t.a);return new Bd({r:(t.r*t.a+n.r*n.a*(1-t.a))/s,g:(t.g*t.a+n.g*n.a*(1-t.a))/s,b:(t.b*t.a+n.b*n.a*(1-t.a))/s,a:s})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(e){const t=this.toHsl(),{h:n}=t,s=[this],r=360/e;for(let o=1;o<e;o++)s.push(new Bd({h:(n+o*r)%360,s:t.s,l:t.l}));return s}equals(e){const t=new Bd(e);return"cmyk"===this.format||"cmyk"===t.format?this.toCmykString()===t.toCmykString():this.toRgbString()===t.toRgbString()}}function zd(e,t=20){return e.mix("#141414",t).toString()}var Ud=Hn({name:"ElButton",__name:"button",props:fd,emits:vd,setup(e,{expose:t,emit:n}){const s=e,r=n,o=function(e){const t=$a(),n=Oi("button");return ao((()=>{let s={},r=e.color;if(r){const o=r.match(/var\((.*?)\)/);o&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(o[1]));const i=new Bd(r),a=e.dark?i.tint(20).toString():zd(i,20);if(e.plain)s=n.cssVarBlock({"bg-color":e.dark?zd(i,90):i.tint(90).toString(),"text-color":r,"border-color":e.dark?zd(i,50):i.tint(50).toString(),"hover-text-color":`var(${n.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":a,"active-text-color":`var(${n.cssVarName("color-white")})`,"active-border-color":a}),t.value&&(s[n.cssVarBlockName("disabled-bg-color")]=e.dark?zd(i,90):i.tint(90).toString(),s[n.cssVarBlockName("disabled-text-color")]=e.dark?zd(i,50):i.tint(50).toString(),s[n.cssVarBlockName("disabled-border-color")]=e.dark?zd(i,80):i.tint(80).toString());else if(e.link||e.text){const o=e.dark?zd(i,30):i.tint(30).toString();if(s=n.cssVarBlock({"text-color":r,"hover-text-color":o,"active-text-color":a}),e.link&&(s[n.cssVarBlockName("hover-link-text-color")]=o,s[n.cssVarBlockName("active-color")]=a),t.value){const t=e.dark?zd(i,50):i.tint(50).toString();s[n.cssVarBlockName("disabled-bg-color")]="transparent",s[n.cssVarBlockName("disabled-text-color")]=t,s[n.cssVarBlockName("disabled-border-color")]="transparent"}}else{const o=e.dark?zd(i,30):i.tint(30).toString(),l=i.isDark()?`var(${n.cssVarName("color-white")})`:`var(${n.cssVarName("color-black")})`;if(s=n.cssVarBlock({"bg-color":r,"text-color":l,"border-color":r,"hover-bg-color":o,"hover-text-color":l,"hover-border-color":o,"active-bg-color":a,"active-border-color":a}),t.value){const t=e.dark?zd(i,50):i.tint(50).toString();s[n.cssVarBlockName("disabled-bg-color")]=t,s[n.cssVarBlockName("disabled-text-color")]=e.dark?"rgba(255, 255, 255, 0.5)":`var(${n.cssVarName("color-white")})`,s[n.cssVarBlockName("disabled-border-color")]=t}}}return s}))}(s),i=Oi("button"),{_ref:a,_size:l,_type:c,_disabled:d,_props:u,_plain:h,_round:g,_text:m,_dashed:p,shouldAddSpace:f,handleClick:v}=((e,t)=>{(({from:e,replacement:t,scope:n,version:s,ref:r,type:o="API"},i)=>{En((()=>_t(i)),(i=>{i&&Co(n,`[${o}] ${e} is about to be deprecated in version ${s}, please use ${t} instead.\nFor more detail, please visit: ${r}\n`)}),{immediate:!0})})({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},ao((()=>"text"===e.type)));const n=bn(Sd,void 0),s=md("button"),{form:r}=Wa(),o=Ga(ao((()=>n?.size))),i=$a(),a=wt(),l=Ts(),c=ao((()=>e.type||n?.type||s.value?.type||"")),d=ao((()=>e.autoInsertSpace??s.value?.autoInsertSpace??!1)),u=ao((()=>e.plain??s.value?.plain??!1)),h=ao((()=>e.round??s.value?.round??!1)),g=ao((()=>e.text??s.value?.text??!1)),m=ao((()=>e.dashed??s.value?.dashed??!1)),p=ao((()=>"button"===e.tag?{ariaDisabled:i.value||e.loading,disabled:i.value||e.loading,autofocus:e.autofocus,type:e.nativeType}:{})),f=ao((()=>{const e=l.default?.();if(d.value&&1===e?.length){const t=e[0];if(t?.type===Cr){const e=t.children;return/^\p{Unified_Ideograph}{2}$/u.test(e.trim())}}return!1}));return{_disabled:i,_size:o,_type:c,_ref:a,_props:p,_plain:u,_round:h,_text:g,_dashed:m,shouldAddSpace:f,handleClick:n=>{i.value||e.loading?n.stopPropagation():("reset"===e.nativeType&&r?.resetFields(),t("click",n))}}})(s,r),S=ao((()=>[i.b(),i.m(c.value),i.m(l.value),i.is("disabled",d.value),i.is("loading",s.loading),i.is("plain",h.value),i.is("round",g.value),i.is("circle",s.circle),i.is("text",m.value),i.is("dashed",p.value),i.is("link",s.link),i.is("has-bg",s.bg)]));return t({ref:a,size:l,type:c,disabled:d,shouldAddSpace:f}),(t,n)=>(_r(),Lr(ps(e.tag),$r({ref_key:"_ref",ref:a},_t(u),{class:S.value,style:_t(o),onClick:_t(v)}),{default:fn((()=>[e.loading?(_r(),Rr(br,{key:0},[t.$slots.loading?Ss(t.$slots,"loading",{key:0}):(_r(),Lr(_t(Xi),{key:1,class:j(_t(i).is("loading"))},{default:fn((()=>[(_r(),Lr(ps(e.loadingIcon)))])),_:1},8,["class"]))],64)):e.icon||t.$slots.icon?(_r(),Lr(_t(Xi),{key:1},{default:fn((()=>[e.icon?(_r(),Lr(ps(e.icon),{key:0})):Ss(t.$slots,"icon",{key:1})])),_:3})):Vr("v-if",!0),t.$slots.default?(_r(),Rr("span",{key:2,class:j({[_t(i).em("text","expand")]:_t(f)})},[Ss(t.$slots,"default")],2)):Vr("v-if",!0)])),_:3},16,["class","style","onClick"]))}}),Vd=Ud,Nd=Hn({name:"ElButtonGroup",__name:"button-group",props:{size:fd.size,type:fd.type,direction:{type:String,values:["horizontal","vertical"],default:"horizontal"}},setup(e){const t=e;yn(Sd,dt({size:Ot(t,"size"),type:Ot(t,"type")}));const n=Oi("button");return(e,s)=>(_r(),Rr("div",{class:j([_t(n).b("group"),_t(n).bm("group",t.direction)])},[Ss(e.$slots,"default")],2))}});const Hd=Qi(Vd,{ButtonGroup:Nd});var Gd;(Gd=Nd).install=i,qi(Gd);const $d="_trap-focus-children",Wd=[],jd=e=>{if(0===Wd.length)return;const t=Zi(e),n=Wd[Wd.length-1][$d];if(n.length>0&&t===Ji.tab){if(1===n.length)return e.preventDefault(),void(document.activeElement!==n[0]&&n[0].focus());const t=e.shiftKey,s=e.target===n[0],r=e.target===n[n.length-1];s&&t&&(e.preventDefault(),n[n.length-1].focus()),r&&!t&&(e.preventDefault(),n[0].focus())}},Kd={beforeMount(e){e[$d]=gi(e),Wd.push(e),Wd.length<=1&&document.addEventListener("keydown",jd)},updated(e){Xt((()=>{e[$d]=gi(e)}))},unmounted(){Wd.shift(),0===Wd.length&&document.removeEventListener("keydown",jd)}};var qd=Hn({name:"ElOverlay",props:Xo({mask:{type:Boolean,default:!0},customMaskEvent:Boolean,overlayClass:{type:[String,Array,Object]},zIndex:{type:[String,Number]}}),emits:{click:e=>e instanceof MouseEvent},setup(e,{slots:t,emit:n}){const s=Oi("overlay"),{onClick:r,onMousedown:o,onMouseup:i}=Ii(e.customMaskEvent?void 0:e=>{n("click",e)});return()=>e.mask?Br("div",{class:[s.b(),e.overlayClass],style:{zIndex:e.zIndex},onClick:r,onMousedown:o,onMouseup:i},[Ss(t,"default")],14,["onClick","onMouseup","onMousedown"]):lo("div",{class:e.overlayClass,style:{zIndex:e.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[Ss(t,"default")])}}),Qd=Hn({name:"ElMessageBox",directives:{TrapFocus:Kd},components:{ElButton:Hd,ElFocusTrap:_a,ElInput:ed,ElOverlay:qd,ElIcon:Xi,...li},inheritAttrs:!1,props:{buttonSize:{type:String,validator:e=>["",...ui].includes(e)},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:Boolean,container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(e,{emit:t}){const{locale:n,zIndex:s,ns:r,size:o}=function(e,t){const n=md(),s=Oi("message-box",ao((()=>n.value?.namespace||"el"))),r=(e=>{const t=e||bn(od,wt());return(e=>({lang:ao((()=>_t(e).name)),locale:Ct(e)?e:wt(e),t:sd(e)}))(ao((()=>t.value||nd)))})(ao((()=>n.value?.locale))),o=dd(ao((()=>{const e=n.value?.zIndex;return Ta(e)||Number.isNaN(e)?2e3:e}))),i=ao((()=>_t(t)||n.value?.size||""));return((e,t,n=!1)=>{const s=!!Qr(),r=s?md():void 0,o=t?.provide??(s?yn:void 0);if(!o)return void Co("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");const i=ao((()=>{const t=_t(e);return r?.value?pd(r.value,t):t}));o(hd,i),o(od,ao((()=>i.value.locale))),o(Li,ao((()=>i.value.namespace))),o(cd,ao((()=>i.value.zIndex))),o(Va,{size:ao((()=>i.value.size||""))}),o(ud,ao((()=>({emptyValues:i.value.emptyValues,valueOnClear:i.value.valueOnClear})))),!n&&gd.value||(gd.value=i.value)})(ao((()=>_t(n)||{}))),{ns:s,locale:r,zIndex:o,size:i}}(0,ao((()=>e.buttonSize))),{t:i}=n,{nextZIndex:a}=s,l=wt(!1),c=dt({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",cancelButtonType:"",confirmButtonType:"primary",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",closeIcon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:"",inputValidator:void 0,inputErrorMessage:"",message:"",modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:St(si),cancelButtonLoadingIcon:St(si),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:a()}),d=ao((()=>{const e=c.type;return{[r.bm("icon",e)]:e&&ci[e]}})),u=zi(),h=zi(),g=ao((()=>{const e=c.type;return c.icon||e&&ci[e]||""})),m=ao((()=>!!c.message)),p=wt(),f=wt(),v=wt(),b=wt(),C=wt(),w=ao((()=>c.confirmButtonClass));En((()=>c.inputValue),(async t=>{await Xt(),"prompt"===e.boxType&&t&&x()}),{immediate:!0}),En((()=>l.value),(t=>{t&&("prompt"!==e.boxType&&(c.autofocus?v.value=C.value?.$el??p.value:v.value=p.value),c.zIndex=a()),"prompt"===e.boxType&&(t?Xt().then((()=>{b.value&&b.value.$el&&(c.autofocus?v.value=P()??p.value:v.value=p.value)})):(c.editorErrorMessage="",c.validateError=!1))}));const{isDragging:E}=((e,t,n,s)=>{const r={offsetX:0,offsetY:0},o=wt(!1),i=(t,n)=>{if(e.value){const{offsetX:o,offsetY:i}=r,a=e.value.getBoundingClientRect(),l=Math.max(a.left,0),c=Math.max(a.top,0),d=a.width,u=a.height,h=document.documentElement.clientWidth,g=document.documentElement.clientHeight,m=-l+o,p=-c+i,f=h-l-d+o,v=g-c-(u<g?u:0)+i;s?.value||(t=ki(t,m,f),n=ki(n,p,v)),r.offsetX=t,r.offsetY=n,e.value.style.transform=`translate(${fi(t)}, ${fi(n)})`}},a=e=>{const t=e.clientX,n=e.clientY,{offsetX:s,offsetY:a}=r,l=e=>{o.value||(o.value=!0),i(s+e.clientX-t,a+e.clientY-n)},c=()=>{o.value=!1,document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c)};document.addEventListener("mousemove",l),document.addEventListener("mouseup",c)},l=()=>{t.value&&e.value&&(t.value.removeEventListener("mousedown",a),window.removeEventListener("resize",c))},c=()=>{const{offsetX:e,offsetY:t}=r;i(e,t)};return ss((()=>{wn((()=>{n.value?t.value&&e.value&&(t.value.addEventListener("mousedown",a),window.addEventListener("resize",c)):l()}))})),is((()=>{l()})),{isDragging:o,resetPosition:()=>{r.offsetX=0,r.offsetY=0,e.value&&(e.value.style.transform="")},updatePosition:c}})(p,f,ao((()=>e.draggable)),ao((()=>e.overflow)));function T(){l.value&&(l.value=!1,Xt((()=>{c.action&&t("action",c.action)})))}ss((async()=>{await Xt(),e.closeOnHashChange&&window.addEventListener("hashchange",T)})),is((()=>{e.closeOnHashChange&&window.removeEventListener("hashchange",T)}));const M=()=>{e.closeOnClickModal&&k(c.distinguishCancelAndClose?"close":"cancel")},_=Ii(M),k=t=>{("prompt"!==e.boxType||"confirm"!==t||x())&&(c.action=t,c.beforeClose?c.beforeClose?.(t,c,T):T())},x=()=>{if("prompt"===e.boxType){const e=c.inputPattern;if(e&&!e.test(c.inputValue||""))return c.editorErrorMessage=c.inputErrorMessage||i("el.messagebox.error"),c.validateError=!0,!1;const t=c.inputValidator;if(S(t)){const e=t(c.inputValue);if(!1===e)return c.editorErrorMessage=c.inputErrorMessage||i("el.messagebox.error"),c.validateError=!0,!1;if(y(e))return c.editorErrorMessage=e,c.validateError=!0,!1}}return c.editorErrorMessage="",c.validateError=!1,!0},P=()=>{const e=b.value?.$refs;return e?.input??e?.textarea},R=()=>{k("close")};return e.lockScroll&&Fi(l,{ns:r}),{...Rt(c),ns:r,overlayEvent:_,visible:l,hasMessage:m,typeClass:d,contentId:u,inputId:h,btnSize:o,iconComponent:g,confirmButtonClasses:w,rootRef:p,focusStartRef:v,headerRef:f,inputRef:b,isDragging:E,confirmRef:C,doClose:T,handleClose:R,onCloseRequested:()=>{e.closeOnPressEscape&&R()},handleWrapperClick:M,handleInputEnter:e=>{if("textarea"!==c.inputType&&!b.value?.isComposing)return e.preventDefault(),k("confirm")},handleAction:k,t:i}}});const Xd=["aria-label","aria-describedby"],Jd=["aria-label"],Yd=["id"];var Zd=wo(Qd,[["render",function(e,t,n,s,r,o){const i=gs("el-icon"),a=gs("el-input"),l=gs("el-button"),c=gs("el-focus-trap"),d=gs("el-overlay");return _r(),Lr(uc,{name:"fade-in-linear",onAfterLeave:t[11]||(t[11]=t=>e.$emit("vanish")),persisted:""},{default:fn((()=>[vn(Br(d,{"z-index":e.zIndex,"overlay-class":[e.ns.is("message-box"),e.modalClass],mask:e.modal},{default:fn((()=>[Dr("div",{role:"dialog","aria-label":e.title,"aria-modal":"true","aria-describedby":e.showInput?void 0:e.contentId,class:j(`${e.ns.namespace.value}-overlay-message-box`),onClick:t[8]||(t[8]=(...t)=>e.overlayEvent.onClick&&e.overlayEvent.onClick(...t)),onMousedown:t[9]||(t[9]=(...t)=>e.overlayEvent.onMousedown&&e.overlayEvent.onMousedown(...t)),onMouseup:t[10]||(t[10]=(...t)=>e.overlayEvent.onMouseup&&e.overlayEvent.onMouseup(...t))},[Br(c,{loop:"",trapped:e.visible,"focus-trap-el":e.rootRef,"focus-start-el":e.focusStartRef,onReleaseRequested:e.onCloseRequested},{default:fn((()=>[Dr("div",{ref:"rootRef",class:j([e.ns.b(),e.customClass,e.ns.is("draggable",e.draggable),e.ns.is("dragging",e.isDragging),{[e.ns.m("center")]:e.center}]),style:N(e.customStyle),tabindex:"-1",onClick:t[7]||(t[7]=$c((()=>{}),["stop"]))},[null!==e.title&&void 0!==e.title?(_r(),Rr("div",{key:0,ref:"headerRef",class:j([e.ns.e("header"),{"show-close":e.showClose}])},[Dr("div",{class:j(e.ns.e("title"))},[e.iconComponent&&e.center?(_r(),Lr(i,{key:0,class:j([e.ns.e("status"),e.typeClass])},{default:fn((()=>[(_r(),Lr(ps(e.iconComponent)))])),_:1},8,["class"])):Vr("v-if",!0),Dr("span",null,J(e.title),1)],2),e.showClose?(_r(),Rr("button",{key:0,type:"button",class:j(e.ns.e("headerbtn")),"aria-label":e.t("el.messagebox.close"),onClick:t[0]||(t[0]=t=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel")),onKeydown:t[1]||(t[1]=jc($c((t=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel")),["prevent"]),["enter"]))},[Br(i,{class:j(e.ns.e("close"))},{default:fn((()=>[(_r(),Lr(ps(e.closeIcon||"close")))])),_:1},8,["class"])],42,Jd)):Vr("v-if",!0)],2)):Vr("v-if",!0),Dr("div",{id:e.contentId,class:j(e.ns.e("content"))},[Dr("div",{class:j(e.ns.e("container"))},[e.iconComponent&&!e.center&&e.hasMessage?(_r(),Lr(i,{key:0,class:j([e.ns.e("status"),e.typeClass])},{default:fn((()=>[(_r(),Lr(ps(e.iconComponent)))])),_:1},8,["class"])):Vr("v-if",!0),e.hasMessage?(_r(),Rr("div",{key:1,class:j(e.ns.e("message"))},[Ss(e.$slots,"default",{},(()=>[e.dangerouslyUseHTMLString?(_r(),Lr(ps(e.showInput?"label":"p"),{key:1,for:e.showInput?e.inputId:void 0,innerHTML:e.message},null,8,["for","innerHTML"])):(_r(),Lr(ps(e.showInput?"label":"p"),{key:0,for:e.showInput?e.inputId:void 0,textContent:J(e.message)},null,8,["for","textContent"]))]))],2)):Vr("v-if",!0)],2),vn(Dr("div",{class:j(e.ns.e("input"))},[Br(a,{id:e.inputId,ref:"inputRef",modelValue:e.inputValue,"onUpdate:modelValue":t[2]||(t[2]=t=>e.inputValue=t),type:e.inputType,placeholder:e.inputPlaceholder,"aria-invalid":e.validateError,class:j({invalid:e.validateError}),onKeydown:jc(e.handleInputEnter,["enter"])},null,8,["id","modelValue","type","placeholder","aria-invalid","class","onKeydown"]),Dr("div",{class:j(e.ns.e("errormsg")),style:N({visibility:e.editorErrorMessage?"visible":"hidden"})},J(e.editorErrorMessage),7)],2),[[Mc,e.showInput]])],10,Yd),e.showCancelButton||e.showConfirmButton?(_r(),Rr("div",{key:1,class:j(e.ns.e("btns"))},[e.showCancelButton?(_r(),Lr(l,{key:0,type:"text"===e.cancelButtonType?"":e.cancelButtonType,text:"text"===e.cancelButtonType,loading:e.cancelButtonLoading,"loading-icon":e.cancelButtonLoadingIcon,class:j([e.cancelButtonClass]),round:e.roundButton,size:e.btnSize,onClick:t[3]||(t[3]=t=>e.handleAction("cancel")),onKeydown:t[4]||(t[4]=jc($c((t=>e.handleAction("cancel")),["prevent"]),["enter"]))},{default:fn((()=>[Ur(J(e.cancelButtonText||e.t("el.messagebox.cancel")),1)])),_:1},8,["type","text","loading","loading-icon","class","round","size"])):Vr("v-if",!0),vn(Br(l,{ref:"confirmRef",type:"text"===e.confirmButtonType?"":e.confirmButtonType,text:"text"===e.confirmButtonType,loading:e.confirmButtonLoading,"loading-icon":e.confirmButtonLoadingIcon,class:j([e.confirmButtonClasses]),round:e.roundButton,disabled:e.confirmButtonDisabled,size:e.btnSize,onClick:t[5]||(t[5]=t=>e.handleAction("confirm")),onKeydown:t[6]||(t[6]=jc($c((t=>e.handleAction("confirm")),["prevent"]),["enter"]))},{default:fn((()=>[Ur(J(e.confirmButtonText||e.t("el.messagebox.confirm")),1)])),_:1},8,["type","text","loading","loading-icon","class","round","disabled","size"]),[[Mc,e.showConfirmButton]])],2)):Vr("v-if",!0)],6)])),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,Xd)])),_:3},8,["z-index","overlay-class","mask"]),[[Mc,e.visible]])])),_:3})}]]);const eu=new Map,tu=(e,t)=>{const n=e.component?.proxy;return()=>n.handleAction(t)},nu=(e,t)=>{const n=document.createElement("div");e.onVanish=()=>{Qc(null,n),eu.delete(r)},e.onAction=t=>{const n=eu.get(r);let o;o=e.showInput?{value:r.inputValue,action:t}:t,e.callback?e.callback(o,s.proxy):"cancel"===t||"close"===t?e.distinguishCancelAndClose&&"cancel"!==t?n.reject("close"):n.reject("cancel"):n.resolve(o)};const s=((e,t,n=null)=>{const s=Br(Zd,e,S(e.message)||Ar(e.message)?{default:S(e.message)?()=>e.message({confirm:tu(s,"confirm"),cancel:tu(s,"cancel"),close:tu(s,"close")}):()=>e.message}:null);return s.appContext=n,Qc(s,t),(e=>{let t=document.body;return e.appendTo&&(y(e.appendTo)&&(t=document.querySelector(e.appendTo)),yo(e.appendTo)&&(t=e.appendTo),yo(t)||(Co("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),t=document.body)),t})(e).appendChild(t.firstElementChild),s.component})(e,n,t),r=s.proxy;for(const t in e)g(e,t)&&!g(r.$props,t)&&("closeIcon"===t&&C(e[t])?r[t]=St(e[t]):r[t]=e[t]);return r.visible=!0,r};function su(e,t=null){if(!ho)return Promise.reject();let n;return y(e)||Ar(e)?e={message:e}:n=e.callback,new Promise(((s,r)=>{const o=nu(e,t??su._context);eu.set(o,{options:e,callback:n,resolve:s,reject:r})}))}const ru={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};["alert","confirm","prompt"].forEach((e=>{su[e]=function(e){return(t,n,s,r)=>{let o="";return C(n)?(s=n,o=""):o=void 0===n?"":n,su(Object.assign({title:o,message:t,type:"",...ru[e]},s,{boxType:e}),r)}}(e)})),su.close=()=>{eu.forEach(((e,t)=>{t.doClose()})),eu.clear()},su._context=null;const ou=su;ou.install=e=>{ou._context=e._context,e.config.globalProperties.$msgbox=ou,e.config.globalProperties.$messageBox=ou,e.config.globalProperties.$alert=ou.alert,e.config.globalProperties.$confirm=ou.confirm,e.config.globalProperties.$prompt=ou.prompt};const iu=ou;class au{static GetStackTrace(){const e=new Error;let t="No Stack Available for this browser";return e.stack&&(t=e.stack.toString().replace(/Error/g,"")),t}static SetLoggerVerbosity(e){null!=this.verboseLogLevel&&(this.verboseLogLevel=e)}static Log(e,t,n){if(n>this.verboseLogLevel)return;const s=`Level: Log\nMsg: ${t}\nCaller: ${e}`;console.log(s)}static Info(e,t,n){if(n>this.verboseLogLevel)return;const s=`Level: Info\nMsg: ${t}`;console.info(s)}static Error(e,t){const n=`Level: Error\nMsg: ${t}\nCaller: ${e}`;console.error(n)}static Warning(e,t){const n=`Level: Warning\nCaller: ${e}\nMsg: ${t}`;console.warn(n)}}var lu,cu;au.verboseLogLevel=5,function(e){e.LIST_STREAMERS="listStreamers",e.SUBSCRIBE="subscribe",e.UNSUBSCRIBE="unsubscribe",e.ICE_CANDIDATE="iceCandidate",e.OFFER="offer",e.ANSWER="answer",e.DATACHANNELREQUEST="dataChannelRequest",e.SFURECVDATACHANNELREADY="peerDataChannelsReady",e.PONG="pong"}(lu||(lu={}));class du{payload(){return au.Log(au.GetStackTrace(),"Sending => \n"+JSON.stringify(this,void 0,4),6),JSON.stringify(this)}}class uu extends du{constructor(){super(),this.type=lu.LIST_STREAMERS}}class hu extends du{constructor(e){super(),this.type=lu.LIST_STREAMERS,this.streamerName=e}}class gu extends du{constructor(e){super(),this.type=lu.SUBSCRIBE,this.streamerId=e}}class mu extends du{constructor(){super(),this.type=lu.UNSUBSCRIBE}}class pu extends du{constructor(e){super(),this.type=lu.PONG,this.time=e}}class fu extends du{constructor(e){super(),this.type=lu.OFFER,e&&(this.type=e.type,this.sdp=e.sdp)}}class vu extends du{constructor(e){super(),this.type=lu.ANSWER,e&&(this.type=e.type,this.sdp=e.sdp)}}class Su extends du{constructor(){super(),this.type=lu.DATACHANNELREQUEST}}class yu extends du{constructor(){super(),this.type=lu.SFURECVDATACHANNELREADY}}class bu{constructor(e){this.type=lu.ICE_CANDIDATE,this.candidate=e}payload(){return au.Log(au.GetStackTrace(),"Sending => \n"+JSON.stringify(this,void 0,4),6),JSON.stringify(this)}}!function(e){e.CONFIG="config",e.STREAMER_LIST="streamerList",e.PLAYER_COUNT="playerCount",e.OFFER="offer",e.ANSWER="answer",e.ICE_CANDIDATE="iceCandidate",e.PEER_DATA_CHANNELS="peerDataChannels",e.PING="ping",e.WARNING="warning"}(cu||(cu={}));class Cu{}class wu extends Cu{}class Eu{constructor(){this.FromUEMessageHandlers=new Map}addMessageHandler(e,t){this.FromUEMessageHandlers.set(e,t)}handleMessage(e,t){this.FromUEMessageHandlers.has(e)?this.FromUEMessageHandlers.get(e)(t):au.Error(au.GetStackTrace(),`Message type of ${e} does not have a message handler registered on the frontend - ignoring message.`)}static setupDefaultHandlers(e){e.signallingProtocol.addMessageHandler(cu.PING,(t=>{const n=new pu((new Date).getTime()).payload();au.Log(au.GetStackTrace(),cu.PING+": "+t,6),e.webSocket.send(n)})),e.signallingProtocol.addMessageHandler(cu.CONFIG,(t=>{au.Log(au.GetStackTrace(),cu.CONFIG,6);const n=JSON.parse(t);e.onConfig(n)})),e.signallingProtocol.addMessageHandler(cu.STREAMER_LIST,(t=>{au.Log(au.GetStackTrace(),cu.STREAMER_LIST,6);const n=JSON.parse(t);e.onStreamerList(n)})),e.signallingProtocol.addMessageHandler(cu.PLAYER_COUNT,(t=>{au.Log(au.GetStackTrace(),cu.PLAYER_COUNT,6);const n=JSON.parse(t);au.Log(au.GetStackTrace(),"Player Count: "+n.count,6),e.onPlayerCount(n)})),e.signallingProtocol.addMessageHandler(cu.ANSWER,(t=>{au.Log(au.GetStackTrace(),cu.ANSWER,6);const n=JSON.parse(t);e.onWebRtcAnswer(n)})),e.signallingProtocol.addMessageHandler(cu.OFFER,(t=>{au.Log(au.GetStackTrace(),cu.OFFER,6);const n=JSON.parse(t);e.onWebRtcOffer(n)})),e.signallingProtocol.addMessageHandler(cu.ICE_CANDIDATE,(t=>{au.Log(au.GetStackTrace(),cu.ICE_CANDIDATE,6);const n=JSON.parse(t);e.onIceCandidate(n.candidate)})),e.signallingProtocol.addMessageHandler(cu.WARNING,(e=>{au.Warning(au.GetStackTrace(),`Warning received: ${e}`)})),e.signallingProtocol.addMessageHandler(cu.PEER_DATA_CHANNELS,(t=>{au.Log(au.GetStackTrace(),cu.PEER_DATA_CHANNELS,6);const n=JSON.parse(t);e.onWebRtcPeerDataChannels(n)}))}}class Tu{constructor(){this.WS_OPEN_STATE=1,this.onOpen=new EventTarget,this.onClose=new EventTarget,this.signallingProtocol=new Eu,Eu.setupDefaultHandlers(this)}connect(e){au.Log(au.GetStackTrace(),e,6);try{return this.webSocket=new WebSocket(e),this.webSocket.onopen=e=>this.handleOnOpen(e),this.webSocket.onerror=()=>this.handleOnError(),this.webSocket.onclose=e=>this.handleOnClose(e),this.webSocket.onmessage=e=>this.handleOnMessage(e),this.webSocket.onmessagebinary=e=>this.handleOnMessageBinary(e),!0}catch(e){return au.Error(e,e),!1}}handleOnMessageBinary(e){e&&e.data&&e.data.text().then((e=>{const t=new MessageEvent("messageFromBinary",{data:e});this.handleOnMessage(t)})).catch((e=>{au.Error(au.GetStackTrace(),`从websocket解析二进制blob失败,原因: ${e}`)}))}handleOnMessage(e){if(e.data&&e.data instanceof Blob)return void this.handleOnMessageBinary(e);const t=JSON.parse(e.data);au.Log(au.GetStackTrace(),"received => \n"+JSON.stringify(JSON.parse(e.data),void 0,4),6),this.signallingProtocol.handleMessage(t.type,e.data)}handleOnOpen(e){au.Log(au.GetStackTrace(),"通过WebSocket连接到信令服务器",6),this.onOpen.dispatchEvent(new Event("open"))}handleOnError(){au.Error(au.GetStackTrace(),"WebSocket error")}handleOnClose(e){console.log(e),au.Log(au.GetStackTrace(),"通过WebSocket与信令服务器断开连接: "+JSON.stringify(e.code)+" - "+e.reason),4004==e.code&&(this.onOpen.dispatchEvent(new Event("close",e)),this.onClose.dispatchEvent(new CustomEvent("close",{detail:e})))}requestStreamerList(){const e=new uu;this.webSocket.send(e.payload())}requestStreamerObject(e){const t=new hu(e);this.webSocket.send(t.payload())}sendSubscribe(e){const t=new gu(e);this.webSocket.send(t.payload())}sendUnsubscribe(){const e=new mu;this.webSocket.send(e.payload())}sendWebRtcOffer(e){const t=new fu(e);this.webSocket.send(t.payload())}sendWebRtcAnswer(e){const t=new vu(e);this.webSocket.send(t.payload())}sendWebRtcDatachannelRequest(){const e=new Su;this.webSocket.send(e.payload())}sendSFURecvDataChannelReady(){const e=new yu;this.webSocket.send(e.payload())}sendIceCandidate(e){if(au.Log(au.GetStackTrace(),"Sending Ice Candidate(发送Ice候选人)"),this.webSocket&&this.webSocket.readyState===this.WS_OPEN_STATE){const t=new bu(e);this.webSocket.send(t.payload())}}close(){var e;null===(e=this.webSocket)||void 0===e||e.close()}onConfig(e){}onStreamerList(e){}onIceCandidate(e){}onWebRtcAnswer(e){}onWebRtcOffer(e){}onWebRtcPeerDataChannels(e){}onPlayerCount(e){}}class Mu{constructor(e){this.videoElementProvider=e,this.audioElement=document.createElement("Audio"),this.videoElementProvider.setAudioElement(this.audioElement)}handleOnTrack(e){au.Log(au.GetStackTrace(),"handleOnTrack "+JSON.stringify(e.streams),6);const t=this.videoElementProvider.getVideoElement();if(e.track&&au.Log(au.GetStackTrace(),"Got track - "+e.track.kind+" id="+e.track.id+" readyState="+e.track.readyState,6),"audio"!=e.track.kind)return"video"==e.track.kind&&t.srcObject!==e.streams[0]?(t.srcObject=e.streams[0],void au.Log(au.GetStackTrace(),"Set video source from video track ontrack.")):void 0;this.CreateAudioTrack(e.streams[0])}CreateAudioTrack(e){const t=this.videoElementProvider.getVideoElement();t.srcObject!=e&&t.srcObject&&t.srcObject!==e&&(this.audioElement.srcObject=e,au.Log(au.GetStackTrace(),"Created new audio element to play separate audio stream."))}}class _u{constructor(e){this.freezeFrameHeight=0,this.freezeFrameWidth=0,this.rootDiv=e,this.rootElement=document.createElement("div"),this.rootElement.id="freezeFrame",this.rootElement.style.display="none",this.rootElement.style.pointerEvents="none",this.rootElement.style.position="absolute",this.rootElement.style.zIndex="20",this.imageElement=document.createElement("img"),this.imageElement.style.position="absolute",this.rootElement.appendChild(this.imageElement),this.rootDiv.appendChild(this.rootElement)}setElementForShow(){this.rootElement.style.display="block"}setElementForHide(){this.rootElement.style.display="none"}updateImageElementSource(e){const t=btoa(e.reduce(((e,t)=>e+String.fromCharCode(t)),""));this.imageElement.src="data:image/jpeg;base64,"+t}setDimensionsFromElementAndResize(){this.freezeFrameHeight=this.imageElement.naturalHeight,this.freezeFrameWidth=this.imageElement.naturalWidth,this.resize()}resize(){if(0!==this.freezeFrameWidth&&0!==this.freezeFrameHeight){let e=0,t=0,n=0,s=0;const r=this.rootDiv.clientWidth/this.rootDiv.clientHeight,o=this.freezeFrameWidth/this.freezeFrameHeight;r<o?(e=this.rootDiv.clientWidth,t=Math.floor(this.rootDiv.clientWidth/o),n=Math.floor(.5*(this.rootDiv.clientHeight-t)),s=0):(e=Math.floor(this.rootDiv.clientHeight*o),t=this.rootDiv.clientHeight,n=0,s=Math.floor(.5*(this.rootDiv.clientWidth-e))),this.rootElement.style.width=this.rootDiv.offsetWidth+"px",this.rootElement.style.height=this.rootDiv.offsetHeight+"px",this.rootElement.style.left="0px",this.rootElement.style.top="0px",this.imageElement.style.width=e+"px",this.imageElement.style.height=t+"px",this.imageElement.style.left=s+"px",this.imageElement.style.top=n+"px"}}}class ku{constructor(e){this.receiving=!1,this.size=0,this.jpeg=void 0,this.valid=!1,this.freezeFrameDelay=50,this.freezeFrame=new _u(e)}showFreezeFrame(){this.valid&&this.freezeFrame.setElementForShow()}hideFreezeFrame(){this.valid=!1,this.freezeFrame.setElementForHide()}updateFreezeFrameAndShow(e,t){this.freezeFrame.updateImageElementSource(e),this.freezeFrame.imageElement.onload=()=>{this.freezeFrame.setDimensionsFromElementAndResize(),t()}}processFreezeFrameMessage(e,t){this.receiving||(this.receiving=!0,this.valid=!1,this.size=0,this.jpeg=void 0),this.size=new DataView(e.slice(1,5).buffer).getInt32(0,!0);const n=e.slice(5);if(this.jpeg){const e=new Uint8Array(this.jpeg.length+n.length);e.set(this.jpeg,0),e.set(n,this.jpeg.length),this.jpeg=e}else this.jpeg=n,this.receiving=!0,au.Log(au.GetStackTrace(),`received first chunk of freeze frame: ${this.jpeg.length}/${this.size}`,6);this.jpeg.length===this.size?(this.receiving=!1,this.valid=!0,au.Log(au.GetStackTrace(),`received complete freeze frame ${this.size}`,6),this.updateFreezeFrameAndShow(this.jpeg,t)):this.jpeg.length>this.size&&(au.Error(au.GetStackTrace(),`received bigger freeze frame than advertised: ${this.jpeg.length}/${this.size}`),this.jpeg=void 0,this.receiving=!1)}}class xu{constructor(e,t,n,s,r=(()=>{})){this.onChange=r,this.onChangeEmit=()=>{},this.id=e,this.description=n,this.label=t,this.value=s}set label(e){this._label=e,this.onChangeEmit(this._value)}get label(){return this._label}get value(){return this._value}set value(e){this._value=e,this.onChange(this._value,this),this.onChangeEmit(this._value)}}class Pu extends xu{constructor(e,t,n,s,r,o=(()=>{})){super(e,t,n,s,o);const i=new URLSearchParams(window.location.search);if(r&&i.has(this.id)){const e=this.getUrlParamFlag();this.flag=e}else this.flag=s;this.useUrlParams=r}getUrlParamFlag(){const e=new URLSearchParams(window.location.search);return!!e.has(this.id)&&"false"!==e.get(this.id)&&"False"!==e.get(this.id)}updateURLParams(){if(this.useUrlParams){const e=new URLSearchParams(window.location.search);!0===this.flag?e.set(this.id,"true"):e.set(this.id,"false"),window.history.replaceState({},"",""!==e.toString()?`${location.pathname}?${e}`:`${location.pathname}`)}}enable(){this.flag=!0}get flag(){return!!this.value}set flag(e){this.value=e}}class Ru extends xu{constructor(e,t,n,s,r,o,i,a=(()=>{})){super(e,t,n,o,a),this._min=s,this._max=r;const l=new URLSearchParams(window.location.search);if(i&&l.has(this.id)){const e=Number.parseInt(l.get(this.id));this.number=Number.isNaN(e)?o:e}else this.number=o;this.useUrlParams=i}updateURLParams(){if(this.useUrlParams){const e=new URLSearchParams(window.location.search);e.set(this.id,this.number.toString()),window.history.replaceState({},"",""!==e.toString()?`${location.pathname}?${e}`:`${location.pathname}`)}}set number(e){this.value=this.clamp(e)}get number(){return this.value}clamp(e){return Math.max(Math.min(this._max,e),this._min)}get min(){return this._min}get max(){return this._max}addOnChangedListener(e){this.onChange=e}}class Lu extends xu{constructor(e,t,n,s,r,o=(()=>{})){super(e,t,n,s,o);const i=new URLSearchParams(window.location.search);if(r&&i.has(this.id)){const e=this.getUrlParamText();this.text=e}else this.text=s;this.useUrlParams=r}getUrlParamText(){var e;const t=new URLSearchParams(window.location.search);return t.has(this.id)&&null!==(e=t.get(this.id))&&void 0!==e?e:""}updateURLParams(){if(this.useUrlParams){const e=new URLSearchParams(window.location.search);e.set(this.id,this.text),window.history.replaceState({},"",""!==e.toString()?`${location.pathname}?${e}`:`${location.pathname}`)}}get text(){return this.value}set text(e){this.value=e}}class Au extends xu{constructor(e,t,n,s,r,o,i=(()=>{})){super(e,t,n,[s,s],i),this.options=r;const a=new URLSearchParams(window.location.search),l=o&&a.has(this.id)?this.getUrlParamText():s;this.selected=l,this.useUrlParams=o}getUrlParamText(){var e;const t=new URLSearchParams(window.location.search);return t.has(this.id)&&null!==(e=t.get(this.id))&&void 0!==e?e:""}updateURLParams(){if(this.useUrlParams){const e=new URLSearchParams(window.location.search);e.set(this.id,this.selected),window.history.replaceState({},"",""!==e.toString()?`${location.pathname}?${e}`:`${location.pathname}`)}}addOnChangedListener(e){this.onChange=e}get options(){return this._options}set options(e){this._options=e,this.onChangeEmit(this.selected)}get selected(){return this.value}set selected(e){let t=this.options.filter((t=>-1!==t.indexOf(e)));t.length?this.value=t[0]:(t=this.options.filter((t=>-1!==t.indexOf(e.split(" ")[0]))),t.length&&(this.value=t[0]))}}class Ou extends Event{constructor(e){super("afkWarningActivate"),this.data=e}}class Fu extends Event{constructor(e){super("afkWarningUpdate"),this.data=e}}class Iu extends Event{constructor(){super("afkWarningDeactivate")}}class Du extends Event{constructor(){super("afkTimedOut")}}class Bu extends Event{constructor(e){super("videoEncoderAvgQP"),this.data=e}}class zu extends Event{constructor(){super("webRtcSdp")}}class Uu extends Event{constructor(){super("webRtcAutoConnect")}}class Vu extends Event{constructor(){super("webRtcConnecting")}}class Nu extends Event{constructor(){super("webRtcConnected")}}class Hu extends Event{constructor(){super("webRtcFailed")}}class Gu extends Event{constructor(e){super("webRtcDisconnected"),this.data=e}}class $u extends Event{constructor(e){super("dataChannelOpen"),this.data=e}}class Wu extends Event{constructor(e){super("dataChannelClose"),this.data=e}}class ju extends Event{constructor(e){super("dataChannelError"),this.data=e}}class Ku extends Event{constructor(){super("videoInitialized")}}class qu extends Event{constructor(){super("streamLoading")}}class Qu extends Event{constructor(){super("streamConnect")}}class Xu extends Event{constructor(){super("streamDisconnect")}}class Ju extends Event{constructor(){super("streamReconnect")}}class Yu extends Event{constructor(e){super("playStreamError"),this.data=e}}class Zu extends Event{constructor(){super("playStream")}}class eh extends Event{constructor(e){super("playStreamRejected"),this.data=e}}class th extends Event{constructor(e){super("loadFreezeFrame"),this.data=e}}class nh extends Event{constructor(){super("hideFreezeFrame")}}class sh extends Event{constructor(e){super("statsReceived"),this.data=e}}class rh extends Event{constructor(e){super("streamerListMessage"),this.data=e}}class oh extends Event{constructor(e){super("latencyTestResult"),this.data=e}}class ih extends Event{constructor(e){super("dataChannelLatencyTestResponse"),this.data=e}}class ah extends Event{constructor(e){super("dataChannelLatencyTestResult"),this.data=e}}class lh extends Event{constructor(e){super("initialSettings"),this.data=e}}class ch extends Event{constructor(e){super("settingsChanged"),this.data=e}}class dh extends Event{constructor(){super("xrSessionStarted")}}class uh extends Event{constructor(){super("xrSessionEnded")}}class hh extends Event{constructor(e){super("xrFrame"),this.data=e}}class gh extends Event{constructor(e){super("playerCount"),this.data=e}}class mh extends EventTarget{dispatchEvent(e){return super.dispatchEvent(e)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}}class ph{}ph.AutoConnect="AutoConnect",ph.AutoPlayVideo="AutoPlayVideo",ph.AFKDetection="TimeoutIfIdle",ph.BrowserSendOffer="OfferToReceive",ph.HoveringMouseMode="HoveringMouse",ph.ForceMonoAudio="ForceMonoAudio",ph.ForceTURN="ForceTURN",ph.FakeMouseWithTouches="FakeMouseWithTouches",ph.IsQualityController="ControlsQuality",ph.MatchViewportResolution="MatchViewportRes",ph.StartVideoMuted="StartVideoMuted",ph.SuppressBrowserKeys="SuppressBrowserKeys",ph.UseMic="UseMic",ph.KeyboardInput="KeyboardInput",ph.MouseInput="MouseInput",ph.TouchInput="TouchInput",ph.GamepadInput="GamepadInput",ph.XRControllerInput="XRControllerInput",ph.WaitForStreamer="WaitForStreamer";const fh=e=>Object.getOwnPropertyNames(ph).some((t=>ph[t]===e));class vh{}vh.AFKTimeoutSecs="AFKTimeout",vh.MinQP="MinQP",vh.MaxQP="MaxQP",vh.WebRTCFPS="WebRTCFPS",vh.WebRTCMinBitrate="WebRTCMinBitrate",vh.WebRTCMaxBitrate="WebRTCMaxBitrate",vh.MaxReconnectAttempts="MaxReconnectAttempts",vh.StreamerAutoJoinInterval="StreamerAutoJoinInterval";const Sh=e=>Object.getOwnPropertyNames(vh).some((t=>vh[t]===e));class yh{}yh.SignallingServerUrl="ss";const bh=e=>Object.getOwnPropertyNames(yh).some((t=>yh[t]===e));class Ch{}Ch.PreferredCodec="PreferredCodec",Ch.StreamerId="StreamerId";const wh=e=>Object.getOwnPropertyNames(Ch).some((t=>Ch[t]===e));class Eh{constructor(e={}){this.flags=new Map,this.numericParameters=new Map,this.textParameters=new Map,this.optionParameters=new Map;const{initialSettings:t,useUrlParams:n}=e;this._useUrlParams=!!n,this.populateDefaultSettings(this._useUrlParams),t&&this.setSettings(t)}get useUrlParams(){return this._useUrlParams}populateDefaultSettings(e){this.textParameters.set(yh.SignallingServerUrl,new Lu(yh.SignallingServerUrl,"Signalling url","Url of the signalling server",("https:"===location.protocol?"wss://":"ws://")+window.location.hostname+("80"===window.location.port||""===window.location.port?"":`:${window.location.port}`),e)),this.optionParameters.set(Ch.StreamerId,new Au(Ch.StreamerId,"Streamer ID","The ID of the streamer to stream.","",[],e)),this.optionParameters.set(Ch.PreferredCodec,new Au(Ch.PreferredCodec,"Preferred Codec","The preferred codec to be used during codec negotiation","H264 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f",function(){const e=[];if(!RTCRtpReceiver.getCapabilities)return e.push("Only available on Chrome"),e;const t=/(VP\d|H26\d|AV1).*/;return RTCRtpReceiver.getCapabilities("video").codecs.forEach((n=>{const s=n.mimeType.split("/")[1]+" "+(n.sdpFmtpLine||"");null!==t.exec(s)&&e.push(s)})),e}(),e)),this.flags.set(ph.AutoConnect,new Pu(ph.AutoConnect,"Auto connect to stream","Whether we should attempt to auto connect to the signalling server or show a click to start prompt.",!1,e)),this.flags.set(ph.AutoPlayVideo,new Pu(ph.AutoPlayVideo,"Auto play video","When video is ready automatically start playing it as opposed to showing a play button.",!0,e)),this.flags.set(ph.BrowserSendOffer,new Pu(ph.BrowserSendOffer,"Browser send offer","Browser will initiate the WebRTC handshake by sending the offer to the streamer",!1,e)),this.flags.set(ph.UseMic,new Pu(ph.UseMic,"Use microphone","Make browser request microphone access and open an input audio track.",!1,e)),this.flags.set(ph.StartVideoMuted,new Pu(ph.StartVideoMuted,"Start video muted","Video will start muted if true.",!1,e)),this.flags.set(ph.SuppressBrowserKeys,new Pu(ph.SuppressBrowserKeys,"Suppress browser keys","Suppress certain browser keys that we use in UE, for example F5 to show shader complexity instead of refresh the page.",!0,e)),this.flags.set(ph.IsQualityController,new Pu(ph.IsQualityController,"Is quality controller?","True if this peer controls stream quality",!0,e)),this.flags.set(ph.ForceMonoAudio,new Pu(ph.ForceMonoAudio,"Force mono audio","Force browser to request mono audio in the SDP",!1,e)),this.flags.set(ph.ForceTURN,new Pu(ph.ForceTURN,"Force TURN","Only generate TURN/Relayed ICE candidates.",!1,e)),this.flags.set(ph.AFKDetection,new Pu(ph.AFKDetection,"AFK if idle","Timeout the experience if user is AFK for a period.",!1,e)),this.flags.set(ph.MatchViewportResolution,new Pu(ph.MatchViewportResolution,"Match viewport resolution","Pixel Streaming will be instructed to dynamically resize the video stream to match the size of the video element.",!1,e)),this.flags.set(ph.HoveringMouseMode,new Pu(ph.HoveringMouseMode,"Control Scheme: Locked Mouse","Either locked mouse, where the pointer is consumed by the video and locked to it, or hovering mouse, where the mouse is not consumed.",!1,e,((e,t)=>{t.label=`Control Scheme: ${e?"Hovering":"Locked"} Mouse`}))),this.flags.set(ph.FakeMouseWithTouches,new Pu(ph.FakeMouseWithTouches,"Fake mouse with touches","A single finger touch is converted into a mouse event. This allows a non-touch application to be controlled partially via a touch device.",!1,e)),this.flags.set(ph.KeyboardInput,new Pu(ph.KeyboardInput,"Keyboard input","If enabled, send keyboard events to streamer",!0,e)),this.flags.set(ph.MouseInput,new Pu(ph.MouseInput,"Mouse input","If enabled, send mouse events to streamer",!0,e)),this.flags.set(ph.TouchInput,new Pu(ph.TouchInput,"Touch input","If enabled, send touch events to streamer",!0,e)),this.flags.set(ph.GamepadInput,new Pu(ph.GamepadInput,"Gamepad input","If enabled, send gamepad events to streamer",!0,e)),this.flags.set(ph.XRControllerInput,new Pu(ph.XRControllerInput,"XR controller input","If enabled, send XR controller events to streamer",!0,e)),this.flags.set(ph.WaitForStreamer,new Pu(ph.WaitForStreamer,"等待拖缆","将继续尝试连接到第一个可用的流媒体.",!0,e)),this.numericParameters.set(vh.AFKTimeoutSecs,new Ru(vh.AFKTimeoutSecs,"AFK timeout","The time (in seconds) it takes for the application to time out if AFK timeout is enabled.",0,600,120,e)),this.numericParameters.set(vh.MaxReconnectAttempts,new Ru(vh.MaxReconnectAttempts,"Max Reconnects","Maximum number of reconnects the application will attempt when a streamer disconnects.",0,999,3,e)),this.numericParameters.set(vh.MinQP,new Ru(vh.MinQP,"Min QP","The lower bound for the quantization parameter (QP) of the encoder. 0 = Best quality, 51 = worst quality.",0,51,0,e)),this.numericParameters.set(vh.MaxQP,new Ru(vh.MaxQP,"Max QP","The upper bound for the quantization parameter (QP) of the encoder. 0 = Best quality, 51 = worst quality.",0,51,51,e)),this.numericParameters.set(vh.WebRTCFPS,new Ru(vh.WebRTCFPS,"Max FPS","The maximum FPS that WebRTC will try to transmit frames at.",1,999,60,e)),this.numericParameters.set(vh.WebRTCMinBitrate,new Ru(vh.WebRTCMinBitrate,"Min Bitrate (kbps)","The minimum bitrate that WebRTC should use.",0,5e5,0,e)),this.numericParameters.set(vh.WebRTCMaxBitrate,new Ru(vh.WebRTCMaxBitrate,"Max Bitrate (kbps)","The maximum bitrate that WebRTC should use.",0,5e5,0,e)),this.numericParameters.set(vh.StreamerAutoJoinInterval,new Ru(vh.StreamerAutoJoinInterval,"Streamer Auto Join Interval (ms)","Delay between retries when waiting for an available streamer.",500,9e5,3e3,e))}_addOnNumericSettingChangedListener(e,t){this.numericParameters.has(e)&&this.numericParameters.get(e).addOnChangedListener(t)}_addOnOptionSettingChangedListener(e,t){this.optionParameters.has(e)&&this.optionParameters.get(e).addOnChangedListener(t)}getNumericSettingValue(e){if(this.numericParameters.has(e))return this.numericParameters.get(e).number;throw new Error(`There is no numeric setting with the id of ${e}`)}getTextSettingValue(e){if(this.textParameters.has(e))return this.textParameters.get(e).value;throw new Error(`There is no numeric setting with the id of ${e}`)}setNumericSetting(e,t){if(!this.numericParameters.has(e))throw new Error(`There is no numeric setting with the id of ${e}`);this.numericParameters.get(e).number=t}_addOnSettingChangedListener(e,t){this.flags.has(e)&&(this.flags.get(e).onChange=t)}_addOnTextSettingChangedListener(e,t){this.textParameters.has(e)&&(this.textParameters.get(e).onChange=t)}getSettingOption(e){return this.optionParameters.get(e)}isFlagEnabled(e){return this.flags.get(e).flag}setFlagEnabled(e,t){this.flags.has(e)?this.flags.get(e).flag=t:au.Warning(au.GetStackTrace(),`Cannot toggle flag called ${e} - it does not exist in the Config.flags map.`)}setTextSetting(e,t){this.textParameters.has(e)?this.textParameters.get(e).text=t:au.Warning(au.GetStackTrace(),`Cannot set text setting called ${e} - it does not exist in the Config.textParameters map.`)}setOptionSettingOptions(e,t){this.optionParameters.has(e)?(console.log(t),this.optionParameters.get(e).options=t):au.Warning(au.GetStackTrace(),`Cannot set text setting called ${e} - it does not exist in the Config.optionParameters map.`)}setOptionSettingValue(e,t){this.optionParameters.has(e)?this.optionParameters.get(e).selected=t:au.Warning(au.GetStackTrace(),`Cannot set text setting called ${e} - it does not exist in the Config.enumParameters map.`)}setFlagLabel(e,t){this.flags.has(e)?this.flags.get(e).label=t:au.Warning(au.GetStackTrace(),`Cannot set label for flag called ${e} - it does not exist in the Config.flags map.`)}setSettings(e){for(const t of Object.keys(e))fh(t)?this.setFlagEnabled(t,e[t]):Sh(t)?this.setNumericSetting(t,e[t]):bh(t)?this.setTextSetting(t,e[t]):wh(t)&&this.setOptionSettingValue(t,e[t])}getSettings(){const e={};for(const[t,n]of this.flags.entries())e[t]=n.flag;for(const[t,n]of this.numericParameters.entries())e[t]=n.number;for(const[t,n]of this.textParameters.entries())e[t]=n.text;for(const[t,n]of this.optionParameters.entries())e[t]=n.selected;return e}getFlags(){return Array.from(this.flags.values())}getTextSettings(){return Array.from(this.textParameters.values())}getNumericSettings(){return Array.from(this.numericParameters.values())}getOptionSettings(){return Array.from(this.optionParameters.values())}_registerOnChangeEvents(e){for(const t of this.flags.keys()){const n=this.flags.get(t);n&&(n.onChangeEmit=t=>e.dispatchEvent(new ch({id:n.id,type:"flag",value:t,target:n})))}for(const t of this.numericParameters.keys()){const n=this.numericParameters.get(t);n&&(n.onChangeEmit=t=>e.dispatchEvent(new ch({id:n.id,type:"number",value:t,target:n})))}for(const t of this.textParameters.keys()){const n=this.textParameters.get(t);n&&(n.onChangeEmit=t=>e.dispatchEvent(new ch({id:n.id,type:"text",value:t,target:n})))}for(const t of this.optionParameters.keys()){const n=this.optionParameters.get(t);n&&(n.onChangeEmit=t=>e.dispatchEvent(new ch({id:n.id,type:"option",value:t,target:n})))}}}var Th;!function(e){e[e.LockedMouse=0]="LockedMouse",e[e.HoveringMouse=1]="HoveringMouse"}(Th||(Th={}));class Mh{constructor(e,t,n){this.closeTimeout=10,this.active=!1,this.countdownActive=!1,this.warnTimer=void 0,this.countDown=0,this.countDownTimer=void 0,this.config=e,this.pixelStreaming=t,this.onDismissAfk=n,this.onAFKTimedOutCallback=()=>{console.log("AFK timed out, did you want to override this callback?")}}onAfkClick(){clearInterval(this.countDownTimer),(this.active||this.countdownActive)&&(this.startAfkWarningTimer(),this.pixelStreaming.dispatchEvent(new Iu))}startAfkWarningTimer(){this.config.getNumericSettingValue(vh.AFKTimeoutSecs)>0&&this.config.isFlagEnabled(ph.AFKDetection)?this.active=!0:this.active=!1,this.resetAfkWarningTimer()}stopAfkWarningTimer(){this.active=!1,this.countdownActive=!1,clearTimeout(this.warnTimer),clearInterval(this.countDownTimer)}pauseAfkWarningTimer(){this.active=!1}resetAfkWarningTimer(){this.active&&this.config.isFlagEnabled(ph.AFKDetection)&&(clearTimeout(this.warnTimer),this.warnTimer=setTimeout((()=>this.activateAfkEvent()),1e3*this.config.getNumericSettingValue(vh.AFKTimeoutSecs)))}activateAfkEvent(){this.pauseAfkWarningTimer(),this.pixelStreaming.dispatchEvent(new Ou({countDown:this.countDown,dismissAfk:this.onDismissAfk})),this.countDown=this.closeTimeout,this.countdownActive=!0,this.pixelStreaming.dispatchEvent(new Fu({countDown:this.countDown})),this.config.isFlagEnabled(ph.HoveringMouseMode)||document.exitPointerLock&&document.exitPointerLock(),this.countDownTimer=setInterval((()=>{this.countDown--,0==this.countDown?(this.pixelStreaming.dispatchEvent(new Du),this.onAFKTimedOutCallback(),au.Log(au.GetStackTrace(),"You have been disconnected due to inactivity"),this.stopAfkWarningTimer()):this.pixelStreaming.dispatchEvent(new Fu({countDown:this.countDown}))}),1e3)}}class _h{constructor(){this.isReceivingFreezeFrame=!1}getDataChannelInstance(){return this}createDataChannel(e,t,n){this.peerConnection=e,this.label=t,this.datachannelOptions=n,null==n&&(this.datachannelOptions={},this.datachannelOptions.ordered=!0),this.dataChannel=this.peerConnection.createDataChannel(this.label,this.datachannelOptions),this.setupDataChannel()}setupDataChannel(){this.dataChannel.binaryType="arraybuffer",this.dataChannel.onopen=e=>this.handleOnOpen(e),this.dataChannel.onclose=e=>this.handleOnClose(e),this.dataChannel.onmessage=e=>this.handleOnMessage(e),this.dataChannel.onerror=e=>this.handleOnError(e)}handleOnOpen(e){var t;au.Log(au.GetStackTrace(),`Data Channel (${this.label}) opened.`,7),this.onOpen(null===(t=this.dataChannel)||void 0===t?void 0:t.label,e)}handleOnClose(e){var t;au.Log(au.GetStackTrace(),`Data Channel (${this.label}) closed.`,7),this.onClose(null===(t=this.dataChannel)||void 0===t?void 0:t.label,e)}handleOnMessage(e){au.Log(au.GetStackTrace(),`Data Channel (${this.label}) message: ${e}`,8)}handleOnError(e){var t;au.Log(au.GetStackTrace(),`Data Channel (${this.label}) error: ${e}`,7),this.onError(null===(t=this.dataChannel)||void 0===t?void 0:t.label,e)}onOpen(e,t){}onClose(e,t){}onError(e,t){}}class kh{}class xh{}class Ph{}class Rh{}class Lh{}class Ah{}class Oh{}class Fh{}class Ih{constructor(){this.inboundVideoStats=new xh,this.inboundAudioStats=new kh,this.candidatePair=new Lh,this.DataChannelStats=new Ph,this.outBoundVideoStats=new Ah,this.sessionStats=new Oh,this.streamStats=new Fh,this.codecs=new Map}processStats(e){this.localCandidates=new Array,this.remoteCandidates=new Array,e.forEach((e=>{switch(e.type){case"candidate-pair":this.handleCandidatePair(e);break;case"certificate":case"media-source":case"media-playout":case"outbound-rtp":case"peer-connection":case"remote-inbound-rtp":case"transport":break;case"codec":this.handleCodec(e);break;case"data-channel":this.handleDataChannel(e);break;case"inbound-rtp":this.handleInBoundRTP(e);break;case"local-candidate":this.handleLocalCandidate(e);break;case"remote-candidate":this.handleRemoteCandidate(e);break;case"remote-outbound-rtp":this.handleRemoteOutBound(e);break;case"track":this.handleTrack(e);break;case"stream":this.handleStream(e);break;default:au.Error(au.GetStackTrace(),"unhandled Stat Type"),au.Log(au.GetStackTrace(),e)}}))}handleStream(e){this.streamStats=e}handleCandidatePair(e){this.candidatePair.bytesReceived=e.bytesReceived,this.candidatePair.bytesSent=e.bytesSent,this.candidatePair.localCandidateId=e.localCandidateId,this.candidatePair.remoteCandidateId=e.remoteCandidateId,this.candidatePair.nominated=e.nominated,this.candidatePair.readable=e.readable,this.candidatePair.selected=e.selected,this.candidatePair.writable=e.writable,this.candidatePair.state=e.state,this.candidatePair.currentRoundTripTime=e.currentRoundTripTime}handleDataChannel(e){this.DataChannelStats.bytesReceived=e.bytesReceived,this.DataChannelStats.bytesSent=e.bytesSent,this.DataChannelStats.dataChannelIdentifier=e.dataChannelIdentifier,this.DataChannelStats.id=e.id,this.DataChannelStats.label=e.label,this.DataChannelStats.messagesReceived=e.messagesReceived,this.DataChannelStats.messagesSent=e.messagesSent,this.DataChannelStats.protocol=e.protocol,this.DataChannelStats.state=e.state,this.DataChannelStats.timestamp=e.timestamp}handleLocalCandidate(e){const t=new Rh;t.label="local-candidate",t.address=e.address,t.port=e.port,t.protocol=e.protocol,t.candidateType=e.candidateType,t.id=e.id,this.localCandidates.push(t)}handleRemoteCandidate(e){const t=new Rh;t.label="local-candidate",t.address=e.address,t.port=e.port,t.protocol=e.protocol,t.id=e.id,t.candidateType=e.candidateType,this.remoteCandidates.push(t)}handleInBoundRTP(e){switch(e.kind){case"video":this.inboundVideoStats=e,null!=this.lastVideoStats&&(this.inboundVideoStats.bitrate=8*(this.inboundVideoStats.bytesReceived-this.lastVideoStats.bytesReceived)/(this.inboundVideoStats.timestamp-this.lastVideoStats.timestamp),this.inboundVideoStats.bitrate=Math.floor(this.inboundVideoStats.bitrate)),this.lastVideoStats=Object.assign({},this.inboundVideoStats);break;case"audio":this.inboundAudioStats=e,null!=this.lastAudioStats&&(this.inboundAudioStats.bitrate=8*(this.inboundAudioStats.bytesReceived-this.lastAudioStats.bytesReceived)/(this.inboundAudioStats.timestamp-this.lastAudioStats.timestamp),this.inboundAudioStats.bitrate=Math.floor(this.inboundAudioStats.bitrate)),this.lastAudioStats=Object.assign({},this.inboundAudioStats);break;default:au.Log(au.GetStackTrace(),"Kind is not handled")}}handleRemoteOutBound(e){"video"===e.kind&&(this.outBoundVideoStats.bytesSent=e.bytesSent,this.outBoundVideoStats.id=e.id,this.outBoundVideoStats.localId=e.localId,this.outBoundVideoStats.packetsSent=e.packetsSent,this.outBoundVideoStats.remoteTimestamp=e.remoteTimestamp,this.outBoundVideoStats.timestamp=e.timestamp)}handleTrack(e){"track"!==e.type||"video_label"!==e.trackIdentifier&&"video"!==e.kind||(this.inboundVideoStats.framesDropped=e.framesDropped,this.inboundVideoStats.framesReceived=e.framesReceived,this.inboundVideoStats.frameHeight=e.frameHeight,this.inboundVideoStats.frameWidth=e.frameWidth)}handleCodec(e){const t=e.id,n=`${e.mimeType.replace("video/","").replace("audio/","")}${e.sdpFmtpLine?` ${e.sdpFmtpLine}`:""}`;this.codecs.set(t,n)}handleSessionStatistics(e,t,n){const s=Date.now()-e;this.sessionStats.runTime=new Date(s).toISOString().substr(11,8).toString();const r=null===t?"Not sent yet":t?"true":"false";this.sessionStats.controlsStreamInput=r,this.sessionStats.videoEncoderAvgQP=n}isNumber(e){return"number"==typeof e&&isFinite(e)}}const Dh=(Bh={parseRtpParameters:()=>e.parseRtpParameters,splitSections:()=>e.splitSections},zh={},t.d(zh,Bh),zh);var Bh,zh;class Uh{static isVideoTransciever(e){return this.canTransceiverReceiveVideo(e)||this.canTransceiverSendVideo(e)}static canTransceiverReceiveVideo(e){return!!e&&("sendrecv"===e.direction||"recvonly"===e.direction)&&e.receiver&&e.receiver.track&&"video"===e.receiver.track.kind}static canTransceiverSendVideo(e){return!!e&&("sendrecv"===e.direction||"sendonly"===e.direction)&&e.sender&&e.sender.track&&"video"===e.sender.track.kind}static isAudioTransciever(e){return this.canTransceiverReceiveAudio(e)||this.canTransceiverSendAudio(e)}static canTransceiverReceiveAudio(e){return!!e&&("sendrecv"===e.direction||"recvonly"===e.direction)&&e.receiver&&e.receiver.track&&"audio"===e.receiver.track.kind}static canTransceiverSendAudio(e){return!!e&&("sendrecv"===e.direction||"sendonly"===e.direction)&&e.sender&&e.sender.track&&"audio"===e.sender.track.kind}}var Vh,Nh,Hh=function(e,t,n,s){return new(n||(n=Promise))((function(r,o){function i(e){try{l(s.next(e))}catch(e){o(e)}}function a(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}l((s=s.apply(e,t||[])).next())}))};class Gh{constructor(e,t,n){this.config=t,this.createPeerConnection(e,n)}createPeerConnection(e,t){this.config.isFlagEnabled(ph.ForceTURN)&&(e.iceTransportPolicy="relay",au.Log(au.GetStackTrace(),"Forcing TURN usage by setting ICE Transport Policy in peer connection config.")),this.peerConnection=new RTCPeerConnection(e),this.peerConnection.onsignalingstatechange=e=>this.handleSignalStateChange(e),this.peerConnection.oniceconnectionstatechange=e=>this.handleIceConnectionStateChange(e),this.peerConnection.onicegatheringstatechange=e=>this.handleIceGatheringStateChange(e),this.peerConnection.ontrack=e=>this.handleOnTrack(e),this.peerConnection.onicecandidate=e=>this.handleIceCandidate(e),this.peerConnection.ondatachannel=e=>this.handleDataChannel(e),this.aggregatedStats=new Ih,this.preferredCodec=t,this.updateCodecSelection=!0}createOffer(e,t){return Hh(this,void 0,void 0,(function*(){au.Log(au.GetStackTrace(),"Create Offer",6);const n="localhost"===location.hostname||"127.0.0.1"===location.hostname,s="https:"===location.protocol;let r=t.isFlagEnabled(ph.UseMic);!r||n||s||(r=!1,au.Error(au.GetStackTrace(),"Microphone access in the browser will not work if you are not on HTTPS or localhost. Disabling mic access."),au.Error(au.GetStackTrace(),"For testing you can enable HTTP microphone access Chrome by visiting chrome://flags/ and enabling 'unsafely-treat-insecure-origin-as-secure'")),this.setupTransceiversAsync(r).finally((()=>{var t;null===(t=this.peerConnection)||void 0===t||t.createOffer(e).then((e=>{var t;this.showTextOverlayConnecting(),e.sdp=this.mungeSDP(e.sdp,r),null===(t=this.peerConnection)||void 0===t||t.setLocalDescription(e),this.onSendWebRTCOffer(e)})).catch((()=>{this.showTextOverlaySetupFailure()}))}))}))}receiveOffer(e,t){var n;return Hh(this,void 0,void 0,(function*(){au.Log(au.GetStackTrace(),"Receive Offer",6),null===(n=this.peerConnection)||void 0===n||n.setRemoteDescription(e).then((()=>{const e="localhost"===location.hostname||"127.0.0.1"===location.hostname,n="https:"===location.protocol;let s=t.isFlagEnabled(ph.UseMic);!s||e||n||(s=!1,au.Error(au.GetStackTrace(),"Microphone access in the browser will not work if you are not on HTTPS or localhost. Disabling mic access."),au.Error(au.GetStackTrace(),"For testing you can enable HTTP microphone access Chrome by visiting chrome://flags/ and enabling 'unsafely-treat-insecure-origin-as-secure'")),this.setupTransceiversAsync(s).finally((()=>{var e;null===(e=this.peerConnection)||void 0===e||e.createAnswer().then((e=>{var t;return e.sdp=this.mungeSDP(e.sdp,s),null===(t=this.peerConnection)||void 0===t?void 0:t.setLocalDescription(e)})).then((()=>{var e;this.onSendWebRTCAnswer(null===(e=this.peerConnection)||void 0===e?void 0:e.currentLocalDescription)})).catch((()=>{au.Error(au.GetStackTrace(),"createAnswer() failed")}))}))})),this.config.setOptionSettingOptions(Ch.PreferredCodec,this.parseAvailableCodecs(e).filter((e=>this.config.getSettingOption(Ch.PreferredCodec).options.includes(e))))}))}receiveAnswer(e){var t;null===(t=this.peerConnection)||void 0===t||t.setRemoteDescription(e),this.config.setOptionSettingOptions(Ch.PreferredCodec,this.parseAvailableCodecs(e).filter((e=>this.config.getSettingOption(Ch.PreferredCodec).options.includes(e))))}generateStats(){var e;null===(e=this.peerConnection)||void 0===e||e.getStats(null).then((e=>{this.aggregatedStats.processStats(e),this.onVideoStats(this.aggregatedStats),this.updateCodecSelection&&this.config.setOptionSettingValue(Ch.PreferredCodec,this.aggregatedStats.codecs.get(this.aggregatedStats.inboundVideoStats.codecId))}))}close(){this.peerConnection&&(this.peerConnection.close(),this.peerConnection=null)}mungeSDP(e,t){let n=e.replace(/(a=fmtp:\d+ .*level-asymmetry-allowed=.*)\r\n/gm,"$1;x-google-start-bitrate=10000;x-google-max-bitrate=100000\r\n"),s="maxaveragebitrate=510000;";return t&&(s+="sprop-maxcapturerate=48000;"),s+=this.config.isFlagEnabled(ph.ForceMonoAudio)?"stereo=0;":"stereo=1;",s+="useinbandfec=1",n=n.replace("useinbandfec=1",s),n}handleOnIce(e){var t;au.Log(au.GetStackTrace(),"peerconnection handleOnIce",6),this.config.isFlagEnabled(ph.ForceTURN)&&e.candidate.indexOf("relay")<0?au.Info(au.GetStackTrace(),`Dropping candidate because it was not TURN relay. | Type= ${e.type} | Protocol= ${e.protocol} | Address=${e.address} | Port=${e.port} |`,6):null===(t=this.peerConnection)||void 0===t||t.addIceCandidate(e)}handleSignalStateChange(e){au.Log(au.GetStackTrace(),"signaling state change: "+e,6)}handleIceConnectionStateChange(e){au.Log(au.GetStackTrace(),"ice connection state change: "+e,6),this.onIceConnectionStateChange(e)}handleIceGatheringStateChange(e){au.Log(au.GetStackTrace(),"ice gathering state change: "+JSON.stringify(e),6)}handleOnTrack(e){this.onTrack(e)}handleIceCandidate(e){this.onPeerIceCandidate(e)}handleDataChannel(e){this.onDataChannel(e)}onTrack(e){}onIceConnectionStateChange(e){}onPeerIceCandidate(e){}onDataChannel(e){}setupTransceiversAsync(e){var t,n,s,r,o,i,a,l,c;return Hh(this,void 0,void 0,(function*(){const d=(null===(t=this.peerConnection)||void 0===t?void 0:t.getTransceivers().length)>0;if(null===(n=this.peerConnection)||void 0===n||n.addTransceiver("video",{direction:"recvonly"}),RTCRtpReceiver.getCapabilities&&""!=this.preferredCodec)for(const e of null!==(r=null===(s=this.peerConnection)||void 0===s?void 0:s.getTransceivers())&&void 0!==r?r:[])if(e&&e.receiver&&e.receiver.track&&"video"===e.receiver.track.kind&&e.setCodecPreferences){const t=this.preferredCodec.split(" "),n=[{mimeType:"video/"+t[0],clockRate:9e4,sdpFmtpLine:t[1]?t[1]:""}];this.config.getSettingOption(Ch.PreferredCodec).options.filter((e=>e!=this.preferredCodec)).forEach((e=>{const t=e.split(" ");n.push({mimeType:"video/"+t[0],clockRate:9e4,sdpFmtpLine:t[1]?t[1]:""})}));for(const e of n)""===e.sdpFmtpLine&&delete e.sdpFmtpLine;e.setCodecPreferences(n)}if(e){const e={video:!1,audio:{autoGainControl:!1,channelCount:1,echoCancellation:!1,latency:0,noiseSuppression:!1,sampleRate:48e3,sampleSize:16,volume:1}},t=yield navigator.mediaDevices.getUserMedia(e);if(t)if(d){for(const e of null!==(a=null===(i=this.peerConnection)||void 0===i?void 0:i.getTransceivers())&&void 0!==a?a:[])if(Uh.canTransceiverReceiveAudio(e))for(const n of t.getTracks())n.kind&&"audio"==n.kind&&(e.sender.replaceTrack(n),e.direction="sendrecv")}else for(const e of t.getTracks())e.kind&&"audio"==e.kind&&(null===(l=this.peerConnection)||void 0===l||l.addTransceiver(e,{direction:"sendrecv"}));else null===(c=this.peerConnection)||void 0===c||c.addTransceiver("audio",{direction:"recvonly"})}else null===(o=this.peerConnection)||void 0===o||o.addTransceiver("audio",{direction:"recvonly"})}))}onVideoStats(e){}onSendWebRTCOffer(e){}onSendWebRTCAnswer(e){}showTextOverlayConnecting(){}showTextOverlaySetupFailure(){}parseAvailableCodecs(e){if(!RTCRtpReceiver.getCapabilities)return["Only available on Chrome"];const t=[],n=(0,Dh.splitSections)(e.sdp);return n.shift(),n.forEach((e=>{const{codecs:n}=(0,Dh.parseRtpParameters)(e),s=/(VP\d|H26\d|AV1).*/;n.forEach((e=>{const n=e.name+" "+Object.keys(e.parameters||{}).map((t=>t+"="+e.parameters[t])).join(";");if(null!==s.exec(n)){"VP9"==e.name&&(e.parameters={"profile-id":"0"});const n=e.name+" "+Object.keys(e.parameters||{}).map((t=>t+"="+e.parameters[t])).join(";");t.push(n)}}))})),t}}class $h{constructor(){this.PixelStreamingSettings=new Wh,this.EncoderSettings=new jh,this.WebRTCSettings=new Kh}ueCompatible(){null!=this.WebRTCSettings.MaxFPS&&(this.WebRTCSettings.FPS=this.WebRTCSettings.MaxFPS)}}class Wh{}class jh{}class Kh{}class qh{constructor(){this.ReceiptTimeMs=null,this.TransmissionTimeMs=null,this.PreCaptureTimeMs=null,this.PostCaptureTimeMs=null,this.PreEncodeTimeMs=null,this.PostEncodeTimeMs=null,this.EncodeMs=null,this.CaptureToSendMs=null,this.testStartTimeMs=0,this.browserReceiptTimeMs=0,this.latencyExcludingDecode=0,this.testDuration=0,this.networkLatency=0,this.browserSendLatency=0,this.frameDisplayDeltaTimeMs=0,this.endToEndLatency=0,this.encodeLatency=0}setFrameDisplayDeltaTime(e){0==this.frameDisplayDeltaTimeMs&&(this.frameDisplayDeltaTimeMs=Math.round(e))}processFields(){null!=this.EncodeMs||null==this.PreEncodeTimeMs&&null==this.PostEncodeTimeMs||(au.Log(au.GetStackTrace(),`Setting Encode Ms \n ${this.PostEncodeTimeMs} \n ${this.PreEncodeTimeMs}`,6),this.EncodeMs=this.PostEncodeTimeMs-this.PreEncodeTimeMs),null!=this.CaptureToSendMs||null==this.PreCaptureTimeMs&&null==this.PostCaptureTimeMs||(au.Log(au.GetStackTrace(),`Setting CaptureToSendMs Ms \n ${this.PostCaptureTimeMs} \n ${this.PreCaptureTimeMs}`,6),this.CaptureToSendMs=this.PostCaptureTimeMs-this.PreCaptureTimeMs)}}class Qh{static setExtensionFromBytes(e,t){t.receiving||(t.mimetype="",t.extension="",t.receiving=!0,t.valid=!1,t.size=0,t.data=[],t.timestampStart=(new Date).getTime(),au.Log(au.GetStackTrace(),"Received first chunk of file",6));const n=new TextDecoder("utf-16").decode(e.slice(1));au.Log(au.GetStackTrace(),n,6),t.extension=n}static setMimeTypeFromBytes(e,t){t.receiving||(t.mimetype="",t.extension="",t.receiving=!0,t.valid=!1,t.size=0,t.data=[],t.timestampStart=(new Date).getTime(),au.Log(au.GetStackTrace(),"Received first chunk of file",6));const n=new TextDecoder("utf-16").decode(e.slice(1));au.Log(au.GetStackTrace(),n,6),t.mimetype=n}static setContentsFromBytes(e,t){if(!t.receiving)return;t.size=Math.ceil(new DataView(e.slice(1,5).buffer).getInt32(0,!0)/16379);const n=e.slice(5);if(t.data.push(n),au.Log(au.GetStackTrace(),`Received file chunk: ${t.data.length}/${t.size}`,6),t.data.length===t.size){t.receiving=!1,t.valid=!0,au.Log(au.GetStackTrace(),"Received complete file",6);const e=(new Date).getTime()-t.timestampStart,n=Math.round(16*t.size*1024/e);au.Log(au.GetStackTrace(),`Average transfer bitrate: ${n}kb/s over ${e/1e3} seconds`,6);const s=new Blob(t.data,{type:t.mimetype}),r=document.createElement("a");r.setAttribute("href",URL.createObjectURL(s)),r.setAttribute("download",`transfer.${t.extension}`),document.body.append(r),r.remove()}else t.data.length>t.size&&(t.receiving=!1,au.Error(au.GetStackTrace(),`Received bigger file than advertised: ${t.data.length}/${t.size}`))}}class Xh{constructor(){this.mimetype="",this.extension="",this.receiving=!1,this.size=0,this.data=[],this.valid=!1}}class Jh{}Jh.mainButton=0,Jh.auxiliaryButton=1,Jh.secondaryButton=2,Jh.fourthButton=3,Jh.fifthButton=4;class Yh{}Yh.primaryButton=1,Yh.secondaryButton=2,Yh.auxiliaryButton=4,Yh.fourthButton=8,Yh.fifthButton=16;class Zh{constructor(){this.unregisterCallbacks=[]}addUnregisterCallback(e){this.unregisterCallbacks.push(e)}unregisterAll(){for(const e of this.unregisterCallbacks)e();this.unregisterCallbacks=[]}}class eg{constructor(e,t,n){this.touchEventListenerTracker=new Zh,this.toStreamerMessagesProvider=e,this.videoElementProvider=t,this.coordinateConverter=n;const s=e=>this.onTouchStart(e),r=e=>this.onTouchEnd(e),o=e=>this.onTouchMove(e);document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchend",r,{passive:!1}),document.addEventListener("touchmove",o,{passive:!1}),this.touchEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("touchstart",s))),this.touchEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("touchend",r))),this.touchEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("touchmove",o)))}unregisterTouchEvents(){this.touchEventListenerTracker.unregisterAll()}setVideoElementParentClientRect(e){this.videoElementParentClientRect=e}onTouchStart(e){if(this.videoElementProvider.isVideoReady()){if(null==this.fakeTouchFinger){const t=e.changedTouches[0];this.fakeTouchFinger=new tg(t.identifier,t.clientX-this.videoElementParentClientRect.left,t.clientY-this.videoElementParentClientRect.top);const n=this.videoElementProvider.getVideoParentElement(),s=new MouseEvent("mouseenter",t);n.dispatchEvent(s);const r=this.coordinateConverter.normalizeAndQuantizeUnsigned(this.fakeTouchFinger.x,this.fakeTouchFinger.y);this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDown")([Jh.mainButton,r.x,r.y])}e.preventDefault()}}onTouchEnd(e){if(!this.videoElementProvider.isVideoReady())return;const t=this.videoElementProvider.getVideoParentElement(),n=this.toStreamerMessagesProvider.toStreamerHandlers;for(let s=0;s<e.changedTouches.length;s++){const r=e.changedTouches[s];if(r.identifier===this.fakeTouchFinger.id){const e=r.clientX-this.videoElementParentClientRect.left,s=r.clientY-this.videoElementParentClientRect.top,o=this.coordinateConverter.normalizeAndQuantizeUnsigned(e,s);n.get("MouseUp")([Jh.mainButton,o.x,o.y]);const i=new MouseEvent("mouseleave",r);t.dispatchEvent(i),this.fakeTouchFinger=null;break}}e.preventDefault()}onTouchMove(e){if(!this.videoElementProvider.isVideoReady())return;const t=this.toStreamerMessagesProvider.toStreamerHandlers;for(let n=0;n<e.touches.length;n++){const s=e.touches[n];if(s.identifier===this.fakeTouchFinger.id){const e=s.clientX-this.videoElementParentClientRect.left,n=s.clientY-this.videoElementParentClientRect.top,r=this.coordinateConverter.normalizeAndQuantizeUnsigned(e,n),o=this.coordinateConverter.normalizeAndQuantizeSigned(e-this.fakeTouchFinger.x,n-this.fakeTouchFinger.y);t.get("MouseMove")([r.x,r.y,o.x,o.y]),this.fakeTouchFinger.x=e,this.fakeTouchFinger.y=n;break}}e.preventDefault()}}class tg{constructor(e,t,n){this.id=e,this.x=t,this.y=n}}class ng{}ng.backSpace=8,ng.shift=16,ng.control=17,ng.alt=18,ng.rightShift=253,ng.rightControl=254,ng.rightAlt=255;class sg{constructor(e,t,n){this.keyboardEventListenerTracker=new Zh,this.CodeToKeyCode={Escape:27,Digit0:48,Digit1:49,Digit2:50,Digit3:51,Digit4:52,Digit5:53,Digit6:54,Digit7:55,Digit8:56,Digit9:57,Minus:173,Equal:187,Backspace:8,Tab:9,KeyQ:81,KeyW:87,KeyE:69,KeyR:82,KeyT:84,KeyY:89,KeyU:85,KeyI:73,KeyO:79,KeyP:80,BracketLeft:219,BracketRight:221,Enter:13,ControlLeft:17,KeyA:65,KeyS:83,KeyD:68,KeyF:70,KeyG:71,KeyH:72,KeyJ:74,KeyK:75,KeyL:76,Semicolon:186,Quote:222,Backquote:192,ShiftLeft:16,Backslash:220,KeyZ:90,KeyX:88,KeyC:67,KeyV:86,KeyB:66,KeyN:78,KeyM:77,Comma:188,Period:190,Slash:191,ShiftRight:253,AltLeft:18,Space:32,CapsLock:20,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,Pause:19,ScrollLock:145,NumpadDivide:111,NumpadMultiply:106,NumpadSubtract:109,NumpadAdd:107,NumpadDecimal:110,Numpad9:105,Numpad8:104,Numpad7:103,Numpad6:102,Numpad5:101,Numpad4:100,Numpad3:99,Numpad2:98,Numpad1:97,Numpad0:96,NumLock:144,ControlRight:254,AltRight:255,Home:36,End:35,ArrowUp:38,ArrowLeft:37,ArrowRight:39,ArrowDown:40,PageUp:33,PageDown:34,Insert:45,Delete:46,ContextMenu:93},this.toStreamerMessagesProvider=e,this.config=t,this.activeKeysProvider=n}registerKeyBoardEvents(){const e=e=>this.handleOnKeyDown(e),t=e=>this.handleOnKeyUp(e),n=e=>this.handleOnKeyPress(e);document.addEventListener("keydown",e),document.addEventListener("keyup",t),document.addEventListener("keypress",n),this.keyboardEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("keydown",e))),this.keyboardEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("keyup",t))),this.keyboardEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("keypress",n)))}unregisterKeyBoardEvents(){this.keyboardEventListenerTracker.unregisterAll()}handleOnKeyDown(e){const t=this.getKeycode(e);t&&(au.Log(au.GetStackTrace(),`key down ${t}, repeat = ${e.repeat}`,6),this.toStreamerMessagesProvider.toStreamerHandlers.get("KeyDown")([this.getKeycode(e),e.repeat?1:0]),this.activeKeysProvider.getActiveKeys().push(t),t===ng.backSpace&&document.dispatchEvent(new KeyboardEvent("keypress",{charCode:ng.backSpace})),this.config.isFlagEnabled(ph.SuppressBrowserKeys)&&this.isKeyCodeBrowserKey(t)&&e.preventDefault())}handleOnKeyUp(e){const t=this.getKeycode(e);t&&(au.Log(au.GetStackTrace(),`key up ${t}`,6),this.toStreamerMessagesProvider.toStreamerHandlers.get("KeyUp")([t]),this.config.isFlagEnabled(ph.SuppressBrowserKeys)&&this.isKeyCodeBrowserKey(t)&&e.preventDefault())}handleOnKeyPress(e){if(!("charCode"in e))return void au.Warning(au.GetStackTrace(),"KeyboardEvent.charCode is deprecated in this browser, cannot send key press.");const t=e.charCode;au.Log(au.GetStackTrace(),`key press ${t}`,6),this.toStreamerMessagesProvider.toStreamerHandlers.get("KeyPress")([t])}getKeycode(e){if(!("keyCode"in e)){const t=e;return t.code in this.CodeToKeyCode?this.CodeToKeyCode[t.code]:(au.Warning(au.GetStackTrace(),`Keyboard code of ${t.code} is not supported in our mapping, ignoring this key.`),null)}return e.keyCode===ng.shift&&"ShiftRight"===e.code?ng.rightShift:e.keyCode===ng.control&&"ControlRight"===e.code?ng.rightControl:e.keyCode===ng.alt&&"AltRight"===e.code?ng.rightAlt:e.keyCode}isKeyCodeBrowserKey(e){return e>=112&&e<=123||9===e}}class rg{constructor(e,t,n){this.x=0,this.y=0,this.updateMouseMovePositionEvent=e=>{this.updateMouseMovePosition(e)},this.mouseEventListenerTracker=new Zh,this.videoElementProvider=e,this.mouseController=t,this.activeKeysProvider=n;const s=this.videoElementProvider.getVideoParentElement();this.x=s.getBoundingClientRect().width/2,this.y=s.getBoundingClientRect().height/2,this.coord=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(this.x,this.y)}unregisterMouseEvents(){this.mouseEventListenerTracker.unregisterAll()}lockStateChange(){const e=this.videoElementProvider.getVideoParentElement(),t=this.mouseController.toStreamerMessagesProvider.toStreamerHandlers;if(document.pointerLockElement===e||document.mozPointerLockElement===e)au.Log(au.GetStackTrace(),"Pointer locked",6),document.addEventListener("mousemove",this.updateMouseMovePositionEvent,!1),this.mouseEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("mousemove",this.updateMouseMovePositionEvent,!1)));else{au.Log(au.GetStackTrace(),"The pointer lock status is now unlocked",6),document.removeEventListener("mousemove",this.updateMouseMovePositionEvent,!1);let e=this.activeKeysProvider.getActiveKeys();const n=new Set(e),s=[];n.forEach((e=>{s[e]})),s.forEach((e=>{t.get("KeyUp")([e])})),e=[]}}updateMouseMovePosition(e){if(!this.videoElementProvider.isVideoReady())return;const t=this.mouseController.toStreamerMessagesProvider.toStreamerHandlers,n=this.videoElementProvider.getVideoParentElement().clientWidth,s=this.videoElementProvider.getVideoParentElement().clientHeight;this.x+=e.movementX,this.y+=e.movementY,this.x>n&&(this.x-=n),this.y>s&&(this.y-=s),this.x<0&&(this.x=n+this.x),this.y<0&&(this.y=s-this.y),this.coord=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(this.x,this.y);const r=this.mouseController.coordinateConverter.normalizeAndQuantizeSigned(e.movementX,e.movementY);t.get("MouseMove")([this.coord.x,this.coord.y,r.x,r.y])}handleMouseDown(e){this.videoElementProvider.isVideoReady()&&this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDown")([e.button,this.coord.x,this.coord.y])}handleMouseUp(e){this.videoElementProvider.isVideoReady()&&this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp")([e.button,this.coord.x,this.coord.y])}handleMouseWheel(e){this.videoElementProvider.isVideoReady()&&this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseWheel")([e.wheelDelta,this.coord.x,this.coord.y])}handleMouseDouble(e){this.videoElementProvider.isVideoReady()&&this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDouble")([e.button,this.coord.x,this.coord.y])}handlePressMouseButtons(e){this.videoElementProvider.isVideoReady()&&this.mouseController.pressMouseButtons(e.buttons,this.x,this.y)}handleReleaseMouseButtons(e){this.videoElementProvider.isVideoReady()&&this.mouseController.releaseMouseButtons(e.buttons,this.x,this.y)}}class og{constructor(e){this.mouseController=e}unregisterMouseEvents(){}updateMouseMovePosition(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;au.Log(au.GetStackTrace(),"MouseMove",6);const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY),n=this.mouseController.coordinateConverter.normalizeAndQuantizeSigned(e.movementX,e.movementY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseMove")([t.x,t.y,n.x,n.y]),e.preventDefault()}handleMouseDown(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;au.Log(au.GetStackTrace(),"onMouse Down",6);const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDown")([e.button,t.x,t.y]),e.preventDefault()}handleMouseUp(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;au.Log(au.GetStackTrace(),"onMouse Up",6);const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp")([e.button,t.x,t.y]),e.preventDefault()}handleContextMenu(e){this.mouseController.videoElementProvider.isVideoReady()&&e.preventDefault()}handleMouseWheel(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseWheel")([e.wheelDelta,t.x,t.y]),e.preventDefault()}handleMouseDouble(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDouble")([e.button,t.x,t.y])}handlePressMouseButtons(e){this.mouseController.videoElementProvider.isVideoReady()&&(au.Log(au.GetStackTrace(),"onMouse press",6),this.mouseController.pressMouseButtons(e.buttons,e.offsetX,e.offsetY))}handleReleaseMouseButtons(e){this.mouseController.videoElementProvider.isVideoReady()&&(au.Log(au.GetStackTrace(),"onMouse release",6),this.mouseController.releaseMouseButtons(e.buttons,e.offsetX,e.offsetY))}}class ig{constructor(e,t,n,s){this.mouseEventListenerTracker=new Zh,this.toStreamerMessagesProvider=e,this.coordinateConverter=n,this.videoElementProvider=t,this.activeKeysProvider=s,this.registerMouseEnterAndLeaveEvents()}unregisterMouseEvents(){this.mouseEventListenerTracker.unregisterAll()}registerLockedMouseEvents(e){const t=this.videoElementProvider.getVideoParentElement(),n=new rg(this.videoElementProvider,e,this.activeKeysProvider);if(t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock,document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock,t.requestPointerLock){const e=()=>{t.requestPointerLock()};t.addEventListener("click",e),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("click",e)))}const s=()=>n.lockStateChange();document.addEventListener("pointerlockchange",s,!1),document.addEventListener("mozpointerlockchange",s,!1),this.mouseEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("pointerlockchange",s,!1))),this.mouseEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("mozpointerlockchange",s,!1)));const r=e=>n.handleMouseDown(e),o=e=>n.handleMouseUp(e),i=e=>n.handleMouseWheel(e),a=e=>n.handleMouseDouble(e);t.addEventListener("mousedown",r),t.addEventListener("mouseup",o),t.addEventListener("wheel",i),t.addEventListener("dblclick",a),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("mousedown",r))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("mouseup",o))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("wheel",i))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("dblclick",a))),this.mouseEventListenerTracker.addUnregisterCallback((()=>n.unregisterMouseEvents())),this.mouseEventListenerTracker.addUnregisterCallback((()=>{!document.exitPointerLock||document.pointerLockElement!==t&&document.mozPointerLockElement!==t||document.exitPointerLock()}))}registerHoveringMouseEvents(e){const t=this.videoElementProvider.getVideoParentElement(),n=new og(e),s=e=>n.updateMouseMovePosition(e),r=e=>n.handleMouseDown(e),o=e=>n.handleMouseUp(e),i=e=>n.handleContextMenu(e),a=e=>n.handleMouseWheel(e),l=e=>n.handleMouseDouble(e);t.addEventListener("mousemove",s),t.addEventListener("mousedown",r),t.addEventListener("mouseup",o),t.addEventListener("contextmenu",i),t.addEventListener("wheel",a),t.addEventListener("dblclick",l),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("mousemove",s))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("mousedown",r))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("mouseup",o))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("contextmenu",i))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("wheel",a))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("dblclick",l))),this.mouseEventListenerTracker.addUnregisterCallback((()=>n.unregisterMouseEvents()))}registerMouseEnterAndLeaveEvents(){const e=this.videoElementProvider.getVideoParentElement(),t=e=>{this.videoElementProvider.isVideoReady()&&(au.Log(au.GetStackTrace(),"Mouse Entered",6),this.sendMouseEnter(),this.pressMouseButtons(e.buttons,e.x,e.y))},n=e=>{this.videoElementProvider.isVideoReady()&&(au.Log(au.GetStackTrace(),"Mouse Left",6),this.sendMouseLeave(),this.releaseMouseButtons(e.buttons,e.x,e.y))};e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",n),this.mouseEventListenerTracker.addUnregisterCallback((()=>e.removeEventListener("mouseenter",t))),this.mouseEventListenerTracker.addUnregisterCallback((()=>e.removeEventListener("mouseleave",n)))}releaseMouseButtons(e,t,n){const s=this.coordinateConverter.normalizeAndQuantizeUnsigned(t,n);e&Yh.primaryButton&&this.sendMouseUp(Jh.mainButton,s.x,s.y),e&Yh.secondaryButton&&this.sendMouseUp(Jh.secondaryButton,s.x,s.y),e&Yh.auxiliaryButton&&this.sendMouseUp(Jh.auxiliaryButton,s.x,s.y),e&Yh.fourthButton&&this.sendMouseUp(Jh.fourthButton,s.x,s.y),e&Yh.fifthButton&&this.sendMouseUp(Jh.fifthButton,s.x,s.y)}pressMouseButtons(e,t,n){if(!this.videoElementProvider.isVideoReady())return;const s=this.coordinateConverter.normalizeAndQuantizeUnsigned(t,n);e&Yh.primaryButton&&this.sendMouseDown(Jh.mainButton,s.x,s.y),e&Yh.secondaryButton&&this.sendMouseDown(Jh.secondaryButton,s.x,s.y),e&Yh.auxiliaryButton&&this.sendMouseDown(Jh.auxiliaryButton,s.x,s.y),e&Yh.fourthButton&&this.sendMouseDown(Jh.fourthButton,s.x,s.y),e&Yh.fifthButton&&this.sendMouseDown(Jh.fifthButton,s.x,s.y)}sendMouseEnter(){this.videoElementProvider.isVideoReady()&&this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseEnter")()}sendMouseLeave(){this.videoElementProvider.isVideoReady()&&this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseLeave")()}sendMouseDown(e,t,n){this.videoElementProvider.isVideoReady()&&(au.Log(au.GetStackTrace(),`mouse button ${e} down at (${t}, ${n})`,6),this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDown")([e,t,n]))}sendMouseUp(e,t,n){if(!this.videoElementProvider.isVideoReady())return;au.Log(au.GetStackTrace(),`mouse button ${e} up at (${t}, ${n})`,6);const s=this.coordinateConverter.normalizeAndQuantizeUnsigned(t,n);this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp")([e,s.x,s.y])}}class ag{constructor(e,t,n){this.fingers=[9,8,7,6,5,4,3,2,1,0],this.fingerIds=new Map,this.maxByteValue=255,this.touchEventListenerTracker=new Zh,this.toStreamerMessagesProvider=e,this.videoElementProvider=t,this.coordinateConverter=n,this.videoElementParent=t.getVideoElement();const s=e=>this.onTouchStart(e),r=e=>this.onTouchEnd(e),o=e=>this.onTouchMove(e);this.videoElementParent.addEventListener("touchstart",s),this.videoElementParent.addEventListener("touchend",r),this.videoElementParent.addEventListener("touchmove",o),this.touchEventListenerTracker.addUnregisterCallback((()=>this.videoElementParent.removeEventListener("touchstart",s))),this.touchEventListenerTracker.addUnregisterCallback((()=>this.videoElementParent.removeEventListener("touchend",r))),this.touchEventListenerTracker.addUnregisterCallback((()=>this.videoElementParent.removeEventListener("touchmove",o))),au.Log(au.GetStackTrace(),"Touch Events Registered",6);const i=e=>{e.preventDefault()};document.addEventListener("touchmove",i),this.touchEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("touchmove",i)))}unregisterTouchEvents(){this.touchEventListenerTracker.unregisterAll()}rememberTouch(e){const t=this.fingers.pop();void 0===t&&au.Log(au.GetStackTrace(),"exhausted touch identifiers",6),this.fingerIds.set(e.identifier,t)}forgetTouch(e){this.fingers.push(this.fingerIds.get(e.identifier)),this.fingers.sort((function(e,t){return t-e})),this.fingerIds.delete(e.identifier)}onTouchStart(e){if(this.videoElementProvider.isVideoReady()){for(let t=0;t<e.changedTouches.length;t++)this.rememberTouch(e.changedTouches[t]);au.Log(au.GetStackTrace(),"touch start",6),this.emitTouchData("TouchStart",e.changedTouches),e.preventDefault()}}onTouchEnd(e){if(this.videoElementProvider.isVideoReady()){au.Log(au.GetStackTrace(),"touch end",6),this.emitTouchData("TouchEnd",e.changedTouches);for(let t=0;t<e.changedTouches.length;t++)this.forgetTouch(e.changedTouches[t]);e.preventDefault()}}onTouchMove(e){this.videoElementProvider.isVideoReady()&&(au.Log(au.GetStackTrace(),"touch move",6),this.emitTouchData("TouchMove",e.touches),e.preventDefault())}emitTouchData(e,t){let n=document.querySelector(".screen"),s=Math.floor(n.getBoundingClientRect().width*window.devicePixelRatio),r=Math.floor(n.getBoundingClientRect().height*window.devicePixelRatio),o=Math.floor(window.screen.width*window.devicePixelRatio),i=Math.floor(window.screen.height*window.devicePixelRatio),a=(Math.floor(document.documentElement.clientWidth*window.devicePixelRatio),i-Math.floor(document.documentElement.clientHeight*window.devicePixelRatio)),l=document.querySelector(".screen").clientWidth/r,c=document.querySelector(".screen").clientHeight/s;if(!this.videoElementProvider.isVideoReady())return;this.videoElementProvider.getVideoParentElement().getBoundingClientRect();const d=this.toStreamerMessagesProvider.toStreamerHandlers;for(let n=0;n<t.length;n++){const u=1,h=t[n];let g,m;g=c*(Math.floor(h.clientY*window.devicePixelRatio)-Math.floor((i-a-r)/2)),m=l*(s-(Math.floor(h.clientX*window.devicePixelRatio)-Math.floor((o-s)/2))),au.Log(au.GetStackTrace(),`F${this.fingerIds.get(h.identifier)}=(${g}, ${m})`,6);const p=this.coordinateConverter.normalizeAndQuantizeUnsigned(g,m);switch(e){case"TouchStart":d.get("TouchStart")([u,p.x,p.y,this.fingerIds.get(h.identifier),this.maxByteValue*h.force,p.inRange?1:0]);break;case"TouchEnd":d.get("TouchEnd")([u,p.x,p.y,this.fingerIds.get(h.identifier),this.maxByteValue*h.force,p.inRange?1:0]);break;case"TouchMove":d.get("TouchMove")([u,p.x,p.y,this.fingerIds.get(h.identifier),this.maxByteValue*h.force,p.inRange?1:0])}}}}class lg{constructor(e){this.gamePadEventListenerTracker=new Zh,this.toStreamerMessagesProvider=e,this.requestAnimationFrame=(window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.requestAnimationFrame).bind(window);const t=window;if("GamepadEvent"in t){const e=e=>this.gamePadConnectHandler(e),t=e=>this.gamePadDisconnectHandler(e);window.addEventListener("gamepadconnected",e),window.addEventListener("gamepaddisconnected",t),this.gamePadEventListenerTracker.addUnregisterCallback((()=>window.removeEventListener("gamepadconnected",e))),this.gamePadEventListenerTracker.addUnregisterCallback((()=>window.removeEventListener("gamepaddisconnected",t)))}else if("WebKitGamepadEvent"in t){const e=e=>this.gamePadConnectHandler(e),t=e=>this.gamePadDisconnectHandler(e);window.addEventListener("webkitgamepadconnected",e),window.addEventListener("webkitgamepaddisconnected",t),this.gamePadEventListenerTracker.addUnregisterCallback((()=>window.removeEventListener("webkitgamepadconnected",e))),this.gamePadEventListenerTracker.addUnregisterCallback((()=>window.removeEventListener("webkitgamepaddisconnected",t)))}if(this.controllers=[],navigator.getGamepads)for(const e of navigator.getGamepads())e&&this.gamePadConnectHandler(new GamepadEvent("gamepadconnected",{gamepad:e}))}unregisterGamePadEvents(){this.gamePadEventListenerTracker.unregisterAll();for(const e of this.controllers)void 0!==e.id&&this.onGamepadDisconnected(e.id);this.controllers=[],this.onGamepadConnected=()=>{},this.onGamepadDisconnected=()=>{}}gamePadConnectHandler(e){au.Log(au.GetStackTrace(),"Gamepad connect handler",6);const t=e.gamepad,n={currentState:t,prevState:t,id:void 0};this.controllers.push(n),this.controllers[t.index].currentState=t,this.controllers[t.index].prevState=t,au.Log(au.GetStackTrace(),"gamepad: "+t.id+" connected",6),window.requestAnimationFrame((()=>this.updateStatus())),this.onGamepadConnected()}gamePadDisconnectHandler(e){au.Log(au.GetStackTrace(),"Gamepad disconnect handler",6),au.Log(au.GetStackTrace(),"gamepad: "+e.gamepad.id+" disconnected",6);const t=this.controllers[e.gamepad.index];delete this.controllers[e.gamepad.index],this.controllers=this.controllers.filter((e=>void 0!==e)),this.onGamepadDisconnected(t.id)}scanGamePads(){const e=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads():[];for(let t=0;t<e.length;t++)e[t]&&e[t].index in this.controllers&&(this.controllers[e[t].index].currentState=e[t])}updateStatus(){this.scanGamePads();const e=this.toStreamerMessagesProvider.toStreamerHandlers;for(const t of this.controllers){const n=void 0===t.id?this.controllers.indexOf(t):t.id,s=t.currentState;for(let s=0;s<t.currentState.buttons.length;s++){const r=t.currentState.buttons[s],o=t.prevState.buttons[s];r.pressed?s==Vh.LeftTrigger?e.get("GamepadAnalog")([n,5,r.value]):s==Vh.RightTrigger?e.get("GamepadAnalog")([n,6,r.value]):e.get("GamepadButtonPressed")([n,s,o.pressed?1:0]):!r.pressed&&o.pressed&&(s==Vh.LeftTrigger?e.get("GamepadAnalog")([n,5,0]):s==Vh.RightTrigger?e.get("GamepadAnalog")([n,6,0]):e.get("GamepadButtonReleased")([n,s]))}for(let t=0;t<s.axes.length;t+=2){const r=parseFloat(s.axes[t].toFixed(4)),o=-parseFloat(s.axes[t+1].toFixed(4));e.get("GamepadAnalog")([n,t+1,r]),e.get("GamepadAnalog")([n,t+2,o])}this.controllers[n].prevState=s}this.controllers.length>0&&this.requestAnimationFrame((()=>this.updateStatus()))}onGamepadResponseReceived(e){for(const t of this.controllers)if(void 0===t.id){t.id=e;break}}onGamepadConnected(){}onGamepadDisconnected(e){}}!function(e){e[e.RightClusterBottomButton=0]="RightClusterBottomButton",e[e.RightClusterRightButton=1]="RightClusterRightButton",e[e.RightClusterLeftButton=2]="RightClusterLeftButton",e[e.RightClusterTopButton=3]="RightClusterTopButton",e[e.LeftShoulder=4]="LeftShoulder",e[e.RightShoulder=5]="RightShoulder",e[e.LeftTrigger=6]="LeftTrigger",e[e.RightTrigger=7]="RightTrigger",e[e.SelectOrBack=8]="SelectOrBack",e[e.StartOrForward=9]="StartOrForward",e[e.LeftAnalogPress=10]="LeftAnalogPress",e[e.RightAnalogPress=11]="RightAnalogPress",e[e.LeftClusterTopButton=12]="LeftClusterTopButton",e[e.LeftClusterBottomButton=13]="LeftClusterBottomButton",e[e.LeftClusterLeftButton=14]="LeftClusterLeftButton",e[e.LeftClusterRightButton=15]="LeftClusterRightButton",e[e.CentreButton=16]="CentreButton",e[e.LeftStickHorizontal=0]="LeftStickHorizontal",e[e.LeftStickVertical=1]="LeftStickVertical",e[e.RightStickHorizontal=2]="RightStickHorizontal",e[e.RightStickVertical=3]="RightStickVertical"}(Vh||(Vh={}));class cg{constructor(e,t,n){this.activeKeys=new dg,this.toStreamerMessagesProvider=e,this.videoElementProvider=t,this.coordinateConverter=n}registerKeyBoard(e){au.Log(au.GetStackTrace(),"Register Keyboard Events",7);const t=new sg(this.toStreamerMessagesProvider,e,this.activeKeys);return t.registerKeyBoardEvents(),t}registerMouse(e){au.Log(au.GetStackTrace(),"Register Mouse Events",7);const t=new ig(this.toStreamerMessagesProvider,this.videoElementProvider,this.coordinateConverter,this.activeKeys);switch(e){case Th.LockedMouse:t.registerLockedMouseEvents(t);break;case Th.HoveringMouse:t.registerHoveringMouseEvents(t);break;default:au.Info(au.GetStackTrace(),"unknown Control Scheme Type Defaulting to Locked Mouse Events"),t.registerLockedMouseEvents(t)}return t}registerTouch(e,t){if(au.Log(au.GetStackTrace(),"Registering Touch",6),e){const e=new eg(this.toStreamerMessagesProvider,this.videoElementProvider,this.coordinateConverter);return e.setVideoElementParentClientRect(t),e}return new ag(this.toStreamerMessagesProvider,this.videoElementProvider,this.coordinateConverter)}registerGamePad(){return au.Log(au.GetStackTrace(),"Register Game Pad",7),new lg(this.toStreamerMessagesProvider)}}class dg{constructor(){this.activeKeys=[],this.activeKeys=[]}getActiveKeys(){return this.activeKeys}}class ug{constructor(e,t){this.lastTimeResized=(new Date).getTime(),this.videoElement=document.createElement("video"),this.config=t,this.videoElement.id="streamingVideo",this.videoElement.disablePictureInPicture=!0,this.videoElement.playsInline=!0,this.videoElement.style.width="100%",this.videoElement.style.height="100%",this.videoElement.style.position="absolute",this.videoElement.style.pointerEvents="all",e.appendChild(this.videoElement),this.onResizePlayerCallback=()=>{console.log("Resolution changed, restyling player, did you forget to override this function?")},this.onMatchViewportResolutionCallback=()=>{console.log("Resolution changed and match viewport resolution is turned on, did you forget to override this function?")},this.videoElement.onclick=()=>{null!=this.audioElement&&this.audioElement.paused&&this.audioElement.play(),this.videoElement.paused&&this.videoElement.play()},this.videoElement.onloadedmetadata=()=>{this.onVideoInitialized()},window.addEventListener("resize",(()=>this.resizePlayerStyle()),!0),window.addEventListener("orientationchange",(()=>this.onOrientationChange()))}setAudioElement(e){this.audioElement=e}play(){return this.videoElement.muted=this.config.isFlagEnabled(ph.StartVideoMuted),this.videoElement.autoplay=this.config.isFlagEnabled(ph.AutoPlayVideo),this.videoElement.play()}isPaused(){return this.videoElement.paused}isVideoReady(){return void 0!==this.videoElement.readyState&&this.videoElement.readyState>0}hasVideoSource(){return void 0!==this.videoElement.srcObject&&null!==this.videoElement.srcObject}getVideoElement(){return this.videoElement}getVideoParentElement(){return this.videoElement.parentElement}setVideoEnabled(e){this.videoElement.srcObject.getTracks().forEach((t=>t.enabled=e))}onVideoInitialized(){}onOrientationChange(){clearTimeout(this.orientationChangeTimeout),this.orientationChangeTimeout=window.setTimeout((()=>{this.resizePlayerStyle()}),500)}resizePlayerStyle(){const e=this.getVideoParentElement();e&&(this.updateVideoStreamSize(),e.classList.contains("fixed-size")||this.resizePlayerStyleToFillParentElement(),this.onResizePlayerCallback())}resizePlayerStyleToFillParentElement(){this.getVideoParentElement().setAttribute("style","top: 0px; left: 0px; width: 100%; height: 100%; cursor: default;")}updateVideoStreamSize(){if(this.config.isFlagEnabled(ph.MatchViewportResolution))if((new Date).getTime()-this.lastTimeResized>300){const e=this.getVideoParentElement();if(!e)return;this.onMatchViewportResolutionCallback(e.clientWidth,e.clientHeight),this.lastTimeResized=(new Date).getTime()}else au.Log(au.GetStackTrace(),"Resizing too often - skipping",6),clearTimeout(this.resizeTimeoutHandle),this.resizeTimeoutHandle=window.setTimeout((()=>this.updateVideoStreamSize()),100)}}class hg{constructor(){this.toStreamerHandlers=new Map,this.fromStreamerHandlers=new Map,this.toStreamerMessages=new Map,this.fromStreamerMessages=new Map}populateDefaultProtocol(){this.toStreamerMessages.set("IFrameRequest",{id:0,structure:[]}),this.toStreamerMessages.set("RequestQualityControl",{id:1,structure:[]}),this.toStreamerMessages.set("FpsRequest",{id:2,structure:[]}),this.toStreamerMessages.set("AverageBitrateRequest",{id:3,structure:[]}),this.toStreamerMessages.set("StartStreaming",{id:4,structure:[]}),this.toStreamerMessages.set("StopStreaming",{id:5,structure:[]}),this.toStreamerMessages.set("LatencyTest",{id:6,structure:["string"]}),this.toStreamerMessages.set("RequestInitialSettings",{id:7,structure:[]}),this.toStreamerMessages.set("TestEcho",{id:8,structure:[]}),this.toStreamerMessages.set("DataChannelLatencyTest",{id:9,structure:[]}),this.toStreamerMessages.set("UIInteraction",{id:50,structure:["string"]}),this.toStreamerMessages.set("Command",{id:51,structure:["string"]}),this.toStreamerMessages.set("KeyDown",{id:60,structure:["uint8","uint8"]}),this.toStreamerMessages.set("KeyUp",{id:61,structure:["uint8"]}),this.toStreamerMessages.set("KeyPress",{id:62,structure:["uint16"]}),this.toStreamerMessages.set("MouseEnter",{id:70,structure:[]}),this.toStreamerMessages.set("MouseLeave",{id:71,structure:[]}),this.toStreamerMessages.set("MouseDown",{id:72,structure:["uint8","uint16","uint16"]}),this.toStreamerMessages.set("MouseUp",{id:73,structure:["uint8","uint16","uint16"]}),this.toStreamerMessages.set("MouseMove",{id:74,structure:["uint16","uint16","int16","int16"]}),this.toStreamerMessages.set("MouseWheel",{id:75,structure:["int16","uint16","uint16"]}),this.toStreamerMessages.set("MouseDouble",{id:76,structure:["uint8","uint16","uint16"]}),this.toStreamerMessages.set("TouchStart",{id:80,structure:["uint8","uint16","uint16","uint8","uint8","uint8"]}),this.toStreamerMessages.set("TouchEnd",{id:81,structure:["uint8","uint16","uint16","uint8","uint8","uint8"]}),this.toStreamerMessages.set("TouchMove",{id:82,structure:["uint8","uint16","uint16","uint8","uint8","uint8"]}),this.toStreamerMessages.set("GamepadConnected",{id:93,structure:[]}),this.toStreamerMessages.set("GamepadButtonPressed",{id:90,structure:["uint8","uint8","uint8"]}),this.toStreamerMessages.set("GamepadButtonReleased",{id:91,structure:["uint8","uint8","uint8"]}),this.toStreamerMessages.set("GamepadAnalog",{id:92,structure:["uint8","uint8","double"]}),this.toStreamerMessages.set("GamepadDisconnected",{id:94,structure:["uint8"]}),this.fromStreamerMessages.set(0,"QualityControlOwnership"),this.fromStreamerMessages.set(1,"Response"),this.fromStreamerMessages.set(2,"Command"),this.fromStreamerMessages.set(3,"FreezeFrame"),this.fromStreamerMessages.set(4,"UnfreezeFrame"),this.fromStreamerMessages.set(5,"VideoEncoderAvgQP"),this.fromStreamerMessages.set(6,"LatencyTest"),this.fromStreamerMessages.set(7,"InitialSettings"),this.fromStreamerMessages.set(8,"FileExtension"),this.fromStreamerMessages.set(9,"FileMimeType"),this.fromStreamerMessages.set(10,"FileContents"),this.fromStreamerMessages.set(11,"TestEcho"),this.fromStreamerMessages.set(12,"InputControlOwnership"),this.fromStreamerMessages.set(13,"GamepadResponse"),this.fromStreamerMessages.set(14,"DataChannelLatencyTest"),this.fromStreamerMessages.set(255,"Protocol")}registerMessageHandler(e,t,n){switch(e){case Nh.ToStreamer:this.toStreamerHandlers.set(t,n);break;case Nh.FromStreamer:this.fromStreamerHandlers.set(t,n);break;default:au.Log(au.GetStackTrace(),`Unknown message direction ${e}`)}}}!function(e){e[e.ToStreamer=0]="ToStreamer",e[e.FromStreamer=1]="FromStreamer"}(Nh||(Nh={}));class gg{constructor(){this.responseEventListeners=new Map}addResponseEventListener(e,t){this.responseEventListeners.set(e,t)}removeResponseEventListener(e){this.responseEventListeners.delete(e)}onResponse(e){au.Log(au.GetStackTrace(),"DataChannelReceiveMessageType.Response",6);const t=new TextDecoder("utf-16").decode(e.slice(1));au.Log(au.GetStackTrace(),t,6),this.responseEventListeners.forEach((e=>{e(t)}))}}class mg{constructor(e,t){this.dataChannelSender=e,this.toStreamerMessagesMapProvider=t}sendMessageToStreamer(e,t){void 0===t&&(t=[]);const n=this.toStreamerMessagesMapProvider.toStreamerMessages.get(e);if(void 0===n)return void au.Error(au.GetStackTrace(),`Attempted to send a message to the streamer with message type: ${e}, but the frontend hasn't been configured to send such a message. Check you've added the message type in your cpp`);if(n.structure&&t&&n.structure.length!==t.length)return void au.Error(au.GetStackTrace(),`Provided message data doesn't match expected layout. Expected [ ${n.structure.map((e=>{switch(e){case"uint8":case"uint16":case"int16":case"float":case"double":return"number";case"string":return"string"}})).toString()} ] but received [ ${t.map((e=>typeof e)).toString()} ]`);let s=0;const r=new TextEncoder;t.forEach(((e,t)=>{switch(n.structure[t]){case"uint8":s+=1;break;case"uint16":case"int16":s+=2;break;case"float":s+=4;break;case"double":s+=8;break;case"string":s+=2,s+=2*r.encode(e).length}}));const o=new DataView(new ArrayBuffer(s+1));o.setUint8(0,n.id);let i=1;t.forEach(((e,t)=>{switch(n.structure[t]){case"uint8":o.setUint8(i,e),i+=1;break;case"uint16":o.setUint16(i,e,!0),i+=2;break;case"int16":o.setInt16(i,e,!0),i+=2;break;case"float":o.setFloat32(i,e,!0),i+=4;break;case"double":o.setFloat64(i,e,!0),i+=8;break;case"string":o.setUint16(i,e.length,!0),i+=2;for(let t=0;t<e.length;t++)o.setUint16(i,e.charCodeAt(t),!0),i+=2}})),this.dataChannelSender.canSend()?this.dataChannelSender.sendData(o.buffer):au.Info(au.GetStackTrace(),`Data channel cannot send yet, skipping sending message: ${e} - ${new Uint8Array(o.buffer)}`)}}class pg{constructor(e){this.sendMessageController=e}SendRequestQualityControl(){this.sendMessageController.sendMessageToStreamer("RequestQualityControl")}SendMaxFpsRequest(){this.sendMessageController.sendMessageToStreamer("FpsRequest")}SendAverageBitrateRequest(){this.sendMessageController.sendMessageToStreamer("AverageBitrateRequest")}SendStartStreaming(){this.sendMessageController.sendMessageToStreamer("StartStreaming")}SendStopStreaming(){this.sendMessageController.sendMessageToStreamer("StopStreaming")}SendRequestInitialSettings(){this.sendMessageController.sendMessageToStreamer("RequestInitialSettings")}}class fg{constructor(e){this.dataChannelProvider=e}canSend(){return void 0!==this.dataChannelProvider.getDataChannelInstance().dataChannel&&"open"==this.dataChannelProvider.getDataChannelInstance().dataChannel.readyState}sendData(e){const t=this.dataChannelProvider.getDataChannelInstance();"open"==t.dataChannel.readyState?(t.dataChannel.send(e),au.Log(au.GetStackTrace(),`Message Sent: ${new Uint8Array(e)}`,6),this.resetAfkWarningTimerOnDataSend()):au.Error(au.GetStackTrace(),`Message Failed: ${new Uint8Array(e)}`)}resetAfkWarningTimerOnDataSend(){}}class vg{constructor(e){this.videoElementProvider=e,this.normalizeAndQuantizeUnsignedFunc=()=>{throw new Error("Normalize and quantize unsigned, method not implemented.")},this.normalizeAndQuantizeSignedFunc=()=>{throw new Error("Normalize and unquantize signed, method not implemented.")},this.denormalizeAndUnquantizeUnsignedFunc=()=>{throw new Error("Denormalize and unquantize unsigned, method not implemented.")}}normalizeAndQuantizeUnsigned(e,t){return this.normalizeAndQuantizeUnsignedFunc(e,t)}unquantizeAndDenormalizeUnsigned(e,t){return this.denormalizeAndUnquantizeUnsignedFunc(e,t)}normalizeAndQuantizeSigned(e,t){return this.normalizeAndQuantizeSignedFunc(e,t)}setupNormalizeAndQuantize(){if(this.videoElementParent=this.videoElementProvider.getVideoParentElement(),this.videoElement=this.videoElementProvider.getVideoElement(),this.videoElementParent&&this.videoElement){const e=this.videoElementParent.clientHeight/this.videoElementParent.clientWidth,t=this.videoElement.videoHeight/this.videoElement.videoWidth;e>t?(au.Log(au.GetStackTrace(),"Setup Normalize and Quantize for playerAspectRatio > videoAspectRatio",6),this.ratio=e/t,this.normalizeAndQuantizeUnsignedFunc=(e,t)=>this.normalizeAndQuantizeUnsignedPlayerBigger(e,t),this.normalizeAndQuantizeSignedFunc=(e,t)=>this.normalizeAndQuantizeSignedPlayerBigger(e,t),this.denormalizeAndUnquantizeUnsignedFunc=(e,t)=>this.denormalizeAndUnquantizeUnsignedPlayerBigger(e,t)):(au.Log(au.GetStackTrace(),"Setup Normalize and Quantize for playerAspectRatio <= videoAspectRatio",6),this.ratio=t/e,this.normalizeAndQuantizeUnsignedFunc=(e,t)=>this.normalizeAndQuantizeUnsignedPlayerSmaller(e,t),this.normalizeAndQuantizeSignedFunc=(e,t)=>this.normalizeAndQuantizeSignedPlayerSmaller(e,t),this.denormalizeAndUnquantizeUnsignedFunc=(e,t)=>this.denormalizeAndUnquantizeUnsignedPlayerSmaller(e,t))}}normalizeAndQuantizeUnsignedPlayerBigger(e,t){const n=e/this.videoElementParent.clientWidth,s=this.ratio*(t/this.videoElementParent.clientHeight-.5)+.5;return n<0||n>1||s<0||s>1?new Sg(!1,65535,65535):new Sg(!0,65536*n,65536*s)}denormalizeAndUnquantizeUnsignedPlayerBigger(e,t){const n=e/65536,s=(t/65536-.5)/this.ratio+.5;return new yg(n*this.videoElementParent.clientWidth,s*this.videoElementParent.clientHeight)}normalizeAndQuantizeSignedPlayerBigger(e,t){const n=e/(.5*this.videoElementParent.clientWidth),s=this.ratio*t/(.5*this.videoElementParent.clientHeight);return new bg(32767*n,32767*s)}normalizeAndQuantizeUnsignedPlayerSmaller(e,t){const n=this.ratio*(e/this.videoElementParent.clientWidth-.5)+.5,s=t/this.videoElementParent.clientHeight;return n<0||n>1||s<0||s>1?new Sg(!1,65535,65535):new Sg(!0,65536*n,65536*s)}denormalizeAndUnquantizeUnsignedPlayerSmaller(e,t){const n=(e/65536-.5)/this.ratio+.5,s=t/65536;return new yg(n*this.videoElementParent.clientWidth,s*this.videoElementParent.clientHeight)}normalizeAndQuantizeSignedPlayerSmaller(e,t){const n=this.ratio*e/(.5*this.videoElementParent.clientWidth),s=t/(.5*this.videoElementParent.clientHeight);return new bg(32767*n,32767*s)}}class Sg{constructor(e,t,n){this.inRange=e,this.x=t,this.y=n}}class yg{constructor(e,t){this.x=e,this.y=t}}class bg{constructor(e,t){this.x=e,this.y=t}}class Cg{constructor(e,t){this.shouldShowPlayOverlay=!0,this.autoJoinTimer=void 0,this.config=e,this.pixelStreaming=t,this.responseController=new gg,this.file=new Xh,this.sdpConstraints={offerToReceiveAudio:!0,offerToReceiveVideo:!0},this.afkController=new Mh(this.config,this.pixelStreaming,this.onAfkTriggered.bind(this)),this.afkController.onAFKTimedOutCallback=()=>{this.closeSignalingServer("You have been disconnected due to inactivity")},this.freezeFrameController=new ku(this.pixelStreaming.videoElementParent),this.videoPlayer=new ug(this.pixelStreaming.videoElementParent,this.config),this.videoPlayer.onVideoInitialized=()=>this.handleVideoInitialized(),this.videoPlayer.onMatchViewportResolutionCallback=(e,t)=>{const n={"Resolution.Width":e,"Resolution.Height":t};this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify(n)])},this.videoPlayer.onResizePlayerCallback=()=>{this.setUpMouseAndFreezeFrame()},this.streamController=new Mu(this.videoPlayer),this.coordinateConverter=new vg(this.videoPlayer),this.sendrecvDataChannelController=new _h,this.recvDataChannelController=new _h,this.registerDataChannelEventEmitters(this.sendrecvDataChannelController),this.registerDataChannelEventEmitters(this.recvDataChannelController),this.dataChannelSender=new fg(this.sendrecvDataChannelController),this.dataChannelSender.resetAfkWarningTimerOnDataSend=()=>this.afkController.resetAfkWarningTimer(),this.streamMessageController=new hg,this.webSocketController=new Tu,this.webSocketController.onConfig=e=>this.handleOnConfigMessage(e),this.webSocketController.onStreamerList=e=>this.handleStreamerListMessage(e),this.webSocketController.onPlayerCount=e=>{this.pixelStreaming._onPlayerCount(e.count)},this.webSocketController.onOpen.addEventListener("open",(()=>{this.config.isFlagEnabled(ph.BrowserSendOffer)||this.webSocketController.requestStreamerObject(sessionStorage.getItem("streamerName"))})),this.webSocketController.onClose.addEventListener("close",(e=>{const t=this.shouldReconnect&&1001!=e.detail.code&&this.config.getNumericSettingValue(vh.MaxReconnectAttempts)>0,n=this.disconnectMessage?this.disconnectMessage:e.detail.reason;this.pixelStreaming._onDisconnect(n,!t&&!this.isReconnecting),this.afkController.stopAfkWarningTimer(),this.statsTimerHandle&&void 0!==this.statsTimerHandle&&window.clearInterval(this.statsTimerHandle),this.setVideoEncoderAvgQP(0),this.setTouchInputEnabled(!1),this.setMouseInputEnabled(!1),this.setKeyboardInputEnabled(!1),this.setGamePadInputEnabled(!1),t&&setTimeout((()=>{this.isReconnecting=!0,this.reconnectAttempt++,this.tryReconnect(e.detail.reason)}),2e3)})),this.sendMessageController=new mg(this.dataChannelSender,this.streamMessageController),this.toStreamerMessagesController=new pg(this.sendMessageController),this.registerMessageHandlers(),this.streamMessageController.populateDefaultProtocol(),this.inputClassesFactory=new cg(this.streamMessageController,this.videoPlayer,this.coordinateConverter),this.isUsingSFU=!1,this.isQualityController=!1,this.preferredCodec="",this.shouldReconnect=!0,this.isReconnecting=!1,this.reconnectAttempt=0,this.config._addOnOptionSettingChangedListener(Ch.StreamerId,(e=>{""!==e&&(this.peerConnectionController.peerConnection.close(),this.peerConnectionController.createPeerConnection(this.peerConfig,this.preferredCodec),this.subscribedStream=e,this.webSocketController.sendSubscribe(e))})),this.setVideoEncoderAvgQP(-1),this.signallingUrlBuilder=()=>{let e=this.config.getTextSettingValue(yh.SignallingServerUrl);return this.config.isFlagEnabled(ph.BrowserSendOffer)&&(e+="?"+ph.BrowserSendOffer+"=true"),e}}requestUnquantizedAndDenormalizeUnsigned(e,t){return this.coordinateConverter.unquantizeAndDenormalizeUnsigned(e,t)}handleOnMessage(e){const t=new Uint8Array(e.data);au.Log(au.GetStackTrace(),"Message incoming:"+t,6);const n=this.streamMessageController.fromStreamerMessages.get(t[0]);this.streamMessageController.fromStreamerHandlers.get(n)(e.data)}registerMessageHandlers(){this.streamMessageController.registerMessageHandler(Nh.FromStreamer,"QualityControlOwnership",(e=>this.onQualityControlOwnership(e))),this.streamMessageController.registerMessageHandler(Nh.FromStreamer,"Response",(e=>this.responseController.onResponse(e))),this.streamMessageController.registerMessageHandler(Nh.FromStreamer,"Command",(e=>{this.onCommand(e)})),this.streamMessageController.registerMessageHandler(Nh.FromStreamer,"FreezeFrame",(e=>this.onFreezeFrameMessage(e))),this.streamMessageController.registerMessageHandler(Nh.FromStreamer,"UnfreezeFrame",(()=>this.invalidateFreezeFrameAndEnableVideo())),this.streamMessageController.registerMessageHandler(Nh.FromStreamer,"VideoEncoderAvgQP",(e=>this.handleVideoEncoderAvgQP(e))),this.streamMessageController.registerMessageHandler(Nh.FromStreamer,"LatencyTest",(e=>this.handleLatencyTestResult(e))),this.streamMessageController.registerMessageHandler(Nh.FromStreamer,"DataChannelLatencyTest",(e=>this.handleDataChannelLatencyTestResponse(e))),this.streamMessageController.registerMessageHandler(Nh.FromStreamer,"InitialSettings",(e=>this.handleInitialSettings(e))),this.streamMessageController.registerMessageHandler(Nh.FromStreamer,"FileExtension",(e=>this.onFileExtension(e))),this.streamMessageController.registerMessageHandler(Nh.FromStreamer,"FileMimeType",(e=>this.onFileMimeType(e))),this.streamMessageController.registerMessageHandler(Nh.FromStreamer,"FileContents",(e=>this.onFileContents(e))),this.streamMessageController.registerMessageHandler(Nh.FromStreamer,"TestEcho",(()=>{})),this.streamMessageController.registerMessageHandler(Nh.FromStreamer,"InputControlOwnership",(e=>this.onInputControlOwnership(e))),this.streamMessageController.registerMessageHandler(Nh.FromStreamer,"GamepadResponse",(e=>this.onGamepadResponse(e))),this.streamMessageController.registerMessageHandler(Nh.FromStreamer,"Protocol",(e=>this.onProtocolMessage(e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"IFrameRequest",(()=>this.sendMessageController.sendMessageToStreamer("IFrameRequest"))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"RequestQualityControl",(()=>this.sendMessageController.sendMessageToStreamer("RequestQualityControl"))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"FpsRequest",(()=>this.sendMessageController.sendMessageToStreamer("FpsRequest"))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"AverageBitrateRequest",(()=>this.sendMessageController.sendMessageToStreamer("AverageBitrateRequest"))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"StartStreaming",(()=>this.sendMessageController.sendMessageToStreamer("StartStreaming"))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"StopStreaming",(()=>this.sendMessageController.sendMessageToStreamer("StopStreaming"))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"LatencyTest",(e=>this.sendMessageController.sendMessageToStreamer("LatencyTest",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"RequestInitialSettings",(()=>this.sendMessageController.sendMessageToStreamer("RequestInitialSettings"))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"TestEcho",(()=>{})),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"UIInteraction",(e=>this.sendMessageController.sendMessageToStreamer("UIInteraction",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"Command",(e=>this.sendMessageController.sendMessageToStreamer("Command",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"TextboxEntry",(e=>this.sendMessageController.sendMessageToStreamer("TextboxEntry",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"KeyDown",(e=>this.sendMessageController.sendMessageToStreamer("KeyDown",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"KeyUp",(e=>this.sendMessageController.sendMessageToStreamer("KeyUp",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"KeyPress",(e=>this.sendMessageController.sendMessageToStreamer("KeyPress",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"MouseEnter",(e=>this.sendMessageController.sendMessageToStreamer("MouseEnter",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"MouseLeave",(e=>this.sendMessageController.sendMessageToStreamer("MouseLeave",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"MouseDown",(e=>this.sendMessageController.sendMessageToStreamer("MouseDown",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"MouseUp",(e=>this.sendMessageController.sendMessageToStreamer("MouseUp",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"MouseMove",(e=>this.sendMessageController.sendMessageToStreamer("MouseMove",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"MouseWheel",(e=>this.sendMessageController.sendMessageToStreamer("MouseWheel",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"MouseDouble",(e=>this.sendMessageController.sendMessageToStreamer("MouseDouble",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"TouchStart",(e=>this.sendMessageController.sendMessageToStreamer("TouchStart",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"TouchEnd",(e=>this.sendMessageController.sendMessageToStreamer("TouchEnd",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"TouchMove",(e=>this.sendMessageController.sendMessageToStreamer("TouchMove",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"GamepadConnected",(()=>this.sendMessageController.sendMessageToStreamer("GamepadConnected"))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"GamepadButtonPressed",(e=>this.sendMessageController.sendMessageToStreamer("GamepadButtonPressed",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"GamepadButtonReleased",(e=>this.sendMessageController.sendMessageToStreamer("GamepadButtonReleased",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"GamepadAnalog",(e=>this.sendMessageController.sendMessageToStreamer("GamepadAnalog",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"GamepadDisconnected",(e=>this.sendMessageController.sendMessageToStreamer("GamepadDisconnected",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"XRHMDTransform",(e=>this.sendMessageController.sendMessageToStreamer("XRHMDTransform",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"XRControllerTransform",(e=>this.sendMessageController.sendMessageToStreamer("XRControllerTransform",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"XRSystem",(e=>this.sendMessageController.sendMessageToStreamer("XRSystem",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"XRButtonTouched",(e=>this.sendMessageController.sendMessageToStreamer("XRButtonTouched",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"XRButtonPressed",(e=>this.sendMessageController.sendMessageToStreamer("XRButtonPressed",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"XRButtonReleased",(e=>this.sendMessageController.sendMessageToStreamer("XRButtonReleased",e))),this.streamMessageController.registerMessageHandler(Nh.ToStreamer,"XRAnalog",(e=>this.sendMessageController.sendMessageToStreamer("XRAnalog",e)))}onCommand(e){au.Log(au.GetStackTrace(),"DataChannelReceiveMessageType.Command",6);const t=new TextDecoder("utf-16").decode(e.slice(1));au.Log(au.GetStackTrace(),"Data Channel Command: "+t,6);const n=JSON.parse(t);"onScreenKeyboard"===n.command&&this.pixelStreaming._activateOnScreenKeyboard(n)}onProtocolMessage(e){try{const t=new TextDecoder("utf-16").decode(e.slice(1)),n=JSON.parse(t);Object.prototype.hasOwnProperty.call(n,"Direction")||au.Error(au.GetStackTrace(),"Malformed protocol received. Ensure the protocol message contains a direction");const s=n.Direction;delete n.Direction,au.Log(au.GetStackTrace(),`Received new ${s==Nh.FromStreamer?"FromStreamer":"ToStreamer"} protocol. Updating existing protocol...(更新现有协议)`),Object.keys(n).forEach((e=>{const t=n[e];switch(s){case Nh.ToStreamer:if(!Object.prototype.hasOwnProperty.call(t,"id"))return void au.Error(au.GetStackTrace(),`ToStreamer->${e} protocol definition was malformed as it didn't contain at least an id\n\n Definition was: ${JSON.stringify(t,null,2)}`);if("UIInteraction"===e||"Command"===e||"LatencyTest"===e)return;this.streamMessageController.toStreamerHandlers.get(e)?this.streamMessageController.toStreamerMessages.set(e,t):au.Error(au.GetStackTrace(),`There was no registered handler for "${e}" - try adding one using registerMessageHandler(MessageDirection.ToStreamer, "${e}", myHandler)`);break;case Nh.FromStreamer:if(!Object.prototype.hasOwnProperty.call(t,"id"))return void au.Error(au.GetStackTrace(),`FromStreamer->${e} protocol definition was malformed as it didn't contain at least an id\n\n Definition was: ${JSON.stringify(t,null,2)}`);this.streamMessageController.fromStreamerHandlers.get(e)?this.streamMessageController.fromStreamerMessages.set(t.id,e):au.Error(au.GetStackTrace(),`There was no registered handler for "${t}" - try adding one using registerMessageHandler(MessageDirection.FromStreamer, "${e}", myHandler)`);break;default:au.Error(au.GetStackTrace(),`Unknown direction: ${s}`)}})),this.toStreamerMessagesController.SendRequestInitialSettings(),this.toStreamerMessagesController.SendRequestQualityControl()}catch(e){au.Log(au.GetStackTrace(),e)}}onInputControlOwnership(e){const t=new Uint8Array(e);au.Log(au.GetStackTrace(),"DataChannelReceiveMessageType.InputControlOwnership",6);const n=new Boolean(t[1]).valueOf();au.Log(au.GetStackTrace(),`Received input controller message - will your input control the stream: ${n}`),this.pixelStreaming._onInputControlOwnership(n)}onGamepadResponse(e){const t=new TextDecoder("utf-16").decode(e.slice(1)),n=JSON.parse(t);this.gamePadController.onGamepadResponseReceived(n.controllerId)}onAfkTriggered(){this.afkController.onAfkClick(),this.videoPlayer.isPaused()&&this.videoPlayer.hasVideoSource()&&this.playStream()}setAfkEnabled(e){e?this.onAfkTriggered():this.afkController.stopAfkWarningTimer()}tryReconnect(e){this.webSocketController?(this.isReconnecting=!0,this.webSocketController.webSocket&&this.webSocketController.webSocket.readyState!=WebSocket.CLOSED?(this.closeSignalingServer(`${e} Restarting stream...`),setTimeout((()=>{this.tryReconnect(e)}),3e3)):(this.pixelStreaming._onWebRtcAutoConnect(),this.connectToSignallingServer())):au.Log(au.GetStackTrace(),"The Web Socket Controller does not exist so this will not work right now.")}loadFreezeFrameOrShowPlayOverlay(){this.pixelStreaming.dispatchEvent(new th({shouldShowPlayOverlay:this.shouldShowPlayOverlay,isValid:this.freezeFrameController.valid,jpegData:this.freezeFrameController.jpeg})),!0===this.shouldShowPlayOverlay?(au.Log(au.GetStackTrace(),"showing play overlay"),this.resizePlayerStyle()):(au.Log(au.GetStackTrace(),"showing freeze frame"),this.freezeFrameController.showFreezeFrame()),setTimeout((()=>{this.videoPlayer.setVideoEnabled(!1)}),this.freezeFrameController.freezeFrameDelay)}onFreezeFrameMessage(e){au.Log(au.GetStackTrace(),"DataChannelReceiveMessageType.FreezeFrame",6);const t=new Uint8Array(e);this.freezeFrameController.processFreezeFrameMessage(t,(()=>this.loadFreezeFrameOrShowPlayOverlay()))}invalidateFreezeFrameAndEnableVideo(){au.Log(au.GetStackTrace(),"DataChannelReceiveMessageType.FreezeFrame",6),setTimeout((()=>{this.pixelStreaming.dispatchEvent(new nh),this.freezeFrameController.hideFreezeFrame()}),this.freezeFrameController.freezeFrameDelay),this.videoPlayer.getVideoElement()&&this.videoPlayer.setVideoEnabled(!0)}onFileExtension(e){const t=new Uint8Array(e);Qh.setExtensionFromBytes(t,this.file)}onFileMimeType(e){const t=new Uint8Array(e);Qh.setMimeTypeFromBytes(t,this.file)}onFileContents(e){const t=new Uint8Array(e);Qh.setContentsFromBytes(t,this.file)}playStream(){if(!this.videoPlayer.getVideoElement()){const e="Could not play video stream because the video player was not initialized correctly.";return this.pixelStreaming.dispatchEvent(new Yu({message:e})),au.Error(au.GetStackTrace(),e),void this.closeSignalingServer("Stream not initialized correctly")}if(this.videoPlayer.hasVideoSource()){if(this.setTouchInputEnabled(this.config.isFlagEnabled(ph.TouchInput)),this.pixelStreaming.dispatchEvent(new Zu),this.streamController.audioElement.srcObject){const e=this.config.isFlagEnabled(ph.StartVideoMuted);this.streamController.audioElement.muted=e,e?this.playVideo():this.streamController.audioElement.play().then((()=>{this.playVideo()})).catch((e=>{au.Log(au.GetStackTrace(),e),au.Log(au.GetStackTrace(),"Browser does not support autoplaying video without interaction - to resolve this we are going to show the play button overlay."),this.pixelStreaming.dispatchEvent(new eh({reason:e}))}))}else this.playVideo();this.shouldShowPlayOverlay=!1,this.freezeFrameController.showFreezeFrame()}else au.Warning(au.GetStackTrace(),"Cannot play stream, the video element has no srcObject to play.")}playVideo(){this.videoPlayer.play().catch((e=>{this.streamController.audioElement.srcObject&&this.streamController.audioElement.pause(),au.Log(au.GetStackTrace(),e),au.Log(au.GetStackTrace(),"Browser does not support autoplaying video without interaction - to resolve this we are going to show the play button overlay."),this.pixelStreaming.dispatchEvent(new eh({reason:e}))}))}autoPlayVideoOrSetUpPlayOverlay(){this.config.isFlagEnabled(ph.AutoPlayVideo)&&this.playStream(),this.resizePlayerStyle()}connectToSignallingServer(){this.locallyClosed=!1,this.shouldReconnect=!0,this.disconnectMessage=null;const e=this.signallingUrlBuilder();this.webSocketController.connect(e)}startSession(e){if(this.peerConfig=e,this.config.isFlagEnabled(ph.ForceTURN)&&!this.checkTurnServerAvailability(e))return au.Info(au.GetStackTrace(),"No turn server was found in the Peer Connection Options. TURN cannot be forced, closing connection. Please use STUN instead"),void this.closeSignalingServer("TURN cannot be forced, closing connection. Please use STUN instead.");this.peerConnectionController=new Gh(this.peerConfig,this.config,this.preferredCodec),this.peerConnectionController.onVideoStats=e=>this.handleVideoStats(e),this.peerConnectionController.onSendWebRTCOffer=e=>this.handleSendWebRTCOffer(e),this.peerConnectionController.onSendWebRTCAnswer=e=>this.handleSendWebRTCAnswer(e),this.peerConnectionController.onPeerIceCandidate=e=>this.handleSendIceCandidate(e),this.peerConnectionController.onDataChannel=e=>this.handleDataChannel(e),this.peerConnectionController.showTextOverlayConnecting=()=>this.pixelStreaming._onWebRtcConnecting(),this.peerConnectionController.showTextOverlaySetupFailure=()=>this.pixelStreaming._onWebRtcFailed();let t=!1;this.peerConnectionController.onIceConnectionStateChange=()=>{!t&&["connected","completed"].includes(this.peerConnectionController.peerConnection.iceConnectionState)&&(this.pixelStreaming._onWebRtcConnected(),t=!0)},this.peerConnectionController.onTrack=e=>this.streamController.handleOnTrack(e),this.config.isFlagEnabled(ph.BrowserSendOffer)&&(this.sendrecvDataChannelController.createDataChannel(this.peerConnectionController.peerConnection,"cirrus",this.datachannelOptions),this.sendrecvDataChannelController.handleOnMessage=e=>this.handleOnMessage(e),this.peerConnectionController.createOffer(this.sdpConstraints,this.config))}checkTurnServerAvailability(e){if(!e.iceServers)return au.Info(au.GetStackTrace(),"A turn sever was not found"),!1;for(const t of e.iceServers)for(const e of t.urls)if(e.includes("turn"))return au.Log(au.GetStackTrace(),`A turn sever was found at ${e}`),!0;return au.Info(au.GetStackTrace(),"A turn sever was not found"),!1}handleOnConfigMessage(e){this.resizePlayerStyle(),this.startSession(e.peerConnectionOptions),this.webSocketController.onWebRtcAnswer=e=>this.handleWebRtcAnswer(e),this.webSocketController.onWebRtcOffer=e=>this.handleWebRtcOffer(e),this.webSocketController.onWebRtcPeerDataChannels=e=>this.handleWebRtcSFUPeerDatachannels(e),this.webSocketController.onIceCandidate=e=>this.handleIceCandidate(e)}handleStreamerListMessage(e){var t;console.log(e,"====="),au.Log(au.GetStackTrace(),`Got streamer list ${e.ids}`,6);const n=null!==(t=e.streamerBusyList)&&void 0!==t?t:[];n.length>0&&(console.log(window.location.href,"======"),iu.confirm("监测到当前窗口有人在使用,是否强制进入?","警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.webSocketController.sendSubscribe(n[0].streamerId)})).catch((()=>{})));const s=[...e.ids];console.log(s),this.config.setOptionSettingOptions(Ch.StreamerId,s);let r=null,o=null;const i=this.config.isFlagEnabled(ph.WaitForStreamer),a=this.config.getNumericSettingValue(vh.MaxReconnectAttempts),l=this.config.getNumericSettingValue(vh.StreamerAutoJoinInterval),c=new URLSearchParams(window.location.search);c.has(Ch.StreamerId)?r=c.get(Ch.StreamerId):this.subscribedStream&&(r=this.subscribedStream),r&&e.ids.includes(r)?o=r:r&&i||1!=e.ids.length||(o=e.ids[0]),o?(this.isReconnecting=!1,this.reconnectAttempt=0,this.config.setOptionSettingValue(Ch.StreamerId,o)):i&&(this.reconnectAttempt<a?(this.isReconnecting=!0,this.reconnectAttempt++,setTimeout((()=>{this.webSocketController.requestStreamerList()}),l)):(this.reconnectAttempt=0,this.isReconnecting=!1,this.shouldReconnect=!1)),this.pixelStreaming.dispatchEvent(new rh({messageStreamerList:e,autoSelectedStreamerId:o,wantedStreamerId:r}))}handleWebRtcAnswer(e){au.Log(au.GetStackTrace(),`Got answer sdp ${e.sdp}`,6);const t={sdp:e.sdp,type:"answer"};this.peerConnectionController.receiveAnswer(t),this.handlePostWebrtcNegotiation()}handleWebRtcOffer(e){au.Log(au.GetStackTrace(),`Got offer sdp ${e.sdp}`,6),this.isUsingSFU=!!e.sfu&&e.sfu,this.isUsingSFU&&(this.peerConnectionController.preferredCodec="");const t={sdp:e.sdp,type:"offer"};this.peerConnectionController.receiveOffer(t,this.config),this.handlePostWebrtcNegotiation()}handleWebRtcSFUPeerDatachannels(e){const t={ordered:!0,negotiated:!0,id:e.sendStreamId},n=e.sendStreamId!=e.recvStreamId;if(this.sendrecvDataChannelController.createDataChannel(this.peerConnectionController.peerConnection,n?"send-datachannel":"datachannel",t),n){const t={ordered:!0,negotiated:!0,id:e.recvStreamId};this.recvDataChannelController.createDataChannel(this.peerConnectionController.peerConnection,"recv-datachannel",t),this.recvDataChannelController.handleOnOpen=()=>this.webSocketController.sendSFURecvDataChannelReady(),this.recvDataChannelController.handleOnMessage=e=>this.handleOnMessage(e)}else this.sendrecvDataChannelController.handleOnMessage=e=>this.handleOnMessage(e)}handlePostWebrtcNegotiation(){this.afkController.startAfkWarningTimer(),this.pixelStreaming._onWebRtcSdp(),this.statsTimerHandle&&void 0!==this.statsTimerHandle&&window.clearInterval(this.statsTimerHandle),this.statsTimerHandle=window.setInterval((()=>this.getStats()),1e3),this.setMouseInputEnabled(this.config.isFlagEnabled(ph.MouseInput)),this.setKeyboardInputEnabled(this.config.isFlagEnabled(ph.KeyboardInput)),this.setGamePadInputEnabled(this.config.isFlagEnabled(ph.GamepadInput))}handleIceCandidate(e){au.Log(au.GetStackTrace(),"Web RTC Controller: onWebRtcIce",6);const t=new RTCIceCandidate(e);this.peerConnectionController.handleOnIce(t)}handleSendIceCandidate(e){au.Log(au.GetStackTrace(),"OnIceCandidate",6),e.candidate&&e.candidate.candidate&&this.webSocketController.sendIceCandidate(e.candidate)}handleDataChannel(e){au.Log(au.GetStackTrace(),"Data channel created for us by browser as we are a receiving peer.",6),this.sendrecvDataChannelController.dataChannel=e.channel,this.sendrecvDataChannelController.setupDataChannel(),this.sendrecvDataChannelController.handleOnMessage=e=>this.handleOnMessage(e)}handleSendWebRTCOffer(e){au.Log(au.GetStackTrace(),"Sending the offer to the Server",6),this.webSocketController.sendWebRtcOffer(e)}handleSendWebRTCAnswer(e){au.Log(au.GetStackTrace(),"Sending the answer to the Server",6),this.webSocketController.sendWebRtcAnswer(e),this.isUsingSFU&&this.webSocketController.sendWebRtcDatachannelRequest()}setUpMouseAndFreezeFrame(){this.videoElementParentClientRect=this.videoPlayer.getVideoParentElement().getBoundingClientRect(),this.coordinateConverter.setupNormalizeAndQuantize(),this.freezeFrameController.freezeFrame.resize()}closeSignalingServer(e){var t;this.locallyClosed=!0,this.shouldReconnect=!1,this.disconnectMessage=e,null===(t=this.webSocketController)||void 0===t||t.close()}closePeerConnection(){var e;null===(e=this.peerConnectionController)||void 0===e||e.close()}close(){this.closeSignalingServer(""),this.closePeerConnection()}getStats(){this.peerConnectionController.generateStats()}sendLatencyTest(){this.latencyStartTime=Date.now(),this.streamMessageController.toStreamerHandlers.get("LatencyTest")([JSON.stringify({StartTime:this.latencyStartTime})])}sendDataChannelLatencyTest(e){this.streamMessageController.toStreamerHandlers.get("DataChannelLatencyTest")([JSON.stringify(e)])}sendEncoderMinQP(e){au.Log(au.GetStackTrace(),`MinQP=${e}\n`,6),null!=e&&this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"Encoder.MinQP":e})])}sendEncoderMaxQP(e){au.Log(au.GetStackTrace(),`MaxQP=${e}\n`,6),null!=e&&this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"Encoder.MaxQP":e})])}sendWebRTCMinBitrate(e){au.Log(au.GetStackTrace(),`WebRTC Min Bitrate=${e}`,6),null!=e&&this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"WebRTC.MinBitrate":e})])}sendWebRTCMaxBitrate(e){au.Log(au.GetStackTrace(),`WebRTC Max Bitrate=${e}`,6),null!=e&&this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"WebRTC.MaxBitrate":e})])}sendWebRTCFps(e){au.Log(au.GetStackTrace(),`WebRTC FPS=${e}`,6),null!=e&&(this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"WebRTC.Fps":e})]),this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"WebRTC.MaxFps":e})]))}sendShowFps(){au.Log(au.GetStackTrace(),"---- Sending show stat to UE ----",6),this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"stat.fps":""})])}sendIframeRequest(){au.Log(au.GetStackTrace(),"---- Sending Request for an IFrame ----",6),this.streamMessageController.toStreamerHandlers.get("IFrameRequest")()}emitUIInteraction(e){au.Log(au.GetStackTrace(),"---- Sending custom UIInteraction message ----",6),this.streamMessageController.toStreamerHandlers.get("UIInteraction")([JSON.stringify(e)])}emitCommand(e){au.Log(au.GetStackTrace(),"---- Sending custom Command message ----",6),this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify(e)])}emitConsoleCommand(e){au.Log(au.GetStackTrace(),"---- Sending custom Command:ConsoleCommand message ----",6),this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({ConsoleCommand:e})])}sendRequestQualityControlOwnership(){au.Log(au.GetStackTrace(),"---- Sending Request to Control Quality ----",6),this.toStreamerMessagesController.SendRequestQualityControl()}handleLatencyTestResult(e){au.Log(au.GetStackTrace(),"DataChannelReceiveMessageType.latencyTest",6);const t=new TextDecoder("utf-16").decode(e.slice(1)),n=new qh;Object.assign(n,JSON.parse(t)),n.processFields(),n.testStartTimeMs=this.latencyStartTime,n.browserReceiptTimeMs=Date.now(),n.latencyExcludingDecode=~~(n.browserReceiptTimeMs-n.testStartTimeMs),n.testDuration=~~(n.TransmissionTimeMs-n.ReceiptTimeMs),n.networkLatency=~~(n.latencyExcludingDecode-n.testDuration),n.frameDisplayDeltaTimeMs&&n.browserReceiptTimeMs&&(n.endToEndLatency=(n.frameDisplayDeltaTimeMs,n.networkLatency,~~+n.CaptureToSendMs)),this.pixelStreaming._onLatencyTestResult(n)}handleDataChannelLatencyTestResponse(e){au.Log(au.GetStackTrace(),"DataChannelReceiveMessageType.dataChannelLatencyResponse",6);const t=new TextDecoder("utf-16").decode(e.slice(1)),n=JSON.parse(t);this.pixelStreaming._onDataChannelLatencyTestResponse(n)}handleInitialSettings(e){au.Log(au.GetStackTrace(),"DataChannelReceiveMessageType.InitialSettings",6);const t=new TextDecoder("utf-16").decode(e.slice(1)),n=JSON.parse(t),s=new $h;n.Encoder&&(s.EncoderSettings=n.Encoder),n.WebRTC&&(s.WebRTCSettings=n.WebRTC),n.PixelStreaming&&(s.PixelStreamingSettings=n.PixelStreaming),n.ConfigOptions&&void 0!==n.ConfigOptions.DefaultToHover&&this.config.setFlagEnabled(ph.HoveringMouseMode,!!n.ConfigOptions.DefaultToHover),s.ueCompatible(),au.Log(au.GetStackTrace(),t,6),this.pixelStreaming._onInitialSettings(s)}handleVideoEncoderAvgQP(e){au.Log(au.GetStackTrace(),"DataChannelReceiveMessageType.VideoEncoderAvgQP",6);const t=Number(new TextDecoder("utf-16").decode(e.slice(1)));this.setVideoEncoderAvgQP(t)}handleVideoInitialized(){this.pixelStreaming._onVideoInitialized(),this.autoPlayVideoOrSetUpPlayOverlay(),this.resizePlayerStyle(),this.videoPlayer.updateVideoStreamSize()}onQualityControlOwnership(e){const t=new Uint8Array(e);au.Log(au.GetStackTrace(),"DataChannelReceiveMessageType.QualityControlOwnership",6),this.isQualityController=new Boolean(t[1]).valueOf(),au.Log(au.GetStackTrace(),`Received quality controller message, will control quality: ${this.isQualityController}`),this.pixelStreaming._onQualityControlOwnership(this.isQualityController)}handleVideoStats(e){this.pixelStreaming._onVideoStats(e)}resizePlayerStyle(){this.videoPlayer.resizePlayerStyle()}setPreferredCodec(e){this.preferredCodec=e,this.peerConnectionController&&(this.peerConnectionController.preferredCodec=e,this.peerConnectionController.updateCodecSelection=!1)}setVideoEncoderAvgQP(e){this.videoAvgQp=e,this.pixelStreaming._onVideoEncoderAvgQP(this.videoAvgQp)}setKeyboardInputEnabled(e){var t;null===(t=this.keyboardController)||void 0===t||t.unregisterKeyBoardEvents(),e&&(this.keyboardController=this.inputClassesFactory.registerKeyBoard(this.config))}setMouseInputEnabled(e){var t;if(null===(t=this.mouseController)||void 0===t||t.unregisterMouseEvents(),e){const e=this.config.isFlagEnabled(ph.HoveringMouseMode)?Th.HoveringMouse:Th.LockedMouse;this.mouseController=this.inputClassesFactory.registerMouse(e)}}setTouchInputEnabled(e){var t;null===(t=this.touchController)||void 0===t||t.unregisterTouchEvents(),e&&(this.touchController=this.inputClassesFactory.registerTouch(this.config.isFlagEnabled(ph.FakeMouseWithTouches),this.videoElementParentClientRect))}setGamePadInputEnabled(e){var t;null===(t=this.gamePadController)||void 0===t||t.unregisterGamePadEvents(),e&&(this.gamePadController=this.inputClassesFactory.registerGamePad(),this.gamePadController.onGamepadConnected=()=>{this.streamMessageController.toStreamerHandlers.get("GamepadConnected")()},this.gamePadController.onGamepadDisconnected=e=>{this.streamMessageController.toStreamerHandlers.get("GamepadDisconnected")([e])})}registerDataChannelEventEmitters(e){e.onOpen=(e,t)=>this.pixelStreaming.dispatchEvent(new $u({label:e,event:t})),e.onClose=(e,t)=>this.pixelStreaming.dispatchEvent(new Wu({label:e,event:t})),e.onError=(e,t)=>this.pixelStreaming.dispatchEvent(new ju({label:e,event:t}))}registerMessageHandler(e,t,n){t===Nh.FromStreamer&&void 0===n&&au.Warning(au.GetStackTrace(),`Unable to register handler for ${e} as no handler was passed`),this.streamMessageController.registerMessageHandler(t,e,(s=>void 0===n&&t===Nh.ToStreamer?this.sendMessageController.sendMessageToStreamer(e,s):n(s)))}}class wg{static vertexShader(){return"\n\t\tattribute vec2 a_position;\n\t\tattribute vec2 a_texCoord;\n\n\t\t// input\n\t\tuniform vec2 u_resolution;\n\t\tuniform vec4 u_offset;\n\n\t\t//\n\t\tvarying vec2 v_texCoord;\n\n\t\tvoid main() {\n\t\t // convert the rectangle from pixels to 0.0 to 1.0\n\t\t vec2 zeroToOne = a_position / u_resolution;\n\n\t\t // convert from 0->1 to 0->2\n\t\t vec2 zeroToTwo = zeroToOne * 2.0;\n\n\t\t // convert from 0->2 to -1->+1 (clipspace)\n\t\t vec2 clipSpace = zeroToTwo - 1.0;\n\n\t\t gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);\n\t\t // pass the texCoord to the fragment shader\n\t\t // The GPU will interpolate this value between points.\n\t\t v_texCoord = (a_texCoord * u_offset.xy) + u_offset.zw;\n\t\t}\n\t\t"}static fragmentShader(){return"\n\t\tprecision mediump float;\n\n\t\t// our texture\n\t\tuniform sampler2D u_image;\n\n\t\t// the texCoords passed in from the vertex shader.\n\t\tvarying vec2 v_texCoord;\n\n\t\tvoid main() {\n\t\t gl_FragColor = texture2D(u_image, v_texCoord);\n\t\t}\n\t\t"}}class Eg{static deepCopyGamepad(e){return JSON.parse(JSON.stringify({buttons:e.buttons.map((e=>JSON.parse(JSON.stringify({pressed:e.pressed,touched:e.touched})))),axes:e.axes}))}}class Tg{constructor(e){this.toStreamerMessagesProvider=e,this.controllers=[]}updateStatus(e,t,n){if(e.gamepad){const s=t.getPose(e.gripSpace,n);if(!s)return;let r=0;e.profiles.includes("htc-vive")?r=1:e.profiles.includes("oculus-touch")&&(r=2),this.toStreamerMessagesProvider.toStreamerHandlers.get("XRSystem")([r]);let o=2;switch(e.handedness){case"left":o=0;break;case"right":o=1}const i=s.transform.matrix,a=[];for(let e=0;e<16;e++)a[e]=new Float32Array([i[e]])[0];this.toStreamerMessagesProvider.toStreamerHandlers.get("XRControllerTransform")([a[0],a[4],a[8],a[12],a[1],a[5],a[9],a[13],a[2],a[6],a[10],a[14],a[3],a[7],a[11],a[15],o]),void 0===this.controllers[o]&&(this.controllers[o]={prevState:void 0,currentState:void 0,id:void 0},this.controllers[o].prevState=Eg.deepCopyGamepad(e.gamepad)),this.controllers[o].currentState=Eg.deepCopyGamepad(e.gamepad);const l=this.controllers[o],c=l.currentState,d=l.prevState;for(let e=0;e<c.buttons.length;e++){const t=c.buttons[e],n=d.buttons[e];t.pressed?this.toStreamerMessagesProvider.toStreamerHandlers.get("XRButtonPressed")([o,e,n.pressed?1:0]):!t.pressed&&n.pressed&&this.toStreamerMessagesProvider.toStreamerHandlers.get("XRButtonReleased")([o,e,0]),t.touched&&!t.pressed?this.toStreamerMessagesProvider.toStreamerHandlers.get("XRButtonPressed")([o,3,n.touched?1:0]):!t.touched&&n.touched&&this.toStreamerMessagesProvider.toStreamerHandlers.get("XRButtonReleased")([o,3,0])}for(let e=0;e<c.axes.length;e++)this.toStreamerMessagesProvider.toStreamerHandlers.get("XRAnalog")([o,e,c.axes[e]]);this.controllers[o].prevState=c}}}class Mg{constructor(e){this.xrSession=null,this.webRtcController=e,this.xrControllers=[],this.xrGamepadController=new Tg(this.webRtcController.streamMessageController),this.onSessionEnded=new EventTarget,this.onSessionStarted=new EventTarget,this.onFrame=new EventTarget}xrClicked(){this.xrSession?this.xrSession.end():navigator.xr.requestSession("immersive-vr").then((e=>{this.onXrSessionStarted(e)}))}onXrSessionEnded(){au.Log(au.GetStackTrace(),"XR Session ended"),this.xrSession=null,this.onSessionEnded.dispatchEvent(new Event("xrSessionEnded"))}onXrSessionStarted(e){au.Log(au.GetStackTrace(),"XR Session started"),this.xrSession=e,this.xrSession.addEventListener("end",(()=>{this.onXrSessionEnded()}));const t=document.createElement("canvas");this.gl=t.getContext("webgl2",{xrCompatible:!0}),this.xrSession.updateRenderState({baseLayer:new XRWebGLLayer(this.xrSession,this.gl)});const n=this.gl.createShader(this.gl.VERTEX_SHADER);this.gl.shaderSource(n,wg.vertexShader()),this.gl.compileShader(n);const s=this.gl.createShader(this.gl.FRAGMENT_SHADER);this.gl.shaderSource(s,wg.fragmentShader()),this.gl.compileShader(s);const r=this.gl.createProgram();this.gl.attachShader(r,n),this.gl.attachShader(r,s),this.gl.linkProgram(r),this.gl.useProgram(r),this.positionLocation=this.gl.getAttribLocation(r,"a_position"),this.texcoordLocation=this.gl.getAttribLocation(r,"a_texCoord"),this.positionBuffer=this.gl.createBuffer(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.positionBuffer),this.gl.enableVertexAttribArray(this.positionLocation);const o=this.gl.createTexture();this.gl.bindTexture(this.gl.TEXTURE_2D,o),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.NEAREST),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.NEAREST),this.texcoordBuffer=this.gl.createBuffer(),this.resolutionLocation=this.gl.getUniformLocation(r,"u_resolution"),this.offsetLocation=this.gl.getUniformLocation(r,"u_offset"),e.requestReferenceSpace("local").then((e=>{this.xrRefSpace=e,this.xrSession.requestAnimationFrame(((e,t)=>this.onXrFrame(e,t)))})),this.onSessionStarted.dispatchEvent(new Event("xrSessionStarted"))}onXrFrame(e,t){const n=t.getViewerPose(this.xrRefSpace);if(n){const e=n.transform.matrix,t=[];for(let n=0;n<16;n++)t[n]=new Float32Array([e[n]])[0];this.webRtcController.streamMessageController.toStreamerHandlers.get("XRHMDTransform")([t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15]]);const s=this.xrSession.renderState.baseLayer;this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,s.framebuffer),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,this.webRtcController.videoPlayer.getVideoElement()),this.render(this.webRtcController.videoPlayer.getVideoElement())}this.webRtcController.config.isFlagEnabled(ph.XRControllerInput)&&this.xrSession.inputSources.forEach(((e,n,s)=>{this.xrGamepadController.updateStatus(e,t,this.xrRefSpace)}),this),this.xrSession.requestAnimationFrame(((e,t)=>this.onXrFrame(e,t))),this.onFrame.dispatchEvent(new hh({time:e,frame:t}))}render(e){if(!this.gl)return;const t=this.xrSession.renderState.baseLayer;let n,s,r,o,i;this.gl.viewport(0,0,t.framebufferWidth,t.framebufferHeight),this.gl.uniform4f(this.offsetLocation,1,1,0,0),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array([0,0,e.videoWidth,0,0,e.videoHeight,0,e.videoHeight,e.videoWidth,0,e.videoWidth,e.videoHeight]),this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.texcoordBuffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.positionBuffer),n=2,s=this.gl.FLOAT,r=!1,o=0,i=0,this.gl.vertexAttribPointer(this.positionLocation,n,s,r,o,i),this.gl.enableVertexAttribArray(this.texcoordLocation),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.texcoordBuffer),n=2,s=this.gl.FLOAT,r=!1,o=0,i=0,this.gl.vertexAttribPointer(this.texcoordLocation,n,s,r,o,i),this.gl.uniform2f(this.resolutionLocation,e.videoWidth,e.videoHeight);const a=this.gl.TRIANGLES;i=0,this.gl.drawArrays(a,i,6)}static isSessionSupported(e){return navigator.xr?navigator.xr.isSessionSupported(e):new Promise((()=>!1))}}class _g{constructor(e){this.editTextButton=null,this.hiddenInput=null,"ontouchstart"in document.documentElement&&this.createOnScreenKeyboardHelpers(e)}unquantizeAndDenormalizeUnsigned(e,t){return null}createOnScreenKeyboardHelpers(e){this.hiddenInput||(this.hiddenInput=document.createElement("input"),this.hiddenInput.id="hiddenInput",this.hiddenInput.maxLength=0,e.appendChild(this.hiddenInput)),this.editTextButton||(this.editTextButton=document.createElement("button"),this.editTextButton.id="editTextButton",this.editTextButton.innerHTML="edit text",e.appendChild(this.editTextButton),this.editTextButton.classList.add("hiddenState"),this.editTextButton.addEventListener("touchend",(e=>{this.hiddenInput.focus(),e.preventDefault()})))}showOnScreenKeyboard(e){if(e.showOnScreenKeyboard){this.editTextButton.classList.remove("hiddenState");const t=this.unquantizeAndDenormalizeUnsigned(e.x,e.y);this.editTextButton.style.top=t.y.toString()+"px",this.editTextButton.style.left=(t.x-40).toString()+"px"}else this.editTextButton.classList.add("hiddenState"),this.hiddenInput.blur()}}class kg{constructor(e){this.seq=e.Seq,this.playerSentTimestamp=Date.now(),this.requestFillerSize=e.Filler?e.Filler.length:0}update(e){this.playerReceivedTimestamp=Date.now(),this.streamerReceivedTimestamp=e.ReceivedTimestamp,this.streamerSentTimestamp=e.SentTimestamp,this.responseFillerSize=e.Filler?e.Filler.length:0}}class xg{constructor(e,t){this.sink=e,this.callback=t,this.records=new Map,this.seq=0}start(e){return!this.isRunning()&&(this.startTime=Date.now(),this.records.clear(),this.interval=setInterval((()=>{Date.now()-this.startTime>=e.duration?this.stop():this.sendRequest(e.requestSize,e.responseSize)}).bind(this),Math.floor(1e3/e.rps)),!0)}stop(){this.interval&&(clearInterval(this.interval),this.interval=void 0,this.callback(this.produceResult()))}produceResult(){const e=new Map(this.records);return{records:e,dataChannelRtt:Math.ceil(Array.from(this.records.values()).reduce(((e,t)=>e+(t.playerReceivedTimestamp-t.playerSentTimestamp)),0)/this.records.size),playerToStreamerTime:Math.ceil(Array.from(this.records.values()).reduce(((e,t)=>e+(t.streamerReceivedTimestamp-t.playerSentTimestamp)),0)/this.records.size),streamerToPlayerTime:Math.ceil(Array.from(this.records.values()).reduce(((e,t)=>e+(t.playerReceivedTimestamp-t.streamerSentTimestamp)),0)/this.records.size),exportLatencyAsCSV:()=>{let t="Timestamp;RTT;PlayerToStreamer;StreamerToPlayer;\n";return e.forEach((e=>{t+=e.playerSentTimestamp+";",t+=e.playerReceivedTimestamp-e.playerSentTimestamp+";",t+=e.streamerReceivedTimestamp-e.playerSentTimestamp+";",t+=e.playerReceivedTimestamp-e.streamerSentTimestamp+";",t+="\n"})),t}}}isRunning(){return!!this.interval}receive(e){if(!this.isRunning())return;if(!e)return void au.Error(au.GetStackTrace(),"Undefined response from server");let t=this.records.get(e.Seq);t&&t.update(e)}sendRequest(e,t){let n=this.createRequest(e,t),s=new kg(n);this.records.set(s.seq,s),this.sink(n)}createRequest(e,t){return{Seq:this.seq++,FillResponseSize:t,Filler:e?"A".repeat(e):""}}}class Pg{constructor(e,t){this.allowConsoleCommands=!1,this.config=e,(null==t?void 0:t.videoElementParent)&&(this._videoElementParent=t.videoElementParent),this._eventEmitter=new mh,this.configureSettings(),this.setWebRtcPlayerController(new Cg(this.config,this)),this.onScreenKeyboardHelper=new _g(this.videoElementParent),this.onScreenKeyboardHelper.unquantizeAndDenormalizeUnsigned=(e,t)=>this._webRtcController.requestUnquantizedAndDenormalizeUnsigned(e,t),this._activateOnScreenKeyboard=e=>this.onScreenKeyboardHelper.showOnScreenKeyboard(e),this._webXrController=new Mg(this._webRtcController)}get videoElementParent(){return this._videoElementParent||(this._videoElementParent=document.createElement("div"),this._videoElementParent.id="videoElementParent"),this._videoElementParent}configureSettings(){this.config._addOnSettingChangedListener(ph.IsQualityController,(e=>{!0!==e||this._webRtcController.isQualityController||this._webRtcController.sendRequestQualityControlOwnership()})),this.config._addOnSettingChangedListener(ph.AFKDetection,(e=>{this._webRtcController.setAfkEnabled(e)})),this.config._addOnSettingChangedListener(ph.MatchViewportResolution,(()=>{this._webRtcController.videoPlayer.updateVideoStreamSize()})),this.config._addOnSettingChangedListener(ph.HoveringMouseMode,(e=>{this.config.setFlagLabel(ph.HoveringMouseMode,`Control Scheme: ${e?"Hovering":"Locked"} Mouse`),this._webRtcController.setMouseInputEnabled(this.config.isFlagEnabled(ph.MouseInput))})),this.config._addOnSettingChangedListener(ph.KeyboardInput,(e=>{this._webRtcController.setKeyboardInputEnabled(e)})),this.config._addOnSettingChangedListener(ph.MouseInput,(e=>{this._webRtcController.setMouseInputEnabled(e)})),this.config._addOnSettingChangedListener(ph.TouchInput,(e=>{this._webRtcController.setTouchInputEnabled(e)})),this.config._addOnSettingChangedListener(ph.GamepadInput,(e=>{this._webRtcController.setGamePadInputEnabled(e)})),this.config._addOnNumericSettingChangedListener(vh.MinQP,(e=>{au.Log(au.GetStackTrace(),"-------- Sending MinQP --------",7),this._webRtcController.sendEncoderMinQP(e),au.Log(au.GetStackTrace(),"-------------------------------------------",7)})),this.config._addOnNumericSettingChangedListener(vh.MaxQP,(e=>{au.Log(au.GetStackTrace(),"-------- Sending encoder settings --------",7),this._webRtcController.sendEncoderMaxQP(e),au.Log(au.GetStackTrace(),"-------------------------------------------",7)})),this.config._addOnNumericSettingChangedListener(vh.WebRTCMinBitrate,(e=>{au.Log(au.GetStackTrace(),"-------- Sending web rtc settings --------",7),this._webRtcController.sendWebRTCMinBitrate(1e3*e),au.Log(au.GetStackTrace(),"-------------------------------------------",7)})),this.config._addOnNumericSettingChangedListener(vh.WebRTCMaxBitrate,(e=>{au.Log(au.GetStackTrace(),"-------- Sending web rtc settings --------",7),this._webRtcController.sendWebRTCMaxBitrate(1e3*e),au.Log(au.GetStackTrace(),"-------------------------------------------",7)})),this.config._addOnNumericSettingChangedListener(vh.WebRTCFPS,(e=>{au.Log(au.GetStackTrace(),"-------- Sending web rtc settings --------",7),this._webRtcController.sendWebRTCFps(e),au.Log(au.GetStackTrace(),"-------------------------------------------",7)})),this.config._addOnOptionSettingChangedListener(Ch.PreferredCodec,(e=>{this._webRtcController&&this._webRtcController.setPreferredCodec(e)})),this.config._registerOnChangeEvents(this._eventEmitter)}_activateOnScreenKeyboard(e){throw new Error("Method not implemented.")}_onInputControlOwnership(e){this._inputController=e}setWebRtcPlayerController(e){this._webRtcController=e,this._webRtcController.setPreferredCodec(this.config.getSettingOption(Ch.PreferredCodec).selected),this._webRtcController.resizePlayerStyle(),this.checkForAutoConnect()}connect(){this._eventEmitter.dispatchEvent(new Qu),this._webRtcController.connectToSignallingServer()}reconnect(){this._eventEmitter.dispatchEvent(new Ju),this._webRtcController.tryReconnect("Reconnecting...")}disconnect(){this._eventEmitter.dispatchEvent(new Xu),this._webRtcController.close()}play(){this._onStreamLoading(),this._webRtcController.playStream()}checkForAutoConnect(){console.log(this.config.isFlagEnabled(ph.AutoConnect),"====ssss"),this.config.isFlagEnabled(ph.AutoConnect)&&(this._onWebRtcAutoConnect(),this._webRtcController.connectToSignallingServer())}unmuteMicrophone(e=!1){if(!this.config.isFlagEnabled("UseMic"))return e?(this.config.setFlagEnabled("UseMic",!0),void this.reconnect()):void au.Warning(au.GetStackTrace(),"Trying to unmute mic, but PixelStreaming was initialized with no microphone track. Call with forceEnable == true to re-connect with a mic track.");this.setMicrophoneMuted(!1)}muteMicrophone(){this.config.isFlagEnabled("UseMic")?this.setMicrophoneMuted(!0):au.Info(au.GetStackTrace(),"Trying to mute mic, but PixelStreaming has no microphone track, so sending sound is already disabled.")}setMicrophoneMuted(e){var t,n,s,r;for(const o of null!==(r=null===(s=null===(n=null===(t=this._webRtcController)||void 0===t?void 0:t.peerConnectionController)||void 0===n?void 0:n.peerConnection)||void 0===s?void 0:s.getTransceivers())&&void 0!==r?r:[])Uh.canTransceiverSendAudio(o)&&(o.sender.track.enabled=!e)}_onWebRtcAutoConnect(){this._eventEmitter.dispatchEvent(new Uu)}_onWebRtcSdp(){this._eventEmitter.dispatchEvent(new zu)}_onStreamLoading(){this._eventEmitter.dispatchEvent(new qu)}_onDisconnect(e,t){this._eventEmitter.dispatchEvent(new Gu({eventString:e,allowClickToReconnect:t}))}_onWebRtcConnecting(){this._eventEmitter.dispatchEvent(new Vu)}_onWebRtcConnected(){this._eventEmitter.dispatchEvent(new Nu)}_onWebRtcFailed(){this._eventEmitter.dispatchEvent(new Hu)}_onVideoInitialized(){this._eventEmitter.dispatchEvent(new Ku),this._videoStartTime=Date.now()}_onLatencyTestResult(e){this._eventEmitter.dispatchEvent(new oh({latencyTimings:e}))}_onDataChannelLatencyTestResponse(e){this._eventEmitter.dispatchEvent(new ih({response:e}))}_onVideoStats(e){this._videoStartTime&&void 0!==this._videoStartTime||(this._videoStartTime=Date.now()),e.handleSessionStatistics(this._videoStartTime,this._inputController,this._webRtcController.videoAvgQp),this._eventEmitter.dispatchEvent(new sh({aggregatedStats:e}))}_onVideoEncoderAvgQP(e){this._eventEmitter.dispatchEvent(new Bu({avgQP:e}))}_onInitialSettings(e){var t;this._eventEmitter.dispatchEvent(new lh({settings:e})),e.PixelStreamingSettings&&(this.allowConsoleCommands=null!==(t=e.PixelStreamingSettings.AllowPixelStreamingCommands)&&void 0!==t&&t,!1===this.allowConsoleCommands&&au.Info(au.GetStackTrace(),"-AllowPixelStreamingCommands=false, sending arbitrary console commands from browser to UE is disabled."));const n=this.config.useUrlParams,s=new URLSearchParams(window.location.search);e.EncoderSettings&&(this.config.setNumericSetting(vh.MinQP,n&&s.has(vh.MinQP)?Number.parseInt(s.get(vh.MinQP)):e.EncoderSettings.MinQP),this.config.setNumericSetting(vh.MaxQP,n&&s.has(vh.MaxQP)?Number.parseInt(s.get(vh.MaxQP)):e.EncoderSettings.MaxQP)),e.WebRTCSettings&&(this.config.setNumericSetting(vh.WebRTCMinBitrate,n&&s.has(vh.WebRTCMinBitrate)?Number.parseInt(s.get(vh.WebRTCMinBitrate)):e.WebRTCSettings.MinBitrate/1e3),this.config.setNumericSetting(vh.WebRTCMaxBitrate,n&&s.has(vh.WebRTCMaxBitrate)?Number.parseInt(s.get(vh.WebRTCMaxBitrate)):e.WebRTCSettings.MaxBitrate/1e3),this.config.setNumericSetting(vh.WebRTCFPS,n&&s.has(vh.WebRTCFPS)?Number.parseInt(s.get(vh.WebRTCFPS)):e.WebRTCSettings.FPS))}_onQualityControlOwnership(e){this.config.setFlagEnabled(ph.IsQualityController,e)}_onPlayerCount(e){this._eventEmitter.dispatchEvent(new gh({count:e}))}requestLatencyTest(){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._webRtcController.sendLatencyTest(),!0)}requestDataChannelLatencyTest(e){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._dataChannelLatencyTestController||(this._dataChannelLatencyTestController=new xg(this._webRtcController.sendDataChannelLatencyTest.bind(this._webRtcController),(e=>{this._eventEmitter.dispatchEvent(new ah({result:e}))})),this.addEventListener("dataChannelLatencyTestResponse",(({data:{response:e}})=>{this._dataChannelLatencyTestController.receive(e)}))),this._dataChannelLatencyTestController.start(e))}requestShowFps(){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._webRtcController.sendShowFps(),!0)}requestIframe(){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._webRtcController.sendIframeRequest(),!0)}emitUIInteraction(e){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._webRtcController.emitUIInteraction(e),!0)}emitCommand(e){return!(!this._webRtcController.videoPlayer.isVideoReady()||!this.allowConsoleCommands&&"ConsoleCommand"in e||(this._webRtcController.emitCommand(e),0))}emitConsoleCommand(e){return!(!this.allowConsoleCommands||!this._webRtcController.videoPlayer.isVideoReady()||(this._webRtcController.emitConsoleCommand(e),0))}addResponseEventListener(e,t){this._webRtcController.responseController.addResponseEventListener(e,t)}removeResponseEventListener(e){this._webRtcController.responseController.removeResponseEventListener(e)}dispatchEvent(e){return this._eventEmitter.dispatchEvent(e)}addEventListener(e,t){this._eventEmitter.addEventListener(e,t)}removeEventListener(e,t){this._eventEmitter.removeEventListener(e,t)}toggleXR(){this.webXrController.xrClicked()}setSignallingUrlBuilder(e){this._webRtcController.signallingUrlBuilder=e}get webSocketController(){return this._webRtcController.webSocketController}get webXrController(){return this._webXrController}registerMessageHandler(e,t,n){t!==Nh.FromStreamer||void 0!==n?t===Nh.ToStreamer&&void 0===n?this._webRtcController.streamMessageController.registerMessageHandler(t,e,(t=>this._webRtcController.sendMessageController.sendMessageToStreamer(e,t))):this._webRtcController.streamMessageController.registerMessageHandler(t,e,(e=>n(e))):au.Warning(au.GetStackTrace(),`Unable to register an undefined handler for ${e}`)}get toStreamerHandlers(){return this._webRtcController.streamMessageController.toStreamerHandlers}isReconnecting(){return this._webRtcController.isReconnecting}}var Rg=n.Dz,Lg=n.g$,Ag=n.Lt,Og=n.Q9,Fg=n.qf,Ig=n.hV,Dg=n.z$,Bg=n.J0,zg=n.De,Ug=n.$C,Vg=n.al,Ng=n._W,Hg=n.Gv,Gg=n.m,$g=n.tz,Wg=n.Nu,jg=n.zg,Kg=n.vp,qg=n.vU,Qg=n.wF,Xg=n.rv,Jg=n.Nh,Yg=n.ss,Zg=n.qW,em=n.QL,tm=n.cf,nm=n.eM,sm=n.Yd,rm=n.Tk,om=n.iM,im=n.qy,am=n.ce,lm=n.sK,cm=n.Ok,dm=n.q5,um=n.g,hm=n.xl,gm=n.I,mm=n.bx,pm=n.dD,fm=n.Ib,vm=n.Az,Sm=n.Iw,ym=n.qY,bm=n.db,Cm=n.mR,wm=n.Tn,Em=n.rV,Tm=n.gh,Mm=n.Mi,_m=n.j,km=n.YB,xm=n.i5,Pm=n.x_,Rm=n.Am,Lm=n.eR,Am=n.r8,Om=n.u3,Fm=n.vd,Im=n.iV,Dm=n.jZ,Bm=n.SW,zm=n.ZH,Um=n.Ni,Vm=n.lh,Nm=n.bq,Hm=n.$f,Gm=n.eu,$m=n.Ax,Wm=n.Mc;export{Rg as AfkLogic,Lg as AfkTimedOutEvent,Ag as AfkWarningActivateEvent,Og as AfkWarningDeactivateEvent,Fg as AfkWarningUpdateEvent,Ig as AggregatedStats,Dg as CandidatePairStats,Bg as CandidateStat,zg as Config,Ug as ControlSchemeType,Vg as DataChannelCloseEvent,Ng as DataChannelErrorEvent,Hg as DataChannelLatencyTestResponseEvent,Gg as DataChannelLatencyTestResultEvent,$g as DataChannelOpenEvent,Wg as DataChannelStats,jg as EncoderSettings,Kg as EventEmitter,qg as Flags,Qg as HideFreezeFrameEvent,Xg as InboundAudioStats,Jg as InboundVideoStats,Yg as InitialSettings,Zg as InitialSettingsEvent,em as LatencyTestResultEvent,tm as LatencyTestResults,nm as LoadFreezeFrameEvent,sm as Logger,rm as MessageDirection,om as MessageRecv,im as MessageSend,am as MessageStreamerList,lm as NumericParameters,cm as OptionParameters,dm as OutBoundVideoStats,um as PixelStreaming,hm as PlayStreamErrorEvent,gm as PlayStreamEvent,mm as PlayStreamRejectedEvent,pm as PlayerCountEvent,fm as SettingBase,vm as SettingFlag,Sm as SettingNumber,ym as SettingOption,bm as SettingText,Cm as SettingsChangedEvent,wm as SignallingProtocol,Em as StatsReceivedEvent,Tm as StreamLoadingEvent,Mm as StreamPreConnectEvent,_m as StreamPreDisconnectEvent,km as StreamReconnectEvent,xm as StreamerListMessageEvent,Pm as TextParameters,Rm as UnquantizedAndDenormalizeUnsigned,Lm as VideoEncoderAvgQPEvent,Am as VideoInitializedEvent,Om as WebRTCSettings,Fm as WebRtcAutoConnectEvent,Im as WebRtcConnectedEvent,Dm as WebRtcConnectingEvent,Bm as WebRtcDisconnectedEvent,zm as WebRtcFailedEvent,Um as WebRtcPlayerController,Vm as WebRtcSdpEvent,Nm as WebSocketController,Hm as WebXRController,Gm as XrFrameEvent,$m as XrSessionEndedEvent,Wm as XrSessionStartedEvent};