quickvo-sdk-js 1.6.62 → 1.6.70

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.
Files changed (54) hide show
  1. package/dist/chunk-TkQbh5WD.js +61 -0
  2. package/dist/favicon.svg +1 -0
  3. package/dist/icons.svg +24 -0
  4. package/dist/index.js +25676 -27771
  5. package/dist/index.umd.cjs +4 -3
  6. package/dist/lib-DYp36HK6.js +10975 -0
  7. package/dist/src/QuickVO.d.ts +15 -25
  8. package/dist/src/action/ActionSFU.d.ts +52 -27
  9. package/dist/src/action/Task.d.ts +40 -0
  10. package/dist/src/base/Base.d.ts +5 -1
  11. package/dist/src/base/modules/Config.d.ts +14 -17
  12. package/dist/src/base/modules/Notifys.d.ts +7 -32
  13. package/dist/src/base/modules/Peer.d.ts +17 -7
  14. package/dist/src/base/modules/cws/CallsWebSocket.d.ts +12 -11
  15. package/dist/src/base/modules/cws/CallsWebSocketEvent.d.ts +6 -6
  16. package/dist/src/base/modules/cws/PrWebSocket.d.ts +7 -6
  17. package/dist/src/base/modules/cws/callLogStorage.d.ts +18 -0
  18. package/dist/src/base/modules/cws/quickvoCodecWorkerMain.d.ts +6 -0
  19. package/dist/src/base/modules/notifyPayloadMap.d.ts +119 -0
  20. package/dist/src/base/modules/users/Users.d.ts +58 -40
  21. package/dist/src/base/modules/users/modules/LocalTrackAnalysis.d.ts +6 -2
  22. package/dist/src/base/modules/users/modules/LocalUser.d.ts +8 -1
  23. package/dist/src/base/modules/users/modules/RemotePeerTrackAnalysis.d.ts +5 -1
  24. package/dist/src/base/modules/users/modules/RemoteUser.d.ts +9 -19
  25. package/dist/src/base/modules/users/modules/RemoteUserP2P.d.ts +15 -3
  26. package/dist/src/base/modules/users/modules/UserBase.d.ts +34 -95
  27. package/dist/src/base/modules/users/webrtcRtcStatsByTrack.d.ts +9 -0
  28. package/dist/src/base/modules/webmDurationFixWorkerMain.d.ts +6 -0
  29. package/dist/src/enums/eventName.d.ts +3 -1
  30. package/dist/src/enums/notifyName.d.ts +2 -1
  31. package/dist/src/index.d.ts +5 -0
  32. package/dist/src/protos/gen/modules/BaseData_pb.d.ts +94 -0
  33. package/dist/src/protos/gen/modules/Room_pb.d.ts +2200 -0
  34. package/dist/src/protos/gen/modules/Rtc_pb.d.ts +70 -0
  35. package/dist/src/protos/index.d.ts +4 -1
  36. package/dist/src/protos/protoCodec.d.ts +19 -0
  37. package/dist/src/protos/protoEvent.d.ts +133 -62
  38. package/dist/src/protos/protoPako.d.ts +4 -0
  39. package/dist/src/tools.d.ts +29 -1
  40. package/dist/src/types.d.ts +42 -68
  41. package/dist/src/workers/cwsCodec/CwsCodecCore.d.ts +7 -0
  42. package/dist/src/workers/cwsCodec/CwsCodecWorker.d.ts +15 -0
  43. package/dist/src/workers/cwsCodec/cwsCodec.worker.d.ts +1 -0
  44. package/dist/src/workers/cwsCodec/type.d.ts +33 -0
  45. package/dist/src/workers/webmFix/WebmFixCore.d.ts +3 -0
  46. package/dist/src/workers/webmFix/WebmFixWorker.d.ts +13 -0
  47. package/dist/src/workers/webmFix/type.d.ts +22 -0
  48. package/dist/src/workers/webmFix/webmDurationFixInterop.d.ts +5 -0
  49. package/dist/src/workers/webmFix/webmFix.worker.d.ts +1 -0
  50. package/package.json +9 -6
  51. package/dist/src/action/PublisherController.d.ts +0 -16
  52. package/dist/src/action/subscriberController.d.ts +0 -15
  53. package/dist/src/protos/compiled.d.ts +0 -8254
  54. package/dist/vite.svg +0 -1
@@ -1,4 +1,5 @@
1
- (function(b,m){typeof exports=="object"&&typeof module<"u"?m(exports):typeof define=="function"&&define.amd?define(["exports"],m):(b=typeof globalThis<"u"?globalThis:b||self,m(b["quickvo-sdk-js"]={}))})(this,(function(exports){"use strict";const at=(b,m={})=>{const u={unit:"B",splitStr:" ",...m};let{unit:T,splitStr:r}=u;const c=["B","KB","MB","GB","TB","PB","EB","ZB","YB","DB","NB"],e=c.findIndex(z=>z===T),t=c.slice(e+1,c.length);let i=`${b}`;const _=i[0]==="-";_&&(i=i.replace("-",""));const I=i.split(""),x=U(I,4).reverse();let M="",j=0;for(const z of x)if(M=`${z.join("")}${M}`,j=+`${M}`,!(j<1024)){for(const Q of t)if(T=Q,j=j/1024,Math.abs(j)<1024)break}return`${_?"-":""}${j.toFixed(2)}${r}${T}`},L=(b,m=[])=>{const u={...b},T=Object.keys(u);for(const r of T)m.findIndex(c=>String(c)===r)===-1&&delete u[r];return u},U=(b,m)=>{const u=Math.max(1,m),T=Math.ceil(b.length/u),r=[];for(let c=0;c<T;c++){const e=c*u,t=Math.min(e+u,b.length);r.push(b.slice(e,t))}return r},pt=(b,m=[])=>{const u=[];for(const T of b){const r=L(T,m);u.push(r)}return u},Yt=(b,m="value",u="label")=>{const T=[],r=Object.entries(b);for(const[c,e]of r){const t={[u]:e,[m]:c};T.push(t)}return T},gt=(b,m=1e-4)=>{if(!b){const c=window.AudioContext||window.webkitAudioContext;b=new c}const u=b.createOscillator();u.type="sine",u.frequency.setValueAtTime(1,b.currentTime);const T=b.createGain();T.gain.setValueAtTime(m,b.currentTime),u.connect(T);const r=b.createMediaStreamDestination();return T.connect(r),u.start(b.currentTime),r.stream},wt=({width:b=32,height:m=32,opacity:u=1,fps:T=20,text:r=""})=>{T=Math.min(T,30);const c=document.createElement("canvas"),e=c.getContext("2d");c.width=b,c.height=m;let t=0;const i=c.captureStream(T),_=()=>{e.clearRect(0,0,c.width,c.height);const I=e.createLinearGradient(0,0,c.width,c.height);if(I.addColorStop(0,`hsla(${t}, 100%, 50%, ${u})`),I.addColorStop(1,`hsla(${t+120}, 100%, 50%, ${u})`),e.fillStyle=I,e.fillRect(0,0,c.width,c.height),r){const x=Math.min(b,m)*.8;e.font=`bold ${x/r.length}px Arial`,e.textAlign="center",e.textBaseline="middle",e.fillStyle=`rgba(255, 255, 255, ${u})`,e.fillText(r,c.width*.5,c.height*.5)}t=(t+1)%360,i.active&&setTimeout(_,Math.round(1e3/T))};return _(),i},R=(b=0,m=1)=>{const u=Math.max(0,b),T=Math.max(1,m),r=Math.min(u,T),c=Math.max(u,T),e=Math.random()*(c-r+1)+r;return parseInt(`${e}`,10)},bt=(b=16,m=16)=>{const u="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),T=Math.min(u.length,m),r=Date.now().toString(T),c=r.split(""),e=Math.max(4,b-r.length);for(let t=0;t<e;t++){const i=R(0,T-1),_=u[i];c.push(_)}return c.join("").toUpperCase()},E$1=(b,m)=>{try{let u=Number(b);if(isNaN(u)){const T=new Date(`${b}`);if(`${T}`=="Invalid Date")return 0;u=T.getTime()}if(m!==void 0){const T=new Date().getTimezoneOffset();u+=(T+m)*60*1e3}return u}catch(u){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:b,_offset:m,error:u}),0}},V=1e3,H=6e4,v$2=36e5,$=864e5,X={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六","07":"日"},W$1=b=>E$1(b),p$1=(b,m="YYYY-MM-DD hh:mm:ss",u={})=>{const T={empty_str:"-",...u},{empty_str:r,offset:c}=T,e=E$1(b,c);if(Number(b)!==0&&e===0)return r;const t=new Date(e),i=`${t.getFullYear()}`,_=`${t.getMonth()+1}`,I=`${["1","2","3"].includes(_)?1:["4","5","6"].includes(_)?2:["7","8","9"].includes(_)?3:4}`,x=`${t.getDate()}`,M=`${t.getDay()===0?7:t.getDay()}`,j=`${t.getHours()}`,z=`${t.getMinutes()}`,Q=`${t.getSeconds()}`,ne=`${Math.ceil((e-W$1(`${i}/01/01 00:00:00`)+1)/864e5)}`,K=`${Math.ceil(((e-W$1(`${i}/01/01 00:00:00`))/864e5-Number(M))/7)+1}`,oe=[{k:"Y+",v:i},{k:"M+",v:_},{k:"Q+",v:I},{k:"D+",v:x},{k:"W+",v:M},{k:"h+",v:j},{k:"m+",v:z},{k:"s+",v:Q},{k:"d+",v:ne},{k:"w+",v:K}];let ue;for(let{k:G,v:ie}of oe)if(ue=new RegExp(`(${G})`).exec(m),ue){const le=ue[1];let re=ie.padStart(le.length,"0");le.includes("W")&&(re=X[re.slice(0,2)]),m=m.replace(le,re)}return m},St=(b,m="hh:mm:ss")=>{const u=`${Math.floor(b/864e5)}`;m.includes("D")&&(b=b%864e5);const T=`${Math.floor(b/36e5)}`;m.includes("h")&&(b=b%36e5);const r=`${Math.floor(b/6e4)}`;m.includes("m")&&(b=b%6e4);const c=`${Math.floor(b/1e3)}`;m.includes("s")&&(b=b%1e3);const e=[{k:"D+",v:u},{k:"h+",v:T},{k:"m+",v:r},{k:"s+",v:c}];let t;for(let{k:i,v:_}of e)if(t=new RegExp(`(${i})`).exec(m),t){const I=t[1];let x=_.padStart(I.length,"0");m=m.replace(I,x)}return m},$t=(b,m={})=>new Promise(async(u,T)=>{const{timeout:r=5*1e3,message:c="timeout"}=m,e=setTimeout(()=>T(c),r);try{const t=await b();u(t)}catch(t){T(t)}clearTimeout(e)}),isMobile=()=>{const b=navigator.userAgent.toLowerCase();return new RegExp("mobile|android|iphone|ipad|ipod|windows phone|phone|webos","i").test(b)},getNetworkQuality=(b,m,u)=>{let T=0;return b<.03&&m<100&&u<50?T=5:b<.06&&m<160&&u<100?T=4:b<.1&&m<250&&u<150?T=3:b<.15&&m<400&&u<200?T=2:T=1,T},availableWeight=[.05,.05,.05,.05,.1,.1,.1,.15,.15,.2].reverse(),estimateDataByResolution=(b,m)=>{const c=2073600/(b*m);return Math.round(307200/Math.pow(c,.9))},sortByMimeTypes=(b,m)=>b.sort((u,T)=>{const r=m.indexOf(u.mimeType),c=m.indexOf(T.mimeType),e=r>=0?r:Number.MAX_VALUE,t=c>=0?c:Number.MAX_VALUE;return e-t}),enum_callStrategy={qualityPriority:"画质优先",fluencyPriority:"流畅度优先",balancedDowngrade:"均衡降级"},callStrategy_options=Yt(enum_callStrategy),callStrategy_keys=Object.keys(enum_callStrategy),callStrategy_vals=Object.values(enum_callStrategy),enum_eventName={heartbeat:"心跳",heartbeatEx:"慢心跳",ackMsg:"确认收到消息",reportNetwork:"上报网络类型",connectCF:"连接CF",publish:"发布流",joinRoom:"加入房间",joinRoomEx:"加入房间(提前建连)",pubNotify:"广播已发布的轨道",subscribe:"订阅流",renegotiate:"协商流",closeTrack:"关闭轨道",preventUsersBehavior:"阻止用户行为",networkQualityChange:"更新网络状态",updateCall:"更新通话状态",updateSimulcast:"切换大小流",toggleRoomSpeechLang:"切换房间语音识别",syncRoomInfo:"同步房间",updateRoomToken:"更新房间SDKTOKEN",offer:"发送P2P-offer",answer:"回应P2P-answer",candidate:"发送P2P候选信息-candidate",reportP2PConnectEx:"上报P2P连接结果",quitRoom:"退出房间",quitRoomEx:"退出房间不断开连接",debugger:"调试",ai:"WorkerAi调试",UpdateTrackActive:"p2p轨道状态"},eventName_options=Yt(enum_eventName),eventName_keys=Object.keys(enum_eventName),eventName_vals=Object.values(enum_eventName),enum_notifyName={onNetQuality:"网络质量回调",onJoinRoom:"加入房间回调",onJoinRoomBatch:"加入房间批量回调",onQuitRoom:"退出房间回调",onQuitRoomBatch:"退出房间批量回调",onPublish:"监听到流发布",onCloseTrack:"关闭轨道",onUpdateCall:"更新通讯状态",onTrackInactive:"通知轨道失效",onRoomActionChange:"房间内的全体禁言状态发生变化",onMeetSpecialRolesChange:"房间内的管理员发生变化",onAttemptP2PEx:"建立P2P连接",onOffer:"收到P2P-offer",onAnswer:"收到P2P-answer",onCandidate:"收到P2P候选信息-candidate",onDisconnectedP2P:"断开P2P",onUpdatePermissions:"更新推流权限通知",onUpdatePermissionsBatch:"批量更新推流权限通知",onBeforeTokenExpire:"Token即将过期",onTokenExpired:"Token已过期",onDestroyRoom:"销毁房间",onUpdateBehavior:"行为允许权限变更",onCDNPlayUrlAdd:"cdn播放地址变化",onRoomUserSpeech:"用户讲话"},notifyName_options=Yt(enum_notifyName),notifyName_keys=Object.keys(enum_notifyName),notifyName_vals=Object.values(enum_notifyName),enum_mediaType={mc_audio:"麦克风-默认轨道",mc_video:"摄像头-默认轨道",ss_video:"屏幕共享-视频轨道",ss_audio:"屏幕共享-音频轨道"},mediaType_options=Yt(enum_mediaType),mediaType_keys=Object.keys(enum_mediaType),mediaType_vals=Object.values(enum_mediaType),enum_quality={0:"未知",1:"极差",2:"较差",3:"一般",4:"很好",5:"极好"},quality_options=Yt(enum_quality),quality_keys=Object.keys(enum_quality),quality_vals=Object.values(enum_quality),enum_roomState={ready:"已就绪",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",closed:"已关闭"},roomState_options=Yt(enum_roomState),roomState_keys=Object.keys(enum_roomState),roomState_vals=Object.values(enum_roomState),enum_trackType={0:"麦克风-默认轨道",1:"摄像头-默认轨道",2:"屏幕共享-视频轨道",3:"屏幕共享-音频轨道"},trackType_options=Yt(enum_trackType),trackType_keys=Object.keys(enum_trackType),trackType_vals=Object.values(enum_trackType);let Config$1=class{url="";appid="";debug=!1;reportErr=!0;logUrl="https://logs1.quickvo.org";sdkToken="";roomId="";userId="";callType=1;banAction=0;banActionStr="0000";banActionMap={mc_audio:!1,mc_video:!1,ss_audio:!1,ss_video:!1};stt=!0;lang={input:"",output:"",translateEnable:!1};useP2P=!0;newPublishAutoSubscribe=!0;roomState="ready";peerState="new";serviceVersion="1.0.8";callSession="";isEarly=!1;earlyId=bt();isInRoom=!1;sfuPriority=-1;network={sfu:{inboundBytes:0,outboundBytes:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,velocityPush:0,velocityPull:0},p2p:{inboundBytes:0,outboundBytes:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,velocityPush:0,velocityPull:0}};codecPreferences={audio:[],video:[]};constructor(){{const m=RTCRtpReceiver.getCapabilities("video").codecs,u=["video/H264","video/VP8","video/VP9"];this.codecPreferences.video=sortByMimeTypes(m,u)}}updateRoomAction=m=>{this.banAction=m,this.banActionStr=Number(this.banAction).toString(2).padStart(4,"0");const u=this.banActionStr.split(""),[T,r,c,e]=u;this.banActionMap={mc_audio:!!Number(e),mc_video:!!Number(c),ss_video:!!Number(r),ss_audio:!!Number(r)}};createRoomAction=m=>{const{ss_audio:u,ss_video:T,mc_video:r,mc_audio:c}=this.banActionMap,e={ss_audio:u,ss_video:T,mc_video:r,mc_audio:c};for(const t of mediaType_keys){const i=m[t];i!==void 0&&(e[t]=i)}{const{ss_audio:t,ss_video:i,mc_video:_,mc_audio:I}=e;return parseInt(`${t?1:0}${i?1:0}${_?1:0}${I?1:0}`,2)}};getRoomAction=()=>this.banActionMap;setOptions=m=>{const u=Object.keys(m);for(const T of u){if(m[T]===void 0)continue;const r=m[T];this[T]=r}};createWsUrl=()=>{const{appid:m,roomId:u,userId:T,isEarly:r,earlyId:c,serviceVersion:e}=this;if(!m)throw new Error("quickvo: createSession is error. You must first use QuickVO.setOptions to set the appid.");const t={c:m,r:u,p:"web",h:location.hostname,v:e};r?t.i=c:t.b=T;const i=btoa(encodeURI(JSON.stringify(t))),_=`${this.url}?s=${i}&t=${Date.now()}`;return this.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWsUrl",{data:t,url:_}),_}};class Traffic{sfu={outboundBytes:0,inboundBytes:0};p2p={outboundBytes:0,inboundBytes:0};getUse=(m="b")=>{let u=1;return m==="kb"&&(u=1024),{sfu:{outboundBytes:Math.round(this.sfu.outboundBytes/u),inboundBytes:Math.round(this.sfu.inboundBytes/u)},p2p:{outboundBytes:Math.round(this.p2p.outboundBytes/u),inboundBytes:Math.round(this.p2p.inboundBytes/u)}}};clear=()=>{}}class Notifys{queue=new Map;emit=(m,u)=>{const T=this.queue.get(m)||[];for(const r of T){const{callback:c=()=>{}}=r;c(u)}};add=m=>{const{event:u,sn:T=bt(32)}=m;this.queue.has(u)||this.queue.set(u,[]);const r=this.queue.get(u)||[],c=r.findIndex(e=>e.sn===T);return c!==-1&&r.splice(c,1),r.push(m),T}}class LocalTrackAnalysis{types=["outbound-rtp","remote-inbound-rtp","media-source","codec"];trackReport={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:"unknown",payloadType:0,sdpFmtpLine:"",frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0};transmittedPackets=0;transmittedPacketsLost=0;averageQualitys=[];averageOffsetBytesSents=[];isAvailable=[];availableScore=[];constructor(){}generate=async(m,u)=>{try{if(u===void 0)throw new Error("Peer track is undefined.");if(m.connectionState!=="connected")throw new Error(`Peer connectionState is ${m.connectionState}.`);const r=[...(await m.getStats(u)).values()],c={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:"unknown",payloadType:0,sdpFmtpLine:"",frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0};let e=0,t=0;for(const i of r){const{type:_}=i;if(this.types.includes(_))switch(_){case"codec":{const{mimeType:I,payloadType:x,sdpFmtpLine:M}=i;c.mimeType=I,c.payloadType=x,c.sdpFmtpLine=M}break;case"outbound-rtp":{const{bytesSent:I,packetsSent:x,frameWidth:M=0,frameHeight:j=0,framesPerSecond:z=0}=i;e=x,c.bytesSent=I,c.frameWidth=M,c.frameHeight=j,c.framesPerSecond=z}break;case"remote-inbound-rtp":{const{packetsLost:I=0,roundTripTime:x=0,jitter:M=0}=i;t=I,c.roundTripTime=Math.round(x*1e3),c.jitter=Math.round(M*1e3)}break}}if(t!==0){const i=e-this.transmittedPackets,_=t-this.transmittedPacketsLost,I=i+_;c.lostRate=I===0?0:Math.round(_/I*1e4)/1e4,this.transmittedPackets=e,this.transmittedPacketsLost=t}{const{lostRate:i,roundTripTime:_,jitter:I}=c;c.quality=getNetworkQuality(i,_,I),this.averageQualitys.unshift(c.quality),this.averageQualitys=this.averageQualitys.slice(0,10)}this.averageQualitys.length>=10&&(c.averageQuality=this.averageQualitys.length<10?0:Math.round(this.averageQualitys.reduce((i,_)=>i+_)/this.averageQualitys.length)),c.offsetBytesSent=Math.max(0,c.bytesSent-this.trackReport.bytesSent),this.averageOffsetBytesSents.unshift(c.offsetBytesSent),this.averageOffsetBytesSents=this.averageOffsetBytesSents.slice(0,5),c.averageOffsetBytesSent=this.averageOffsetBytesSents.length===0?0:Math.round(this.averageOffsetBytesSents.reduce((i,_)=>i+_)/this.averageOffsetBytesSents.length);{const{frameWidth:i,frameHeight:_,mimeType:I}=c;if(I){if(I.includes("audio"))this.isAvailable.unshift(1);else if(i&&_){const x=Math.round(estimateDataByResolution(i,_)/3),M=c.offsetBytesSent>=x?1:0;this.isAvailable.unshift(M)}this.isAvailable=this.isAvailable.slice(0,10)}}{const i=this.isAvailable.length;let _=0;const I=[];for(let x=0;x<i;x++){const M=this.isAvailable[x]*availableWeight[x];_+=M,I.push(M)}this.availableScore=I,c.availableScore=Math.round(_*100)/100}this.trackReport=c}catch{this.clear()}return this.trackReport};clear=()=>{this.trackReport={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:"unknown",payloadType:0,sdpFmtpLine:"",frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0},this.transmittedPackets=0,this.transmittedPacketsLost=0,this.averageQualitys=[],this.averageOffsetBytesSents=[],this.availableScore=[],this.isAvailable=[]}}let d$1=class{inputStream=new MediaStream;outputStream=new MediaStream;inputGain=1;enhanceGain=1;bgsGain=1;bgmGain=1;outputGain=1;mixAudioMap=new Map;audioContext=new AudioContext;sourceNode;inputGainNode;enhanceGainNode;bgsGainNode;bgmGainNode;rnnoiseNode;analyserNode;analyserArrayData;outputGainNode;destinationNode;denoise=!1;mute=!0;rnnoiseWorklet;rnnoiseWorkletNode;filterStream=m=>m;constructor(m,u){this.inputStream=m,u&&(this.audioContext=u),this.sourceNode=this.audioContext.createMediaStreamSource(this.inputStream),this.inputGainNode=this.audioContext.createGain(),this.inputGainNode.gain.setValueAtTime(this.inputGain,this.audioContext.currentTime),this.enhanceGainNode=this.audioContext.createGain(),this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime),this.bgsGainNode=this.audioContext.createGain(),this.bgsGainNode.gain.setValueAtTime(this.bgsGain,this.audioContext.currentTime),this.bgmGainNode=this.audioContext.createGain(),this.bgmGainNode.gain.setValueAtTime(this.bgmGain,this.audioContext.currentTime),this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=512,this.analyserArrayData=new Uint8Array(this.analyserNode.frequencyBinCount),this.outputGainNode=this.audioContext.createGain(),this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime),this.destinationNode=this.audioContext.createMediaStreamDestination(),this.outputStream=this.destinationNode.stream;{const{sourceNode:T,inputGainNode:r,enhanceGainNode:c,bgsGainNode:e,bgmGainNode:t,analyserNode:i,outputGainNode:_,destinationNode:I}=this;T.connect(r),r.connect(c),c.connect(i),e.connect(i),t.connect(i),c.connect(I),e.connect(I),t.connect(I),_.connect(this.audioContext.destination)}this.audioContext.resume()}use=({rnnoise:m})=>{this.rnnoiseWorklet=new m.RnnoiseWorklet};_changeSource=()=>{this.sourceNode.disconnect(),this.sourceNode=this.audioContext.createMediaStreamSource(this.inputStream),this.sourceNode.connect(this.inputGainNode)};replaceTrack=m=>{const u=this.inputStream.getTracks();for(const T of u)this.inputStream.removeTrack(T);this.inputStream.addTrack(m),this._changeSource()};stop=()=>{{const m=this.inputStream.getTracks();for(const u of m)u.stop(),this.inputStream.removeTrack(u)}};pause=async m=>{const u=this.inputStream.getTracks();for(const T of u)T.enabled=!m};getStream=()=>this.filterStream(this.outputStream);setMute=(m=!0)=>{this.mute=m,this.analyserNode.disconnect(),m===!1&&this.analyserNode.connect(this.outputGainNode)};setDenoise=async(m=!0)=>{this.rnnoiseWorklet&&(this.inputGainNode.disconnect(),this.rnnoiseWorklet.destroy(),m?(this.rnnoiseWorkletNode=await this.rnnoiseWorklet.createRnnoiseWorkletNode(this.audioContext),this.inputGainNode.connect(this.rnnoiseWorkletNode),this.rnnoiseWorkletNode.connect(this.enhanceGainNode)):this.inputGainNode.connect(this.enhanceGainNode),this.denoise=m)};setInputGain=m=>{this.inputGain=m,this.inputGainNode.gain.setValueAtTime(m,this.audioContext.currentTime)};setEnhanceGain=async m=>{this.enhanceGain=m+1,this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime)};setBgsGain=m=>{this.bgsGain=m,this.bgsGainNode.gain.setValueAtTime(m,this.audioContext.currentTime)};setBgmGain=m=>{this.bgmGain=m,this.bgmGainNode.gain.setValueAtTime(m,this.audioContext.currentTime)};setOutputGain=m=>{this.outputGain=m,this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime)};getVolume=()=>{const{analyserNode:m,analyserArrayData:u}=this;m.getByteFrequencyData(u);let T=0;for(let r=0;r<u.length;r++)T+=u[r];return Math.ceil(T/u.length)};mixAudio=(m,u="bgm")=>new Promise(async(T,r)=>{try{{const t=this.mixAudioMap.get(u);t&&t.stop()}const c=u==="bgs"?this.bgsGainNode:this.bgmGainNode,e=this.audioContext.createBufferSource();this.mixAudioMap.set(u,e),e.buffer=m,e.connect(c),e.onended=()=>{e.disconnect(c),this.mixAudioMap.delete(u),T(!0)},e.start(0)}catch(c){r(c)}});mixAudioStop=m=>{this.mixAudioMap.get(m)?.stop()};changeMix=(m,u)=>{const T=m==="bgs"?this.bgsGainNode:this.bgmGainNode;u?T.connect(this.destinationNode):T.disconnect(this.destinationNode)}};class UserBase{config;localMedias;id="";callAction=0;callActionStr="";callActionMap={};permissions=1;permissionsStr="0001";permissionsMap={subscribe:!1,publish:!1};banBehavior=0;banBehaviorStr="";banBehaviorMap={};isSelf=!1;isOwner=!1;isAdmin=!1;network={egress:0,ingress:0};tracks={};streamControls={};streams={mc_audio:new MediaStream,mc_video:new MediaStream,ss_video:new MediaStream,ss_audio:new MediaStream};published={};subscribed={};constructor({config:m,localMedias:u}){this.config=m,this.localMedias=u;for(const T of mediaType_keys)switch(T){case"mc_audio":case"ss_audio":{const r=new MediaStream,c=this.localMedias.getPhoneyStreamTrack(T);r.addTrack(c);const e=new d$1(r,this.localMedias.audioContext);this.streamControls[T]=e,this.streams[T]=e.getStream()}break;default:{const r=new MediaStream,c=this.localMedias.getPhoneyStreamTrack(T);r.addTrack(c),this.streams[T]=r}break}}setMute=(m,u)=>{for(const T of m){const r=this.streamControls[T];r&&r.setMute(u)}};setTracksPublished=(m,u)=>{for(const T of m)this.published[T]=u};setTracksSubscribed=(m,u)=>{for(const T of m)this.subscribed[T]=u};updateCallAction=m=>{this.callAction=m,this.callActionStr=Number(this.callAction).toString(2).padStart(4,"0");const u=this.callActionStr.split(""),[T,r,c,e]=u;this.callActionMap={mc_audio:!!Number(e),mc_video:!!Number(c),ss_video:!!Number(r),ss_audio:!!Number(T)}};updatePermissions=m=>{this.permissions=m,this.permissionsStr=Number(this.permissions).toString(2).padStart(4,"0");const u=this.permissionsStr.split(""),[T,r]=u.reverse();this.permissionsMap={publish:!!Number(r),subscribe:!!Number(T)}};updateBanBehavior=m=>{this.banBehavior=m,this.banBehaviorStr=Number(this.banBehavior).toString(2).padStart(4,"0");const u=this.banBehaviorStr.split(""),[T,r,c,e]=u;this.banBehaviorMap={mc_audio:!!Number(e),mc_video:!!Number(c),ss_video:!!Number(r),ss_audio:!!Number(T)}};updateNetwork=m=>{const{egress:u,ingress:T}=this.network,r=m.egress===u&&m.ingress===T;return r===!1&&(this.network=m),r};updateTracks=(m,u=!1)=>{const T=this.isSelf?"local":"remote",r=!this.isSelf,c=this.id;for(const e of m){const{type:t}=e,i=mediaType_keys[t];if(u)this.tracks[i]={enabled:r,...e,location:T,mediaType:i,origin:"unknown",userId:c};else{const _=this.tracks[i];this.tracks[i]={enabled:r,..._,...e,location:T,mediaType:i,origin:"unknown",userId:c}}}};getTrack=m=>this.tracks[m];getTracks=m=>{const u=[];for(const T of m){const r=this.tracks[T];r&&u.push(r)}return u};removeTracks=m=>{const u=[];for(const T of m){const r=this.tracks[T];r&&(u.push(r),delete this.tracks[T])}return u};replaceMediaStreamTrack=(m,u)=>{switch(m){case"mc_audio":case"ss_audio":this.streamControls[m]?.replaceTrack(u);break;default:{const T=this.streams[m],r=T.getTracks();for(const c of r)T.removeTrack(c);T.addTrack(u)}break}};getStream=m=>{const u=this.streams[m];if(!u)throw new Error(`There is no mediaTrack of type streams[${JSON.stringify(m)}].`);return u};getStreams=()=>this.streams;getUserMediaStreamContext=m=>this.streamControls[m];usePhoneyStream=m=>{for(const u of m){const T=this.localMedias.getPhoneyStreamTrack(u);this.replaceMediaStreamTrack(u,T);const r=this.getTrack(u);r&&(r.origin="phoney",r.msid="",r.enabled=!1)}};getInfo=()=>{const{id:m,callAction:u,callActionStr:T,callActionMap:r,permissions:c,permissionsStr:e,permissionsMap:t,banBehavior:i,banBehaviorStr:_,banBehaviorMap:I,isOwner:x,isSelf:M,isAdmin:j,network:z}=this,Q=[];for(const ne of mediaType_keys){if(!this.published[ne])continue;const oe={...this.tracks[ne]};oe&&Q.push(oe)}return{id:m,callAction:u,callActionStr:T,callActionMap:r,permissions:c,permissionsStr:e,permissionsMap:t,banBehavior:i,banBehaviorStr:_,banBehaviorMap:I,isOwner:x,isAdmin:j,isSelf:M,network:z,tracks:Q}}}class LocalUser extends UserBase{tracksAnalysis={sfu:{sends:{mc_audio:new LocalTrackAnalysis,mc_video:new LocalTrackAnalysis,ss_video:new LocalTrackAnalysis,ss_audio:new LocalTrackAnalysis}}};constructor({config:m,localMedias:u}){super({config:m,localMedias:u}),this.isSelf=!0}getTrackReports=m=>this.tracksAnalysis.sfu.sends[m].trackReport;generateTrackAnalysis=async m=>{for(const u of mediaType_keys){const T=m.getSenderTrack(u);await this.tracksAnalysis.sfu.sends[u].generate(m.pc,T)}};setActiveNoise=(m,u)=>{this.getUserMediaStreamContext(m)?.setDenoise(u)};updateSelfCallAction=()=>{let m="";const u=r=>{const c=mediaType_keys[r];return this.tracks[c]?.enabled===!0?"1":"0"};m=`${u(0)}${m}`,m=`${u(1)}${m}`,m=`${u(2)}${m}`,m=`${u(3)}${m}`;const T=parseInt(m,2);return this.updateCallAction(T),T};checkBanBehavior=m=>{const{banBehaviorMap:u}=this;let T=!0;for(const r of m)if(u[r]===!0){T=!1;break}return T};hasPermissions=m=>this.config.callType===1||this.isAdmin===!0?!0:this.permissionsMap[m];useLocalStream=m=>{for(const u of m){const T=this.localMedias.getLocalStreamTrack(u);if(!T)continue;this.replaceMediaStreamTrack(u,T);const r=this.getTrack(u);r&&(r.origin="local",r.msid="",r.enabled=!0)}};clear=()=>{this.tracks={},this.network={egress:0,ingress:0},this.published={}}}const types=["remote-outbound-rtp","inbound-rtp","candidate-pair","media-source","codec"];class RemotePeerTrackAnalysis{reports=[];trackReport={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:"unknown",payloadType:0,sdpFmtpLine:"",frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0};transmittedPackets=0;transmittedPacketsLost=0;averageQualitys=[];averageOffsetBytesSents=[];isAvailable=[];availableScore=[];constructor(){}generate=async(m,u)=>{try{if(u===void 0)throw new Error("Peer track is undefined.");if(m.connectionState!=="connected")throw new Error(`Peer connectionState is ${m.connectionState}.`);const r=[...(await m.getStats(u)).values()],c={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:"unknown",payloadType:0,sdpFmtpLine:"",frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0};let e=0,t=0;for(const i of r){const{type:_}=i;if(types.includes(_))switch(_){case"codec":{const{mimeType:I,payloadType:x,sdpFmtpLine:M}=i;c.mimeType=I,c.payloadType=x,c.sdpFmtpLine=M}break;case"remote-outbound-rtp":break;case"inbound-rtp":{const{bytesReceived:I,packetsReceived:x,packetsLost:M=0,jitter:j=0,frameWidth:z=0,frameHeight:Q=0,framesPerSecond:ne=0}=i;e=x,t=M,c.bytesSent=I,c.jitter=Math.round(j*1e3),c.frameWidth=z,c.frameHeight=Q,c.framesPerSecond=ne}break;case"candidate-pair":{const{currentRoundTripTime:I=0}=i;c.roundTripTime=Math.round(I*1e3)}break}}if(e!==0&&t!==0){const i=e-this.transmittedPackets,_=t-this.transmittedPacketsLost,I=i+_;c.lostRate=I===0?0:Math.round(_/I*1e4)/1e4,this.transmittedPackets=e,this.transmittedPacketsLost=t}{const{lostRate:i,roundTripTime:_,jitter:I}=c;c.quality=getNetworkQuality(i,_,I),this.averageQualitys.unshift(c.quality),this.averageQualitys=this.averageQualitys.slice(0,10)}this.averageQualitys.length>=10&&(c.averageQuality=this.averageQualitys.length<10?0:Math.round(this.averageQualitys.reduce((i,_)=>i+_)/this.averageQualitys.length)),c.offsetBytesSent=Math.max(0,c.bytesSent-this.trackReport.bytesSent),this.averageOffsetBytesSents.unshift(c.offsetBytesSent),this.averageOffsetBytesSents=this.averageOffsetBytesSents.slice(0,5),c.averageOffsetBytesSent=this.averageOffsetBytesSents.length===0?0:Math.round(this.averageOffsetBytesSents.reduce((i,_)=>i+_)/this.averageOffsetBytesSents.length);{const{frameWidth:i,frameHeight:_,mimeType:I}=c;if(I){if(I.includes("audio"))this.isAvailable.unshift(1);else if(i&&_){const x=Math.round(estimateDataByResolution(i,_)/3),M=c.offsetBytesSent>=x?1:0;this.isAvailable.unshift(M)}this.isAvailable=this.isAvailable.slice(0,10)}}{const i=this.isAvailable.length;let _=0;const I=[];for(let x=0;x<i;x++){const M=this.isAvailable[x]*availableWeight[x];_+=M,I.push(M)}this.availableScore=I,c.availableScore=Math.round(_*100)/100}this.trackReport=c}catch{this.clear()}return this.trackReport};clear=()=>{this.trackReport={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:"unknown",payloadType:0,sdpFmtpLine:"",frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0},this.transmittedPackets=0,this.transmittedPacketsLost=0,this.averageQualitys=[],this.averageOffsetBytesSents=[],this.availableScore=[],this.isAvailable=[]}}class RemoteUser extends UserBase{tracksAnalysis={sfu:{recvs:{mc_audio:new RemotePeerTrackAnalysis,mc_video:new RemotePeerTrackAnalysis,ss_video:new RemotePeerTrackAnalysis,ss_audio:new RemotePeerTrackAnalysis}},p2p:{sends:{mc_audio:new LocalTrackAnalysis,mc_video:new LocalTrackAnalysis,ss_video:new LocalTrackAnalysis,ss_audio:new LocalTrackAnalysis},recvs:{mc_audio:new RemotePeerTrackAnalysis,mc_video:new RemotePeerTrackAnalysis,ss_video:new RemotePeerTrackAnalysis,ss_audio:new RemotePeerTrackAnalysis}}};subscribeState={};publishWaiting={};audioReceiver={mc_audio:new Audio,ss_audio:new Audio};p2p;constructor({config:m,localMedias:u}){super({config:m,localMedias:u}),this.isSelf=!1;for(const T of mediaType_keys)this.published[T]=!0}getTrackReports=(m,u,T)=>{if(m==="sfu")return this.tracksAnalysis.sfu.recvs[T].trackReport;if(m==="p2p")return this.tracksAnalysis[m][u][T].trackReport};generateTrackAnalysis=async m=>{for(const u of mediaType_keys){{const T=this.getTrack(u);if(T){const{mid:r}=T,c=m.getRecvierTrack(r);await this.tracksAnalysis.sfu.recvs[u].generate(m.pc,c)}}{if(!this.p2p||!this.p2p.peer)continue;{const T=this.p2p.getSenderTrack(u);await this.tracksAnalysis.p2p.sends[u].generate(this.p2p.peer,T)}{const T=this.p2p.getRecvierTrack(u);await this.tracksAnalysis.p2p.recvs[u].generate(this.p2p.peer,T)}}}};addSubscribe=(m,u=2)=>{for(const T of m)this.tracks[T]&&(this.subscribeState[T]=u)};executeSubscribe=()=>{const m=[],u=Object.keys(this.subscribeState);for(const T of u){if(!this.subscribeState[T])continue;const r=this.getTrack(T);r&&(m.push({...r,lastRetry:this.subscribeState[T]===1}),this.subscribeState[T]-=1)}return{id:this.id,tracks:m}};completedSubscribe=m=>{for(const u of m)delete this.subscribeState[u]};setPublishWaiting=m=>{for(const u of m)this.publishWaiting[u]=new Date().getTime()};checkSubscribed=(m,u="all")=>{const T=[],r=[];for(const c of m){let e;const t=this.tracks[c];switch(u){case"all":e=t?.origin==="sfu"&&t.msid||t?.origin==="p2p";break;case"sfu":e=t?.origin==="sfu"&&t.msid;break;case"p2p":e=t?.origin==="p2p";break}e?T.push(c):r.push(c)}return{subscribed_mediaTypes:T,prohibited_mediaTypes:r}};useRemoteStream=(m,u)=>{for(const T of m){const r=this.getTrack(T);if(!r)continue;const c=u.getTransceiver(r.mid);if(!c)continue;const{track:e}=c.receiver;if(this.replaceMediaStreamTrack(T,e),r.origin="sfu",r.msid=e.id,["mc_audio","ss_audio"].includes(T)){const t=this.getUserMediaStreamContext(T);t?.setMute(!1);const i=t?.inputStream;if(!i)continue;const _=this.audioReceiver[T];if(!_)continue;_.srcObject=i}}};useRemoteP2PStream=m=>{for(const u of m){const T=this.getTrack(u);if(!T)continue;const r=this.p2p?.getTrack(u);if(r&&(this.replaceMediaStreamTrack(u,r),T.origin="p2p",T.msid="",["mc_audio","ss_audio"].includes(u))){const c=this.getUserMediaStreamContext(u);c?.setMute(!1);const e=c?.inputStream;if(!e)continue;const t=this.audioReceiver[u];if(!t)continue;t.srcObject=e}}};clear=()=>{this.p2p?.destroy(),this.p2p=void 0,this.tracks={},this.network={egress:0,ingress:0},this.published={}}}class PrResolves{resolvesMap=new Map;index=0;constructor(){}emit=async m=>{const u=this.resolvesMap.get(m);if(u){for(const T of u.values())clearTimeout(T.timer),T.resolve(!0);u.clear()}};add=(m,u=()=>!1,T=1e3*30)=>new Promise((r,c)=>{if(u())return r(!0);this.resolvesMap.has(m)||this.resolvesMap.set(m,new Map),this.index++;const i=`${this.index}`;T=Math.max(0,T);let _=0;T>=0&&(_=window.setTimeout(()=>c(`[PrResolves] ${m} is timeout.`),T)),this.resolvesMap.get(m)?.set(i,{resolve:r,reject:c,timer:_})});clear=()=>{const m=this.resolvesMap.keys();for(const u of m){const r=this.resolvesMap.get(u)?.values()||[];for(const c of r)clearTimeout(c.timer),c.reject(`[PrResolves] ${u} is clear.`)}this.resolvesMap=new Map}}const Z_FIXED$1=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN$1=2;function zero$1(b){let m=b.length;for(;--m>=0;)b[m]=0}const STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,BL_CODES$1=19,HEAP_SIZE$1=2*L_CODES$1+1,MAX_BITS$1=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),extra_dbits=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),extra_blbits=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),bl_order=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DIST_CODE_LEN=512,static_ltree=new Array((L_CODES$1+2)*2);zero$1(static_ltree);const static_dtree=new Array(D_CODES$1*2);zero$1(static_dtree);const _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);const _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);const base_length=new Array(LENGTH_CODES$1);zero$1(base_length);const base_dist=new Array(D_CODES$1);zero$1(base_dist);function StaticTreeDesc(b,m,u,T,r){this.static_tree=b,this.extra_bits=m,this.extra_base=u,this.elems=T,this.max_length=r,this.has_stree=b&&b.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(b,m){this.dyn_tree=b,this.max_code=0,this.stat_desc=m}const d_code=b=>b<256?_dist_code[b]:_dist_code[256+(b>>>7)],put_short=(b,m)=>{b.pending_buf[b.pending++]=m&255,b.pending_buf[b.pending++]=m>>>8&255},send_bits=(b,m,u)=>{b.bi_valid>Buf_size-u?(b.bi_buf|=m<<b.bi_valid&65535,put_short(b,b.bi_buf),b.bi_buf=m>>Buf_size-b.bi_valid,b.bi_valid+=u-Buf_size):(b.bi_buf|=m<<b.bi_valid&65535,b.bi_valid+=u)},send_code=(b,m,u)=>{send_bits(b,u[m*2],u[m*2+1])},bi_reverse=(b,m)=>{let u=0;do u|=b&1,b>>>=1,u<<=1;while(--m>0);return u>>>1},bi_flush=b=>{b.bi_valid===16?(put_short(b,b.bi_buf),b.bi_buf=0,b.bi_valid=0):b.bi_valid>=8&&(b.pending_buf[b.pending++]=b.bi_buf&255,b.bi_buf>>=8,b.bi_valid-=8)},gen_bitlen=(b,m)=>{const u=m.dyn_tree,T=m.max_code,r=m.stat_desc.static_tree,c=m.stat_desc.has_stree,e=m.stat_desc.extra_bits,t=m.stat_desc.extra_base,i=m.stat_desc.max_length;let _,I,x,M,j,z,Q=0;for(M=0;M<=MAX_BITS$1;M++)b.bl_count[M]=0;for(u[b.heap[b.heap_max]*2+1]=0,_=b.heap_max+1;_<HEAP_SIZE$1;_++)I=b.heap[_],M=u[u[I*2+1]*2+1]+1,M>i&&(M=i,Q++),u[I*2+1]=M,!(I>T)&&(b.bl_count[M]++,j=0,I>=t&&(j=e[I-t]),z=u[I*2],b.opt_len+=z*(M+j),c&&(b.static_len+=z*(r[I*2+1]+j)));if(Q!==0){do{for(M=i-1;b.bl_count[M]===0;)M--;b.bl_count[M]--,b.bl_count[M+1]+=2,b.bl_count[i]--,Q-=2}while(Q>0);for(M=i;M!==0;M--)for(I=b.bl_count[M];I!==0;)x=b.heap[--_],!(x>T)&&(u[x*2+1]!==M&&(b.opt_len+=(M-u[x*2+1])*u[x*2],u[x*2+1]=M),I--)}},gen_codes=(b,m,u)=>{const T=new Array(MAX_BITS$1+1);let r=0,c,e;for(c=1;c<=MAX_BITS$1;c++)r=r+u[c-1]<<1,T[c]=r;for(e=0;e<=m;e++){let t=b[e*2+1];t!==0&&(b[e*2]=bi_reverse(T[t]++,t))}},tr_static_init=()=>{let b,m,u,T,r;const c=new Array(MAX_BITS$1+1);for(u=0,T=0;T<LENGTH_CODES$1-1;T++)for(base_length[T]=u,b=0;b<1<<extra_lbits[T];b++)_length_code[u++]=T;for(_length_code[u-1]=T,r=0,T=0;T<16;T++)for(base_dist[T]=r,b=0;b<1<<extra_dbits[T];b++)_dist_code[r++]=T;for(r>>=7;T<D_CODES$1;T++)for(base_dist[T]=r<<7,b=0;b<1<<extra_dbits[T]-7;b++)_dist_code[256+r++]=T;for(m=0;m<=MAX_BITS$1;m++)c[m]=0;for(b=0;b<=143;)static_ltree[b*2+1]=8,b++,c[8]++;for(;b<=255;)static_ltree[b*2+1]=9,b++,c[9]++;for(;b<=279;)static_ltree[b*2+1]=7,b++,c[7]++;for(;b<=287;)static_ltree[b*2+1]=8,b++,c[8]++;for(gen_codes(static_ltree,L_CODES$1+1,c),b=0;b<D_CODES$1;b++)static_dtree[b*2+1]=5,static_dtree[b*2]=bi_reverse(b,5);static_l_desc=new StaticTreeDesc(static_ltree,extra_lbits,LITERALS$1+1,L_CODES$1,MAX_BITS$1),static_d_desc=new StaticTreeDesc(static_dtree,extra_dbits,0,D_CODES$1,MAX_BITS$1),static_bl_desc=new StaticTreeDesc(new Array(0),extra_blbits,0,BL_CODES$1,MAX_BL_BITS)},init_block=b=>{let m;for(m=0;m<L_CODES$1;m++)b.dyn_ltree[m*2]=0;for(m=0;m<D_CODES$1;m++)b.dyn_dtree[m*2]=0;for(m=0;m<BL_CODES$1;m++)b.bl_tree[m*2]=0;b.dyn_ltree[END_BLOCK*2]=1,b.opt_len=b.static_len=0,b.sym_next=b.matches=0},bi_windup=b=>{b.bi_valid>8?put_short(b,b.bi_buf):b.bi_valid>0&&(b.pending_buf[b.pending++]=b.bi_buf),b.bi_buf=0,b.bi_valid=0},smaller=(b,m,u,T)=>{const r=m*2,c=u*2;return b[r]<b[c]||b[r]===b[c]&&T[m]<=T[u]},pqdownheap=(b,m,u)=>{const T=b.heap[u];let r=u<<1;for(;r<=b.heap_len&&(r<b.heap_len&&smaller(m,b.heap[r+1],b.heap[r],b.depth)&&r++,!smaller(m,T,b.heap[r],b.depth));)b.heap[u]=b.heap[r],u=r,r<<=1;b.heap[u]=T},compress_block=(b,m,u)=>{let T,r,c=0,e,t;if(b.sym_next!==0)do T=b.pending_buf[b.sym_buf+c++]&255,T+=(b.pending_buf[b.sym_buf+c++]&255)<<8,r=b.pending_buf[b.sym_buf+c++],T===0?send_code(b,r,m):(e=_length_code[r],send_code(b,e+LITERALS$1+1,m),t=extra_lbits[e],t!==0&&(r-=base_length[e],send_bits(b,r,t)),T--,e=d_code(T),send_code(b,e,u),t=extra_dbits[e],t!==0&&(T-=base_dist[e],send_bits(b,T,t)));while(c<b.sym_next);send_code(b,END_BLOCK,m)},build_tree=(b,m)=>{const u=m.dyn_tree,T=m.stat_desc.static_tree,r=m.stat_desc.has_stree,c=m.stat_desc.elems;let e,t,i=-1,_;for(b.heap_len=0,b.heap_max=HEAP_SIZE$1,e=0;e<c;e++)u[e*2]!==0?(b.heap[++b.heap_len]=i=e,b.depth[e]=0):u[e*2+1]=0;for(;b.heap_len<2;)_=b.heap[++b.heap_len]=i<2?++i:0,u[_*2]=1,b.depth[_]=0,b.opt_len--,r&&(b.static_len-=T[_*2+1]);for(m.max_code=i,e=b.heap_len>>1;e>=1;e--)pqdownheap(b,u,e);_=c;do e=b.heap[1],b.heap[1]=b.heap[b.heap_len--],pqdownheap(b,u,1),t=b.heap[1],b.heap[--b.heap_max]=e,b.heap[--b.heap_max]=t,u[_*2]=u[e*2]+u[t*2],b.depth[_]=(b.depth[e]>=b.depth[t]?b.depth[e]:b.depth[t])+1,u[e*2+1]=u[t*2+1]=_,b.heap[1]=_++,pqdownheap(b,u,1);while(b.heap_len>=2);b.heap[--b.heap_max]=b.heap[1],gen_bitlen(b,m),gen_codes(u,i,b.bl_count)},scan_tree=(b,m,u)=>{let T,r=-1,c,e=m[1],t=0,i=7,_=4;for(e===0&&(i=138,_=3),m[(u+1)*2+1]=65535,T=0;T<=u;T++)c=e,e=m[(T+1)*2+1],!(++t<i&&c===e)&&(t<_?b.bl_tree[c*2]+=t:c!==0?(c!==r&&b.bl_tree[c*2]++,b.bl_tree[REP_3_6*2]++):t<=10?b.bl_tree[REPZ_3_10*2]++:b.bl_tree[REPZ_11_138*2]++,t=0,r=c,e===0?(i=138,_=3):c===e?(i=6,_=3):(i=7,_=4))},send_tree=(b,m,u)=>{let T,r=-1,c,e=m[1],t=0,i=7,_=4;for(e===0&&(i=138,_=3),T=0;T<=u;T++)if(c=e,e=m[(T+1)*2+1],!(++t<i&&c===e)){if(t<_)do send_code(b,c,b.bl_tree);while(--t!==0);else c!==0?(c!==r&&(send_code(b,c,b.bl_tree),t--),send_code(b,REP_3_6,b.bl_tree),send_bits(b,t-3,2)):t<=10?(send_code(b,REPZ_3_10,b.bl_tree),send_bits(b,t-3,3)):(send_code(b,REPZ_11_138,b.bl_tree),send_bits(b,t-11,7));t=0,r=c,e===0?(i=138,_=3):c===e?(i=6,_=3):(i=7,_=4)}},build_bl_tree=b=>{let m;for(scan_tree(b,b.dyn_ltree,b.l_desc.max_code),scan_tree(b,b.dyn_dtree,b.d_desc.max_code),build_tree(b,b.bl_desc),m=BL_CODES$1-1;m>=3&&b.bl_tree[bl_order[m]*2+1]===0;m--);return b.opt_len+=3*(m+1)+5+5+4,m},send_all_trees=(b,m,u,T)=>{let r;for(send_bits(b,m-257,5),send_bits(b,u-1,5),send_bits(b,T-4,4),r=0;r<T;r++)send_bits(b,b.bl_tree[bl_order[r]*2+1],3);send_tree(b,b.dyn_ltree,m-1),send_tree(b,b.dyn_dtree,u-1)},detect_data_type=b=>{let m=4093624447,u;for(u=0;u<=31;u++,m>>>=1)if(m&1&&b.dyn_ltree[u*2]!==0)return Z_BINARY;if(b.dyn_ltree[18]!==0||b.dyn_ltree[20]!==0||b.dyn_ltree[26]!==0)return Z_TEXT;for(u=32;u<LITERALS$1;u++)if(b.dyn_ltree[u*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=b=>{static_init_done||(tr_static_init(),static_init_done=!0),b.l_desc=new TreeDesc(b.dyn_ltree,static_l_desc),b.d_desc=new TreeDesc(b.dyn_dtree,static_d_desc),b.bl_desc=new TreeDesc(b.bl_tree,static_bl_desc),b.bi_buf=0,b.bi_valid=0,init_block(b)},_tr_stored_block$1=(b,m,u,T)=>{send_bits(b,(STORED_BLOCK<<1)+(T?1:0),3),bi_windup(b),put_short(b,u),put_short(b,~u),u&&b.pending_buf.set(b.window.subarray(m,m+u),b.pending),b.pending+=u},_tr_align$1=b=>{send_bits(b,STATIC_TREES<<1,3),send_code(b,END_BLOCK,static_ltree),bi_flush(b)},_tr_flush_block$1=(b,m,u,T)=>{let r,c,e=0;b.level>0?(b.strm.data_type===Z_UNKNOWN$1&&(b.strm.data_type=detect_data_type(b)),build_tree(b,b.l_desc),build_tree(b,b.d_desc),e=build_bl_tree(b),r=b.opt_len+3+7>>>3,c=b.static_len+3+7>>>3,c<=r&&(r=c)):r=c=u+5,u+4<=r&&m!==-1?_tr_stored_block$1(b,m,u,T):b.strategy===Z_FIXED$1||c===r?(send_bits(b,(STATIC_TREES<<1)+(T?1:0),3),compress_block(b,static_ltree,static_dtree)):(send_bits(b,(DYN_TREES<<1)+(T?1:0),3),send_all_trees(b,b.l_desc.max_code+1,b.d_desc.max_code+1,e+1),compress_block(b,b.dyn_ltree,b.dyn_dtree)),init_block(b),T&&bi_windup(b)},_tr_tally$1=(b,m,u)=>(b.pending_buf[b.sym_buf+b.sym_next++]=m,b.pending_buf[b.sym_buf+b.sym_next++]=m>>8,b.pending_buf[b.sym_buf+b.sym_next++]=u,m===0?b.dyn_ltree[u*2]++:(b.matches++,m--,b.dyn_ltree[(_length_code[u]+LITERALS$1+1)*2]++,b.dyn_dtree[d_code(m)*2]++),b.sym_next===b.sym_end);var _tr_init_1=_tr_init$1,_tr_stored_block_1=_tr_stored_block$1,_tr_flush_block_1=_tr_flush_block$1,_tr_tally_1=_tr_tally$1,_tr_align_1=_tr_align$1,trees={_tr_init:_tr_init_1,_tr_stored_block:_tr_stored_block_1,_tr_flush_block:_tr_flush_block_1,_tr_tally:_tr_tally_1,_tr_align:_tr_align_1};const adler32=(b,m,u,T)=>{let r=b&65535|0,c=b>>>16&65535|0,e=0;for(;u!==0;){e=u>2e3?2e3:u,u-=e;do r=r+m[T++]|0,c=c+r|0;while(--e);r%=65521,c%=65521}return r|c<<16|0};var adler32_1=adler32;const makeTable=()=>{let b,m=[];for(var u=0;u<256;u++){b=u;for(var T=0;T<8;T++)b=b&1?3988292384^b>>>1:b>>>1;m[u]=b}return m},crcTable=new Uint32Array(makeTable()),crc32=(b,m,u,T)=>{const r=crcTable,c=T+u;b^=-1;for(let e=T;e<c;e++)b=b>>>8^r[(b^m[e])&255];return b^-1};var crc32_1=crc32,messages={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},constants$2={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init,_tr_stored_block,_tr_flush_block,_tr_tally,_tr_align}=trees,{Z_NO_FLUSH:Z_NO_FLUSH$2,Z_PARTIAL_FLUSH,Z_FULL_FLUSH:Z_FULL_FLUSH$1,Z_FINISH:Z_FINISH$3,Z_BLOCK:Z_BLOCK$1,Z_OK:Z_OK$3,Z_STREAM_END:Z_STREAM_END$3,Z_STREAM_ERROR:Z_STREAM_ERROR$2,Z_DATA_ERROR:Z_DATA_ERROR$2,Z_BUF_ERROR:Z_BUF_ERROR$1,Z_DEFAULT_COMPRESSION:Z_DEFAULT_COMPRESSION$1,Z_FILTERED,Z_HUFFMAN_ONLY,Z_RLE,Z_FIXED,Z_DEFAULT_STRATEGY:Z_DEFAULT_STRATEGY$1,Z_UNKNOWN,Z_DEFLATED:Z_DEFLATED$2}=constants$2,MAX_MEM_LEVEL=9,MAX_WBITS$1=15,DEF_MEM_LEVEL=8,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,MIN_MATCH=3,MAX_MATCH=258,MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1,PRESET_DICT=32,INIT_STATE=42,GZIP_STATE=57,EXTRA_STATE=69,NAME_STATE=73,COMMENT_STATE=91,HCRC_STATE=103,BUSY_STATE=113,FINISH_STATE=666,BS_NEED_MORE=1,BS_BLOCK_DONE=2,BS_FINISH_STARTED=3,BS_FINISH_DONE=4,OS_CODE=3,err=(b,m)=>(b.msg=messages[m],m),rank=b=>b*2-(b>4?9:0),zero=b=>{let m=b.length;for(;--m>=0;)b[m]=0},slide_hash=b=>{let m,u,T,r=b.w_size;m=b.hash_size,T=m;do u=b.head[--T],b.head[T]=u>=r?u-r:0;while(--m);m=r,T=m;do u=b.prev[--T],b.prev[T]=u>=r?u-r:0;while(--m)};let HASH_ZLIB=(b,m,u)=>(m<<b.hash_shift^u)&b.hash_mask,HASH=HASH_ZLIB;const flush_pending=b=>{const m=b.state;let u=m.pending;u>b.avail_out&&(u=b.avail_out),u!==0&&(b.output.set(m.pending_buf.subarray(m.pending_out,m.pending_out+u),b.next_out),b.next_out+=u,m.pending_out+=u,b.total_out+=u,b.avail_out-=u,m.pending-=u,m.pending===0&&(m.pending_out=0))},flush_block_only=(b,m)=>{_tr_flush_block(b,b.block_start>=0?b.block_start:-1,b.strstart-b.block_start,m),b.block_start=b.strstart,flush_pending(b.strm)},put_byte=(b,m)=>{b.pending_buf[b.pending++]=m},putShortMSB=(b,m)=>{b.pending_buf[b.pending++]=m>>>8&255,b.pending_buf[b.pending++]=m&255},read_buf=(b,m,u,T)=>{let r=b.avail_in;return r>T&&(r=T),r===0?0:(b.avail_in-=r,m.set(b.input.subarray(b.next_in,b.next_in+r),u),b.state.wrap===1?b.adler=adler32_1(b.adler,m,r,u):b.state.wrap===2&&(b.adler=crc32_1(b.adler,m,r,u)),b.next_in+=r,b.total_in+=r,r)},longest_match=(b,m)=>{let u=b.max_chain_length,T=b.strstart,r,c,e=b.prev_length,t=b.nice_match;const i=b.strstart>b.w_size-MIN_LOOKAHEAD?b.strstart-(b.w_size-MIN_LOOKAHEAD):0,_=b.window,I=b.w_mask,x=b.prev,M=b.strstart+MAX_MATCH;let j=_[T+e-1],z=_[T+e];b.prev_length>=b.good_match&&(u>>=2),t>b.lookahead&&(t=b.lookahead);do if(r=m,!(_[r+e]!==z||_[r+e-1]!==j||_[r]!==_[T]||_[++r]!==_[T+1])){T+=2,r++;do;while(_[++T]===_[++r]&&_[++T]===_[++r]&&_[++T]===_[++r]&&_[++T]===_[++r]&&_[++T]===_[++r]&&_[++T]===_[++r]&&_[++T]===_[++r]&&_[++T]===_[++r]&&T<M);if(c=MAX_MATCH-(M-T),T=M-MAX_MATCH,c>e){if(b.match_start=m,e=c,c>=t)break;j=_[T+e-1],z=_[T+e]}}while((m=x[m&I])>i&&--u!==0);return e<=b.lookahead?e:b.lookahead},fill_window=b=>{const m=b.w_size;let u,T,r;do{if(T=b.window_size-b.lookahead-b.strstart,b.strstart>=m+(m-MIN_LOOKAHEAD)&&(b.window.set(b.window.subarray(m,m+m-T),0),b.match_start-=m,b.strstart-=m,b.block_start-=m,b.insert>b.strstart&&(b.insert=b.strstart),slide_hash(b),T+=m),b.strm.avail_in===0)break;if(u=read_buf(b.strm,b.window,b.strstart+b.lookahead,T),b.lookahead+=u,b.lookahead+b.insert>=MIN_MATCH)for(r=b.strstart-b.insert,b.ins_h=b.window[r],b.ins_h=HASH(b,b.ins_h,b.window[r+1]);b.insert&&(b.ins_h=HASH(b,b.ins_h,b.window[r+MIN_MATCH-1]),b.prev[r&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=r,r++,b.insert--,!(b.lookahead+b.insert<MIN_MATCH)););}while(b.lookahead<MIN_LOOKAHEAD&&b.strm.avail_in!==0)},deflate_stored=(b,m)=>{let u=b.pending_buf_size-5>b.w_size?b.w_size:b.pending_buf_size-5,T,r,c,e=0,t=b.strm.avail_in;do{if(T=65535,c=b.bi_valid+42>>3,b.strm.avail_out<c||(c=b.strm.avail_out-c,r=b.strstart-b.block_start,T>r+b.strm.avail_in&&(T=r+b.strm.avail_in),T>c&&(T=c),T<u&&(T===0&&m!==Z_FINISH$3||m===Z_NO_FLUSH$2||T!==r+b.strm.avail_in)))break;e=m===Z_FINISH$3&&T===r+b.strm.avail_in?1:0,_tr_stored_block(b,0,0,e),b.pending_buf[b.pending-4]=T,b.pending_buf[b.pending-3]=T>>8,b.pending_buf[b.pending-2]=~T,b.pending_buf[b.pending-1]=~T>>8,flush_pending(b.strm),r&&(r>T&&(r=T),b.strm.output.set(b.window.subarray(b.block_start,b.block_start+r),b.strm.next_out),b.strm.next_out+=r,b.strm.avail_out-=r,b.strm.total_out+=r,b.block_start+=r,T-=r),T&&(read_buf(b.strm,b.strm.output,b.strm.next_out,T),b.strm.next_out+=T,b.strm.avail_out-=T,b.strm.total_out+=T)}while(e===0);return t-=b.strm.avail_in,t&&(t>=b.w_size?(b.matches=2,b.window.set(b.strm.input.subarray(b.strm.next_in-b.w_size,b.strm.next_in),0),b.strstart=b.w_size,b.insert=b.strstart):(b.window_size-b.strstart<=t&&(b.strstart-=b.w_size,b.window.set(b.window.subarray(b.w_size,b.w_size+b.strstart),0),b.matches<2&&b.matches++,b.insert>b.strstart&&(b.insert=b.strstart)),b.window.set(b.strm.input.subarray(b.strm.next_in-t,b.strm.next_in),b.strstart),b.strstart+=t,b.insert+=t>b.w_size-b.insert?b.w_size-b.insert:t),b.block_start=b.strstart),b.high_water<b.strstart&&(b.high_water=b.strstart),e?BS_FINISH_DONE:m!==Z_NO_FLUSH$2&&m!==Z_FINISH$3&&b.strm.avail_in===0&&b.strstart===b.block_start?BS_BLOCK_DONE:(c=b.window_size-b.strstart,b.strm.avail_in>c&&b.block_start>=b.w_size&&(b.block_start-=b.w_size,b.strstart-=b.w_size,b.window.set(b.window.subarray(b.w_size,b.w_size+b.strstart),0),b.matches<2&&b.matches++,c+=b.w_size,b.insert>b.strstart&&(b.insert=b.strstart)),c>b.strm.avail_in&&(c=b.strm.avail_in),c&&(read_buf(b.strm,b.window,b.strstart,c),b.strstart+=c,b.insert+=c>b.w_size-b.insert?b.w_size-b.insert:c),b.high_water<b.strstart&&(b.high_water=b.strstart),c=b.bi_valid+42>>3,c=b.pending_buf_size-c>65535?65535:b.pending_buf_size-c,u=c>b.w_size?b.w_size:c,r=b.strstart-b.block_start,(r>=u||(r||m===Z_FINISH$3)&&m!==Z_NO_FLUSH$2&&b.strm.avail_in===0&&r<=c)&&(T=r>c?c:r,e=m===Z_FINISH$3&&b.strm.avail_in===0&&T===r?1:0,_tr_stored_block(b,b.block_start,T,e),b.block_start+=T,flush_pending(b.strm)),e?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(b,m)=>{let u,T;for(;;){if(b.lookahead<MIN_LOOKAHEAD){if(fill_window(b),b.lookahead<MIN_LOOKAHEAD&&m===Z_NO_FLUSH$2)return BS_NEED_MORE;if(b.lookahead===0)break}if(u=0,b.lookahead>=MIN_MATCH&&(b.ins_h=HASH(b,b.ins_h,b.window[b.strstart+MIN_MATCH-1]),u=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart),u!==0&&b.strstart-u<=b.w_size-MIN_LOOKAHEAD&&(b.match_length=longest_match(b,u)),b.match_length>=MIN_MATCH)if(T=_tr_tally(b,b.strstart-b.match_start,b.match_length-MIN_MATCH),b.lookahead-=b.match_length,b.match_length<=b.max_lazy_match&&b.lookahead>=MIN_MATCH){b.match_length--;do b.strstart++,b.ins_h=HASH(b,b.ins_h,b.window[b.strstart+MIN_MATCH-1]),u=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart;while(--b.match_length!==0);b.strstart++}else b.strstart+=b.match_length,b.match_length=0,b.ins_h=b.window[b.strstart],b.ins_h=HASH(b,b.ins_h,b.window[b.strstart+1]);else T=_tr_tally(b,0,b.window[b.strstart]),b.lookahead--,b.strstart++;if(T&&(flush_block_only(b,!1),b.strm.avail_out===0))return BS_NEED_MORE}return b.insert=b.strstart<MIN_MATCH-1?b.strstart:MIN_MATCH-1,m===Z_FINISH$3?(flush_block_only(b,!0),b.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):b.sym_next&&(flush_block_only(b,!1),b.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(b,m)=>{let u,T,r;for(;;){if(b.lookahead<MIN_LOOKAHEAD){if(fill_window(b),b.lookahead<MIN_LOOKAHEAD&&m===Z_NO_FLUSH$2)return BS_NEED_MORE;if(b.lookahead===0)break}if(u=0,b.lookahead>=MIN_MATCH&&(b.ins_h=HASH(b,b.ins_h,b.window[b.strstart+MIN_MATCH-1]),u=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart),b.prev_length=b.match_length,b.prev_match=b.match_start,b.match_length=MIN_MATCH-1,u!==0&&b.prev_length<b.max_lazy_match&&b.strstart-u<=b.w_size-MIN_LOOKAHEAD&&(b.match_length=longest_match(b,u),b.match_length<=5&&(b.strategy===Z_FILTERED||b.match_length===MIN_MATCH&&b.strstart-b.match_start>4096)&&(b.match_length=MIN_MATCH-1)),b.prev_length>=MIN_MATCH&&b.match_length<=b.prev_length){r=b.strstart+b.lookahead-MIN_MATCH,T=_tr_tally(b,b.strstart-1-b.prev_match,b.prev_length-MIN_MATCH),b.lookahead-=b.prev_length-1,b.prev_length-=2;do++b.strstart<=r&&(b.ins_h=HASH(b,b.ins_h,b.window[b.strstart+MIN_MATCH-1]),u=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart);while(--b.prev_length!==0);if(b.match_available=0,b.match_length=MIN_MATCH-1,b.strstart++,T&&(flush_block_only(b,!1),b.strm.avail_out===0))return BS_NEED_MORE}else if(b.match_available){if(T=_tr_tally(b,0,b.window[b.strstart-1]),T&&flush_block_only(b,!1),b.strstart++,b.lookahead--,b.strm.avail_out===0)return BS_NEED_MORE}else b.match_available=1,b.strstart++,b.lookahead--}return b.match_available&&(T=_tr_tally(b,0,b.window[b.strstart-1]),b.match_available=0),b.insert=b.strstart<MIN_MATCH-1?b.strstart:MIN_MATCH-1,m===Z_FINISH$3?(flush_block_only(b,!0),b.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):b.sym_next&&(flush_block_only(b,!1),b.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(b,m)=>{let u,T,r,c;const e=b.window;for(;;){if(b.lookahead<=MAX_MATCH){if(fill_window(b),b.lookahead<=MAX_MATCH&&m===Z_NO_FLUSH$2)return BS_NEED_MORE;if(b.lookahead===0)break}if(b.match_length=0,b.lookahead>=MIN_MATCH&&b.strstart>0&&(r=b.strstart-1,T=e[r],T===e[++r]&&T===e[++r]&&T===e[++r])){c=b.strstart+MAX_MATCH;do;while(T===e[++r]&&T===e[++r]&&T===e[++r]&&T===e[++r]&&T===e[++r]&&T===e[++r]&&T===e[++r]&&T===e[++r]&&r<c);b.match_length=MAX_MATCH-(c-r),b.match_length>b.lookahead&&(b.match_length=b.lookahead)}if(b.match_length>=MIN_MATCH?(u=_tr_tally(b,1,b.match_length-MIN_MATCH),b.lookahead-=b.match_length,b.strstart+=b.match_length,b.match_length=0):(u=_tr_tally(b,0,b.window[b.strstart]),b.lookahead--,b.strstart++),u&&(flush_block_only(b,!1),b.strm.avail_out===0))return BS_NEED_MORE}return b.insert=0,m===Z_FINISH$3?(flush_block_only(b,!0),b.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):b.sym_next&&(flush_block_only(b,!1),b.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(b,m)=>{let u;for(;;){if(b.lookahead===0&&(fill_window(b),b.lookahead===0)){if(m===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(b.match_length=0,u=_tr_tally(b,0,b.window[b.strstart]),b.lookahead--,b.strstart++,u&&(flush_block_only(b,!1),b.strm.avail_out===0))return BS_NEED_MORE}return b.insert=0,m===Z_FINISH$3?(flush_block_only(b,!0),b.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):b.sym_next&&(flush_block_only(b,!1),b.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(b,m,u,T,r){this.good_length=b,this.max_lazy=m,this.nice_length=u,this.max_chain=T,this.func=r}const configuration_table=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)],lm_init=b=>{b.window_size=2*b.w_size,zero(b.head),b.max_lazy_match=configuration_table[b.level].max_lazy,b.good_match=configuration_table[b.level].good_length,b.nice_match=configuration_table[b.level].nice_length,b.max_chain_length=configuration_table[b.level].max_chain,b.strstart=0,b.block_start=0,b.lookahead=0,b.insert=0,b.match_length=b.prev_length=MIN_MATCH-1,b.match_available=0,b.ins_h=0};function DeflateState(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Z_DEFLATED$2,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(HEAP_SIZE*2),this.dyn_dtree=new Uint16Array((2*D_CODES+1)*2),this.bl_tree=new Uint16Array((2*BL_CODES+1)*2),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(MAX_BITS+1),this.heap=new Uint16Array(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*L_CODES+1),zero(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const deflateStateCheck=b=>{if(!b)return 1;const m=b.state;return!m||m.strm!==b||m.status!==INIT_STATE&&m.status!==GZIP_STATE&&m.status!==EXTRA_STATE&&m.status!==NAME_STATE&&m.status!==COMMENT_STATE&&m.status!==HCRC_STATE&&m.status!==BUSY_STATE&&m.status!==FINISH_STATE?1:0},deflateResetKeep=b=>{if(deflateStateCheck(b))return err(b,Z_STREAM_ERROR$2);b.total_in=b.total_out=0,b.data_type=Z_UNKNOWN;const m=b.state;return m.pending=0,m.pending_out=0,m.wrap<0&&(m.wrap=-m.wrap),m.status=m.wrap===2?GZIP_STATE:m.wrap?INIT_STATE:BUSY_STATE,b.adler=m.wrap===2?0:1,m.last_flush=-2,_tr_init(m),Z_OK$3},deflateReset=b=>{const m=deflateResetKeep(b);return m===Z_OK$3&&lm_init(b.state),m},deflateSetHeader=(b,m)=>deflateStateCheck(b)||b.state.wrap!==2?Z_STREAM_ERROR$2:(b.state.gzhead=m,Z_OK$3),deflateInit2=(b,m,u,T,r,c)=>{if(!b)return Z_STREAM_ERROR$2;let e=1;if(m===Z_DEFAULT_COMPRESSION$1&&(m=6),T<0?(e=0,T=-T):T>15&&(e=2,T-=16),r<1||r>MAX_MEM_LEVEL||u!==Z_DEFLATED$2||T<8||T>15||m<0||m>9||c<0||c>Z_FIXED||T===8&&e!==1)return err(b,Z_STREAM_ERROR$2);T===8&&(T=9);const t=new DeflateState;return b.state=t,t.strm=b,t.status=INIT_STATE,t.wrap=e,t.gzhead=null,t.w_bits=T,t.w_size=1<<t.w_bits,t.w_mask=t.w_size-1,t.hash_bits=r+7,t.hash_size=1<<t.hash_bits,t.hash_mask=t.hash_size-1,t.hash_shift=~~((t.hash_bits+MIN_MATCH-1)/MIN_MATCH),t.window=new Uint8Array(t.w_size*2),t.head=new Uint16Array(t.hash_size),t.prev=new Uint16Array(t.w_size),t.lit_bufsize=1<<r+6,t.pending_buf_size=t.lit_bufsize*4,t.pending_buf=new Uint8Array(t.pending_buf_size),t.sym_buf=t.lit_bufsize,t.sym_end=(t.lit_bufsize-1)*3,t.level=m,t.strategy=c,t.method=u,deflateReset(b)},deflateInit=(b,m)=>deflateInit2(b,m,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(b,m)=>{if(deflateStateCheck(b)||m>Z_BLOCK$1||m<0)return b?err(b,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const u=b.state;if(!b.output||b.avail_in!==0&&!b.input||u.status===FINISH_STATE&&m!==Z_FINISH$3)return err(b,b.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const T=u.last_flush;if(u.last_flush=m,u.pending!==0){if(flush_pending(b),b.avail_out===0)return u.last_flush=-1,Z_OK$3}else if(b.avail_in===0&&rank(m)<=rank(T)&&m!==Z_FINISH$3)return err(b,Z_BUF_ERROR$1);if(u.status===FINISH_STATE&&b.avail_in!==0)return err(b,Z_BUF_ERROR$1);if(u.status===INIT_STATE&&u.wrap===0&&(u.status=BUSY_STATE),u.status===INIT_STATE){let r=Z_DEFLATED$2+(u.w_bits-8<<4)<<8,c=-1;if(u.strategy>=Z_HUFFMAN_ONLY||u.level<2?c=0:u.level<6?c=1:u.level===6?c=2:c=3,r|=c<<6,u.strstart!==0&&(r|=PRESET_DICT),r+=31-r%31,putShortMSB(u,r),u.strstart!==0&&(putShortMSB(u,b.adler>>>16),putShortMSB(u,b.adler&65535)),b.adler=1,u.status=BUSY_STATE,flush_pending(b),u.pending!==0)return u.last_flush=-1,Z_OK$3}if(u.status===GZIP_STATE){if(b.adler=0,put_byte(u,31),put_byte(u,139),put_byte(u,8),u.gzhead)put_byte(u,(u.gzhead.text?1:0)+(u.gzhead.hcrc?2:0)+(u.gzhead.extra?4:0)+(u.gzhead.name?8:0)+(u.gzhead.comment?16:0)),put_byte(u,u.gzhead.time&255),put_byte(u,u.gzhead.time>>8&255),put_byte(u,u.gzhead.time>>16&255),put_byte(u,u.gzhead.time>>24&255),put_byte(u,u.level===9?2:u.strategy>=Z_HUFFMAN_ONLY||u.level<2?4:0),put_byte(u,u.gzhead.os&255),u.gzhead.extra&&u.gzhead.extra.length&&(put_byte(u,u.gzhead.extra.length&255),put_byte(u,u.gzhead.extra.length>>8&255)),u.gzhead.hcrc&&(b.adler=crc32_1(b.adler,u.pending_buf,u.pending,0)),u.gzindex=0,u.status=EXTRA_STATE;else if(put_byte(u,0),put_byte(u,0),put_byte(u,0),put_byte(u,0),put_byte(u,0),put_byte(u,u.level===9?2:u.strategy>=Z_HUFFMAN_ONLY||u.level<2?4:0),put_byte(u,OS_CODE),u.status=BUSY_STATE,flush_pending(b),u.pending!==0)return u.last_flush=-1,Z_OK$3}if(u.status===EXTRA_STATE){if(u.gzhead.extra){let r=u.pending,c=(u.gzhead.extra.length&65535)-u.gzindex;for(;u.pending+c>u.pending_buf_size;){let t=u.pending_buf_size-u.pending;if(u.pending_buf.set(u.gzhead.extra.subarray(u.gzindex,u.gzindex+t),u.pending),u.pending=u.pending_buf_size,u.gzhead.hcrc&&u.pending>r&&(b.adler=crc32_1(b.adler,u.pending_buf,u.pending-r,r)),u.gzindex+=t,flush_pending(b),u.pending!==0)return u.last_flush=-1,Z_OK$3;r=0,c-=t}let e=new Uint8Array(u.gzhead.extra);u.pending_buf.set(e.subarray(u.gzindex,u.gzindex+c),u.pending),u.pending+=c,u.gzhead.hcrc&&u.pending>r&&(b.adler=crc32_1(b.adler,u.pending_buf,u.pending-r,r)),u.gzindex=0}u.status=NAME_STATE}if(u.status===NAME_STATE){if(u.gzhead.name){let r=u.pending,c;do{if(u.pending===u.pending_buf_size){if(u.gzhead.hcrc&&u.pending>r&&(b.adler=crc32_1(b.adler,u.pending_buf,u.pending-r,r)),flush_pending(b),u.pending!==0)return u.last_flush=-1,Z_OK$3;r=0}u.gzindex<u.gzhead.name.length?c=u.gzhead.name.charCodeAt(u.gzindex++)&255:c=0,put_byte(u,c)}while(c!==0);u.gzhead.hcrc&&u.pending>r&&(b.adler=crc32_1(b.adler,u.pending_buf,u.pending-r,r)),u.gzindex=0}u.status=COMMENT_STATE}if(u.status===COMMENT_STATE){if(u.gzhead.comment){let r=u.pending,c;do{if(u.pending===u.pending_buf_size){if(u.gzhead.hcrc&&u.pending>r&&(b.adler=crc32_1(b.adler,u.pending_buf,u.pending-r,r)),flush_pending(b),u.pending!==0)return u.last_flush=-1,Z_OK$3;r=0}u.gzindex<u.gzhead.comment.length?c=u.gzhead.comment.charCodeAt(u.gzindex++)&255:c=0,put_byte(u,c)}while(c!==0);u.gzhead.hcrc&&u.pending>r&&(b.adler=crc32_1(b.adler,u.pending_buf,u.pending-r,r))}u.status=HCRC_STATE}if(u.status===HCRC_STATE){if(u.gzhead.hcrc){if(u.pending+2>u.pending_buf_size&&(flush_pending(b),u.pending!==0))return u.last_flush=-1,Z_OK$3;put_byte(u,b.adler&255),put_byte(u,b.adler>>8&255),b.adler=0}if(u.status=BUSY_STATE,flush_pending(b),u.pending!==0)return u.last_flush=-1,Z_OK$3}if(b.avail_in!==0||u.lookahead!==0||m!==Z_NO_FLUSH$2&&u.status!==FINISH_STATE){let r=u.level===0?deflate_stored(u,m):u.strategy===Z_HUFFMAN_ONLY?deflate_huff(u,m):u.strategy===Z_RLE?deflate_rle(u,m):configuration_table[u.level].func(u,m);if((r===BS_FINISH_STARTED||r===BS_FINISH_DONE)&&(u.status=FINISH_STATE),r===BS_NEED_MORE||r===BS_FINISH_STARTED)return b.avail_out===0&&(u.last_flush=-1),Z_OK$3;if(r===BS_BLOCK_DONE&&(m===Z_PARTIAL_FLUSH?_tr_align(u):m!==Z_BLOCK$1&&(_tr_stored_block(u,0,0,!1),m===Z_FULL_FLUSH$1&&(zero(u.head),u.lookahead===0&&(u.strstart=0,u.block_start=0,u.insert=0))),flush_pending(b),b.avail_out===0))return u.last_flush=-1,Z_OK$3}return m!==Z_FINISH$3?Z_OK$3:u.wrap<=0?Z_STREAM_END$3:(u.wrap===2?(put_byte(u,b.adler&255),put_byte(u,b.adler>>8&255),put_byte(u,b.adler>>16&255),put_byte(u,b.adler>>24&255),put_byte(u,b.total_in&255),put_byte(u,b.total_in>>8&255),put_byte(u,b.total_in>>16&255),put_byte(u,b.total_in>>24&255)):(putShortMSB(u,b.adler>>>16),putShortMSB(u,b.adler&65535)),flush_pending(b),u.wrap>0&&(u.wrap=-u.wrap),u.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=b=>{if(deflateStateCheck(b))return Z_STREAM_ERROR$2;const m=b.state.status;return b.state=null,m===BUSY_STATE?err(b,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(b,m)=>{let u=m.length;if(deflateStateCheck(b))return Z_STREAM_ERROR$2;const T=b.state,r=T.wrap;if(r===2||r===1&&T.status!==INIT_STATE||T.lookahead)return Z_STREAM_ERROR$2;if(r===1&&(b.adler=adler32_1(b.adler,m,u,0)),T.wrap=0,u>=T.w_size){r===0&&(zero(T.head),T.strstart=0,T.block_start=0,T.insert=0);let i=new Uint8Array(T.w_size);i.set(m.subarray(u-T.w_size,u),0),m=i,u=T.w_size}const c=b.avail_in,e=b.next_in,t=b.input;for(b.avail_in=u,b.next_in=0,b.input=m,fill_window(T);T.lookahead>=MIN_MATCH;){let i=T.strstart,_=T.lookahead-(MIN_MATCH-1);do T.ins_h=HASH(T,T.ins_h,T.window[i+MIN_MATCH-1]),T.prev[i&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=i,i++;while(--_);T.strstart=i,T.lookahead=MIN_MATCH-1,fill_window(T)}return T.strstart+=T.lookahead,T.block_start=T.strstart,T.insert=T.lookahead,T.lookahead=0,T.match_length=T.prev_length=MIN_MATCH-1,T.match_available=0,b.next_in=e,b.input=t,b.avail_in=c,T.wrap=r,Z_OK$3};var deflateInit_1=deflateInit,deflateInit2_1=deflateInit2,deflateReset_1=deflateReset,deflateResetKeep_1=deflateResetKeep,deflateSetHeader_1=deflateSetHeader,deflate_2$1=deflate$2,deflateEnd_1=deflateEnd,deflateSetDictionary_1=deflateSetDictionary,deflateInfo="pako deflate (from Nodeca project)",deflate_1$2={deflateInit:deflateInit_1,deflateInit2:deflateInit2_1,deflateReset:deflateReset_1,deflateResetKeep:deflateResetKeep_1,deflateSetHeader:deflateSetHeader_1,deflate:deflate_2$1,deflateEnd:deflateEnd_1,deflateSetDictionary:deflateSetDictionary_1,deflateInfo};const _has=(b,m)=>Object.prototype.hasOwnProperty.call(b,m);var assign=function(b){const m=Array.prototype.slice.call(arguments,1);for(;m.length;){const u=m.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(const T in u)_has(u,T)&&(b[T]=u[T])}}return b},flattenChunks=b=>{let m=0;for(let T=0,r=b.length;T<r;T++)m+=b[T].length;const u=new Uint8Array(m);for(let T=0,r=0,c=b.length;T<c;T++){let e=b[T];u.set(e,r),r+=e.length}return u},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(b){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let b=0;b<256;b++)_utf8len[b]=b>=252?6:b>=248?5:b>=240?4:b>=224?3:b>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=b=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(b);let m,u,T,r,c,e=b.length,t=0;for(r=0;r<e;r++)u=b.charCodeAt(r),(u&64512)===55296&&r+1<e&&(T=b.charCodeAt(r+1),(T&64512)===56320&&(u=65536+(u-55296<<10)+(T-56320),r++)),t+=u<128?1:u<2048?2:u<65536?3:4;for(m=new Uint8Array(t),c=0,r=0;c<t;r++)u=b.charCodeAt(r),(u&64512)===55296&&r+1<e&&(T=b.charCodeAt(r+1),(T&64512)===56320&&(u=65536+(u-55296<<10)+(T-56320),r++)),u<128?m[c++]=u:u<2048?(m[c++]=192|u>>>6,m[c++]=128|u&63):u<65536?(m[c++]=224|u>>>12,m[c++]=128|u>>>6&63,m[c++]=128|u&63):(m[c++]=240|u>>>18,m[c++]=128|u>>>12&63,m[c++]=128|u>>>6&63,m[c++]=128|u&63);return m};const buf2binstring=(b,m)=>{if(m<65534&&b.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,b.length===m?b:b.subarray(0,m));let u="";for(let T=0;T<m;T++)u+=String.fromCharCode(b[T]);return u};var buf2string=(b,m)=>{const u=m||b.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(b.subarray(0,m));let T,r;const c=new Array(u*2);for(r=0,T=0;T<u;){let e=b[T++];if(e<128){c[r++]=e;continue}let t=_utf8len[e];if(t>4){c[r++]=65533,T+=t-1;continue}for(e&=t===2?31:t===3?15:7;t>1&&T<u;)e=e<<6|b[T++]&63,t--;if(t>1){c[r++]=65533;continue}e<65536?c[r++]=e:(e-=65536,c[r++]=55296|e>>10&1023,c[r++]=56320|e&1023)}return buf2binstring(c,r)},utf8border=(b,m)=>{m=m||b.length,m>b.length&&(m=b.length);let u=m-1;for(;u>=0&&(b[u]&192)===128;)u--;return u<0||u===0?m:u+_utf8len[b[u]]>m?u:m},strings={string2buf,buf2string,utf8border};function ZStream(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var zstream=ZStream;const toString$1=Object.prototype.toString,{Z_NO_FLUSH:Z_NO_FLUSH$1,Z_SYNC_FLUSH,Z_FULL_FLUSH,Z_FINISH:Z_FINISH$2,Z_OK:Z_OK$2,Z_STREAM_END:Z_STREAM_END$2,Z_DEFAULT_COMPRESSION,Z_DEFAULT_STRATEGY,Z_DEFLATED:Z_DEFLATED$1}=constants$2;function Deflate$1(b){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},b||{});let m=this.options;m.raw&&m.windowBits>0?m.windowBits=-m.windowBits:m.gzip&&m.windowBits>0&&m.windowBits<16&&(m.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let u=deflate_1$2.deflateInit2(this.strm,m.level,m.method,m.windowBits,m.memLevel,m.strategy);if(u!==Z_OK$2)throw new Error(messages[u]);if(m.header&&deflate_1$2.deflateSetHeader(this.strm,m.header),m.dictionary){let T;if(typeof m.dictionary=="string"?T=strings.string2buf(m.dictionary):toString$1.call(m.dictionary)==="[object ArrayBuffer]"?T=new Uint8Array(m.dictionary):T=m.dictionary,u=deflate_1$2.deflateSetDictionary(this.strm,T),u!==Z_OK$2)throw new Error(messages[u]);this._dict_set=!0}}Deflate$1.prototype.push=function(b,m){const u=this.strm,T=this.options.chunkSize;let r,c;if(this.ended)return!1;for(m===~~m?c=m:c=m===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof b=="string"?u.input=strings.string2buf(b):toString$1.call(b)==="[object ArrayBuffer]"?u.input=new Uint8Array(b):u.input=b,u.next_in=0,u.avail_in=u.input.length;;){if(u.avail_out===0&&(u.output=new Uint8Array(T),u.next_out=0,u.avail_out=T),(c===Z_SYNC_FLUSH||c===Z_FULL_FLUSH)&&u.avail_out<=6){this.onData(u.output.subarray(0,u.next_out)),u.avail_out=0;continue}if(r=deflate_1$2.deflate(u,c),r===Z_STREAM_END$2)return u.next_out>0&&this.onData(u.output.subarray(0,u.next_out)),r=deflate_1$2.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Z_OK$2;if(u.avail_out===0){this.onData(u.output);continue}if(c>0&&u.next_out>0){this.onData(u.output.subarray(0,u.next_out)),u.avail_out=0;continue}if(u.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(b){this.chunks.push(b)},Deflate$1.prototype.onEnd=function(b){b===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=b,this.msg=this.strm.msg};function deflate$1(b,m){const u=new Deflate$1(m);if(u.push(b,!0),u.err)throw u.msg||messages[u.err];return u.result}function deflateRaw$1(b,m){return m=m||{},m.raw=!0,deflate$1(b,m)}function gzip$1(b,m){return m=m||{},m.gzip=!0,deflate$1(b,m)}var Deflate_1$1=Deflate$1,deflate_2=deflate$1,deflateRaw_1$1=deflateRaw$1,gzip_1$1=gzip$1,deflate_1$1={Deflate:Deflate_1$1,deflate:deflate_2,deflateRaw:deflateRaw_1$1,gzip:gzip_1$1};const BAD$1=16209,TYPE$1=16191;var inffast=function(m,u){let T,r,c,e,t,i,_,I,x,M,j,z,Q,ne,K,oe,ue,G,ie,le,re,se,de,ee;const ae=m.state;T=m.next_in,de=m.input,r=T+(m.avail_in-5),c=m.next_out,ee=m.output,e=c-(u-m.avail_out),t=c+(m.avail_out-257),i=ae.dmax,_=ae.wsize,I=ae.whave,x=ae.wnext,M=ae.window,j=ae.hold,z=ae.bits,Q=ae.lencode,ne=ae.distcode,K=(1<<ae.lenbits)-1,oe=(1<<ae.distbits)-1;e:do{z<15&&(j+=de[T++]<<z,z+=8,j+=de[T++]<<z,z+=8),ue=Q[j&K];t:for(;;){if(G=ue>>>24,j>>>=G,z-=G,G=ue>>>16&255,G===0)ee[c++]=ue&65535;else if(G&16){ie=ue&65535,G&=15,G&&(z<G&&(j+=de[T++]<<z,z+=8),ie+=j&(1<<G)-1,j>>>=G,z-=G),z<15&&(j+=de[T++]<<z,z+=8,j+=de[T++]<<z,z+=8),ue=ne[j&oe];i:for(;;){if(G=ue>>>24,j>>>=G,z-=G,G=ue>>>16&255,G&16){if(le=ue&65535,G&=15,z<G&&(j+=de[T++]<<z,z+=8,z<G&&(j+=de[T++]<<z,z+=8)),le+=j&(1<<G)-1,le>i){m.msg="invalid distance too far back",ae.mode=BAD$1;break e}if(j>>>=G,z-=G,G=c-e,le>G){if(G=le-G,G>I&&ae.sane){m.msg="invalid distance too far back",ae.mode=BAD$1;break e}if(re=0,se=M,x===0){if(re+=_-G,G<ie){ie-=G;do ee[c++]=M[re++];while(--G);re=c-le,se=ee}}else if(x<G){if(re+=_+x-G,G-=x,G<ie){ie-=G;do ee[c++]=M[re++];while(--G);if(re=0,x<ie){G=x,ie-=G;do ee[c++]=M[re++];while(--G);re=c-le,se=ee}}}else if(re+=x-G,G<ie){ie-=G;do ee[c++]=M[re++];while(--G);re=c-le,se=ee}for(;ie>2;)ee[c++]=se[re++],ee[c++]=se[re++],ee[c++]=se[re++],ie-=3;ie&&(ee[c++]=se[re++],ie>1&&(ee[c++]=se[re++]))}else{re=c-le;do ee[c++]=ee[re++],ee[c++]=ee[re++],ee[c++]=ee[re++],ie-=3;while(ie>2);ie&&(ee[c++]=ee[re++],ie>1&&(ee[c++]=ee[re++]))}}else if((G&64)===0){ue=ne[(ue&65535)+(j&(1<<G)-1)];continue i}else{m.msg="invalid distance code",ae.mode=BAD$1;break e}break}}else if((G&64)===0){ue=Q[(ue&65535)+(j&(1<<G)-1)];continue t}else if(G&32){ae.mode=TYPE$1;break e}else{m.msg="invalid literal/length code",ae.mode=BAD$1;break e}break}}while(T<r&&c<t);ie=z>>3,T-=ie,z-=ie<<3,j&=(1<<z)-1,m.next_in=T,m.next_out=c,m.avail_in=T<r?5+(r-T):5-(T-r),m.avail_out=c<t?257+(t-c):257-(c-t),ae.hold=j,ae.bits=z};const MAXBITS=15,ENOUGH_LENS$1=852,ENOUGH_DISTS$1=592,CODES$1=0,LENS$1=1,DISTS$1=2,lbase=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),lext=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),dbase=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),dext=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),inflate_table=(b,m,u,T,r,c,e,t)=>{const i=t.bits;let _=0,I=0,x=0,M=0,j=0,z=0,Q=0,ne=0,K=0,oe=0,ue,G,ie,le,re,se=null,de;const ee=new Uint16Array(MAXBITS+1),ae=new Uint16Array(MAXBITS+1);let pe=null,he,ye,ge;for(_=0;_<=MAXBITS;_++)ee[_]=0;for(I=0;I<T;I++)ee[m[u+I]]++;for(j=i,M=MAXBITS;M>=1&&ee[M]===0;M--);if(j>M&&(j=M),M===0)return r[c++]=1<<24|64<<16|0,r[c++]=1<<24|64<<16|0,t.bits=1,0;for(x=1;x<M&&ee[x]===0;x++);for(j<x&&(j=x),ne=1,_=1;_<=MAXBITS;_++)if(ne<<=1,ne-=ee[_],ne<0)return-1;if(ne>0&&(b===CODES$1||M!==1))return-1;for(ae[1]=0,_=1;_<MAXBITS;_++)ae[_+1]=ae[_]+ee[_];for(I=0;I<T;I++)m[u+I]!==0&&(e[ae[m[u+I]]++]=I);if(b===CODES$1?(se=pe=e,de=20):b===LENS$1?(se=lbase,pe=lext,de=257):(se=dbase,pe=dext,de=0),oe=0,I=0,_=x,re=c,z=j,Q=0,ie=-1,K=1<<j,le=K-1,b===LENS$1&&K>ENOUGH_LENS$1||b===DISTS$1&&K>ENOUGH_DISTS$1)return 1;for(;;){he=_-Q,e[I]+1<de?(ye=0,ge=e[I]):e[I]>=de?(ye=pe[e[I]-de],ge=se[e[I]-de]):(ye=96,ge=0),ue=1<<_-Q,G=1<<z,x=G;do G-=ue,r[re+(oe>>Q)+G]=he<<24|ye<<16|ge|0;while(G!==0);for(ue=1<<_-1;oe&ue;)ue>>=1;if(ue!==0?(oe&=ue-1,oe+=ue):oe=0,I++,--ee[_]===0){if(_===M)break;_=m[u+e[I]]}if(_>j&&(oe&le)!==ie){for(Q===0&&(Q=j),re+=x,z=_-Q,ne=1<<z;z+Q<M&&(ne-=ee[z+Q],!(ne<=0));)z++,ne<<=1;if(K+=1<<z,b===LENS$1&&K>ENOUGH_LENS$1||b===DISTS$1&&K>ENOUGH_DISTS$1)return 1;ie=oe&le,r[ie]=j<<24|z<<16|re-c|0}}return oe!==0&&(r[re+oe]=_-Q<<24|64<<16|0),t.bits=j,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK,Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR,Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=b=>(b>>>24&255)+(b>>>8&65280)+((b&65280)<<8)+((b&255)<<24);function InflateState(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const inflateStateCheck=b=>{if(!b)return 1;const m=b.state;return!m||m.strm!==b||m.mode<HEAD||m.mode>SYNC?1:0},inflateResetKeep=b=>{if(inflateStateCheck(b))return Z_STREAM_ERROR$1;const m=b.state;return b.total_in=b.total_out=m.total=0,b.msg="",m.wrap&&(b.adler=m.wrap&1),m.mode=HEAD,m.last=0,m.havedict=0,m.flags=-1,m.dmax=32768,m.head=null,m.hold=0,m.bits=0,m.lencode=m.lendyn=new Int32Array(ENOUGH_LENS),m.distcode=m.distdyn=new Int32Array(ENOUGH_DISTS),m.sane=1,m.back=-1,Z_OK$1},inflateReset=b=>{if(inflateStateCheck(b))return Z_STREAM_ERROR$1;const m=b.state;return m.wsize=0,m.whave=0,m.wnext=0,inflateResetKeep(b)},inflateReset2=(b,m)=>{let u;if(inflateStateCheck(b))return Z_STREAM_ERROR$1;const T=b.state;return m<0?(u=0,m=-m):(u=(m>>4)+5,m<48&&(m&=15)),m&&(m<8||m>15)?Z_STREAM_ERROR$1:(T.window!==null&&T.wbits!==m&&(T.window=null),T.wrap=u,T.wbits=m,inflateReset(b))},inflateInit2=(b,m)=>{if(!b)return Z_STREAM_ERROR$1;const u=new InflateState;b.state=u,u.strm=b,u.window=null,u.mode=HEAD;const T=inflateReset2(b,m);return T!==Z_OK$1&&(b.state=null),T},inflateInit=b=>inflateInit2(b,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=b=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let m=0;for(;m<144;)b.lens[m++]=8;for(;m<256;)b.lens[m++]=9;for(;m<280;)b.lens[m++]=7;for(;m<288;)b.lens[m++]=8;for(inftrees(LENS,b.lens,0,288,lenfix,0,b.work,{bits:9}),m=0;m<32;)b.lens[m++]=5;inftrees(DISTS,b.lens,0,32,distfix,0,b.work,{bits:5}),virgin=!1}b.lencode=lenfix,b.lenbits=9,b.distcode=distfix,b.distbits=5},updatewindow=(b,m,u,T)=>{let r;const c=b.state;return c.window===null&&(c.wsize=1<<c.wbits,c.wnext=0,c.whave=0,c.window=new Uint8Array(c.wsize)),T>=c.wsize?(c.window.set(m.subarray(u-c.wsize,u),0),c.wnext=0,c.whave=c.wsize):(r=c.wsize-c.wnext,r>T&&(r=T),c.window.set(m.subarray(u-T,u-T+r),c.wnext),T-=r,T?(c.window.set(m.subarray(u-T,u),0),c.wnext=T,c.whave=c.wsize):(c.wnext+=r,c.wnext===c.wsize&&(c.wnext=0),c.whave<c.wsize&&(c.whave+=r))),0},inflate$2=(b,m)=>{let u,T,r,c,e,t,i,_,I,x,M,j,z,Q,ne=0,K,oe,ue,G,ie,le,re,se;const de=new Uint8Array(4);let ee,ae;const pe=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(b)||!b.output||!b.input&&b.avail_in!==0)return Z_STREAM_ERROR$1;u=b.state,u.mode===TYPE&&(u.mode=TYPEDO),e=b.next_out,r=b.output,i=b.avail_out,c=b.next_in,T=b.input,t=b.avail_in,_=u.hold,I=u.bits,x=t,M=i,se=Z_OK$1;e:for(;;)switch(u.mode){case HEAD:if(u.wrap===0){u.mode=TYPEDO;break}for(;I<16;){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}if(u.wrap&2&&_===35615){u.wbits===0&&(u.wbits=15),u.check=0,de[0]=_&255,de[1]=_>>>8&255,u.check=crc32_1(u.check,de,2,0),_=0,I=0,u.mode=FLAGS;break}if(u.head&&(u.head.done=!1),!(u.wrap&1)||(((_&255)<<8)+(_>>8))%31){b.msg="incorrect header check",u.mode=BAD;break}if((_&15)!==Z_DEFLATED){b.msg="unknown compression method",u.mode=BAD;break}if(_>>>=4,I-=4,re=(_&15)+8,u.wbits===0&&(u.wbits=re),re>15||re>u.wbits){b.msg="invalid window size",u.mode=BAD;break}u.dmax=1<<u.wbits,u.flags=0,b.adler=u.check=1,u.mode=_&512?DICTID:TYPE,_=0,I=0;break;case FLAGS:for(;I<16;){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}if(u.flags=_,(u.flags&255)!==Z_DEFLATED){b.msg="unknown compression method",u.mode=BAD;break}if(u.flags&57344){b.msg="unknown header flags set",u.mode=BAD;break}u.head&&(u.head.text=_>>8&1),u.flags&512&&u.wrap&4&&(de[0]=_&255,de[1]=_>>>8&255,u.check=crc32_1(u.check,de,2,0)),_=0,I=0,u.mode=TIME;case TIME:for(;I<32;){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}u.head&&(u.head.time=_),u.flags&512&&u.wrap&4&&(de[0]=_&255,de[1]=_>>>8&255,de[2]=_>>>16&255,de[3]=_>>>24&255,u.check=crc32_1(u.check,de,4,0)),_=0,I=0,u.mode=OS;case OS:for(;I<16;){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}u.head&&(u.head.xflags=_&255,u.head.os=_>>8),u.flags&512&&u.wrap&4&&(de[0]=_&255,de[1]=_>>>8&255,u.check=crc32_1(u.check,de,2,0)),_=0,I=0,u.mode=EXLEN;case EXLEN:if(u.flags&1024){for(;I<16;){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}u.length=_,u.head&&(u.head.extra_len=_),u.flags&512&&u.wrap&4&&(de[0]=_&255,de[1]=_>>>8&255,u.check=crc32_1(u.check,de,2,0)),_=0,I=0}else u.head&&(u.head.extra=null);u.mode=EXTRA;case EXTRA:if(u.flags&1024&&(j=u.length,j>t&&(j=t),j&&(u.head&&(re=u.head.extra_len-u.length,u.head.extra||(u.head.extra=new Uint8Array(u.head.extra_len)),u.head.extra.set(T.subarray(c,c+j),re)),u.flags&512&&u.wrap&4&&(u.check=crc32_1(u.check,T,j,c)),t-=j,c+=j,u.length-=j),u.length))break e;u.length=0,u.mode=NAME;case NAME:if(u.flags&2048){if(t===0)break e;j=0;do re=T[c+j++],u.head&&re&&u.length<65536&&(u.head.name+=String.fromCharCode(re));while(re&&j<t);if(u.flags&512&&u.wrap&4&&(u.check=crc32_1(u.check,T,j,c)),t-=j,c+=j,re)break e}else u.head&&(u.head.name=null);u.length=0,u.mode=COMMENT;case COMMENT:if(u.flags&4096){if(t===0)break e;j=0;do re=T[c+j++],u.head&&re&&u.length<65536&&(u.head.comment+=String.fromCharCode(re));while(re&&j<t);if(u.flags&512&&u.wrap&4&&(u.check=crc32_1(u.check,T,j,c)),t-=j,c+=j,re)break e}else u.head&&(u.head.comment=null);u.mode=HCRC;case HCRC:if(u.flags&512){for(;I<16;){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}if(u.wrap&4&&_!==(u.check&65535)){b.msg="header crc mismatch",u.mode=BAD;break}_=0,I=0}u.head&&(u.head.hcrc=u.flags>>9&1,u.head.done=!0),b.adler=u.check=0,u.mode=TYPE;break;case DICTID:for(;I<32;){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}b.adler=u.check=zswap32(_),_=0,I=0,u.mode=DICT;case DICT:if(u.havedict===0)return b.next_out=e,b.avail_out=i,b.next_in=c,b.avail_in=t,u.hold=_,u.bits=I,Z_NEED_DICT$1;b.adler=u.check=1,u.mode=TYPE;case TYPE:if(m===Z_BLOCK||m===Z_TREES)break e;case TYPEDO:if(u.last){_>>>=I&7,I-=I&7,u.mode=CHECK;break}for(;I<3;){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}switch(u.last=_&1,_>>>=1,I-=1,_&3){case 0:u.mode=STORED;break;case 1:if(fixedtables(u),u.mode=LEN_,m===Z_TREES){_>>>=2,I-=2;break e}break;case 2:u.mode=TABLE;break;case 3:b.msg="invalid block type",u.mode=BAD}_>>>=2,I-=2;break;case STORED:for(_>>>=I&7,I-=I&7;I<32;){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}if((_&65535)!==(_>>>16^65535)){b.msg="invalid stored block lengths",u.mode=BAD;break}if(u.length=_&65535,_=0,I=0,u.mode=COPY_,m===Z_TREES)break e;case COPY_:u.mode=COPY;case COPY:if(j=u.length,j){if(j>t&&(j=t),j>i&&(j=i),j===0)break e;r.set(T.subarray(c,c+j),e),t-=j,c+=j,i-=j,e+=j,u.length-=j;break}u.mode=TYPE;break;case TABLE:for(;I<14;){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}if(u.nlen=(_&31)+257,_>>>=5,I-=5,u.ndist=(_&31)+1,_>>>=5,I-=5,u.ncode=(_&15)+4,_>>>=4,I-=4,u.nlen>286||u.ndist>30){b.msg="too many length or distance symbols",u.mode=BAD;break}u.have=0,u.mode=LENLENS;case LENLENS:for(;u.have<u.ncode;){for(;I<3;){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}u.lens[pe[u.have++]]=_&7,_>>>=3,I-=3}for(;u.have<19;)u.lens[pe[u.have++]]=0;if(u.lencode=u.lendyn,u.lenbits=7,ee={bits:u.lenbits},se=inftrees(CODES,u.lens,0,19,u.lencode,0,u.work,ee),u.lenbits=ee.bits,se){b.msg="invalid code lengths set",u.mode=BAD;break}u.have=0,u.mode=CODELENS;case CODELENS:for(;u.have<u.nlen+u.ndist;){for(;ne=u.lencode[_&(1<<u.lenbits)-1],K=ne>>>24,oe=ne>>>16&255,ue=ne&65535,!(K<=I);){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}if(ue<16)_>>>=K,I-=K,u.lens[u.have++]=ue;else{if(ue===16){for(ae=K+2;I<ae;){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}if(_>>>=K,I-=K,u.have===0){b.msg="invalid bit length repeat",u.mode=BAD;break}re=u.lens[u.have-1],j=3+(_&3),_>>>=2,I-=2}else if(ue===17){for(ae=K+3;I<ae;){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}_>>>=K,I-=K,re=0,j=3+(_&7),_>>>=3,I-=3}else{for(ae=K+7;I<ae;){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}_>>>=K,I-=K,re=0,j=11+(_&127),_>>>=7,I-=7}if(u.have+j>u.nlen+u.ndist){b.msg="invalid bit length repeat",u.mode=BAD;break}for(;j--;)u.lens[u.have++]=re}}if(u.mode===BAD)break;if(u.lens[256]===0){b.msg="invalid code -- missing end-of-block",u.mode=BAD;break}if(u.lenbits=9,ee={bits:u.lenbits},se=inftrees(LENS,u.lens,0,u.nlen,u.lencode,0,u.work,ee),u.lenbits=ee.bits,se){b.msg="invalid literal/lengths set",u.mode=BAD;break}if(u.distbits=6,u.distcode=u.distdyn,ee={bits:u.distbits},se=inftrees(DISTS,u.lens,u.nlen,u.ndist,u.distcode,0,u.work,ee),u.distbits=ee.bits,se){b.msg="invalid distances set",u.mode=BAD;break}if(u.mode=LEN_,m===Z_TREES)break e;case LEN_:u.mode=LEN;case LEN:if(t>=6&&i>=258){b.next_out=e,b.avail_out=i,b.next_in=c,b.avail_in=t,u.hold=_,u.bits=I,inffast(b,M),e=b.next_out,r=b.output,i=b.avail_out,c=b.next_in,T=b.input,t=b.avail_in,_=u.hold,I=u.bits,u.mode===TYPE&&(u.back=-1);break}for(u.back=0;ne=u.lencode[_&(1<<u.lenbits)-1],K=ne>>>24,oe=ne>>>16&255,ue=ne&65535,!(K<=I);){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}if(oe&&(oe&240)===0){for(G=K,ie=oe,le=ue;ne=u.lencode[le+((_&(1<<G+ie)-1)>>G)],K=ne>>>24,oe=ne>>>16&255,ue=ne&65535,!(G+K<=I);){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}_>>>=G,I-=G,u.back+=G}if(_>>>=K,I-=K,u.back+=K,u.length=ue,oe===0){u.mode=LIT;break}if(oe&32){u.back=-1,u.mode=TYPE;break}if(oe&64){b.msg="invalid literal/length code",u.mode=BAD;break}u.extra=oe&15,u.mode=LENEXT;case LENEXT:if(u.extra){for(ae=u.extra;I<ae;){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}u.length+=_&(1<<u.extra)-1,_>>>=u.extra,I-=u.extra,u.back+=u.extra}u.was=u.length,u.mode=DIST;case DIST:for(;ne=u.distcode[_&(1<<u.distbits)-1],K=ne>>>24,oe=ne>>>16&255,ue=ne&65535,!(K<=I);){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}if((oe&240)===0){for(G=K,ie=oe,le=ue;ne=u.distcode[le+((_&(1<<G+ie)-1)>>G)],K=ne>>>24,oe=ne>>>16&255,ue=ne&65535,!(G+K<=I);){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}_>>>=G,I-=G,u.back+=G}if(_>>>=K,I-=K,u.back+=K,oe&64){b.msg="invalid distance code",u.mode=BAD;break}u.offset=ue,u.extra=oe&15,u.mode=DISTEXT;case DISTEXT:if(u.extra){for(ae=u.extra;I<ae;){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}u.offset+=_&(1<<u.extra)-1,_>>>=u.extra,I-=u.extra,u.back+=u.extra}if(u.offset>u.dmax){b.msg="invalid distance too far back",u.mode=BAD;break}u.mode=MATCH;case MATCH:if(i===0)break e;if(j=M-i,u.offset>j){if(j=u.offset-j,j>u.whave&&u.sane){b.msg="invalid distance too far back",u.mode=BAD;break}j>u.wnext?(j-=u.wnext,z=u.wsize-j):z=u.wnext-j,j>u.length&&(j=u.length),Q=u.window}else Q=r,z=e-u.offset,j=u.length;j>i&&(j=i),i-=j,u.length-=j;do r[e++]=Q[z++];while(--j);u.length===0&&(u.mode=LEN);break;case LIT:if(i===0)break e;r[e++]=u.length,i--,u.mode=LEN;break;case CHECK:if(u.wrap){for(;I<32;){if(t===0)break e;t--,_|=T[c++]<<I,I+=8}if(M-=i,b.total_out+=M,u.total+=M,u.wrap&4&&M&&(b.adler=u.check=u.flags?crc32_1(u.check,r,M,e-M):adler32_1(u.check,r,M,e-M)),M=i,u.wrap&4&&(u.flags?_:zswap32(_))!==u.check){b.msg="incorrect data check",u.mode=BAD;break}_=0,I=0}u.mode=LENGTH;case LENGTH:if(u.wrap&&u.flags){for(;I<32;){if(t===0)break e;t--,_+=T[c++]<<I,I+=8}if(u.wrap&4&&_!==(u.total&4294967295)){b.msg="incorrect length check",u.mode=BAD;break}_=0,I=0}u.mode=DONE;case DONE:se=Z_STREAM_END$1;break e;case BAD:se=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return b.next_out=e,b.avail_out=i,b.next_in=c,b.avail_in=t,u.hold=_,u.bits=I,(u.wsize||M!==b.avail_out&&u.mode<BAD&&(u.mode<CHECK||m!==Z_FINISH$1))&&updatewindow(b,b.output,b.next_out,M-b.avail_out),x-=b.avail_in,M-=b.avail_out,b.total_in+=x,b.total_out+=M,u.total+=M,u.wrap&4&&M&&(b.adler=u.check=u.flags?crc32_1(u.check,r,M,b.next_out-M):adler32_1(u.check,r,M,b.next_out-M)),b.data_type=u.bits+(u.last?64:0)+(u.mode===TYPE?128:0)+(u.mode===LEN_||u.mode===COPY_?256:0),(x===0&&M===0||m===Z_FINISH$1)&&se===Z_OK$1&&(se=Z_BUF_ERROR),se},inflateEnd=b=>{if(inflateStateCheck(b))return Z_STREAM_ERROR$1;let m=b.state;return m.window&&(m.window=null),b.state=null,Z_OK$1},inflateGetHeader=(b,m)=>{if(inflateStateCheck(b))return Z_STREAM_ERROR$1;const u=b.state;return(u.wrap&2)===0?Z_STREAM_ERROR$1:(u.head=m,m.done=!1,Z_OK$1)},inflateSetDictionary=(b,m)=>{const u=m.length;let T,r,c;return inflateStateCheck(b)||(T=b.state,T.wrap!==0&&T.mode!==DICT)?Z_STREAM_ERROR$1:T.mode===DICT&&(r=1,r=adler32_1(r,m,u,0),r!==T.check)?Z_DATA_ERROR$1:(c=updatewindow(b,m,u,u),c?(T.mode=MEM,Z_MEM_ERROR$1):(T.havedict=1,Z_OK$1))};var inflateReset_1=inflateReset,inflateReset2_1=inflateReset2,inflateResetKeep_1=inflateResetKeep,inflateInit_1=inflateInit,inflateInit2_1=inflateInit2,inflate_2$1=inflate$2,inflateEnd_1=inflateEnd,inflateGetHeader_1=inflateGetHeader,inflateSetDictionary_1=inflateSetDictionary,inflateInfo="pako inflate (from Nodeca project)",inflate_1$2={inflateReset:inflateReset_1,inflateReset2:inflateReset2_1,inflateResetKeep:inflateResetKeep_1,inflateInit:inflateInit_1,inflateInit2:inflateInit2_1,inflate:inflate_2$1,inflateEnd:inflateEnd_1,inflateGetHeader:inflateGetHeader_1,inflateSetDictionary:inflateSetDictionary_1,inflateInfo};function GZheader(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var gzheader=GZheader;const toString=Object.prototype.toString,{Z_NO_FLUSH,Z_FINISH,Z_OK,Z_STREAM_END,Z_NEED_DICT,Z_STREAM_ERROR,Z_DATA_ERROR,Z_MEM_ERROR}=constants$2;function Inflate$1(b){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},b||{});const m=this.options;m.raw&&m.windowBits>=0&&m.windowBits<16&&(m.windowBits=-m.windowBits,m.windowBits===0&&(m.windowBits=-15)),m.windowBits>=0&&m.windowBits<16&&!(b&&b.windowBits)&&(m.windowBits+=32),m.windowBits>15&&m.windowBits<48&&(m.windowBits&15)===0&&(m.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let u=inflate_1$2.inflateInit2(this.strm,m.windowBits);if(u!==Z_OK)throw new Error(messages[u]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),m.dictionary&&(typeof m.dictionary=="string"?m.dictionary=strings.string2buf(m.dictionary):toString.call(m.dictionary)==="[object ArrayBuffer]"&&(m.dictionary=new Uint8Array(m.dictionary)),m.raw&&(u=inflate_1$2.inflateSetDictionary(this.strm,m.dictionary),u!==Z_OK)))throw new Error(messages[u])}Inflate$1.prototype.push=function(b,m){const u=this.strm,T=this.options.chunkSize,r=this.options.dictionary;let c,e,t;if(this.ended)return!1;for(m===~~m?e=m:e=m===!0?Z_FINISH:Z_NO_FLUSH,toString.call(b)==="[object ArrayBuffer]"?u.input=new Uint8Array(b):u.input=b,u.next_in=0,u.avail_in=u.input.length;;){for(u.avail_out===0&&(u.output=new Uint8Array(T),u.next_out=0,u.avail_out=T),c=inflate_1$2.inflate(u,e),c===Z_NEED_DICT&&r&&(c=inflate_1$2.inflateSetDictionary(u,r),c===Z_OK?c=inflate_1$2.inflate(u,e):c===Z_DATA_ERROR&&(c=Z_NEED_DICT));u.avail_in>0&&c===Z_STREAM_END&&u.state.wrap>0&&b[u.next_in]!==0;)inflate_1$2.inflateReset(u),c=inflate_1$2.inflate(u,e);switch(c){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(c),this.ended=!0,!1}if(t=u.avail_out,u.next_out&&(u.avail_out===0||c===Z_STREAM_END))if(this.options.to==="string"){let i=strings.utf8border(u.output,u.next_out),_=u.next_out-i,I=strings.buf2string(u.output,i);u.next_out=_,u.avail_out=T-_,_&&u.output.set(u.output.subarray(i,i+_),0),this.onData(I)}else this.onData(u.output.length===u.next_out?u.output:u.output.subarray(0,u.next_out));if(!(c===Z_OK&&t===0)){if(c===Z_STREAM_END)return c=inflate_1$2.inflateEnd(this.strm),this.onEnd(c),this.ended=!0,!0;if(u.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(b){this.chunks.push(b)},Inflate$1.prototype.onEnd=function(b){b===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=b,this.msg=this.strm.msg};function inflate$1(b,m){const u=new Inflate$1(m);if(u.push(b),u.err)throw u.msg||messages[u.err];return u.result}function inflateRaw$1(b,m){return m=m||{},m.raw=!0,inflate$1(b,m)}var Inflate_1$1=Inflate$1,inflate_2=inflate$1,inflateRaw_1$1=inflateRaw$1,ungzip$1=inflate$1,inflate_1$1={Inflate:Inflate_1$1,inflate:inflate_2,inflateRaw:inflateRaw_1$1,ungzip:ungzip$1};const{Deflate,deflate,deflateRaw,gzip}=deflate_1$1,{Inflate,inflate,inflateRaw,ungzip}=inflate_1$1;var Deflate_1=Deflate,deflate_1=deflate,deflateRaw_1=deflateRaw,gzip_1=gzip,Inflate_1=Inflate,inflate_1=inflate,inflateRaw_1=inflateRaw,ungzip_1=ungzip,constants_1=constants$2,pako={Deflate:Deflate_1,deflate:deflate_1,deflateRaw:deflateRaw_1,gzip:gzip_1,Inflate:Inflate_1,inflate:inflate_1,inflateRaw:inflateRaw_1,ungzip:ungzip_1,constants:constants_1},commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(b){return b&&b.__esModule&&Object.prototype.hasOwnProperty.call(b,"default")?b.default:b}var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=b;function b(m,u){for(var T=new Array(arguments.length-1),r=0,c=2,e=!0;c<arguments.length;)T[r++]=arguments[c++];return new Promise(function(i,_){T[r]=function(x){if(e)if(e=!1,x)_(x);else{for(var M=new Array(arguments.length-1),j=0;j<M.length;)M[j++]=arguments[j];i.apply(null,M)}};try{m.apply(u||null,T)}catch(I){e&&(e=!1,_(I))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,(function(b){var m=b;m.length=function(t){var i=t.length;if(!i)return 0;for(var _=0;--i%4>1&&t.charAt(i)==="=";)++_;return Math.ceil(t.length*3)/4-_};for(var u=new Array(64),T=new Array(123),r=0;r<64;)T[u[r]=r<26?r+65:r<52?r+71:r<62?r-4:r-59|43]=r++;m.encode=function(t,i,_){for(var I=null,x=[],M=0,j=0,z;i<_;){var Q=t[i++];switch(j){case 0:x[M++]=u[Q>>2],z=(Q&3)<<4,j=1;break;case 1:x[M++]=u[z|Q>>4],z=(Q&15)<<2,j=2;break;case 2:x[M++]=u[z|Q>>6],x[M++]=u[Q&63],j=0;break}M>8191&&((I||(I=[])).push(String.fromCharCode.apply(String,x)),M=0)}return j&&(x[M++]=u[z],x[M++]=61,j===1&&(x[M++]=61)),I?(M&&I.push(String.fromCharCode.apply(String,x.slice(0,M))),I.join("")):String.fromCharCode.apply(String,x.slice(0,M))};var c="invalid encoding";m.decode=function(t,i,_){for(var I=_,x=0,M,j=0;j<t.length;){var z=t.charCodeAt(j++);if(z===61&&x>1)break;if((z=T[z])===void 0)throw Error(c);switch(x){case 0:M=z,x=1;break;case 1:i[_++]=M<<2|(z&48)>>4,M=z,x=2;break;case 2:i[_++]=(M&15)<<4|(z&60)>>2,M=z,x=3;break;case 3:i[_++]=(M&3)<<6|z,x=0;break}}if(x===1)throw Error(c);return _-I},m.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}})(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=b;function b(){this._listeners={}}return b.prototype.on=function(u,T,r){return(this._listeners[u]||(this._listeners[u]=[])).push({fn:T,ctx:r||this}),this},b.prototype.off=function(u,T){if(u===void 0)this._listeners={};else if(T===void 0)this._listeners[u]=[];else for(var r=this._listeners[u],c=0;c<r.length;)r[c].fn===T?r.splice(c,1):++c;return this},b.prototype.emit=function(u){var T=this._listeners[u];if(T){for(var r=[],c=1;c<arguments.length;)r.push(arguments[c++]);for(c=0;c<T.length;)T[c].fn.apply(T[c++].ctx,r)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=b(b);function b(c){return typeof Float32Array<"u"?(function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),i=t[3]===128;function _(j,z,Q){e[0]=j,z[Q]=t[0],z[Q+1]=t[1],z[Q+2]=t[2],z[Q+3]=t[3]}function I(j,z,Q){e[0]=j,z[Q]=t[3],z[Q+1]=t[2],z[Q+2]=t[1],z[Q+3]=t[0]}c.writeFloatLE=i?_:I,c.writeFloatBE=i?I:_;function x(j,z){return t[0]=j[z],t[1]=j[z+1],t[2]=j[z+2],t[3]=j[z+3],e[0]}function M(j,z){return t[3]=j[z],t[2]=j[z+1],t[1]=j[z+2],t[0]=j[z+3],e[0]}c.readFloatLE=i?x:M,c.readFloatBE=i?M:x})():(function(){function e(i,_,I,x){var M=_<0?1:0;if(M&&(_=-_),_===0)i(1/_>0?0:2147483648,I,x);else if(isNaN(_))i(2143289344,I,x);else if(_>34028234663852886e22)i((M<<31|2139095040)>>>0,I,x);else if(_<11754943508222875e-54)i((M<<31|Math.round(_/1401298464324817e-60))>>>0,I,x);else{var j=Math.floor(Math.log(_)/Math.LN2),z=Math.round(_*Math.pow(2,-j)*8388608)&8388607;i((M<<31|j+127<<23|z)>>>0,I,x)}}c.writeFloatLE=e.bind(null,m),c.writeFloatBE=e.bind(null,u);function t(i,_,I){var x=i(_,I),M=(x>>31)*2+1,j=x>>>23&255,z=x&8388607;return j===255?z?NaN:M*(1/0):j===0?M*1401298464324817e-60*z:M*Math.pow(2,j-150)*(z+8388608)}c.readFloatLE=t.bind(null,T),c.readFloatBE=t.bind(null,r)})(),typeof Float64Array<"u"?(function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),i=t[7]===128;function _(j,z,Q){e[0]=j,z[Q]=t[0],z[Q+1]=t[1],z[Q+2]=t[2],z[Q+3]=t[3],z[Q+4]=t[4],z[Q+5]=t[5],z[Q+6]=t[6],z[Q+7]=t[7]}function I(j,z,Q){e[0]=j,z[Q]=t[7],z[Q+1]=t[6],z[Q+2]=t[5],z[Q+3]=t[4],z[Q+4]=t[3],z[Q+5]=t[2],z[Q+6]=t[1],z[Q+7]=t[0]}c.writeDoubleLE=i?_:I,c.writeDoubleBE=i?I:_;function x(j,z){return t[0]=j[z],t[1]=j[z+1],t[2]=j[z+2],t[3]=j[z+3],t[4]=j[z+4],t[5]=j[z+5],t[6]=j[z+6],t[7]=j[z+7],e[0]}function M(j,z){return t[7]=j[z],t[6]=j[z+1],t[5]=j[z+2],t[4]=j[z+3],t[3]=j[z+4],t[2]=j[z+5],t[1]=j[z+6],t[0]=j[z+7],e[0]}c.readDoubleLE=i?x:M,c.readDoubleBE=i?M:x})():(function(){function e(i,_,I,x,M,j){var z=x<0?1:0;if(z&&(x=-x),x===0)i(0,M,j+_),i(1/x>0?0:2147483648,M,j+I);else if(isNaN(x))i(0,M,j+_),i(2146959360,M,j+I);else if(x>17976931348623157e292)i(0,M,j+_),i((z<<31|2146435072)>>>0,M,j+I);else{var Q;if(x<22250738585072014e-324)Q=x/5e-324,i(Q>>>0,M,j+_),i((z<<31|Q/4294967296)>>>0,M,j+I);else{var ne=Math.floor(Math.log(x)/Math.LN2);ne===1024&&(ne=1023),Q=x*Math.pow(2,-ne),i(Q*4503599627370496>>>0,M,j+_),i((z<<31|ne+1023<<20|Q*1048576&1048575)>>>0,M,j+I)}}}c.writeDoubleLE=e.bind(null,m,0,4),c.writeDoubleBE=e.bind(null,u,4,0);function t(i,_,I,x,M){var j=i(x,M+_),z=i(x,M+I),Q=(z>>31)*2+1,ne=z>>>20&2047,K=4294967296*(z&1048575)+j;return ne===2047?K?NaN:Q*(1/0):ne===0?Q*5e-324*K:Q*Math.pow(2,ne-1075)*(K+4503599627370496)}c.readDoubleLE=t.bind(null,T,0,4),c.readDoubleBE=t.bind(null,r,4,0)})(),c}function m(c,e,t){e[t]=c&255,e[t+1]=c>>>8&255,e[t+2]=c>>>16&255,e[t+3]=c>>>24}function u(c,e,t){e[t]=c>>>24,e[t+1]=c>>>16&255,e[t+2]=c>>>8&255,e[t+3]=c&255}function T(c,e){return(c[e]|c[e+1]<<8|c[e+2]<<16|c[e+3]<<24)>>>0}function r(c,e){return(c[e]<<24|c[e+1]<<16|c[e+2]<<8|c[e+3])>>>0}return float}var inquire_1,hasRequiredInquire;function requireInquire(){if(hasRequiredInquire)return inquire_1;hasRequiredInquire=1,inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(b){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,(function(b){var m=b;m.length=function(T){for(var r=0,c=0,e=0;e<T.length;++e)c=T.charCodeAt(e),c<128?r+=1:c<2048?r+=2:(c&64512)===55296&&(T.charCodeAt(e+1)&64512)===56320?(++e,r+=4):r+=3;return r},m.read=function(T,r,c){var e=c-r;if(e<1)return"";for(var t=null,i=[],_=0,I;r<c;)I=T[r++],I<128?i[_++]=I:I>191&&I<224?i[_++]=(I&31)<<6|T[r++]&63:I>239&&I<365?(I=((I&7)<<18|(T[r++]&63)<<12|(T[r++]&63)<<6|T[r++]&63)-65536,i[_++]=55296+(I>>10),i[_++]=56320+(I&1023)):i[_++]=(I&15)<<12|(T[r++]&63)<<6|T[r++]&63,_>8191&&((t||(t=[])).push(String.fromCharCode.apply(String,i)),_=0);return t?(_&&t.push(String.fromCharCode.apply(String,i.slice(0,_))),t.join("")):String.fromCharCode.apply(String,i.slice(0,_))},m.write=function(T,r,c){for(var e=c,t,i,_=0;_<T.length;++_)t=T.charCodeAt(_),t<128?r[c++]=t:t<2048?(r[c++]=t>>6|192,r[c++]=t&63|128):(t&64512)===55296&&((i=T.charCodeAt(_+1))&64512)===56320?(t=65536+((t&1023)<<10)+(i&1023),++_,r[c++]=t>>18|240,r[c++]=t>>12&63|128,r[c++]=t>>6&63|128,r[c++]=t&63|128):(r[c++]=t>>12|224,r[c++]=t>>6&63|128,r[c++]=t&63|128);return c-e}})(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=b;function b(m,u,T){var r=T||8192,c=r>>>1,e=null,t=r;return function(_){if(_<1||_>c)return m(_);t+_>r&&(e=m(r),t=0);var I=u.call(e,t,t+=_);return t&7&&(t=(t|7)+1),I}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=m;var b=requireMinimal$1();function m(c,e){this.lo=c>>>0,this.hi=e>>>0}var u=m.zero=new m(0,0);u.toNumber=function(){return 0},u.zzEncode=u.zzDecode=function(){return this},u.length=function(){return 1};var T=m.zeroHash="\0\0\0\0\0\0\0\0";m.fromNumber=function(e){if(e===0)return u;var t=e<0;t&&(e=-e);var i=e>>>0,_=(e-i)/4294967296>>>0;return t&&(_=~_>>>0,i=~i>>>0,++i>4294967295&&(i=0,++_>4294967295&&(_=0))),new m(i,_)},m.from=function(e){if(typeof e=="number")return m.fromNumber(e);if(b.isString(e))if(b.Long)e=b.Long.fromString(e);else return m.fromNumber(parseInt(e,10));return e.low||e.high?new m(e.low>>>0,e.high>>>0):u},m.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,i=~this.hi>>>0;return t||(i=i+1>>>0),-(t+i*4294967296)}return this.lo+this.hi*4294967296},m.prototype.toLong=function(e){return b.Long?new b.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var r=String.prototype.charCodeAt;return m.fromHash=function(e){return e===T?u:new m((r.call(e,0)|r.call(e,1)<<8|r.call(e,2)<<16|r.call(e,3)<<24)>>>0,(r.call(e,4)|r.call(e,5)<<8|r.call(e,6)<<16|r.call(e,7)<<24)>>>0)},m.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},m.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},m.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},m.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return i===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:i<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,(function(b){var m=b;m.asPromise=requireAspromise(),m.base64=requireBase64(),m.EventEmitter=requireEventemitter(),m.float=requireFloat(),m.inquire=requireInquire(),m.utf8=requireUtf8(),m.pool=requirePool(),m.LongBits=requireLongbits(),m.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),m.global=m.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,m.emptyArray=Object.freeze?Object.freeze([]):[],m.emptyObject=Object.freeze?Object.freeze({}):{},m.isInteger=Number.isInteger||function(c){return typeof c=="number"&&isFinite(c)&&Math.floor(c)===c},m.isString=function(c){return typeof c=="string"||c instanceof String},m.isObject=function(c){return c&&typeof c=="object"},m.isset=m.isSet=function(c,e){var t=c[e];return t!=null&&c.hasOwnProperty(e)?typeof t!="object"||(Array.isArray(t)?t.length:Object.keys(t).length)>0:!1},m.Buffer=(function(){try{var r=m.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}})(),m._Buffer_from=null,m._Buffer_allocUnsafe=null,m.newBuffer=function(c){return typeof c=="number"?m.Buffer?m._Buffer_allocUnsafe(c):new m.Array(c):m.Buffer?m._Buffer_from(c):typeof Uint8Array>"u"?c:new Uint8Array(c)},m.Array=typeof Uint8Array<"u"?Uint8Array:Array,m.Long=m.global.dcodeIO&&m.global.dcodeIO.Long||m.global.Long||m.inquire("long"),m.key2Re=/^true|false|0|1$/,m.key32Re=/^-?(?:0|[1-9][0-9]*)$/,m.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,m.longToHash=function(c){return c?m.LongBits.from(c).toHash():m.LongBits.zeroHash},m.longFromHash=function(c,e){var t=m.LongBits.fromHash(c);return m.Long?m.Long.fromBits(t.lo,t.hi,e):t.toNumber(!!e)};function u(r,c,e){for(var t=Object.keys(c),i=0;i<t.length;++i)(r[t[i]]===void 0||!e)&&(r[t[i]]=c[t[i]]);return r}m.merge=u,m.lcFirst=function(c){return c.charAt(0).toLowerCase()+c.substring(1)};function T(r){function c(e,t){if(!(this instanceof c))return new c(e,t);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,c):Object.defineProperty(this,"stack",{value:new Error().stack||""}),t&&u(this,t)}return c.prototype=Object.create(Error.prototype,{constructor:{value:c,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),c}m.newError=T,m.ProtocolError=T("ProtocolError"),m.oneOfGetter=function(c){for(var e={},t=0;t<c.length;++t)e[c[t]]=1;return function(){for(var i=Object.keys(this),_=i.length-1;_>-1;--_)if(e[i[_]]===1&&this[i[_]]!==void 0&&this[i[_]]!==null)return i[_]}},m.oneOfSetter=function(c){return function(e){for(var t=0;t<c.length;++t)c[t]!==e&&delete this[c[t]]}},m.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},m._configure=function(){var r=m.Buffer;if(!r){m._Buffer_from=m._Buffer_allocUnsafe=null;return}m._Buffer_from=r.from!==Uint8Array.from&&r.from||function(e,t){return new r(e,t)},m._Buffer_allocUnsafe=r.allocUnsafe||function(e){return new r(e)}}})(minimal$1)),minimal$1}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1,writer$1=i;var b=requireMinimal$1(),m,u=b.LongBits,T=b.base64,r=b.utf8;function c(ne,K,oe){this.fn=ne,this.len=K,this.next=void 0,this.val=oe}function e(){}function t(ne){this.head=ne.head,this.tail=ne.tail,this.len=ne.len,this.next=ne.states}function i(){this.len=0,this.head=new c(e,0,0),this.tail=this.head,this.states=null}var _=function(){return b.Buffer?function(){return(i.create=function(){return new m})()}:function(){return new i}};i.create=_(),i.alloc=function(K){return new b.Array(K)},b.Array!==Array&&(i.alloc=b.pool(i.alloc,b.Array.prototype.subarray)),i.prototype._push=function(K,oe,ue){return this.tail=this.tail.next=new c(K,oe,ue),this.len+=oe,this};function I(ne,K,oe){K[oe]=ne&255}function x(ne,K,oe){for(;ne>127;)K[oe++]=ne&127|128,ne>>>=7;K[oe]=ne}function M(ne,K){this.len=ne,this.next=void 0,this.val=K}M.prototype=Object.create(c.prototype),M.prototype.fn=x,i.prototype.uint32=function(K){return this.len+=(this.tail=this.tail.next=new M((K=K>>>0)<128?1:K<16384?2:K<2097152?3:K<268435456?4:5,K)).len,this},i.prototype.int32=function(K){return K<0?this._push(j,10,u.fromNumber(K)):this.uint32(K)},i.prototype.sint32=function(K){return this.uint32((K<<1^K>>31)>>>0)};function j(ne,K,oe){for(;ne.hi;)K[oe++]=ne.lo&127|128,ne.lo=(ne.lo>>>7|ne.hi<<25)>>>0,ne.hi>>>=7;for(;ne.lo>127;)K[oe++]=ne.lo&127|128,ne.lo=ne.lo>>>7;K[oe++]=ne.lo}i.prototype.uint64=function(K){var oe=u.from(K);return this._push(j,oe.length(),oe)},i.prototype.int64=i.prototype.uint64,i.prototype.sint64=function(K){var oe=u.from(K).zzEncode();return this._push(j,oe.length(),oe)},i.prototype.bool=function(K){return this._push(I,1,K?1:0)};function z(ne,K,oe){K[oe]=ne&255,K[oe+1]=ne>>>8&255,K[oe+2]=ne>>>16&255,K[oe+3]=ne>>>24}i.prototype.fixed32=function(K){return this._push(z,4,K>>>0)},i.prototype.sfixed32=i.prototype.fixed32,i.prototype.fixed64=function(K){var oe=u.from(K);return this._push(z,4,oe.lo)._push(z,4,oe.hi)},i.prototype.sfixed64=i.prototype.fixed64,i.prototype.float=function(K){return this._push(b.float.writeFloatLE,4,K)},i.prototype.double=function(K){return this._push(b.float.writeDoubleLE,8,K)};var Q=b.Array.prototype.set?function(K,oe,ue){oe.set(K,ue)}:function(K,oe,ue){for(var G=0;G<K.length;++G)oe[ue+G]=K[G]};return i.prototype.bytes=function(K){var oe=K.length>>>0;if(!oe)return this._push(I,1,0);if(b.isString(K)){var ue=i.alloc(oe=T.length(K));T.decode(K,ue,0),K=ue}return this.uint32(oe)._push(Q,oe,K)},i.prototype.string=function(K){var oe=r.length(K);return oe?this.uint32(oe)._push(r.write,oe,K):this._push(I,1,0)},i.prototype.fork=function(){return this.states=new t(this),this.head=this.tail=new c(e,0,0),this.len=0,this},i.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(e,0,0),this.len=0),this},i.prototype.ldelim=function(){var K=this.head,oe=this.tail,ue=this.len;return this.reset().uint32(ue),ue&&(this.tail.next=K.next,this.tail=oe,this.len+=ue),this},i.prototype.finish=function(){for(var K=this.head.next,oe=this.constructor.alloc(this.len),ue=0;K;)K.fn(K.val,oe,ue),ue+=K.len,K=K.next;return oe},i._configure=function(ne){m=ne,i.create=_(),m._configure()},writer$1}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=u;var b=requireWriter$1();(u.prototype=Object.create(b.prototype)).constructor=u;var m=requireMinimal$1();function u(){b.call(this)}u._configure=function(){u.alloc=m._Buffer_allocUnsafe,u.writeBytesBuffer=m.Buffer&&m.Buffer.prototype instanceof Uint8Array&&m.Buffer.prototype.set.name==="set"?function(c,e,t){e.set(c,t)}:function(c,e,t){if(c.copy)c.copy(e,t,0,c.length);else for(var i=0;i<c.length;)e[t++]=c[i++]}},u.prototype.bytes=function(c){m.isString(c)&&(c=m._Buffer_from(c,"base64"));var e=c.length>>>0;return this.uint32(e),e&&this._push(u.writeBytesBuffer,e,c),this};function T(r,c,e){r.length<40?m.utf8.write(r,c,e):c.utf8Write?c.utf8Write(r,e):c.write(r,e)}return u.prototype.string=function(c){var e=m.Buffer.byteLength(c);return this.uint32(e),e&&this._push(T,e,c),this},u._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=c;var b=requireMinimal$1(),m,u=b.LongBits,T=b.utf8;function r(x,M){return RangeError("index out of range: "+x.pos+" + "+(M||1)+" > "+x.len)}function c(x){this.buf=x,this.pos=0,this.len=x.length}var e=typeof Uint8Array<"u"?function(M){if(M instanceof Uint8Array||Array.isArray(M))return new c(M);throw Error("illegal buffer")}:function(M){if(Array.isArray(M))return new c(M);throw Error("illegal buffer")},t=function(){return b.Buffer?function(j){return(c.create=function(Q){return b.Buffer.isBuffer(Q)?new m(Q):e(Q)})(j)}:e};c.create=t(),c.prototype._slice=b.Array.prototype.subarray||b.Array.prototype.slice,c.prototype.uint32=(function(){var M=4294967295;return function(){if(M=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(M=(M|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(M=(M|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(M=(M|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(M=(M|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return M;if((this.pos+=5)>this.len)throw this.pos=this.len,r(this,10);return M}})(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var M=this.uint32();return M>>>1^-(M&1)|0};function i(){var x=new u(0,0),M=0;if(this.len-this.pos>4){for(;M<4;++M)if(x.lo=(x.lo|(this.buf[this.pos]&127)<<M*7)>>>0,this.buf[this.pos++]<128)return x;if(x.lo=(x.lo|(this.buf[this.pos]&127)<<28)>>>0,x.hi=(x.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return x;M=0}else{for(;M<3;++M){if(this.pos>=this.len)throw r(this);if(x.lo=(x.lo|(this.buf[this.pos]&127)<<M*7)>>>0,this.buf[this.pos++]<128)return x}return x.lo=(x.lo|(this.buf[this.pos++]&127)<<M*7)>>>0,x}if(this.len-this.pos>4){for(;M<5;++M)if(x.hi=(x.hi|(this.buf[this.pos]&127)<<M*7+3)>>>0,this.buf[this.pos++]<128)return x}else for(;M<5;++M){if(this.pos>=this.len)throw r(this);if(x.hi=(x.hi|(this.buf[this.pos]&127)<<M*7+3)>>>0,this.buf[this.pos++]<128)return x}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function _(x,M){return(x[M-4]|x[M-3]<<8|x[M-2]<<16|x[M-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw r(this,4);return _(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw r(this,4);return _(this.buf,this.pos+=4)|0};function I(){if(this.pos+8>this.len)throw r(this,8);return new u(_(this.buf,this.pos+=4),_(this.buf,this.pos+=4))}return c.prototype.float=function(){if(this.pos+4>this.len)throw r(this,4);var M=b.float.readFloatLE(this.buf,this.pos);return this.pos+=4,M},c.prototype.double=function(){if(this.pos+8>this.len)throw r(this,4);var M=b.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,M},c.prototype.bytes=function(){var M=this.uint32(),j=this.pos,z=this.pos+M;if(z>this.len)throw r(this,M);if(this.pos+=M,Array.isArray(this.buf))return this.buf.slice(j,z);if(j===z){var Q=b.Buffer;return Q?Q.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,j,z)},c.prototype.string=function(){var M=this.bytes();return T.read(M,0,M.length)},c.prototype.skip=function(M){if(typeof M=="number"){if(this.pos+M>this.len)throw r(this,M);this.pos+=M}else do if(this.pos>=this.len)throw r(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(x){switch(x){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(x=this.uint32()&7)!==4;)this.skipType(x);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+x+" at offset "+this.pos)}return this},c._configure=function(x){m=x,c.create=t(),m._configure();var M=b.Long?"toLong":"toNumber";b.merge(c.prototype,{int64:function(){return i.call(this)[M](!1)},uint64:function(){return i.call(this)[M](!0)},sint64:function(){return i.call(this).zzDecode()[M](!1)},fixed64:function(){return I.call(this)[M](!0)},sfixed64:function(){return I.call(this)[M](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=u;var b=requireReader();(u.prototype=Object.create(b.prototype)).constructor=u;var m=requireMinimal$1();function u(T){b.call(this,T)}return u._configure=function(){m.Buffer&&(u.prototype._slice=m.Buffer.prototype.slice)},u.prototype.string=function(){var r=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+r,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+r,this.len))},u._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=m;var b=requireMinimal$1();(m.prototype=Object.create(b.EventEmitter.prototype)).constructor=m;function m(u,T,r){if(typeof u!="function")throw TypeError("rpcImpl must be a function");b.EventEmitter.call(this),this.rpcImpl=u,this.requestDelimited=!!T,this.responseDelimited=!!r}return m.prototype.rpcCall=function u(T,r,c,e,t){if(!e)throw TypeError("request must be specified");var i=this;if(!t)return b.asPromise(u,i,T,r,c,e);if(!i.rpcImpl){setTimeout(function(){t(Error("already ended"))},0);return}try{return i.rpcImpl(T,r[i.requestDelimited?"encodeDelimited":"encode"](e).finish(),function(I,x){if(I)return i.emit("error",I,T),t(I);if(x===null){i.end(!0);return}if(!(x instanceof c))try{x=c[i.responseDelimited?"decodeDelimited":"decode"](x)}catch(M){return i.emit("error",M,T),t(M)}return i.emit("data",x,T),t(null,x)})}catch(_){i.emit("error",_,T),setTimeout(function(){t(_)},0);return}},m.prototype.end=function(T){return this.rpcImpl&&(T||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,(function(b){var m=b;m.Service=requireService()})(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,(function(b){var m=b;m.build="minimal",m.Writer=requireWriter$1(),m.BufferWriter=requireWriter_buffer(),m.Reader=requireReader(),m.BufferReader=requireReader_buffer(),m.util=requireMinimal$1(),m.rpc=requireRpc(),m.roots=requireRoots(),m.configure=u;function u(){m.util._configure(),m.Writer._configure(m.BufferWriter),m.Reader._configure(m.BufferReader)}u()})(indexMinimal)),indexMinimal}var minimal,hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,minimal=requireIndexMinimal()),minimal}var minimalExports=requireMinimal();const $Reader=minimalExports.Reader,$Writer=minimalExports.Writer,$util=minimalExports.util,$root=minimalExports.roots.default||(minimalExports.roots.default={}),com=$root.com=(()=>{const b={};return b.quick=(function(){const m={};return m.voice=(function(){const u={};return u.proto=(function(){const T={};return T.CommonReq=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.event="",r.prototype.data=$util.newBuffer([]),r.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.version=0,r.prototype.compress=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&t.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&t.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&t.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&t.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&t.uint32(40).int64(e.valid),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&t.uint32(48).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&t.uint32(56).bool(e.compress),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.CommonReq;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.event=e.string();break}case 2:{I.data=e.bytes();break}case 3:{I.sn=e.int64();break}case 4:{I.time=e.int64();break}case 5:{I.valid=e.int64();break}case 6:{I.version=e.int32();break}case 7:{I.compress=e.bool();break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.event!=null&&e.hasOwnProperty("event")&&!$util.isString(e.event)?"event: string expected":e.data!=null&&e.hasOwnProperty("data")&&!(e.data&&typeof e.data.length=="number"||$util.isString(e.data))?"data: buffer expected":e.sn!=null&&e.hasOwnProperty("sn")&&!$util.isInteger(e.sn)&&!(e.sn&&$util.isInteger(e.sn.low)&&$util.isInteger(e.sn.high))?"sn: integer|Long expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":e.valid!=null&&e.hasOwnProperty("valid")&&!$util.isInteger(e.valid)&&!(e.valid&&$util.isInteger(e.valid.low)&&$util.isInteger(e.valid.high))?"valid: integer|Long expected":e.version!=null&&e.hasOwnProperty("version")&&!$util.isInteger(e.version)?"version: integer expected":e.compress!=null&&e.hasOwnProperty("compress")&&typeof e.compress!="boolean"?"compress: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CommonReq)return e;let t=new $root.com.quick.voice.proto.CommonReq;return e.event!=null&&(t.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,t.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),e.sn!=null&&($util.Long?(t.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?t.sn=parseInt(e.sn,10):typeof e.sn=="number"?t.sn=e.sn:typeof e.sn=="object"&&(t.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(t.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?t.time=parseInt(e.time,10):typeof e.time=="number"?t.time=e.time:typeof e.time=="object"&&(t.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(t.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?t.valid=parseInt(e.valid,10):typeof e.valid=="number"?t.valid=e.valid:typeof e.valid=="object"&&(t.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.version!=null&&(t.version=e.version|0),e.compress!=null&&(t.compress=!!e.compress),t},r.toObject=function(e,t){t||(t={});let i={};if(t.defaults){if(i.event="",t.bytes===String?i.data="":(i.data=[],t.bytes!==Array&&(i.data=$util.newBuffer(i.data))),$util.Long){let _=new $util.Long(0,0,!1);i.sn=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.sn=t.longs===String?"0":0;if($util.Long){let _=new $util.Long(0,0,!1);i.time=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.time=t.longs===String?"0":0;if($util.Long){let _=new $util.Long(0,0,!1);i.valid=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.valid=t.longs===String?"0":0;i.version=0,i.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(i.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(i.data=t.bytes===String?$util.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?i.sn=t.longs===String?String(e.sn):e.sn:i.sn=t.longs===String?$util.Long.prototype.toString.call(e.sn):t.longs===Number?new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber():e.sn),e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?i.time=t.longs===String?String(e.time):e.time:i.time=t.longs===String?$util.Long.prototype.toString.call(e.time):t.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),e.valid!=null&&e.hasOwnProperty("valid")&&(typeof e.valid=="number"?i.valid=t.longs===String?String(e.valid):e.valid:i.valid=t.longs===String?$util.Long.prototype.toString.call(e.valid):t.longs===Number?new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber():e.valid),e.version!=null&&e.hasOwnProperty("version")&&(i.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(i.compress=e.compress),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CommonReq"},r})(),T.CommonRsp=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.event="",r.prototype.data=$util.newBuffer([]),r.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.code=0,r.prototype.desc="",r.prototype.version=0,r.prototype.compress=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&t.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&t.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&t.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&t.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&t.uint32(40).int64(e.valid),e.code!=null&&Object.hasOwnProperty.call(e,"code")&&t.uint32(48).int32(e.code),e.desc!=null&&Object.hasOwnProperty.call(e,"desc")&&t.uint32(58).string(e.desc),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&t.uint32(64).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&t.uint32(72).bool(e.compress),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.CommonRsp;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.event=e.string();break}case 2:{I.data=e.bytes();break}case 3:{I.sn=e.int64();break}case 4:{I.time=e.int64();break}case 5:{I.valid=e.int64();break}case 6:{I.code=e.int32();break}case 7:{I.desc=e.string();break}case 8:{I.version=e.int32();break}case 9:{I.compress=e.bool();break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.event!=null&&e.hasOwnProperty("event")&&!$util.isString(e.event)?"event: string expected":e.data!=null&&e.hasOwnProperty("data")&&!(e.data&&typeof e.data.length=="number"||$util.isString(e.data))?"data: buffer expected":e.sn!=null&&e.hasOwnProperty("sn")&&!$util.isInteger(e.sn)&&!(e.sn&&$util.isInteger(e.sn.low)&&$util.isInteger(e.sn.high))?"sn: integer|Long expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":e.valid!=null&&e.hasOwnProperty("valid")&&!$util.isInteger(e.valid)&&!(e.valid&&$util.isInteger(e.valid.low)&&$util.isInteger(e.valid.high))?"valid: integer|Long expected":e.code!=null&&e.hasOwnProperty("code")&&!$util.isInteger(e.code)?"code: integer expected":e.desc!=null&&e.hasOwnProperty("desc")&&!$util.isString(e.desc)?"desc: string expected":e.version!=null&&e.hasOwnProperty("version")&&!$util.isInteger(e.version)?"version: integer expected":e.compress!=null&&e.hasOwnProperty("compress")&&typeof e.compress!="boolean"?"compress: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CommonRsp)return e;let t=new $root.com.quick.voice.proto.CommonRsp;return e.event!=null&&(t.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,t.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),e.sn!=null&&($util.Long?(t.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?t.sn=parseInt(e.sn,10):typeof e.sn=="number"?t.sn=e.sn:typeof e.sn=="object"&&(t.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(t.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?t.time=parseInt(e.time,10):typeof e.time=="number"?t.time=e.time:typeof e.time=="object"&&(t.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(t.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?t.valid=parseInt(e.valid,10):typeof e.valid=="number"?t.valid=e.valid:typeof e.valid=="object"&&(t.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.code!=null&&(t.code=e.code|0),e.desc!=null&&(t.desc=String(e.desc)),e.version!=null&&(t.version=e.version|0),e.compress!=null&&(t.compress=!!e.compress),t},r.toObject=function(e,t){t||(t={});let i={};if(t.defaults){if(i.event="",t.bytes===String?i.data="":(i.data=[],t.bytes!==Array&&(i.data=$util.newBuffer(i.data))),$util.Long){let _=new $util.Long(0,0,!1);i.sn=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.sn=t.longs===String?"0":0;if($util.Long){let _=new $util.Long(0,0,!1);i.time=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.time=t.longs===String?"0":0;if($util.Long){let _=new $util.Long(0,0,!1);i.valid=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.valid=t.longs===String?"0":0;i.code=0,i.desc="",i.version=0,i.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(i.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(i.data=t.bytes===String?$util.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?i.sn=t.longs===String?String(e.sn):e.sn:i.sn=t.longs===String?$util.Long.prototype.toString.call(e.sn):t.longs===Number?new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber():e.sn),e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?i.time=t.longs===String?String(e.time):e.time:i.time=t.longs===String?$util.Long.prototype.toString.call(e.time):t.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),e.valid!=null&&e.hasOwnProperty("valid")&&(typeof e.valid=="number"?i.valid=t.longs===String?String(e.valid):e.valid:i.valid=t.longs===String?$util.Long.prototype.toString.call(e.valid):t.longs===Number?new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber():e.valid),e.code!=null&&e.hasOwnProperty("code")&&(i.code=e.code),e.desc!=null&&e.hasOwnProperty("desc")&&(i.desc=e.desc),e.version!=null&&e.hasOwnProperty("version")&&(i.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(i.compress=e.compress),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CommonRsp"},r})(),T.User=(function(){function r(e){if(this.tracks=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.id="",r.prototype.callAction=null,r.prototype.callState=null,r.prototype.joinTime=null,r.prototype.tracks=$util.emptyArray,r.prototype.permissions=null,r.prototype.isPublished=null,r.prototype.behavior=null,r.prototype.channelCache=null;let c;return Object.defineProperty(r.prototype,"_callAction",{get:$util.oneOfGetter(c=["callAction"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_callState",{get:$util.oneOfGetter(c=["callState"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_joinTime",{get:$util.oneOfGetter(c=["joinTime"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_permissions",{get:$util.oneOfGetter(c=["permissions"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_isPublished",{get:$util.oneOfGetter(c=["isPublished"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_behavior",{get:$util.oneOfGetter(c=["behavior"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_channelCache",{get:$util.oneOfGetter(c=["channelCache"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.id!=null&&Object.hasOwnProperty.call(t,"id")&&i.uint32(10).string(t.id),t.callAction!=null&&Object.hasOwnProperty.call(t,"callAction")&&i.uint32(16).int32(t.callAction),t.callState!=null&&Object.hasOwnProperty.call(t,"callState")&&i.uint32(24).int32(t.callState),t.joinTime!=null&&Object.hasOwnProperty.call(t,"joinTime")&&i.uint32(32).int64(t.joinTime),t.tracks!=null&&t.tracks.length)for(let _=0;_<t.tracks.length;++_)$root.com.quick.voice.proto.Track.encode(t.tracks[_],i.uint32(42).fork()).ldelim();return t.permissions!=null&&Object.hasOwnProperty.call(t,"permissions")&&i.uint32(48).int32(t.permissions),t.isPublished!=null&&Object.hasOwnProperty.call(t,"isPublished")&&i.uint32(56).bool(t.isPublished),t.behavior!=null&&Object.hasOwnProperty.call(t,"behavior")&&i.uint32(64).int32(t.behavior),t.channelCache!=null&&Object.hasOwnProperty.call(t,"channelCache")&&$root.com.quick.voice.proto.DataChannelCacheInfo.encode(t.channelCache,i.uint32(74).fork()).ldelim(),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.User;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.id=t.string();break}case 2:{x.callAction=t.int32();break}case 3:{x.callState=t.int32();break}case 4:{x.joinTime=t.int64();break}case 5:{x.tracks&&x.tracks.length||(x.tracks=[]),x.tracks.push($root.com.quick.voice.proto.Track.decode(t,t.uint32()));break}case 6:{x.permissions=t.int32();break}case 7:{x.isPublished=t.bool();break}case 8:{x.behavior=t.int32();break}case 9:{x.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.decode(t,t.uint32());break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.id!=null&&t.hasOwnProperty("id")&&!$util.isString(t.id))return"id: string expected";if(t.callAction!=null&&t.hasOwnProperty("callAction")&&!$util.isInteger(t.callAction))return"callAction: integer expected";if(t.callState!=null&&t.hasOwnProperty("callState")&&!$util.isInteger(t.callState))return"callState: integer expected";if(t.joinTime!=null&&t.hasOwnProperty("joinTime")&&!$util.isInteger(t.joinTime)&&!(t.joinTime&&$util.isInteger(t.joinTime.low)&&$util.isInteger(t.joinTime.high)))return"joinTime: integer|Long expected";if(t.tracks!=null&&t.hasOwnProperty("tracks")){if(!Array.isArray(t.tracks))return"tracks: array expected";for(let i=0;i<t.tracks.length;++i){let _=$root.com.quick.voice.proto.Track.verify(t.tracks[i]);if(_)return"tracks."+_}}if(t.permissions!=null&&t.hasOwnProperty("permissions")&&!$util.isInteger(t.permissions))return"permissions: integer expected";if(t.isPublished!=null&&t.hasOwnProperty("isPublished")&&typeof t.isPublished!="boolean")return"isPublished: boolean expected";if(t.behavior!=null&&t.hasOwnProperty("behavior")&&!$util.isInteger(t.behavior))return"behavior: integer expected";if(t.channelCache!=null&&t.hasOwnProperty("channelCache")){let i=$root.com.quick.voice.proto.DataChannelCacheInfo.verify(t.channelCache);if(i)return"channelCache."+i}return null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.User)return t;let i=new $root.com.quick.voice.proto.User;if(t.id!=null&&(i.id=String(t.id)),t.callAction!=null&&(i.callAction=t.callAction|0),t.callState!=null&&(i.callState=t.callState|0),t.joinTime!=null&&($util.Long?(i.joinTime=$util.Long.fromValue(t.joinTime)).unsigned=!1:typeof t.joinTime=="string"?i.joinTime=parseInt(t.joinTime,10):typeof t.joinTime=="number"?i.joinTime=t.joinTime:typeof t.joinTime=="object"&&(i.joinTime=new $util.LongBits(t.joinTime.low>>>0,t.joinTime.high>>>0).toNumber())),t.tracks){if(!Array.isArray(t.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");i.tracks=[];for(let _=0;_<t.tracks.length;++_){if(typeof t.tracks[_]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");i.tracks[_]=$root.com.quick.voice.proto.Track.fromObject(t.tracks[_])}}if(t.permissions!=null&&(i.permissions=t.permissions|0),t.isPublished!=null&&(i.isPublished=!!t.isPublished),t.behavior!=null&&(i.behavior=t.behavior|0),t.channelCache!=null){if(typeof t.channelCache!="object")throw TypeError(".com.quick.voice.proto.User.channelCache: object expected");i.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.fromObject(t.channelCache)}return i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.tracks=[]),i.defaults&&(_.id=""),t.id!=null&&t.hasOwnProperty("id")&&(_.id=t.id),t.callAction!=null&&t.hasOwnProperty("callAction")&&(_.callAction=t.callAction,i.oneofs&&(_._callAction="callAction")),t.callState!=null&&t.hasOwnProperty("callState")&&(_.callState=t.callState,i.oneofs&&(_._callState="callState")),t.joinTime!=null&&t.hasOwnProperty("joinTime")&&(typeof t.joinTime=="number"?_.joinTime=i.longs===String?String(t.joinTime):t.joinTime:_.joinTime=i.longs===String?$util.Long.prototype.toString.call(t.joinTime):i.longs===Number?new $util.LongBits(t.joinTime.low>>>0,t.joinTime.high>>>0).toNumber():t.joinTime,i.oneofs&&(_._joinTime="joinTime")),t.tracks&&t.tracks.length){_.tracks=[];for(let I=0;I<t.tracks.length;++I)_.tracks[I]=$root.com.quick.voice.proto.Track.toObject(t.tracks[I],i)}return t.permissions!=null&&t.hasOwnProperty("permissions")&&(_.permissions=t.permissions,i.oneofs&&(_._permissions="permissions")),t.isPublished!=null&&t.hasOwnProperty("isPublished")&&(_.isPublished=t.isPublished,i.oneofs&&(_._isPublished="isPublished")),t.behavior!=null&&t.hasOwnProperty("behavior")&&(_.behavior=t.behavior,i.oneofs&&(_._behavior="behavior")),t.channelCache!=null&&t.hasOwnProperty("channelCache")&&(_.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.toObject(t.channelCache,i),i.oneofs&&(_._channelCache="channelCache")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.User"},r})(),T.DataChannelCacheInfo=(function(){function r(c){if(this.channels=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.channels=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.channels!=null&&e.channels.length)for(let i=0;i<e.channels.length;++i)$root.com.quick.voice.proto.DataChannel.encode(e.channels[i],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.DataChannelCacheInfo;for(;e.pos<_;){let x=e.uint32();if(x===i)break;x>>>3===1?(I.channels&&I.channels.length||(I.channels=[]),I.channels.push($root.com.quick.voice.proto.DataChannel.decode(e,e.uint32()))):e.skipType(x&7)}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let t=0;t<e.channels.length;++t){let i=$root.com.quick.voice.proto.DataChannel.verify(e.channels[t]);if(i)return"channels."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.DataChannelCacheInfo)return e;let t=new $root.com.quick.voice.proto.DataChannelCacheInfo;if(e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: array expected");t.channels=[];for(let i=0;i<e.channels.length;++i){if(typeof e.channels[i]!="object")throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: object expected");t.channels[i]=$root.com.quick.voice.proto.DataChannel.fromObject(e.channels[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.channels=[]),e.channels&&e.channels.length){i.channels=[];for(let _=0;_<e.channels.length;++_)i.channels[_]=$root.com.quick.voice.proto.DataChannel.toObject(e.channels[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.DataChannelCacheInfo"},r})(),T.DataChannel=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.dataChannelName="",r.prototype.id=null;let c;return Object.defineProperty(r.prototype,"_id",{get:$util.oneOfGetter(c=["id"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.dataChannelName!=null&&Object.hasOwnProperty.call(t,"dataChannelName")&&i.uint32(10).string(t.dataChannelName),t.id!=null&&Object.hasOwnProperty.call(t,"id")&&i.uint32(16).int32(t.id),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.DataChannel;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.dataChannelName=t.string();break}case 2:{x.id=t.int32();break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){return typeof t!="object"||t===null?"object expected":t.dataChannelName!=null&&t.hasOwnProperty("dataChannelName")&&!$util.isString(t.dataChannelName)?"dataChannelName: string expected":t.id!=null&&t.hasOwnProperty("id")&&!$util.isInteger(t.id)?"id: integer expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.DataChannel)return t;let i=new $root.com.quick.voice.proto.DataChannel;return t.dataChannelName!=null&&(i.dataChannelName=String(t.dataChannelName)),t.id!=null&&(i.id=t.id|0),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.dataChannelName=""),t.dataChannelName!=null&&t.hasOwnProperty("dataChannelName")&&(_.dataChannelName=t.dataChannelName),t.id!=null&&t.hasOwnProperty("id")&&(_.id=t.id,i.oneofs&&(_._id="id")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.DataChannel"},r})(),T.Login=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.appid="",r.prototype.userId="",r.prototype.sdkToken="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.appid!=null&&Object.hasOwnProperty.call(e,"appid")&&t.uint32(10).string(e.appid),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&t.uint32(26).string(e.sdkToken),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.Login;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.appid=e.string();break}case 2:{I.userId=e.string();break}case 3:{I.sdkToken=e.string();break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.appid!=null&&e.hasOwnProperty("appid")&&!$util.isString(e.appid)?"appid: string expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&!$util.isString(e.sdkToken)?"sdkToken: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.Login)return e;let t=new $root.com.quick.voice.proto.Login;return e.appid!=null&&(t.appid=String(e.appid)),e.userId!=null&&(t.userId=String(e.userId)),e.sdkToken!=null&&(t.sdkToken=String(e.sdkToken)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.appid="",i.userId="",i.sdkToken=""),e.appid!=null&&e.hasOwnProperty("appid")&&(i.appid=e.appid),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(i.sdkToken=e.sdkToken),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.Login"},r})(),T.Track=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.mid="",r.prototype.trackName=null,r.prototype.location=null,r.prototype.userId=null,r.prototype.code=null,r.prototype.desc=null,r.prototype.type=null,r.prototype.isValid=null,r.prototype.simulcast=null,r.prototype.lastRetry=null;let c;return Object.defineProperty(r.prototype,"_trackName",{get:$util.oneOfGetter(c=["trackName"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_location",{get:$util.oneOfGetter(c=["location"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_userId",{get:$util.oneOfGetter(c=["userId"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_code",{get:$util.oneOfGetter(c=["code"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_desc",{get:$util.oneOfGetter(c=["desc"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_type",{get:$util.oneOfGetter(c=["type"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_isValid",{get:$util.oneOfGetter(c=["isValid"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_simulcast",{get:$util.oneOfGetter(c=["simulcast"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_lastRetry",{get:$util.oneOfGetter(c=["lastRetry"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.mid!=null&&Object.hasOwnProperty.call(t,"mid")&&i.uint32(10).string(t.mid),t.trackName!=null&&Object.hasOwnProperty.call(t,"trackName")&&i.uint32(18).string(t.trackName),t.location!=null&&Object.hasOwnProperty.call(t,"location")&&i.uint32(26).string(t.location),t.userId!=null&&Object.hasOwnProperty.call(t,"userId")&&i.uint32(34).string(t.userId),t.code!=null&&Object.hasOwnProperty.call(t,"code")&&i.uint32(40).int32(t.code),t.desc!=null&&Object.hasOwnProperty.call(t,"desc")&&i.uint32(50).string(t.desc),t.type!=null&&Object.hasOwnProperty.call(t,"type")&&i.uint32(56).int32(t.type),t.isValid!=null&&Object.hasOwnProperty.call(t,"isValid")&&i.uint32(64).bool(t.isValid),t.simulcast!=null&&Object.hasOwnProperty.call(t,"simulcast")&&i.uint32(74).string(t.simulcast),t.lastRetry!=null&&Object.hasOwnProperty.call(t,"lastRetry")&&i.uint32(80).bool(t.lastRetry),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.Track;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.mid=t.string();break}case 2:{x.trackName=t.string();break}case 3:{x.location=t.string();break}case 4:{x.userId=t.string();break}case 5:{x.code=t.int32();break}case 6:{x.desc=t.string();break}case 7:{x.type=t.int32();break}case 8:{x.isValid=t.bool();break}case 9:{x.simulcast=t.string();break}case 10:{x.lastRetry=t.bool();break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.mid!=null&&t.hasOwnProperty("mid")&&!$util.isString(t.mid))return"mid: string expected";if(t.trackName!=null&&t.hasOwnProperty("trackName")&&!$util.isString(t.trackName))return"trackName: string expected";if(t.location!=null&&t.hasOwnProperty("location")&&!$util.isString(t.location))return"location: string expected";if(t.userId!=null&&t.hasOwnProperty("userId")&&!$util.isString(t.userId))return"userId: string expected";if(t.code!=null&&t.hasOwnProperty("code")&&!$util.isInteger(t.code))return"code: integer expected";if(t.desc!=null&&t.hasOwnProperty("desc")&&!$util.isString(t.desc))return"desc: string expected";if(t.type!=null&&t.hasOwnProperty("type"))switch(t.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return t.isValid!=null&&t.hasOwnProperty("isValid")&&typeof t.isValid!="boolean"?"isValid: boolean expected":t.simulcast!=null&&t.hasOwnProperty("simulcast")&&!$util.isString(t.simulcast)?"simulcast: string expected":t.lastRetry!=null&&t.hasOwnProperty("lastRetry")&&typeof t.lastRetry!="boolean"?"lastRetry: boolean expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.Track)return t;let i=new $root.com.quick.voice.proto.Track;switch(t.mid!=null&&(i.mid=String(t.mid)),t.trackName!=null&&(i.trackName=String(t.trackName)),t.location!=null&&(i.location=String(t.location)),t.userId!=null&&(i.userId=String(t.userId)),t.code!=null&&(i.code=t.code|0),t.desc!=null&&(i.desc=String(t.desc)),t.type){default:if(typeof t.type=="number"){i.type=t.type;break}break;case"Microphone":case 0:i.type=0;break;case"Camera":case 1:i.type=1;break;case"Screen":case 2:i.type=2;break;case"SystemVoice":case 3:i.type=3;break}return t.isValid!=null&&(i.isValid=!!t.isValid),t.simulcast!=null&&(i.simulcast=String(t.simulcast)),t.lastRetry!=null&&(i.lastRetry=!!t.lastRetry),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.mid=""),t.mid!=null&&t.hasOwnProperty("mid")&&(_.mid=t.mid),t.trackName!=null&&t.hasOwnProperty("trackName")&&(_.trackName=t.trackName,i.oneofs&&(_._trackName="trackName")),t.location!=null&&t.hasOwnProperty("location")&&(_.location=t.location,i.oneofs&&(_._location="location")),t.userId!=null&&t.hasOwnProperty("userId")&&(_.userId=t.userId,i.oneofs&&(_._userId="userId")),t.code!=null&&t.hasOwnProperty("code")&&(_.code=t.code,i.oneofs&&(_._code="code")),t.desc!=null&&t.hasOwnProperty("desc")&&(_.desc=t.desc,i.oneofs&&(_._desc="desc")),t.type!=null&&t.hasOwnProperty("type")&&(_.type=i.enums===String?$root.com.quick.voice.proto.TrackType[t.type]===void 0?t.type:$root.com.quick.voice.proto.TrackType[t.type]:t.type,i.oneofs&&(_._type="type")),t.isValid!=null&&t.hasOwnProperty("isValid")&&(_.isValid=t.isValid,i.oneofs&&(_._isValid="isValid")),t.simulcast!=null&&t.hasOwnProperty("simulcast")&&(_.simulcast=t.simulcast,i.oneofs&&(_._simulcast="simulcast")),t.lastRetry!=null&&t.hasOwnProperty("lastRetry")&&(_.lastRetry=t.lastRetry,i.oneofs&&(_._lastRetry="lastRetry")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.Track"},r})(),T.JoinReq=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.user=null,r.prototype.callType=0,r.prototype.token=null,r.prototype.lang=null,r.prototype.stt=null,r.prototype.msgId=null,r.prototype.msg=null;let c;return Object.defineProperty(r.prototype,"_token",{get:$util.oneOfGetter(c=["token"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_lang",{get:$util.oneOfGetter(c=["lang"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_stt",{get:$util.oneOfGetter(c=["stt"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_msgId",{get:$util.oneOfGetter(c=["msgId"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_msg",{get:$util.oneOfGetter(c=["msg"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.user!=null&&Object.hasOwnProperty.call(t,"user")&&$root.com.quick.voice.proto.User.encode(t.user,i.uint32(18).fork()).ldelim(),t.callType!=null&&Object.hasOwnProperty.call(t,"callType")&&i.uint32(24).int32(t.callType),t.token!=null&&Object.hasOwnProperty.call(t,"token")&&i.uint32(34).string(t.token),t.lang!=null&&Object.hasOwnProperty.call(t,"lang")&&$root.com.quick.voice.proto.AiLangSetting.encode(t.lang,i.uint32(42).fork()).ldelim(),t.stt!=null&&Object.hasOwnProperty.call(t,"stt")&&i.uint32(48).bool(t.stt),t.msgId!=null&&Object.hasOwnProperty.call(t,"msgId")&&i.uint32(58).string(t.msgId),t.msg!=null&&Object.hasOwnProperty.call(t,"msg")&&i.uint32(66).string(t.msg),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.JoinReq;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.roomId=t.string();break}case 2:{x.user=$root.com.quick.voice.proto.User.decode(t,t.uint32());break}case 3:{x.callType=t.int32();break}case 4:{x.token=t.string();break}case 5:{x.lang=$root.com.quick.voice.proto.AiLangSetting.decode(t,t.uint32());break}case 6:{x.stt=t.bool();break}case 7:{x.msgId=t.string();break}case 8:{x.msg=t.string();break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.user!=null&&t.hasOwnProperty("user")){let i=$root.com.quick.voice.proto.User.verify(t.user);if(i)return"user."+i}if(t.callType!=null&&t.hasOwnProperty("callType"))switch(t.callType){default:return"callType: enum value expected";case 0:case 1:case 2:case 3:break}if(t.token!=null&&t.hasOwnProperty("token")&&!$util.isString(t.token))return"token: string expected";if(t.lang!=null&&t.hasOwnProperty("lang")){let i=$root.com.quick.voice.proto.AiLangSetting.verify(t.lang);if(i)return"lang."+i}return t.stt!=null&&t.hasOwnProperty("stt")&&typeof t.stt!="boolean"?"stt: boolean expected":t.msgId!=null&&t.hasOwnProperty("msgId")&&!$util.isString(t.msgId)?"msgId: string expected":t.msg!=null&&t.hasOwnProperty("msg")&&!$util.isString(t.msg)?"msg: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.JoinReq)return t;let i=new $root.com.quick.voice.proto.JoinReq;if(t.roomId!=null&&(i.roomId=String(t.roomId)),t.user!=null){if(typeof t.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");i.user=$root.com.quick.voice.proto.User.fromObject(t.user)}switch(t.callType){default:if(typeof t.callType=="number"){i.callType=t.callType;break}break;case"Normal":case 0:i.callType=0;break;case"Meeting":case 1:i.callType=1;break;case"Live":case 2:i.callType=2;break;case"Conference":case 3:i.callType=3;break}if(t.token!=null&&(i.token=String(t.token)),t.lang!=null){if(typeof t.lang!="object")throw TypeError(".com.quick.voice.proto.JoinReq.lang: object expected");i.lang=$root.com.quick.voice.proto.AiLangSetting.fromObject(t.lang)}return t.stt!=null&&(i.stt=!!t.stt),t.msgId!=null&&(i.msgId=String(t.msgId)),t.msg!=null&&(i.msg=String(t.msg)),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.roomId="",_.user=null,_.callType=i.enums===String?"Normal":0),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.user!=null&&t.hasOwnProperty("user")&&(_.user=$root.com.quick.voice.proto.User.toObject(t.user,i)),t.callType!=null&&t.hasOwnProperty("callType")&&(_.callType=i.enums===String?$root.com.quick.voice.proto.CallType[t.callType]===void 0?t.callType:$root.com.quick.voice.proto.CallType[t.callType]:t.callType),t.token!=null&&t.hasOwnProperty("token")&&(_.token=t.token,i.oneofs&&(_._token="token")),t.lang!=null&&t.hasOwnProperty("lang")&&(_.lang=$root.com.quick.voice.proto.AiLangSetting.toObject(t.lang,i),i.oneofs&&(_._lang="lang")),t.stt!=null&&t.hasOwnProperty("stt")&&(_.stt=t.stt,i.oneofs&&(_._stt="stt")),t.msgId!=null&&t.hasOwnProperty("msgId")&&(_.msgId=t.msgId,i.oneofs&&(_._msgId="msgId")),t.msg!=null&&t.hasOwnProperty("msg")&&(_.msg=t.msg,i.oneofs&&(_._msg="msg")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.JoinReq"},r})(),T.JoinRsp=(function(){function r(e){if(this.roomUsers=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.roomUsers=$util.emptyArray,r.prototype.callType=0,r.prototype.wifiOnly=!1,r.prototype.roomAction=null,r.prototype.totalSize=null,r.prototype.meetSpecialRoles=null;let c;return Object.defineProperty(r.prototype,"_roomAction",{get:$util.oneOfGetter(c=["roomAction"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_totalSize",{get:$util.oneOfGetter(c=["totalSize"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_meetSpecialRoles",{get:$util.oneOfGetter(c=["meetSpecialRoles"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.roomUsers!=null&&t.roomUsers.length)for(let _=0;_<t.roomUsers.length;++_)$root.com.quick.voice.proto.User.encode(t.roomUsers[_],i.uint32(18).fork()).ldelim();return t.callType!=null&&Object.hasOwnProperty.call(t,"callType")&&i.uint32(24).int32(t.callType),t.wifiOnly!=null&&Object.hasOwnProperty.call(t,"wifiOnly")&&i.uint32(32).bool(t.wifiOnly),t.roomAction!=null&&Object.hasOwnProperty.call(t,"roomAction")&&i.uint32(40).int32(t.roomAction),t.totalSize!=null&&Object.hasOwnProperty.call(t,"totalSize")&&i.uint32(48).int32(t.totalSize),t.meetSpecialRoles!=null&&Object.hasOwnProperty.call(t,"meetSpecialRoles")&&$root.com.quick.voice.proto.MeetRolesListRsp.encode(t.meetSpecialRoles,i.uint32(58).fork()).ldelim(),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.JoinRsp;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.roomId=t.string();break}case 2:{x.roomUsers&&x.roomUsers.length||(x.roomUsers=[]),x.roomUsers.push($root.com.quick.voice.proto.User.decode(t,t.uint32()));break}case 3:{x.callType=t.int32();break}case 4:{x.wifiOnly=t.bool();break}case 5:{x.roomAction=t.int32();break}case 6:{x.totalSize=t.int32();break}case 7:{x.meetSpecialRoles=$root.com.quick.voice.proto.MeetRolesListRsp.decode(t,t.uint32());break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.roomUsers!=null&&t.hasOwnProperty("roomUsers")){if(!Array.isArray(t.roomUsers))return"roomUsers: array expected";for(let i=0;i<t.roomUsers.length;++i){let _=$root.com.quick.voice.proto.User.verify(t.roomUsers[i]);if(_)return"roomUsers."+_}}if(t.callType!=null&&t.hasOwnProperty("callType"))switch(t.callType){default:return"callType: enum value expected";case 0:case 1:case 2:case 3:break}if(t.wifiOnly!=null&&t.hasOwnProperty("wifiOnly")&&typeof t.wifiOnly!="boolean")return"wifiOnly: boolean expected";if(t.roomAction!=null&&t.hasOwnProperty("roomAction")&&!$util.isInteger(t.roomAction))return"roomAction: integer expected";if(t.totalSize!=null&&t.hasOwnProperty("totalSize")&&!$util.isInteger(t.totalSize))return"totalSize: integer expected";if(t.meetSpecialRoles!=null&&t.hasOwnProperty("meetSpecialRoles")){let i=$root.com.quick.voice.proto.MeetRolesListRsp.verify(t.meetSpecialRoles);if(i)return"meetSpecialRoles."+i}return null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.JoinRsp)return t;let i=new $root.com.quick.voice.proto.JoinRsp;if(t.roomId!=null&&(i.roomId=String(t.roomId)),t.roomUsers){if(!Array.isArray(t.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");i.roomUsers=[];for(let _=0;_<t.roomUsers.length;++_){if(typeof t.roomUsers[_]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");i.roomUsers[_]=$root.com.quick.voice.proto.User.fromObject(t.roomUsers[_])}}switch(t.callType){default:if(typeof t.callType=="number"){i.callType=t.callType;break}break;case"Normal":case 0:i.callType=0;break;case"Meeting":case 1:i.callType=1;break;case"Live":case 2:i.callType=2;break;case"Conference":case 3:i.callType=3;break}if(t.wifiOnly!=null&&(i.wifiOnly=!!t.wifiOnly),t.roomAction!=null&&(i.roomAction=t.roomAction|0),t.totalSize!=null&&(i.totalSize=t.totalSize|0),t.meetSpecialRoles!=null){if(typeof t.meetSpecialRoles!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.meetSpecialRoles: object expected");i.meetSpecialRoles=$root.com.quick.voice.proto.MeetRolesListRsp.fromObject(t.meetSpecialRoles)}return i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.roomUsers=[]),i.defaults&&(_.roomId="",_.callType=i.enums===String?"Normal":0,_.wifiOnly=!1),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.roomUsers&&t.roomUsers.length){_.roomUsers=[];for(let I=0;I<t.roomUsers.length;++I)_.roomUsers[I]=$root.com.quick.voice.proto.User.toObject(t.roomUsers[I],i)}return t.callType!=null&&t.hasOwnProperty("callType")&&(_.callType=i.enums===String?$root.com.quick.voice.proto.CallType[t.callType]===void 0?t.callType:$root.com.quick.voice.proto.CallType[t.callType]:t.callType),t.wifiOnly!=null&&t.hasOwnProperty("wifiOnly")&&(_.wifiOnly=t.wifiOnly),t.roomAction!=null&&t.hasOwnProperty("roomAction")&&(_.roomAction=t.roomAction,i.oneofs&&(_._roomAction="roomAction")),t.totalSize!=null&&t.hasOwnProperty("totalSize")&&(_.totalSize=t.totalSize,i.oneofs&&(_._totalSize="totalSize")),t.meetSpecialRoles!=null&&t.hasOwnProperty("meetSpecialRoles")&&(_.meetSpecialRoles=$root.com.quick.voice.proto.MeetRolesListRsp.toObject(t.meetSpecialRoles,i),i.oneofs&&(_._meetSpecialRoles="meetSpecialRoles")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.JoinRsp"},r})(),T.JoinNotify=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.user=null,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,t.uint32(18).fork()).ldelim(),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.JoinNotify;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.roomId=e.string();break}case 2:{I.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let t=$root.com.quick.voice.proto.User.verify(e.user);if(t)return"user."+t}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinNotify)return e;let t=new $root.com.quick.voice.proto.JoinNotify;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");t.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.roomId="",i.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(i.user=$root.com.quick.voice.proto.User.toObject(e.user,t)),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinNotify"},r})(),T.ConnectCFReq=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.sdp="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&t.uint32(10).string(e.sdp),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.ConnectCFReq;for(;e.pos<_;){let x=e.uint32();if(x===i)break;x>>>3===1?I.sdp=e.string():e.skipType(x&7)}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp)?"sdp: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ConnectCFReq)return e;let t=new $root.com.quick.voice.proto.ConnectCFReq;return e.sdp!=null&&(t.sdp=String(e.sdp)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.sdp=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(i.sdp=e.sdp),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ConnectCFReq"},r})(),T.ConnectCFRsp=(function(){function r(e){if(this.subscribeUsers=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.remoteSdp="",r.prototype.subscribeUsers=$util.emptyArray,r.prototype.session=null;let c;return Object.defineProperty(r.prototype,"_session",{get:$util.oneOfGetter(c=["session"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.remoteSdp!=null&&Object.hasOwnProperty.call(t,"remoteSdp")&&i.uint32(10).string(t.remoteSdp),t.subscribeUsers!=null&&t.subscribeUsers.length)for(let _=0;_<t.subscribeUsers.length;++_)$root.com.quick.voice.proto.User.encode(t.subscribeUsers[_],i.uint32(18).fork()).ldelim();return t.session!=null&&Object.hasOwnProperty.call(t,"session")&&i.uint32(26).string(t.session),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.ConnectCFRsp;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.remoteSdp=t.string();break}case 2:{x.subscribeUsers&&x.subscribeUsers.length||(x.subscribeUsers=[]),x.subscribeUsers.push($root.com.quick.voice.proto.User.decode(t,t.uint32()));break}case 3:{x.session=t.string();break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.remoteSdp!=null&&t.hasOwnProperty("remoteSdp")&&!$util.isString(t.remoteSdp))return"remoteSdp: string expected";if(t.subscribeUsers!=null&&t.hasOwnProperty("subscribeUsers")){if(!Array.isArray(t.subscribeUsers))return"subscribeUsers: array expected";for(let i=0;i<t.subscribeUsers.length;++i){let _=$root.com.quick.voice.proto.User.verify(t.subscribeUsers[i]);if(_)return"subscribeUsers."+_}}return t.session!=null&&t.hasOwnProperty("session")&&!$util.isString(t.session)?"session: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.ConnectCFRsp)return t;let i=new $root.com.quick.voice.proto.ConnectCFRsp;if(t.remoteSdp!=null&&(i.remoteSdp=String(t.remoteSdp)),t.subscribeUsers){if(!Array.isArray(t.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");i.subscribeUsers=[];for(let _=0;_<t.subscribeUsers.length;++_){if(typeof t.subscribeUsers[_]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");i.subscribeUsers[_]=$root.com.quick.voice.proto.User.fromObject(t.subscribeUsers[_])}}return t.session!=null&&(i.session=String(t.session)),i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.subscribeUsers=[]),i.defaults&&(_.remoteSdp=""),t.remoteSdp!=null&&t.hasOwnProperty("remoteSdp")&&(_.remoteSdp=t.remoteSdp),t.subscribeUsers&&t.subscribeUsers.length){_.subscribeUsers=[];for(let I=0;I<t.subscribeUsers.length;++I)_.subscribeUsers[I]=$root.com.quick.voice.proto.User.toObject(t.subscribeUsers[I],i)}return t.session!=null&&t.hasOwnProperty("session")&&(_.session=t.session,i.oneofs&&(_._session="session")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.ConnectCFRsp"},r})(),T.PublishReq=(function(){function r(e){if(this.tracks=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.sdp="",r.prototype.tracks=$util.emptyArray,r.prototype.callAction=0,r.prototype.recreate=null,r.prototype.session=null;let c;return Object.defineProperty(r.prototype,"_recreate",{get:$util.oneOfGetter(c=["recreate"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_session",{get:$util.oneOfGetter(c=["session"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.sdp!=null&&Object.hasOwnProperty.call(t,"sdp")&&i.uint32(10).string(t.sdp),t.tracks!=null&&t.tracks.length)for(let _=0;_<t.tracks.length;++_)$root.com.quick.voice.proto.Track.encode(t.tracks[_],i.uint32(18).fork()).ldelim();return t.callAction!=null&&Object.hasOwnProperty.call(t,"callAction")&&i.uint32(24).int32(t.callAction),t.recreate!=null&&Object.hasOwnProperty.call(t,"recreate")&&i.uint32(32).bool(t.recreate),t.session!=null&&Object.hasOwnProperty.call(t,"session")&&i.uint32(42).string(t.session),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.PublishReq;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.sdp=t.string();break}case 2:{x.tracks&&x.tracks.length||(x.tracks=[]),x.tracks.push($root.com.quick.voice.proto.Track.decode(t,t.uint32()));break}case 3:{x.callAction=t.int32();break}case 4:{x.recreate=t.bool();break}case 5:{x.session=t.string();break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.sdp!=null&&t.hasOwnProperty("sdp")&&!$util.isString(t.sdp))return"sdp: string expected";if(t.tracks!=null&&t.hasOwnProperty("tracks")){if(!Array.isArray(t.tracks))return"tracks: array expected";for(let i=0;i<t.tracks.length;++i){let _=$root.com.quick.voice.proto.Track.verify(t.tracks[i]);if(_)return"tracks."+_}}return t.callAction!=null&&t.hasOwnProperty("callAction")&&!$util.isInteger(t.callAction)?"callAction: integer expected":t.recreate!=null&&t.hasOwnProperty("recreate")&&typeof t.recreate!="boolean"?"recreate: boolean expected":t.session!=null&&t.hasOwnProperty("session")&&!$util.isString(t.session)?"session: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.PublishReq)return t;let i=new $root.com.quick.voice.proto.PublishReq;if(t.sdp!=null&&(i.sdp=String(t.sdp)),t.tracks){if(!Array.isArray(t.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");i.tracks=[];for(let _=0;_<t.tracks.length;++_){if(typeof t.tracks[_]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");i.tracks[_]=$root.com.quick.voice.proto.Track.fromObject(t.tracks[_])}}return t.callAction!=null&&(i.callAction=t.callAction|0),t.recreate!=null&&(i.recreate=!!t.recreate),t.session!=null&&(i.session=String(t.session)),i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.tracks=[]),i.defaults&&(_.sdp="",_.callAction=0),t.sdp!=null&&t.hasOwnProperty("sdp")&&(_.sdp=t.sdp),t.tracks&&t.tracks.length){_.tracks=[];for(let I=0;I<t.tracks.length;++I)_.tracks[I]=$root.com.quick.voice.proto.Track.toObject(t.tracks[I],i)}return t.callAction!=null&&t.hasOwnProperty("callAction")&&(_.callAction=t.callAction),t.recreate!=null&&t.hasOwnProperty("recreate")&&(_.recreate=t.recreate,i.oneofs&&(_._recreate="recreate")),t.session!=null&&t.hasOwnProperty("session")&&(_.session=t.session,i.oneofs&&(_._session="session")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.PublishReq"},r})(),T.PublishRsp=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.remoteSdp="",r.prototype.session=null;let c;return Object.defineProperty(r.prototype,"_session",{get:$util.oneOfGetter(c=["session"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.remoteSdp!=null&&Object.hasOwnProperty.call(t,"remoteSdp")&&i.uint32(10).string(t.remoteSdp),t.session!=null&&Object.hasOwnProperty.call(t,"session")&&i.uint32(18).string(t.session),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.PublishRsp;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.remoteSdp=t.string();break}case 2:{x.session=t.string();break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){return typeof t!="object"||t===null?"object expected":t.remoteSdp!=null&&t.hasOwnProperty("remoteSdp")&&!$util.isString(t.remoteSdp)?"remoteSdp: string expected":t.session!=null&&t.hasOwnProperty("session")&&!$util.isString(t.session)?"session: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.PublishRsp)return t;let i=new $root.com.quick.voice.proto.PublishRsp;return t.remoteSdp!=null&&(i.remoteSdp=String(t.remoteSdp)),t.session!=null&&(i.session=String(t.session)),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.remoteSdp=""),t.remoteSdp!=null&&t.hasOwnProperty("remoteSdp")&&(_.remoteSdp=t.remoteSdp),t.session!=null&&t.hasOwnProperty("session")&&(_.session=t.session,i.oneofs&&(_._session="session")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.PublishRsp"},r})(),T.PublishNotify=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.user=null,r.prototype.session=null;let c;return Object.defineProperty(r.prototype,"_session",{get:$util.oneOfGetter(c=["session"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.user!=null&&Object.hasOwnProperty.call(t,"user")&&$root.com.quick.voice.proto.User.encode(t.user,i.uint32(18).fork()).ldelim(),t.session!=null&&Object.hasOwnProperty.call(t,"session")&&i.uint32(26).string(t.session),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.PublishNotify;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.roomId=t.string();break}case 2:{x.user=$root.com.quick.voice.proto.User.decode(t,t.uint32());break}case 3:{x.session=t.string();break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.user!=null&&t.hasOwnProperty("user")){let i=$root.com.quick.voice.proto.User.verify(t.user);if(i)return"user."+i}return t.session!=null&&t.hasOwnProperty("session")&&!$util.isString(t.session)?"session: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.PublishNotify)return t;let i=new $root.com.quick.voice.proto.PublishNotify;if(t.roomId!=null&&(i.roomId=String(t.roomId)),t.user!=null){if(typeof t.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");i.user=$root.com.quick.voice.proto.User.fromObject(t.user)}return t.session!=null&&(i.session=String(t.session)),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.roomId="",_.user=null),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.user!=null&&t.hasOwnProperty("user")&&(_.user=$root.com.quick.voice.proto.User.toObject(t.user,i)),t.session!=null&&t.hasOwnProperty("session")&&(_.session=t.session,i.oneofs&&(_._session="session")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.PublishNotify"},r})(),T.SubscribeReq=(function(){function r(e){if(this.users=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.users=$util.emptyArray,r.prototype.session=null;let c;return Object.defineProperty(r.prototype,"_session",{get:$util.oneOfGetter(c=["session"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.users!=null&&t.users.length)for(let _=0;_<t.users.length;++_)$root.com.quick.voice.proto.User.encode(t.users[_],i.uint32(10).fork()).ldelim();return t.session!=null&&Object.hasOwnProperty.call(t,"session")&&i.uint32(18).string(t.session),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.SubscribeReq;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.users&&x.users.length||(x.users=[]),x.users.push($root.com.quick.voice.proto.User.decode(t,t.uint32()));break}case 2:{x.session=t.string();break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.users!=null&&t.hasOwnProperty("users")){if(!Array.isArray(t.users))return"users: array expected";for(let i=0;i<t.users.length;++i){let _=$root.com.quick.voice.proto.User.verify(t.users[i]);if(_)return"users."+_}}return t.session!=null&&t.hasOwnProperty("session")&&!$util.isString(t.session)?"session: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.SubscribeReq)return t;let i=new $root.com.quick.voice.proto.SubscribeReq;if(t.users){if(!Array.isArray(t.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");i.users=[];for(let _=0;_<t.users.length;++_){if(typeof t.users[_]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");i.users[_]=$root.com.quick.voice.proto.User.fromObject(t.users[_])}}return t.session!=null&&(i.session=String(t.session)),i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.users=[]),t.users&&t.users.length){_.users=[];for(let I=0;I<t.users.length;++I)_.users[I]=$root.com.quick.voice.proto.User.toObject(t.users[I],i)}return t.session!=null&&t.hasOwnProperty("session")&&(_.session=t.session,i.oneofs&&(_._session="session")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.SubscribeReq"},r})(),T.SubscribeRsp=(function(){function r(e){if(this.users=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.remoteSdp="",r.prototype.users=$util.emptyArray,r.prototype.session=null;let c;return Object.defineProperty(r.prototype,"_session",{get:$util.oneOfGetter(c=["session"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.remoteSdp!=null&&Object.hasOwnProperty.call(t,"remoteSdp")&&i.uint32(10).string(t.remoteSdp),t.users!=null&&t.users.length)for(let _=0;_<t.users.length;++_)$root.com.quick.voice.proto.User.encode(t.users[_],i.uint32(18).fork()).ldelim();return t.session!=null&&Object.hasOwnProperty.call(t,"session")&&i.uint32(26).string(t.session),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.SubscribeRsp;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.remoteSdp=t.string();break}case 2:{x.users&&x.users.length||(x.users=[]),x.users.push($root.com.quick.voice.proto.User.decode(t,t.uint32()));break}case 3:{x.session=t.string();break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.remoteSdp!=null&&t.hasOwnProperty("remoteSdp")&&!$util.isString(t.remoteSdp))return"remoteSdp: string expected";if(t.users!=null&&t.hasOwnProperty("users")){if(!Array.isArray(t.users))return"users: array expected";for(let i=0;i<t.users.length;++i){let _=$root.com.quick.voice.proto.User.verify(t.users[i]);if(_)return"users."+_}}return t.session!=null&&t.hasOwnProperty("session")&&!$util.isString(t.session)?"session: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.SubscribeRsp)return t;let i=new $root.com.quick.voice.proto.SubscribeRsp;if(t.remoteSdp!=null&&(i.remoteSdp=String(t.remoteSdp)),t.users){if(!Array.isArray(t.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");i.users=[];for(let _=0;_<t.users.length;++_){if(typeof t.users[_]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");i.users[_]=$root.com.quick.voice.proto.User.fromObject(t.users[_])}}return t.session!=null&&(i.session=String(t.session)),i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.users=[]),i.defaults&&(_.remoteSdp=""),t.remoteSdp!=null&&t.hasOwnProperty("remoteSdp")&&(_.remoteSdp=t.remoteSdp),t.users&&t.users.length){_.users=[];for(let I=0;I<t.users.length;++I)_.users[I]=$root.com.quick.voice.proto.User.toObject(t.users[I],i)}return t.session!=null&&t.hasOwnProperty("session")&&(_.session=t.session,i.oneofs&&(_._session="session")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.SubscribeRsp"},r})(),T.RenegotiateReq=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.userId="",r.prototype.sdp="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&t.uint32(18).string(e.sdp),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.RenegotiateReq;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.userId=e.string();break}case 2:{I.sdp=e.string();break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp)?"sdp: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.RenegotiateReq)return e;let t=new $root.com.quick.voice.proto.RenegotiateReq;return e.userId!=null&&(t.userId=String(e.userId)),e.sdp!=null&&(t.sdp=String(e.sdp)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.userId="",i.sdp=""),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.sdp!=null&&e.hasOwnProperty("sdp")&&(i.sdp=e.sdp),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.RenegotiateReq"},r})(),T.QuitReq=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.userId="",r.prototype.roomId="",r.prototype.msgId=null,r.prototype.msg=null;let c;return Object.defineProperty(r.prototype,"_msgId",{get:$util.oneOfGetter(c=["msgId"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_msg",{get:$util.oneOfGetter(c=["msg"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.userId!=null&&Object.hasOwnProperty.call(t,"userId")&&i.uint32(10).string(t.userId),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(18).string(t.roomId),t.msgId!=null&&Object.hasOwnProperty.call(t,"msgId")&&i.uint32(26).string(t.msgId),t.msg!=null&&Object.hasOwnProperty.call(t,"msg")&&i.uint32(34).string(t.msg),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.QuitReq;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.userId=t.string();break}case 2:{x.roomId=t.string();break}case 3:{x.msgId=t.string();break}case 4:{x.msg=t.string();break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){return typeof t!="object"||t===null?"object expected":t.userId!=null&&t.hasOwnProperty("userId")&&!$util.isString(t.userId)?"userId: string expected":t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId)?"roomId: string expected":t.msgId!=null&&t.hasOwnProperty("msgId")&&!$util.isString(t.msgId)?"msgId: string expected":t.msg!=null&&t.hasOwnProperty("msg")&&!$util.isString(t.msg)?"msg: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.QuitReq)return t;let i=new $root.com.quick.voice.proto.QuitReq;return t.userId!=null&&(i.userId=String(t.userId)),t.roomId!=null&&(i.roomId=String(t.roomId)),t.msgId!=null&&(i.msgId=String(t.msgId)),t.msg!=null&&(i.msg=String(t.msg)),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.userId="",_.roomId=""),t.userId!=null&&t.hasOwnProperty("userId")&&(_.userId=t.userId),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.msgId!=null&&t.hasOwnProperty("msgId")&&(_.msgId=t.msgId,i.oneofs&&(_._msgId="msgId")),t.msg!=null&&t.hasOwnProperty("msg")&&(_.msg=t.msg,i.oneofs&&(_._msg="msg")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.QuitReq"},r})(),T.QuitNotify=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.user=null,r.prototype.code=null,r.prototype.desc=null;let c;return Object.defineProperty(r.prototype,"_code",{get:$util.oneOfGetter(c=["code"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_desc",{get:$util.oneOfGetter(c=["desc"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.user!=null&&Object.hasOwnProperty.call(t,"user")&&$root.com.quick.voice.proto.User.encode(t.user,i.uint32(18).fork()).ldelim(),t.code!=null&&Object.hasOwnProperty.call(t,"code")&&i.uint32(24).int32(t.code),t.desc!=null&&Object.hasOwnProperty.call(t,"desc")&&i.uint32(34).string(t.desc),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.QuitNotify;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.roomId=t.string();break}case 2:{x.user=$root.com.quick.voice.proto.User.decode(t,t.uint32());break}case 3:{x.code=t.int32();break}case 4:{x.desc=t.string();break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.user!=null&&t.hasOwnProperty("user")){let i=$root.com.quick.voice.proto.User.verify(t.user);if(i)return"user."+i}return t.code!=null&&t.hasOwnProperty("code")&&!$util.isInteger(t.code)?"code: integer expected":t.desc!=null&&t.hasOwnProperty("desc")&&!$util.isString(t.desc)?"desc: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.QuitNotify)return t;let i=new $root.com.quick.voice.proto.QuitNotify;if(t.roomId!=null&&(i.roomId=String(t.roomId)),t.user!=null){if(typeof t.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");i.user=$root.com.quick.voice.proto.User.fromObject(t.user)}return t.code!=null&&(i.code=t.code|0),t.desc!=null&&(i.desc=String(t.desc)),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.roomId="",_.user=null),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.user!=null&&t.hasOwnProperty("user")&&(_.user=$root.com.quick.voice.proto.User.toObject(t.user,i)),t.code!=null&&t.hasOwnProperty("code")&&(_.code=t.code,i.oneofs&&(_._code="code")),t.desc!=null&&t.hasOwnProperty("desc")&&(_.desc=t.desc,i.oneofs&&(_._desc="desc")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.QuitNotify"},r})(),T.TokenExpireNotify=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.TokenExpireNotify;for(;e.pos<_;){let x=e.uint32();if(x===i)break;x>>>3===1?I.roomId=e.string():e.skipType(x&7)}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.TokenExpireNotify)return e;let t=new $root.com.quick.voice.proto.TokenExpireNotify;return e.roomId!=null&&(t.roomId=String(e.roomId)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.TokenExpireNotify"},r})(),T.UpdateTokenReq=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.sdkToken="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&t.uint32(18).string(e.sdkToken),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.UpdateTokenReq;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.roomId=e.string();break}case 2:{I.sdkToken=e.string();break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&!$util.isString(e.sdkToken)?"sdkToken: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTokenReq)return e;let t=new $root.com.quick.voice.proto.UpdateTokenReq;return e.roomId!=null&&(t.roomId=String(e.roomId)),e.sdkToken!=null&&(t.sdkToken=String(e.sdkToken)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.roomId="",i.sdkToken=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(i.sdkToken=e.sdkToken),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTokenReq"},r})(),T.NetQualityChange=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.userId="",r.prototype.roomId="",r.prototype.egress=0,r.prototype.ingress=0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(18).string(e.roomId),e.egress!=null&&Object.hasOwnProperty.call(e,"egress")&&t.uint32(24).int32(e.egress),e.ingress!=null&&Object.hasOwnProperty.call(e,"ingress")&&t.uint32(32).int32(e.ingress),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.NetQualityChange;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.userId=e.string();break}case 2:{I.roomId=e.string();break}case 3:{I.egress=e.int32();break}case 4:{I.ingress=e.int32();break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":e.egress!=null&&e.hasOwnProperty("egress")&&!$util.isInteger(e.egress)?"egress: integer expected":e.ingress!=null&&e.hasOwnProperty("ingress")&&!$util.isInteger(e.ingress)?"ingress: integer expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.NetQualityChange)return e;let t=new $root.com.quick.voice.proto.NetQualityChange;return e.userId!=null&&(t.userId=String(e.userId)),e.roomId!=null&&(t.roomId=String(e.roomId)),e.egress!=null&&(t.egress=e.egress|0),e.ingress!=null&&(t.ingress=e.ingress|0),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.userId="",i.roomId="",i.egress=0,i.ingress=0),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.egress!=null&&e.hasOwnProperty("egress")&&(i.egress=e.egress),e.ingress!=null&&e.hasOwnProperty("ingress")&&(i.ingress=e.ingress),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.NetQualityChange"},r})(),T.NetQualityNotify=(function(){function r(c){if(this.qualities=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.qualities=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.qualities!=null&&e.qualities.length)for(let i=0;i<e.qualities.length;++i)$root.com.quick.voice.proto.NetQualityChange.encode(e.qualities[i],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.NetQualityNotify;for(;e.pos<_;){let x=e.uint32();if(x===i)break;x>>>3===1?(I.qualities&&I.qualities.length||(I.qualities=[]),I.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(e,e.uint32()))):e.skipType(x&7)}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.qualities!=null&&e.hasOwnProperty("qualities")){if(!Array.isArray(e.qualities))return"qualities: array expected";for(let t=0;t<e.qualities.length;++t){let i=$root.com.quick.voice.proto.NetQualityChange.verify(e.qualities[t]);if(i)return"qualities."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.NetQualityNotify)return e;let t=new $root.com.quick.voice.proto.NetQualityNotify;if(e.qualities){if(!Array.isArray(e.qualities))throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: array expected");t.qualities=[];for(let i=0;i<e.qualities.length;++i){if(typeof e.qualities[i]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");t.qualities[i]=$root.com.quick.voice.proto.NetQualityChange.fromObject(e.qualities[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.qualities=[]),e.qualities&&e.qualities.length){i.qualities=[];for(let _=0;_<e.qualities.length;++_)i.qualities[_]=$root.com.quick.voice.proto.NetQualityChange.toObject(e.qualities[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.NetQualityNotify"},r})(),T.UpdateCall=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.user=null,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,t.uint32(18).fork()).ldelim(),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.UpdateCall;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.roomId=e.string();break}case 2:{I.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let t=$root.com.quick.voice.proto.User.verify(e.user);if(t)return"user."+t}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateCall)return e;let t=new $root.com.quick.voice.proto.UpdateCall;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");t.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.roomId="",i.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(i.user=$root.com.quick.voice.proto.User.toObject(e.user,t)),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateCall"},r})(),T.P2PUserSyncItem=(function(){function r(c){if(this.types=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.userId="",r.prototype.types=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),e.types!=null&&e.types.length){t.uint32(18).fork();for(let i=0;i<e.types.length;++i)t.int32(e.types[i]);t.ldelim()}return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.P2PUserSyncItem;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.userId=e.string();break}case 2:{if(I.types&&I.types.length||(I.types=[]),(x&7)===2){let M=e.uint32()+e.pos;for(;e.pos<M;)I.types.push(e.int32())}else I.types.push(e.int32());break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId))return"userId: string expected";if(e.types!=null&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)switch(e.types[t]){default:return"types: enum value[] expected";case 0:case 1:case 2:case 3:break}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.P2PUserSyncItem)return e;let t=new $root.com.quick.voice.proto.P2PUserSyncItem;if(e.userId!=null&&(t.userId=String(e.userId)),e.types){if(!Array.isArray(e.types))throw TypeError(".com.quick.voice.proto.P2PUserSyncItem.types: array expected");t.types=[];for(let i=0;i<e.types.length;++i)switch(e.types[i]){default:if(typeof e.types[i]=="number"){t.types[i]=e.types[i];break}case"Microphone":case 0:t.types[i]=0;break;case"Camera":case 1:t.types[i]=1;break;case"Screen":case 2:t.types[i]=2;break;case"SystemVoice":case 3:t.types[i]=3;break}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.types=[]),t.defaults&&(i.userId=""),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.types&&e.types.length){i.types=[];for(let _=0;_<e.types.length;++_)i.types[_]=t.enums===String?$root.com.quick.voice.proto.TrackType[e.types[_]]===void 0?e.types[_]:$root.com.quick.voice.proto.TrackType[e.types[_]]:e.types[_]}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.P2PUserSyncItem"},r})(),T.P2PUserSyncList=(function(){function r(c){if(this.push=[],this.pull=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.push=$util.emptyArray,r.prototype.pull=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.push!=null&&e.push.length)for(let i=0;i<e.push.length;++i)$root.com.quick.voice.proto.P2PUserSyncItem.encode(e.push[i],t.uint32(10).fork()).ldelim();if(e.pull!=null&&e.pull.length)for(let i=0;i<e.pull.length;++i)$root.com.quick.voice.proto.P2PUserSyncItem.encode(e.pull[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.P2PUserSyncList;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.push&&I.push.length||(I.push=[]),I.push.push($root.com.quick.voice.proto.P2PUserSyncItem.decode(e,e.uint32()));break}case 2:{I.pull&&I.pull.length||(I.pull=[]),I.pull.push($root.com.quick.voice.proto.P2PUserSyncItem.decode(e,e.uint32()));break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.push!=null&&e.hasOwnProperty("push")){if(!Array.isArray(e.push))return"push: array expected";for(let t=0;t<e.push.length;++t){let i=$root.com.quick.voice.proto.P2PUserSyncItem.verify(e.push[t]);if(i)return"push."+i}}if(e.pull!=null&&e.hasOwnProperty("pull")){if(!Array.isArray(e.pull))return"pull: array expected";for(let t=0;t<e.pull.length;++t){let i=$root.com.quick.voice.proto.P2PUserSyncItem.verify(e.pull[t]);if(i)return"pull."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.P2PUserSyncList)return e;let t=new $root.com.quick.voice.proto.P2PUserSyncList;if(e.push){if(!Array.isArray(e.push))throw TypeError(".com.quick.voice.proto.P2PUserSyncList.push: array expected");t.push=[];for(let i=0;i<e.push.length;++i){if(typeof e.push[i]!="object")throw TypeError(".com.quick.voice.proto.P2PUserSyncList.push: object expected");t.push[i]=$root.com.quick.voice.proto.P2PUserSyncItem.fromObject(e.push[i])}}if(e.pull){if(!Array.isArray(e.pull))throw TypeError(".com.quick.voice.proto.P2PUserSyncList.pull: array expected");t.pull=[];for(let i=0;i<e.pull.length;++i){if(typeof e.pull[i]!="object")throw TypeError(".com.quick.voice.proto.P2PUserSyncList.pull: object expected");t.pull[i]=$root.com.quick.voice.proto.P2PUserSyncItem.fromObject(e.pull[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.push=[],i.pull=[]),e.push&&e.push.length){i.push=[];for(let _=0;_<e.push.length;++_)i.push[_]=$root.com.quick.voice.proto.P2PUserSyncItem.toObject(e.push[_],t)}if(e.pull&&e.pull.length){i.pull=[];for(let _=0;_<e.pull.length;++_)i.pull[_]=$root.com.quick.voice.proto.P2PUserSyncItem.toObject(e.pull[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.P2PUserSyncList"},r})(),T.SyncRoomInfoReq=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.user=null,r.prototype.p2pState=null;let c;return Object.defineProperty(r.prototype,"_p2pState",{get:$util.oneOfGetter(c=["p2pState"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.user!=null&&Object.hasOwnProperty.call(t,"user")&&$root.com.quick.voice.proto.User.encode(t.user,i.uint32(18).fork()).ldelim(),t.p2pState!=null&&Object.hasOwnProperty.call(t,"p2pState")&&$root.com.quick.voice.proto.P2PUserSyncList.encode(t.p2pState,i.uint32(26).fork()).ldelim(),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.roomId=t.string();break}case 2:{x.user=$root.com.quick.voice.proto.User.decode(t,t.uint32());break}case 3:{x.p2pState=$root.com.quick.voice.proto.P2PUserSyncList.decode(t,t.uint32());break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.user!=null&&t.hasOwnProperty("user")){let i=$root.com.quick.voice.proto.User.verify(t.user);if(i)return"user."+i}if(t.p2pState!=null&&t.hasOwnProperty("p2pState")){let i=$root.com.quick.voice.proto.P2PUserSyncList.verify(t.p2pState);if(i)return"p2pState."+i}return null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return t;let i=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(t.roomId!=null&&(i.roomId=String(t.roomId)),t.user!=null){if(typeof t.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");i.user=$root.com.quick.voice.proto.User.fromObject(t.user)}if(t.p2pState!=null){if(typeof t.p2pState!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.p2pState: object expected");i.p2pState=$root.com.quick.voice.proto.P2PUserSyncList.fromObject(t.p2pState)}return i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.roomId="",_.user=null),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.user!=null&&t.hasOwnProperty("user")&&(_.user=$root.com.quick.voice.proto.User.toObject(t.user,i)),t.p2pState!=null&&t.hasOwnProperty("p2pState")&&(_.p2pState=$root.com.quick.voice.proto.P2PUserSyncList.toObject(t.p2pState,i),i.oneofs&&(_._p2pState="p2pState")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.SyncRoomInfoReq"},r})(),T.SyncRoomInfoRsp=(function(){function r(e){if(this.users=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.isValid=!1,r.prototype.users=$util.emptyArray,r.prototype.isActive=!1,r.prototype.roomAction=null,r.prototype.totalSize=null,r.prototype.meetSpecialRoles=null;let c;return Object.defineProperty(r.prototype,"_roomAction",{get:$util.oneOfGetter(c=["roomAction"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_totalSize",{get:$util.oneOfGetter(c=["totalSize"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_meetSpecialRoles",{get:$util.oneOfGetter(c=["meetSpecialRoles"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.isValid!=null&&Object.hasOwnProperty.call(t,"isValid")&&i.uint32(16).bool(t.isValid),t.users!=null&&t.users.length)for(let _=0;_<t.users.length;++_)$root.com.quick.voice.proto.User.encode(t.users[_],i.uint32(26).fork()).ldelim();return t.isActive!=null&&Object.hasOwnProperty.call(t,"isActive")&&i.uint32(32).bool(t.isActive),t.roomAction!=null&&Object.hasOwnProperty.call(t,"roomAction")&&i.uint32(40).int32(t.roomAction),t.totalSize!=null&&Object.hasOwnProperty.call(t,"totalSize")&&i.uint32(48).int32(t.totalSize),t.meetSpecialRoles!=null&&Object.hasOwnProperty.call(t,"meetSpecialRoles")&&$root.com.quick.voice.proto.MeetRolesListRsp.encode(t.meetSpecialRoles,i.uint32(58).fork()).ldelim(),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.roomId=t.string();break}case 2:{x.isValid=t.bool();break}case 3:{x.users&&x.users.length||(x.users=[]),x.users.push($root.com.quick.voice.proto.User.decode(t,t.uint32()));break}case 4:{x.isActive=t.bool();break}case 5:{x.roomAction=t.int32();break}case 6:{x.totalSize=t.int32();break}case 7:{x.meetSpecialRoles=$root.com.quick.voice.proto.MeetRolesListRsp.decode(t,t.uint32());break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.isValid!=null&&t.hasOwnProperty("isValid")&&typeof t.isValid!="boolean")return"isValid: boolean expected";if(t.users!=null&&t.hasOwnProperty("users")){if(!Array.isArray(t.users))return"users: array expected";for(let i=0;i<t.users.length;++i){let _=$root.com.quick.voice.proto.User.verify(t.users[i]);if(_)return"users."+_}}if(t.isActive!=null&&t.hasOwnProperty("isActive")&&typeof t.isActive!="boolean")return"isActive: boolean expected";if(t.roomAction!=null&&t.hasOwnProperty("roomAction")&&!$util.isInteger(t.roomAction))return"roomAction: integer expected";if(t.totalSize!=null&&t.hasOwnProperty("totalSize")&&!$util.isInteger(t.totalSize))return"totalSize: integer expected";if(t.meetSpecialRoles!=null&&t.hasOwnProperty("meetSpecialRoles")){let i=$root.com.quick.voice.proto.MeetRolesListRsp.verify(t.meetSpecialRoles);if(i)return"meetSpecialRoles."+i}return null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return t;let i=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(t.roomId!=null&&(i.roomId=String(t.roomId)),t.isValid!=null&&(i.isValid=!!t.isValid),t.users){if(!Array.isArray(t.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");i.users=[];for(let _=0;_<t.users.length;++_){if(typeof t.users[_]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");i.users[_]=$root.com.quick.voice.proto.User.fromObject(t.users[_])}}if(t.isActive!=null&&(i.isActive=!!t.isActive),t.roomAction!=null&&(i.roomAction=t.roomAction|0),t.totalSize!=null&&(i.totalSize=t.totalSize|0),t.meetSpecialRoles!=null){if(typeof t.meetSpecialRoles!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.meetSpecialRoles: object expected");i.meetSpecialRoles=$root.com.quick.voice.proto.MeetRolesListRsp.fromObject(t.meetSpecialRoles)}return i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.users=[]),i.defaults&&(_.roomId="",_.isValid=!1,_.isActive=!1),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.isValid!=null&&t.hasOwnProperty("isValid")&&(_.isValid=t.isValid),t.users&&t.users.length){_.users=[];for(let I=0;I<t.users.length;++I)_.users[I]=$root.com.quick.voice.proto.User.toObject(t.users[I],i)}return t.isActive!=null&&t.hasOwnProperty("isActive")&&(_.isActive=t.isActive),t.roomAction!=null&&t.hasOwnProperty("roomAction")&&(_.roomAction=t.roomAction,i.oneofs&&(_._roomAction="roomAction")),t.totalSize!=null&&t.hasOwnProperty("totalSize")&&(_.totalSize=t.totalSize,i.oneofs&&(_._totalSize="totalSize")),t.meetSpecialRoles!=null&&t.hasOwnProperty("meetSpecialRoles")&&(_.meetSpecialRoles=$root.com.quick.voice.proto.MeetRolesListRsp.toObject(t.meetSpecialRoles,i),i.oneofs&&(_._meetSpecialRoles="meetSpecialRoles")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.SyncRoomInfoRsp"},r})(),T.UpdateTime=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&t.uint32(8).int64(e.time),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.UpdateTime;for(;e.pos<_;){let x=e.uint32();if(x===i)break;x>>>3===1?I.time=e.int64():e.skipType(x&7)}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTime)return e;let t=new $root.com.quick.voice.proto.UpdateTime;return e.time!=null&&($util.Long?(t.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?t.time=parseInt(e.time,10):typeof e.time=="number"?t.time=e.time:typeof e.time=="object"&&(t.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});let i={};if(t.defaults)if($util.Long){let _=new $util.Long(0,0,!1);i.time=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.time=t.longs===String?"0":0;return e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?i.time=t.longs===String?String(e.time):e.time:i.time=t.longs===String?$util.Long.prototype.toString.call(e.time):t.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTime"},r})(),T.CloseTrackReq=(function(){function r(c){if(this.tracks=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.sdp="",r.prototype.tracks=$util.emptyArray,r.prototype.roomId="",r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&t.uint32(10).string(e.sdp),e.tracks!=null&&e.tracks.length)for(let i=0;i<e.tracks.length;++i)$root.com.quick.voice.proto.Track.encode(e.tracks[i],t.uint32(18).fork()).ldelim();return e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(26).string(e.roomId),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.CloseTrackReq;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.sdp=e.string();break}case 2:{I.tracks&&I.tracks.length||(I.tracks=[]),I.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}case 3:{I.roomId=e.string();break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp))return"sdp: string expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let t=0;t<e.tracks.length;++t){let i=$root.com.quick.voice.proto.Track.verify(e.tracks[t]);if(i)return"tracks."+i}}return e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackReq)return e;let t=new $root.com.quick.voice.proto.CloseTrackReq;if(e.sdp!=null&&(t.sdp=String(e.sdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");t.tracks=[];for(let i=0;i<e.tracks.length;++i){if(typeof e.tracks[i]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");t.tracks[i]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[i])}}return e.roomId!=null&&(t.roomId=String(e.roomId)),t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.tracks=[]),t.defaults&&(i.sdp="",i.roomId=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(i.sdp=e.sdp),e.tracks&&e.tracks.length){i.tracks=[];for(let _=0;_<e.tracks.length;++_)i.tracks[_]=$root.com.quick.voice.proto.Track.toObject(e.tracks[_],t)}return e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackReq"},r})(),T.CloseTrackRsp=(function(){function r(c){if(this.tracks=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.remoteSdp="",r.prototype.tracks=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&t.uint32(10).string(e.remoteSdp),e.tracks!=null&&e.tracks.length)for(let i=0;i<e.tracks.length;++i)$root.com.quick.voice.proto.Track.encode(e.tracks[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.CloseTrackRsp;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.remoteSdp=e.string();break}case 2:{I.tracks&&I.tracks.length||(I.tracks=[]),I.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&!$util.isString(e.remoteSdp))return"remoteSdp: string expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let t=0;t<e.tracks.length;++t){let i=$root.com.quick.voice.proto.Track.verify(e.tracks[t]);if(i)return"tracks."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackRsp)return e;let t=new $root.com.quick.voice.proto.CloseTrackRsp;if(e.remoteSdp!=null&&(t.remoteSdp=String(e.remoteSdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");t.tracks=[];for(let i=0;i<e.tracks.length;++i){if(typeof e.tracks[i]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");t.tracks[i]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.tracks=[]),t.defaults&&(i.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(i.remoteSdp=e.remoteSdp),e.tracks&&e.tracks.length){i.tracks=[];for(let _=0;_<e.tracks.length;++_)i.tracks[_]=$root.com.quick.voice.proto.Track.toObject(e.tracks[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackRsp"},r})(),T.CloseTrackNotify=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.user=null,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,t.uint32(10).fork()).ldelim(),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.CloseTrackNotify;for(;e.pos<_;){let x=e.uint32();if(x===i)break;x>>>3===1?I.user=$root.com.quick.voice.proto.User.decode(e,e.uint32()):e.skipType(x&7)}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.user!=null&&e.hasOwnProperty("user")){let t=$root.com.quick.voice.proto.User.verify(e.user);if(t)return"user."+t}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackNotify)return e;let t=new $root.com.quick.voice.proto.CloseTrackNotify;if(e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.CloseTrackNotify.user: object expected");t.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.user=null),e.user!=null&&e.hasOwnProperty("user")&&(i.user=$root.com.quick.voice.proto.User.toObject(e.user,t)),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackNotify"},r})(),T.TrackType=(function(){const r={},c=Object.create(r);return c[r[0]="Microphone"]=0,c[r[1]="Camera"]=1,c[r[2]="Screen"]=2,c[r[3]="SystemVoice"]=3,c})(),T.UpdatePermissions=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.user=null,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,t.uint32(18).fork()).ldelim(),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.UpdatePermissions;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.roomId=e.string();break}case 2:{I.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let t=$root.com.quick.voice.proto.User.verify(e.user);if(t)return"user."+t}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdatePermissions)return e;let t=new $root.com.quick.voice.proto.UpdatePermissions;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");t.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.roomId="",i.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(i.user=$root.com.quick.voice.proto.User.toObject(e.user,t)),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdatePermissions"},r})(),T.CallType=(function(){const r={},c=Object.create(r);return c[r[0]="Normal"]=0,c[r[1]="Meeting"]=1,c[r[2]="Live"]=2,c[r[3]="Conference"]=3,c})(),T.QuitNotifyCode=(function(){const r={},c=Object.create(r);return c[r[0]="NormalQuit"]=0,c[r[2021]="Timeout"]=2021,c[r[2011]="TokenExpired"]=2011,c[r[2022]="KickOut"]=2022,c[r[2023]="EndPk"]=2023,c[r[2024]="EndLive"]=2024,c[r[2025]="ForceClear"]=2025,c})(),T.UserBehavior=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.type=0,r.prototype.behavior=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).int32(e.type),e.behavior!=null&&Object.hasOwnProperty.call(e,"behavior")&&t.uint32(16).bool(e.behavior),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.UserBehavior;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.type=e.int32();break}case 2:{I.behavior=e.bool();break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return e.behavior!=null&&e.hasOwnProperty("behavior")&&typeof e.behavior!="boolean"?"behavior: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UserBehavior)return e;let t=new $root.com.quick.voice.proto.UserBehavior;switch(e.type){default:if(typeof e.type=="number"){t.type=e.type;break}break;case"Microphone":case 0:t.type=0;break;case"Camera":case 1:t.type=1;break;case"Screen":case 2:t.type=2;break;case"SystemVoice":case 3:t.type=3;break}return e.behavior!=null&&(t.behavior=!!e.behavior),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.type=t.enums===String?"Microphone":0,i.behavior=!1),e.type!=null&&e.hasOwnProperty("type")&&(i.type=t.enums===String?$root.com.quick.voice.proto.TrackType[e.type]===void 0?e.type:$root.com.quick.voice.proto.TrackType[e.type]:e.type),e.behavior!=null&&e.hasOwnProperty("behavior")&&(i.behavior=e.behavior),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UserBehavior"},r})(),T.PreventUser=(function(){function r(c){if(this.behaviors=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.id="",r.prototype.behaviors=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.id!=null&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),e.behaviors!=null&&e.behaviors.length)for(let i=0;i<e.behaviors.length;++i)$root.com.quick.voice.proto.UserBehavior.encode(e.behaviors[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.PreventUser;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.id=e.string();break}case 2:{I.behaviors&&I.behaviors.length||(I.behaviors=[]),I.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(e,e.uint32()));break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.id!=null&&e.hasOwnProperty("id")&&!$util.isString(e.id))return"id: string expected";if(e.behaviors!=null&&e.hasOwnProperty("behaviors")){if(!Array.isArray(e.behaviors))return"behaviors: array expected";for(let t=0;t<e.behaviors.length;++t){let i=$root.com.quick.voice.proto.UserBehavior.verify(e.behaviors[t]);if(i)return"behaviors."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUser)return e;let t=new $root.com.quick.voice.proto.PreventUser;if(e.id!=null&&(t.id=String(e.id)),e.behaviors){if(!Array.isArray(e.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");t.behaviors=[];for(let i=0;i<e.behaviors.length;++i){if(typeof e.behaviors[i]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");t.behaviors[i]=$root.com.quick.voice.proto.UserBehavior.fromObject(e.behaviors[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.behaviors=[]),t.defaults&&(i.id=""),e.id!=null&&e.hasOwnProperty("id")&&(i.id=e.id),e.behaviors&&e.behaviors.length){i.behaviors=[];for(let _=0;_<e.behaviors.length;++_)i.behaviors[_]=$root.com.quick.voice.proto.UserBehavior.toObject(e.behaviors[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUser"},r})(),T.PreventUsersBehaviorReq=(function(){function r(c){if(this.users=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.users=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let i=0;i<e.users.length;++i)$root.com.quick.voice.proto.PreventUser.encode(e.users[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.roomId=e.string();break}case 2:{I.users&&I.users.length||(I.users=[]),I.users.push($root.com.quick.voice.proto.PreventUser.decode(e,e.uint32()));break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let t=0;t<e.users.length;++t){let i=$root.com.quick.voice.proto.PreventUser.verify(e.users[t]);if(i)return"users."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return e;let t=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");t.users=[];for(let i=0;i<e.users.length;++i){if(typeof e.users[i]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");t.users[i]=$root.com.quick.voice.proto.PreventUser.fromObject(e.users[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.users=[]),t.defaults&&(i.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.users&&e.users.length){i.users=[];for(let _=0;_<e.users.length;++_)i.users[_]=$root.com.quick.voice.proto.PreventUser.toObject(e.users[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUsersBehaviorReq"},r})(),T.PreventUsersBehaviorNotify=(function(){function r(c){if(this.users=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.users=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let i=0;i<e.users.length;++i)$root.com.quick.voice.proto.User.encode(e.users[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.roomId=e.string();break}case 2:{I.users&&I.users.length||(I.users=[]),I.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let t=0;t<e.users.length;++t){let i=$root.com.quick.voice.proto.User.verify(e.users[t]);if(i)return"users."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return e;let t=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");t.users=[];for(let i=0;i<e.users.length;++i){if(typeof e.users[i]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");t.users[i]=$root.com.quick.voice.proto.User.fromObject(e.users[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.users=[]),t.defaults&&(i.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.users&&e.users.length){i.users=[];for(let _=0;_<e.users.length;++_)i.users[_]=$root.com.quick.voice.proto.User.toObject(e.users[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},r})(),T.AccelerationAreas=(function(){const r={},c=Object.create(r);return c[r[0]="chinaMainland"]=0,c[r[1]="global"]=1,c[r[2]="overseas"]=2,c})(),T.CountMethods=(function(){const r={},c=Object.create(r);return c[r[0]="flow"]=0,c[r[1]="minutes"]=1,c})(),T.BaseCDNAddress=(function(){function r(c){if(this.urlMap={},c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.area=0,r.prototype.countType=0,r.prototype.urlMap=$util.emptyObject,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.area!=null&&Object.hasOwnProperty.call(e,"area")&&t.uint32(8).int32(e.area),e.countType!=null&&Object.hasOwnProperty.call(e,"countType")&&t.uint32(16).int32(e.countType),e.urlMap!=null&&Object.hasOwnProperty.call(e,"urlMap"))for(let i=Object.keys(e.urlMap),_=0;_<i.length;++_)t.uint32(26).fork().uint32(10).string(i[_]).uint32(18).string(e.urlMap[i[_]]).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.BaseCDNAddress,x,M;for(;e.pos<_;){let j=e.uint32();if(j===i)break;switch(j>>>3){case 1:{I.area=e.int32();break}case 2:{I.countType=e.int32();break}case 3:{I.urlMap===$util.emptyObject&&(I.urlMap={});let z=e.uint32()+e.pos;for(x="",M="";e.pos<z;){let Q=e.uint32();switch(Q>>>3){case 1:x=e.string();break;case 2:M=e.string();break;default:e.skipType(Q&7);break}}I.urlMap[x]=M;break}default:e.skipType(j&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.area!=null&&e.hasOwnProperty("area"))switch(e.area){default:return"area: enum value expected";case 0:case 1:case 2:break}if(e.countType!=null&&e.hasOwnProperty("countType"))switch(e.countType){default:return"countType: enum value expected";case 0:case 1:break}if(e.urlMap!=null&&e.hasOwnProperty("urlMap")){if(!$util.isObject(e.urlMap))return"urlMap: object expected";let t=Object.keys(e.urlMap);for(let i=0;i<t.length;++i)if(!$util.isString(e.urlMap[t[i]]))return"urlMap: string{k:string} expected"}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.BaseCDNAddress)return e;let t=new $root.com.quick.voice.proto.BaseCDNAddress;switch(e.area){default:if(typeof e.area=="number"){t.area=e.area;break}break;case"chinaMainland":case 0:t.area=0;break;case"global":case 1:t.area=1;break;case"overseas":case 2:t.area=2;break}switch(e.countType){default:if(typeof e.countType=="number"){t.countType=e.countType;break}break;case"flow":case 0:t.countType=0;break;case"minutes":case 1:t.countType=1;break}if(e.urlMap){if(typeof e.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");t.urlMap={};for(let i=Object.keys(e.urlMap),_=0;_<i.length;++_)t.urlMap[i[_]]=String(e.urlMap[i[_]])}return t},r.toObject=function(e,t){t||(t={});let i={};(t.objects||t.defaults)&&(i.urlMap={}),t.defaults&&(i.area=t.enums===String?"chinaMainland":0,i.countType=t.enums===String?"flow":0),e.area!=null&&e.hasOwnProperty("area")&&(i.area=t.enums===String?$root.com.quick.voice.proto.AccelerationAreas[e.area]===void 0?e.area:$root.com.quick.voice.proto.AccelerationAreas[e.area]:e.area),e.countType!=null&&e.hasOwnProperty("countType")&&(i.countType=t.enums===String?$root.com.quick.voice.proto.CountMethods[e.countType]===void 0?e.countType:$root.com.quick.voice.proto.CountMethods[e.countType]:e.countType);let _;if(e.urlMap&&(_=Object.keys(e.urlMap)).length){i.urlMap={};for(let I=0;I<_.length;++I)i.urlMap[_[I]]=e.urlMap[_[I]]}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.BaseCDNAddress"},r})(),T.CDNPlayAddressNotify=(function(){function r(e){if(this.standLines=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.m3u8=null,r.prototype.rtmp=null,r.prototype.flv=null,r.prototype.rtmps=null,r.prototype.mainLine=null,r.prototype.standLines=$util.emptyArray;let c;return Object.defineProperty(r.prototype,"_m3u8",{get:$util.oneOfGetter(c=["m3u8"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_rtmp",{get:$util.oneOfGetter(c=["rtmp"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_flv",{get:$util.oneOfGetter(c=["flv"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_rtmps",{get:$util.oneOfGetter(c=["rtmps"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_mainLine",{get:$util.oneOfGetter(c=["mainLine"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.m3u8!=null&&Object.hasOwnProperty.call(t,"m3u8")&&i.uint32(18).string(t.m3u8),t.rtmp!=null&&Object.hasOwnProperty.call(t,"rtmp")&&i.uint32(26).string(t.rtmp),t.flv!=null&&Object.hasOwnProperty.call(t,"flv")&&i.uint32(34).string(t.flv),t.rtmps!=null&&Object.hasOwnProperty.call(t,"rtmps")&&i.uint32(42).string(t.rtmps),t.mainLine!=null&&Object.hasOwnProperty.call(t,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(t.mainLine,i.uint32(50).fork()).ldelim(),t.standLines!=null&&t.standLines.length)for(let _=0;_<t.standLines.length;++_)$root.com.quick.voice.proto.BaseCDNAddress.encode(t.standLines[_],i.uint32(58).fork()).ldelim();return i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.roomId=t.string();break}case 2:{x.m3u8=t.string();break}case 3:{x.rtmp=t.string();break}case 4:{x.flv=t.string();break}case 5:{x.rtmps=t.string();break}case 6:{x.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(t,t.uint32());break}case 7:{x.standLines&&x.standLines.length||(x.standLines=[]),x.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(t,t.uint32()));break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.m3u8!=null&&t.hasOwnProperty("m3u8")&&!$util.isString(t.m3u8))return"m3u8: string expected";if(t.rtmp!=null&&t.hasOwnProperty("rtmp")&&!$util.isString(t.rtmp))return"rtmp: string expected";if(t.flv!=null&&t.hasOwnProperty("flv")&&!$util.isString(t.flv))return"flv: string expected";if(t.rtmps!=null&&t.hasOwnProperty("rtmps")&&!$util.isString(t.rtmps))return"rtmps: string expected";if(t.mainLine!=null&&t.hasOwnProperty("mainLine")){let i=$root.com.quick.voice.proto.BaseCDNAddress.verify(t.mainLine);if(i)return"mainLine."+i}if(t.standLines!=null&&t.hasOwnProperty("standLines")){if(!Array.isArray(t.standLines))return"standLines: array expected";for(let i=0;i<t.standLines.length;++i){let _=$root.com.quick.voice.proto.BaseCDNAddress.verify(t.standLines[i]);if(_)return"standLines."+_}}return null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return t;let i=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(t.roomId!=null&&(i.roomId=String(t.roomId)),t.m3u8!=null&&(i.m3u8=String(t.m3u8)),t.rtmp!=null&&(i.rtmp=String(t.rtmp)),t.flv!=null&&(i.flv=String(t.flv)),t.rtmps!=null&&(i.rtmps=String(t.rtmps)),t.mainLine!=null){if(typeof t.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");i.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(t.mainLine)}if(t.standLines){if(!Array.isArray(t.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");i.standLines=[];for(let _=0;_<t.standLines.length;++_){if(typeof t.standLines[_]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");i.standLines[_]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(t.standLines[_])}}return i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.standLines=[]),i.defaults&&(_.roomId=""),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.m3u8!=null&&t.hasOwnProperty("m3u8")&&(_.m3u8=t.m3u8,i.oneofs&&(_._m3u8="m3u8")),t.rtmp!=null&&t.hasOwnProperty("rtmp")&&(_.rtmp=t.rtmp,i.oneofs&&(_._rtmp="rtmp")),t.flv!=null&&t.hasOwnProperty("flv")&&(_.flv=t.flv,i.oneofs&&(_._flv="flv")),t.rtmps!=null&&t.hasOwnProperty("rtmps")&&(_.rtmps=t.rtmps,i.oneofs&&(_._rtmps="rtmps")),t.mainLine!=null&&t.hasOwnProperty("mainLine")&&(_.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(t.mainLine,i),i.oneofs&&(_._mainLine="mainLine")),t.standLines&&t.standLines.length){_.standLines=[];for(let I=0;I<t.standLines.length;++I)_.standLines[I]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(t.standLines[I],i)}return _},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.CDNPlayAddressNotify"},r})(),T.UserChannel=(function(){function r(c){if(this.channels=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.userId="",r.prototype.channels=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),e.channels!=null&&e.channels.length)for(let i=0;i<e.channels.length;++i)$root.com.quick.voice.proto.DataChannel.encode(e.channels[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.UserChannel;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.userId=e.string();break}case 2:{I.channels&&I.channels.length||(I.channels=[]),I.channels.push($root.com.quick.voice.proto.DataChannel.decode(e,e.uint32()));break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId))return"userId: string expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let t=0;t<e.channels.length;++t){let i=$root.com.quick.voice.proto.DataChannel.verify(e.channels[t]);if(i)return"channels."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UserChannel)return e;let t=new $root.com.quick.voice.proto.UserChannel;if(e.userId!=null&&(t.userId=String(e.userId)),e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.UserChannel.channels: array expected");t.channels=[];for(let i=0;i<e.channels.length;++i){if(typeof e.channels[i]!="object")throw TypeError(".com.quick.voice.proto.UserChannel.channels: object expected");t.channels[i]=$root.com.quick.voice.proto.DataChannel.fromObject(e.channels[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.channels=[]),t.defaults&&(i.userId=""),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.channels&&e.channels.length){i.channels=[];for(let _=0;_<e.channels.length;++_)i.channels[_]=$root.com.quick.voice.proto.DataChannel.toObject(e.channels[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UserChannel"},r})(),T.ChannelPublishReq=(function(){function r(c){if(this.channels=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.channels=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.channels!=null&&e.channels.length)for(let i=0;i<e.channels.length;++i)$root.com.quick.voice.proto.DataChannel.encode(e.channels[i],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.ChannelPublishReq;for(;e.pos<_;){let x=e.uint32();if(x===i)break;x>>>3===1?(I.channels&&I.channels.length||(I.channels=[]),I.channels.push($root.com.quick.voice.proto.DataChannel.decode(e,e.uint32()))):e.skipType(x&7)}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let t=0;t<e.channels.length;++t){let i=$root.com.quick.voice.proto.DataChannel.verify(e.channels[t]);if(i)return"channels."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ChannelPublishReq)return e;let t=new $root.com.quick.voice.proto.ChannelPublishReq;if(e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: array expected");t.channels=[];for(let i=0;i<e.channels.length;++i){if(typeof e.channels[i]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: object expected");t.channels[i]=$root.com.quick.voice.proto.DataChannel.fromObject(e.channels[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.channels=[]),e.channels&&e.channels.length){i.channels=[];for(let _=0;_<e.channels.length;++_)i.channels[_]=$root.com.quick.voice.proto.DataChannel.toObject(e.channels[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ChannelPublishReq"},r})(),T.ChannelPublishRsq=(function(){function r(c){if(this.channels=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.channels=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.channels!=null&&e.channels.length)for(let i=0;i<e.channels.length;++i)$root.com.quick.voice.proto.UserChannel.encode(e.channels[i],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.ChannelPublishRsq;for(;e.pos<_;){let x=e.uint32();if(x===i)break;x>>>3===1?(I.channels&&I.channels.length||(I.channels=[]),I.channels.push($root.com.quick.voice.proto.UserChannel.decode(e,e.uint32()))):e.skipType(x&7)}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let t=0;t<e.channels.length;++t){let i=$root.com.quick.voice.proto.UserChannel.verify(e.channels[t]);if(i)return"channels."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ChannelPublishRsq)return e;let t=new $root.com.quick.voice.proto.ChannelPublishRsq;if(e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: array expected");t.channels=[];for(let i=0;i<e.channels.length;++i){if(typeof e.channels[i]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: object expected");t.channels[i]=$root.com.quick.voice.proto.UserChannel.fromObject(e.channels[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.channels=[]),e.channels&&e.channels.length){i.channels=[];for(let _=0;_<e.channels.length;++_)i.channels[_]=$root.com.quick.voice.proto.UserChannel.toObject(e.channels[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ChannelPublishRsq"},r})(),T.ChannelSubscribeReq=(function(){function r(c){if(this.users=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.users=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.users!=null&&e.users.length)for(let i=0;i<e.users.length;++i)$root.com.quick.voice.proto.UserChannel.encode(e.users[i],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.ChannelSubscribeReq;for(;e.pos<_;){let x=e.uint32();if(x===i)break;x>>>3===1?(I.users&&I.users.length||(I.users=[]),I.users.push($root.com.quick.voice.proto.UserChannel.decode(e,e.uint32()))):e.skipType(x&7)}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let t=0;t<e.users.length;++t){let i=$root.com.quick.voice.proto.UserChannel.verify(e.users[t]);if(i)return"users."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ChannelSubscribeReq)return e;let t=new $root.com.quick.voice.proto.ChannelSubscribeReq;if(e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: array expected");t.users=[];for(let i=0;i<e.users.length;++i){if(typeof e.users[i]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: object expected");t.users[i]=$root.com.quick.voice.proto.UserChannel.fromObject(e.users[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.users=[]),e.users&&e.users.length){i.users=[];for(let _=0;_<e.users.length;++_)i.users[_]=$root.com.quick.voice.proto.UserChannel.toObject(e.users[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ChannelSubscribeReq"},r})(),T.ChannelSubscribeRsq=(function(){function r(c){if(this.channels=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.channels=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.channels!=null&&e.channels.length)for(let i=0;i<e.channels.length;++i)$root.com.quick.voice.proto.UserChannel.encode(e.channels[i],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.ChannelSubscribeRsq;for(;e.pos<_;){let x=e.uint32();if(x===i)break;x>>>3===1?(I.channels&&I.channels.length||(I.channels=[]),I.channels.push($root.com.quick.voice.proto.UserChannel.decode(e,e.uint32()))):e.skipType(x&7)}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let t=0;t<e.channels.length;++t){let i=$root.com.quick.voice.proto.UserChannel.verify(e.channels[t]);if(i)return"channels."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ChannelSubscribeRsq)return e;let t=new $root.com.quick.voice.proto.ChannelSubscribeRsq;if(e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: array expected");t.channels=[];for(let i=0;i<e.channels.length;++i){if(typeof e.channels[i]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: object expected");t.channels[i]=$root.com.quick.voice.proto.UserChannel.fromObject(e.channels[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.channels=[]),e.channels&&e.channels.length){i.channels=[];for(let _=0;_<e.channels.length;++_)i.channels[_]=$root.com.quick.voice.proto.UserChannel.toObject(e.channels[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ChannelSubscribeRsq"},r})(),T.DataChannelData=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.userId="",r.prototype.type=0,r.prototype.audioData=null;let c;return Object.defineProperty(r.prototype,"_audioData",{get:$util.oneOfGetter(c=["audioData"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.userId!=null&&Object.hasOwnProperty.call(t,"userId")&&i.uint32(10).string(t.userId),t.type!=null&&Object.hasOwnProperty.call(t,"type")&&i.uint32(16).int32(t.type),t.audioData!=null&&Object.hasOwnProperty.call(t,"audioData")&&$root.com.quick.voice.proto.DataChannelAudioData.encode(t.audioData,i.uint32(26).fork()).ldelim(),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.DataChannelData;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.userId=t.string();break}case 2:{x.type=t.int32();break}case 3:{x.audioData=$root.com.quick.voice.proto.DataChannelAudioData.decode(t,t.uint32());break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.userId!=null&&t.hasOwnProperty("userId")&&!$util.isString(t.userId))return"userId: string expected";if(t.type!=null&&t.hasOwnProperty("type")&&t.type!==0)return"type: enum value expected";if(t.audioData!=null&&t.hasOwnProperty("audioData")){let i=$root.com.quick.voice.proto.DataChannelAudioData.verify(t.audioData);if(i)return"audioData."+i}return null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.DataChannelData)return t;let i=new $root.com.quick.voice.proto.DataChannelData;switch(t.userId!=null&&(i.userId=String(t.userId)),t.type){default:if(typeof t.type=="number"){i.type=t.type;break}break;case"backAuido":case 0:i.type=0;break}if(t.audioData!=null){if(typeof t.audioData!="object")throw TypeError(".com.quick.voice.proto.DataChannelData.audioData: object expected");i.audioData=$root.com.quick.voice.proto.DataChannelAudioData.fromObject(t.audioData)}return i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.userId="",_.type=i.enums===String?"backAuido":0),t.userId!=null&&t.hasOwnProperty("userId")&&(_.userId=t.userId),t.type!=null&&t.hasOwnProperty("type")&&(_.type=i.enums===String?$root.com.quick.voice.proto.DataChannelType[t.type]===void 0?t.type:$root.com.quick.voice.proto.DataChannelType[t.type]:t.type),t.audioData!=null&&t.hasOwnProperty("audioData")&&(_.audioData=$root.com.quick.voice.proto.DataChannelAudioData.toObject(t.audioData,i),i.oneofs&&(_._audioData="audioData")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.DataChannelData"},r})(),T.DataChannelType=(function(){const r={},c=Object.create(r);return c[r[0]="backAuido"]=0,c})(),T.DataChannelAudioData=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.data=$util.newBuffer([]),r.prototype.format=null,r.prototype.time=null;let c;return Object.defineProperty(r.prototype,"_time",{get:$util.oneOfGetter(c=["time"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.data!=null&&Object.hasOwnProperty.call(t,"data")&&i.uint32(10).bytes(t.data),t.format!=null&&Object.hasOwnProperty.call(t,"format")&&$root.com.quick.voice.proto.DataChannelAudioFormat.encode(t.format,i.uint32(18).fork()).ldelim(),t.time!=null&&Object.hasOwnProperty.call(t,"time")&&i.uint32(24).int64(t.time),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.DataChannelAudioData;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.data=t.bytes();break}case 2:{x.format=$root.com.quick.voice.proto.DataChannelAudioFormat.decode(t,t.uint32());break}case 3:{x.time=t.int64();break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.data!=null&&t.hasOwnProperty("data")&&!(t.data&&typeof t.data.length=="number"||$util.isString(t.data)))return"data: buffer expected";if(t.format!=null&&t.hasOwnProperty("format")){let i=$root.com.quick.voice.proto.DataChannelAudioFormat.verify(t.format);if(i)return"format."+i}return t.time!=null&&t.hasOwnProperty("time")&&!$util.isInteger(t.time)&&!(t.time&&$util.isInteger(t.time.low)&&$util.isInteger(t.time.high))?"time: integer|Long expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.DataChannelAudioData)return t;let i=new $root.com.quick.voice.proto.DataChannelAudioData;if(t.data!=null&&(typeof t.data=="string"?$util.base64.decode(t.data,i.data=$util.newBuffer($util.base64.length(t.data)),0):t.data.length>=0&&(i.data=t.data)),t.format!=null){if(typeof t.format!="object")throw TypeError(".com.quick.voice.proto.DataChannelAudioData.format: object expected");i.format=$root.com.quick.voice.proto.DataChannelAudioFormat.fromObject(t.format)}return t.time!=null&&($util.Long?(i.time=$util.Long.fromValue(t.time)).unsigned=!1:typeof t.time=="string"?i.time=parseInt(t.time,10):typeof t.time=="number"?i.time=t.time:typeof t.time=="object"&&(i.time=new $util.LongBits(t.time.low>>>0,t.time.high>>>0).toNumber())),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(i.bytes===String?_.data="":(_.data=[],i.bytes!==Array&&(_.data=$util.newBuffer(_.data))),_.format=null),t.data!=null&&t.hasOwnProperty("data")&&(_.data=i.bytes===String?$util.base64.encode(t.data,0,t.data.length):i.bytes===Array?Array.prototype.slice.call(t.data):t.data),t.format!=null&&t.hasOwnProperty("format")&&(_.format=$root.com.quick.voice.proto.DataChannelAudioFormat.toObject(t.format,i)),t.time!=null&&t.hasOwnProperty("time")&&(typeof t.time=="number"?_.time=i.longs===String?String(t.time):t.time:_.time=i.longs===String?$util.Long.prototype.toString.call(t.time):i.longs===Number?new $util.LongBits(t.time.low>>>0,t.time.high>>>0).toNumber():t.time,i.oneofs&&(_._time="time")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.DataChannelAudioData"},r})(),T.DataChannelAudioFormat=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.sampleRate=0,r.prototype.channels=0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.sampleRate!=null&&Object.hasOwnProperty.call(e,"sampleRate")&&t.uint32(9).double(e.sampleRate),e.channels!=null&&Object.hasOwnProperty.call(e,"channels")&&t.uint32(16).int32(e.channels),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.DataChannelAudioFormat;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.sampleRate=e.double();break}case 2:{I.channels=e.int32();break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.sampleRate!=null&&e.hasOwnProperty("sampleRate")&&typeof e.sampleRate!="number"?"sampleRate: number expected":e.channels!=null&&e.hasOwnProperty("channels")&&!$util.isInteger(e.channels)?"channels: integer expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.DataChannelAudioFormat)return e;let t=new $root.com.quick.voice.proto.DataChannelAudioFormat;return e.sampleRate!=null&&(t.sampleRate=Number(e.sampleRate)),e.channels!=null&&(t.channels=e.channels|0),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.sampleRate=0,i.channels=0),e.sampleRate!=null&&e.hasOwnProperty("sampleRate")&&(i.sampleRate=t.json&&!isFinite(e.sampleRate)?String(e.sampleRate):e.sampleRate),e.channels!=null&&e.hasOwnProperty("channels")&&(i.channels=e.channels),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.DataChannelAudioFormat"},r})(),T.AckMsgReq=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.msgId=$util.Long?$util.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.msgId!=null&&Object.hasOwnProperty.call(e,"msgId")&&t.uint32(8).int64(e.msgId),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.AckMsgReq;for(;e.pos<_;){let x=e.uint32();if(x===i)break;x>>>3===1?I.msgId=e.int64():e.skipType(x&7)}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.msgId!=null&&e.hasOwnProperty("msgId")&&!$util.isInteger(e.msgId)&&!(e.msgId&&$util.isInteger(e.msgId.low)&&$util.isInteger(e.msgId.high))?"msgId: integer|Long expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.AckMsgReq)return e;let t=new $root.com.quick.voice.proto.AckMsgReq;return e.msgId!=null&&($util.Long?(t.msgId=$util.Long.fromValue(e.msgId)).unsigned=!1:typeof e.msgId=="string"?t.msgId=parseInt(e.msgId,10):typeof e.msgId=="number"?t.msgId=e.msgId:typeof e.msgId=="object"&&(t.msgId=new $util.LongBits(e.msgId.low>>>0,e.msgId.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});let i={};if(t.defaults)if($util.Long){let _=new $util.Long(0,0,!1);i.msgId=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.msgId=t.longs===String?"0":0;return e.msgId!=null&&e.hasOwnProperty("msgId")&&(typeof e.msgId=="number"?i.msgId=t.longs===String?String(e.msgId):e.msgId:i.msgId=t.longs===String?$util.Long.prototype.toString.call(e.msgId):t.longs===Number?new $util.LongBits(e.msgId.low>>>0,e.msgId.high>>>0).toNumber():e.msgId),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.AckMsgReq"},r})(),T.SdpConsult=(function(){function r(e){if(this.tracks=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.sender=null,r.prototype.receiverId="",r.prototype.sdp="",r.prototype.tracks=$util.emptyArray;let c;return Object.defineProperty(r.prototype,"_sender",{get:$util.oneOfGetter(c=["sender"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.sender!=null&&Object.hasOwnProperty.call(t,"sender")&&$root.com.quick.voice.proto.User.encode(t.sender,i.uint32(18).fork()).ldelim(),t.receiverId!=null&&Object.hasOwnProperty.call(t,"receiverId")&&i.uint32(26).string(t.receiverId),t.sdp!=null&&Object.hasOwnProperty.call(t,"sdp")&&i.uint32(34).string(t.sdp),t.tracks!=null&&t.tracks.length)for(let _=0;_<t.tracks.length;++_)$root.com.quick.voice.proto.Track.encode(t.tracks[_],i.uint32(42).fork()).ldelim();return i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.SdpConsult;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.roomId=t.string();break}case 2:{x.sender=$root.com.quick.voice.proto.User.decode(t,t.uint32());break}case 3:{x.receiverId=t.string();break}case 4:{x.sdp=t.string();break}case 5:{x.tracks&&x.tracks.length||(x.tracks=[]),x.tracks.push($root.com.quick.voice.proto.Track.decode(t,t.uint32()));break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.sender!=null&&t.hasOwnProperty("sender")){let i=$root.com.quick.voice.proto.User.verify(t.sender);if(i)return"sender."+i}if(t.receiverId!=null&&t.hasOwnProperty("receiverId")&&!$util.isString(t.receiverId))return"receiverId: string expected";if(t.sdp!=null&&t.hasOwnProperty("sdp")&&!$util.isString(t.sdp))return"sdp: string expected";if(t.tracks!=null&&t.hasOwnProperty("tracks")){if(!Array.isArray(t.tracks))return"tracks: array expected";for(let i=0;i<t.tracks.length;++i){let _=$root.com.quick.voice.proto.Track.verify(t.tracks[i]);if(_)return"tracks."+_}}return null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.SdpConsult)return t;let i=new $root.com.quick.voice.proto.SdpConsult;if(t.roomId!=null&&(i.roomId=String(t.roomId)),t.sender!=null){if(typeof t.sender!="object")throw TypeError(".com.quick.voice.proto.SdpConsult.sender: object expected");i.sender=$root.com.quick.voice.proto.User.fromObject(t.sender)}if(t.receiverId!=null&&(i.receiverId=String(t.receiverId)),t.sdp!=null&&(i.sdp=String(t.sdp)),t.tracks){if(!Array.isArray(t.tracks))throw TypeError(".com.quick.voice.proto.SdpConsult.tracks: array expected");i.tracks=[];for(let _=0;_<t.tracks.length;++_){if(typeof t.tracks[_]!="object")throw TypeError(".com.quick.voice.proto.SdpConsult.tracks: object expected");i.tracks[_]=$root.com.quick.voice.proto.Track.fromObject(t.tracks[_])}}return i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.tracks=[]),i.defaults&&(_.roomId="",_.receiverId="",_.sdp=""),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.sender!=null&&t.hasOwnProperty("sender")&&(_.sender=$root.com.quick.voice.proto.User.toObject(t.sender,i),i.oneofs&&(_._sender="sender")),t.receiverId!=null&&t.hasOwnProperty("receiverId")&&(_.receiverId=t.receiverId),t.sdp!=null&&t.hasOwnProperty("sdp")&&(_.sdp=t.sdp),t.tracks&&t.tracks.length){_.tracks=[];for(let I=0;I<t.tracks.length;++I)_.tracks[I]=$root.com.quick.voice.proto.Track.toObject(t.tracks[I],i)}return _},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.SdpConsult"},r})(),T.Candidate=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.sdpMid="",r.prototype.sdpMLineIndex=0,r.prototype.sdp="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.sdpMid!=null&&Object.hasOwnProperty.call(e,"sdpMid")&&t.uint32(10).string(e.sdpMid),e.sdpMLineIndex!=null&&Object.hasOwnProperty.call(e,"sdpMLineIndex")&&t.uint32(16).int32(e.sdpMLineIndex),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&t.uint32(26).string(e.sdp),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.Candidate;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.sdpMid=e.string();break}case 2:{I.sdpMLineIndex=e.int32();break}case 3:{I.sdp=e.string();break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.sdpMid!=null&&e.hasOwnProperty("sdpMid")&&!$util.isString(e.sdpMid)?"sdpMid: string expected":e.sdpMLineIndex!=null&&e.hasOwnProperty("sdpMLineIndex")&&!$util.isInteger(e.sdpMLineIndex)?"sdpMLineIndex: integer expected":e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp)?"sdp: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.Candidate)return e;let t=new $root.com.quick.voice.proto.Candidate;return e.sdpMid!=null&&(t.sdpMid=String(e.sdpMid)),e.sdpMLineIndex!=null&&(t.sdpMLineIndex=e.sdpMLineIndex|0),e.sdp!=null&&(t.sdp=String(e.sdp)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.sdpMid="",i.sdpMLineIndex=0,i.sdp=""),e.sdpMid!=null&&e.hasOwnProperty("sdpMid")&&(i.sdpMid=e.sdpMid),e.sdpMLineIndex!=null&&e.hasOwnProperty("sdpMLineIndex")&&(i.sdpMLineIndex=e.sdpMLineIndex),e.sdp!=null&&e.hasOwnProperty("sdp")&&(i.sdp=e.sdp),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.Candidate"},r})(),T.Candidates=(function(){function r(c){if(this.candidates=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.senderId="",r.prototype.receiverId="",r.prototype.candidates=$util.emptyArray,r.prototype.isSubscribeReceiver=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.senderId!=null&&Object.hasOwnProperty.call(e,"senderId")&&t.uint32(18).string(e.senderId),e.receiverId!=null&&Object.hasOwnProperty.call(e,"receiverId")&&t.uint32(26).string(e.receiverId),e.candidates!=null&&e.candidates.length)for(let i=0;i<e.candidates.length;++i)$root.com.quick.voice.proto.Candidate.encode(e.candidates[i],t.uint32(34).fork()).ldelim();return e.isSubscribeReceiver!=null&&Object.hasOwnProperty.call(e,"isSubscribeReceiver")&&t.uint32(40).bool(e.isSubscribeReceiver),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.Candidates;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.roomId=e.string();break}case 2:{I.senderId=e.string();break}case 3:{I.receiverId=e.string();break}case 4:{I.candidates&&I.candidates.length||(I.candidates=[]),I.candidates.push($root.com.quick.voice.proto.Candidate.decode(e,e.uint32()));break}case 5:{I.isSubscribeReceiver=e.bool();break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.senderId!=null&&e.hasOwnProperty("senderId")&&!$util.isString(e.senderId))return"senderId: string expected";if(e.receiverId!=null&&e.hasOwnProperty("receiverId")&&!$util.isString(e.receiverId))return"receiverId: string expected";if(e.candidates!=null&&e.hasOwnProperty("candidates")){if(!Array.isArray(e.candidates))return"candidates: array expected";for(let t=0;t<e.candidates.length;++t){let i=$root.com.quick.voice.proto.Candidate.verify(e.candidates[t]);if(i)return"candidates."+i}}return e.isSubscribeReceiver!=null&&e.hasOwnProperty("isSubscribeReceiver")&&typeof e.isSubscribeReceiver!="boolean"?"isSubscribeReceiver: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.Candidates)return e;let t=new $root.com.quick.voice.proto.Candidates;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.senderId!=null&&(t.senderId=String(e.senderId)),e.receiverId!=null&&(t.receiverId=String(e.receiverId)),e.candidates){if(!Array.isArray(e.candidates))throw TypeError(".com.quick.voice.proto.Candidates.candidates: array expected");t.candidates=[];for(let i=0;i<e.candidates.length;++i){if(typeof e.candidates[i]!="object")throw TypeError(".com.quick.voice.proto.Candidates.candidates: object expected");t.candidates[i]=$root.com.quick.voice.proto.Candidate.fromObject(e.candidates[i])}}return e.isSubscribeReceiver!=null&&(t.isSubscribeReceiver=!!e.isSubscribeReceiver),t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.candidates=[]),t.defaults&&(i.roomId="",i.senderId="",i.receiverId="",i.isSubscribeReceiver=!1),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.senderId!=null&&e.hasOwnProperty("senderId")&&(i.senderId=e.senderId),e.receiverId!=null&&e.hasOwnProperty("receiverId")&&(i.receiverId=e.receiverId),e.candidates&&e.candidates.length){i.candidates=[];for(let _=0;_<e.candidates.length;++_)i.candidates[_]=$root.com.quick.voice.proto.Candidate.toObject(e.candidates[_],t)}return e.isSubscribeReceiver!=null&&e.hasOwnProperty("isSubscribeReceiver")&&(i.isSubscribeReceiver=e.isSubscribeReceiver),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.Candidates"},r})(),T.NatType=(function(){const r={},c=Object.create(r);return c[r[0]="Symmetric"]=0,c[r[1]="Cone"]=1,c[r[2]="Port"]=2,c[r[3]="IP"]=3,c[r[4]="UnKnown"]=4,c})(),T.NetworkType=(function(){const r={},c=Object.create(r);return c[r[0]="Wifi"]=0,c[r[1]="Wired"]=1,c[r[2]="Mobile"]=2,c})(),T.ReportNetInfo=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.nat=0,r.prototype.type=0,r.prototype.ip="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.nat!=null&&Object.hasOwnProperty.call(e,"nat")&&t.uint32(8).int32(e.nat),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&t.uint32(16).int32(e.type),e.ip!=null&&Object.hasOwnProperty.call(e,"ip")&&t.uint32(26).string(e.ip),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.ReportNetInfo;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.nat=e.int32();break}case 2:{I.type=e.int32();break}case 3:{I.ip=e.string();break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.nat!=null&&e.hasOwnProperty("nat"))switch(e.nat){default:return"nat: enum value expected";case 0:case 1:case 2:case 3:case 4:break}if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:break}return e.ip!=null&&e.hasOwnProperty("ip")&&!$util.isString(e.ip)?"ip: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ReportNetInfo)return e;let t=new $root.com.quick.voice.proto.ReportNetInfo;switch(e.nat){default:if(typeof e.nat=="number"){t.nat=e.nat;break}break;case"Symmetric":case 0:t.nat=0;break;case"Cone":case 1:t.nat=1;break;case"Port":case 2:t.nat=2;break;case"IP":case 3:t.nat=3;break;case"UnKnown":case 4:t.nat=4;break}switch(e.type){default:if(typeof e.type=="number"){t.type=e.type;break}break;case"Wifi":case 0:t.type=0;break;case"Wired":case 1:t.type=1;break;case"Mobile":case 2:t.type=2;break}return e.ip!=null&&(t.ip=String(e.ip)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.nat=t.enums===String?"Symmetric":0,i.type=t.enums===String?"Wifi":0,i.ip=""),e.nat!=null&&e.hasOwnProperty("nat")&&(i.nat=t.enums===String?$root.com.quick.voice.proto.NatType[e.nat]===void 0?e.nat:$root.com.quick.voice.proto.NatType[e.nat]:e.nat),e.type!=null&&e.hasOwnProperty("type")&&(i.type=t.enums===String?$root.com.quick.voice.proto.NetworkType[e.type]===void 0?e.type:$root.com.quick.voice.proto.NetworkType[e.type]:e.type),e.ip!=null&&e.hasOwnProperty("ip")&&(i.ip=e.ip),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ReportNetInfo"},r})(),T.P2PCode=(function(){const r={},c=Object.create(r);return c[r[0]="Success"]=0,c[r[1]="Failed"]=1,c[r[2]="Ignore"]=2,c[r[3]="Disconnected"]=3,c[r[4]="LowQuality"]=4,c})(),T.ReportTrafficUsage=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.p2pPush=null,r.prototype.p2pPull=null,r.prototype.sfuPush=null,r.prototype.sfuPull=null;let c;return Object.defineProperty(r.prototype,"_p2pPush",{get:$util.oneOfGetter(c=["p2pPush"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_p2pPull",{get:$util.oneOfGetter(c=["p2pPull"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_sfuPush",{get:$util.oneOfGetter(c=["sfuPush"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_sfuPull",{get:$util.oneOfGetter(c=["sfuPull"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.p2pPush!=null&&Object.hasOwnProperty.call(t,"p2pPush")&&i.uint32(8).int64(t.p2pPush),t.p2pPull!=null&&Object.hasOwnProperty.call(t,"p2pPull")&&i.uint32(16).int64(t.p2pPull),t.sfuPush!=null&&Object.hasOwnProperty.call(t,"sfuPush")&&i.uint32(24).int64(t.sfuPush),t.sfuPull!=null&&Object.hasOwnProperty.call(t,"sfuPull")&&i.uint32(32).int64(t.sfuPull),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.ReportTrafficUsage;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.p2pPush=t.int64();break}case 2:{x.p2pPull=t.int64();break}case 3:{x.sfuPush=t.int64();break}case 4:{x.sfuPull=t.int64();break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){return typeof t!="object"||t===null?"object expected":t.p2pPush!=null&&t.hasOwnProperty("p2pPush")&&!$util.isInteger(t.p2pPush)&&!(t.p2pPush&&$util.isInteger(t.p2pPush.low)&&$util.isInteger(t.p2pPush.high))?"p2pPush: integer|Long expected":t.p2pPull!=null&&t.hasOwnProperty("p2pPull")&&!$util.isInteger(t.p2pPull)&&!(t.p2pPull&&$util.isInteger(t.p2pPull.low)&&$util.isInteger(t.p2pPull.high))?"p2pPull: integer|Long expected":t.sfuPush!=null&&t.hasOwnProperty("sfuPush")&&!$util.isInteger(t.sfuPush)&&!(t.sfuPush&&$util.isInteger(t.sfuPush.low)&&$util.isInteger(t.sfuPush.high))?"sfuPush: integer|Long expected":t.sfuPull!=null&&t.hasOwnProperty("sfuPull")&&!$util.isInteger(t.sfuPull)&&!(t.sfuPull&&$util.isInteger(t.sfuPull.low)&&$util.isInteger(t.sfuPull.high))?"sfuPull: integer|Long expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.ReportTrafficUsage)return t;let i=new $root.com.quick.voice.proto.ReportTrafficUsage;return t.p2pPush!=null&&($util.Long?(i.p2pPush=$util.Long.fromValue(t.p2pPush)).unsigned=!1:typeof t.p2pPush=="string"?i.p2pPush=parseInt(t.p2pPush,10):typeof t.p2pPush=="number"?i.p2pPush=t.p2pPush:typeof t.p2pPush=="object"&&(i.p2pPush=new $util.LongBits(t.p2pPush.low>>>0,t.p2pPush.high>>>0).toNumber())),t.p2pPull!=null&&($util.Long?(i.p2pPull=$util.Long.fromValue(t.p2pPull)).unsigned=!1:typeof t.p2pPull=="string"?i.p2pPull=parseInt(t.p2pPull,10):typeof t.p2pPull=="number"?i.p2pPull=t.p2pPull:typeof t.p2pPull=="object"&&(i.p2pPull=new $util.LongBits(t.p2pPull.low>>>0,t.p2pPull.high>>>0).toNumber())),t.sfuPush!=null&&($util.Long?(i.sfuPush=$util.Long.fromValue(t.sfuPush)).unsigned=!1:typeof t.sfuPush=="string"?i.sfuPush=parseInt(t.sfuPush,10):typeof t.sfuPush=="number"?i.sfuPush=t.sfuPush:typeof t.sfuPush=="object"&&(i.sfuPush=new $util.LongBits(t.sfuPush.low>>>0,t.sfuPush.high>>>0).toNumber())),t.sfuPull!=null&&($util.Long?(i.sfuPull=$util.Long.fromValue(t.sfuPull)).unsigned=!1:typeof t.sfuPull=="string"?i.sfuPull=parseInt(t.sfuPull,10):typeof t.sfuPull=="number"?i.sfuPull=t.sfuPull:typeof t.sfuPull=="object"&&(i.sfuPull=new $util.LongBits(t.sfuPull.low>>>0,t.sfuPull.high>>>0).toNumber())),i},r.toObject=function(t,i){i||(i={});let _={};return t.p2pPush!=null&&t.hasOwnProperty("p2pPush")&&(typeof t.p2pPush=="number"?_.p2pPush=i.longs===String?String(t.p2pPush):t.p2pPush:_.p2pPush=i.longs===String?$util.Long.prototype.toString.call(t.p2pPush):i.longs===Number?new $util.LongBits(t.p2pPush.low>>>0,t.p2pPush.high>>>0).toNumber():t.p2pPush,i.oneofs&&(_._p2pPush="p2pPush")),t.p2pPull!=null&&t.hasOwnProperty("p2pPull")&&(typeof t.p2pPull=="number"?_.p2pPull=i.longs===String?String(t.p2pPull):t.p2pPull:_.p2pPull=i.longs===String?$util.Long.prototype.toString.call(t.p2pPull):i.longs===Number?new $util.LongBits(t.p2pPull.low>>>0,t.p2pPull.high>>>0).toNumber():t.p2pPull,i.oneofs&&(_._p2pPull="p2pPull")),t.sfuPush!=null&&t.hasOwnProperty("sfuPush")&&(typeof t.sfuPush=="number"?_.sfuPush=i.longs===String?String(t.sfuPush):t.sfuPush:_.sfuPush=i.longs===String?$util.Long.prototype.toString.call(t.sfuPush):i.longs===Number?new $util.LongBits(t.sfuPush.low>>>0,t.sfuPush.high>>>0).toNumber():t.sfuPush,i.oneofs&&(_._sfuPush="sfuPush")),t.sfuPull!=null&&t.hasOwnProperty("sfuPull")&&(typeof t.sfuPull=="number"?_.sfuPull=i.longs===String?String(t.sfuPull):t.sfuPull:_.sfuPull=i.longs===String?$util.Long.prototype.toString.call(t.sfuPull):i.longs===Number?new $util.LongBits(t.sfuPull.low>>>0,t.sfuPull.high>>>0).toNumber():t.sfuPull,i.oneofs&&(_._sfuPull="sfuPull")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.ReportTrafficUsage"},r})(),T.CheckSessionReq=(function(){function r(c){if(this.tracks=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.session="",r.prototype.tracks=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.session!=null&&Object.hasOwnProperty.call(e,"session")&&t.uint32(10).string(e.session),e.tracks!=null&&e.tracks.length)for(let i=0;i<e.tracks.length;++i)$root.com.quick.voice.proto.Track.encode(e.tracks[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.CheckSessionReq;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.session=e.string();break}case 2:{I.tracks&&I.tracks.length||(I.tracks=[]),I.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.session!=null&&e.hasOwnProperty("session")&&!$util.isString(e.session))return"session: string expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let t=0;t<e.tracks.length;++t){let i=$root.com.quick.voice.proto.Track.verify(e.tracks[t]);if(i)return"tracks."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CheckSessionReq)return e;let t=new $root.com.quick.voice.proto.CheckSessionReq;if(e.session!=null&&(t.session=String(e.session)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CheckSessionReq.tracks: array expected");t.tracks=[];for(let i=0;i<e.tracks.length;++i){if(typeof e.tracks[i]!="object")throw TypeError(".com.quick.voice.proto.CheckSessionReq.tracks: object expected");t.tracks[i]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.tracks=[]),t.defaults&&(i.session=""),e.session!=null&&e.hasOwnProperty("session")&&(i.session=e.session),e.tracks&&e.tracks.length){i.tracks=[];for(let _=0;_<e.tracks.length;++_)i.tracks[_]=$root.com.quick.voice.proto.Track.toObject(e.tracks[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CheckSessionReq"},r})(),T.CheckSessionRsq=(function(){function r(c){if(this.tracks=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.sessionIsValid=!1,r.prototype.tracks=$util.emptyArray,r.prototype.session="",r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.sessionIsValid!=null&&Object.hasOwnProperty.call(e,"sessionIsValid")&&t.uint32(8).bool(e.sessionIsValid),e.tracks!=null&&e.tracks.length)for(let i=0;i<e.tracks.length;++i)$root.com.quick.voice.proto.Track.encode(e.tracks[i],t.uint32(18).fork()).ldelim();return e.session!=null&&Object.hasOwnProperty.call(e,"session")&&t.uint32(26).string(e.session),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.CheckSessionRsq;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.sessionIsValid=e.bool();break}case 2:{I.tracks&&I.tracks.length||(I.tracks=[]),I.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}case 3:{I.session=e.string();break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.sessionIsValid!=null&&e.hasOwnProperty("sessionIsValid")&&typeof e.sessionIsValid!="boolean")return"sessionIsValid: boolean expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let t=0;t<e.tracks.length;++t){let i=$root.com.quick.voice.proto.Track.verify(e.tracks[t]);if(i)return"tracks."+i}}return e.session!=null&&e.hasOwnProperty("session")&&!$util.isString(e.session)?"session: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CheckSessionRsq)return e;let t=new $root.com.quick.voice.proto.CheckSessionRsq;if(e.sessionIsValid!=null&&(t.sessionIsValid=!!e.sessionIsValid),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CheckSessionRsq.tracks: array expected");t.tracks=[];for(let i=0;i<e.tracks.length;++i){if(typeof e.tracks[i]!="object")throw TypeError(".com.quick.voice.proto.CheckSessionRsq.tracks: object expected");t.tracks[i]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[i])}}return e.session!=null&&(t.session=String(e.session)),t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.tracks=[]),t.defaults&&(i.sessionIsValid=!1,i.session=""),e.sessionIsValid!=null&&e.hasOwnProperty("sessionIsValid")&&(i.sessionIsValid=e.sessionIsValid),e.tracks&&e.tracks.length){i.tracks=[];for(let _=0;_<e.tracks.length;++_)i.tracks[_]=$root.com.quick.voice.proto.Track.toObject(e.tracks[_],t)}return e.session!=null&&e.hasOwnProperty("session")&&(i.session=e.session),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CheckSessionRsq"},r})(),T.RoomSpeechNotify=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.userId="",r.prototype.text="",r.prototype.timestamp=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.origin="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),e.text!=null&&Object.hasOwnProperty.call(e,"text")&&t.uint32(26).string(e.text),e.timestamp!=null&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(32).int64(e.timestamp),e.origin!=null&&Object.hasOwnProperty.call(e,"origin")&&t.uint32(42).string(e.origin),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.RoomSpeechNotify;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.roomId=e.string();break}case 2:{I.userId=e.string();break}case 3:{I.text=e.string();break}case 4:{I.timestamp=e.int64();break}case 5:{I.origin=e.string();break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.text!=null&&e.hasOwnProperty("text")&&!$util.isString(e.text)?"text: string expected":e.timestamp!=null&&e.hasOwnProperty("timestamp")&&!$util.isInteger(e.timestamp)&&!(e.timestamp&&$util.isInteger(e.timestamp.low)&&$util.isInteger(e.timestamp.high))?"timestamp: integer|Long expected":e.origin!=null&&e.hasOwnProperty("origin")&&!$util.isString(e.origin)?"origin: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.RoomSpeechNotify)return e;let t=new $root.com.quick.voice.proto.RoomSpeechNotify;return e.roomId!=null&&(t.roomId=String(e.roomId)),e.userId!=null&&(t.userId=String(e.userId)),e.text!=null&&(t.text=String(e.text)),e.timestamp!=null&&($util.Long?(t.timestamp=$util.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?t.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?t.timestamp=e.timestamp:typeof e.timestamp=="object"&&(t.timestamp=new $util.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),e.origin!=null&&(t.origin=String(e.origin)),t},r.toObject=function(e,t){t||(t={});let i={};if(t.defaults){if(i.roomId="",i.userId="",i.text="",$util.Long){let _=new $util.Long(0,0,!1);i.timestamp=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.timestamp=t.longs===String?"0":0;i.origin=""}return e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.text!=null&&e.hasOwnProperty("text")&&(i.text=e.text),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?i.timestamp=t.longs===String?String(e.timestamp):e.timestamp:i.timestamp=t.longs===String?$util.Long.prototype.toString.call(e.timestamp):t.longs===Number?new $util.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber():e.timestamp),e.origin!=null&&e.hasOwnProperty("origin")&&(i.origin=e.origin),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.RoomSpeechNotify"},r})(),T.LiveStreamerSpeechNotify=(function(){function r(c){if(this.langs={},c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.userId="",r.prototype.origin="",r.prototype.langs=$util.emptyObject,r.prototype.timestamp=$util.Long?$util.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),e.origin!=null&&Object.hasOwnProperty.call(e,"origin")&&t.uint32(26).string(e.origin),e.langs!=null&&Object.hasOwnProperty.call(e,"langs"))for(let i=Object.keys(e.langs),_=0;_<i.length;++_)t.uint32(34).fork().uint32(10).string(i[_]).uint32(18).string(e.langs[i[_]]).ldelim();return e.timestamp!=null&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(40).int64(e.timestamp),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.LiveStreamerSpeechNotify,x,M;for(;e.pos<_;){let j=e.uint32();if(j===i)break;switch(j>>>3){case 1:{I.roomId=e.string();break}case 2:{I.userId=e.string();break}case 3:{I.origin=e.string();break}case 4:{I.langs===$util.emptyObject&&(I.langs={});let z=e.uint32()+e.pos;for(x="",M="";e.pos<z;){let Q=e.uint32();switch(Q>>>3){case 1:x=e.string();break;case 2:M=e.string();break;default:e.skipType(Q&7);break}}I.langs[x]=M;break}case 5:{I.timestamp=e.int64();break}default:e.skipType(j&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId))return"userId: string expected";if(e.origin!=null&&e.hasOwnProperty("origin")&&!$util.isString(e.origin))return"origin: string expected";if(e.langs!=null&&e.hasOwnProperty("langs")){if(!$util.isObject(e.langs))return"langs: object expected";let t=Object.keys(e.langs);for(let i=0;i<t.length;++i)if(!$util.isString(e.langs[t[i]]))return"langs: string{k:string} expected"}return e.timestamp!=null&&e.hasOwnProperty("timestamp")&&!$util.isInteger(e.timestamp)&&!(e.timestamp&&$util.isInteger(e.timestamp.low)&&$util.isInteger(e.timestamp.high))?"timestamp: integer|Long expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.LiveStreamerSpeechNotify)return e;let t=new $root.com.quick.voice.proto.LiveStreamerSpeechNotify;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.userId!=null&&(t.userId=String(e.userId)),e.origin!=null&&(t.origin=String(e.origin)),e.langs){if(typeof e.langs!="object")throw TypeError(".com.quick.voice.proto.LiveStreamerSpeechNotify.langs: object expected");t.langs={};for(let i=Object.keys(e.langs),_=0;_<i.length;++_)t.langs[i[_]]=String(e.langs[i[_]])}return e.timestamp!=null&&($util.Long?(t.timestamp=$util.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?t.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?t.timestamp=e.timestamp:typeof e.timestamp=="object"&&(t.timestamp=new $util.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});let i={};if((t.objects||t.defaults)&&(i.langs={}),t.defaults)if(i.roomId="",i.userId="",i.origin="",$util.Long){let I=new $util.Long(0,0,!1);i.timestamp=t.longs===String?I.toString():t.longs===Number?I.toNumber():I}else i.timestamp=t.longs===String?"0":0;e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.origin!=null&&e.hasOwnProperty("origin")&&(i.origin=e.origin);let _;if(e.langs&&(_=Object.keys(e.langs)).length){i.langs={};for(let I=0;I<_.length;++I)i.langs[_[I]]=e.langs[_[I]]}return e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?i.timestamp=t.longs===String?String(e.timestamp):e.timestamp:i.timestamp=t.longs===String?$util.Long.prototype.toString.call(e.timestamp):t.longs===Number?new $util.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber():e.timestamp),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.LiveStreamerSpeechNotify"},r})(),T.AiLangSetting=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.input="",r.prototype.output="",r.prototype.translateEnable=null;let c;return Object.defineProperty(r.prototype,"_translateEnable",{get:$util.oneOfGetter(c=["translateEnable"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.input!=null&&Object.hasOwnProperty.call(t,"input")&&i.uint32(10).string(t.input),t.output!=null&&Object.hasOwnProperty.call(t,"output")&&i.uint32(18).string(t.output),t.translateEnable!=null&&Object.hasOwnProperty.call(t,"translateEnable")&&i.uint32(24).bool(t.translateEnable),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.AiLangSetting;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.input=t.string();break}case 2:{x.output=t.string();break}case 3:{x.translateEnable=t.bool();break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){return typeof t!="object"||t===null?"object expected":t.input!=null&&t.hasOwnProperty("input")&&!$util.isString(t.input)?"input: string expected":t.output!=null&&t.hasOwnProperty("output")&&!$util.isString(t.output)?"output: string expected":t.translateEnable!=null&&t.hasOwnProperty("translateEnable")&&typeof t.translateEnable!="boolean"?"translateEnable: boolean expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.AiLangSetting)return t;let i=new $root.com.quick.voice.proto.AiLangSetting;return t.input!=null&&(i.input=String(t.input)),t.output!=null&&(i.output=String(t.output)),t.translateEnable!=null&&(i.translateEnable=!!t.translateEnable),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.input="",_.output=""),t.input!=null&&t.hasOwnProperty("input")&&(_.input=t.input),t.output!=null&&t.hasOwnProperty("output")&&(_.output=t.output),t.translateEnable!=null&&t.hasOwnProperty("translateEnable")&&(_.translateEnable=t.translateEnable,i.oneofs&&(_._translateEnable="translateEnable")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.AiLangSetting"},r})(),T.P2PIgnoreReason=(function(){const r={},c=Object.create(r);return c[r[0]="CHANNEL_LIMIT"]=0,c[r[1]="SUBSCRIBE_NOT_EXIST"]=1,c[r[2]="Busying"]=2,c[r[3]="TRACK_NOT_EXIST"]=3,c[r[4]="OTHER"]=4,c})(),T.P2PAction=(function(){const r={},c=Object.create(r);return c[r[0]="ReverseTry"]=0,c[r[1]="ReverseTryFailed"]=1,c[r[2]="ReverseSuccess"]=2,c[r[3]="ConnectSuccess"]=3,c[r[4]="ReversePushDelay"]=4,c})(),T.P2PAvailablePeerNotify=(function(){function r(c){if(this.types=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.pushId="",r.prototype.types=$util.emptyArray,r.prototype.isRemotePush=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.pushId!=null&&Object.hasOwnProperty.call(e,"pushId")&&t.uint32(18).string(e.pushId),e.types!=null&&e.types.length){t.uint32(26).fork();for(let i=0;i<e.types.length;++i)t.int32(e.types[i]);t.ldelim()}return e.isRemotePush!=null&&Object.hasOwnProperty.call(e,"isRemotePush")&&t.uint32(32).bool(e.isRemotePush),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.P2PAvailablePeerNotify;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.roomId=e.string();break}case 2:{I.pushId=e.string();break}case 3:{if(I.types&&I.types.length||(I.types=[]),(x&7)===2){let M=e.uint32()+e.pos;for(;e.pos<M;)I.types.push(e.int32())}else I.types.push(e.int32());break}case 4:{I.isRemotePush=e.bool();break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.pushId!=null&&e.hasOwnProperty("pushId")&&!$util.isString(e.pushId))return"pushId: string expected";if(e.types!=null&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)switch(e.types[t]){default:return"types: enum value[] expected";case 0:case 1:case 2:case 3:break}}return e.isRemotePush!=null&&e.hasOwnProperty("isRemotePush")&&typeof e.isRemotePush!="boolean"?"isRemotePush: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.P2PAvailablePeerNotify)return e;let t=new $root.com.quick.voice.proto.P2PAvailablePeerNotify;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.pushId!=null&&(t.pushId=String(e.pushId)),e.types){if(!Array.isArray(e.types))throw TypeError(".com.quick.voice.proto.P2PAvailablePeerNotify.types: array expected");t.types=[];for(let i=0;i<e.types.length;++i)switch(e.types[i]){default:if(typeof e.types[i]=="number"){t.types[i]=e.types[i];break}case"Microphone":case 0:t.types[i]=0;break;case"Camera":case 1:t.types[i]=1;break;case"Screen":case 2:t.types[i]=2;break;case"SystemVoice":case 3:t.types[i]=3;break}}return e.isRemotePush!=null&&(t.isRemotePush=!!e.isRemotePush),t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.types=[]),t.defaults&&(i.roomId="",i.pushId="",i.isRemotePush=!1),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.pushId!=null&&e.hasOwnProperty("pushId")&&(i.pushId=e.pushId),e.types&&e.types.length){i.types=[];for(let _=0;_<e.types.length;++_)i.types[_]=t.enums===String?$root.com.quick.voice.proto.TrackType[e.types[_]]===void 0?e.types[_]:$root.com.quick.voice.proto.TrackType[e.types[_]]:e.types[_]}return e.isRemotePush!=null&&e.hasOwnProperty("isRemotePush")&&(i.isRemotePush=e.isRemotePush),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.P2PAvailablePeerNotify"},r})(),T.ReportP2PExReq=(function(){function r(e){if(this.types=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.pushId="",r.prototype.pullId="",r.prototype.code=0,r.prototype.types=$util.emptyArray,r.prototype.desc=null,r.prototype.connectedTime=null,r.prototype.action=null;let c;return Object.defineProperty(r.prototype,"_desc",{get:$util.oneOfGetter(c=["desc"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_connectedTime",{get:$util.oneOfGetter(c=["connectedTime"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_action",{get:$util.oneOfGetter(c=["action"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.pushId!=null&&Object.hasOwnProperty.call(t,"pushId")&&i.uint32(18).string(t.pushId),t.pullId!=null&&Object.hasOwnProperty.call(t,"pullId")&&i.uint32(26).string(t.pullId),t.code!=null&&Object.hasOwnProperty.call(t,"code")&&i.uint32(32).int32(t.code),t.types!=null&&t.types.length){i.uint32(42).fork();for(let _=0;_<t.types.length;++_)i.int32(t.types[_]);i.ldelim()}return t.desc!=null&&Object.hasOwnProperty.call(t,"desc")&&i.uint32(50).string(t.desc),t.connectedTime!=null&&Object.hasOwnProperty.call(t,"connectedTime")&&i.uint32(58).string(t.connectedTime),t.action!=null&&Object.hasOwnProperty.call(t,"action")&&i.uint32(64).int32(t.action),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let I=i===void 0?t.len:t.pos+i,x=new $root.com.quick.voice.proto.ReportP2PExReq;for(;t.pos<I;){let M=t.uint32();if(M===_)break;switch(M>>>3){case 1:{x.roomId=t.string();break}case 2:{x.pushId=t.string();break}case 3:{x.pullId=t.string();break}case 4:{x.code=t.int32();break}case 5:{if(x.types&&x.types.length||(x.types=[]),(M&7)===2){let j=t.uint32()+t.pos;for(;t.pos<j;)x.types.push(t.int32())}else x.types.push(t.int32());break}case 6:{x.desc=t.string();break}case 7:{x.connectedTime=t.string();break}case 8:{x.action=t.int32();break}default:t.skipType(M&7);break}}return x},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.pushId!=null&&t.hasOwnProperty("pushId")&&!$util.isString(t.pushId))return"pushId: string expected";if(t.pullId!=null&&t.hasOwnProperty("pullId")&&!$util.isString(t.pullId))return"pullId: string expected";if(t.code!=null&&t.hasOwnProperty("code"))switch(t.code){default:return"code: enum value expected";case 0:case 1:case 2:case 3:case 4:break}if(t.types!=null&&t.hasOwnProperty("types")){if(!Array.isArray(t.types))return"types: array expected";for(let i=0;i<t.types.length;++i)switch(t.types[i]){default:return"types: enum value[] expected";case 0:case 1:case 2:case 3:break}}if(t.desc!=null&&t.hasOwnProperty("desc")&&!$util.isString(t.desc))return"desc: string expected";if(t.connectedTime!=null&&t.hasOwnProperty("connectedTime")&&!$util.isString(t.connectedTime))return"connectedTime: string expected";if(t.action!=null&&t.hasOwnProperty("action"))switch(t.action){default:return"action: enum value expected";case 0:case 1:case 2:case 3:case 4:break}return null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.ReportP2PExReq)return t;let i=new $root.com.quick.voice.proto.ReportP2PExReq;switch(t.roomId!=null&&(i.roomId=String(t.roomId)),t.pushId!=null&&(i.pushId=String(t.pushId)),t.pullId!=null&&(i.pullId=String(t.pullId)),t.code){default:if(typeof t.code=="number"){i.code=t.code;break}break;case"Success":case 0:i.code=0;break;case"Failed":case 1:i.code=1;break;case"Ignore":case 2:i.code=2;break;case"Disconnected":case 3:i.code=3;break;case"LowQuality":case 4:i.code=4;break}if(t.types){if(!Array.isArray(t.types))throw TypeError(".com.quick.voice.proto.ReportP2PExReq.types: array expected");i.types=[];for(let _=0;_<t.types.length;++_)switch(t.types[_]){default:if(typeof t.types[_]=="number"){i.types[_]=t.types[_];break}case"Microphone":case 0:i.types[_]=0;break;case"Camera":case 1:i.types[_]=1;break;case"Screen":case 2:i.types[_]=2;break;case"SystemVoice":case 3:i.types[_]=3;break}}switch(t.desc!=null&&(i.desc=String(t.desc)),t.connectedTime!=null&&(i.connectedTime=String(t.connectedTime)),t.action){default:if(typeof t.action=="number"){i.action=t.action;break}break;case"ReverseTry":case 0:i.action=0;break;case"ReverseTryFailed":case 1:i.action=1;break;case"ReverseSuccess":case 2:i.action=2;break;case"ConnectSuccess":case 3:i.action=3;break;case"ReversePushDelay":case 4:i.action=4;break}return i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.types=[]),i.defaults&&(_.roomId="",_.pushId="",_.pullId="",_.code=i.enums===String?"Success":0),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.pushId!=null&&t.hasOwnProperty("pushId")&&(_.pushId=t.pushId),t.pullId!=null&&t.hasOwnProperty("pullId")&&(_.pullId=t.pullId),t.code!=null&&t.hasOwnProperty("code")&&(_.code=i.enums===String?$root.com.quick.voice.proto.P2PCode[t.code]===void 0?t.code:$root.com.quick.voice.proto.P2PCode[t.code]:t.code),t.types&&t.types.length){_.types=[];for(let I=0;I<t.types.length;++I)_.types[I]=i.enums===String?$root.com.quick.voice.proto.TrackType[t.types[I]]===void 0?t.types[I]:$root.com.quick.voice.proto.TrackType[t.types[I]]:t.types[I]}return t.desc!=null&&t.hasOwnProperty("desc")&&(_.desc=t.desc,i.oneofs&&(_._desc="desc")),t.connectedTime!=null&&t.hasOwnProperty("connectedTime")&&(_.connectedTime=t.connectedTime,i.oneofs&&(_._connectedTime="connectedTime")),t.action!=null&&t.hasOwnProperty("action")&&(_.action=i.enums===String?$root.com.quick.voice.proto.P2PAction[t.action]===void 0?t.action:$root.com.quick.voice.proto.P2PAction[t.action]:t.action,i.oneofs&&(_._action="action")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.ReportP2PExReq"},r})(),T.P2PDisconnectedNotify=(function(){function r(c){if(this.types=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.remoteUserId="",r.prototype.types=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.remoteUserId!=null&&Object.hasOwnProperty.call(e,"remoteUserId")&&t.uint32(18).string(e.remoteUserId),e.types!=null&&e.types.length){t.uint32(26).fork();for(let i=0;i<e.types.length;++i)t.int32(e.types[i]);t.ldelim()}return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.P2PDisconnectedNotify;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.roomId=e.string();break}case 2:{I.remoteUserId=e.string();break}case 3:{if(I.types&&I.types.length||(I.types=[]),(x&7)===2){let M=e.uint32()+e.pos;for(;e.pos<M;)I.types.push(e.int32())}else I.types.push(e.int32());break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.remoteUserId!=null&&e.hasOwnProperty("remoteUserId")&&!$util.isString(e.remoteUserId))return"remoteUserId: string expected";if(e.types!=null&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)switch(e.types[t]){default:return"types: enum value[] expected";case 0:case 1:case 2:case 3:break}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.P2PDisconnectedNotify)return e;let t=new $root.com.quick.voice.proto.P2PDisconnectedNotify;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.remoteUserId!=null&&(t.remoteUserId=String(e.remoteUserId)),e.types){if(!Array.isArray(e.types))throw TypeError(".com.quick.voice.proto.P2PDisconnectedNotify.types: array expected");t.types=[];for(let i=0;i<e.types.length;++i)switch(e.types[i]){default:if(typeof e.types[i]=="number"){t.types[i]=e.types[i];break}case"Microphone":case 0:t.types[i]=0;break;case"Camera":case 1:t.types[i]=1;break;case"Screen":case 2:t.types[i]=2;break;case"SystemVoice":case 3:t.types[i]=3;break}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.types=[]),t.defaults&&(i.roomId="",i.remoteUserId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.remoteUserId!=null&&e.hasOwnProperty("remoteUserId")&&(i.remoteUserId=e.remoteUserId),e.types&&e.types.length){i.types=[];for(let _=0;_<e.types.length;++_)i.types[_]=t.enums===String?$root.com.quick.voice.proto.TrackType[e.types[_]]===void 0?e.types[_]:$root.com.quick.voice.proto.TrackType[e.types[_]]:e.types[_]}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.P2PDisconnectedNotify"},r})(),T.RoomGlobalActionChangedNotify=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.roomAction=0,r.prototype.from="",r.prototype.serverAction=0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.roomAction!=null&&Object.hasOwnProperty.call(e,"roomAction")&&t.uint32(16).int32(e.roomAction),e.from!=null&&Object.hasOwnProperty.call(e,"from")&&t.uint32(26).string(e.from),e.serverAction!=null&&Object.hasOwnProperty.call(e,"serverAction")&&t.uint32(32).int32(e.serverAction),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.RoomGlobalActionChangedNotify;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.roomId=e.string();break}case 2:{I.roomAction=e.int32();break}case 3:{I.from=e.string();break}case 4:{I.serverAction=e.int32();break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":e.roomAction!=null&&e.hasOwnProperty("roomAction")&&!$util.isInteger(e.roomAction)?"roomAction: integer expected":e.from!=null&&e.hasOwnProperty("from")&&!$util.isString(e.from)?"from: string expected":e.serverAction!=null&&e.hasOwnProperty("serverAction")&&!$util.isInteger(e.serverAction)?"serverAction: integer expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.RoomGlobalActionChangedNotify)return e;let t=new $root.com.quick.voice.proto.RoomGlobalActionChangedNotify;return e.roomId!=null&&(t.roomId=String(e.roomId)),e.roomAction!=null&&(t.roomAction=e.roomAction|0),e.from!=null&&(t.from=String(e.from)),e.serverAction!=null&&(t.serverAction=e.serverAction|0),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.roomId="",i.roomAction=0,i.from="",i.serverAction=0),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.roomAction!=null&&e.hasOwnProperty("roomAction")&&(i.roomAction=e.roomAction),e.from!=null&&e.hasOwnProperty("from")&&(i.from=e.from),e.serverAction!=null&&e.hasOwnProperty("serverAction")&&(i.serverAction=e.serverAction),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.RoomGlobalActionChangedNotify"},r})(),T.PubNotifyInterceptSyncRsp=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.roomAction=0,r.prototype.user=null,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.roomAction!=null&&Object.hasOwnProperty.call(e,"roomAction")&&t.uint32(16).int32(e.roomAction),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,t.uint32(26).fork()).ldelim(),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.PubNotifyInterceptSyncRsp;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.roomId=e.string();break}case 2:{I.roomAction=e.int32();break}case 3:{I.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.roomAction!=null&&e.hasOwnProperty("roomAction")&&!$util.isInteger(e.roomAction))return"roomAction: integer expected";if(e.user!=null&&e.hasOwnProperty("user")){let t=$root.com.quick.voice.proto.User.verify(e.user);if(t)return"user."+t}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PubNotifyInterceptSyncRsp)return e;let t=new $root.com.quick.voice.proto.PubNotifyInterceptSyncRsp;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.roomAction!=null&&(t.roomAction=e.roomAction|0),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.PubNotifyInterceptSyncRsp.user: object expected");t.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.roomId="",i.roomAction=0,i.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.roomAction!=null&&e.hasOwnProperty("roomAction")&&(i.roomAction=e.roomAction),e.user!=null&&e.hasOwnProperty("user")&&(i.user=$root.com.quick.voice.proto.User.toObject(e.user,t)),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PubNotifyInterceptSyncRsp"},r})(),T.MeetRolesListRsp=(function(){function r(c){if(this.admin=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.creator="",r.prototype.admin=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.creator!=null&&Object.hasOwnProperty.call(e,"creator")&&t.uint32(10).string(e.creator),e.admin!=null&&e.admin.length)for(let i=0;i<e.admin.length;++i)t.uint32(18).string(e.admin[i]);return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.MeetRolesListRsp;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.creator=e.string();break}case 2:{I.admin&&I.admin.length||(I.admin=[]),I.admin.push(e.string());break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.creator!=null&&e.hasOwnProperty("creator")&&!$util.isString(e.creator))return"creator: string expected";if(e.admin!=null&&e.hasOwnProperty("admin")){if(!Array.isArray(e.admin))return"admin: array expected";for(let t=0;t<e.admin.length;++t)if(!$util.isString(e.admin[t]))return"admin: string[] expected"}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.MeetRolesListRsp)return e;let t=new $root.com.quick.voice.proto.MeetRolesListRsp;if(e.creator!=null&&(t.creator=String(e.creator)),e.admin){if(!Array.isArray(e.admin))throw TypeError(".com.quick.voice.proto.MeetRolesListRsp.admin: array expected");t.admin=[];for(let i=0;i<e.admin.length;++i)t.admin[i]=String(e.admin[i])}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.admin=[]),t.defaults&&(i.creator=""),e.creator!=null&&e.hasOwnProperty("creator")&&(i.creator=e.creator),e.admin&&e.admin.length){i.admin=[];for(let _=0;_<e.admin.length;++_)i.admin[_]=e.admin[_]}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.MeetRolesListRsp"},r})(),T.MeetRolesChangeNotify=(function(){function r(c){if(this.users=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.meetSpecialRoles=null,r.prototype.users=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.meetSpecialRoles!=null&&Object.hasOwnProperty.call(e,"meetSpecialRoles")&&$root.com.quick.voice.proto.MeetRolesListRsp.encode(e.meetSpecialRoles,t.uint32(18).fork()).ldelim(),e.users!=null&&e.users.length)for(let i=0;i<e.users.length;++i)$root.com.quick.voice.proto.User.encode(e.users[i],t.uint32(26).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.MeetRolesChangeNotify;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.roomId=e.string();break}case 2:{I.meetSpecialRoles=$root.com.quick.voice.proto.MeetRolesListRsp.decode(e,e.uint32());break}case 3:{I.users&&I.users.length||(I.users=[]),I.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.meetSpecialRoles!=null&&e.hasOwnProperty("meetSpecialRoles")){let t=$root.com.quick.voice.proto.MeetRolesListRsp.verify(e.meetSpecialRoles);if(t)return"meetSpecialRoles."+t}if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let t=0;t<e.users.length;++t){let i=$root.com.quick.voice.proto.User.verify(e.users[t]);if(i)return"users."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.MeetRolesChangeNotify)return e;let t=new $root.com.quick.voice.proto.MeetRolesChangeNotify;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.meetSpecialRoles!=null){if(typeof e.meetSpecialRoles!="object")throw TypeError(".com.quick.voice.proto.MeetRolesChangeNotify.meetSpecialRoles: object expected");t.meetSpecialRoles=$root.com.quick.voice.proto.MeetRolesListRsp.fromObject(e.meetSpecialRoles)}if(e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.MeetRolesChangeNotify.users: array expected");t.users=[];for(let i=0;i<e.users.length;++i){if(typeof e.users[i]!="object")throw TypeError(".com.quick.voice.proto.MeetRolesChangeNotify.users: object expected");t.users[i]=$root.com.quick.voice.proto.User.fromObject(e.users[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.users=[]),t.defaults&&(i.roomId="",i.meetSpecialRoles=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.meetSpecialRoles!=null&&e.hasOwnProperty("meetSpecialRoles")&&(i.meetSpecialRoles=$root.com.quick.voice.proto.MeetRolesListRsp.toObject(e.meetSpecialRoles,t)),e.users&&e.users.length){i.users=[];for(let _=0;_<e.users.length;++_)i.users[_]=$root.com.quick.voice.proto.User.toObject(e.users[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.MeetRolesChangeNotify"},r})(),T.JoinBatchNotify=(function(){function r(c){if(this.users=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.users=$util.emptyArray,r.prototype.totalSize=0,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let i=0;i<e.users.length;++i)$root.com.quick.voice.proto.User.encode(e.users[i],t.uint32(18).fork()).ldelim();return e.totalSize!=null&&Object.hasOwnProperty.call(e,"totalSize")&&t.uint32(24).int32(e.totalSize),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.JoinBatchNotify;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.roomId=e.string();break}case 2:{I.users&&I.users.length||(I.users=[]),I.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 3:{I.totalSize=e.int32();break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let t=0;t<e.users.length;++t){let i=$root.com.quick.voice.proto.User.verify(e.users[t]);if(i)return"users."+i}}return e.totalSize!=null&&e.hasOwnProperty("totalSize")&&!$util.isInteger(e.totalSize)?"totalSize: integer expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinBatchNotify)return e;let t=new $root.com.quick.voice.proto.JoinBatchNotify;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.JoinBatchNotify.users: array expected");t.users=[];for(let i=0;i<e.users.length;++i){if(typeof e.users[i]!="object")throw TypeError(".com.quick.voice.proto.JoinBatchNotify.users: object expected");t.users[i]=$root.com.quick.voice.proto.User.fromObject(e.users[i])}}return e.totalSize!=null&&(t.totalSize=e.totalSize|0),t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.users=[]),t.defaults&&(i.roomId="",i.totalSize=0),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.users&&e.users.length){i.users=[];for(let _=0;_<e.users.length;++_)i.users[_]=$root.com.quick.voice.proto.User.toObject(e.users[_],t)}return e.totalSize!=null&&e.hasOwnProperty("totalSize")&&(i.totalSize=e.totalSize),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinBatchNotify"},r})(),T.QuitUserInfo=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.userId="",r.prototype.code=0,r.prototype.desc="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),e.code!=null&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).int32(e.code),e.desc!=null&&Object.hasOwnProperty.call(e,"desc")&&t.uint32(26).string(e.desc),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.QuitUserInfo;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.userId=e.string();break}case 2:{I.code=e.int32();break}case 3:{I.desc=e.string();break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.code!=null&&e.hasOwnProperty("code")&&!$util.isInteger(e.code)?"code: integer expected":e.desc!=null&&e.hasOwnProperty("desc")&&!$util.isString(e.desc)?"desc: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.QuitUserInfo)return e;let t=new $root.com.quick.voice.proto.QuitUserInfo;return e.userId!=null&&(t.userId=String(e.userId)),e.code!=null&&(t.code=e.code|0),e.desc!=null&&(t.desc=String(e.desc)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.userId="",i.code=0,i.desc=""),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.code!=null&&e.hasOwnProperty("code")&&(i.code=e.code),e.desc!=null&&e.hasOwnProperty("desc")&&(i.desc=e.desc),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.QuitUserInfo"},r})(),T.QuitBatchNotify=(function(){function r(c){if(this.users=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.users=$util.emptyArray,r.prototype.totalSize=0,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let i=0;i<e.users.length;++i)$root.com.quick.voice.proto.QuitUserInfo.encode(e.users[i],t.uint32(18).fork()).ldelim();return e.totalSize!=null&&Object.hasOwnProperty.call(e,"totalSize")&&t.uint32(24).int32(e.totalSize),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.QuitBatchNotify;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.roomId=e.string();break}case 2:{I.users&&I.users.length||(I.users=[]),I.users.push($root.com.quick.voice.proto.QuitUserInfo.decode(e,e.uint32()));break}case 3:{I.totalSize=e.int32();break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let t=0;t<e.users.length;++t){let i=$root.com.quick.voice.proto.QuitUserInfo.verify(e.users[t]);if(i)return"users."+i}}return e.totalSize!=null&&e.hasOwnProperty("totalSize")&&!$util.isInteger(e.totalSize)?"totalSize: integer expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.QuitBatchNotify)return e;let t=new $root.com.quick.voice.proto.QuitBatchNotify;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.QuitBatchNotify.users: array expected");t.users=[];for(let i=0;i<e.users.length;++i){if(typeof e.users[i]!="object")throw TypeError(".com.quick.voice.proto.QuitBatchNotify.users: object expected");t.users[i]=$root.com.quick.voice.proto.QuitUserInfo.fromObject(e.users[i])}}return e.totalSize!=null&&(t.totalSize=e.totalSize|0),t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.users=[]),t.defaults&&(i.roomId="",i.totalSize=0),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.users&&e.users.length){i.users=[];for(let _=0;_<e.users.length;++_)i.users[_]=$root.com.quick.voice.proto.QuitUserInfo.toObject(e.users[_],t)}return e.totalSize!=null&&e.hasOwnProperty("totalSize")&&(i.totalSize=e.totalSize),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.QuitBatchNotify"},r})(),T.RoomInfoCommonRsp=(function(){function r(c){if(this.users=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.users=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let i=0;i<e.users.length;++i)$root.com.quick.voice.proto.User.encode(e.users[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.RoomInfoCommonRsp;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.roomId=e.string();break}case 2:{I.users&&I.users.length||(I.users=[]),I.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let t=0;t<e.users.length;++t){let i=$root.com.quick.voice.proto.User.verify(e.users[t]);if(i)return"users."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.RoomInfoCommonRsp)return e;let t=new $root.com.quick.voice.proto.RoomInfoCommonRsp;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.RoomInfoCommonRsp.users: array expected");t.users=[];for(let i=0;i<e.users.length;++i){if(typeof e.users[i]!="object")throw TypeError(".com.quick.voice.proto.RoomInfoCommonRsp.users: object expected");t.users[i]=$root.com.quick.voice.proto.User.fromObject(e.users[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.users=[]),t.defaults&&(i.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.users&&e.users.length){i.users=[];for(let _=0;_<e.users.length;++_)i.users[_]=$root.com.quick.voice.proto.User.toObject(e.users[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.RoomInfoCommonRsp"},r})(),T.RtcEvent=(function(){const r={},c=Object.create(r);return c[r[0]="UpdateTrackActive"]=0,c})(),T.RtcTrack=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.userId="",r.prototype.mid="",r.prototype.trackName="",r.prototype.type=0,r.prototype.isActive=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),e.mid!=null&&Object.hasOwnProperty.call(e,"mid")&&t.uint32(18).string(e.mid),e.trackName!=null&&Object.hasOwnProperty.call(e,"trackName")&&t.uint32(26).string(e.trackName),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&t.uint32(32).int32(e.type),e.isActive!=null&&Object.hasOwnProperty.call(e,"isActive")&&t.uint32(40).bool(e.isActive),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.RtcTrack;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.userId=e.string();break}case 2:{I.mid=e.string();break}case 3:{I.trackName=e.string();break}case 4:{I.type=e.int32();break}case 5:{I.isActive=e.bool();break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId))return"userId: string expected";if(e.mid!=null&&e.hasOwnProperty("mid")&&!$util.isString(e.mid))return"mid: string expected";if(e.trackName!=null&&e.hasOwnProperty("trackName")&&!$util.isString(e.trackName))return"trackName: string expected";if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return e.isActive!=null&&e.hasOwnProperty("isActive")&&typeof e.isActive!="boolean"?"isActive: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.RtcTrack)return e;let t=new $root.com.quick.voice.proto.RtcTrack;switch(e.userId!=null&&(t.userId=String(e.userId)),e.mid!=null&&(t.mid=String(e.mid)),e.trackName!=null&&(t.trackName=String(e.trackName)),e.type){default:if(typeof e.type=="number"){t.type=e.type;break}break;case"Microphone":case 0:t.type=0;break;case"Camera":case 1:t.type=1;break;case"Screen":case 2:t.type=2;break;case"SystemVoice":case 3:t.type=3;break}return e.isActive!=null&&(t.isActive=!!e.isActive),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.userId="",i.mid="",i.trackName="",i.type=t.enums===String?"Microphone":0,i.isActive=!1),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.mid!=null&&e.hasOwnProperty("mid")&&(i.mid=e.mid),e.trackName!=null&&e.hasOwnProperty("trackName")&&(i.trackName=e.trackName),e.type!=null&&e.hasOwnProperty("type")&&(i.type=t.enums===String?$root.com.quick.voice.proto.RtcTrackType[e.type]===void 0?e.type:$root.com.quick.voice.proto.RtcTrackType[e.type]:e.type),e.isActive!=null&&e.hasOwnProperty("isActive")&&(i.isActive=e.isActive),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.RtcTrack"},r})(),T.RtcTrackType=(function(){const r={},c=Object.create(r);return c[r[0]="Microphone"]=0,c[r[1]="Camera"]=1,c[r[2]="Screen"]=2,c[r[3]="SystemVoice"]=3,c})(),T.UpdateTrackState=(function(){function r(c){if(this.tracks=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.tracks=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.tracks!=null&&e.tracks.length)for(let i=0;i<e.tracks.length;++i)$root.com.quick.voice.proto.RtcTrack.encode(e.tracks[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,I=new $root.com.quick.voice.proto.UpdateTrackState;for(;e.pos<_;){let x=e.uint32();if(x===i)break;switch(x>>>3){case 1:{I.roomId=e.string();break}case 2:{I.tracks&&I.tracks.length||(I.tracks=[]),I.tracks.push($root.com.quick.voice.proto.RtcTrack.decode(e,e.uint32()));break}default:e.skipType(x&7);break}}return I},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let t=0;t<e.tracks.length;++t){let i=$root.com.quick.voice.proto.RtcTrack.verify(e.tracks[t]);if(i)return"tracks."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTrackState)return e;let t=new $root.com.quick.voice.proto.UpdateTrackState;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.UpdateTrackState.tracks: array expected");t.tracks=[];for(let i=0;i<e.tracks.length;++i){if(typeof e.tracks[i]!="object")throw TypeError(".com.quick.voice.proto.UpdateTrackState.tracks: object expected");t.tracks[i]=$root.com.quick.voice.proto.RtcTrack.fromObject(e.tracks[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.tracks=[]),t.defaults&&(i.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.tracks&&e.tracks.length){i.tracks=[];for(let _=0;_<e.tracks.length;++_)i.tracks[_]=$root.com.quick.voice.proto.RtcTrack.toObject(e.tracks[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTrackState"},r})(),T})(),u})(),m})(),b})(),compressArrayBuffer=b=>{const m=new Uint8Array(b),u=pako.deflate(m,{gzip:!0});return new Uint8Array(u?.buffer)},decompressArrayBuffer=b=>{const m=new Uint8Array(b),u=pako.inflate(m,{gzip:!0});return new Uint8Array(u?.buffer)},sendMessageFormat=b=>{const{event:m,compress:u=!1}=b,T=b.data;let r="",c;switch(b.time&&(r=p$1(b.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),m){case"heartbeat":case"heartbeatEx":c=com.quick.voice.proto.ReportTrafficUsage.encode(T).finish();break;case"ackMsg":c=com.quick.voice.proto.AckMsgReq.encode(T).finish();break;case"reportNetwork":c=com.quick.voice.proto.ReportNetInfo.encode(T).finish();break;case"connectCF":c=com.quick.voice.proto.ConnectCFReq.encode(T).finish();break;case"publish":c=com.quick.voice.proto.PublishReq.encode(T).finish();break;case"joinRoom":case"joinRoomEx":c=com.quick.voice.proto.JoinReq.encode(T).finish();break;case"pubNotify":c=com.quick.voice.proto.PublishNotify.encode(T).finish();break;case"subscribe":c=com.quick.voice.proto.SubscribeReq.encode(T).finish();break;case"renegotiate":c=com.quick.voice.proto.RenegotiateReq.encode(T).finish();break;case"closeTrack":c=com.quick.voice.proto.CloseTrackReq.encode(T).finish();break;case"preventUsersBehavior":c=com.quick.voice.proto.PreventUsersBehaviorReq.encode(T).finish();break;case"networkQualityChange":c=com.quick.voice.proto.NetQualityChange.encode(T).finish();break;case"updateCall":c=com.quick.voice.proto.UpdateCall.encode(T).finish();break;case"toggleRoomSpeechLang":c=com.quick.voice.proto.AiLangSetting.encode(T).finish();break;case"syncRoomInfo":c=com.quick.voice.proto.SyncRoomInfoReq.encode(T).finish();break;case"offer":c=com.quick.voice.proto.SdpConsult.encode(T).finish();break;case"answer":c=com.quick.voice.proto.SdpConsult.encode(T).finish();break;case"candidate":c=com.quick.voice.proto.Candidates.encode(T).finish();break;case"reportP2PConnectEx":c=com.quick.voice.proto.ReportP2PExReq.encode(T).finish();break;case"UpdateTrackActive":c=com.quick.voice.proto.UpdateTrackState.encode(T).finish();break;case"quitRoom":case"quitRoomEx":c=com.quick.voice.proto.QuitReq.encode(T).finish();break}if(c&&u)try{c=compressArrayBuffer(c)}catch(e){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息压缩错误",e)}return{...b,timeStr:r,data_original:T,data:c}},onMessageFormat=b=>{const{event:m,compress:u=!1,time:T}=b;let r=b.data,c="",e;const t=new Date().getTime(),i=p$1(t,"YYYY-MM-DD hh:mm:ss",{offset:480});if(T&&(c=p$1(T,"YYYY-MM-DD hh:mm:ss",{offset:480})),u)try{r=decompressArrayBuffer(r)}catch(_){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",_)}switch(m){case"connectCF":e=com.quick.voice.proto.ConnectCFRsp.decode(r);break;case"publish":e=com.quick.voice.proto.PublishRsp.decode(r);break;case"joinRoom":case"joinRoomEx":e=com.quick.voice.proto.JoinRsp.decode(r);break;case"subscribe":e=com.quick.voice.proto.SubscribeRsp.decode(r);break;case"closeTrack":e=com.quick.voice.proto.CloseTrackRsp.decode(r);break;case"syncRoomInfo":e=com.quick.voice.proto.SyncRoomInfoRsp.decode(r);break;case"onJoinRoom":e=com.quick.voice.proto.JoinNotify.decode(r);break;case"onJoinRoomBatch":e=com.quick.voice.proto.JoinBatchNotify.decode(r);break;case"onPublish":e=com.quick.voice.proto.PublishNotify.decode(r);break;case"onCloseTrack":e=com.quick.voice.proto.CloseTrackNotify.decode(r);break;case"onTrackInactive":e=com.quick.voice.proto.CheckSessionRsq.decode(r);break;case"onUpdateCall":e=com.quick.voice.proto.UpdateCall.decode(r);break;case"onRoomActionChange":e=com.quick.voice.proto.RoomGlobalActionChangedNotify.decode(r);break;case"onMeetSpecialRolesChange":e=com.quick.voice.proto.MeetRolesChangeNotify.decode(r);break;case"onUpdatePermissions":e=com.quick.voice.proto.UpdatePermissions.decode(r);break;case"onUpdatePermissionsBatch":e=com.quick.voice.proto.RoomInfoCommonRsp.decode(r);break;case"onNetQuality":e=com.quick.voice.proto.NetQualityNotify.decode(r);break;case"onCDNPlayUrlAdd":e=com.quick.voice.proto.CDNPlayAddressNotify.decode(r);break;case"onUpdateBehavior":e=com.quick.voice.proto.PreventUsersBehaviorNotify.decode(r);break;case"onRoomUserSpeech":e=com.quick.voice.proto.RoomSpeechNotify.decode(r);break;case"onAttemptP2PEx":e=com.quick.voice.proto.P2PAvailablePeerNotify.decode(r);break;case"onOffer":e=com.quick.voice.proto.SdpConsult.decode(r);break;case"onAnswer":e=com.quick.voice.proto.SdpConsult.decode(r);break;case"onCandidate":e=com.quick.voice.proto.Candidates.decode(r);break;case"onDisconnectedP2P":e=com.quick.voice.proto.P2PDisconnectedNotify.decode(r);break;case"onQuitRoom":e=com.quick.voice.proto.QuitNotify.decode(r);break;case"onQuitRoomBatch":e=com.quick.voice.proto.QuitBatchNotify.decode(r);break;case"onDestroyRoom":e=com.quick.voice.proto.QuitNotify.decode(r);break;case"debugger":case"ai":e=JSON.parse(new TextDecoder().decode(r));break;case"UpdateTrackActive":e=com.quick.voice.proto.UpdateTrackState.decode(r);break}return{...b,time:t,timeStr:i,data_remote:r,data:e,remoteTime:T,remoteTimeStr:c}},obj2pb=b=>com.quick.voice.proto.CommonReq.encode(b).finish(),pb2obj=b=>com.quick.voice.proto.CommonRsp.decode(b);var lib$1={},parser={},grammar={exports:{}},hasRequiredGrammar;function requireGrammar(){if(hasRequiredGrammar)return grammar.exports;hasRequiredGrammar=1;var b=grammar.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(m){return m.encoding?"rtpmap:%d %s/%s/%s":m.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(m){return m.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(m){return m.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(m){return"extmap:%d"+(m.direction?"/%s":"%v")+(m["encrypt-uri"]?" %s":"%v")+" %s"+(m.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(m){return m.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{push:"msid",reg:/^msid:([\w-]+)(?: ([\w-]+))?/,names:["id","appdata"],format:"msid:%s %s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(m){var u="candidate:%s %d %s %d %s %d typ %s";return u+=m.raddr!=null?" raddr %s rport %d":"%v%v",u+=m.tcptype!=null?" tcptype %s":"%v",m.generation!=null&&(u+=" generation %d"),u+=m["network-id"]!=null?" network-id %d":"%v",u+=m["network-cost"]!=null?" network-cost %d":"%v",u}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(m){var u="ssrc:%d";return m.attribute!=null&&(u+=" %s",m.value!=null&&(u+=":%s")),u}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(m){return m.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(m){return m.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(m){return"imageattr:%s %s %s"+(m.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(m){return"simulcast:%s %s"+(m.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(m){return"ts-refclk:%s"+(m.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(m){var u="mediaclk:";return u+=m.id!=null?"id=%s %s":"%v%s",u+=m.mediaClockValue!=null?"=%s":"",u+=m.rateNumerator!=null?" rate=%s":"",u+=m.rateDenominator!=null?"/%s":"",u}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(b).forEach(function(m){var u=b[m];u.forEach(function(T){T.reg||(T.reg=/(.*)/),T.format||(T.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,(function(b){var m=function(t){return String(Number(t))===t?Number(t):t},u=function(t,i,_,I){if(I&&!_)i[I]=m(t[1]);else for(var x=0;x<_.length;x+=1)t[x+1]!=null&&(i[_[x]]=m(t[x+1]))},T=function(t,i,_){var I=t.name&&t.names;t.push&&!i[t.push]?i[t.push]=[]:I&&!i[t.name]&&(i[t.name]={});var x=t.push?{}:I?i[t.name]:i;u(_.match(t.reg),x,t.names,t.name),t.push&&i[t.push].push(x)},r=requireGrammar(),c=RegExp.prototype.test.bind(/^([a-z])=(.*)/);b.parse=function(t){var i={},_=[],I=i;return t.split(/(\r\n|\r|\n)/).filter(c).forEach(function(x){var M=x[0],j=x.slice(2);M==="m"&&(_.push({rtp:[],fmtp:[]}),I=_[_.length-1]);for(var z=0;z<(r[M]||[]).length;z+=1){var Q=r[M][z];if(Q.reg.test(j))return T(Q,I,j)}}),i.media=_,i};var e=function(t,i){var _=i.split(/=(.+)/,2);return _.length===2?t[_[0]]=m(_[1]):_.length===1&&i.length>1&&(t[_[0]]=void 0),t};b.parseParams=function(t){return t.split(/;\s?/).reduce(e,{})},b.parseFmtpConfig=b.parseParams,b.parsePayloads=function(t){return t.toString().split(" ").map(Number)},b.parseRemoteCandidates=function(t){for(var i=[],_=t.split(" ").map(m),I=0;I<_.length;I+=3)i.push({component:_[I],ip:_[I+1],port:_[I+2]});return i},b.parseImageAttributes=function(t){return t.split(" ").map(function(i){return i.substring(1,i.length-1).split(",").reduce(e,{})})},b.parseSimulcastStreamList=function(t){return t.split(";").map(function(i){return i.split(",").map(function(_){var I,x=!1;return _[0]!=="~"?I=m(_):(I=m(_.substring(1,_.length)),x=!0),{scid:I,paused:x}})})}})(parser)),parser}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1;var b=requireGrammar(),m=/%[sdv%]/g,u=function(e){var t=1,i=arguments,_=i.length;return e.replace(m,function(I){if(t>=_)return I;var x=i[t];switch(t+=1,I){case"%%":return"%";case"%s":return String(x);case"%d":return Number(x);case"%v":return""}})},T=function(e,t,i){var _=t.format instanceof Function?t.format(t.push?i:i[t.name]):t.format,I=[e+"="+_];if(t.names)for(var x=0;x<t.names.length;x+=1){var M=t.names[x];t.name?I.push(i[t.name][M]):I.push(i[t.names[x]])}else I.push(i[t.name]);return u.apply(null,I)},r=["v","o","s","i","u","e","p","c","b","t","r","z","a"],c=["i","c","b","a"];return writer=function(e,t){t=t||{},e.version==null&&(e.version=0),e.name==null&&(e.name=" "),e.media.forEach(function(x){x.payloads==null&&(x.payloads="")});var i=t.outerOrder||r,_=t.innerOrder||c,I=[];return i.forEach(function(x){b[x].forEach(function(M){M.name in e&&e[M.name]!=null?I.push(T(x,M,e)):M.push in e&&e[M.push]!=null&&e[M.push].forEach(function(j){I.push(T(x,M,j))})})}),e.media.forEach(function(x){I.push(T("m",b.m[0],x)),_.forEach(function(M){b[M].forEach(function(j){j.name in x&&x[j.name]!=null?I.push(T(M,j,x)):j.push in x&&x[j.push]!=null&&x[j.push].forEach(function(z){I.push(T(M,j,z))})})})}),I.join(`\r
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`quickvo-sdk-js`]={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},u=(e,r,i)=>(i=e==null?{}:t(a(e)),l(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),d=(e,t={})=>{let{unit:n,splitStr:r}={unit:`B`,splitStr:` `,...t},i=[`B`,`KB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`,`DB`,`NB`],a=i.findIndex(e=>e===n),o=i.slice(a+1,i.length),s=`${e}`,c=s[0]===`-`;c&&(s=s.replace(`-`,``));let l=p(s.split(``),4).reverse(),u=``,d=0;for(let e of l)if(u=`${e.join(``)}${u}`,d=+`${u}`,!(d<1024)){for(let e of o)if(n=e,d/=1024,Math.abs(d)<1024)break}return`${c?`-`:``}${d.toFixed(2)}${r}${n}`},f=(e,t=[])=>{let n={...e},r=Object.keys(n);for(let e of r)t.findIndex(t=>String(t)===e)===-1&&delete n[e];return n},p=(e,t)=>{let n=Math.max(1,t),r=Math.ceil(e.length/n),i=[];for(let t=0;t<r;t++){let r=t*n,a=Math.min(r+n,e.length);i.push(e.slice(r,a))}return i},m=(e,t=[])=>{let n=[];for(let r of e){let e=f(r,t);n.push(e)}return n},h=(e,t=`value`,n=`label`)=>{let r=[],i=Object.entries(e);for(let[e,a]of i){let i={[n]:a,[t]:e};r.push(i)}return r},g=(e,t=1e-4)=>{e||=new(window.AudioContext||window.webkitAudioContext);let n=e.createOscillator();n.type=`sine`,n.frequency.setValueAtTime(1,e.currentTime);let r=e.createGain();r.gain.setValueAtTime(t,e.currentTime),n.connect(r);let i=e.createMediaStreamDestination();return r.connect(i),n.start(e.currentTime),i.stream},_=({width:e=32,height:t=32,opacity:n=1,fps:r=20,text:i=``})=>{r=Math.min(r,30);let a=document.createElement(`canvas`),o=a.getContext(`2d`);a.width=e,a.height=t;let s=0,c=a.captureStream(r),l=()=>{o.clearRect(0,0,a.width,a.height);let u=o.createLinearGradient(0,0,a.width,a.height);u.addColorStop(0,`hsla(${s}, 100%, 50%, ${n})`),u.addColorStop(1,`hsla(${s+120}, 100%, 50%, ${n})`),o.fillStyle=u,o.fillRect(0,0,a.width,a.height),i&&(o.font=`bold ${Math.min(e,t)*.8/i.length}px Arial`,o.textAlign=`center`,o.textBaseline=`middle`,o.fillStyle=`rgba(255, 255, 255, ${n})`,o.fillText(i,a.width*.5,a.height*.5)),s=(s+1)%360,c.active&&setTimeout(l,Math.round(1e3/r))};return l(),c},v=(e=0,t=1)=>{let n=Math.max(0,e),r=Math.max(1,t),i=Math.min(n,r),a=Math.random()*(Math.max(n,r)-i+1)+i;return parseInt(`${a}`,10)},y=(e=16,t=16)=>{let n=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``),r=Math.min(n.length,t),i=Date.now().toString(r),a=i.split(``),o=Math.max(4,e-i.length);for(let e=0;e<o;e++){let e=n[v(0,r-1)];a.push(e)}return a.join(``).toUpperCase()},b=(e,t)=>{try{let n=Number(e);if(isNaN(n)){let t=new Date(`${e}`);if(`${t}`==`Invalid Date`)return 0;n=t.getTime()}if(t!==void 0){let e=new Date().getTimezoneOffset();n+=(e+t)*60*1e3}return n}catch(n){return console.error(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;padding:16px 0;`,`------->timeStamp:err`,{_val:e,_offset:t,error:n}),0}},x=1e3,S=x*60,C=S*60,w=C*24,T={1:`1`,2:`2`,3:`3`,4:`4`,5:`5`,6:`6`,7:`7`,"01":`一`,"02":`二`,"03":`三`,"04":`四`,"05":`五`,"06":`六`,"07":`日`},E=e=>b(e),D=(e,t=`YYYY-MM-DD hh:mm:ss`,n={})=>{let{empty_str:r,offset:i}={empty_str:`-`,...n},a=b(e,i);if(Number(e)!==0&&a===0)return r;let o=new Date(a),s=`${o.getFullYear()}`,c=`${o.getMonth()+1}`,l=`${[`1`,`2`,`3`].includes(c)?1:[`4`,`5`,`6`].includes(c)?2:[`7`,`8`,`9`].includes(c)?3:4}`,u=`${o.getDate()}`,d=`${o.getDay()===0?7:o.getDay()}`,f=`${o.getHours()}`,p=`${o.getMinutes()}`,m=`${o.getSeconds()}`,h=`${Math.ceil((a-E(`${s}/01/01 00:00:00`)+1)/w)}`,g=`${Math.ceil(((a-E(`${s}/01/01 00:00:00`))/w-Number(d))/7)+1}`,_=[{k:`Y+`,v:s},{k:`M+`,v:c},{k:`Q+`,v:l},{k:`D+`,v:u},{k:`W+`,v:d},{k:`h+`,v:f},{k:`m+`,v:p},{k:`s+`,v:m},{k:`d+`,v:h},{k:`w+`,v:g}],v;for(let{k:e,v:n}of _)if(v=RegExp(`(${e})`).exec(t),v){let e=v[1],r=n.padStart(e.length,`0`);e.includes(`W`)&&(r=T[r.slice(0,2)]),t=t.replace(e,r)}return t},ee=(e,t=`hh:mm:ss`)=>{let n=`${Math.floor(e/w)}`;t.includes(`D`)&&(e%=864e5);let r=`${Math.floor(e/C)}`;t.includes(`h`)&&(e%=36e5);let i=`${Math.floor(e/S)}`;t.includes(`m`)&&(e%=6e4);let a=`${Math.floor(e/x)}`;t.includes(`s`)&&(e%=1e3);let o=[{k:`D+`,v:n},{k:`h+`,v:r},{k:`m+`,v:i},{k:`s+`,v:a}],s;for(let{k:e,v:n}of o)if(s=RegExp(`(${e})`).exec(t),s){let e=s[1],r=n.padStart(e.length,`0`);t=t.replace(e,r)}return t},O=(e,t={})=>new Promise(async(n,r)=>{let{timeout:i=5*1e3,message:a=`timeout`}=t,o=setTimeout(()=>r(a),i);try{n(await e())}catch(e){r(e)}clearTimeout(o)}),k=c({availableWeight:()=>re,estimateDataByResolution:()=>ie,getNetworkQuality:()=>ne,isMobile:()=>te,parseBehavior:()=>j,parseCallAction:()=>oe,parsePermissions:()=>A,parseRoomAction:()=>se,parseServerAction:()=>ce,sortByMimeTypes:()=>ae}),te=()=>{let e=navigator.userAgent.toLowerCase();return RegExp(`mobile|android|iphone|ipad|ipod|windows phone|phone|webos`,`i`).test(e)},ne=(e,t,n)=>{let r=0;return r=e<.03&&t<100&&n<50?5:e<.06&&t<160&&n<100?4:e<.1&&t<250&&n<150?3:e<.15&&t<400&&n<200?2:1,r},re=[.05,.05,.05,.05,.1,.1,.1,.15,.15,.2].reverse(),ie=(e,t)=>{let n=2073600/(e*t);return Math.round(307200/n**.9)},ae=(e,t)=>e.sort((e,n)=>{let r=t.indexOf(e.mimeType),i=t.indexOf(n.mimeType);return(r>=0?r:Number.MAX_VALUE)-(i>=0?i:Number.MAX_VALUE)}),oe=e=>{let[t,n,r,i]=Number(e).toString(2).padStart(4,`0`).split(``);return{mc_audio:!!Number(i),mc_video:!!Number(r),ss_video:!!Number(n),ss_audio:!!Number(t)}},A=e=>{let[t,n]=Number(e).toString(2).padStart(4,`0`).split(``).reverse();return{publish:!!Number(n),subscribe:!!Number(t)}},j=e=>{let[t,n,r,i]=Number(e).toString(2).padStart(4,`0`).split(``);return{mc_audio:!Number(i),mc_video:!Number(r),ss_video:!Number(n),ss_audio:!Number(t)}},se=e=>{let[t,n,r,i]=Number(e).toString(2).padStart(4,`0`).split(``);return{mc_audio:!!Number(i),mc_video:!!Number(r),ss_video:!!Number(n),ss_audio:!!Number(n)}},ce=e=>{let[t,n,r,i]=Number(e).toString(2).padStart(4,`0`).split(``);return{mc_audio:!!Number(i),mc_video:!!Number(r),ss_video:!!Number(n),ss_audio:!!Number(n)}},le=class{url=``;appid=``;debug=!1;reportErr=!0;logUrl=`https://logs1.quickvo.org`;sdkToken=``;roomId=``;userId=``;callType=1;roomAction=0;stt=!0;lang={input:``,output:``,translateEnable:!1};useP2P=!0;callStrategy;autoSubscribe={mc_audio:!1,mc_video:!1,ss_audio:!1,ss_video:!1};roomState=`ready`;peerState=`new`;serviceVersion=`1.0.8`;callSession=``;isEarly=!1;earlyId=y();isInRoom=!1;sfuPriority=-1;network={sfu:{inboundBytes:0,outboundBytes:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,velocityPush:0,velocityPull:0},p2p:{inboundBytes:0,outboundBytes:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,velocityPush:0,velocityPull:0}};codecPreferences={audio:[],video:[]};constructor(){{let e=RTCRtpReceiver.getCapabilities(`video`).codecs,t=[`video/H264`,`video/VP8`,`video/VP9`];this.codecPreferences.video=ae(e,t)}}updateRoomAction=e=>{this.roomAction=e};getRoomAction=()=>this.roomAction;setOptions=e=>{e.appid!==void 0&&(this.appid=e.appid),e.url!==void 0&&(this.url=e.url),e.logUrl!==void 0&&(this.logUrl=e.logUrl),e.debug!==void 0&&(this.debug=e.debug),e.reportErr!==void 0&&(this.reportErr=e.reportErr),e.useP2P!==void 0&&(this.useP2P=e.useP2P),e.callStrategy!==void 0&&(this.callStrategy=e.callStrategy),e.sdkToken!==void 0&&(this.sdkToken=e.sdkToken),e.roomId!==void 0&&(this.roomId=e.roomId),e.userId!==void 0&&(this.userId=e.userId),e.callType!==void 0&&(this.callType=e.callType),e.stt!==void 0&&(this.stt=e.stt),e.lang!==void 0&&(this.lang={...this.lang,...e.lang}),e.autoSubscribe!==void 0&&(this.autoSubscribe=e.autoSubscribe)};createWsUrl=()=>{let{appid:e,roomId:t,userId:n,isEarly:r,earlyId:i,serviceVersion:a}=this;if(!e)throw Error(`quickvo: createSession is error. You must first use QuickVO.setOptions to set the appid.`);let o={c:e,r:t,p:`web`,h:location.hostname,v:a};r?o.i=i:o.b=n;let s=btoa(encodeURI(JSON.stringify(o))),c=`${this.url}?s=${s}&t=${Date.now()}`;return this.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: createWsUrl`,{data:o,url:c}),c}},ue=class{sfu={outboundBytes:0,inboundBytes:0};p2p={outboundBytes:0,inboundBytes:0};getUse=(e=`b`)=>{let t=1;return e===`kb`&&(t=1024),{sfu:{outboundBytes:Math.round(this.sfu.outboundBytes/t),inboundBytes:Math.round(this.sfu.inboundBytes/t)},p2p:{outboundBytes:Math.round(this.p2p.outboundBytes/t),inboundBytes:Math.round(this.p2p.inboundBytes/t)}}};clear=()=>{}};function de(e){return e}var fe=class{queue=new Map;emit=(e,t)=>{let n=this.queue.get(e)??[];for(let e of n){let n=e.callback;n?.(t)}};add=e=>{let{event:t,sn:n=y(32)}=e;this.queue.has(t)||this.queue.set(t,[]);let r=this.queue.get(t)||[],i=r.findIndex(e=>e.sn===n);return i!==-1&&r.splice(i,1),r.push(e),n}},pe={mc_audio:`麦克风-默认轨道`,mc_video:`摄像头-默认轨道`,ss_video:`屏幕共享-视频轨道`,ss_audio:`屏幕共享-音频轨道`},me=h(pe),M=Object.keys(pe),he=Object.values(pe),ge=window.AudioContext||window.webkitAudioContext,_e=class{audioContext=new ge;_onDocumentClick;_onDeviceChange;_destroyed=!1;phoneyStreamTracks={};enumerateDevices={audioinput:[],videoinput:[],audiooutput:[]};useMediaDevices={};mediaTrackConstraints={mc_audio:{autoGainControl:!0,noiseSuppression:!0,echoCancellation:!0,sampleRate:48e3,channelCount:2},mc_video:{},ss_video:{},ss_audio:{}};localStreamTracks={};on={};constructor(){this._onDocumentClick=()=>{this.audioContext&&this.audioContext.state===`suspended`&&this.audioContext.resume()},document.addEventListener(`click`,this._onDocumentClick);let e=g(this.audioContext,.001),t=_({width:32,height:32,opacity:0,fps:20,text:``});{let[t]=e.getAudioTracks();this.phoneyStreamTracks.mc_audio=t}{let[e]=t.getVideoTracks();this.phoneyStreamTracks.mc_video=e}{let[t]=e.clone().getAudioTracks();this.phoneyStreamTracks.ss_audio=t}{let[e]=t.clone().getVideoTracks();this.phoneyStreamTracks.ss_video=e}navigator.mediaDevices&&(this._onDeviceChange=()=>{this._getAllEnumerateDevices(),this.on.devicechange&&this.on.devicechange()},navigator.mediaDevices.ondevicechange=this._onDeviceChange),this._getAllEnumerateDevices()}getPhoneyStreamTrack=e=>this.phoneyStreamTracks[e];initLocalStreamTrack=async e=>{switch(e){case`mc_audio`:{let e=this._getSafetyMediaDeviceKind(`audioinput`),t=this.mediaTrackConstraints.mc_audio,n=await navigator.mediaDevices.getUserMedia({audio:{deviceId:{exact:e},...t},video:!1});this.stopLocalStreamTrack(`mc_audio`);let[r]=n.getAudioTracks();this.localStreamTracks.mc_audio=r}break;case`mc_video`:{let e=this._getSafetyMediaDeviceKind(`videoinput`),t=this.mediaTrackConstraints.mc_video,n=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:{exact:e},...t}});this.stopLocalStreamTrack(`mc_video`);let[r]=n.getVideoTracks();this.localStreamTracks.mc_video=r}break;case`mc`:{let e=this._getSafetyMediaDeviceKind(`audioinput`),t=this._getSafetyMediaDeviceKind(`videoinput`),n=this.mediaTrackConstraints.mc_audio,r=this.mediaTrackConstraints.mc_video,i=await navigator.mediaDevices.getUserMedia({audio:{deviceId:{exact:e},...n},video:{deviceId:{exact:t},...r}});this.stopLocalStreamTrack(`mc_audio`),this.stopLocalStreamTrack(`mc_video`);{let[e]=i.getAudioTracks();this.localStreamTracks.mc_audio=e}{let[e]=i.getVideoTracks();this.localStreamTracks.mc_video=e}}break;case`ss_audio`:{let e=this.mediaTrackConstraints.ss_audio,t=await navigator.mediaDevices.getDisplayMedia({audio:{...e},video:!0});this.stopLocalStreamTrack(`ss_audio`);let[n]=t.getAudioTracks();this.localStreamTracks.ss_audio=n}break;case`ss_video`:{let e=this.mediaTrackConstraints.ss_video,t=await navigator.mediaDevices.getDisplayMedia({audio:!1,video:{...e}});this.stopLocalStreamTrack(`ss_video`);let[n]=t.getVideoTracks();this.localStreamTracks.ss_video=n}break;case`ss`:{let e=this.mediaTrackConstraints.ss_audio,t=this.mediaTrackConstraints.ss_video,n={audio:{...e},video:{...t}},r=await navigator.mediaDevices.getDisplayMedia(n);this.stopLocalStreamTrack(`ss_audio`),this.stopLocalStreamTrack(`ss_video`);{let[e]=r.getAudioTracks();this.localStreamTracks.ss_audio=e}{let[e]=r.getVideoTracks();this.localStreamTracks.ss_video=e}}break}};getLocalStreamTrack=e=>this.localStreamTracks[e];checkLocalStreamTracks=e=>{let t=[],n=[];for(let r of e)this.localStreamTracks[r]?n.push(r):t.push(r);return{valid_mediaTypes:n,invalid_mediaTypes:t}};stopLocalStreamTrack=e=>{this.localStreamTracks[e]?.stop(),this.localStreamTracks[e]=void 0};isOpenMediaDevice=e=>!!this.localStreamTracks[e];setMediaTrackConstraints=async(e,t)=>{let n=this.mediaTrackConstraints[e];this.mediaTrackConstraints[e]={...n,...t}};getMediaDeviceKind=e=>this.useMediaDevices[e];setMediaDeviceKind=async(e,t)=>{this.useMediaDevices[e]=t};changeAudiooutput=async()=>{try{let e=this.useMediaDevices.audiooutput||``;await this.audioContext.setSinkId(e)}catch(e){console.error(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: setSinkId is error.`,e)}};getMediaDevicesErrInfo=async()=>{let e={mc_audio:``,mc_video:``};try{let t=await navigator.mediaDevices.enumerateDevices();t.find(e=>e.kind===`audioinput`)||(e.mc_audio=`audioinput is not available.`),t.find(e=>e.kind===`videoinput`)||(e.mc_video=`videoinput is not available.`)}catch(t){e.mc_audio=t.message||t,e.mc_video=t.message||t}return e};getEnumerateDevices=async e=>(await this._getAllEnumerateDevices(),this.enumerateDevices[e]);getEnumerateAudioinputDevices=()=>this.getEnumerateDevices(`audioinput`);getEnumerateAudioOutputDevices=()=>this.getEnumerateDevices(`audiooutput`);getEnumerateVideoinputDevices=()=>this.getEnumerateDevices(`videoinput`);_getAllEnumerateDevices=async()=>{if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return;let e=navigator.language;await navigator.mediaDevices.enumerateDevices().then(t=>{let n={audioinput:[],videoinput:[],audiooutput:[]},r=[];for(let e of t){let{kind:t,label:i,deviceId:a}=e;a!==`communications`&&(a===`default`?n[t].push({kind:t,label:i,deviceId:a}):r.push({kind:t,label:i,deviceId:a}))}n.audioinput.length===0&&n.audioinput.push({kind:`audioinput`,deviceId:`default-auto`,label:e===`zh-CN`?`默认值-自动`:`Default-Auto`}),n.videoinput.length===0&&n.videoinput.push({kind:`videoinput`,deviceId:`default-auto`,label:e===`zh-CN`?`默认值-自动`:`Default-Auto`}),n.audiooutput.length===0&&n.audiooutput.push({kind:`audiooutput`,deviceId:`default-auto`,label:e===`zh-CN`?`默认值-自动`:`Default-Auto`});for(let e of r){let{kind:t,label:r,deviceId:i}=e;n[t].push({kind:t,label:r,deviceId:i})}this.enumerateDevices=n}).catch(function(e){console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: getAllEnumerateDevices is err`,e)})};_getSafetyMediaDeviceKind=e=>{let t=this.useMediaDevices[e];return t===`default-auto`&&(t=void 0),t};destroy=async()=>{if(!this._destroyed){this._destroyed=!0,this._onDocumentClick&&=(document.removeEventListener(`click`,this._onDocumentClick),void 0),navigator.mediaDevices&&this._onDeviceChange&&navigator.mediaDevices.ondevicechange===this._onDeviceChange&&(navigator.mediaDevices.ondevicechange=null),this._onDeviceChange=void 0;for(let e of Object.keys(this.localStreamTracks))this.stopLocalStreamTrack(e);this.phoneyStreamTracks?.mc_audio&&this.phoneyStreamTracks.mc_audio.stop(),this.phoneyStreamTracks?.mc_video&&this.phoneyStreamTracks.mc_video.stop(),this.phoneyStreamTracks?.ss_audio&&this.phoneyStreamTracks.ss_audio.stop(),this.phoneyStreamTracks?.ss_video&&this.phoneyStreamTracks.ss_video.stop(),this.phoneyStreamTracks=void 0;try{this.audioContext&&this.audioContext.state!==`closed`&&await this.audioContext.close()}catch(e){console.warn(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: LocalMedias.audioContext.close is error.`,e)}}}};function ve(e){let t=!1,n=[];for(let r=0;r<e.length;r++){let i=e.charAt(r);switch(i){case`_`:t=!0;break;case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n.push(i),t=!1;break;default:t&&(t=!1,i=i.toUpperCase()),n.push(i);break}}return n.join(``)}var ye=new Set([`constructor`,`toString`,`toJSON`,`valueOf`]);function be(e){return ye.has(e)?e+`$`:e}function xe(){let e=0,t=0;for(let n=0;n<28;n+=7){let r=this.buf[this.pos++];if(e|=(r&127)<<n,!(r&128))return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(n&15)<<28,t=(n&112)>>4,!(n&128))return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let r=this.buf[this.pos++];if(t|=(r&127)<<n,!(r&128))return this.assertBounds(),[e,t]}throw Error(`invalid varint`)}function Se(e,t,n){for(let r=0;r<28;r+=7){let i=e>>>r,a=!(!(i>>>7)&&t==0),o=(a?i|128:i)&255;if(n.push(o),!a)return}let r=e>>>28&15|(t&7)<<4,i=!!(t>>3);if(n.push((i?r|128:r)&255),i){for(let e=3;e<31;e+=7){let r=t>>>e,i=!!(r>>>7),a=(i?r|128:r)&255;if(n.push(a),!i)return}n.push(t>>>31&1)}}var Ce=4294967296;function we(e){let t=e[0]===`-`;t&&(e=e.slice(1));let n=1e6,r=0,i=0;function a(t,a){let o=Number(e.slice(t,a));i*=n,r=r*n+o,r>=Ce&&(i+=r/Ce|0,r%=Ce)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?Oe(r,i):De(r,i)}function N(e,t){let n=De(e,t),r=n.hi&2147483648;r&&(n=Oe(n.lo,n.hi));let i=Te(n.lo,n.hi);return r?`-`+i:i}function Te(e,t){if({lo:e,hi:t}=Ee(e,t),t<=2097151)return String(Ce*t+e);let n=e&16777215,r=(e>>>24|t<<8)&16777215,i=t>>16&65535,a=n+r*6777216+i*6710656,o=r+i*8147497,s=i*2,c=1e7;return a>=c&&(o+=Math.floor(a/c),a%=c),o>=c&&(s+=Math.floor(o/c),o%=c),s.toString()+ke(o)+ke(a)}function Ee(e,t){return{lo:e>>>0,hi:t>>>0}}function De(e,t){return{lo:e|0,hi:t|0}}function Oe(e,t){return t=~t,e?e=~e+1:t+=1,De(e,t)}var ke=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function Ae(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e>>=7;t.push(1)}}function je(){let e=this.buf[this.pos++],t=e&127;if(!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}var P=Me();function Me(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt==`function`&&typeof e.getBigInt64==`function`&&typeof e.getBigUint64==`function`&&typeof e.setBigInt64==`function`&&typeof e.setBigUint64==`function`&&(globalThis.Deno||typeof process!=`object`||typeof process.env!=`object`||process.env.BUF_BIGINT_DISABLE!==`1`)){let t=BigInt(`-9223372036854775808`),n=BigInt(`9223372036854775807`),r=BigInt(`0`),i=BigInt(`18446744073709551615`);return{zero:BigInt(0),supported:!0,parse(e){let r=typeof e==`bigint`?e:BigInt(e);if(r>n||r<t)throw Error(`invalid int64: ${e}`);return r},uParse(e){let t=typeof e==`bigint`?e:BigInt(e);if(t>i||t<r)throw Error(`invalid uint64: ${e}`);return t},enc(t){return e.setBigInt64(0,this.parse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(t){return e.setBigInt64(0,this.uParse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(t,n){return e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigInt64(0,!0)},uDec(t,n){return e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigUint64(0,!0)}}}return{zero:`0`,supported:!1,parse(e){return typeof e!=`string`&&(e=e.toString()),Ne(e),e},uParse(e){return typeof e!=`string`&&(e=e.toString()),Pe(e),e},enc(e){return typeof e!=`string`&&(e=e.toString()),Ne(e),we(e)},uEnc(e){return typeof e!=`string`&&(e=e.toString()),Pe(e),we(e)},dec(e,t){return N(e,t)},uDec(e,t){return Te(e,t)}}}function Ne(e){if(!/^-?[0-9]+$/.test(e))throw Error(`invalid int64: `+e)}function Pe(e){if(!/^[0-9]+$/.test(e))throw Error(`invalid uint64: `+e)}var F;(function(e){e[e.DOUBLE=1]=`DOUBLE`,e[e.FLOAT=2]=`FLOAT`,e[e.INT64=3]=`INT64`,e[e.UINT64=4]=`UINT64`,e[e.INT32=5]=`INT32`,e[e.FIXED64=6]=`FIXED64`,e[e.FIXED32=7]=`FIXED32`,e[e.BOOL=8]=`BOOL`,e[e.STRING=9]=`STRING`,e[e.BYTES=12]=`BYTES`,e[e.UINT32=13]=`UINT32`,e[e.SFIXED32=15]=`SFIXED32`,e[e.SFIXED64=16]=`SFIXED64`,e[e.SINT32=17]=`SINT32`,e[e.SINT64=18]=`SINT64`})(F||={});function Fe(e,t){switch(e){case F.STRING:return``;case F.BOOL:return!1;case F.DOUBLE:case F.FLOAT:return 0;case F.INT64:case F.UINT64:case F.SFIXED64:case F.FIXED64:case F.SINT64:return t?`0`:P.zero;case F.BYTES:return new Uint8Array;default:return 0}}function Ie(e,t){switch(e){case F.BOOL:return t===!1;case F.STRING:return t===``;case F.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return t==0}}var Le=2,Re=Symbol.for(`reflect unsafe local`);function ze(e,t){let n=e[t.localName].case;return n===void 0?n:t.fields.find(e=>e.localName===n)}function Be(e,t){let n=t.localName;if(t.oneof)return e[t.oneof.localName].case===n;if(t.presence!=Le)return e[n]!==void 0&&Object.prototype.hasOwnProperty.call(e,n);switch(t.fieldKind){case`list`:return e[n].length>0;case`map`:return Object.keys(e[n]).length>0;case`scalar`:return!Ie(t.scalar,e[n]);case`enum`:return e[n]!==t.enum.values[0].number}throw Error(`message field with implicit presence`)}function Ve(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0}function He(e,t){if(t.oneof){let n=e[t.oneof.localName];return n.case===t.localName?n.value:void 0}return e[t.localName]}function Ue(e,t,n){t.oneof?e[t.oneof.localName]={case:t.localName,value:n}:e[t.localName]=n}function We(e,t){let n=t.localName;if(t.oneof){let r=t.oneof.localName;e[r].case===n&&(e[r]={case:void 0})}else if(t.presence!=Le)delete e[n];else switch(t.fieldKind){case`map`:e[n]={};break;case`list`:e[n]=[];break;case`enum`:e[n]=t.enum.values[0].number;break;case`scalar`:e[n]=Fe(t.scalar,t.longAsString);break}}function Ge(e){for(let t of e.field)Ve(t,`jsonName`)||(t.jsonName=ve(t.name));e.nestedType.forEach(Ge)}function Ke(e,t){let n=e.values.find(e=>e.name===t);if(!n)throw Error(`cannot parse ${e} default value: ${t}`);return n.number}function qe(e,t){switch(e){case F.STRING:return t;case F.BYTES:{let n=Je(t);if(n===!1)throw Error(`cannot parse ${F[e]} default value: ${t}`);return n}case F.INT64:case F.SFIXED64:case F.SINT64:return P.parse(t);case F.UINT64:case F.FIXED64:return P.uParse(t);case F.DOUBLE:case F.FLOAT:switch(t){case`inf`:return 1/0;case`-inf`:return-1/0;case`nan`:return NaN;default:return parseFloat(t)}case F.BOOL:return t===`true`;case F.INT32:case F.UINT32:case F.SINT32:case F.FIXED32:case F.SFIXED32:return parseInt(t,10)}}function Je(e){let t=[],n={tail:e,c:``,next(){return this.tail.length==0?!1:(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(e){if(this.tail.length>=e){let t=this.tail.substring(0,e);return this.tail=this.tail.substring(e),t}return!1}};for(;n.next();)switch(n.c){case`\\`:if(n.next())switch(n.c){case`\\`:t.push(n.c.charCodeAt(0));break;case`b`:t.push(8);break;case`f`:t.push(12);break;case`n`:t.push(10);break;case`r`:t.push(13);break;case`t`:t.push(9);break;case`v`:t.push(11);break;case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:{let e=n.c,r=n.take(2);if(r===!1)return!1;let i=parseInt(e+r,8);if(Number.isNaN(i))return!1;t.push(i);break}case`x`:{let e=n.c,r=n.take(2);if(r===!1)return!1;let i=parseInt(e+r,16);if(Number.isNaN(i))return!1;t.push(i);break}case`u`:{let e=n.c,r=n.take(4);if(r===!1)return!1;let i=parseInt(e+r,16);if(Number.isNaN(i))return!1;let a=new Uint8Array(4);new DataView(a.buffer).setInt32(0,i,!0),t.push(a[0],a[1],a[2],a[3]);break}case`U`:{let e=n.c,r=n.take(8);if(r===!1)return!1;let i=P.uEnc(e+r),a=new Uint8Array(8),o=new DataView(a.buffer);o.setInt32(0,i.lo,!0),o.setInt32(4,i.hi,!0),t.push(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]);break}}break;default:t.push(n.c.charCodeAt(0))}return new Uint8Array(t)}function*Ye(e){switch(e.kind){case`file`:for(let t of e.messages)yield t,yield*Ye(t);yield*e.enums,yield*e.services,yield*e.extensions;break;case`message`:for(let t of e.nestedMessages)yield t,yield*Ye(t);yield*e.nestedEnums,yield*e.nestedExtensions;break}}function Xe(...e){let t=Ze();if(!e.length)return t;if(`$typeName`in e[0]&&e[0].$typeName==`google.protobuf.FileDescriptorSet`){for(let n of e[0].file)gt(n,t);return t}if(`$typeName`in e[0]){let n=e[0],r=e[1],i=new Set;function a(e){let n=[];for(let a of e.dependency){if(t.getFile(a)!=null||i.has(a))continue;let o=r(a);if(!o)throw Error(`Unable to resolve ${a}, imported by ${e.name}`);`kind`in o?t.addFile(o,!1,!0):(i.add(o.name),n.push(o))}return n.concat(...n.map(a))}for(let e of[n,...a(n)].reverse())gt(e,t)}else for(let n of e)for(let e of n.files)t.addFile(e);return t}function Ze(){let e=new Map,t=new Map,n=new Map;return{kind:`registry`,types:e,extendees:t,[Symbol.iterator](){return e.values()},get files(){return n.values()},addFile(e,t,r){if(n.set(e.proto.name,e),!t)for(let t of Ye(e))this.add(t);if(r)for(let n of e.dependencies)this.addFile(n,t,r)},add(n){if(n.kind==`extension`){let e=t.get(n.extendee.typeName);e||t.set(n.extendee.typeName,e=new Map),e.set(n.number,n)}e.set(n.typeName,n)},get(t){return e.get(t)},getFile(e){return n.get(e)},getMessage(t){let n=e.get(t);return n?.kind==`message`?n:void 0},getEnum(t){let n=e.get(t);return n?.kind==`enum`?n:void 0},getExtension(t){let n=e.get(t);return n?.kind==`extension`?n:void 0},getExtensionFor(e,n){return t.get(e.typeName)?.get(n)},getService(t){let n=e.get(t);return n?.kind==`service`?n:void 0}}}var Qe=998,$e=999,et=9,tt=10,nt=11,rt=12,it=14,at=3,ot=2,st=1,ct=0,lt=1,ut=2,dt=3,ft=1,pt=2,mt=1,ht={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2,defaultSymbolVisibility:1},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1001:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:1,defaultSymbolVisibility:2}};function gt(e,t){let n={kind:`file`,proto:e,deprecated:e.options?.deprecated??!1,edition:Tt(e),name:e.name.replace(/\.proto$/,``),dependencies:Et(e,t),enums:[],messages:[],extensions:[],services:[],toString(){return`file ${e.name}`}},r=new Map,i={get(e){return r.get(e)},add(e){Rt(e.proto.options?.mapEntry===!0),r.set(e.typeName,e)}};for(let r of e.enumType)yt(r,n,void 0,t);for(let r of e.messageType)bt(r,n,void 0,t,i);for(let r of e.service)xt(r,n,t);_t(n,t);for(let e of r.values())vt(e,t,i);for(let e of n.messages)vt(e,t,i),_t(e,t);t.addFile(n,!0)}function _t(e,t){switch(e.kind){case`file`:for(let n of e.proto.extension){let r=wt(n,e,t);e.extensions.push(r),t.add(r)}break;case`message`:for(let n of e.proto.extension){let r=wt(n,e,t);e.nestedExtensions.push(r),t.add(r)}for(let n of e.nestedMessages)_t(n,t);break}}function vt(e,t,n){let r=e.proto.oneofDecl.map(t=>Ct(t,e)),i=new Set;for(let a of e.proto.field){let o=jt(a,r),s=wt(a,e,t,o,n);e.fields.push(s),e.field[s.localName]=s,o===void 0?e.members.push(s):(o.fields.push(s),i.has(o)||(i.add(o),e.members.push(o)))}for(let t of r.filter(e=>i.has(e)))e.oneofs.push(t);for(let r of e.nestedMessages)vt(r,t,n)}function yt(e,t,n,r){let i=Dt(e.name,e.value),a={kind:`enum`,proto:e,deprecated:e.options?.deprecated??!1,file:t,parent:n,open:!0,name:e.name,typeName:kt(e,n,t),value:{},values:[],sharedPrefix:i,toString(){return`enum ${this.typeName}`}};a.open=Ft(a),r.add(a);for(let t of e.value){let e=t.name;a.values.push(a.value[t.number]={kind:`enum_value`,proto:t,deprecated:t.options?.deprecated??!1,parent:a,name:e,localName:be(i==null?e:e.substring(i.length)),number:t.number,toString(){return`enum value ${a.typeName}.${e}`}})}(n?.nestedEnums??t.enums).push(a)}function bt(e,t,n,r,i){let a={kind:`message`,proto:e,deprecated:e.options?.deprecated??!1,file:t,parent:n,name:e.name,typeName:kt(e,n,t),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};e.options?.mapEntry===!0?i.add(a):((n?.nestedMessages??t.messages).push(a),r.add(a));for(let n of e.enumType)yt(n,t,a,r);for(let n of e.nestedType)bt(n,t,a,r,i)}function xt(e,t,n){let r={kind:`service`,proto:e,deprecated:e.options?.deprecated??!1,file:t,name:e.name,typeName:kt(e,void 0,t),methods:[],method:{},toString(){return`service ${this.typeName}`}};t.services.push(r),n.add(r);for(let t of e.method){let e=St(t,r,n);r.methods.push(e),r.method[e.localName]=e}}function St(e,t,n){let r;r=e.clientStreaming&&e.serverStreaming?`bidi_streaming`:e.clientStreaming?`client_streaming`:e.serverStreaming?`server_streaming`:`unary`;let i=n.getMessage(At(e.inputType)),a=n.getMessage(At(e.outputType));Rt(i,`invalid MethodDescriptorProto: input_type ${e.inputType} not found`),Rt(a,`invalid MethodDescriptorProto: output_type ${e.inputType} not found`);let o=e.name;return{kind:`rpc`,proto:e,deprecated:e.options?.deprecated??!1,parent:t,name:o,localName:be(o.length?be(o[0].toLowerCase()+o.substring(1)):o),methodKind:r,input:i,output:a,idempotency:e.options?.idempotencyLevel??ct,toString(){return`rpc ${t.typeName}.${o}`}}}function Ct(e,t){return{kind:`oneof`,proto:e,deprecated:!1,parent:t,fields:[],name:e.name,localName:be(ve(e.name)),toString(){return`oneof ${t.typeName}.${this.name}`}}}function wt(e,t,n,r,i){let a=i===void 0,o={kind:`field`,proto:e,deprecated:e.options?.deprecated??!1,name:e.name,number:e.number,scalar:void 0,message:void 0,enum:void 0,presence:Mt(e,r,a,t),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(a){let r=t.kind==`file`?t:t.file,i=t.kind==`file`?void 0:t,a=kt(e,i,r);o.kind=`extension`,o.file=r,o.parent=i,o.oneof=void 0,o.typeName=a,o.jsonName=`[${a}]`,o.toString=()=>`extension ${a}`;let s=n.getMessage(At(e.extendee));Rt(s,`invalid FieldDescriptorProto: extendee ${e.extendee} not found`),o.extendee=s}else{let n=t;Rt(n.kind==`message`),o.parent=n,o.oneof=r,o.localName=r?ve(e.name):be(ve(e.name)),o.jsonName=e.jsonName,o.toString=()=>`field ${n.typeName}.${e.name}`}let s=e.label,c=e.type,l=e.options?.jstype;if(s===at){let r=c==nt?i?.get(At(e.typeName)):void 0;if(r){o.fieldKind=`map`;let{key:e,value:t}=Pt(r);return o.mapKey=e.scalar,o.mapKind=t.fieldKind,o.message=t.message,o.delimitedEncoding=!1,o.enum=t.enum,o.scalar=t.scalar,o}switch(o.fieldKind=`list`,c){case nt:case tt:o.listKind=`message`,o.message=n.getMessage(At(e.typeName)),Rt(o.message),o.delimitedEncoding=It(e,t);break;case it:o.listKind=`enum`,o.enum=n.getEnum(At(e.typeName)),Rt(o.enum);break;default:o.listKind=`scalar`,o.scalar=c,o.longAsString=l==st;break}return o.packed=Nt(e,t),o}switch(c){case nt:case tt:o.fieldKind=`message`,o.message=n.getMessage(At(e.typeName)),Rt(o.message,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),o.delimitedEncoding=It(e,t),o.getDefaultValue=()=>void 0;break;case it:{let t=n.getEnum(At(e.typeName));Rt(t!==void 0,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),o.fieldKind=`enum`,o.enum=n.getEnum(At(e.typeName)),o.getDefaultValue=()=>Ve(e,`defaultValue`)?Ke(t,e.defaultValue):void 0;break}default:o.fieldKind=`scalar`,o.scalar=c,o.longAsString=l==st,o.getDefaultValue=()=>Ve(e,`defaultValue`)?qe(c,e.defaultValue):void 0;break}return o}function Tt(e){switch(e.syntax){case``:case`proto2`:return Qe;case`proto3`:return $e;case`editions`:if(e.edition in ht)return e.edition;throw Error(`${e.name}: unsupported edition`);default:throw Error(`${e.name}: unsupported syntax "${e.syntax}"`)}}function Et(e,t){return e.dependency.map(n=>{let r=t.getFile(n);if(!r)throw Error(`Cannot find ${n}, imported by ${e.name}`);return r})}function Dt(e,t){let n=Ot(e)+`_`;for(let e of t){if(!e.name.toLowerCase().startsWith(n))return;let t=e.name.substring(n.length);if(t.length==0||/^\d/.test(t))return}return n}function Ot(e){return(e.substring(0,1)+e.substring(1).replace(/[A-Z]/g,e=>`_`+e)).toLowerCase()}function kt(e,t,n){let r;return r=t?`${t.typeName}.${e.name}`:n.proto.package.length>0?`${n.proto.package}.${e.name}`:`${e.name}`,r}function At(e){return e.startsWith(`.`)?e.substring(1):e}function jt(e,t){if(!Ve(e,`oneofIndex`)||e.proto3Optional)return;let n=t[e.oneofIndex];return Rt(n,`invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`),n}function Mt(e,t,n,r){if(e.label==ot)return dt;if(e.label==at)return ut;if(t||e.proto3Optional||n)return lt;let i=Lt(`fieldPresence`,{proto:e,parent:r});return i==ut&&(e.type==nt||e.type==tt)?lt:i}function Nt(e,t){if(e.label!=at)return!1;switch(e.type){case et:case rt:case tt:case nt:return!1}let n=e.options;return n&&Ve(n,`packed`)?n.packed:ft==Lt(`repeatedFieldEncoding`,{proto:e,parent:t})}function Pt(e){let t=e.fields.find(e=>e.number===1),n=e.fields.find(e=>e.number===2);return Rt(t&&t.fieldKind==`scalar`&&t.scalar!=F.BYTES&&t.scalar!=F.FLOAT&&t.scalar!=F.DOUBLE&&n&&n.fieldKind!=`list`&&n.fieldKind!=`map`),{key:t,value:n}}function Ft(e){return mt==Lt(`enumType`,{proto:e.proto,parent:e.parent??e.file})}function It(e,t){return e.type==tt?!0:pt==Lt(`messageEncoding`,{proto:e,parent:t})}function Lt(e,t){let n=t.proto.options?.features;if(n){let t=n[e];if(t!=0)return t}if(`kind`in t){if(t.kind==`message`)return Lt(e,t.parent??t.file);let n=ht[t.edition];if(!n)throw Error(`feature default for edition ${t.edition} not found`);return n[e]}return Lt(e,t.parent)}function Rt(e,t){if(!e)throw Error(t)}function zt(e){let t=Bt(e);return t.messageType.forEach(Ge),Xe(t,()=>void 0).getFile(t.name)}function Bt(e){return Object.assign(Object.create({syntax:``,edition:0}),Object.assign(Object.assign({$typeName:`google.protobuf.FileDescriptorProto`,dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},e),{messageType:e.messageType.map(Vt),enumType:e.enumType.map(Wt)}))}function Vt(e){return Object.assign(Object.create({visibility:0}),{$typeName:`google.protobuf.DescriptorProto`,name:e.name,field:e.field?.map(Ht)??[],extension:[],nestedType:e.nestedType?.map(Vt)??[],enumType:e.enumType?.map(Wt)??[],extensionRange:e.extensionRange?.map(e=>Object.assign({$typeName:`google.protobuf.DescriptorProto.ExtensionRange`},e))??[],oneofDecl:[],reservedRange:[],reservedName:[]})}function Ht(e){return Object.assign(Object.create({label:1,typeName:``,extendee:``,defaultValue:``,oneofIndex:0,jsonName:``,proto3Optional:!1}),Object.assign(Object.assign({$typeName:`google.protobuf.FieldDescriptorProto`},e),{options:e.options?Ut(e.options):void 0}))}function Ut(e){return Object.assign(Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0}),Object.assign(Object.assign({$typeName:`google.protobuf.FieldOptions`},e),{targets:e.targets??[],editionDefaults:e.editionDefaults?.map(e=>Object.assign({$typeName:`google.protobuf.FieldOptions.EditionDefault`},e))??[],uninterpretedOption:[]}))}function Wt(e){return Object.assign(Object.create({visibility:0}),{$typeName:`google.protobuf.EnumDescriptorProto`,name:e.name,reservedName:[],reservedRange:[],value:e.value.map(e=>Object.assign({$typeName:`google.protobuf.EnumValueDescriptorProto`},e))})}function Gt(e){let t=Xt(),n=e.length*3/4;e[e.length-2]==`=`?n-=2:e[e.length-1]==`=`&&--n;let r=new Uint8Array(n),i=0,a=0,o,s=0;for(let n=0;n<e.length;n++){if(o=t[e.charCodeAt(n)],o===void 0)switch(e[n]){case`=`:a=0;case`
2
+ `:case`\r`:case` `:case` `:continue;default:throw Error(`invalid base64 string`)}switch(a){case 0:s=o,a=1;break;case 1:r[i++]=s<<2|(o&48)>>4,s=o,a=2;break;case 2:r[i++]=(s&15)<<4|(o&60)>>2,s=o,a=3;break;case 3:r[i++]=(s&3)<<6|o,a=0;break}}if(a==1)throw Error(`invalid base64 string`);return r.subarray(0,i)}var Kt,qt,Jt;function Yt(e){return Kt||(Kt=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.split(``),qt=Kt.slice(0,-2).concat(`-`,`_`)),e==`url`?qt:Kt}function Xt(){if(!Jt){Jt=[];let e=Yt(`std`);for(let t=0;t<e.length;t++)Jt[e[t].charCodeAt(0)]=t;Jt[45]=e.indexOf(`+`),Jt[95]=e.indexOf(`/`)}return Jt}function Zt(e,t){return typeof e==`object`&&e&&`$typeName`in e&&typeof e.$typeName==`string`?t===void 0?!0:t.typeName===e.$typeName:!1}var Qt=class extends Error{constructor(e,t,n=`FieldValueInvalidError`){super(t),this.name=n,this.field=()=>e}};function $t(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function en(e,t){if($t(e)&&Re in e&&`add`in e&&`field`in e&&typeof e.field==`function`){if(t!==void 0){let n=t,r=e.field();return n.listKind==r.listKind&&n.scalar===r.scalar&&n.message?.typeName===r.message?.typeName&&n.enum?.typeName===r.enum?.typeName}return!0}return!1}function tn(e,t){if($t(e)&&Re in e&&`has`in e&&`field`in e&&typeof e.field==`function`){if(t!==void 0){let n=t,r=e.field();return n.mapKey===r.mapKey&&n.mapKind==r.mapKind&&n.scalar===r.scalar&&n.message?.typeName===r.message?.typeName&&n.enum?.typeName===r.enum?.typeName}return!0}return!1}function nn(e,t){return $t(e)&&Re in e&&`desc`in e&&$t(e.desc)&&e.desc.kind===`message`&&(t===void 0||e.desc.typeName==t.typeName)}var rn=Symbol.for(`@bufbuild/protobuf/text-encoding`);function an(){if(globalThis[rn]==null){let e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[rn]={encodeUtf8(t){return e.encode(t)},decodeUtf8(e){return t.decode(e)},checkUtf8(e){try{return!0}catch{return!1}}}}return globalThis[rn]}var I;(function(e){e[e.Varint=0]=`Varint`,e[e.Bit64=1]=`Bit64`,e[e.LengthDelimited=2]=`LengthDelimited`,e[e.StartGroup=3]=`StartGroup`,e[e.EndGroup=4]=`EndGroup`,e[e.Bit32=5]=`Bit32`})(I||={});var on=class{constructor(e=an().encodeUtf8){this.encodeUtf8=e,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let e=0;for(let t=0;t<this.chunks.length;t++)e+=this.chunks[t].length;let t=new Uint8Array(e),n=0;for(let e=0;e<this.chunks.length;e++)t.set(this.chunks[e],n),n+=this.chunks[e].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw Error(`invalid state, fork stack empty`);return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(ln(e);e>127;)this.buf.push(e&127|128),e>>>=7;return this.buf.push(e),this}int32(e){return cn(e),Ae(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.encodeUtf8(e);return this.uint32(t.byteLength),this.raw(t)}float(e){un(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){ln(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){cn(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return cn(e),e=(e<<1^e>>31)>>>0,Ae(e,this.buf),this}sfixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=P.enc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=P.uEnc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}int64(e){let t=P.enc(e);return Se(t.lo,t.hi,this.buf),this}sint64(e){let t=P.enc(e),n=t.hi>>31;return Se(t.lo<<1^n,(t.hi<<1|t.lo>>>31)^n,this.buf),this}uint64(e){let t=P.uEnc(e);return Se(t.lo,t.hi,this.buf),this}},sn=class{constructor(e,t=an().decodeUtf8){this.decodeUtf8=t,this.varint64=xe,this.uint32=je,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),t=e>>>3,n=e&7;if(t<=0||n<0||n>5)throw Error(`illegal tag: field no `+t+` wire type `+n);return[t,n]}skip(e,t){let n=this.pos;switch(e){case I.Varint:for(;this.buf[this.pos++]&128;);break;case I.Bit64:this.pos+=4;case I.Bit32:this.pos+=4;break;case I.LengthDelimited:let n=this.uint32();this.pos+=n;break;case I.StartGroup:for(;;){let[e,n]=this.tag();if(n===I.EndGroup){if(t!==void 0&&e!==t)throw Error(`invalid end group tag`);break}this.skip(n,e)}break;default:throw Error(`cant skip wire type `+e)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return P.dec(...this.varint64())}uint64(){return P.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),n=-(e&1);return e=(e>>>1|(t&1)<<31)^n,t=t>>>1^n,P.dec(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return P.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return P.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.decodeUtf8(this.bytes())}};function cn(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid int32: `+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw Error(`invalid int32: `+e)}function ln(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid uint32: `+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw Error(`invalid uint32: `+e)}function un(e){if(typeof e==`string`){let t=e;if(e=Number(e),Number.isNaN(e)&&t!==`NaN`)throw Error(`invalid float32: `+t)}else if(typeof e!=`number`)throw Error(`invalid float32: `+typeof e);if(Number.isFinite(e)&&(e>34028234663852886e22||e<-34028234663852886e22))throw Error(`invalid float32: `+e)}function dn(e,t){let n=e.fieldKind==`list`?en(t,e):e.fieldKind==`map`?tn(t,e):mn(e,t);if(n===!0)return;let r;switch(e.fieldKind){case`list`:r=`expected ${yn(e)}, got ${_n(t)}`;break;case`map`:r=`expected ${bn(e)}, got ${_n(t)}`;break;default:r=gn(e,t,n)}return new Qt(e,r)}function fn(e,t,n){let r=mn(e,n);if(r!==!0)return new Qt(e,`list item #${t+1}: ${gn(e,n,r)}`)}function pn(e,t,n){let r=hn(t,e.mapKey);if(r!==!0)return new Qt(e,`invalid map key: ${gn({scalar:e.mapKey},t,r)}`);let i=mn(e,n);if(i!==!0)return new Qt(e,`map entry ${_n(t)}: ${gn(e,n,i)}`)}function mn(e,t){return e.scalar===void 0?e.enum===void 0?nn(t,e.message):e.enum.open?Number.isInteger(t):e.enum.values.some(e=>e.number===t):hn(t,e.scalar)}function hn(e,t){switch(t){case F.DOUBLE:return typeof e==`number`;case F.FLOAT:return typeof e==`number`?Number.isNaN(e)||!Number.isFinite(e)?!0:e>34028234663852886e22||e<-34028234663852886e22?`${e.toFixed()} out of range`:!0:!1;case F.INT32:case F.SFIXED32:case F.SINT32:return typeof e!=`number`||!Number.isInteger(e)?!1:e>2147483647||e<-2147483648?`${e.toFixed()} out of range`:!0;case F.FIXED32:case F.UINT32:return typeof e!=`number`||!Number.isInteger(e)?!1:e>4294967295||e<0?`${e.toFixed()} out of range`:!0;case F.BOOL:return typeof e==`boolean`;case F.STRING:return typeof e==`string`?an().checkUtf8(e)||`invalid UTF8`:!1;case F.BYTES:return e instanceof Uint8Array;case F.INT64:case F.SFIXED64:case F.SINT64:if(typeof e==`bigint`||typeof e==`number`||typeof e==`string`&&e.length>0)try{return P.parse(e),!0}catch{return`${e} out of range`}return!1;case F.FIXED64:case F.UINT64:if(typeof e==`bigint`||typeof e==`number`||typeof e==`string`&&e.length>0)try{return P.uParse(e),!0}catch{return`${e} out of range`}return!1}}function gn(e,t,n){return n=typeof n==`string`?`: ${n}`:`, got ${_n(t)}`,e.scalar===void 0?e.enum===void 0?`expected ${vn(e.message)}`+n:`expected ${e.enum.toString()}`+n:`expected ${xn(e.scalar)}`+n}function _n(e){switch(typeof e){case`object`:return e===null?`null`:e instanceof Uint8Array?`Uint8Array(${e.length})`:Array.isArray(e)?`Array(${e.length})`:en(e)?yn(e.field()):tn(e)?bn(e.field()):nn(e)?vn(e.desc):Zt(e)?`message ${e.$typeName}`:`object`;case`string`:return e.length>30?`string`:`"${e.split(`"`).join(`\\"`)}"`;case`boolean`:return String(e);case`number`:return String(e);case`bigint`:return String(e)+`n`;default:return typeof e}}function vn(e){return`ReflectMessage (${e.typeName})`}function yn(e){switch(e.listKind){case`message`:return`ReflectList (${e.message.toString()})`;case`enum`:return`ReflectList (${e.enum.toString()})`;case`scalar`:return`ReflectList (${F[e.scalar]})`}}function bn(e){switch(e.mapKind){case`message`:return`ReflectMap (${F[e.mapKey]}, ${e.message.toString()})`;case`enum`:return`ReflectMap (${F[e.mapKey]}, ${e.enum.toString()})`;case`scalar`:return`ReflectMap (${F[e.mapKey]}, ${F[e.scalar]})`}}function xn(e){switch(e){case F.STRING:return`string`;case F.BOOL:return`boolean`;case F.INT64:case F.SINT64:case F.SFIXED64:return`bigint (int64)`;case F.UINT64:case F.FIXED64:return`bigint (uint64)`;case F.BYTES:return`Uint8Array`;case F.DOUBLE:return`number (float64)`;case F.FLOAT:return`number (float32)`;case F.FIXED32:case F.UINT32:return`number (uint32)`;case F.INT32:case F.SFIXED32:case F.SINT32:return`number (int32)`}}function Sn(e){return wn(e.$typeName)}function Cn(e){let t=e.fields[0];return wn(e.typeName)&&t!==void 0&&t.fieldKind==`scalar`&&t.name==`value`&&t.number==1}function wn(e){return e.startsWith(`google.protobuf.`)&&[`DoubleValue`,`FloatValue`,`Int64Value`,`UInt64Value`,`Int32Value`,`UInt32Value`,`BoolValue`,`StringValue`,`BytesValue`].includes(e.substring(16))}var Tn=999,En=998,Dn=2;function On(e,t){if(Zt(t,e))return t;let n=Rn(e);return t!==void 0&&kn(e,n,t),n}function kn(e,t,n){for(let r of e.members){let e=n[r.localName];if(e==null)continue;let i;if(r.kind==`oneof`){let t=ze(n,r);if(!t)continue;i=t,e=He(n,t)}else i=r;switch(i.fieldKind){case`message`:e=Nn(i,e);break;case`scalar`:e=An(i,e);break;case`list`:e=Mn(i,e);break;case`map`:e=jn(i,e);break}Ue(t,i,e)}return t}function An(e,t){return e.scalar==F.BYTES?Pn(t):t}function jn(e,t){if($t(t)){if(e.scalar==F.BYTES)return Fn(t,Pn);if(e.mapKind==`message`)return Fn(t,t=>Nn(e,t))}return t}function Mn(e,t){if(Array.isArray(t)){if(e.scalar==F.BYTES)return t.map(Pn);if(e.listKind==`message`)return t.map(t=>Nn(e,t))}return t}function Nn(e,t){if(e.fieldKind==`message`&&!e.oneof&&Cn(e.message))return An(e.message.fields[0],t);if($t(t)){if(e.message.typeName==`google.protobuf.Struct`&&e.parent.typeName!==`google.protobuf.Value`)return t;if(!Zt(t,e.message))return On(e.message,t)}return t}function Pn(e){return Array.isArray(e)?new Uint8Array(e):e}function Fn(e,t){let n={};for(let r of Object.entries(e))n[r[0]]=t(r[1]);return n}var In=Symbol(),Ln=new WeakMap;function Rn(e){let t;if(zn(e)){let n=Ln.get(e),r,i;if(n)({prototype:r,members:i}=n);else{r={},i=new Set;for(let t of e.members)t.kind!=`oneof`&&(t.fieldKind!=`scalar`&&t.fieldKind!=`enum`||t.presence!=Dn&&(i.add(t),r[t.localName]=Bn(t)));Ln.set(e,{prototype:r,members:i})}t=Object.create(r),t.$typeName=e.typeName;for(let n of e.members)i.has(n)||n.kind==`field`&&(n.fieldKind==`message`||(n.fieldKind==`scalar`||n.fieldKind==`enum`)&&n.presence!=Dn)||(t[n.localName]=Bn(n))}else{t={$typeName:e.typeName};for(let n of e.members)(n.kind==`oneof`||n.presence==Dn)&&(t[n.localName]=Bn(n))}return t}function zn(e){switch(e.file.edition){case Tn:return!1;case En:return!0;default:return e.fields.some(e=>e.presence!=Dn&&e.fieldKind!=`message`&&!e.oneof)}}function Bn(e){if(e.kind==`oneof`)return{case:void 0};if(e.fieldKind==`list`)return[];if(e.fieldKind==`map`)return{};if(e.fieldKind==`message`)return In;let t=e.getDefaultValue();return t===void 0?e.fieldKind==`scalar`?Fe(e.scalar,e.longAsString):e.enum.values[0].number:e.fieldKind==`scalar`&&e.longAsString?t.toString():t}function Vn(e,t,n=!0){return new Un(e,t,n)}var Hn=new WeakMap,Un=class{get sortedFields(){let e=Hn.get(this.desc);if(e)return e;let t=this.desc.fields.concat().sort((e,t)=>e.number-t.number);return Hn.set(this.desc,t),t}constructor(e,t,n=!0){this.lists=new Map,this.maps=new Map,this.check=n,this.desc=e,this.message=this[Re]=t??On(e),this.fields=e.fields,this.oneofs=e.oneofs,this.members=e.members}findNumber(e){return this._fieldsByNumber||=new Map(this.desc.fields.map(e=>[e.number,e])),this._fieldsByNumber.get(e)}oneofCase(e){return Wn(this.message,e),ze(this.message,e)}isSet(e){return Wn(this.message,e),Be(this.message,e)}clear(e){Wn(this.message,e),We(this.message,e)}get(e){Wn(this.message,e);let t=He(this.message,e);switch(e.fieldKind){case`list`:let n=this.lists.get(e);return(!n||n[Re]!==t)&&this.lists.set(e,n=new Gn(e,t,this.check)),n;case`map`:let r=this.maps.get(e);return(!r||r[Re]!==t)&&this.maps.set(e,r=new Kn(e,t,this.check)),r;case`message`:return Jn(e,t,this.check);case`scalar`:return t===void 0?Fe(e.scalar,!1):tr(e,t);case`enum`:return t??e.enum.values[0].number}}set(e,t){if(Wn(this.message,e),this.check){let n=dn(e,t);if(n)throw n}let n;n=e.fieldKind==`message`?qn(e,t):tn(t)||en(t)?t[Re]:nr(e,t),Ue(this.message,e,n)}getUnknown(){return this.message.$unknown}setUnknown(e){this.message.$unknown=e}};function Wn(e,t){if(t.parent.typeName!==e.$typeName)throw new Qt(t,`cannot use ${t.toString()} with message ${e.$typeName}`,`ForeignFieldError`)}var Gn=class{field(){return this._field}get size(){return this._arr.length}constructor(e,t,n){this._field=e,this._arr=this[Re]=t,this.check=n}get(e){let t=this._arr[e];return t===void 0?void 0:Xn(this._field,t,this.check)}set(e,t){if(e<0||e>=this._arr.length)throw new Qt(this._field,`list item #${e+1}: out of range`);if(this.check){let n=fn(this._field,e,t);if(n)throw n}this._arr[e]=Yn(this._field,t)}add(e){if(this.check){let t=fn(this._field,this._arr.length,e);if(t)throw t}this._arr.push(Yn(this._field,e))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(let e of this._arr)yield Xn(this._field,e,this.check)}*entries(){for(let e=0;e<this._arr.length;e++)yield[e,Xn(this._field,this._arr[e],this.check)]}},Kn=class{constructor(e,t,n=!0){this.obj=this[Re]=t??{},this.check=n,this._field=e}field(){return this._field}set(e,t){if(this.check){let n=pn(this._field,e,t);if(n)throw n}return this.obj[$n(e)]=Zn(this._field,t),this}delete(e){let t=$n(e),n=Object.prototype.hasOwnProperty.call(this.obj,t);return n&&delete this.obj[t],n}clear(){for(let e of Object.keys(this.obj))delete this.obj[e]}get(e){let t=this.obj[$n(e)];return t!==void 0&&(t=Qn(this._field,t,this.check)),t}has(e){return Object.prototype.hasOwnProperty.call(this.obj,$n(e))}*keys(){for(let e of Object.keys(this.obj))yield er(e,this._field.mapKey)}*entries(){for(let e of Object.entries(this.obj))yield[er(e[0],this._field.mapKey),Qn(this._field,e[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(let e of Object.values(this.obj))yield Qn(this._field,e,this.check)}forEach(e,t){for(let n of this.entries())e.call(t,n[1],n[0],this)}};function qn(e,t){return nn(t)?Sn(t.message)&&!e.oneof&&e.fieldKind==`message`?t.message.value:t.desc.typeName==`google.protobuf.Struct`&&e.parent.typeName!=`google.protobuf.Value`?ir(t.message):t.message:t}function Jn(e,t,n){return t!==void 0&&(Cn(e.message)&&!e.oneof&&e.fieldKind==`message`?t={$typeName:e.message.typeName,value:tr(e.message.fields[0],t)}:e.message.typeName==`google.protobuf.Struct`&&e.parent.typeName!=`google.protobuf.Value`&&$t(t)&&(t=rr(t))),new Un(e.message,t,n)}function Yn(e,t){return e.listKind==`message`?qn(e,t):nr(e,t)}function Xn(e,t,n){return e.listKind==`message`?Jn(e,t,n):tr(e,t)}function Zn(e,t){return e.mapKind==`message`?qn(e,t):nr(e,t)}function Qn(e,t,n){return e.mapKind==`message`?Jn(e,t,n):t}function $n(e){return typeof e==`string`||typeof e==`number`?e:String(e)}function er(e,t){switch(t){case F.STRING:return e;case F.INT32:case F.FIXED32:case F.UINT32:case F.SFIXED32:case F.SINT32:{let t=Number.parseInt(e);if(Number.isFinite(t))return t;break}case F.BOOL:switch(e){case`true`:return!0;case`false`:return!1}break;case F.UINT64:case F.FIXED64:try{return P.uParse(e)}catch{}break;default:try{return P.parse(e)}catch{}break}return e}function tr(e,t){switch(e.scalar){case F.INT64:case F.SFIXED64:case F.SINT64:`longAsString`in e&&e.longAsString&&typeof t==`string`&&(t=P.parse(t));break;case F.FIXED64:case F.UINT64:`longAsString`in e&&e.longAsString&&typeof t==`string`&&(t=P.uParse(t));break}return t}function nr(e,t){switch(e.scalar){case F.INT64:case F.SFIXED64:case F.SINT64:`longAsString`in e&&e.longAsString?t=String(t):(typeof t==`string`||typeof t==`number`)&&(t=P.parse(t));break;case F.FIXED64:case F.UINT64:`longAsString`in e&&e.longAsString?t=String(t):(typeof t==`string`||typeof t==`number`)&&(t=P.uParse(t));break}return t}function rr(e){let t={$typeName:`google.protobuf.Struct`,fields:{}};if($t(e))for(let[n,r]of Object.entries(e))t.fields[n]=or(r);return t}function ir(e){let t={};for(let[n,r]of Object.entries(e.fields))t[n]=ar(r);return t}function ar(e){switch(e.kind.case){case`structValue`:return ir(e.kind.value);case`listValue`:return e.kind.value.values.map(ar);case`nullValue`:case void 0:return null;default:return e.kind.value}}function or(e){let t={$typeName:`google.protobuf.Value`,kind:{case:void 0}};switch(typeof e){case`number`:t.kind={case:`numberValue`,value:e};break;case`string`:t.kind={case:`stringValue`,value:e};break;case`boolean`:t.kind={case:`boolValue`,value:e};break;case`object`:if(e===null)t.kind={case:`nullValue`,value:0};else if(Array.isArray(e)){let n={$typeName:`google.protobuf.ListValue`,values:[]};if(Array.isArray(e))for(let t of e)n.values.push(or(t));t.kind={case:`listValue`,value:n}}else t.kind={case:`structValue`,value:rr(e)};break}return t}var sr=3,cr={writeUnknownFields:!0};function lr(e){return e?Object.assign(Object.assign({},cr),e):cr}function ur(e,t,n){return dr(new on,lr(n),Vn(e,t)).finish()}function dr(e,t,n){for(let r of n.sortedFields){if(!n.isSet(r)){if(r.presence==sr)throw Error(`cannot encode ${r} to binary: required field not set`);continue}fr(e,t,n,r)}if(t.writeUnknownFields)for(let{no:t,wireType:r,data:i}of n.getUnknown()??[])e.tag(t,r).raw(i);return e}function fr(e,t,n,r){switch(r.fieldKind){case`scalar`:case`enum`:pr(e,n.desc.typeName,r.name,r.scalar??F.INT32,r.number,n.get(r));break;case`list`:hr(e,t,r,n.get(r));break;case`message`:mr(e,t,r,n.get(r));break;case`map`:for(let[i,a]of n.get(r))gr(e,t,r,i,a);break}}function pr(e,t,n,r,i,a){_r(e.tag(i,vr(r)),t,n,r,a)}function mr(e,t,n,r){n.delimitedEncoding?dr(e.tag(n.number,I.StartGroup),t,r).tag(n.number,I.EndGroup):dr(e.tag(n.number,I.LengthDelimited).fork(),t,r).join()}function hr(e,t,n,r){if(n.listKind==`message`){for(let i of r)mr(e,t,n,i);return}let i=n.scalar??F.INT32;if(n.packed){if(!r.size)return;e.tag(n.number,I.LengthDelimited).fork();for(let t of r)_r(e,n.parent.typeName,n.name,i,t);e.join();return}for(let t of r)pr(e,n.parent.typeName,n.name,i,n.number,t)}function gr(e,t,n,r,i){switch(e.tag(n.number,I.LengthDelimited).fork(),pr(e,n.parent.typeName,n.name,n.mapKey,1,r),n.mapKind){case`scalar`:case`enum`:pr(e,n.parent.typeName,n.name,n.scalar??F.INT32,2,i);break;case`message`:dr(e.tag(2,I.LengthDelimited).fork(),t,i).join();break}e.join()}function _r(e,t,n,r,i){try{switch(r){case F.STRING:e.string(i);break;case F.BOOL:e.bool(i);break;case F.DOUBLE:e.double(i);break;case F.FLOAT:e.float(i);break;case F.INT32:e.int32(i);break;case F.INT64:e.int64(i);break;case F.UINT64:e.uint64(i);break;case F.FIXED64:e.fixed64(i);break;case F.BYTES:e.bytes(i);break;case F.FIXED32:e.fixed32(i);break;case F.SFIXED32:e.sfixed32(i);break;case F.SFIXED64:e.sfixed64(i);break;case F.SINT64:e.sint64(i);break;case F.UINT32:e.uint32(i);break;case F.SINT32:e.sint32(i);break}}catch(e){throw e instanceof Error?Error(`cannot encode field ${t}.${n} to binary: ${e.message}`):e}}function vr(e){switch(e){case F.BYTES:case F.STRING:return I.LengthDelimited;case F.DOUBLE:case F.FIXED64:case F.SFIXED64:return I.Bit64;case F.FIXED32:case F.SFIXED32:case F.FLOAT:return I.Bit32;default:return I.Varint}}function L(e,t,...n){return n.reduce((e,t)=>e.nestedMessages[t],e.messages[t])}var yr=L(zt({name:`google/protobuf/descriptor.proto`,package:`google.protobuf`,messageType:[{name:`FileDescriptorSet`,field:[{name:`file`,number:1,type:11,label:3,typeName:`.google.protobuf.FileDescriptorProto`}],extensionRange:[{start:536e6,end:536000001}]},{name:`FileDescriptorProto`,field:[{name:`name`,number:1,type:9,label:1},{name:`package`,number:2,type:9,label:1},{name:`dependency`,number:3,type:9,label:3},{name:`public_dependency`,number:10,type:5,label:3},{name:`weak_dependency`,number:11,type:5,label:3},{name:`option_dependency`,number:15,type:9,label:3},{name:`message_type`,number:4,type:11,label:3,typeName:`.google.protobuf.DescriptorProto`},{name:`enum_type`,number:5,type:11,label:3,typeName:`.google.protobuf.EnumDescriptorProto`},{name:`service`,number:6,type:11,label:3,typeName:`.google.protobuf.ServiceDescriptorProto`},{name:`extension`,number:7,type:11,label:3,typeName:`.google.protobuf.FieldDescriptorProto`},{name:`options`,number:8,type:11,label:1,typeName:`.google.protobuf.FileOptions`},{name:`source_code_info`,number:9,type:11,label:1,typeName:`.google.protobuf.SourceCodeInfo`},{name:`syntax`,number:12,type:9,label:1},{name:`edition`,number:14,type:14,label:1,typeName:`.google.protobuf.Edition`}]},{name:`DescriptorProto`,field:[{name:`name`,number:1,type:9,label:1},{name:`field`,number:2,type:11,label:3,typeName:`.google.protobuf.FieldDescriptorProto`},{name:`extension`,number:6,type:11,label:3,typeName:`.google.protobuf.FieldDescriptorProto`},{name:`nested_type`,number:3,type:11,label:3,typeName:`.google.protobuf.DescriptorProto`},{name:`enum_type`,number:4,type:11,label:3,typeName:`.google.protobuf.EnumDescriptorProto`},{name:`extension_range`,number:5,type:11,label:3,typeName:`.google.protobuf.DescriptorProto.ExtensionRange`},{name:`oneof_decl`,number:8,type:11,label:3,typeName:`.google.protobuf.OneofDescriptorProto`},{name:`options`,number:7,type:11,label:1,typeName:`.google.protobuf.MessageOptions`},{name:`reserved_range`,number:9,type:11,label:3,typeName:`.google.protobuf.DescriptorProto.ReservedRange`},{name:`reserved_name`,number:10,type:9,label:3},{name:`visibility`,number:11,type:14,label:1,typeName:`.google.protobuf.SymbolVisibility`}],nestedType:[{name:`ExtensionRange`,field:[{name:`start`,number:1,type:5,label:1},{name:`end`,number:2,type:5,label:1},{name:`options`,number:3,type:11,label:1,typeName:`.google.protobuf.ExtensionRangeOptions`}]},{name:`ReservedRange`,field:[{name:`start`,number:1,type:5,label:1},{name:`end`,number:2,type:5,label:1}]}]},{name:`ExtensionRangeOptions`,field:[{name:`uninterpreted_option`,number:999,type:11,label:3,typeName:`.google.protobuf.UninterpretedOption`},{name:`declaration`,number:2,type:11,label:3,typeName:`.google.protobuf.ExtensionRangeOptions.Declaration`,options:{retention:2}},{name:`features`,number:50,type:11,label:1,typeName:`.google.protobuf.FeatureSet`},{name:`verification`,number:3,type:14,label:1,typeName:`.google.protobuf.ExtensionRangeOptions.VerificationState`,defaultValue:`UNVERIFIED`,options:{retention:2}}],nestedType:[{name:`Declaration`,field:[{name:`number`,number:1,type:5,label:1},{name:`full_name`,number:2,type:9,label:1},{name:`type`,number:3,type:9,label:1},{name:`reserved`,number:5,type:8,label:1},{name:`repeated`,number:6,type:8,label:1}]}],enumType:[{name:`VerificationState`,value:[{name:`DECLARATION`,number:0},{name:`UNVERIFIED`,number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:`FieldDescriptorProto`,field:[{name:`name`,number:1,type:9,label:1},{name:`number`,number:3,type:5,label:1},{name:`label`,number:4,type:14,label:1,typeName:`.google.protobuf.FieldDescriptorProto.Label`},{name:`type`,number:5,type:14,label:1,typeName:`.google.protobuf.FieldDescriptorProto.Type`},{name:`type_name`,number:6,type:9,label:1},{name:`extendee`,number:2,type:9,label:1},{name:`default_value`,number:7,type:9,label:1},{name:`oneof_index`,number:9,type:5,label:1},{name:`json_name`,number:10,type:9,label:1},{name:`options`,number:8,type:11,label:1,typeName:`.google.protobuf.FieldOptions`},{name:`proto3_optional`,number:17,type:8,label:1}],enumType:[{name:`Type`,value:[{name:`TYPE_DOUBLE`,number:1},{name:`TYPE_FLOAT`,number:2},{name:`TYPE_INT64`,number:3},{name:`TYPE_UINT64`,number:4},{name:`TYPE_INT32`,number:5},{name:`TYPE_FIXED64`,number:6},{name:`TYPE_FIXED32`,number:7},{name:`TYPE_BOOL`,number:8},{name:`TYPE_STRING`,number:9},{name:`TYPE_GROUP`,number:10},{name:`TYPE_MESSAGE`,number:11},{name:`TYPE_BYTES`,number:12},{name:`TYPE_UINT32`,number:13},{name:`TYPE_ENUM`,number:14},{name:`TYPE_SFIXED32`,number:15},{name:`TYPE_SFIXED64`,number:16},{name:`TYPE_SINT32`,number:17},{name:`TYPE_SINT64`,number:18}]},{name:`Label`,value:[{name:`LABEL_OPTIONAL`,number:1},{name:`LABEL_REPEATED`,number:3},{name:`LABEL_REQUIRED`,number:2}]}]},{name:`OneofDescriptorProto`,field:[{name:`name`,number:1,type:9,label:1},{name:`options`,number:2,type:11,label:1,typeName:`.google.protobuf.OneofOptions`}]},{name:`EnumDescriptorProto`,field:[{name:`name`,number:1,type:9,label:1},{name:`value`,number:2,type:11,label:3,typeName:`.google.protobuf.EnumValueDescriptorProto`},{name:`options`,number:3,type:11,label:1,typeName:`.google.protobuf.EnumOptions`},{name:`reserved_range`,number:4,type:11,label:3,typeName:`.google.protobuf.EnumDescriptorProto.EnumReservedRange`},{name:`reserved_name`,number:5,type:9,label:3},{name:`visibility`,number:6,type:14,label:1,typeName:`.google.protobuf.SymbolVisibility`}],nestedType:[{name:`EnumReservedRange`,field:[{name:`start`,number:1,type:5,label:1},{name:`end`,number:2,type:5,label:1}]}]},{name:`EnumValueDescriptorProto`,field:[{name:`name`,number:1,type:9,label:1},{name:`number`,number:2,type:5,label:1},{name:`options`,number:3,type:11,label:1,typeName:`.google.protobuf.EnumValueOptions`}]},{name:`ServiceDescriptorProto`,field:[{name:`name`,number:1,type:9,label:1},{name:`method`,number:2,type:11,label:3,typeName:`.google.protobuf.MethodDescriptorProto`},{name:`options`,number:3,type:11,label:1,typeName:`.google.protobuf.ServiceOptions`}]},{name:`MethodDescriptorProto`,field:[{name:`name`,number:1,type:9,label:1},{name:`input_type`,number:2,type:9,label:1},{name:`output_type`,number:3,type:9,label:1},{name:`options`,number:4,type:11,label:1,typeName:`.google.protobuf.MethodOptions`},{name:`client_streaming`,number:5,type:8,label:1,defaultValue:`false`},{name:`server_streaming`,number:6,type:8,label:1,defaultValue:`false`}]},{name:`FileOptions`,field:[{name:`java_package`,number:1,type:9,label:1},{name:`java_outer_classname`,number:8,type:9,label:1},{name:`java_multiple_files`,number:10,type:8,label:1,defaultValue:`false`},{name:`java_generate_equals_and_hash`,number:20,type:8,label:1,options:{deprecated:!0}},{name:`java_string_check_utf8`,number:27,type:8,label:1,defaultValue:`false`},{name:`optimize_for`,number:9,type:14,label:1,typeName:`.google.protobuf.FileOptions.OptimizeMode`,defaultValue:`SPEED`},{name:`go_package`,number:11,type:9,label:1},{name:`cc_generic_services`,number:16,type:8,label:1,defaultValue:`false`},{name:`java_generic_services`,number:17,type:8,label:1,defaultValue:`false`},{name:`py_generic_services`,number:18,type:8,label:1,defaultValue:`false`},{name:`deprecated`,number:23,type:8,label:1,defaultValue:`false`},{name:`cc_enable_arenas`,number:31,type:8,label:1,defaultValue:`true`},{name:`objc_class_prefix`,number:36,type:9,label:1},{name:`csharp_namespace`,number:37,type:9,label:1},{name:`swift_prefix`,number:39,type:9,label:1},{name:`php_class_prefix`,number:40,type:9,label:1},{name:`php_namespace`,number:41,type:9,label:1},{name:`php_metadata_namespace`,number:44,type:9,label:1},{name:`ruby_package`,number:45,type:9,label:1},{name:`features`,number:50,type:11,label:1,typeName:`.google.protobuf.FeatureSet`},{name:`uninterpreted_option`,number:999,type:11,label:3,typeName:`.google.protobuf.UninterpretedOption`}],enumType:[{name:`OptimizeMode`,value:[{name:`SPEED`,number:1},{name:`CODE_SIZE`,number:2},{name:`LITE_RUNTIME`,number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:`MessageOptions`,field:[{name:`message_set_wire_format`,number:1,type:8,label:1,defaultValue:`false`},{name:`no_standard_descriptor_accessor`,number:2,type:8,label:1,defaultValue:`false`},{name:`deprecated`,number:3,type:8,label:1,defaultValue:`false`},{name:`map_entry`,number:7,type:8,label:1},{name:`deprecated_legacy_json_field_conflicts`,number:11,type:8,label:1,options:{deprecated:!0}},{name:`features`,number:12,type:11,label:1,typeName:`.google.protobuf.FeatureSet`},{name:`uninterpreted_option`,number:999,type:11,label:3,typeName:`.google.protobuf.UninterpretedOption`}],extensionRange:[{start:1e3,end:536870912}]},{name:`FieldOptions`,field:[{name:`ctype`,number:1,type:14,label:1,typeName:`.google.protobuf.FieldOptions.CType`,defaultValue:`STRING`},{name:`packed`,number:2,type:8,label:1},{name:`jstype`,number:6,type:14,label:1,typeName:`.google.protobuf.FieldOptions.JSType`,defaultValue:`JS_NORMAL`},{name:`lazy`,number:5,type:8,label:1,defaultValue:`false`},{name:`unverified_lazy`,number:15,type:8,label:1,defaultValue:`false`},{name:`deprecated`,number:3,type:8,label:1,defaultValue:`false`},{name:`weak`,number:10,type:8,label:1,defaultValue:`false`,options:{deprecated:!0}},{name:`debug_redact`,number:16,type:8,label:1,defaultValue:`false`},{name:`retention`,number:17,type:14,label:1,typeName:`.google.protobuf.FieldOptions.OptionRetention`},{name:`targets`,number:19,type:14,label:3,typeName:`.google.protobuf.FieldOptions.OptionTargetType`},{name:`edition_defaults`,number:20,type:11,label:3,typeName:`.google.protobuf.FieldOptions.EditionDefault`},{name:`features`,number:21,type:11,label:1,typeName:`.google.protobuf.FeatureSet`},{name:`feature_support`,number:22,type:11,label:1,typeName:`.google.protobuf.FieldOptions.FeatureSupport`},{name:`uninterpreted_option`,number:999,type:11,label:3,typeName:`.google.protobuf.UninterpretedOption`}],nestedType:[{name:`EditionDefault`,field:[{name:`edition`,number:3,type:14,label:1,typeName:`.google.protobuf.Edition`},{name:`value`,number:2,type:9,label:1}]},{name:`FeatureSupport`,field:[{name:`edition_introduced`,number:1,type:14,label:1,typeName:`.google.protobuf.Edition`},{name:`edition_deprecated`,number:2,type:14,label:1,typeName:`.google.protobuf.Edition`},{name:`deprecation_warning`,number:3,type:9,label:1},{name:`edition_removed`,number:4,type:14,label:1,typeName:`.google.protobuf.Edition`}]}],enumType:[{name:`CType`,value:[{name:`STRING`,number:0},{name:`CORD`,number:1},{name:`STRING_PIECE`,number:2}]},{name:`JSType`,value:[{name:`JS_NORMAL`,number:0},{name:`JS_STRING`,number:1},{name:`JS_NUMBER`,number:2}]},{name:`OptionRetention`,value:[{name:`RETENTION_UNKNOWN`,number:0},{name:`RETENTION_RUNTIME`,number:1},{name:`RETENTION_SOURCE`,number:2}]},{name:`OptionTargetType`,value:[{name:`TARGET_TYPE_UNKNOWN`,number:0},{name:`TARGET_TYPE_FILE`,number:1},{name:`TARGET_TYPE_EXTENSION_RANGE`,number:2},{name:`TARGET_TYPE_MESSAGE`,number:3},{name:`TARGET_TYPE_FIELD`,number:4},{name:`TARGET_TYPE_ONEOF`,number:5},{name:`TARGET_TYPE_ENUM`,number:6},{name:`TARGET_TYPE_ENUM_ENTRY`,number:7},{name:`TARGET_TYPE_SERVICE`,number:8},{name:`TARGET_TYPE_METHOD`,number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:`OneofOptions`,field:[{name:`features`,number:1,type:11,label:1,typeName:`.google.protobuf.FeatureSet`},{name:`uninterpreted_option`,number:999,type:11,label:3,typeName:`.google.protobuf.UninterpretedOption`}],extensionRange:[{start:1e3,end:536870912}]},{name:`EnumOptions`,field:[{name:`allow_alias`,number:2,type:8,label:1},{name:`deprecated`,number:3,type:8,label:1,defaultValue:`false`},{name:`deprecated_legacy_json_field_conflicts`,number:6,type:8,label:1,options:{deprecated:!0}},{name:`features`,number:7,type:11,label:1,typeName:`.google.protobuf.FeatureSet`},{name:`uninterpreted_option`,number:999,type:11,label:3,typeName:`.google.protobuf.UninterpretedOption`}],extensionRange:[{start:1e3,end:536870912}]},{name:`EnumValueOptions`,field:[{name:`deprecated`,number:1,type:8,label:1,defaultValue:`false`},{name:`features`,number:2,type:11,label:1,typeName:`.google.protobuf.FeatureSet`},{name:`debug_redact`,number:3,type:8,label:1,defaultValue:`false`},{name:`feature_support`,number:4,type:11,label:1,typeName:`.google.protobuf.FieldOptions.FeatureSupport`},{name:`uninterpreted_option`,number:999,type:11,label:3,typeName:`.google.protobuf.UninterpretedOption`}],extensionRange:[{start:1e3,end:536870912}]},{name:`ServiceOptions`,field:[{name:`features`,number:34,type:11,label:1,typeName:`.google.protobuf.FeatureSet`},{name:`deprecated`,number:33,type:8,label:1,defaultValue:`false`},{name:`uninterpreted_option`,number:999,type:11,label:3,typeName:`.google.protobuf.UninterpretedOption`}],extensionRange:[{start:1e3,end:536870912}]},{name:`MethodOptions`,field:[{name:`deprecated`,number:33,type:8,label:1,defaultValue:`false`},{name:`idempotency_level`,number:34,type:14,label:1,typeName:`.google.protobuf.MethodOptions.IdempotencyLevel`,defaultValue:`IDEMPOTENCY_UNKNOWN`},{name:`features`,number:35,type:11,label:1,typeName:`.google.protobuf.FeatureSet`},{name:`uninterpreted_option`,number:999,type:11,label:3,typeName:`.google.protobuf.UninterpretedOption`}],enumType:[{name:`IdempotencyLevel`,value:[{name:`IDEMPOTENCY_UNKNOWN`,number:0},{name:`NO_SIDE_EFFECTS`,number:1},{name:`IDEMPOTENT`,number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:`UninterpretedOption`,field:[{name:`name`,number:2,type:11,label:3,typeName:`.google.protobuf.UninterpretedOption.NamePart`},{name:`identifier_value`,number:3,type:9,label:1},{name:`positive_int_value`,number:4,type:4,label:1},{name:`negative_int_value`,number:5,type:3,label:1},{name:`double_value`,number:6,type:1,label:1},{name:`string_value`,number:7,type:12,label:1},{name:`aggregate_value`,number:8,type:9,label:1}],nestedType:[{name:`NamePart`,field:[{name:`name_part`,number:1,type:9,label:2},{name:`is_extension`,number:2,type:8,label:2}]}]},{name:`FeatureSet`,field:[{name:`field_presence`,number:1,type:14,label:1,typeName:`.google.protobuf.FeatureSet.FieldPresence`,options:{retention:1,targets:[4,1],editionDefaults:[{value:`EXPLICIT`,edition:900},{value:`IMPLICIT`,edition:999},{value:`EXPLICIT`,edition:1e3}]}},{name:`enum_type`,number:2,type:14,label:1,typeName:`.google.protobuf.FeatureSet.EnumType`,options:{retention:1,targets:[6,1],editionDefaults:[{value:`CLOSED`,edition:900},{value:`OPEN`,edition:999}]}},{name:`repeated_field_encoding`,number:3,type:14,label:1,typeName:`.google.protobuf.FeatureSet.RepeatedFieldEncoding`,options:{retention:1,targets:[4,1],editionDefaults:[{value:`EXPANDED`,edition:900},{value:`PACKED`,edition:999}]}},{name:`utf8_validation`,number:4,type:14,label:1,typeName:`.google.protobuf.FeatureSet.Utf8Validation`,options:{retention:1,targets:[4,1],editionDefaults:[{value:`NONE`,edition:900},{value:`VERIFY`,edition:999}]}},{name:`message_encoding`,number:5,type:14,label:1,typeName:`.google.protobuf.FeatureSet.MessageEncoding`,options:{retention:1,targets:[4,1],editionDefaults:[{value:`LENGTH_PREFIXED`,edition:900}]}},{name:`json_format`,number:6,type:14,label:1,typeName:`.google.protobuf.FeatureSet.JsonFormat`,options:{retention:1,targets:[3,6,1],editionDefaults:[{value:`LEGACY_BEST_EFFORT`,edition:900},{value:`ALLOW`,edition:999}]}},{name:`enforce_naming_style`,number:7,type:14,label:1,typeName:`.google.protobuf.FeatureSet.EnforceNamingStyle`,options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:`STYLE_LEGACY`,edition:900},{value:`STYLE2024`,edition:1001}]}},{name:`default_symbol_visibility`,number:8,type:14,label:1,typeName:`.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility`,options:{retention:2,targets:[1],editionDefaults:[{value:`EXPORT_ALL`,edition:900},{value:`EXPORT_TOP_LEVEL`,edition:1001}]}}],nestedType:[{name:`VisibilityFeature`,enumType:[{name:`DefaultSymbolVisibility`,value:[{name:`DEFAULT_SYMBOL_VISIBILITY_UNKNOWN`,number:0},{name:`EXPORT_ALL`,number:1},{name:`EXPORT_TOP_LEVEL`,number:2},{name:`LOCAL_ALL`,number:3},{name:`STRICT`,number:4}]}]}],enumType:[{name:`FieldPresence`,value:[{name:`FIELD_PRESENCE_UNKNOWN`,number:0},{name:`EXPLICIT`,number:1},{name:`IMPLICIT`,number:2},{name:`LEGACY_REQUIRED`,number:3}]},{name:`EnumType`,value:[{name:`ENUM_TYPE_UNKNOWN`,number:0},{name:`OPEN`,number:1},{name:`CLOSED`,number:2}]},{name:`RepeatedFieldEncoding`,value:[{name:`REPEATED_FIELD_ENCODING_UNKNOWN`,number:0},{name:`PACKED`,number:1},{name:`EXPANDED`,number:2}]},{name:`Utf8Validation`,value:[{name:`UTF8_VALIDATION_UNKNOWN`,number:0},{name:`VERIFY`,number:2},{name:`NONE`,number:3}]},{name:`MessageEncoding`,value:[{name:`MESSAGE_ENCODING_UNKNOWN`,number:0},{name:`LENGTH_PREFIXED`,number:1},{name:`DELIMITED`,number:2}]},{name:`JsonFormat`,value:[{name:`JSON_FORMAT_UNKNOWN`,number:0},{name:`ALLOW`,number:1},{name:`LEGACY_BEST_EFFORT`,number:2}]},{name:`EnforceNamingStyle`,value:[{name:`ENFORCE_NAMING_STYLE_UNKNOWN`,number:0},{name:`STYLE2024`,number:1},{name:`STYLE_LEGACY`,number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:`FeatureSetDefaults`,field:[{name:`defaults`,number:1,type:11,label:3,typeName:`.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault`},{name:`minimum_edition`,number:4,type:14,label:1,typeName:`.google.protobuf.Edition`},{name:`maximum_edition`,number:5,type:14,label:1,typeName:`.google.protobuf.Edition`}],nestedType:[{name:`FeatureSetEditionDefault`,field:[{name:`edition`,number:3,type:14,label:1,typeName:`.google.protobuf.Edition`},{name:`overridable_features`,number:4,type:11,label:1,typeName:`.google.protobuf.FeatureSet`},{name:`fixed_features`,number:5,type:11,label:1,typeName:`.google.protobuf.FeatureSet`}]}]},{name:`SourceCodeInfo`,field:[{name:`location`,number:1,type:11,label:3,typeName:`.google.protobuf.SourceCodeInfo.Location`}],nestedType:[{name:`Location`,field:[{name:`path`,number:1,type:5,label:3,options:{packed:!0}},{name:`span`,number:2,type:5,label:3,options:{packed:!0}},{name:`leading_comments`,number:3,type:9,label:1},{name:`trailing_comments`,number:4,type:9,label:1},{name:`leading_detached_comments`,number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:`GeneratedCodeInfo`,field:[{name:`annotation`,number:1,type:11,label:3,typeName:`.google.protobuf.GeneratedCodeInfo.Annotation`}],nestedType:[{name:`Annotation`,field:[{name:`path`,number:1,type:5,label:3,options:{packed:!0}},{name:`source_file`,number:2,type:9,label:1},{name:`begin`,number:3,type:5,label:1},{name:`end`,number:4,type:5,label:1},{name:`semantic`,number:5,type:14,label:1,typeName:`.google.protobuf.GeneratedCodeInfo.Annotation.Semantic`}],enumType:[{name:`Semantic`,value:[{name:`NONE`,number:0},{name:`SET`,number:1},{name:`ALIAS`,number:2}]}]}]}],enumType:[{name:`Edition`,value:[{name:`EDITION_UNKNOWN`,number:0},{name:`EDITION_LEGACY`,number:900},{name:`EDITION_PROTO2`,number:998},{name:`EDITION_PROTO3`,number:999},{name:`EDITION_2023`,number:1e3},{name:`EDITION_2024`,number:1001},{name:`EDITION_UNSTABLE`,number:9999},{name:`EDITION_1_TEST_ONLY`,number:1},{name:`EDITION_2_TEST_ONLY`,number:2},{name:`EDITION_99997_TEST_ONLY`,number:99997},{name:`EDITION_99998_TEST_ONLY`,number:99998},{name:`EDITION_99999_TEST_ONLY`,number:99999},{name:`EDITION_MAX`,number:2147483647}]},{name:`SymbolVisibility`,value:[{name:`VISIBILITY_UNSET`,number:0},{name:`VISIBILITY_LOCAL`,number:1},{name:`VISIBILITY_EXPORT`,number:2}]}]}),1),br;(function(e){e[e.DECLARATION=0]=`DECLARATION`,e[e.UNVERIFIED=1]=`UNVERIFIED`})(br||={});var xr;(function(e){e[e.DOUBLE=1]=`DOUBLE`,e[e.FLOAT=2]=`FLOAT`,e[e.INT64=3]=`INT64`,e[e.UINT64=4]=`UINT64`,e[e.INT32=5]=`INT32`,e[e.FIXED64=6]=`FIXED64`,e[e.FIXED32=7]=`FIXED32`,e[e.BOOL=8]=`BOOL`,e[e.STRING=9]=`STRING`,e[e.GROUP=10]=`GROUP`,e[e.MESSAGE=11]=`MESSAGE`,e[e.BYTES=12]=`BYTES`,e[e.UINT32=13]=`UINT32`,e[e.ENUM=14]=`ENUM`,e[e.SFIXED32=15]=`SFIXED32`,e[e.SFIXED64=16]=`SFIXED64`,e[e.SINT32=17]=`SINT32`,e[e.SINT64=18]=`SINT64`})(xr||={});var Sr;(function(e){e[e.OPTIONAL=1]=`OPTIONAL`,e[e.REPEATED=3]=`REPEATED`,e[e.REQUIRED=2]=`REQUIRED`})(Sr||={});var Cr;(function(e){e[e.SPEED=1]=`SPEED`,e[e.CODE_SIZE=2]=`CODE_SIZE`,e[e.LITE_RUNTIME=3]=`LITE_RUNTIME`})(Cr||={});var wr;(function(e){e[e.STRING=0]=`STRING`,e[e.CORD=1]=`CORD`,e[e.STRING_PIECE=2]=`STRING_PIECE`})(wr||={});var Tr;(function(e){e[e.JS_NORMAL=0]=`JS_NORMAL`,e[e.JS_STRING=1]=`JS_STRING`,e[e.JS_NUMBER=2]=`JS_NUMBER`})(Tr||={});var Er;(function(e){e[e.RETENTION_UNKNOWN=0]=`RETENTION_UNKNOWN`,e[e.RETENTION_RUNTIME=1]=`RETENTION_RUNTIME`,e[e.RETENTION_SOURCE=2]=`RETENTION_SOURCE`})(Er||={});var Dr;(function(e){e[e.TARGET_TYPE_UNKNOWN=0]=`TARGET_TYPE_UNKNOWN`,e[e.TARGET_TYPE_FILE=1]=`TARGET_TYPE_FILE`,e[e.TARGET_TYPE_EXTENSION_RANGE=2]=`TARGET_TYPE_EXTENSION_RANGE`,e[e.TARGET_TYPE_MESSAGE=3]=`TARGET_TYPE_MESSAGE`,e[e.TARGET_TYPE_FIELD=4]=`TARGET_TYPE_FIELD`,e[e.TARGET_TYPE_ONEOF=5]=`TARGET_TYPE_ONEOF`,e[e.TARGET_TYPE_ENUM=6]=`TARGET_TYPE_ENUM`,e[e.TARGET_TYPE_ENUM_ENTRY=7]=`TARGET_TYPE_ENUM_ENTRY`,e[e.TARGET_TYPE_SERVICE=8]=`TARGET_TYPE_SERVICE`,e[e.TARGET_TYPE_METHOD=9]=`TARGET_TYPE_METHOD`})(Dr||={});var Or;(function(e){e[e.IDEMPOTENCY_UNKNOWN=0]=`IDEMPOTENCY_UNKNOWN`,e[e.NO_SIDE_EFFECTS=1]=`NO_SIDE_EFFECTS`,e[e.IDEMPOTENT=2]=`IDEMPOTENT`})(Or||={});var kr;(function(e){e[e.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0]=`DEFAULT_SYMBOL_VISIBILITY_UNKNOWN`,e[e.EXPORT_ALL=1]=`EXPORT_ALL`,e[e.EXPORT_TOP_LEVEL=2]=`EXPORT_TOP_LEVEL`,e[e.LOCAL_ALL=3]=`LOCAL_ALL`,e[e.STRICT=4]=`STRICT`})(kr||={});var Ar;(function(e){e[e.FIELD_PRESENCE_UNKNOWN=0]=`FIELD_PRESENCE_UNKNOWN`,e[e.EXPLICIT=1]=`EXPLICIT`,e[e.IMPLICIT=2]=`IMPLICIT`,e[e.LEGACY_REQUIRED=3]=`LEGACY_REQUIRED`})(Ar||={});var jr;(function(e){e[e.ENUM_TYPE_UNKNOWN=0]=`ENUM_TYPE_UNKNOWN`,e[e.OPEN=1]=`OPEN`,e[e.CLOSED=2]=`CLOSED`})(jr||={});var Mr;(function(e){e[e.REPEATED_FIELD_ENCODING_UNKNOWN=0]=`REPEATED_FIELD_ENCODING_UNKNOWN`,e[e.PACKED=1]=`PACKED`,e[e.EXPANDED=2]=`EXPANDED`})(Mr||={});var Nr;(function(e){e[e.UTF8_VALIDATION_UNKNOWN=0]=`UTF8_VALIDATION_UNKNOWN`,e[e.VERIFY=2]=`VERIFY`,e[e.NONE=3]=`NONE`})(Nr||={});var Pr;(function(e){e[e.MESSAGE_ENCODING_UNKNOWN=0]=`MESSAGE_ENCODING_UNKNOWN`,e[e.LENGTH_PREFIXED=1]=`LENGTH_PREFIXED`,e[e.DELIMITED=2]=`DELIMITED`})(Pr||={});var Fr;(function(e){e[e.JSON_FORMAT_UNKNOWN=0]=`JSON_FORMAT_UNKNOWN`,e[e.ALLOW=1]=`ALLOW`,e[e.LEGACY_BEST_EFFORT=2]=`LEGACY_BEST_EFFORT`})(Fr||={});var Ir;(function(e){e[e.ENFORCE_NAMING_STYLE_UNKNOWN=0]=`ENFORCE_NAMING_STYLE_UNKNOWN`,e[e.STYLE2024=1]=`STYLE2024`,e[e.STYLE_LEGACY=2]=`STYLE_LEGACY`})(Ir||={});var Lr;(function(e){e[e.NONE=0]=`NONE`,e[e.SET=1]=`SET`,e[e.ALIAS=2]=`ALIAS`})(Lr||={});var Rr;(function(e){e[e.EDITION_UNKNOWN=0]=`EDITION_UNKNOWN`,e[e.EDITION_LEGACY=900]=`EDITION_LEGACY`,e[e.EDITION_PROTO2=998]=`EDITION_PROTO2`,e[e.EDITION_PROTO3=999]=`EDITION_PROTO3`,e[e.EDITION_2023=1e3]=`EDITION_2023`,e[e.EDITION_2024=1001]=`EDITION_2024`,e[e.EDITION_UNSTABLE=9999]=`EDITION_UNSTABLE`,e[e.EDITION_1_TEST_ONLY=1]=`EDITION_1_TEST_ONLY`,e[e.EDITION_2_TEST_ONLY=2]=`EDITION_2_TEST_ONLY`,e[e.EDITION_99997_TEST_ONLY=99997]=`EDITION_99997_TEST_ONLY`,e[e.EDITION_99998_TEST_ONLY=99998]=`EDITION_99998_TEST_ONLY`,e[e.EDITION_99999_TEST_ONLY=99999]=`EDITION_99999_TEST_ONLY`,e[e.EDITION_MAX=2147483647]=`EDITION_MAX`})(Rr||={});var zr;(function(e){e[e.VISIBILITY_UNSET=0]=`VISIBILITY_UNSET`,e[e.VISIBILITY_LOCAL=1]=`VISIBILITY_LOCAL`,e[e.VISIBILITY_EXPORT=2]=`VISIBILITY_EXPORT`})(zr||={});var Br={readUnknownFields:!0};function Vr(e){return e?Object.assign(Object.assign({},Br),e):Br}function R(e,t,n){let r=Vn(e,void 0,!1);return Hr(r,new sn(t),Vr(n),!1,t.byteLength),r.message}function Hr(e,t,n,r,i){let a=r?t.len:t.pos+i,o,s,c=e.getUnknown()??[];for(;t.pos<a&&([o,s]=t.tag(),!(r&&s==I.EndGroup));){let r=e.findNumber(o);if(!r){let e=t.skip(s,o);n.readUnknownFields&&c.push({no:o,wireType:s,data:e});continue}Ur(e,t,r,s,n)}if(r&&(s!=I.EndGroup||o!==i))throw Error(`invalid end group tag`);c.length>0&&e.setUnknown(c)}function Ur(e,t,n,r,i){switch(n.fieldKind){case`scalar`:e.set(n,qr(t,n.scalar));break;case`enum`:let a=qr(t,F.INT32);if(n.enum.open)e.set(n,a);else if(n.enum.values.some(e=>e.number===a))e.set(n,a);else if(i.readUnknownFields){let t=[];Ae(a,t);let i=e.getUnknown()??[];i.push({no:n.number,wireType:r,data:new Uint8Array(t)}),e.setUnknown(i)}break;case`message`:e.set(n,Kr(t,i,n,e.get(n)));break;case`list`:Gr(t,r,e.get(n),i);break;case`map`:Wr(t,e.get(n),i);break}}function Wr(e,t,n){let r=t.field(),i,a,o=e.uint32(),s=e.pos+o;for(;e.pos<s;){let[t]=e.tag();switch(t){case 1:i=qr(e,r.mapKey);break;case 2:switch(r.mapKind){case`scalar`:a=qr(e,r.scalar);break;case`enum`:a=e.int32();break;case`message`:a=Kr(e,n,r);break}break}}if(i===void 0&&(i=Fe(r.mapKey,!1)),a===void 0)switch(r.mapKind){case`scalar`:a=Fe(r.scalar,!1);break;case`enum`:a=r.enum.values[0].number;break;case`message`:a=Vn(r.message,void 0,!1);break}t.set(i,a)}function Gr(e,t,n,r){let i=n.field();if(i.listKind===`message`){n.add(Kr(e,r,i));return}let a=i.scalar??F.INT32;if(!(t==I.LengthDelimited&&a!=F.STRING&&a!=F.BYTES)){n.add(qr(e,a));return}let o=e.uint32()+e.pos;for(;e.pos<o;)n.add(qr(e,a))}function Kr(e,t,n,r){let i=n.delimitedEncoding,a=r??Vn(n.message,void 0,!1);return Hr(a,e,t,i,i?n.number:e.uint32()),a}function qr(e,t){switch(t){case F.STRING:return e.string();case F.BOOL:return e.bool();case F.DOUBLE:return e.double();case F.FLOAT:return e.float();case F.INT32:return e.int32();case F.INT64:return e.int64();case F.UINT64:return e.uint64();case F.FIXED64:return e.fixed64();case F.BYTES:return e.bytes();case F.FIXED32:return e.fixed32();case F.SFIXED32:return e.sfixed32();case F.SFIXED64:return e.sfixed64();case F.SINT64:return e.sint64();case F.UINT32:return e.uint32();case F.SINT32:return e.sint32()}}function Jr(e,t){let n=R(yr,Gt(e));return n.messageType.forEach(Ge),n.dependency=t?.map(e=>e.proto.name)??[],Xe(n,e=>t?.find(t=>t.proto.name===e)).getFile(n.name)}var z=Jr(`ChJtb2R1bGVzL1Jvb20ucHJvdG8SFWNvbS5xdWljay52b2ljZS5wcm90byKDAwoEVXNlchIKCgJpZBgBIAEoCRIXCgpjYWxsQWN0aW9uGAIgASgFSACIAQESFgoJY2FsbFN0YXRlGAMgASgFSAGIAQESFQoIam9pblRpbWUYBCABKANIAogBARIsCgZ0cmFja3MYBSADKAsyHC5jb20ucXVpY2sudm9pY2UucHJvdG8uVHJhY2sSGAoLcGVybWlzc2lvbnMYBiABKAVIA4gBARIYCgtpc1B1Ymxpc2hlZBgHIAEoCEgEiAEBEhUKCGJlaGF2aW9yGAggASgFSAWIAQESRgoMY2hhbm5lbENhY2hlGAkgASgLMisuY29tLnF1aWNrLnZvaWNlLnByb3RvLkRhdGFDaGFubmVsQ2FjaGVJbmZvSAaIAQFCDQoLX2NhbGxBY3Rpb25CDAoKX2NhbGxTdGF0ZUILCglfam9pblRpbWVCDgoMX3Blcm1pc3Npb25zQg4KDF9pc1B1Ymxpc2hlZEILCglfYmVoYXZpb3JCDwoNX2NoYW5uZWxDYWNoZSJMChREYXRhQ2hhbm5lbENhY2hlSW5mbxI0CghjaGFubmVscxgBIAMoCzIiLmNvbS5xdWljay52b2ljZS5wcm90by5EYXRhQ2hhbm5lbCI+CgtEYXRhQ2hhbm5lbBIXCg9kYXRhQ2hhbm5lbE5hbWUYASABKAkSDwoCaWQYAiABKAVIAIgBAUIFCgNfaWQiOAoFTG9naW4SDQoFYXBwaWQYASABKAkSDgoGdXNlcklkGAIgASgJEhAKCHNka1Rva2VuGAMgASgJIuICCgVUcmFjaxILCgNtaWQYASABKAkSFgoJdHJhY2tOYW1lGAIgASgJSACIAQESFQoIbG9jYXRpb24YAyABKAlIAYgBARITCgZ1c2VySWQYBCABKAlIAogBARIRCgRjb2RlGAUgASgFSAOIAQESEQoEZGVzYxgGIAEoCUgEiAEBEjMKBHR5cGUYByABKA4yIC5jb20ucXVpY2sudm9pY2UucHJvdG8uVHJhY2tUeXBlSAWIAQESFAoHaXNWYWxpZBgIIAEoCEgGiAEBEhYKCXNpbXVsY2FzdBgJIAEoCUgHiAEBEhYKCWxhc3RSZXRyeRgKIAEoCEgIiAEBQgwKCl90cmFja05hbWVCCwoJX2xvY2F0aW9uQgkKB191c2VySWRCBwoFX2NvZGVCBwoFX2Rlc2NCBwoFX3R5cGVCCgoIX2lzVmFsaWRCDAoKX3NpbXVsY2FzdEIMCgpfbGFzdFJldHJ5IqkCCgdKb2luUmVxEg4KBnJvb21JZBgBIAEoCRIpCgR1c2VyGAIgASgLMhsuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXISMQoIY2FsbFR5cGUYAyABKA4yHy5jb20ucXVpY2sudm9pY2UucHJvdG8uQ2FsbFR5cGUSEgoFdG9rZW4YBCABKAlIAIgBARI3CgRsYW5nGAUgASgLMiQuY29tLnF1aWNrLnZvaWNlLnByb3RvLkFpTGFuZ1NldHRpbmdIAYgBARIQCgNzdHQYBiABKAhIAogBARISCgVtc2dJZBgHIAEoCUgDiAEBEhAKA21zZxgIIAEoCUgEiAEBQggKBl90b2tlbkIHCgVfbGFuZ0IGCgRfc3R0QggKBl9tc2dJZEIGCgRfbXNnIrkCCgdKb2luUnNwEg4KBnJvb21JZBgBIAEoCRIuCglyb29tVXNlcnMYAiADKAsyGy5jb20ucXVpY2sudm9pY2UucHJvdG8uVXNlchIxCghjYWxsVHlwZRgDIAEoDjIfLmNvbS5xdWljay52b2ljZS5wcm90by5DYWxsVHlwZRIQCgh3aWZpT25seRgEIAEoCBIXCgpyb29tQWN0aW9uGAUgASgFSACIAQESFgoJdG90YWxTaXplGAYgASgFSAGIAQESRgoQbWVldFNwZWNpYWxSb2xlcxgHIAEoCzInLmNvbS5xdWljay52b2ljZS5wcm90by5NZWV0Um9sZXNMaXN0UnNwSAKIAQFCDQoLX3Jvb21BY3Rpb25CDAoKX3RvdGFsU2l6ZUITChFfbWVldFNwZWNpYWxSb2xlcyJHCgpKb2luTm90aWZ5Eg4KBnJvb21JZBgBIAEoCRIpCgR1c2VyGAIgASgLMhsuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXIiGwoMQ29ubmVjdENGUmVxEgsKA3NkcBgBIAEoCSJ4CgxDb25uZWN0Q0ZSc3ASEQoJcmVtb3RlU2RwGAEgASgJEjMKDnN1YnNjcmliZVVzZXJzGAIgAygLMhsuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXISFAoHc2Vzc2lvbhgDIAEoCUgAiAEBQgoKCF9zZXNzaW9uIqEBCgpQdWJsaXNoUmVxEgsKA3NkcBgBIAEoCRIsCgZ0cmFja3MYAiADKAsyHC5jb20ucXVpY2sudm9pY2UucHJvdG8uVHJhY2sSEgoKY2FsbEFjdGlvbhgDIAEoBRIVCghyZWNyZWF0ZRgEIAEoCEgAiAEBEhQKB3Nlc3Npb24YBSABKAlIAYgBAUILCglfcmVjcmVhdGVCCgoIX3Nlc3Npb24iQQoKUHVibGlzaFJzcBIRCglyZW1vdGVTZHAYASABKAkSFAoHc2Vzc2lvbhgCIAEoCUgAiAEBQgoKCF9zZXNzaW9uImwKDVB1Ymxpc2hOb3RpZnkSDgoGcm9vbUlkGAEgASgJEikKBHVzZXIYAiABKAsyGy5jb20ucXVpY2sudm9pY2UucHJvdG8uVXNlchIUCgdzZXNzaW9uGAMgASgJSACIAQFCCgoIX3Nlc3Npb24iXAoMU3Vic2NyaWJlUmVxEioKBXVzZXJzGAEgAygLMhsuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXISFAoHc2Vzc2lvbhgCIAEoCUgAiAEBQgoKCF9zZXNzaW9uIm8KDFN1YnNjcmliZVJzcBIRCglyZW1vdGVTZHAYASABKAkSKgoFdXNlcnMYAiADKAsyGy5jb20ucXVpY2sudm9pY2UucHJvdG8uVXNlchIUCgdzZXNzaW9uGAMgASgJSACIAQFCCgoIX3Nlc3Npb24iLQoOUmVuZWdvdGlhdGVSZXESDgoGdXNlcklkGAEgASgJEgsKA3NkcBgCIAEoCSJhCgdRdWl0UmVxEg4KBnVzZXJJZBgBIAEoCRIOCgZyb29tSWQYAiABKAkSEgoFbXNnSWQYAyABKAlIAIgBARIQCgNtc2cYBCABKAlIAYgBAUIICgZfbXNnSWRCBgoEX21zZyJ/CgpRdWl0Tm90aWZ5Eg4KBnJvb21JZBgBIAEoCRIpCgR1c2VyGAIgASgLMhsuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXISEQoEY29kZRgDIAEoBUgAiAEBEhEKBGRlc2MYBCABKAlIAYgBAUIHCgVfY29kZUIHCgVfZGVzYyIjChFUb2tlbkV4cGlyZU5vdGlmeRIOCgZyb29tSWQYASABKAkiMgoOVXBkYXRlVG9rZW5SZXESDgoGcm9vbUlkGAEgASgJEhAKCHNka1Rva2VuGAIgASgJIlMKEE5ldFF1YWxpdHlDaGFuZ2USDgoGdXNlcklkGAEgASgJEg4KBnJvb21JZBgCIAEoCRIOCgZlZ3Jlc3MYAyABKAUSDwoHaW5ncmVzcxgEIAEoBSJOChBOZXRRdWFsaXR5Tm90aWZ5EjoKCXF1YWxpdGllcxgBIAMoCzInLmNvbS5xdWljay52b2ljZS5wcm90by5OZXRRdWFsaXR5Q2hhbmdlIkcKClVwZGF0ZUNhbGwSDgoGcm9vbUlkGAEgASgJEikKBHVzZXIYAiABKAsyGy5jb20ucXVpY2sudm9pY2UucHJvdG8uVXNlciJSCg9QMlBVc2VyU3luY0l0ZW0SDgoGdXNlcklkGAEgASgJEi8KBXR5cGVzGAIgAygOMiAuY29tLnF1aWNrLnZvaWNlLnByb3RvLlRyYWNrVHlwZSJ9Cg9QMlBVc2VyU3luY0xpc3QSNAoEcHVzaBgBIAMoCzImLmNvbS5xdWljay52b2ljZS5wcm90by5QMlBVc2VyU3luY0l0ZW0SNAoEcHVsbBgCIAMoCzImLmNvbS5xdWljay52b2ljZS5wcm90by5QMlBVc2VyU3luY0l0ZW0imAEKD1N5bmNSb29tSW5mb1JlcRIOCgZyb29tSWQYASABKAkSKQoEdXNlchgCIAEoCzIbLmNvbS5xdWljay52b2ljZS5wcm90by5Vc2VyEj0KCHAycFN0YXRlGAMgASgLMiYuY29tLnF1aWNrLnZvaWNlLnByb3RvLlAyUFVzZXJTeW5jTGlzdEgAiAEBQgsKCV9wMnBTdGF0ZSKbAgoPU3luY1Jvb21JbmZvUnNwEg4KBnJvb21JZBgBIAEoCRIPCgdpc1ZhbGlkGAIgASgIEioKBXVzZXJzGAMgAygLMhsuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXISEAoIaXNBY3RpdmUYBCABKAgSFwoKcm9vbUFjdGlvbhgFIAEoBUgAiAEBEhYKCXRvdGFsU2l6ZRgGIAEoBUgBiAEBEkYKEG1lZXRTcGVjaWFsUm9sZXMYByABKAsyJy5jb20ucXVpY2sudm9pY2UucHJvdG8uTWVldFJvbGVzTGlzdFJzcEgCiAEBQg0KC19yb29tQWN0aW9uQgwKCl90b3RhbFNpemVCEwoRX21lZXRTcGVjaWFsUm9sZXMiGgoKVXBkYXRlVGltZRIMCgR0aW1lGAEgASgDIloKDUNsb3NlVHJhY2tSZXESCwoDc2RwGAEgASgJEiwKBnRyYWNrcxgCIAMoCzIcLmNvbS5xdWljay52b2ljZS5wcm90by5UcmFjaxIOCgZyb29tSWQYAyABKAkiUAoNQ2xvc2VUcmFja1JzcBIRCglyZW1vdGVTZHAYASABKAkSLAoGdHJhY2tzGAIgAygLMhwuY29tLnF1aWNrLnZvaWNlLnByb3RvLlRyYWNrIj0KEENsb3NlVHJhY2tOb3RpZnkSKQoEdXNlchgBIAEoCzIbLmNvbS5xdWljay52b2ljZS5wcm90by5Vc2VyIk4KEVVwZGF0ZVBlcm1pc3Npb25zEg4KBnJvb21JZBgBIAEoCRIpCgR1c2VyGAIgASgLMhsuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXIiUAoMVXNlckJlaGF2aW9yEi4KBHR5cGUYASABKA4yIC5jb20ucXVpY2sudm9pY2UucHJvdG8uVHJhY2tUeXBlEhAKCGJlaGF2aW9yGAIgASgIIlEKC1ByZXZlbnRVc2VyEgoKAmlkGAEgASgJEjYKCWJlaGF2aW9ycxgCIAMoCzIjLmNvbS5xdWljay52b2ljZS5wcm90by5Vc2VyQmVoYXZpb3IiXAoXUHJldmVudFVzZXJzQmVoYXZpb3JSZXESDgoGcm9vbUlkGAEgASgJEjEKBXVzZXJzGAIgAygLMiIuY29tLnF1aWNrLnZvaWNlLnByb3RvLlByZXZlbnRVc2VyIlgKGlByZXZlbnRVc2Vyc0JlaGF2aW9yTm90aWZ5Eg4KBnJvb21JZBgBIAEoCRIqCgV1c2VycxgCIAMoCzIbLmNvbS5xdWljay52b2ljZS5wcm90by5Vc2VyIvIBCg5CYXNlQ0ROQWRkcmVzcxI2CgRhcmVhGAEgASgOMiguY29tLnF1aWNrLnZvaWNlLnByb3RvLkFjY2VsZXJhdGlvbkFyZWFzEjYKCWNvdW50VHlwZRgCIAEoDjIjLmNvbS5xdWljay52b2ljZS5wcm90by5Db3VudE1ldGhvZHMSQQoGdXJsTWFwGAMgAygLMjEuY29tLnF1aWNrLnZvaWNlLnByb3RvLkJhc2VDRE5BZGRyZXNzLlVybE1hcEVudHJ5Gi0KC1VybE1hcEVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEinAIKFENETlBsYXlBZGRyZXNzTm90aWZ5Eg4KBnJvb21JZBgBIAEoCRIRCgRtM3U4GAIgASgJSACIAQESEQoEcnRtcBgDIAEoCUgBiAEBEhAKA2ZsdhgEIAEoCUgCiAEBEhIKBXJ0bXBzGAUgASgJSAOIAQESPAoIbWFpbkxpbmUYBiABKAsyJS5jb20ucXVpY2sudm9pY2UucHJvdG8uQmFzZUNETkFkZHJlc3NIBIgBARI5CgpzdGFuZExpbmVzGAcgAygLMiUuY29tLnF1aWNrLnZvaWNlLnByb3RvLkJhc2VDRE5BZGRyZXNzQgcKBV9tM3U4QgcKBV9ydG1wQgYKBF9mbHZCCAoGX3J0bXBzQgsKCV9tYWluTGluZSJTCgtVc2VyQ2hhbm5lbBIOCgZ1c2VySWQYASABKAkSNAoIY2hhbm5lbHMYAiADKAsyIi5jb20ucXVpY2sudm9pY2UucHJvdG8uRGF0YUNoYW5uZWwiSQoRQ2hhbm5lbFB1Ymxpc2hSZXESNAoIY2hhbm5lbHMYASADKAsyIi5jb20ucXVpY2sudm9pY2UucHJvdG8uRGF0YUNoYW5uZWwiSQoRQ2hhbm5lbFB1Ymxpc2hSc3ESNAoIY2hhbm5lbHMYASADKAsyIi5jb20ucXVpY2sudm9pY2UucHJvdG8uVXNlckNoYW5uZWwiSAoTQ2hhbm5lbFN1YnNjcmliZVJlcRIxCgV1c2VycxgBIAMoCzIiLmNvbS5xdWljay52b2ljZS5wcm90by5Vc2VyQ2hhbm5lbCJLChNDaGFubmVsU3Vic2NyaWJlUnNxEjQKCGNoYW5uZWxzGAEgAygLMiIuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXJDaGFubmVsIqoBCg9EYXRhQ2hhbm5lbERhdGESDgoGdXNlcklkGAEgASgJEjQKBHR5cGUYAiABKA4yJi5jb20ucXVpY2sudm9pY2UucHJvdG8uRGF0YUNoYW5uZWxUeXBlEkMKCWF1ZGlvRGF0YRgDIAEoCzIrLmNvbS5xdWljay52b2ljZS5wcm90by5EYXRhQ2hhbm5lbEF1ZGlvRGF0YUgAiAEBQgwKCl9hdWRpb0RhdGEifwoURGF0YUNoYW5uZWxBdWRpb0RhdGESDAoEZGF0YRgBIAEoDBI9CgZmb3JtYXQYAiABKAsyLS5jb20ucXVpY2sudm9pY2UucHJvdG8uRGF0YUNoYW5uZWxBdWRpb0Zvcm1hdBIRCgR0aW1lGAMgASgDSACIAQFCBwoFX3RpbWUiPgoWRGF0YUNoYW5uZWxBdWRpb0Zvcm1hdBISCgpzYW1wbGVSYXRlGAEgASgBEhAKCGNoYW5uZWxzGAIgASgFIhoKCUFja01zZ1JlcRINCgVtc2dJZBgBIAEoAyKoAQoKU2RwQ29uc3VsdBIOCgZyb29tSWQYASABKAkSMAoGc2VuZGVyGAIgASgLMhsuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXJIAIgBARISCgpyZWNlaXZlcklkGAMgASgJEgsKA3NkcBgEIAEoCRIsCgZ0cmFja3MYBSADKAsyHC5jb20ucXVpY2sudm9pY2UucHJvdG8uVHJhY2tCCQoHX3NlbmRlciI/CglDYW5kaWRhdGUSDgoGc2RwTWlkGAEgASgJEhUKDXNkcE1MaW5lSW5kZXgYAiABKAUSCwoDc2RwGAMgASgJIpUBCgpDYW5kaWRhdGVzEg4KBnJvb21JZBgBIAEoCRIQCghzZW5kZXJJZBgCIAEoCRISCgpyZWNlaXZlcklkGAMgASgJEjQKCmNhbmRpZGF0ZXMYBCADKAsyIC5jb20ucXVpY2sudm9pY2UucHJvdG8uQ2FuZGlkYXRlEhsKE2lzU3Vic2NyaWJlUmVjZWl2ZXIYBSABKAgiegoNUmVwb3J0TmV0SW5mbxIrCgNuYXQYASABKA4yHi5jb20ucXVpY2sudm9pY2UucHJvdG8uTmF0VHlwZRIwCgR0eXBlGAIgASgOMiIuY29tLnF1aWNrLnZvaWNlLnByb3RvLk5ldHdvcmtUeXBlEgoKAmlwGAMgASgJIpwBChJSZXBvcnRUcmFmZmljVXNhZ2USFAoHcDJwUHVzaBgBIAEoA0gAiAEBEhQKB3AycFB1bGwYAiABKANIAYgBARIUCgdzZnVQdXNoGAMgASgDSAKIAQESFAoHc2Z1UHVsbBgEIAEoA0gDiAEBQgoKCF9wMnBQdXNoQgoKCF9wMnBQdWxsQgoKCF9zZnVQdXNoQgoKCF9zZnVQdWxsIlAKD0NoZWNrU2Vzc2lvblJlcRIPCgdzZXNzaW9uGAEgASgJEiwKBnRyYWNrcxgCIAMoCzIcLmNvbS5xdWljay52b2ljZS5wcm90by5UcmFjayJoCg9DaGVja1Nlc3Npb25Sc3ESFgoOc2Vzc2lvbklzVmFsaWQYASABKAgSLAoGdHJhY2tzGAIgAygLMhwuY29tLnF1aWNrLnZvaWNlLnByb3RvLlRyYWNrEg8KB3Nlc3Npb24YAyABKAkiYwoQUm9vbVNwZWVjaE5vdGlmeRIOCgZyb29tSWQYASABKAkSDgoGdXNlcklkGAIgASgJEgwKBHRleHQYAyABKAkSEQoJdGltZXN0YW1wGAQgASgDEg4KBm9yaWdpbhgFIAEoCSLWAQoYTGl2ZVN0cmVhbWVyU3BlZWNoTm90aWZ5Eg4KBnJvb21JZBgBIAEoCRIOCgZ1c2VySWQYAiABKAkSDgoGb3JpZ2luGAMgASgJEkkKBWxhbmdzGAQgAygLMjouY29tLnF1aWNrLnZvaWNlLnByb3RvLkxpdmVTdHJlYW1lclNwZWVjaE5vdGlmeS5MYW5nc0VudHJ5EhEKCXRpbWVzdGFtcBgFIAEoAxosCgpMYW5nc0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEiYAoNQWlMYW5nU2V0dGluZxINCgVpbnB1dBgBIAEoCRIOCgZvdXRwdXQYAiABKAkSHAoPdHJhbnNsYXRlRW5hYmxlGAMgASgISACIAQFCEgoQX3RyYW5zbGF0ZUVuYWJsZSJ/ChZQMlBBdmFpbGFibGVQZWVyTm90aWZ5Eg4KBnJvb21JZBgBIAEoCRIOCgZwdXNoSWQYAiABKAkSLwoFdHlwZXMYAyADKA4yIC5jb20ucXVpY2sudm9pY2UucHJvdG8uVHJhY2tUeXBlEhQKDGlzUmVtb3RlUHVzaBgEIAEoCCKrAgoOUmVwb3J0UDJQRXhSZXESDgoGcm9vbUlkGAEgASgJEg4KBnB1c2hJZBgCIAEoCRIOCgZwdWxsSWQYAyABKAkSLAoEY29kZRgEIAEoDjIeLmNvbS5xdWljay52b2ljZS5wcm90by5QMlBDb2RlEi8KBXR5cGVzGAUgAygOMiAuY29tLnF1aWNrLnZvaWNlLnByb3RvLlRyYWNrVHlwZRIRCgRkZXNjGAYgASgJSACIAQESGgoNY29ubmVjdGVkVGltZRgHIAEoCUgBiAEBEjUKBmFjdGlvbhgIIAEoDjIgLmNvbS5xdWljay52b2ljZS5wcm90by5QMlBBY3Rpb25IAogBAUIHCgVfZGVzY0IQCg5fY29ubmVjdGVkVGltZUIJCgdfYWN0aW9uIm4KFVAyUERpc2Nvbm5lY3RlZE5vdGlmeRIOCgZyb29tSWQYASABKAkSFAoMcmVtb3RlVXNlcklkGAIgASgJEi8KBXR5cGVzGAMgAygOMiAuY29tLnF1aWNrLnZvaWNlLnByb3RvLlRyYWNrVHlwZSJnCh1Sb29tR2xvYmFsQWN0aW9uQ2hhbmdlZE5vdGlmeRIOCgZyb29tSWQYASABKAkSEgoKcm9vbUFjdGlvbhgCIAEoBRIMCgRmcm9tGAMgASgJEhQKDHNlcnZlckFjdGlvbhgEIAEoBSJqChlQdWJOb3RpZnlJbnRlcmNlcHRTeW5jUnNwEg4KBnJvb21JZBgBIAEoCRISCgpyb29tQWN0aW9uGAIgASgFEikKBHVzZXIYAyABKAsyGy5jb20ucXVpY2sudm9pY2UucHJvdG8uVXNlciIyChBNZWV0Um9sZXNMaXN0UnNwEg8KB2NyZWF0b3IYASABKAkSDQoFYWRtaW4YAiADKAkilgEKFU1lZXRSb2xlc0NoYW5nZU5vdGlmeRIOCgZyb29tSWQYASABKAkSQQoQbWVldFNwZWNpYWxSb2xlcxgCIAEoCzInLmNvbS5xdWljay52b2ljZS5wcm90by5NZWV0Um9sZXNMaXN0UnNwEioKBXVzZXJzGAMgAygLMhsuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXIiYAoPSm9pbkJhdGNoTm90aWZ5Eg4KBnJvb21JZBgBIAEoCRIqCgV1c2VycxgCIAMoCzIbLmNvbS5xdWljay52b2ljZS5wcm90by5Vc2VyEhEKCXRvdGFsU2l6ZRgDIAEoBSI6CgxRdWl0VXNlckluZm8SDgoGdXNlcklkGAEgASgJEgwKBGNvZGUYAiABKAUSDAoEZGVzYxgDIAEoCSJoCg9RdWl0QmF0Y2hOb3RpZnkSDgoGcm9vbUlkGAEgASgJEjIKBXVzZXJzGAIgAygLMiMuY29tLnF1aWNrLnZvaWNlLnByb3RvLlF1aXRVc2VySW5mbxIRCgl0b3RhbFNpemUYAyABKAUiTwoRUm9vbUluZm9Db21tb25Sc3ASDgoGcm9vbUlkGAEgASgJEioKBXVzZXJzGAIgAygLMhsuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXIiggEKCUljZVNlcnZlchIMCgR1cmxzGAEgAygJEhAKCHVzZXJuYW1lGAIgASgJEhIKCmNyZWRlbnRpYWwYAyABKAkSQQoPY3JlZGVudGlhbF90eXBlGAQgASgOMiguY29tLnF1aWNrLnZvaWNlLnByb3RvLkljZUNyZWRlbnRpYWxUeXBlIg0KC1R1cm5VcmxzUmVxIqEBChBUdXJuVXJsc1Jlc3BvbnNlEjUKC2ljZV9zZXJ2ZXJzGAEgAygLMiAuY29tLnF1aWNrLnZvaWNlLnByb3RvLkljZVNlcnZlchILCgN0dGwYAiABKAQSEgoKZXhwaXJlc19hdBgDIAEoBBI1CgZwb2xpY3kYBCABKA4yJS5jb20ucXVpY2sudm9pY2UucHJvdG8uSWNlQ29ubmVjdFR5cGUqRAoJVHJhY2tUeXBlEg4KCk1pY3JvcGhvbmUQABIKCgZDYW1lcmEQARIKCgZTY3JlZW4QAhIPCgtTeXN0ZW1Wb2ljZRADKj0KCENhbGxUeXBlEgoKBk5vcm1hbBAAEgsKB01lZXRpbmcQARIICgRMaXZlEAISDgoKQ29uZmVyZW5jZRADKnoKDlF1aXROb3RpZnlDb2RlEg4KCk5vcm1hbFF1aXQQABIMCgdUaW1lb3V0EOUPEhEKDFRva2VuRXhwaXJlZBDbDxIMCgdLaWNrT3V0EOYPEgoKBUVuZFBrEOcPEgwKB0VuZExpdmUQ6A8SDwoKRm9yY2VDbGVhchDpDypAChFBY2NlbGVyYXRpb25BcmVhcxIRCg1jaGluYU1haW5sYW5kEAASCgoGZ2xvYmFsEAESDAoIb3ZlcnNlYXMQAiolCgxDb3VudE1ldGhvZHMSCAoEZmxvdxAAEgsKB21pbnV0ZXMQASogCg9EYXRhQ2hhbm5lbFR5cGUSDQoJYmFja0F1aWRvEAAqQQoHTmF0VHlwZRINCglTeW1tZXRyaWMQABIICgRDb25lEAESCAoEUG9ydBACEgYKAklQEAMSCwoHVW5Lbm93bhAEKi4KC05ldHdvcmtUeXBlEggKBFdpZmkQABIJCgVXaXJlZBABEgoKBk1vYmlsZRACKlAKB1AyUENvZGUSCwoHU3VjY2VzcxAAEgoKBkZhaWxlZBABEgoKBklnbm9yZRACEhAKDERpc2Nvbm5lY3RlZBADEg4KCkxvd1F1YWxpdHkQBCpqCg9QMlBJZ25vcmVSZWFzb24SEQoNQ0hBTk5FTF9MSU1JVBAAEhcKE1NVQlNDUklCRV9OT1RfRVhJU1QQARILCgdCdXN5aW5nEAISEwoPVFJBQ0tfTk9UX0VYSVNUEAMSCQoFT1RIRVIQBCpvCglQMlBBY3Rpb24SDgoKUmV2ZXJzZVRyeRAAEhQKEFJldmVyc2VUcnlGYWlsZWQQARISCg5SZXZlcnNlU3VjY2VzcxACEhIKDkNvbm5lY3RTdWNjZXNzEAMSFAoQUmV2ZXJzZVB1c2hEZWxheRAEKnkKEUljZUNyZWRlbnRpYWxUeXBlEiMKH0lDRV9DUkVERU5USUFMX1RZUEVfVU5TUEVDSUZJRUQQABIgChxJQ0VfQ1JFREVOVElBTF9UWVBFX1BBU1NXT1JEEAESHQoZSUNFX0NSRURFTlRJQUxfVFlQRV9PQVVUSBACKiQKDkljZUNvbm5lY3RUeXBlEgcKA0FsbBAAEgkKBVJlbGF5EAFCRQoVY29tLnF1aWNrLnZvaWNlLnByb3RvQglSb29tUHJvdG9aFWNvbS5xdWljay52b2ljZS5wcm90b7oCCVJvb21Qcm90b2IGcHJvdG8z`),Yr=L(z,4),Xr=L(z,5),Zr=L(z,6),Qr=L(z,7),$r=L(z,8),ei=L(z,9),ti=L(z,10),ni=L(z,11),ri=L(z,12),ii=L(z,13),ai=L(z,14),oi=L(z,15),si=L(z,16),ci=L(z,17),li=L(z,19),ui=L(z,20),di=L(z,21),fi=L(z,22),pi=L(z,25),mi=L(z,26),hi=L(z,28),gi=L(z,29),_i=L(z,30),vi=L(z,31),yi=L(z,34),bi=L(z,35),xi=L(z,37),Si=L(z,46),Ci=L(z,47),wi=L(z,48),Ti=L(z,49),Ei=L(z,50),Di=L(z,51),Oi=L(z,53),ki=L(z,54),Ai=L(z,56),ji=L(z,57),Mi=L(z,58),Ni=L(z,59),Pi=L(z,60),Fi=L(z,63),Ii=L(z,64),Li=L(z,66),Ri=L(z,67),zi=L(z,69),Bi=L(z,70),B=function(e){return e[e.Microphone=0]=`Microphone`,e[e.Camera=1]=`Camera`,e[e.Screen=2]=`Screen`,e[e.SystemVoice=3]=`SystemVoice`,e}({}),Vi=function(e){return e[e.All=0]=`All`,e[e.Relay=1]=`Relay`,e}({}),Hi=s(((e,t)=>{var n=t.exports={v:[{name:`version`,reg:/^(\d*)$/}],o:[{name:`origin`,reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:[`username`,`sessionId`,`sessionVersion`,`netType`,`ipVer`,`address`],format:`%s %s %d %s IP%d %s`}],s:[{name:`name`}],i:[{name:`description`}],u:[{name:`uri`}],e:[{name:`email`}],p:[{name:`phone`}],z:[{name:`timezones`}],r:[{name:`repeats`}],t:[{name:`timing`,reg:/^(\d*) (\d*)/,names:[`start`,`stop`],format:`%d %d`}],c:[{name:`connection`,reg:/^IN IP(\d) (\S*)/,names:[`version`,`ip`],format:`IN IP%d %s`}],b:[{push:`bandwidth`,reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:[`type`,`limit`],format:`%s:%s`}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:[`type`,`port`,`protocol`,`payloads`],format:`%s %d %s %s`}],a:[{push:`rtp`,reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:[`payload`,`codec`,`rate`,`encoding`],format:function(e){return e.encoding?`rtpmap:%d %s/%s/%s`:e.rate?`rtpmap:%d %s/%s`:`rtpmap:%d %s`}},{push:`fmtp`,reg:/^fmtp:(\d*) ([\S| ]*)/,names:[`payload`,`config`],format:`fmtp:%d %s`},{name:`control`,reg:/^control:(.*)/,format:`control:%s`},{name:`rtcp`,reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:[`port`,`netType`,`ipVer`,`address`],format:function(e){return e.address==null?`rtcp:%d`:`rtcp:%d %s IP%d %s`}},{push:`rtcpFbTrrInt`,reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:[`payload`,`value`],format:`rtcp-fb:%s trr-int %d`},{push:`rtcpFb`,reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:[`payload`,`type`,`subtype`],format:function(e){return e.subtype==null?`rtcp-fb:%s %s`:`rtcp-fb:%s %s %s`}},{push:`ext`,reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:[`value`,`direction`,`encrypt-uri`,`uri`,`config`],format:function(e){return`extmap:%d`+(e.direction?`/%s`:`%v`)+(e[`encrypt-uri`]?` %s`:`%v`)+` %s`+(e.config?` %s`:``)}},{name:`extmapAllowMixed`,reg:/^(extmap-allow-mixed)/},{push:`crypto`,reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:[`id`,`suite`,`config`,`sessionConfig`],format:function(e){return e.sessionConfig==null?`crypto:%d %s %s`:`crypto:%d %s %s %s`}},{name:`setup`,reg:/^setup:(\w*)/,format:`setup:%s`},{name:`connectionType`,reg:/^connection:(new|existing)/,format:`connection:%s`},{name:`mid`,reg:/^mid:([^\s]*)/,format:`mid:%s`},{push:`msid`,reg:/^msid:([\w-]+)(?: ([\w-]+))?/,names:[`id`,`appdata`],format:`msid:%s %s`},{name:`ptime`,reg:/^ptime:(\d*(?:\.\d*)*)/,format:`ptime:%d`},{name:`maxptime`,reg:/^maxptime:(\d*(?:\.\d*)*)/,format:`maxptime:%d`},{name:`direction`,reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:`icelite`,reg:/^(ice-lite)/},{name:`iceUfrag`,reg:/^ice-ufrag:(\S*)/,format:`ice-ufrag:%s`},{name:`icePwd`,reg:/^ice-pwd:(\S*)/,format:`ice-pwd:%s`},{name:`fingerprint`,reg:/^fingerprint:(\S*) (\S*)/,names:[`type`,`hash`],format:`fingerprint:%s %s`},{push:`candidates`,reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:[`foundation`,`component`,`transport`,`priority`,`ip`,`port`,`type`,`raddr`,`rport`,`tcptype`,`generation`,`network-id`,`network-cost`],format:function(e){var t=`candidate:%s %d %s %d %s %d typ %s`;return t+=e.raddr==null?`%v%v`:` raddr %s rport %d`,t+=e.tcptype==null?`%v`:` tcptype %s`,e.generation!=null&&(t+=` generation %d`),t+=e[`network-id`]==null?`%v`:` network-id %d`,t+=e[`network-cost`]==null?`%v`:` network-cost %d`,t}},{name:`endOfCandidates`,reg:/^(end-of-candidates)/},{name:`remoteCandidates`,reg:/^remote-candidates:(.*)/,format:`remote-candidates:%s`},{name:`iceOptions`,reg:/^ice-options:(\S*)/,format:`ice-options:%s`},{push:`ssrcs`,reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:[`id`,`attribute`,`value`],format:function(e){var t=`ssrc:%d`;return e.attribute!=null&&(t+=` %s`,e.value!=null&&(t+=`:%s`)),t}},{push:`ssrcGroups`,reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:[`semantics`,`ssrcs`],format:`ssrc-group:%s %s`},{name:`msidSemantic`,reg:/^msid-semantic:\s?(\w*) (\S*)/,names:[`semantic`,`token`],format:`msid-semantic: %s %s`},{push:`groups`,reg:/^group:(\w*) (.*)/,names:[`type`,`mids`],format:`group:%s %s`},{name:`rtcpMux`,reg:/^(rtcp-mux)/},{name:`rtcpRsize`,reg:/^(rtcp-rsize)/},{name:`sctpmap`,reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:[`sctpmapNumber`,`app`,`maxMessageSize`],format:function(e){return e.maxMessageSize==null?`sctpmap:%s %s`:`sctpmap:%s %s %s`}},{name:`xGoogleFlag`,reg:/^x-google-flag:([^\s]*)/,format:`x-google-flag:%s`},{push:`rids`,reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:[`id`,`direction`,`params`],format:function(e){return e.params?`rid:%s %s %s`:`rid:%s %s`}},{push:`imageattrs`,reg:RegExp(`^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?`),names:[`pt`,`dir1`,`attrs1`,`dir2`,`attrs2`],format:function(e){return`imageattr:%s %s %s`+(e.dir2?` %s %s`:``)}},{name:`simulcast`,reg:RegExp(`^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$`),names:[`dir1`,`list1`,`dir2`,`list2`],format:function(e){return`simulcast:%s %s`+(e.dir2?` %s %s`:``)}},{name:`simulcast_03`,reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:[`value`],format:`simulcast: %s`},{name:`framerate`,reg:/^framerate:(\d+(?:$|\.\d+))/,format:`framerate:%s`},{name:`sourceFilter`,reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:[`filterMode`,`netType`,`addressTypes`,`destAddress`,`srcList`],format:`source-filter: %s %s %s %s %s`},{name:`bundleOnly`,reg:/^(bundle-only)/},{name:`label`,reg:/^label:(.+)/,format:`label:%s`},{name:`sctpPort`,reg:/^sctp-port:(\d+)$/,format:`sctp-port:%s`},{name:`maxMessageSize`,reg:/^max-message-size:(\d+)$/,format:`max-message-size:%s`},{push:`tsRefClocks`,reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:[`clksrc`,`clksrcExt`],format:function(e){return`ts-refclk:%s`+(e.clksrcExt==null?``:`=%s`)}},{name:`mediaClk`,reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:[`id`,`mediaClockName`,`mediaClockValue`,`rateNumerator`,`rateDenominator`],format:function(e){var t=`mediaclk:`;return t+=e.id==null?`%v%s`:`id=%s %s`,t+=e.mediaClockValue==null?``:`=%s`,t+=e.rateNumerator==null?``:` rate=%s`,t+=e.rateDenominator==null?``:`/%s`,t}},{name:`keywords`,reg:/^keywds:(.+)$/,format:`keywds:%s`},{name:`content`,reg:/^content:(.+)/,format:`content:%s`},{name:`bfcpFloorCtrl`,reg:/^floorctrl:(c-only|s-only|c-s)/,format:`floorctrl:%s`},{name:`bfcpConfId`,reg:/^confid:(\d+)/,format:`confid:%s`},{name:`bfcpUserId`,reg:/^userid:(\d+)/,format:`userid:%s`},{name:`bfcpFloorId`,reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:[`id`,`mStream`],format:`floorid:%s mstrm:%s`},{push:`invalid`,names:[`value`]}]};Object.keys(n).forEach(function(e){n[e].forEach(function(e){e.reg||=/(.*)/,e.format||=`%s`})})})),Ui=s((e=>{var t=function(e){return String(Number(e))===e?Number(e):e},n=function(e,n,r,i){if(i&&!r)n[i]=t(e[1]);else for(var a=0;a<r.length;a+=1)e[a+1]!=null&&(n[r[a]]=t(e[a+1]))},r=function(e,t,r){var i=e.name&&e.names;e.push&&!t[e.push]?t[e.push]=[]:i&&!t[e.name]&&(t[e.name]={});var a=e.push?{}:i?t[e.name]:t;n(r.match(e.reg),a,e.names,e.name),e.push&&t[e.push].push(a)},i=Hi(),a=RegExp.prototype.test.bind(/^([a-z])=(.*)/);e.parse=function(e){var t={},n=[],o=t;return e.split(/(\r\n|\r|\n)/).filter(a).forEach(function(e){var t=e[0],a=e.slice(2);t===`m`&&(n.push({rtp:[],fmtp:[]}),o=n[n.length-1]);for(var s=0;s<(i[t]||[]).length;s+=1){var c=i[t][s];if(c.reg.test(a))return r(c,o,a)}}),t.media=n,t};var o=function(e,n){var r=n.split(/=(.+)/,2);return r.length===2?e[r[0]]=t(r[1]):r.length===1&&n.length>1&&(e[r[0]]=void 0),e};e.parseParams=function(e){return e.split(/;\s?/).reduce(o,{})},e.parseFmtpConfig=e.parseParams,e.parsePayloads=function(e){return e.toString().split(` `).map(Number)},e.parseRemoteCandidates=function(e){for(var n=[],r=e.split(` `).map(t),i=0;i<r.length;i+=3)n.push({component:r[i],ip:r[i+1],port:r[i+2]});return n},e.parseImageAttributes=function(e){return e.split(` `).map(function(e){return e.substring(1,e.length-1).split(`,`).reduce(o,{})})},e.parseSimulcastStreamList=function(e){return e.split(`;`).map(function(e){return e.split(`,`).map(function(e){var n,r=!1;return e[0]===`~`?(n=t(e.substring(1,e.length)),r=!0):n=t(e),{scid:n,paused:r}})})}})),Wi=s(((e,t)=>{var n=Hi(),r=/%[sdv%]/g,i=function(e){var t=1,n=arguments,i=n.length;return e.replace(r,function(e){if(t>=i)return e;var r=n[t];switch(t+=1,e){case`%%`:return`%`;case`%s`:return String(r);case`%d`:return Number(r);case`%v`:return``}})},a=function(e,t,n){var r=t.format instanceof Function?t.format(t.push?n:n[t.name]):t.format,a=[e+`=`+r];if(t.names)for(var o=0;o<t.names.length;o+=1){var s=t.names[o];t.name?a.push(n[t.name][s]):a.push(n[t.names[o]])}else a.push(n[t.name]);return i.apply(null,a)},o=[`v`,`o`,`s`,`i`,`u`,`e`,`p`,`c`,`b`,`t`,`r`,`z`,`a`],s=[`i`,`c`,`b`,`a`];t.exports=function(e,t){t||={},e.version??=0,e.name??=` `,e.media.forEach(function(e){e.payloads??=``});var r=t.outerOrder||o,i=t.innerOrder||s,c=[];return r.forEach(function(t){n[t].forEach(function(n){n.name in e&&e[n.name]!=null?c.push(a(t,n,e)):n.push in e&&e[n.push]!=null&&e[n.push].forEach(function(e){c.push(a(t,n,e))})})}),e.media.forEach(function(e){c.push(a(`m`,n.m[0],e)),i.forEach(function(t){n[t].forEach(function(n){n.name in e&&e[n.name]!=null?c.push(a(t,n,e)):n.push in e&&e[n.push]!=null&&e[n.push].forEach(function(e){c.push(a(t,n,e))})})})}),c.join(`\r
2
3
  `)+`\r
3
- `},writer}var hasRequiredLib$1;function requireLib$1(){if(hasRequiredLib$1)return lib$1;hasRequiredLib$1=1;var b=requireParser(),m=requireWriter(),u=requireGrammar();return lib$1.grammar=u,lib$1.write=m,lib$1.parse=b.parse,lib$1.parseParams=b.parseParams,lib$1.parseFmtpConfig=b.parseFmtpConfig,lib$1.parsePayloads=b.parsePayloads,lib$1.parseRemoteCandidates=b.parseRemoteCandidates,lib$1.parseImageAttributes=b.parseImageAttributes,lib$1.parseSimulcastStreamList=b.parseSimulcastStreamList,lib$1}var libExports$1=requireLib$1();class RemoteUserP2P{config;prResolves=new PrResolves;remoteUserId="";peer;timer;channelLocal;channelRemote;channelRemoteList=[];icecandidates=[];isCandidateCollected=!1;transceiverSend=new Map;transceiverRecv=new Map;activeSend={};activeRecv={};on={};waitings={candidateCollected:()=>this.prResolves.add("candidateCollected",()=>this.isCandidateCollected),remoteChannelConnected:()=>this.prResolves.add("remoteChannelConnected",()=>this.channelRemote?.readyState==="open"),connected:()=>this.prResolves.add("connected",()=>this.peer?.connectionState==="connected"),setOffered:()=>this.prResolves.add("setOffered",()=>this.peer?.remoteDescription)};constructor({config:m,remoteUserId:u}){this.config=m,this.remoteUserId=u}remoteChannelSend=async m=>{if(await this.waitings.remoteChannelConnected(),this.config.debug&&this.channelRemote?.readyState!=="open"){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [remoteChannelSend] RemoteChannel is error.",{channelRemote:this.channelRemote});return}const u=sendMessageFormat(m),T=new Uint8Array(obj2pb(u));this.channelRemote?.send(T)};init=()=>{this._clear(),this.peer=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}]}),this.peer.addTransceiver("audio",{direction:"inactive"}),this.channelLocal=this.peer.createDataChannel(`Web_P2P_${this.config.userId}`,{}),this.channelLocal.onmessage=m=>{const u=new Uint8Array(m.data),T=pb2obj(u),r=onMessageFormat(T),{event:c,data:e}=r;switch(c){case"UpdateTrackActive":{const{tracks:t=[]}=e;for(const i of t){const{type:_,isActive:I=!1}=i,x=mediaType_keys[_];this.setSendTracksEnabled([x],I,"remote")}}break}},this.peer.ondatachannel=m=>{this.channelRemote=m.channel,this.channelRemoteList.push(m.channel),this.channelRemote.onopen=()=>{this.prResolves.emit("remoteChannelConnected")},this.config.debug&&this.channelRemoteList.length>1&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: There are multiple channelRemote.",this.channelRemoteList)},this.peer.onconnectionstatechange=m=>{const u=m.target.connectionState;switch(u){case"connected":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: [p2p.onconnectionstatechange] ${u} `,{remoteUserId:this.remoteUserId}),clearTimeout(this.timer),this.prResolves.emit("connected");break;case"failed":case"disconnected":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: [p2p.onconnectionstatechange] ${u} `,{remoteUserId:this.remoteUserId}),this.timer=setTimeout(()=>this.close(),20*1e3);break;case"closed":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: [p2p.onconnectionstatechange] ${u} `,{remoteUserId:this.remoteUserId}),this.destroy();break;default:this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: [p2p.onconnectionstatechange] ${u} `,{remoteUserId:this.remoteUserId});break}},this.peer.onicecandidate=m=>{m.candidate&&this.icecandidates.push(m.candidate)}};getSenderTrack=m=>this.transceiverSend.get(m)?.sender.track;getRecvierTrack=m=>this.transceiverRecv.get(m)?.receiver.track;syncRecvTracksEnabled=()=>{const m=[],u=[];for(const T of mediaType_keys)T.includes("audio")||(this.activeRecv[T]?m.push(T):u.push(T));m.length!==0&&this.setRecvTracksEnabled(m,!0),u.length!==0&&this.setRecvTracksEnabled(u,!1)};initSenders=(m=[],u="sendrecv")=>{const T=this.checkPeer(),r=[],c=T?.getTransceivers()||[];for(const e of mediaType_keys){const t=this.transceiverSend.get(e);if(!t)continue;c.find(_=>_.direction!=="stopped"&&_.mid===t?.mid)||this.transceiverSend.delete(e)}for(const e of m){const{mid:t,mediaType:i}=e;let _=c?.find(x=>x.mid===t);if(!_)continue;_.direction=u;const I=this.transceiverSend.get(i);I&&I.mid===_.mid||(this.transceiverSend.set(i,_),r.push(i),u=="sendrecv"&&this.transceiverRecv.set(i,_))}return r};initRecvs=(m=[],u="sendrecv")=>{const T=this.checkPeer(),r=[],c=T?.getTransceivers()||[];for(const e of mediaType_keys){const t=this.transceiverRecv.get(e);if(!t)continue;c.find(_=>_.direction!=="stopped"&&_.mid===t?.mid)||this.transceiverRecv.delete(e)}for(const e of m){if(this.transceiverRecv.get(e))continue;let i;switch(e){case"mc_audio":case"ss_audio":i="audio";break;case"mc_video":case"ss_video":i="video";break}const _=T.addTransceiver(i,{direction:u});_.direction=u,["mc_video","ss_video"].includes(e)&&_.setCodecPreferences(this.config.codecPreferences.video),this.transceiverRecv.set(e,_),r.push(e)}return r};hasRecvier=async m=>this.transceiverRecv.has(m);hasSender=async m=>this.transceiverSend.has(m);checkActive=()=>{if(!this.peer||this.peer.connectionState!=="connected")return!1;let m=!1;for(const u of mediaType_keys){if(!this.activeSend[u])continue;m=!0;break}for(const u of mediaType_keys){if(!this.activeRecv[u])continue;m=!0;break}return m};replaceSenderTrack=async(m,u)=>{const T=this.transceiverSend.get(m);if(!T)return;const{sender:r}=T;await r.replaceTrack(u)};setSendTracksEnabled=(m=[],u,T)=>{this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m",`color: ${u?"#00b60f":"#b64900"};`,`------->quickvo: [p2p.setSendTracksEnabled] ${u} `,{origin:T,mediaTypes:m,remoteUserId:this.remoteUserId,time:p$1(new Date().getTime())});const r=[];for(const c of m)this.activeSend[c]=u===!0?new Date().getTime():void 0,r.push(c);return this.on.setSendTracksEnabled&&this.on.setSendTracksEnabled(m),r};setRecvTracksEnabled=(m=[],u)=>{this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m",`color: ${u?"#00b60f":"#b64900"};`,`------->quickvo: [p2p.setRecvTracksEnabled] ${u} `,{mediaTypes:m,remoteUserId:this.remoteUserId,time:p$1(new Date().getTime())});const T=[];for(const e of m)this.activeRecv[e]=u===!0?new Date().getTime():void 0,T.push(e);const r=this.getRecvUserTracks(T);this.remoteChannelSend({event:"UpdateTrackActive",data:{roomId:this.config.roomId,tracks:r}});const c=this.checkActive();return u===!1&&c===!1&&this.close(),T};setRTCRtpSenderParameters=async(m,u=[])=>{try{for(const T of u){const r=this.transceiverSend.get(T);if(!r)continue;const{sender:c}=r,e=c.getParameters();await c.setParameters({...e,...m})}}catch(T){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",T)}};createOffer=async()=>{const m=this.checkPeer(),u=await m.createOffer();return u.sdp&&(u.sdp=u.sdp.replace(new RegExp("42e01f","g"),"42e034")),await m.setLocalDescription(u),u};setOffer=async m=>{const u=this.checkPeer();this._filterSdp(m),await u.setRemoteDescription(m),await this.prResolves.emit("setOffered")};createAnswer=async()=>{const m=this.checkPeer(),u=await m.createAnswer();return u.sdp&&(u.sdp=u.sdp.replace(new RegExp("42e01f","g"),"42e034")),await m.setLocalDescription(u),u};setAnswer=async m=>{const u=this.checkPeer();this._filterSdp(m),await u.setRemoteDescription(m)};getIcecandidates=async()=>(await this.waitings.candidateCollected(),this.icecandidates);addCandidates=async m=>{await this.waitings.setOffered();for(const u of m)u.candidate?.includes("kcp")||await this.peer?.addIceCandidate(u)};getSenderUserTracks=(m=[])=>{const u=[];for(const T of m){const r=this.transceiverSend.get(T);if(!r)continue;const{mid:c,sender:e}=r,{track:t}=e;if(!t)continue;const{id:i,enabled:_}=t,I=mediaType_keys.findIndex(M=>M===T),x={type:I,enabled:_,trackName:`web-${I}-${i}`,mid:c,mediaType:T};u.push(x)}return u};getRecvUserTracks=(m=[])=>{const u=[];for(const T of m){const r=this.transceiverRecv.get(T);if(!r)continue;const{mid:c,receiver:e}=r,{track:t}=e;if(!t)continue;const{id:i,enabled:_}=t,I=mediaType_keys.findIndex(j=>j===T),x=this.activeRecv[T],M={type:I,enabled:_,trackName:`web-${I}-${i}`,mid:c,mediaType:T,isActive:x};u.push(M)}return u};checkReceActive=m=>this.activeRecv[m]||!1;getTrack=m=>this.transceiverRecv.get(m)?.receiver?.track;checkPeer=()=>{if(!this.peer)throw new Error("you need init peer.");return this.peer};close=()=>{this.peer?.connectionState==="connected"&&this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [p2p.close]",{remoteUserId:this.remoteUserId}),clearTimeout(this.timer);{const m=[...this.transceiverSend.values()];for(const u of m)u.currentDirection!=="stopped"&&u.stop();this.transceiverSend=new Map}{const m=[...this.transceiverRecv.values()];for(const u of m)u.currentDirection!=="stopped"&&u.stop();this.transceiverRecv=new Map}this.peer?.close(),this.on.close&&this.on.close()};destroy=async()=>{this.close(),this._clear()};_clear=()=>{this.icecandidates=[],this.isCandidateCollected=!1,this.channelLocal=void 0,this.channelRemote=void 0,this.channelRemoteList=[],this.activeSend={},this.activeRecv={},this.transceiverSend=new Map,this.transceiverRecv=new Map,this.peer=void 0};_filterSdp=m=>{const u=libExports$1.parse(m.sdp),{media:T=[]}=u;for(const r of T){const{candidates:c=[]}=r,e=[];for(const t of c)t.transport!=="kcp"&&e.push(t);r.candidates=e}m.sdp=libExports$1.write(u)}}class Users{config;localMedias;notifys;localUser;remoteUsers=new Map;constructor({config:m,localMedias:u,notifys:T}){this.config=m,this.localMedias=u,this.notifys=T,this.localUser=new LocalUser({config:m,localMedias:u})}getLocalUserTrackReports=m=>this.localUser.getTrackReports(m);getRemoteUserTrackReports=(m,u,T,r)=>this.getRemoteUserContent(m)?.getTrackReports(u,T,r);getUserContent=m=>m?m===this.config.userId?this.localUser:this.getRemoteUserContent(m):this.localUser;getRemoteUserContent=m=>this.remoteUsers.get(m);getUserAudioMediaStreamContext=(m,u)=>this.getUserContent(m)?.getUserMediaStreamContext(u);setInputVolume=(m,u,T)=>{this.getUserAudioMediaStreamContext(m,u)?.setInputGain(T)};setEnhanceGain=async(m,u,T)=>{this.getUserAudioMediaStreamContext(m,u)?.setEnhanceGain(T)};setSpeakerVolume=(m,u,T)=>{const r=this.getUserAudioMediaStreamContext(m,u);r?.setOutputGain(T);const c=T===0;r?.setMute(c)};getVolume=(m,u)=>this.getUserAudioMediaStreamContext(m,u)?.getVolume();playBgs=async(m,u,T)=>{const r=this.getUserContent(m);if(!r)throw new Error("This user is undefined.");await r.streamControls[u]?.mixAudio(T,"bgs")};playBgm=async(m,u,T)=>{const r=this.getUserContent(m);if(!r)throw new Error("This user is undefined.");await r.streamControls[u]?.mixAudio(T,"bgm")};changBgsMix=async(m,u,T)=>{const r=this.getUserContent(m);if(!r)throw new Error("This user is undefined.");r.streamControls[u]?.changeMix("bgs",T)};changBgmMix=async(m,u,T)=>{const r=this.getUserContent(m);if(!r)throw new Error("This user is undefined.");r.streamControls[u]?.changeMix("bgm",T)};stopBgs=async(m,u)=>{const T=this.getUserContent(m);if(!T)throw new Error("This user is undefined.");T.streamControls[u]?.mixAudioStop("bgs")};stopBgm=async(m,u)=>{const T=this.getUserContent(m);if(!T)throw new Error("This user is undefined.");T.streamControls[u]?.mixAudioStop("bgm")};setBgsGain=async(m,u,T)=>{const r=this.getUserContent(m);if(!r)throw new Error("This user is undefined.");r.streamControls[u]?.setBgsGain(T)};setBgmGain=async(m,u,T)=>{const r=this.getUserContent(m);if(!r)throw new Error("This user is undefined.");r.streamControls[u]?.setBgmGain(T)};getrP2PConnectedCount=()=>{let m=0;const u=this.remoteUsers.values();for(const T of u)T.p2p&&(m+=T.p2p.transceiverSend.size);return m};addRemoteUsersSubscribes=(m=[])=>{for(const u of m){const{userId:T,mediaTypes:r}=u;this.remoteUsers.get(T)?.addSubscribe(r)}};executeRemoteUsersSubscribes=()=>{const m=[],u=this.remoteUsers.values();for(const T of u){const r=T.executeSubscribe();r.tracks.length!==0&&m.push(r)}return m};completedRemoteUsersSubscribes=m=>{for(const u of m){const{id:T,tracks:r=[]}=u,c=this.remoteUsers.get(T);c?.updateTracks(r);for(const e of r){const{type:t}=e,i=mediaType_keys[t];c?.completedSubscribe([i])}}};emitUsersChange=()=>{const m=this.getUsersInfo();this.notifys.emit("onRoomUsers",{code:200,desc:"All users info is change.",data:m})};getMaxVolumeUser=()=>{const m=[...this.remoteUsers.keys()];if(m.push(this.localUser.id),m.length===0)return;let u=[];for(const T of m){const r=this.getVolume(T,"mc_audio");r&&u.push({id:T,volume:r})}return u=u.sort((T,r)=>T.volume-r.volume>0?-1:1),u[0]};getUserStream=(m,u)=>this.getUserContent(m)?.getStream(u);getUsersInfo=()=>{const u=[this.localUser.getInfo()],T=[...this.remoteUsers.values()];for(const r of T){const c=r.getInfo();u.push(c)}return u};getP2PState=()=>{const m={pull:[],push:[]};{const u=this.remoteUsers.values();for(const T of u){const{id:r,p2p:c}=T;if(!c)continue;const e=[],t=[];for(const i of mediaType_keys){const _=mediaType_keys.findIndex(I=>I===i);{if((c.activeSend[i]||!1)===!1)continue;e.push(_)}{if((c.activeRecv[i]||!1)===!1)continue;t.push(_)}}e.length!==0&&m.push.push({userId:r,types:e}),t.length!==0&&m.pull.push({userId:r,types:t})}}return m};createRemoteUser=m=>{const{config:u,localMedias:T}=this,r=new RemoteUser({config:u,localMedias:T});return r.id=m,this.remoteUsers.set(m,r),r};checkRemoteUser=m=>this.remoteUsers.has(m);removeRemoteUser=m=>{this.remoteUsers.get(m)?.clear(),this.remoteUsers.delete(m)};updateUsersIsAdmin=(m=[])=>{this.localUser.isAdmin=m.includes(this.localUser.id);const u=this.remoteUsers.values();for(const T of u)T.isAdmin=m.includes(T.id)};initUsers=m=>{for(const u of m){const{id:T,callAction:r=0,permissions:c=0,behavior:e=0,tracks:t}=u;if(this.localUser?.id===T)this.localUser.updateCallAction(r),this.localUser.updatePermissions(c),this.localUser.updateBanBehavior(e),this.localUser.updateTracks(t||[],!0);else{let i=this.remoteUsers.get(T);i||(i=this.createRemoteUser(T)),i.updateCallAction(r),i.updatePermissions(c),i.updateBanBehavior(e),i.updateTracks(t||[],!0)}}};clearUsers=()=>{this.localUser.clear();const m=[...this.remoteUsers.keys()];for(const u of m)this.remoteUsers.get(u)?.clear(),this.remoteUsers.delete(u)};createRemoteUserP2P=m=>{const u=this.getRemoteUserContent(m);if(!u)throw new Error("The remote user to be established does not exist.");const T=new RemoteUserP2P({config:this.config,remoteUserId:u.id});return T.on.setSendTracksEnabled=r=>{this.syncRemoteUserP2PSenderStreamTrack(r)},T.on.close=()=>{for(const r of mediaType_keys)u.tracksAnalysis.p2p.sends[r].clear(),u.tracksAnalysis.p2p.recvs[r].clear()},u.p2p=T,T};syncRemoteUserP2PSenderStreamTrack=async m=>{const u=this.remoteUsers.values();for(const T of u)for(const r of m){if(!T.p2p||!T.p2p.hasSender(r))continue;if(T.p2p.activeSend[r]){const e=this.localUser.getStream(r);if(!e)continue;const[t]=e.getTracks();T.p2p.replaceSenderTrack(r,t)}else{const e=this.localMedias.getPhoneyStreamTrack(r);T.p2p.replaceSenderTrack(r,e)}}}}var S=Object.defineProperty,v$1=b=>{throw TypeError(b)},O=(b,m,u)=>m in b?S(b,m,{enumerable:!0,configurable:!0,writable:!0,value:u}):b[m]=u,f=(b,m,u)=>O(b,typeof m!="symbol"?m+"":m,u),Y=(b,m,u)=>m.has(b)||v$1("Cannot "+u),k=(b,m,u)=>(Y(b,m,"read from private field"),m.get(b)),B=(b,m,u)=>m.has(b)?v$1("Cannot add the same private member more than once"):m instanceof WeakSet?m.add(b):m.set(b,u);const J=(b=0,m=1)=>{const u=Math.max(0,b),T=Math.max(1,m),r=Math.random()*(T-u+1)+u;return parseInt(`${r}`,10)},A=(b=16,m=16)=>{const u="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),T=Math.min(u.length,m),r=Date.now().toString(T),c=r.split(""),e=Math.max(4,b-r.length);for(let t=0;t<e;t++){const i=J(0,T-1),_=u[i];c.push(_)}return c.join("").toUpperCase()},w=(b,m)=>{try{let u=Number(b);if(isNaN(u)){const T=new Date(`${b}`);if(`${T}`=="Invalid Date")return 0;u=T.getTime()}if(m!==void 0){const T=new Date().getTimezoneOffset();u+=(T+m)*60*1e3}return u}catch(u){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:b,_offset:m,error:u}),0}},E={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六","07":"日"},y$1=b=>w(b),D=(b,m="YYYY-MM-DD hh:mm:ss",u={})=>{const T={empty_str:"-",...u},{empty_str:r,offset:c}=T,e=w(b,c);if(Number(b)!==0&&e===0)return r;const t=new Date(e),i=`${t.getFullYear()}`,_=`${t.getMonth()+1}`,I=`${["1","2","3"].includes(_)?1:["4","5","6"].includes(_)?2:["7","8","9"].includes(_)?3:4}`,x=`${t.getDate()}`,M=`${t.getDay()===0?7:t.getDay()}`,j=`${t.getHours()}`,z=`${t.getMinutes()}`,Q=`${t.getSeconds()}`,ne=`${Math.ceil((e-y$1(`${i}/01/01 00:00:00`)+1)/864e5)}`,K=`${Math.ceil(((e-y$1(`${i}/01/01 00:00:00`))/864e5-Number(M))/7)+1}`,oe=[{k:"Y+",v:i},{k:"M+",v:_},{k:"Q+",v:I},{k:"D+",v:x},{k:"W+",v:M},{k:"h+",v:j},{k:"m+",v:z},{k:"s+",v:Q},{k:"d+",v:ne},{k:"w+",v:K}];let ue;for(let{k:G,v:ie}of oe)if(ue=new RegExp(`(${G})`).exec(m),ue){const le=ue[1];let re=ie.padStart(le.length,"0");le.includes("W")&&(re=E[re.slice(0,2)]),m=m.replace(le,re)}return m};var h$1;class W{constructor(m=1e3,u=!1){f(this,"_debug",!1),f(this,"_queue",[]),f(this,"_interval",1e3),f(this,"_now",Date.now()),f(this,"removeQueueItem",(T=[])=>{for(const r of T){const c=this._queue.findIndex(e=>e.key===r);c!==-1&&(this._queue.splice(c,1),this._debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->Breathe:移除事件",r))}}),f(this,"addQueueItem",T=>{const{key:r=A(),execution_time:c=this._now,interval:e=1e4,func:t=()=>{}}=T;this.removeQueueItem([r]);const i=c+Number(e);let _=this._queue.findIndex(x=>i>=x.execution_time);_=_===-1?this._queue.length:_;const I={key:r,execution_time:i,interval:e,func:t};return this._queue.splice(_,0,I),this._debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->Breathe:插入事件",r,`执行时间: ${D(i)}`,`队列位置: ${_}`),r}),B(this,h$1,()=>{this._now=Date.now();const T=this._queue.length;for(let r=T;r>0;r--){const c=this._queue[this._queue.length-1],{key:e,interval:t=0,execution_time:i=0,func:_}=c,I=Math.round((i-this._now)/1e3);if(!c){this._debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->Breathe:","当前 无 任务");break}if(this._debug){const x=Array.from(this._queue,z=>z.execution_time),M=Array.from(this._queue,z=>z.execution_time).sort((z,Q)=>Q-z),j=Array.from(this._queue,z=>z.key);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->Breathe:队列keys",JSON.stringify(j)),JSON.stringify(x)!==JSON.stringify(M)&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->Breathe:时间线${x.length}`,"异常",JSON.stringify(x)),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->Breathe:","当前 有 任务",`最近任务 ${D(i)} 剩余${I}s`,`任务详情:${JSON.stringify(c)}`)}if(I>0)break;if(_(),t===0)return this.removeQueueItem([e]);this.addQueueItem(c)}}),f(this,"startQueue",()=>setInterval(k(this,h$1),this._interval)),this._interval=m,this._debug=u}}h$1=new WeakMap;const Ctor=window.AudioContext||window.webkitAudioContext;class LocalMedias{audioContext=new Ctor;_onDocumentClick;_onDeviceChange;_destroyed=!1;phoneyStreamTracks={};enumerateDevices={audioinput:[],videoinput:[],audiooutput:[]};useMediaDevices={};mediaTrackConstraints={mc_audio:{autoGainControl:!0,noiseSuppression:!0,echoCancellation:!0,sampleRate:48e3,channelCount:2},mc_video:{},ss_video:{},ss_audio:{}};localStreamTracks={};on={};constructor(){this._onDocumentClick=()=>{this.audioContext&&this.audioContext.state==="suspended"&&this.audioContext.resume()},document.addEventListener("click",this._onDocumentClick);const m=gt(this.audioContext,.001),u=wt({width:32,height:32,opacity:0,fps:20,text:""});{const[T]=m.getAudioTracks();this.phoneyStreamTracks.mc_audio=T}{const[T]=u.getVideoTracks();this.phoneyStreamTracks.mc_video=T}{const[T]=m.clone().getAudioTracks();this.phoneyStreamTracks.ss_audio=T}{const[T]=u.clone().getVideoTracks();this.phoneyStreamTracks.ss_video=T}navigator.mediaDevices&&(this._onDeviceChange=()=>{this._getAllEnumerateDevices(),this.on.devicechange&&this.on.devicechange()},navigator.mediaDevices.ondevicechange=this._onDeviceChange),this._getAllEnumerateDevices()}getPhoneyStreamTrack=m=>this.phoneyStreamTracks[m];initLocalStreamTrack=async m=>{switch(m){case"mc_audio":{const u=this._getSafetyMediaDeviceKind("audioinput"),T=this.mediaTrackConstraints.mc_audio,r=await navigator.mediaDevices.getUserMedia({audio:{deviceId:{exact:u},...T},video:!1});this.stopLocalStreamTrack("mc_audio");const[c]=r.getAudioTracks();this.localStreamTracks.mc_audio=c}break;case"mc_video":{const u=this._getSafetyMediaDeviceKind("videoinput"),T=this.mediaTrackConstraints.mc_video,r=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:{exact:u},...T}});this.stopLocalStreamTrack("mc_video");const[c]=r.getVideoTracks();this.localStreamTracks.mc_video=c}break;case"mc":{const u=this._getSafetyMediaDeviceKind("audioinput"),T=this._getSafetyMediaDeviceKind("videoinput"),r=this.mediaTrackConstraints.mc_audio,c=this.mediaTrackConstraints.mc_video,e=await navigator.mediaDevices.getUserMedia({audio:{deviceId:{exact:u},...r},video:{deviceId:{exact:T},...c}});this.stopLocalStreamTrack("mc_audio"),this.stopLocalStreamTrack("mc_video");{const[t]=e.getAudioTracks();this.localStreamTracks.mc_audio=t}{const[t]=e.getVideoTracks();this.localStreamTracks.mc_video=t}}break;case"ss_audio":{const u=this.mediaTrackConstraints.ss_audio,T=await navigator.mediaDevices.getDisplayMedia({audio:{...u},video:!0});this.stopLocalStreamTrack("ss_audio");const[r]=T.getAudioTracks();this.localStreamTracks.ss_audio=r}break;case"ss_video":{const u=this.mediaTrackConstraints.ss_video,T=await navigator.mediaDevices.getDisplayMedia({audio:!1,video:{...u}});this.stopLocalStreamTrack("ss_video");const[r]=T.getVideoTracks();this.localStreamTracks.ss_video=r}break;case"ss":{const u=this.mediaTrackConstraints.ss_audio,T=this.mediaTrackConstraints.ss_video;let r={audio:{...u},video:{...T}};const c=await navigator.mediaDevices.getDisplayMedia(r);this.stopLocalStreamTrack("ss_audio"),this.stopLocalStreamTrack("ss_video");{const[e]=c.getAudioTracks();this.localStreamTracks.ss_audio=e}{const[e]=c.getVideoTracks();this.localStreamTracks.ss_video=e}}break}};getLocalStreamTrack=m=>this.localStreamTracks[m];checkLocalStreamTracks=m=>{const u=[],T=[];for(const r of m)this.localStreamTracks[r]?T.push(r):u.push(r);return{valid_mediaTypes:T,invalid_mediaTypes:u}};stopLocalStreamTrack=m=>{this.localStreamTracks[m]?.stop(),this.localStreamTracks[m]=void 0};isOpenMediaDevice=m=>!!this.localStreamTracks[m];setMediaTrackConstraints=async(m,u)=>{const T=this.mediaTrackConstraints[m];this.mediaTrackConstraints[m]={...T,...u}};getMediaDeviceKind=m=>this.useMediaDevices[m];setMediaDeviceKind=async(m,u)=>{this.useMediaDevices[m]=u};changeAudiooutput=async()=>{try{const m=this.useMediaDevices.audiooutput||"";await this.audioContext.setSinkId(m)}catch(m){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",m)}};getMediaDevicesErrInfo=async()=>{const m={mc_audio:"",mc_video:""};try{const u=await navigator.mediaDevices.enumerateDevices();u.find(r=>r.kind==="audioinput")||(m.mc_audio="audioinput is not available."),u.find(r=>r.kind==="videoinput")||(m.mc_video="videoinput is not available.")}catch(u){m.mc_audio=u.message||u,m.mc_video=u.message||u}return m};getEnumerateDevices=async m=>(await this._getAllEnumerateDevices(),this.enumerateDevices[m]);getEnumerateAudioinputDevices=()=>this.getEnumerateDevices("audioinput");getEnumerateAudioOutputDevices=()=>this.getEnumerateDevices("audiooutput");getEnumerateVideoinputDevices=()=>this.getEnumerateDevices("videoinput");_getAllEnumerateDevices=async()=>{if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return;const m=navigator.language;await navigator.mediaDevices.enumerateDevices().then(u=>{const T={audioinput:[],videoinput:[],audiooutput:[]},r=[];for(const c of u){const{kind:e,label:t,deviceId:i}=c;i!=="communications"&&(i==="default"?T[e].push({kind:e,label:t,deviceId:i}):r.push({kind:e,label:t,deviceId:i}))}T.audioinput.length===0&&T.audioinput.push({kind:"audioinput",deviceId:"default-auto",label:m==="zh-CN"?"默认值-自动":"Default-Auto"}),T.videoinput.length===0&&T.videoinput.push({kind:"videoinput",deviceId:"default-auto",label:m==="zh-CN"?"默认值-自动":"Default-Auto"}),T.audiooutput.length===0&&T.audiooutput.push({kind:"audiooutput",deviceId:"default-auto",label:m==="zh-CN"?"默认值-自动":"Default-Auto"});for(const c of r){const{kind:e,label:t,deviceId:i}=c;T[e].push({kind:e,label:t,deviceId:i})}this.enumerateDevices=T}).catch(function(u){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getAllEnumerateDevices is err",u)})};_getSafetyMediaDeviceKind=m=>{let u=this.useMediaDevices[m];return u==="default-auto"&&(u=void 0),u};destroy=async()=>{if(!this._destroyed){this._destroyed=!0,this._onDocumentClick&&(document.removeEventListener("click",this._onDocumentClick),this._onDocumentClick=void 0),navigator.mediaDevices&&this._onDeviceChange&&navigator.mediaDevices.ondevicechange===this._onDeviceChange&&(navigator.mediaDevices.ondevicechange=null),this._onDeviceChange=void 0;for(const m of Object.keys(this.localStreamTracks))this.stopLocalStreamTrack(m);this.phoneyStreamTracks?.mc_audio&&this.phoneyStreamTracks.mc_audio.stop(),this.phoneyStreamTracks?.mc_video&&this.phoneyStreamTracks.mc_video.stop(),this.phoneyStreamTracks?.ss_audio&&this.phoneyStreamTracks.ss_audio.stop(),this.phoneyStreamTracks?.ss_video&&this.phoneyStreamTracks.ss_video.stop(),this.phoneyStreamTracks=void 0;try{this.audioContext&&this.audioContext.state!=="closed"&&await this.audioContext.close()}catch(m){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: LocalMedias.audioContext.close is error.",m)}}}}class Peer{config;users;prResolves=new PrResolves;pc=new RTCPeerConnection;transceiverMap=new Map;transceiverCreatedTimeMap=new Map;transceiverTrackMap=new Map;iceConnectionTimer=0;simulcast="f";on={};waitings={peerConnected:async()=>this.prResolves.add("peerConnected",()=>this.pc.connectionState==="connected")};constructor({config:m,users:u}){this.config=m,this.users=u}setRTCRtpSenderParameters=async(m,u=[])=>{try{for(const T of u){const r=this.transceiverMap.get(T);if(!r)continue;const{sender:c}=r,e=c.getParameters();await c.setParameters({...e,...m})}}catch(T){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",T)}};init=async()=>{this.close(),this.pc=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}],bundlePolicy:"max-bundle"}),this.pc.addTransceiver("audio",{direction:"sendonly"}),this.pc.addTransceiver("video",{direction:"sendonly"});const m=await this.pc.createOffer();await this.pc.setLocalDescription(m),this.pc.onconnectionstatechange=u=>{const T=u.target.connectionState;switch(T){case"connected":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${T}`),clearTimeout(this.iceConnectionTimer),this.prResolves.emit("peerConnected");break;case"disconnected":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${T}`),this.iceConnectionTimer=window.setTimeout(this.close,1e3*15);break;case"failed":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${T}`);break;case"closed":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${T}`);break;default:this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${T}`);break}this.on.state&&this.on.state(T)}};close=()=>{clearTimeout(this.iceConnectionTimer),this.transceiverMap=new Map,this.transceiverTrackMap=new Map,this.pc.close()};addSenders=async m=>{const u=[],T=new Date().getTime();for(const r of m){if(this.transceiverMap.get(r))continue;u.push(r);const t={direction:"sendonly",sendEncodings:[{priority:r==="mc_audio"||r==="ss_audio"?"high":"low"}]},i=this.users.localUser.getStream(r),[_]=i.getTracks(),I=this.pc.addTransceiver(_,t);["mc_video","ss_video"].includes(r)&&I.setCodecPreferences(this.config.codecPreferences.video),this.transceiverMap.set(r,I),this.transceiverCreatedTimeMap.set(r,T)}if(u.length!==0){const r=await this.pc.createOffer();if(this.config.debug){const c=libExports$1.parse(r.sdp),e=pt(c.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:e,sdpJson:c,description:r})}await this.pc.setLocalDescription(r)}for(const r of u){const c=this.transceiverMap.get(r);if(!c)continue;const{mid:e,sender:t}=c,{track:i}=t;if(!i)continue;const _=mediaType_keys.findIndex(M=>M===r),I=`WEB-${_}-${bt()}`,x={type:_,mediaType:r,trackName:I,location:"local",mid:e,origin:"local",enabled:!0};this.transceiverTrackMap.set(r,x)}return u};syncSenderStreamTrack=async m=>{for(const u of m){if(!this.hasSender(u))continue;const T=this.users.localUser.getStream(u),[r]=T.getTracks();await this.replaceSenderTrack(u,r)}};stopSenders=m=>{for(const u of m){const T=this.transceiverMap.get(u);T&&(T.stop(),this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: stopSenders: ${T.mid} is stop.`,T),this.transceiverMap.delete(u),this.transceiverTrackMap.delete(u))}};checkSendersCreatedTime=()=>{const m=[],u=new Date().getTime();for(const T of mediaType_keys){const r=this.transceiverCreatedTimeMap.get(T);r&&u-r>=1e3*60*20&&m.push(T)}return this.stopSenders(m),m};hasSender=m=>this.transceiverMap.has(m);replaceSenderTrack=async(m,u)=>{const T=this.transceiverMap.get(m);if(!T)throw new Error(`ReplaceTrack is error. no have ${m} transceiver.`);const{sender:r}=T;await r.replaceTrack(u)};getSenderUserTracks=(m=[])=>{const u=[];for(const T of m){const r=this.transceiverTrackMap.get(T);r&&u.push(r)}return u};getTransceiver=m=>this.pc.getTransceivers().find(r=>r.mid===m);getSenderTrack=m=>this.transceiverMap.get(m)?.sender.track;getRecvierTrack=m=>this.pc.getTransceivers().find(r=>r.mid===m)?.receiver.track;stopReceivers=m=>{if(m.length===0)return;const u=this.pc.getTransceivers();for(const T of u){const{mid:r}=T;r&&m.includes(r)&&(T.receiver.track.stop(),T.stop(),this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: stopReceivers: ${r} is stop.`,T))}};createOffer=async()=>{const m=await this.pc.createOffer();if(this.config.debug){const u=libExports$1.parse(m.sdp),T=pt(u.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:T,sdpJson:u,description:m})}await this.pc.setLocalDescription(m)};createAnswer=async()=>{const m=await this.pc.createAnswer();if(this.config.debug){const u=libExports$1.parse(m.sdp),T=pt(u.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:T,sdpJson:u,description:m})}await this.pc.setLocalDescription(m)};getSdp=()=>this.pc.localDescription?.sdp||"";setRemoteDescription=async m=>{if(this.config.debug){const u=libExports$1.parse(m.sdp),T=pt(u.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:T,sdpJson:u,description:m})}return await this.pc.setRemoteDescription(m),m}}class CallsWebSocketEvent{eventName;prws;message;needRetry=!0;sn=Number(bt(16,10));_resolve=m=>{};_reject=m=>{};sendBefore;sendAfter;options={timeout:30*1e3,onBack:!0};timer=0;constructor(m,u,T={}){this.prws=u,T.timeout!==void 0&&T.timeout<=0&&(T.timeout=60*1e3),this.eventName=m,this.options={...this.options,...T}}resolve=m=>{if(this.options.onBack&&(m.sn!==this.message?.sn&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: Received a timeout response. ${this.message?.sn} !== ${m.sn}`,{current:this.message,response:m}),this.message&&this.message.time)){const u=m.time-this.message.time;u>=10*1e3&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: This request response is too long. ${St(u)}`,{current:this.message,response:m})}this.needRetry=!1,clearTimeout(this.timer),this.sendAfter&&this.sendAfter(),this._resolve(m)};reject=m=>{this.needRetry=!1,clearTimeout(this.timer),this._reject(m)};retry=()=>{if(!this.message)throw new Error(`[${this.eventName}]: Send needs to be called first.`);this.message.time=Date.now(),this.sendMsg()};send=m=>new Promise((u,T)=>{this._resolve=u,this._reject=T;let{data:r,compress:c=!1,version:e=5}=m;const t=this.eventName,i=Date.now(),_=this.options.timeout,I={event:t,data:r,sn:this.sn,time:i,valid:_,compress:c,version:e};this.message=sendMessageFormat(I),this.sendMsg()});sendMsg=()=>{if(this.prws.ws?.readyState!==1)return;if(!this.message||!this.message.sn)return this.reject("Message is undefined or Message.sn is undefined.");this.sendBefore&&this.sendBefore(this.message);const m=com.quick.voice.proto.CommonReq.encode(this.message).finish();if(this.prws.send(m),this.options.onBack===!0)this._createTimer();else{const{event:u,sn:T}=this.message;this.needRetry=!1,this.sendAfter&&this.sendAfter(),this._resolve({event:u,sn:T,code:200,desc:"",data:{}})}};_createTimer=()=>{this.timer=window.setTimeout(()=>{const m=new Error(`[${this.eventName}]: Event is timeout.`);m.name="timeout",this._reject(m)},this.options.timeout)};destroy=()=>{clearTimeout(this.timer);const m=new Error(`[${this.eventName}]: Event is destroy.`);m.name="destroy",this._reject(m)}}class PrWebSocket{binaryType="blob";debug=!1;url="";ws;isReconnecting=!1;timeout=10*1e3;reconnectTimeout=40*1e3;activeTimeStamp=0;on={};getUrl=()=>"";constructor(){}connect=()=>new Promise(async(m,u)=>{const T=new Date().getTime();this.url=this.getUrl(),this.debug&&console.log("------->pr-ws: connecting.",{url:this.url});const r=setTimeout(()=>u("Connection timeout."),this.timeout);try{await this._open();const e=new Date().getTime()-T;m(e)}catch(c){this.close(c.code,c.reason),u(c)}clearTimeout(r)});reconnect=()=>new Promise(async(m,u)=>{const T=new Date().getTime();this.isReconnecting=!0,this.url=this.getUrl(),this.debug&&console.log("------->pr-ws: reconnecting.",{url:this.url});let r=!1;const c=setTimeout(()=>{r=!0,this.isReconnecting=!1,u("Reconnection timeout.")},this.reconnectTimeout);for(;;)try{if(r)break;await this._open(),clearTimeout(c),r=!0,this.isReconnecting=!1;const t=new Date().getTime()-T;m(t)}catch{this.debug===!0&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->pr-ws: Reconnect again in 5 seconds.",{url:this.url}),await new Promise(t=>setTimeout(()=>t(!0),1e3*5))}});send=m=>{if(!this.ws||this.ws.readyState!==1)throw new Error("Ws is not ready.");this.ws.send(m)};close=(m=1e3,u="Correctly close.")=>{this.ws&&(this._clear(),this.ws?.close(m,u),this.ws=void 0,this.debug&&console.log("------->pr-ws: closed.",{code:m,reason:u,url:this.url}))};_open=()=>new Promise((m,u)=>{this._clear(),this.ws=new WebSocket(this.url),this.ws.binaryType=this.binaryType,this.ws.onmessage=T=>{this.activeTimeStamp=new Date().getTime(),this.on.message&&this.on.message(T.data)},this.ws.onopen=()=>{this.activeTimeStamp=new Date().getTime(),m(!0)},this.ws.onerror=T=>{u(T)},this.ws.onclose=T=>{this.isReconnecting===!1&&this.on.checkReconnect&&this.on.checkReconnect(T)}});_clear=()=>{this.ws&&(this.ws.onmessage=()=>{},this.ws.onopen=()=>{},this.ws.onerror=()=>{},this.ws.onclose=()=>{})}}const SDP_KEYS=["sdp","Sdp","remoteSdp"],MASK_KEYS=["id","userId"];function filterData(b){if(b==null||typeof b!="object")return b;if(Array.isArray(b))return b.map(u=>u!=null&&typeof u=="object"?filterData(u):u);const m={};for(const u of Object.keys(b)){let T=b[u];if(SDP_KEYS.includes(u))T="";else if(MASK_KEYS.includes(u)){const r=T!=null?String(T):"";T=r.length>10?r.slice(0,3)+"****"+r.slice(-3):T}else T!=null&&typeof T=="object"&&(T=filterData(T));m[u]=T}return m}const reqIgnoreEvents=[];reqIgnoreEvents.push("heartbeat"),reqIgnoreEvents.push("heartbeatEx"),reqIgnoreEvents.push("networkQualityChange"),reqIgnoreEvents.push("updateCall"),reqIgnoreEvents.push("reportNetwork"),reqIgnoreEvents.push("ackMsg");const resIgnoreEvents=[];resIgnoreEvents.push("heartbeat"),resIgnoreEvents.push("heartbeatEx"),resIgnoreEvents.push("networkQualityChange"),resIgnoreEvents.push("updateCall"),resIgnoreEvents.push("reportNetwork"),resIgnoreEvents.push("offer"),resIgnoreEvents.push("candidate"),resIgnoreEvents.push("answer"),resIgnoreEvents.push("reportP2PConnectEx"),resIgnoreEvents.push("onRoomUserSpeech"),resIgnoreEvents.push("onNetQuality");class CallsWebSocket{config;timeout=30*1e3;prws=new PrWebSocket;events=new Map;on={};_logBuffer=new Map;_logFlushTimer=0;static _LOG_FLUSH_DELAY=1e3;constructor({config:m}){this.config=m,this.prws.binaryType="arraybuffer",this.prws.getUrl=()=>this.config.createWsUrl(),this.prws.on.message=u=>{const T=new Uint8Array(u),r=com.quick.voice.proto.CommonRsp.decode(T),c=onMessageFormat(r),{event:e,sn:t}=c;if(this._updataLogs("res",c),this.config.debug&&!resIgnoreEvents.includes(e)&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",c),notifyName_keys.includes(e)){const I=this.on[e],x=L(c,["code","data","desc"]);I&&I(x);return}const _=this.events.get(e)?.get(t);if(_){const I=L(c,["code","data","desc","sn"]);_.resolve(I)}},this.prws.on.checkReconnect=async u=>{switch(u.code){case 1e3:case 4001:case 4002:case 4003:this.on.state&&this.on.state("closed");break;case 4010:this.reconnect();break;default:{if(this.config.isInRoom===!1)return;this.reconnect()}break}}}needRestoreRoom=()=>{if(this.prws.isReconnecting===!0)return!1;const u=new Date().getTime()-this.prws.activeTimeStamp,T=u>30*1e3;return T===!0&&this.config.debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;","------->quickvo: NeedRestoreRoom.",{offsetTime:u}),T};connect=async()=>{this.on.state&&this.on.state("connecting"),await this.prws.connect().then(async m=>{this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: 连接耗时-${m}ms`),await this.retryEvents(),this.on.state&&this.on.state("connected")}).catch(m=>{this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 连接失败",m),this.on.state&&this.on.state("closed")})};reconnect=async()=>{this.on.state&&this.on.state("reconnecting"),await this.prws.reconnect().then(async m=>{this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: 重连耗时-${m}ms`),await this.retryEvents(),this.on.state&&this.on.state("connected")}).catch(m=>{this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连失败",m),this.on.state&&this.on.state("closed")})};close=()=>{this.prws.ws?.readyState!==3&&(this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is closed."),this.prws.close(),this.clearEvents(),this._logFlushTimer&&(clearTimeout(this._logFlushTimer),this._logFlushTimer=0),this._flushLogs())};createRequest=(m,u={})=>{const T=new CallsWebSocketEvent(m,this.prws,{timeout:this.timeout,...u});return T.sendBefore=r=>{this._updataLogs("req",r),this.config.debug&&!reqIgnoreEvents.includes(r.event)&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",r)},T.sendAfter=()=>{T.needRetry===!1&&T.message?.sn&&(this.events.get(m)?.delete(T.message.sn),this.events.get(m)?.size===0&&this.events.delete(m))},T.options.onBack===!0&&(this.events.has(m)||this.events.set(m,new Map),T.sn?this.events.get(m)?.set(T.sn,T):console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: This message is invalid. There is no valid SN.",m,T.message)),T};hasEvent=m=>this.events.has(m);clearEvents=()=>{const m=this.events.values();for(const u of m){const T=u.values();for(const r of T)r.destroy()}this.events=new Map};retryEvents=async()=>{const m=this.events.values();for(const u of m){const T=u.values();for(const r of T)r.needRetry===!0&&r.retry()}};_updataLogs=(m,u={})=>{try{const{time:T,event:r,data:c={},data_original:e={},data_remote:t,...i}=u,_=p$1(T,"YYYY-MM-DD hh:mm:ss",{offset:480});let I={},x="res ↓";switch(m){case"res":x="res ↓",I=filterData(c);break;case"req":x="req ↑",I=filterData(e);break}let M="#quickvo.logs";(reqIgnoreEvents.includes(r)||resIgnoreEvents.includes(r))&&(M="#quickvo.ignoreEvents");const j={"#action":x,timeStr:_,event:r,data:I,time:T,...i};this.on.log&&this.on.log(j),this._logBuffer.has(M)||this._logBuffer.set(M,[]),this._logBuffer.get(M).push(j),this._logFlushTimer===0&&(this._logFlushTimer=window.setTimeout(()=>this._flushLogs(),CallsWebSocket._LOG_FLUSH_DELAY))}catch(T){this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",T)}};_flushLogs=()=>{this._logFlushTimer&&(clearTimeout(this._logFlushTimer),this._logFlushTimer=0);const m=this._logBuffer.keys();for(const u of m){const T=this._logBuffer.get(u);if(T.length===0)continue;this._logBuffer.set(u,[]);const r=localStorage.getItem(u)||JSON.stringify([]),c=JSON.parse(r),e=T.slice().reverse();let t=!1,i=!1;const _=[],I=x=>{const{event:M}=x;if(M==="heartbeat"||M==="heartbeatEx"){if(x["#action"]?.includes("req")){if(t)return;t=!0}if(x["#action"]?.includes("res")){if(i)return;i=!0}}_.push(x)};for(const x of e)if(I(x),_.length>=200)break;if(_.length<200){for(const x of c)if(I(x),_.length>=200)break}localStorage.setItem(u,JSON.stringify(_))}}}var lib={},ebml={},EBML={},hasRequiredEBML;function requireEBML(){return hasRequiredEBML||(hasRequiredEBML=1,Object.defineProperty(EBML,"__esModule",{value:!0})),EBML}var EBMLDecoder={},int64Buffer={},hasRequiredInt64Buffer;function requireInt64Buffer(){return hasRequiredInt64Buffer||(hasRequiredInt64Buffer=1,(function(b){(function(m){var u="undefined",T=u!==typeof Buffer&&Buffer,r=u!==typeof Uint8Array&&Uint8Array,c=u!==typeof ArrayBuffer&&ArrayBuffer,e=[0,0,0,0,0,0,0,0],t=Array.isArray||le,i=4294967296,_=16777216,I;x("Uint64BE",!0,!0),x("Int64BE",!0,!1),x("Uint64LE",!1,!0),x("Int64LE",!1,!1);function x(re,se,de){var ee=se?0:4,ae=se?4:0,pe=se?0:3,he=se?1:2,ye=se?2:1,ge=se?3:0,Re=se?oe:G,Pe=se?ue:ie,Ae=Se.prototype,Ne="is"+re,He="_"+Ne;return Ae.buffer=void 0,Ae.offset=0,Ae[He]=!0,Ae.toNumber=Ue,Ae.toString=Fe,Ae.toJSON=Ue,Ae.toArray=M,T&&(Ae.toBuffer=j),r&&(Ae.toArrayBuffer=z),Se[Ne]=we,m[re]=Se,Se;function Se(be,me,ke,ve){return this instanceof Se?je(this,be,me,ke,ve):new Se(be,me,ke,ve)}function we(be){return!!(be&&be[He])}function je(be,me,ke,ve,Oe){if(r&&c&&(me instanceof c&&(me=new r(me)),ve instanceof c&&(ve=new r(ve))),!me&&!ke&&!ve&&!I){be.buffer=K(e,0);return}if(!Q(me,ke)){var Ce=I||Array;Oe=ke,ve=me,ke=0,me=I===T?T.alloc(8):new Ce(8)}be.buffer=me,be.offset=ke|=0,u!==typeof ve&&(typeof ve=="string"?Ee(me,ke,ve,Oe||10):Q(ve,Oe)?ne(me,ke,ve,Oe):typeof Oe=="number"?(Me(me,ke+ee,ve),Me(me,ke+ae,Oe)):ve>0?Re(me,ke,ve):ve<0?Pe(me,ke,ve):ne(me,ke,e,0))}function Ee(be,me,ke,ve){var Oe=0,Ce=ke.length,Be=0,De=0;ke[0]==="-"&&Oe++;for(var ze=Oe;Oe<Ce;){var Je=parseInt(ke[Oe++],ve);if(!(Je>=0))break;De=De*ve+Je,Be=Be*ve+Math.floor(De/i),De%=i}ze&&(Be=~Be,De?De=i-De:Be++),Me(be,me+ee,Be),Me(be,me+ae,De)}function Ue(){var be=this.buffer,me=this.offset,ke=qe(be,me+ee),ve=qe(be,me+ae);return de||(ke|=0),ke?ke*i+ve:ve}function Fe(be){var me=this.buffer,ke=this.offset,ve=qe(me,ke+ee),Oe=qe(me,ke+ae),Ce="",Be=!de&&ve&2147483648;for(Be&&(ve=~ve,Oe=i-Oe),be=be||10;;){var De=ve%be*i+Oe;if(ve=Math.floor(ve/be),Oe=Math.floor(De/be),Ce=(De%be).toString(be)+Ce,!ve&&!Oe)break}return Be&&(Ce="-"+Ce),Ce}function Me(be,me,ke){be[me+ge]=ke&255,ke=ke>>8,be[me+ye]=ke&255,ke=ke>>8,be[me+he]=ke&255,ke=ke>>8,be[me+pe]=ke&255}function qe(be,me){return be[me+pe]*_+(be[me+he]<<16)+(be[me+ye]<<8)+be[me+ge]}}function M(re){var se=this.buffer,de=this.offset;return I=null,re!==!1&&t(se)?se.length===8?se:se.slice(de,de+8):K(se,de)}function j(re){var se=this.buffer,de=this.offset;return I=T,re!==!1&&T.isBuffer(se)?se.length===8?se:se.slice(de,de+8):T.from(z.call(this,re))}function z(re){var se=this.buffer,de=this.offset,ee=se.buffer;if(I=r,re!==!1&&!se.offset&&ee instanceof c)return ee.byteLength===8?ee:ee.slice(de,de+8);var ae=new r(8);return ne(ae,0,se,de),ae.buffer}function Q(re,se){var de=re&&re.length;return se|=0,de&&se+8<=de&&typeof re[se]!="string"}function ne(re,se,de,ee){se|=0,ee|=0;for(var ae=0;ae<8;ae++)re[se++]=de[ee++]&255}function K(re,se){return Array.prototype.slice.call(re,se,se+8)}function oe(re,se,de){for(var ee=se+8;ee>se;)re[--ee]=de&255,de/=256}function ue(re,se,de){var ee=se+8;for(de++;ee>se;)re[--ee]=-de&255^255,de/=256}function G(re,se,de){for(var ee=se+8;se<ee;)re[se++]=de&255,de/=256}function ie(re,se,de){var ee=se+8;for(de++;se<ee;)re[se++]=-de&255^255,de/=256}function le(re){return!!re&&Object.prototype.toString.call(re)=="[object Array]"}})(typeof b.nodeName!="string"?b:int64Buffer||{})})(int64Buffer)),int64Buffer}var tools={},EBMLEncoder={},ebmlID={},hasRequiredEbmlID;function requireEbmlID(){return hasRequiredEbmlID||(hasRequiredEbmlID=1,Object.defineProperty(ebmlID,"__esModule",{value:!0}),ebmlID.byEbmlID=void 0,ebmlID.byEbmlID={128:{name:"ChapterDisplay",level:4,type:"m",multiple:!0,minver:1,webm:!0,description:"Contains all possible strings to use for the chapter display."},131:{name:"TrackType",level:3,type:"u",mandatory:!0,minver:1,range:"1-254",description:"A set of track types coded on 8 bits (1: video, 2: audio, 3: complex, 0x10: logo, 0x11: subtitle, 0x12: buttons, 0x20: control)."},133:{name:"ChapString",cppname:"ChapterString",level:5,type:"8",mandatory:!0,minver:1,webm:!0,description:"Contains the string to use as the chapter atom."},134:{name:"CodecID",level:3,type:"s",mandatory:!0,minver:1,description:"An ID corresponding to the codec, see the codec page for more info."},136:{name:"FlagDefault",cppname:"TrackFlagDefault",level:3,type:"u",mandatory:!0,minver:1,default:1,range:"0-1",description:"Set if that track (audio, video or subs) SHOULD be active if no language found matches the user preference. (1 bit)"},137:{name:"ChapterTrackNumber",level:5,type:"u",mandatory:!0,multiple:!0,minver:1,webm:!1,range:"not 0",description:"UID of the Track to apply this chapter too. In the absense of a control track, choosing this chapter will select the listed Tracks and deselect unlisted tracks. Absense of this element indicates that the Chapter should be applied to any currently used Tracks."},145:{name:"ChapterTimeStart",level:4,type:"u",mandatory:!0,minver:1,webm:!0,description:"Timestamp of the start of Chapter (not scaled)."},146:{name:"ChapterTimeEnd",level:4,type:"u",minver:1,webm:!1,description:"Timestamp of the end of Chapter (timestamp excluded, not scaled)."},150:{name:"CueRefTime",level:5,type:"u",mandatory:!0,minver:2,webm:!1,description:"Timestamp of the referenced Block."},151:{name:"CueRefCluster",level:5,type:"u",mandatory:!0,webm:!1,description:"The Position of the Cluster containing the referenced Block."},152:{name:"ChapterFlagHidden",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If a chapter is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)"},16980:{name:"ContentCompAlgo",level:6,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The compression algorithm used. Algorithms that have been specified so far are: 0 - zlib, 3 - Header Stripping"},16981:{name:"ContentCompSettings",level:6,type:"b",minver:1,webm:!1,description:"Settings that might be needed by the decompressor. For Header Stripping (ContentCompAlgo=3), the bytes that were removed from the beggining of each frames of the track."},17026:{name:"DocType",level:1,type:"s",mandatory:!0,default:"matroska",minver:1,description:"A string that describes the type of document that follows this EBML header. 'matroska' in our case or 'webm' for webm files."},17029:{name:"DocTypeReadVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The minimum DocType version an interpreter has to support to read this file."},17030:{name:"EBMLVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The version of EBML parser used to create the file."},17031:{name:"DocTypeVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The version of DocType interpreter used to create the file."},17476:{name:"SegmentFamily",level:2,type:"b",multiple:!0,minver:1,webm:!1,bytesize:16,description:"A randomly generated unique ID that all segments related to each other must use (128 bits)."},17505:{name:"DateUTC",level:2,type:"d",minver:1,description:"Date of the origin of timestamp (value 0), i.e. production date."},17540:{name:"TagDefault",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"0-1",description:"Indication to know if this is the default/original language to use for the given tag. (1 bit)"},17541:{name:"TagBinary",level:4,type:"b",minver:1,webm:!1,description:"The values of the Tag if it is binary. Note that this cannot be used in the same SimpleTag as TagString."},17543:{name:"TagString",level:4,type:"8",minver:1,webm:!1,description:"The value of the Element."},17545:{name:"Duration",level:2,type:"f",minver:1,range:"> 0",description:"Duration of the segment (based on TimecodeScale)."},17816:{name:"ChapterFlagEnabled",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"0-1",description:"Specify wether the chapter is enabled. It can be enabled/disabled by a Control Track. When disabled, the movie should skip all the content between the TimeStart and TimeEnd of this chapter (see flag notes). (1 bit)"},18016:{name:"FileMimeType",level:3,type:"s",mandatory:!0,minver:1,webm:!1,description:"MIME type of the file."},18017:{name:"FileUsedStartTime",level:3,type:"u",divx:!0,description:"DivX font extension"},18018:{name:"FileUsedEndTime",level:3,type:"u",divx:!0,description:"DivX font extension"},18037:{name:"FileReferral",level:3,type:"b",webm:!1,description:"A binary value that a track/codec can refer to when the attachment is needed."},20529:{name:"ContentEncodingOrder",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"Tells when this modification was used during encoding/muxing starting with 0 and counting upwards. The decoder/demuxer has to start with the highest order number it finds and work its way down. This value has to be unique over all ContentEncodingOrder elements in the segment."},20530:{name:"ContentEncodingScope",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"not 0",description:"A bit field that describes which elements have been modified in this way. Values (big endian) can be OR'ed. Possible values: 1 - all frame contents, 2 - the track's private data, 4 - the next ContentEncoding (next ContentEncodingOrder. Either the data inside ContentCompression and/or ContentEncryption)"},20531:{name:"ContentEncodingType",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"A value describing what kind of transformation has been done. Possible values: 0 - compression, 1 - encryption"},20532:{name:"ContentCompression",level:5,type:"m",minver:1,webm:!1,description:"Settings describing the compression used. Must be present if the value of ContentEncodingType is 0 and absent otherwise. Each block must be decompressable even if no previous block is available in order not to prevent seeking."},20533:{name:"ContentEncryption",level:5,type:"m",minver:1,webm:!1,description:"Settings describing the encryption used. Must be present if the value of ContentEncodingType is 1 and absent otherwise."},21368:{name:"CueBlockNumber",level:4,type:"u",minver:1,default:1,range:"not 0",description:"Number of the Block in the specified Cluster."},22100:{name:"ChapterStringUID",level:4,type:"8",mandatory:!1,minver:3,webm:!0,description:"A unique string ID to identify the Chapter. Use for WebVTT cue identifier storage."},22337:{name:"WritingApp",level:2,type:"8",mandatory:!0,minver:1,description:'Writing application ("mkvmerge-0.3.3").'},22612:{name:"SilentTracks",cppname:"ClusterSilentTracks",level:2,type:"m",minver:1,webm:!1,description:"The list of tracks that are not used in that part of the stream. It is useful when using overlay tracks on seeking. Then you should decide what track to use."},25152:{name:"ContentEncoding",level:4,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Settings for one content encoding like compression or encryption."},25188:{name:"BitDepth",cppname:"AudioBitDepth",level:4,type:"u",minver:1,range:"not 0",description:"Bits per sample, mostly used for PCM."},25906:{name:"SignedElement",level:3,type:"b",multiple:!0,webm:!1,description:"An element ID whose data will be used to compute the signature."},26148:{name:"TrackTranslate",level:3,type:"m",multiple:!0,minver:1,webm:!1,description:"The track identification for the given Chapter Codec."},26897:{name:"ChapProcessCommand",cppname:"ChapterProcessCommand",level:5,type:"m",multiple:!0,minver:1,webm:!1,description:"Contains all the commands associated to the Atom."},26914:{name:"ChapProcessTime",cppname:"ChapterProcessTime",level:6,type:"u",mandatory:!0,minver:1,webm:!1,description:"Defines when the process command should be handled (0: during the whole chapter, 1: before starting playback, 2: after playback of the chapter)."},26916:{name:"ChapterTranslate",level:2,type:"m",multiple:!0,minver:1,webm:!1,description:"A tuple of corresponding ID used by chapter codecs to represent this segment."},26931:{name:"ChapProcessData",cppname:"ChapterProcessData",level:6,type:"b",mandatory:!0,minver:1,webm:!1,description:"Contains the command information. The data should be interpreted depending on the ChapProcessCodecID value. For ChapProcessCodecID = 1, the data correspond to the binary DVD cell pre/post commands."},26948:{name:"ChapProcess",cppname:"ChapterProcess",level:4,type:"m",multiple:!0,minver:1,webm:!1,description:"Contains all the commands associated to the Atom."},26965:{name:"ChapProcessCodecID",cppname:"ChapterProcessCodecID",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"Contains the type of the codec used for the processing. A value of 0 means native Matroska processing (to be defined), a value of 1 means the DVD command set is used. More codec IDs can be added later."},29555:{name:"Tag",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Element containing elements specific to Tracks/Chapters."},29572:{name:"SegmentFilename",level:2,type:"8",minver:1,webm:!1,description:"A filename corresponding to this segment."},29766:{name:"AttachmentLink",cppname:"TrackAttachmentLink",level:3,type:"u",minver:1,webm:!1,range:"not 0",description:"The UID of an attachment that is used by this codec."},2459272:{name:"CodecName",level:3,type:"8",minver:1,description:"A human-readable string specifying the codec."},408125543:{name:"Segment",level:"0",type:"m",mandatory:!0,multiple:!0,minver:1,description:"This element contains all other top-level (level 1) elements. Typically a Matroska file is composed of 1 segment."},17530:{name:"TagLanguage",level:4,type:"s",mandatory:!0,minver:1,webm:!1,default:"und",description:"Specifies the language of the tag specified, in the Matroska languages form."},17827:{name:"TagName",level:4,type:"8",mandatory:!0,minver:1,webm:!1,description:"The name of the Tag that is going to be stored."},26568:{name:"SimpleTag",cppname:"TagSimple",level:3,recursive:"1",type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Contains general information about the target."},25542:{name:"TagAttachmentUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Attachment(s) the tags belong to. If the value is 0 at this level, the tags apply to all the attachments in the Segment."},25540:{name:"TagChapterUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Chapter(s) the tags belong to. If the value is 0 at this level, the tags apply to all chapters in the Segment."},25545:{name:"TagEditionUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the EditionEntry(s) the tags belong to. If the value is 0 at this level, the tags apply to all editions in the Segment."},25541:{name:"TagTrackUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Track(s) the tags belong to. If the value is 0 at this level, the tags apply to all tracks in the Segment."},25546:{name:"TargetType",cppname:"TagTargetType",level:4,type:"s",minver:1,webm:!1,strong:"informational",description:'An string that can be used to display the logical level of the target like "ALBUM", "TRACK", "MOVIE", "CHAPTER", etc (see TargetType).'},26826:{name:"TargetTypeValue",cppname:"TagTargetTypeValue",level:4,type:"u",minver:1,webm:!1,default:50,description:"A number to indicate the logical level of the target (see TargetType)."},25536:{name:"Targets",cppname:"TagTargets",level:3,type:"m",mandatory:!0,minver:1,webm:!1,description:"Contain all UIDs where the specified meta data apply. It is empty to describe everything in the segment."},307544935:{name:"Tags",level:1,type:"m",multiple:!0,minver:1,webm:!1,description:"Element containing elements specific to Tracks/Chapters. A list of valid tags can be found here."},17677:{name:"ChapProcessPrivate",cppname:"ChapterProcessPrivate",level:5,type:"b",minver:1,webm:!1,description:'Some optional data attached to the ChapProcessCodecID information. For ChapProcessCodecID = 1, it is the "DVD level" equivalent.'},17278:{name:"ChapCountry",cppname:"ChapterCountry",level:5,type:"s",multiple:!0,minver:1,webm:!1,description:"The countries corresponding to the string, same 2 octets as in Internet domains."},17276:{name:"ChapLanguage",cppname:"ChapterLanguage",level:5,type:"s",mandatory:!0,multiple:!0,minver:1,webm:!0,default:"eng",description:"The languages corresponding to the string, in the bibliographic ISO-639-2 form."},143:{name:"ChapterTrack",level:4,type:"m",minver:1,webm:!1,description:"List of tracks on which the chapter applies. If this element is not present, all tracks apply"},25539:{name:"ChapterPhysicalEquiv",level:4,type:"u",minver:1,webm:!1,description:'Specify the physical equivalent of this ChapterAtom like "DVD" (60) or "SIDE" (50), see complete list of values.'},28348:{name:"ChapterSegmentEditionUID",level:4,type:"u",minver:1,webm:!1,range:"not 0",description:"The EditionUID to play from the segment linked in ChapterSegmentUID."},28263:{name:"ChapterSegmentUID",level:4,type:"b",minver:1,webm:!1,range:">0",bytesize:16,description:"A segment to play in place of this chapter. Edition ChapterSegmentEditionUID should be used for this segment, otherwise no edition is used."},29636:{name:"ChapterUID",level:4,type:"u",mandatory:!0,minver:1,webm:!0,range:"not 0",description:"A unique ID to identify the Chapter."},182:{name:"ChapterAtom",level:3,recursive:"1",type:"m",mandatory:!0,multiple:!0,minver:1,webm:!0,description:"Contains the atom information to use as the chapter atom (apply to all tracks)."},17885:{name:"EditionFlagOrdered",level:3,type:"u",minver:1,webm:!1,default:0,range:"0-1",description:"Specify if the chapters can be defined multiple times and the order to play them is enforced. (1 bit)"},17883:{name:"EditionFlagDefault",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If a flag is set (1) the edition should be used as the default one. (1 bit)"},17853:{name:"EditionFlagHidden",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If an edition is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)"},17852:{name:"EditionUID",level:3,type:"u",minver:1,webm:!1,range:"not 0",description:"A unique ID to identify the edition. It's useful for tagging an edition."},17849:{name:"EditionEntry",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!0,description:"Contains all information about a segment edition."},272869232:{name:"Chapters",level:1,type:"m",minver:1,webm:!0,description:"A system to define basic menus and partition data. For more detailed information, look at the Chapters Explanation."},18094:{name:"FileUID",level:3,type:"u",mandatory:!0,minver:1,webm:!1,range:"not 0",description:"Unique ID representing the file, as random as possible."},18012:{name:"FileData",level:3,type:"b",mandatory:!0,minver:1,webm:!1,description:"The data of the file."},18030:{name:"FileName",level:3,type:"8",mandatory:!0,minver:1,webm:!1,description:"Filename of the attached file."},18046:{name:"FileDescription",level:3,type:"8",minver:1,webm:!1,description:"A human-friendly name for the attached file."},24999:{name:"AttachedFile",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"An attached file."},423732329:{name:"Attachments",level:1,type:"m",minver:1,webm:!1,description:"Contain attached files."},235:{name:"CueRefCodecState",level:5,type:"u",webm:!1,default:0,description:"The position of the Codec State corresponding to this referenced element. 0 means that the data is taken from the initial Track Entry."},21343:{name:"CueRefNumber",level:5,type:"u",webm:!1,default:1,range:"not 0",description:"Number of the referenced Block of Track X in the specified Cluster."},219:{name:"CueReference",level:4,type:"m",multiple:!0,minver:2,webm:!1,description:"The Clusters containing the required referenced Blocks."},234:{name:"CueCodecState",level:4,type:"u",minver:2,webm:!1,default:0,description:"The position of the Codec State corresponding to this Cue element. 0 means that the data is taken from the initial Track Entry."},178:{name:"CueDuration",level:4,type:"u",mandatory:!1,minver:4,webm:!1,description:"The duration of the block according to the segment time base. If missing the track's DefaultDuration does not apply and no duration information is available in terms of the cues."},240:{name:"CueRelativePosition",level:4,type:"u",mandatory:!1,minver:4,webm:!1,description:"The relative position of the referenced block inside the cluster with 0 being the first possible position for an element inside that cluster.",position:"clusterRelative"},241:{name:"CueClusterPosition",level:4,type:"u",mandatory:!0,minver:1,description:"The position of the Cluster containing the required Block.",position:"segment"},247:{name:"CueTrack",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"The track for which a position is given."},183:{name:"CueTrackPositions",level:3,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contain positions for different tracks corresponding to the timestamp."},179:{name:"CueTime",level:3,type:"u",mandatory:!0,minver:1,description:"Absolute timestamp according to the segment time base."},187:{name:"CuePoint",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains all information relative to a seek point in the segment."},475249515:{name:"Cues",level:1,type:"m",minver:1,description:'A top-level element to speed seeking access. All entries are local to the segment. Should be mandatory for non "live" streams.'},18406:{name:"ContentSigHashAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The hash algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - SHA1-160 2 - MD5"},18405:{name:"ContentSigAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - RSA"},18404:{name:"ContentSigKeyID",level:6,type:"b",minver:1,webm:!1,description:"This is the ID of the private key the data was signed with."},18403:{name:"ContentSignature",level:6,type:"b",minver:1,webm:!1,description:"A cryptographic signature of the contents."},18402:{name:"ContentEncKeyID",level:6,type:"b",minver:1,webm:!1,description:"For public key algorithms this is the ID of the public key the the data was encrypted with."},18401:{name:"ContentEncAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The encryption algorithm used. The value '0' means that the contents have not been encrypted but only signed. Predefined values: 1 - DES, 2 - 3DES, 3 - Twofish, 4 - Blowfish, 5 - AES"},28032:{name:"ContentEncodings",level:3,type:"m",minver:1,webm:!1,description:"Settings for several content encoding mechanisms like compression or encryption."},196:{name:"TrickMasterTrackSegmentUID",level:3,type:"b",divx:!0,bytesize:16,description:"DivX trick track extenstions"},199:{name:"TrickMasterTrackUID",level:3,type:"u",divx:!0,description:"DivX trick track extenstions"},198:{name:"TrickTrackFlag",level:3,type:"u",divx:!0,default:0,description:"DivX trick track extenstions"},193:{name:"TrickTrackSegmentUID",level:3,type:"b",divx:!0,bytesize:16,description:"DivX trick track extenstions"},192:{name:"TrickTrackUID",level:3,type:"u",divx:!0,description:"DivX trick track extenstions"},237:{name:"TrackJoinUID",level:5,type:"u",mandatory:!0,multiple:!0,minver:3,webm:!1,range:"not 0",description:"The trackUID number of a track whose blocks are used to create this virtual track."},233:{name:"TrackJoinBlocks",level:4,type:"m",minver:3,webm:!1,description:"Contains the list of all tracks whose Blocks need to be combined to create this virtual track"},230:{name:"TrackPlaneType",level:6,type:"u",mandatory:!0,minver:3,webm:!1,description:"The kind of plane this track corresponds to (0: left eye, 1: right eye, 2: background)."},229:{name:"TrackPlaneUID",level:6,type:"u",mandatory:!0,minver:3,webm:!1,range:"not 0",description:"The trackUID number of the track representing the plane."},228:{name:"TrackPlane",level:5,type:"m",mandatory:!0,multiple:!0,minver:3,webm:!1,description:"Contains a video plane track that need to be combined to create this 3D track"},227:{name:"TrackCombinePlanes",level:4,type:"m",minver:3,webm:!1,description:"Contains the list of all video plane tracks that need to be combined to create this 3D track"},226:{name:"TrackOperation",level:3,type:"m",minver:3,webm:!1,description:"Operation that needs to be applied on tracks to create this virtual track. For more details look at the Specification Notes on the subject."},32123:{name:"ChannelPositions",cppname:"AudioPosition",level:4,type:"b",webm:!1,description:"Table of horizontal angles for each successive channel, see appendix."},159:{name:"Channels",cppname:"AudioChannels",level:4,type:"u",mandatory:!0,minver:1,default:1,range:"not 0",description:"Numbers of channels in the track."},30901:{name:"OutputSamplingFrequency",cppname:"AudioOutputSamplingFreq",level:4,type:"f",minver:1,default:"Sampling Frequency",range:"> 0",description:"Real output sampling frequency in Hz (used for SBR techniques)."},181:{name:"SamplingFrequency",cppname:"AudioSamplingFreq",level:4,type:"f",mandatory:!0,minver:1,default:8e3,range:"> 0",description:"Sampling frequency in Hz."},225:{name:"Audio",cppname:"TrackAudio",level:3,type:"m",minver:1,description:"Audio settings."},2327523:{name:"FrameRate",cppname:"VideoFrameRate",level:4,type:"f",range:"> 0",strong:"Informational",description:"Number of frames per second. only."},3126563:{name:"GammaValue",cppname:"VideoGamma",level:4,type:"f",webm:!1,range:"> 0",description:"Gamma Value."},3061028:{name:"ColourSpace",cppname:"VideoColourSpace",level:4,type:"b",minver:1,webm:!1,bytesize:4,description:"Same value as in AVI (32 bits)."},21683:{name:"AspectRatioType",cppname:"VideoAspectRatio",level:4,type:"u",minver:1,default:0,description:"Specify the possible modifications to the aspect ratio (0: free resizing, 1: keep aspect ratio, 2: fixed)."},21682:{name:"DisplayUnit",cppname:"VideoDisplayUnit",level:4,type:"u",minver:1,default:0,description:"How DisplayWidth & DisplayHeight should be interpreted (0: pixels, 1: centimeters, 2: inches, 3: Display Aspect Ratio)."},21690:{name:"DisplayHeight",cppname:"VideoDisplayHeight",level:4,type:"u",minver:1,default:"PixelHeight",range:"not 0",description:"Height of the video frames to display. The default value is only valid when DisplayUnit is 0."},21680:{name:"DisplayWidth",cppname:"VideoDisplayWidth",level:4,type:"u",minver:1,default:"PixelWidth",range:"not 0",description:"Width of the video frames to display. The default value is only valid when DisplayUnit is 0."},21725:{name:"PixelCropRight",cppname:"VideoPixelCropRight",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove on the right of the image."},21708:{name:"PixelCropLeft",cppname:"VideoPixelCropLeft",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove on the left of the image."},21691:{name:"PixelCropTop",cppname:"VideoPixelCropTop",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove at the top of the image."},21674:{name:"PixelCropBottom",cppname:"VideoPixelCropBottom",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove at the bottom of the image (for HDTV content)."},186:{name:"PixelHeight",cppname:"VideoPixelHeight",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"Height of the encoded video frames in pixels."},176:{name:"PixelWidth",cppname:"VideoPixelWidth",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"Width of the encoded video frames in pixels."},21433:{name:"OldStereoMode",level:4,type:"u",maxver:"0",webm:!1,divx:!1,description:"DEPRECATED, DO NOT USE. Bogus StereoMode value used in old versions of libmatroska. (0: mono, 1: right eye, 2: left eye, 3: both eyes)."},21440:{name:"AlphaMode",cppname:"VideoAlphaMode",level:4,type:"u",minver:3,webm:!0,default:0,description:"Alpha Video Mode. Presence of this element indicates that the BlockAdditional element could contain Alpha data."},21432:{name:"StereoMode",cppname:"VideoStereoMode",level:4,type:"u",minver:3,webm:!0,default:0,description:"Stereo-3D video mode (0: mono, 1: side by side (left eye is first), 2: top-bottom (right eye is first), 3: top-bottom (left eye is first), 4: checkboard (right is first), 5: checkboard (left is first), 6: row interleaved (right is first), 7: row interleaved (left is first), 8: column interleaved (right is first), 9: column interleaved (left is first), 10: anaglyph (cyan/red), 11: side by side (right eye is first), 12: anaglyph (green/magenta), 13 both eyes laced in one Block (left eye is first), 14 both eyes laced in one Block (right eye is first)) . There are some more details on 3D support in the Specification Notes."},154:{name:"FlagInterlaced",cppname:"VideoFlagInterlaced",level:4,type:"u",mandatory:!0,minver:2,webm:!0,default:0,range:"0-1",description:"Set if the video is interlaced. (1 bit)"},224:{name:"Video",cppname:"TrackVideo",level:3,type:"m",minver:1,description:"Video settings."},26277:{name:"TrackTranslateTrackID",level:4,type:"b",mandatory:!0,minver:1,webm:!1,description:"The binary value used to represent this track in the chapter codec data. The format depends on the ChapProcessCodecID used."},26303:{name:"TrackTranslateCodec",level:4,type:"u",mandatory:!0,minver:1,webm:!1,description:"The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)."},26364:{name:"TrackTranslateEditionUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify an edition UID on which this translation applies. When not specified, it means for all editions found in the segment."},22203:{name:"SeekPreRoll",level:3,type:"u",mandatory:!0,multiple:!1,default:0,minver:4,webm:!0,description:"After a discontinuity, SeekPreRoll is the duration in nanoseconds of the data the decoder must decode before the decoded data is valid."},22186:{name:"CodecDelay",level:3,type:"u",multiple:!1,default:0,minver:4,webm:!0,description:"CodecDelay is The codec-built-in delay in nanoseconds. This value must be subtracted from each block timestamp in order to get the actual timestamp. The value should be small so the muxing of tracks with the same actual timestamp are in the same Cluster."},28587:{name:"TrackOverlay",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify that this track is an overlay track for the Track specified (in the u-integer). That means when this track has a gap (see SilentTracks) the overlay track should be used instead. The order of multiple TrackOverlay matters, the first one is the one that should be used. If not found it should be the second, etc."},170:{name:"CodecDecodeAll",level:3,type:"u",mandatory:!0,minver:2,webm:!1,default:1,range:"0-1",description:"The codec can decode potentially damaged data (1 bit)."},2536e3:{name:"CodecDownloadURL",level:3,type:"s",multiple:!0,webm:!1,description:"A URL to download about the codec used."},3883072:{name:"CodecInfoURL",level:3,type:"s",multiple:!0,webm:!1,description:"A URL to find information about the codec used."},3839639:{name:"CodecSettings",level:3,type:"8",webm:!1,description:"A string describing the encoding setting used."},25506:{name:"CodecPrivate",level:3,type:"b",minver:1,description:"Private data only known to the codec."},2274716:{name:"Language",cppname:"TrackLanguage",level:3,type:"s",minver:1,default:"eng",description:"Specifies the language of the track in the Matroska languages form."},21358:{name:"Name",cppname:"TrackName",level:3,type:"8",minver:1,description:"A human-readable track name."},21998:{name:"MaxBlockAdditionID",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The maximum value of BlockAdditions for this track."},21375:{name:"TrackOffset",level:3,type:"i",webm:!1,default:0,description:"A value to add to the Block's Timestamp. This can be used to adjust the playback offset of a track."},2306383:{name:"TrackTimecodeScale",level:3,type:"f",mandatory:!0,minver:1,maxver:"3",webm:!1,default:1,range:"> 0",description:"DEPRECATED, DO NOT USE. The scale to apply on this track to work at normal speed in relation with other tracks (mostly used to adjust video speed when the audio length differs)."},2313850:{name:"DefaultDecodedFieldDuration",cppname:"TrackDefaultDecodedFieldDuration",level:3,type:"u",minver:4,range:"not 0",description:`The period in nanoseconds (not scaled by TimcodeScale)
4
- between two successive fields at the output of the decoding process (see the notes)`},2352003:{name:"DefaultDuration",cppname:"TrackDefaultDuration",level:3,type:"u",minver:1,range:"not 0",description:"Number of nanoseconds (not scaled via TimecodeScale) per frame ('frame' in the Matroska sense -- one element put into a (Simple)Block)."},28152:{name:"MaxCache",cppname:"TrackMaxCache",level:3,type:"u",minver:1,webm:!1,description:"The maximum cache size required to store referenced frames in and the current frame. 0 means no cache is needed."},28135:{name:"MinCache",cppname:"TrackMinCache",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The minimum number of frames a player should be able to cache during playback. If set to 0, the reference pseudo-cache system is not used."},156:{name:"FlagLacing",cppname:"TrackFlagLacing",level:3,type:"u",mandatory:!0,minver:1,default:1,range:"0-1",description:"Set if the track may contain blocks using lacing. (1 bit)"},21930:{name:"FlagForced",cppname:"TrackFlagForced",level:3,type:"u",mandatory:!0,minver:1,default:0,range:"0-1",description:"Set if that track MUST be active during playback. There can be many forced track for a kind (audio, video or subs), the player should select the one which language matches the user preference or the default + forced track. Overlay MAY happen between a forced and non-forced track of the same kind. (1 bit)"},185:{name:"FlagEnabled",cppname:"TrackFlagEnabled",level:3,type:"u",mandatory:!0,minver:2,webm:!0,default:1,range:"0-1",description:"Set if the track is usable. (1 bit)"},29637:{name:"TrackUID",level:3,type:"u",mandatory:!0,minver:1,range:"not 0",description:"A unique ID to identify the Track. This should be kept the same when making a direct stream copy of the Track to another file."},215:{name:"TrackNumber",level:3,type:"u",mandatory:!0,minver:1,range:"not 0",description:"The track number as used in the Block Header (using more than 127 tracks is not encouraged, though the design allows an unlimited number)."},174:{name:"TrackEntry",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Describes a track with all elements."},374648427:{name:"Tracks",level:1,type:"m",multiple:!0,minver:1,description:"A top-level block of information with many tracks described."},175:{name:"EncryptedBlock",level:2,type:"b",multiple:!0,webm:!1,description:"Similar to EncryptedBlock Structure)"},202:{name:"ReferenceTimeCode",level:4,type:"u",multiple:!1,mandatory:!0,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},201:{name:"ReferenceOffset",level:4,type:"u",multiple:!1,mandatory:!0,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},200:{name:"ReferenceFrame",level:3,type:"m",multiple:!1,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},207:{name:"SliceDuration",level:5,type:"u",default:0,description:"The (scaled) duration to apply to the element."},206:{name:"Delay",cppname:"SliceDelay",level:5,type:"u",default:0,description:"The (scaled) delay to apply to the element."},203:{name:"BlockAdditionID",cppname:"SliceBlockAddID",level:5,type:"u",default:0,description:"The ID of the BlockAdditional element (0 is the main Block)."},205:{name:"FrameNumber",cppname:"SliceFrameNumber",level:5,type:"u",default:0,description:"The number of the frame to generate from this lace with this delay (allow you to generate many frames from the same Block/Frame)."},204:{name:"LaceNumber",cppname:"SliceLaceNumber",level:5,type:"u",minver:1,default:0,divx:!1,description:"The reverse number of the frame in the lace (0 is the last frame, 1 is the next to last, etc). While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback."},232:{name:"TimeSlice",level:4,type:"m",multiple:!0,minver:1,divx:!1,description:"Contains extra time information about the data contained in the Block. While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback."},142:{name:"Slices",level:3,type:"m",minver:1,divx:!1,description:"Contains slices description."},30114:{name:"DiscardPadding",level:3,type:"i",minver:4,webm:!0,description:"Duration in nanoseconds of the silent data added to the Block (padding at the end of the Block for positive value, at the beginning of the Block for negative value). The duration of DiscardPadding is not calculated in the duration of the TrackEntry and should be discarded during playback."},164:{name:"CodecState",level:3,type:"b",minver:2,webm:!1,description:"The new codec state to use. Data interpretation is private to the codec. This information should always be referenced by a seek entry."},253:{name:"ReferenceVirtual",level:3,type:"i",webm:!1,description:"Relative position of the data that should be in position of the virtual block."},251:{name:"ReferenceBlock",level:3,type:"i",multiple:!0,minver:1,description:"Timestamp of another frame used as a reference (ie: B or P frame). The timestamp is relative to the block it's attached to."},250:{name:"ReferencePriority",cppname:"FlagReferenced",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"This frame is referenced and has the specified cache priority. In cache only a frame of the same or higher priority can replace this frame. A value of 0 means the frame is not referenced."},155:{name:"BlockDuration",level:3,type:"u",minver:1,default:"TrackDuration",description:'The duration of the Block (based on TimecodeScale). This element is mandatory when DefaultDuration is set for the track (but can be omitted as other default values). When not written and with no DefaultDuration, the value is assumed to be the difference between the timestamp of this Block and the timestamp of the next Block in "display" order (not coding order). This element can be useful at the end of a Track (as there is not other Block available), or when there is a break in a track like for subtitle tracks. When set to 0 that means the frame is not a keyframe.'},165:{name:"BlockAdditional",level:5,type:"b",mandatory:!0,minver:1,webm:!1,description:"Interpreted by the codec as it wishes (using the BlockAddID)."},238:{name:"BlockAddID",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"not 0",description:"An ID to identify the BlockAdditional level."},166:{name:"BlockMore",level:4,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Contain the BlockAdditional and some parameters."},30113:{name:"BlockAdditions",level:3,type:"m",minver:1,webm:!1,description:"Contain additional blocks to complete the main one. An EBML parser that has no knowledge of the Block structure could still see and use/skip these data."},162:{name:"BlockVirtual",level:3,type:"b",webm:!1,description:"A Block with no data. It must be stored in the stream at the place the real Block should be in display order. (see Block Virtual)"},161:{name:"Block",level:3,type:"b",mandatory:!0,minver:1,description:"Block containing the actual data to be rendered and a timestamp relative to the Cluster Timecode. (see Block Structure)"},160:{name:"BlockGroup",level:2,type:"m",multiple:!0,minver:1,description:"Basic container of information containing a single Block or BlockVirtual, and information specific to that Block/VirtualBlock."},163:{name:"SimpleBlock",level:2,type:"b",multiple:!0,minver:2,webm:!0,divx:!0,description:"Similar to SimpleBlock Structure"},171:{name:"PrevSize",cppname:"ClusterPrevSize",level:2,type:"u",minver:1,description:"Size of the previous Cluster, in octets. Can be useful for backward playing.",position:"prevCluster"},167:{name:"Position",cppname:"ClusterPosition",level:2,type:"u",minver:1,webm:!1,description:"The Position of the Cluster in the segment (0 in live broadcast streams). It might help to resynchronise offset on damaged streams.",position:"segment"},22743:{name:"SilentTrackNumber",cppname:"ClusterSilentTrackNumber",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"One of the track number that are not used from now on in the stream. It could change later if not specified as silent in a further Cluster."},231:{name:"Timecode",cppname:"ClusterTimecode",level:2,type:"u",mandatory:!0,minver:1,description:"Absolute timestamp of the cluster (based on TimecodeScale)."},524531317:{name:"Cluster",level:1,type:"m",multiple:!0,minver:1,description:"The lower level element containing the (monolithic) Block structure."},19840:{name:"MuxingApp",level:2,type:"8",mandatory:!0,minver:1,description:'Muxing application or library ("libmatroska-0.4.3").'},31657:{name:"Title",level:2,type:"8",minver:1,webm:!1,description:"General name of the segment."},2807730:{name:"TimecodeScaleDenominator",level:2,type:"u",mandatory:!0,minver:4,default:"1000000000",description:"Timestamp scale numerator, see TimecodeScale."},2807729:{name:"TimecodeScale",level:2,type:"u",mandatory:!0,minver:1,default:"1000000",description:"Timestamp scale in nanoseconds (1.000.000 means all timestamps in the segment are expressed in milliseconds)."},27045:{name:"ChapterTranslateID",level:3,type:"b",mandatory:!0,minver:1,webm:!1,description:"The binary value used to represent this segment in the chapter codec data. The format depends on the ChapProcessCodecID used."},27071:{name:"ChapterTranslateCodec",level:3,type:"u",mandatory:!0,minver:1,webm:!1,description:"The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)."},27132:{name:"ChapterTranslateEditionUID",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify an edition UID on which this correspondance applies. When not specified, it means for all editions found in the segment."},4096955:{name:"NextFilename",level:2,type:"8",minver:1,webm:!1,description:"An escaped filename corresponding to the next segment."},4110627:{name:"NextUID",level:2,type:"b",minver:1,webm:!1,bytesize:16,description:"A unique ID to identify the next chained segment (128 bits)."},3965867:{name:"PrevFilename",level:2,type:"8",minver:1,webm:!1,description:"An escaped filename corresponding to the previous segment."},3979555:{name:"PrevUID",level:2,type:"b",minver:1,webm:!1,bytesize:16,description:"A unique ID to identify the previous chained segment (128 bits)."},29604:{name:"SegmentUID",level:2,type:"b",minver:1,webm:!1,range:"not 0",bytesize:16,description:"A randomly generated unique ID to identify the current segment between many others (128 bits)."},357149030:{name:"Info",level:1,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains miscellaneous general information and statistics on the file."},21420:{name:"SeekPosition",level:3,type:"u",mandatory:!0,minver:1,description:"The position of the element in the segment in octets (0 = first level 1 element).",position:"segment"},21419:{name:"SeekID",level:3,type:"b",mandatory:!0,minver:1,description:"The binary ID corresponding to the element name.",type2:"ebmlID"},19899:{name:"Seek",cppname:"SeekPoint",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains a single seek entry to an EBML element."},290298740:{name:"SeekHead",cppname:"SeekHeader",level:1,type:"m",multiple:!0,minver:1,description:"Contains the position of other level 1 elements."},32379:{name:"SignatureElementList",level:2,type:"m",multiple:!0,webm:!1,i:"Cluster|Block|BlockAdditional",description:"A list consists of a number of consecutive elements that represent one case where data is used in signature. Ex: means that the BlockAdditional of all Blocks in all Clusters is used for encryption."},32347:{name:"SignatureElements",level:1,type:"m",webm:!1,description:"Contains elements that will be used to compute the signature."},32437:{name:"Signature",level:1,type:"b",webm:!1,description:"The signature of the data (until a new."},32421:{name:"SignaturePublicKey",level:1,type:"b",webm:!1,description:"The public key to use with the algorithm (in the case of a PKI-based signature)."},32410:{name:"SignatureHash",level:1,type:"u",webm:!1,description:"Hash algorithm used (1=SHA1-160, 2=MD5)."},32394:{name:"SignatureAlgo",level:1,type:"u",webm:!1,description:"Signature algorithm used (1=RSA, 2=elliptic)."},458458727:{name:"SignatureSlot",level:-1,type:"m",multiple:!0,webm:!1,description:"Contain signature of some (coming) elements in the stream."},191:{name:"CRC-32",level:-1,type:"b",minver:1,webm:!1,description:"The CRC is computed on all the data of the Master element it's in. The CRC element should be the first in it's parent master for easier reading. All level 1 elements should include a CRC-32. The CRC in use is the IEEE CRC32 Little Endian",crc:!0},236:{name:"Void",level:-1,type:"b",minver:1,description:"Used to void damaged data, to avoid unexpected behaviors when using damaged data. The content is discarded. Also used to reserve space in a sub-element for later use."},17139:{name:"EBMLMaxSizeLength",level:1,type:"u",mandatory:!0,default:8,minver:1,description:"The maximum length of the sizes you'll find in this file (8 or less in Matroska). This does not override the element size indicated at the beginning of an element. Elements that have an indicated size which is larger than what is allowed by EBMLMaxSizeLength shall be considered invalid."},17138:{name:"EBMLMaxIDLength",level:1,type:"u",mandatory:!0,default:4,minver:1,description:"The maximum length of the IDs you'll find in this file (4 or less in Matroska)."},17143:{name:"EBMLReadVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The minimum EBML version a parser has to support to read this file."},440786851:{name:"EBML",level:"0",type:"m",mandatory:!0,multiple:!0,minver:1,description:"Set the EBML characteristics of the data to follow. Each EBML document has to start with this."},21936:{name:"Colour",level:"4",type:"m",mandatory:!0,multiple:!0,description:"Settings describing the colour format."},21937:{name:"MatrixCoefficients",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The Matrix Coefficients of the video used to derive luma and chroma values from red, green, and blue color primaries. For clarity, the value and meanings for MatrixCoefficients are adopted from Table 4 of ISO/IEC 23001-8:2016 or ITU-T H.273."},21945:{name:"Range",level:"5",type:"u",mandatory:!0,multiple:!0,description:"Clipping of the color ranges."},21946:{name:"TransferCharacteristics",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The transfer characteristics of the video."},21947:{name:"Primaries",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The colour primaries of the video. For clarity, the value and meanings for Primaries are adopted from Table 2 of ISO/IEC 23091-4 or ITU-T H.273."}}),ebmlID}var hasRequiredEBMLEncoder;function requireEBMLEncoder(){if(hasRequiredEBMLEncoder)return EBMLEncoder;hasRequiredEBMLEncoder=1,Object.defineProperty(EBMLEncoder,"__esModule",{value:!0});var b=requireTools(),m=requireTools(),u=requireEbmlID(),T=(function(){function r(){this._schema=u.byEbmlID,this._buffers=[],this._stack=[]}return r.prototype.encode=function(c){var e=this;return b.concat(c.reduce(function(t,i){return t.concat(e.encodeChunk(i))},[])).buffer},r.prototype.encodeChunk=function(c){return c.type==="m"?c.isEnd?this.endTag(c):this.startTag(c):(c.data=m.Buffer.from(c.data),this.writeTag(c)),this.flush()},r.prototype.flush=function(){var c=this._buffers;return this._buffers=[],c},r.prototype.getSchemaInfo=function(c){for(var e=Object.keys(this._schema).map(Number),t=0;t<e.length;t++){var i=e[t];if(this._schema[i].name===c)return new m.Buffer(i.toString(16),"hex")}return null},r.prototype.writeTag=function(c){var e=c.name,t=this.getSchemaInfo(e),i=c.data;if(t==null)throw new Error("No schema entry found for "+e);var _=b.encodeTag(t,i);if(this._stack.length>0){var I=this._stack[this._stack.length-1];I.children.push({tagId:t,elm:c,children:[],data:_});return}this._buffers=this._buffers.concat(_)},r.prototype.startTag=function(c){var e=c.name,t=this.getSchemaInfo(e);if(t==null)throw new Error("No schema entry found for "+e);if(c.unknownSize){var i=b.encodeTag(t,new m.Buffer(0),c.unknownSize);this._buffers=this._buffers.concat(i);return}var _={tagId:t,elm:c,children:[],data:null};this._stack.length>0&&this._stack[this._stack.length-1].children.push(_),this._stack.push(_)},r.prototype.endTag=function(c){c.name;var e=this._stack.pop();if(e==null)throw new Error("EBML structure is broken");if(e.elm.name!==c.name)throw new Error("EBML structure is broken");var t=e.children.reduce(function(_,I){if(I.data===null)throw new Error("EBML structure is broken");return _.concat(I.data)},[]),i=b.concat(t);e.elm.type==="m"?e.data=b.encodeTag(e.tagId,i,e.elm.unknownSize):e.data=b.encodeTag(e.tagId,i),this._stack.length<1&&(this._buffers=this._buffers.concat(e.data))},r})();return EBMLEncoder.default=T,EBMLEncoder}var buffer={},base64Js={},hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1,base64Js.byteLength=t,base64Js.toByteArray=_,base64Js.fromByteArray=M;for(var b=[],m=[],u=typeof Uint8Array<"u"?Uint8Array:Array,T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,c=T.length;r<c;++r)b[r]=T[r],m[T.charCodeAt(r)]=r;m[45]=62,m[95]=63;function e(j){var z=j.length;if(z%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var Q=j.indexOf("=");Q===-1&&(Q=z);var ne=Q===z?0:4-Q%4;return[Q,ne]}function t(j){var z=e(j),Q=z[0],ne=z[1];return(Q+ne)*3/4-ne}function i(j,z,Q){return(z+Q)*3/4-Q}function _(j){var z,Q=e(j),ne=Q[0],K=Q[1],oe=new u(i(j,ne,K)),ue=0,G=K>0?ne-4:ne,ie;for(ie=0;ie<G;ie+=4)z=m[j.charCodeAt(ie)]<<18|m[j.charCodeAt(ie+1)]<<12|m[j.charCodeAt(ie+2)]<<6|m[j.charCodeAt(ie+3)],oe[ue++]=z>>16&255,oe[ue++]=z>>8&255,oe[ue++]=z&255;return K===2&&(z=m[j.charCodeAt(ie)]<<2|m[j.charCodeAt(ie+1)]>>4,oe[ue++]=z&255),K===1&&(z=m[j.charCodeAt(ie)]<<10|m[j.charCodeAt(ie+1)]<<4|m[j.charCodeAt(ie+2)]>>2,oe[ue++]=z>>8&255,oe[ue++]=z&255),oe}function I(j){return b[j>>18&63]+b[j>>12&63]+b[j>>6&63]+b[j&63]}function x(j,z,Q){for(var ne,K=[],oe=z;oe<Q;oe+=3)ne=(j[oe]<<16&16711680)+(j[oe+1]<<8&65280)+(j[oe+2]&255),K.push(I(ne));return K.join("")}function M(j){for(var z,Q=j.length,ne=Q%3,K=[],oe=16383,ue=0,G=Q-ne;ue<G;ue+=oe)K.push(x(j,ue,ue+oe>G?G:ue+oe));return ne===1?(z=j[Q-1],K.push(b[z>>2]+b[z<<4&63]+"==")):ne===2&&(z=(j[Q-2]<<8)+j[Q-1],K.push(b[z>>10]+b[z>>4&63]+b[z<<2&63]+"=")),K.join("")}return base64Js}var ieee754={};var hasRequiredIeee754;function requireIeee754(){return hasRequiredIeee754||(hasRequiredIeee754=1,ieee754.read=function(b,m,u,T,r){var c,e,t=r*8-T-1,i=(1<<t)-1,_=i>>1,I=-7,x=u?r-1:0,M=u?-1:1,j=b[m+x];for(x+=M,c=j&(1<<-I)-1,j>>=-I,I+=t;I>0;c=c*256+b[m+x],x+=M,I-=8);for(e=c&(1<<-I)-1,c>>=-I,I+=T;I>0;e=e*256+b[m+x],x+=M,I-=8);if(c===0)c=1-_;else{if(c===i)return e?NaN:(j?-1:1)*(1/0);e=e+Math.pow(2,T),c=c-_}return(j?-1:1)*e*Math.pow(2,c-T)},ieee754.write=function(b,m,u,T,r,c){var e,t,i,_=c*8-r-1,I=(1<<_)-1,x=I>>1,M=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,j=T?0:c-1,z=T?1:-1,Q=m<0||m===0&&1/m<0?1:0;for(m=Math.abs(m),isNaN(m)||m===1/0?(t=isNaN(m)?1:0,e=I):(e=Math.floor(Math.log(m)/Math.LN2),m*(i=Math.pow(2,-e))<1&&(e--,i*=2),e+x>=1?m+=M/i:m+=M*Math.pow(2,1-x),m*i>=2&&(e++,i/=2),e+x>=I?(t=0,e=I):e+x>=1?(t=(m*i-1)*Math.pow(2,r),e=e+x):(t=m*Math.pow(2,x-1)*Math.pow(2,r),e=0));r>=8;b[u+j]=t&255,j+=z,t/=256,r-=8);for(e=e<<r|t,_+=r;_>0;b[u+j]=e&255,j+=z,e/=256,_-=8);b[u+j-z]|=Q*128}),ieee754}var hasRequiredBuffer;function requireBuffer(){return hasRequiredBuffer||(hasRequiredBuffer=1,(function(b){const m=requireBase64Js(),u=requireIeee754(),T=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;b.Buffer=t,b.SlowBuffer=oe,b.INSPECT_MAX_BYTES=50;const r=2147483647;b.kMaxLength=r,t.TYPED_ARRAY_SUPPORT=c(),!t.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{const F=new Uint8Array(1),C={foo:function(){return 42}};return Object.setPrototypeOf(C,Uint8Array.prototype),Object.setPrototypeOf(F,C),F.foo()===42}catch{return!1}}Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}});function e(F){if(F>r)throw new RangeError('The value "'+F+'" is invalid for option "size"');const C=new Uint8Array(F);return Object.setPrototypeOf(C,t.prototype),C}function t(F,C,N){if(typeof F=="number"){if(typeof C=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return x(F)}return i(F,C,N)}t.poolSize=8192;function i(F,C,N){if(typeof F=="string")return M(F,C);if(ArrayBuffer.isView(F))return z(F);if(F==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof F);if(Le(F,ArrayBuffer)||F&&Le(F.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Le(F,SharedArrayBuffer)||F&&Le(F.buffer,SharedArrayBuffer)))return Q(F,C,N);if(typeof F=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Z=F.valueOf&&F.valueOf();if(Z!=null&&Z!==F)return t.from(Z,C,N);const te=ne(F);if(te)return te;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof F[Symbol.toPrimitive]=="function")return t.from(F[Symbol.toPrimitive]("string"),C,N);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof F)}t.from=function(F,C,N){return i(F,C,N)},Object.setPrototypeOf(t.prototype,Uint8Array.prototype),Object.setPrototypeOf(t,Uint8Array);function _(F){if(typeof F!="number")throw new TypeError('"size" argument must be of type number');if(F<0)throw new RangeError('The value "'+F+'" is invalid for option "size"')}function I(F,C,N){return _(F),F<=0?e(F):C!==void 0?typeof N=="string"?e(F).fill(C,N):e(F).fill(C):e(F)}t.alloc=function(F,C,N){return I(F,C,N)};function x(F){return _(F),e(F<0?0:K(F)|0)}t.allocUnsafe=function(F){return x(F)},t.allocUnsafeSlow=function(F){return x(F)};function M(F,C){if((typeof C!="string"||C==="")&&(C="utf8"),!t.isEncoding(C))throw new TypeError("Unknown encoding: "+C);const N=ue(F,C)|0;let Z=e(N);const te=Z.write(F,C);return te!==N&&(Z=Z.slice(0,te)),Z}function j(F){const C=F.length<0?0:K(F.length)|0,N=e(C);for(let Z=0;Z<C;Z+=1)N[Z]=F[Z]&255;return N}function z(F){if(Le(F,Uint8Array)){const C=new Uint8Array(F);return Q(C.buffer,C.byteOffset,C.byteLength)}return j(F)}function Q(F,C,N){if(C<0||F.byteLength<C)throw new RangeError('"offset" is outside of buffer bounds');if(F.byteLength<C+(N||0))throw new RangeError('"length" is outside of buffer bounds');let Z;return C===void 0&&N===void 0?Z=new Uint8Array(F):N===void 0?Z=new Uint8Array(F,C):Z=new Uint8Array(F,C,N),Object.setPrototypeOf(Z,t.prototype),Z}function ne(F){if(t.isBuffer(F)){const C=K(F.length)|0,N=e(C);return N.length===0||F.copy(N,0,0,C),N}if(F.length!==void 0)return typeof F.length!="number"||Qe(F.length)?e(0):j(F);if(F.type==="Buffer"&&Array.isArray(F.data))return j(F.data)}function K(F){if(F>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return F|0}function oe(F){return+F!=F&&(F=0),t.alloc(+F)}t.isBuffer=function(C){return C!=null&&C._isBuffer===!0&&C!==t.prototype},t.compare=function(C,N){if(Le(C,Uint8Array)&&(C=t.from(C,C.offset,C.byteLength)),Le(N,Uint8Array)&&(N=t.from(N,N.offset,N.byteLength)),!t.isBuffer(C)||!t.isBuffer(N))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(C===N)return 0;let Z=C.length,te=N.length;for(let ce=0,fe=Math.min(Z,te);ce<fe;++ce)if(C[ce]!==N[ce]){Z=C[ce],te=N[ce];break}return Z<te?-1:te<Z?1:0},t.isEncoding=function(C){switch(String(C).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},t.concat=function(C,N){if(!Array.isArray(C))throw new TypeError('"list" argument must be an Array of Buffers');if(C.length===0)return t.alloc(0);let Z;if(N===void 0)for(N=0,Z=0;Z<C.length;++Z)N+=C[Z].length;const te=t.allocUnsafe(N);let ce=0;for(Z=0;Z<C.length;++Z){let fe=C[Z];if(Le(fe,Uint8Array))ce+fe.length>te.length?(t.isBuffer(fe)||(fe=t.from(fe)),fe.copy(te,ce)):Uint8Array.prototype.set.call(te,fe,ce);else if(t.isBuffer(fe))fe.copy(te,ce);else throw new TypeError('"list" argument must be an Array of Buffers');ce+=fe.length}return te};function ue(F,C){if(t.isBuffer(F))return F.length;if(ArrayBuffer.isView(F)||Le(F,ArrayBuffer))return F.byteLength;if(typeof F!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof F);const N=F.length,Z=arguments.length>2&&arguments[2]===!0;if(!Z&&N===0)return 0;let te=!1;for(;;)switch(C){case"ascii":case"latin1":case"binary":return N;case"utf8":case"utf-8":return ze(F).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N*2;case"hex":return N>>>1;case"base64":return Ve(F).length;default:if(te)return Z?-1:ze(F).length;C=(""+C).toLowerCase(),te=!0}}t.byteLength=ue;function G(F,C,N){let Z=!1;if((C===void 0||C<0)&&(C=0),C>this.length||((N===void 0||N>this.length)&&(N=this.length),N<=0)||(N>>>=0,C>>>=0,N<=C))return"";for(F||(F="utf8");;)switch(F){case"hex":return Ne(this,C,N);case"utf8":case"utf-8":return ye(this,C,N);case"ascii":return Pe(this,C,N);case"latin1":case"binary":return Ae(this,C,N);case"base64":return he(this,C,N);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return He(this,C,N);default:if(Z)throw new TypeError("Unknown encoding: "+F);F=(F+"").toLowerCase(),Z=!0}}t.prototype._isBuffer=!0;function ie(F,C,N){const Z=F[C];F[C]=F[N],F[N]=Z}t.prototype.swap16=function(){const C=this.length;if(C%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let N=0;N<C;N+=2)ie(this,N,N+1);return this},t.prototype.swap32=function(){const C=this.length;if(C%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let N=0;N<C;N+=4)ie(this,N,N+3),ie(this,N+1,N+2);return this},t.prototype.swap64=function(){const C=this.length;if(C%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let N=0;N<C;N+=8)ie(this,N,N+7),ie(this,N+1,N+6),ie(this,N+2,N+5),ie(this,N+3,N+4);return this},t.prototype.toString=function(){const C=this.length;return C===0?"":arguments.length===0?ye(this,0,C):G.apply(this,arguments)},t.prototype.toLocaleString=t.prototype.toString,t.prototype.equals=function(C){if(!t.isBuffer(C))throw new TypeError("Argument must be a Buffer");return this===C?!0:t.compare(this,C)===0},t.prototype.inspect=function(){let C="";const N=b.INSPECT_MAX_BYTES;return C=this.toString("hex",0,N).replace(/(.{2})/g,"$1 ").trim(),this.length>N&&(C+=" ... "),"<Buffer "+C+">"},T&&(t.prototype[T]=t.prototype.inspect),t.prototype.compare=function(C,N,Z,te,ce){if(Le(C,Uint8Array)&&(C=t.from(C,C.offset,C.byteLength)),!t.isBuffer(C))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof C);if(N===void 0&&(N=0),Z===void 0&&(Z=C?C.length:0),te===void 0&&(te=0),ce===void 0&&(ce=this.length),N<0||Z>C.length||te<0||ce>this.length)throw new RangeError("out of range index");if(te>=ce&&N>=Z)return 0;if(te>=ce)return-1;if(N>=Z)return 1;if(N>>>=0,Z>>>=0,te>>>=0,ce>>>=0,this===C)return 0;let fe=ce-te,_e=Z-N;const $e=Math.min(fe,_e),Ie=this.slice(te,ce),xe=C.slice(N,Z);for(let Te=0;Te<$e;++Te)if(Ie[Te]!==xe[Te]){fe=Ie[Te],_e=xe[Te];break}return fe<_e?-1:_e<fe?1:0};function le(F,C,N,Z,te){if(F.length===0)return-1;if(typeof N=="string"?(Z=N,N=0):N>2147483647?N=2147483647:N<-2147483648&&(N=-2147483648),N=+N,Qe(N)&&(N=te?0:F.length-1),N<0&&(N=F.length+N),N>=F.length){if(te)return-1;N=F.length-1}else if(N<0)if(te)N=0;else return-1;if(typeof C=="string"&&(C=t.from(C,Z)),t.isBuffer(C))return C.length===0?-1:re(F,C,N,Z,te);if(typeof C=="number")return C=C&255,typeof Uint8Array.prototype.indexOf=="function"?te?Uint8Array.prototype.indexOf.call(F,C,N):Uint8Array.prototype.lastIndexOf.call(F,C,N):re(F,[C],N,Z,te);throw new TypeError("val must be string, number or Buffer")}function re(F,C,N,Z,te){let ce=1,fe=F.length,_e=C.length;if(Z!==void 0&&(Z=String(Z).toLowerCase(),Z==="ucs2"||Z==="ucs-2"||Z==="utf16le"||Z==="utf-16le")){if(F.length<2||C.length<2)return-1;ce=2,fe/=2,_e/=2,N/=2}function $e(xe,Te){return ce===1?xe[Te]:xe.readUInt16BE(Te*ce)}let Ie;if(te){let xe=-1;for(Ie=N;Ie<fe;Ie++)if($e(F,Ie)===$e(C,xe===-1?0:Ie-xe)){if(xe===-1&&(xe=Ie),Ie-xe+1===_e)return xe*ce}else xe!==-1&&(Ie-=Ie-xe),xe=-1}else for(N+_e>fe&&(N=fe-_e),Ie=N;Ie>=0;Ie--){let xe=!0;for(let Te=0;Te<_e;Te++)if($e(F,Ie+Te)!==$e(C,Te)){xe=!1;break}if(xe)return Ie}return-1}t.prototype.includes=function(C,N,Z){return this.indexOf(C,N,Z)!==-1},t.prototype.indexOf=function(C,N,Z){return le(this,C,N,Z,!0)},t.prototype.lastIndexOf=function(C,N,Z){return le(this,C,N,Z,!1)};function se(F,C,N,Z){N=Number(N)||0;const te=F.length-N;Z?(Z=Number(Z),Z>te&&(Z=te)):Z=te;const ce=C.length;Z>ce/2&&(Z=ce/2);let fe;for(fe=0;fe<Z;++fe){const _e=parseInt(C.substr(fe*2,2),16);if(Qe(_e))return fe;F[N+fe]=_e}return fe}function de(F,C,N,Z){return Ge(ze(C,F.length-N),F,N,Z)}function ee(F,C,N,Z){return Ge(Je(C),F,N,Z)}function ae(F,C,N,Z){return Ge(Ve(C),F,N,Z)}function pe(F,C,N,Z){return Ge(We(C,F.length-N),F,N,Z)}t.prototype.write=function(C,N,Z,te){if(N===void 0)te="utf8",Z=this.length,N=0;else if(Z===void 0&&typeof N=="string")te=N,Z=this.length,N=0;else if(isFinite(N))N=N>>>0,isFinite(Z)?(Z=Z>>>0,te===void 0&&(te="utf8")):(te=Z,Z=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ce=this.length-N;if((Z===void 0||Z>ce)&&(Z=ce),C.length>0&&(Z<0||N<0)||N>this.length)throw new RangeError("Attempt to write outside buffer bounds");te||(te="utf8");let fe=!1;for(;;)switch(te){case"hex":return se(this,C,N,Z);case"utf8":case"utf-8":return de(this,C,N,Z);case"ascii":case"latin1":case"binary":return ee(this,C,N,Z);case"base64":return ae(this,C,N,Z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,C,N,Z);default:if(fe)throw new TypeError("Unknown encoding: "+te);te=(""+te).toLowerCase(),fe=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function he(F,C,N){return C===0&&N===F.length?m.fromByteArray(F):m.fromByteArray(F.slice(C,N))}function ye(F,C,N){N=Math.min(F.length,N);const Z=[];let te=C;for(;te<N;){const ce=F[te];let fe=null,_e=ce>239?4:ce>223?3:ce>191?2:1;if(te+_e<=N){let $e,Ie,xe,Te;switch(_e){case 1:ce<128&&(fe=ce);break;case 2:$e=F[te+1],($e&192)===128&&(Te=(ce&31)<<6|$e&63,Te>127&&(fe=Te));break;case 3:$e=F[te+1],Ie=F[te+2],($e&192)===128&&(Ie&192)===128&&(Te=(ce&15)<<12|($e&63)<<6|Ie&63,Te>2047&&(Te<55296||Te>57343)&&(fe=Te));break;case 4:$e=F[te+1],Ie=F[te+2],xe=F[te+3],($e&192)===128&&(Ie&192)===128&&(xe&192)===128&&(Te=(ce&15)<<18|($e&63)<<12|(Ie&63)<<6|xe&63,Te>65535&&Te<1114112&&(fe=Te))}}fe===null?(fe=65533,_e=1):fe>65535&&(fe-=65536,Z.push(fe>>>10&1023|55296),fe=56320|fe&1023),Z.push(fe),te+=_e}return Re(Z)}const ge=4096;function Re(F){const C=F.length;if(C<=ge)return String.fromCharCode.apply(String,F);let N="",Z=0;for(;Z<C;)N+=String.fromCharCode.apply(String,F.slice(Z,Z+=ge));return N}function Pe(F,C,N){let Z="";N=Math.min(F.length,N);for(let te=C;te<N;++te)Z+=String.fromCharCode(F[te]&127);return Z}function Ae(F,C,N){let Z="";N=Math.min(F.length,N);for(let te=C;te<N;++te)Z+=String.fromCharCode(F[te]);return Z}function Ne(F,C,N){const Z=F.length;(!C||C<0)&&(C=0),(!N||N<0||N>Z)&&(N=Z);let te="";for(let ce=C;ce<N;++ce)te+=Ke[F[ce]];return te}function He(F,C,N){const Z=F.slice(C,N);let te="";for(let ce=0;ce<Z.length-1;ce+=2)te+=String.fromCharCode(Z[ce]+Z[ce+1]*256);return te}t.prototype.slice=function(C,N){const Z=this.length;C=~~C,N=N===void 0?Z:~~N,C<0?(C+=Z,C<0&&(C=0)):C>Z&&(C=Z),N<0?(N+=Z,N<0&&(N=0)):N>Z&&(N=Z),N<C&&(N=C);const te=this.subarray(C,N);return Object.setPrototypeOf(te,t.prototype),te};function Se(F,C,N){if(F%1!==0||F<0)throw new RangeError("offset is not uint");if(F+C>N)throw new RangeError("Trying to access beyond buffer length")}t.prototype.readUintLE=t.prototype.readUIntLE=function(C,N,Z){C=C>>>0,N=N>>>0,Z||Se(C,N,this.length);let te=this[C],ce=1,fe=0;for(;++fe<N&&(ce*=256);)te+=this[C+fe]*ce;return te},t.prototype.readUintBE=t.prototype.readUIntBE=function(C,N,Z){C=C>>>0,N=N>>>0,Z||Se(C,N,this.length);let te=this[C+--N],ce=1;for(;N>0&&(ce*=256);)te+=this[C+--N]*ce;return te},t.prototype.readUint8=t.prototype.readUInt8=function(C,N){return C=C>>>0,N||Se(C,1,this.length),this[C]},t.prototype.readUint16LE=t.prototype.readUInt16LE=function(C,N){return C=C>>>0,N||Se(C,2,this.length),this[C]|this[C+1]<<8},t.prototype.readUint16BE=t.prototype.readUInt16BE=function(C,N){return C=C>>>0,N||Se(C,2,this.length),this[C]<<8|this[C+1]},t.prototype.readUint32LE=t.prototype.readUInt32LE=function(C,N){return C=C>>>0,N||Se(C,4,this.length),(this[C]|this[C+1]<<8|this[C+2]<<16)+this[C+3]*16777216},t.prototype.readUint32BE=t.prototype.readUInt32BE=function(C,N){return C=C>>>0,N||Se(C,4,this.length),this[C]*16777216+(this[C+1]<<16|this[C+2]<<8|this[C+3])},t.prototype.readBigUInt64LE=Ze(function(C){C=C>>>0,Oe(C,"offset");const N=this[C],Z=this[C+7];(N===void 0||Z===void 0)&&Ce(C,this.length-8);const te=N+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24,ce=this[++C]+this[++C]*2**8+this[++C]*2**16+Z*2**24;return BigInt(te)+(BigInt(ce)<<BigInt(32))}),t.prototype.readBigUInt64BE=Ze(function(C){C=C>>>0,Oe(C,"offset");const N=this[C],Z=this[C+7];(N===void 0||Z===void 0)&&Ce(C,this.length-8);const te=N*2**24+this[++C]*2**16+this[++C]*2**8+this[++C],ce=this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+Z;return(BigInt(te)<<BigInt(32))+BigInt(ce)}),t.prototype.readIntLE=function(C,N,Z){C=C>>>0,N=N>>>0,Z||Se(C,N,this.length);let te=this[C],ce=1,fe=0;for(;++fe<N&&(ce*=256);)te+=this[C+fe]*ce;return ce*=128,te>=ce&&(te-=Math.pow(2,8*N)),te},t.prototype.readIntBE=function(C,N,Z){C=C>>>0,N=N>>>0,Z||Se(C,N,this.length);let te=N,ce=1,fe=this[C+--te];for(;te>0&&(ce*=256);)fe+=this[C+--te]*ce;return ce*=128,fe>=ce&&(fe-=Math.pow(2,8*N)),fe},t.prototype.readInt8=function(C,N){return C=C>>>0,N||Se(C,1,this.length),this[C]&128?(255-this[C]+1)*-1:this[C]},t.prototype.readInt16LE=function(C,N){C=C>>>0,N||Se(C,2,this.length);const Z=this[C]|this[C+1]<<8;return Z&32768?Z|4294901760:Z},t.prototype.readInt16BE=function(C,N){C=C>>>0,N||Se(C,2,this.length);const Z=this[C+1]|this[C]<<8;return Z&32768?Z|4294901760:Z},t.prototype.readInt32LE=function(C,N){return C=C>>>0,N||Se(C,4,this.length),this[C]|this[C+1]<<8|this[C+2]<<16|this[C+3]<<24},t.prototype.readInt32BE=function(C,N){return C=C>>>0,N||Se(C,4,this.length),this[C]<<24|this[C+1]<<16|this[C+2]<<8|this[C+3]},t.prototype.readBigInt64LE=Ze(function(C){C=C>>>0,Oe(C,"offset");const N=this[C],Z=this[C+7];(N===void 0||Z===void 0)&&Ce(C,this.length-8);const te=this[C+4]+this[C+5]*2**8+this[C+6]*2**16+(Z<<24);return(BigInt(te)<<BigInt(32))+BigInt(N+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24)}),t.prototype.readBigInt64BE=Ze(function(C){C=C>>>0,Oe(C,"offset");const N=this[C],Z=this[C+7];(N===void 0||Z===void 0)&&Ce(C,this.length-8);const te=(N<<24)+this[++C]*2**16+this[++C]*2**8+this[++C];return(BigInt(te)<<BigInt(32))+BigInt(this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+Z)}),t.prototype.readFloatLE=function(C,N){return C=C>>>0,N||Se(C,4,this.length),u.read(this,C,!0,23,4)},t.prototype.readFloatBE=function(C,N){return C=C>>>0,N||Se(C,4,this.length),u.read(this,C,!1,23,4)},t.prototype.readDoubleLE=function(C,N){return C=C>>>0,N||Se(C,8,this.length),u.read(this,C,!0,52,8)},t.prototype.readDoubleBE=function(C,N){return C=C>>>0,N||Se(C,8,this.length),u.read(this,C,!1,52,8)};function we(F,C,N,Z,te,ce){if(!t.isBuffer(F))throw new TypeError('"buffer" argument must be a Buffer instance');if(C>te||C<ce)throw new RangeError('"value" argument is out of bounds');if(N+Z>F.length)throw new RangeError("Index out of range")}t.prototype.writeUintLE=t.prototype.writeUIntLE=function(C,N,Z,te){if(C=+C,N=N>>>0,Z=Z>>>0,!te){const _e=Math.pow(2,8*Z)-1;we(this,C,N,Z,_e,0)}let ce=1,fe=0;for(this[N]=C&255;++fe<Z&&(ce*=256);)this[N+fe]=C/ce&255;return N+Z},t.prototype.writeUintBE=t.prototype.writeUIntBE=function(C,N,Z,te){if(C=+C,N=N>>>0,Z=Z>>>0,!te){const _e=Math.pow(2,8*Z)-1;we(this,C,N,Z,_e,0)}let ce=Z-1,fe=1;for(this[N+ce]=C&255;--ce>=0&&(fe*=256);)this[N+ce]=C/fe&255;return N+Z},t.prototype.writeUint8=t.prototype.writeUInt8=function(C,N,Z){return C=+C,N=N>>>0,Z||we(this,C,N,1,255,0),this[N]=C&255,N+1},t.prototype.writeUint16LE=t.prototype.writeUInt16LE=function(C,N,Z){return C=+C,N=N>>>0,Z||we(this,C,N,2,65535,0),this[N]=C&255,this[N+1]=C>>>8,N+2},t.prototype.writeUint16BE=t.prototype.writeUInt16BE=function(C,N,Z){return C=+C,N=N>>>0,Z||we(this,C,N,2,65535,0),this[N]=C>>>8,this[N+1]=C&255,N+2},t.prototype.writeUint32LE=t.prototype.writeUInt32LE=function(C,N,Z){return C=+C,N=N>>>0,Z||we(this,C,N,4,4294967295,0),this[N+3]=C>>>24,this[N+2]=C>>>16,this[N+1]=C>>>8,this[N]=C&255,N+4},t.prototype.writeUint32BE=t.prototype.writeUInt32BE=function(C,N,Z){return C=+C,N=N>>>0,Z||we(this,C,N,4,4294967295,0),this[N]=C>>>24,this[N+1]=C>>>16,this[N+2]=C>>>8,this[N+3]=C&255,N+4};function je(F,C,N,Z,te){ve(C,Z,te,F,N,7);let ce=Number(C&BigInt(4294967295));F[N++]=ce,ce=ce>>8,F[N++]=ce,ce=ce>>8,F[N++]=ce,ce=ce>>8,F[N++]=ce;let fe=Number(C>>BigInt(32)&BigInt(4294967295));return F[N++]=fe,fe=fe>>8,F[N++]=fe,fe=fe>>8,F[N++]=fe,fe=fe>>8,F[N++]=fe,N}function Ee(F,C,N,Z,te){ve(C,Z,te,F,N,7);let ce=Number(C&BigInt(4294967295));F[N+7]=ce,ce=ce>>8,F[N+6]=ce,ce=ce>>8,F[N+5]=ce,ce=ce>>8,F[N+4]=ce;let fe=Number(C>>BigInt(32)&BigInt(4294967295));return F[N+3]=fe,fe=fe>>8,F[N+2]=fe,fe=fe>>8,F[N+1]=fe,fe=fe>>8,F[N]=fe,N+8}t.prototype.writeBigUInt64LE=Ze(function(C,N=0){return je(this,C,N,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeBigUInt64BE=Ze(function(C,N=0){return Ee(this,C,N,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeIntLE=function(C,N,Z,te){if(C=+C,N=N>>>0,!te){const $e=Math.pow(2,8*Z-1);we(this,C,N,Z,$e-1,-$e)}let ce=0,fe=1,_e=0;for(this[N]=C&255;++ce<Z&&(fe*=256);)C<0&&_e===0&&this[N+ce-1]!==0&&(_e=1),this[N+ce]=(C/fe>>0)-_e&255;return N+Z},t.prototype.writeIntBE=function(C,N,Z,te){if(C=+C,N=N>>>0,!te){const $e=Math.pow(2,8*Z-1);we(this,C,N,Z,$e-1,-$e)}let ce=Z-1,fe=1,_e=0;for(this[N+ce]=C&255;--ce>=0&&(fe*=256);)C<0&&_e===0&&this[N+ce+1]!==0&&(_e=1),this[N+ce]=(C/fe>>0)-_e&255;return N+Z},t.prototype.writeInt8=function(C,N,Z){return C=+C,N=N>>>0,Z||we(this,C,N,1,127,-128),C<0&&(C=255+C+1),this[N]=C&255,N+1},t.prototype.writeInt16LE=function(C,N,Z){return C=+C,N=N>>>0,Z||we(this,C,N,2,32767,-32768),this[N]=C&255,this[N+1]=C>>>8,N+2},t.prototype.writeInt16BE=function(C,N,Z){return C=+C,N=N>>>0,Z||we(this,C,N,2,32767,-32768),this[N]=C>>>8,this[N+1]=C&255,N+2},t.prototype.writeInt32LE=function(C,N,Z){return C=+C,N=N>>>0,Z||we(this,C,N,4,2147483647,-2147483648),this[N]=C&255,this[N+1]=C>>>8,this[N+2]=C>>>16,this[N+3]=C>>>24,N+4},t.prototype.writeInt32BE=function(C,N,Z){return C=+C,N=N>>>0,Z||we(this,C,N,4,2147483647,-2147483648),C<0&&(C=4294967295+C+1),this[N]=C>>>24,this[N+1]=C>>>16,this[N+2]=C>>>8,this[N+3]=C&255,N+4},t.prototype.writeBigInt64LE=Ze(function(C,N=0){return je(this,C,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),t.prototype.writeBigInt64BE=Ze(function(C,N=0){return Ee(this,C,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ue(F,C,N,Z,te,ce){if(N+Z>F.length)throw new RangeError("Index out of range");if(N<0)throw new RangeError("Index out of range")}function Fe(F,C,N,Z,te){return C=+C,N=N>>>0,te||Ue(F,C,N,4),u.write(F,C,N,Z,23,4),N+4}t.prototype.writeFloatLE=function(C,N,Z){return Fe(this,C,N,!0,Z)},t.prototype.writeFloatBE=function(C,N,Z){return Fe(this,C,N,!1,Z)};function Me(F,C,N,Z,te){return C=+C,N=N>>>0,te||Ue(F,C,N,8),u.write(F,C,N,Z,52,8),N+8}t.prototype.writeDoubleLE=function(C,N,Z){return Me(this,C,N,!0,Z)},t.prototype.writeDoubleBE=function(C,N,Z){return Me(this,C,N,!1,Z)},t.prototype.copy=function(C,N,Z,te){if(!t.isBuffer(C))throw new TypeError("argument should be a Buffer");if(Z||(Z=0),!te&&te!==0&&(te=this.length),N>=C.length&&(N=C.length),N||(N=0),te>0&&te<Z&&(te=Z),te===Z||C.length===0||this.length===0)return 0;if(N<0)throw new RangeError("targetStart out of bounds");if(Z<0||Z>=this.length)throw new RangeError("Index out of range");if(te<0)throw new RangeError("sourceEnd out of bounds");te>this.length&&(te=this.length),C.length-N<te-Z&&(te=C.length-N+Z);const ce=te-Z;return this===C&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(N,Z,te):Uint8Array.prototype.set.call(C,this.subarray(Z,te),N),ce},t.prototype.fill=function(C,N,Z,te){if(typeof C=="string"){if(typeof N=="string"?(te=N,N=0,Z=this.length):typeof Z=="string"&&(te=Z,Z=this.length),te!==void 0&&typeof te!="string")throw new TypeError("encoding must be a string");if(typeof te=="string"&&!t.isEncoding(te))throw new TypeError("Unknown encoding: "+te);if(C.length===1){const fe=C.charCodeAt(0);(te==="utf8"&&fe<128||te==="latin1")&&(C=fe)}}else typeof C=="number"?C=C&255:typeof C=="boolean"&&(C=Number(C));if(N<0||this.length<N||this.length<Z)throw new RangeError("Out of range index");if(Z<=N)return this;N=N>>>0,Z=Z===void 0?this.length:Z>>>0,C||(C=0);let ce;if(typeof C=="number")for(ce=N;ce<Z;++ce)this[ce]=C;else{const fe=t.isBuffer(C)?C:t.from(C,te),_e=fe.length;if(_e===0)throw new TypeError('The value "'+C+'" is invalid for argument "value"');for(ce=0;ce<Z-N;++ce)this[ce+N]=fe[ce%_e]}return this};const qe={};function be(F,C,N){qe[F]=class extends N{constructor(){super(),Object.defineProperty(this,"message",{value:C.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${F}]`,this.stack,delete this.name}get code(){return F}set code(te){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:te,writable:!0})}toString(){return`${this.name} [${F}]: ${this.message}`}}}be("ERR_BUFFER_OUT_OF_BOUNDS",function(F){return F?`${F} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),be("ERR_INVALID_ARG_TYPE",function(F,C){return`The "${F}" argument must be of type number. Received type ${typeof C}`},TypeError),be("ERR_OUT_OF_RANGE",function(F,C,N){let Z=`The value of "${F}" is out of range.`,te=N;return Number.isInteger(N)&&Math.abs(N)>2**32?te=me(String(N)):typeof N=="bigint"&&(te=String(N),(N>BigInt(2)**BigInt(32)||N<-(BigInt(2)**BigInt(32)))&&(te=me(te)),te+="n"),Z+=` It must be ${C}. Received ${te}`,Z},RangeError);function me(F){let C="",N=F.length;const Z=F[0]==="-"?1:0;for(;N>=Z+4;N-=3)C=`_${F.slice(N-3,N)}${C}`;return`${F.slice(0,N)}${C}`}function ke(F,C,N){Oe(C,"offset"),(F[C]===void 0||F[C+N]===void 0)&&Ce(C,F.length-(N+1))}function ve(F,C,N,Z,te,ce){if(F>N||F<C){const fe=typeof C=="bigint"?"n":"";let _e;throw C===0||C===BigInt(0)?_e=`>= 0${fe} and < 2${fe} ** ${(ce+1)*8}${fe}`:_e=`>= -(2${fe} ** ${(ce+1)*8-1}${fe}) and < 2 ** ${(ce+1)*8-1}${fe}`,new qe.ERR_OUT_OF_RANGE("value",_e,F)}ke(Z,te,ce)}function Oe(F,C){if(typeof F!="number")throw new qe.ERR_INVALID_ARG_TYPE(C,"number",F)}function Ce(F,C,N){throw Math.floor(F)!==F?(Oe(F,N),new qe.ERR_OUT_OF_RANGE("offset","an integer",F)):C<0?new qe.ERR_BUFFER_OUT_OF_BOUNDS:new qe.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${C}`,F)}const Be=/[^+/0-9A-Za-z-_]/g;function De(F){if(F=F.split("=")[0],F=F.trim().replace(Be,""),F.length<2)return"";for(;F.length%4!==0;)F=F+"=";return F}function ze(F,C){C=C||1/0;let N;const Z=F.length;let te=null;const ce=[];for(let fe=0;fe<Z;++fe){if(N=F.charCodeAt(fe),N>55295&&N<57344){if(!te){if(N>56319){(C-=3)>-1&&ce.push(239,191,189);continue}else if(fe+1===Z){(C-=3)>-1&&ce.push(239,191,189);continue}te=N;continue}if(N<56320){(C-=3)>-1&&ce.push(239,191,189),te=N;continue}N=(te-55296<<10|N-56320)+65536}else te&&(C-=3)>-1&&ce.push(239,191,189);if(te=null,N<128){if((C-=1)<0)break;ce.push(N)}else if(N<2048){if((C-=2)<0)break;ce.push(N>>6|192,N&63|128)}else if(N<65536){if((C-=3)<0)break;ce.push(N>>12|224,N>>6&63|128,N&63|128)}else if(N<1114112){if((C-=4)<0)break;ce.push(N>>18|240,N>>12&63|128,N>>6&63|128,N&63|128)}else throw new Error("Invalid code point")}return ce}function Je(F){const C=[];for(let N=0;N<F.length;++N)C.push(F.charCodeAt(N)&255);return C}function We(F,C){let N,Z,te;const ce=[];for(let fe=0;fe<F.length&&!((C-=2)<0);++fe)N=F.charCodeAt(fe),Z=N>>8,te=N%256,ce.push(te),ce.push(Z);return ce}function Ve(F){return m.toByteArray(De(F))}function Ge(F,C,N,Z){let te;for(te=0;te<Z&&!(te+N>=C.length||te>=F.length);++te)C[te+N]=F[te];return te}function Le(F,C){return F instanceof C||F!=null&&F.constructor!=null&&F.constructor.name!=null&&F.constructor.name===C.name}function Qe(F){return F!==F}const Ke=(function(){const F="0123456789abcdef",C=new Array(256);for(let N=0;N<16;++N){const Z=N*16;for(let te=0;te<16;++te)C[Z+te]=F[N]+F[te]}return C})();function Ze(F){return typeof BigInt>"u"?Ye:F}function Ye(){throw new Error("BigInt not supported")}})(buffer)),buffer}var toolsEbml={},hasRequiredToolsEbml;function requireToolsEbml(){if(hasRequiredToolsEbml)return toolsEbml;hasRequiredToolsEbml=1;var b=toolsEbml&&toolsEbml.__assign||function(){return b=Object.assign||function(r){for(var c,e=1,t=arguments.length;e<t;e++){c=arguments[e];for(var i in c)Object.prototype.hasOwnProperty.call(c,i)&&(r[i]=c[i])}return r},b.apply(this,arguments)},m=toolsEbml&&toolsEbml.__spreadArray||function(r,c,e){if(e||arguments.length===2)for(var t=0,i=c.length,_;t<i;t++)(_||!(t in c))&&(_||(_=Array.prototype.slice.call(c,0,t)),_[t]=c[t]);return r.concat(_||Array.prototype.slice.call(c))};Object.defineProperty(toolsEbml,"__esModule",{value:!0});var u=requireTools(),T=(function(){function r(){}return r.readVint=function(c,e){e===void 0&&(e=0);var t=8-Math.floor(Math.log2(c[e]));if(t>8){var i=r.readHexString(c,e,e+t);throw new Error("Unrepresentable length: ".concat(t," ").concat(i))}if(e+t>c.length)return null;for(var _=c[e]&(1<<8-t)-1,I=1;I<t;I+=1){if(I===7&&_>=Math.pow(2,8)&&c[e+7]>0)return{length:t,value:-1};_*=Math.pow(2,8),_+=c[e+I]}return{length:t,value:_}},r.writeVint=function(c){if(c<0||c>Math.pow(2,53))throw new Error("Unrepresentable value: ".concat(c));var e=1;for(e=1;e<=8&&!(c<Math.pow(2,7*e)-1);e+=1);for(var t=u.Buffer.alloc(e),i=c,_=1;_<=e;_+=1){var I=i&255;t[e-_]=I,i-=I,i/=Math.pow(2,8)}return t[0]|=1<<8-e,t},r.concatenate=function(c,e){return!c&&!e?u.Buffer.from([]):!c||c.byteLength===0?e:!e||e.byteLength===0?c:u.Buffer.from(m(m([],c,!0),e,!0))},r.readHexString=function(c,e,t){return e===void 0&&(e=0),t===void 0&&(t=c.byteLength),Array.from(c.slice(e,t)).map(function(i){return Number(i).toString(16)}).reduce(function(i,_){return"".concat(i).concat(_.padStart(2,"0"))},"")},r.readUtf8=function(c){try{return u.Buffer.from(c).toString("utf8")}catch{return null}},r.readUnsigned=function(c){var e=new DataView(c.buffer,c.byteOffset,c.byteLength);switch(c.byteLength){case 1:return e.getUint8(0);case 2:return e.getUint16(0);case 4:return e.getUint32(0)}return c.byteLength<=6?c.reduce(function(t,i){return t*256+i},0):r.readHexString(c,0,c.byteLength)},r.readSigned=function(c){var e=new DataView(c.buffer,c.byteOffset,c.byteLength);switch(c.byteLength){case 1:return e.getInt8(0);case 2:return e.getInt16(0);case 4:return e.getInt32(0);default:return NaN}},r.readFloat=function(c){var e=new DataView(c.buffer,c.byteOffset,c.byteLength);switch(c.byteLength){case 4:return e.getFloat32(0);case 8:return e.getFloat64(0);default:return NaN}},r.readDate=function(c){var e=new DataView(c.buffer,c.byteOffset,c.byteLength);switch(c.byteLength){case 1:return new Date(e.getUint8(0));case 2:return new Date(e.getUint16(0));case 4:return new Date(e.getUint32(0));case 8:return new Date(Number.parseInt(r.readHexString(c),16));default:return new Date(0)}},r.readDataFromTag=function(c,e){var t=c.type,i=c.name,_=c.track,I=c.discardable||!1,x=c.keyframe||!1,M=null,j;switch(t){case"u":j=r.readUnsigned(e);break;case"f":j=r.readFloat(e);break;case"i":j=r.readSigned(e);break;case"s":j=String.fromCharCode.apply(String,e);break;case"8":j=r.readUtf8(e);break;case"d":j=r.readDate(e);break}if(i==="SimpleBlock"||i==="Block"){var z=0,Q=r.readVint(e,z),ne=Q.length,K=Q.value;z+=ne,_=K,j=r.readSigned(e.subarray(z,z+2)),z+=2,i==="SimpleBlock"&&(x=!!(e[ne+2]&128),I=!!(e[ne+2]&1)),z+=1,M=e.subarray(z)}return b(b({},c),{data:e,discardable:I,keyframe:x,payload:M,track:_,value:j})},r})();return toolsEbml.default=T,toolsEbml}var vint,hasRequiredVint;function requireVint(){return hasRequiredVint||(hasRequiredVint=1,vint=function(b,m,u){m=m||0;for(var T=1;T<=8&&!(b[m]>=Math.pow(2,8-T));T++);if(T>8)throw new Error("Unrepresentable length: "+T+" "+b.toString("hex",m,m+T));if(m+T>b.length)return null;var r,c=b[m]&(1<<8-T)-1;for(r=1;r<T;r++){if(r===7&&c>=Math.pow(2,45)&&b[m+7]>0)return{length:T,value:-1};c*=Math.pow(2,8),c+=b[m+r]}return u&&(c-=Math.pow(2,T*7-1)-1),{length:T,value:c}}),vint}var bufferReader,hasRequiredBufferReader;function requireBufferReader(){if(hasRequiredBufferReader)return bufferReader;hasRequiredBufferReader=1;var b=requireVint();function m(u){this.buffer=u,this.offset=0}return m.prototype.nextInt16BE=function(){var u=this.buffer.readInt16BE(this.offset);return this.offset+=2,u},m.prototype.nextUInt8=function(){var u=this.buffer.readUInt8(this.offset);return this.offset+=1,u},m.prototype.nextUIntV=function(){var u=b(this.buffer,this.offset);return this.offset+=u.length,u.value},m.prototype.nextIntV=function(){var u=b(this.buffer,this.offset,!0);return this.offset+=u.length,u.value},m.prototype.nextBuffer=function(u){var T=u?this.buffer.slice(this.offset,this.offset+u):this.buffer.slice(this.offset);return this.offset+=u||this.length,T},Object.defineProperty(m.prototype,"length",{get:function(){return this.buffer.length-this.offset}}),bufferReader=m,bufferReader}var ebmlBlock,hasRequiredEbmlBlock;function requireEbmlBlock(){if(hasRequiredEbmlBlock)return ebmlBlock;hasRequiredEbmlBlock=1;var b=requireBufferReader(),m=1,u=3,T=2;ebmlBlock=function(c){var e={},t=new b(c);e.trackNumber=t.nextUIntV(),e.timecode=t.nextInt16BE();var i=t.nextUInt8();e.invisible=!!(i&8),e.keyframe=!!(i&128),e.discardable=!!(i&1);var _=(i&6)>>1;return e.frames=r(t,_),e};function r(c,e){if(!e)return[c.nextBuffer()];var t,i,_=[],I=c.nextUInt8()+1;if(e===T){if(c.length%I!==0)throw new Error("Fixed-Size Lacing Error");for(i=c.length/I,t=0;t<I;t++)_.push(c.nextBuffer(i));return _}var x=[];if(e===m)for(t=0;t<I-1;t++){var M;i=0;do M=c.nextUInt8(),i+=M;while(M===255);x.push(i)}else if(e===u)for(i=c.nextUIntV(),x.push(i),t=1;t<I-1;t++)i+=c.nextIntV(),x.push(i);for(t=0;t<I-1;t++)_.push(c.nextBuffer(x[t]));return _.push(c.nextBuffer()),_}return ebmlBlock}var hasRequiredTools;function requireTools(){return hasRequiredTools||(hasRequiredTools=1,(function(b){Object.defineProperty(b,"__esModule",{value:!0}),b.convertEBMLDateToJSDate=b.createFloatBuffer=b.createIntBuffer=b.createUIntBuffer=b.encodeValueToBuffer=b.concat=b.putRefinedMetaData=b.extractElement=b.removeElement=b.makeMetadataSeekable=b.createRIFFChunk=b.VP8BitStreamToRiffWebPBuffer=b.WebPBlockFilter=b.encodeTag=b.readBlock=b.ebmlBlock=b.writeVint=b.readVint=b.Buffer=void 0;var m=requireInt64Buffer(),u=requireEBMLEncoder(),T=requireBuffer(),r=requireToolsEbml(),c=requireEbmlBlock();b.Buffer=T.Buffer,b.readVint=r.default.readVint,b.writeVint=r.default.writeVint,b.ebmlBlock=c;function e(ee){return(0,b.ebmlBlock)(new b.Buffer(ee))}b.readBlock=e;function t(ee,ae,pe){return pe===void 0&&(pe=!1),G([ee,pe?new b.Buffer("01ffffffffffffff","hex"):(0,b.writeVint)(ae.length),ae])}b.encodeTag=t;function i(ee){return ee.reduce(function(ae,pe){if(pe.type!=="b"||pe.name!=="SimpleBlock")return ae;var he=(0,b.ebmlBlock)(pe.data),ye=he.frames.some(function(ge){var Re=ge.slice(3,6).toString("hex");return Re==="9d012a"});return ye?ae.concat(pe):ae},[])}b.WebPBlockFilter=i;function _(ee){var ae=I("VP8 ",ee),pe=G([new b.Buffer("WEBP","ascii"),ae]);return I("RIFF",pe)}b.VP8BitStreamToRiffWebPBuffer=_;function I(ee,ae){var pe=new b.Buffer(4);return pe.writeUInt32LE(ae.byteLength,0),G([new b.Buffer(ee.substr(0,4),"ascii"),pe,ae,new b.Buffer(ae.byteLength%2===0?0:1)])}b.createRIFFChunk=I;function x(ee,ae,pe){var he=j("EBML",ee),ye=Q(he),ge=ye+12,Re=ee[ee.length-1].dataEnd-ge,Pe=j("Info",ee);M("Duration",Pe),Pe.splice(1,0,{name:"Duration",type:"f",data:se(ae,8)});for(var Ae=Q(Pe),Ne=j("Tracks",ee),He=Q(Ne),Se=47,we=[],je=5+pe.length*15,Ee=[],Ue=-1,Fe=10,Me=function(ve){var Oe=Se,Ce=Oe+Ae,Be=Ce+He,De=Be+je,ze=De-Re;if(we=[],we.push({name:"SeekHead",type:"m",isEnd:!1}),we.push({name:"Seek",type:"m",isEnd:!1}),we.push({name:"SeekID",type:"b",data:new b.Buffer([21,73,169,102])}),we.push({name:"SeekPosition",type:"u",data:le(Oe)}),we.push({name:"Seek",type:"m",isEnd:!0}),we.push({name:"Seek",type:"m",isEnd:!1}),we.push({name:"SeekID",type:"b",data:new b.Buffer([22,84,174,107])}),we.push({name:"SeekPosition",type:"u",data:le(Ce)}),we.push({name:"Seek",type:"m",isEnd:!0}),we.push({name:"Seek",type:"m",isEnd:!1}),we.push({name:"SeekID",type:"b",data:new b.Buffer([28,83,187,107])}),we.push({name:"SeekPosition",type:"u",data:le(Be)}),we.push({name:"Seek",type:"m",isEnd:!0}),we.push({name:"SeekHead",type:"m",isEnd:!0}),Se=Q(we),Ee=[],Ee.push({name:"Cues",type:"m",isEnd:!1}),pe.forEach(function(Je){var We=Je.CueTrack,Ve=Je.CueClusterPosition,Ge=Je.CueTime;Ee.push({name:"CuePoint",type:"m",isEnd:!1}),Ee.push({name:"CueTime",type:"u",data:le(Ge)}),Ee.push({name:"CueTrackPositions",type:"m",isEnd:!1}),Ee.push({name:"CueTrack",type:"u",data:le(We)}),Ve-=ge,Ve+=ze,Ee.push({name:"CueClusterPosition",type:"u",data:le(Ve)}),Ee.push({name:"CueTrackPositions",type:"m",isEnd:!0}),Ee.push({name:"CuePoint",type:"m",isEnd:!0})}),Ee.push({name:"Cues",type:"m",isEnd:!0}),je=Q(Ee),Ue!==ze){if(Ue=ze,ve===Fe-1)throw new Error("Failed to converge to a stable metadata size")}else return"break"},qe=0;qe<Fe;qe++){var be=Me(qe);if(be==="break")break}var me=[].concat.apply([],[he,{name:"Segment",type:"m",isEnd:!1,unknownSize:!0},we,Pe,Ne,Ee]),ke=new u.default().encode(me);return ke}b.makeMetadataSeekable=x;function M(ee,ae){for(var pe=-1,he=0;he<ae.length;he++){var ye=ae[he];if(ye.name===ee)if(ye.type==="m")if(!ye.isEnd)pe=he;else{if(pe==-1)throw new Error("Detected ".concat(ee," closing element before finding the start"));ae.splice(pe,he-pe+1);return}else{ae.splice(he,1);return}}}b.removeElement=M;function j(ee,ae){for(var pe=[],he=-1,ye=0;ye<ae.length;ye++){var ge=ae[ye];if(ge.name===ee)if(ge.type==="m")if(!ge.isEnd)he=ye;else{if(he==-1)throw new Error("Detected ".concat(ee," closing element before finding the start"));pe=ae.slice(he,ye+1);break}else{pe.push(ae[ye]);break}}return pe}b.extractElement=j;function z(ee,ae){Array.isArray(ae.cueInfos)&&!Array.isArray(ae.cues)&&(console.warn("putRefinedMetaData: info.cueInfos property is deprecated. please use info.cues"),ae.cues=ae.cueInfos);for(var pe=[],he=[],ye=0;ye<ee.length;ye++){var ge=ee[ye];if(ge.type==="m"&&ge.name==="Segment"){if(pe=ee.slice(0,ye),he=ee.slice(ye),ge.unknownSize){he.shift();break}throw new Error("this metadata is not streaming webm file")}}if(!(he[he.length-1].dataEnd>0))throw new Error("metadata dataEnd has wrong number");var Re=he[he.length-1].dataEnd,Pe=pe[pe.length-1].dataEnd,Ae=new u.default().encode(pe).byteLength,Ne=Ae-Pe,He=Re-he[0].tagStart;he[0].tagStart-Pe,he[0].tagStart;var Se=new b.Buffer([24,83,128,103]),we=new b.Buffer("01ffffffffffffff","hex"),je=Se.byteLength+we.byteLength,Ee=He,Ue;for(Ue=1;Ue<20;Ue++){var Fe=Pe+je+Ee,Me=Fe-Re,qe=Ne+Me,be=ne(he,qe,ae),me=new u.default().encode(be).byteLength;if(me===Ee)return new u.default().encode([].concat(pe,[{type:"m",name:"Segment",isEnd:!1,unknownSize:!0}],be));Ee=me}throw new Error("unable to refine metadata, stable size could not be found in "+Ue+" iterations!")}b.putRefinedMetaData=z;function Q(ee){var ae=new u.default;return ee.reduce(function(pe,he){return pe.concat(ae.encode([he]))},[]).reduce(function(pe,he){return pe+he.byteLength},0)}function ne(ee,ae,pe){var he=pe.duration,ye=pe.clusterPtrs,ge=pe.cues,Re=ee.slice(0);if(typeof he=="number"){var Pe=!1;Re.forEach(function(Ne){Ne.type==="f"&&Ne.name==="Duration"&&(Pe=!0,Ne.data=se(he,8))}),Pe||ue(Re,"Info",[{name:"Duration",type:"f",data:se(he,8)}])}Array.isArray(ge)&&ue(Re,"Cues",oe(ge,ae));var Ae=[];return Array.isArray(ye)&&(console.warn("append cluster pointers to seekhead is deprecated. please use cues"),Ae=K(ye,ae)),ue(Re,"SeekHead",Ae,!0),Re}function K(ee,ae){var pe=[];return ee.forEach(function(he){pe.push({name:"Seek",type:"m",isEnd:!1}),pe.push({name:"SeekID",type:"b",data:new b.Buffer([31,67,182,117])}),pe.push({name:"SeekPosition",type:"u",data:le(he+ae)}),pe.push({name:"Seek",type:"m",isEnd:!0})}),pe}function oe(ee,ae){var pe=[];return ee.forEach(function(he){var ye=he.CueTrack,ge=he.CueClusterPosition,Re=he.CueTime;pe.push({name:"CuePoint",type:"m",isEnd:!1}),pe.push({name:"CueTime",type:"u",data:le(Re)}),pe.push({name:"CueTrackPositions",type:"m",isEnd:!1}),pe.push({name:"CueTrack",type:"u",data:le(ye)}),pe.push({name:"CueClusterPosition",type:"u",data:le(ge+ae)}),pe.push({name:"CueTrackPositions",type:"m",isEnd:!0}),pe.push({name:"CuePoint",type:"m",isEnd:!0})}),pe}function ue(ee,ae,pe,he){he===void 0&&(he=!1);for(var ye=-1,ge=0;ge<ee.length;ge++){var Re=ee[ge];if(Re.type==="m"&&Re.name===ae&&Re.isEnd===!1){ye=ge;break}}ye>=0?Array.prototype.splice.apply(ee,[ye+1,0].concat(pe)):he?[].concat([{name:ae,type:"m",isEnd:!1}],pe,[{name:ae,type:"m",isEnd:!0}]).reverse().forEach(function(Pe){ee.unshift(Pe)}):(ee.push({name:ae,type:"m",isEnd:!1}),pe.forEach(function(Pe){ee.push(Pe)}),ee.push({name:ae,type:"m",isEnd:!0}))}function G(ee){return b.Buffer.concat(ee)}b.concat=G;function ie(ee){var ae=new b.Buffer(0);if(ee.type==="m")return ee;switch(ee.type){case"u":ae=le(ee.value);break;case"i":ae=re(ee.value);break;case"f":ae=se(ee.value);break;case"s":ae=new b.Buffer(ee.value,"ascii");break;case"8":ae=new b.Buffer(ee.value,"utf8");break;case"b":ae=ee.value;break;case"d":ae=new m.Int64BE(ee.value.getTime().toString()).toBuffer();break}return Object.assign({},ee,{data:ae})}b.encodeValueToBuffer=ie;function le(ee){for(var ae=1;ee>=Math.pow(2,8*ae);ae++);if(ae>=7)return console.warn("7bit or more bigger uint not supported."),new m.Uint64BE(ee).toBuffer();var pe=new b.Buffer(ae);return pe.writeUIntBE(ee,0,ae),pe}b.createUIntBuffer=le;function re(ee){for(var ae=1;ee>=Math.pow(2,8*ae);ae++);if(ae>=7)return console.warn("7bit or more bigger uint not supported."),new m.Int64BE(ee).toBuffer();var pe=new b.Buffer(ae);return pe.writeIntBE(ee,0,ae),pe}b.createIntBuffer=re;function se(ee,ae){if(ae===void 0&&(ae=8),ae===8){var pe=new b.Buffer(8);return pe.writeDoubleBE(ee,0),pe}else if(ae===4){var pe=new b.Buffer(4);return pe.writeFloatBE(ee,0),pe}else throw new Error("float type bits must 4bytes or 8bytes")}b.createFloatBuffer=se;function de(ee){return ee instanceof Date?ee:new Date(new Date("2001-01-01T00:00:00.000Z").getTime()+Number(ee)/1e3/1e3)}b.convertEBMLDateToJSDate=de})(tools)),tools}var hasRequiredEBMLDecoder;function requireEBMLDecoder(){if(hasRequiredEBMLDecoder)return EBMLDecoder;hasRequiredEBMLDecoder=1,Object.defineProperty(EBMLDecoder,"__esModule",{value:!0});var b=requireInt64Buffer(),m=requireTools(),u=requireTools(),T=requireEbmlID(),r;(function(e){e[e.STATE_TAG=1]="STATE_TAG",e[e.STATE_SIZE=2]="STATE_SIZE",e[e.STATE_CONTENT=3]="STATE_CONTENT"})(r||(r={}));var c=(function(){function e(){this._buffer=new m.Buffer(0),this._tag_stack=[],this._state=r.STATE_TAG,this._cursor=0,this._total=0,this._schema=T.byEbmlID,this._result=[]}return e.prototype.decode=function(t){this.readChunk(t);var i=this._result;return this._result=[],i},e.prototype.readChunk=function(t){for(this._buffer=u.concat([this._buffer,new m.Buffer(t)]);this._cursor<this._buffer.length&&!(this._state===r.STATE_TAG&&!this.readTag()||this._state===r.STATE_SIZE&&!this.readSize()||this._state===r.STATE_CONTENT&&!this.readContent()););},e.prototype.getSchemaInfo=function(t){return this._schema[t]||{name:"unknown",level:-1,type:"unknown",description:"unknown"}},e.prototype.readTag=function(){if(this._cursor>=this._buffer.length)return!1;var t=(0,m.readVint)(this._buffer,this._cursor);if(t==null)return!1;var i=this._buffer.slice(this._cursor,this._cursor+t.length),_=i.reduce(function(M,j,z,Q){return M+j*Math.pow(16,2*(Q.length-1-z))},0),I=this.getSchemaInfo(_),x={EBML_ID:_.toString(16),schema:I,type:I.type,name:I.name,level:I.level,tagStart:this._total,tagEnd:this._total+t.length,sizeStart:this._total+t.length,sizeEnd:null,dataStart:null,dataEnd:null,dataSize:null,data:null};return this._tag_stack.push(x),this._cursor+=t.length,this._total+=t.length,this._state=r.STATE_SIZE,!0},e.prototype.readSize=function(){if(this._cursor>=this._buffer.length)return!1;var t=(0,m.readVint)(this._buffer,this._cursor);if(t==null)return!1;var i=this._tag_stack[this._tag_stack.length-1];return i.sizeEnd=i.sizeStart+t.length,i.dataStart=i.sizeEnd,i.dataSize=t.value,t.value===-1?(i.dataEnd=-1,i.type==="m"&&(i.unknownSize=!0)):i.dataEnd=i.sizeEnd+t.value,this._cursor+=t.length,this._total+=t.length,this._state=r.STATE_CONTENT,!0},e.prototype.readContent=function(){var t=this._tag_stack[this._tag_stack.length-1];if(t.type==="m"){if(t.isEnd=!1,this._result.push(t),this._state=r.STATE_TAG,t.dataSize===0){var i=Object.assign({},t,{isEnd:!0});this._result.push(i),this._tag_stack.pop()}return!0}if(this._buffer.length<this._cursor+t.dataSize)return!1;var _=this._buffer.slice(this._cursor,this._cursor+t.dataSize);switch(this._buffer=this._buffer.slice(this._cursor+t.dataSize),t.data=_,t.type){case"u":t.value=_.readUIntBE(0,_.length);break;case"i":t.value=_.readIntBE(0,_.length);break;case"f":t.value=t.dataSize===4?_.readFloatBE(0):t.dataSize===8?_.readDoubleBE(0):(console.warn("cannot read ".concat(t.dataSize," octets float. failback to 0")),0);break;case"s":t.value=_.toString("ascii");break;case"8":t.value=_.toString("utf8");break;case"b":t.value=_;break;case"d":t.value=(0,m.convertEBMLDateToJSDate)(new b.Int64BE(_).toNumber());break}if(t.value===null)throw new Error("unknown tag type:"+t.type);for(this._result.push(t),this._total+=t.dataSize,this._state=r.STATE_TAG,this._cursor=0,this._tag_stack.pop();this._tag_stack.length>0;){var I=this._tag_stack[this._tag_stack.length-1];if(I.dataEnd<0)return this._tag_stack.pop(),!0;if(this._total<I.dataEnd)break;if(I.type!=="m")throw new Error("parent element is not master element");var i=Object.assign({},I,{isEnd:!0});this._result.push(i),this._tag_stack.pop()}return!0},e})();return EBMLDecoder.default=c,EBMLDecoder}var EBMLReader={},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var b=typeof Reflect=="object"?Reflect:null,m=b&&typeof b.apply=="function"?b.apply:function(ie,le,re){return Function.prototype.apply.call(ie,le,re)},u;b&&typeof b.ownKeys=="function"?u=b.ownKeys:Object.getOwnPropertySymbols?u=function(ie){return Object.getOwnPropertyNames(ie).concat(Object.getOwnPropertySymbols(ie))}:u=function(ie){return Object.getOwnPropertyNames(ie)};function T(G){console&&console.warn&&console.warn(G)}var r=Number.isNaN||function(ie){return ie!==ie};function c(){c.init.call(this)}events.exports=c,events.exports.once=K,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var e=10;function t(G){if(typeof G!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof G)}Object.defineProperty(c,"defaultMaxListeners",{enumerable:!0,get:function(){return e},set:function(G){if(typeof G!="number"||G<0||r(G))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+G+".");e=G}}),c.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},c.prototype.setMaxListeners=function(ie){if(typeof ie!="number"||ie<0||r(ie))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+ie+".");return this._maxListeners=ie,this};function i(G){return G._maxListeners===void 0?c.defaultMaxListeners:G._maxListeners}c.prototype.getMaxListeners=function(){return i(this)},c.prototype.emit=function(ie){for(var le=[],re=1;re<arguments.length;re++)le.push(arguments[re]);var se=ie==="error",de=this._events;if(de!==void 0)se=se&&de.error===void 0;else if(!se)return!1;if(se){var ee;if(le.length>0&&(ee=le[0]),ee instanceof Error)throw ee;var ae=new Error("Unhandled error."+(ee?" ("+ee.message+")":""));throw ae.context=ee,ae}var pe=de[ie];if(pe===void 0)return!1;if(typeof pe=="function")m(pe,this,le);else for(var he=pe.length,ye=z(pe,he),re=0;re<he;++re)m(ye[re],this,le);return!0};function _(G,ie,le,re){var se,de,ee;if(t(le),de=G._events,de===void 0?(de=G._events=Object.create(null),G._eventsCount=0):(de.newListener!==void 0&&(G.emit("newListener",ie,le.listener?le.listener:le),de=G._events),ee=de[ie]),ee===void 0)ee=de[ie]=le,++G._eventsCount;else if(typeof ee=="function"?ee=de[ie]=re?[le,ee]:[ee,le]:re?ee.unshift(le):ee.push(le),se=i(G),se>0&&ee.length>se&&!ee.warned){ee.warned=!0;var ae=new Error("Possible EventEmitter memory leak detected. "+ee.length+" "+String(ie)+" listeners added. Use emitter.setMaxListeners() to increase limit");ae.name="MaxListenersExceededWarning",ae.emitter=G,ae.type=ie,ae.count=ee.length,T(ae)}return G}c.prototype.addListener=function(ie,le){return _(this,ie,le,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function(ie,le){return _(this,ie,le,!0)};function I(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function x(G,ie,le){var re={fired:!1,wrapFn:void 0,target:G,type:ie,listener:le},se=I.bind(re);return se.listener=le,re.wrapFn=se,se}c.prototype.once=function(ie,le){return t(le),this.on(ie,x(this,ie,le)),this},c.prototype.prependOnceListener=function(ie,le){return t(le),this.prependListener(ie,x(this,ie,le)),this},c.prototype.removeListener=function(ie,le){var re,se,de,ee,ae;if(t(le),se=this._events,se===void 0)return this;if(re=se[ie],re===void 0)return this;if(re===le||re.listener===le)--this._eventsCount===0?this._events=Object.create(null):(delete se[ie],se.removeListener&&this.emit("removeListener",ie,re.listener||le));else if(typeof re!="function"){for(de=-1,ee=re.length-1;ee>=0;ee--)if(re[ee]===le||re[ee].listener===le){ae=re[ee].listener,de=ee;break}if(de<0)return this;de===0?re.shift():Q(re,de),re.length===1&&(se[ie]=re[0]),se.removeListener!==void 0&&this.emit("removeListener",ie,ae||le)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function(ie){var le,re,se;if(re=this._events,re===void 0)return this;if(re.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):re[ie]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete re[ie]),this;if(arguments.length===0){var de=Object.keys(re),ee;for(se=0;se<de.length;++se)ee=de[se],ee!=="removeListener"&&this.removeAllListeners(ee);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(le=re[ie],typeof le=="function")this.removeListener(ie,le);else if(le!==void 0)for(se=le.length-1;se>=0;se--)this.removeListener(ie,le[se]);return this};function M(G,ie,le){var re=G._events;if(re===void 0)return[];var se=re[ie];return se===void 0?[]:typeof se=="function"?le?[se.listener||se]:[se]:le?ne(se):z(se,se.length)}c.prototype.listeners=function(ie){return M(this,ie,!0)},c.prototype.rawListeners=function(ie){return M(this,ie,!1)},c.listenerCount=function(G,ie){return typeof G.listenerCount=="function"?G.listenerCount(ie):j.call(G,ie)},c.prototype.listenerCount=j;function j(G){var ie=this._events;if(ie!==void 0){var le=ie[G];if(typeof le=="function")return 1;if(le!==void 0)return le.length}return 0}c.prototype.eventNames=function(){return this._eventsCount>0?u(this._events):[]};function z(G,ie){for(var le=new Array(ie),re=0;re<ie;++re)le[re]=G[re];return le}function Q(G,ie){for(;ie+1<G.length;ie++)G[ie]=G[ie+1];G.pop()}function ne(G){for(var ie=new Array(G.length),le=0;le<ie.length;++le)ie[le]=G[le].listener||G[le];return ie}function K(G,ie){return new Promise(function(le,re){function se(ee){G.removeListener(ie,de),re(ee)}function de(){typeof G.removeListener=="function"&&G.removeListener("error",se),le([].slice.call(arguments))}ue(G,ie,de,{once:!0}),ie!=="error"&&oe(G,se,{once:!0})})}function oe(G,ie,le){typeof G.on=="function"&&ue(G,"error",ie,le)}function ue(G,ie,le,re){if(typeof G.on=="function")re.once?G.once(ie,le):G.on(ie,le);else if(typeof G.addEventListener=="function")G.addEventListener(ie,function se(de){re.once&&G.removeEventListener(ie,se),le(de)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof G)}return events.exports}var hasRequiredEBMLReader;function requireEBMLReader(){if(hasRequiredEBMLReader)return EBMLReader;hasRequiredEBMLReader=1;var b=EBMLReader&&EBMLReader.__extends||(function(){var r=function(c,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var _ in i)Object.prototype.hasOwnProperty.call(i,_)&&(t[_]=i[_])},r(c,e)};return function(c,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(c,e);function t(){this.constructor=c}c.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}})();Object.defineProperty(EBMLReader,"__esModule",{value:!0});var m=requireEvents(),u=requireTools(),T=(function(r){b(c,r);function c(){var e=r.call(this)||this;return e.logGroup="",e.hasLoggingStarted=!1,e.metadataloaded=!1,e.chunks=[],e.stack=[],e.segmentOffset=0,e.last2SimpleBlockVideoTrackTimecode=[0,0],e.last2SimpleBlockAudioTrackTimecode=[0,0],e.lastClusterTimecode=0,e.lastClusterPosition=0,e.timecodeScale=1e6,e.metadataSize=0,e.metadatas=[],e.cues=[],e.firstVideoBlockRead=!1,e.firstAudioBlockRead=!1,e.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null},e.trackTypes=[],e.trackDefaultDuration=[],e.trackCodecDelay=[],e.trackInfo={type:"nothing"},e.ended=!1,e.logging=!1,e.use_duration_every_simpleblock=!1,e.use_webp=!1,e.use_segment_info=!0,e.drop_default_duration=!0,e}return c.prototype.stop=function(){for(this.ended=!0,this.emit_segment_info();this.stack.length;)this.stack.pop(),this.logging&&console.groupEnd();this.logging&&this.hasLoggingStarted&&this.logGroup&&console.groupEnd()},c.prototype.emit_segment_info=function(){var e=this.chunks;if(this.chunks=[],this.metadataloaded){if(!this.use_segment_info)return;var _=this.lastClusterTimecode,I=this.duration,x=this.timecodeScale;this.emit("cluster",{timecode:_,data:e}),this.emit("duration",{timecodeScale:x,duration:I})}else{this.metadataloaded=!0,this.metadatas=e;var t=this.trackTypes.indexOf(1),i=this.trackTypes.indexOf(2);if(this.trackInfo=t>=0&&i>=0?{type:"both",trackNumber:t}:t>=0?{type:"video",trackNumber:t}:i>=0?{type:"audio",trackNumber:i}:{type:"nothing"},!this.use_segment_info)return;this.emit("metadata",{data:e,metadataSize:this.metadataSize})}},c.prototype.read=function(e){var t=this,i=!1;if(!this.ended){if(e.type==="m")if(e.isEnd)this.stack.pop();else{var _=this.stack[this.stack.length-1];if(_!=null&&_.level>=e.level){this.stack.pop(),this.logging&&console.groupEnd(),_.dataEnd=e.dataEnd,_.dataSize=e.dataEnd-_.dataStart,_.unknownSize=!1;var I=Object.assign({},_,{name:_.name,type:_.type,isEnd:!0});this.chunks.push(I)}this.stack.push(e)}if(e.type==="m"&&e.name=="Segment")this.segmentOffset!=0&&console.warn("Multiple segments detected!"),this.segmentOffset=e.dataStart,this.emit("segment_offset",this.segmentOffset);else if(e.type==="b"&&e.name==="SimpleBlock"){var x=u.ebmlBlock(e.data),M=x.timecode,j=x.trackNumber,z=x.frames;if(this.trackTypes[j]===1){if(!this.firstVideoBlockRead&&(this.firstVideoBlockRead=!0,this.trackInfo.type==="both"||this.trackInfo.type==="video")){var Q=this.lastClusterTimecode+M;this.cues.push({CueTrack:j,CueClusterPosition:this.lastClusterPosition,CueTime:Q}),this.emit("cue_info",{CueTrack:j,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:j,CueClusterPosition:this.lastClusterPosition,CueTime:Q})}this.last2SimpleBlockVideoTrackTimecode=[this.last2SimpleBlockVideoTrackTimecode[1],M]}else if(this.trackTypes[j]===2){if(!this.firstAudioBlockRead&&(this.firstAudioBlockRead=!0,this.trackInfo.type==="audio")){var Q=this.lastClusterTimecode+M;this.cues.push({CueTrack:j,CueClusterPosition:this.lastClusterPosition,CueTime:Q}),this.emit("cue_info",{CueTrack:j,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:j,CueClusterPosition:this.lastClusterPosition,CueTime:Q})}this.last2SimpleBlockAudioTrackTimecode=[this.last2SimpleBlockAudioTrackTimecode[1],M]}this.use_duration_every_simpleblock&&this.emit("duration",{timecodeScale:this.timecodeScale,duration:this.duration}),this.use_webp&&z.forEach(function(ne){var K=ne.slice(3,6).toString("hex");if(K==="9d012a"){var oe=u.VP8BitStreamToRiffWebPBuffer(ne),ue=new Blob([oe],{type:"image/webp"}),G=t.duration;t.emit("webp",{currentTime:G,webp:ue})}})}else e.type==="m"&&e.name==="Cluster"&&e.isEnd===!1?(this.firstVideoBlockRead=!1,this.firstAudioBlockRead=!1,this.emit_segment_info(),this.emit("cluster_ptr",e.tagStart),this.lastClusterPosition=e.tagStart):e.type==="u"&&e.name==="Timecode"?this.lastClusterTimecode=e.value:e.type==="u"&&e.name==="TimecodeScale"?this.timecodeScale=e.value:e.type==="m"&&e.name==="TrackEntry"?e.isEnd?(this.trackTypes[this.currentTrack.TrackNumber]=this.currentTrack.TrackType,this.trackDefaultDuration[this.currentTrack.TrackNumber]=this.currentTrack.DefaultDuration,this.trackCodecDelay[this.currentTrack.TrackNumber]=this.currentTrack.CodecDelay):this.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null}:e.type==="u"&&e.name==="TrackType"?this.currentTrack.TrackType=e.value:e.type==="u"&&e.name==="TrackNumber"?this.currentTrack.TrackNumber=e.value:e.type==="u"&&e.name==="CodecDelay"?this.currentTrack.CodecDelay=e.value:e.type==="u"&&e.name==="DefaultDuration"?this.drop_default_duration?(console.warn("DefaultDuration detected!, remove it"),i=!0):this.currentTrack.DefaultDuration=e.value:e.name==="unknown"&&console.warn(e);!this.metadataloaded&&e.dataEnd>0&&(this.metadataSize=e.dataEnd),i||this.chunks.push(e),this.logging&&this.put(e)}},Object.defineProperty(c.prototype,"duration",{get:function(){if(this.trackInfo.type==="nothing")return console.warn("no video, no audio track"),0;var e=0,t=0,i=0,_=this.trackDefaultDuration[this.trackInfo.trackNumber];if(typeof _=="number")e=_;else if(this.trackInfo.type==="both")if(this.last2SimpleBlockAudioTrackTimecode[1]>this.last2SimpleBlockVideoTrackTimecode[1]){e=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var I=this.trackCodecDelay[this.trackTypes.indexOf(2)];typeof I=="number"&&(t=I),i=this.last2SimpleBlockAudioTrackTimecode[1]}else{e=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var I=this.trackCodecDelay[this.trackTypes.indexOf(1)];typeof I=="number"&&(t=I),i=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="video"){e=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var I=this.trackCodecDelay[this.trackInfo.trackNumber];typeof I=="number"&&(t=I),i=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="audio"){e=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var I=this.trackCodecDelay[this.trackInfo.trackNumber];typeof I=="number"&&(t=I),i=this.last2SimpleBlockAudioTrackTimecode[1]}var x=(this.lastClusterTimecode+i)*this.timecodeScale+e-t,M=x/this.timecodeScale;return Math.floor(M)},enumerable:!1,configurable:!0}),c.prototype.addListener=function(e,t){return r.prototype.addListener.call(this,e,t)},c.prototype.put=function(e){this.hasLoggingStarted||(this.hasLoggingStarted=!0,this.logging&&this.logGroup&&console.groupCollapsed(this.logGroup)),e.type==="m"?e.isEnd?console.groupEnd():console.group(e.name+":"+e.tagStart):e.type==="b"?console.log(e.name,e.type):console.log(e.name,e.tagStart,e.type,e.value)},c})(m.EventEmitter);return EBMLReader.default=T,EBMLReader}var hasRequiredEbml;function requireEbml(){return hasRequiredEbml||(hasRequiredEbml=1,(function(b){var m=ebml&&ebml.__createBinding||(Object.create?(function(t,i,_,I){I===void 0&&(I=_),Object.defineProperty(t,I,{enumerable:!0,get:function(){return i[_]}})}):(function(t,i,_,I){I===void 0&&(I=_),t[I]=i[_]})),u=ebml&&ebml.__exportStar||function(t,i){for(var _ in t)_!=="default"&&!Object.prototype.hasOwnProperty.call(i,_)&&m(i,t,_)};Object.defineProperty(b,"__esModule",{value:!0}),b.tools=b.Reader=b.Encoder=b.Decoder=void 0,u(requireEBML(),b);var T=requireEBMLDecoder();b.Decoder=T.default;var r=requireEBMLEncoder();b.Encoder=r.default;var c=requireEBMLReader();b.Reader=c.default;var e=requireTools();b.tools=e})(ebml)),ebml}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var b=lib&&lib.__awaiter||function(r,c,e,t){function i(_){return _ instanceof e?_:new e(function(I){I(_)})}return new(e||(e=Promise))(function(_,I){function x(z){try{j(t.next(z))}catch(Q){I(Q)}}function M(z){try{j(t.throw(z))}catch(Q){I(Q)}}function j(z){z.done?_(z.value):i(z.value).then(x,M)}j((t=t.apply(r,c||[])).next())})},m=lib&&lib.__generator||function(r,c){var e={label:0,sent:function(){if(_[0]&1)throw _[1];return _[1]},trys:[],ops:[]},t,i,_,I;return I={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(I[Symbol.iterator]=function(){return this}),I;function x(j){return function(z){return M([j,z])}}function M(j){if(t)throw new TypeError("Generator is already executing.");for(;e;)try{if(t=1,i&&(_=j[0]&2?i.return:j[0]?i.throw||((_=i.return)&&_.call(i),0):i.next)&&!(_=_.call(i,j[1])).done)return _;switch(i=0,_&&(j=[j[0]&2,_.value]),j[0]){case 0:case 1:_=j;break;case 4:return e.label++,{value:j[1],done:!1};case 5:e.label++,i=j[1],j=[0];continue;case 7:j=e.ops.pop(),e.trys.pop();continue;default:if(_=e.trys,!(_=_.length>0&&_[_.length-1])&&(j[0]===6||j[0]===2)){e=0;continue}if(j[0]===3&&(!_||j[1]>_[0]&&j[1]<_[3])){e.label=j[1];break}if(j[0]===6&&e.label<_[1]){e.label=_[1],_=j;break}if(_&&e.label<_[2]){e.label=_[2],e.ops.push(j);break}_[2]&&e.ops.pop(),e.trys.pop();continue}j=c.call(r,e)}catch(z){j=[6,z],i=0}finally{t=_=0}if(j[0]&5)throw j[1];return{value:j[0]?j[1]:void 0,done:!0}}};Object.defineProperty(lib,"__esModule",{value:!0});var u=requireEbml();function T(r){return b(this,void 0,void 0,function(){var c,e,t,i,_,I,x,M,j,z,Q,ne;return m(this,function(K){switch(K.label){case 0:if(!r)throw Error("call to fixWebmDuration requires a blob");c=new u.Decoder,e=new u.Reader,t=r.stream(),i=t.getReader(),K.label=1;case 1:return[4,i.read()];case 2:return _=K.sent(),I=_.done,x=_.value,I?(e.stop(),[3,3]):(M=c.decode(x),M=M?.filter(function(oe){return oe.type!=="unknown"}),M.forEach(function(oe){e.read(oe)}),x=null,[3,1]);case 3:return j=u.tools.makeMetadataSeekable(e.metadatas,e.duration,e.cues),z=new Blob([j],{type:r.type}),Q=r.slice(e.metadataSize),ne=new Blob([z,Q],{type:r.type}),[2,ne]}})})}return lib.default=T,lib}var libExports=requireLib();const fixWebmDuration=getDefaultExportFromCjs(libExports);class StreamRecorder{#e;#r=!1;#o=!1;#c=0;#a=0;#t=0;#i=0;#n=0;onchange=m=>{};onDurationChange=m=>{};constructor(){}start=async(m="")=>{m||(m=`video_Record_${p$1(Date.now())}`);let u=[];return navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0}).then(T=>{const r=T.getTracks();for(const e of r)e.onended=()=>this.stop();this.#r=!0,this.#o=!1,this.#e=new MediaRecorder(T),this.#e.start();const c=new Date().getTime();this.#c=c,this.#t=c,this.#s(),this.#l(),this.#e.addEventListener("dataavailable",e=>{u.push(e.data)}),this.#e.addEventListener("stop",async()=>{this.#r=!1;const e=new Date().getTime();this.#a=e,this.#i+=e-this.#t,this.#s(),clearInterval(this.#n);const t=T.getTracks();for(const M of t)M.stop();if(this.#e===null)return;const i=new Blob(u,{type:this.#e.mimeType}),_=await fixWebmDuration(i),I=URL.createObjectURL(_),x=document.createElement("a");x.href=I,x.download=`${m}.mp4`,x.click(),URL.revokeObjectURL(I),u=[],this.#e=null})})};pause=async()=>{await new Promise(u=>setTimeout(()=>u(!0),300)),this.#e?.pause(),this.#o=!0;const m=new Date().getTime();this.#i+=m-this.#t,this.#s(),clearInterval(this.#n)};resume=async()=>{this.#e?.resume(),this.#o=!1;const m=new Date().getTime();this.#t=m,this.#s(),this.#l()};stop=async()=>{this.#e?.stop()};destroy=()=>{clearInterval(this.#n),this.#n=0,this.#r&&this.#e&&this.#e.stop()};getDuration=()=>{if(this.#t===0)return 0;let m=this.#i;const u=new Date().getTime();if(this.#r&&this.#o===!1){const T=u-this.#t;this.#t=u,m=m+T}return m};getInfo=()=>({active:this.#r,pause:this.#o,startTime:this.#c,endTime:this.#a,duration:this.#i});#s=()=>{const m=this.getInfo();this.onchange(m)};#l=()=>{clearInterval(this.#n),this.#n=window.setInterval(()=>{this.#i=this.getDuration(),this.onDurationChange(this.#i)},500)}}var l=Object.defineProperty,y=b=>{throw TypeError(b)},q=(b,m,u)=>m in b?l(b,m,{enumerable:!0,configurable:!0,writable:!0,value:u}):b[m]=u,s=(b,m,u)=>q(b,typeof m!="symbol"?m+"":m,u),P=(b,m,u)=>m.has(b)||y("Cannot "+u),n=(b,m,u)=>(P(b,m,"read from private field"),u?u.call(b):m.get(b)),a=(b,m,u)=>m.has(b)?y("Cannot add the same private member more than once"):m instanceof WeakSet?m.add(b):m.set(b,u),d,v,o;class p{constructor(m={}){s(this,"queue",[]),s(this,"timer",0),s(this,"activeIndex",0),s(this,"activePromise"),s(this,"options",{timeout:0}),s(this,"add",(u,T={})=>new Promise(async(r,c)=>{const e=T.timeout||this.options.timeout,t=T.key||n(this,d).call(this),i=T.describe||"";if(this.queue.findIndex(I=>I.key===t)!==-1)return c(`${t} is exist.`);const _={key:t,func:u,describe:i,timeout:e,resolve:r,reject:c};this.queue.unshift(_),this.activePromise||n(this,o).call(this)})),s(this,"clear",()=>{this.queue=[],this.activePromise=void 0,clearTimeout(this.timer)}),s(this,"retry",()=>{n(this,o).call(this)}),a(this,d,()=>(this.activeIndex=this.activeIndex+1,`${this.activeIndex}`)),a(this,v,u=>{const T=this.queue.findIndex(r=>r.key===u);this.queue.splice(T,1)}),a(this,o,async()=>{const u=this.queue.length;if(u===0)return;const T=u-1,r=this.queue[T];this.activePromise=r;const{key:c,func:e,resolve:t,reject:i,timeout:_}=this.activePromise;_&&(this.timer=window.setTimeout(()=>{i(`pr-async-queue: ${c} is timeout.`),n(this,o).call(this)},_)),await e().then(t).catch(i).finally(()=>{clearTimeout(this.timer),this.activePromise=void 0,n(this,v).call(this,c),n(this,o).call(this)})}),this.options={timeout:0,...m}}}d=new WeakMap,v=new WeakMap,o=new WeakMap;class AnimationFrame{_requestAnimationFrameId;_requestAnimationFrameItems=new Map;_lastInvokeTime=new Map;addRequestAnimationFrame=(m,u,T)=>{this._requestAnimationFrameId||this.init();const c=1e3/Math.max(1,Math.min(120,T?.fps??20));this._requestAnimationFrameItems.set(m,e=>{const t=e??performance.now(),i=this._lastInvokeTime.get(m)??0;t-i>=c&&(this._lastInvokeTime.set(m,t),u(e))})};clearRequestAnimationFrame=(m=[])=>{m.length===0&&(m=[...this._requestAnimationFrameItems.keys()]);for(const u of m)this._requestAnimationFrameItems.delete(u),this._lastInvokeTime.delete(u)};init=()=>{const m=u=>{const T=this._requestAnimationFrameItems.values();for(const r of T)r(u);if(this._requestAnimationFrameItems.size===0){this._requestAnimationFrameId=void 0;return}this._requestAnimationFrameId=requestAnimationFrame(m)};this._requestAnimationFrameId=requestAnimationFrame(m)};stop=()=>{this._requestAnimationFrameId!==void 0&&(cancelAnimationFrame(this._requestAnimationFrameId),this._requestAnimationFrameId=void 0)}}class Base{config=new Config$1;notifys=new Notifys;localMedias=new LocalMedias;intervalQueue=new W;asyncQueue=new p;traffic=new Traffic;recorder=new StreamRecorder;animationFrame=new AnimationFrame;users=new Users({config:this.config,localMedias:this.localMedias,notifys:this.notifys});cws=new CallsWebSocket({config:this.config});peer=new Peer({config:this.config,users:this.users});constructor(){this.cws.on.log=m=>this.notifys.emit("onLog",{code:200,desc:"Message log.",data:{message:m}}),this.intervalQueue.startQueue(),this.localMedias.on.devicechange=()=>this.notifys.emit("onDevicechange",{code:200,data:{},desc:"MediaDevice is change."})}use=({rnnoise:m})=>{m!==void 0&&this.users.localUser.streamControls.mc_audio?.use({rnnoise:m})};setRoomState=m=>{this.config.roomState!==m&&(this.config.roomState=m,m==="closed"&&(this.config.isInRoom=!1),this.notifys.emit("onRoomState",{code:200,desc:"RoomState is change.",data:{state:m}}))};setPeerState=m=>{this.config.peerState=m,this.notifys.emit("onPeerState",{code:200,desc:"PeerState is change.",data:{state:m}})};setCallStrategy=async(m,u=[])=>{u.length===0&&(u=mediaType_keys);let T="balanced";switch(m){case"qualityPriority":T="maintain-resolution";break;case"fluencyPriority":T="maintain-framerate";break;case"balancedDowngrade":T="balanced";break}await this.peer.setRTCRtpSenderParameters({degradationPreference:T},u);const r=this.users.remoteUsers.values();for(const c of r)c.p2p?.setRTCRtpSenderParameters({degradationPreference:T},u)};_checkUserStreamOrigin=({p2pAverageQuality:m,sfuAverageQuality:u})=>m-(u+this.config.sfuPriority)>=0?"p2p":"sfu";_reportP2PConnect=(m,u)=>{if(this.cws.hasEvent("reportP2PConnectEx"))return;let T;switch(m){case"success":T=0;break;case"fail":T=1;break;case"ignore":T=2;break;case"disconnect":T=3;break;case"poor_network":T=4;break}const{mediaTypes:r,...c}=u,e=[];for(const i of r){const _=mediaType_keys.findIndex(I=>I===i);e.push(_)}return this.cws.createRequest("reportP2PConnectEx").send({data:{...c,code:T,types:e}})};_reportLog=(m,u="未知错误")=>{const{appid:T,userId:r,earlyId:c="",logUrl:e,reportErr:t}=this.config;if(this.notifys.emit("onLog",{code:0,desc:u,data:{type:m}}),!t||!this.config.logUrl)return;const i="web",I=(x=>({ws_c_timeout:0,webrtc_c_timeout:1,join_room_error:2,publish_error:3,subscribe_error:4,close_track_error:5,heartbeat_e_timeout:6,heartbeat_i_timeout:7,quit_room_error:8})[x].toString())(m);{const x={origin:i,type:I,app_id:T,user_id:r,ins_id:c,desc:u},M=btoa(encodeURI(JSON.stringify(x))),j=`${e}/upload/log?log_key=${M}`;{const z=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),ne=new TextEncoder().encode(z),K=pako.deflate(ne,{gzip:!0});this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLog",{obj:x,url:j,size:at(K.byteLength)}),fetch(j,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:K}).catch(()=>{this.config.debug===!0&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLog is error.",{obj:x,url:j,size:at(K.byteLength)})})}}}}class ActionBase{base;constructor({base:m}){this.base=m,this.base.cws.on.onJoinRoom=u=>{const{roomId:T}=u.data;if(T!==this.base.config.roomId){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: The received message does not belong to the current room.",u);return}this.base.users.initUsers([u.data.user]),this.base.users.emitUsersChange(),this.base.notifys.emit("onJoinRoom",u)},this.base.cws.on.onJoinRoomBatch=u=>{const{roomId:T}=u.data;if(T!==this.base.config.roomId){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: The received message does not belong to the current room.",u);return}this.base.users.initUsers(u.data.users),this.base.users.emitUsersChange()},this.base.cws.on.onUpdateCall=u=>{const{id:T,callAction:r}=u.data.user,c=this.base.users.getRemoteUserContent(T);c&&(c.updateCallAction(r),this.base.users.emitUsersChange())},this.base.cws.on.onRoomUserSpeech=u=>{this.base.notifys.emit("onRoomUserSpeech",u)},this.base.cws.on.onBeforeTokenExpire=u=>{this.base.notifys.emit("onBeforeTokenExpire",u)},this.base.cws.on.onTokenExpired=u=>{this.base.notifys.emit("onTokenExpired",u)},this.base.cws.on.onCDNPlayUrlAdd=u=>{this.base.notifys.emit("onCDNPlayUrlAdd",u)},this.base.cws.on.onNetQuality=u=>{const{qualities:T=[]}=u.data;let r=!1;for(const c of T){const{userId:e,egress:t,ingress:i}=c,_=this.base.users.getRemoteUserContent(e);if(!_)continue;_.updateNetwork({egress:t,ingress:i})===!1&&(r=!0)}r&&this.base.users.emitUsersChange()}}_debugger=async()=>{await this.base.cws.createRequest("debugger",{onBack:!1}).send({data:{}})};_ai=async()=>{await this.base.cws.createRequest("ai",{onBack:!1}).send({data:{}})}}const g=(b,m)=>{if(!(b!=null&&b.ip)||!(b!=null&&b.port)||!(b!=null&&b.serve_ip)||!(b!=null&&b.serve_port)||!(m!=null&&m.ip)||!(m!=null&&m.port)||!(m!=null&&m.serve_ip)||!(m!=null&&m.serve_port))return"Unknown";const[u,T]=[b.ip,b.port],[r,c]=[b.serve_ip,b.serve_port],[e,t]=[m.ip,m.port],[i,_]=[m.serve_ip,m.serve_port];return u===e&&T===t?"Full Cone":u===r&&(e!==r||t!==T)||e===i&&(u!==i||T!==t)?"Restricted Cone":u===r&&T===c&&(e!==r||t!==c)||e===i&&t===_&&(u!==i||T!==_)?"Port Restricted Cone":"Symmetric"},h=async()=>{const b="stun.cloudflare.com:3478",m="stun.l.google.com:19302",u=async T=>new Promise(r=>{const c=new RTCPeerConnection({iceServers:[{urls:`stun:${T}`}]});c.createDataChannel("ice-channel");let e=null;c.onicecandidate=t=>{var i,_;if(((i=t.candidate)==null?void 0:i.type)==="srflx"){const[I,x]=T.split(":").map(M=>M.trim());e={ip:t.candidate.address||"",port:(_=t.candidate.port)==null?void 0:_.toString(),serve_ip:I,serve_port:x},c.close(),r(e)}},setTimeout(()=>{c.close(),r(null)},5e3),c.createOffer().then(t=>c.setLocalDescription(t)).catch(()=>r(null))});try{const T=await u(b),r=await u(m);if(!T||!r)return{address:"",natType:"Unknown"};const c=g(T,r);return{address:T.ip||"",natType:c}}catch(T){return console.error("获取NAT类型失败:",T),{address:"",natType:"Unknown"}}};class PublisherController{mediaTypes={};_timeout=300;_timer;_promise;_resolve;_reject;exe=async()=>{};add=m=>{for(const u of m)this.mediaTypes[u]=!0;return clearTimeout(this._timer),this._timer=setTimeout(async()=>{try{await this.exe(),this._resolve&&this._resolve(!0),this._promise=void 0}catch(u){this._reject&&this._reject(u),this._promise=void 0}for(const u of mediaType_keys)this.mediaTypes[u]=void 0},this._timeout),this._promise||(this._promise=new Promise((u,T)=>{this._resolve=u,this._reject=T})),this._promise};clear=()=>{clearTimeout(this._timer),this._timer=void 0;const m=this._reject;this._resolve=void 0,this._reject=void 0,this._promise=void 0;for(const u of mediaType_keys)this.mediaTypes[u]=void 0;m&&m("Publish cleared")};getMediaTypes=()=>{const m=[];for(const u of mediaType_keys)this.mediaTypes[u]===!0&&m.push(u);return m}}class ActionSFU{base;_onOnline;_reconnectTimerId;_isRestorePeer=!1;_networkCalculating=!1;_lastTrackAnalysisWarnTime=0;_publisherController=new PublisherController;_restorePeerPromise;_syncRoomPromise;_quitRoomPromise;constructor({base:m}){this.base=m,this.base.cws.on.state=u=>{switch(u){case"connecting":case"reconnecting":this.base.setRoomState("connecting");break;case"connected":this.base.setRoomState("connected"),this.base.config.isInRoom===!0&&this._restorePeer().catch(()=>this._clear());break;case"closed":this._clear();break}},this.base.peer.on.state=u=>{switch(u){case"failed":case"closed":this._restorePeer();break;default:this.base.setPeerState(u);break}},this.base.cws.on.onQuitRoom=u=>{const{id:T}=u.data.user;this._onRemoteUsersQuitRoom([T]).length!==0&&this.base.notifys.emit("onQuitRoom",u)},this.base.cws.on.onQuitRoomBatch=u=>{const T=Array.from(u.data.users,r=>r.userId);this._onRemoteUsersQuitRoom(T)},this.base.cws.on.onPublish=u=>{const{roomId:T}=u.data;if(T!==this.base.config.roomId){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: The received message does not belong to the current room.",u);return}const{id:r,callAction:c,tracks:e}=u.data.user,t=this.base.users.getRemoteUserContent(r);if(!t)return;const i=[],_=[];for(const I of e){const{type:x}=I,M=mediaType_keys[x];_.push(M);const j=t.getTrack(M);j&&j.msid&&i.push(j)}if(t.updateTracks(e),t.updateCallAction(c),this.base.config.newPublishAutoSubscribe)this.subscribe([{userId:r,mediaTypes:_}]);else if(i.length!==0){const I=Array.from(i,x=>x.mediaType);this.subscribe([{userId:r,mediaTypes:I}])}else this.base.users.emitUsersChange();this.base.notifys.emit("onPublish",u),i.length!==0&&this._closeTrack(i).catch(()=>this._restorePeer())},this.base.cws.on.onCloseTrack=u=>{const{id:T,callAction:r,tracks:c}=u.data.user,e=this.base.users.getRemoteUserContent(T);if(!e)return;e.updateCallAction(r);const t=Array.from(c,({type:i})=>mediaType_keys[i]);this.stopSubscribe([{userId:T,mediaTypes:t}]).catch(()=>this._restorePeer()),e.removeTracks(t)},this.base.cws.on.onTrackInactive=u=>{const{session:T,tracks:r=[]}=u.data;if(T!==this.base.config.callSession)return this._restorePeer();const c=this.base.users.localUser,e=[];for(const t of r){const{type:i,trackName:_}=t,I=mediaType_keys[i],x=c.getTrack(I);x&&x.trackName===_&&e.push(x)}if(e.length!==0){const t=Array.from(e,i=>i.mediaType);c.setTracksPublished(t,!1),this.base.peer.stopSenders(t),this._closeTrack(e).then(()=>this.publish(t)).catch(()=>this._restorePeer())}},this.base.cws.on.onUpdatePermissions=u=>{const{user:T}=u.data,{id:r,permissions:c=1}=T;c===1?this.base.users.localUser.id===r?(this.base.users.localUser.updatePermissions(c),this.pauseTracks(["mc_audio","mc_video"],!0)):this.base.users.removeRemoteUser(r):c===3&&this.base.users.initUsers([T]),this.base.users.emitUsersChange()},this.base.cws.on.onUpdatePermissionsBatch=u=>{const{users:T}=u.data;for(const r of T){const{id:c,permissions:e}=r,t=this.base.users.getUserContent(c);t&&t.updatePermissions(e)}this.base.users.emitUsersChange()},this.base.cws.on.onUpdateBehavior=u=>{const{users:T}=u.data;for(const t of T){const{id:i,behavior:_}=t,I=this.base.users.getUserContent(i);I&&I.updateBanBehavior(_)}const r=[],{banBehaviorMap:c,isAdmin:e}=this.base.users.localUser;if(e===!1)for(const t of mediaType_keys)c[t]!==!1&&r.push(t);r.length!==0?this.pauseTracks(r,!0):this.base.users.emitUsersChange()},this.base.cws.on.onRoomActionChange=u=>{if(this.base.config.updateRoomAction(u.data.roomAction||0),this.base.users.localUser.isAdmin===!1){const e=[];for(const t of mediaType_keys)this.base.config.banActionMap[t]!==!1&&e.push(t);e.length!==0&&this.pauseTracks(e,!0)}const{banAction:T,banActionStr:r,banActionMap:c}=this.base.config;this.base.notifys.emit("onRoomActionChange",{code:200,desc:"RoomAction is Change.",data:{serverAction:u.data.serverAction,banAction:T,banActionStr:r,banActionMap:c}})},this.base.cws.on.onMeetSpecialRolesChange=u=>{const{meetSpecialRoles:T,users:r}=u.data;this.base.users.updateUsersIsAdmin(T?.admin||[]);for(const c of r){const{id:e,permissions:t}=c;this.base.users.remoteUsers.get(e)?.updatePermissions(t)}this.base.users.localUser.isAdmin===!0&&(this._createTrack(["mc_audio","mc_video"]),this._pubNotify(["mc_audio","mc_video"])),this.base.users.emitUsersChange()},this._onOnline=()=>this._reportNetwork(),window.addEventListener("online",this._onOnline)}setLocalStream=(m,u)=>new Promise(async(T,r)=>{try{if(this.base.users.localUser.usePhoneyStream(m),u){if(m.includes("mc_audio")&&m.includes("mc_video")?await this.base.localMedias.initLocalStreamTrack("mc"):m.includes("mc_audio")?await this.base.localMedias.initLocalStreamTrack("mc_audio"):m.includes("mc_video")&&await this.base.localMedias.initLocalStreamTrack("mc_video"),m.includes("ss_audio")&&m.includes("ss_video")?await this.base.localMedias.initLocalStreamTrack("ss"):m.includes("ss_audio")&&!m.includes("ss_video")?await this.base.localMedias.initLocalStreamTrack("ss_audio"):m.includes("ss_video")&&!m.includes("ss_audio")&&await this.base.localMedias.initLocalStreamTrack("ss_video"),m.includes("ss_audio")){const c=this.base.users.localMedias.getLocalStreamTrack("ss_audio");c&&(c.onended=()=>this.stopPublish(["ss_audio","ss_video"]))}if(m.includes("ss_video")){const c=this.base.users.localMedias.getLocalStreamTrack("ss_video");c&&(c.onended=()=>this.stopPublish(["ss_audio","ss_video"]))}this.base.users.localUser.useLocalStream(m)}else for(const c of m)this.base.localMedias.stopLocalStreamTrack(c);this.base.peer.syncSenderStreamTrack(m),T(!0)}catch(c){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: error",c),r(c)}});setMediaDeviceKind=(m,u)=>new Promise(async(T,r)=>{try{await this.base.users.localMedias.setMediaDeviceKind(m,u);const c=this.base.users.localUser;switch(m){case"audioinput":c.usePhoneyStream(["mc_audio"]),!!this.base.localMedias.getLocalStreamTrack("mc_audio")===!0&&(await this.base.localMedias.initLocalStreamTrack("mc_audio"),c.useLocalStream(["mc_audio"])),this.base.peer.syncSenderStreamTrack(["mc_audio"]),this.base.users.syncRemoteUserP2PSenderStreamTrack(["mc_audio"]);break;case"videoinput":c.usePhoneyStream(["mc_video"]),!!this.base.localMedias.getLocalStreamTrack("mc_video")===!0&&(await this.base.localMedias.initLocalStreamTrack("mc_video"),c.useLocalStream(["mc_video"])),this.base.peer.syncSenderStreamTrack(["mc_video"]),this.base.users.syncRemoteUserP2PSenderStreamTrack(["mc_video"]);break;case"audiooutput":await this.base.users.localMedias.changeAudiooutput();break}T(!0)}catch(c){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: error",c),r(c)}});setMediaTrackConstraints=async(m,u)=>{this.base.localMedias.setMediaTrackConstraints(m,u),this.base.users.localMedias.isOpenMediaDevice(m)&&["mc_video"].includes(m)&&await this.setLocalStream([m],!0)};earlyConnect=(m=[])=>new Promise(async(u,T)=>{try{m.length===0&&(m=["mc_audio","mc_video"]),this.base.config.isEarly=!0,await this._connectCws(),this._initHeartbeat("heartbeatEx"),await this._connectCF(!0),this._createTrack(m),u(!0)}catch(r){this.base._reportLog("ws_c_timeout",r.msg||r),T(r)}});joinRoom=async m=>(this._quitRoomPromise&&await this._quitRoomPromise,new Promise(async(u,T)=>{try{this.base.config.setOptions(m),this.base.users.localUser.id=m.userId,this.base.traffic.clear(),this.base.users.remoteUsers.clear(),this.base.users.localUser.setTracksPublished(mediaType_keys,!1),this._publisherController.clear();const{userId:r,callType:c,sdkToken:e,roomId:t,stt:i=!1,lang:_,isEarly:I}=this.base.config;(I===!1||!this.base.cws.prws.ws||[2,3].includes(this.base.cws.prws.ws?.readyState))&&await this._connectCws();{const G=this.base.peer.checkSendersCreatedTime();this._createTrack(G)}const{input:x="zh",output:M="zh",translateEnable:j=!1}=_||{},z=this.base.cws.createRequest(I?"joinRoomEx":"joinRoom"),Q=bt(32,10),ne=await z.send({data:{msg:Q,msgId:Q,callType:c,roomId:t,user:{id:r,tracks:[],callAction:0},token:e,stt:i,lang:{input:x,output:M,translateEnable:j}}}),{code:K=0,desc:oe="服务器繁忙",data:ue}=ne;if(K!==200)throw new Error(oe);if(ue.roomId!==t)return T("加入的房间不匹配");if(this.base.config.isInRoom=!0,this._initHeartbeat("heartbeat"),this.base.users.initUsers(ue.roomUsers||[]),ue?.meetSpecialRoles?.creator){const G=this.base.users.getUserContent(ue?.meetSpecialRoles?.creator);G&&(G.isOwner=!0)}this.base.config.updateRoomAction(ue.roomAction||0),this.base.users.updateUsersIsAdmin(ue?.meetSpecialRoles?.admin||[]),this.base.users.emitUsersChange(),this.base.cws.hasEvent("connectCF")||await this._connectCF(),await this.base.peer.waitings.peerConnected(),u(Q)}catch(r){T(r)}}));publish=async m=>{if(m.length===0)throw new Error('Publish is error: The "mediaTypes" field cannot be left blank.');m.includes("ss_audio")&&!m.includes("ss_video")&&m.push("ss_video");const u=this.base.users.localUser;if(u.hasPermissions("publish")===!1)throw new Error("No permission.");return this._publisherController.exe=async()=>{const T=this._publisherController.getMediaTypes();await this._createTrack(T);const r=this.base.peer.getSenderUserTracks(T);u.updateTracks(r),await this._notifySelfCallAction();{const{invalid_mediaTypes:t}=this.base.localMedias.checkLocalStreamTracks(T);t.length!==0&&await this.setLocalStream(T,!0)}u.checkBanBehavior(T)===!1&&await this.pauseTracks(T,!0);const{valid_mediaTypes:e}=this.base.localMedias.checkLocalStreamTracks(T);if(e.length!==0)await this._pubNotify(e);else throw new Error("No effective track.");this.base.users.emitUsersChange()},this._publisherController.add(m)};stopPublish=m=>new Promise(async(u,T)=>{try{const r=this.base.users.localUser;r.setTracksPublished(m,!1),this.base.peer.stopSenders(m);const c=r.removeTracks(m);if(c.length===0)return u(!0);await this._closeTrack(c),await this._notifySelfCallAction(),await this.setLocalStream(m,!1),this.base.users.emitUsersChange(),u(!0)}catch(r){this.base._reportLog("close_track_error",r.message||r),T(r)}});pauseTracks=async(m,u)=>new Promise(async(T,r)=>{try{const c=this.base.users.localUser;if(u===!1){if(c.hasPermissions("publish")===!1)return r("No permission.");if(c.checkBanBehavior(m)===!1)return r("Not permitted.");c.useLocalStream(m)}else c.usePhoneyStream(m);this.base.users.syncRemoteUserP2PSenderStreamTrack(m),this.base.peer.syncSenderStreamTrack(m),await this._notifySelfCallAction(),this.base.users.emitUsersChange(),T(!0)}catch(c){r(c)}});subscribe=m=>{if(m===void 0){m=[];const r=this.base.users.remoteUsers.keys();for(const c of r)m.push({userId:c,mediaTypes:mediaType_keys})}const u=[];for(const r of m){const{userId:c,mediaTypes:e}=r,t=this.base.users.getRemoteUserContent(c);if(!t)continue;const i=[];for(const _ of e)t.tracks[_]?.origin==="sfu"&&i.push(_);i.length!==0&&u.push({userId:c,mediaTypes:i})}u.length!==0&&this.stopSubscribe(u);const T=()=>new Promise(async(r,c)=>{try{if(m.length===0)return r(!0);await this.base.peer.waitings.peerConnected(),this.base.users.addRemoteUsersSubscribes(m);const e=async()=>{const i=this.base.users.executeRemoteUsersSubscribes();if(i.length===0)return!0;let _=!1;const x=await this.base.cws.createRequest("subscribe").send({data:{session:this.base.config.callSession,users:i}}),{code:M=0,sn:j,data:z={}}=x;if(await this._ackMsg(j),M===200){const{remoteSdp:Q,users:ne}=z;if(Q){const oe=new RTCSessionDescription({type:"offer",sdp:Q});await this.base.peer.setRemoteDescription(oe),await this._renegotiate()}if(!ne)throw new Error("The subscription was successful but the correct subscription object was not returned.");let K=0;for(const oe of ne){const{id:ue,tracks:G}=oe;if(!ue||!G)continue;const ie=this.base.users.getRemoteUserContent(ue);for(const le of G){const{code:re=0,type:se,mid:de,trackName:ee}=le;switch(re){case 200:{const ae=mediaType_keys[se],pe={type:se,mid:de,trackName:ee,mediaType:ae};ie?.updateTracks([pe]),ie?.completedSubscribe([ae]),ie?.useRemoteStream([ae],this.base.peer)}break;case 2026:{const ae=mediaType_keys[se];ie?.setPublishWaiting([ae])}break;default:K+=1;break}}}K===0&&(_=!0),this.base.users.emitUsersChange()}else if(M===2026){const Q=m||[];for(const ne of Q){const{userId:K,mediaTypes:oe}=ne;this.base.users.getRemoteUserContent(K)?.setPublishWaiting(oe)}}return _};await e()===!1&&(this.base.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: The failed track will be resubscribed after 4 seconds."),await new Promise(i=>setTimeout(()=>i(!0),1e3*4)),await e()),r(!0)}catch(e){this.base._reportLog("subscribe_error",e.message||e),c(e)}});return this.base.asyncQueue.add(T,{describe:"subscribe"})};stopSubscribe=m=>new Promise(async(u,T)=>{try{if(m===void 0){m=[];const c=this.base.users.remoteUsers.keys();for(const e of c)m.push({userId:e,mediaTypes:mediaType_keys})}if(m.length===0)return u(!0);const r=[];for(const c of m){const{userId:e,mediaTypes:t}=c,i=this.base.users.getRemoteUserContent(e);if(!i)continue;const _=[];for(const I of t){const x=i.getTrack(I);x&&(x.origin==="sfu"&&x.msid?(r.push(x),i.usePhoneyStream([I])):x.origin==="p2p"&&i.p2p?.activeRecv[I]!==void 0&&_.push(I))}_.length!==0&&(i.p2p?.setRecvTracksEnabled(_,!1),i.usePhoneyStream(_),this.base._reportP2PConnect("disconnect",{desc:"Take the initiative to disconnect.",pushId:i.id,pullId:this.base.config.userId,mediaTypes:_}))}r.length!==0&&await this._closeTrack(r),this.base.users.emitUsersChange(),u(!0)}catch(r){this.base._reportLog("close_track_error",r.message||r),T(r)}});quitRoom=()=>new Promise(async m=>{const{roomId:u,userId:T,isInRoom:r}=this.base.config,c=bt(32,10),e=async()=>{if(r===!1)return m(c);this.base.config.isInRoom=!1,this.base.intervalQueue.removeQueueItem(["heartbeat-interval","peerAnalysis"]),await this.base.cws.createRequest("quitRoom",{onBack:!1}).send({data:{roomId:u,userId:T,msgId:c,msg:c}})};try{await $t(e,{message:"quitRoom timeout.",timeout:2*1e3})}catch{}this._clear(),this.base.setRoomState("ready"),m(c)});quitRoomEx=()=>{const m=bt(32,10);return this._quitRoomPromise||(this._quitRoomPromise=new Promise(async(u,T)=>{try{const{roomId:r,userId:c,isInRoom:e}=this.base.config;if(e===!1)return u(m);this.base.config.isInRoom=!1,this._publisherController.clear(),this._initHeartbeat("heartbeatEx"),await this.setLocalStream(mediaType_keys,!1),await this.base.cws.createRequest("quitRoomEx").send({data:{roomId:r,userId:c,msgId:m,msg:m}}),await this.stopSubscribe(),await this.stopPublish(["ss_audio","ss_video"]),this.base.users.clearUsers(),this.base.setRoomState("ready"),u(m)}catch(r){this._clear(),this.base._reportLog("quit_room_error",r.message||r),console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: StopSubscribe is error at quitRoomEx. start init earlyConnect.",r),this.earlyConnect(),T(r)}}).finally(()=>{this._quitRoomPromise=void 0})),m};setBanBehaviors=m=>new Promise(async(u,T)=>{try{const{roomId:r}=this.base.config,c=[];for(const I of m){const{id:x,banBehaviors:M}=I,j=Object.keys(M);if(j.length===0)continue;const z=[];for(const ne of j){const K=mediaType_keys.findIndex(G=>G===ne),oe=M[ne],ue={type:K,behavior:oe};z.push(ue)}const Q={id:x,behaviors:z};c.push(Q)}const t=await this.base.cws.createRequest("preventUsersBehavior").send({data:{roomId:r,users:c}}),{code:i=0,desc:_}=t;if(i!==200)return T(_);u(t)}catch(r){T(r)}});toggleRoomSpeechLang=m=>{this.base.config.isInRoom===!0&&this.base.cws.createRequest("toggleRoomSpeechLang").send({data:m})};updateSimulcast=async m=>{const u=this.base.users.remoteUsers.values(),T=[];for(const c of u){const{id:e,tracks:t}=c,i=[];for(const _ of mediaType_keys){if(!["mc_video","ss_video"].includes(_))continue;const I=t[_];if(!I)continue;const x={...I,simulcast:m};i.push(x)}i.length!==0&&T.push({id:e,tracks:i})}if(T.length===0)return;this.base.cws.createRequest("updateSimulcast").send({data:{session:this.base.config.callSession,users:T}})};updateToken=m=>{this.base.config.isInRoom===!0&&this.base.cws.createRequest("updateRoomToken").send({data:{roomId:this.base.config.roomId,sdkToken:m}})};destroy=()=>{this.base.config.debug===!0&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [Destroy]"),this.base.config.isInRoom===!0&&(this.base.config.isEarly===!0?this.quitRoomEx():this.quitRoom()),this._clear(),this._reconnectTimerId&&(clearTimeout(this._reconnectTimerId),this._reconnectTimerId=void 0),this._onOnline&&(window.removeEventListener("online",this._onOnline),this._onOnline=void 0),this.base.localMedias.destroy(),this.base.recorder.destroy(),this.base.notifys.emit("onDestroyRoom",{code:200,desc:"Is destroy.",data:{}})};_clear=()=>{this.base.setRoomState("closed"),this.base.config.roomId="",this.base.cws.clearEvents(),this.base.cws.close(),this.base.peer.close(),this.base.intervalQueue.removeQueueItem(["heartbeat-interval","peerAnalysis"]),this.base.asyncQueue.clear(),this.base.users.clearUsers(),this.setLocalStream(mediaType_keys,!1),this._publisherController.clear(),this.base.animationFrame.stop()};_connectCws=async()=>{this.base.setRoomState("connecting"),await this.base.cws.connect()};_initHeartbeat=m=>{if(this.base.intervalQueue.removeQueueItem(["heartbeat-interval"]),m==="heartbeat"){const u=()=>{if(this.base.cws.prws.ws?.readyState!==1)return;if(this.base.cws.needRestoreRoom()===!0)return this._restoreRoom();const r=this.base.cws.createRequest(m,{onBack:!1}),c=this.base.traffic.getUse("kb"),{outboundBytes:e,inboundBytes:t}=c.sfu,{outboundBytes:i,inboundBytes:_}=c.p2p,I={sfuPush:e,sfuPull:t,p2pPush:i,p2pPull:_};r.send({data:I})};this.base.intervalQueue.addQueueItem({key:"heartbeat-interval",func:u,interval:1e3*10})}else{const u=()=>{if(this.base.cws.prws.ws?.readyState!==1)return;const T=this.base.cws.createRequest(m,{onBack:!1}),r={};T.send({data:r})};this.base.intervalQueue.addQueueItem({key:"heartbeat-interval",func:u,interval:1e3*30})}};_connectCF=async(m=!1)=>{if(m===!1&&["connecting","connected"].includes(this.base.peer.pc.connectionState))return;await this.base.peer.init(),this.base.users.localUser.setTracksPublished(mediaType_keys,!1);let u;u=await this.base.cws.createRequest("connectCF").send({compress:!0,data:{sdp:this.base.peer.getSdp()}});const{code:T=0,desc:r,data:c,sn:e}=u;if(await this._ackMsg(e),T!==200)throw new Error(r);const{remoteSdp:t,session:i}=c;this.base.config.callSession=i||"";const _=t||"";await this.base.peer.setRemoteDescription({type:"answer",sdp:_}),await $t(this.base.peer.waitings.peerConnected,{message:"ice connect is timeout.",timeout:10*1e3}),this._reportNetwork(),this.base.intervalQueue.addQueueItem({key:"peerAnalysis",func:this._calculateNetwork,interval:1e3})};_reportNetwork=async()=>{try{let m=0;const{address:u,natType:T}=await h();switch(T){case"Symmetric":m=0;break;case"Full Cone":m=1;break;case"Port Restricted Cone":m=2;break;case"Restricted Cone":m=3;break}let r=0;{const e=isMobile(),i=(navigator.connection||navigator.mozConnection||navigator.webkitConnection).effectiveType;e||(["wifi","4g"].includes(i)?r=0:r=2),e&&(["wifi"].includes(i)?r=0:r=2)}await this.base.cws.createRequest("reportNetwork").send({data:{nat:m,type:r,ip:u}})}catch(m){this.base.config.debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [reportNetwork]",m)}};_createTrack=m=>{const u=()=>new Promise(async(T,r)=>{try{await this.base.peer.waitings.peerConnected();const c=await this.base.peer.addSenders(m),e=this.base.peer.getSenderUserTracks(c);if(e.length===0)return T(!0);const t=this.base.peer.getSdp(),i=this.base.cws.createRequest("publish");let _=await i.send({compress:!0,data:{session:this.base.config.callSession,sdp:t,tracks:e,callAction:0}});const{code:I=0,sn:x}=_;if(await this._ackMsg(x),I===2116){await this._connectCF(),await this.base.peer.waitings.peerConnected(),_=await i.send({compress:!0,data:{session:this.base.config.callSession,sdp:t,tracks:e,callAction:0}});const{sn:M}=_;await this._ackMsg(M)}{const{code:M=0,desc:j,data:z={}}=_;if(M!==200)throw new Error(j);const{remoteSdp:Q}=z;await this.base.peer.setRemoteDescription({type:"answer",sdp:Q||""})}T(!0)}catch(c){this.base._reportLog("publish_error",c.message||c),r(c)}});return this.base.asyncQueue.add(u,{describe:"createTrack"})};_closeTrack=(m=[])=>{const u=()=>new Promise(async(T,r)=>{if(m.length===0)return T(!0);try{await this.base.peer.createOffer();const e=await this.base.cws.createRequest("closeTrack").send({compress:!0,data:{roomId:this.base.config.roomId,sdp:this.base.peer.getSdp(),tracks:m}}),{code:t=0,desc:i,data:_={}}=e;if(t!==200)throw new Error(i);await this.base.peer.setRemoteDescription({type:"answer",sdp:_.remoteSdp||""}),T(!0)}catch(c){r(c)}});return this.base.asyncQueue.add(u,{describe:"closeTrack"})};_pubNotify=async m=>{const u=m.filter(_=>!this.base.users.localUser.published[_]),T=this.base.peer.getSenderUserTracks(u);if(T.length===0)return;const r=pt(T,["type","trackName","mid"]),{callSession:c,roomId:e,userId:t}=this.base.config;await this.base.cws.createRequest("pubNotify").send({data:{session:c,roomId:e,user:{id:t,tracks:r}}}),this.base.users.localUser.setTracksPublished(m,!0)};_renegotiate=async()=>{await this.base.peer.createAnswer();const m=this.base.peer.getSdp(),T=await this.base.cws.createRequest("renegotiate").send({data:{sdp:m},compress:!0}),{code:r=0,desc:c,sn:e}=T;if(await this._ackMsg(e),r!==200)throw new Error(c)};_ackMsg=async m=>{await this.base.cws.createRequest("ackMsg",{onBack:!1}).send({data:{msgId:m}})};_notifySelfCallAction=async()=>{const m=this.base.users.localUser;m.updateSelfCallAction();const{roomId:u}=this.base.config,{id:T,callAction:r}=m,e=await this.base.cws.createRequest("updateCall").send({data:{roomId:u,user:{id:T,callAction:r}}}),{code:t=0}=e;if(t!==200)throw new Error("NotifySelfCallAction is error.")};_calculateNetwork=async()=>{if(this.base.cws.prws.ws?.readyState===1&&this.base.peer.pc.connectionState==="connected"&&!this._networkCalculating){this._networkCalculating=!0;try{const m={elapsed:0,sfu:{inboundBytes:0,outboundBytes:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,velocityPush:0,velocityPull:0},p2p:{inboundBytes:0,outboundBytes:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,velocityPush:0,velocityPull:0}},u=[],T=[];{const r=[0],c=[0],e=[0],t=[],i=[],_=new Date().getTime(),I=this.base.users.localUser,x=Array.from(this.base.users.remoteUsers.values());await Promise.all([I.generateTrackAnalysis(this.base.peer),...x.map(Q=>Q.generateTrackAnalysis(this.base.peer))]);for(const Q of mediaType_keys)if(I.published[Q]&&I.getTrack(Q)){const{trackReport:ne}=I.tracksAnalysis.sfu.sends[Q],{offsetBytesSent:K,lostRate:oe,roundTripTime:ue,jitter:G,quality:ie,averageQuality:le,averageOffsetBytesSent:re}=ne;this.base.traffic.sfu.outboundBytes+=K,m.sfu.velocityPush+=re,r.push(oe),c.push(ue),e.push(G),ie!==0&&t.push(ie),le!==0&&i.push(le),u.push(ie)}for(const Q of x)for(const ne of mediaType_keys)if(Q.getTrack(ne)){const{trackReport:K}=Q.tracksAnalysis.sfu.recvs[ne],{offsetBytesSent:oe,lostRate:ue,roundTripTime:G,jitter:ie,quality:le,averageQuality:re,averageOffsetBytesSent:se}=K;this.base.traffic.sfu.inboundBytes+=oe,m.sfu.velocityPull+=se,r.push(ue),c.push(G),e.push(ie),le!==0&&t.push(le),re!==0&&i.push(re),T.push(le)}const M=new Date().getTime();m.elapsed=M-_;const j=1e3,z=30*1e3;m.elapsed>j&&Date.now()-this._lastTrackAnalysisWarnTime>z&&(this._lastTrackAnalysisWarnTime=Date.now(),console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: generateTrackAnalysis taking too much time.",{elapsed:m.elapsed})),m.sfu.lostRate=Math.max(...r),m.sfu.roundTripTime=Math.max(...c),m.sfu.jitter=Math.max(...e),m.sfu.quality=t.length===0?0:Math.min(...t),m.sfu.averageQuality=i.length===0?0:Math.min(...i)}{const r=[0],c=[0],e=[0],t=[],i=[],_=this.base.users.remoteUsers.values();for(const I of _)for(const x of mediaType_keys)if(I.p2p){{const{trackReport:M}=I.tracksAnalysis.p2p.sends[x],{offsetBytesSent:j,lostRate:z,roundTripTime:Q,jitter:ne,quality:K,averageQuality:oe,averageOffsetBytesSent:ue}=M;this.base.traffic.p2p.outboundBytes+=j,m.p2p.velocityPush+=ue,r.push(z),c.push(Q),e.push(ne),K!==0&&t.push(K),oe!==0&&i.push(oe),u.push(K)}{const{trackReport:M}=I.tracksAnalysis.p2p.recvs[x],{offsetBytesSent:j,lostRate:z,roundTripTime:Q,jitter:ne,quality:K,averageQuality:oe,averageOffsetBytesSent:ue}=M;this.base.traffic.p2p.inboundBytes+=j,m.p2p.velocityPull+=ue,r.push(z),c.push(Q),e.push(ne),K!==0&&t.push(K),oe!==0&&i.push(oe),T.push(K)}}m.p2p.lostRate=Math.max(...r),m.p2p.roundTripTime=Math.max(...c),m.p2p.jitter=Math.max(...e),m.p2p.quality=t.length===0?0:Math.min(...t),m.p2p.averageQuality=i.length===0?0:Math.min(...i)}{const r=this.base.traffic.getUse();m.sfu.outboundBytes=r.sfu.outboundBytes,m.sfu.inboundBytes=r.sfu.inboundBytes,m.p2p.outboundBytes=r.p2p.outboundBytes,m.p2p.inboundBytes=r.p2p.inboundBytes}this.base.config.network=m,this.base.notifys.emit("onRoomNetwork",{code:200,data:m,desc:"RoomNetwork is change."});{const r=this.base.users.localUser,c=u.length===0?0:Math.round(u.reduce((i,_)=>i+_)/u.length),e=T.length===0?0:Math.round(T.reduce((i,_)=>i+_)/T.length);r.updateNetwork({egress:c,ingress:e})===!1&&(this.base.cws.createRequest("networkQualityChange",{onBack:!1}).send({data:{egress:c,ingress:e,userId:r.id,roomId:this.base.config.roomId}}),this.base.users.emitUsersChange())}this._checkAndSelectUserStreamOrigin()}finally{this._networkCalculating=!1}}};_checkAndSelectUserStreamOrigin=async()=>{if(this._hasAsyncTask("subscribe")||this._hasAsyncTask("publish")||this._hasAsyncTask("closeTrack"))return;const m=this.base.config.network.sfu.averageQuality,u=this.base.users.remoteUsers.values(),T=[],r=[],c=new Date().getTime();for(const e of u){const t=e.p2p;if(!t)continue;const i=[];for(const _ of mediaType_keys){if(!t.hasRecvier(_))continue;const x=t.checkReceActive(_);if(!x)continue;const M=e.getTrack(_);if(!M){t.setRecvTracksEnabled([_],!1);continue}const{averageQuality:j,availableScore:z}=e.tracksAnalysis.p2p.recvs[_]?.trackReport;let Q=this.base._checkUserStreamOrigin({p2pAverageQuality:j,sfuAverageQuality:m});M.origin==="p2p"&&["mc_video","ss_video"].includes(_)&&c-x>=1e4&&z<.6&&(Q="sfu",this.base.config.debug===!0&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: Switching to SFU. availableScore: ${z}`,{remoteUserId:e.id,mediaType:_,availableScore:z})),Q!==M.origin&&(Q==="p2p"?(e.useRemoteP2PStream([_]),r.push(M)):i.push(_))}i.length!==0&&(this.base._reportP2PConnect("disconnect",{desc:"Poor quality of P2P. ",pushId:e.id,pullId:this.base.config.userId,mediaTypes:i}),T.push({userId:e.id,mediaTypes:i}))}if(r.length!==0&&await this._closeTrack(r),T.length!==0){await this.subscribe(T);for(const e of T){const{userId:t,mediaTypes:i}=e;try{this.base.users.getRemoteUserContent(t)?.p2p?.setRecvTracksEnabled(i,!1)}catch(_){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [_checkAndSelectUserStreamOrigin]",_)}}}r.length!==0&&T.length===0&&this.base.users.emitUsersChange()};_hasAsyncTask=m=>{let u=!1;return this.base.asyncQueue.activePromise?.describe===m&&(u=!0),u===!1&&this.base.asyncQueue.queue.find(r=>r.describe===m)&&(u=!0),u};_syncRoomInfo=async()=>{if(this._syncRoomPromise)return this._syncRoomPromise;this._syncRoomPromise=new Promise(async(m,u)=>{try{const T=this.base.users.localUser,r=this.base.users.getP2PState(),e=await this.base.cws.createRequest("syncRoomInfo").send({data:{user:{id:T.id,callAction:T.callAction},p2pState:r}}),{code:t=0,desc:i,data:_={}}=e;if(t!==200)throw new Error(i);if(_.isActive===!1)throw new Error("Do not stay in this room.");const I=_.users||[];if((I.find(z=>z.id===T.id)||!1)===!1)throw new Error("Need to rejoin the room.");const M=Array.from(I,z=>z.id),j=this.base.users.remoteUsers.values();for(const z of j)M.includes(z.id)||(z.clear(),this.base.users.remoteUsers.delete(z.id));this.base.users.initUsers(I),this._syncRoomPromise=void 0,m(!0)}catch(T){this._syncRoomPromise=void 0,u(T)}})};_restorePeer=async()=>{if(this._restorePeerPromise)return this._restorePeerPromise;this._restorePeerPromise=new Promise(async(m,u)=>{try{this._isRestorePeer=!0,this.base.config.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [restorePeer]");let T=[];if(this.base.config.isInRoom){const i=this.base.users.remoteUsers.values();for(const _ of i){const I=[],x=_.getTracks(mediaType_keys);for(const M of x){const{mediaType:j,origin:z,msid:Q}=M;(z==="p2p"||z==="sfu"&&Q!=="")&&I.push(j)}I.length!==0&&T.push({userId:_.id,mediaTypes:I})}}const r=this.base.users.localUser.getTracks(mediaType_keys),c=[],e=[],t=[];for(const i of r){const{enabled:_,mediaType:I}=i;c.push(I),_===!0?e.push(I):t.push(I)}if(await this._connectCF(!0),await this._syncRoomInfo(),T.length!==0&&await this.subscribe(T),c.length!==0){await this._createTrack(c);const i=this.base.peer.getSenderUserTracks(c);this.base.users.localUser.updateTracks(i),this.base.users.localUser.usePhoneyStream(c),e.length!==0&&await this.setLocalStream(e,!0),await this._notifySelfCallAction();const{valid_mediaTypes:_}=this.base.localMedias.checkLocalStreamTracks(c);if(_.length!==0)await this._pubNotify(_);else throw new Error("No effective track.")}this._restorePeerPromise=void 0,m(!0)}catch(T){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [RestorePeer is error.]",T),this._clear(),this._restorePeerPromise=void 0,u(T)}this._isRestorePeer=!1})};_onRemoteUsersQuitRoom=m=>{const u=[],T=[],r=[];for(const c of m){const e=this.base.users.getRemoteUserContent(c);if(!e)continue;u.push(c);const t=e.removeTracks(mediaType_keys);for(const i of t){const{mid:_,msid:I}=i;I&&_&&(T.push(_),r.push(i))}this.base.users.removeRemoteUser(c)}return u.length!==0&&(this.base.peer.stopReceivers(T),this._closeTrack(r).catch(()=>this._restorePeer()),this.base.users.emitUsersChange()),u};_restoreRoom=async()=>{this.base.intervalQueue.removeQueueItem(["heartbeat-interval"]);try{await this._connectCws().catch(m=>{throw this._clear(),m}),this._isRestorePeer===!1&&await this._restorePeer()}catch(m){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [RestoreRoom is error.]",m)}}}class ActionP2P{base;_p2pCheckTimeoutMap=new Map;constructor({base:m}){this.base=m,this.base.cws.on.onOffer=u=>{this._onOffer(u)},this.base.cws.on.onCandidate=u=>{this._onCandidate(u)},this.base.cws.on.onAttemptP2PEx=u=>{const{roomId:T,pushId:r,types:c=[],isRemotePush:e=!1}=u.data;if(c.length===0){this.base.config.debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [onAttemptP2PEx] There is an error. types.length === 0",u);return}if(this.base.config.roomId!==T){this.base.config.debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [onAttemptP2PEx] There is an error. roomId is inequality.",u);return}const t=Array.from(c,i=>mediaType_keys[i]);t.length!==0&&this._openP2P(r,t,e)},this.base.cws.on.onDisconnectedP2P=u=>{const{roomId:T,remoteUserId:r}=u.data;if(T!==this.base.config.roomId)return;const c=this.base.users.getRemoteUserContent(r);if(!c||!c.p2p)return;c.p2p.checkActive()===!1&&c.p2p.close()}}_openP2P=async(m,u,T)=>{if(u.length===0)return;const{useP2P:r,roomId:c,userId:e}=this.base.config;if(r===!1)throw new Error("You have disabled the p2p function on the client side.");try{const t=this.base.users.localUser,i=new Date().getTime(),_=this.base.users.getRemoteUserContent(m);if(!_)throw new Error("The remote user to be established does not exist.");const I=this._getRemoteUserP2PContent(m,!0),{prohibited_mediaTypes:x=[],subscribed_mediaTypes:M=[]}=_.checkSubscribed(u);if(T===!0&&x.length!==0&&(this.base._reportP2PConnect("ignore",{desc:"P2P connections without a subscription relationship are not allowed.",pullId:e,pushId:m,mediaTypes:x}),M.length===0))return;this.base.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [${m}]: start connect p2p.`,{isRemotePush:T}),T===!1?(I.close(),I.init()):I.peer?.connectionState!=="connected"&&I.init();const j=I.initRecvs(M);if(j.length!==0){const Q=()=>{const K=async()=>{const ue=await I.createOffer(),G=I.getRecvUserTracks(M),le=await this.base.cws.createRequest("offer").send({data:{roomId:c,tracks:G,sender:{id:e,callAction:t.callAction},receiverId:m,sdp:ue.sdp}}),{code:re=0,desc:se}=le;if(re!==200)throw new Error(se)};return $t(()=>new Promise(ue=>{this.base.cws.on.onAnswer=G=>{const{code:ie,data:le}=G;if(ie!==200)return;const{sender:re,sdp:se,tracks:de=[]}=le,{id:ee}=re;m===ee&&ue({answer:{type:"answer",sdp:se},tracks:de})},K()}),{message:"await_answer is timeout.",timeout:2e4})},ne=async()=>{const K=await $t(I.getIcecandidates,{message:"get recv candidates is timeout.",timeout:1e4}),oe=Array.from(K,({sdpMid:re,sdpMLineIndex:se,candidate:de})=>({sdpMid:re,sdpMLineIndex:se,sdp:de})),G=await this.base.cws.createRequest("candidate",{timeout:1e3*10}).send({data:{roomId:c,senderId:e,receiverId:m,candidates:oe,isSubscribeReceiver:!0}}),{code:ie=0,desc:le}=G;if(ie!==200)throw new Error(le)};{const K=await Q(),{answer:oe,tracks:ue=[]}=K;await I.setAnswer(oe),await ne();const G=[],ie=[];for(const le of ue){const{type:re,mid:se,enabled:de=!1}=le;if(re===void 0)continue;const ee=mediaType_keys[le.type];ie.push(ee),G.push({mediaType:ee,mid:se,enabled:de})}I.initSenders(G),I.setSendTracksEnabled(j,!1,"local")}}await $t(I.waitings.connected,{message:"ice connect is timeout.",timeout:10*1e3}),await $t(I.waitings.remoteChannelConnected,{message:"remote_channel connect is timeout.",timeout:10*1e3}),T===!0&&I.setRecvTracksEnabled(M,!0);const z=`${new Date().getTime()-i}`;T===!0?await this.base._reportP2PConnect("success",{action:3,desc:"P2P connection successful.",pullId:e,pushId:m,mediaTypes:M,connectedTime:z}):await this.base._reportP2PConnect("success",{action:2,desc:"P2P connection successful.",pullId:m,pushId:e,mediaTypes:u,connectedTime:z}),this.base.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [${m}]: switch to P2P will be attempted within 10 seconds.`);{const Q=this._p2pCheckTimeoutMap.get(m);Q&&clearTimeout(Q);const ne=window.setTimeout(()=>{this._p2pCheckTimeoutMap.delete(m);const K=[],oe=this.base.users.getRemoteUserContent(m);if(!(!oe||!oe.p2p)){for(const ue of M){const G=oe.p2p.activeRecv[ue]||!1,ie=oe.getTrack(ue);G&&ie?.origin!=="p2p"&&K.push(ue)}K.length!==0&&(oe.p2p.setRecvTracksEnabled(K,!1),this.base._reportP2PConnect("disconnect",{desc:"Poor quality of P2P.",pushId:oe.id,pullId:this.base.config.userId,mediaTypes:K}))}},1e3*10);this._p2pCheckTimeoutMap.set(m,ne)}}catch(t){this.base.users.getRemoteUserContent(m)?.p2p?.destroy(),this.base.config.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [p2p]: onOpen p2p with ${m} is error.`,t),T===!0?await this.base._reportP2PConnect("fail",{action:0,desc:t.message||t,pullId:e,pushId:m,mediaTypes:u}):await this.base._reportP2PConnect("fail",{action:1,desc:t.message||t,pullId:m,pushId:e,mediaTypes:u})}};_onOffer=async m=>{const{code:u,data:T}=m;if(u!==200)return;const{sdp:r,sender:c={},tracks:e=[]}=T,{id:t}=c,{userId:i,roomId:_}=this.base.config,I=this.base.users.localUser;try{const x=this.base.users.getrP2PConnectedCount(),M=[],j=[];for(const ue of e){const{type:G,mid:ie,enabled:le=!1}=ue;if(G===void 0)continue;const re=mediaType_keys[ue.type];M.push(re),j.push({mediaType:re,mid:ie,enabled:le})}if(x+M.length>3){if(M.length===2){const ue=M.findIndex(G=>G==="ss_video");M.splice(ue,1),await this.base._reportP2PConnect("ignore",{desc:"P2P connections have reached the maximum limit.",pushId:i,pullId:t,mediaTypes:["ss_video"]})}if(M.length===1){await this.base._reportP2PConnect("ignore",{desc:"P2P connections have reached the maximum limit.",pushId:i,pullId:t,mediaTypes:M});return}}const z=this._getRemoteUserP2PContent(t,!0);this.base.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [${t}]: start connect p2p.`),z.peer?.connectionState!=="connected"&&z.init(),await z.setOffer({type:"offer",sdp:r});{const ue=z.initSenders(j);z.setSendTracksEnabled(ue,!1,"local")}const Q=await z.createAnswer(),ne=z.getSenderUserTracks(M),K=()=>new Promise(async(ue,G)=>{try{const le=await this.base.cws.createRequest("answer").send({data:{roomId:_,tracks:ne,sender:{id:I.id,callAction:I.callAction},receiverId:t,sdp:Q.sdp}}),{code:re=0,desc:se}=le;if(re!==200)throw new Error(se);ue(!0)}catch(ie){G(ie)}}),oe=()=>new Promise(async(ue,G)=>{try{const ie=await $t(z.getIcecandidates,{message:"get send candidates is timeout.",timeout:1e4}),le=Array.from(ie,({sdpMid:ae,sdpMLineIndex:pe,candidate:he})=>({sdpMid:ae,sdpMLineIndex:pe,sdp:he})),se=await this.base.cws.createRequest("candidate").send({data:{roomId:_,senderId:I.id,receiverId:t,candidates:le,isSubscribeReceiver:!1}}),{code:de=0,desc:ee}=se;if(de!==200)throw new Error(ee);ue(!0)}catch(ie){G(ie)}});await K(),await new Promise(ue=>setTimeout(()=>ue(!0),1e3)),await oe(),await $t(z.waitings.connected,{message:"ice connect is timeout.",timeout:20*1e3})}catch(x){this.base.config.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [p2p]: onReply p2p with ${t} is error.`,x)}};_onCandidate=async m=>{const{code:u,data:T}=m;if(u!==200)return;const{senderId:r,candidates:c=[],receiverId:e,isSubscribeReceiver:t=!1}=T,{userId:i}=this.base.config;if(t===!1||e!==i)return;const _=this.base.users.getRemoteUserContent(r);if(!_||!_.p2p){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: An error occurred in onCandidate.",_);return}const I=Array.from(c,({sdpMid:x,sdpMLineIndex:M,sdp:j})=>({sdpMid:x,sdpMLineIndex:M,candidate:j}));await _.p2p.addCandidates(I)};_getRemoteUserP2PContent=(m,u)=>{const T=this.base.users.getRemoteUserContent(m);if(!T)throw new Error("The remote user to be established does not exist.");if(u===!0&&(T.p2p||this.base.users.createRemoteUserP2P(m)),!T.p2p)throw new Error("The remote user p2p to be established does not exist.");return T.p2p};destroy=()=>{for(const m of this._p2pCheckTimeoutMap.values())clearTimeout(m);this._p2pCheckTimeoutMap.clear()}}const version="1.6.62";class QuickVO{static version=version;_base=new Base;_ACTION_BASE=new ActionBase({base:this._base});_ACTION_SFU=new ActionSFU({base:this._base});_ACTION_P2P=new ActionP2P({base:this._base});constructor(m){console.info(`[QuickVO] version is ${version}`),this._base.config.setOptions(m)}recorder=this._base.recorder;use=this._base.use;setCallStrategy=this._base.setCallStrategy;addNotify=this._base.notifys.add;setOptions=this._base.config.setOptions;getLocalStream=this._base.users.localUser.getStream;getLocalStreams=this._base.users.localUser.getStreams;setActiveNoise=this._base.users.localUser.setActiveNoise;hasPermissions=this._base.users.localUser.hasPermissions;getUserContent=this._base.users.getUserContent;getUserStream=this._base.users.getUserStream;getVolume=this._base.users.getVolume;getMaxVolumeUser=this._base.users.getMaxVolumeUser;setInputVolume=this._base.users.setInputVolume;setEnhanceGain=this._base.users.setEnhanceGain;setSpeakerVolume=this._base.users.setSpeakerVolume;getUserAudioMediaStreamContext=this._base.users.getUserAudioMediaStreamContext;playBgs=this._base.users.playBgs;changBgsMix=this._base.users.changBgsMix;stopBgs=this._base.users.stopBgs;setBgsGain=this._base.users.setBgsGain;playBgm=this._base.users.playBgm;changBgmMix=this._base.users.changBgmMix;stopBgm=this._base.users.stopBgm;setBgmGain=this._base.users.setBgmGain;getEnumerateDevices=this._base.localMedias.getEnumerateDevices;getMediaDeviceKind=this._base.localMedias.getMediaDeviceKind;getMediaDevicesErrInfo=this._base.localMedias.getMediaDevicesErrInfo;setLocalStream=this._ACTION_SFU.setLocalStream;setMediaDeviceKind=this._ACTION_SFU.setMediaDeviceKind;setMediaTrackConstraints=this._ACTION_SFU.setMediaTrackConstraints;earlyConnect=this._ACTION_SFU.earlyConnect;joinRoom=this._ACTION_SFU.joinRoom;publish=this._ACTION_SFU.publish;stopPublish=this._ACTION_SFU.stopPublish;pauseTracks=this._ACTION_SFU.pauseTracks;subscribe=this._ACTION_SFU.subscribe;stopSubscribe=this._ACTION_SFU.stopSubscribe;setBanBehaviors=this._ACTION_SFU.setBanBehaviors;updateSimulcast=this._ACTION_SFU.updateSimulcast;toggleRoomSpeechLang=this._ACTION_SFU.toggleRoomSpeechLang;updateToken=this._ACTION_SFU.updateToken;quitRoom=this._ACTION_SFU.quitRoom;quitRoomEx=this._ACTION_SFU.quitRoomEx;destroy=()=>{this._ACTION_P2P.destroy(),this._ACTION_SFU.destroy()};addRequestAnimationFrame=this._base.animationFrame.addRequestAnimationFrame;clearRequestAnimationFrame=this._base.animationFrame.clearRequestAnimationFrame;getLocalUserTrackReports=this._base.users.getLocalUserTrackReports;getRemoteUserTrackReports=this._base.users.getRemoteUserTrackReports;getRoomAction=this._base.config.getRoomAction;createRoomAction=this._base.config.createRoomAction;_openP2P=this._ACTION_P2P._openP2P;_restoreRoom=this._ACTION_SFU._restoreRoom;_debugger=this._ACTION_BASE._debugger;_ai=this._ACTION_BASE._ai}exports.QuickVO=QuickVO,exports.callStrategy_keys=callStrategy_keys,exports.callStrategy_options=callStrategy_options,exports.callStrategy_vals=callStrategy_vals,exports.enum_callStrategy=enum_callStrategy,exports.enum_eventName=enum_eventName,exports.enum_mediaType=enum_mediaType,exports.enum_notifyName=enum_notifyName,exports.enum_quality=enum_quality,exports.enum_roomState=enum_roomState,exports.enum_trackType=enum_trackType,exports.eventName_keys=eventName_keys,exports.eventName_options=eventName_options,exports.eventName_vals=eventName_vals,exports.mediaType_keys=mediaType_keys,exports.mediaType_options=mediaType_options,exports.mediaType_vals=mediaType_vals,exports.notifyName_keys=notifyName_keys,exports.notifyName_options=notifyName_options,exports.notifyName_vals=notifyName_vals,exports.quality_keys=quality_keys,exports.quality_options=quality_options,exports.quality_vals=quality_vals,exports.roomState_keys=roomState_keys,exports.roomState_options=roomState_options,exports.roomState_vals=roomState_vals,exports.trackType_keys=trackType_keys,exports.trackType_options=trackType_options,exports.trackType_vals=trackType_vals,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}));
4
+ `}})),Gi=u(s((e=>{var t=Ui(),n=Wi();Hi(),e.write=n,e.parse=t.parse,e.parseParams=t.parseParams,e.parseFmtpConfig=t.parseFmtpConfig,e.parsePayloads=t.parsePayloads,e.parseRemoteCandidates=t.parseRemoteCandidates,e.parseImageAttributes=t.parseImageAttributes,e.parseSimulcastStreamList=t.parseSimulcastStreamList}))(),1),Ki=class{resolvesMap=new Map;index=0;constructor(){}emit=async e=>{let t=this.resolvesMap.get(e);if(t){for(let e of t.values())clearTimeout(e.timer),e.resolve(!0);t.clear()}};add=(e,t=()=>!1,n=1e3*30)=>new Promise((r,i)=>{if(t())return r(!0);this.resolvesMap.has(e)||this.resolvesMap.set(e,new Map),this.index++;let a=`${this.index}`;n=Math.max(0,n);let o=0;n>=0&&(o=window.setTimeout(()=>i(`[PrResolves] ${e} is timeout.`),n)),this.resolvesMap.get(e)?.set(a,{resolve:r,reject:i,timer:o})});clear=()=>{let e=this.resolvesMap.keys();for(let t of e){let e=this.resolvesMap.get(t)?.values()||[];for(let n of e)clearTimeout(n.timer),n.reject(`[PrResolves] ${t} is clear.`)}this.resolvesMap=new Map}},qi=class e{config;users;prResolves=new Ki;pc=new RTCPeerConnection;initTime=0;transceiverMap=new Map;broadcasted={};iceConnectionTimer=0;simulcast=`f`;turnExpiresAtMs;on={};waitings={peerConnected:async()=>this.prResolves.add(`peerConnected`,()=>this.pc.connectionState===`connected`)};constructor({config:e,users:t}){this.config=e,this.users=t}static rtcConfigurationFromTurnRsp(e){let t=[{urls:`stun:stun.cloudflare.com:3478`}],n=e?.iceServers;return{iceServers:n&&n.length>0?n.map(e=>{let t=e.urls.length===1?{urls:e.urls[0]}:{urls:[...e.urls]};return e.username&&e.credential&&(t.username=e.username,t.credential=e.credential),t}):t,bundlePolicy:`max-bundle`,...e?.policy===Vi.Relay?{iceTransportPolicy:`relay`}:{}}}setBroadcasted=(e,t)=>{for(let n of e)this.broadcasted[n]=t};getNoBroadcasted=e=>e.filter(e=>this.broadcasted[e]===!1);checkValid=()=>!(new Date().getTime()-this.initTime>=1e3*60*20||this.pc.connectionState!==`connected`);setRTCRtpSenderParameters=async(e,t=[])=>{try{for(let n of t){let t=this.transceiverMap.get(n);if(!t)continue;let{sender:r}=t,i=r.getParameters();await r.setParameters({...i,...e})}}catch(e){console.error(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: setRTCRtpSenderParameters is error.`,e)}};init=async t=>{if(this.close(),t?.expiresAt!=null){let e=Number(t.expiresAt);this.turnExpiresAtMs=Number.isFinite(e)?e*1e3:void 0}else this.turnExpiresAtMs=void 0;let n=e.rtcConfigurationFromTurnRsp(t);this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: RTCPeerConfiguration`,n),this.pc=new RTCPeerConnection(n),this.pc.addTransceiver(`audio`,{direction:`sendonly`}),this.pc.addTransceiver(`video`,{direction:`sendonly`});let r=await this.pc.createOffer();await this.pc.setLocalDescription(r),this.pc.onconnectionstatechange=()=>{let e=this.pc?.connectionState;switch(e){case`connected`:this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#00b60f;`,`------->quickvo: connectionState:${e}`),clearTimeout(this.iceConnectionTimer),this.prResolves.emit(`peerConnected`);break;case`disconnected`:this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#b64900;`,`------->quickvo: connectionState:${e}`),this.iceConnectionTimer=window.setTimeout(this.close,1e3*15);break;case`failed`:this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#b60000;`,`------->quickvo: connectionState:${e}`);break;case`closed`:this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#b60000;`,`------->quickvo: connectionState:${e}`);break;default:this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#b64900;`,`------->quickvo: connectionState:${e}`);break}this.on.state&&this.on.state(e)},this.initTime=new Date().getTime(),this.setBroadcasted(M,!1)};close=()=>{clearTimeout(this.iceConnectionTimer),this.transceiverMap=new Map,this.turnExpiresAtMs=void 0,this.pc.close()};addSenders=async e=>{let t=[];for(let n of e){if(this.transceiverMap.get(n))continue;t.push(n);let e={direction:`sendonly`,sendEncodings:[{priority:n===`mc_audio`||n===`ss_audio`?`high`:`low`}]},[r]=this.users.localUser.getStream(n).getTracks(),i=this.pc.addTransceiver(r,e);[`mc_video`,`ss_video`].includes(n)&&i.setCodecPreferences(this.config.codecPreferences.video),this.transceiverMap.set(n,i)}if(t.length!==0){let e=await this.pc.createOffer();if(this.config.debug){let t=Gi.parse(e.sdp),n=m(t.media,[`mid`,`msid`,`type`]);console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#ffffff;`,`------->quickvo: setLocalDescription`,{msidArr:n,sdpJson:t,description:e})}await this.pc.setLocalDescription(e)}let n=[];for(let e of t){let t=this.transceiverMap.get(e);if(!t)continue;let{mid:r,sender:i}=t,{track:a}=i;if(!a||!r)continue;let o=M.findIndex(t=>t===e),s={type:o,trackName:`WEB-${o}-${y()}`,mid:r};n.push(s)}return this.users.localUser.updateTracks(n),t};syncSenderStreamTrack=async e=>{for(let t of e){if(!this.hasSender(t))continue;let[e]=this.users.localUser.getStream(t).getTracks();await this.replaceSenderTrack(t,e)}};stopSenders=e=>{this.users.localUser.removeTracks(e);for(let t of e){let e=this.transceiverMap.get(t);e&&(e.stop(),this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: stopSenders: ${e.mid} is stop.`,e),this.transceiverMap.delete(t))}this.users.localUser.removeTracks(e)};hasSender=e=>this.transceiverMap.has(e);replaceSenderTrack=async(e,t)=>{let n=this.transceiverMap.get(e);if(!n)throw Error(`ReplaceTrack is error. no have ${e} transceiver.`);let{sender:r}=n;await r.replaceTrack(t)};getTransceiver=e=>this.pc.getTransceivers().find(t=>t.mid===e);getSenderTrack=e=>this.transceiverMap.get(e)?.sender.track;getRecvierTrack=e=>this.pc.getTransceivers().find(t=>t.mid===e)?.receiver.track;stopReceivers=e=>{if(e.length===0)return;let t=this.pc.getTransceivers();for(let n of t){let{mid:t}=n;t&&e.includes(t)&&(n.receiver.track.stop(),n.stop(),this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: stopReceivers: ${t} is stop.`,n))}};createOffer=async()=>{let e=await this.pc.createOffer();if(this.config.debug){let t=Gi.parse(e.sdp),n=m(t.media,[`mid`,`msid`,`type`]);console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#ffffff;`,`------->quickvo: createOffer`,{msidArr:n,sdpJson:t,description:e})}await this.pc.setLocalDescription(e)};createAnswer=async()=>{let e=await this.pc.createAnswer();if(this.config.debug){let t=Gi.parse(e.sdp),n=m(t.media,[`mid`,`msid`,`type`]);console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#ffffff;`,`------->quickvo: createAnswer`,{msidArr:n,sdpJson:t,description:e})}await this.pc.setLocalDescription(e)};getSdp=()=>this.pc.localDescription?.sdp||``;setRemoteDescription=async e=>{if(this.config.debug){let t=Gi.parse(e.sdp),n=m(t.media,[`mid`,`msid`,`type`]);console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#ffffff;`,`------->quickvo: setRemoteDescription`,{msidArr:n,sdpJson:t,description:e})}return await this.pc.setRemoteDescription(e),e}},Ji=class{types=[`outbound-rtp`,`remote-inbound-rtp`,`media-source`,`codec`];trackReport={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:`unknown`,payloadType:0,sdpFmtpLine:``,frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0};transmittedPackets=0;transmittedPacketsLost=0;averageQualitys=[];averageOffsetBytesSents=[];isAvailable=[];availableScore=[];constructor(){}applyFromReports=e=>{try{if(e.length===0)throw Error(`empty reports`);let t={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:`unknown`,payloadType:0,sdpFmtpLine:``,frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0},n=0,r=0;for(let i of e){let{type:e}=i;if(this.types.includes(e))switch(e){case`codec`:{let{mimeType:e,payloadType:n,sdpFmtpLine:r}=i;t.mimeType=e,t.payloadType=n,t.sdpFmtpLine=r}break;case`outbound-rtp`:{let{bytesSent:e,packetsSent:r,frameWidth:a=0,frameHeight:o=0,framesPerSecond:s=0}=i;n=r,t.bytesSent=e,t.frameWidth=a,t.frameHeight=o,t.framesPerSecond=s}break;case`remote-inbound-rtp`:{let{packetsLost:e=0,roundTripTime:n=0,jitter:a=0}=i;r=e,t.roundTripTime=Math.round(n*1e3),t.jitter=Math.round(a*1e3)}break}}if(r!==0){let e=n-this.transmittedPackets,i=r-this.transmittedPacketsLost,a=e+i;t.lostRate=a===0?0:Math.round(i/a*1e4)/1e4,this.transmittedPackets=n,this.transmittedPacketsLost=r}{let{lostRate:e,roundTripTime:n,jitter:r}=t;t.quality=ne(e,n,r),this.averageQualitys.unshift(t.quality),this.averageQualitys=this.averageQualitys.slice(0,10)}this.averageQualitys.length>=10&&(t.averageQuality=this.averageQualitys.length<10?0:Math.round(this.averageQualitys.reduce((e,t)=>e+t)/this.averageQualitys.length)),t.offsetBytesSent=Math.max(0,t.bytesSent-this.trackReport.bytesSent),this.averageOffsetBytesSents.unshift(t.offsetBytesSent),this.averageOffsetBytesSents=this.averageOffsetBytesSents.slice(0,5),t.averageOffsetBytesSent=this.averageOffsetBytesSents.length===0?0:Math.round(this.averageOffsetBytesSents.reduce((e,t)=>e+t)/this.averageOffsetBytesSents.length);{let{frameWidth:e,frameHeight:n,mimeType:r}=t;if(r){if(r.includes(`audio`))this.isAvailable.unshift(1);else if(e&&n){let r=Math.round(ie(e,n)/3),i=t.offsetBytesSent>=r?1:0;this.isAvailable.unshift(i)}this.isAvailable=this.isAvailable.slice(0,10)}}{let e=this.isAvailable.length,n=0,r=[];for(let t=0;t<e;t++){let e=this.isAvailable[t]*re[t];n+=e,r.push(e)}this.availableScore=r,t.availableScore=Math.round(n*100)/100}this.trackReport=t}catch{this.clear()}return this.trackReport};generate=async(e,t)=>{try{if(t===void 0)throw Error(`Peer track is undefined.`);if(e.connectionState!==`connected`)throw Error(`Peer connectionState is ${e.connectionState}.`);let n=await e.getStats(t);return this.applyFromReports([...n.values()])}catch{return this.clear(),this.trackReport}};clear=()=>{this.trackReport={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:`unknown`,payloadType:0,sdpFmtpLine:``,frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0},this.transmittedPackets=0,this.transmittedPacketsLost=0,this.averageQualitys=[],this.averageOffsetBytesSents=[],this.availableScore=[],this.isAvailable=[]}},Yi=class{inputStream=new MediaStream;outputStream=new MediaStream;inputGain=1;enhanceGain=1;bgsGain=1;bgmGain=1;outputGain=1;mixAudioMap=new Map;audioContext=new AudioContext;sourceNode;inputGainNode;enhanceGainNode;bgsGainNode;bgmGainNode;rnnoiseNode;analyserNode;analyserArrayData;outputGainNode;destinationNode;denoise=!1;mute=!0;rnnoiseWorklet;rnnoiseWorkletNode;filterStream=e=>e;constructor(e,t){this.inputStream=e,t&&(this.audioContext=t),this.sourceNode=this.audioContext.createMediaStreamSource(this.inputStream),this.inputGainNode=this.audioContext.createGain(),this.inputGainNode.gain.setValueAtTime(this.inputGain,this.audioContext.currentTime),this.enhanceGainNode=this.audioContext.createGain(),this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime),this.bgsGainNode=this.audioContext.createGain(),this.bgsGainNode.gain.setValueAtTime(this.bgsGain,this.audioContext.currentTime),this.bgmGainNode=this.audioContext.createGain(),this.bgmGainNode.gain.setValueAtTime(this.bgmGain,this.audioContext.currentTime),this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=512,this.analyserArrayData=new Uint8Array(this.analyserNode.frequencyBinCount),this.outputGainNode=this.audioContext.createGain(),this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime),this.destinationNode=this.audioContext.createMediaStreamDestination(),this.outputStream=this.destinationNode.stream;{let{sourceNode:e,inputGainNode:t,enhanceGainNode:n,bgsGainNode:r,bgmGainNode:i,analyserNode:a,outputGainNode:o,destinationNode:s}=this;e.connect(t),t.connect(n),n.connect(a),r.connect(a),i.connect(a),n.connect(s),r.connect(s),i.connect(s),o.connect(this.audioContext.destination)}this.audioContext.resume()}use=({rnnoise:e})=>{this.rnnoiseWorklet=new e.RnnoiseWorklet};_changeSource=()=>{this.sourceNode.disconnect(),this.sourceNode=this.audioContext.createMediaStreamSource(this.inputStream),this.sourceNode.connect(this.inputGainNode)};replaceTrack=e=>{let t=this.inputStream.getTracks();for(let e of t)this.inputStream.removeTrack(e);this.inputStream.addTrack(e),this._changeSource()};stop=()=>{{let e=this.inputStream.getTracks();for(let t of e)t.stop(),this.inputStream.removeTrack(t)}};pause=async e=>{let t=this.inputStream.getTracks();for(let n of t)n.enabled=!e};getStream=()=>this.filterStream(this.outputStream);setMute=(e=!0)=>{this.mute=e,this.analyserNode.disconnect(),e===!1&&this.analyserNode.connect(this.outputGainNode)};setDenoise=async(e=!0)=>{this.rnnoiseWorklet&&(this.inputGainNode.disconnect(),this.rnnoiseWorklet.destroy(),e?(this.rnnoiseWorkletNode=await this.rnnoiseWorklet.createRnnoiseWorkletNode(this.audioContext),this.inputGainNode.connect(this.rnnoiseWorkletNode),this.rnnoiseWorkletNode.connect(this.enhanceGainNode)):this.inputGainNode.connect(this.enhanceGainNode),this.denoise=e)};setInputGain=e=>{this.inputGain=e,this.inputGainNode.gain.setValueAtTime(e,this.audioContext.currentTime)};setEnhanceGain=async e=>{this.enhanceGain=e+1,this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime)};setBgsGain=e=>{this.bgsGain=e,this.bgsGainNode.gain.setValueAtTime(e,this.audioContext.currentTime)};setBgmGain=e=>{this.bgmGain=e,this.bgmGainNode.gain.setValueAtTime(e,this.audioContext.currentTime)};setOutputGain=e=>{this.outputGain=e,this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime)};getVolume=()=>{let{analyserNode:e,analyserArrayData:t}=this;e.getByteFrequencyData(t);let n=0;for(let e=0;e<t.length;e++)n+=t[e];return Math.ceil(n/t.length)};mixAudio=(e,t=`bgm`)=>new Promise(async(n,r)=>{try{{let e=this.mixAudioMap.get(t);e&&e.stop()}let r=t===`bgs`?this.bgsGainNode:this.bgmGainNode,i=this.audioContext.createBufferSource();this.mixAudioMap.set(t,i),i.buffer=e,i.connect(r),i.onended=()=>{i.disconnect(r),this.mixAudioMap.delete(t),n(!0)},i.start(0)}catch(e){r(e)}});mixAudioStop=e=>{this.mixAudioMap.get(e)?.stop()};changeMix=(e,t)=>{let n=e===`bgs`?this.bgsGainNode:this.bgmGainNode;t?n.connect(this.destinationNode):n.disconnect(this.destinationNode)}},Xi=class{config;localMedias;id=``;isSelf=!1;isOwner=!1;isAdmin=!1;tracks={};network={egress:0,ingress:0};callAction=0;permissions=1;behavior=0;streamControls={};streams={mc_audio:new MediaStream,mc_video:new MediaStream,ss_video:new MediaStream,ss_audio:new MediaStream};constructor({config:e,localMedias:t}){this.config=e,this.localMedias=t;for(let e of M)switch(e){case`mc_audio`:case`ss_audio`:{let t=new MediaStream,n=this.localMedias.getPhoneyStreamTrack(e);t.addTrack(n);let r=new Yi(t,this.localMedias.audioContext);this.streamControls[e]=r,this.streams[e]=r.getStream()}break;default:{let t=new MediaStream,n=this.localMedias.getPhoneyStreamTrack(e);t.addTrack(n),this.streams[e]=t}break}}setMute=(e,t)=>{for(let n of e){let e=this.streamControls[n];e&&e.setMute(t)}};updateCallAction=e=>{this.callAction=e};updatePermissions=e=>{this.permissions=e};updateBehavior=e=>{this.behavior=e};updateNetwork=e=>{let{egress:t,ingress:n}=this.network,r=e.egress===t&&e.ingress===n;return r===!1&&(this.network=e),r};updateTracks=(e,t=!1)=>{let n=this.isSelf?`local`:`remote`;for(let r of e){let{type:e,trackName:i,mid:a}=r;if(e===void 0||i===void 0||!a)continue;let o=M[e];t===!0||!this.tracks[o]?this.tracks[o]={type:e,trackName:i,mid:a,location:n,mediaType:o,origin:`phoney`,enabled:!1,simulcast:`f`,msid:``}:(this.tracks[o].mid=a,this.tracks[o].trackName=i)}};getTrack=e=>this.tracks[e];getTracks=e=>{let t=[];for(let n of e){let e=this.tracks[n];e&&t.push(e)}return t};removeTracks=e=>{let t=[];for(let n of e){let e=this.tracks[n];e&&(t.push(e),delete this.tracks[n])}return t};replaceMediaStreamTrack=(e,t)=>{switch(e){case`mc_audio`:case`ss_audio`:this.streamControls[e]?.replaceTrack(t);break;default:{let n=this.streams[e],r=n.getTracks();for(let e of r)n.removeTrack(e);n.addTrack(t)}break}};getStream=e=>{let t=this.streams[e];if(!t)throw Error(`There is no mediaTrack of type streams[${JSON.stringify(e)}].`);return t};getStreams=()=>this.streams;getUserMediaStreamContext=e=>this.streamControls[e];usePhoneyStream=e=>{for(let t of e){let e=this.localMedias.getPhoneyStreamTrack(t);this.replaceMediaStreamTrack(t,e);let n=this.getTrack(t);n&&(n.origin=`phoney`,n.msid=``,n.enabled=!1)}};getInfo=()=>{let{id:e,isOwner:t,isSelf:n,isAdmin:r,callAction:i,permissions:a,behavior:o,network:s}=this,c=[];for(let e of M){let t=this.tracks[e];t&&c.push({...t})}return{id:e,isOwner:t,isAdmin:r,isSelf:n,callAction:i,permissions:a,behavior:o,network:s,tracks:c}}};function Zi(e){return Array.from(e.values())}function Qi(e){return e}function $i(e,t){if(!t)return Qi([]);let n=Zi(e),r=new Map(n.map(e=>[e.id,e])),i,a;for(let e of n)if(e.type===`media-source`&&e.trackIdentifier===t.id){a=e;break}if(a){for(let e of n)if(e.type===`outbound-rtp`&&e.mediaSourceId===a.id){i=e;break}}if(!i){for(let e of n)if(e.type===`outbound-rtp`&&(e.trackId===t.id||e.trackIdentifier===t.id)){i=e;break}}if(!i)return Qi([]);let o=new Set([i.id]);a&&o.add(a.id);for(let e of n)e.type===`remote-inbound-rtp`&&e.localId===i.id&&o.add(e.id);let s=i.codecId;return s&&r.has(s)&&o.add(s),Qi(n.filter(e=>o.has(e.id)))}function ea(e,t,n){let r=Zi(e),i=new Map(r.map(e=>[e.id,e])),a;if(t){for(let e of r)if(e.type===`inbound-rtp`&&(e.trackIdentifier===t.id||e.trackId===t.id)){a=e;break}}if(!a&&n!=null&&n!==``){for(let e of r)if(e.type===`inbound-rtp`&&e.mid===n){a=e;break}}if(!a)return Qi([]);let o=new Set([a.id]),s=a.transportId;if(s){let e=!1;for(let t of r)if(t.type===`candidate-pair`&&t.transportId===s&&(t.nominated===!0||t.state===`succeeded`)){o.add(t.id),e=!0;break}if(!e){for(let e of r)if(e.type===`candidate-pair`&&e.transportId===s){o.add(e.id);break}}}let c=a.codecId;c&&i.has(c)&&o.add(c);for(let e of r)if(e.type===`remote-outbound-rtp`&&e.localId===a.id){o.add(e.id);break}return Qi(r.filter(e=>o.has(e.id)))}var ta=class extends Xi{published={mc_audio:!1,mc_video:!1,ss_video:!1,ss_audio:!1};tracksAnalysis={sfu:{sends:{mc_audio:new Ji,mc_video:new Ji,ss_video:new Ji,ss_audio:new Ji}}};constructor({config:e,localMedias:t}){super({config:e,localMedias:t}),this.isSelf=!0}getTrackReports=e=>this.tracksAnalysis.sfu.sends[e].trackReport;generateTrackAnalysis=async(e,t)=>{if(e.pc.connectionState===`connected`)for(let n of M){let r=$i(t,e.getSenderTrack(n)??null);this.tracksAnalysis.sfu.sends[n].applyFromReports(r)}};setPublished=(e,t)=>{for(let n of e)this.published[n]=t};setActiveNoise=(e,t)=>{this.getUserMediaStreamContext(e)?.setDenoise(t)};updateSelfCallAction=()=>{let e=``,t=e=>{let t=M[e];return this.tracks[t]?.origin===`local`?`1`:`0`};e=`${t(0)}${e}`,e=`${t(1)}${e}`,e=`${t(2)}${e}`,e=`${t(3)}${e}`;let n=parseInt(e,2);return this.updateCallAction(n),n};checkBanBehavior=e=>{let{behavior:t}=this,n=!1,r=j(t);for(let t of e)if(r[t]===!0){n=!0;break}return n};hasPermissions=e=>this.config.callType===1||this.isAdmin===!0?!0:A(this.permissions)[e];useLocalStream=e=>{for(let t of e){let e=this.localMedias.getLocalStreamTrack(t);if(!e)continue;this.replaceMediaStreamTrack(t,e);let n=this.getTrack(t);n&&(n.origin=`local`,n.msid=``,n.enabled=!0)}};clear=()=>{this.tracks={},this.network={egress:0,ingress:0},this.isOwner=!1,this.isAdmin=!1,this.setPublished(M,!1)}},na=4,ra=0,ia=1,aa=2;function oa(e){let t=e.length;for(;--t>=0;)e[t]=0}var sa=0,ca=1,la=2,ua=3,da=258,fa=29,pa=256,ma=pa+1+fa,ha=30,ga=19,_a=2*ma+1,va=15,ya=16,ba=7,xa=256,Sa=16,Ca=17,wa=18,Ta=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Ea=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Da=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Oa=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ka=512,Aa=Array((ma+2)*2);oa(Aa);var ja=Array(ha*2);oa(ja);var Ma=Array(ka);oa(Ma);var Na=Array(da-ua+1);oa(Na);var Pa=Array(fa);oa(Pa);var Fa=Array(ha);oa(Fa);function Ia(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}var La,Ra,za;function Ba(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}var Va=e=>e<256?Ma[e]:Ma[256+(e>>>7)],Ha=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},V=(e,t,n)=>{e.bi_valid>ya-n?(e.bi_buf|=t<<e.bi_valid&65535,Ha(e,e.bi_buf),e.bi_buf=t>>ya-e.bi_valid,e.bi_valid+=n-ya):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Ua=(e,t,n)=>{V(e,n[t*2],n[t*2+1])},Wa=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},Ga=e=>{e.bi_valid===16?(Ha(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},Ka=(e,t)=>{let n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,d,f,p,m,h=0;for(f=0;f<=va;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<_a;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}},qa=(e,t,n)=>{let r=Array(va+1),i=0,a,o;for(a=1;a<=va;a++)i=i+n[a-1]<<1,r[a]=i;for(o=0;o<=t;o++){let t=e[o*2+1];t!==0&&(e[o*2]=Wa(r[t]++,t))}},Ja=()=>{let e,t,n,r,i,a=Array(va+1);for(n=0,r=0;r<fa-1;r++)for(Pa[r]=n,e=0;e<1<<Ta[r];e++)Na[n++]=r;for(Na[n-1]=r,i=0,r=0;r<16;r++)for(Fa[r]=i,e=0;e<1<<Ea[r];e++)Ma[i++]=r;for(i>>=7;r<ha;r++)for(Fa[r]=i<<7,e=0;e<1<<Ea[r]-7;e++)Ma[256+ i++]=r;for(t=0;t<=va;t++)a[t]=0;for(e=0;e<=143;)Aa[e*2+1]=8,e++,a[8]++;for(;e<=255;)Aa[e*2+1]=9,e++,a[9]++;for(;e<=279;)Aa[e*2+1]=7,e++,a[7]++;for(;e<=287;)Aa[e*2+1]=8,e++,a[8]++;for(qa(Aa,ma+1,a),e=0;e<ha;e++)ja[e*2+1]=5,ja[e*2]=Wa(e,5);La=new Ia(Aa,Ta,pa+1,ma,va),Ra=new Ia(ja,Ea,0,ha,va),za=new Ia([],Da,0,ga,ba)},Ya=e=>{let t;for(t=0;t<ma;t++)e.dyn_ltree[t*2]=0;for(t=0;t<ha;t++)e.dyn_dtree[t*2]=0;for(t=0;t<ga;t++)e.bl_tree[t*2]=0;e.dyn_ltree[xa*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Xa=e=>{e.bi_valid>8?Ha(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Za=(e,t,n,r)=>{let i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},Qa=(e,t,n)=>{let r=e.heap[n],i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&Za(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Za(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},$a=(e,t,n)=>{let r,i,a=0,o,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+ a++]&255,r+=(e.pending_buf[e.sym_buf+ a++]&255)<<8,i=e.pending_buf[e.sym_buf+ a++],r===0?Ua(e,i,t):(o=Na[i],Ua(e,o+pa+1,t),s=Ta[o],s!==0&&(i-=Pa[o],V(e,i,s)),r--,o=Va(r),Ua(e,o,n),s=Ea[o],s!==0&&(r-=Fa[o],V(e,r,s)));while(a<e.sym_next);Ua(e,xa,t)},eo=(e,t)=>{let n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=_a,o=0;o<a;o++)n[o*2]===0?n[o*2+1]=0:(e.heap[++e.heap_len]=c=o,e.depth[o]=0);for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)Qa(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Qa(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,Qa(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Ka(e,t),qa(n,c,e.bl_count)},to=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a===0?s<=10?e.bl_tree[Ca*2]++:e.bl_tree[wa*2]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[Sa*2]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))},no=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do Ua(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(Ua(e,Ca,e.bl_tree),V(e,s-3,3)):(Ua(e,wa,e.bl_tree),V(e,s-11,7)):(a!==i&&(Ua(e,a,e.bl_tree),s--),Ua(e,Sa,e.bl_tree),V(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}},ro=e=>{let t;for(to(e,e.dyn_ltree,e.l_desc.max_code),to(e,e.dyn_dtree,e.d_desc.max_code),eo(e,e.bl_desc),t=ga-1;t>=3&&e.bl_tree[Oa[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},io=(e,t,n,r)=>{let i;for(V(e,t-257,5),V(e,n-1,5),V(e,r-4,4),i=0;i<r;i++)V(e,e.bl_tree[Oa[i]*2+1],3);no(e,e.dyn_ltree,t-1),no(e,e.dyn_dtree,n-1)},ao=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return ra;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return ia;for(n=32;n<pa;n++)if(e.dyn_ltree[n*2]!==0)return ia;return ra},oo=!1,so=e=>{oo||=(Ja(),!0),e.l_desc=new Ba(e.dyn_ltree,La),e.d_desc=new Ba(e.dyn_dtree,Ra),e.bl_desc=new Ba(e.bl_tree,za),e.bi_buf=0,e.bi_valid=0,Ya(e)},co=(e,t,n,r)=>{V(e,(sa<<1)+(r?1:0),3),Xa(e),Ha(e,n),Ha(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},lo={_tr_init:so,_tr_stored_block:co,_tr_flush_block:(e,t,n,r)=>{let i,a,o=0;e.level>0?(e.strm.data_type===aa&&(e.strm.data_type=ao(e)),eo(e,e.l_desc),eo(e,e.d_desc),o=ro(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?co(e,t,n,r):e.strategy===na||a===i?(V(e,(ca<<1)+(r?1:0),3),$a(e,Aa,ja)):(V(e,(la<<1)+(r?1:0),3),io(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),$a(e,e.dyn_ltree,e.dyn_dtree)),Ya(e),r&&Xa(e)},_tr_tally:(e,t,n)=>(e.pending_buf[e.sym_buf+ e.sym_next++]=t,e.pending_buf[e.sym_buf+ e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+ e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Na[n]+pa+1)*2]++,e.dyn_dtree[Va(t)*2]++),e.sym_next===e.sym_end),_tr_align:e=>{V(e,ca<<1,3),Ua(e,xa,Aa),Ga(e)}},uo=(e,t,n,r)=>{let i=e&65535|0,a=e>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},fo=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t})()),H=(e,t,n,r)=>{let i=fo,a=r+n;e^=-1;for(let n=r;n<a;n++)e=e>>>8^i[(e^t[n])&255];return e^-1},po={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`},mo={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:ho,_tr_stored_block:go,_tr_flush_block:_o,_tr_tally:vo,_tr_align:yo}=lo,{Z_NO_FLUSH:bo,Z_PARTIAL_FLUSH:xo,Z_FULL_FLUSH:So,Z_FINISH:U,Z_BLOCK:Co,Z_OK:W,Z_STREAM_END:wo,Z_STREAM_ERROR:To,Z_DATA_ERROR:Eo,Z_BUF_ERROR:Do,Z_DEFAULT_COMPRESSION:Oo,Z_FILTERED:ko,Z_HUFFMAN_ONLY:Ao,Z_RLE:jo,Z_FIXED:Mo,Z_DEFAULT_STRATEGY:No,Z_UNKNOWN:Po,Z_DEFLATED:Fo}=mo,Io=9,Lo=15,Ro=8,zo=286,Bo=30,Vo=19,Ho=2*zo+1,Uo=15,G=3,Wo=258,Go=Wo+G+1,Ko=32,qo=42,Jo=57,Yo=69,Xo=73,Zo=91,Qo=103,$o=113,es=666,K=1,ts=2,ns=3,rs=4,is=3,as=(e,t)=>(e.msg=po[t],t),os=e=>e*2-(e>4?9:0),ss=e=>{let t=e.length;for(;--t>=0;)e[t]=0},cs=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)},ls=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,q=e=>{let t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},J=(e,t)=>{_o(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,q(e.strm)},Y=(e,t)=>{e.pending_buf[e.pending++]=t},us=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},ds=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=uo(e.adler,t,i,n):e.state.wrap===2&&(e.adler=H(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},fs=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-Go?e.strstart-(e.w_size-Go):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+Wo,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(i=t,l[i+o]!==m||l[i+o-1]!==p||l[i]!==l[r]||l[++i]!==l[r+1])continue;r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=Wo-(f-r),r=f-Wo,a>o){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead},ps=e=>{let t=e.w_size,n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Go)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),cs(e),r+=t),e.strm.avail_in===0)break;if(n=ds(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=G)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=ls(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=ls(e,e.ins_h,e.window[i+G-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<G)););}while(e.lookahead<Go&&e.strm.avail_in!==0)},ms=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,a,o=0,s=e.strm.avail_in;do{if(r=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>a&&(r=a),r<n&&(r===0&&t!==U||t===bo||r!==i+e.strm.avail_in)))break;o=t===U&&r===i+e.strm.avail_in?1:0,go(e,0,0,o),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,q(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(ds(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(o===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?rs:t!==bo&&t!==U&&e.strm.avail_in===0&&e.strstart===e.block_start?ts:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(ds(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,n=a>e.w_size?e.w_size:a,i=e.strstart-e.block_start,(i>=n||(i||t===U)&&t!==bo&&e.strm.avail_in===0&&i<=a)&&(r=i>a?a:i,o=t===U&&e.strm.avail_in===0&&r===i?1:0,go(e,e.block_start,r,o),e.block_start+=r,q(e.strm)),o?ns:K)},hs=(e,t)=>{let n,r;for(;;){if(e.lookahead<Go){if(ps(e),e.lookahead<Go&&t===bo)return K;if(e.lookahead===0)break}if(n=0,e.lookahead>=G&&(e.ins_h=ls(e,e.ins_h,e.window[e.strstart+G-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-Go&&(e.match_length=fs(e,n)),e.match_length>=G)if(r=vo(e,e.strstart-e.match_start,e.match_length-G),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=G){e.match_length--;do e.strstart++,e.ins_h=ls(e,e.ins_h,e.window[e.strstart+G-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=ls(e,e.ins_h,e.window[e.strstart+1]);else r=vo(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(J(e,!1),e.strm.avail_out===0))return K}return e.insert=e.strstart<G-1?e.strstart:G-1,t===U?(J(e,!0),e.strm.avail_out===0?ns:rs):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?K:ts},gs=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<Go){if(ps(e),e.lookahead<Go&&t===bo)return K;if(e.lookahead===0)break}if(n=0,e.lookahead>=G&&(e.ins_h=ls(e,e.ins_h,e.window[e.strstart+G-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=G-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Go&&(e.match_length=fs(e,n),e.match_length<=5&&(e.strategy===ko||e.match_length===G&&e.strstart-e.match_start>4096)&&(e.match_length=G-1)),e.prev_length>=G&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-G,r=vo(e,e.strstart-1-e.prev_match,e.prev_length-G),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=ls(e,e.ins_h,e.window[e.strstart+G-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=G-1,e.strstart++,r&&(J(e,!1),e.strm.avail_out===0))return K}else if(e.match_available){if(r=vo(e,0,e.window[e.strstart-1]),r&&J(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return K}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=vo(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<G-1?e.strstart:G-1,t===U?(J(e,!0),e.strm.avail_out===0?ns:rs):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?K:ts},_s=(e,t)=>{let n,r,i,a,o=e.window;for(;;){if(e.lookahead<=Wo){if(ps(e),e.lookahead<=Wo&&t===bo)return K;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=G&&e.strstart>0&&(i=e.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=e.strstart+Wo;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);e.match_length=Wo-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=G?(n=vo(e,1,e.match_length-G),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=vo(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(J(e,!1),e.strm.avail_out===0))return K}return e.insert=0,t===U?(J(e,!0),e.strm.avail_out===0?ns:rs):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?K:ts},vs=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(ps(e),e.lookahead===0)){if(t===bo)return K;break}if(e.match_length=0,n=vo(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(J(e,!1),e.strm.avail_out===0))return K}return e.insert=0,t===U?(J(e,!0),e.strm.avail_out===0?ns:rs):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?K:ts};function ys(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var bs=[new ys(0,0,0,0,ms),new ys(4,4,8,4,hs),new ys(4,5,16,8,hs),new ys(4,6,32,32,hs),new ys(4,4,16,16,gs),new ys(8,16,32,32,gs),new ys(8,16,128,128,gs),new ys(8,32,128,256,gs),new ys(32,128,258,1024,gs),new ys(32,258,258,4096,gs)],xs=e=>{e.window_size=2*e.w_size,ss(e.head),e.max_lazy_match=bs[e.level].max_lazy,e.good_match=bs[e.level].good_length,e.nice_match=bs[e.level].nice_length,e.max_chain_length=bs[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=G-1,e.match_available=0,e.ins_h=0};function Ss(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Fo,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Ho*2),this.dyn_dtree=new Uint16Array((2*Bo+1)*2),this.bl_tree=new Uint16Array((2*Vo+1)*2),ss(this.dyn_ltree),ss(this.dyn_dtree),ss(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Uo+1),this.heap=new Uint16Array(2*zo+1),ss(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*zo+1),ss(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Cs=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.status!==qo&&t.status!==Jo&&t.status!==Yo&&t.status!==Xo&&t.status!==Zo&&t.status!==Qo&&t.status!==$o&&t.status!==es?1:0},ws=e=>{if(Cs(e))return as(e,To);e.total_in=e.total_out=0,e.data_type=Po;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?Jo:t.wrap?qo:$o,e.adler=t.wrap===2?0:1,t.last_flush=-2,ho(t),W},Ts=e=>{let t=ws(e);return t===W&&xs(e.state),t},Es=(e,t)=>Cs(e)||e.state.wrap!==2?To:(e.state.gzhead=t,W),Ds=(e,t,n,r,i,a)=>{if(!e)return To;let o=1;if(t===Oo&&(t=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>Io||n!==Fo||r<8||r>15||t<0||t>9||a<0||a>Mo||r===8&&o!==1)return as(e,To);r===8&&(r=9);let s=new Ss;return e.state=s,s.strm=e,s.status=qo,s.wrap=o,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+G-1)/G),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=t,s.strategy=a,s.method=n,Ts(e)},Os={deflateInit:(e,t)=>Ds(e,t,Fo,Lo,Ro,No),deflateInit2:Ds,deflateReset:Ts,deflateResetKeep:ws,deflateSetHeader:Es,deflate:(e,t)=>{if(Cs(e)||t>Co||t<0)return e?as(e,To):To;let n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===es&&t!==U)return as(e,e.avail_out===0?Do:To);let r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(q(e),e.avail_out===0)return n.last_flush=-1,W}else if(e.avail_in===0&&os(t)<=os(r)&&t!==U)return as(e,Do);if(n.status===es&&e.avail_in!==0)return as(e,Do);if(n.status===qo&&n.wrap===0&&(n.status=$o),n.status===qo){let t=Fo+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=Ao||n.level<2?0:n.level<6?1:n.level===6?2:3,t|=r<<6,n.strstart!==0&&(t|=Ko),t+=31-t%31,us(n,t),n.strstart!==0&&(us(n,e.adler>>>16),us(n,e.adler&65535)),e.adler=1,n.status=$o,q(e),n.pending!==0)return n.last_flush=-1,W}if(n.status===Jo){if(e.adler=0,Y(n,31),Y(n,139),Y(n,8),n.gzhead)Y(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Y(n,n.gzhead.time&255),Y(n,n.gzhead.time>>8&255),Y(n,n.gzhead.time>>16&255),Y(n,n.gzhead.time>>24&255),Y(n,n.level===9?2:n.strategy>=Ao||n.level<2?4:0),Y(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(Y(n,n.gzhead.extra.length&255),Y(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=H(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Yo;else if(Y(n,0),Y(n,0),Y(n,0),Y(n,0),Y(n,0),Y(n,n.level===9?2:n.strategy>=Ao||n.level<2?4:0),Y(n,is),n.status=$o,q(e),n.pending!==0)return n.last_flush=-1,W}if(n.status===Yo){if(n.gzhead.extra){let t=n.pending,r=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=H(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,q(e),n.pending!==0)return n.last_flush=-1,W;t=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=H(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=Xo}if(n.status===Xo){if(n.gzhead.name){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=H(e.adler,n.pending_buf,n.pending-t,t)),q(e),n.pending!==0)return n.last_flush=-1,W;t=0}r=n.gzindex<n.gzhead.name.length?n.gzhead.name.charCodeAt(n.gzindex++)&255:0,Y(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=H(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=Zo}if(n.status===Zo){if(n.gzhead.comment){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=H(e.adler,n.pending_buf,n.pending-t,t)),q(e),n.pending!==0)return n.last_flush=-1,W;t=0}r=n.gzindex<n.gzhead.comment.length?n.gzhead.comment.charCodeAt(n.gzindex++)&255:0,Y(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=H(e.adler,n.pending_buf,n.pending-t,t))}n.status=Qo}if(n.status===Qo){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(q(e),n.pending!==0))return n.last_flush=-1,W;Y(n,e.adler&255),Y(n,e.adler>>8&255),e.adler=0}if(n.status=$o,q(e),n.pending!==0)return n.last_flush=-1,W}if(e.avail_in!==0||n.lookahead!==0||t!==bo&&n.status!==es){let r=n.level===0?ms(n,t):n.strategy===Ao?vs(n,t):n.strategy===jo?_s(n,t):bs[n.level].func(n,t);if((r===ns||r===rs)&&(n.status=es),r===K||r===ns)return e.avail_out===0&&(n.last_flush=-1),W;if(r===ts&&(t===xo?yo(n):t!==Co&&(go(n,0,0,!1),t===So&&(ss(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),q(e),e.avail_out===0))return n.last_flush=-1,W}return t===U?n.wrap<=0?wo:(n.wrap===2?(Y(n,e.adler&255),Y(n,e.adler>>8&255),Y(n,e.adler>>16&255),Y(n,e.adler>>24&255),Y(n,e.total_in&255),Y(n,e.total_in>>8&255),Y(n,e.total_in>>16&255),Y(n,e.total_in>>24&255)):(us(n,e.adler>>>16),us(n,e.adler&65535)),q(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending===0?wo:W):W},deflateEnd:e=>{if(Cs(e))return To;let t=e.state.status;return e.state=null,t===$o?as(e,Eo):W},deflateSetDictionary:(e,t)=>{let n=t.length;if(Cs(e))return To;let r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==qo||r.lookahead)return To;if(i===1&&(e.adler=uo(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(ss(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}let a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,ps(r);r.lookahead>=G;){let e=r.strstart,t=r.lookahead-(G-1);do r.ins_h=ls(r,r.ins_h,r.window[e+G-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++;while(--t);r.strstart=e,r.lookahead=G-1,ps(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=G-1,r.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,r.wrap=i,W},deflateInfo:`pako deflate (from Nodeca project)`},ks=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),As={assign:function(e){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let n=t.shift();if(n){if(typeof n!=`object`)throw TypeError(n+`must be non-object`);for(let t in n)ks(n,t)&&(e[t]=n[t])}}return e},flattenChunks:e=>{let t=0;for(let n=0,r=e.length;n<r;n++)t+=e[n].length;let n=new Uint8Array(t);for(let t=0,r=0,i=e.length;t<i;t++){let i=e[t];n.set(i,r),r+=i.length}return n}},js=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{js=!1}var Ms=new Uint8Array(256);for(let e=0;e<256;e++)Ms[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Ms[254]=Ms[254]=1;var Ns=e=>{if(typeof TextEncoder==`function`&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,i,a,o=e.length,s=0;for(i=0;i<o;i++)n=e.charCodeAt(i),(n&64512)==55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)==56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),a=0,i=0;a<s;i++)n=e.charCodeAt(i),(n&64512)==55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)==56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|n&63):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|n&63):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|n&63);return t},Ps=(e,t)=>{if(t<65534&&e.subarray&&js)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n=``;for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n},Fs={string2buf:Ns,buf2string:(e,t)=>{let n=t||e.length;if(typeof TextDecoder==`function`&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,i,a=Array(n*2);for(i=0,r=0;r<n;){let t=e[r++];if(t<128){a[i++]=t;continue}let o=Ms[t];if(o>4){a[i++]=65533,r+=o-1;continue}for(t&=o===2?31:o===3?15:7;o>1&&r<n;)t=t<<6|e[r++]&63,o--;if(o>1){a[i++]=65533;continue}t<65536?a[i++]=t:(t-=65536,a[i++]=55296|t>>10&1023,a[i++]=56320|t&1023)}return Ps(a,i)},utf8border:(e,t)=>{t||=e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)==128;)n--;return n<0||n===0?t:n+Ms[e[n]]>t?n:t}};function Is(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}var Ls=Is,Rs=Object.prototype.toString,{Z_NO_FLUSH:zs,Z_SYNC_FLUSH:Bs,Z_FULL_FLUSH:Vs,Z_FINISH:Hs,Z_OK:Us,Z_STREAM_END:Ws,Z_DEFAULT_COMPRESSION:Gs,Z_DEFAULT_STRATEGY:Ks,Z_DEFLATED:qs}=mo;function Js(e){this.options=As.assign({level:Gs,method:qs,chunkSize:16384,windowBits:15,memLevel:8,strategy:Ks},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new Ls,this.strm.avail_out=0;let n=Os.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Us)throw Error(po[n]);if(t.header&&Os.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e=typeof t.dictionary==`string`?Fs.string2buf(t.dictionary):Rs.call(t.dictionary)===`[object ArrayBuffer]`?new Uint8Array(t.dictionary):t.dictionary,n=Os.deflateSetDictionary(this.strm,e),n!==Us)throw Error(po[n]);this._dict_set=!0}}Js.prototype.push=function(e,t){let n=this.strm,r=this.options.chunkSize,i,a;if(this.ended)return!1;for(a=t===~~t?t:t===!0?Hs:zs,typeof e==`string`?n.input=Fs.string2buf(e):Rs.call(e)===`[object ArrayBuffer]`?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(a===Bs||a===Vs)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=Os.deflate(n,a),i===Ws)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=Os.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Us;if(n.avail_out===0){this.onData(n.output);continue}if(a>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0},Js.prototype.onData=function(e){this.chunks.push(e)},Js.prototype.onEnd=function(e){e===Us&&(this.result=As.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ys(e,t){let n=new Js(t);if(n.push(e,!0),n.err)throw n.msg||po[n.err];return n.result}function Xs(e,t){return t||={},t.raw=!0,Ys(e,t)}function Zs(e,t){return t||={},t.gzip=!0,Ys(e,t)}var Qs={Deflate:Js,deflate:Ys,deflateRaw:Xs,gzip:Zs,constants:mo},$s=16209,ec=16191,tc=function(e,t){let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E=e.state;n=e.next_in,w=e.input,r=n+(e.avail_in-5),i=e.next_out,T=e.output,a=i-(t-e.avail_out),o=i+(e.avail_out-257),s=E.dmax,c=E.wsize,l=E.whave,u=E.wnext,d=E.window,f=E.hold,p=E.bits,m=E.lencode,h=E.distcode,g=(1<<E.lenbits)-1,_=(1<<E.distbits)-1;top:do{p<15&&(f+=w[n++]<<p,p+=8,f+=w[n++]<<p,p+=8),v=m[f&g];dolen:for(;;){if(y=v>>>24,f>>>=y,p-=y,y=v>>>16&255,y===0)T[i++]=v&65535;else if(y&16){b=v&65535,y&=15,y&&(p<y&&(f+=w[n++]<<p,p+=8),b+=f&(1<<y)-1,f>>>=y,p-=y),p<15&&(f+=w[n++]<<p,p+=8,f+=w[n++]<<p,p+=8),v=h[f&_];dodist:for(;;){if(y=v>>>24,f>>>=y,p-=y,y=v>>>16&255,y&16){if(x=v&65535,y&=15,p<y&&(f+=w[n++]<<p,p+=8,p<y&&(f+=w[n++]<<p,p+=8)),x+=f&(1<<y)-1,x>s){e.msg=`invalid distance too far back`,E.mode=$s;break top}if(f>>>=y,p-=y,y=i-a,x>y){if(y=x-y,y>l&&E.sane){e.msg=`invalid distance too far back`,E.mode=$s;break top}if(S=0,C=d,u===0){if(S+=c-y,y<b){b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}}else if(u<y){if(S+=c+u-y,y-=u,y<b){b-=y;do T[i++]=d[S++];while(--y);if(S=0,u<b){y=u,b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}}}else if(S+=u-y,y<b){b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}for(;b>2;)T[i++]=C[S++],T[i++]=C[S++],T[i++]=C[S++],b-=3;b&&(T[i++]=C[S++],b>1&&(T[i++]=C[S++]))}else{S=i-x;do T[i++]=T[S++],T[i++]=T[S++],T[i++]=T[S++],b-=3;while(b>2);b&&(T[i++]=T[S++],b>1&&(T[i++]=T[S++]))}}else if(y&64){e.msg=`invalid distance code`,E.mode=$s;break top}else{v=h[(v&65535)+(f&(1<<y)-1)];continue dodist}break}}else if(!(y&64)){v=m[(v&65535)+(f&(1<<y)-1)];continue dolen}else if(y&32){E.mode=ec;break top}else{e.msg=`invalid literal/length code`,E.mode=$s;break top}break}}while(n<r&&i<o);b=p>>3,n-=b,p-=b<<3,f&=(1<<p)-1,e.next_in=n,e.next_out=i,e.avail_in=n<r?5+(r-n):5-(n-r),e.avail_out=i<o?257+(o-i):257-(i-o),E.hold=f,E.bits=p},nc=15,rc=852,ic=592,ac=0,oc=1,sc=2,cc=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),lc=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),uc=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),dc=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),fc=(e,t,n,r,i,a,o,s)=>{let c=s.bits,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y,b,x,S,C,w=null,T,E=new Uint16Array(nc+1),D=new Uint16Array(nc+1),ee=null,O,k,te;for(l=0;l<=nc;l++)E[l]=0;for(u=0;u<r;u++)E[t[n+u]]++;for(p=c,f=nc;f>=1&&E[f]===0;f--);if(p>f&&(p=f),f===0)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(d=1;d<f&&E[d]===0;d++);for(p<d&&(p=d),g=1,l=1;l<=nc;l++)if(g<<=1,g-=E[l],g<0)return-1;if(g>0&&(e===ac||f!==1))return-1;for(D[1]=0,l=1;l<nc;l++)D[l+1]=D[l]+E[l];for(u=0;u<r;u++)t[n+u]!==0&&(o[D[t[n+u]]++]=u);if(e===ac?(w=ee=o,T=20):e===oc?(w=cc,ee=lc,T=257):(w=uc,ee=dc,T=0),v=0,u=0,l=d,C=a,m=p,h=0,x=-1,_=1<<p,S=_-1,e===oc&&_>rc||e===sc&&_>ic)return 1;for(;;){O=l-h,o[u]+1<T?(k=0,te=o[u]):o[u]>=T?(k=ee[o[u]-T],te=w[o[u]-T]):(k=96,te=0),y=1<<l-h,b=1<<m,d=b;do b-=y,i[C+(v>>h)+b]=O<<24|k<<16|te|0;while(b!==0);for(y=1<<l-1;v&y;)y>>=1;if(y===0?v=0:(v&=y-1,v+=y),u++,--E[l]===0){if(l===f)break;l=t[n+o[u]]}if(l>p&&(v&S)!==x){for(h===0&&(h=p),C+=d,m=l-h,g=1<<m;m+h<f&&(g-=E[m+h],!(g<=0));)m++,g<<=1;if(_+=1<<m,e===oc&&_>rc||e===sc&&_>ic)return 1;x=v&S,i[x]=p<<24|m<<16|C-a|0}}return v!==0&&(i[C+v]=l-h<<24|4194304),s.bits=p,0},pc=0,mc=1,hc=2,{Z_FINISH:gc,Z_BLOCK:_c,Z_TREES:vc,Z_OK:yc,Z_STREAM_END:bc,Z_NEED_DICT:xc,Z_STREAM_ERROR:X,Z_DATA_ERROR:Sc,Z_MEM_ERROR:Cc,Z_BUF_ERROR:wc,Z_DEFLATED:Tc}=mo,Ec=16180,Dc=16181,Oc=16182,kc=16183,Ac=16184,jc=16185,Mc=16186,Nc=16187,Pc=16188,Fc=16189,Ic=16190,Lc=16191,Rc=16192,zc=16193,Bc=16194,Vc=16195,Hc=16196,Uc=16197,Wc=16198,Gc=16199,Kc=16200,qc=16201,Jc=16202,Yc=16203,Xc=16204,Zc=16205,Qc=16206,$c=16207,el=16208,Z=16209,tl=16210,nl=16211,rl=852,il=592,al=15,ol=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function sl(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var cl=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.mode<Ec||t.mode>nl?1:0},ll=e=>{if(cl(e))return X;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=t.wrap&1),t.mode=Ec,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(rl),t.distcode=t.distdyn=new Int32Array(il),t.sane=1,t.back=-1,yc},ul=e=>{if(cl(e))return X;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,ll(e)},dl=(e,t)=>{let n;if(cl(e))return X;let r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?X:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,ul(e))},fl=(e,t)=>{if(!e)return X;let n=new sl;e.state=n,n.strm=e,n.window=null,n.mode=Ec;let r=dl(e,t);return r!==yc&&(e.state=null),r},pl=e=>fl(e,al),ml=!0,hl,gl,_l=e=>{if(ml){hl=new Int32Array(512),gl=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(fc(mc,e.lens,0,288,hl,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;fc(hc,e.lens,0,32,gl,0,e.work,{bits:5}),ml=!1}e.lencode=hl,e.lenbits=9,e.distcode=gl,e.distbits=5},vl=(e,t,n,r)=>{let i,a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),r>=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(t.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(t.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},yl={inflateReset:ul,inflateReset2:dl,inflateResetKeep:ll,inflateInit:pl,inflateInit2:fl,inflate:(e,t)=>{let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g=0,_,v,y,b,x,S,C,w,T=new Uint8Array(4),E,D,ee=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(cl(e)||!e.output||!e.input&&e.avail_in!==0)return X;n=e.state,n.mode===Lc&&(n.mode=Rc),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,d=s,f=c,w=yc;inf_leave:for(;;)switch(n.mode){case Ec:if(n.wrap===0){n.mode=Rc;break}for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&2&&l===35615){n.wbits===0&&(n.wbits=15),n.check=0,T[0]=l&255,T[1]=l>>>8&255,n.check=H(n.check,T,2,0),l=0,u=0,n.mode=Dc;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg=`incorrect header check`,n.mode=Z;break}if((l&15)!==Tc){e.msg=`unknown compression method`,n.mode=Z;break}if(l>>>=4,u-=4,C=(l&15)+8,n.wbits===0&&(n.wbits=C),C>15||C>n.wbits){e.msg=`invalid window size`,n.mode=Z;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=l&512?Fc:Lc,l=0,u=0;break;case Dc:for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.flags=l,(n.flags&255)!==Tc){e.msg=`unknown compression method`,n.mode=Z;break}if(n.flags&57344){e.msg=`unknown header flags set`,n.mode=Z;break}n.head&&(n.head.text=l>>8&1),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=H(n.check,T,2,0)),l=0,u=0,n.mode=Oc;case Oc:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.time=l),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,T[2]=l>>>16&255,T[3]=l>>>24&255,n.check=H(n.check,T,4,0)),l=0,u=0,n.mode=kc;case kc:for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.xflags=l&255,n.head.os=l>>8),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=H(n.check,T,2,0)),l=0,u=0,n.mode=Ac;case Ac:if(n.flags&1024){for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.length=l,n.head&&(n.head.extra_len=l),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=H(n.check,T,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=jc;case jc:if(n.flags&1024&&(p=n.length,p>s&&(p=s),p&&(n.head&&(C=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+p),C)),n.flags&512&&n.wrap&4&&(n.check=H(n.check,r,p,a)),s-=p,a+=p,n.length-=p),n.length))break inf_leave;n.length=0,n.mode=Mc;case Mc:if(n.flags&2048){if(s===0)break inf_leave;p=0;do C=r[a+ p++],n.head&&C&&n.length<65536&&(n.head.name+=String.fromCharCode(C));while(C&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=H(n.check,r,p,a)),s-=p,a+=p,C)break inf_leave}else n.head&&(n.head.name=null);n.length=0,n.mode=Nc;case Nc:if(n.flags&4096){if(s===0)break inf_leave;p=0;do C=r[a+ p++],n.head&&C&&n.length<65536&&(n.head.comment+=String.fromCharCode(C));while(C&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=H(n.check,r,p,a)),s-=p,a+=p,C)break inf_leave}else n.head&&(n.head.comment=null);n.mode=Pc;case Pc:if(n.flags&512){for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&4&&l!==(n.check&65535)){e.msg=`header crc mismatch`,n.mode=Z;break}l=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Lc;break;case Fc:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}e.adler=n.check=ol(l),l=0,u=0,n.mode=Ic;case Ic:if(n.havedict===0)return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,xc;e.adler=n.check=1,n.mode=Lc;case Lc:if(t===_c||t===vc)break inf_leave;case Rc:if(n.last){l>>>=u&7,u-=u&7,n.mode=Qc;break}for(;u<3;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}switch(n.last=l&1,l>>>=1,--u,l&3){case 0:n.mode=zc;break;case 1:if(_l(n),n.mode=Gc,t===vc){l>>>=2,u-=2;break inf_leave}break;case 2:n.mode=Hc;break;case 3:e.msg=`invalid block type`,n.mode=Z}l>>>=2,u-=2;break;case zc:for(l>>>=u&7,u-=u&7;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if((l&65535)!=(l>>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=Z;break}if(n.length=l&65535,l=0,u=0,n.mode=Bc,t===vc)break inf_leave;case Bc:n.mode=Vc;case Vc:if(p=n.length,p){if(p>s&&(p=s),p>c&&(p=c),p===0)break inf_leave;i.set(r.subarray(a,a+p),o),s-=p,a+=p,c-=p,o+=p,n.length-=p;break}n.mode=Lc;break;case Hc:for(;u<14;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.nlen=(l&31)+257,l>>>=5,u-=5,n.ndist=(l&31)+1,l>>>=5,u-=5,n.ncode=(l&15)+4,l>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg=`too many length or distance symbols`,n.mode=Z;break}n.have=0,n.mode=Uc;case Uc:for(;n.have<n.ncode;){for(;u<3;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.lens[ee[n.have++]]=l&7,l>>>=3,u-=3}for(;n.have<19;)n.lens[ee[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,E={bits:n.lenbits},w=fc(pc,n.lens,0,19,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid code lengths set`,n.mode=Z;break}n.have=0,n.mode=Wc;case Wc:for(;n.have<n.nlen+n.ndist;){for(;g=n.lencode[l&(1<<n.lenbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(y<16)l>>>=_,u-=_,n.lens[n.have++]=y;else{if(y===16){for(D=_+2;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(l>>>=_,u-=_,n.have===0){e.msg=`invalid bit length repeat`,n.mode=Z;break}C=n.lens[n.have-1],p=3+(l&3),l>>>=2,u-=2}else if(y===17){for(D=_+3;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=_,u-=_,C=0,p=3+(l&7),l>>>=3,u-=3}else{for(D=_+7;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=_,u-=_,C=0,p=11+(l&127),l>>>=7,u-=7}if(n.have+p>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=Z;break}for(;p--;)n.lens[n.have++]=C}}if(n.mode===Z)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=Z;break}if(n.lenbits=9,E={bits:n.lenbits},w=fc(mc,n.lens,0,n.nlen,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid literal/lengths set`,n.mode=Z;break}if(n.distbits=6,n.distcode=n.distdyn,E={bits:n.distbits},w=fc(hc,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,E),n.distbits=E.bits,w){e.msg=`invalid distances set`,n.mode=Z;break}if(n.mode=Gc,t===vc)break inf_leave;case Gc:n.mode=Kc;case Kc:if(s>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,tc(e,f),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,n.mode===Lc&&(n.back=-1);break}for(n.back=0;g=n.lencode[l&(1<<n.lenbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(v&&!(v&240)){for(b=_,x=v,S=y;g=n.lencode[S+((l&(1<<b+x)-1)>>b)],_=g>>>24,v=g>>>16&255,y=g&65535,!(b+_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=b,u-=b,n.back+=b}if(l>>>=_,u-=_,n.back+=_,n.length=y,v===0){n.mode=Zc;break}if(v&32){n.back=-1,n.mode=Lc;break}if(v&64){e.msg=`invalid literal/length code`,n.mode=Z;break}n.extra=v&15,n.mode=qc;case qc:if(n.extra){for(D=n.extra;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Jc;case Jc:for(;g=n.distcode[l&(1<<n.distbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(!(v&240)){for(b=_,x=v,S=y;g=n.distcode[S+((l&(1<<b+x)-1)>>b)],_=g>>>24,v=g>>>16&255,y=g&65535,!(b+_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=b,u-=b,n.back+=b}if(l>>>=_,u-=_,n.back+=_,v&64){e.msg=`invalid distance code`,n.mode=Z;break}n.offset=y,n.extra=v&15,n.mode=Yc;case Yc:if(n.extra){for(D=n.extra;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=Z;break}n.mode=Xc;case Xc:if(c===0)break inf_leave;if(p=f-c,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=Z;break}p>n.wnext?(p-=n.wnext,m=n.wsize-p):m=n.wnext-p,p>n.length&&(p=n.length),h=n.window}else h=i,m=o-n.offset,p=n.length;p>c&&(p=c),c-=p,n.length-=p;do i[o++]=h[m++];while(--p);n.length===0&&(n.mode=Kc);break;case Zc:if(c===0)break inf_leave;i[o++]=n.length,c--,n.mode=Kc;break;case Qc:if(n.wrap){for(;u<32;){if(s===0)break inf_leave;s--,l|=r[a++]<<u,u+=8}if(f-=c,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?H(n.check,i,f,o-f):uo(n.check,i,f,o-f)),f=c,n.wrap&4&&(n.flags?l:ol(l))!==n.check){e.msg=`incorrect data check`,n.mode=Z;break}l=0,u=0}n.mode=$c;case $c:if(n.wrap&&n.flags){for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&4&&l!==(n.total&4294967295)){e.msg=`incorrect length check`,n.mode=Z;break}l=0,u=0}n.mode=el;case el:w=bc;break inf_leave;case Z:w=Sc;break inf_leave;case tl:return Cc;case nl:default:return X}return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,(n.wsize||f!==e.avail_out&&n.mode<Z&&(n.mode<Qc||t!==gc))&&vl(e,e.output,e.next_out,f-e.avail_out),d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?H(n.check,i,f,e.next_out-f):uo(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Lc?128:0)+(n.mode===Gc||n.mode===Bc?256:0),(d===0&&f===0||t===gc)&&w===yc&&(w=wc),w},inflateEnd:e=>{if(cl(e))return X;let t=e.state;return t.window&&=null,e.state=null,yc},inflateGetHeader:(e,t)=>{if(cl(e))return X;let n=e.state;return n.wrap&2?(n.head=t,t.done=!1,yc):X},inflateSetDictionary:(e,t)=>{let n=t.length,r,i,a;return cl(e)||(r=e.state,r.wrap!==0&&r.mode!==Ic)?X:r.mode===Ic&&(i=1,i=uo(i,t,n,0),i!==r.check)?Sc:(a=vl(e,t,n,n),a?(r.mode=tl,Cc):(r.havedict=1,yc))},inflateInfo:`pako inflate (from Nodeca project)`};function bl(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=``,this.comment=``,this.hcrc=0,this.done=!1}var xl=bl,Sl=Object.prototype.toString,{Z_NO_FLUSH:Cl,Z_FINISH:wl,Z_OK:Tl,Z_STREAM_END:El,Z_NEED_DICT:Dl,Z_STREAM_ERROR:Ol,Z_DATA_ERROR:kl,Z_MEM_ERROR:Al}=mo;function jl(e){this.options=As.assign({chunkSize:1024*64,windowBits:15,to:``},e||{});let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new Ls,this.strm.avail_out=0;let n=yl.inflateInit2(this.strm,t.windowBits);if(n!==Tl||(this.header=new xl,yl.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary==`string`?t.dictionary=Fs.string2buf(t.dictionary):Sl.call(t.dictionary)===`[object ArrayBuffer]`&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=yl.inflateSetDictionary(this.strm,t.dictionary),n!==Tl))))throw Error(po[n])}jl.prototype.push=function(e,t){let n=this.strm,r=this.options.chunkSize,i=this.options.dictionary,a,o,s;if(this.ended)return!1;for(o=t===~~t?t:t===!0?wl:Cl,Sl.call(e)===`[object ArrayBuffer]`?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),a=yl.inflate(n,o),a===Dl&&i&&(a=yl.inflateSetDictionary(n,i),a===Tl?a=yl.inflate(n,o):a===kl&&(a=Dl));n.avail_in>0&&a===El&&n.state.wrap>0&&e[n.next_in]!==0;)yl.inflateReset(n),a=yl.inflate(n,o);switch(a){case Ol:case kl:case Dl:case Al:return this.onEnd(a),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||a===El))if(this.options.to===`string`){let e=Fs.utf8border(n.output,n.next_out),t=n.next_out-e,i=Fs.buf2string(n.output,e);n.next_out=t,n.avail_out=r-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(i)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(a===Tl&&s===0)){if(a===El)return a=yl.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(n.avail_in===0)break}}return!0},jl.prototype.onData=function(e){this.chunks.push(e)},jl.prototype.onEnd=function(e){e===Tl&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=As.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ml(e,t){let n=new jl(t);if(n.push(e),n.err)throw n.msg||po[n.err];return n.result}function Nl(e,t){return t||={},t.raw=!0,Ml(e,t)}var Pl={Inflate:jl,inflate:Ml,inflateRaw:Nl,ungzip:Ml,constants:mo},{Deflate:Fl,deflate:Il,deflateRaw:Ll,gzip:Rl}=Qs,{Inflate:zl,inflate:Bl,inflateRaw:Vl,ungzip:Hl}=Pl,Ul={Deflate:Fl,deflate:Il,deflateRaw:Ll,gzip:Rl,Inflate:zl,inflate:Bl,inflateRaw:Vl,ungzip:Hl,constants:mo};function Wl(e){let t=Ul.deflate(e,{gzip:!0});return new Uint8Array(t)}function Gl(e){let t=Ul.inflate(e,{gzip:!0});return new Uint8Array(t)}var Kl=Jr(`ChFtb2R1bGVzL1J0Yy5wcm90bxIVY29tLnF1aWNrLnZvaWNlLnByb3RvInwKCFJ0Y1RyYWNrEg4KBnVzZXJJZBgBIAEoCRILCgNtaWQYAiABKAkSEQoJdHJhY2tOYW1lGAMgASgJEi4KBHR5cGUYBCABKA4yIC5jb20ucXVpY2sudm9pY2UucHJvdG8uVHJhY2tUeXBlEhAKCGlzQWN0aXZlGAUgASgIIlMKEFVwZGF0ZVRyYWNrU3RhdGUSDgoGcm9vbUlkGAEgASgJEi8KBnRyYWNrcxgCIAMoCzIfLmNvbS5xdWljay52b2ljZS5wcm90by5SdGNUcmFjayohCghSdGNFdmVudBIVChFVcGRhdGVUcmFja0FjdGl2ZRAAQkMKFWNvbS5xdWljay52b2ljZS5wcm90b0IIUnRjUHJvdG9aFWNvbS5xdWljay52b2ljZS5wcm90b7oCCFJ0Y1Byb3RvYgZwcm90bzM`,[z]),ql=L(Kl,0),Jl=L(Kl,1),Yl=Jr(`ChZtb2R1bGVzL0Jhc2VEYXRhLnByb3RvEhVjb20ucXVpY2sudm9pY2UucHJvdG8idAoJQ29tbW9uUmVxEg0KBWV2ZW50GAEgASgJEgwKBGRhdGEYAiABKAwSCgoCc24YAyABKAMSDAoEdGltZRgEIAEoAxINCgV2YWxpZBgFIAEoAxIPCgd2ZXJzaW9uGAYgASgFEhAKCGNvbXByZXNzGAcgASgIIpABCglDb21tb25Sc3ASDQoFZXZlbnQYASABKAkSDAoEZGF0YRgCIAEoDBIKCgJzbhgDIAEoAxIMCgR0aW1lGAQgASgDEg0KBXZhbGlkGAUgASgDEgwKBGNvZGUYBiABKAUSDAoEZGVzYxgHIAEoCRIPCgd2ZXJzaW9uGAggASgFEhAKCGNvbXByZXNzGAkgASgIQj8KFWNvbS5xdWljay52b2ljZS5wcm90b0IIQmFzZURhdGFaFWNvbS5xdWljay52b2ljZS5wcm90b7oCBFJvb21iBnByb3RvMw`),Xl=L(Yl,0),Zl=L(Yl,1);function Ql(e){if(e==null)return e;let t=typeof e;if(t===`bigint`||t===`string`||t===`number`||t===`boolean`||e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>Ql(e));if(t!==`object`)return e;let n=e,r={};for(let e of Object.keys(n))e!==`$typeName`&&(r[e]=Ql(n[e]));return r}function $l(e){return Ql({...e,sn:Number(e.sn),time:Number(e.time),valid:Number(e.valid)})}function eu(e){return $l(R(Zl,e))}function tu(e){return ur(Xl,On(Xl,{event:e.event,data:e.data,sn:BigInt(e.sn??0),time:BigInt(e.time??0),valid:BigInt(e.valid??0),version:e.version??0,compress:e.compress??!1}))}var Q=(e,t)=>ur(e,On(e,t));function nu(e){return e}var ru=e=>{let{event:t}=e,n=e.data,r=``,i;switch(e.time&&(r=D(e.time,`YYYY-MM-DD hh:mm:ss`,{offset:480})),t){case`heartbeat`:case`heartbeatEx`:i=Q(Di,n);break;case`ackMsg`:i=Q(Si,n);break;case`reportNetwork`:i=Q(Ei,n);break;case`connectCF`:i=Q($r,n);break;case`genTurnAddress`:i=Q(zi,n);break;case`publish`:i=Q(ti,n);break;case`joinRoom`:case`joinRoomEx`:i=Q(Xr,n);break;case`pubNotify`:i=Q(ri,n);break;case`subscribe`:i=Q(ii,n);break;case`renegotiate`:i=Q(oi,n);break;case`closeTrack`:i=Q(hi,n);break;case`preventUsersBehavior`:i=Q(yi,n);break;case`networkQualityChange`:i=Q(ui,n);break;case`updateCall`:i=Q(fi,n);break;case`toggleRoomSpeechLang`:i=Q(Ai,n);break;case`syncRoomInfo`:i=Q(pi,n);break;case`offer`:i=Q(Ci,n);break;case`answer`:i=Q(Ci,n);break;case`candidate`:i=Q(Ti,n);break;case`reportP2PConnectEx`:i=Q(Mi,n);break;case`UpdateTrackActive`:i=Q(Jl,n);break;case`quitRoom`:case`quitRoomEx`:i=Q(si,n);break;case`updateSimulcast`:i=Q(ii,n);break;case`updateRoomToken`:i=Q(li,n);break;case`debugger`:case`ai`:i=new Uint8Array;break}return{...e,timeStr:r,data_original:n,data:i}};function iu(e){let{event:t,compress:n=!1,time:r}=e,i=e.data,a=``,o,s=D(new Date().getTime(),`YYYY-MM-DD hh:mm:ss`,{offset:480});if(r!=null&&(a=D(Number(r),`YYYY-MM-DD hh:mm:ss`,{offset:480})),n)try{i=Gl(i)}catch(e){console.error(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo:消息解压错误`,e)}switch(t){case`connectCF`:o=R(ei,i);break;case`genTurnAddress`:o=R(Bi,i);break;case`publish`:o=R(ni,i);break;case`joinRoom`:case`joinRoomEx`:o=R(Zr,i);break;case`subscribe`:o=R(ai,i);break;case`closeTrack`:o=R(gi,i);break;case`syncRoomInfo`:o=R(mi,i);break;case`onJoinRoom`:o=R(Qr,i);break;case`onJoinRoomBatch`:o=R(Ii,i);break;case`onPublish`:o=R(ri,i);break;case`onCloseTrack`:o=R(_i,i);break;case`onTrackInactive`:o=R(Oi,i);break;case`onUpdateCall`:o=R(fi,i);break;case`onRoomActionChange`:o=R(Pi,i);break;case`onMeetSpecialRolesChange`:o=R(Fi,i);break;case`onUpdatePermissions`:o=R(vi,i);break;case`onUpdatePermissionsBatch`:o=R(Ri,i);break;case`onNetQuality`:o=R(di,i);break;case`onCDNPlayUrlAdd`:o=R(xi,i);break;case`onUpdateBehavior`:o=R(bi,i);break;case`onRoomUserSpeech`:o=R(ki,i);break;case`onAttemptP2PEx`:o=R(ji,i);break;case`onOffer`:o=R(Ci,i);break;case`onAnswer`:o=R(Ci,i);break;case`onCandidate`:o=R(Ti,i);break;case`onDisconnectedP2P`:o=R(Ni,i);break;case`onQuitRoom`:o=R(ci,i);break;case`onQuitRoomBatch`:o=R(Li,i);break;case`onDestroyRoom`:o=R(ci,i);break;case`debugger`:case`ai`:o=JSON.parse(new TextDecoder().decode(i));break;case`UpdateTrackActive`:o=R(Jl,i);break}return Ql({...e,timeStr:s,data_remote:i,data:o,remoteTime:r,remoteTimeStr:a})}var au=e=>{let{event:t,data:n,sn:r,time:i,valid:a,version:o,compress:s}=e;return tu({event:String(t??``),data:n,sn:r,time:i,valid:a,version:o,compress:s})},ou=e=>eu(e),su='(function(){function e(e){let t=!1,n=[];for(let r=0;r<e.length;r++){let i=e.charAt(r);switch(i){case`_`:t=!0;break;case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n.push(i),t=!1;break;default:t&&(t=!1,i=i.toUpperCase()),n.push(i);break}}return n.join(``)}let t=new Set([`constructor`,`toString`,`toJSON`,`valueOf`]);function n(e){return t.has(e)?e+`$`:e}function r(){let e=0,t=0;for(let n=0;n<28;n+=7){let r=this.buf[this.pos++];if(e|=(r&127)<<n,!(r&128))return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(n&15)<<28,t=(n&112)>>4,!(n&128))return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let r=this.buf[this.pos++];if(t|=(r&127)<<n,!(r&128))return this.assertBounds(),[e,t]}throw Error(`invalid varint`)}let i=4294967296;function a(e){let t=e[0]===`-`;t&&(e=e.slice(1));let n=1e6,r=0,a=0;function o(t,o){let s=Number(e.slice(t,o));a*=n,r=r*n+s,r>=i&&(a+=r/i|0,r%=i)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),t?u(r,a):l(r,a)}function o(e,t){let n=l(e,t),r=n.hi&2147483648;r&&(n=u(n.lo,n.hi));let i=s(n.lo,n.hi);return r?`-`+i:i}function s(e,t){if({lo:e,hi:t}=c(e,t),t<=2097151)return String(i*t+e);let n=e&16777215,r=(e>>>24|t<<8)&16777215,a=t>>16&65535,o=n+r*6777216+a*6710656,s=r+a*8147497,l=a*2,u=1e7;return o>=u&&(s+=Math.floor(o/u),o%=u),s>=u&&(l+=Math.floor(s/u),s%=u),l.toString()+d(s)+d(o)}function c(e,t){return{lo:e>>>0,hi:t>>>0}}function l(e,t){return{lo:e|0,hi:t|0}}function u(e,t){return t=~t,e?e=~e+1:t+=1,l(e,t)}let d=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function f(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e>>=7;t.push(1)}}function p(){let e=this.buf[this.pos++],t=e&127;if(!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}let m=h();function h(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt==`function`&&typeof e.getBigInt64==`function`&&typeof e.getBigUint64==`function`&&typeof e.setBigInt64==`function`&&typeof e.setBigUint64==`function`&&(globalThis.Deno||typeof process!=`object`||typeof process.env!=`object`||process.env.BUF_BIGINT_DISABLE!==`1`)){let t=BigInt(`-9223372036854775808`),n=BigInt(`9223372036854775807`),r=BigInt(`0`),i=BigInt(`18446744073709551615`);return{zero:BigInt(0),supported:!0,parse(e){let r=typeof e==`bigint`?e:BigInt(e);if(r>n||r<t)throw Error(`invalid int64: ${e}`);return r},uParse(e){let t=typeof e==`bigint`?e:BigInt(e);if(t>i||t<r)throw Error(`invalid uint64: ${e}`);return t},enc(t){return e.setBigInt64(0,this.parse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(t){return e.setBigInt64(0,this.uParse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(t,n){return e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigInt64(0,!0)},uDec(t,n){return e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigUint64(0,!0)}}}return{zero:`0`,supported:!1,parse(e){return typeof e!=`string`&&(e=e.toString()),g(e),e},uParse(e){return typeof e!=`string`&&(e=e.toString()),_(e),e},enc(e){return typeof e!=`string`&&(e=e.toString()),g(e),a(e)},uEnc(e){return typeof e!=`string`&&(e=e.toString()),_(e),a(e)},dec(e,t){return o(e,t)},uDec(e,t){return s(e,t)}}}function g(e){if(!/^-?[0-9]+$/.test(e))throw Error(`invalid int64: `+e)}function _(e){if(!/^[0-9]+$/.test(e))throw Error(`invalid uint64: `+e)}var v;(function(e){e[e.DOUBLE=1]=`DOUBLE`,e[e.FLOAT=2]=`FLOAT`,e[e.INT64=3]=`INT64`,e[e.UINT64=4]=`UINT64`,e[e.INT32=5]=`INT32`,e[e.FIXED64=6]=`FIXED64`,e[e.FIXED32=7]=`FIXED32`,e[e.BOOL=8]=`BOOL`,e[e.STRING=9]=`STRING`,e[e.BYTES=12]=`BYTES`,e[e.UINT32=13]=`UINT32`,e[e.SFIXED32=15]=`SFIXED32`,e[e.SFIXED64=16]=`SFIXED64`,e[e.SINT32=17]=`SINT32`,e[e.SINT64=18]=`SINT64`})(v||={});function y(e,t){switch(e){case v.STRING:return``;case v.BOOL:return!1;case v.DOUBLE:case v.FLOAT:return 0;case v.INT64:case v.UINT64:case v.SFIXED64:case v.FIXED64:case v.SINT64:return t?`0`:m.zero;case v.BYTES:return new Uint8Array;default:return 0}}function b(e,t){switch(e){case v.BOOL:return t===!1;case v.STRING:return t===``;case v.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return t==0}}let x=Symbol.for(`reflect unsafe local`);function S(e,t){let n=e[t.localName].case;return n===void 0?n:t.fields.find(e=>e.localName===n)}function C(e,t){let n=t.localName;if(t.oneof)return e[t.oneof.localName].case===n;if(t.presence!=2)return e[n]!==void 0&&Object.prototype.hasOwnProperty.call(e,n);switch(t.fieldKind){case`list`:return e[n].length>0;case`map`:return Object.keys(e[n]).length>0;case`scalar`:return!b(t.scalar,e[n]);case`enum`:return e[n]!==t.enum.values[0].number}throw Error(`message field with implicit presence`)}function w(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0}function T(e,t){if(t.oneof){let n=e[t.oneof.localName];return n.case===t.localName?n.value:void 0}return e[t.localName]}function E(e,t,n){t.oneof?e[t.oneof.localName]={case:t.localName,value:n}:e[t.localName]=n}function D(e,t){let n=t.localName;if(t.oneof){let r=t.oneof.localName;e[r].case===n&&(e[r]={case:void 0})}else if(t.presence!=2)delete e[n];else switch(t.fieldKind){case`map`:e[n]={};break;case`list`:e[n]=[];break;case`enum`:e[n]=t.enum.values[0].number;break;case`scalar`:e[n]=y(t.scalar,t.longAsString);break}}function O(t){for(let n of t.field)w(n,`jsonName`)||(n.jsonName=e(n.name));t.nestedType.forEach(O)}function ee(e,t){let n=e.values.find(e=>e.name===t);if(!n)throw Error(`cannot parse ${e} default value: ${t}`);return n.number}function te(e,t){switch(e){case v.STRING:return t;case v.BYTES:{let n=ne(t);if(n===!1)throw Error(`cannot parse ${v[e]} default value: ${t}`);return n}case v.INT64:case v.SFIXED64:case v.SINT64:return m.parse(t);case v.UINT64:case v.FIXED64:return m.uParse(t);case v.DOUBLE:case v.FLOAT:switch(t){case`inf`:return 1/0;case`-inf`:return-1/0;case`nan`:return NaN;default:return parseFloat(t)}case v.BOOL:return t===`true`;case v.INT32:case v.UINT32:case v.SINT32:case v.FIXED32:case v.SFIXED32:return parseInt(t,10)}}function ne(e){let t=[],n={tail:e,c:``,next(){return this.tail.length==0?!1:(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(e){if(this.tail.length>=e){let t=this.tail.substring(0,e);return this.tail=this.tail.substring(e),t}return!1}};for(;n.next();)switch(n.c){case`\\\\`:if(n.next())switch(n.c){case`\\\\`:t.push(n.c.charCodeAt(0));break;case`b`:t.push(8);break;case`f`:t.push(12);break;case`n`:t.push(10);break;case`r`:t.push(13);break;case`t`:t.push(9);break;case`v`:t.push(11);break;case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:{let e=n.c,r=n.take(2);if(r===!1)return!1;let i=parseInt(e+r,8);if(Number.isNaN(i))return!1;t.push(i);break}case`x`:{let e=n.c,r=n.take(2);if(r===!1)return!1;let i=parseInt(e+r,16);if(Number.isNaN(i))return!1;t.push(i);break}case`u`:{let e=n.c,r=n.take(4);if(r===!1)return!1;let i=parseInt(e+r,16);if(Number.isNaN(i))return!1;let a=new Uint8Array(4);new DataView(a.buffer).setInt32(0,i,!0),t.push(a[0],a[1],a[2],a[3]);break}case`U`:{let e=n.c,r=n.take(8);if(r===!1)return!1;let i=m.uEnc(e+r),a=new Uint8Array(8),o=new DataView(a.buffer);o.setInt32(0,i.lo,!0),o.setInt32(4,i.hi,!0),t.push(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]);break}}break;default:t.push(n.c.charCodeAt(0))}return new Uint8Array(t)}function*re(e){switch(e.kind){case`file`:for(let t of e.messages)yield t,yield*re(t);yield*e.enums,yield*e.services,yield*e.extensions;break;case`message`:for(let t of e.nestedMessages)yield t,yield*re(t);yield*e.nestedEnums,yield*e.nestedExtensions;break}}function ie(...e){let t=ae();if(!e.length)return t;if(`$typeName`in e[0]&&e[0].$typeName==`google.protobuf.FileDescriptorSet`){for(let n of e[0].file)se(n,t);return t}if(`$typeName`in e[0]){let n=e[0],r=e[1],i=new Set;function a(e){let n=[];for(let a of e.dependency){if(t.getFile(a)!=null||i.has(a))continue;let o=r(a);if(!o)throw Error(`Unable to resolve ${a}, imported by ${e.name}`);`kind`in o?t.addFile(o,!1,!0):(i.add(o.name),n.push(o))}return n.concat(...n.map(a))}for(let e of[n,...a(n)].reverse())se(e,t)}else for(let n of e)for(let e of n.files)t.addFile(e);return t}function ae(){let e=new Map,t=new Map,n=new Map;return{kind:`registry`,types:e,extendees:t,[Symbol.iterator](){return e.values()},get files(){return n.values()},addFile(e,t,r){if(n.set(e.proto.name,e),!t)for(let t of re(e))this.add(t);if(r)for(let n of e.dependencies)this.addFile(n,t,r)},add(n){if(n.kind==`extension`){let e=t.get(n.extendee.typeName);e||t.set(n.extendee.typeName,e=new Map),e.set(n.number,n)}e.set(n.typeName,n)},get(t){return e.get(t)},getFile(e){return n.get(e)},getMessage(t){let n=e.get(t);return n?.kind==`message`?n:void 0},getEnum(t){let n=e.get(t);return n?.kind==`enum`?n:void 0},getExtension(t){let n=e.get(t);return n?.kind==`extension`?n:void 0},getExtensionFor(e,n){return t.get(e.typeName)?.get(n)},getService(t){let n=e.get(t);return n?.kind==`service`?n:void 0}}}let oe={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2,defaultSymbolVisibility:1},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1001:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:1,defaultSymbolVisibility:2}};function se(e,t){let n={kind:`file`,proto:e,deprecated:e.options?.deprecated??!1,edition:ge(e),name:e.name.replace(/\\.proto$/,``),dependencies:_e(e,t),enums:[],messages:[],extensions:[],services:[],toString(){return`file ${e.name}`}},r=new Map,i={get(e){return r.get(e)},add(e){A(e.proto.options?.mapEntry===!0),r.set(e.typeName,e)}};for(let r of e.enumType)ue(r,n,void 0,t);for(let r of e.messageType)de(r,n,void 0,t,i);for(let r of e.service)fe(r,n,t);ce(n,t);for(let e of r.values())le(e,t,i);for(let e of n.messages)le(e,t,i),ce(e,t);t.addFile(n,!0)}function ce(e,t){switch(e.kind){case`file`:for(let n of e.proto.extension){let r=he(n,e,t);e.extensions.push(r),t.add(r)}break;case`message`:for(let n of e.proto.extension){let r=he(n,e,t);e.nestedExtensions.push(r),t.add(r)}for(let n of e.nestedMessages)ce(n,t);break}}function le(e,t,n){let r=e.proto.oneofDecl.map(t=>me(t,e)),i=new Set;for(let a of e.proto.field){let o=xe(a,r),s=he(a,e,t,o,n);e.fields.push(s),e.field[s.localName]=s,o===void 0?e.members.push(s):(o.fields.push(s),i.has(o)||(i.add(o),e.members.push(o)))}for(let t of r.filter(e=>i.has(e)))e.oneofs.push(t);for(let r of e.nestedMessages)le(r,t,n)}function ue(e,t,r,i){let a=ve(e.name,e.value),o={kind:`enum`,proto:e,deprecated:e.options?.deprecated??!1,file:t,parent:r,open:!0,name:e.name,typeName:be(e,r,t),value:{},values:[],sharedPrefix:a,toString(){return`enum ${this.typeName}`}};o.open=Te(o),i.add(o);for(let t of e.value){let e=t.name;o.values.push(o.value[t.number]={kind:`enum_value`,proto:t,deprecated:t.options?.deprecated??!1,parent:o,name:e,localName:n(a==null?e:e.substring(a.length)),number:t.number,toString(){return`enum value ${o.typeName}.${e}`}})}(r?.nestedEnums??t.enums).push(o)}function de(e,t,n,r,i){let a={kind:`message`,proto:e,deprecated:e.options?.deprecated??!1,file:t,parent:n,name:e.name,typeName:be(e,n,t),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};e.options?.mapEntry===!0?i.add(a):((n?.nestedMessages??t.messages).push(a),r.add(a));for(let n of e.enumType)ue(n,t,a,r);for(let n of e.nestedType)de(n,t,a,r,i)}function fe(e,t,n){let r={kind:`service`,proto:e,deprecated:e.options?.deprecated??!1,file:t,name:e.name,typeName:be(e,void 0,t),methods:[],method:{},toString(){return`service ${this.typeName}`}};t.services.push(r),n.add(r);for(let t of e.method){let e=pe(t,r,n);r.methods.push(e),r.method[e.localName]=e}}function pe(e,t,r){let i;i=e.clientStreaming&&e.serverStreaming?`bidi_streaming`:e.clientStreaming?`client_streaming`:e.serverStreaming?`server_streaming`:`unary`;let a=r.getMessage(k(e.inputType)),o=r.getMessage(k(e.outputType));A(a,`invalid MethodDescriptorProto: input_type ${e.inputType} not found`),A(o,`invalid MethodDescriptorProto: output_type ${e.inputType} not found`);let s=e.name;return{kind:`rpc`,proto:e,deprecated:e.options?.deprecated??!1,parent:t,name:s,localName:n(s.length?n(s[0].toLowerCase()+s.substring(1)):s),methodKind:i,input:a,output:o,idempotency:e.options?.idempotencyLevel??0,toString(){return`rpc ${t.typeName}.${s}`}}}function me(t,r){return{kind:`oneof`,proto:t,deprecated:!1,parent:r,fields:[],name:t.name,localName:n(e(t.name)),toString(){return`oneof ${r.typeName}.${this.name}`}}}function he(t,r,i,a,o){let s=o===void 0,c={kind:`field`,proto:t,deprecated:t.options?.deprecated??!1,name:t.name,number:t.number,scalar:void 0,message:void 0,enum:void 0,presence:Se(t,a,s,r),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(s){let e=r.kind==`file`?r:r.file,n=r.kind==`file`?void 0:r,a=be(t,n,e);c.kind=`extension`,c.file=e,c.parent=n,c.oneof=void 0,c.typeName=a,c.jsonName=`[${a}]`,c.toString=()=>`extension ${a}`;let o=i.getMessage(k(t.extendee));A(o,`invalid FieldDescriptorProto: extendee ${t.extendee} not found`),c.extendee=o}else{let i=r;A(i.kind==`message`),c.parent=i,c.oneof=a,c.localName=a?e(t.name):n(e(t.name)),c.jsonName=t.jsonName,c.toString=()=>`field ${i.typeName}.${t.name}`}let l=t.label,u=t.type,d=t.options?.jstype;if(l===3){let e=u==11?o?.get(k(t.typeName)):void 0;if(e){c.fieldKind=`map`;let{key:t,value:n}=we(e);return c.mapKey=t.scalar,c.mapKind=n.fieldKind,c.message=n.message,c.delimitedEncoding=!1,c.enum=n.enum,c.scalar=n.scalar,c}switch(c.fieldKind=`list`,u){case 11:case 10:c.listKind=`message`,c.message=i.getMessage(k(t.typeName)),A(c.message),c.delimitedEncoding=Ee(t,r);break;case 14:c.listKind=`enum`,c.enum=i.getEnum(k(t.typeName)),A(c.enum);break;default:c.listKind=`scalar`,c.scalar=u,c.longAsString=d==1;break}return c.packed=Ce(t,r),c}switch(u){case 11:case 10:c.fieldKind=`message`,c.message=i.getMessage(k(t.typeName)),A(c.message,`invalid FieldDescriptorProto: type_name ${t.typeName} not found`),c.delimitedEncoding=Ee(t,r),c.getDefaultValue=()=>void 0;break;case 14:{let e=i.getEnum(k(t.typeName));A(e!==void 0,`invalid FieldDescriptorProto: type_name ${t.typeName} not found`),c.fieldKind=`enum`,c.enum=i.getEnum(k(t.typeName)),c.getDefaultValue=()=>w(t,`defaultValue`)?ee(e,t.defaultValue):void 0;break}default:c.fieldKind=`scalar`,c.scalar=u,c.longAsString=d==1,c.getDefaultValue=()=>w(t,`defaultValue`)?te(u,t.defaultValue):void 0;break}return c}function ge(e){switch(e.syntax){case``:case`proto2`:return 998;case`proto3`:return 999;case`editions`:if(e.edition in oe)return e.edition;throw Error(`${e.name}: unsupported edition`);default:throw Error(`${e.name}: unsupported syntax "${e.syntax}"`)}}function _e(e,t){return e.dependency.map(n=>{let r=t.getFile(n);if(!r)throw Error(`Cannot find ${n}, imported by ${e.name}`);return r})}function ve(e,t){let n=ye(e)+`_`;for(let e of t){if(!e.name.toLowerCase().startsWith(n))return;let t=e.name.substring(n.length);if(t.length==0||/^\\d/.test(t))return}return n}function ye(e){return(e.substring(0,1)+e.substring(1).replace(/[A-Z]/g,e=>`_`+e)).toLowerCase()}function be(e,t,n){let r;return r=t?`${t.typeName}.${e.name}`:n.proto.package.length>0?`${n.proto.package}.${e.name}`:`${e.name}`,r}function k(e){return e.startsWith(`.`)?e.substring(1):e}function xe(e,t){if(!w(e,`oneofIndex`)||e.proto3Optional)return;let n=t[e.oneofIndex];return A(n,`invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`),n}function Se(e,t,n,r){if(e.label==2)return 3;if(e.label==3)return 2;if(t||e.proto3Optional||n)return 1;let i=De(`fieldPresence`,{proto:e,parent:r});return i==2&&(e.type==11||e.type==10)?1:i}function Ce(e,t){if(e.label!=3)return!1;switch(e.type){case 9:case 12:case 10:case 11:return!1}let n=e.options;return n&&w(n,`packed`)?n.packed:De(`repeatedFieldEncoding`,{proto:e,parent:t})==1}function we(e){let t=e.fields.find(e=>e.number===1),n=e.fields.find(e=>e.number===2);return A(t&&t.fieldKind==`scalar`&&t.scalar!=v.BYTES&&t.scalar!=v.FLOAT&&t.scalar!=v.DOUBLE&&n&&n.fieldKind!=`list`&&n.fieldKind!=`map`),{key:t,value:n}}function Te(e){return De(`enumType`,{proto:e.proto,parent:e.parent??e.file})==1}function Ee(e,t){return e.type==10?!0:De(`messageEncoding`,{proto:e,parent:t})==2}function De(e,t){let n=t.proto.options?.features;if(n){let t=n[e];if(t!=0)return t}if(`kind`in t){if(t.kind==`message`)return De(e,t.parent??t.file);let n=oe[t.edition];if(!n)throw Error(`feature default for edition ${t.edition} not found`);return n[e]}return De(e,t.parent)}function A(e,t){if(!e)throw Error(t)}function Oe(e){let t=ke(e);return t.messageType.forEach(O),ie(t,()=>void 0).getFile(t.name)}function ke(e){return Object.assign(Object.create({syntax:``,edition:0}),Object.assign(Object.assign({$typeName:`google.protobuf.FileDescriptorProto`,dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},e),{messageType:e.messageType.map(Ae),enumType:e.enumType.map(Ne)}))}function Ae(e){return Object.assign(Object.create({visibility:0}),{$typeName:`google.protobuf.DescriptorProto`,name:e.name,field:e.field?.map(je)??[],extension:[],nestedType:e.nestedType?.map(Ae)??[],enumType:e.enumType?.map(Ne)??[],extensionRange:e.extensionRange?.map(e=>Object.assign({$typeName:`google.protobuf.DescriptorProto.ExtensionRange`},e))??[],oneofDecl:[],reservedRange:[],reservedName:[]})}function je(e){return Object.assign(Object.create({label:1,typeName:``,extendee:``,defaultValue:``,oneofIndex:0,jsonName:``,proto3Optional:!1}),Object.assign(Object.assign({$typeName:`google.protobuf.FieldDescriptorProto`},e),{options:e.options?Me(e.options):void 0}))}function Me(e){return Object.assign(Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0}),Object.assign(Object.assign({$typeName:`google.protobuf.FieldOptions`},e),{targets:e.targets??[],editionDefaults:e.editionDefaults?.map(e=>Object.assign({$typeName:`google.protobuf.FieldOptions.EditionDefault`},e))??[],uninterpretedOption:[]}))}function Ne(e){return Object.assign(Object.create({visibility:0}),{$typeName:`google.protobuf.EnumDescriptorProto`,name:e.name,reservedName:[],reservedRange:[],value:e.value.map(e=>Object.assign({$typeName:`google.protobuf.EnumValueDescriptorProto`},e))})}function Pe(e){let t=ze(),n=e.length*3/4;e[e.length-2]==`=`?n-=2:e[e.length-1]==`=`&&--n;let r=new Uint8Array(n),i=0,a=0,o,s=0;for(let n=0;n<e.length;n++){if(o=t[e.charCodeAt(n)],o===void 0)switch(e[n]){case`=`:a=0;case`\n`:case`\\r`:case` `:case` `:continue;default:throw Error(`invalid base64 string`)}switch(a){case 0:s=o,a=1;break;case 1:r[i++]=s<<2|(o&48)>>4,s=o,a=2;break;case 2:r[i++]=(s&15)<<4|(o&60)>>2,s=o,a=3;break;case 3:r[i++]=(s&3)<<6|o,a=0;break}}if(a==1)throw Error(`invalid base64 string`);return r.subarray(0,i)}let Fe,Ie,Le;function Re(e){return Fe||(Fe=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.split(``),Ie=Fe.slice(0,-2).concat(`-`,`_`)),e==`url`?Ie:Fe}function ze(){if(!Le){Le=[];let e=Re(`std`);for(let t=0;t<e.length;t++)Le[e[t].charCodeAt(0)]=t;Le[45]=e.indexOf(`+`),Le[95]=e.indexOf(`/`)}return Le}function Be(e,t){return typeof e==`object`&&e&&`$typeName`in e&&typeof e.$typeName==`string`?t===void 0?!0:t.typeName===e.$typeName:!1}var Ve=class extends Error{constructor(e,t,n=`FieldValueInvalidError`){super(t),this.name=n,this.field=()=>e}};function j(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function He(e,t){if(j(e)&&x in e&&`add`in e&&`field`in e&&typeof e.field==`function`){if(t!==void 0){let n=t,r=e.field();return n.listKind==r.listKind&&n.scalar===r.scalar&&n.message?.typeName===r.message?.typeName&&n.enum?.typeName===r.enum?.typeName}return!0}return!1}function Ue(e,t){if(j(e)&&x in e&&`has`in e&&`field`in e&&typeof e.field==`function`){if(t!==void 0){let n=t,r=e.field();return n.mapKey===r.mapKey&&n.mapKind==r.mapKind&&n.scalar===r.scalar&&n.message?.typeName===r.message?.typeName&&n.enum?.typeName===r.enum?.typeName}return!0}return!1}function We(e,t){return j(e)&&x in e&&`desc`in e&&j(e.desc)&&e.desc.kind===`message`&&(t===void 0||e.desc.typeName==t.typeName)}let Ge=Symbol.for(`@bufbuild/protobuf/text-encoding`);function Ke(){if(globalThis[Ge]==null){let e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[Ge]={encodeUtf8(t){return e.encode(t)},decodeUtf8(e){return t.decode(e)},checkUtf8(e){try{return!0}catch{return!1}}}}return globalThis[Ge]}var M;(function(e){e[e.Varint=0]=`Varint`,e[e.Bit64=1]=`Bit64`,e[e.LengthDelimited=2]=`LengthDelimited`,e[e.StartGroup=3]=`StartGroup`,e[e.EndGroup=4]=`EndGroup`,e[e.Bit32=5]=`Bit32`})(M||={});var qe=class{constructor(e,t=Ke().decodeUtf8){this.decodeUtf8=t,this.varint64=r,this.uint32=p,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),t=e>>>3,n=e&7;if(t<=0||n<0||n>5)throw Error(`illegal tag: field no `+t+` wire type `+n);return[t,n]}skip(e,t){let n=this.pos;switch(e){case M.Varint:for(;this.buf[this.pos++]&128;);break;case M.Bit64:this.pos+=4;case M.Bit32:this.pos+=4;break;case M.LengthDelimited:let n=this.uint32();this.pos+=n;break;case M.StartGroup:for(;;){let[e,n]=this.tag();if(n===M.EndGroup){if(t!==void 0&&e!==t)throw Error(`invalid end group tag`);break}this.skip(n,e)}break;default:throw Error(`cant skip wire type `+e)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return m.dec(...this.varint64())}uint64(){return m.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),n=-(e&1);return e=(e>>>1|(t&1)<<31)^n,t=t>>>1^n,m.dec(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return m.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return m.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.decodeUtf8(this.bytes())}};function Je(e,t){let n=e.fieldKind==`list`?He(t,e):e.fieldKind==`map`?Ue(t,e):Ze(e,t);if(n===!0)return;let r;switch(e.fieldKind){case`list`:r=`expected ${nt(e)}, got ${et(t)}`;break;case`map`:r=`expected ${rt(e)}, got ${et(t)}`;break;default:r=$e(e,t,n)}return new Ve(e,r)}function Ye(e,t,n){let r=Ze(e,n);if(r!==!0)return new Ve(e,`list item #${t+1}: ${$e(e,n,r)}`)}function Xe(e,t,n){let r=Qe(t,e.mapKey);if(r!==!0)return new Ve(e,`invalid map key: ${$e({scalar:e.mapKey},t,r)}`);let i=Ze(e,n);if(i!==!0)return new Ve(e,`map entry ${et(t)}: ${$e(e,n,i)}`)}function Ze(e,t){return e.scalar===void 0?e.enum===void 0?We(t,e.message):e.enum.open?Number.isInteger(t):e.enum.values.some(e=>e.number===t):Qe(t,e.scalar)}function Qe(e,t){switch(t){case v.DOUBLE:return typeof e==`number`;case v.FLOAT:return typeof e==`number`?Number.isNaN(e)||!Number.isFinite(e)?!0:e>34028234663852886e22||e<-34028234663852886e22?`${e.toFixed()} out of range`:!0:!1;case v.INT32:case v.SFIXED32:case v.SINT32:return typeof e!=`number`||!Number.isInteger(e)?!1:e>2147483647||e<-2147483648?`${e.toFixed()} out of range`:!0;case v.FIXED32:case v.UINT32:return typeof e!=`number`||!Number.isInteger(e)?!1:e>4294967295||e<0?`${e.toFixed()} out of range`:!0;case v.BOOL:return typeof e==`boolean`;case v.STRING:return typeof e==`string`?Ke().checkUtf8(e)||`invalid UTF8`:!1;case v.BYTES:return e instanceof Uint8Array;case v.INT64:case v.SFIXED64:case v.SINT64:if(typeof e==`bigint`||typeof e==`number`||typeof e==`string`&&e.length>0)try{return m.parse(e),!0}catch{return`${e} out of range`}return!1;case v.FIXED64:case v.UINT64:if(typeof e==`bigint`||typeof e==`number`||typeof e==`string`&&e.length>0)try{return m.uParse(e),!0}catch{return`${e} out of range`}return!1}}function $e(e,t,n){return n=typeof n==`string`?`: ${n}`:`, got ${et(t)}`,e.scalar===void 0?e.enum===void 0?`expected ${tt(e.message)}`+n:`expected ${e.enum.toString()}`+n:`expected ${it(e.scalar)}`+n}function et(e){switch(typeof e){case`object`:return e===null?`null`:e instanceof Uint8Array?`Uint8Array(${e.length})`:Array.isArray(e)?`Array(${e.length})`:He(e)?nt(e.field()):Ue(e)?rt(e.field()):We(e)?tt(e.desc):Be(e)?`message ${e.$typeName}`:`object`;case`string`:return e.length>30?`string`:`"${e.split(`"`).join(`\\\\"`)}"`;case`boolean`:return String(e);case`number`:return String(e);case`bigint`:return String(e)+`n`;default:return typeof e}}function tt(e){return`ReflectMessage (${e.typeName})`}function nt(e){switch(e.listKind){case`message`:return`ReflectList (${e.message.toString()})`;case`enum`:return`ReflectList (${e.enum.toString()})`;case`scalar`:return`ReflectList (${v[e.scalar]})`}}function rt(e){switch(e.mapKind){case`message`:return`ReflectMap (${v[e.mapKey]}, ${e.message.toString()})`;case`enum`:return`ReflectMap (${v[e.mapKey]}, ${e.enum.toString()})`;case`scalar`:return`ReflectMap (${v[e.mapKey]}, ${v[e.scalar]})`}}function it(e){switch(e){case v.STRING:return`string`;case v.BOOL:return`boolean`;case v.INT64:case v.SINT64:case v.SFIXED64:return`bigint (int64)`;case v.UINT64:case v.FIXED64:return`bigint (uint64)`;case v.BYTES:return`Uint8Array`;case v.DOUBLE:return`number (float64)`;case v.FLOAT:return`number (float32)`;case v.FIXED32:case v.UINT32:return`number (uint32)`;case v.INT32:case v.SFIXED32:case v.SINT32:return`number (int32)`}}function at(e){return st(e.$typeName)}function ot(e){let t=e.fields[0];return st(e.typeName)&&t!==void 0&&t.fieldKind==`scalar`&&t.name==`value`&&t.number==1}function st(e){return e.startsWith(`google.protobuf.`)&&[`DoubleValue`,`FloatValue`,`Int64Value`,`UInt64Value`,`Int32Value`,`UInt32Value`,`BoolValue`,`StringValue`,`BytesValue`].includes(e.substring(16))}function ct(e,t){if(Be(t,e))return t;let n=vt(e);return t!==void 0&&lt(e,n,t),n}function lt(e,t,n){for(let r of e.members){let e=n[r.localName];if(e==null)continue;let i;if(r.kind==`oneof`){let t=S(n,r);if(!t)continue;i=t,e=T(n,t)}else i=r;switch(i.fieldKind){case`message`:e=pt(i,e);break;case`scalar`:e=ut(i,e);break;case`list`:e=ft(i,e);break;case`map`:e=dt(i,e);break}E(t,i,e)}return t}function ut(e,t){return e.scalar==v.BYTES?mt(t):t}function dt(e,t){if(j(t)){if(e.scalar==v.BYTES)return ht(t,mt);if(e.mapKind==`message`)return ht(t,t=>pt(e,t))}return t}function ft(e,t){if(Array.isArray(t)){if(e.scalar==v.BYTES)return t.map(mt);if(e.listKind==`message`)return t.map(t=>pt(e,t))}return t}function pt(e,t){if(e.fieldKind==`message`&&!e.oneof&&ot(e.message))return ut(e.message.fields[0],t);if(j(t)){if(e.message.typeName==`google.protobuf.Struct`&&e.parent.typeName!==`google.protobuf.Value`)return t;if(!Be(t,e.message))return ct(e.message,t)}return t}function mt(e){return Array.isArray(e)?new Uint8Array(e):e}function ht(e,t){let n={};for(let r of Object.entries(e))n[r[0]]=t(r[1]);return n}let gt=Symbol(),_t=new WeakMap;function vt(e){let t;if(yt(e)){let n=_t.get(e),r,i;if(n)({prototype:r,members:i}=n);else{r={},i=new Set;for(let t of e.members)t.kind!=`oneof`&&(t.fieldKind!=`scalar`&&t.fieldKind!=`enum`||t.presence!=2&&(i.add(t),r[t.localName]=bt(t)));_t.set(e,{prototype:r,members:i})}t=Object.create(r),t.$typeName=e.typeName;for(let n of e.members)i.has(n)||n.kind==`field`&&(n.fieldKind==`message`||(n.fieldKind==`scalar`||n.fieldKind==`enum`)&&n.presence!=2)||(t[n.localName]=bt(n))}else{t={$typeName:e.typeName};for(let n of e.members)(n.kind==`oneof`||n.presence==2)&&(t[n.localName]=bt(n))}return t}function yt(e){switch(e.file.edition){case 999:return!1;case 998:return!0;default:return e.fields.some(e=>e.presence!=2&&e.fieldKind!=`message`&&!e.oneof)}}function bt(e){if(e.kind==`oneof`)return{case:void 0};if(e.fieldKind==`list`)return[];if(e.fieldKind==`map`)return{};if(e.fieldKind==`message`)return gt;let t=e.getDefaultValue();return t===void 0?e.fieldKind==`scalar`?y(e.scalar,e.longAsString):e.enum.values[0].number:e.fieldKind==`scalar`&&e.longAsString?t.toString():t}function xt(e,t,n=!0){return new Ct(e,t,n)}let St=new WeakMap;var Ct=class{get sortedFields(){let e=St.get(this.desc);if(e)return e;let t=this.desc.fields.concat().sort((e,t)=>e.number-t.number);return St.set(this.desc,t),t}constructor(e,t,n=!0){this.lists=new Map,this.maps=new Map,this.check=n,this.desc=e,this.message=this[x]=t??ct(e),this.fields=e.fields,this.oneofs=e.oneofs,this.members=e.members}findNumber(e){return this._fieldsByNumber||=new Map(this.desc.fields.map(e=>[e.number,e])),this._fieldsByNumber.get(e)}oneofCase(e){return wt(this.message,e),S(this.message,e)}isSet(e){return wt(this.message,e),C(this.message,e)}clear(e){wt(this.message,e),D(this.message,e)}get(e){wt(this.message,e);let t=T(this.message,e);switch(e.fieldKind){case`list`:let n=this.lists.get(e);return(!n||n[x]!==t)&&this.lists.set(e,n=new Tt(e,t,this.check)),n;case`map`:let r=this.maps.get(e);return(!r||r[x]!==t)&&this.maps.set(e,r=new Et(e,t,this.check)),r;case`message`:return Ot(e,t,this.check);case`scalar`:return t===void 0?y(e.scalar,!1):Ft(e,t);case`enum`:return t??e.enum.values[0].number}}set(e,t){if(wt(this.message,e),this.check){let n=Je(e,t);if(n)throw n}let n;n=e.fieldKind==`message`?Dt(e,t):Ue(t)||He(t)?t[x]:It(e,t),E(this.message,e,n)}getUnknown(){return this.message.$unknown}setUnknown(e){this.message.$unknown=e}};function wt(e,t){if(t.parent.typeName!==e.$typeName)throw new Ve(t,`cannot use ${t.toString()} with message ${e.$typeName}`,`ForeignFieldError`)}var Tt=class{field(){return this._field}get size(){return this._arr.length}constructor(e,t,n){this._field=e,this._arr=this[x]=t,this.check=n}get(e){let t=this._arr[e];return t===void 0?void 0:At(this._field,t,this.check)}set(e,t){if(e<0||e>=this._arr.length)throw new Ve(this._field,`list item #${e+1}: out of range`);if(this.check){let n=Ye(this._field,e,t);if(n)throw n}this._arr[e]=kt(this._field,t)}add(e){if(this.check){let t=Ye(this._field,this._arr.length,e);if(t)throw t}this._arr.push(kt(this._field,e))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(let e of this._arr)yield At(this._field,e,this.check)}*entries(){for(let e=0;e<this._arr.length;e++)yield[e,At(this._field,this._arr[e],this.check)]}},Et=class{constructor(e,t,n=!0){this.obj=this[x]=t??{},this.check=n,this._field=e}field(){return this._field}set(e,t){if(this.check){let n=Xe(this._field,e,t);if(n)throw n}return this.obj[Nt(e)]=jt(this._field,t),this}delete(e){let t=Nt(e),n=Object.prototype.hasOwnProperty.call(this.obj,t);return n&&delete this.obj[t],n}clear(){for(let e of Object.keys(this.obj))delete this.obj[e]}get(e){let t=this.obj[Nt(e)];return t!==void 0&&(t=Mt(this._field,t,this.check)),t}has(e){return Object.prototype.hasOwnProperty.call(this.obj,Nt(e))}*keys(){for(let e of Object.keys(this.obj))yield Pt(e,this._field.mapKey)}*entries(){for(let e of Object.entries(this.obj))yield[Pt(e[0],this._field.mapKey),Mt(this._field,e[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(let e of Object.values(this.obj))yield Mt(this._field,e,this.check)}forEach(e,t){for(let n of this.entries())e.call(t,n[1],n[0],this)}};function Dt(e,t){return We(t)?at(t.message)&&!e.oneof&&e.fieldKind==`message`?t.message.value:t.desc.typeName==`google.protobuf.Struct`&&e.parent.typeName!=`google.protobuf.Value`?Rt(t.message):t.message:t}function Ot(e,t,n){return t!==void 0&&(ot(e.message)&&!e.oneof&&e.fieldKind==`message`?t={$typeName:e.message.typeName,value:Ft(e.message.fields[0],t)}:e.message.typeName==`google.protobuf.Struct`&&e.parent.typeName!=`google.protobuf.Value`&&j(t)&&(t=Lt(t))),new Ct(e.message,t,n)}function kt(e,t){return e.listKind==`message`?Dt(e,t):It(e,t)}function At(e,t,n){return e.listKind==`message`?Ot(e,t,n):Ft(e,t)}function jt(e,t){return e.mapKind==`message`?Dt(e,t):It(e,t)}function Mt(e,t,n){return e.mapKind==`message`?Ot(e,t,n):t}function Nt(e){return typeof e==`string`||typeof e==`number`?e:String(e)}function Pt(e,t){switch(t){case v.STRING:return e;case v.INT32:case v.FIXED32:case v.UINT32:case v.SFIXED32:case v.SINT32:{let t=Number.parseInt(e);if(Number.isFinite(t))return t;break}case v.BOOL:switch(e){case`true`:return!0;case`false`:return!1}break;case v.UINT64:case v.FIXED64:try{return m.uParse(e)}catch{}break;default:try{return m.parse(e)}catch{}break}return e}function Ft(e,t){switch(e.scalar){case v.INT64:case v.SFIXED64:case v.SINT64:`longAsString`in e&&e.longAsString&&typeof t==`string`&&(t=m.parse(t));break;case v.FIXED64:case v.UINT64:`longAsString`in e&&e.longAsString&&typeof t==`string`&&(t=m.uParse(t));break}return t}function It(e,t){switch(e.scalar){case v.INT64:case v.SFIXED64:case v.SINT64:`longAsString`in e&&e.longAsString?t=String(t):(typeof t==`string`||typeof t==`number`)&&(t=m.parse(t));break;case v.FIXED64:case v.UINT64:`longAsString`in e&&e.longAsString?t=String(t):(typeof t==`string`||typeof t==`number`)&&(t=m.uParse(t));break}return t}function Lt(e){let t={$typeName:`google.protobuf.Struct`,fields:{}};if(j(e))for(let[n,r]of Object.entries(e))t.fields[n]=Bt(r);return t}function Rt(e){let t={};for(let[n,r]of Object.entries(e.fields))t[n]=zt(r);return t}function zt(e){switch(e.kind.case){case`structValue`:return Rt(e.kind.value);case`listValue`:return e.kind.value.values.map(zt);case`nullValue`:case void 0:return null;default:return e.kind.value}}function Bt(e){let t={$typeName:`google.protobuf.Value`,kind:{case:void 0}};switch(typeof e){case`number`:t.kind={case:`numberValue`,value:e};break;case`string`:t.kind={case:`stringValue`,value:e};break;case`boolean`:t.kind={case:`boolValue`,value:e};break;case`object`:if(e===null)t.kind={case:`nullValue`,value:0};else if(Array.isArray(e)){let n={$typeName:`google.protobuf.ListValue`,values:[]};if(Array.isArray(e))for(let t of e)n.values.push(Bt(t));t.kind={case:`listValue`,value:n}}else t.kind={case:`structValue`,value:Lt(e)};break}return t}function N(e,t,...n){return n.reduce((e,t)=>e.nestedMessages[t],e.messages[t])}let Vt=N(Oe({name:`google/protobuf/descriptor.proto`,package:`google.protobuf`,messageType:[{name:`FileDescriptorSet`,field:[{name:`file`,number:1,type:11,label:3,typeName:`.google.protobuf.FileDescriptorProto`}],extensionRange:[{start:536e6,end:536000001}]},{name:`FileDescriptorProto`,field:[{name:`name`,number:1,type:9,label:1},{name:`package`,number:2,type:9,label:1},{name:`dependency`,number:3,type:9,label:3},{name:`public_dependency`,number:10,type:5,label:3},{name:`weak_dependency`,number:11,type:5,label:3},{name:`option_dependency`,number:15,type:9,label:3},{name:`message_type`,number:4,type:11,label:3,typeName:`.google.protobuf.DescriptorProto`},{name:`enum_type`,number:5,type:11,label:3,typeName:`.google.protobuf.EnumDescriptorProto`},{name:`service`,number:6,type:11,label:3,typeName:`.google.protobuf.ServiceDescriptorProto`},{name:`extension`,number:7,type:11,label:3,typeName:`.google.protobuf.FieldDescriptorProto`},{name:`options`,number:8,type:11,label:1,typeName:`.google.protobuf.FileOptions`},{name:`source_code_info`,number:9,type:11,label:1,typeName:`.google.protobuf.SourceCodeInfo`},{name:`syntax`,number:12,type:9,label:1},{name:`edition`,number:14,type:14,label:1,typeName:`.google.protobuf.Edition`}]},{name:`DescriptorProto`,field:[{name:`name`,number:1,type:9,label:1},{name:`field`,number:2,type:11,label:3,typeName:`.google.protobuf.FieldDescriptorProto`},{name:`extension`,number:6,type:11,label:3,typeName:`.google.protobuf.FieldDescriptorProto`},{name:`nested_type`,number:3,type:11,label:3,typeName:`.google.protobuf.DescriptorProto`},{name:`enum_type`,number:4,type:11,label:3,typeName:`.google.protobuf.EnumDescriptorProto`},{name:`extension_range`,number:5,type:11,label:3,typeName:`.google.protobuf.DescriptorProto.ExtensionRange`},{name:`oneof_decl`,number:8,type:11,label:3,typeName:`.google.protobuf.OneofDescriptorProto`},{name:`options`,number:7,type:11,label:1,typeName:`.google.protobuf.MessageOptions`},{name:`reserved_range`,number:9,type:11,label:3,typeName:`.google.protobuf.DescriptorProto.ReservedRange`},{name:`reserved_name`,number:10,type:9,label:3},{name:`visibility`,number:11,type:14,label:1,typeName:`.google.protobuf.SymbolVisibility`}],nestedType:[{name:`ExtensionRange`,field:[{name:`start`,number:1,type:5,label:1},{name:`end`,number:2,type:5,label:1},{name:`options`,number:3,type:11,label:1,typeName:`.google.protobuf.ExtensionRangeOptions`}]},{name:`ReservedRange`,field:[{name:`start`,number:1,type:5,label:1},{name:`end`,number:2,type:5,label:1}]}]},{name:`ExtensionRangeOptions`,field:[{name:`uninterpreted_option`,number:999,type:11,label:3,typeName:`.google.protobuf.UninterpretedOption`},{name:`declaration`,number:2,type:11,label:3,typeName:`.google.protobuf.ExtensionRangeOptions.Declaration`,options:{retention:2}},{name:`features`,number:50,type:11,label:1,typeName:`.google.protobuf.FeatureSet`},{name:`verification`,number:3,type:14,label:1,typeName:`.google.protobuf.ExtensionRangeOptions.VerificationState`,defaultValue:`UNVERIFIED`,options:{retention:2}}],nestedType:[{name:`Declaration`,field:[{name:`number`,number:1,type:5,label:1},{name:`full_name`,number:2,type:9,label:1},{name:`type`,number:3,type:9,label:1},{name:`reserved`,number:5,type:8,label:1},{name:`repeated`,number:6,type:8,label:1}]}],enumType:[{name:`VerificationState`,value:[{name:`DECLARATION`,number:0},{name:`UNVERIFIED`,number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:`FieldDescriptorProto`,field:[{name:`name`,number:1,type:9,label:1},{name:`number`,number:3,type:5,label:1},{name:`label`,number:4,type:14,label:1,typeName:`.google.protobuf.FieldDescriptorProto.Label`},{name:`type`,number:5,type:14,label:1,typeName:`.google.protobuf.FieldDescriptorProto.Type`},{name:`type_name`,number:6,type:9,label:1},{name:`extendee`,number:2,type:9,label:1},{name:`default_value`,number:7,type:9,label:1},{name:`oneof_index`,number:9,type:5,label:1},{name:`json_name`,number:10,type:9,label:1},{name:`options`,number:8,type:11,label:1,typeName:`.google.protobuf.FieldOptions`},{name:`proto3_optional`,number:17,type:8,label:1}],enumType:[{name:`Type`,value:[{name:`TYPE_DOUBLE`,number:1},{name:`TYPE_FLOAT`,number:2},{name:`TYPE_INT64`,number:3},{name:`TYPE_UINT64`,number:4},{name:`TYPE_INT32`,number:5},{name:`TYPE_FIXED64`,number:6},{name:`TYPE_FIXED32`,number:7},{name:`TYPE_BOOL`,number:8},{name:`TYPE_STRING`,number:9},{name:`TYPE_GROUP`,number:10},{name:`TYPE_MESSAGE`,number:11},{name:`TYPE_BYTES`,number:12},{name:`TYPE_UINT32`,number:13},{name:`TYPE_ENUM`,number:14},{name:`TYPE_SFIXED32`,number:15},{name:`TYPE_SFIXED64`,number:16},{name:`TYPE_SINT32`,number:17},{name:`TYPE_SINT64`,number:18}]},{name:`Label`,value:[{name:`LABEL_OPTIONAL`,number:1},{name:`LABEL_REPEATED`,number:3},{name:`LABEL_REQUIRED`,number:2}]}]},{name:`OneofDescriptorProto`,field:[{name:`name`,number:1,type:9,label:1},{name:`options`,number:2,type:11,label:1,typeName:`.google.protobuf.OneofOptions`}]},{name:`EnumDescriptorProto`,field:[{name:`name`,number:1,type:9,label:1},{name:`value`,number:2,type:11,label:3,typeName:`.google.protobuf.EnumValueDescriptorProto`},{name:`options`,number:3,type:11,label:1,typeName:`.google.protobuf.EnumOptions`},{name:`reserved_range`,number:4,type:11,label:3,typeName:`.google.protobuf.EnumDescriptorProto.EnumReservedRange`},{name:`reserved_name`,number:5,type:9,label:3},{name:`visibility`,number:6,type:14,label:1,typeName:`.google.protobuf.SymbolVisibility`}],nestedType:[{name:`EnumReservedRange`,field:[{name:`start`,number:1,type:5,label:1},{name:`end`,number:2,type:5,label:1}]}]},{name:`EnumValueDescriptorProto`,field:[{name:`name`,number:1,type:9,label:1},{name:`number`,number:2,type:5,label:1},{name:`options`,number:3,type:11,label:1,typeName:`.google.protobuf.EnumValueOptions`}]},{name:`ServiceDescriptorProto`,field:[{name:`name`,number:1,type:9,label:1},{name:`method`,number:2,type:11,label:3,typeName:`.google.protobuf.MethodDescriptorProto`},{name:`options`,number:3,type:11,label:1,typeName:`.google.protobuf.ServiceOptions`}]},{name:`MethodDescriptorProto`,field:[{name:`name`,number:1,type:9,label:1},{name:`input_type`,number:2,type:9,label:1},{name:`output_type`,number:3,type:9,label:1},{name:`options`,number:4,type:11,label:1,typeName:`.google.protobuf.MethodOptions`},{name:`client_streaming`,number:5,type:8,label:1,defaultValue:`false`},{name:`server_streaming`,number:6,type:8,label:1,defaultValue:`false`}]},{name:`FileOptions`,field:[{name:`java_package`,number:1,type:9,label:1},{name:`java_outer_classname`,number:8,type:9,label:1},{name:`java_multiple_files`,number:10,type:8,label:1,defaultValue:`false`},{name:`java_generate_equals_and_hash`,number:20,type:8,label:1,options:{deprecated:!0}},{name:`java_string_check_utf8`,number:27,type:8,label:1,defaultValue:`false`},{name:`optimize_for`,number:9,type:14,label:1,typeName:`.google.protobuf.FileOptions.OptimizeMode`,defaultValue:`SPEED`},{name:`go_package`,number:11,type:9,label:1},{name:`cc_generic_services`,number:16,type:8,label:1,defaultValue:`false`},{name:`java_generic_services`,number:17,type:8,label:1,defaultValue:`false`},{name:`py_generic_services`,number:18,type:8,label:1,defaultValue:`false`},{name:`deprecated`,number:23,type:8,label:1,defaultValue:`false`},{name:`cc_enable_arenas`,number:31,type:8,label:1,defaultValue:`true`},{name:`objc_class_prefix`,number:36,type:9,label:1},{name:`csharp_namespace`,number:37,type:9,label:1},{name:`swift_prefix`,number:39,type:9,label:1},{name:`php_class_prefix`,number:40,type:9,label:1},{name:`php_namespace`,number:41,type:9,label:1},{name:`php_metadata_namespace`,number:44,type:9,label:1},{name:`ruby_package`,number:45,type:9,label:1},{name:`features`,number:50,type:11,label:1,typeName:`.google.protobuf.FeatureSet`},{name:`uninterpreted_option`,number:999,type:11,label:3,typeName:`.google.protobuf.UninterpretedOption`}],enumType:[{name:`OptimizeMode`,value:[{name:`SPEED`,number:1},{name:`CODE_SIZE`,number:2},{name:`LITE_RUNTIME`,number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:`MessageOptions`,field:[{name:`message_set_wire_format`,number:1,type:8,label:1,defaultValue:`false`},{name:`no_standard_descriptor_accessor`,number:2,type:8,label:1,defaultValue:`false`},{name:`deprecated`,number:3,type:8,label:1,defaultValue:`false`},{name:`map_entry`,number:7,type:8,label:1},{name:`deprecated_legacy_json_field_conflicts`,number:11,type:8,label:1,options:{deprecated:!0}},{name:`features`,number:12,type:11,label:1,typeName:`.google.protobuf.FeatureSet`},{name:`uninterpreted_option`,number:999,type:11,label:3,typeName:`.google.protobuf.UninterpretedOption`}],extensionRange:[{start:1e3,end:536870912}]},{name:`FieldOptions`,field:[{name:`ctype`,number:1,type:14,label:1,typeName:`.google.protobuf.FieldOptions.CType`,defaultValue:`STRING`},{name:`packed`,number:2,type:8,label:1},{name:`jstype`,number:6,type:14,label:1,typeName:`.google.protobuf.FieldOptions.JSType`,defaultValue:`JS_NORMAL`},{name:`lazy`,number:5,type:8,label:1,defaultValue:`false`},{name:`unverified_lazy`,number:15,type:8,label:1,defaultValue:`false`},{name:`deprecated`,number:3,type:8,label:1,defaultValue:`false`},{name:`weak`,number:10,type:8,label:1,defaultValue:`false`,options:{deprecated:!0}},{name:`debug_redact`,number:16,type:8,label:1,defaultValue:`false`},{name:`retention`,number:17,type:14,label:1,typeName:`.google.protobuf.FieldOptions.OptionRetention`},{name:`targets`,number:19,type:14,label:3,typeName:`.google.protobuf.FieldOptions.OptionTargetType`},{name:`edition_defaults`,number:20,type:11,label:3,typeName:`.google.protobuf.FieldOptions.EditionDefault`},{name:`features`,number:21,type:11,label:1,typeName:`.google.protobuf.FeatureSet`},{name:`feature_support`,number:22,type:11,label:1,typeName:`.google.protobuf.FieldOptions.FeatureSupport`},{name:`uninterpreted_option`,number:999,type:11,label:3,typeName:`.google.protobuf.UninterpretedOption`}],nestedType:[{name:`EditionDefault`,field:[{name:`edition`,number:3,type:14,label:1,typeName:`.google.protobuf.Edition`},{name:`value`,number:2,type:9,label:1}]},{name:`FeatureSupport`,field:[{name:`edition_introduced`,number:1,type:14,label:1,typeName:`.google.protobuf.Edition`},{name:`edition_deprecated`,number:2,type:14,label:1,typeName:`.google.protobuf.Edition`},{name:`deprecation_warning`,number:3,type:9,label:1},{name:`edition_removed`,number:4,type:14,label:1,typeName:`.google.protobuf.Edition`}]}],enumType:[{name:`CType`,value:[{name:`STRING`,number:0},{name:`CORD`,number:1},{name:`STRING_PIECE`,number:2}]},{name:`JSType`,value:[{name:`JS_NORMAL`,number:0},{name:`JS_STRING`,number:1},{name:`JS_NUMBER`,number:2}]},{name:`OptionRetention`,value:[{name:`RETENTION_UNKNOWN`,number:0},{name:`RETENTION_RUNTIME`,number:1},{name:`RETENTION_SOURCE`,number:2}]},{name:`OptionTargetType`,value:[{name:`TARGET_TYPE_UNKNOWN`,number:0},{name:`TARGET_TYPE_FILE`,number:1},{name:`TARGET_TYPE_EXTENSION_RANGE`,number:2},{name:`TARGET_TYPE_MESSAGE`,number:3},{name:`TARGET_TYPE_FIELD`,number:4},{name:`TARGET_TYPE_ONEOF`,number:5},{name:`TARGET_TYPE_ENUM`,number:6},{name:`TARGET_TYPE_ENUM_ENTRY`,number:7},{name:`TARGET_TYPE_SERVICE`,number:8},{name:`TARGET_TYPE_METHOD`,number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:`OneofOptions`,field:[{name:`features`,number:1,type:11,label:1,typeName:`.google.protobuf.FeatureSet`},{name:`uninterpreted_option`,number:999,type:11,label:3,typeName:`.google.protobuf.UninterpretedOption`}],extensionRange:[{start:1e3,end:536870912}]},{name:`EnumOptions`,field:[{name:`allow_alias`,number:2,type:8,label:1},{name:`deprecated`,number:3,type:8,label:1,defaultValue:`false`},{name:`deprecated_legacy_json_field_conflicts`,number:6,type:8,label:1,options:{deprecated:!0}},{name:`features`,number:7,type:11,label:1,typeName:`.google.protobuf.FeatureSet`},{name:`uninterpreted_option`,number:999,type:11,label:3,typeName:`.google.protobuf.UninterpretedOption`}],extensionRange:[{start:1e3,end:536870912}]},{name:`EnumValueOptions`,field:[{name:`deprecated`,number:1,type:8,label:1,defaultValue:`false`},{name:`features`,number:2,type:11,label:1,typeName:`.google.protobuf.FeatureSet`},{name:`debug_redact`,number:3,type:8,label:1,defaultValue:`false`},{name:`feature_support`,number:4,type:11,label:1,typeName:`.google.protobuf.FieldOptions.FeatureSupport`},{name:`uninterpreted_option`,number:999,type:11,label:3,typeName:`.google.protobuf.UninterpretedOption`}],extensionRange:[{start:1e3,end:536870912}]},{name:`ServiceOptions`,field:[{name:`features`,number:34,type:11,label:1,typeName:`.google.protobuf.FeatureSet`},{name:`deprecated`,number:33,type:8,label:1,defaultValue:`false`},{name:`uninterpreted_option`,number:999,type:11,label:3,typeName:`.google.protobuf.UninterpretedOption`}],extensionRange:[{start:1e3,end:536870912}]},{name:`MethodOptions`,field:[{name:`deprecated`,number:33,type:8,label:1,defaultValue:`false`},{name:`idempotency_level`,number:34,type:14,label:1,typeName:`.google.protobuf.MethodOptions.IdempotencyLevel`,defaultValue:`IDEMPOTENCY_UNKNOWN`},{name:`features`,number:35,type:11,label:1,typeName:`.google.protobuf.FeatureSet`},{name:`uninterpreted_option`,number:999,type:11,label:3,typeName:`.google.protobuf.UninterpretedOption`}],enumType:[{name:`IdempotencyLevel`,value:[{name:`IDEMPOTENCY_UNKNOWN`,number:0},{name:`NO_SIDE_EFFECTS`,number:1},{name:`IDEMPOTENT`,number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:`UninterpretedOption`,field:[{name:`name`,number:2,type:11,label:3,typeName:`.google.protobuf.UninterpretedOption.NamePart`},{name:`identifier_value`,number:3,type:9,label:1},{name:`positive_int_value`,number:4,type:4,label:1},{name:`negative_int_value`,number:5,type:3,label:1},{name:`double_value`,number:6,type:1,label:1},{name:`string_value`,number:7,type:12,label:1},{name:`aggregate_value`,number:8,type:9,label:1}],nestedType:[{name:`NamePart`,field:[{name:`name_part`,number:1,type:9,label:2},{name:`is_extension`,number:2,type:8,label:2}]}]},{name:`FeatureSet`,field:[{name:`field_presence`,number:1,type:14,label:1,typeName:`.google.protobuf.FeatureSet.FieldPresence`,options:{retention:1,targets:[4,1],editionDefaults:[{value:`EXPLICIT`,edition:900},{value:`IMPLICIT`,edition:999},{value:`EXPLICIT`,edition:1e3}]}},{name:`enum_type`,number:2,type:14,label:1,typeName:`.google.protobuf.FeatureSet.EnumType`,options:{retention:1,targets:[6,1],editionDefaults:[{value:`CLOSED`,edition:900},{value:`OPEN`,edition:999}]}},{name:`repeated_field_encoding`,number:3,type:14,label:1,typeName:`.google.protobuf.FeatureSet.RepeatedFieldEncoding`,options:{retention:1,targets:[4,1],editionDefaults:[{value:`EXPANDED`,edition:900},{value:`PACKED`,edition:999}]}},{name:`utf8_validation`,number:4,type:14,label:1,typeName:`.google.protobuf.FeatureSet.Utf8Validation`,options:{retention:1,targets:[4,1],editionDefaults:[{value:`NONE`,edition:900},{value:`VERIFY`,edition:999}]}},{name:`message_encoding`,number:5,type:14,label:1,typeName:`.google.protobuf.FeatureSet.MessageEncoding`,options:{retention:1,targets:[4,1],editionDefaults:[{value:`LENGTH_PREFIXED`,edition:900}]}},{name:`json_format`,number:6,type:14,label:1,typeName:`.google.protobuf.FeatureSet.JsonFormat`,options:{retention:1,targets:[3,6,1],editionDefaults:[{value:`LEGACY_BEST_EFFORT`,edition:900},{value:`ALLOW`,edition:999}]}},{name:`enforce_naming_style`,number:7,type:14,label:1,typeName:`.google.protobuf.FeatureSet.EnforceNamingStyle`,options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:`STYLE_LEGACY`,edition:900},{value:`STYLE2024`,edition:1001}]}},{name:`default_symbol_visibility`,number:8,type:14,label:1,typeName:`.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility`,options:{retention:2,targets:[1],editionDefaults:[{value:`EXPORT_ALL`,edition:900},{value:`EXPORT_TOP_LEVEL`,edition:1001}]}}],nestedType:[{name:`VisibilityFeature`,enumType:[{name:`DefaultSymbolVisibility`,value:[{name:`DEFAULT_SYMBOL_VISIBILITY_UNKNOWN`,number:0},{name:`EXPORT_ALL`,number:1},{name:`EXPORT_TOP_LEVEL`,number:2},{name:`LOCAL_ALL`,number:3},{name:`STRICT`,number:4}]}]}],enumType:[{name:`FieldPresence`,value:[{name:`FIELD_PRESENCE_UNKNOWN`,number:0},{name:`EXPLICIT`,number:1},{name:`IMPLICIT`,number:2},{name:`LEGACY_REQUIRED`,number:3}]},{name:`EnumType`,value:[{name:`ENUM_TYPE_UNKNOWN`,number:0},{name:`OPEN`,number:1},{name:`CLOSED`,number:2}]},{name:`RepeatedFieldEncoding`,value:[{name:`REPEATED_FIELD_ENCODING_UNKNOWN`,number:0},{name:`PACKED`,number:1},{name:`EXPANDED`,number:2}]},{name:`Utf8Validation`,value:[{name:`UTF8_VALIDATION_UNKNOWN`,number:0},{name:`VERIFY`,number:2},{name:`NONE`,number:3}]},{name:`MessageEncoding`,value:[{name:`MESSAGE_ENCODING_UNKNOWN`,number:0},{name:`LENGTH_PREFIXED`,number:1},{name:`DELIMITED`,number:2}]},{name:`JsonFormat`,value:[{name:`JSON_FORMAT_UNKNOWN`,number:0},{name:`ALLOW`,number:1},{name:`LEGACY_BEST_EFFORT`,number:2}]},{name:`EnforceNamingStyle`,value:[{name:`ENFORCE_NAMING_STYLE_UNKNOWN`,number:0},{name:`STYLE2024`,number:1},{name:`STYLE_LEGACY`,number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:`FeatureSetDefaults`,field:[{name:`defaults`,number:1,type:11,label:3,typeName:`.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault`},{name:`minimum_edition`,number:4,type:14,label:1,typeName:`.google.protobuf.Edition`},{name:`maximum_edition`,number:5,type:14,label:1,typeName:`.google.protobuf.Edition`}],nestedType:[{name:`FeatureSetEditionDefault`,field:[{name:`edition`,number:3,type:14,label:1,typeName:`.google.protobuf.Edition`},{name:`overridable_features`,number:4,type:11,label:1,typeName:`.google.protobuf.FeatureSet`},{name:`fixed_features`,number:5,type:11,label:1,typeName:`.google.protobuf.FeatureSet`}]}]},{name:`SourceCodeInfo`,field:[{name:`location`,number:1,type:11,label:3,typeName:`.google.protobuf.SourceCodeInfo.Location`}],nestedType:[{name:`Location`,field:[{name:`path`,number:1,type:5,label:3,options:{packed:!0}},{name:`span`,number:2,type:5,label:3,options:{packed:!0}},{name:`leading_comments`,number:3,type:9,label:1},{name:`trailing_comments`,number:4,type:9,label:1},{name:`leading_detached_comments`,number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:`GeneratedCodeInfo`,field:[{name:`annotation`,number:1,type:11,label:3,typeName:`.google.protobuf.GeneratedCodeInfo.Annotation`}],nestedType:[{name:`Annotation`,field:[{name:`path`,number:1,type:5,label:3,options:{packed:!0}},{name:`source_file`,number:2,type:9,label:1},{name:`begin`,number:3,type:5,label:1},{name:`end`,number:4,type:5,label:1},{name:`semantic`,number:5,type:14,label:1,typeName:`.google.protobuf.GeneratedCodeInfo.Annotation.Semantic`}],enumType:[{name:`Semantic`,value:[{name:`NONE`,number:0},{name:`SET`,number:1},{name:`ALIAS`,number:2}]}]}]}],enumType:[{name:`Edition`,value:[{name:`EDITION_UNKNOWN`,number:0},{name:`EDITION_LEGACY`,number:900},{name:`EDITION_PROTO2`,number:998},{name:`EDITION_PROTO3`,number:999},{name:`EDITION_2023`,number:1e3},{name:`EDITION_2024`,number:1001},{name:`EDITION_UNSTABLE`,number:9999},{name:`EDITION_1_TEST_ONLY`,number:1},{name:`EDITION_2_TEST_ONLY`,number:2},{name:`EDITION_99997_TEST_ONLY`,number:99997},{name:`EDITION_99998_TEST_ONLY`,number:99998},{name:`EDITION_99999_TEST_ONLY`,number:99999},{name:`EDITION_MAX`,number:2147483647}]},{name:`SymbolVisibility`,value:[{name:`VISIBILITY_UNSET`,number:0},{name:`VISIBILITY_LOCAL`,number:1},{name:`VISIBILITY_EXPORT`,number:2}]}]}),1);var Ht;(function(e){e[e.DECLARATION=0]=`DECLARATION`,e[e.UNVERIFIED=1]=`UNVERIFIED`})(Ht||={});var Ut;(function(e){e[e.DOUBLE=1]=`DOUBLE`,e[e.FLOAT=2]=`FLOAT`,e[e.INT64=3]=`INT64`,e[e.UINT64=4]=`UINT64`,e[e.INT32=5]=`INT32`,e[e.FIXED64=6]=`FIXED64`,e[e.FIXED32=7]=`FIXED32`,e[e.BOOL=8]=`BOOL`,e[e.STRING=9]=`STRING`,e[e.GROUP=10]=`GROUP`,e[e.MESSAGE=11]=`MESSAGE`,e[e.BYTES=12]=`BYTES`,e[e.UINT32=13]=`UINT32`,e[e.ENUM=14]=`ENUM`,e[e.SFIXED32=15]=`SFIXED32`,e[e.SFIXED64=16]=`SFIXED64`,e[e.SINT32=17]=`SINT32`,e[e.SINT64=18]=`SINT64`})(Ut||={});var Wt;(function(e){e[e.OPTIONAL=1]=`OPTIONAL`,e[e.REPEATED=3]=`REPEATED`,e[e.REQUIRED=2]=`REQUIRED`})(Wt||={});var Gt;(function(e){e[e.SPEED=1]=`SPEED`,e[e.CODE_SIZE=2]=`CODE_SIZE`,e[e.LITE_RUNTIME=3]=`LITE_RUNTIME`})(Gt||={});var Kt;(function(e){e[e.STRING=0]=`STRING`,e[e.CORD=1]=`CORD`,e[e.STRING_PIECE=2]=`STRING_PIECE`})(Kt||={});var qt;(function(e){e[e.JS_NORMAL=0]=`JS_NORMAL`,e[e.JS_STRING=1]=`JS_STRING`,e[e.JS_NUMBER=2]=`JS_NUMBER`})(qt||={});var Jt;(function(e){e[e.RETENTION_UNKNOWN=0]=`RETENTION_UNKNOWN`,e[e.RETENTION_RUNTIME=1]=`RETENTION_RUNTIME`,e[e.RETENTION_SOURCE=2]=`RETENTION_SOURCE`})(Jt||={});var Yt;(function(e){e[e.TARGET_TYPE_UNKNOWN=0]=`TARGET_TYPE_UNKNOWN`,e[e.TARGET_TYPE_FILE=1]=`TARGET_TYPE_FILE`,e[e.TARGET_TYPE_EXTENSION_RANGE=2]=`TARGET_TYPE_EXTENSION_RANGE`,e[e.TARGET_TYPE_MESSAGE=3]=`TARGET_TYPE_MESSAGE`,e[e.TARGET_TYPE_FIELD=4]=`TARGET_TYPE_FIELD`,e[e.TARGET_TYPE_ONEOF=5]=`TARGET_TYPE_ONEOF`,e[e.TARGET_TYPE_ENUM=6]=`TARGET_TYPE_ENUM`,e[e.TARGET_TYPE_ENUM_ENTRY=7]=`TARGET_TYPE_ENUM_ENTRY`,e[e.TARGET_TYPE_SERVICE=8]=`TARGET_TYPE_SERVICE`,e[e.TARGET_TYPE_METHOD=9]=`TARGET_TYPE_METHOD`})(Yt||={});var Xt;(function(e){e[e.IDEMPOTENCY_UNKNOWN=0]=`IDEMPOTENCY_UNKNOWN`,e[e.NO_SIDE_EFFECTS=1]=`NO_SIDE_EFFECTS`,e[e.IDEMPOTENT=2]=`IDEMPOTENT`})(Xt||={});var Zt;(function(e){e[e.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0]=`DEFAULT_SYMBOL_VISIBILITY_UNKNOWN`,e[e.EXPORT_ALL=1]=`EXPORT_ALL`,e[e.EXPORT_TOP_LEVEL=2]=`EXPORT_TOP_LEVEL`,e[e.LOCAL_ALL=3]=`LOCAL_ALL`,e[e.STRICT=4]=`STRICT`})(Zt||={});var Qt;(function(e){e[e.FIELD_PRESENCE_UNKNOWN=0]=`FIELD_PRESENCE_UNKNOWN`,e[e.EXPLICIT=1]=`EXPLICIT`,e[e.IMPLICIT=2]=`IMPLICIT`,e[e.LEGACY_REQUIRED=3]=`LEGACY_REQUIRED`})(Qt||={});var $t;(function(e){e[e.ENUM_TYPE_UNKNOWN=0]=`ENUM_TYPE_UNKNOWN`,e[e.OPEN=1]=`OPEN`,e[e.CLOSED=2]=`CLOSED`})($t||={});var en;(function(e){e[e.REPEATED_FIELD_ENCODING_UNKNOWN=0]=`REPEATED_FIELD_ENCODING_UNKNOWN`,e[e.PACKED=1]=`PACKED`,e[e.EXPANDED=2]=`EXPANDED`})(en||={});var tn;(function(e){e[e.UTF8_VALIDATION_UNKNOWN=0]=`UTF8_VALIDATION_UNKNOWN`,e[e.VERIFY=2]=`VERIFY`,e[e.NONE=3]=`NONE`})(tn||={});var nn;(function(e){e[e.MESSAGE_ENCODING_UNKNOWN=0]=`MESSAGE_ENCODING_UNKNOWN`,e[e.LENGTH_PREFIXED=1]=`LENGTH_PREFIXED`,e[e.DELIMITED=2]=`DELIMITED`})(nn||={});var rn;(function(e){e[e.JSON_FORMAT_UNKNOWN=0]=`JSON_FORMAT_UNKNOWN`,e[e.ALLOW=1]=`ALLOW`,e[e.LEGACY_BEST_EFFORT=2]=`LEGACY_BEST_EFFORT`})(rn||={});var an;(function(e){e[e.ENFORCE_NAMING_STYLE_UNKNOWN=0]=`ENFORCE_NAMING_STYLE_UNKNOWN`,e[e.STYLE2024=1]=`STYLE2024`,e[e.STYLE_LEGACY=2]=`STYLE_LEGACY`})(an||={});var on;(function(e){e[e.NONE=0]=`NONE`,e[e.SET=1]=`SET`,e[e.ALIAS=2]=`ALIAS`})(on||={});var sn;(function(e){e[e.EDITION_UNKNOWN=0]=`EDITION_UNKNOWN`,e[e.EDITION_LEGACY=900]=`EDITION_LEGACY`,e[e.EDITION_PROTO2=998]=`EDITION_PROTO2`,e[e.EDITION_PROTO3=999]=`EDITION_PROTO3`,e[e.EDITION_2023=1e3]=`EDITION_2023`,e[e.EDITION_2024=1001]=`EDITION_2024`,e[e.EDITION_UNSTABLE=9999]=`EDITION_UNSTABLE`,e[e.EDITION_1_TEST_ONLY=1]=`EDITION_1_TEST_ONLY`,e[e.EDITION_2_TEST_ONLY=2]=`EDITION_2_TEST_ONLY`,e[e.EDITION_99997_TEST_ONLY=99997]=`EDITION_99997_TEST_ONLY`,e[e.EDITION_99998_TEST_ONLY=99998]=`EDITION_99998_TEST_ONLY`,e[e.EDITION_99999_TEST_ONLY=99999]=`EDITION_99999_TEST_ONLY`,e[e.EDITION_MAX=2147483647]=`EDITION_MAX`})(sn||={});var cn;(function(e){e[e.VISIBILITY_UNSET=0]=`VISIBILITY_UNSET`,e[e.VISIBILITY_LOCAL=1]=`VISIBILITY_LOCAL`,e[e.VISIBILITY_EXPORT=2]=`VISIBILITY_EXPORT`})(cn||={});let ln={readUnknownFields:!0};function un(e){return e?Object.assign(Object.assign({},ln),e):ln}function P(e,t,n){let r=xt(e,void 0,!1);return dn(r,new qe(t),un(n),!1,t.byteLength),r.message}function dn(e,t,n,r,i){let a=r?t.len:t.pos+i,o,s,c=e.getUnknown()??[];for(;t.pos<a&&([o,s]=t.tag(),!(r&&s==M.EndGroup));){let r=e.findNumber(o);if(!r){let e=t.skip(s,o);n.readUnknownFields&&c.push({no:o,wireType:s,data:e});continue}fn(e,t,r,s,n)}if(r&&(s!=M.EndGroup||o!==i))throw Error(`invalid end group tag`);c.length>0&&e.setUnknown(c)}function fn(e,t,n,r,i){switch(n.fieldKind){case`scalar`:e.set(n,gn(t,n.scalar));break;case`enum`:let a=gn(t,v.INT32);if(n.enum.open)e.set(n,a);else if(n.enum.values.some(e=>e.number===a))e.set(n,a);else if(i.readUnknownFields){let t=[];f(a,t);let i=e.getUnknown()??[];i.push({no:n.number,wireType:r,data:new Uint8Array(t)}),e.setUnknown(i)}break;case`message`:e.set(n,hn(t,i,n,e.get(n)));break;case`list`:mn(t,r,e.get(n),i);break;case`map`:pn(t,e.get(n),i);break}}function pn(e,t,n){let r=t.field(),i,a,o=e.uint32(),s=e.pos+o;for(;e.pos<s;){let[t]=e.tag();switch(t){case 1:i=gn(e,r.mapKey);break;case 2:switch(r.mapKind){case`scalar`:a=gn(e,r.scalar);break;case`enum`:a=e.int32();break;case`message`:a=hn(e,n,r);break}break}}if(i===void 0&&(i=y(r.mapKey,!1)),a===void 0)switch(r.mapKind){case`scalar`:a=y(r.scalar,!1);break;case`enum`:a=r.enum.values[0].number;break;case`message`:a=xt(r.message,void 0,!1);break}t.set(i,a)}function mn(e,t,n,r){let i=n.field();if(i.listKind===`message`){n.add(hn(e,r,i));return}let a=i.scalar??v.INT32;if(!(t==M.LengthDelimited&&a!=v.STRING&&a!=v.BYTES)){n.add(gn(e,a));return}let o=e.uint32()+e.pos;for(;e.pos<o;)n.add(gn(e,a))}function hn(e,t,n,r){let i=n.delimitedEncoding,a=r??xt(n.message,void 0,!1);return dn(a,e,t,i,i?n.number:e.uint32()),a}function gn(e,t){switch(t){case v.STRING:return e.string();case v.BOOL:return e.bool();case v.DOUBLE:return e.double();case v.FLOAT:return e.float();case v.INT32:return e.int32();case v.INT64:return e.int64();case v.UINT64:return e.uint64();case v.FIXED64:return e.fixed64();case v.BYTES:return e.bytes();case v.FIXED32:return e.fixed32();case v.SFIXED32:return e.sfixed32();case v.SFIXED64:return e.sfixed64();case v.SINT64:return e.sint64();case v.UINT32:return e.uint32();case v.SINT32:return e.sint32()}}function _n(e,t){let n=P(Vt,Pe(e));return n.messageType.forEach(O),n.dependency=t?.map(e=>e.proto.name)??[],ie(n,e=>t?.find(t=>t.proto.name===e)).getFile(n.name)}let vn=N(_n(`ChZtb2R1bGVzL0Jhc2VEYXRhLnByb3RvEhVjb20ucXVpY2sudm9pY2UucHJvdG8idAoJQ29tbW9uUmVxEg0KBWV2ZW50GAEgASgJEgwKBGRhdGEYAiABKAwSCgoCc24YAyABKAMSDAoEdGltZRgEIAEoAxINCgV2YWxpZBgFIAEoAxIPCgd2ZXJzaW9uGAYgASgFEhAKCGNvbXByZXNzGAcgASgIIpABCglDb21tb25Sc3ASDQoFZXZlbnQYASABKAkSDAoEZGF0YRgCIAEoDBIKCgJzbhgDIAEoAxIMCgR0aW1lGAQgASgDEg0KBXZhbGlkGAUgASgDEgwKBGNvZGUYBiABKAUSDAoEZGVzYxgHIAEoCRIPCgd2ZXJzaW9uGAggASgFEhAKCGNvbXByZXNzGAkgASgIQj8KFWNvbS5xdWljay52b2ljZS5wcm90b0IIQmFzZURhdGFaFWNvbS5xdWljay52b2ljZS5wcm90b7oCBFJvb21iBnByb3RvMw`),1);function yn(e){if(e==null)return e;let t=typeof e;if(t===`bigint`||t===`string`||t===`number`||t===`boolean`||e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>yn(e));if(t!==`object`)return e;let n=e,r={};for(let e of Object.keys(n))e!==`$typeName`&&(r[e]=yn(n[e]));return r}function bn(e){return yn({...e,sn:Number(e.sn),time:Number(e.time),valid:Number(e.valid)})}function xn(e){return bn(P(vn,e))}let Sn=(e,t)=>{try{let n=Number(e);if(isNaN(n)){let t=new Date(`${e}`);if(`${t}`==`Invalid Date`)return 0;n=t.getTime()}if(t!==void 0){let e=new Date().getTimezoneOffset();n+=(e+t)*60*1e3}return n}catch(n){return console.error(`\\x1B[38;2;0;151;255m%c%s\\x1B[0m`,`color:#0097ff;padding:16px 0;`,`------->timeStamp:err`,{_val:e,_offset:t,error:n}),0}},Cn=36e5*24,wn={1:`1`,2:`2`,3:`3`,4:`4`,5:`5`,6:`6`,7:`7`,"01":`一`,"02":`二`,"03":`三`,"04":`四`,"05":`五`,"06":`六`,"07":`日`},Tn=e=>Sn(e),En=(e,t=`YYYY-MM-DD hh:mm:ss`,n={})=>{let{empty_str:r,offset:i}={empty_str:`-`,...n},a=Sn(e,i);if(Number(e)!==0&&a===0)return r;let o=new Date(a),s=`${o.getFullYear()}`,c=`${o.getMonth()+1}`,l=`${[`1`,`2`,`3`].includes(c)?1:[`4`,`5`,`6`].includes(c)?2:[`7`,`8`,`9`].includes(c)?3:4}`,u=`${o.getDate()}`,d=`${o.getDay()===0?7:o.getDay()}`,f=`${o.getHours()}`,p=`${o.getMinutes()}`,m=`${o.getSeconds()}`,h=`${Math.ceil((a-Tn(`${s}/01/01 00:00:00`)+1)/Cn)}`,g=`${Math.ceil(((a-Tn(`${s}/01/01 00:00:00`))/Cn-Number(d))/7)+1}`,_=[{k:`Y+`,v:s},{k:`M+`,v:c},{k:`Q+`,v:l},{k:`D+`,v:u},{k:`W+`,v:d},{k:`h+`,v:f},{k:`m+`,v:p},{k:`s+`,v:m},{k:`d+`,v:h},{k:`w+`,v:g}],v;for(let{k:e,v:n}of _)if(v=RegExp(`(${e})`).exec(t),v){let e=v[1],r=n.padStart(e.length,`0`);e.includes(`W`)&&(r=wn[r.slice(0,2)]),t=t.replace(e,r)}return t};function Dn(e){let t=e.length;for(;--t>=0;)e[t]=0}let On=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),kn=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),An=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),jn=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),F=Array(288*2);Dn(F);let Mn=Array(60);Dn(Mn);let Nn=Array(512);Dn(Nn);let Pn=Array(256);Dn(Pn);let Fn=Array(29);Dn(Fn);let In=Array(30);Dn(In);function Ln(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let Rn,zn,Bn;function Vn(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}let Hn=e=>e<256?Nn[e]:Nn[256+(e>>>7)],Un=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},I=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,Un(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},L=(e,t,n)=>{I(e,n[t*2],n[t*2+1])},Wn=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},Gn=e=>{e.bi_valid===16?(Un(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},Kn=(e,t)=>{let n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,d,f,p,m,h=0;for(f=0;f<=15;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<573;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}},qn=(e,t,n)=>{let r=Array(16),i=0,a,o;for(a=1;a<=15;a++)i=i+n[a-1]<<1,r[a]=i;for(o=0;o<=t;o++){let t=e[o*2+1];t!==0&&(e[o*2]=Wn(r[t]++,t))}},Jn=()=>{let e,t,n,r,i,a=Array(16);for(n=0,r=0;r<28;r++)for(Fn[r]=n,e=0;e<1<<On[r];e++)Pn[n++]=r;for(Pn[n-1]=r,i=0,r=0;r<16;r++)for(In[r]=i,e=0;e<1<<kn[r];e++)Nn[i++]=r;for(i>>=7;r<30;r++)for(In[r]=i<<7,e=0;e<1<<kn[r]-7;e++)Nn[256+ i++]=r;for(t=0;t<=15;t++)a[t]=0;for(e=0;e<=143;)F[e*2+1]=8,e++,a[8]++;for(;e<=255;)F[e*2+1]=9,e++,a[9]++;for(;e<=279;)F[e*2+1]=7,e++,a[7]++;for(;e<=287;)F[e*2+1]=8,e++,a[8]++;for(qn(F,287,a),e=0;e<30;e++)Mn[e*2+1]=5,Mn[e*2]=Wn(e,5);Rn=new Ln(F,On,257,286,15),zn=new Ln(Mn,kn,0,30,15),Bn=new Ln([],An,0,19,7)},Yn=e=>{let t;for(t=0;t<286;t++)e.dyn_ltree[t*2]=0;for(t=0;t<30;t++)e.dyn_dtree[t*2]=0;for(t=0;t<19;t++)e.bl_tree[t*2]=0;e.dyn_ltree[256*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Xn=e=>{e.bi_valid>8?Un(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Zn=(e,t,n,r)=>{let i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},Qn=(e,t,n)=>{let r=e.heap[n],i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&Zn(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Zn(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},$n=(e,t,n)=>{let r,i,a=0,o,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+ a++]&255,r+=(e.pending_buf[e.sym_buf+ a++]&255)<<8,i=e.pending_buf[e.sym_buf+ a++],r===0?L(e,i,t):(o=Pn[i],L(e,o+256+1,t),s=On[o],s!==0&&(i-=Fn[o],I(e,i,s)),r--,o=Hn(r),L(e,o,n),s=kn[o],s!==0&&(r-=In[o],I(e,r,s)));while(a<e.sym_next);L(e,256,t)},er=(e,t)=>{let n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=573,o=0;o<a;o++)n[o*2]===0?n[o*2+1]=0:(e.heap[++e.heap_len]=c=o,e.depth[o]=0);for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)Qn(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Qn(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,Qn(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Kn(e,t),qn(n,c,e.bl_count)},tr=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a===0?s<=10?e.bl_tree[34]++:e.bl_tree[36]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[32]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))},nr=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do L(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(L(e,17,e.bl_tree),I(e,s-3,3)):(L(e,18,e.bl_tree),I(e,s-11,7)):(a!==i&&(L(e,a,e.bl_tree),s--),L(e,16,e.bl_tree),I(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}},rr=e=>{let t;for(tr(e,e.dyn_ltree,e.l_desc.max_code),tr(e,e.dyn_dtree,e.d_desc.max_code),er(e,e.bl_desc),t=18;t>=3&&e.bl_tree[jn[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},ir=(e,t,n,r)=>{let i;for(I(e,t-257,5),I(e,n-1,5),I(e,r-4,4),i=0;i<r;i++)I(e,e.bl_tree[jn[i]*2+1],3);nr(e,e.dyn_ltree,t-1),nr(e,e.dyn_dtree,n-1)},ar=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return 0;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return 1;for(n=32;n<256;n++)if(e.dyn_ltree[n*2]!==0)return 1;return 0},or=!1,sr=e=>{or||=(Jn(),!0),e.l_desc=new Vn(e.dyn_ltree,Rn),e.d_desc=new Vn(e.dyn_dtree,zn),e.bl_desc=new Vn(e.bl_tree,Bn),e.bi_buf=0,e.bi_valid=0,Yn(e)},cr=(e,t,n,r)=>{I(e,0+(r?1:0),3),Xn(e),Un(e,n),Un(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n};var lr={_tr_init:sr,_tr_stored_block:cr,_tr_flush_block:(e,t,n,r)=>{let i,a,o=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=ar(e)),er(e,e.l_desc),er(e,e.d_desc),o=rr(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?cr(e,t,n,r):e.strategy===4||a===i?(I(e,2+(r?1:0),3),$n(e,F,Mn)):(I(e,4+(r?1:0),3),ir(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),$n(e,e.dyn_ltree,e.dyn_dtree)),Yn(e),r&&Xn(e)},_tr_tally:(e,t,n)=>(e.pending_buf[e.sym_buf+ e.sym_next++]=t,e.pending_buf[e.sym_buf+ e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+ e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Pn[n]+256+1)*2]++,e.dyn_dtree[Hn(t)*2]++),e.sym_next===e.sym_end),_tr_align:e=>{I(e,2,3),L(e,256,F),Gn(e)}},ur=(e,t,n,r)=>{let i=e&65535|0,a=e>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0};let dr=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t})());var R=(e,t,n,r)=>{let i=dr,a=r+n;e^=-1;for(let n=r;n<a;n++)e=e>>>8^i[(e^t[n])&255];return e^-1},fr={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`},pr={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};let{_tr_init:mr,_tr_stored_block:hr,_tr_flush_block:gr,_tr_tally:z,_tr_align:_r}=lr,{Z_NO_FLUSH:vr,Z_PARTIAL_FLUSH:yr,Z_FULL_FLUSH:br,Z_FINISH:B,Z_BLOCK:xr,Z_OK:V,Z_STREAM_END:Sr,Z_STREAM_ERROR:H,Z_DATA_ERROR:Cr,Z_BUF_ERROR:wr,Z_DEFAULT_COMPRESSION:Tr,Z_FILTERED:Er,Z_HUFFMAN_ONLY:Dr,Z_RLE:Or,Z_FIXED:kr,Z_DEFAULT_STRATEGY:Ar,Z_UNKNOWN:jr,Z_DEFLATED:Mr}=pr,Nr=(e,t)=>(e.msg=fr[t],t),Pr=e=>e*2-(e>4?9:0),U=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Fr=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)},W=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,G=e=>{let t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},K=(e,t)=>{gr(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,G(e.strm)},q=(e,t)=>{e.pending_buf[e.pending++]=t},Ir=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},Lr=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=ur(e.adler,t,i,n):e.state.wrap===2&&(e.adler=R(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},Rr=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+258,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(i=t,l[i+o]!==m||l[i+o-1]!==p||l[i]!==l[r]||l[++i]!==l[r+1])continue;r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=258-(f-r),r=f-258,a>o){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead},zr=e=>{let t=e.w_size,n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-262)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Fr(e),r+=t),e.strm.avail_in===0)break;if(n=Lr(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=W(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=W(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<262&&e.strm.avail_in!==0)},Br=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,a,o=0,s=e.strm.avail_in;do{if(r=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>a&&(r=a),r<n&&(r===0&&t!==B||t===vr||r!==i+e.strm.avail_in)))break;o=t===B&&r===i+e.strm.avail_in?1:0,hr(e,0,0,o),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,G(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(Lr(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(o===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?4:t!==vr&&t!==B&&e.strm.avail_in===0&&e.strstart===e.block_start?2:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(Lr(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,n=a>e.w_size?e.w_size:a,i=e.strstart-e.block_start,(i>=n||(i||t===B)&&t!==vr&&e.strm.avail_in===0&&i<=a)&&(r=i>a?a:i,o=t===B&&e.strm.avail_in===0&&r===i?1:0,hr(e,e.block_start,r,o),e.block_start+=r,G(e.strm)),o?3:1)},Vr=(e,t)=>{let n,r;for(;;){if(e.lookahead<262){if(zr(e),e.lookahead<262&&t===vr)return 1;if(e.lookahead===0)break}if(n=0,e.lookahead>=3&&(e.ins_h=W(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-262&&(e.match_length=Rr(e,n)),e.match_length>=3)if(r=z(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do e.strstart++,e.ins_h=W(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=W(e,e.ins_h,e.window[e.strstart+1]);else r=z(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(K(e,!1),e.strm.avail_out===0))return 1}return e.insert=e.strstart<2?e.strstart:2,t===B?(K(e,!0),e.strm.avail_out===0?3:4):e.sym_next&&(K(e,!1),e.strm.avail_out===0)?1:2},Hr=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<262){if(zr(e),e.lookahead<262&&t===vr)return 1;if(e.lookahead===0)break}if(n=0,e.lookahead>=3&&(e.ins_h=W(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-262&&(e.match_length=Rr(e,n),e.match_length<=5&&(e.strategy===Er||e.match_length===3&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,r=z(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=W(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(K(e,!1),e.strm.avail_out===0))return 1}else if(e.match_available){if(r=z(e,0,e.window[e.strstart-1]),r&&K(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=z(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<2?e.strstart:2,t===B?(K(e,!0),e.strm.avail_out===0?3:4):e.sym_next&&(K(e,!1),e.strm.avail_out===0)?1:2},Ur=(e,t)=>{let n,r,i,a,o=e.window;for(;;){if(e.lookahead<=258){if(zr(e),e.lookahead<=258&&t===vr)return 1;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=e.strstart+258;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);e.match_length=258-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=z(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=z(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(K(e,!1),e.strm.avail_out===0))return 1}return e.insert=0,t===B?(K(e,!0),e.strm.avail_out===0?3:4):e.sym_next&&(K(e,!1),e.strm.avail_out===0)?1:2},Wr=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(zr(e),e.lookahead===0)){if(t===vr)return 1;break}if(e.match_length=0,n=z(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(K(e,!1),e.strm.avail_out===0))return 1}return e.insert=0,t===B?(K(e,!0),e.strm.avail_out===0?3:4):e.sym_next&&(K(e,!1),e.strm.avail_out===0)?1:2};function J(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}let Gr=[new J(0,0,0,0,Br),new J(4,4,8,4,Vr),new J(4,5,16,8,Vr),new J(4,6,32,32,Vr),new J(4,4,16,16,Hr),new J(8,16,32,32,Hr),new J(8,16,128,128,Hr),new J(8,32,128,256,Hr),new J(32,128,258,1024,Hr),new J(32,258,258,4096,Hr)],Kr=e=>{e.window_size=2*e.w_size,U(e.head),e.max_lazy_match=Gr[e.level].max_lazy,e.good_match=Gr[e.level].good_length,e.nice_match=Gr[e.level].nice_length,e.max_chain_length=Gr[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0};function qr(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Mr,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(573*2),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),U(this.dyn_ltree),U(this.dyn_dtree),U(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),U(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),U(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}let Jr=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.status!==42&&t.status!==57&&t.status!==69&&t.status!==73&&t.status!==91&&t.status!==103&&t.status!==113&&t.status!==666?1:0},Yr=e=>{if(Jr(e))return Nr(e,H);e.total_in=e.total_out=0,e.data_type=jr;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?57:t.wrap?42:113,e.adler=t.wrap===2?0:1,t.last_flush=-2,mr(t),V},Xr=e=>{let t=Yr(e);return t===V&&Kr(e.state),t},Zr=(e,t)=>Jr(e)||e.state.wrap!==2?H:(e.state.gzhead=t,V),Qr=(e,t,n,r,i,a)=>{if(!e)return H;let o=1;if(t===Tr&&(t=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>9||n!==Mr||r<8||r>15||t<0||t>9||a<0||a>kr||r===8&&o!==1)return Nr(e,H);r===8&&(r=9);let s=new qr;return e.state=s,s.strm=e,s.status=42,s.wrap=o,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=t,s.strategy=a,s.method=n,Xr(e)};var $r={deflateInit:(e,t)=>Qr(e,t,Mr,15,8,Ar),deflateInit2:Qr,deflateReset:Xr,deflateResetKeep:Yr,deflateSetHeader:Zr,deflate:(e,t)=>{if(Jr(e)||t>xr||t<0)return e?Nr(e,H):H;let n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===666&&t!==B)return Nr(e,e.avail_out===0?wr:H);let r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(G(e),e.avail_out===0)return n.last_flush=-1,V}else if(e.avail_in===0&&Pr(t)<=Pr(r)&&t!==B)return Nr(e,wr);if(n.status===666&&e.avail_in!==0)return Nr(e,wr);if(n.status===42&&n.wrap===0&&(n.status=113),n.status===42){let t=Mr+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=Dr||n.level<2?0:n.level<6?1:n.level===6?2:3,t|=r<<6,n.strstart!==0&&(t|=32),t+=31-t%31,Ir(n,t),n.strstart!==0&&(Ir(n,e.adler>>>16),Ir(n,e.adler&65535)),e.adler=1,n.status=113,G(e),n.pending!==0)return n.last_flush=-1,V}if(n.status===57){if(e.adler=0,q(n,31),q(n,139),q(n,8),n.gzhead)q(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),q(n,n.gzhead.time&255),q(n,n.gzhead.time>>8&255),q(n,n.gzhead.time>>16&255),q(n,n.gzhead.time>>24&255),q(n,n.level===9?2:n.strategy>=Dr||n.level<2?4:0),q(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(q(n,n.gzhead.extra.length&255),q(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=R(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(q(n,0),q(n,0),q(n,0),q(n,0),q(n,0),q(n,n.level===9?2:n.strategy>=Dr||n.level<2?4:0),q(n,3),n.status=113,G(e),n.pending!==0)return n.last_flush=-1,V}if(n.status===69){if(n.gzhead.extra){let t=n.pending,r=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=R(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,G(e),n.pending!==0)return n.last_flush=-1,V;t=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=R(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=73}if(n.status===73){if(n.gzhead.name){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=R(e.adler,n.pending_buf,n.pending-t,t)),G(e),n.pending!==0)return n.last_flush=-1,V;t=0}r=n.gzindex<n.gzhead.name.length?n.gzhead.name.charCodeAt(n.gzindex++)&255:0,q(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=R(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=91}if(n.status===91){if(n.gzhead.comment){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=R(e.adler,n.pending_buf,n.pending-t,t)),G(e),n.pending!==0)return n.last_flush=-1,V;t=0}r=n.gzindex<n.gzhead.comment.length?n.gzhead.comment.charCodeAt(n.gzindex++)&255:0,q(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=R(e.adler,n.pending_buf,n.pending-t,t))}n.status=103}if(n.status===103){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(G(e),n.pending!==0))return n.last_flush=-1,V;q(n,e.adler&255),q(n,e.adler>>8&255),e.adler=0}if(n.status=113,G(e),n.pending!==0)return n.last_flush=-1,V}if(e.avail_in!==0||n.lookahead!==0||t!==vr&&n.status!==666){let r=n.level===0?Br(n,t):n.strategy===Dr?Wr(n,t):n.strategy===Or?Ur(n,t):Gr[n.level].func(n,t);if((r===3||r===4)&&(n.status=666),r===1||r===3)return e.avail_out===0&&(n.last_flush=-1),V;if(r===2&&(t===yr?_r(n):t!==xr&&(hr(n,0,0,!1),t===br&&(U(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),G(e),e.avail_out===0))return n.last_flush=-1,V}return t===B?n.wrap<=0?Sr:(n.wrap===2?(q(n,e.adler&255),q(n,e.adler>>8&255),q(n,e.adler>>16&255),q(n,e.adler>>24&255),q(n,e.total_in&255),q(n,e.total_in>>8&255),q(n,e.total_in>>16&255),q(n,e.total_in>>24&255)):(Ir(n,e.adler>>>16),Ir(n,e.adler&65535)),G(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending===0?Sr:V):V},deflateEnd:e=>{if(Jr(e))return H;let t=e.state.status;return e.state=null,t===113?Nr(e,Cr):V},deflateSetDictionary:(e,t)=>{let n=t.length;if(Jr(e))return H;let r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==42||r.lookahead)return H;if(i===1&&(e.adler=ur(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(U(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}let a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,zr(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do r.ins_h=W(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++;while(--t);r.strstart=e,r.lookahead=2,zr(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,r.wrap=i,V},deflateInfo:`pako deflate (from Nodeca project)`};let ei=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var ti={assign:function(e){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let n=t.shift();if(n){if(typeof n!=`object`)throw TypeError(n+`must be non-object`);for(let t in n)ei(n,t)&&(e[t]=n[t])}}return e},flattenChunks:e=>{let t=0;for(let n=0,r=e.length;n<r;n++)t+=e[n].length;let n=new Uint8Array(t);for(let t=0,r=0,i=e.length;t<i;t++){let i=e[t];n.set(i,r),r+=i.length}return n}};let ni=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{ni=!1}let ri=new Uint8Array(256);for(let e=0;e<256;e++)ri[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;ri[254]=ri[254]=1;var ii=e=>{if(typeof TextEncoder==`function`&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,i,a,o=e.length,s=0;for(i=0;i<o;i++)n=e.charCodeAt(i),(n&64512)==55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)==56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),a=0,i=0;a<s;i++)n=e.charCodeAt(i),(n&64512)==55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)==56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|n&63):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|n&63):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|n&63);return t};let ai=(e,t)=>{if(t<65534&&e.subarray&&ni)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n=``;for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};var oi={string2buf:ii,buf2string:(e,t)=>{let n=t||e.length;if(typeof TextDecoder==`function`&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,i,a=Array(n*2);for(i=0,r=0;r<n;){let t=e[r++];if(t<128){a[i++]=t;continue}let o=ri[t];if(o>4){a[i++]=65533,r+=o-1;continue}for(t&=o===2?31:o===3?15:7;o>1&&r<n;)t=t<<6|e[r++]&63,o--;if(o>1){a[i++]=65533;continue}t<65536?a[i++]=t:(t-=65536,a[i++]=55296|t>>10&1023,a[i++]=56320|t&1023)}return ai(a,i)},utf8border:(e,t)=>{t||=e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)==128;)n--;return n<0||n===0?t:n+ri[e[n]]>t?n:t}};function si(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}var ci=si;let li=Object.prototype.toString,{Z_NO_FLUSH:ui,Z_SYNC_FLUSH:di,Z_FULL_FLUSH:fi,Z_FINISH:pi,Z_OK:mi,Z_STREAM_END:hi,Z_DEFAULT_COMPRESSION:gi,Z_DEFAULT_STRATEGY:_i,Z_DEFLATED:vi}=pr;function yi(e){this.options=ti.assign({level:gi,method:vi,chunkSize:16384,windowBits:15,memLevel:8,strategy:_i},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new ci,this.strm.avail_out=0;let n=$r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==mi)throw Error(fr[n]);if(t.header&&$r.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e=typeof t.dictionary==`string`?oi.string2buf(t.dictionary):li.call(t.dictionary)===`[object ArrayBuffer]`?new Uint8Array(t.dictionary):t.dictionary,n=$r.deflateSetDictionary(this.strm,e),n!==mi)throw Error(fr[n]);this._dict_set=!0}}yi.prototype.push=function(e,t){let n=this.strm,r=this.options.chunkSize,i,a;if(this.ended)return!1;for(a=t===~~t?t:t===!0?pi:ui,typeof e==`string`?n.input=oi.string2buf(e):li.call(e)===`[object ArrayBuffer]`?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(a===di||a===fi)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=$r.deflate(n,a),i===hi)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=$r.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===mi;if(n.avail_out===0){this.onData(n.output);continue}if(a>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0},yi.prototype.onData=function(e){this.chunks.push(e)},yi.prototype.onEnd=function(e){e===mi&&(this.result=ti.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function bi(e,t){let n=new yi(t);if(n.push(e,!0),n.err)throw n.msg||fr[n.err];return n.result}function xi(e,t){return t||={},t.raw=!0,bi(e,t)}function Si(e,t){return t||={},t.gzip=!0,bi(e,t)}var Ci={Deflate:yi,deflate:bi,deflateRaw:xi,gzip:Si,constants:pr};let wi=16209;var Ti=function(e,t){let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E=e.state;n=e.next_in,w=e.input,r=n+(e.avail_in-5),i=e.next_out,T=e.output,a=i-(t-e.avail_out),o=i+(e.avail_out-257),s=E.dmax,c=E.wsize,l=E.whave,u=E.wnext,d=E.window,f=E.hold,p=E.bits,m=E.lencode,h=E.distcode,g=(1<<E.lenbits)-1,_=(1<<E.distbits)-1;top:do{p<15&&(f+=w[n++]<<p,p+=8,f+=w[n++]<<p,p+=8),v=m[f&g];dolen:for(;;){if(y=v>>>24,f>>>=y,p-=y,y=v>>>16&255,y===0)T[i++]=v&65535;else if(y&16){b=v&65535,y&=15,y&&(p<y&&(f+=w[n++]<<p,p+=8),b+=f&(1<<y)-1,f>>>=y,p-=y),p<15&&(f+=w[n++]<<p,p+=8,f+=w[n++]<<p,p+=8),v=h[f&_];dodist:for(;;){if(y=v>>>24,f>>>=y,p-=y,y=v>>>16&255,y&16){if(x=v&65535,y&=15,p<y&&(f+=w[n++]<<p,p+=8,p<y&&(f+=w[n++]<<p,p+=8)),x+=f&(1<<y)-1,x>s){e.msg=`invalid distance too far back`,E.mode=wi;break top}if(f>>>=y,p-=y,y=i-a,x>y){if(y=x-y,y>l&&E.sane){e.msg=`invalid distance too far back`,E.mode=wi;break top}if(S=0,C=d,u===0){if(S+=c-y,y<b){b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}}else if(u<y){if(S+=c+u-y,y-=u,y<b){b-=y;do T[i++]=d[S++];while(--y);if(S=0,u<b){y=u,b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}}}else if(S+=u-y,y<b){b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}for(;b>2;)T[i++]=C[S++],T[i++]=C[S++],T[i++]=C[S++],b-=3;b&&(T[i++]=C[S++],b>1&&(T[i++]=C[S++]))}else{S=i-x;do T[i++]=T[S++],T[i++]=T[S++],T[i++]=T[S++],b-=3;while(b>2);b&&(T[i++]=T[S++],b>1&&(T[i++]=T[S++]))}}else if(y&64){e.msg=`invalid distance code`,E.mode=wi;break top}else{v=h[(v&65535)+(f&(1<<y)-1)];continue dodist}break}}else if(!(y&64)){v=m[(v&65535)+(f&(1<<y)-1)];continue dolen}else if(y&32){E.mode=16191;break top}else{e.msg=`invalid literal/length code`,E.mode=wi;break top}break}}while(n<r&&i<o);b=p>>3,n-=b,p-=b<<3,f&=(1<<p)-1,e.next_in=n,e.next_out=i,e.avail_in=n<r?5+(r-n):5-(n-r),e.avail_out=i<o?257+(o-i):257-(i-o),E.hold=f,E.bits=p};let Ei=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Di=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Oi=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ki=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Ai=(e,t,n,r,i,a,o,s)=>{let c=s.bits,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y,b,x,S,C,w=null,T,E=new Uint16Array(16),D=new Uint16Array(16),O=null,ee,te,ne;for(l=0;l<=15;l++)E[l]=0;for(u=0;u<r;u++)E[t[n+u]]++;for(p=c,f=15;f>=1&&E[f]===0;f--);if(p>f&&(p=f),f===0)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(d=1;d<f&&E[d]===0;d++);for(p<d&&(p=d),g=1,l=1;l<=15;l++)if(g<<=1,g-=E[l],g<0)return-1;if(g>0&&(e===0||f!==1))return-1;for(D[1]=0,l=1;l<15;l++)D[l+1]=D[l]+E[l];for(u=0;u<r;u++)t[n+u]!==0&&(o[D[t[n+u]]++]=u);if(e===0?(w=O=o,T=20):e===1?(w=Ei,O=Di,T=257):(w=Oi,O=ki,T=0),v=0,u=0,l=d,C=a,m=p,h=0,x=-1,_=1<<p,S=_-1,e===1&&_>852||e===2&&_>592)return 1;for(;;){ee=l-h,o[u]+1<T?(te=0,ne=o[u]):o[u]>=T?(te=O[o[u]-T],ne=w[o[u]-T]):(te=96,ne=0),y=1<<l-h,b=1<<m,d=b;do b-=y,i[C+(v>>h)+b]=ee<<24|te<<16|ne|0;while(b!==0);for(y=1<<l-1;v&y;)y>>=1;if(y===0?v=0:(v&=y-1,v+=y),u++,--E[l]===0){if(l===f)break;l=t[n+o[u]]}if(l>p&&(v&S)!==x){for(h===0&&(h=p),C+=d,m=l-h,g=1<<m;m+h<f&&(g-=E[m+h],!(g<=0));)m++,g<<=1;if(_+=1<<m,e===1&&_>852||e===2&&_>592)return 1;x=v&S,i[x]=p<<24|m<<16|C-a|0}}return v!==0&&(i[C+v]=l-h<<24|4194304),s.bits=p,0};let{Z_FINISH:ji,Z_BLOCK:Mi,Z_TREES:Ni,Z_OK:Pi,Z_STREAM_END:Fi,Z_NEED_DICT:Ii,Z_STREAM_ERROR:Y,Z_DATA_ERROR:Li,Z_MEM_ERROR:Ri,Z_BUF_ERROR:zi,Z_DEFLATED:Bi}=pr,Vi=16180,Hi=16181,Ui=16182,Wi=16183,Gi=16184,Ki=16185,qi=16186,Ji=16187,Yi=16188,Xi=16189,Zi=16190,X=16191,Qi=16192,$i=16193,ea=16194,ta=16195,na=16196,ra=16197,ia=16198,aa=16199,oa=16200,sa=16201,ca=16202,la=16203,ua=16204,da=16205,fa=16206,pa=16207,ma=16208,Z=16209,ha=16210,ga=16211,_a=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function va(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}let ya=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.mode<Vi||t.mode>ga?1:0},ba=e=>{if(ya(e))return Y;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=t.wrap&1),t.mode=Vi,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Pi},xa=e=>{if(ya(e))return Y;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,ba(e)},Sa=(e,t)=>{let n;if(ya(e))return Y;let r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Y:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,xa(e))},Ca=(e,t)=>{if(!e)return Y;let n=new va;e.state=n,n.strm=e,n.window=null,n.mode=Vi;let r=Sa(e,t);return r!==Pi&&(e.state=null),r},wa=e=>Ca(e,15),Ta=!0,Ea,Da,Oa=e=>{if(Ta){Ea=new Int32Array(512),Da=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Ai(1,e.lens,0,288,Ea,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Ai(2,e.lens,0,32,Da,0,e.work,{bits:5}),Ta=!1}e.lencode=Ea,e.lenbits=9,e.distcode=Da,e.distbits=5},ka=(e,t,n,r)=>{let i,a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),r>=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(t.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(t.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0};var Q={inflateReset:xa,inflateReset2:Sa,inflateResetKeep:ba,inflateInit:wa,inflateInit2:Ca,inflate:(e,t)=>{let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g=0,_,v,y,b,x,S,C,w,T=new Uint8Array(4),E,D,O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ya(e)||!e.output||!e.input&&e.avail_in!==0)return Y;n=e.state,n.mode===X&&(n.mode=Qi),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,d=s,f=c,w=Pi;inf_leave:for(;;)switch(n.mode){case Vi:if(n.wrap===0){n.mode=Qi;break}for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&2&&l===35615){n.wbits===0&&(n.wbits=15),n.check=0,T[0]=l&255,T[1]=l>>>8&255,n.check=R(n.check,T,2,0),l=0,u=0,n.mode=Hi;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg=`incorrect header check`,n.mode=Z;break}if((l&15)!==Bi){e.msg=`unknown compression method`,n.mode=Z;break}if(l>>>=4,u-=4,C=(l&15)+8,n.wbits===0&&(n.wbits=C),C>15||C>n.wbits){e.msg=`invalid window size`,n.mode=Z;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=l&512?Xi:X,l=0,u=0;break;case Hi:for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.flags=l,(n.flags&255)!==Bi){e.msg=`unknown compression method`,n.mode=Z;break}if(n.flags&57344){e.msg=`unknown header flags set`,n.mode=Z;break}n.head&&(n.head.text=l>>8&1),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=R(n.check,T,2,0)),l=0,u=0,n.mode=Ui;case Ui:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.time=l),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,T[2]=l>>>16&255,T[3]=l>>>24&255,n.check=R(n.check,T,4,0)),l=0,u=0,n.mode=Wi;case Wi:for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.xflags=l&255,n.head.os=l>>8),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=R(n.check,T,2,0)),l=0,u=0,n.mode=Gi;case Gi:if(n.flags&1024){for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.length=l,n.head&&(n.head.extra_len=l),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=R(n.check,T,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=Ki;case Ki:if(n.flags&1024&&(p=n.length,p>s&&(p=s),p&&(n.head&&(C=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+p),C)),n.flags&512&&n.wrap&4&&(n.check=R(n.check,r,p,a)),s-=p,a+=p,n.length-=p),n.length))break inf_leave;n.length=0,n.mode=qi;case qi:if(n.flags&2048){if(s===0)break inf_leave;p=0;do C=r[a+ p++],n.head&&C&&n.length<65536&&(n.head.name+=String.fromCharCode(C));while(C&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=R(n.check,r,p,a)),s-=p,a+=p,C)break inf_leave}else n.head&&(n.head.name=null);n.length=0,n.mode=Ji;case Ji:if(n.flags&4096){if(s===0)break inf_leave;p=0;do C=r[a+ p++],n.head&&C&&n.length<65536&&(n.head.comment+=String.fromCharCode(C));while(C&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=R(n.check,r,p,a)),s-=p,a+=p,C)break inf_leave}else n.head&&(n.head.comment=null);n.mode=Yi;case Yi:if(n.flags&512){for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&4&&l!==(n.check&65535)){e.msg=`header crc mismatch`,n.mode=Z;break}l=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=X;break;case Xi:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}e.adler=n.check=_a(l),l=0,u=0,n.mode=Zi;case Zi:if(n.havedict===0)return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,Ii;e.adler=n.check=1,n.mode=X;case X:if(t===Mi||t===Ni)break inf_leave;case Qi:if(n.last){l>>>=u&7,u-=u&7,n.mode=fa;break}for(;u<3;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}switch(n.last=l&1,l>>>=1,--u,l&3){case 0:n.mode=$i;break;case 1:if(Oa(n),n.mode=aa,t===Ni){l>>>=2,u-=2;break inf_leave}break;case 2:n.mode=na;break;case 3:e.msg=`invalid block type`,n.mode=Z}l>>>=2,u-=2;break;case $i:for(l>>>=u&7,u-=u&7;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if((l&65535)!=(l>>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=Z;break}if(n.length=l&65535,l=0,u=0,n.mode=ea,t===Ni)break inf_leave;case ea:n.mode=ta;case ta:if(p=n.length,p){if(p>s&&(p=s),p>c&&(p=c),p===0)break inf_leave;i.set(r.subarray(a,a+p),o),s-=p,a+=p,c-=p,o+=p,n.length-=p;break}n.mode=X;break;case na:for(;u<14;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.nlen=(l&31)+257,l>>>=5,u-=5,n.ndist=(l&31)+1,l>>>=5,u-=5,n.ncode=(l&15)+4,l>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg=`too many length or distance symbols`,n.mode=Z;break}n.have=0,n.mode=ra;case ra:for(;n.have<n.ncode;){for(;u<3;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.lens[O[n.have++]]=l&7,l>>>=3,u-=3}for(;n.have<19;)n.lens[O[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,E={bits:n.lenbits},w=Ai(0,n.lens,0,19,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid code lengths set`,n.mode=Z;break}n.have=0,n.mode=ia;case ia:for(;n.have<n.nlen+n.ndist;){for(;g=n.lencode[l&(1<<n.lenbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(y<16)l>>>=_,u-=_,n.lens[n.have++]=y;else{if(y===16){for(D=_+2;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(l>>>=_,u-=_,n.have===0){e.msg=`invalid bit length repeat`,n.mode=Z;break}C=n.lens[n.have-1],p=3+(l&3),l>>>=2,u-=2}else if(y===17){for(D=_+3;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=_,u-=_,C=0,p=3+(l&7),l>>>=3,u-=3}else{for(D=_+7;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=_,u-=_,C=0,p=11+(l&127),l>>>=7,u-=7}if(n.have+p>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=Z;break}for(;p--;)n.lens[n.have++]=C}}if(n.mode===Z)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=Z;break}if(n.lenbits=9,E={bits:n.lenbits},w=Ai(1,n.lens,0,n.nlen,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid literal/lengths set`,n.mode=Z;break}if(n.distbits=6,n.distcode=n.distdyn,E={bits:n.distbits},w=Ai(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,E),n.distbits=E.bits,w){e.msg=`invalid distances set`,n.mode=Z;break}if(n.mode=aa,t===Ni)break inf_leave;case aa:n.mode=oa;case oa:if(s>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,Ti(e,f),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,n.mode===X&&(n.back=-1);break}for(n.back=0;g=n.lencode[l&(1<<n.lenbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(v&&!(v&240)){for(b=_,x=v,S=y;g=n.lencode[S+((l&(1<<b+x)-1)>>b)],_=g>>>24,v=g>>>16&255,y=g&65535,!(b+_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=b,u-=b,n.back+=b}if(l>>>=_,u-=_,n.back+=_,n.length=y,v===0){n.mode=da;break}if(v&32){n.back=-1,n.mode=X;break}if(v&64){e.msg=`invalid literal/length code`,n.mode=Z;break}n.extra=v&15,n.mode=sa;case sa:if(n.extra){for(D=n.extra;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=ca;case ca:for(;g=n.distcode[l&(1<<n.distbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(!(v&240)){for(b=_,x=v,S=y;g=n.distcode[S+((l&(1<<b+x)-1)>>b)],_=g>>>24,v=g>>>16&255,y=g&65535,!(b+_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=b,u-=b,n.back+=b}if(l>>>=_,u-=_,n.back+=_,v&64){e.msg=`invalid distance code`,n.mode=Z;break}n.offset=y,n.extra=v&15,n.mode=la;case la:if(n.extra){for(D=n.extra;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=Z;break}n.mode=ua;case ua:if(c===0)break inf_leave;if(p=f-c,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=Z;break}p>n.wnext?(p-=n.wnext,m=n.wsize-p):m=n.wnext-p,p>n.length&&(p=n.length),h=n.window}else h=i,m=o-n.offset,p=n.length;p>c&&(p=c),c-=p,n.length-=p;do i[o++]=h[m++];while(--p);n.length===0&&(n.mode=oa);break;case da:if(c===0)break inf_leave;i[o++]=n.length,c--,n.mode=oa;break;case fa:if(n.wrap){for(;u<32;){if(s===0)break inf_leave;s--,l|=r[a++]<<u,u+=8}if(f-=c,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?R(n.check,i,f,o-f):ur(n.check,i,f,o-f)),f=c,n.wrap&4&&(n.flags?l:_a(l))!==n.check){e.msg=`incorrect data check`,n.mode=Z;break}l=0,u=0}n.mode=pa;case pa:if(n.wrap&&n.flags){for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&4&&l!==(n.total&4294967295)){e.msg=`incorrect length check`,n.mode=Z;break}l=0,u=0}n.mode=ma;case ma:w=Fi;break inf_leave;case Z:w=Li;break inf_leave;case ha:return Ri;case ga:default:return Y}return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,(n.wsize||f!==e.avail_out&&n.mode<Z&&(n.mode<fa||t!==ji))&&ka(e,e.output,e.next_out,f-e.avail_out),d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?R(n.check,i,f,e.next_out-f):ur(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===X?128:0)+(n.mode===aa||n.mode===ea?256:0),(d===0&&f===0||t===ji)&&w===Pi&&(w=zi),w},inflateEnd:e=>{if(ya(e))return Y;let t=e.state;return t.window&&=null,e.state=null,Pi},inflateGetHeader:(e,t)=>{if(ya(e))return Y;let n=e.state;return n.wrap&2?(n.head=t,t.done=!1,Pi):Y},inflateSetDictionary:(e,t)=>{let n=t.length,r,i,a;return ya(e)||(r=e.state,r.wrap!==0&&r.mode!==Zi)?Y:r.mode===Zi&&(i=1,i=ur(i,t,n,0),i!==r.check)?Li:(a=ka(e,t,n,n),a?(r.mode=ha,Ri):(r.havedict=1,Pi))},inflateInfo:`pako inflate (from Nodeca project)`};function Aa(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=``,this.comment=``,this.hcrc=0,this.done=!1}var ja=Aa;let Ma=Object.prototype.toString,{Z_NO_FLUSH:Na,Z_FINISH:Pa,Z_OK:Fa,Z_STREAM_END:Ia,Z_NEED_DICT:La,Z_STREAM_ERROR:Ra,Z_DATA_ERROR:za,Z_MEM_ERROR:Ba}=pr;function Va(e){this.options=ti.assign({chunkSize:1024*64,windowBits:15,to:``},e||{});let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new ci,this.strm.avail_out=0;let n=Q.inflateInit2(this.strm,t.windowBits);if(n!==Fa||(this.header=new ja,Q.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary==`string`?t.dictionary=oi.string2buf(t.dictionary):Ma.call(t.dictionary)===`[object ArrayBuffer]`&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Q.inflateSetDictionary(this.strm,t.dictionary),n!==Fa))))throw Error(fr[n])}Va.prototype.push=function(e,t){let n=this.strm,r=this.options.chunkSize,i=this.options.dictionary,a,o,s;if(this.ended)return!1;for(o=t===~~t?t:t===!0?Pa:Na,Ma.call(e)===`[object ArrayBuffer]`?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),a=Q.inflate(n,o),a===La&&i&&(a=Q.inflateSetDictionary(n,i),a===Fa?a=Q.inflate(n,o):a===za&&(a=La));n.avail_in>0&&a===Ia&&n.state.wrap>0&&e[n.next_in]!==0;)Q.inflateReset(n),a=Q.inflate(n,o);switch(a){case Ra:case za:case La:case Ba:return this.onEnd(a),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||a===Ia))if(this.options.to===`string`){let e=oi.utf8border(n.output,n.next_out),t=n.next_out-e,i=oi.buf2string(n.output,e);n.next_out=t,n.avail_out=r-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(i)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(a===Fa&&s===0)){if(a===Ia)return a=Q.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(n.avail_in===0)break}}return!0},Va.prototype.onData=function(e){this.chunks.push(e)},Va.prototype.onEnd=function(e){e===Fa&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=ti.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ha(e,t){let n=new Va(t);if(n.push(e),n.err)throw n.msg||fr[n.err];return n.result}function Ua(e,t){return t||={},t.raw=!0,Ha(e,t)}var Wa={Inflate:Va,inflate:Ha,inflateRaw:Ua,ungzip:Ha,constants:pr};let{Deflate:Ga,deflate:Ka,deflateRaw:qa,gzip:Ja}=Ci,{Inflate:Ya,inflate:Xa,inflateRaw:Za,ungzip:Qa}=Wa;var $a={Deflate:Ga,deflate:Ka,deflateRaw:qa,gzip:Ja,Inflate:Ya,inflate:Xa,inflateRaw:Za,ungzip:Qa,constants:pr};function eo(e){let t=$a.deflate(e,{gzip:!0});return new Uint8Array(t)}function to(e){let t=$a.inflate(e,{gzip:!0});return new Uint8Array(t)}let $=_n(`ChJtb2R1bGVzL1Jvb20ucHJvdG8SFWNvbS5xdWljay52b2ljZS5wcm90byKDAwoEVXNlchIKCgJpZBgBIAEoCRIXCgpjYWxsQWN0aW9uGAIgASgFSACIAQESFgoJY2FsbFN0YXRlGAMgASgFSAGIAQESFQoIam9pblRpbWUYBCABKANIAogBARIsCgZ0cmFja3MYBSADKAsyHC5jb20ucXVpY2sudm9pY2UucHJvdG8uVHJhY2sSGAoLcGVybWlzc2lvbnMYBiABKAVIA4gBARIYCgtpc1B1Ymxpc2hlZBgHIAEoCEgEiAEBEhUKCGJlaGF2aW9yGAggASgFSAWIAQESRgoMY2hhbm5lbENhY2hlGAkgASgLMisuY29tLnF1aWNrLnZvaWNlLnByb3RvLkRhdGFDaGFubmVsQ2FjaGVJbmZvSAaIAQFCDQoLX2NhbGxBY3Rpb25CDAoKX2NhbGxTdGF0ZUILCglfam9pblRpbWVCDgoMX3Blcm1pc3Npb25zQg4KDF9pc1B1Ymxpc2hlZEILCglfYmVoYXZpb3JCDwoNX2NoYW5uZWxDYWNoZSJMChREYXRhQ2hhbm5lbENhY2hlSW5mbxI0CghjaGFubmVscxgBIAMoCzIiLmNvbS5xdWljay52b2ljZS5wcm90by5EYXRhQ2hhbm5lbCI+CgtEYXRhQ2hhbm5lbBIXCg9kYXRhQ2hhbm5lbE5hbWUYASABKAkSDwoCaWQYAiABKAVIAIgBAUIFCgNfaWQiOAoFTG9naW4SDQoFYXBwaWQYASABKAkSDgoGdXNlcklkGAIgASgJEhAKCHNka1Rva2VuGAMgASgJIuICCgVUcmFjaxILCgNtaWQYASABKAkSFgoJdHJhY2tOYW1lGAIgASgJSACIAQESFQoIbG9jYXRpb24YAyABKAlIAYgBARITCgZ1c2VySWQYBCABKAlIAogBARIRCgRjb2RlGAUgASgFSAOIAQESEQoEZGVzYxgGIAEoCUgEiAEBEjMKBHR5cGUYByABKA4yIC5jb20ucXVpY2sudm9pY2UucHJvdG8uVHJhY2tUeXBlSAWIAQESFAoHaXNWYWxpZBgIIAEoCEgGiAEBEhYKCXNpbXVsY2FzdBgJIAEoCUgHiAEBEhYKCWxhc3RSZXRyeRgKIAEoCEgIiAEBQgwKCl90cmFja05hbWVCCwoJX2xvY2F0aW9uQgkKB191c2VySWRCBwoFX2NvZGVCBwoFX2Rlc2NCBwoFX3R5cGVCCgoIX2lzVmFsaWRCDAoKX3NpbXVsY2FzdEIMCgpfbGFzdFJldHJ5IqkCCgdKb2luUmVxEg4KBnJvb21JZBgBIAEoCRIpCgR1c2VyGAIgASgLMhsuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXISMQoIY2FsbFR5cGUYAyABKA4yHy5jb20ucXVpY2sudm9pY2UucHJvdG8uQ2FsbFR5cGUSEgoFdG9rZW4YBCABKAlIAIgBARI3CgRsYW5nGAUgASgLMiQuY29tLnF1aWNrLnZvaWNlLnByb3RvLkFpTGFuZ1NldHRpbmdIAYgBARIQCgNzdHQYBiABKAhIAogBARISCgVtc2dJZBgHIAEoCUgDiAEBEhAKA21zZxgIIAEoCUgEiAEBQggKBl90b2tlbkIHCgVfbGFuZ0IGCgRfc3R0QggKBl9tc2dJZEIGCgRfbXNnIrkCCgdKb2luUnNwEg4KBnJvb21JZBgBIAEoCRIuCglyb29tVXNlcnMYAiADKAsyGy5jb20ucXVpY2sudm9pY2UucHJvdG8uVXNlchIxCghjYWxsVHlwZRgDIAEoDjIfLmNvbS5xdWljay52b2ljZS5wcm90by5DYWxsVHlwZRIQCgh3aWZpT25seRgEIAEoCBIXCgpyb29tQWN0aW9uGAUgASgFSACIAQESFgoJdG90YWxTaXplGAYgASgFSAGIAQESRgoQbWVldFNwZWNpYWxSb2xlcxgHIAEoCzInLmNvbS5xdWljay52b2ljZS5wcm90by5NZWV0Um9sZXNMaXN0UnNwSAKIAQFCDQoLX3Jvb21BY3Rpb25CDAoKX3RvdGFsU2l6ZUITChFfbWVldFNwZWNpYWxSb2xlcyJHCgpKb2luTm90aWZ5Eg4KBnJvb21JZBgBIAEoCRIpCgR1c2VyGAIgASgLMhsuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXIiGwoMQ29ubmVjdENGUmVxEgsKA3NkcBgBIAEoCSJ4CgxDb25uZWN0Q0ZSc3ASEQoJcmVtb3RlU2RwGAEgASgJEjMKDnN1YnNjcmliZVVzZXJzGAIgAygLMhsuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXISFAoHc2Vzc2lvbhgDIAEoCUgAiAEBQgoKCF9zZXNzaW9uIqEBCgpQdWJsaXNoUmVxEgsKA3NkcBgBIAEoCRIsCgZ0cmFja3MYAiADKAsyHC5jb20ucXVpY2sudm9pY2UucHJvdG8uVHJhY2sSEgoKY2FsbEFjdGlvbhgDIAEoBRIVCghyZWNyZWF0ZRgEIAEoCEgAiAEBEhQKB3Nlc3Npb24YBSABKAlIAYgBAUILCglfcmVjcmVhdGVCCgoIX3Nlc3Npb24iQQoKUHVibGlzaFJzcBIRCglyZW1vdGVTZHAYASABKAkSFAoHc2Vzc2lvbhgCIAEoCUgAiAEBQgoKCF9zZXNzaW9uImwKDVB1Ymxpc2hOb3RpZnkSDgoGcm9vbUlkGAEgASgJEikKBHVzZXIYAiABKAsyGy5jb20ucXVpY2sudm9pY2UucHJvdG8uVXNlchIUCgdzZXNzaW9uGAMgASgJSACIAQFCCgoIX3Nlc3Npb24iXAoMU3Vic2NyaWJlUmVxEioKBXVzZXJzGAEgAygLMhsuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXISFAoHc2Vzc2lvbhgCIAEoCUgAiAEBQgoKCF9zZXNzaW9uIm8KDFN1YnNjcmliZVJzcBIRCglyZW1vdGVTZHAYASABKAkSKgoFdXNlcnMYAiADKAsyGy5jb20ucXVpY2sudm9pY2UucHJvdG8uVXNlchIUCgdzZXNzaW9uGAMgASgJSACIAQFCCgoIX3Nlc3Npb24iLQoOUmVuZWdvdGlhdGVSZXESDgoGdXNlcklkGAEgASgJEgsKA3NkcBgCIAEoCSJhCgdRdWl0UmVxEg4KBnVzZXJJZBgBIAEoCRIOCgZyb29tSWQYAiABKAkSEgoFbXNnSWQYAyABKAlIAIgBARIQCgNtc2cYBCABKAlIAYgBAUIICgZfbXNnSWRCBgoEX21zZyJ/CgpRdWl0Tm90aWZ5Eg4KBnJvb21JZBgBIAEoCRIpCgR1c2VyGAIgASgLMhsuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXISEQoEY29kZRgDIAEoBUgAiAEBEhEKBGRlc2MYBCABKAlIAYgBAUIHCgVfY29kZUIHCgVfZGVzYyIjChFUb2tlbkV4cGlyZU5vdGlmeRIOCgZyb29tSWQYASABKAkiMgoOVXBkYXRlVG9rZW5SZXESDgoGcm9vbUlkGAEgASgJEhAKCHNka1Rva2VuGAIgASgJIlMKEE5ldFF1YWxpdHlDaGFuZ2USDgoGdXNlcklkGAEgASgJEg4KBnJvb21JZBgCIAEoCRIOCgZlZ3Jlc3MYAyABKAUSDwoHaW5ncmVzcxgEIAEoBSJOChBOZXRRdWFsaXR5Tm90aWZ5EjoKCXF1YWxpdGllcxgBIAMoCzInLmNvbS5xdWljay52b2ljZS5wcm90by5OZXRRdWFsaXR5Q2hhbmdlIkcKClVwZGF0ZUNhbGwSDgoGcm9vbUlkGAEgASgJEikKBHVzZXIYAiABKAsyGy5jb20ucXVpY2sudm9pY2UucHJvdG8uVXNlciJSCg9QMlBVc2VyU3luY0l0ZW0SDgoGdXNlcklkGAEgASgJEi8KBXR5cGVzGAIgAygOMiAuY29tLnF1aWNrLnZvaWNlLnByb3RvLlRyYWNrVHlwZSJ9Cg9QMlBVc2VyU3luY0xpc3QSNAoEcHVzaBgBIAMoCzImLmNvbS5xdWljay52b2ljZS5wcm90by5QMlBVc2VyU3luY0l0ZW0SNAoEcHVsbBgCIAMoCzImLmNvbS5xdWljay52b2ljZS5wcm90by5QMlBVc2VyU3luY0l0ZW0imAEKD1N5bmNSb29tSW5mb1JlcRIOCgZyb29tSWQYASABKAkSKQoEdXNlchgCIAEoCzIbLmNvbS5xdWljay52b2ljZS5wcm90by5Vc2VyEj0KCHAycFN0YXRlGAMgASgLMiYuY29tLnF1aWNrLnZvaWNlLnByb3RvLlAyUFVzZXJTeW5jTGlzdEgAiAEBQgsKCV9wMnBTdGF0ZSKbAgoPU3luY1Jvb21JbmZvUnNwEg4KBnJvb21JZBgBIAEoCRIPCgdpc1ZhbGlkGAIgASgIEioKBXVzZXJzGAMgAygLMhsuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXISEAoIaXNBY3RpdmUYBCABKAgSFwoKcm9vbUFjdGlvbhgFIAEoBUgAiAEBEhYKCXRvdGFsU2l6ZRgGIAEoBUgBiAEBEkYKEG1lZXRTcGVjaWFsUm9sZXMYByABKAsyJy5jb20ucXVpY2sudm9pY2UucHJvdG8uTWVldFJvbGVzTGlzdFJzcEgCiAEBQg0KC19yb29tQWN0aW9uQgwKCl90b3RhbFNpemVCEwoRX21lZXRTcGVjaWFsUm9sZXMiGgoKVXBkYXRlVGltZRIMCgR0aW1lGAEgASgDIloKDUNsb3NlVHJhY2tSZXESCwoDc2RwGAEgASgJEiwKBnRyYWNrcxgCIAMoCzIcLmNvbS5xdWljay52b2ljZS5wcm90by5UcmFjaxIOCgZyb29tSWQYAyABKAkiUAoNQ2xvc2VUcmFja1JzcBIRCglyZW1vdGVTZHAYASABKAkSLAoGdHJhY2tzGAIgAygLMhwuY29tLnF1aWNrLnZvaWNlLnByb3RvLlRyYWNrIj0KEENsb3NlVHJhY2tOb3RpZnkSKQoEdXNlchgBIAEoCzIbLmNvbS5xdWljay52b2ljZS5wcm90by5Vc2VyIk4KEVVwZGF0ZVBlcm1pc3Npb25zEg4KBnJvb21JZBgBIAEoCRIpCgR1c2VyGAIgASgLMhsuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXIiUAoMVXNlckJlaGF2aW9yEi4KBHR5cGUYASABKA4yIC5jb20ucXVpY2sudm9pY2UucHJvdG8uVHJhY2tUeXBlEhAKCGJlaGF2aW9yGAIgASgIIlEKC1ByZXZlbnRVc2VyEgoKAmlkGAEgASgJEjYKCWJlaGF2aW9ycxgCIAMoCzIjLmNvbS5xdWljay52b2ljZS5wcm90by5Vc2VyQmVoYXZpb3IiXAoXUHJldmVudFVzZXJzQmVoYXZpb3JSZXESDgoGcm9vbUlkGAEgASgJEjEKBXVzZXJzGAIgAygLMiIuY29tLnF1aWNrLnZvaWNlLnByb3RvLlByZXZlbnRVc2VyIlgKGlByZXZlbnRVc2Vyc0JlaGF2aW9yTm90aWZ5Eg4KBnJvb21JZBgBIAEoCRIqCgV1c2VycxgCIAMoCzIbLmNvbS5xdWljay52b2ljZS5wcm90by5Vc2VyIvIBCg5CYXNlQ0ROQWRkcmVzcxI2CgRhcmVhGAEgASgOMiguY29tLnF1aWNrLnZvaWNlLnByb3RvLkFjY2VsZXJhdGlvbkFyZWFzEjYKCWNvdW50VHlwZRgCIAEoDjIjLmNvbS5xdWljay52b2ljZS5wcm90by5Db3VudE1ldGhvZHMSQQoGdXJsTWFwGAMgAygLMjEuY29tLnF1aWNrLnZvaWNlLnByb3RvLkJhc2VDRE5BZGRyZXNzLlVybE1hcEVudHJ5Gi0KC1VybE1hcEVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEinAIKFENETlBsYXlBZGRyZXNzTm90aWZ5Eg4KBnJvb21JZBgBIAEoCRIRCgRtM3U4GAIgASgJSACIAQESEQoEcnRtcBgDIAEoCUgBiAEBEhAKA2ZsdhgEIAEoCUgCiAEBEhIKBXJ0bXBzGAUgASgJSAOIAQESPAoIbWFpbkxpbmUYBiABKAsyJS5jb20ucXVpY2sudm9pY2UucHJvdG8uQmFzZUNETkFkZHJlc3NIBIgBARI5CgpzdGFuZExpbmVzGAcgAygLMiUuY29tLnF1aWNrLnZvaWNlLnByb3RvLkJhc2VDRE5BZGRyZXNzQgcKBV9tM3U4QgcKBV9ydG1wQgYKBF9mbHZCCAoGX3J0bXBzQgsKCV9tYWluTGluZSJTCgtVc2VyQ2hhbm5lbBIOCgZ1c2VySWQYASABKAkSNAoIY2hhbm5lbHMYAiADKAsyIi5jb20ucXVpY2sudm9pY2UucHJvdG8uRGF0YUNoYW5uZWwiSQoRQ2hhbm5lbFB1Ymxpc2hSZXESNAoIY2hhbm5lbHMYASADKAsyIi5jb20ucXVpY2sudm9pY2UucHJvdG8uRGF0YUNoYW5uZWwiSQoRQ2hhbm5lbFB1Ymxpc2hSc3ESNAoIY2hhbm5lbHMYASADKAsyIi5jb20ucXVpY2sudm9pY2UucHJvdG8uVXNlckNoYW5uZWwiSAoTQ2hhbm5lbFN1YnNjcmliZVJlcRIxCgV1c2VycxgBIAMoCzIiLmNvbS5xdWljay52b2ljZS5wcm90by5Vc2VyQ2hhbm5lbCJLChNDaGFubmVsU3Vic2NyaWJlUnNxEjQKCGNoYW5uZWxzGAEgAygLMiIuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXJDaGFubmVsIqoBCg9EYXRhQ2hhbm5lbERhdGESDgoGdXNlcklkGAEgASgJEjQKBHR5cGUYAiABKA4yJi5jb20ucXVpY2sudm9pY2UucHJvdG8uRGF0YUNoYW5uZWxUeXBlEkMKCWF1ZGlvRGF0YRgDIAEoCzIrLmNvbS5xdWljay52b2ljZS5wcm90by5EYXRhQ2hhbm5lbEF1ZGlvRGF0YUgAiAEBQgwKCl9hdWRpb0RhdGEifwoURGF0YUNoYW5uZWxBdWRpb0RhdGESDAoEZGF0YRgBIAEoDBI9CgZmb3JtYXQYAiABKAsyLS5jb20ucXVpY2sudm9pY2UucHJvdG8uRGF0YUNoYW5uZWxBdWRpb0Zvcm1hdBIRCgR0aW1lGAMgASgDSACIAQFCBwoFX3RpbWUiPgoWRGF0YUNoYW5uZWxBdWRpb0Zvcm1hdBISCgpzYW1wbGVSYXRlGAEgASgBEhAKCGNoYW5uZWxzGAIgASgFIhoKCUFja01zZ1JlcRINCgVtc2dJZBgBIAEoAyKoAQoKU2RwQ29uc3VsdBIOCgZyb29tSWQYASABKAkSMAoGc2VuZGVyGAIgASgLMhsuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXJIAIgBARISCgpyZWNlaXZlcklkGAMgASgJEgsKA3NkcBgEIAEoCRIsCgZ0cmFja3MYBSADKAsyHC5jb20ucXVpY2sudm9pY2UucHJvdG8uVHJhY2tCCQoHX3NlbmRlciI/CglDYW5kaWRhdGUSDgoGc2RwTWlkGAEgASgJEhUKDXNkcE1MaW5lSW5kZXgYAiABKAUSCwoDc2RwGAMgASgJIpUBCgpDYW5kaWRhdGVzEg4KBnJvb21JZBgBIAEoCRIQCghzZW5kZXJJZBgCIAEoCRISCgpyZWNlaXZlcklkGAMgASgJEjQKCmNhbmRpZGF0ZXMYBCADKAsyIC5jb20ucXVpY2sudm9pY2UucHJvdG8uQ2FuZGlkYXRlEhsKE2lzU3Vic2NyaWJlUmVjZWl2ZXIYBSABKAgiegoNUmVwb3J0TmV0SW5mbxIrCgNuYXQYASABKA4yHi5jb20ucXVpY2sudm9pY2UucHJvdG8uTmF0VHlwZRIwCgR0eXBlGAIgASgOMiIuY29tLnF1aWNrLnZvaWNlLnByb3RvLk5ldHdvcmtUeXBlEgoKAmlwGAMgASgJIpwBChJSZXBvcnRUcmFmZmljVXNhZ2USFAoHcDJwUHVzaBgBIAEoA0gAiAEBEhQKB3AycFB1bGwYAiABKANIAYgBARIUCgdzZnVQdXNoGAMgASgDSAKIAQESFAoHc2Z1UHVsbBgEIAEoA0gDiAEBQgoKCF9wMnBQdXNoQgoKCF9wMnBQdWxsQgoKCF9zZnVQdXNoQgoKCF9zZnVQdWxsIlAKD0NoZWNrU2Vzc2lvblJlcRIPCgdzZXNzaW9uGAEgASgJEiwKBnRyYWNrcxgCIAMoCzIcLmNvbS5xdWljay52b2ljZS5wcm90by5UcmFjayJoCg9DaGVja1Nlc3Npb25Sc3ESFgoOc2Vzc2lvbklzVmFsaWQYASABKAgSLAoGdHJhY2tzGAIgAygLMhwuY29tLnF1aWNrLnZvaWNlLnByb3RvLlRyYWNrEg8KB3Nlc3Npb24YAyABKAkiYwoQUm9vbVNwZWVjaE5vdGlmeRIOCgZyb29tSWQYASABKAkSDgoGdXNlcklkGAIgASgJEgwKBHRleHQYAyABKAkSEQoJdGltZXN0YW1wGAQgASgDEg4KBm9yaWdpbhgFIAEoCSLWAQoYTGl2ZVN0cmVhbWVyU3BlZWNoTm90aWZ5Eg4KBnJvb21JZBgBIAEoCRIOCgZ1c2VySWQYAiABKAkSDgoGb3JpZ2luGAMgASgJEkkKBWxhbmdzGAQgAygLMjouY29tLnF1aWNrLnZvaWNlLnByb3RvLkxpdmVTdHJlYW1lclNwZWVjaE5vdGlmeS5MYW5nc0VudHJ5EhEKCXRpbWVzdGFtcBgFIAEoAxosCgpMYW5nc0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEiYAoNQWlMYW5nU2V0dGluZxINCgVpbnB1dBgBIAEoCRIOCgZvdXRwdXQYAiABKAkSHAoPdHJhbnNsYXRlRW5hYmxlGAMgASgISACIAQFCEgoQX3RyYW5zbGF0ZUVuYWJsZSJ/ChZQMlBBdmFpbGFibGVQZWVyTm90aWZ5Eg4KBnJvb21JZBgBIAEoCRIOCgZwdXNoSWQYAiABKAkSLwoFdHlwZXMYAyADKA4yIC5jb20ucXVpY2sudm9pY2UucHJvdG8uVHJhY2tUeXBlEhQKDGlzUmVtb3RlUHVzaBgEIAEoCCKrAgoOUmVwb3J0UDJQRXhSZXESDgoGcm9vbUlkGAEgASgJEg4KBnB1c2hJZBgCIAEoCRIOCgZwdWxsSWQYAyABKAkSLAoEY29kZRgEIAEoDjIeLmNvbS5xdWljay52b2ljZS5wcm90by5QMlBDb2RlEi8KBXR5cGVzGAUgAygOMiAuY29tLnF1aWNrLnZvaWNlLnByb3RvLlRyYWNrVHlwZRIRCgRkZXNjGAYgASgJSACIAQESGgoNY29ubmVjdGVkVGltZRgHIAEoCUgBiAEBEjUKBmFjdGlvbhgIIAEoDjIgLmNvbS5xdWljay52b2ljZS5wcm90by5QMlBBY3Rpb25IAogBAUIHCgVfZGVzY0IQCg5fY29ubmVjdGVkVGltZUIJCgdfYWN0aW9uIm4KFVAyUERpc2Nvbm5lY3RlZE5vdGlmeRIOCgZyb29tSWQYASABKAkSFAoMcmVtb3RlVXNlcklkGAIgASgJEi8KBXR5cGVzGAMgAygOMiAuY29tLnF1aWNrLnZvaWNlLnByb3RvLlRyYWNrVHlwZSJnCh1Sb29tR2xvYmFsQWN0aW9uQ2hhbmdlZE5vdGlmeRIOCgZyb29tSWQYASABKAkSEgoKcm9vbUFjdGlvbhgCIAEoBRIMCgRmcm9tGAMgASgJEhQKDHNlcnZlckFjdGlvbhgEIAEoBSJqChlQdWJOb3RpZnlJbnRlcmNlcHRTeW5jUnNwEg4KBnJvb21JZBgBIAEoCRISCgpyb29tQWN0aW9uGAIgASgFEikKBHVzZXIYAyABKAsyGy5jb20ucXVpY2sudm9pY2UucHJvdG8uVXNlciIyChBNZWV0Um9sZXNMaXN0UnNwEg8KB2NyZWF0b3IYASABKAkSDQoFYWRtaW4YAiADKAkilgEKFU1lZXRSb2xlc0NoYW5nZU5vdGlmeRIOCgZyb29tSWQYASABKAkSQQoQbWVldFNwZWNpYWxSb2xlcxgCIAEoCzInLmNvbS5xdWljay52b2ljZS5wcm90by5NZWV0Um9sZXNMaXN0UnNwEioKBXVzZXJzGAMgAygLMhsuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXIiYAoPSm9pbkJhdGNoTm90aWZ5Eg4KBnJvb21JZBgBIAEoCRIqCgV1c2VycxgCIAMoCzIbLmNvbS5xdWljay52b2ljZS5wcm90by5Vc2VyEhEKCXRvdGFsU2l6ZRgDIAEoBSI6CgxRdWl0VXNlckluZm8SDgoGdXNlcklkGAEgASgJEgwKBGNvZGUYAiABKAUSDAoEZGVzYxgDIAEoCSJoCg9RdWl0QmF0Y2hOb3RpZnkSDgoGcm9vbUlkGAEgASgJEjIKBXVzZXJzGAIgAygLMiMuY29tLnF1aWNrLnZvaWNlLnByb3RvLlF1aXRVc2VySW5mbxIRCgl0b3RhbFNpemUYAyABKAUiTwoRUm9vbUluZm9Db21tb25Sc3ASDgoGcm9vbUlkGAEgASgJEioKBXVzZXJzGAIgAygLMhsuY29tLnF1aWNrLnZvaWNlLnByb3RvLlVzZXIiggEKCUljZVNlcnZlchIMCgR1cmxzGAEgAygJEhAKCHVzZXJuYW1lGAIgASgJEhIKCmNyZWRlbnRpYWwYAyABKAkSQQoPY3JlZGVudGlhbF90eXBlGAQgASgOMiguY29tLnF1aWNrLnZvaWNlLnByb3RvLkljZUNyZWRlbnRpYWxUeXBlIg0KC1R1cm5VcmxzUmVxIqEBChBUdXJuVXJsc1Jlc3BvbnNlEjUKC2ljZV9zZXJ2ZXJzGAEgAygLMiAuY29tLnF1aWNrLnZvaWNlLnByb3RvLkljZVNlcnZlchILCgN0dGwYAiABKAQSEgoKZXhwaXJlc19hdBgDIAEoBBI1CgZwb2xpY3kYBCABKA4yJS5jb20ucXVpY2sudm9pY2UucHJvdG8uSWNlQ29ubmVjdFR5cGUqRAoJVHJhY2tUeXBlEg4KCk1pY3JvcGhvbmUQABIKCgZDYW1lcmEQARIKCgZTY3JlZW4QAhIPCgtTeXN0ZW1Wb2ljZRADKj0KCENhbGxUeXBlEgoKBk5vcm1hbBAAEgsKB01lZXRpbmcQARIICgRMaXZlEAISDgoKQ29uZmVyZW5jZRADKnoKDlF1aXROb3RpZnlDb2RlEg4KCk5vcm1hbFF1aXQQABIMCgdUaW1lb3V0EOUPEhEKDFRva2VuRXhwaXJlZBDbDxIMCgdLaWNrT3V0EOYPEgoKBUVuZFBrEOcPEgwKB0VuZExpdmUQ6A8SDwoKRm9yY2VDbGVhchDpDypAChFBY2NlbGVyYXRpb25BcmVhcxIRCg1jaGluYU1haW5sYW5kEAASCgoGZ2xvYmFsEAESDAoIb3ZlcnNlYXMQAiolCgxDb3VudE1ldGhvZHMSCAoEZmxvdxAAEgsKB21pbnV0ZXMQASogCg9EYXRhQ2hhbm5lbFR5cGUSDQoJYmFja0F1aWRvEAAqQQoHTmF0VHlwZRINCglTeW1tZXRyaWMQABIICgRDb25lEAESCAoEUG9ydBACEgYKAklQEAMSCwoHVW5Lbm93bhAEKi4KC05ldHdvcmtUeXBlEggKBFdpZmkQABIJCgVXaXJlZBABEgoKBk1vYmlsZRACKlAKB1AyUENvZGUSCwoHU3VjY2VzcxAAEgoKBkZhaWxlZBABEgoKBklnbm9yZRACEhAKDERpc2Nvbm5lY3RlZBADEg4KCkxvd1F1YWxpdHkQBCpqCg9QMlBJZ25vcmVSZWFzb24SEQoNQ0hBTk5FTF9MSU1JVBAAEhcKE1NVQlNDUklCRV9OT1RfRVhJU1QQARILCgdCdXN5aW5nEAISEwoPVFJBQ0tfTk9UX0VYSVNUEAMSCQoFT1RIRVIQBCpvCglQMlBBY3Rpb24SDgoKUmV2ZXJzZVRyeRAAEhQKEFJldmVyc2VUcnlGYWlsZWQQARISCg5SZXZlcnNlU3VjY2VzcxACEhIKDkNvbm5lY3RTdWNjZXNzEAMSFAoQUmV2ZXJzZVB1c2hEZWxheRAEKnkKEUljZUNyZWRlbnRpYWxUeXBlEiMKH0lDRV9DUkVERU5USUFMX1RZUEVfVU5TUEVDSUZJRUQQABIgChxJQ0VfQ1JFREVOVElBTF9UWVBFX1BBU1NXT1JEEAESHQoZSUNFX0NSRURFTlRJQUxfVFlQRV9PQVVUSBACKiQKDkljZUNvbm5lY3RUeXBlEgcKA0FsbBAAEgkKBVJlbGF5EAFCRQoVY29tLnF1aWNrLnZvaWNlLnByb3RvQglSb29tUHJvdG9aFWNvbS5xdWljay52b2ljZS5wcm90b7oCCVJvb21Qcm90b2IGcHJvdG8z`),no=N($,6),ro=N($,7),io=N($,9),ao=N($,11),oo=N($,12),so=N($,14),co=N($,17),lo=N($,21),uo=N($,22),fo=N($,26),po=N($,29),mo=N($,30),ho=N($,31),go=N($,35),_o=N($,37),vo=N($,47),yo=N($,49),bo=N($,53),xo=N($,54),So=N($,57),Co=N($,59),wo=N($,60),To=N($,63),Eo=N($,64),Do=N($,66),Oo=N($,67),ko=N($,70),Ao=N(_n(`ChFtb2R1bGVzL1J0Yy5wcm90bxIVY29tLnF1aWNrLnZvaWNlLnByb3RvInwKCFJ0Y1RyYWNrEg4KBnVzZXJJZBgBIAEoCRILCgNtaWQYAiABKAkSEQoJdHJhY2tOYW1lGAMgASgJEi4KBHR5cGUYBCABKA4yIC5jb20ucXVpY2sudm9pY2UucHJvdG8uVHJhY2tUeXBlEhAKCGlzQWN0aXZlGAUgASgIIlMKEFVwZGF0ZVRyYWNrU3RhdGUSDgoGcm9vbUlkGAEgASgJEi8KBnRyYWNrcxgCIAMoCzIfLmNvbS5xdWljay52b2ljZS5wcm90by5SdGNUcmFjayohCghSdGNFdmVudBIVChFVcGRhdGVUcmFja0FjdGl2ZRAAQkMKFWNvbS5xdWljay52b2ljZS5wcm90b0IIUnRjUHJvdG9aFWNvbS5xdWljay52b2ljZS5wcm90b7oCCFJ0Y1Byb3RvYgZwcm90bzM`,[$]),1);function jo(e){let{event:t,compress:n=!1,time:r}=e,i=e.data,a=``,o,s=En(new Date().getTime(),`YYYY-MM-DD hh:mm:ss`,{offset:480});if(r!=null&&(a=En(Number(r),`YYYY-MM-DD hh:mm:ss`,{offset:480})),n)try{i=to(i)}catch(e){console.error(`\\x1B[38;2;0;151;255m%c%s\\x1B[0m`,`color:#0097ff;`,`------->quickvo:消息解压错误`,e)}switch(t){case`connectCF`:o=P(io,i);break;case`genTurnAddress`:o=P(ko,i);break;case`publish`:o=P(ao,i);break;case`joinRoom`:case`joinRoomEx`:o=P(no,i);break;case`subscribe`:o=P(so,i);break;case`closeTrack`:o=P(po,i);break;case`syncRoomInfo`:o=P(fo,i);break;case`onJoinRoom`:o=P(ro,i);break;case`onJoinRoomBatch`:o=P(Eo,i);break;case`onPublish`:o=P(oo,i);break;case`onCloseTrack`:o=P(mo,i);break;case`onTrackInactive`:o=P(bo,i);break;case`onUpdateCall`:o=P(uo,i);break;case`onRoomActionChange`:o=P(wo,i);break;case`onMeetSpecialRolesChange`:o=P(To,i);break;case`onUpdatePermissions`:o=P(ho,i);break;case`onUpdatePermissionsBatch`:o=P(Oo,i);break;case`onNetQuality`:o=P(lo,i);break;case`onCDNPlayUrlAdd`:o=P(_o,i);break;case`onUpdateBehavior`:o=P(go,i);break;case`onRoomUserSpeech`:o=P(xo,i);break;case`onAttemptP2PEx`:o=P(So,i);break;case`onOffer`:o=P(vo,i);break;case`onAnswer`:o=P(vo,i);break;case`onCandidate`:o=P(yo,i);break;case`onDisconnectedP2P`:o=P(Co,i);break;case`onQuitRoom`:o=P(co,i);break;case`onQuitRoomBatch`:o=P(Do,i);break;case`onDestroyRoom`:o=P(co,i);break;case`debugger`:case`ai`:o=JSON.parse(new TextDecoder().decode(i));break;case`UpdateTrackActive`:o=P(Ao,i);break}return yn({...e,timeStr:s,data_remote:i,data:o,remoteTime:r,remoteTimeStr:a})}let Mo=new class{decode(e){return{...jo(xn(new Uint8Array(e))),data_remote:new Uint8Array}}gzipCompress(e){return eo(new Uint8Array(e))}};onmessage=e=>{let{id:t,action:n,data:r}=e.data;if(n!==`destroy`)try{if(n===`decode`){let e={id:t,ok:!0,kind:`decode`,result:Mo.decode(r.buffer)};postMessage(e);return}if(n===`gzipCompress`){let e=Mo.gzipCompress(r.buffer),n=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);postMessage({id:t,ok:!0,kind:`gzipCompress`,buffer:n},[n]);return}}catch(e){let n={id:t,ok:!1,error:e instanceof Error?e.message:String(e)};postMessage(n)}}})();',cu=typeof self<`u`&&self.Blob&&new Blob([`(self.URL || self.webkitURL).revokeObjectURL(self.location.href);`,su],{type:`text/javascript;charset=utf-8`});function lu(e){let t;try{if(t=cu&&(self.URL||self.webkitURL).createObjectURL(cu),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(su),{name:e?.name})}}function uu(e,t){let n=e;if(n?.message){let e=n.filename?` ${n.filename}:${n.lineno??0}`:``;return`${t}: ${n.message}${e}`}return t}var du=class{worker;nextId=1;pending=new Map;options;constructor(e={}){this.options=e,this.worker=new lu,this.worker.onmessage=e=>{let t=e.data,n=this.pending.get(t.id);if(n){if(this.pending.delete(t.id),t.ok===!1){n.reject(Error(t.error));return}if(t.kind===`gzipCompress`){n.resolve(new Uint8Array(t.buffer));return}n.resolve(t.result)}},this.worker.addEventListener(`messageerror`,()=>{this.failAll(Error(`quickvo cws codec worker messageerror`))}),this.worker.addEventListener(`error`,e=>{this.failAll(Error(uu(e,`quickvo cws codec worker error`)))})}failAll(e){for(let[,t]of this.pending)t.reject(e);this.pending.clear(),this.worker.terminate(),this.options.onFatal?.()}decode(e){let t=this.nextId++,n=e.slice(0);return new Promise((e,r)=>{this.pending.set(t,{resolve:t=>e(t),reject:r}),this.worker.postMessage({id:t,action:`decode`,data:{buffer:n}},[n])})}gzipCompress(e){let t=this.nextId++,n=e.slice(0);return new Promise((e,r)=>{this.pending.set(t,{resolve:t=>e(t),reject:r}),this.worker.postMessage({id:t,action:`gzipCompress`,data:{buffer:n}},[n])})}destroy=()=>{let e=Error(`quickvo codec worker destroyed`);for(let[,t]of this.pending)t.reject(e);this.pending.clear();try{this.worker.postMessage({id:0,action:`destroy`,data:{}})}catch{}this.worker.terminate()}},fu=!1,pu=null;function mu(){if(fu)return null;if(typeof Worker>`u`)return fu=!0,null;if(!pu)try{pu=new du({onFatal:()=>{fu=!0,pu=null}})}catch{return fu=!0,null}return pu}var hu=Promise.resolve();function gu(e){let t=hu.then(()=>_u(e));return hu=t.then(()=>void 0,()=>void 0),t}async function _u(e){let t=mu();if(!t)return iu(eu(new Uint8Array(e)));try{return await t.decode(e)}catch{return iu(eu(new Uint8Array(e)))}}async function vu(e){let t=mu();if(!t)return Wl(e);let n=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);try{return await t.gzipCompress(n)}catch{return Wl(e)}}function yu(){pu?.destroy(),pu=null,fu=!1,hu=Promise.resolve()}var bu=class{config;prResolves=new Ki;remoteUserId=``;pc;timer;channelLocal;channelRemote;channelRemoteList=[];icecandidates=[];isCandidateCollected=!1;transceiverSend=new Map;transceiverRecv=new Map;activeSend={};activeRecv={};on={};waitings={candidateCollected:()=>this.prResolves.add(`candidateCollected`,()=>this.isCandidateCollected),remoteChannelConnected:()=>this.prResolves.add(`remoteChannelConnected`,()=>this.channelRemote?.readyState===`open`),connected:()=>this.prResolves.add(`connected`,()=>this.pc?.connectionState===`connected`),setOffered:()=>this.prResolves.add(`setOffered`,()=>this.pc?.remoteDescription)};constructor({config:e,remoteUserId:t}){this.config=e,this.remoteUserId=t}remoteChannelSend=async e=>{if(await this.waitings.remoteChannelConnected(),this.config.debug&&this.channelRemote?.readyState!==`open`){console.error(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: [remoteChannelSend] RemoteChannel is error.`,{channelRemote:this.channelRemote});return}let t=ru({time:Date.now(),sn:0,valid:30*1e3,compress:!1,version:5,...e}),n=t.data;t.compress&&n&&(n=await vu(n));let r=new Uint8Array(au({...t,data:n}));this.channelRemote?.send(r)};init=()=>{this._clear(),this.pc=new RTCPeerConnection({iceServers:[{urls:`stun:stun.cloudflare.com:3478`}]}),this.pc.addTransceiver(`audio`,{direction:`inactive`}),this.channelLocal=this.pc.createDataChannel(`Web_P2P_${this.config.userId}`,{}),this.channelLocal.onmessage=e=>{gu((e.data instanceof ArrayBuffer?e.data:new Uint8Array(e.data).buffer).slice(0)).then(e=>{let{event:t,data:n}=e;switch(t){case`UpdateTrackActive`:{if(n==null)break;let{tracks:e=[]}=n;for(let t of e){let{type:e,isActive:n=!1}=t,r=M[e];this.setSendTracksEnabled([r],n,`remote`)}}break}}).catch(()=>{try{let{event:t,data:n}=iu(ou(new Uint8Array((e.data instanceof ArrayBuffer,e.data))));if(t===`UpdateTrackActive`&&n!=null){let{tracks:e=[]}=n;for(let t of e){let{type:e,isActive:n=!1}=t,r=M[e];this.setSendTracksEnabled([r],n,`remote`)}}}catch{}})},this.pc.ondatachannel=e=>{this.channelRemote=e.channel,this.channelRemoteList.push(e.channel),this.channelRemote.onopen=()=>{this.prResolves.emit(`remoteChannelConnected`)},this.config.debug&&this.channelRemoteList.length>1&&console.warn(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: There are multiple channelRemote.`,this.channelRemoteList)},this.pc.onconnectionstatechange=()=>{let e=this.pc?.connectionState;switch(e){case`connected`:this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#00b60f;`,`------->quickvo: [p2p.onconnectionstatechange] ${e} `,{remoteUserId:this.remoteUserId}),clearTimeout(this.timer),this.prResolves.emit(`connected`);break;case`failed`:case`disconnected`:this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#b64900;`,`------->quickvo: [p2p.onconnectionstatechange] ${e} `,{remoteUserId:this.remoteUserId}),this.timer=setTimeout(()=>this.close(),20*1e3);break;case`closed`:this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#b60000;`,`------->quickvo: [p2p.onconnectionstatechange] ${e} `,{remoteUserId:this.remoteUserId}),this.destroy();break;default:this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#b64900;`,`------->quickvo: [p2p.onconnectionstatechange] ${e} `,{remoteUserId:this.remoteUserId});break}},this.pc.onicecandidate=e=>{e.candidate?this.icecandidates.push(e.candidate):this._markIceGatheringComplete()},this.pc.onicegatheringstatechange=()=>{this.pc?.iceGatheringState===`complete`&&this._markIceGatheringComplete()}};getSenderTrack=e=>this.transceiverSend.get(e)?.sender.track;getRecvierTrack=e=>this.transceiverRecv.get(e)?.receiver.track;syncRecvTracksEnabled=()=>{let e=[],t=[];for(let n of M)n.includes(`audio`)||(this.activeRecv[n]?e.push(n):t.push(n));e.length!==0&&this.setRecvTracksEnabled(e,!0),t.length!==0&&this.setRecvTracksEnabled(t,!1)};initSenders=(e=[],t=`sendrecv`)=>{let n=this.checkPeer(),r=[],i=n?.getTransceivers()||[];for(let e of M){let t=this.transceiverSend.get(e);t&&(i.find(e=>e.direction!==`stopped`&&e.mid===t?.mid)||this.transceiverSend.delete(e))}for(let n of e){let{mid:e,mediaType:a}=n,o=i?.find(t=>t.mid===e);if(!o)continue;o.direction=t;let s=this.transceiverSend.get(a);s&&s.mid===o.mid||(this.transceiverSend.set(a,o),r.push(a),t==`sendrecv`&&this.transceiverRecv.set(a,o))}return r};initRecvs=(e=[],t=`sendrecv`)=>{let n=this.checkPeer(),r=[],i=n?.getTransceivers()||[];for(let e of M){let t=this.transceiverRecv.get(e);t&&(i.find(e=>e.direction!==`stopped`&&e.mid===t?.mid)||this.transceiverRecv.delete(e))}for(let i of e){if(this.transceiverRecv.get(i))continue;let e;switch(i){case`mc_audio`:case`ss_audio`:e=`audio`;break;case`mc_video`:case`ss_video`:e=`video`;break}let a=n.addTransceiver(e,{direction:t});a.direction=t,[`mc_video`,`ss_video`].includes(i)&&a.setCodecPreferences(this.config.codecPreferences.video),this.transceiverRecv.set(i,a),r.push(i)}return r};hasRecvier=async e=>this.transceiverRecv.has(e);hasSender=async e=>this.transceiverSend.has(e);checkActive=()=>{if(!this.pc||this.pc.connectionState!==`connected`)return!1;let e=!1;for(let t of M)if(this.activeSend[t]){e=!0;break}for(let t of M)if(this.activeRecv[t]){e=!0;break}return e};replaceSenderTrack=async(e,t)=>{let n=this.transceiverSend.get(e);if(!n)return;let{sender:r}=n;await r.replaceTrack(t)};setSendTracksEnabled=(e=[],t,n)=>{this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color: ${t?`#00b60f`:`#b64900`};`,`------->quickvo: [p2p.setSendTracksEnabled] ${t} `,{origin:n,mediaTypes:e,remoteUserId:this.remoteUserId,time:D(new Date().getTime())});let r=[];for(let n of e)this.activeSend[n]=t===!0?new Date().getTime():void 0,r.push(n);return this.on.setSendTracksEnabled&&this.on.setSendTracksEnabled(e),r};setRecvTracksEnabled=(e=[],t)=>{this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color: ${t?`#00b60f`:`#b64900`};`,`------->quickvo: [p2p.setRecvTracksEnabled] ${t} `,{mediaTypes:e,remoteUserId:this.remoteUserId,time:D(new Date().getTime())});let n=[];for(let r of e)this.activeRecv[r]=t===!0?new Date().getTime():void 0,n.push(r);let r=this.getRecvUserTracksAsRtc(n);this.remoteChannelSend({event:`UpdateTrackActive`,data:{roomId:this.config.roomId,tracks:r}});let i=this.checkActive();return t===!1&&i===!1&&this.close(),n};setRTCRtpSenderParameters=async(e,t=[])=>{try{for(let n of t){let t=this.transceiverSend.get(n);if(!t)continue;let{sender:r}=t,i=r.getParameters();await r.setParameters({...i,...e})}}catch(e){console.error(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: setRTCRtpSenderParameters is error.`,e)}};createOffer=async()=>{let e=this.checkPeer(),t=await e.createOffer();return t.sdp&&=t.sdp.replace(RegExp(`42e01f`,`g`),`42e034`),await e.setLocalDescription(t),t};setOffer=async e=>{let t=this.checkPeer();this._filterSdp(e),await t.setRemoteDescription(e),await this.prResolves.emit(`setOffered`)};createAnswer=async()=>{let e=this.checkPeer(),t=await e.createAnswer();return t.sdp&&=t.sdp.replace(RegExp(`42e01f`,`g`),`42e034`),await e.setLocalDescription(t),t};setAnswer=async e=>{let t=this.checkPeer();this._filterSdp(e),await t.setRemoteDescription(e)};getIcecandidates=async()=>(await this.waitings.candidateCollected(),this.icecandidates);addCandidates=async e=>{await this.waitings.setOffered();for(let t of e)t.candidate?.includes(`kcp`)||await this.pc?.addIceCandidate(t)};getSenderUserTracks=(e=[])=>{let t=[];for(let n of e){let e=this.transceiverSend.get(n);if(!e)continue;let{mid:r,sender:i}=e,{track:a}=i;if(!a)continue;let{id:o,enabled:s}=a,c=M.findIndex(e=>e===n),l={type:c,enabled:s,trackName:`web-${c}-${o}`,mid:r,mediaType:n};t.push(l)}return t};getRecvUserTracks=(e=[])=>{let t=[];for(let n of e){let e=this.transceiverRecv.get(n);if(!e)continue;let{mid:r,receiver:i}=e,{track:a}=i;if(!a)continue;let{id:o,enabled:s}=a,c=M.findIndex(e=>e===n),l=this.activeRecv[n],u={type:c,enabled:s,trackName:`web-${c}-${o}`,mid:r,mediaType:n,isActive:l};t.push(u)}return t};getRecvUserTracksAsRoomTrack=(e=[])=>{let t=[B.Microphone,B.Camera,B.Screen,B.SystemVoice],n=[];for(let r of e){let e=this.transceiverRecv.get(r);if(!e)continue;let{mid:i,receiver:a}=e,{track:o}=a;if(!o)continue;let{id:s,enabled:c}=o,l=M.findIndex(e=>e===r);l<0||l>=t.length||n.push(On(Yr,{mid:i??``,trackName:`web-${l}-${s}`,type:t[l],isValid:c}))}return n};getSenderUserTracksAsRoomTrack=(e=[])=>{let t=[B.Microphone,B.Camera,B.Screen,B.SystemVoice],n=[];for(let r of e){let e=this.transceiverSend.get(r);if(!e)continue;let{mid:i,sender:a}=e,{track:o}=a;if(!o)continue;let{id:s,enabled:c}=o,l=M.findIndex(e=>e===r);l<0||l>=t.length||n.push(On(Yr,{mid:i??``,trackName:`web-${l}-${s}`,type:t[l],isValid:c}))}return n};getRecvUserTracksAsRtc=(e=[])=>{let t=[B.Microphone,B.Camera,B.Screen,B.SystemVoice],n=[];for(let r of e){let e=this.transceiverRecv.get(r);if(!e)continue;let{mid:i,receiver:a}=e,{track:o}=a;if(!o)continue;let{id:s}=o,c=M.findIndex(e=>e===r);if(c<0||c>=t.length)continue;let l=this.activeRecv[r]!=null;n.push(On(ql,{userId:this.config.userId,mid:i??``,trackName:`web-${c}-${s}`,type:t[c],isActive:l}))}return n};checkReceActive=e=>this.activeRecv[e]||!1;getTrack=e=>this.transceiverRecv.get(e)?.receiver?.track;checkPeer=()=>{if(!this.pc)throw Error(`you need init pc.`);return this.pc};close=()=>{this.pc?.connectionState===`connected`&&this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: [p2p.close]`,{remoteUserId:this.remoteUserId}),clearTimeout(this.timer);{let e=[...this.transceiverSend.values()];for(let t of e)t.currentDirection!==`stopped`&&t.stop();this.transceiverSend=new Map}{let e=[...this.transceiverRecv.values()];for(let t of e)t.currentDirection!==`stopped`&&t.stop();this.transceiverRecv=new Map}this.pc?.close(),this.on.close&&this.on.close()};destroy=async()=>{this.close(),this._clear()};_markIceGatheringComplete=()=>{this.isCandidateCollected||(this.isCandidateCollected=!0,this.prResolves.emit(`candidateCollected`))};_clear=()=>{this.icecandidates=[],this.isCandidateCollected=!1,this.channelLocal=void 0,this.channelRemote=void 0,this.channelRemoteList=[],this.activeSend={},this.activeRecv={},this.transceiverSend=new Map,this.transceiverRecv=new Map,this.pc=void 0};_filterSdp=e=>{let t=Gi.parse(e.sdp),{media:n=[]}=t;for(let e of n){let{candidates:t=[]}=e,n=[];for(let e of t)e.transport!==`kcp`&&n.push(e);e.candidates=n}e.sdp=Gi.write(t)}},xu=[`remote-outbound-rtp`,`inbound-rtp`,`candidate-pair`,`media-source`,`codec`],Su=class{reports=[];trackReport={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:`unknown`,payloadType:0,sdpFmtpLine:``,frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0};transmittedPackets=0;transmittedPacketsLost=0;averageQualitys=[];averageOffsetBytesSents=[];isAvailable=[];availableScore=[];constructor(){}applyFromReports=e=>{try{if(e.length===0)throw Error(`empty reports`);let t={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:`unknown`,payloadType:0,sdpFmtpLine:``,frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0},n=0,r=0;for(let i of e){let{type:e}=i;if(xu.includes(e))switch(e){case`codec`:{let{mimeType:e,payloadType:n,sdpFmtpLine:r}=i;t.mimeType=e,t.payloadType=n,t.sdpFmtpLine=r}break;case`remote-outbound-rtp`:break;case`inbound-rtp`:{let{bytesReceived:e,packetsReceived:a,packetsLost:o=0,jitter:s=0,frameWidth:c=0,frameHeight:l=0,framesPerSecond:u=0}=i;n=a,r=o,t.bytesSent=e,t.jitter=Math.round(s*1e3),t.frameWidth=c,t.frameHeight=l,t.framesPerSecond=u}break;case`candidate-pair`:{let{currentRoundTripTime:e=0}=i;t.roundTripTime=Math.round(e*1e3)}break}}if(n!==0&&r!==0){let e=n-this.transmittedPackets,i=r-this.transmittedPacketsLost,a=e+i;t.lostRate=a===0?0:Math.round(i/a*1e4)/1e4,this.transmittedPackets=n,this.transmittedPacketsLost=r}{let{lostRate:e,roundTripTime:n,jitter:r}=t;t.quality=ne(e,n,r),this.averageQualitys.unshift(t.quality),this.averageQualitys=this.averageQualitys.slice(0,10)}this.averageQualitys.length>=10&&(t.averageQuality=this.averageQualitys.length<10?0:Math.round(this.averageQualitys.reduce((e,t)=>e+t)/this.averageQualitys.length)),t.offsetBytesSent=Math.max(0,t.bytesSent-this.trackReport.bytesSent),this.averageOffsetBytesSents.unshift(t.offsetBytesSent),this.averageOffsetBytesSents=this.averageOffsetBytesSents.slice(0,5),t.averageOffsetBytesSent=this.averageOffsetBytesSents.length===0?0:Math.round(this.averageOffsetBytesSents.reduce((e,t)=>e+t)/this.averageOffsetBytesSents.length);{let{frameWidth:e,frameHeight:n,mimeType:r}=t;if(r){if(r.includes(`audio`))this.isAvailable.unshift(1);else if(e&&n){let r=Math.round(ie(e,n)/3),i=t.offsetBytesSent>=r?1:0;this.isAvailable.unshift(i)}this.isAvailable=this.isAvailable.slice(0,10)}}{let e=this.isAvailable.length,n=0,r=[];for(let t=0;t<e;t++){let e=this.isAvailable[t]*re[t];n+=e,r.push(e)}this.availableScore=r,t.availableScore=Math.round(n*100)/100}this.trackReport=t}catch{this.clear()}return this.trackReport};generate=async(e,t)=>{try{if(t===void 0)throw Error(`Peer track is undefined.`);if(e.connectionState!==`connected`)throw Error(`Peer connectionState is ${e.connectionState}.`);let n=await e.getStats(t);return this.applyFromReports([...n.values()])}catch{return this.clear(),this.trackReport}};clear=()=>{this.trackReport={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:`unknown`,payloadType:0,sdpFmtpLine:``,frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0},this.transmittedPackets=0,this.transmittedPacketsLost=0,this.averageQualitys=[],this.averageOffsetBytesSents=[],this.availableScore=[],this.isAvailable=[]}},Cu=class extends Xi{subscribed={mc_audio:!1,mc_video:!1,ss_video:!1,ss_audio:!1};tracksAnalysis={sfu:{recvs:{mc_audio:new Su,mc_video:new Su,ss_video:new Su,ss_audio:new Su}},p2p:{sends:{mc_audio:new Ji,mc_video:new Ji,ss_video:new Ji,ss_audio:new Ji},recvs:{mc_audio:new Su,mc_video:new Su,ss_video:new Su,ss_audio:new Su}}};audioReceiver={mc_audio:new Audio,ss_audio:new Audio};p2p;constructor({config:e,localMedias:t}){super({config:e,localMedias:t}),this.isSelf=!1}checkSubscribed=e=>{let t=[],n=[];for(let r of e){let e=this.tracks[r];if(e&&e.origin!==`phoney`){n.push(r);continue}t.push(r)}return{prohibited_mediaTypes:t,subscribed_mediaTypes:n}};setSubscribed=(e,t)=>{for(let n of e)this.subscribed[n]=t};getTrackReports=(e,t,n)=>{if(e===`sfu`)return this.tracksAnalysis.sfu.recvs[n].trackReport;if(e===`p2p`)return this.tracksAnalysis[e][t][n].trackReport};generateTrackAnalysis=async(e,t,n)=>{let{pc:r}=e;if(r.connectionState===`connected`)for(let r of M){let i=this.getTrack(r);if(i){let{mid:n}=i,a=ea(t,e.getRecvierTrack(n)??null,n);this.tracksAnalysis.sfu.recvs[r].applyFromReports(a)}if(!this.p2p?.pc||!n||this.p2p.pc.connectionState!==`connected`)continue;let a=this.p2p.getSenderTrack(r),o=this.p2p.getRecvierTrack(r);this.tracksAnalysis.p2p.sends[r].applyFromReports($i(n,a??null)),this.tracksAnalysis.p2p.recvs[r].applyFromReports(ea(n,o??null,null))}};useRemoteStream=(e,t)=>{for(let n of e){let e=this.getTrack(n);if(!e)continue;let r=t.getTransceiver(e.mid);if(!r)continue;let{track:i}=r.receiver;if(this.replaceMediaStreamTrack(n,i),e.origin=`sfu`,e.msid=i.id,e.enabled=!0,[`mc_audio`,`ss_audio`].includes(n)){let e=this.getUserMediaStreamContext(n);e?.setMute(!1);let t=e?.inputStream;if(!t)continue;let r=this.audioReceiver[n];if(!r)continue;r.srcObject=t}}};useRemoteP2PStream=e=>{for(let t of e){let e=this.getTrack(t);if(!e)continue;let n=this.p2p?.getTrack(t);if(n&&(this.replaceMediaStreamTrack(t,n),e.origin=`p2p`,e.msid=``,e.enabled=!0,[`mc_audio`,`ss_audio`].includes(t))){let e=this.getUserMediaStreamContext(t);e?.setMute(!1);let n=e?.inputStream;if(!n)continue;let r=this.audioReceiver[t];if(!r)continue;r.srcObject=n}}};clear=()=>{this.tracks={},this.network={egress:0,ingress:0},this.setSubscribed(M,!1),this.p2p?.destroy(),this.p2p=void 0}},wu=class{config;localMedias;notifys;localUser;remoteUsers=new Map;_emitUsersChangeTimer=0;constructor({config:e,localMedias:t,notifys:n}){this.config=e,this.localMedias=t,this.notifys=n,this.localUser=new ta({config:e,localMedias:t})}getLocalUserTrackReports=e=>this.localUser.getTrackReports(e);getRemoteUserTrackReports=(e,t,n,r)=>this.getRemoteUserContent(e)?.getTrackReports(t,n,r);getUserContent=e=>!e||e===this.config.userId?this.localUser:this.getRemoteUserContent(e);getRemoteUserContent=e=>this.remoteUsers.get(e);getUserAudioMediaStreamContext=(e,t)=>this.getUserContent(e)?.getUserMediaStreamContext(t);setInputVolume=(e,t,n)=>{this.getUserAudioMediaStreamContext(e,t)?.setInputGain(n)};setEnhanceGain=async(e,t,n)=>{this.getUserAudioMediaStreamContext(e,t)?.setEnhanceGain(n)};setSpeakerVolume=(e,t,n)=>{let r=this.getUserAudioMediaStreamContext(e,t);r?.setOutputGain(n);let i=n===0;r?.setMute(i)};getVolume=(e,t)=>this.getUserAudioMediaStreamContext(e,t)?.getVolume();playBgs=async(e,t,n)=>{let r=this.getUserContent(e);if(!r)throw Error(`This user is undefined.`);await r.streamControls[t]?.mixAudio(n,`bgs`)};playBgm=async(e,t,n)=>{let r=this.getUserContent(e);if(!r)throw Error(`This user is undefined.`);await r.streamControls[t]?.mixAudio(n,`bgm`)};changBgsMix=async(e,t,n)=>{let r=this.getUserContent(e);if(!r)throw Error(`This user is undefined.`);r.streamControls[t]?.changeMix(`bgs`,n)};changBgmMix=async(e,t,n)=>{let r=this.getUserContent(e);if(!r)throw Error(`This user is undefined.`);r.streamControls[t]?.changeMix(`bgm`,n)};stopBgs=async(e,t)=>{let n=this.getUserContent(e);if(!n)throw Error(`This user is undefined.`);n.streamControls[t]?.mixAudioStop(`bgs`)};stopBgm=async(e,t)=>{let n=this.getUserContent(e);if(!n)throw Error(`This user is undefined.`);n.streamControls[t]?.mixAudioStop(`bgm`)};setBgsGain=async(e,t,n)=>{let r=this.getUserContent(e);if(!r)throw Error(`This user is undefined.`);r.streamControls[t]?.setBgsGain(n)};setBgmGain=async(e,t,n)=>{let r=this.getUserContent(e);if(!r)throw Error(`This user is undefined.`);r.streamControls[t]?.setBgmGain(n)};getrP2PConnectedCount=()=>{let e=0,t=this.remoteUsers.values();for(let n of t)n.p2p&&(e+=n.p2p.transceiverSend.size);return e};addRemoteUsersSubscribed=(e=[])=>{if(e.length===0){let e=this.remoteUsers.values();for(let t of e)t.setSubscribed(M,!0)}else for(let t of e){let{userId:e,mediaTypes:n}=t;this.remoteUsers.get(e)?.setSubscribed(n,!0)}};removeRemoteUsersSubscribed=(e=[])=>{if(e.length===0){let e=this.remoteUsers.values();for(let t of e)t.setSubscribed(M,!1)}else for(let t of e){let{userId:e,mediaTypes:n}=t;this.remoteUsers.get(e)?.setSubscribed(n,!1)}};createRemoteUsersSubscribeData=(e=!1)=>{let t=[],n=this.remoteUsers.values();for(let r of n){let{id:n,tracks:i,subscribed:a}=r,o=[];for(let t of M){let n=i[t];if(!n||a[t]===!1||n.origin!==`phoney`)continue;let{type:r}=n;o.push({type:r,lastRetry:e})}o.length!==0&&t.push({id:n,tracks:o})}return t};createRemoteUsersCloseData=()=>{let e=[],t=this.remoteUsers.values();for(let n of t){let{id:t,tracks:r,subscribed:i}=n,a=[],o=[];for(let e of M){let n=r[e];n&&i[e]!==!0&&n.origin!==`phoney`&&(n.origin===`sfu`&&a.push({...n,userId:t}),n.origin===`p2p`&&o.push(e))}a.length===0&&o.length===0||e.push({userId:t,sfu_tracks:a,p2p_mediaTypes:o})}return e};emitUsersChange=()=>{clearTimeout(this._emitUsersChangeTimer);let e=()=>{let e=this.getUsersInfo();this.notifys.emit(`onRoomUsers`,{code:200,desc:`All users info is change.`,data:e})};this._emitUsersChangeTimer=setTimeout(()=>e(),500)};getMaxVolumeUser=()=>{let e=[...this.remoteUsers.keys()];if(e.push(this.localUser.id),e.length===0)return;let t=[];for(let n of e){let e=this.getVolume(n,`mc_audio`);e&&t.push({id:n,volume:e})}return t=t.sort((e,t)=>e.volume-t.volume>0?-1:1),t[0]};getUserStream=(e,t)=>this.getUserContent(e)?.getStream(t);getUsersInfo=()=>{let e=[this.localUser.getInfo()],t=[...this.remoteUsers.values()];for(let n of t){let t=n.getInfo();e.push(t)}return e};getP2PState=()=>{let e={pull:[],push:[]};{let t=this.remoteUsers.values();for(let n of t){let{id:t,p2p:r}=n;if(!r)continue;let i=[],a=[];for(let e of M){let t=M.findIndex(t=>t===e);(r.activeSend[e]||!1)!==!1&&(i.push(t),(r.activeRecv[e]||!1)!==!1&&a.push(t))}i.length!==0&&e.push.push({userId:t,types:i}),a.length!==0&&e.pull.push({userId:t,types:a})}}return e};createRemoteUser=e=>{let{config:t,localMedias:n}=this,r=new Cu({config:t,localMedias:n});return r.id=e,this.remoteUsers.set(e,r),r};checkRemoteUser=e=>this.remoteUsers.has(e);removeRemoteUser=e=>{this.remoteUsers.get(e)?.clear(),this.remoteUsers.delete(e)};applyRemoteUserPublishNotify=e=>{let t=this.getRemoteUserContent(e.id);if(!t)return!1;let{callAction:n=0,tracks:r=[]}=e;return t.updateTracks(r),t.updateCallAction(n),!0};detachRemoteUsersForQuit=e=>{let t=[],n=[],r=[];for(let i of e){let e=this.getRemoteUserContent(i);if(!e)continue;t.push(i);let a=e.removeTracks(M);for(let e of a){let{mid:t,msid:i}=e;i&&t&&(n.push(t),r.push(e))}this.removeRemoteUser(i)}return{removeUserIds:t,removeMids:n,removeTracks:r}};pruneRemoteUsersNotInServerList=e=>{let t=new Set(e),n=[];for(let e of[...this.remoteUsers.values()]){if(t.has(e.id))continue;let r=[];for(let t of M){let n=e.tracks[t];n&&n.msid&&r.push(n.mid)}n.push({mids:r}),e.clear(),this.remoteUsers.delete(e.id)}return n};updateUsersIsAdmin=(e=[])=>{this.localUser.isAdmin=e.includes(this.localUser.id);let t=this.remoteUsers.values();for(let n of t)n.isAdmin=e.includes(n.id)};initUsers=(e,t)=>{for(let n of e){let{id:e,callAction:r=0,permissions:i=0,behavior:a=0,tracks:o}=n;if(this.localUser.id===e)this.localUser.updateCallAction(r),this.localUser.updatePermissions(i),this.localUser.updateBehavior(a),this.localUser.updateTracks(o,t);else{let n=this.remoteUsers.get(e);n||=this.createRemoteUser(e),n.updateCallAction(r),n.updatePermissions(i),n.updateBehavior(a),n.updateTracks(o,t)}}};clearRemoteUsers=()=>{let e=[...this.remoteUsers.keys()];for(let t of e)this.remoteUsers.get(t)?.clear(),this.remoteUsers.delete(t)};createRemoteUserP2P=e=>{let t=this.getRemoteUserContent(e);if(!t)throw Error(`The remote user to be established does not exist.`);let n=new bu({config:this.config,remoteUserId:t.id});return n.on.setSendTracksEnabled=e=>{this.syncRemoteUserP2PSenderStreamTrack(e)},n.on.close=()=>{for(let e of M)t.tracksAnalysis.p2p.sends[e].clear(),t.tracksAnalysis.p2p.recvs[e].clear()},t.p2p=n,n};syncRemoteUserP2PSenderStreamTrack=async e=>{let t=this.remoteUsers.values();for(let n of t)for(let t of e)if(n.p2p&&n.p2p.hasSender(t))if(n.p2p.activeSend[t]){let e=this.localUser.getStream(t);if(!e)continue;let[r]=e.getTracks();await n.p2p.replaceSenderTrack(t,r)}else{let e=this.localMedias.getPhoneyStreamTrack(t);await n.p2p.replaceSenderTrack(t,e)}}},Tu=Object.defineProperty,Eu=e=>{throw TypeError(e)},Du=(e,t,n)=>t in e?Tu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ou=(e,t,n)=>Du(e,typeof t==`symbol`?t:t+``,n),ku=(e,t,n)=>t.has(e)||Eu(`Cannot `+n),Au=(e,t,n)=>(ku(e,t,`read from private field`),n?n.call(e):t.get(e)),ju=(e,t,n)=>t.has(e)?Eu(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Mu=(e=0,t=1)=>{let n=Math.max(0,e),r=Math.random()*(Math.max(1,t)-n+1)+n;return parseInt(`${r}`,10)},Nu=(e=16,t=16)=>{let n=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``),r=Math.min(n.length,t),i=Date.now().toString(r),a=i.split(``),o=Math.max(4,e-i.length);for(let e=0;e<o;e++){let e=n[Mu(0,r-1)];a.push(e)}return a.join(``).toUpperCase()},Pu=(e,t)=>{try{let n=Number(e);if(isNaN(n)){let t=new Date(`${e}`);if(`${t}`==`Invalid Date`)return 0;n=t.getTime()}if(t!==void 0){let e=new Date().getTimezoneOffset();n+=(e+t)*60*1e3}return n}catch(n){return console.error(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;padding:16px 0;`,`------->timeStamp:err`,{_val:e,_offset:t,error:n}),0}},Fu={1:`1`,2:`2`,3:`3`,4:`4`,5:`5`,6:`6`,7:`7`,"01":`一`,"02":`二`,"03":`三`,"04":`四`,"05":`五`,"06":`六`,"07":`日`},Iu=e=>Pu(e),Lu=(e,t=`YYYY-MM-DD hh:mm:ss`,n={})=>{let{empty_str:r,offset:i}={empty_str:`-`,...n},a=Pu(e,i);if(Number(e)!==0&&a===0)return r;let o=new Date(a),s=`${o.getFullYear()}`,c=`${o.getMonth()+1}`,l=`${[`1`,`2`,`3`].includes(c)?1:[`4`,`5`,`6`].includes(c)?2:[`7`,`8`,`9`].includes(c)?3:4}`,u=`${o.getDate()}`,d=`${o.getDay()===0?7:o.getDay()}`,f=`${o.getHours()}`,p=`${o.getMinutes()}`,m=`${o.getSeconds()}`,h=`${Math.ceil((a-Iu(`${s}/01/01 00:00:00`)+1)/864e5)}`,g=`${Math.ceil(((a-Iu(`${s}/01/01 00:00:00`))/864e5-Number(d))/7)+1}`,_=[{k:`Y+`,v:s},{k:`M+`,v:c},{k:`Q+`,v:l},{k:`D+`,v:u},{k:`W+`,v:d},{k:`h+`,v:f},{k:`m+`,v:p},{k:`s+`,v:m},{k:`d+`,v:h},{k:`w+`,v:g}],v;for(let{k:e,v:n}of _)if(v=RegExp(`(${e})`).exec(t),v){let e=v[1],r=n.padStart(e.length,`0`);e.includes(`W`)&&(r=Fu[r.slice(0,2)]),t=t.replace(e,r)}return t},Ru,zu=class{constructor(e=1e3,t=!1){Ou(this,`_debug`,!1),Ou(this,`_queue`,[]),Ou(this,`_interval`,1e3),Ou(this,`_now`,Date.now()),Ou(this,`removeQueueItem`,(e=[])=>{for(let t of e){let e=this._queue.findIndex(e=>e.key===t);e!==-1&&(this._queue.splice(e,1),this._debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;padding:16px 0;`,`------->Breathe:移除事件`,t))}}),Ou(this,`addQueueItem`,e=>{let{key:t=Nu(),execution_time:n=this._now,interval:r=1e4,func:i=()=>{}}=e;this.removeQueueItem([t]);let a=n+Number(r),o=this._queue.findIndex(e=>a>=e.execution_time);o=o===-1?this._queue.length:o;let s={key:t,execution_time:a,interval:r,func:i};return this._queue.splice(o,0,s),this._debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;padding:16px 0;`,`------->Breathe:插入事件`,t,`执行时间: ${Lu(a)}`,`队列位置: ${o}`),t}),ju(this,Ru,()=>{this._now=Date.now();let e=this._queue.length;for(let t=e;t>0;t--){let e=this._queue[this._queue.length-1],{key:t,interval:n=0,execution_time:r=0,func:i}=e,a=Math.round((r-this._now)/1e3);if(!e){this._debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;padding:16px 0;`,`------->Breathe:`,`当前 无 任务`);break}if(this._debug){let t=Array.from(this._queue,e=>e.execution_time),n=Array.from(this._queue,e=>e.execution_time).sort((e,t)=>t-e),i=Array.from(this._queue,e=>e.key);console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;padding:16px 0;`,`------->Breathe:队列keys`,JSON.stringify(i)),JSON.stringify(t)!==JSON.stringify(n)&&console.error(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;padding:16px 0;`,`------->Breathe:时间线${t.length}`,`异常`,JSON.stringify(t)),console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;padding:16px 0;`,`------->Breathe:`,`当前 有 任务`,`最近任务 ${Lu(r)} 剩余${a}s`,`任务详情:${JSON.stringify(e)}`)}if(a>0)break;if(i(),n===0)return this.removeQueueItem([t]);this.addQueueItem(e)}}),Ou(this,`startQueue`,()=>setInterval(Au(this,Ru),this._interval)),this._interval=e,this._debug=t}};Ru=new WeakMap;var Bu={onNetQuality:`网络质量回调`,updateSeverTime:`服务端时间更新`,onJoinRoom:`加入房间回调`,onJoinRoomBatch:`加入房间批量回调`,onQuitRoom:`退出房间回调`,onQuitRoomBatch:`退出房间批量回调`,onPublish:`监听到流发布`,onCloseTrack:`关闭轨道`,onUpdateCall:`更新通讯状态`,onTrackInactive:`通知轨道失效`,onRoomActionChange:`房间内的全体禁言状态发生变化`,onMeetSpecialRolesChange:`房间内的管理员发生变化`,onAttemptP2PEx:`建立P2P连接`,onOffer:`收到P2P-offer`,onAnswer:`收到P2P-answer`,onCandidate:`收到P2P候选信息-candidate`,onDisconnectedP2P:`断开P2P`,onUpdatePermissions:`更新推流权限通知`,onUpdatePermissionsBatch:`批量更新推流权限通知`,onBeforeTokenExpire:`Token即将过期`,onTokenExpired:`Token已过期`,onDestroyRoom:`销毁房间`,onUpdateBehavior:`行为允许权限变更`,onCDNPlayUrlAdd:`cdn播放地址变化`,onRoomUserSpeech:`用户讲话`},Vu=h(Bu),Hu=Object.keys(Bu),Uu=Object.values(Bu),Wu=class{binaryType=`blob`;debug=!1;url=``;ws;isReconnecting=!1;timeout=10*1e3;reconnectTimeout=40*1e3;activeTimeStamp=0;on={};getUrl=()=>``;constructor(){}connect=()=>{let e=new Date().getTime();this.url=this.getUrl(),this.debug&&console.log(`------->pr-ws: connecting.`,{url:this.url});let t,n=!1,r=e=>{n||(n=!0,clearTimeout(t),e())};return new Promise((n,i)=>{t=setTimeout(()=>{this.ws?.close(),r(()=>i(`Connection timeout.`))},this.timeout),this._open().then(()=>r(()=>n(new Date().getTime()-e))).catch(e=>r(()=>{this.close(1e3,e instanceof Error?e.message:String(e)),i(e)}))})};reconnect=()=>this._reconnectAsync();_reconnectAsync=async()=>{let e=new Date().getTime();this.isReconnecting=!0,this.url=this.getUrl(),this.debug&&console.log(`------->pr-ws: reconnecting.`,{url:this.url});let t=!1,n=setTimeout(()=>{this.ws?.close(),t=!0,this.isReconnecting=!1},this.reconnectTimeout);try{for(;!t;)try{return await this._open(),clearTimeout(n),this.isReconnecting=!1,new Date().getTime()-e}catch{if(t)break;this.debug===!0&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->pr-ws: Reconnect again in 5 seconds.`,{url:this.url}),await new Promise(e=>setTimeout(e,1e3*5))}throw`Reconnection timeout.`}finally{clearTimeout(n)}};send=e=>{if(!this.ws||this.ws.readyState!==1)throw Error(`Ws is not ready.`);this.ws.send(e)};close=(e=1e3,t=`Correctly close.`)=>{this.ws&&(this._clear(),this.ws?.close(e,t),this.ws=void 0,this.debug&&console.log(`------->pr-ws: closed.`,{code:e,reason:t,url:this.url}))};_open=()=>new Promise((e,t)=>{this._clear(),this.ws=new WebSocket(this.url),this.ws.binaryType=this.binaryType,this.ws.onmessage=e=>{this.activeTimeStamp=new Date().getTime(),this.on.message&&e.data instanceof ArrayBuffer&&this.on.message(e.data)},this.ws.onopen=()=>{this.activeTimeStamp=new Date().getTime(),e(!0)},this.ws.onerror=e=>{t(e)},this.ws.onclose=e=>{this.isReconnecting===!1&&this.on.checkReconnect&&this.on.checkReconnect(e)}});_clear=()=>{this.ws&&(this.ws.onmessage=()=>{},this.ws.onopen=()=>{},this.ws.onerror=()=>{},this.ws.onclose=()=>{})}},Gu=class{eventName;prws;message;needRetry=!0;sn=Number(y(16,10));_resolve=e=>{};_reject=e=>{};sendBefore;sendAfter;options={timeout:30*1e3,onBack:!0};timer=0;constructor(e,t,n={}){this.prws=t,n.timeout!==void 0&&n.timeout<=0&&(n.timeout=60*1e3),this.eventName=e,this.options={...this.options,...n}}resolve=e=>{if(this.options.onBack&&(e.sn!==this.message?.sn&&console.warn(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: Received a timeout response. ${this.message?.sn} !== ${e.sn}`,{current:this.message,response:e}),this.message&&this.message.time&&typeof e.time==`number`)){let t=e.time-this.message.time;t>=10*1e3&&console.warn(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: This request response is too long. ${ee(t)}`,{current:this.message,response:e})}this.needRetry=!1,clearTimeout(this.timer),this.sendAfter&&this.sendAfter(),this._resolve(e)};reject=e=>{this.needRetry=!1,clearTimeout(this.timer),this._reject(e)};retry=()=>{if(!this.message)throw Error(`[${this.eventName}]: Send needs to be called first.`);this.message.time=Date.now(),this.sendMsg()};send=e=>new Promise(async(t,n)=>{this._resolve=t,this._reject=n;let{data:r,compress:i=!1,version:a=5}=e,o=this.eventName,s=Date.now(),c=this.options.timeout,l={event:o,data:r,sn:this.sn,time:s,valid:c,compress:i,version:a};try{let e=ru(l),t=e.data;e.compress&&t&&(t=await vu(t)),this.message={...e,data:t};try{this.sendMsg()}catch(e){n(e)}}catch(e){n(e)}});sendMsg=()=>{if(this.prws.ws?.readyState!==1)return;if(!this.message||!this.message.sn)return this.reject(`Message is undefined or Message.sn is undefined.`);this.sendBefore&&this.sendBefore(this.message);let e=tu({event:this.message.event,data:this.message.data,sn:this.message.sn,time:this.message.time,valid:this.message.valid,version:this.message.version,compress:this.message.compress});if(this.prws.send(new Uint8Array(e)),this.options.onBack===!0)this._createTimer();else{let{event:e,sn:t}=this.message;this.needRetry=!1,this.sendAfter&&this.sendAfter(),this._resolve({event:e,sn:t,code:200,desc:``,data:{}})}};_createTimer=()=>{this.timer=window.setTimeout(()=>{let e=Error(`[${this.eventName}]: Event is timeout.`);e.name=`timeout`,this._reject(e)},this.options.timeout)};destroy=()=>{clearTimeout(this.timer);let e=Error(`[${this.eventName}]: Event is destroy.`);e.name=`destroy`,this._reject(e)}},Ku=[`sdp`,`Sdp`,`remoteSdp`],qu=[`id`,`userId`];function Ju(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(e=>typeof e==`bigint`?String(e):typeof e==`object`&&e?Ju(e):e);let t={};for(let n of Object.keys(e)){let r=e[n];if(typeof r==`bigint`){t[n]=String(r);continue}if(Ku.includes(n))r=``;else if(qu.includes(n)){let e=r==null?``:String(r);r=e.length>10?e.slice(0,3)+`****`+e.slice(-3):r}else typeof r==`object`&&r&&(r=Ju(r));t[n]=r}return t}var Yu=`quickvo-sdk`,Xu=2,Zu=`call_logs`,Qu=`logs_main`,$u=`logs_ignore`,ed=null;function td(e){return e===`#quickvo.ignoreEvents`?$u:Qu}function nd(){return ed||=new Promise((e,t)=>{let n=indexedDB.open(Yu,Xu);n.onerror=()=>t(n.error??Error(`indexedDB.open failed`)),n.onsuccess=()=>e(n.result),n.onupgradeneeded=()=>{let e=n.result;e.objectStoreNames.contains(Qu)||e.createObjectStore(Qu),e.objectStoreNames.contains($u)||e.createObjectStore($u)}}),ed}function rd(e,t){return nd().then(n=>new Promise((r,i)=>{if(!n.objectStoreNames.contains(e)){r(void 0);return}let a=n.transaction(e,`readonly`).objectStore(e).get(t);a.onsuccess=()=>r(a.result),a.onerror=()=>i(a.error)}))}function id(e){return nd().then(t=>new Promise((n,r)=>{if(!t.objectStoreNames.contains(Zu)){n(void 0);return}let i=t.transaction(Zu,`readonly`).objectStore(Zu).get(e);i.onsuccess=()=>n(i.result),i.onerror=()=>r(i.error)}))}function ad(e,t,n){return nd().then(r=>new Promise((i,a)=>{let o=r.transaction(e,`readwrite`);o.objectStore(e).put(n,t),o.oncomplete=()=>i(),o.onerror=()=>a(o.error??Error(`idb put failed`))}))}function od(e){try{let t=localStorage.getItem(e);if(t==null)return null;let n=JSON.parse(t);return Array.isArray(n)?n:null}catch{return null}}async function sd(e){let t=td(e);try{let n=await rd(t,e);if(Array.isArray(n))return n}catch{}try{let n=await id(e);if(Array.isArray(n)){try{await ad(t,e,n)}catch{}return n}}catch{}let n=od(e);if(n){try{await ad(t,e,n),localStorage.removeItem(e)}catch{}return n}return[]}async function cd(e,t){await ad(td(e),e,t)}function ld(e){if(e==null)return e;if(typeof e==`bigint`)return String(e);if(typeof e!=`object`)return e;if(Array.isArray(e))return e.map(e=>ld(e));if(e instanceof Uint8Array)return e.slice();let t={};for(let n of Object.keys(e))t[n]=ld(e[n]);return t}var ud=`#quickvo.logs`;async function dd(){let e=ld(await sd(ud)),t=JSON.stringify(e,null,2),n=new Blob([t],{type:`application/json;charset=utf-8`}),r=URL.createObjectURL(n);try{let e=document.createElement(`a`);e.href=r,e.download=`quickvo-logs-${new Date().toISOString().replace(/[:.]/g,`-`)}.json`,e.rel=`noopener`,document.body.appendChild(e),e.click(),e.remove()}finally{URL.revokeObjectURL(r)}}if(typeof window<`u`&&typeof Window<`u`){let e=Window.prototype;e.getQVLogs||=function(){return dd()}}var fd=[];fd.push(`heartbeat`),fd.push(`heartbeatEx`),fd.push(`networkQualityChange`),fd.push(`genTurnAddress`),fd.push(`reportNetwork`),fd.push(`ackMsg`);var $=[];$.push(`heartbeat`),$.push(`heartbeatEx`),$.push(`networkQualityChange`),$.push(`genTurnAddress`),$.push(`pubNotify`),$.push(`updateCall`),$.push(`reportNetwork`),$.push(`offer`),$.push(`candidate`),$.push(`answer`),$.push(`reportP2PConnectEx`),$.push(`onRoomUserSpeech`),$.push(`updateSeverTime`);var pd=class e{config;timeout=30*1e3;prws=new Wu;events=new Map;on={};_logBuffer=new Map;_logFlushTimer=0;static _LOG_FLUSH_DELAY=1e3;constructor({config:e}){this.config=e,this.prws.binaryType=`arraybuffer`,this.prws.getUrl=()=>this.config.createWsUrl(),this.prws.on.message=e=>{gu(e.slice(0)).then(e=>{this._dispatchCwsDecodedMessage(e)}).catch(e=>{this.config.debug&&console.error(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: 消息解码失败`,e)})},this.prws.on.checkReconnect=async e=>{switch(e.code){case 1e3:case 4001:case 4002:case 4003:this.on.state&&this.on.state(`closed`);break;case 4010:this.reconnect();break;default:if(this.config.isInRoom===!1)return;this.reconnect();break}}}needRestoreRoom=()=>{let e=new Date().getTime()-this.prws.activeTimeStamp,t=e>30*1e3;return t===!0&&this.config.debug&&console.warn(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#b64900;`,`------->quickvo: NeedRestoreRoom.`,{offsetTime:e}),t};isValid=()=>!(!this.prws.ws||[2,3].includes(this.prws.ws.readyState));connect=async()=>{this.on.state&&this.on.state(`connecting`);try{let e=await this.prws.connect();this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: 连接耗时-${e}ms`),await this.retryEvents(),this.on.state&&this.on.state(`connected`)}catch(e){throw this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: 连接失败`,e),this.on.state&&this.on.state(`closed`),e}};reconnect=async()=>{this.on.state&&this.on.state(`reconnecting`),await this.prws.reconnect().then(async e=>{this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: 重连耗时-${e}ms`),await this.retryEvents(),this.on.state&&this.on.state(`connected`)}).catch(e=>{this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: 重连失败`,e),this.on.state&&this.on.state(`closed`)})};close=()=>{this.prws.ws?.readyState!==3&&(this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: cws is closed.`),this.prws.close(),this.clearEvents(),this._logFlushTimer&&=(clearTimeout(this._logFlushTimer),0),this._flushLogs())};createRequest=(e,t={})=>{let n=new Gu(e,this.prws,{timeout:this.timeout,...t});return n.sendBefore=e=>{this._updateLogs(`req`,e),this.config.debug&&!fd.includes(e.event)&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#ff9700;padding:16px 0;`,`------->quickvo: 发送消息↑`,e)},n.sendAfter=()=>{n.needRetry===!1&&n.message?.sn&&(this.events.get(e)?.delete(n.message.sn),this.events.get(e)?.size===0&&this.events.delete(e))},n.options.onBack===!0&&(this.events.has(e)||this.events.set(e,new Map),n.sn?this.events.get(e)?.set(n.sn,n):console.warn(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#ff9700;padding:16px 0;`,`------->quickvo: This message is invalid. There is no valid SN.`,e,n.message)),n};hasEvent=e=>this.events.has(e);clearEvents=()=>{let e=this.events.values();for(let t of e){let e=t.values();for(let t of e)t.destroy()}this.events=new Map};_dispatchCwsDecodedMessage=e=>{let{event:t,sn:n}=e;if(this._updateLogs(`res`,e),this.config.debug&&!$.includes(t)&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#ff0097;padding:16px 0;`,`------->quickvo: 响应消息↓`,e),Hu.includes(t)){let n=this.on[t],r=f(e,[`code`,`data`,`desc`]);n&&n(r);return}let r=this.events.get(t)?.get(n);if(r){let t=f(e,[`code`,`data`,`desc`,`sn`]);r.resolve(t)}};retryEvents=async()=>{let e=this.events.values();for(let t of e){let e=t.values();for(let t of e)t.needRetry===!0&&t.retry()}};_updateLogs=(t,n={})=>{try{let{time:r,event:i,data:a={},data_original:o={},data_remote:s,...c}=n,l=D(r,`YYYY-MM-DD hh:mm:ss`,{offset:480}),u={},d=`res ↓`;switch(t){case`res`:d=`res ↓`,u=Ju(a);break;case`req`:d=`req ↑`,u=Ju(o);break}let f=`#quickvo.logs`;(fd.includes(i)||$.includes(i))&&(f=`#quickvo.ignoreEvents`);let p={"#action":d,timeStr:l,event:i,data:u,time:r,...c};this.on.log&&this.on.log(ld(p)),this._logBuffer.has(f)||this._logBuffer.set(f,[]),this._logBuffer.get(f).push(p),this._logFlushTimer===0&&(this._logFlushTimer=window.setTimeout(()=>{this._flushLogs()},e._LOG_FLUSH_DELAY))}catch(e){this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: updateLogs is error`,e)}};_flushLogs=async()=>{this._logFlushTimer&&=(clearTimeout(this._logFlushTimer),0);let e=this._logBuffer.keys();for(let t of e){let e=this._logBuffer.get(t);if(e.length===0)continue;this._logBuffer.set(t,[]);let n=[];try{n=await sd(t)}catch{n=[]}let r=e.slice().reverse(),i=!1,a=!1,o=[],s=e=>{let{event:t}=e;if(t===`heartbeat`||t===`heartbeatEx`){if(e[`#action`]?.includes(`req`)){if(i)return;i=!0}if(e[`#action`]?.includes(`res`)){if(a)return;a=!0}}o.push(e)};for(let e of r)if(s(e),o.length>=200)break;if(o.length<200){for(let e of n)if(s(e),o.length>=200)break}try{await cd(t,o)}catch(e){this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: saveCallLogs failed`,e)}}}};function md(e){if(typeof e==`function`)return e;if(typeof e==`object`&&e&&`default`in e){let t=e.default;if(typeof t==`function`)return t;if(typeof t==`object`&&t&&`default`in t&&typeof t.default==`function`)return t.default}throw TypeError(`fixWebmDuration is not a function`)}var hd='(function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),u=o((e=>{(function(e){var t=`undefined`,n=t!==typeof Buffer&&Buffer,r=t!==typeof Uint8Array&&Uint8Array,i=t!==typeof ArrayBuffer&&ArrayBuffer,a=[0,0,0,0,0,0,0,0],o=Array.isArray||x,s=4294967296,c=16777216,l;u(`Uint64BE`,!0,!0),u(`Int64BE`,!0,!1),u(`Uint64LE`,!1,!0),u(`Int64LE`,!1,!1);function u(o,u,x){var S=u?0:4,C=u?4:0,w=u?0:3,T=u?1:2,E=u?2:1,D=u?3:0,O=u?_:y,k=u?v:b,A=N.prototype,j=`is`+o,M=`_`+j;return A.buffer=void 0,A.offset=0,A[M]=!0,A.toNumber=F,A.toString=I,A.toJSON=F,A.toArray=d,n&&(A.toBuffer=f),r&&(A.toArrayBuffer=p),N[j]=ee,e[o]=N,N;function N(e,t,n,r){return this instanceof N?te(this,e,t,n,r):new N(e,t,n,r)}function ee(e){return!!(e&&e[M])}function te(e,o,s,c,u){if(r&&i&&(o instanceof i&&(o=new r(o)),c instanceof i&&(c=new r(c))),!o&&!s&&!c&&!l){e.buffer=g(a,0);return}if(!m(o,s)){var d=l||Array;u=s,c=o,s=0,o=l===n?n.alloc(8):new d(8)}e.buffer=o,e.offset=s|=0,t!==typeof c&&(typeof c==`string`?P(o,s,c,u||10):m(c,u)?h(o,s,c,u):typeof u==`number`?(L(o,s+S,c),L(o,s+C,u)):c>0?O(o,s,c):c<0?k(o,s,c):h(o,s,a,0))}function P(e,t,n,r){var i=0,a=n.length,o=0,c=0;n[0]===`-`&&i++;for(var l=i;i<a;){var u=parseInt(n[i++],r);if(!(u>=0))break;c=c*r+u,o=o*r+Math.floor(c/s),c%=s}l&&(o=~o,c?c=s-c:o++),L(e,t+S,o),L(e,t+C,c)}function F(){var e=this.buffer,t=this.offset,n=R(e,t+S),r=R(e,t+C);return x||(n|=0),n?n*s+r:r}function I(e){var t=this.buffer,n=this.offset,r=R(t,n+S),i=R(t,n+C),a=``,o=!x&&r&2147483648;for(o&&(r=~r,i=s-i),e||=10;;){var c=r%e*s+i;if(r=Math.floor(r/e),i=Math.floor(c/e),a=(c%e).toString(e)+a,!r&&!i)break}return o&&(a=`-`+a),a}function L(e,t,n){e[t+D]=n&255,n>>=8,e[t+E]=n&255,n>>=8,e[t+T]=n&255,n>>=8,e[t+w]=n&255}function R(e,t){return e[t+w]*c+(e[t+T]<<16)+(e[t+E]<<8)+e[t+D]}}function d(e){var t=this.buffer,n=this.offset;return l=null,e!==!1&&o(t)?t.length===8?t:t.slice(n,n+8):g(t,n)}function f(e){var t=this.buffer,r=this.offset;return l=n,e!==!1&&n.isBuffer(t)?t.length===8?t:t.slice(r,r+8):n.from(p.call(this,e))}function p(e){var t=this.buffer,n=this.offset,a=t.buffer;if(l=r,e!==!1&&!t.offset&&a instanceof i)return a.byteLength===8?a:a.slice(n,n+8);var o=new r(8);return h(o,0,t,n),o.buffer}function m(e,t){var n=e&&e.length;return t|=0,n&&t+8<=n&&typeof e[t]!=`string`}function h(e,t,n,r){t|=0,r|=0;for(var i=0;i<8;i++)e[t++]=n[r++]&255}function g(e,t){return Array.prototype.slice.call(e,t,t+8)}function _(e,t,n){for(var r=t+8;r>t;)e[--r]=n&255,n/=256}function v(e,t,n){var r=t+8;for(n++;r>t;)e[--r]=-n&255^255,n/=256}function y(e,t,n){for(var r=t+8;t<r;)e[t++]=n&255,n/=256}function b(e,t,n){var r=t+8;for(n++;t<r;)e[t++]=-n&255^255,n/=256}function x(e){return!!e&&Object.prototype.toString.call(e)==`[object Array]`}})(typeof e==`object`&&typeof e.nodeName!=`string`?e:e||{})})),d=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.byEbmlID=void 0,e.byEbmlID={128:{name:`ChapterDisplay`,level:4,type:`m`,multiple:!0,minver:1,webm:!0,description:`Contains all possible strings to use for the chapter display.`},131:{name:`TrackType`,level:3,type:`u`,mandatory:!0,minver:1,range:`1-254`,description:`A set of track types coded on 8 bits (1: video, 2: audio, 3: complex, 0x10: logo, 0x11: subtitle, 0x12: buttons, 0x20: control).`},133:{name:`ChapString`,cppname:`ChapterString`,level:5,type:`8`,mandatory:!0,minver:1,webm:!0,description:`Contains the string to use as the chapter atom.`},134:{name:`CodecID`,level:3,type:`s`,mandatory:!0,minver:1,description:`An ID corresponding to the codec, see the codec page for more info.`},136:{name:`FlagDefault`,cppname:`TrackFlagDefault`,level:3,type:`u`,mandatory:!0,minver:1,default:1,range:`0-1`,description:`Set if that track (audio, video or subs) SHOULD be active if no language found matches the user preference. (1 bit)`},137:{name:`ChapterTrackNumber`,level:5,type:`u`,mandatory:!0,multiple:!0,minver:1,webm:!1,range:`not 0`,description:`UID of the Track to apply this chapter too. In the absense of a control track, choosing this chapter will select the listed Tracks and deselect unlisted tracks. Absense of this element indicates that the Chapter should be applied to any currently used Tracks.`},145:{name:`ChapterTimeStart`,level:4,type:`u`,mandatory:!0,minver:1,webm:!0,description:`Timestamp of the start of Chapter (not scaled).`},146:{name:`ChapterTimeEnd`,level:4,type:`u`,minver:1,webm:!1,description:`Timestamp of the end of Chapter (timestamp excluded, not scaled).`},150:{name:`CueRefTime`,level:5,type:`u`,mandatory:!0,minver:2,webm:!1,description:`Timestamp of the referenced Block.`},151:{name:`CueRefCluster`,level:5,type:`u`,mandatory:!0,webm:!1,description:`The Position of the Cluster containing the referenced Block.`},152:{name:`ChapterFlagHidden`,level:4,type:`u`,mandatory:!0,minver:1,webm:!1,default:0,range:`0-1`,description:`If a chapter is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)`},16980:{name:`ContentCompAlgo`,level:6,type:`u`,mandatory:!0,minver:1,webm:!1,default:0,description:`The compression algorithm used. Algorithms that have been specified so far are: 0 - zlib, 3 - Header Stripping`},16981:{name:`ContentCompSettings`,level:6,type:`b`,minver:1,webm:!1,description:`Settings that might be needed by the decompressor. For Header Stripping (ContentCompAlgo=3), the bytes that were removed from the beggining of each frames of the track.`},17026:{name:`DocType`,level:1,type:`s`,mandatory:!0,default:`matroska`,minver:1,description:`A string that describes the type of document that follows this EBML header. \'matroska\' in our case or \'webm\' for webm files.`},17029:{name:`DocTypeReadVersion`,level:1,type:`u`,mandatory:!0,default:1,minver:1,description:`The minimum DocType version an interpreter has to support to read this file.`},17030:{name:`EBMLVersion`,level:1,type:`u`,mandatory:!0,default:1,minver:1,description:`The version of EBML parser used to create the file.`},17031:{name:`DocTypeVersion`,level:1,type:`u`,mandatory:!0,default:1,minver:1,description:`The version of DocType interpreter used to create the file.`},17476:{name:`SegmentFamily`,level:2,type:`b`,multiple:!0,minver:1,webm:!1,bytesize:16,description:`A randomly generated unique ID that all segments related to each other must use (128 bits).`},17505:{name:`DateUTC`,level:2,type:`d`,minver:1,description:`Date of the origin of timestamp (value 0), i.e. production date.`},17540:{name:`TagDefault`,level:4,type:`u`,mandatory:!0,minver:1,webm:!1,default:1,range:`0-1`,description:`Indication to know if this is the default/original language to use for the given tag. (1 bit)`},17541:{name:`TagBinary`,level:4,type:`b`,minver:1,webm:!1,description:`The values of the Tag if it is binary. Note that this cannot be used in the same SimpleTag as TagString.`},17543:{name:`TagString`,level:4,type:`8`,minver:1,webm:!1,description:`The value of the Element.`},17545:{name:`Duration`,level:2,type:`f`,minver:1,range:`> 0`,description:`Duration of the segment (based on TimecodeScale).`},17816:{name:`ChapterFlagEnabled`,level:4,type:`u`,mandatory:!0,minver:1,webm:!1,default:1,range:`0-1`,description:`Specify wether the chapter is enabled. It can be enabled/disabled by a Control Track. When disabled, the movie should skip all the content between the TimeStart and TimeEnd of this chapter (see flag notes). (1 bit)`},18016:{name:`FileMimeType`,level:3,type:`s`,mandatory:!0,minver:1,webm:!1,description:`MIME type of the file.`},18017:{name:`FileUsedStartTime`,level:3,type:`u`,divx:!0,description:`DivX font extension`},18018:{name:`FileUsedEndTime`,level:3,type:`u`,divx:!0,description:`DivX font extension`},18037:{name:`FileReferral`,level:3,type:`b`,webm:!1,description:`A binary value that a track/codec can refer to when the attachment is needed.`},20529:{name:`ContentEncodingOrder`,level:5,type:`u`,mandatory:!0,minver:1,webm:!1,default:0,description:`Tells when this modification was used during encoding/muxing starting with 0 and counting upwards. The decoder/demuxer has to start with the highest order number it finds and work its way down. This value has to be unique over all ContentEncodingOrder elements in the segment.`},20530:{name:`ContentEncodingScope`,level:5,type:`u`,mandatory:!0,minver:1,webm:!1,default:1,range:`not 0`,description:`A bit field that describes which elements have been modified in this way. Values (big endian) can be OR\'ed. Possible values: 1 - all frame contents, 2 - the track\'s private data, 4 - the next ContentEncoding (next ContentEncodingOrder. Either the data inside ContentCompression and/or ContentEncryption)`},20531:{name:`ContentEncodingType`,level:5,type:`u`,mandatory:!0,minver:1,webm:!1,default:0,description:`A value describing what kind of transformation has been done. Possible values: 0 - compression, 1 - encryption`},20532:{name:`ContentCompression`,level:5,type:`m`,minver:1,webm:!1,description:`Settings describing the compression used. Must be present if the value of ContentEncodingType is 0 and absent otherwise. Each block must be decompressable even if no previous block is available in order not to prevent seeking.`},20533:{name:`ContentEncryption`,level:5,type:`m`,minver:1,webm:!1,description:`Settings describing the encryption used. Must be present if the value of ContentEncodingType is 1 and absent otherwise.`},21368:{name:`CueBlockNumber`,level:4,type:`u`,minver:1,default:1,range:`not 0`,description:`Number of the Block in the specified Cluster.`},22100:{name:`ChapterStringUID`,level:4,type:`8`,mandatory:!1,minver:3,webm:!0,description:`A unique string ID to identify the Chapter. Use for WebVTT cue identifier storage.`},22337:{name:`WritingApp`,level:2,type:`8`,mandatory:!0,minver:1,description:`Writing application ("mkvmerge-0.3.3").`},22612:{name:`SilentTracks`,cppname:`ClusterSilentTracks`,level:2,type:`m`,minver:1,webm:!1,description:`The list of tracks that are not used in that part of the stream. It is useful when using overlay tracks on seeking. Then you should decide what track to use.`},25152:{name:`ContentEncoding`,level:4,type:`m`,mandatory:!0,multiple:!0,minver:1,webm:!1,description:`Settings for one content encoding like compression or encryption.`},25188:{name:`BitDepth`,cppname:`AudioBitDepth`,level:4,type:`u`,minver:1,range:`not 0`,description:`Bits per sample, mostly used for PCM.`},25906:{name:`SignedElement`,level:3,type:`b`,multiple:!0,webm:!1,description:`An element ID whose data will be used to compute the signature.`},26148:{name:`TrackTranslate`,level:3,type:`m`,multiple:!0,minver:1,webm:!1,description:`The track identification for the given Chapter Codec.`},26897:{name:`ChapProcessCommand`,cppname:`ChapterProcessCommand`,level:5,type:`m`,multiple:!0,minver:1,webm:!1,description:`Contains all the commands associated to the Atom.`},26914:{name:`ChapProcessTime`,cppname:`ChapterProcessTime`,level:6,type:`u`,mandatory:!0,minver:1,webm:!1,description:`Defines when the process command should be handled (0: during the whole chapter, 1: before starting playback, 2: after playback of the chapter).`},26916:{name:`ChapterTranslate`,level:2,type:`m`,multiple:!0,minver:1,webm:!1,description:`A tuple of corresponding ID used by chapter codecs to represent this segment.`},26931:{name:`ChapProcessData`,cppname:`ChapterProcessData`,level:6,type:`b`,mandatory:!0,minver:1,webm:!1,description:`Contains the command information. The data should be interpreted depending on the ChapProcessCodecID value. For ChapProcessCodecID = 1, the data correspond to the binary DVD cell pre/post commands.`},26948:{name:`ChapProcess`,cppname:`ChapterProcess`,level:4,type:`m`,multiple:!0,minver:1,webm:!1,description:`Contains all the commands associated to the Atom.`},26965:{name:`ChapProcessCodecID`,cppname:`ChapterProcessCodecID`,level:5,type:`u`,mandatory:!0,minver:1,webm:!1,default:0,description:`Contains the type of the codec used for the processing. A value of 0 means native Matroska processing (to be defined), a value of 1 means the DVD command set is used. More codec IDs can be added later.`},29555:{name:`Tag`,level:2,type:`m`,mandatory:!0,multiple:!0,minver:1,webm:!1,description:`Element containing elements specific to Tracks/Chapters.`},29572:{name:`SegmentFilename`,level:2,type:`8`,minver:1,webm:!1,description:`A filename corresponding to this segment.`},29766:{name:`AttachmentLink`,cppname:`TrackAttachmentLink`,level:3,type:`u`,minver:1,webm:!1,range:`not 0`,description:`The UID of an attachment that is used by this codec.`},2459272:{name:`CodecName`,level:3,type:`8`,minver:1,description:`A human-readable string specifying the codec.`},408125543:{name:`Segment`,level:`0`,type:`m`,mandatory:!0,multiple:!0,minver:1,description:`This element contains all other top-level (level 1) elements. Typically a Matroska file is composed of 1 segment.`},17530:{name:`TagLanguage`,level:4,type:`s`,mandatory:!0,minver:1,webm:!1,default:`und`,description:`Specifies the language of the tag specified, in the Matroska languages form.`},17827:{name:`TagName`,level:4,type:`8`,mandatory:!0,minver:1,webm:!1,description:`The name of the Tag that is going to be stored.`},26568:{name:`SimpleTag`,cppname:`TagSimple`,level:3,recursive:`1`,type:`m`,mandatory:!0,multiple:!0,minver:1,webm:!1,description:`Contains general information about the target.`},25542:{name:`TagAttachmentUID`,level:4,type:`u`,multiple:!0,minver:1,webm:!1,default:0,description:`A unique ID to identify the Attachment(s) the tags belong to. If the value is 0 at this level, the tags apply to all the attachments in the Segment.`},25540:{name:`TagChapterUID`,level:4,type:`u`,multiple:!0,minver:1,webm:!1,default:0,description:`A unique ID to identify the Chapter(s) the tags belong to. If the value is 0 at this level, the tags apply to all chapters in the Segment.`},25545:{name:`TagEditionUID`,level:4,type:`u`,multiple:!0,minver:1,webm:!1,default:0,description:`A unique ID to identify the EditionEntry(s) the tags belong to. If the value is 0 at this level, the tags apply to all editions in the Segment.`},25541:{name:`TagTrackUID`,level:4,type:`u`,multiple:!0,minver:1,webm:!1,default:0,description:`A unique ID to identify the Track(s) the tags belong to. If the value is 0 at this level, the tags apply to all tracks in the Segment.`},25546:{name:`TargetType`,cppname:`TagTargetType`,level:4,type:`s`,minver:1,webm:!1,strong:`informational`,description:`An string that can be used to display the logical level of the target like "ALBUM", "TRACK", "MOVIE", "CHAPTER", etc (see TargetType).`},26826:{name:`TargetTypeValue`,cppname:`TagTargetTypeValue`,level:4,type:`u`,minver:1,webm:!1,default:50,description:`A number to indicate the logical level of the target (see TargetType).`},25536:{name:`Targets`,cppname:`TagTargets`,level:3,type:`m`,mandatory:!0,minver:1,webm:!1,description:`Contain all UIDs where the specified meta data apply. It is empty to describe everything in the segment.`},307544935:{name:`Tags`,level:1,type:`m`,multiple:!0,minver:1,webm:!1,description:`Element containing elements specific to Tracks/Chapters. A list of valid tags can be found here.`},17677:{name:`ChapProcessPrivate`,cppname:`ChapterProcessPrivate`,level:5,type:`b`,minver:1,webm:!1,description:`Some optional data attached to the ChapProcessCodecID information. For ChapProcessCodecID = 1, it is the "DVD level" equivalent.`},17278:{name:`ChapCountry`,cppname:`ChapterCountry`,level:5,type:`s`,multiple:!0,minver:1,webm:!1,description:`The countries corresponding to the string, same 2 octets as in Internet domains.`},17276:{name:`ChapLanguage`,cppname:`ChapterLanguage`,level:5,type:`s`,mandatory:!0,multiple:!0,minver:1,webm:!0,default:`eng`,description:`The languages corresponding to the string, in the bibliographic ISO-639-2 form.`},143:{name:`ChapterTrack`,level:4,type:`m`,minver:1,webm:!1,description:`List of tracks on which the chapter applies. If this element is not present, all tracks apply`},25539:{name:`ChapterPhysicalEquiv`,level:4,type:`u`,minver:1,webm:!1,description:`Specify the physical equivalent of this ChapterAtom like "DVD" (60) or "SIDE" (50), see complete list of values.`},28348:{name:`ChapterSegmentEditionUID`,level:4,type:`u`,minver:1,webm:!1,range:`not 0`,description:`The EditionUID to play from the segment linked in ChapterSegmentUID.`},28263:{name:`ChapterSegmentUID`,level:4,type:`b`,minver:1,webm:!1,range:`>0`,bytesize:16,description:`A segment to play in place of this chapter. Edition ChapterSegmentEditionUID should be used for this segment, otherwise no edition is used.`},29636:{name:`ChapterUID`,level:4,type:`u`,mandatory:!0,minver:1,webm:!0,range:`not 0`,description:`A unique ID to identify the Chapter.`},182:{name:`ChapterAtom`,level:3,recursive:`1`,type:`m`,mandatory:!0,multiple:!0,minver:1,webm:!0,description:`Contains the atom information to use as the chapter atom (apply to all tracks).`},17885:{name:`EditionFlagOrdered`,level:3,type:`u`,minver:1,webm:!1,default:0,range:`0-1`,description:`Specify if the chapters can be defined multiple times and the order to play them is enforced. (1 bit)`},17883:{name:`EditionFlagDefault`,level:3,type:`u`,mandatory:!0,minver:1,webm:!1,default:0,range:`0-1`,description:`If a flag is set (1) the edition should be used as the default one. (1 bit)`},17853:{name:`EditionFlagHidden`,level:3,type:`u`,mandatory:!0,minver:1,webm:!1,default:0,range:`0-1`,description:`If an edition is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)`},17852:{name:`EditionUID`,level:3,type:`u`,minver:1,webm:!1,range:`not 0`,description:`A unique ID to identify the edition. It\'s useful for tagging an edition.`},17849:{name:`EditionEntry`,level:2,type:`m`,mandatory:!0,multiple:!0,minver:1,webm:!0,description:`Contains all information about a segment edition.`},272869232:{name:`Chapters`,level:1,type:`m`,minver:1,webm:!0,description:`A system to define basic menus and partition data. For more detailed information, look at the Chapters Explanation.`},18094:{name:`FileUID`,level:3,type:`u`,mandatory:!0,minver:1,webm:!1,range:`not 0`,description:`Unique ID representing the file, as random as possible.`},18012:{name:`FileData`,level:3,type:`b`,mandatory:!0,minver:1,webm:!1,description:`The data of the file.`},18030:{name:`FileName`,level:3,type:`8`,mandatory:!0,minver:1,webm:!1,description:`Filename of the attached file.`},18046:{name:`FileDescription`,level:3,type:`8`,minver:1,webm:!1,description:`A human-friendly name for the attached file.`},24999:{name:`AttachedFile`,level:2,type:`m`,mandatory:!0,multiple:!0,minver:1,webm:!1,description:`An attached file.`},423732329:{name:`Attachments`,level:1,type:`m`,minver:1,webm:!1,description:`Contain attached files.`},235:{name:`CueRefCodecState`,level:5,type:`u`,webm:!1,default:0,description:`The position of the Codec State corresponding to this referenced element. 0 means that the data is taken from the initial Track Entry.`},21343:{name:`CueRefNumber`,level:5,type:`u`,webm:!1,default:1,range:`not 0`,description:`Number of the referenced Block of Track X in the specified Cluster.`},219:{name:`CueReference`,level:4,type:`m`,multiple:!0,minver:2,webm:!1,description:`The Clusters containing the required referenced Blocks.`},234:{name:`CueCodecState`,level:4,type:`u`,minver:2,webm:!1,default:0,description:`The position of the Codec State corresponding to this Cue element. 0 means that the data is taken from the initial Track Entry.`},178:{name:`CueDuration`,level:4,type:`u`,mandatory:!1,minver:4,webm:!1,description:`The duration of the block according to the segment time base. If missing the track\'s DefaultDuration does not apply and no duration information is available in terms of the cues.`},240:{name:`CueRelativePosition`,level:4,type:`u`,mandatory:!1,minver:4,webm:!1,description:`The relative position of the referenced block inside the cluster with 0 being the first possible position for an element inside that cluster.`,position:`clusterRelative`},241:{name:`CueClusterPosition`,level:4,type:`u`,mandatory:!0,minver:1,description:`The position of the Cluster containing the required Block.`,position:`segment`},247:{name:`CueTrack`,level:4,type:`u`,mandatory:!0,minver:1,range:`not 0`,description:`The track for which a position is given.`},183:{name:`CueTrackPositions`,level:3,type:`m`,mandatory:!0,multiple:!0,minver:1,description:`Contain positions for different tracks corresponding to the timestamp.`},179:{name:`CueTime`,level:3,type:`u`,mandatory:!0,minver:1,description:`Absolute timestamp according to the segment time base.`},187:{name:`CuePoint`,level:2,type:`m`,mandatory:!0,multiple:!0,minver:1,description:`Contains all information relative to a seek point in the segment.`},475249515:{name:`Cues`,level:1,type:`m`,minver:1,description:`A top-level element to speed seeking access. All entries are local to the segment. Should be mandatory for non "live" streams.`},18406:{name:`ContentSigHashAlgo`,level:6,type:`u`,minver:1,webm:!1,default:0,description:`The hash algorithm used for the signature. A value of \'0\' means that the contents have not been signed but only encrypted. Predefined values: 1 - SHA1-160 2 - MD5`},18405:{name:`ContentSigAlgo`,level:6,type:`u`,minver:1,webm:!1,default:0,description:`The algorithm used for the signature. A value of \'0\' means that the contents have not been signed but only encrypted. Predefined values: 1 - RSA`},18404:{name:`ContentSigKeyID`,level:6,type:`b`,minver:1,webm:!1,description:`This is the ID of the private key the data was signed with.`},18403:{name:`ContentSignature`,level:6,type:`b`,minver:1,webm:!1,description:`A cryptographic signature of the contents.`},18402:{name:`ContentEncKeyID`,level:6,type:`b`,minver:1,webm:!1,description:`For public key algorithms this is the ID of the public key the the data was encrypted with.`},18401:{name:`ContentEncAlgo`,level:6,type:`u`,minver:1,webm:!1,default:0,description:`The encryption algorithm used. The value \'0\' means that the contents have not been encrypted but only signed. Predefined values: 1 - DES, 2 - 3DES, 3 - Twofish, 4 - Blowfish, 5 - AES`},28032:{name:`ContentEncodings`,level:3,type:`m`,minver:1,webm:!1,description:`Settings for several content encoding mechanisms like compression or encryption.`},196:{name:`TrickMasterTrackSegmentUID`,level:3,type:`b`,divx:!0,bytesize:16,description:`DivX trick track extenstions`},199:{name:`TrickMasterTrackUID`,level:3,type:`u`,divx:!0,description:`DivX trick track extenstions`},198:{name:`TrickTrackFlag`,level:3,type:`u`,divx:!0,default:0,description:`DivX trick track extenstions`},193:{name:`TrickTrackSegmentUID`,level:3,type:`b`,divx:!0,bytesize:16,description:`DivX trick track extenstions`},192:{name:`TrickTrackUID`,level:3,type:`u`,divx:!0,description:`DivX trick track extenstions`},237:{name:`TrackJoinUID`,level:5,type:`u`,mandatory:!0,multiple:!0,minver:3,webm:!1,range:`not 0`,description:`The trackUID number of a track whose blocks are used to create this virtual track.`},233:{name:`TrackJoinBlocks`,level:4,type:`m`,minver:3,webm:!1,description:`Contains the list of all tracks whose Blocks need to be combined to create this virtual track`},230:{name:`TrackPlaneType`,level:6,type:`u`,mandatory:!0,minver:3,webm:!1,description:`The kind of plane this track corresponds to (0: left eye, 1: right eye, 2: background).`},229:{name:`TrackPlaneUID`,level:6,type:`u`,mandatory:!0,minver:3,webm:!1,range:`not 0`,description:`The trackUID number of the track representing the plane.`},228:{name:`TrackPlane`,level:5,type:`m`,mandatory:!0,multiple:!0,minver:3,webm:!1,description:`Contains a video plane track that need to be combined to create this 3D track`},227:{name:`TrackCombinePlanes`,level:4,type:`m`,minver:3,webm:!1,description:`Contains the list of all video plane tracks that need to be combined to create this 3D track`},226:{name:`TrackOperation`,level:3,type:`m`,minver:3,webm:!1,description:`Operation that needs to be applied on tracks to create this virtual track. For more details look at the Specification Notes on the subject.`},32123:{name:`ChannelPositions`,cppname:`AudioPosition`,level:4,type:`b`,webm:!1,description:`Table of horizontal angles for each successive channel, see appendix.`},159:{name:`Channels`,cppname:`AudioChannels`,level:4,type:`u`,mandatory:!0,minver:1,default:1,range:`not 0`,description:`Numbers of channels in the track.`},30901:{name:`OutputSamplingFrequency`,cppname:`AudioOutputSamplingFreq`,level:4,type:`f`,minver:1,default:`Sampling Frequency`,range:`> 0`,description:`Real output sampling frequency in Hz (used for SBR techniques).`},181:{name:`SamplingFrequency`,cppname:`AudioSamplingFreq`,level:4,type:`f`,mandatory:!0,minver:1,default:8e3,range:`> 0`,description:`Sampling frequency in Hz.`},225:{name:`Audio`,cppname:`TrackAudio`,level:3,type:`m`,minver:1,description:`Audio settings.`},2327523:{name:`FrameRate`,cppname:`VideoFrameRate`,level:4,type:`f`,range:`> 0`,strong:`Informational`,description:`Number of frames per second. only.`},3126563:{name:`GammaValue`,cppname:`VideoGamma`,level:4,type:`f`,webm:!1,range:`> 0`,description:`Gamma Value.`},3061028:{name:`ColourSpace`,cppname:`VideoColourSpace`,level:4,type:`b`,minver:1,webm:!1,bytesize:4,description:`Same value as in AVI (32 bits).`},21683:{name:`AspectRatioType`,cppname:`VideoAspectRatio`,level:4,type:`u`,minver:1,default:0,description:`Specify the possible modifications to the aspect ratio (0: free resizing, 1: keep aspect ratio, 2: fixed).`},21682:{name:`DisplayUnit`,cppname:`VideoDisplayUnit`,level:4,type:`u`,minver:1,default:0,description:`How DisplayWidth & DisplayHeight should be interpreted (0: pixels, 1: centimeters, 2: inches, 3: Display Aspect Ratio).`},21690:{name:`DisplayHeight`,cppname:`VideoDisplayHeight`,level:4,type:`u`,minver:1,default:`PixelHeight`,range:`not 0`,description:`Height of the video frames to display. The default value is only valid when DisplayUnit is 0.`},21680:{name:`DisplayWidth`,cppname:`VideoDisplayWidth`,level:4,type:`u`,minver:1,default:`PixelWidth`,range:`not 0`,description:`Width of the video frames to display. The default value is only valid when DisplayUnit is 0.`},21725:{name:`PixelCropRight`,cppname:`VideoPixelCropRight`,level:4,type:`u`,minver:1,default:0,description:`The number of video pixels to remove on the right of the image.`},21708:{name:`PixelCropLeft`,cppname:`VideoPixelCropLeft`,level:4,type:`u`,minver:1,default:0,description:`The number of video pixels to remove on the left of the image.`},21691:{name:`PixelCropTop`,cppname:`VideoPixelCropTop`,level:4,type:`u`,minver:1,default:0,description:`The number of video pixels to remove at the top of the image.`},21674:{name:`PixelCropBottom`,cppname:`VideoPixelCropBottom`,level:4,type:`u`,minver:1,default:0,description:`The number of video pixels to remove at the bottom of the image (for HDTV content).`},186:{name:`PixelHeight`,cppname:`VideoPixelHeight`,level:4,type:`u`,mandatory:!0,minver:1,range:`not 0`,description:`Height of the encoded video frames in pixels.`},176:{name:`PixelWidth`,cppname:`VideoPixelWidth`,level:4,type:`u`,mandatory:!0,minver:1,range:`not 0`,description:`Width of the encoded video frames in pixels.`},21433:{name:`OldStereoMode`,level:4,type:`u`,maxver:`0`,webm:!1,divx:!1,description:`DEPRECATED, DO NOT USE. Bogus StereoMode value used in old versions of libmatroska. (0: mono, 1: right eye, 2: left eye, 3: both eyes).`},21440:{name:`AlphaMode`,cppname:`VideoAlphaMode`,level:4,type:`u`,minver:3,webm:!0,default:0,description:`Alpha Video Mode. Presence of this element indicates that the BlockAdditional element could contain Alpha data.`},21432:{name:`StereoMode`,cppname:`VideoStereoMode`,level:4,type:`u`,minver:3,webm:!0,default:0,description:`Stereo-3D video mode (0: mono, 1: side by side (left eye is first), 2: top-bottom (right eye is first), 3: top-bottom (left eye is first), 4: checkboard (right is first), 5: checkboard (left is first), 6: row interleaved (right is first), 7: row interleaved (left is first), 8: column interleaved (right is first), 9: column interleaved (left is first), 10: anaglyph (cyan/red), 11: side by side (right eye is first), 12: anaglyph (green/magenta), 13 both eyes laced in one Block (left eye is first), 14 both eyes laced in one Block (right eye is first)) . There are some more details on 3D support in the Specification Notes.`},154:{name:`FlagInterlaced`,cppname:`VideoFlagInterlaced`,level:4,type:`u`,mandatory:!0,minver:2,webm:!0,default:0,range:`0-1`,description:`Set if the video is interlaced. (1 bit)`},224:{name:`Video`,cppname:`TrackVideo`,level:3,type:`m`,minver:1,description:`Video settings.`},26277:{name:`TrackTranslateTrackID`,level:4,type:`b`,mandatory:!0,minver:1,webm:!1,description:`The binary value used to represent this track in the chapter codec data. The format depends on the ChapProcessCodecID used.`},26303:{name:`TrackTranslateCodec`,level:4,type:`u`,mandatory:!0,minver:1,webm:!1,description:`The chapter codec using this ID (0: Matroska Script, 1: DVD-menu).`},26364:{name:`TrackTranslateEditionUID`,level:4,type:`u`,multiple:!0,minver:1,webm:!1,description:`Specify an edition UID on which this translation applies. When not specified, it means for all editions found in the segment.`},22203:{name:`SeekPreRoll`,level:3,type:`u`,mandatory:!0,multiple:!1,default:0,minver:4,webm:!0,description:`After a discontinuity, SeekPreRoll is the duration in nanoseconds of the data the decoder must decode before the decoded data is valid.`},22186:{name:`CodecDelay`,level:3,type:`u`,multiple:!1,default:0,minver:4,webm:!0,description:`CodecDelay is The codec-built-in delay in nanoseconds. This value must be subtracted from each block timestamp in order to get the actual timestamp. The value should be small so the muxing of tracks with the same actual timestamp are in the same Cluster.`},28587:{name:`TrackOverlay`,level:3,type:`u`,multiple:!0,minver:1,webm:!1,description:`Specify that this track is an overlay track for the Track specified (in the u-integer). That means when this track has a gap (see SilentTracks) the overlay track should be used instead. The order of multiple TrackOverlay matters, the first one is the one that should be used. If not found it should be the second, etc.`},170:{name:`CodecDecodeAll`,level:3,type:`u`,mandatory:!0,minver:2,webm:!1,default:1,range:`0-1`,description:`The codec can decode potentially damaged data (1 bit).`},2536e3:{name:`CodecDownloadURL`,level:3,type:`s`,multiple:!0,webm:!1,description:`A URL to download about the codec used.`},3883072:{name:`CodecInfoURL`,level:3,type:`s`,multiple:!0,webm:!1,description:`A URL to find information about the codec used.`},3839639:{name:`CodecSettings`,level:3,type:`8`,webm:!1,description:`A string describing the encoding setting used.`},25506:{name:`CodecPrivate`,level:3,type:`b`,minver:1,description:`Private data only known to the codec.`},2274716:{name:`Language`,cppname:`TrackLanguage`,level:3,type:`s`,minver:1,default:`eng`,description:`Specifies the language of the track in the Matroska languages form.`},21358:{name:`Name`,cppname:`TrackName`,level:3,type:`8`,minver:1,description:`A human-readable track name.`},21998:{name:`MaxBlockAdditionID`,level:3,type:`u`,mandatory:!0,minver:1,webm:!1,default:0,description:`The maximum value of BlockAdditions for this track.`},21375:{name:`TrackOffset`,level:3,type:`i`,webm:!1,default:0,description:`A value to add to the Block\'s Timestamp. This can be used to adjust the playback offset of a track.`},2306383:{name:`TrackTimecodeScale`,level:3,type:`f`,mandatory:!0,minver:1,maxver:`3`,webm:!1,default:1,range:`> 0`,description:`DEPRECATED, DO NOT USE. The scale to apply on this track to work at normal speed in relation with other tracks (mostly used to adjust video speed when the audio length differs).`},2313850:{name:`DefaultDecodedFieldDuration`,cppname:`TrackDefaultDecodedFieldDuration`,level:3,type:`u`,minver:4,range:`not 0`,description:`The period in nanoseconds (not scaled by TimcodeScale)\nbetween two successive fields at the output of the decoding process (see the notes)`},2352003:{name:`DefaultDuration`,cppname:`TrackDefaultDuration`,level:3,type:`u`,minver:1,range:`not 0`,description:`Number of nanoseconds (not scaled via TimecodeScale) per frame (\'frame\' in the Matroska sense -- one element put into a (Simple)Block).`},28152:{name:`MaxCache`,cppname:`TrackMaxCache`,level:3,type:`u`,minver:1,webm:!1,description:`The maximum cache size required to store referenced frames in and the current frame. 0 means no cache is needed.`},28135:{name:`MinCache`,cppname:`TrackMinCache`,level:3,type:`u`,mandatory:!0,minver:1,webm:!1,default:0,description:`The minimum number of frames a player should be able to cache during playback. If set to 0, the reference pseudo-cache system is not used.`},156:{name:`FlagLacing`,cppname:`TrackFlagLacing`,level:3,type:`u`,mandatory:!0,minver:1,default:1,range:`0-1`,description:`Set if the track may contain blocks using lacing. (1 bit)`},21930:{name:`FlagForced`,cppname:`TrackFlagForced`,level:3,type:`u`,mandatory:!0,minver:1,default:0,range:`0-1`,description:`Set if that track MUST be active during playback. There can be many forced track for a kind (audio, video or subs), the player should select the one which language matches the user preference or the default + forced track. Overlay MAY happen between a forced and non-forced track of the same kind. (1 bit)`},185:{name:`FlagEnabled`,cppname:`TrackFlagEnabled`,level:3,type:`u`,mandatory:!0,minver:2,webm:!0,default:1,range:`0-1`,description:`Set if the track is usable. (1 bit)`},29637:{name:`TrackUID`,level:3,type:`u`,mandatory:!0,minver:1,range:`not 0`,description:`A unique ID to identify the Track. This should be kept the same when making a direct stream copy of the Track to another file.`},215:{name:`TrackNumber`,level:3,type:`u`,mandatory:!0,minver:1,range:`not 0`,description:`The track number as used in the Block Header (using more than 127 tracks is not encouraged, though the design allows an unlimited number).`},174:{name:`TrackEntry`,level:2,type:`m`,mandatory:!0,multiple:!0,minver:1,description:`Describes a track with all elements.`},374648427:{name:`Tracks`,level:1,type:`m`,multiple:!0,minver:1,description:`A top-level block of information with many tracks described.`},175:{name:`EncryptedBlock`,level:2,type:`b`,multiple:!0,webm:!1,description:`Similar to EncryptedBlock Structure)`},202:{name:`ReferenceTimeCode`,level:4,type:`u`,multiple:!1,mandatory:!0,minver:0,webm:!1,divx:!0,description:`DivX trick track extenstions`},201:{name:`ReferenceOffset`,level:4,type:`u`,multiple:!1,mandatory:!0,minver:0,webm:!1,divx:!0,description:`DivX trick track extenstions`},200:{name:`ReferenceFrame`,level:3,type:`m`,multiple:!1,minver:0,webm:!1,divx:!0,description:`DivX trick track extenstions`},207:{name:`SliceDuration`,level:5,type:`u`,default:0,description:`The (scaled) duration to apply to the element.`},206:{name:`Delay`,cppname:`SliceDelay`,level:5,type:`u`,default:0,description:`The (scaled) delay to apply to the element.`},203:{name:`BlockAdditionID`,cppname:`SliceBlockAddID`,level:5,type:`u`,default:0,description:`The ID of the BlockAdditional element (0 is the main Block).`},205:{name:`FrameNumber`,cppname:`SliceFrameNumber`,level:5,type:`u`,default:0,description:`The number of the frame to generate from this lace with this delay (allow you to generate many frames from the same Block/Frame).`},204:{name:`LaceNumber`,cppname:`SliceLaceNumber`,level:5,type:`u`,minver:1,default:0,divx:!1,description:`The reverse number of the frame in the lace (0 is the last frame, 1 is the next to last, etc). While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback.`},232:{name:`TimeSlice`,level:4,type:`m`,multiple:!0,minver:1,divx:!1,description:`Contains extra time information about the data contained in the Block. While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback.`},142:{name:`Slices`,level:3,type:`m`,minver:1,divx:!1,description:`Contains slices description.`},30114:{name:`DiscardPadding`,level:3,type:`i`,minver:4,webm:!0,description:`Duration in nanoseconds of the silent data added to the Block (padding at the end of the Block for positive value, at the beginning of the Block for negative value). The duration of DiscardPadding is not calculated in the duration of the TrackEntry and should be discarded during playback.`},164:{name:`CodecState`,level:3,type:`b`,minver:2,webm:!1,description:`The new codec state to use. Data interpretation is private to the codec. This information should always be referenced by a seek entry.`},253:{name:`ReferenceVirtual`,level:3,type:`i`,webm:!1,description:`Relative position of the data that should be in position of the virtual block.`},251:{name:`ReferenceBlock`,level:3,type:`i`,multiple:!0,minver:1,description:`Timestamp of another frame used as a reference (ie: B or P frame). The timestamp is relative to the block it\'s attached to.`},250:{name:`ReferencePriority`,cppname:`FlagReferenced`,level:3,type:`u`,mandatory:!0,minver:1,webm:!1,default:0,description:`This frame is referenced and has the specified cache priority. In cache only a frame of the same or higher priority can replace this frame. A value of 0 means the frame is not referenced.`},155:{name:`BlockDuration`,level:3,type:`u`,minver:1,default:`TrackDuration`,description:`The duration of the Block (based on TimecodeScale). This element is mandatory when DefaultDuration is set for the track (but can be omitted as other default values). When not written and with no DefaultDuration, the value is assumed to be the difference between the timestamp of this Block and the timestamp of the next Block in "display" order (not coding order). This element can be useful at the end of a Track (as there is not other Block available), or when there is a break in a track like for subtitle tracks. When set to 0 that means the frame is not a keyframe.`},165:{name:`BlockAdditional`,level:5,type:`b`,mandatory:!0,minver:1,webm:!1,description:`Interpreted by the codec as it wishes (using the BlockAddID).`},238:{name:`BlockAddID`,level:5,type:`u`,mandatory:!0,minver:1,webm:!1,default:1,range:`not 0`,description:`An ID to identify the BlockAdditional level.`},166:{name:`BlockMore`,level:4,type:`m`,mandatory:!0,multiple:!0,minver:1,webm:!1,description:`Contain the BlockAdditional and some parameters.`},30113:{name:`BlockAdditions`,level:3,type:`m`,minver:1,webm:!1,description:`Contain additional blocks to complete the main one. An EBML parser that has no knowledge of the Block structure could still see and use/skip these data.`},162:{name:`BlockVirtual`,level:3,type:`b`,webm:!1,description:`A Block with no data. It must be stored in the stream at the place the real Block should be in display order. (see Block Virtual)`},161:{name:`Block`,level:3,type:`b`,mandatory:!0,minver:1,description:`Block containing the actual data to be rendered and a timestamp relative to the Cluster Timecode. (see Block Structure)`},160:{name:`BlockGroup`,level:2,type:`m`,multiple:!0,minver:1,description:`Basic container of information containing a single Block or BlockVirtual, and information specific to that Block/VirtualBlock.`},163:{name:`SimpleBlock`,level:2,type:`b`,multiple:!0,minver:2,webm:!0,divx:!0,description:`Similar to SimpleBlock Structure`},171:{name:`PrevSize`,cppname:`ClusterPrevSize`,level:2,type:`u`,minver:1,description:`Size of the previous Cluster, in octets. Can be useful for backward playing.`,position:`prevCluster`},167:{name:`Position`,cppname:`ClusterPosition`,level:2,type:`u`,minver:1,webm:!1,description:`The Position of the Cluster in the segment (0 in live broadcast streams). It might help to resynchronise offset on damaged streams.`,position:`segment`},22743:{name:`SilentTrackNumber`,cppname:`ClusterSilentTrackNumber`,level:3,type:`u`,multiple:!0,minver:1,webm:!1,description:`One of the track number that are not used from now on in the stream. It could change later if not specified as silent in a further Cluster.`},231:{name:`Timecode`,cppname:`ClusterTimecode`,level:2,type:`u`,mandatory:!0,minver:1,description:`Absolute timestamp of the cluster (based on TimecodeScale).`},524531317:{name:`Cluster`,level:1,type:`m`,multiple:!0,minver:1,description:`The lower level element containing the (monolithic) Block structure.`},19840:{name:`MuxingApp`,level:2,type:`8`,mandatory:!0,minver:1,description:`Muxing application or library ("libmatroska-0.4.3").`},31657:{name:`Title`,level:2,type:`8`,minver:1,webm:!1,description:`General name of the segment.`},2807730:{name:`TimecodeScaleDenominator`,level:2,type:`u`,mandatory:!0,minver:4,default:`1000000000`,description:`Timestamp scale numerator, see TimecodeScale.`},2807729:{name:`TimecodeScale`,level:2,type:`u`,mandatory:!0,minver:1,default:`1000000`,description:`Timestamp scale in nanoseconds (1.000.000 means all timestamps in the segment are expressed in milliseconds).`},27045:{name:`ChapterTranslateID`,level:3,type:`b`,mandatory:!0,minver:1,webm:!1,description:`The binary value used to represent this segment in the chapter codec data. The format depends on the ChapProcessCodecID used.`},27071:{name:`ChapterTranslateCodec`,level:3,type:`u`,mandatory:!0,minver:1,webm:!1,description:`The chapter codec using this ID (0: Matroska Script, 1: DVD-menu).`},27132:{name:`ChapterTranslateEditionUID`,level:3,type:`u`,multiple:!0,minver:1,webm:!1,description:`Specify an edition UID on which this correspondance applies. When not specified, it means for all editions found in the segment.`},4096955:{name:`NextFilename`,level:2,type:`8`,minver:1,webm:!1,description:`An escaped filename corresponding to the next segment.`},4110627:{name:`NextUID`,level:2,type:`b`,minver:1,webm:!1,bytesize:16,description:`A unique ID to identify the next chained segment (128 bits).`},3965867:{name:`PrevFilename`,level:2,type:`8`,minver:1,webm:!1,description:`An escaped filename corresponding to the previous segment.`},3979555:{name:`PrevUID`,level:2,type:`b`,minver:1,webm:!1,bytesize:16,description:`A unique ID to identify the previous chained segment (128 bits).`},29604:{name:`SegmentUID`,level:2,type:`b`,minver:1,webm:!1,range:`not 0`,bytesize:16,description:`A randomly generated unique ID to identify the current segment between many others (128 bits).`},357149030:{name:`Info`,level:1,type:`m`,mandatory:!0,multiple:!0,minver:1,description:`Contains miscellaneous general information and statistics on the file.`},21420:{name:`SeekPosition`,level:3,type:`u`,mandatory:!0,minver:1,description:`The position of the element in the segment in octets (0 = first level 1 element).`,position:`segment`},21419:{name:`SeekID`,level:3,type:`b`,mandatory:!0,minver:1,description:`The binary ID corresponding to the element name.`,type2:`ebmlID`},19899:{name:`Seek`,cppname:`SeekPoint`,level:2,type:`m`,mandatory:!0,multiple:!0,minver:1,description:`Contains a single seek entry to an EBML element.`},290298740:{name:`SeekHead`,cppname:`SeekHeader`,level:1,type:`m`,multiple:!0,minver:1,description:`Contains the position of other level 1 elements.`},32379:{name:`SignatureElementList`,level:2,type:`m`,multiple:!0,webm:!1,i:`Cluster|Block|BlockAdditional`,description:`A list consists of a number of consecutive elements that represent one case where data is used in signature. Ex: means that the BlockAdditional of all Blocks in all Clusters is used for encryption.`},32347:{name:`SignatureElements`,level:1,type:`m`,webm:!1,description:`Contains elements that will be used to compute the signature.`},32437:{name:`Signature`,level:1,type:`b`,webm:!1,description:`The signature of the data (until a new.`},32421:{name:`SignaturePublicKey`,level:1,type:`b`,webm:!1,description:`The public key to use with the algorithm (in the case of a PKI-based signature).`},32410:{name:`SignatureHash`,level:1,type:`u`,webm:!1,description:`Hash algorithm used (1=SHA1-160, 2=MD5).`},32394:{name:`SignatureAlgo`,level:1,type:`u`,webm:!1,description:`Signature algorithm used (1=RSA, 2=elliptic).`},458458727:{name:`SignatureSlot`,level:-1,type:`m`,multiple:!0,webm:!1,description:`Contain signature of some (coming) elements in the stream.`},191:{name:`CRC-32`,level:-1,type:`b`,minver:1,webm:!1,description:`The CRC is computed on all the data of the Master element it\'s in. The CRC element should be the first in it\'s parent master for easier reading. All level 1 elements should include a CRC-32. The CRC in use is the IEEE CRC32 Little Endian`,crc:!0},236:{name:`Void`,level:-1,type:`b`,minver:1,description:`Used to void damaged data, to avoid unexpected behaviors when using damaged data. The content is discarded. Also used to reserve space in a sub-element for later use.`},17139:{name:`EBMLMaxSizeLength`,level:1,type:`u`,mandatory:!0,default:8,minver:1,description:`The maximum length of the sizes you\'ll find in this file (8 or less in Matroska). This does not override the element size indicated at the beginning of an element. Elements that have an indicated size which is larger than what is allowed by EBMLMaxSizeLength shall be considered invalid.`},17138:{name:`EBMLMaxIDLength`,level:1,type:`u`,mandatory:!0,default:4,minver:1,description:`The maximum length of the IDs you\'ll find in this file (4 or less in Matroska).`},17143:{name:`EBMLReadVersion`,level:1,type:`u`,mandatory:!0,default:1,minver:1,description:`The minimum EBML version a parser has to support to read this file.`},440786851:{name:`EBML`,level:`0`,type:`m`,mandatory:!0,multiple:!0,minver:1,description:`Set the EBML characteristics of the data to follow. Each EBML document has to start with this.`},21936:{name:`Colour`,level:`4`,type:`m`,mandatory:!0,multiple:!0,description:`Settings describing the colour format.`},21937:{name:`MatrixCoefficients`,level:`5`,type:`u`,mandatory:!0,multiple:!0,description:`The Matrix Coefficients of the video used to derive luma and chroma values from red, green, and blue color primaries. For clarity, the value and meanings for MatrixCoefficients are adopted from Table 4 of ISO/IEC 23001-8:2016 or ITU-T H.273.`},21945:{name:`Range`,level:`5`,type:`u`,mandatory:!0,multiple:!0,description:`Clipping of the color ranges.`},21946:{name:`TransferCharacteristics`,level:`5`,type:`u`,mandatory:!0,multiple:!0,description:`The transfer characteristics of the video.`},21947:{name:`Primaries`,level:`5`,type:`u`,mandatory:!0,multiple:!0,description:`The colour primaries of the video. For clarity, the value and meanings for Primaries are adopted from Table 2 of ISO/IEC 23091-4 or ITU-T H.273.`}}})),f=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=b(),n=b(),r=d();e.default=function(){function e(){this._schema=r.byEbmlID,this._buffers=[],this._stack=[]}return e.prototype.encode=function(e){var n=this;return t.concat(e.reduce(function(e,t){return e.concat(n.encodeChunk(t))},[])).buffer},e.prototype.encodeChunk=function(e){return e.type===`m`?e.isEnd?this.endTag(e):this.startTag(e):(e.data=n.Buffer.from(e.data),this.writeTag(e)),this.flush()},e.prototype.flush=function(){var e=this._buffers;return this._buffers=[],e},e.prototype.getSchemaInfo=function(e){for(var t=Object.keys(this._schema).map(Number),r=0;r<t.length;r++){var i=t[r];if(this._schema[i].name===e)return new n.Buffer(i.toString(16),`hex`)}return null},e.prototype.writeTag=function(e){var n=e.name,r=this.getSchemaInfo(n),i=e.data;if(r==null)throw Error(`No schema entry found for `+n);var a=t.encodeTag(r,i);if(this._stack.length>0){this._stack[this._stack.length-1].children.push({tagId:r,elm:e,children:[],data:a});return}this._buffers=this._buffers.concat(a)},e.prototype.startTag=function(e){var r=e.name,i=this.getSchemaInfo(r);if(i==null)throw Error(`No schema entry found for `+r);if(e.unknownSize){var a=t.encodeTag(i,new n.Buffer(0),e.unknownSize);this._buffers=this._buffers.concat(a);return}var o={tagId:i,elm:e,children:[],data:null};this._stack.length>0&&this._stack[this._stack.length-1].children.push(o),this._stack.push(o)},e.prototype.endTag=function(e){e.name;var n=this._stack.pop();if(n==null||n.elm.name!==e.name)throw Error(`EBML structure is broken`);var r=n.children.reduce(function(e,t){if(t.data===null)throw Error(`EBML structure is broken`);return e.concat(t.data)},[]),i=t.concat(r);n.elm.type===`m`?n.data=t.encodeTag(n.tagId,i,n.elm.unknownSize):n.data=t.encodeTag(n.tagId,i),this._stack.length<1&&(this._buffers=this._buffers.concat(n.data))},e}()})),p=o((e=>{e.byteLength=c,e.toByteArray=u,e.fromByteArray=p;for(var t=[],n=[],r=typeof Uint8Array<`u`?Uint8Array:Array,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,a=0,o=i.length;a<o;++a)t[a]=i[a],n[i.charCodeAt(a)]=a;n[45]=62,n[95]=63;function s(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function u(e){var t,i=s(e),a=i[0],o=i[1],c=new r(l(e,a,o)),u=0,d=o>0?a-4:a,f;for(f=0;f<d;f+=4)t=n[e.charCodeAt(f)]<<18|n[e.charCodeAt(f+1)]<<12|n[e.charCodeAt(f+2)]<<6|n[e.charCodeAt(f+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=t&255;return o===2&&(t=n[e.charCodeAt(f)]<<2|n[e.charCodeAt(f+1)]>>4,c[u++]=t&255),o===1&&(t=n[e.charCodeAt(f)]<<10|n[e.charCodeAt(f+1)]<<4|n[e.charCodeAt(f+2)]>>2,c[u++]=t>>8&255,c[u++]=t&255),c}function d(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function f(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(d(r));return i.join(``)}function p(e){for(var n,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;s<c;s+=o)a.push(f(e,s,s+o>c?c:s+o));return i===1?(n=e[r-1],a.push(t[n>>2]+t[n<<4&63]+`==`)):i===2&&(n=(e[r-2]<<8)+e[r-1],a.push(t[n>>10]+t[n>>4&63]+t[n<<2&63]+`=`)),a.join(``)}})),m=o((e=>{e.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else if(a===c)return o?NaN:(p?-1:1)*(1/0);else o+=2**r,a-=l;return(p?-1:1)*o*2**(a-r)},e.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}})),h=o((e=>{let t=p(),n=m(),r=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=s,e.SlowBuffer=b,e.INSPECT_MAX_BYTES=50;let i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,`parent`,{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,`offset`,{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(e){if(e>i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return d(e)}return c(e,t,n)}s.poolSize=8192;function c(e,t,n){if(typeof e==`string`)return f(e,t);if(ArrayBuffer.isView(e))return g(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return _(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return s.from(r,t,n);let i=v(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return s.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}s.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function u(e,t,n){return l(e),e<=0||t===void 0?o(e):typeof n==`string`?o(e).fill(t,n):o(e).fill(t)}s.alloc=function(e,t,n){return u(e,t,n)};function d(e){return l(e),o(e<0?0:y(e)|0)}s.allocUnsafe=function(e){return d(e)},s.allocUnsafeSlow=function(e){return d(e)};function f(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!s.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=x(e,t)|0,r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function h(e){let t=e.length<0?0:y(e.length)|0,n=o(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function g(e){if(Z(e,Uint8Array)){let t=new Uint8Array(e);return _(t.buffer,t.byteOffset,t.byteLength)}return h(e)}function _(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,s.prototype),r}function v(e){if(s.isBuffer(e)){let t=y(e.length)|0,n=o(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||Q(e.length)?o(0):h(e);if(e.type===`Buffer`&&Array.isArray(e.data))return h(e.data)}function y(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function b(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(Z(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),Z(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return s.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(Z(t,Uint8Array))i+t.length>r.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else if(s.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function x(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return Y(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return ce(e).length;default:if(i)return r?-1:Y(e).length;t=(``+t).toLowerCase(),i=!0}}s.byteLength=x;function S(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return F(this,t,n);case`utf8`:case`utf-8`:return M(this,t,n);case`ascii`:return te(this,t,n);case`latin1`:case`binary`:return P(this,t,n);case`base64`:return j(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return I(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function C(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}s.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)C(this,t,t+1);return this},s.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)C(this,t,t+3),C(this,t+1,t+2);return this},s.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)C(this,t,t+7),C(this,t+1,t+6),C(this,t+2,t+5),C(this,t+3,t+4);return this},s.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?M(this,0,e):S.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e?!0:s.compare(this,e)===0},s.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(e,t,n,r,i){if(Z(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let a=i-r,o=n-t,c=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<c;++e)if(l[e]!==u[e]){a=l[e],o=u[e];break}return a<o?-1:o<a?1:0};function w(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,Q(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t==`string`&&(t=s.from(t,r)),s.isBuffer(t))return t.length===0?-1:T(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):T(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function T(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}s.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},s.prototype.indexOf=function(e,t,n){return w(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return w(this,e,t,n,!1)};function E(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o;for(o=0;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(Q(r))return o;e[n+o]=r}return o}function D(e,t,n,r){return X(Y(t,e.length-n),e,n,r)}function O(e,t,n,r){return X(oe(t),e,n,r)}function k(e,t,n,r){return X(ce(t),e,n,r)}function A(e,t,n,r){return X(se(t,e.length-n),e,n,r)}s.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return E(this,e,t,n);case`utf8`:case`utf-8`:return D(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return O(this,e,t,n);case`base64`:return k(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return A(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function j(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function M(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return ee(r)}let N=4096;function ee(e){let t=e.length;if(t<=N)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=N));return n}function te(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function P(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function F(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=le[e[r]];return i}function I(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}s.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,s.prototype),r};function L(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=$(function(e){e>>>=0,q(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&J(e,this.length-8);let r=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),s.prototype.readBigUInt64BE=$(function(e){e>>>=0,q(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&J(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||L(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||L(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=$(function(e){e>>>=0,q(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&J(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),s.prototype.readBigInt64BE=$(function(e){e>>>=0,q(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&J(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||L(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||L(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||L(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||L(e,8,this.length),n.read(this,e,!1,52,8)};function R(e,t,n,r,i,a){if(!s.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;R(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;R(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function ne(e,t,n,r,i){K(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function z(e,t,n,r,i){K(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}s.prototype.writeBigUInt64LE=$(function(e,t=0){return ne(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeBigUInt64BE=$(function(e,t=0){return z(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);R(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);R(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeBigInt64LE=$(function(e,t=0){return ne(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),s.prototype.writeBigInt64BE=$(function(e,t=0){return z(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function B(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function V(e,t,r,i,a){return t=+t,r>>>=0,a||B(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}s.prototype.writeFloatLE=function(e,t,n){return V(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return V(this,e,t,!1,n)};function H(e,t,r,i,a){return t=+t,r>>>=0,a||B(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}s.prototype.writeDoubleLE=function(e,t,n){return H(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return H(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},s.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!s.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=s.isBuffer(e)?e:s.from(e,r),o=a.length;if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};let U={};function W(e,t,n){U[e]=class extends n{constructor(){super(),Object.defineProperty(this,`message`,{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,`code`,{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}W(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),W(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),W(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=G(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=G(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function G(e){let t=``,n=e.length,r=e[0]===`-`?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function re(e,t,n){q(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&J(t,e.length-(n+1))}function K(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new U.ERR_OUT_OF_RANGE(`value`,i,e)}re(r,i,a)}function q(e,t){if(typeof e!=`number`)throw new U.ERR_INVALID_ARG_TYPE(t,`number`,e)}function J(e,t,n){throw Math.floor(e)===e?t<0?new U.ERR_BUFFER_OUT_OF_BOUNDS:new U.ERR_OUT_OF_RANGE(n||`offset`,`>= ${n?1:0} and <= ${t}`,e):(q(e,n),new U.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}let ie=/[^+/0-9A-Za-z-_]/g;function ae(e){if(e=e.split(`=`)[0],e=e.trim().replace(ie,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function Y(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function oe(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function se(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function ce(e){return t.toByteArray(ae(e))}function X(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Z(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Q(e){return e!==e}let le=(function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t})();function $(e){return typeof BigInt>`u`?ue:e}function ue(){throw Error(`BigInt not supported`)}})),g=o((e=>{var t=e&&e.__assign||function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)},n=e&&e.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(e,`__esModule`,{value:!0});var r=b();e.default=function(){function e(){}return e.readVint=function(t,n){n===void 0&&(n=0);var r=8-Math.floor(Math.log2(t[n]));if(r>8){var i=e.readHexString(t,n,n+r);throw Error(`Unrepresentable length: ${r} ${i}`)}if(n+r>t.length)return null;for(var a=t[n]&(1<<8-r)-1,o=1;o<r;o+=1){if(o===7&&a>=2**8&&t[n+7]>0)return{length:r,value:-1};a*=2**8,a+=t[n+o]}return{length:r,value:a}},e.writeVint=function(e){if(e<0||e>2**53)throw Error(`Unrepresentable value: ${e}`);var t=1;for(t=1;t<=8&&!(e<2**(7*t)-1);t+=1);for(var n=r.Buffer.alloc(t),i=e,a=1;a<=t;a+=1){var o=i&255;n[t-a]=o,i-=o,i/=2**8}return n[0]|=1<<8-t,n},e.concatenate=function(e,t){return!e&&!t?r.Buffer.from([]):!e||e.byteLength===0?t:!t||t.byteLength===0?e:r.Buffer.from(n(n([],e,!0),t,!0))},e.readHexString=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=e.byteLength),Array.from(e.slice(t,n)).map(function(e){return Number(e).toString(16)}).reduce(function(e,t){return`${e}${t.padStart(2,`0`)}`},``)},e.readUtf8=function(e){try{return r.Buffer.from(e).toString(`utf8`)}catch{return null}},e.readUnsigned=function(t){var n=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 1:return n.getUint8(0);case 2:return n.getUint16(0);case 4:return n.getUint32(0);default:break}return t.byteLength<=6?t.reduce(function(e,t){return e*256+t},0):e.readHexString(t,0,t.byteLength)},e.readSigned=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 1:return t.getInt8(0);case 2:return t.getInt16(0);case 4:return t.getInt32(0);default:return NaN}},e.readFloat=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return t.getFloat32(0);case 8:return t.getFloat64(0);default:return NaN}},e.readDate=function(t){var n=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 1:return new Date(n.getUint8(0));case 2:return new Date(n.getUint16(0));case 4:return new Date(n.getUint32(0));case 8:return new Date(Number.parseInt(e.readHexString(t),16));default:return new Date(0)}},e.readDataFromTag=function(n,r){var i=n.type,a=n.name,o=n.track,s=n.discardable||!1,c=n.keyframe||!1,l=null,u;switch(i){case`u`:u=e.readUnsigned(r);break;case`f`:u=e.readFloat(r);break;case`i`:u=e.readSigned(r);break;case`s`:u=String.fromCharCode.apply(String,r);break;case`8`:u=e.readUtf8(r);break;case`d`:u=e.readDate(r);break;default:break}if(a===`SimpleBlock`||a===`Block`){var d=0,f=e.readVint(r,d),p=f.length,m=f.value;d+=p,o=m,u=e.readSigned(r.subarray(d,d+2)),d+=2,a===`SimpleBlock`&&(c=!!(r[p+2]&128),s=!!(r[p+2]&1)),d+=1,l=r.subarray(d)}return t(t({},n),{data:r,discardable:s,keyframe:c,payload:l,track:o,value:u})},e}()})),_=o(((e,t)=>{t.exports=function(e,t,n){t||=0;for(var r=1;r<=8&&!(e[t]>=2**(8-r));r++);if(r>8)throw Error(`Unrepresentable length: `+r+` `+e.toString(`hex`,t,t+r));if(t+r>e.length)return null;var i,a=e[t]&(1<<8-r)-1;for(i=1;i<r;i++){if(i===7&&a>=2**45&&e[t+7]>0)return{length:r,value:-1};a*=2**8,a+=e[t+i]}return n&&(a-=2**(r*7-1)-1),{length:r,value:a}}})),v=o(((e,t)=>{var n=_();function r(e){this.buffer=e,this.offset=0}r.prototype.nextInt16BE=function(){var e=this.buffer.readInt16BE(this.offset);return this.offset+=2,e},r.prototype.nextUInt8=function(){var e=this.buffer.readUInt8(this.offset);return this.offset+=1,e},r.prototype.nextUIntV=function(){var e=n(this.buffer,this.offset);return this.offset+=e.length,e.value},r.prototype.nextIntV=function(){var e=n(this.buffer,this.offset,!0);return this.offset+=e.length,e.value},r.prototype.nextBuffer=function(e){var t=e?this.buffer.slice(this.offset,this.offset+e):this.buffer.slice(this.offset);return this.offset+=e||this.length,t},Object.defineProperty(r.prototype,`length`,{get:function(){return this.buffer.length-this.offset}}),t.exports=r})),y=o(((e,t)=>{var n=v(),r=1,i=3,a=2;t.exports=function(e){var t={},r=new n(e);t.trackNumber=r.nextUIntV(),t.timecode=r.nextInt16BE();var i=r.nextUInt8();return t.invisible=!!(i&8),t.keyframe=!!(i&128),t.discardable=!!(i&1),t.frames=o(r,(i&6)>>1),t};function o(e,t){if(!t)return[e.nextBuffer()];var n,o,s=[],c=e.nextUInt8()+1;if(t===a){if(e.length%c!==0)throw Error(`Fixed-Size Lacing Error`);for(o=e.length/c,n=0;n<c;n++)s.push(e.nextBuffer(o));return s}var l=[];if(t===r)for(n=0;n<c-1;n++){var u;o=0;do u=e.nextUInt8(),o+=u;while(u===255);l.push(o)}else if(t===i)for(o=e.nextUIntV(),l.push(o),n=1;n<c-1;n++)o+=e.nextIntV(),l.push(o);for(n=0;n<c-1;n++)s.push(e.nextBuffer(l[n]));return s.push(e.nextBuffer()),s}})),b=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.convertEBMLDateToJSDate=e.createFloatBuffer=e.createIntBuffer=e.createUIntBuffer=e.encodeValueToBuffer=e.concat=e.putRefinedMetaData=e.extractElement=e.removeElement=e.makeMetadataSeekable=e.createRIFFChunk=e.VP8BitStreamToRiffWebPBuffer=e.WebPBlockFilter=e.encodeTag=e.readBlock=e.ebmlBlock=e.writeVint=e.readVint=e.Buffer=void 0;var t=u(),n=f(),r=h(),i=g(),a=y();e.Buffer=r.Buffer,e.readVint=i.default.readVint,e.writeVint=i.default.writeVint,e.ebmlBlock=a;function o(t){return(0,e.ebmlBlock)(new e.Buffer(t))}e.readBlock=o;function s(t,n,r){return r===void 0&&(r=!1),T([t,r?new e.Buffer(`01ffffffffffffff`,`hex`):(0,e.writeVint)(n.length),n])}e.encodeTag=s;function c(t){return t.reduce(function(t,n){return n.type!==`b`||n.name!==`SimpleBlock`||!(0,e.ebmlBlock)(n.data).frames.some(function(e){return e.slice(3,6).toString(`hex`)===`9d012a`})?t:t.concat(n)},[])}e.WebPBlockFilter=c;function l(t){var n=d(`VP8 `,t);return d(`RIFF`,T([new e.Buffer(`WEBP`,`ascii`),n]))}e.VP8BitStreamToRiffWebPBuffer=l;function d(t,n){var r=new e.Buffer(4);return r.writeUInt32LE(n.byteLength,0),T([new e.Buffer(t.substr(0,4),`ascii`),r,n,new e.Buffer(n.byteLength%2==0?0:1)])}e.createRIFFChunk=d;function p(t,r,i){var a=_(`EBML`,t),o=b(a)+12,s=t[t.length-1].dataEnd-o,c=_(`Info`,t);m(`Duration`,c),c.splice(1,0,{name:`Duration`,type:`f`,data:k(r,8)});for(var l=b(c),u=_(`Tracks`,t),d=b(u),f=47,p=[],h=5+i.length*15,g=[],v=-1,y=10,x=function(t){var n=f,r=n+l,a=r+d,c=a+h-s;if(p=[],p.push({name:`SeekHead`,type:`m`,isEnd:!1}),p.push({name:`Seek`,type:`m`,isEnd:!1}),p.push({name:`SeekID`,type:`b`,data:new e.Buffer([21,73,169,102])}),p.push({name:`SeekPosition`,type:`u`,data:D(n)}),p.push({name:`Seek`,type:`m`,isEnd:!0}),p.push({name:`Seek`,type:`m`,isEnd:!1}),p.push({name:`SeekID`,type:`b`,data:new e.Buffer([22,84,174,107])}),p.push({name:`SeekPosition`,type:`u`,data:D(r)}),p.push({name:`Seek`,type:`m`,isEnd:!0}),p.push({name:`Seek`,type:`m`,isEnd:!1}),p.push({name:`SeekID`,type:`b`,data:new e.Buffer([28,83,187,107])}),p.push({name:`SeekPosition`,type:`u`,data:D(a)}),p.push({name:`Seek`,type:`m`,isEnd:!0}),p.push({name:`SeekHead`,type:`m`,isEnd:!0}),f=b(p),g=[],g.push({name:`Cues`,type:`m`,isEnd:!1}),i.forEach(function(e){var t=e.CueTrack,n=e.CueClusterPosition,r=e.CueTime;g.push({name:`CuePoint`,type:`m`,isEnd:!1}),g.push({name:`CueTime`,type:`u`,data:D(r)}),g.push({name:`CueTrackPositions`,type:`m`,isEnd:!1}),g.push({name:`CueTrack`,type:`u`,data:D(t)}),n-=o,n+=c,g.push({name:`CueClusterPosition`,type:`u`,data:D(n)}),g.push({name:`CueTrackPositions`,type:`m`,isEnd:!0}),g.push({name:`CuePoint`,type:`m`,isEnd:!0})}),g.push({name:`Cues`,type:`m`,isEnd:!0}),h=b(g),v!==c){if(v=c,t===y-1)throw Error(`Failed to converge to a stable metadata size`)}else return`break`},S=0;S<y&&x(S)!==`break`;S++);var C=[].concat.apply([],[a,{name:`Segment`,type:`m`,isEnd:!1,unknownSize:!0},p,c,u,g]);return new n.default().encode(C)}e.makeMetadataSeekable=p;function m(e,t){for(var n=-1,r=0;r<t.length;r++){var i=t[r];if(i.name===e)if(i.type===`m`)if(!i.isEnd)n=r;else{if(n==-1)throw Error(`Detected ${e} closing element before finding the start`);t.splice(n,r-n+1);return}else{t.splice(r,1);return}}}e.removeElement=m;function _(e,t){for(var n=[],r=-1,i=0;i<t.length;i++){var a=t[i];if(a.name===e)if(a.type===`m`)if(!a.isEnd)r=i;else{if(r==-1)throw Error(`Detected ${e} closing element before finding the start`);n=t.slice(r,i+1);break}else{n.push(t[i]);break}}return n}e.extractElement=_;function v(t,r){Array.isArray(r.cueInfos)&&!Array.isArray(r.cues)&&(console.warn(`putRefinedMetaData: info.cueInfos property is deprecated. please use info.cues`),r.cues=r.cueInfos);for(var i=[],a=[],o=0;o<t.length;o++){var s=t[o];if(s.type===`m`&&s.name===`Segment`){if(i=t.slice(0,o),a=t.slice(o),s.unknownSize){a.shift();break}throw Error(`this metadata is not streaming webm file`)}}if(!(a[a.length-1].dataEnd>0))throw Error(`metadata dataEnd has wrong number`);var c=a[a.length-1].dataEnd,l=i[i.length-1].dataEnd,u=new n.default().encode(i).byteLength-l,d=c-a[0].tagStart;a[0].tagStart-l,a[0].tagStart;var f=new e.Buffer([24,83,128,103]),p=new e.Buffer(`01ffffffffffffff`,`hex`),m=f.byteLength+p.byteLength,h=d,g;for(g=1;g<20;g++){var _=u+(l+m+h-c),v=x(a,_,r),y=new n.default().encode(v).byteLength;if(y===h)return new n.default().encode([].concat(i,[{type:`m`,name:`Segment`,isEnd:!1,unknownSize:!0}],v));h=y}throw Error(`unable to refine metadata, stable size could not be found in `+g+` iterations!`)}e.putRefinedMetaData=v;function b(e){var t=new n.default;return e.reduce(function(e,n){return e.concat(t.encode([n]))},[]).reduce(function(e,t){return e+t.byteLength},0)}function x(e,t,n){var r=n.duration,i=n.clusterPtrs,a=n.cues,o=e.slice(0);if(typeof r==`number`){var s=!1;o.forEach(function(e){e.type===`f`&&e.name===`Duration`&&(s=!0,e.data=k(r,8))}),s||w(o,`Info`,[{name:`Duration`,type:`f`,data:k(r,8)}])}Array.isArray(a)&&w(o,`Cues`,C(a,t));var c=[];return Array.isArray(i)&&(console.warn(`append cluster pointers to seekhead is deprecated. please use cues`),c=S(i,t)),w(o,`SeekHead`,c,!0),o}function S(t,n){var r=[];return t.forEach(function(t){r.push({name:`Seek`,type:`m`,isEnd:!1}),r.push({name:`SeekID`,type:`b`,data:new e.Buffer([31,67,182,117])}),r.push({name:`SeekPosition`,type:`u`,data:D(t+n)}),r.push({name:`Seek`,type:`m`,isEnd:!0})}),r}function C(e,t){var n=[];return e.forEach(function(e){var r=e.CueTrack,i=e.CueClusterPosition,a=e.CueTime;n.push({name:`CuePoint`,type:`m`,isEnd:!1}),n.push({name:`CueTime`,type:`u`,data:D(a)}),n.push({name:`CueTrackPositions`,type:`m`,isEnd:!1}),n.push({name:`CueTrack`,type:`u`,data:D(r)}),n.push({name:`CueClusterPosition`,type:`u`,data:D(i+t)}),n.push({name:`CueTrackPositions`,type:`m`,isEnd:!0}),n.push({name:`CuePoint`,type:`m`,isEnd:!0})}),n}function w(e,t,n,r){r===void 0&&(r=!1);for(var i=-1,a=0;a<e.length;a++){var o=e[a];if(o.type===`m`&&o.name===t&&o.isEnd===!1){i=a;break}}i>=0?Array.prototype.splice.apply(e,[i+1,0].concat(n)):r?[{name:t,type:`m`,isEnd:!1}].concat(n,[{name:t,type:`m`,isEnd:!0}]).reverse().forEach(function(t){e.unshift(t)}):(e.push({name:t,type:`m`,isEnd:!1}),n.forEach(function(t){e.push(t)}),e.push({name:t,type:`m`,isEnd:!0}))}function T(t){return e.Buffer.concat(t)}e.concat=T;function E(n){var r=new e.Buffer(0);if(n.type===`m`)return n;switch(n.type){case`u`:r=D(n.value);break;case`i`:r=O(n.value);break;case`f`:r=k(n.value);break;case`s`:r=new e.Buffer(n.value,`ascii`);break;case`8`:r=new e.Buffer(n.value,`utf8`);break;case`b`:r=n.value;break;case`d`:r=new t.Int64BE(n.value.getTime().toString()).toBuffer();break}return Object.assign({},n,{data:r})}e.encodeValueToBuffer=E;function D(n){for(var r=1;n>=2**(8*r);r++);if(r>=7)return console.warn(`7bit or more bigger uint not supported.`),new t.Uint64BE(n).toBuffer();var i=new e.Buffer(r);return i.writeUIntBE(n,0,r),i}e.createUIntBuffer=D;function O(n){for(var r=1;n>=2**(8*r);r++);if(r>=7)return console.warn(`7bit or more bigger uint not supported.`),new t.Int64BE(n).toBuffer();var i=new e.Buffer(r);return i.writeIntBE(n,0,r),i}e.createIntBuffer=O;function k(t,n){if(n===void 0&&(n=8),n===8){var r=new e.Buffer(8);return r.writeDoubleBE(t,0),r}else if(n===4){var r=new e.Buffer(4);return r.writeFloatBE(t,0),r}else throw Error(`float type bits must 4bytes or 8bytes`)}e.createFloatBuffer=k;function A(e){return e instanceof Date?e:new Date(new Date(`2001-01-01T00:00:00.000Z`).getTime()+Number(e)/1e3/1e3)}e.convertEBMLDateToJSDate=A})),x=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=u(),n=b(),r=b(),i=d(),a;(function(e){e[e.STATE_TAG=1]=`STATE_TAG`,e[e.STATE_SIZE=2]=`STATE_SIZE`,e[e.STATE_CONTENT=3]=`STATE_CONTENT`})(a||={}),e.default=function(){function e(){this._buffer=new n.Buffer(0),this._tag_stack=[],this._state=a.STATE_TAG,this._cursor=0,this._total=0,this._schema=i.byEbmlID,this._result=[]}return e.prototype.decode=function(e){this.readChunk(e);var t=this._result;return this._result=[],t},e.prototype.readChunk=function(e){for(this._buffer=r.concat([this._buffer,new n.Buffer(e)]);this._cursor<this._buffer.length&&!(this._state===a.STATE_TAG&&!this.readTag()||this._state===a.STATE_SIZE&&!this.readSize()||this._state===a.STATE_CONTENT&&!this.readContent()););},e.prototype.getSchemaInfo=function(e){return this._schema[e]||{name:`unknown`,level:-1,type:`unknown`,description:`unknown`}},e.prototype.readTag=function(){if(this._cursor>=this._buffer.length)return!1;var e=(0,n.readVint)(this._buffer,this._cursor);if(e==null)return!1;var t=this._buffer.slice(this._cursor,this._cursor+e.length).reduce(function(e,t,n,r){return e+t*16**(2*(r.length-1-n))},0),r=this.getSchemaInfo(t),i={EBML_ID:t.toString(16),schema:r,type:r.type,name:r.name,level:r.level,tagStart:this._total,tagEnd:this._total+e.length,sizeStart:this._total+e.length,sizeEnd:null,dataStart:null,dataEnd:null,dataSize:null,data:null};return this._tag_stack.push(i),this._cursor+=e.length,this._total+=e.length,this._state=a.STATE_SIZE,!0},e.prototype.readSize=function(){if(this._cursor>=this._buffer.length)return!1;var e=(0,n.readVint)(this._buffer,this._cursor);if(e==null)return!1;var t=this._tag_stack[this._tag_stack.length-1];return t.sizeEnd=t.sizeStart+e.length,t.dataStart=t.sizeEnd,t.dataSize=e.value,e.value===-1?(t.dataEnd=-1,t.type===`m`&&(t.unknownSize=!0)):t.dataEnd=t.sizeEnd+e.value,this._cursor+=e.length,this._total+=e.length,this._state=a.STATE_CONTENT,!0},e.prototype.readContent=function(){var e=this._tag_stack[this._tag_stack.length-1];if(e.type===`m`){if(e.isEnd=!1,this._result.push(e),this._state=a.STATE_TAG,e.dataSize===0){var r=Object.assign({},e,{isEnd:!0});this._result.push(r),this._tag_stack.pop()}return!0}if(this._buffer.length<this._cursor+e.dataSize)return!1;var i=this._buffer.slice(this._cursor,this._cursor+e.dataSize);switch(this._buffer=this._buffer.slice(this._cursor+e.dataSize),e.data=i,e.type){case`u`:e.value=i.readUIntBE(0,i.length);break;case`i`:e.value=i.readIntBE(0,i.length);break;case`f`:e.value=e.dataSize===4?i.readFloatBE(0):e.dataSize===8?i.readDoubleBE(0):(console.warn(`cannot read ${e.dataSize} octets float. failback to 0`),0);break;case`s`:e.value=i.toString(`ascii`);break;case`8`:e.value=i.toString(`utf8`);break;case`b`:e.value=i;break;case`d`:e.value=(0,n.convertEBMLDateToJSDate)(new t.Int64BE(i).toNumber());break}if(e.value===null)throw Error(`unknown tag type:`+e.type);for(this._result.push(e),this._total+=e.dataSize,this._state=a.STATE_TAG,this._cursor=0,this._tag_stack.pop();this._tag_stack.length>0;){var o=this._tag_stack[this._tag_stack.length-1];if(o.dataEnd<0)return this._tag_stack.pop(),!0;if(this._total<o.dataEnd)break;if(o.type!==`m`)throw Error(`parent element is not master element`);var r=Object.assign({},o,{isEnd:!0});this._result.push(r),this._tag_stack.pop()}return!0},e}()})),S=o(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,`defaultMaxListeners`,{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}})),C=o((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0});var n=S(),r=b();e.default=function(e){t(n,e);function n(){var t=e.call(this)||this;return t.logGroup=``,t.hasLoggingStarted=!1,t.metadataloaded=!1,t.chunks=[],t.stack=[],t.segmentOffset=0,t.last2SimpleBlockVideoTrackTimecode=[0,0],t.last2SimpleBlockAudioTrackTimecode=[0,0],t.lastClusterTimecode=0,t.lastClusterPosition=0,t.timecodeScale=1e6,t.metadataSize=0,t.metadatas=[],t.cues=[],t.firstVideoBlockRead=!1,t.firstAudioBlockRead=!1,t.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null},t.trackTypes=[],t.trackDefaultDuration=[],t.trackCodecDelay=[],t.trackInfo={type:`nothing`},t.ended=!1,t.logging=!1,t.use_duration_every_simpleblock=!1,t.use_webp=!1,t.use_segment_info=!0,t.drop_default_duration=!0,t}return n.prototype.stop=function(){for(this.ended=!0,this.emit_segment_info();this.stack.length;)this.stack.pop(),this.logging&&console.groupEnd();this.logging&&this.hasLoggingStarted&&this.logGroup&&console.groupEnd()},n.prototype.emit_segment_info=function(){var e=this.chunks;if(this.chunks=[],this.metadataloaded){if(!this.use_segment_info)return;var t=this.lastClusterTimecode,n=this.duration,r=this.timecodeScale;this.emit(`cluster`,{timecode:t,data:e}),this.emit(`duration`,{timecodeScale:r,duration:n})}else{this.metadataloaded=!0,this.metadatas=e;var i=this.trackTypes.indexOf(1),a=this.trackTypes.indexOf(2);if(this.trackInfo=i>=0&&a>=0?{type:`both`,trackNumber:i}:i>=0?{type:`video`,trackNumber:i}:a>=0?{type:`audio`,trackNumber:a}:{type:`nothing`},!this.use_segment_info)return;this.emit(`metadata`,{data:e,metadataSize:this.metadataSize})}},n.prototype.read=function(e){var t=this,n=!1;if(!this.ended){if(e.type===`m`)if(e.isEnd)this.stack.pop();else{var i=this.stack[this.stack.length-1];if(i!=null&&i.level>=e.level){this.stack.pop(),this.logging&&console.groupEnd(),i.dataEnd=e.dataEnd,i.dataSize=e.dataEnd-i.dataStart,i.unknownSize=!1;var a=Object.assign({},i,{name:i.name,type:i.type,isEnd:!0});this.chunks.push(a)}this.stack.push(e)}if(e.type===`m`&&e.name==`Segment`)this.segmentOffset!=0&&console.warn(`Multiple segments detected!`),this.segmentOffset=e.dataStart,this.emit(`segment_offset`,this.segmentOffset);else if(e.type===`b`&&e.name===`SimpleBlock`){var o=r.ebmlBlock(e.data),s=o.timecode,c=o.trackNumber,l=o.frames;if(this.trackTypes[c]===1){if(!this.firstVideoBlockRead&&(this.firstVideoBlockRead=!0,this.trackInfo.type===`both`||this.trackInfo.type===`video`)){var u=this.lastClusterTimecode+s;this.cues.push({CueTrack:c,CueClusterPosition:this.lastClusterPosition,CueTime:u}),this.emit(`cue_info`,{CueTrack:c,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit(`cue`,{CueTrack:c,CueClusterPosition:this.lastClusterPosition,CueTime:u})}this.last2SimpleBlockVideoTrackTimecode=[this.last2SimpleBlockVideoTrackTimecode[1],s]}else if(this.trackTypes[c]===2){if(!this.firstAudioBlockRead&&(this.firstAudioBlockRead=!0,this.trackInfo.type===`audio`)){var u=this.lastClusterTimecode+s;this.cues.push({CueTrack:c,CueClusterPosition:this.lastClusterPosition,CueTime:u}),this.emit(`cue_info`,{CueTrack:c,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit(`cue`,{CueTrack:c,CueClusterPosition:this.lastClusterPosition,CueTime:u})}this.last2SimpleBlockAudioTrackTimecode=[this.last2SimpleBlockAudioTrackTimecode[1],s]}this.use_duration_every_simpleblock&&this.emit(`duration`,{timecodeScale:this.timecodeScale,duration:this.duration}),this.use_webp&&l.forEach(function(e){if(e.slice(3,6).toString(`hex`)===`9d012a`){var n=r.VP8BitStreamToRiffWebPBuffer(e),i=new Blob([n],{type:`image/webp`}),a=t.duration;t.emit(`webp`,{currentTime:a,webp:i})}})}else e.type===`m`&&e.name===`Cluster`&&e.isEnd===!1?(this.firstVideoBlockRead=!1,this.firstAudioBlockRead=!1,this.emit_segment_info(),this.emit(`cluster_ptr`,e.tagStart),this.lastClusterPosition=e.tagStart):e.type===`u`&&e.name===`Timecode`?this.lastClusterTimecode=e.value:e.type===`u`&&e.name===`TimecodeScale`?this.timecodeScale=e.value:e.type===`m`&&e.name===`TrackEntry`?e.isEnd?(this.trackTypes[this.currentTrack.TrackNumber]=this.currentTrack.TrackType,this.trackDefaultDuration[this.currentTrack.TrackNumber]=this.currentTrack.DefaultDuration,this.trackCodecDelay[this.currentTrack.TrackNumber]=this.currentTrack.CodecDelay):this.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null}:e.type===`u`&&e.name===`TrackType`?this.currentTrack.TrackType=e.value:e.type===`u`&&e.name===`TrackNumber`?this.currentTrack.TrackNumber=e.value:e.type===`u`&&e.name===`CodecDelay`?this.currentTrack.CodecDelay=e.value:e.type===`u`&&e.name===`DefaultDuration`?this.drop_default_duration?(console.warn(`DefaultDuration detected!, remove it`),n=!0):this.currentTrack.DefaultDuration=e.value:e.name===`unknown`&&console.warn(e);!this.metadataloaded&&e.dataEnd>0&&(this.metadataSize=e.dataEnd),n||this.chunks.push(e),this.logging&&this.put(e)}},Object.defineProperty(n.prototype,`duration`,{get:function(){if(this.trackInfo.type===`nothing`)return console.warn(`no video, no audio track`),0;var e=0,t=0,n=0,r=this.trackDefaultDuration[this.trackInfo.trackNumber];if(typeof r==`number`)e=r;else if(this.trackInfo.type===`both`)if(this.last2SimpleBlockAudioTrackTimecode[1]>this.last2SimpleBlockVideoTrackTimecode[1]){e=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var i=this.trackCodecDelay[this.trackTypes.indexOf(2)];typeof i==`number`&&(t=i),n=this.last2SimpleBlockAudioTrackTimecode[1]}else{e=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var i=this.trackCodecDelay[this.trackTypes.indexOf(1)];typeof i==`number`&&(t=i),n=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type===`video`){e=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var i=this.trackCodecDelay[this.trackInfo.trackNumber];typeof i==`number`&&(t=i),n=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type===`audio`){e=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var i=this.trackCodecDelay[this.trackInfo.trackNumber];typeof i==`number`&&(t=i),n=this.last2SimpleBlockAudioTrackTimecode[1]}var a=((this.lastClusterTimecode+n)*this.timecodeScale+e-t)/this.timecodeScale;return Math.floor(a)},enumerable:!1,configurable:!0}),n.prototype.addListener=function(t,n){return e.prototype.addListener.call(this,t,n)},n.prototype.put=function(e){this.hasLoggingStarted||(this.hasLoggingStarted=!0,this.logging&&this.logGroup&&console.groupCollapsed(this.logGroup)),e.type===`m`?e.isEnd?console.groupEnd():console.group(e.name+`:`+e.tagStart):e.type===`b`?console.log(e.name,e.type):console.log(e.name,e.tagStart,e.type,e.value)},n}(n.EventEmitter)})),w=o((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.tools=e.Reader=e.Encoder=e.Decoder=void 0,n(l(),e),e.Decoder=x().default,e.Encoder=f().default,e.Reader=C().default,e.tools=b()})),T=c(o((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},n=e&&e.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};Object.defineProperty(e,`__esModule`,{value:!0});var r=w();function i(e){return t(this,void 0,void 0,function(){var t,i,a,o,s,c,l,u,d,f,p,m;return n(this,function(n){switch(n.label){case 0:if(!e)throw Error(`call to fixWebmDuration requires a blob`);t=new r.Decoder,i=new r.Reader,a=e.stream(),o=a.getReader(),n.label=1;case 1:return[4,o.read()];case 2:return s=n.sent(),c=s.done,l=s.value,c?(i.stop(),[3,3]):(u=t.decode(l),u=u?.filter(function(e){return e.type!==`unknown`}),u.forEach(function(e){i.read(e)}),l=null,[3,1]);case 3:return d=r.tools.makeMetadataSeekable(i.metadatas,i.duration,i.cues),f=new Blob([d],{type:e.type}),p=e.slice(i.metadataSize),m=new Blob([f,p],{type:e.type}),[2,m]}})})}e.default=i}))(),1);function E(e){if(typeof e==`function`)return e;if(typeof e==`object`&&e&&`default`in e){let t=e.default;if(typeof t==`function`)return t;if(typeof t==`object`&&t&&`default`in t&&typeof t.default==`function`)return t.default}throw TypeError(`fixWebmDuration is not a function`)}let D=E(T),O=new class{async fix(e,t){return D(new Blob([e],{type:t||`video/webm`}))}};onmessage=e=>{let{id:t,action:n,data:r}=e.data;n!==`destroy`&&n===`fix`&&(async()=>{try{let e=await O.fix(r.buffer,r.mimeType),n=await e.arrayBuffer(),i={id:t,ok:!0,buffer:n,mimeType:e.type||r.mimeType||`video/webm`};postMessage(i,[n])}catch(e){let n={id:t,ok:!1,error:e instanceof Error?e.message:String(e)};postMessage(n)}})()}})();',gd=typeof self<`u`&&self.Blob&&new Blob([`(self.URL || self.webkitURL).revokeObjectURL(self.location.href);`,hd],{type:`text/javascript;charset=utf-8`});function _d(e){let t;try{if(t=gd&&(self.URL||self.webkitURL).createObjectURL(gd),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(hd),{name:e?.name})}}function vd(e,t){let n=e;if(n?.message){let e=n.filename?` ${n.filename}:${n.lineno??0}`:``;return`${t}: ${n.message}${e}`}return t}var yd=class{worker;nextId=1;pending=new Map;options;constructor(e={}){this.options=e,this.worker=new _d,this.worker.onmessage=e=>{let t=e.data,n=this.pending.get(t.id);if(n){if(this.pending.delete(t.id),!t.ok){n.reject(Error(t.error??`webm fix worker failed`));return}if(t.buffer==null){n.reject(Error(`webm fix worker failed`));return}n.resolve(new Blob([t.buffer],{type:t.mimeType??`video/webm`}))}},this.worker.addEventListener(`messageerror`,()=>{this.failAll(Error(`webm fix worker messageerror`))}),this.worker.addEventListener(`error`,e=>{this.failAll(Error(vd(e,`webm fix worker error`)))})}failAll(e){for(let[,t]of this.pending)t.reject(e);this.pending.clear(),this.worker.terminate(),this.options.onFatal?.()}fix(e,t){let n=this.nextId++,r=e.slice(0);return new Promise((e,i)=>{this.pending.set(n,{resolve:e,reject:i}),this.worker.postMessage({id:n,action:`fix`,data:{buffer:r,mimeType:t}},[r])})}destroy=()=>{let e=Error(`webm fix worker destroyed`);for(let[,t]of this.pending)t.reject(e);this.pending.clear();try{this.worker.postMessage({id:0,action:`destroy`,data:{}})}catch{}this.worker.terminate()}},bd=!1,xd=null;function Sd(){if(bd)return null;if(typeof Worker>`u`)return bd=!0,null;if(!xd)try{xd=new yd({onFatal:()=>{bd=!0,xd=null}})}catch{return bd=!0,null}return xd}function Cd(e,t){let n=Sd();return n?n.fix(e,t):Promise.reject(Error(`webm fix worker unavailable`))}function wd(){xd?.destroy(),xd=null,bd=!1}var Td=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),Ed=s((e=>{(function(e){var t=`undefined`,n=t!==typeof Buffer&&Buffer,r=t!==typeof Uint8Array&&Uint8Array,i=t!==typeof ArrayBuffer&&ArrayBuffer,a=[0,0,0,0,0,0,0,0],o=Array.isArray||x,s=4294967296,c=16777216,l;u(`Uint64BE`,!0,!0),u(`Int64BE`,!0,!1),u(`Uint64LE`,!1,!0),u(`Int64LE`,!1,!1);function u(o,u,x){var S=u?0:4,C=u?4:0,w=u?0:3,T=u?1:2,E=u?2:1,D=u?3:0,ee=u?_:y,O=u?v:b,k=re.prototype,te=`is`+o,ne=`_`+te;return k.buffer=void 0,k.offset=0,k[ne]=!0,k.toNumber=A,k.toString=j,k.toJSON=A,k.toArray=d,n&&(k.toBuffer=f),r&&(k.toArrayBuffer=p),re[te]=ie,e[o]=re,re;function re(e,t,n,r){return this instanceof re?ae(this,e,t,n,r):new re(e,t,n,r)}function ie(e){return!!(e&&e[ne])}function ae(e,o,s,c,u){if(r&&i&&(o instanceof i&&(o=new r(o)),c instanceof i&&(c=new r(c))),!o&&!s&&!c&&!l){e.buffer=g(a,0);return}if(!m(o,s)){var d=l||Array;u=s,c=o,s=0,o=l===n?n.alloc(8):new d(8)}e.buffer=o,e.offset=s|=0,t!==typeof c&&(typeof c==`string`?oe(o,s,c,u||10):m(c,u)?h(o,s,c,u):typeof u==`number`?(se(o,s+S,c),se(o,s+C,u)):c>0?ee(o,s,c):c<0?O(o,s,c):h(o,s,a,0))}function oe(e,t,n,r){var i=0,a=n.length,o=0,c=0;n[0]===`-`&&i++;for(var l=i;i<a;){var u=parseInt(n[i++],r);if(!(u>=0))break;c=c*r+u,o=o*r+Math.floor(c/s),c%=s}l&&(o=~o,c?c=s-c:o++),se(e,t+S,o),se(e,t+C,c)}function A(){var e=this.buffer,t=this.offset,n=ce(e,t+S),r=ce(e,t+C);return x||(n|=0),n?n*s+r:r}function j(e){var t=this.buffer,n=this.offset,r=ce(t,n+S),i=ce(t,n+C),a=``,o=!x&&r&2147483648;for(o&&(r=~r,i=s-i),e||=10;;){var c=r%e*s+i;if(r=Math.floor(r/e),i=Math.floor(c/e),a=(c%e).toString(e)+a,!r&&!i)break}return o&&(a=`-`+a),a}function se(e,t,n){e[t+D]=n&255,n>>=8,e[t+E]=n&255,n>>=8,e[t+T]=n&255,n>>=8,e[t+w]=n&255}function ce(e,t){return e[t+w]*c+(e[t+T]<<16)+(e[t+E]<<8)+e[t+D]}}function d(e){var t=this.buffer,n=this.offset;return l=null,e!==!1&&o(t)?t.length===8?t:t.slice(n,n+8):g(t,n)}function f(e){var t=this.buffer,r=this.offset;return l=n,e!==!1&&n.isBuffer(t)?t.length===8?t:t.slice(r,r+8):n.from(p.call(this,e))}function p(e){var t=this.buffer,n=this.offset,a=t.buffer;if(l=r,e!==!1&&!t.offset&&a instanceof i)return a.byteLength===8?a:a.slice(n,n+8);var o=new r(8);return h(o,0,t,n),o.buffer}function m(e,t){var n=e&&e.length;return t|=0,n&&t+8<=n&&typeof e[t]!=`string`}function h(e,t,n,r){t|=0,r|=0;for(var i=0;i<8;i++)e[t++]=n[r++]&255}function g(e,t){return Array.prototype.slice.call(e,t,t+8)}function _(e,t,n){for(var r=t+8;r>t;)e[--r]=n&255,n/=256}function v(e,t,n){var r=t+8;for(n++;r>t;)e[--r]=-n&255^255,n/=256}function y(e,t,n){for(var r=t+8;t<r;)e[t++]=n&255,n/=256}function b(e,t,n){var r=t+8;for(n++;t<r;)e[t++]=-n&255^255,n/=256}function x(e){return!!e&&Object.prototype.toString.call(e)==`[object Array]`}})(typeof e==`object`&&typeof e.nodeName!=`string`?e:e||{})})),Dd=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.byEbmlID=void 0,e.byEbmlID={128:{name:`ChapterDisplay`,level:4,type:`m`,multiple:!0,minver:1,webm:!0,description:`Contains all possible strings to use for the chapter display.`},131:{name:`TrackType`,level:3,type:`u`,mandatory:!0,minver:1,range:`1-254`,description:`A set of track types coded on 8 bits (1: video, 2: audio, 3: complex, 0x10: logo, 0x11: subtitle, 0x12: buttons, 0x20: control).`},133:{name:`ChapString`,cppname:`ChapterString`,level:5,type:`8`,mandatory:!0,minver:1,webm:!0,description:`Contains the string to use as the chapter atom.`},134:{name:`CodecID`,level:3,type:`s`,mandatory:!0,minver:1,description:`An ID corresponding to the codec, see the codec page for more info.`},136:{name:`FlagDefault`,cppname:`TrackFlagDefault`,level:3,type:`u`,mandatory:!0,minver:1,default:1,range:`0-1`,description:`Set if that track (audio, video or subs) SHOULD be active if no language found matches the user preference. (1 bit)`},137:{name:`ChapterTrackNumber`,level:5,type:`u`,mandatory:!0,multiple:!0,minver:1,webm:!1,range:`not 0`,description:`UID of the Track to apply this chapter too. In the absense of a control track, choosing this chapter will select the listed Tracks and deselect unlisted tracks. Absense of this element indicates that the Chapter should be applied to any currently used Tracks.`},145:{name:`ChapterTimeStart`,level:4,type:`u`,mandatory:!0,minver:1,webm:!0,description:`Timestamp of the start of Chapter (not scaled).`},146:{name:`ChapterTimeEnd`,level:4,type:`u`,minver:1,webm:!1,description:`Timestamp of the end of Chapter (timestamp excluded, not scaled).`},150:{name:`CueRefTime`,level:5,type:`u`,mandatory:!0,minver:2,webm:!1,description:`Timestamp of the referenced Block.`},151:{name:`CueRefCluster`,level:5,type:`u`,mandatory:!0,webm:!1,description:`The Position of the Cluster containing the referenced Block.`},152:{name:`ChapterFlagHidden`,level:4,type:`u`,mandatory:!0,minver:1,webm:!1,default:0,range:`0-1`,description:`If a chapter is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)`},16980:{name:`ContentCompAlgo`,level:6,type:`u`,mandatory:!0,minver:1,webm:!1,default:0,description:`The compression algorithm used. Algorithms that have been specified so far are: 0 - zlib, 3 - Header Stripping`},16981:{name:`ContentCompSettings`,level:6,type:`b`,minver:1,webm:!1,description:`Settings that might be needed by the decompressor. For Header Stripping (ContentCompAlgo=3), the bytes that were removed from the beggining of each frames of the track.`},17026:{name:`DocType`,level:1,type:`s`,mandatory:!0,default:`matroska`,minver:1,description:`A string that describes the type of document that follows this EBML header. 'matroska' in our case or 'webm' for webm files.`},17029:{name:`DocTypeReadVersion`,level:1,type:`u`,mandatory:!0,default:1,minver:1,description:`The minimum DocType version an interpreter has to support to read this file.`},17030:{name:`EBMLVersion`,level:1,type:`u`,mandatory:!0,default:1,minver:1,description:`The version of EBML parser used to create the file.`},17031:{name:`DocTypeVersion`,level:1,type:`u`,mandatory:!0,default:1,minver:1,description:`The version of DocType interpreter used to create the file.`},17476:{name:`SegmentFamily`,level:2,type:`b`,multiple:!0,minver:1,webm:!1,bytesize:16,description:`A randomly generated unique ID that all segments related to each other must use (128 bits).`},17505:{name:`DateUTC`,level:2,type:`d`,minver:1,description:`Date of the origin of timestamp (value 0), i.e. production date.`},17540:{name:`TagDefault`,level:4,type:`u`,mandatory:!0,minver:1,webm:!1,default:1,range:`0-1`,description:`Indication to know if this is the default/original language to use for the given tag. (1 bit)`},17541:{name:`TagBinary`,level:4,type:`b`,minver:1,webm:!1,description:`The values of the Tag if it is binary. Note that this cannot be used in the same SimpleTag as TagString.`},17543:{name:`TagString`,level:4,type:`8`,minver:1,webm:!1,description:`The value of the Element.`},17545:{name:`Duration`,level:2,type:`f`,minver:1,range:`> 0`,description:`Duration of the segment (based on TimecodeScale).`},17816:{name:`ChapterFlagEnabled`,level:4,type:`u`,mandatory:!0,minver:1,webm:!1,default:1,range:`0-1`,description:`Specify wether the chapter is enabled. It can be enabled/disabled by a Control Track. When disabled, the movie should skip all the content between the TimeStart and TimeEnd of this chapter (see flag notes). (1 bit)`},18016:{name:`FileMimeType`,level:3,type:`s`,mandatory:!0,minver:1,webm:!1,description:`MIME type of the file.`},18017:{name:`FileUsedStartTime`,level:3,type:`u`,divx:!0,description:`DivX font extension`},18018:{name:`FileUsedEndTime`,level:3,type:`u`,divx:!0,description:`DivX font extension`},18037:{name:`FileReferral`,level:3,type:`b`,webm:!1,description:`A binary value that a track/codec can refer to when the attachment is needed.`},20529:{name:`ContentEncodingOrder`,level:5,type:`u`,mandatory:!0,minver:1,webm:!1,default:0,description:`Tells when this modification was used during encoding/muxing starting with 0 and counting upwards. The decoder/demuxer has to start with the highest order number it finds and work its way down. This value has to be unique over all ContentEncodingOrder elements in the segment.`},20530:{name:`ContentEncodingScope`,level:5,type:`u`,mandatory:!0,minver:1,webm:!1,default:1,range:`not 0`,description:`A bit field that describes which elements have been modified in this way. Values (big endian) can be OR'ed. Possible values: 1 - all frame contents, 2 - the track's private data, 4 - the next ContentEncoding (next ContentEncodingOrder. Either the data inside ContentCompression and/or ContentEncryption)`},20531:{name:`ContentEncodingType`,level:5,type:`u`,mandatory:!0,minver:1,webm:!1,default:0,description:`A value describing what kind of transformation has been done. Possible values: 0 - compression, 1 - encryption`},20532:{name:`ContentCompression`,level:5,type:`m`,minver:1,webm:!1,description:`Settings describing the compression used. Must be present if the value of ContentEncodingType is 0 and absent otherwise. Each block must be decompressable even if no previous block is available in order not to prevent seeking.`},20533:{name:`ContentEncryption`,level:5,type:`m`,minver:1,webm:!1,description:`Settings describing the encryption used. Must be present if the value of ContentEncodingType is 1 and absent otherwise.`},21368:{name:`CueBlockNumber`,level:4,type:`u`,minver:1,default:1,range:`not 0`,description:`Number of the Block in the specified Cluster.`},22100:{name:`ChapterStringUID`,level:4,type:`8`,mandatory:!1,minver:3,webm:!0,description:`A unique string ID to identify the Chapter. Use for WebVTT cue identifier storage.`},22337:{name:`WritingApp`,level:2,type:`8`,mandatory:!0,minver:1,description:`Writing application ("mkvmerge-0.3.3").`},22612:{name:`SilentTracks`,cppname:`ClusterSilentTracks`,level:2,type:`m`,minver:1,webm:!1,description:`The list of tracks that are not used in that part of the stream. It is useful when using overlay tracks on seeking. Then you should decide what track to use.`},25152:{name:`ContentEncoding`,level:4,type:`m`,mandatory:!0,multiple:!0,minver:1,webm:!1,description:`Settings for one content encoding like compression or encryption.`},25188:{name:`BitDepth`,cppname:`AudioBitDepth`,level:4,type:`u`,minver:1,range:`not 0`,description:`Bits per sample, mostly used for PCM.`},25906:{name:`SignedElement`,level:3,type:`b`,multiple:!0,webm:!1,description:`An element ID whose data will be used to compute the signature.`},26148:{name:`TrackTranslate`,level:3,type:`m`,multiple:!0,minver:1,webm:!1,description:`The track identification for the given Chapter Codec.`},26897:{name:`ChapProcessCommand`,cppname:`ChapterProcessCommand`,level:5,type:`m`,multiple:!0,minver:1,webm:!1,description:`Contains all the commands associated to the Atom.`},26914:{name:`ChapProcessTime`,cppname:`ChapterProcessTime`,level:6,type:`u`,mandatory:!0,minver:1,webm:!1,description:`Defines when the process command should be handled (0: during the whole chapter, 1: before starting playback, 2: after playback of the chapter).`},26916:{name:`ChapterTranslate`,level:2,type:`m`,multiple:!0,minver:1,webm:!1,description:`A tuple of corresponding ID used by chapter codecs to represent this segment.`},26931:{name:`ChapProcessData`,cppname:`ChapterProcessData`,level:6,type:`b`,mandatory:!0,minver:1,webm:!1,description:`Contains the command information. The data should be interpreted depending on the ChapProcessCodecID value. For ChapProcessCodecID = 1, the data correspond to the binary DVD cell pre/post commands.`},26948:{name:`ChapProcess`,cppname:`ChapterProcess`,level:4,type:`m`,multiple:!0,minver:1,webm:!1,description:`Contains all the commands associated to the Atom.`},26965:{name:`ChapProcessCodecID`,cppname:`ChapterProcessCodecID`,level:5,type:`u`,mandatory:!0,minver:1,webm:!1,default:0,description:`Contains the type of the codec used for the processing. A value of 0 means native Matroska processing (to be defined), a value of 1 means the DVD command set is used. More codec IDs can be added later.`},29555:{name:`Tag`,level:2,type:`m`,mandatory:!0,multiple:!0,minver:1,webm:!1,description:`Element containing elements specific to Tracks/Chapters.`},29572:{name:`SegmentFilename`,level:2,type:`8`,minver:1,webm:!1,description:`A filename corresponding to this segment.`},29766:{name:`AttachmentLink`,cppname:`TrackAttachmentLink`,level:3,type:`u`,minver:1,webm:!1,range:`not 0`,description:`The UID of an attachment that is used by this codec.`},2459272:{name:`CodecName`,level:3,type:`8`,minver:1,description:`A human-readable string specifying the codec.`},408125543:{name:`Segment`,level:`0`,type:`m`,mandatory:!0,multiple:!0,minver:1,description:`This element contains all other top-level (level 1) elements. Typically a Matroska file is composed of 1 segment.`},17530:{name:`TagLanguage`,level:4,type:`s`,mandatory:!0,minver:1,webm:!1,default:`und`,description:`Specifies the language of the tag specified, in the Matroska languages form.`},17827:{name:`TagName`,level:4,type:`8`,mandatory:!0,minver:1,webm:!1,description:`The name of the Tag that is going to be stored.`},26568:{name:`SimpleTag`,cppname:`TagSimple`,level:3,recursive:`1`,type:`m`,mandatory:!0,multiple:!0,minver:1,webm:!1,description:`Contains general information about the target.`},25542:{name:`TagAttachmentUID`,level:4,type:`u`,multiple:!0,minver:1,webm:!1,default:0,description:`A unique ID to identify the Attachment(s) the tags belong to. If the value is 0 at this level, the tags apply to all the attachments in the Segment.`},25540:{name:`TagChapterUID`,level:4,type:`u`,multiple:!0,minver:1,webm:!1,default:0,description:`A unique ID to identify the Chapter(s) the tags belong to. If the value is 0 at this level, the tags apply to all chapters in the Segment.`},25545:{name:`TagEditionUID`,level:4,type:`u`,multiple:!0,minver:1,webm:!1,default:0,description:`A unique ID to identify the EditionEntry(s) the tags belong to. If the value is 0 at this level, the tags apply to all editions in the Segment.`},25541:{name:`TagTrackUID`,level:4,type:`u`,multiple:!0,minver:1,webm:!1,default:0,description:`A unique ID to identify the Track(s) the tags belong to. If the value is 0 at this level, the tags apply to all tracks in the Segment.`},25546:{name:`TargetType`,cppname:`TagTargetType`,level:4,type:`s`,minver:1,webm:!1,strong:`informational`,description:`An string that can be used to display the logical level of the target like "ALBUM", "TRACK", "MOVIE", "CHAPTER", etc (see TargetType).`},26826:{name:`TargetTypeValue`,cppname:`TagTargetTypeValue`,level:4,type:`u`,minver:1,webm:!1,default:50,description:`A number to indicate the logical level of the target (see TargetType).`},25536:{name:`Targets`,cppname:`TagTargets`,level:3,type:`m`,mandatory:!0,minver:1,webm:!1,description:`Contain all UIDs where the specified meta data apply. It is empty to describe everything in the segment.`},307544935:{name:`Tags`,level:1,type:`m`,multiple:!0,minver:1,webm:!1,description:`Element containing elements specific to Tracks/Chapters. A list of valid tags can be found here.`},17677:{name:`ChapProcessPrivate`,cppname:`ChapterProcessPrivate`,level:5,type:`b`,minver:1,webm:!1,description:`Some optional data attached to the ChapProcessCodecID information. For ChapProcessCodecID = 1, it is the "DVD level" equivalent.`},17278:{name:`ChapCountry`,cppname:`ChapterCountry`,level:5,type:`s`,multiple:!0,minver:1,webm:!1,description:`The countries corresponding to the string, same 2 octets as in Internet domains.`},17276:{name:`ChapLanguage`,cppname:`ChapterLanguage`,level:5,type:`s`,mandatory:!0,multiple:!0,minver:1,webm:!0,default:`eng`,description:`The languages corresponding to the string, in the bibliographic ISO-639-2 form.`},143:{name:`ChapterTrack`,level:4,type:`m`,minver:1,webm:!1,description:`List of tracks on which the chapter applies. If this element is not present, all tracks apply`},25539:{name:`ChapterPhysicalEquiv`,level:4,type:`u`,minver:1,webm:!1,description:`Specify the physical equivalent of this ChapterAtom like "DVD" (60) or "SIDE" (50), see complete list of values.`},28348:{name:`ChapterSegmentEditionUID`,level:4,type:`u`,minver:1,webm:!1,range:`not 0`,description:`The EditionUID to play from the segment linked in ChapterSegmentUID.`},28263:{name:`ChapterSegmentUID`,level:4,type:`b`,minver:1,webm:!1,range:`>0`,bytesize:16,description:`A segment to play in place of this chapter. Edition ChapterSegmentEditionUID should be used for this segment, otherwise no edition is used.`},29636:{name:`ChapterUID`,level:4,type:`u`,mandatory:!0,minver:1,webm:!0,range:`not 0`,description:`A unique ID to identify the Chapter.`},182:{name:`ChapterAtom`,level:3,recursive:`1`,type:`m`,mandatory:!0,multiple:!0,minver:1,webm:!0,description:`Contains the atom information to use as the chapter atom (apply to all tracks).`},17885:{name:`EditionFlagOrdered`,level:3,type:`u`,minver:1,webm:!1,default:0,range:`0-1`,description:`Specify if the chapters can be defined multiple times and the order to play them is enforced. (1 bit)`},17883:{name:`EditionFlagDefault`,level:3,type:`u`,mandatory:!0,minver:1,webm:!1,default:0,range:`0-1`,description:`If a flag is set (1) the edition should be used as the default one. (1 bit)`},17853:{name:`EditionFlagHidden`,level:3,type:`u`,mandatory:!0,minver:1,webm:!1,default:0,range:`0-1`,description:`If an edition is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)`},17852:{name:`EditionUID`,level:3,type:`u`,minver:1,webm:!1,range:`not 0`,description:`A unique ID to identify the edition. It's useful for tagging an edition.`},17849:{name:`EditionEntry`,level:2,type:`m`,mandatory:!0,multiple:!0,minver:1,webm:!0,description:`Contains all information about a segment edition.`},272869232:{name:`Chapters`,level:1,type:`m`,minver:1,webm:!0,description:`A system to define basic menus and partition data. For more detailed information, look at the Chapters Explanation.`},18094:{name:`FileUID`,level:3,type:`u`,mandatory:!0,minver:1,webm:!1,range:`not 0`,description:`Unique ID representing the file, as random as possible.`},18012:{name:`FileData`,level:3,type:`b`,mandatory:!0,minver:1,webm:!1,description:`The data of the file.`},18030:{name:`FileName`,level:3,type:`8`,mandatory:!0,minver:1,webm:!1,description:`Filename of the attached file.`},18046:{name:`FileDescription`,level:3,type:`8`,minver:1,webm:!1,description:`A human-friendly name for the attached file.`},24999:{name:`AttachedFile`,level:2,type:`m`,mandatory:!0,multiple:!0,minver:1,webm:!1,description:`An attached file.`},423732329:{name:`Attachments`,level:1,type:`m`,minver:1,webm:!1,description:`Contain attached files.`},235:{name:`CueRefCodecState`,level:5,type:`u`,webm:!1,default:0,description:`The position of the Codec State corresponding to this referenced element. 0 means that the data is taken from the initial Track Entry.`},21343:{name:`CueRefNumber`,level:5,type:`u`,webm:!1,default:1,range:`not 0`,description:`Number of the referenced Block of Track X in the specified Cluster.`},219:{name:`CueReference`,level:4,type:`m`,multiple:!0,minver:2,webm:!1,description:`The Clusters containing the required referenced Blocks.`},234:{name:`CueCodecState`,level:4,type:`u`,minver:2,webm:!1,default:0,description:`The position of the Codec State corresponding to this Cue element. 0 means that the data is taken from the initial Track Entry.`},178:{name:`CueDuration`,level:4,type:`u`,mandatory:!1,minver:4,webm:!1,description:`The duration of the block according to the segment time base. If missing the track's DefaultDuration does not apply and no duration information is available in terms of the cues.`},240:{name:`CueRelativePosition`,level:4,type:`u`,mandatory:!1,minver:4,webm:!1,description:`The relative position of the referenced block inside the cluster with 0 being the first possible position for an element inside that cluster.`,position:`clusterRelative`},241:{name:`CueClusterPosition`,level:4,type:`u`,mandatory:!0,minver:1,description:`The position of the Cluster containing the required Block.`,position:`segment`},247:{name:`CueTrack`,level:4,type:`u`,mandatory:!0,minver:1,range:`not 0`,description:`The track for which a position is given.`},183:{name:`CueTrackPositions`,level:3,type:`m`,mandatory:!0,multiple:!0,minver:1,description:`Contain positions for different tracks corresponding to the timestamp.`},179:{name:`CueTime`,level:3,type:`u`,mandatory:!0,minver:1,description:`Absolute timestamp according to the segment time base.`},187:{name:`CuePoint`,level:2,type:`m`,mandatory:!0,multiple:!0,minver:1,description:`Contains all information relative to a seek point in the segment.`},475249515:{name:`Cues`,level:1,type:`m`,minver:1,description:`A top-level element to speed seeking access. All entries are local to the segment. Should be mandatory for non "live" streams.`},18406:{name:`ContentSigHashAlgo`,level:6,type:`u`,minver:1,webm:!1,default:0,description:`The hash algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - SHA1-160 2 - MD5`},18405:{name:`ContentSigAlgo`,level:6,type:`u`,minver:1,webm:!1,default:0,description:`The algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - RSA`},18404:{name:`ContentSigKeyID`,level:6,type:`b`,minver:1,webm:!1,description:`This is the ID of the private key the data was signed with.`},18403:{name:`ContentSignature`,level:6,type:`b`,minver:1,webm:!1,description:`A cryptographic signature of the contents.`},18402:{name:`ContentEncKeyID`,level:6,type:`b`,minver:1,webm:!1,description:`For public key algorithms this is the ID of the public key the the data was encrypted with.`},18401:{name:`ContentEncAlgo`,level:6,type:`u`,minver:1,webm:!1,default:0,description:`The encryption algorithm used. The value '0' means that the contents have not been encrypted but only signed. Predefined values: 1 - DES, 2 - 3DES, 3 - Twofish, 4 - Blowfish, 5 - AES`},28032:{name:`ContentEncodings`,level:3,type:`m`,minver:1,webm:!1,description:`Settings for several content encoding mechanisms like compression or encryption.`},196:{name:`TrickMasterTrackSegmentUID`,level:3,type:`b`,divx:!0,bytesize:16,description:`DivX trick track extenstions`},199:{name:`TrickMasterTrackUID`,level:3,type:`u`,divx:!0,description:`DivX trick track extenstions`},198:{name:`TrickTrackFlag`,level:3,type:`u`,divx:!0,default:0,description:`DivX trick track extenstions`},193:{name:`TrickTrackSegmentUID`,level:3,type:`b`,divx:!0,bytesize:16,description:`DivX trick track extenstions`},192:{name:`TrickTrackUID`,level:3,type:`u`,divx:!0,description:`DivX trick track extenstions`},237:{name:`TrackJoinUID`,level:5,type:`u`,mandatory:!0,multiple:!0,minver:3,webm:!1,range:`not 0`,description:`The trackUID number of a track whose blocks are used to create this virtual track.`},233:{name:`TrackJoinBlocks`,level:4,type:`m`,minver:3,webm:!1,description:`Contains the list of all tracks whose Blocks need to be combined to create this virtual track`},230:{name:`TrackPlaneType`,level:6,type:`u`,mandatory:!0,minver:3,webm:!1,description:`The kind of plane this track corresponds to (0: left eye, 1: right eye, 2: background).`},229:{name:`TrackPlaneUID`,level:6,type:`u`,mandatory:!0,minver:3,webm:!1,range:`not 0`,description:`The trackUID number of the track representing the plane.`},228:{name:`TrackPlane`,level:5,type:`m`,mandatory:!0,multiple:!0,minver:3,webm:!1,description:`Contains a video plane track that need to be combined to create this 3D track`},227:{name:`TrackCombinePlanes`,level:4,type:`m`,minver:3,webm:!1,description:`Contains the list of all video plane tracks that need to be combined to create this 3D track`},226:{name:`TrackOperation`,level:3,type:`m`,minver:3,webm:!1,description:`Operation that needs to be applied on tracks to create this virtual track. For more details look at the Specification Notes on the subject.`},32123:{name:`ChannelPositions`,cppname:`AudioPosition`,level:4,type:`b`,webm:!1,description:`Table of horizontal angles for each successive channel, see appendix.`},159:{name:`Channels`,cppname:`AudioChannels`,level:4,type:`u`,mandatory:!0,minver:1,default:1,range:`not 0`,description:`Numbers of channels in the track.`},30901:{name:`OutputSamplingFrequency`,cppname:`AudioOutputSamplingFreq`,level:4,type:`f`,minver:1,default:`Sampling Frequency`,range:`> 0`,description:`Real output sampling frequency in Hz (used for SBR techniques).`},181:{name:`SamplingFrequency`,cppname:`AudioSamplingFreq`,level:4,type:`f`,mandatory:!0,minver:1,default:8e3,range:`> 0`,description:`Sampling frequency in Hz.`},225:{name:`Audio`,cppname:`TrackAudio`,level:3,type:`m`,minver:1,description:`Audio settings.`},2327523:{name:`FrameRate`,cppname:`VideoFrameRate`,level:4,type:`f`,range:`> 0`,strong:`Informational`,description:`Number of frames per second. only.`},3126563:{name:`GammaValue`,cppname:`VideoGamma`,level:4,type:`f`,webm:!1,range:`> 0`,description:`Gamma Value.`},3061028:{name:`ColourSpace`,cppname:`VideoColourSpace`,level:4,type:`b`,minver:1,webm:!1,bytesize:4,description:`Same value as in AVI (32 bits).`},21683:{name:`AspectRatioType`,cppname:`VideoAspectRatio`,level:4,type:`u`,minver:1,default:0,description:`Specify the possible modifications to the aspect ratio (0: free resizing, 1: keep aspect ratio, 2: fixed).`},21682:{name:`DisplayUnit`,cppname:`VideoDisplayUnit`,level:4,type:`u`,minver:1,default:0,description:`How DisplayWidth & DisplayHeight should be interpreted (0: pixels, 1: centimeters, 2: inches, 3: Display Aspect Ratio).`},21690:{name:`DisplayHeight`,cppname:`VideoDisplayHeight`,level:4,type:`u`,minver:1,default:`PixelHeight`,range:`not 0`,description:`Height of the video frames to display. The default value is only valid when DisplayUnit is 0.`},21680:{name:`DisplayWidth`,cppname:`VideoDisplayWidth`,level:4,type:`u`,minver:1,default:`PixelWidth`,range:`not 0`,description:`Width of the video frames to display. The default value is only valid when DisplayUnit is 0.`},21725:{name:`PixelCropRight`,cppname:`VideoPixelCropRight`,level:4,type:`u`,minver:1,default:0,description:`The number of video pixels to remove on the right of the image.`},21708:{name:`PixelCropLeft`,cppname:`VideoPixelCropLeft`,level:4,type:`u`,minver:1,default:0,description:`The number of video pixels to remove on the left of the image.`},21691:{name:`PixelCropTop`,cppname:`VideoPixelCropTop`,level:4,type:`u`,minver:1,default:0,description:`The number of video pixels to remove at the top of the image.`},21674:{name:`PixelCropBottom`,cppname:`VideoPixelCropBottom`,level:4,type:`u`,minver:1,default:0,description:`The number of video pixels to remove at the bottom of the image (for HDTV content).`},186:{name:`PixelHeight`,cppname:`VideoPixelHeight`,level:4,type:`u`,mandatory:!0,minver:1,range:`not 0`,description:`Height of the encoded video frames in pixels.`},176:{name:`PixelWidth`,cppname:`VideoPixelWidth`,level:4,type:`u`,mandatory:!0,minver:1,range:`not 0`,description:`Width of the encoded video frames in pixels.`},21433:{name:`OldStereoMode`,level:4,type:`u`,maxver:`0`,webm:!1,divx:!1,description:`DEPRECATED, DO NOT USE. Bogus StereoMode value used in old versions of libmatroska. (0: mono, 1: right eye, 2: left eye, 3: both eyes).`},21440:{name:`AlphaMode`,cppname:`VideoAlphaMode`,level:4,type:`u`,minver:3,webm:!0,default:0,description:`Alpha Video Mode. Presence of this element indicates that the BlockAdditional element could contain Alpha data.`},21432:{name:`StereoMode`,cppname:`VideoStereoMode`,level:4,type:`u`,minver:3,webm:!0,default:0,description:`Stereo-3D video mode (0: mono, 1: side by side (left eye is first), 2: top-bottom (right eye is first), 3: top-bottom (left eye is first), 4: checkboard (right is first), 5: checkboard (left is first), 6: row interleaved (right is first), 7: row interleaved (left is first), 8: column interleaved (right is first), 9: column interleaved (left is first), 10: anaglyph (cyan/red), 11: side by side (right eye is first), 12: anaglyph (green/magenta), 13 both eyes laced in one Block (left eye is first), 14 both eyes laced in one Block (right eye is first)) . There are some more details on 3D support in the Specification Notes.`},154:{name:`FlagInterlaced`,cppname:`VideoFlagInterlaced`,level:4,type:`u`,mandatory:!0,minver:2,webm:!0,default:0,range:`0-1`,description:`Set if the video is interlaced. (1 bit)`},224:{name:`Video`,cppname:`TrackVideo`,level:3,type:`m`,minver:1,description:`Video settings.`},26277:{name:`TrackTranslateTrackID`,level:4,type:`b`,mandatory:!0,minver:1,webm:!1,description:`The binary value used to represent this track in the chapter codec data. The format depends on the ChapProcessCodecID used.`},26303:{name:`TrackTranslateCodec`,level:4,type:`u`,mandatory:!0,minver:1,webm:!1,description:`The chapter codec using this ID (0: Matroska Script, 1: DVD-menu).`},26364:{name:`TrackTranslateEditionUID`,level:4,type:`u`,multiple:!0,minver:1,webm:!1,description:`Specify an edition UID on which this translation applies. When not specified, it means for all editions found in the segment.`},22203:{name:`SeekPreRoll`,level:3,type:`u`,mandatory:!0,multiple:!1,default:0,minver:4,webm:!0,description:`After a discontinuity, SeekPreRoll is the duration in nanoseconds of the data the decoder must decode before the decoded data is valid.`},22186:{name:`CodecDelay`,level:3,type:`u`,multiple:!1,default:0,minver:4,webm:!0,description:`CodecDelay is The codec-built-in delay in nanoseconds. This value must be subtracted from each block timestamp in order to get the actual timestamp. The value should be small so the muxing of tracks with the same actual timestamp are in the same Cluster.`},28587:{name:`TrackOverlay`,level:3,type:`u`,multiple:!0,minver:1,webm:!1,description:`Specify that this track is an overlay track for the Track specified (in the u-integer). That means when this track has a gap (see SilentTracks) the overlay track should be used instead. The order of multiple TrackOverlay matters, the first one is the one that should be used. If not found it should be the second, etc.`},170:{name:`CodecDecodeAll`,level:3,type:`u`,mandatory:!0,minver:2,webm:!1,default:1,range:`0-1`,description:`The codec can decode potentially damaged data (1 bit).`},2536e3:{name:`CodecDownloadURL`,level:3,type:`s`,multiple:!0,webm:!1,description:`A URL to download about the codec used.`},3883072:{name:`CodecInfoURL`,level:3,type:`s`,multiple:!0,webm:!1,description:`A URL to find information about the codec used.`},3839639:{name:`CodecSettings`,level:3,type:`8`,webm:!1,description:`A string describing the encoding setting used.`},25506:{name:`CodecPrivate`,level:3,type:`b`,minver:1,description:`Private data only known to the codec.`},2274716:{name:`Language`,cppname:`TrackLanguage`,level:3,type:`s`,minver:1,default:`eng`,description:`Specifies the language of the track in the Matroska languages form.`},21358:{name:`Name`,cppname:`TrackName`,level:3,type:`8`,minver:1,description:`A human-readable track name.`},21998:{name:`MaxBlockAdditionID`,level:3,type:`u`,mandatory:!0,minver:1,webm:!1,default:0,description:`The maximum value of BlockAdditions for this track.`},21375:{name:`TrackOffset`,level:3,type:`i`,webm:!1,default:0,description:`A value to add to the Block's Timestamp. This can be used to adjust the playback offset of a track.`},2306383:{name:`TrackTimecodeScale`,level:3,type:`f`,mandatory:!0,minver:1,maxver:`3`,webm:!1,default:1,range:`> 0`,description:`DEPRECATED, DO NOT USE. The scale to apply on this track to work at normal speed in relation with other tracks (mostly used to adjust video speed when the audio length differs).`},2313850:{name:`DefaultDecodedFieldDuration`,cppname:`TrackDefaultDecodedFieldDuration`,level:3,type:`u`,minver:4,range:`not 0`,description:`The period in nanoseconds (not scaled by TimcodeScale)
5
+ between two successive fields at the output of the decoding process (see the notes)`},2352003:{name:`DefaultDuration`,cppname:`TrackDefaultDuration`,level:3,type:`u`,minver:1,range:`not 0`,description:`Number of nanoseconds (not scaled via TimecodeScale) per frame ('frame' in the Matroska sense -- one element put into a (Simple)Block).`},28152:{name:`MaxCache`,cppname:`TrackMaxCache`,level:3,type:`u`,minver:1,webm:!1,description:`The maximum cache size required to store referenced frames in and the current frame. 0 means no cache is needed.`},28135:{name:`MinCache`,cppname:`TrackMinCache`,level:3,type:`u`,mandatory:!0,minver:1,webm:!1,default:0,description:`The minimum number of frames a player should be able to cache during playback. If set to 0, the reference pseudo-cache system is not used.`},156:{name:`FlagLacing`,cppname:`TrackFlagLacing`,level:3,type:`u`,mandatory:!0,minver:1,default:1,range:`0-1`,description:`Set if the track may contain blocks using lacing. (1 bit)`},21930:{name:`FlagForced`,cppname:`TrackFlagForced`,level:3,type:`u`,mandatory:!0,minver:1,default:0,range:`0-1`,description:`Set if that track MUST be active during playback. There can be many forced track for a kind (audio, video or subs), the player should select the one which language matches the user preference or the default + forced track. Overlay MAY happen between a forced and non-forced track of the same kind. (1 bit)`},185:{name:`FlagEnabled`,cppname:`TrackFlagEnabled`,level:3,type:`u`,mandatory:!0,minver:2,webm:!0,default:1,range:`0-1`,description:`Set if the track is usable. (1 bit)`},29637:{name:`TrackUID`,level:3,type:`u`,mandatory:!0,minver:1,range:`not 0`,description:`A unique ID to identify the Track. This should be kept the same when making a direct stream copy of the Track to another file.`},215:{name:`TrackNumber`,level:3,type:`u`,mandatory:!0,minver:1,range:`not 0`,description:`The track number as used in the Block Header (using more than 127 tracks is not encouraged, though the design allows an unlimited number).`},174:{name:`TrackEntry`,level:2,type:`m`,mandatory:!0,multiple:!0,minver:1,description:`Describes a track with all elements.`},374648427:{name:`Tracks`,level:1,type:`m`,multiple:!0,minver:1,description:`A top-level block of information with many tracks described.`},175:{name:`EncryptedBlock`,level:2,type:`b`,multiple:!0,webm:!1,description:`Similar to EncryptedBlock Structure)`},202:{name:`ReferenceTimeCode`,level:4,type:`u`,multiple:!1,mandatory:!0,minver:0,webm:!1,divx:!0,description:`DivX trick track extenstions`},201:{name:`ReferenceOffset`,level:4,type:`u`,multiple:!1,mandatory:!0,minver:0,webm:!1,divx:!0,description:`DivX trick track extenstions`},200:{name:`ReferenceFrame`,level:3,type:`m`,multiple:!1,minver:0,webm:!1,divx:!0,description:`DivX trick track extenstions`},207:{name:`SliceDuration`,level:5,type:`u`,default:0,description:`The (scaled) duration to apply to the element.`},206:{name:`Delay`,cppname:`SliceDelay`,level:5,type:`u`,default:0,description:`The (scaled) delay to apply to the element.`},203:{name:`BlockAdditionID`,cppname:`SliceBlockAddID`,level:5,type:`u`,default:0,description:`The ID of the BlockAdditional element (0 is the main Block).`},205:{name:`FrameNumber`,cppname:`SliceFrameNumber`,level:5,type:`u`,default:0,description:`The number of the frame to generate from this lace with this delay (allow you to generate many frames from the same Block/Frame).`},204:{name:`LaceNumber`,cppname:`SliceLaceNumber`,level:5,type:`u`,minver:1,default:0,divx:!1,description:`The reverse number of the frame in the lace (0 is the last frame, 1 is the next to last, etc). While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback.`},232:{name:`TimeSlice`,level:4,type:`m`,multiple:!0,minver:1,divx:!1,description:`Contains extra time information about the data contained in the Block. While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback.`},142:{name:`Slices`,level:3,type:`m`,minver:1,divx:!1,description:`Contains slices description.`},30114:{name:`DiscardPadding`,level:3,type:`i`,minver:4,webm:!0,description:`Duration in nanoseconds of the silent data added to the Block (padding at the end of the Block for positive value, at the beginning of the Block for negative value). The duration of DiscardPadding is not calculated in the duration of the TrackEntry and should be discarded during playback.`},164:{name:`CodecState`,level:3,type:`b`,minver:2,webm:!1,description:`The new codec state to use. Data interpretation is private to the codec. This information should always be referenced by a seek entry.`},253:{name:`ReferenceVirtual`,level:3,type:`i`,webm:!1,description:`Relative position of the data that should be in position of the virtual block.`},251:{name:`ReferenceBlock`,level:3,type:`i`,multiple:!0,minver:1,description:`Timestamp of another frame used as a reference (ie: B or P frame). The timestamp is relative to the block it's attached to.`},250:{name:`ReferencePriority`,cppname:`FlagReferenced`,level:3,type:`u`,mandatory:!0,minver:1,webm:!1,default:0,description:`This frame is referenced and has the specified cache priority. In cache only a frame of the same or higher priority can replace this frame. A value of 0 means the frame is not referenced.`},155:{name:`BlockDuration`,level:3,type:`u`,minver:1,default:`TrackDuration`,description:`The duration of the Block (based on TimecodeScale). This element is mandatory when DefaultDuration is set for the track (but can be omitted as other default values). When not written and with no DefaultDuration, the value is assumed to be the difference between the timestamp of this Block and the timestamp of the next Block in "display" order (not coding order). This element can be useful at the end of a Track (as there is not other Block available), or when there is a break in a track like for subtitle tracks. When set to 0 that means the frame is not a keyframe.`},165:{name:`BlockAdditional`,level:5,type:`b`,mandatory:!0,minver:1,webm:!1,description:`Interpreted by the codec as it wishes (using the BlockAddID).`},238:{name:`BlockAddID`,level:5,type:`u`,mandatory:!0,minver:1,webm:!1,default:1,range:`not 0`,description:`An ID to identify the BlockAdditional level.`},166:{name:`BlockMore`,level:4,type:`m`,mandatory:!0,multiple:!0,minver:1,webm:!1,description:`Contain the BlockAdditional and some parameters.`},30113:{name:`BlockAdditions`,level:3,type:`m`,minver:1,webm:!1,description:`Contain additional blocks to complete the main one. An EBML parser that has no knowledge of the Block structure could still see and use/skip these data.`},162:{name:`BlockVirtual`,level:3,type:`b`,webm:!1,description:`A Block with no data. It must be stored in the stream at the place the real Block should be in display order. (see Block Virtual)`},161:{name:`Block`,level:3,type:`b`,mandatory:!0,minver:1,description:`Block containing the actual data to be rendered and a timestamp relative to the Cluster Timecode. (see Block Structure)`},160:{name:`BlockGroup`,level:2,type:`m`,multiple:!0,minver:1,description:`Basic container of information containing a single Block or BlockVirtual, and information specific to that Block/VirtualBlock.`},163:{name:`SimpleBlock`,level:2,type:`b`,multiple:!0,minver:2,webm:!0,divx:!0,description:`Similar to SimpleBlock Structure`},171:{name:`PrevSize`,cppname:`ClusterPrevSize`,level:2,type:`u`,minver:1,description:`Size of the previous Cluster, in octets. Can be useful for backward playing.`,position:`prevCluster`},167:{name:`Position`,cppname:`ClusterPosition`,level:2,type:`u`,minver:1,webm:!1,description:`The Position of the Cluster in the segment (0 in live broadcast streams). It might help to resynchronise offset on damaged streams.`,position:`segment`},22743:{name:`SilentTrackNumber`,cppname:`ClusterSilentTrackNumber`,level:3,type:`u`,multiple:!0,minver:1,webm:!1,description:`One of the track number that are not used from now on in the stream. It could change later if not specified as silent in a further Cluster.`},231:{name:`Timecode`,cppname:`ClusterTimecode`,level:2,type:`u`,mandatory:!0,minver:1,description:`Absolute timestamp of the cluster (based on TimecodeScale).`},524531317:{name:`Cluster`,level:1,type:`m`,multiple:!0,minver:1,description:`The lower level element containing the (monolithic) Block structure.`},19840:{name:`MuxingApp`,level:2,type:`8`,mandatory:!0,minver:1,description:`Muxing application or library ("libmatroska-0.4.3").`},31657:{name:`Title`,level:2,type:`8`,minver:1,webm:!1,description:`General name of the segment.`},2807730:{name:`TimecodeScaleDenominator`,level:2,type:`u`,mandatory:!0,minver:4,default:`1000000000`,description:`Timestamp scale numerator, see TimecodeScale.`},2807729:{name:`TimecodeScale`,level:2,type:`u`,mandatory:!0,minver:1,default:`1000000`,description:`Timestamp scale in nanoseconds (1.000.000 means all timestamps in the segment are expressed in milliseconds).`},27045:{name:`ChapterTranslateID`,level:3,type:`b`,mandatory:!0,minver:1,webm:!1,description:`The binary value used to represent this segment in the chapter codec data. The format depends on the ChapProcessCodecID used.`},27071:{name:`ChapterTranslateCodec`,level:3,type:`u`,mandatory:!0,minver:1,webm:!1,description:`The chapter codec using this ID (0: Matroska Script, 1: DVD-menu).`},27132:{name:`ChapterTranslateEditionUID`,level:3,type:`u`,multiple:!0,minver:1,webm:!1,description:`Specify an edition UID on which this correspondance applies. When not specified, it means for all editions found in the segment.`},4096955:{name:`NextFilename`,level:2,type:`8`,minver:1,webm:!1,description:`An escaped filename corresponding to the next segment.`},4110627:{name:`NextUID`,level:2,type:`b`,minver:1,webm:!1,bytesize:16,description:`A unique ID to identify the next chained segment (128 bits).`},3965867:{name:`PrevFilename`,level:2,type:`8`,minver:1,webm:!1,description:`An escaped filename corresponding to the previous segment.`},3979555:{name:`PrevUID`,level:2,type:`b`,minver:1,webm:!1,bytesize:16,description:`A unique ID to identify the previous chained segment (128 bits).`},29604:{name:`SegmentUID`,level:2,type:`b`,minver:1,webm:!1,range:`not 0`,bytesize:16,description:`A randomly generated unique ID to identify the current segment between many others (128 bits).`},357149030:{name:`Info`,level:1,type:`m`,mandatory:!0,multiple:!0,minver:1,description:`Contains miscellaneous general information and statistics on the file.`},21420:{name:`SeekPosition`,level:3,type:`u`,mandatory:!0,minver:1,description:`The position of the element in the segment in octets (0 = first level 1 element).`,position:`segment`},21419:{name:`SeekID`,level:3,type:`b`,mandatory:!0,minver:1,description:`The binary ID corresponding to the element name.`,type2:`ebmlID`},19899:{name:`Seek`,cppname:`SeekPoint`,level:2,type:`m`,mandatory:!0,multiple:!0,minver:1,description:`Contains a single seek entry to an EBML element.`},290298740:{name:`SeekHead`,cppname:`SeekHeader`,level:1,type:`m`,multiple:!0,minver:1,description:`Contains the position of other level 1 elements.`},32379:{name:`SignatureElementList`,level:2,type:`m`,multiple:!0,webm:!1,i:`Cluster|Block|BlockAdditional`,description:`A list consists of a number of consecutive elements that represent one case where data is used in signature. Ex: means that the BlockAdditional of all Blocks in all Clusters is used for encryption.`},32347:{name:`SignatureElements`,level:1,type:`m`,webm:!1,description:`Contains elements that will be used to compute the signature.`},32437:{name:`Signature`,level:1,type:`b`,webm:!1,description:`The signature of the data (until a new.`},32421:{name:`SignaturePublicKey`,level:1,type:`b`,webm:!1,description:`The public key to use with the algorithm (in the case of a PKI-based signature).`},32410:{name:`SignatureHash`,level:1,type:`u`,webm:!1,description:`Hash algorithm used (1=SHA1-160, 2=MD5).`},32394:{name:`SignatureAlgo`,level:1,type:`u`,webm:!1,description:`Signature algorithm used (1=RSA, 2=elliptic).`},458458727:{name:`SignatureSlot`,level:-1,type:`m`,multiple:!0,webm:!1,description:`Contain signature of some (coming) elements in the stream.`},191:{name:`CRC-32`,level:-1,type:`b`,minver:1,webm:!1,description:`The CRC is computed on all the data of the Master element it's in. The CRC element should be the first in it's parent master for easier reading. All level 1 elements should include a CRC-32. The CRC in use is the IEEE CRC32 Little Endian`,crc:!0},236:{name:`Void`,level:-1,type:`b`,minver:1,description:`Used to void damaged data, to avoid unexpected behaviors when using damaged data. The content is discarded. Also used to reserve space in a sub-element for later use.`},17139:{name:`EBMLMaxSizeLength`,level:1,type:`u`,mandatory:!0,default:8,minver:1,description:`The maximum length of the sizes you'll find in this file (8 or less in Matroska). This does not override the element size indicated at the beginning of an element. Elements that have an indicated size which is larger than what is allowed by EBMLMaxSizeLength shall be considered invalid.`},17138:{name:`EBMLMaxIDLength`,level:1,type:`u`,mandatory:!0,default:4,minver:1,description:`The maximum length of the IDs you'll find in this file (4 or less in Matroska).`},17143:{name:`EBMLReadVersion`,level:1,type:`u`,mandatory:!0,default:1,minver:1,description:`The minimum EBML version a parser has to support to read this file.`},440786851:{name:`EBML`,level:`0`,type:`m`,mandatory:!0,multiple:!0,minver:1,description:`Set the EBML characteristics of the data to follow. Each EBML document has to start with this.`},21936:{name:`Colour`,level:`4`,type:`m`,mandatory:!0,multiple:!0,description:`Settings describing the colour format.`},21937:{name:`MatrixCoefficients`,level:`5`,type:`u`,mandatory:!0,multiple:!0,description:`The Matrix Coefficients of the video used to derive luma and chroma values from red, green, and blue color primaries. For clarity, the value and meanings for MatrixCoefficients are adopted from Table 4 of ISO/IEC 23001-8:2016 or ITU-T H.273.`},21945:{name:`Range`,level:`5`,type:`u`,mandatory:!0,multiple:!0,description:`Clipping of the color ranges.`},21946:{name:`TransferCharacteristics`,level:`5`,type:`u`,mandatory:!0,multiple:!0,description:`The transfer characteristics of the video.`},21947:{name:`Primaries`,level:`5`,type:`u`,mandatory:!0,multiple:!0,description:`The colour primaries of the video. For clarity, the value and meanings for Primaries are adopted from Table 2 of ISO/IEC 23091-4 or ITU-T H.273.`}}})),Od=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Id(),n=Id(),r=Dd();e.default=function(){function e(){this._schema=r.byEbmlID,this._buffers=[],this._stack=[]}return e.prototype.encode=function(e){var n=this;return t.concat(e.reduce(function(e,t){return e.concat(n.encodeChunk(t))},[])).buffer},e.prototype.encodeChunk=function(e){return e.type===`m`?e.isEnd?this.endTag(e):this.startTag(e):(e.data=n.Buffer.from(e.data),this.writeTag(e)),this.flush()},e.prototype.flush=function(){var e=this._buffers;return this._buffers=[],e},e.prototype.getSchemaInfo=function(e){for(var t=Object.keys(this._schema).map(Number),r=0;r<t.length;r++){var i=t[r];if(this._schema[i].name===e)return new n.Buffer(i.toString(16),`hex`)}return null},e.prototype.writeTag=function(e){var n=e.name,r=this.getSchemaInfo(n),i=e.data;if(r==null)throw Error(`No schema entry found for `+n);var a=t.encodeTag(r,i);if(this._stack.length>0){this._stack[this._stack.length-1].children.push({tagId:r,elm:e,children:[],data:a});return}this._buffers=this._buffers.concat(a)},e.prototype.startTag=function(e){var r=e.name,i=this.getSchemaInfo(r);if(i==null)throw Error(`No schema entry found for `+r);if(e.unknownSize){var a=t.encodeTag(i,new n.Buffer(0),e.unknownSize);this._buffers=this._buffers.concat(a);return}var o={tagId:i,elm:e,children:[],data:null};this._stack.length>0&&this._stack[this._stack.length-1].children.push(o),this._stack.push(o)},e.prototype.endTag=function(e){e.name;var n=this._stack.pop();if(n==null||n.elm.name!==e.name)throw Error(`EBML structure is broken`);var r=n.children.reduce(function(e,t){if(t.data===null)throw Error(`EBML structure is broken`);return e.concat(t.data)},[]),i=t.concat(r);n.elm.type===`m`?n.data=t.encodeTag(n.tagId,i,n.elm.unknownSize):n.data=t.encodeTag(n.tagId,i),this._stack.length<1&&(this._buffers=this._buffers.concat(n.data))},e}()})),kd=s((e=>{e.byteLength=c,e.toByteArray=u,e.fromByteArray=p;for(var t=[],n=[],r=typeof Uint8Array<`u`?Uint8Array:Array,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,a=0,o=i.length;a<o;++a)t[a]=i[a],n[i.charCodeAt(a)]=a;n[45]=62,n[95]=63;function s(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function u(e){var t,i=s(e),a=i[0],o=i[1],c=new r(l(e,a,o)),u=0,d=o>0?a-4:a,f;for(f=0;f<d;f+=4)t=n[e.charCodeAt(f)]<<18|n[e.charCodeAt(f+1)]<<12|n[e.charCodeAt(f+2)]<<6|n[e.charCodeAt(f+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=t&255;return o===2&&(t=n[e.charCodeAt(f)]<<2|n[e.charCodeAt(f+1)]>>4,c[u++]=t&255),o===1&&(t=n[e.charCodeAt(f)]<<10|n[e.charCodeAt(f+1)]<<4|n[e.charCodeAt(f+2)]>>2,c[u++]=t>>8&255,c[u++]=t&255),c}function d(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function f(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(d(r));return i.join(``)}function p(e){for(var n,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;s<c;s+=o)a.push(f(e,s,s+o>c?c:s+o));return i===1?(n=e[r-1],a.push(t[n>>2]+t[n<<4&63]+`==`)):i===2&&(n=(e[r-2]<<8)+e[r-1],a.push(t[n>>10]+t[n>>4&63]+t[n<<2&63]+`=`)),a.join(``)}})),Ad=s((e=>{e.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else if(a===c)return o?NaN:(p?-1:1)*(1/0);else o+=2**r,a-=l;return(p?-1:1)*o*2**(a-r)},e.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}})),jd=s((e=>{var t=kd(),n=Ad(),r=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=s,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50;var i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,`parent`,{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,`offset`,{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(e){if(e>i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return d(e)}return c(e,t,n)}s.poolSize=8192;function c(e,t,n){if(typeof e==`string`)return f(e,t);if(ArrayBuffer.isView(e))return m(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(N(e,SharedArrayBuffer)||e&&N(e.buffer,SharedArrayBuffer)))return h(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return s.from(r,t,n);let i=g(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return s.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}s.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function u(e,t,n){return l(e),e<=0||t===void 0?o(e):typeof n==`string`?o(e).fill(t,n):o(e).fill(t)}s.alloc=function(e,t,n){return u(e,t,n)};function d(e){return l(e),o(e<0?0:_(e)|0)}s.allocUnsafe=function(e){return d(e)},s.allocUnsafeSlow=function(e){return d(e)};function f(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!s.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=y(e,t)|0,r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function p(e){let t=e.length<0?0:_(e.length)|0,n=o(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function m(e){if(N(e,Uint8Array)){let t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}function h(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,s.prototype),r}function g(e){if(s.isBuffer(e)){let t=_(e.length)|0,n=o(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||Te(e.length)?o(0):p(e);if(e.type===`Buffer`&&Array.isArray(e.data))return p(e.data)}function _(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function v(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(N(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),N(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return s.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(N(t,Uint8Array))i+t.length>r.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else if(s.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function y(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||N(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return be(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return Ce(e).length;default:if(i)return r?-1:be(e).length;t=(``+t).toLowerCase(),i=!0}}s.byteLength=y;function b(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return ae(this,t,n);case`utf8`:case`utf-8`:return k(this,t,n);case`ascii`:return re(this,t,n);case`latin1`:case`binary`:return ie(this,t,n);case`base64`:return O(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return oe(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function x(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}s.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)x(this,t,t+1);return this},s.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)x(this,t,t+3),x(this,t+1,t+2);return this},s.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)x(this,t,t+7),x(this,t+1,t+6),x(this,t+2,t+5),x(this,t+3,t+4);return this},s.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?k(this,0,e):b.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e?!0:s.compare(this,e)===0},s.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(e,t,n,r,i){if(N(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let a=i-r,o=n-t,c=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<c;++e)if(l[e]!==u[e]){a=l[e],o=u[e];break}return a<o?-1:o<a?1:0};function S(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,Te(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t==`string`&&(t=s.from(t,r)),s.isBuffer(t))return t.length===0?-1:C(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):C(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function C(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}s.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},s.prototype.indexOf=function(e,t,n){return S(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return S(this,e,t,n,!1)};function w(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o;for(o=0;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(Te(r))return o;e[n+o]=r}return o}function T(e,t,n,r){return we(be(t,e.length-n),e,n,r)}function E(e,t,n,r){return we(xe(t),e,n,r)}function D(e,t,n,r){return we(Ce(t),e,n,r)}function ee(e,t,n,r){return we(Se(t,e.length-n),e,n,r)}s.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return w(this,e,t,n);case`utf8`:case`utf-8`:return T(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return E(this,e,t,n);case`base64`:return D(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return ee(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function O(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function k(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return ne(r)}var te=4096;function ne(e){let t=e.length;if(t<=te)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=te));return n}function re(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function ie(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function ae(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=Ee[e[r]];return i}function oe(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}s.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,s.prototype),r};function A(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||A(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||A(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=De(function(e){e>>>=0,ge(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&_e(e,this.length-8);let r=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),s.prototype.readBigUInt64BE=De(function(e){e>>>=0,ge(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&_e(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||A(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||A(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||A(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||A(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=De(function(e){e>>>=0,ge(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&_e(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),s.prototype.readBigInt64BE=De(function(e){e>>>=0,ge(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&_e(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||A(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||A(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||A(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||A(e,8,this.length),n.read(this,e,!1,52,8)};function j(e,t,n,r,i,a){if(!s.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;j(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;j(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function se(e,t,n,r,i){he(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function ce(e,t,n,r,i){he(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}s.prototype.writeBigUInt64LE=De(function(e,t=0){return se(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeBigUInt64BE=De(function(e,t=0){return ce(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);j(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);j(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeBigInt64LE=De(function(e,t=0){return se(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),s.prototype.writeBigInt64BE=De(function(e,t=0){return ce(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function le(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function ue(e,t,r,i,a){return t=+t,r>>>=0,a||le(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}s.prototype.writeFloatLE=function(e,t,n){return ue(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return ue(this,e,t,!1,n)};function de(e,t,r,i,a){return t=+t,r>>>=0,a||le(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}s.prototype.writeDoubleLE=function(e,t,n){return de(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return de(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},s.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!s.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=s.isBuffer(e)?e:s.from(e,r),o=a.length;if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};var fe={};function pe(e,t,n){fe[e]=class extends n{constructor(){super(),Object.defineProperty(this,`message`,{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,`code`,{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}pe(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),pe(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),pe(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=me(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=me(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function me(e){let t=``,n=e.length,r=e[0]===`-`?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function M(e,t,n){ge(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&_e(t,e.length-(n+1))}function he(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new fe.ERR_OUT_OF_RANGE(`value`,i,e)}M(r,i,a)}function ge(e,t){if(typeof e!=`number`)throw new fe.ERR_INVALID_ARG_TYPE(t,`number`,e)}function _e(e,t,n){throw Math.floor(e)===e?t<0?new fe.ERR_BUFFER_OUT_OF_BOUNDS:new fe.ERR_OUT_OF_RANGE(n||`offset`,`>= ${n?1:0} and <= ${t}`,e):(ge(e,n),new fe.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}var ve=/[^+/0-9A-Za-z-_]/g;function ye(e){if(e=e.split(`=`)[0],e=e.trim().replace(ve,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function be(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function xe(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function Se(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function Ce(e){return t.toByteArray(ye(e))}function we(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function N(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Te(e){return e!==e}var Ee=(function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t})();function De(e){return typeof BigInt>`u`?Oe:e}function Oe(){throw Error(`BigInt not supported`)}})),Md=s((e=>{var t=e&&e.__assign||function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)},n=e&&e.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(e,`__esModule`,{value:!0});var r=Id();e.default=function(){function e(){}return e.readVint=function(t,n){n===void 0&&(n=0);var r=8-Math.floor(Math.log2(t[n]));if(r>8){var i=e.readHexString(t,n,n+r);throw Error(`Unrepresentable length: ${r} ${i}`)}if(n+r>t.length)return null;for(var a=t[n]&(1<<8-r)-1,o=1;o<r;o+=1){if(o===7&&a>=2**8&&t[n+7]>0)return{length:r,value:-1};a*=2**8,a+=t[n+o]}return{length:r,value:a}},e.writeVint=function(e){if(e<0||e>2**53)throw Error(`Unrepresentable value: ${e}`);var t=1;for(t=1;t<=8&&!(e<2**(7*t)-1);t+=1);for(var n=r.Buffer.alloc(t),i=e,a=1;a<=t;a+=1){var o=i&255;n[t-a]=o,i-=o,i/=2**8}return n[0]|=1<<8-t,n},e.concatenate=function(e,t){return!e&&!t?r.Buffer.from([]):!e||e.byteLength===0?t:!t||t.byteLength===0?e:r.Buffer.from(n(n([],e,!0),t,!0))},e.readHexString=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=e.byteLength),Array.from(e.slice(t,n)).map(function(e){return Number(e).toString(16)}).reduce(function(e,t){return`${e}${t.padStart(2,`0`)}`},``)},e.readUtf8=function(e){try{return r.Buffer.from(e).toString(`utf8`)}catch{return null}},e.readUnsigned=function(t){var n=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 1:return n.getUint8(0);case 2:return n.getUint16(0);case 4:return n.getUint32(0);default:break}return t.byteLength<=6?t.reduce(function(e,t){return e*256+t},0):e.readHexString(t,0,t.byteLength)},e.readSigned=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 1:return t.getInt8(0);case 2:return t.getInt16(0);case 4:return t.getInt32(0);default:return NaN}},e.readFloat=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return t.getFloat32(0);case 8:return t.getFloat64(0);default:return NaN}},e.readDate=function(t){var n=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 1:return new Date(n.getUint8(0));case 2:return new Date(n.getUint16(0));case 4:return new Date(n.getUint32(0));case 8:return new Date(Number.parseInt(e.readHexString(t),16));default:return new Date(0)}},e.readDataFromTag=function(n,r){var i=n.type,a=n.name,o=n.track,s=n.discardable||!1,c=n.keyframe||!1,l=null,u;switch(i){case`u`:u=e.readUnsigned(r);break;case`f`:u=e.readFloat(r);break;case`i`:u=e.readSigned(r);break;case`s`:u=String.fromCharCode.apply(String,r);break;case`8`:u=e.readUtf8(r);break;case`d`:u=e.readDate(r);break;default:break}if(a===`SimpleBlock`||a===`Block`){var d=0,f=e.readVint(r,d),p=f.length,m=f.value;d+=p,o=m,u=e.readSigned(r.subarray(d,d+2)),d+=2,a===`SimpleBlock`&&(c=!!(r[p+2]&128),s=!!(r[p+2]&1)),d+=1,l=r.subarray(d)}return t(t({},n),{data:r,discardable:s,keyframe:c,payload:l,track:o,value:u})},e}()})),Nd=s(((e,t)=>{t.exports=function(e,t,n){t||=0;for(var r=1;r<=8&&!(e[t]>=2**(8-r));r++);if(r>8)throw Error(`Unrepresentable length: `+r+` `+e.toString(`hex`,t,t+r));if(t+r>e.length)return null;var i,a=e[t]&(1<<8-r)-1;for(i=1;i<r;i++){if(i===7&&a>=2**45&&e[t+7]>0)return{length:r,value:-1};a*=2**8,a+=e[t+i]}return n&&(a-=2**(r*7-1)-1),{length:r,value:a}}})),Pd=s(((e,t)=>{var n=Nd();function r(e){this.buffer=e,this.offset=0}r.prototype.nextInt16BE=function(){var e=this.buffer.readInt16BE(this.offset);return this.offset+=2,e},r.prototype.nextUInt8=function(){var e=this.buffer.readUInt8(this.offset);return this.offset+=1,e},r.prototype.nextUIntV=function(){var e=n(this.buffer,this.offset);return this.offset+=e.length,e.value},r.prototype.nextIntV=function(){var e=n(this.buffer,this.offset,!0);return this.offset+=e.length,e.value},r.prototype.nextBuffer=function(e){var t=e?this.buffer.slice(this.offset,this.offset+e):this.buffer.slice(this.offset);return this.offset+=e||this.length,t},Object.defineProperty(r.prototype,`length`,{get:function(){return this.buffer.length-this.offset}}),t.exports=r})),Fd=s(((e,t)=>{var n=Pd(),r=1,i=3,a=2;t.exports=function(e){var t={},r=new n(e);t.trackNumber=r.nextUIntV(),t.timecode=r.nextInt16BE();var i=r.nextUInt8();return t.invisible=!!(i&8),t.keyframe=!!(i&128),t.discardable=!!(i&1),t.frames=o(r,(i&6)>>1),t};function o(e,t){if(!t)return[e.nextBuffer()];var n,o,s=[],c=e.nextUInt8()+1;if(t===a){if(e.length%c!==0)throw Error(`Fixed-Size Lacing Error`);for(o=e.length/c,n=0;n<c;n++)s.push(e.nextBuffer(o));return s}var l=[];if(t===r)for(n=0;n<c-1;n++){var u;o=0;do u=e.nextUInt8(),o+=u;while(u===255);l.push(o)}else if(t===i)for(o=e.nextUIntV(),l.push(o),n=1;n<c-1;n++)o+=e.nextIntV(),l.push(o);for(n=0;n<c-1;n++)s.push(e.nextBuffer(l[n]));return s.push(e.nextBuffer()),s}})),Id=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.convertEBMLDateToJSDate=e.createFloatBuffer=e.createIntBuffer=e.createUIntBuffer=e.encodeValueToBuffer=e.concat=e.putRefinedMetaData=e.extractElement=e.removeElement=e.makeMetadataSeekable=e.createRIFFChunk=e.VP8BitStreamToRiffWebPBuffer=e.WebPBlockFilter=e.encodeTag=e.readBlock=e.ebmlBlock=e.writeVint=e.readVint=e.Buffer=void 0;var t=Ed(),n=Od(),r=jd(),i=Md(),a=Fd();e.Buffer=r.Buffer,e.readVint=i.default.readVint,e.writeVint=i.default.writeVint,e.ebmlBlock=a;function o(t){return(0,e.ebmlBlock)(new e.Buffer(t))}e.readBlock=o;function s(t,n,r){return r===void 0&&(r=!1),b([t,r?new e.Buffer(`01ffffffffffffff`,`hex`):(0,e.writeVint)(n.length),n])}e.encodeTag=s;function c(t){return t.reduce(function(t,n){return n.type!==`b`||n.name!==`SimpleBlock`||!(0,e.ebmlBlock)(n.data).frames.some(function(e){return e.slice(3,6).toString(`hex`)===`9d012a`})?t:t.concat(n)},[])}e.WebPBlockFilter=c;function l(t){var n=u(`VP8 `,t);return u(`RIFF`,b([new e.Buffer(`WEBP`,`ascii`),n]))}e.VP8BitStreamToRiffWebPBuffer=l;function u(t,n){var r=new e.Buffer(4);return r.writeUInt32LE(n.byteLength,0),b([new e.Buffer(t.substr(0,4),`ascii`),r,n,new e.Buffer(n.byteLength%2==0?0:1)])}e.createRIFFChunk=u;function d(t,r,i){var a=p(`EBML`,t),o=h(a)+12,s=t[t.length-1].dataEnd-o,c=p(`Info`,t);f(`Duration`,c),c.splice(1,0,{name:`Duration`,type:`f`,data:w(r,8)});for(var l=h(c),u=p(`Tracks`,t),d=h(u),m=47,g=[],_=5+i.length*15,v=[],y=-1,b=10,x=function(t){var n=m,r=n+l,a=r+d,c=a+_-s;if(g=[],g.push({name:`SeekHead`,type:`m`,isEnd:!1}),g.push({name:`Seek`,type:`m`,isEnd:!1}),g.push({name:`SeekID`,type:`b`,data:new e.Buffer([21,73,169,102])}),g.push({name:`SeekPosition`,type:`u`,data:S(n)}),g.push({name:`Seek`,type:`m`,isEnd:!0}),g.push({name:`Seek`,type:`m`,isEnd:!1}),g.push({name:`SeekID`,type:`b`,data:new e.Buffer([22,84,174,107])}),g.push({name:`SeekPosition`,type:`u`,data:S(r)}),g.push({name:`Seek`,type:`m`,isEnd:!0}),g.push({name:`Seek`,type:`m`,isEnd:!1}),g.push({name:`SeekID`,type:`b`,data:new e.Buffer([28,83,187,107])}),g.push({name:`SeekPosition`,type:`u`,data:S(a)}),g.push({name:`Seek`,type:`m`,isEnd:!0}),g.push({name:`SeekHead`,type:`m`,isEnd:!0}),m=h(g),v=[],v.push({name:`Cues`,type:`m`,isEnd:!1}),i.forEach(function(e){var t=e.CueTrack,n=e.CueClusterPosition,r=e.CueTime;v.push({name:`CuePoint`,type:`m`,isEnd:!1}),v.push({name:`CueTime`,type:`u`,data:S(r)}),v.push({name:`CueTrackPositions`,type:`m`,isEnd:!1}),v.push({name:`CueTrack`,type:`u`,data:S(t)}),n-=o,n+=c,v.push({name:`CueClusterPosition`,type:`u`,data:S(n)}),v.push({name:`CueTrackPositions`,type:`m`,isEnd:!0}),v.push({name:`CuePoint`,type:`m`,isEnd:!0})}),v.push({name:`Cues`,type:`m`,isEnd:!0}),_=h(v),y!==c){if(y=c,t===b-1)throw Error(`Failed to converge to a stable metadata size`)}else return`break`},C=0;C<b&&x(C)!==`break`;C++);var T=[].concat.apply([],[a,{name:`Segment`,type:`m`,isEnd:!1,unknownSize:!0},g,c,u,v]);return new n.default().encode(T)}e.makeMetadataSeekable=d;function f(e,t){for(var n=-1,r=0;r<t.length;r++){var i=t[r];if(i.name===e)if(i.type===`m`)if(!i.isEnd)n=r;else{if(n==-1)throw Error(`Detected ${e} closing element before finding the start`);t.splice(n,r-n+1);return}else{t.splice(r,1);return}}}e.removeElement=f;function p(e,t){for(var n=[],r=-1,i=0;i<t.length;i++){var a=t[i];if(a.name===e)if(a.type===`m`)if(!a.isEnd)r=i;else{if(r==-1)throw Error(`Detected ${e} closing element before finding the start`);n=t.slice(r,i+1);break}else{n.push(t[i]);break}}return n}e.extractElement=p;function m(t,r){Array.isArray(r.cueInfos)&&!Array.isArray(r.cues)&&(console.warn(`putRefinedMetaData: info.cueInfos property is deprecated. please use info.cues`),r.cues=r.cueInfos);for(var i=[],a=[],o=0;o<t.length;o++){var s=t[o];if(s.type===`m`&&s.name===`Segment`){if(i=t.slice(0,o),a=t.slice(o),s.unknownSize){a.shift();break}throw Error(`this metadata is not streaming webm file`)}}if(!(a[a.length-1].dataEnd>0))throw Error(`metadata dataEnd has wrong number`);var c=a[a.length-1].dataEnd,l=i[i.length-1].dataEnd,u=new n.default().encode(i).byteLength-l,d=c-a[0].tagStart;a[0].tagStart-l,a[0].tagStart;var f=new e.Buffer([24,83,128,103]),p=new e.Buffer(`01ffffffffffffff`,`hex`),m=f.byteLength+p.byteLength,h=d,_;for(_=1;_<20;_++){var v=u+(l+m+h-c),y=g(a,v,r),b=new n.default().encode(y).byteLength;if(b===h)return new n.default().encode([].concat(i,[{type:`m`,name:`Segment`,isEnd:!1,unknownSize:!0}],y));h=b}throw Error(`unable to refine metadata, stable size could not be found in `+_+` iterations!`)}e.putRefinedMetaData=m;function h(e){var t=new n.default;return e.reduce(function(e,n){return e.concat(t.encode([n]))},[]).reduce(function(e,t){return e+t.byteLength},0)}function g(e,t,n){var r=n.duration,i=n.clusterPtrs,a=n.cues,o=e.slice(0);if(typeof r==`number`){var s=!1;o.forEach(function(e){e.type===`f`&&e.name===`Duration`&&(s=!0,e.data=w(r,8))}),s||y(o,`Info`,[{name:`Duration`,type:`f`,data:w(r,8)}])}Array.isArray(a)&&y(o,`Cues`,v(a,t));var c=[];return Array.isArray(i)&&(console.warn(`append cluster pointers to seekhead is deprecated. please use cues`),c=_(i,t)),y(o,`SeekHead`,c,!0),o}function _(t,n){var r=[];return t.forEach(function(t){r.push({name:`Seek`,type:`m`,isEnd:!1}),r.push({name:`SeekID`,type:`b`,data:new e.Buffer([31,67,182,117])}),r.push({name:`SeekPosition`,type:`u`,data:S(t+n)}),r.push({name:`Seek`,type:`m`,isEnd:!0})}),r}function v(e,t){var n=[];return e.forEach(function(e){var r=e.CueTrack,i=e.CueClusterPosition,a=e.CueTime;n.push({name:`CuePoint`,type:`m`,isEnd:!1}),n.push({name:`CueTime`,type:`u`,data:S(a)}),n.push({name:`CueTrackPositions`,type:`m`,isEnd:!1}),n.push({name:`CueTrack`,type:`u`,data:S(r)}),n.push({name:`CueClusterPosition`,type:`u`,data:S(i+t)}),n.push({name:`CueTrackPositions`,type:`m`,isEnd:!0}),n.push({name:`CuePoint`,type:`m`,isEnd:!0})}),n}function y(e,t,n,r){r===void 0&&(r=!1);for(var i=-1,a=0;a<e.length;a++){var o=e[a];if(o.type===`m`&&o.name===t&&o.isEnd===!1){i=a;break}}i>=0?Array.prototype.splice.apply(e,[i+1,0].concat(n)):r?[{name:t,type:`m`,isEnd:!1}].concat(n,[{name:t,type:`m`,isEnd:!0}]).reverse().forEach(function(t){e.unshift(t)}):(e.push({name:t,type:`m`,isEnd:!1}),n.forEach(function(t){e.push(t)}),e.push({name:t,type:`m`,isEnd:!0}))}function b(t){return e.Buffer.concat(t)}e.concat=b;function x(n){var r=new e.Buffer(0);if(n.type===`m`)return n;switch(n.type){case`u`:r=S(n.value);break;case`i`:r=C(n.value);break;case`f`:r=w(n.value);break;case`s`:r=new e.Buffer(n.value,`ascii`);break;case`8`:r=new e.Buffer(n.value,`utf8`);break;case`b`:r=n.value;break;case`d`:r=new t.Int64BE(n.value.getTime().toString()).toBuffer();break}return Object.assign({},n,{data:r})}e.encodeValueToBuffer=x;function S(n){for(var r=1;n>=2**(8*r);r++);if(r>=7)return console.warn(`7bit or more bigger uint not supported.`),new t.Uint64BE(n).toBuffer();var i=new e.Buffer(r);return i.writeUIntBE(n,0,r),i}e.createUIntBuffer=S;function C(n){for(var r=1;n>=2**(8*r);r++);if(r>=7)return console.warn(`7bit or more bigger uint not supported.`),new t.Int64BE(n).toBuffer();var i=new e.Buffer(r);return i.writeIntBE(n,0,r),i}e.createIntBuffer=C;function w(t,n){if(n===void 0&&(n=8),n===8){var r=new e.Buffer(8);return r.writeDoubleBE(t,0),r}else if(n===4){var r=new e.Buffer(4);return r.writeFloatBE(t,0),r}else throw Error(`float type bits must 4bytes or 8bytes`)}e.createFloatBuffer=w;function T(e){return e instanceof Date?e:new Date(new Date(`2001-01-01T00:00:00.000Z`).getTime()+Number(e)/1e3/1e3)}e.convertEBMLDateToJSDate=T})),Ld=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Ed(),n=Id(),r=Id(),i=Dd(),a;(function(e){e[e.STATE_TAG=1]=`STATE_TAG`,e[e.STATE_SIZE=2]=`STATE_SIZE`,e[e.STATE_CONTENT=3]=`STATE_CONTENT`})(a||={}),e.default=function(){function e(){this._buffer=new n.Buffer(0),this._tag_stack=[],this._state=a.STATE_TAG,this._cursor=0,this._total=0,this._schema=i.byEbmlID,this._result=[]}return e.prototype.decode=function(e){this.readChunk(e);var t=this._result;return this._result=[],t},e.prototype.readChunk=function(e){for(this._buffer=r.concat([this._buffer,new n.Buffer(e)]);this._cursor<this._buffer.length&&!(this._state===a.STATE_TAG&&!this.readTag()||this._state===a.STATE_SIZE&&!this.readSize()||this._state===a.STATE_CONTENT&&!this.readContent()););},e.prototype.getSchemaInfo=function(e){return this._schema[e]||{name:`unknown`,level:-1,type:`unknown`,description:`unknown`}},e.prototype.readTag=function(){if(this._cursor>=this._buffer.length)return!1;var e=(0,n.readVint)(this._buffer,this._cursor);if(e==null)return!1;var t=this._buffer.slice(this._cursor,this._cursor+e.length).reduce(function(e,t,n,r){return e+t*16**(2*(r.length-1-n))},0),r=this.getSchemaInfo(t),i={EBML_ID:t.toString(16),schema:r,type:r.type,name:r.name,level:r.level,tagStart:this._total,tagEnd:this._total+e.length,sizeStart:this._total+e.length,sizeEnd:null,dataStart:null,dataEnd:null,dataSize:null,data:null};return this._tag_stack.push(i),this._cursor+=e.length,this._total+=e.length,this._state=a.STATE_SIZE,!0},e.prototype.readSize=function(){if(this._cursor>=this._buffer.length)return!1;var e=(0,n.readVint)(this._buffer,this._cursor);if(e==null)return!1;var t=this._tag_stack[this._tag_stack.length-1];return t.sizeEnd=t.sizeStart+e.length,t.dataStart=t.sizeEnd,t.dataSize=e.value,e.value===-1?(t.dataEnd=-1,t.type===`m`&&(t.unknownSize=!0)):t.dataEnd=t.sizeEnd+e.value,this._cursor+=e.length,this._total+=e.length,this._state=a.STATE_CONTENT,!0},e.prototype.readContent=function(){var e=this._tag_stack[this._tag_stack.length-1];if(e.type===`m`){if(e.isEnd=!1,this._result.push(e),this._state=a.STATE_TAG,e.dataSize===0){var r=Object.assign({},e,{isEnd:!0});this._result.push(r),this._tag_stack.pop()}return!0}if(this._buffer.length<this._cursor+e.dataSize)return!1;var i=this._buffer.slice(this._cursor,this._cursor+e.dataSize);switch(this._buffer=this._buffer.slice(this._cursor+e.dataSize),e.data=i,e.type){case`u`:e.value=i.readUIntBE(0,i.length);break;case`i`:e.value=i.readIntBE(0,i.length);break;case`f`:e.value=e.dataSize===4?i.readFloatBE(0):e.dataSize===8?i.readDoubleBE(0):(console.warn(`cannot read ${e.dataSize} octets float. failback to 0`),0);break;case`s`:e.value=i.toString(`ascii`);break;case`8`:e.value=i.toString(`utf8`);break;case`b`:e.value=i;break;case`d`:e.value=(0,n.convertEBMLDateToJSDate)(new t.Int64BE(i).toNumber());break}if(e.value===null)throw Error(`unknown tag type:`+e.type);for(this._result.push(e),this._total+=e.dataSize,this._state=a.STATE_TAG,this._cursor=0,this._tag_stack.pop();this._tag_stack.length>0;){var o=this._tag_stack[this._tag_stack.length-1];if(o.dataEnd<0)return this._tag_stack.pop(),!0;if(this._total<o.dataEnd)break;if(o.type!==`m`)throw Error(`parent element is not master element`);var r=Object.assign({},o,{isEnd:!0});this._result.push(r),this._tag_stack.pop()}return!0},e}()})),Rd=s(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,`defaultMaxListeners`,{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}})),zd=s((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0});var n=Rd(),r=Id();e.default=function(e){t(n,e);function n(){var t=e.call(this)||this;return t.logGroup=``,t.hasLoggingStarted=!1,t.metadataloaded=!1,t.chunks=[],t.stack=[],t.segmentOffset=0,t.last2SimpleBlockVideoTrackTimecode=[0,0],t.last2SimpleBlockAudioTrackTimecode=[0,0],t.lastClusterTimecode=0,t.lastClusterPosition=0,t.timecodeScale=1e6,t.metadataSize=0,t.metadatas=[],t.cues=[],t.firstVideoBlockRead=!1,t.firstAudioBlockRead=!1,t.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null},t.trackTypes=[],t.trackDefaultDuration=[],t.trackCodecDelay=[],t.trackInfo={type:`nothing`},t.ended=!1,t.logging=!1,t.use_duration_every_simpleblock=!1,t.use_webp=!1,t.use_segment_info=!0,t.drop_default_duration=!0,t}return n.prototype.stop=function(){for(this.ended=!0,this.emit_segment_info();this.stack.length;)this.stack.pop(),this.logging&&console.groupEnd();this.logging&&this.hasLoggingStarted&&this.logGroup&&console.groupEnd()},n.prototype.emit_segment_info=function(){var e=this.chunks;if(this.chunks=[],this.metadataloaded){if(!this.use_segment_info)return;var t=this.lastClusterTimecode,n=this.duration,r=this.timecodeScale;this.emit(`cluster`,{timecode:t,data:e}),this.emit(`duration`,{timecodeScale:r,duration:n})}else{this.metadataloaded=!0,this.metadatas=e;var i=this.trackTypes.indexOf(1),a=this.trackTypes.indexOf(2);if(this.trackInfo=i>=0&&a>=0?{type:`both`,trackNumber:i}:i>=0?{type:`video`,trackNumber:i}:a>=0?{type:`audio`,trackNumber:a}:{type:`nothing`},!this.use_segment_info)return;this.emit(`metadata`,{data:e,metadataSize:this.metadataSize})}},n.prototype.read=function(e){var t=this,n=!1;if(!this.ended){if(e.type===`m`)if(e.isEnd)this.stack.pop();else{var i=this.stack[this.stack.length-1];if(i!=null&&i.level>=e.level){this.stack.pop(),this.logging&&console.groupEnd(),i.dataEnd=e.dataEnd,i.dataSize=e.dataEnd-i.dataStart,i.unknownSize=!1;var a=Object.assign({},i,{name:i.name,type:i.type,isEnd:!0});this.chunks.push(a)}this.stack.push(e)}if(e.type===`m`&&e.name==`Segment`)this.segmentOffset!=0&&console.warn(`Multiple segments detected!`),this.segmentOffset=e.dataStart,this.emit(`segment_offset`,this.segmentOffset);else if(e.type===`b`&&e.name===`SimpleBlock`){var o=r.ebmlBlock(e.data),s=o.timecode,c=o.trackNumber,l=o.frames;if(this.trackTypes[c]===1){if(!this.firstVideoBlockRead&&(this.firstVideoBlockRead=!0,this.trackInfo.type===`both`||this.trackInfo.type===`video`)){var u=this.lastClusterTimecode+s;this.cues.push({CueTrack:c,CueClusterPosition:this.lastClusterPosition,CueTime:u}),this.emit(`cue_info`,{CueTrack:c,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit(`cue`,{CueTrack:c,CueClusterPosition:this.lastClusterPosition,CueTime:u})}this.last2SimpleBlockVideoTrackTimecode=[this.last2SimpleBlockVideoTrackTimecode[1],s]}else if(this.trackTypes[c]===2){if(!this.firstAudioBlockRead&&(this.firstAudioBlockRead=!0,this.trackInfo.type===`audio`)){var u=this.lastClusterTimecode+s;this.cues.push({CueTrack:c,CueClusterPosition:this.lastClusterPosition,CueTime:u}),this.emit(`cue_info`,{CueTrack:c,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit(`cue`,{CueTrack:c,CueClusterPosition:this.lastClusterPosition,CueTime:u})}this.last2SimpleBlockAudioTrackTimecode=[this.last2SimpleBlockAudioTrackTimecode[1],s]}this.use_duration_every_simpleblock&&this.emit(`duration`,{timecodeScale:this.timecodeScale,duration:this.duration}),this.use_webp&&l.forEach(function(e){if(e.slice(3,6).toString(`hex`)===`9d012a`){var n=r.VP8BitStreamToRiffWebPBuffer(e),i=new Blob([n],{type:`image/webp`}),a=t.duration;t.emit(`webp`,{currentTime:a,webp:i})}})}else e.type===`m`&&e.name===`Cluster`&&e.isEnd===!1?(this.firstVideoBlockRead=!1,this.firstAudioBlockRead=!1,this.emit_segment_info(),this.emit(`cluster_ptr`,e.tagStart),this.lastClusterPosition=e.tagStart):e.type===`u`&&e.name===`Timecode`?this.lastClusterTimecode=e.value:e.type===`u`&&e.name===`TimecodeScale`?this.timecodeScale=e.value:e.type===`m`&&e.name===`TrackEntry`?e.isEnd?(this.trackTypes[this.currentTrack.TrackNumber]=this.currentTrack.TrackType,this.trackDefaultDuration[this.currentTrack.TrackNumber]=this.currentTrack.DefaultDuration,this.trackCodecDelay[this.currentTrack.TrackNumber]=this.currentTrack.CodecDelay):this.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null}:e.type===`u`&&e.name===`TrackType`?this.currentTrack.TrackType=e.value:e.type===`u`&&e.name===`TrackNumber`?this.currentTrack.TrackNumber=e.value:e.type===`u`&&e.name===`CodecDelay`?this.currentTrack.CodecDelay=e.value:e.type===`u`&&e.name===`DefaultDuration`?this.drop_default_duration?(console.warn(`DefaultDuration detected!, remove it`),n=!0):this.currentTrack.DefaultDuration=e.value:e.name===`unknown`&&console.warn(e);!this.metadataloaded&&e.dataEnd>0&&(this.metadataSize=e.dataEnd),n||this.chunks.push(e),this.logging&&this.put(e)}},Object.defineProperty(n.prototype,`duration`,{get:function(){if(this.trackInfo.type===`nothing`)return console.warn(`no video, no audio track`),0;var e=0,t=0,n=0,r=this.trackDefaultDuration[this.trackInfo.trackNumber];if(typeof r==`number`)e=r;else if(this.trackInfo.type===`both`)if(this.last2SimpleBlockAudioTrackTimecode[1]>this.last2SimpleBlockVideoTrackTimecode[1]){e=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var i=this.trackCodecDelay[this.trackTypes.indexOf(2)];typeof i==`number`&&(t=i),n=this.last2SimpleBlockAudioTrackTimecode[1]}else{e=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var i=this.trackCodecDelay[this.trackTypes.indexOf(1)];typeof i==`number`&&(t=i),n=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type===`video`){e=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var i=this.trackCodecDelay[this.trackInfo.trackNumber];typeof i==`number`&&(t=i),n=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type===`audio`){e=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var i=this.trackCodecDelay[this.trackInfo.trackNumber];typeof i==`number`&&(t=i),n=this.last2SimpleBlockAudioTrackTimecode[1]}var a=((this.lastClusterTimecode+n)*this.timecodeScale+e-t)/this.timecodeScale;return Math.floor(a)},enumerable:!1,configurable:!0}),n.prototype.addListener=function(t,n){return e.prototype.addListener.call(this,t,n)},n.prototype.put=function(e){this.hasLoggingStarted||(this.hasLoggingStarted=!0,this.logging&&this.logGroup&&console.groupCollapsed(this.logGroup)),e.type===`m`?e.isEnd?console.groupEnd():console.group(e.name+`:`+e.tagStart):e.type===`b`?console.log(e.name,e.type):console.log(e.name,e.tagStart,e.type,e.value)},n}(n.EventEmitter)})),Bd=s((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.tools=e.Reader=e.Encoder=e.Decoder=void 0,n(Td(),e),e.Decoder=Ld().default,e.Encoder=Od().default,e.Reader=zd().default,e.tools=Id()})),Vd=s((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},n=e&&e.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};Object.defineProperty(e,`__esModule`,{value:!0});var r=Bd();function i(e){return t(this,void 0,void 0,function(){var t,i,a,o,s,c,l,u,d,f,p,m;return n(this,function(n){switch(n.label){case 0:if(!e)throw Error(`call to fixWebmDuration requires a blob`);t=new r.Decoder,i=new r.Reader,a=e.stream(),o=a.getReader(),n.label=1;case 1:return[4,o.read()];case 2:return s=n.sent(),c=s.done,l=s.value,c?(i.stop(),[3,3]):(u=t.decode(l),u=u?.filter(function(e){return e.type!==`unknown`}),u.forEach(function(e){i.read(e)}),l=null,[3,1]);case 3:return d=r.tools.makeMetadataSeekable(i.metadatas,i.duration,i.cues),f=new Blob([d],{type:e.type}),p=e.slice(i.metadataSize),m=new Blob([f,p],{type:e.type}),[2,m]}})})}e.default=i})),Hd=1e3,Ud=class{#e;#t=!1;#n=!1;#r=0;#i=0;#a=0;#o=0;#s=0;onchange=e=>{};onDurationChange=e=>{};constructor(){}start=async(e=``)=>{e||=`video_Record_${D(Date.now())}`;let t=[];return navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0}).then(n=>{let r=n.getTracks();for(let e of r)e.onended=()=>this.stop();this.#t=!0,this.#n=!1,this.#e=new MediaRecorder(n),this.#e.start(Hd);let i=new Date().getTime();this.#r=i,this.#a=i,this.#c(),this.#l(),this.#e.addEventListener(`dataavailable`,e=>{t.push(e.data)}),this.#e.addEventListener(`stop`,async()=>{this.#t=!1;let r=new Date().getTime();this.#i=r,this.#o+=r-this.#a,this.#c(),clearInterval(this.#s);let i=n.getTracks();for(let e of i)e.stop();if(this.#e===null)return;let a=this.#e.mimeType,o=new Blob(t,{type:a}),s;try{s=await Cd(await o.arrayBuffer(),a)}catch{s=await md(await Promise.resolve().then(()=>u(Vd(),1)))(new Blob(t,{type:a}))}let c=URL.createObjectURL(s),l=document.createElement(`a`);l.href=c,l.download=`${e}.mp4`,l.click(),URL.revokeObjectURL(c),t=[],this.#e=null})})};pause=async()=>{await new Promise(e=>setTimeout(()=>e(!0),300)),this.#e?.pause(),this.#n=!0;let e=new Date().getTime();this.#o+=e-this.#a,this.#c(),clearInterval(this.#s)};resume=async()=>{this.#e?.resume(),this.#n=!1,this.#a=new Date().getTime(),this.#c(),this.#l()};stop=async()=>{this.#e?.stop()};destroy=()=>{clearInterval(this.#s),this.#s=0,this.#t&&this.#e&&this.#e.stop()};getDuration=()=>{if(this.#a===0)return 0;let e=this.#o,t=new Date().getTime();if(this.#t&&this.#n===!1){let n=t-this.#a;this.#a=t,e+=n}return e};getInfo=()=>({active:this.#t,pause:this.#n,startTime:this.#r,endTime:this.#i,duration:this.#o});#c=()=>{let e=this.getInfo();this.onchange(e)};#l=()=>{clearInterval(this.#s),this.#s=window.setInterval(()=>{this.#o=this.getDuration(),this.onDurationChange(this.#o)},500)}},Wd=Object.defineProperty,Gd=e=>{throw TypeError(e)},Kd=(e,t,n)=>t in e?Wd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qd=(e,t,n)=>Kd(e,typeof t==`symbol`?t:t+``,n),Jd=(e,t,n)=>t.has(e)||Gd(`Cannot `+n),Yd=(e,t,n)=>(Jd(e,t,`read from private field`),n?n.call(e):t.get(e)),Xd=(e,t,n)=>t.has(e)?Gd(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Zd,Qd,$d,ef=class{constructor(e={}){qd(this,`queue`,[]),qd(this,`timer`,0),qd(this,`activeIndex`,0),qd(this,`activePromise`),qd(this,`options`,{timeout:0}),qd(this,`add`,(e,t={})=>new Promise(async(n,r)=>{let i=t.timeout||this.options.timeout,a=t.key||Yd(this,Zd).call(this),o=t.describe||``;if(this.queue.findIndex(e=>e.key===a)!==-1)return r(`${a} is exist.`);let s={key:a,func:e,describe:o,timeout:i,resolve:n,reject:r};this.queue.unshift(s),this.activePromise||Yd(this,$d).call(this)})),qd(this,`clear`,()=>{this.queue=[],this.activePromise=void 0,clearTimeout(this.timer)}),qd(this,`retry`,()=>{Yd(this,$d).call(this)}),Xd(this,Zd,()=>(this.activeIndex+=1,`${this.activeIndex}`)),Xd(this,Qd,e=>{let t=this.queue.findIndex(t=>t.key===e);this.queue.splice(t,1)}),Xd(this,$d,async()=>{let e=this.queue.length;if(e===0)return;let t=e-1;this.activePromise=this.queue[t];let{key:n,func:r,resolve:i,reject:a,timeout:o}=this.activePromise;o&&(this.timer=window.setTimeout(()=>{a(`pr-async-queue: ${n} is timeout.`),Yd(this,$d).call(this)},o)),await r().then(i).catch(a).finally(()=>{clearTimeout(this.timer),this.activePromise=void 0,Yd(this,Qd).call(this,n),Yd(this,$d).call(this)})}),this.options={timeout:0,...e}}};Zd=new WeakMap,Qd=new WeakMap,$d=new WeakMap;var tf=class{_requestAnimationFrameId;_requestAnimationFrameItems=new Map;_lastInvokeTime=new Map;addRequestAnimationFrame=(e,t,n)=>{this._requestAnimationFrameId||this.init();let r=1e3/Math.max(1,Math.min(120,n?.fps??20));this._requestAnimationFrameItems.set(e,n=>{let i=n??performance.now();i-(this._lastInvokeTime.get(e)??0)>=r&&(this._lastInvokeTime.set(e,i),t(n))})};clearRequestAnimationFrame=(e=[])=>{e.length===0&&(e=[...this._requestAnimationFrameItems.keys()]);for(let t of e)this._requestAnimationFrameItems.delete(t),this._lastInvokeTime.delete(t)};init=()=>{let e=t=>{let n=this._requestAnimationFrameItems.values();for(let e of n)e(t);if(this._requestAnimationFrameItems.size===0){this._requestAnimationFrameId=void 0;return}this._requestAnimationFrameId=requestAnimationFrame(e)};this._requestAnimationFrameId=requestAnimationFrame(e)};stop=()=>{this._requestAnimationFrameId!==void 0&&(cancelAnimationFrame(this._requestAnimationFrameId),this._requestAnimationFrameId=void 0)}},nf=class{config=new le;notifys=new fe;localMedias=new _e;intervalQueue=new zu;asyncQueue=new ef;traffic=new ue;recorder=new Ud;animationFrame=new tf;users=new wu({config:this.config,localMedias:this.localMedias,notifys:this.notifys});cws=new pd({config:this.config});peer=new qi({config:this.config,users:this.users});constructor(){this.cws.on.log=e=>this.notifys.emit(`onLog`,{code:200,desc:`Message log.`,data:{message:e}}),this.intervalQueue.startQueue(),this.localMedias.on.devicechange=()=>this.notifys.emit(`onDevicechange`,{code:200,data:{},desc:`MediaDevice is change.`})}use=({rnnoise:e})=>{e!==void 0&&this.users.localUser.streamControls.mc_audio?.use({rnnoise:e})};setRoomState=e=>{this.config.roomState!==e&&(this.config.roomState=e,e===`closed`&&(this.config.isInRoom=!1),this.notifys.emit(`onRoomState`,{code:200,desc:`RoomState is change.`,data:{state:e}}))};setPeerState=e=>{this.config.peerState=e,this.notifys.emit(`onPeerState`,{code:200,desc:`PeerState is change.`,data:{state:e}})};guardNotifyRoomId=(e,t)=>e===this.config.roomId?!0:(e!==void 0&&console.warn(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#ff0097;padding:16px 0;`,`------->quickvo: The received message does not belong to the current room.`,t),!1);setCallStrategy=async(e,t=[])=>{t.length===0&&(t=M);let n=`balanced`;switch(e){case`qualityPriority`:n=`maintain-resolution`;break;case`fluencyPriority`:n=`maintain-framerate`;break;case`balancedDowngrade`:n=`balanced`;break}await this.peer.setRTCRtpSenderParameters({degradationPreference:n},t);let r=this.users.remoteUsers.values();for(let e of r)e.p2p?.setRTCRtpSenderParameters({degradationPreference:n},t)};_checkUserStreamOrigin=({p2pAverageQuality:e,sfuAverageQuality:t})=>e-(t+this.config.sfuPriority)>=0?`p2p`:`sfu`;_reportP2PConnect=(e,t)=>{if(this.cws.hasEvent(`reportP2PConnectEx`))return;let n;switch(e){case`success`:n=0;break;case`fail`:n=1;break;case`ignore`:n=2;break;case`disconnect`:n=3;break;case`poor_network`:n=4;break}let{mediaTypes:r,...i}=t,a=[];for(let e of r){let t=M.findIndex(t=>t===e);a.push(t)}return this.cws.createRequest(`reportP2PConnectEx`).send({data:{...i,code:n,types:a}})};_reportLog=(e,t=`未知错误`)=>{let{appid:n,userId:r,earlyId:i=``,logUrl:a,reportErr:o}=this.config;if(this.notifys.emit(`onLog`,{code:0,desc:t,data:{type:e}}),!o||!this.config.logUrl)return;let s=(e=>({ws_c_timeout:0,webrtc_c_timeout:1,join_room_error:2,publish_error:3,subscribe_error:4,close_track_error:5,heartbeat_e_timeout:6,heartbeat_i_timeout:7,quit_room_error:8})[e].toString())(e);{let e={origin:`web`,type:s,app_id:n,user_id:r,ins_id:i,desc:t},o=`${a}/upload/log?log_key=${btoa(encodeURI(JSON.stringify(e)))}`;(async()=>{let t;try{let e=await sd(`#quickvo.logs`);t=JSON.stringify(ld(e))}catch{t=JSON.stringify([])}let n=await vu(new TextEncoder().encode(t));this.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: reportLog`,{obj:e,url:o,size:d(n.byteLength)});let r=new Uint8Array(n);fetch(o,{headers:{"Content-Type":`application/octet-stream`},method:`POST`,body:new Blob([r])}).catch(()=>{this.config.debug===!0&&console.warn(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: reportLog is error.`,{obj:e,url:o,size:d(n.byteLength)})})})()}}},rf=class{base;constructor({base:e}){this.base=e,this.base.cws.on.onUpdateCall=e=>{let t=e.data?.user;if(!t)return;let{id:n,callAction:r=0}=t,i=this.base.users.getRemoteUserContent(n);i&&(i.updateCallAction(r),this.base.users.emitUsersChange())},this.base.cws.on.onRoomUserSpeech=e=>{this.base.notifys.emit(`onRoomUserSpeech`,e)},this.base.cws.on.onBeforeTokenExpire=e=>{this.base.notifys.emit(`onBeforeTokenExpire`,e)},this.base.cws.on.onTokenExpired=e=>{this.base.notifys.emit(`onTokenExpired`,e)},this.base.cws.on.onCDNPlayUrlAdd=e=>{this.base.notifys.emit(`onCDNPlayUrlAdd`,e)},this.base.cws.on.onNetQuality=e=>{let{qualities:t=[]}=e.data,n=!1;for(let e of t){let{userId:t,egress:r,ingress:i}=e,a=this.base.users.getRemoteUserContent(t);a&&a.updateNetwork({egress:r,ingress:i})===!1&&(n=!0)}n&&this.base.users.emitUsersChange()}}_debugger=async()=>{await this.base.cws.createRequest(`debugger`,{onBack:!1}).send({data:{}})};_ai=async()=>{await this.base.cws.createRequest(`ai`,{onBack:!1}).send({data:{}})}},af=(e,t)=>{if(!(e!=null&&e.ip)||!(e!=null&&e.port)||!(e!=null&&e.serve_ip)||!(e!=null&&e.serve_port)||!(t!=null&&t.ip)||!(t!=null&&t.port)||!(t!=null&&t.serve_ip)||!(t!=null&&t.serve_port))return`Unknown`;let[n,r]=[e.ip,e.port],[i,a]=[e.serve_ip,e.serve_port],[o,s]=[t.ip,t.port],[c,l]=[t.serve_ip,t.serve_port];return n===o&&r===s?`Full Cone`:n===i&&(o!==i||s!==r)||o===c&&(n!==c||r!==s)?`Restricted Cone`:n===i&&r===a&&(o!==i||s!==a)||o===c&&s===l&&(n!==c||r!==l)?`Port Restricted Cone`:`Symmetric`},of=async()=>{let e=async e=>new Promise(t=>{let n=new RTCPeerConnection({iceServers:[{urls:`stun:${e}`}]});n.createDataChannel(`ice-channel`);let r=null;n.onicecandidate=i=>{if(i.candidate?.type===`srflx`){let[a,o]=e.split(`:`).map(e=>e.trim());r={ip:i.candidate.address||``,port:i.candidate.port?.toString(),serve_ip:a,serve_port:o},n.close(),t(r)}},setTimeout(()=>{n.close(),t(null)},5e3),n.createOffer().then(e=>n.setLocalDescription(e)).catch(()=>t(null))});try{let t=await e(`stun.cloudflare.com:3478`),n=await e(`stun.l.google.com:19302`);if(!t||!n)return{address:``,natType:`Unknown`};let r=af(t,n);return{address:t.ip||``,natType:r}}catch(e){return console.error(`获取NAT类型失败:`,e),{address:``,natType:`Unknown`}}},sf=class{debounceMs;timer;scheduleGen=0;state=`ready`;promise;_resolve;_reject;pendingFn;pendingSettle=!0;constructor(e=0){this.debounceMs=e}begin(){return this.state===`ready`&&(this.state=`waiting`,this.promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})),this.promise}exe(e,t){let n=t?.settle!==!1;this.begin(),this.pendingFn=e,this.pendingSettle=n,this.scheduleGen++;let r=this.scheduleGen;this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0);let i=()=>{this.timer=void 0,r===this.scheduleGen&&this._runFlush()};return this.debounceMs>0?this.timer=setTimeout(i,this.debounceMs):queueMicrotask(i),this.promise}beginPrepareThenExe(e,t){return this.begin(),Promise.resolve(e()).then(()=>this.exe(t))}_runFlush=()=>{let e=this.pendingFn;if(this.pendingFn=void 0,!(!e||this.state!==`waiting`))if(this.pendingSettle)Promise.resolve(e()).then(e=>{this.state===`waiting`&&(this._resolve?.(e),this.state=`ready`)},e=>{this.state===`waiting`&&(this._reject?.(e),this.state=`ready`)});else try{e()}catch(e){this._reject?.(e),this.state=`ready`}};resolve=e=>{this.state===`waiting`&&(this.scheduleGen++,this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0),this.pendingFn=void 0,this._resolve?.(e),this.state=`ready`)};reject=e=>{this.state===`waiting`&&(this.scheduleGen++,this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0),this.pendingFn=void 0,this._reject?.(e),this.state=`ready`)};clear=()=>{this.scheduleGen++,this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0),this.pendingFn=void 0,this.state===`waiting`&&(this._resolve?.(!0),this.state=`ready`)}},cf=class e{base;_onOnline;_reconnectTimerId;_networkCalculating=!1;_lastTrackAnalysisWarnTime=0;static _maxInNumberArray(e){if(e.length===0)return 0;let t=e[0];for(let n=1;n<e.length;n++){let r=e[n];r>t&&(t=r)}return t}static _minInNumberArray(e){if(e.length===0)return 0;let t=e[0];for(let n=1;n<e.length;n++){let r=e[n];r<t&&(t=r)}return t}_earlyConnectTask=new sf;_cwsConnectTask=new sf;_connectCFTask=new sf;_publishTask=new sf(300);_stopPublishTask=new sf(300);_subscribeTask=new sf(300);_stopSubscribeTask=new sf(300);_syncRoomInfoTask=new sf;_restorePeerTask=new sf;_quitRoomTask=new sf;_joinRoomSerial=Promise.resolve();_autoCheckSubscribeCoalesce=!1;constructor({base:e}){this.base=e,this.base.cws.on.state=e=>{switch(e){case`connecting`:case`reconnecting`:this.base.setRoomState(`connecting`);break;case`connected`:this.base.setRoomState(`connected`),this.base.config.isInRoom===!0&&this._syncRoomInfo().catch(()=>this._clear());break;case`closed`:this._clear();break}},this.base.peer.on.state=e=>{switch(e){case`failed`:case`closed`:this._restorePeer();break;default:this.base.setPeerState(e);break}},this.base.cws.on.onJoinRoom=e=>{if(!this.base.guardNotifyRoomId(e.data.roomId,e))return;let t=e.data.user;t&&(this.base.users.initUsers([t],!0),this.base.users.emitUsersChange(),this._scheduleAutoCheckSubscribe(),this.base.notifys.emit(`onJoinRoom`,e))},this.base.cws.on.onJoinRoomBatch=e=>{this.base.guardNotifyRoomId(e.data.roomId,e)&&(this.base.users.initUsers(e.data.users,!0),this._scheduleAutoCheckSubscribe(),this.base.users.emitUsersChange())},this.base.cws.on.onQuitRoom=e=>{let t=e.data?.user;if(!t)return;let{id:n}=t;this._onRemoteUsersQuitRoom([n]).length!==0&&this.base.notifys.emit(`onQuitRoom`,e)},this.base.cws.on.onQuitRoomBatch=e=>{let t=e.data?.users??[],n=Array.from(t,e=>e.userId);this._onRemoteUsersQuitRoom(n)},this.base.cws.on.onPublish=e=>{let{roomId:t,user:n}=e.data;this.base.guardNotifyRoomId(t,e)&&n&&this.base.users.applyRemoteUserPublishNotify(n)&&(this._scheduleAutoCheckSubscribe(),this.base.users.emitUsersChange())},this.base.cws.on.onCloseTrack=e=>{let t=e.data?.user;if(!t)return;let{id:n,callAction:r,tracks:i}=t,a=this.base.users.getRemoteUserContent(n);if(!a)return;a.updateCallAction(r??0);let o=Array.from(i,({type:e})=>M[e]);this.stopSubscribe([{userId:n,mediaTypes:o}]).catch(()=>this._restorePeer()),a.removeTracks(o)},this.base.cws.on.onTrackInactive=e=>{let{session:t,tracks:n=[]}=e.data;if(t!==this.base.config.callSession)return this._restorePeer();let r=[];for(let e of n){let{type:t,trackName:n}=e;if(t===void 0)continue;let i=M[t],a=this.base.users.localUser.getTrack(i);a&&a.trackName===n&&r.push(i)}let{valid_mediaTypes:i}=this.base.localMedias.checkLocalStreamTracks(r);i.length!==0&&(this.base.peer.stopSenders(i),this.publish(i))},this.base.cws.on.onUpdatePermissions=e=>{let t=e.data?.user;if(!t)return;let{id:n,permissions:r=1}=t,i=this.base.users.getUserContent(n);i&&i.updatePermissions(r),this.base.users.localUser.updatePermissions(r),this.base.users.emitUsersChange()},this.base.cws.on.onUpdatePermissionsBatch=e=>{let{users:t}=e.data;for(let e of t){let{id:t,permissions:n}=e,r=this.base.users.getUserContent(t);r&&r.updatePermissions(n??1)}this.base.users.emitUsersChange()},this.base.cws.on.onUpdateBehavior=e=>{let{users:t}=e.data;for(let e of t){let{id:t,behavior:n=0}=e,r=this.base.users.getUserContent(t);r&&r.updateBehavior(n)}let n=[],{behavior:r,isAdmin:i}=this.base.users.localUser,a=j(r);if(i===!1)for(let e of M)a[e]!==!0&&n.push(e);n.length===0?this.base.users.emitUsersChange():this.stopPublish(n)},this.base.cws.on.onRoomActionChange=e=>{let{roomAction:t,serverAction:n}=e.data;if(this.base.config.updateRoomAction(t||0),this.base.users.localUser.isAdmin===!1){let e=se(t),r=ce(n),i=[];for(let t of M)e[t]!==!0&&r[t]!==!1&&i.push(t);i.length!==0&&this.stopPublish([`mc_audio`])}this.base.notifys.emit(`onRoomActionChange`,e)},this.base.cws.on.onMeetSpecialRolesChange=e=>{let{meetSpecialRoles:t,users:n}=e.data;this.base.users.updateUsersIsAdmin(t?.admin||[]);for(let e of n){let{id:t,permissions:n}=e;this.base.users.remoteUsers.get(t)?.updatePermissions(n??1)}this.base.users.emitUsersChange()},this._onOnline=()=>this._reportNetwork(),window.addEventListener(`online`,this._onOnline)}setLocalStream=async(e,t)=>{if(this.base.users.localUser.usePhoneyStream(e),t){if(e.includes(`mc_audio`)&&e.includes(`mc_video`)?await this.base.localMedias.initLocalStreamTrack(`mc`):e.includes(`mc_audio`)?await this.base.localMedias.initLocalStreamTrack(`mc_audio`):e.includes(`mc_video`)&&await this.base.localMedias.initLocalStreamTrack(`mc_video`),e.includes(`ss_audio`)&&e.includes(`ss_video`)?await this.base.localMedias.initLocalStreamTrack(`ss`):e.includes(`ss_audio`)&&!e.includes(`ss_video`)?await this.base.localMedias.initLocalStreamTrack(`ss_audio`):e.includes(`ss_video`)&&!e.includes(`ss_audio`)&&await this.base.localMedias.initLocalStreamTrack(`ss_video`),e.includes(`ss_audio`)){let e=this.base.users.localMedias.getLocalStreamTrack(`ss_audio`);e&&(e.onended=()=>this.stopPublish([`ss_audio`,`ss_video`]))}if(e.includes(`ss_video`)){let e=this.base.users.localMedias.getLocalStreamTrack(`ss_video`);e&&(e.onended=()=>this.stopPublish([`ss_audio`,`ss_video`]))}this.base.users.localUser.useLocalStream(e)}else for(let t of e)this.base.localMedias.stopLocalStreamTrack(t)};setMediaDeviceKind=async(e,t)=>{await this.base.users.localMedias.setMediaDeviceKind(e,t);let n=this.base.users.localUser;switch(e){case`audioinput`:n.usePhoneyStream([`mc_audio`]),this.base.localMedias.getLocalStreamTrack(`mc_audio`)&&(await this.base.localMedias.initLocalStreamTrack(`mc_audio`),n.useLocalStream([`mc_audio`])),this.base.peer.syncSenderStreamTrack([`mc_audio`]),this.base.users.syncRemoteUserP2PSenderStreamTrack([`mc_audio`]);break;case`videoinput`:n.usePhoneyStream([`mc_video`]),this.base.localMedias.getLocalStreamTrack(`mc_video`)&&(await this.base.localMedias.initLocalStreamTrack(`mc_video`),n.useLocalStream([`mc_video`])),this.base.peer.syncSenderStreamTrack([`mc_video`]),this.base.users.syncRemoteUserP2PSenderStreamTrack([`mc_video`]);break;case`audiooutput`:await this.base.users.localMedias.changeAudiooutput();break}};setMediaTrackConstraints=async(e,t)=>{this.base.localMedias.setMediaTrackConstraints(e,t),this.base.users.localMedias.isOpenMediaDevice(e)&&[`mc_video`].includes(e)&&await this.setLocalStream([e],!0)};earlyConnect=async()=>{if(this._earlyConnectTask.state!==`ready`)return this._earlyConnectTask.promise;await this._earlyConnectTask.exe(async()=>{this.base.config.isEarly=!0,await this._connectCws(!1),this._initHeartbeat(`heartbeatEx`),await this._connectCF()}).catch(e=>{this.base._reportLog(`ws_c_timeout`,e.msg||e)})};joinRoom=async e=>{this._quitRoomTask.state===`waiting`&&await this._quitRoomTask.promise;let t=await this._acquireJoinRoomSerial();try{return await this._joinRoomExecute(e)}finally{t()}};publish=async e=>{if(e.length===0)throw Error(`Publish is error: The "mediaTypes" field cannot be left blank.`);let t=[...e],n=this.base.users.localUser;if(n.hasPermissions(`publish`)===!1)throw Error(`No permission.`);if(n.checkBanBehavior(t)===!1)throw Error(`Not permitted.`);return n.setPublished(t,!0),this._publishTask.beginPrepareThenExe(async()=>{let{invalid_mediaTypes:e}=this.base.localMedias.checkLocalStreamTracks(t);e.length!==0&&await this.setLocalStream(e,!0)},async()=>{let e=M.filter(e=>n.published[e]===!0);await this._createTracks(e);let{valid_mediaTypes:t}=this.base.localMedias.checkLocalStreamTracks(e);if(t.length!==0){n.useLocalStream(t),n.updateSelfCallAction(),await this.base.peer.syncSenderStreamTrack(t),await this.base.users.syncRemoteUserP2PSenderStreamTrack(t);let e=this.base.peer.getNoBroadcasted(t);e.length===0?await this._notifySelfCallAction():await this._pubNotify(e)}else throw Error(`No effective track.`);return this.base.users.emitUsersChange(),!0})};stopPublish=async e=>{let t=[...e],n=this.base.users.localUser;return n.setPublished(t,!1),this._stopPublishTask.exe(async()=>{let e=M.filter(e=>n.published[e]===!1);return n.usePhoneyStream(e),n.updateSelfCallAction(),await this.base.peer.syncSenderStreamTrack(e),await this.base.users.syncRemoteUserP2PSenderStreamTrack(e),await this.setLocalStream(e,!1),await this._notifySelfCallAction(),this.base.users.emitUsersChange(),!0})};subscribe=async(e=[])=>{this.base.users.addRemoteUsersSubscribed(e);let t=e=>this.base.asyncQueue.add(async()=>{try{let t=this.base.users.createRemoteUsersSubscribeData(e);if(t.length===0)return this._subscribeTask?.resolve(!0);let{code:n=0,sn:r,data:i}=await this.base.cws.createRequest(`subscribe`).send({data:{session:this.base.config.callSession,users:t}});if(await this._ackMsg(r),n===200&&i){let{remoteSdp:e,users:t}=i;if(!e)throw Error(`The sdp was not correctly swapped.`);if(!t)throw Error(`No available users.`);{let t=new RTCSessionDescription({type:`offer`,sdp:e});await this.base.peer.setRemoteDescription(t),await this._renegotiate()}for(let e of t){let{id:t,tracks:n}=e;if(!t||!n)continue;let r=this.base.users.getRemoteUserContent(t);for(let e of n){if(e.code!==200)continue;let t=e.type||0,n=e.mid||``,i=e.trackName||``,a=M[t];r?.updateTracks([{type:t,mid:n,trackName:i}]),r?.useRemoteStream([a],this.base.peer)}}}this.base.users.emitUsersChange(),this._subscribeTask.resolve(!0)}catch(e){this._subscribeTask.reject(e)}},{describe:`getRemoteUserTracks`});return this._waitPeerThenSubscribeTask(this._subscribeTask,()=>{t(!1),t(!0)})};stopSubscribe=async e=>{this.base.users.removeRemoteUsersSubscribed(e);let t=async()=>{try{let e=this.base.users.createRemoteUsersCloseData(),t=[];for(let n of e){let{userId:e,sfu_tracks:r,p2p_mediaTypes:i}=n;if(i.length!==0){let t=this.base.users.remoteUsers.get(e);if(!t)continue;t.usePhoneyStream(i),t.p2p?.setRecvTracksEnabled(i,!1),await this.base._reportP2PConnect(`disconnect`,{desc:`Take the initiative to disconnect.`,pushId:t.id,pullId:this.base.config.userId,mediaTypes:i})}if(r.length!==0){let n=this.base.users.remoteUsers.get(e);if(!n)continue;let i=Array.from(r,e=>e.mediaType);n.usePhoneyStream(i),t.push(...r)}await this._closeTrack(t)}this.base.users.emitUsersChange(),this._stopSubscribeTask?.resolve(!0)}catch{this._stopSubscribeTask?.reject(!0)}};return this._waitPeerThenSubscribeTask(this._stopSubscribeTask,()=>void t())};quitRoom=()=>{let{roomId:e,userId:t,isInRoom:n}=this.base.config,r=y(32,10);return O(async()=>{n!==!1&&(this.base.config.isInRoom=!1,this.base.intervalQueue.removeQueueItem([`heartbeat-interval`,`peerAnalysis`]),await this.base.cws.createRequest(`quitRoom`,{onBack:!1}).send({data:{roomId:e,userId:t,msgId:r,msg:r}}))},{message:`quitRoom timeout.`,timeout:2*1e3}).finally(()=>{this._clear(),this.base.setRoomState(`ready`)}).catch(e=>{this.base._reportLog(`quit_room_error`,e.message||e)}),Promise.resolve(r)};quitRoomEx=()=>{let e=y(32,10);return this._quitRoomTask.state===`ready`&&this._quitRoomTask.exe(async()=>{try{let{roomId:t,userId:n,isInRoom:r}=this.base.config;return r===!1?!0:(this.base.config.isInRoom=!1,this._initHeartbeat(`heartbeatEx`),await this.base.cws.createRequest(`quitRoomEx`).send({data:{roomId:t,userId:n,msgId:e,msg:e}}),await this.stopPublish(M),await this.stopSubscribe(),this.base.peer.stopSenders([`ss_audio`,`ss_video`]),this.base.users.clearRemoteUsers(),this.base.setRoomState(`ready`),!0)}catch(e){throw e!==`clear`&&(this.base._reportLog(`quit_room_error`,e.message||e),this._clear(),console.warn(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: StopSubscribe is error at quitRoomEx. start init earlyConnect.`,e),this.earlyConnect()),e}}),Promise.resolve(e)};setBehaviors=async e=>{let{roomId:t}=this.base.config,n=[];for(let t of e){let{id:e,behaviors:r}=t,i=Object.keys(r);if(i.length===0)continue;let a=[];for(let e of i){let t={type:M.findIndex(t=>t===e),behavior:!r[e]};a.push(t)}let o={id:e,behaviors:a};n.push(o)}let r=await this.base.cws.createRequest(`preventUsersBehavior`).send({data:{roomId:t,users:n}}),{code:i=0,desc:a}=r;if(i!==200)throw Error(String(a));return r};toggleRoomSpeechLang=e=>{this.base.config.isInRoom===!0&&this.base.cws.createRequest(`toggleRoomSpeechLang`).send({data:e})};updateSimulcast=async e=>{let t=this.base.users.remoteUsers.values(),n=[];for(let r of t){let{id:t,tracks:i}=r,a=[];for(let t of M){if(![`mc_video`,`ss_video`].includes(t))continue;let n=i[t];if(!n)continue;let r={...n,simulcast:e};a.push(r)}a.length!==0&&n.push({id:t,tracks:a})}n.length!==0&&this.base.cws.createRequest(`updateSimulcast`).send({data:{session:this.base.config.callSession,users:n}})};updateToken=e=>{this.base.config.isInRoom===!0&&this.base.cws.createRequest(`updateRoomToken`).send({data:{roomId:this.base.config.roomId,sdkToken:e}})};destroy=async()=>{this.base.config.debug===!0&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: [Destroy]`),this.base.config.isInRoom===!0&&await this.quitRoom(),this._quitRoomTask.state===`waiting`&&await this._quitRoomTask.promise;try{this._clear()}catch(e){console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->Breathe: error`,e)}this._reconnectTimerId&&=(clearTimeout(this._reconnectTimerId),void 0),this._onOnline&&=(window.removeEventListener(`online`,this._onOnline),void 0),this.base.localMedias.destroy(),this.base.recorder.destroy(),this.base.notifys.emit(`onDestroyRoom`,{code:200,desc:`Is destroy.`,data:On(ci,{roomId:this.base.config.roomId})})};_scheduleAutoCheckSubscribe(){this._autoCheckSubscribeCoalesce||(this._autoCheckSubscribeCoalesce=!0,queueMicrotask(()=>{this._autoCheckSubscribeCoalesce=!1,this._autoCheckSubscribe().catch(e=>{this.base.config.debug===!0&&console.warn(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: [autoCheckSubscribe]`,e)})}))}async _waitPeerThenSubscribeTask(e,t,n){return await this.base.peer.waitings.peerConnected(),e.exe(t,n??{settle:!1})}_clearTask=()=>{this._earlyConnectTask.clear(),this._cwsConnectTask.clear(),this._connectCFTask.clear(),this._publishTask.clear(),this._stopPublishTask.clear(),this._subscribeTask.clear(),this._stopSubscribeTask.clear(),this._syncRoomInfoTask.clear(),this._restorePeerTask.clear(),this._quitRoomTask.clear()};_clear=()=>{this.base.setRoomState(`closed`),this.base.config.roomId=``,this.base.cws.clearEvents(),this.base.cws.close(),this.base.peer.close(),this.base.intervalQueue.removeQueueItem([`heartbeat-interval`,`peerAnalysis`]),this.base.asyncQueue.clear(),this.base.users.localUser.clear(),this.base.users.clearRemoteUsers(),this.setLocalStream(M,!1),this.base.animationFrame.stop(),this._clearTask()};_connectCws=async e=>this._cwsConnectTask.state===`ready`?this._cwsConnectTask.exe(async()=>{let t=!1;return e===!0&&(t=this.base.cws.isValid()),t===!1&&(this.base.setRoomState(`connecting`),await this.base.cws.connect()),!0}):this._cwsConnectTask.promise;static _JOIN_ROOM_WS_ATTEMPTS=3;static _JOIN_ROOM_WS_TIMEOUT_MS=1e4;_ensureWebSocketBeforeJoinRoom=async()=>{let t=this.base.cws.prws,n=()=>{let e=this.base.cws.prws.ws;return e!=null&&e.readyState===WebSocket.OPEN};if(n())return;let r=t.timeout;t.timeout=e._JOIN_ROOM_WS_TIMEOUT_MS;let i;try{for(let t=0;t<e._JOIN_ROOM_WS_ATTEMPTS;t++)try{if(await this._connectCws(!0),n())return;i=Error(`WebSocket not in OPEN state after connect`)}catch(e){i=e}}finally{t.timeout=r}this.base.setRoomState(`closed`);let a=i instanceof Error?i.message:String(i??``);throw Error(`加入房间失败:WebSocket 已尝试 ${e._JOIN_ROOM_WS_ATTEMPTS} 次仍无法连接(每次最长 ${e._JOIN_ROOM_WS_TIMEOUT_MS/1e3}s)。${a?` ${a}`:``}`)};static _RTC_RECOVERY_ATTEMPTS=3;static _RTC_RECOVERY_CWS_TIMEOUT_MS=1e4;_connectCFWithRecoveryRetries=async t=>{let n=this.base.cws.timeout,r;try{for(let t=0;t<e._RTC_RECOVERY_ATTEMPTS;t++){this.base.cws.timeout=e._RTC_RECOVERY_CWS_TIMEOUT_MS;try{if(await this._connectCF(),this.base.peer.checkValid())return;r=Error(`WebRTC connectionState is not connected after connectCF`)}catch(e){r=e}}}finally{this.base.cws.timeout=n}let i=r instanceof Error?r.message:String(r??``),a=t===`joinRoom`?`加入房间失败:WebRTC 已尝试 ${e._RTC_RECOVERY_ATTEMPTS} 次仍无法建立连接`:`恢复 WebRTC 失败:已尝试 ${e._RTC_RECOVERY_ATTEMPTS} 次仍无法建立连接`;throw Error(`${a}(单次信令最长 ${e._RTC_RECOVERY_CWS_TIMEOUT_MS/1e3}s、ICE 等待 10s)。${i?` ${i}`:``}`)};_ensureWebRtcForJoinRoom=async()=>{this.base.peer.checkValid()||await this._connectCFWithRecoveryRetries(`joinRoom`)};_initHeartbeat=e=>{this.base.intervalQueue.removeQueueItem([`heartbeat-interval`]),e===`heartbeat`?this.base.intervalQueue.addQueueItem({key:`heartbeat-interval`,func:()=>{if(this.base.cws.prws.ws?.readyState!==1)return;if(this.base.cws.needRestoreRoom()===!0)return this._restoreRoom();let t=this.base.cws.createRequest(e,{onBack:!1}),n=this.base.traffic.getUse(`kb`),{outboundBytes:r,inboundBytes:i}=n.sfu,{outboundBytes:a,inboundBytes:o}=n.p2p,s={sfuPush:BigInt(Math.round(r)),sfuPull:BigInt(Math.round(i)),p2pPush:BigInt(Math.round(a)),p2pPull:BigInt(Math.round(o))};t.send({data:s})},interval:1e3*10}):this.base.intervalQueue.addQueueItem({key:`heartbeat-interval`,func:()=>{this.base.cws.prws.ws?.readyState===1&&this.base.cws.createRequest(e,{onBack:!1}).send({data:{}})},interval:1e3*30})};_fetchGenTurnAddress=async()=>{try{let e=await this.base.cws.createRequest(`genTurnAddress`).send({data:{}});if(e.code===200&&e.data&&Array.isArray(e.data.iceServers)&&e.data.iceServers.length>0)return e.data}catch(e){this.base.config.debug===!0&&console.warn(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#b64900;`,`------->quickvo: genTurnAddress failed, use default STUN.`,e)}};_connectCF=async()=>this._connectCFTask.state===`ready`?this._connectCFTask.exe(async()=>{let e=await this._fetchGenTurnAddress();await this.base.peer.init(e);let t=[`mc_audio`,`mc_video`];await this.base.peer.addSenders(t);let n=this.base.users.localUser.getTracks(t),{code:r=0,desc:i,data:a,sn:o}=await this.base.cws.createRequest(`publish`).send({compress:!0,data:{sdp:this.base.peer.getSdp(),tracks:n,callAction:0}});if(await this._ackMsg(o),r!==200)throw Error(i);if(!a)throw Error(`No publish response data.`);let{remoteSdp:s,session:c}=a;this.base.config.callSession=c||``;let l=s||``;return await this.base.peer.setRemoteDescription({type:`answer`,sdp:l}),await O(this.base.peer.waitings.peerConnected,{message:`ice connect is timeout.`,timeout:10*1e3}),this._reportNetwork(),this.base.intervalQueue.addQueueItem({key:`peerAnalysis`,func:this._calculateNetwork,interval:1e3}),!0}):this._connectCFTask.promise;_reportNetwork=async()=>{try{let e=0,{address:t,natType:n}=await of();switch(n){case`Symmetric`:e=0;break;case`Full Cone`:e=1;break;case`Port Restricted Cone`:e=2;break;case`Restricted Cone`:e=3;break}let r=0;{let e=te(),t=(navigator.connection||navigator.mozConnection||navigator.webkitConnection).effectiveType;e||(r=[`wifi`,`4g`].includes(t)?0:2),e&&(r=[`wifi`].includes(t)?0:2)}await this.base.cws.createRequest(`reportNetwork`).send({data:{nat:e,type:r,ip:t}})}catch(e){this.base.config.debug&&console.warn(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: [reportNetwork]`,e)}};_createTracks=e=>this.base.asyncQueue.add(async()=>{try{await this.base.peer.waitings.peerConnected();let t=await this.base.peer.addSenders(e);if(t.length===0)return!0;let n=m(this.base.users.localUser.getTracks(t),[`type`,`trackName`,`mid`]),r=this.base.peer.getSdp(),{code:i=0,sn:a,desc:o,data:s}=await this.base.cws.createRequest(`publish`).send({compress:!0,data:{session:this.base.config.callSession,sdp:r,tracks:n,callAction:0}});if(await this._ackMsg(a),i!==200)throw Error(o);if(!s)throw Error(`No publish response data.`);let{remoteSdp:c}=s;return await this.base.peer.setRemoteDescription({type:`answer`,sdp:c||``}),!0}catch(e){throw this.base._reportLog(`publish_error`,e.message||e),e}},{describe:`createTrack`});_closeTrack=(e=[])=>this.base.asyncQueue.add(async()=>{if(e.length===0)return!0;try{await this.base.peer.createOffer();let t=m(e,[`type`,`trackName`,`mid`]),{code:n=0,desc:r,data:i}=await this.base.cws.createRequest(`closeTrack`).send({compress:!0,data:{roomId:this.base.config.roomId,sdp:this.base.peer.getSdp(),tracks:t}});if(n!==200)throw Error(r);return await this.base.peer.setRemoteDescription({type:`answer`,sdp:i?.remoteSdp||``}),!0}catch(e){throw this.base._reportLog(`close_track_error`,e.message||e),e}},{describe:`closeTrack`});_pubNotify=async e=>{let t=this.base.users.localUser.getTracks(e);if(t.length===0)return;let n=m(t,[`type`,`trackName`,`mid`]),{callSession:r,roomId:i,userId:a}=this.base.config,{callAction:o}=this.base.users.localUser,{code:s=0,desc:c}=await this.base.cws.createRequest(`pubNotify`).send({data:{session:r,roomId:i,user:{id:a,callAction:o,tracks:n}}});if(s!==200)throw Error(c);{let e=Array.from(t,e=>e.mediaType);this.base.peer.setBroadcasted(e,!0)}};_renegotiate=async()=>{await this.base.peer.createAnswer();let e=this.base.peer.getSdp(),{code:t=0,desc:n,sn:r}=await this.base.cws.createRequest(`renegotiate`).send({data:{sdp:e},compress:!0});if(await this._ackMsg(r),t!==200)throw Error(n)};_ackMsg=async e=>{await this.base.cws.createRequest(`ackMsg`,{onBack:!1}).send({data:{msgId:BigInt(e)}})};_acquireJoinRoomSerial=async()=>{let e=this._joinRoomSerial,t;return this._joinRoomSerial=new Promise(e=>{t=e}),await e,t};_joinRoomExecute=async e=>{this.base.config.setOptions(e),this.base.users.localUser.id=e.userId,this.base.traffic.clear(),this.base.peer.setBroadcasted(M,!1),this.base.users.remoteUsers.clear();let{userId:t,callType:n,sdkToken:r,roomId:i,stt:a=!1,lang:o,isEarly:s}=this.base.config;await this._ensureWebSocketBeforeJoinRoom();let{input:c=`zh`,output:l=`zh`,translateEnable:u=!1}=o||{},d=this.base.cws.createRequest(s?`joinRoomEx`:`joinRoom`),f=y(32,10),{code:p=0,desc:m=`服务器繁忙`,data:h}=await d.send({data:{msg:f,msgId:f,callType:n,roomId:i,user:{id:t,tracks:[],callAction:0},token:r,stt:a,lang:{input:c,output:l,translateEnable:u}}});if(p!==200)throw Error(m);if(h.roomId!==i)throw`加入的房间不匹配`;this.base.config.isInRoom=!0,this._initHeartbeat(`heartbeat`),this.base.users.initUsers(h.roomUsers,!0),this.base.config.updateRoomAction(h.roomAction||0);{let{meetSpecialRoles:e}=h,{creator:t=``,admin:n=[]}=e||{};if(t){let e=this.base.users.getUserContent(t);e&&(e.isOwner=!0)}this.base.users.updateUsersIsAdmin(n||[])}let g=this._earlyConnectTask.promise;return g!==void 0&&await g.catch(()=>{}),await this._ensureWebRtcForJoinRoom(),this._scheduleAutoCheckSubscribe(),this.base.users.emitUsersChange(),f};_autoCheckSubscribe=async()=>{this._subscribeTask.state===`waiting`&&await this._subscribeTask.promise;let e=this.base.users.remoteUsers.values(),t=[],n=M.filter(e=>this.base.config.autoSubscribe[e]===!0);for(let r of e){let e=[],{id:i,tracks:a}=r;for(let t of n){let n=a[t];n&&n.origin===`phoney`&&e.push(t)}e.length!==0&&t.push({userId:i,mediaTypes:e})}t.length!==0&&(this.base.config.debug===!0&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: autoSubscribe`,t),await this.subscribe(t))};_onRemoteUsersQuitRoom=e=>{let{removeUserIds:t,removeMids:n,removeTracks:r}=this.base.users.detachRemoteUsersForQuit(e);return t.length!==0&&(this.base.peer.stopReceivers(n),this._closeTrack(r).catch(()=>this._restorePeer()),this.base.users.emitUsersChange()),t};_notifySelfCallAction=async()=>{let{roomId:e}=this.base.config,{id:t,callAction:n}=this.base.users.localUser,{code:r=0}=await this.base.cws.createRequest(`updateCall`).send({data:{roomId:e,user:{id:t,callAction:n}}});if(r!==200)throw Error(`NotifySelfCallAction is error.`)};_calculateNetwork=async()=>{if(this.base.cws.prws.ws?.readyState===1&&this.base.peer.pc.connectionState===`connected`&&!this._networkCalculating){this._networkCalculating=!0;try{let t={elapsed:0,memory:{jsHeapSizeLimit:0,totalJSHeapSize:0,usedJSHeapSize:0},sfu:{inboundBytes:0,outboundBytes:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,velocityPush:0,velocityPull:0},p2p:{inboundBytes:0,outboundBytes:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,velocityPush:0,velocityPull:0}};if(performance)try{t.memory=performance.memory}catch{}let n=[],r=[];{let i=[0],a=[0],o=[0],s=[],c=[],l=new Date().getTime(),u=this.base.users.localUser,d=Array.from(this.base.users.remoteUsers.values()),f=await this.base.peer.pc.getStats(),p=await Promise.all(d.map(e=>e.p2p?.pc&&e.p2p.pc.connectionState===`connected`?e.p2p.pc.getStats():Promise.resolve(null)));await Promise.all([u.generateTrackAnalysis(this.base.peer,f),...d.map((e,t)=>e.generateTrackAnalysis(this.base.peer,f,p[t]))]);for(let e of M)if(u.published[e]&&u.getTrack(e)){let{trackReport:r}=u.tracksAnalysis.sfu.sends[e],{offsetBytesSent:l,lostRate:d,roundTripTime:f,jitter:p,quality:m,averageQuality:h,averageOffsetBytesSent:g}=r;this.base.traffic.sfu.outboundBytes+=l,t.sfu.velocityPush+=g,i.push(d),a.push(f),o.push(p),m!==0&&(s.push(m),n.push(m)),h!==0&&c.push(h)}for(let e of d)for(let n of M)if(e.getTrack(n)){let{trackReport:l}=e.tracksAnalysis.sfu.recvs[n],{offsetBytesSent:u,lostRate:d,roundTripTime:f,jitter:p,quality:m,averageQuality:h,averageOffsetBytesSent:g}=l;this.base.traffic.sfu.inboundBytes+=u,t.sfu.velocityPull+=g,i.push(d),a.push(f),o.push(p),m!==0&&(s.push(m),r.push(m)),h!==0&&c.push(h)}t.elapsed=new Date().getTime()-l,t.elapsed>1e3&&Date.now()-this._lastTrackAnalysisWarnTime>30*1e3&&(this._lastTrackAnalysisWarnTime=Date.now(),console.warn(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: generateTrackAnalysis taking too much time.`,{elapsed:t.elapsed})),t.sfu.lostRate=e._maxInNumberArray(i),t.sfu.roundTripTime=e._maxInNumberArray(a),t.sfu.jitter=e._maxInNumberArray(o),t.sfu.quality=s.length===0?0:e._minInNumberArray(s),t.sfu.averageQuality=c.length===0?0:e._minInNumberArray(c)}{let i=[0],a=[0],o=[0],s=[],c=[],l=this.base.users.remoteUsers.values();for(let e of l)for(let l of M)if(e.p2p){{let{trackReport:r}=e.tracksAnalysis.p2p.sends[l],{offsetBytesSent:u,lostRate:d,roundTripTime:f,jitter:p,quality:m,averageQuality:h,averageOffsetBytesSent:g}=r;this.base.traffic.p2p.outboundBytes+=u,t.p2p.velocityPush+=g,i.push(d),a.push(f),o.push(p),m!==0&&(s.push(m),n.push(m)),h!==0&&c.push(h)}{let{trackReport:n}=e.tracksAnalysis.p2p.recvs[l],{offsetBytesSent:u,lostRate:d,roundTripTime:f,jitter:p,quality:m,averageQuality:h,averageOffsetBytesSent:g}=n;this.base.traffic.p2p.inboundBytes+=u,t.p2p.velocityPull+=g,i.push(d),a.push(f),o.push(p),m!==0&&(s.push(m),r.push(m)),h!==0&&c.push(h)}}t.p2p.lostRate=e._maxInNumberArray(i),t.p2p.roundTripTime=e._maxInNumberArray(a),t.p2p.jitter=e._maxInNumberArray(o),t.p2p.quality=s.length===0?0:e._minInNumberArray(s),t.p2p.averageQuality=c.length===0?0:e._minInNumberArray(c)}{let e=this.base.traffic.getUse();t.sfu.outboundBytes=e.sfu.outboundBytes,t.sfu.inboundBytes=e.sfu.inboundBytes,t.p2p.outboundBytes=e.p2p.outboundBytes,t.p2p.inboundBytes=e.p2p.inboundBytes}this.base.config.network=t,this.base.notifys.emit(`onRoomNetwork`,{code:200,data:t,desc:`RoomNetwork is change.`});{let e=this.base.users.localUser,t=n.length===0?0:Math.round(n.reduce((e,t)=>e+t)/n.length),i=r.length===0?0:Math.round(r.reduce((e,t)=>e+t)/r.length);e.updateNetwork({egress:t,ingress:i})===!1&&(await this.base.cws.createRequest(`networkQualityChange`,{onBack:!1}).send({data:{egress:t,ingress:i,userId:e.id,roomId:this.base.config.roomId}}),this.base.users.emitUsersChange())}try{await this._checkAndSelectUserStreamOrigin()}catch(e){this.base.config.debug===!0&&console.warn(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: [_checkAndSelectUserStreamOrigin]`,e)}}finally{this._networkCalculating=!1}}};_checkAndSelectUserStreamOrigin=async()=>{if(this._hasAsyncTask(`subscribe`)||this._hasAsyncTask(`publish`)||this._hasAsyncTask(`closeTrack`))return;let e=this.base.config.network.sfu.averageQuality,t=this.base.users.remoteUsers.values(),n=[],r=[],i=new Date().getTime();for(let a of t){let t=a.p2p;if(!t)continue;let o=[];for(let n of M){if(!t.hasRecvier(n))continue;let s=t.checkReceActive(n);if(!s)continue;let c=a.getTrack(n);if(!c){t.setRecvTracksEnabled([n],!1);continue}let{averageQuality:l,availableScore:u}=a.tracksAnalysis.p2p.recvs[n]?.trackReport,d=this.base._checkUserStreamOrigin({p2pAverageQuality:l,sfuAverageQuality:e});c.origin===`p2p`&&[`mc_video`,`ss_video`].includes(n)&&i-s>=1e4&&u<.6&&(d=`sfu`,this.base.config.debug===!0&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: Switching to SFU. availableScore: ${u}`,{remoteUserId:a.id,mediaType:n,availableScore:u})),d!==c.origin&&(d===`p2p`?(a.useRemoteP2PStream([n]),r.push(c)):o.push(n))}o.length!==0&&(this.base._reportP2PConnect(`disconnect`,{desc:`Poor quality of P2P. `,pushId:a.id,pullId:this.base.config.userId,mediaTypes:o}),n.push({userId:a.id,mediaTypes:o}))}if(r.length!==0&&await this._closeTrack(r),n.length!==0){await this.subscribe(n);for(let e of n){let{userId:t,mediaTypes:n}=e;try{this.base.users.getRemoteUserContent(t)?.p2p?.setRecvTracksEnabled(n,!1)}catch(e){console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: [_checkAndSelectUserStreamOrigin]`,e)}}}r.length!==0&&n.length===0&&this.base.users.emitUsersChange()};_hasAsyncTask=e=>{let t=!1;return this.base.asyncQueue.activePromise?.describe===e&&(t=!0),t===!1&&this.base.asyncQueue.queue.find(t=>t.describe===e)&&(t=!0),t};_syncRoomInfo=async()=>this._syncRoomInfoTask.state===`ready`?this._syncRoomInfoTask.exe(async()=>{let e=this.base.users.localUser,{id:t,callAction:n}=e,r=this.base.users.getP2PState(),{code:i=0,desc:a,data:o}=await this.base.cws.createRequest(`syncRoomInfo`).send({data:{user:{id:t,callAction:n},p2pState:r}});if(i!==200)throw Error(a);if(!o)throw Error(`No sync room data.`);if(o.isActive===!1)throw Error(`Do not stay in this room.`);let s=o.users||[];if((s.find(t=>t.id===e.id)||!1)===!1)throw Error(`Need to rejoin the room.`);let c=Array.from(s,e=>e.id);for(let{mids:e}of this.base.users.pruneRemoteUsersNotInServerList(c))e.length!==0&&this.base.peer.stopReceivers(e);return this.base.users.initUsers(s,!1),this._scheduleAutoCheckSubscribe(),!0}):this._syncRoomInfoTask.promise;_restorePeer=async()=>this._restorePeerTask.state===`ready`?this._restorePeerTask.exe(async()=>{this.base.config.debug&&console.info(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: [restorePeer]`),await this._connectCFWithRecoveryRetries(`restorePeer`);{let e=[];for(let t of M)this.base.users.localUser.published[t]!==!1&&e.push(t);let{valid_mediaTypes:t}=this.base.localMedias.checkLocalStreamTracks(e);t.length!==0&&this.publish(t)}return this._scheduleAutoCheckSubscribe(),!0}).catch(e=>{throw console.warn(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: [RestorePeer is error.]`,e),this._clear(),e}):this._restorePeerTask.promise;_restoreRoom=async()=>{this.base.intervalQueue.removeQueueItem([`heartbeat-interval`]);try{await this._connectCws(!1),await this._syncRoomInfo(),await this._restorePeer()}catch(e){console.warn(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: [RestoreRoom is error.]`,e)}}};function lf(e){return e.map(e=>On(wi,{sdpMid:e.sdpMid??``,sdpMLineIndex:e.sdpMLineIndex??0,sdp:e.candidate??``}))}var uf=class{base;_p2pCheckTimeoutMap=new Map;constructor({base:e}){this.base=e,this.base.cws.on.onOffer=e=>{this._onOffer(e)},this.base.cws.on.onCandidate=e=>{this._onCandidate(e)},this.base.cws.on.onAttemptP2PEx=e=>{let{roomId:t,pushId:n,types:r=[],isRemotePush:i=!1}=e.data;if(r.length===0){this.base.config.debug&&console.error(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: [onAttemptP2PEx] There is an error. types.length === 0`,e);return}if(this.base.config.roomId!==t){this.base.config.debug&&console.error(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: [onAttemptP2PEx] There is an error. roomId is inequality.`,e);return}let a=Array.from(r,e=>M[e]);a.length!==0&&this._openP2P(n,a,i)},this.base.cws.on.onDisconnectedP2P=e=>{let{roomId:t,remoteUserId:n}=e.data;if(t!==this.base.config.roomId)return;let r=this.base.users.getRemoteUserContent(n);!r||!r.p2p||r.p2p.checkActive()===!1&&r.p2p.close()}}_openP2P=async(e,t,n)=>{if(t.length===0)return;let{useP2P:r,roomId:i,userId:a}=this.base.config;if(r===!1)throw Error(`You have disabled the p2p function on the client side.`);try{let r=this.base.users.localUser,o=new Date().getTime(),s=this.base.users.getRemoteUserContent(e);if(!s)throw Error(`The remote user to be established does not exist.`);let c=this._getRemoteUserP2PContent(e,!0),{prohibited_mediaTypes:l=[],subscribed_mediaTypes:u=[]}=s.checkSubscribed(t);if(n===!0&&l.length!==0&&(this.base._reportP2PConnect(`ignore`,{desc:`P2P connections without a subscription relationship are not allowed.`,pullId:a,pushId:e,mediaTypes:l}),u.length===0))return;this.base.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: [${e}]: start connect p2p.`,{isRemotePush:n}),n===!1?(c.close(),c.init()):c.pc?.connectionState!==`connected`&&c.init();let d=c.initRecvs(u);if(d.length!==0){let t=()=>{let t=async()=>{let t=await c.createOffer(),n=c.getRecvUserTracksAsRoomTrack(u),{code:o=0,desc:s}=await this.base.cws.createRequest(`offer`).send({data:{roomId:i,tracks:n,sender:{id:a,callAction:r.callAction},receiverId:e,sdp:t.sdp??``}});if(o!==200)throw Error(s)};return O(()=>new Promise(n=>{this.base.cws.on.onAnswer=t=>{let{code:r,data:i}=t;if(r!==200||!i)return;let{sender:a,sdp:o,tracks:s=[]}=i,c=a?.id;c!==void 0&&e===c&&n({answer:{type:`answer`,sdp:o},tracks:s})},t()}),{message:`await_answer is timeout.`,timeout:20*1e3})},n=async()=>{let t=lf(await O(c.getIcecandidates,{message:`get recv candidates is timeout.`,timeout:10*1e3})),{code:n=0,desc:r}=await this.base.cws.createRequest(`candidate`,{timeout:1e3*10}).send({data:{roomId:i,senderId:a,receiverId:e,candidates:t,isSubscribeReceiver:!0}});if(n!==200)throw Error(r)};{let{answer:e,tracks:r=[]}=await t();await c.setAnswer(e),await n();let i=[],a=[];for(let e of r){let{type:t,mid:n}=e;if(t===void 0)continue;let r=M[t];a.push(r),i.push({mediaType:r,mid:n,enabled:!1})}c.initSenders(i),c.setSendTracksEnabled(d,!1,`local`)}}await O(c.waitings.connected,{message:`ice connect is timeout.`,timeout:10*1e3}),await O(c.waitings.remoteChannelConnected,{message:`remote_channel connect is timeout.`,timeout:10*1e3}),n===!0&&c.setRecvTracksEnabled(u,!0);let f=`${new Date().getTime()-o}`;n===!0?await this.base._reportP2PConnect(`success`,{action:3,desc:`P2P connection successful.`,pullId:a,pushId:e,mediaTypes:u,connectedTime:f}):await this.base._reportP2PConnect(`success`,{action:2,desc:`P2P connection successful.`,pullId:e,pushId:a,mediaTypes:t,connectedTime:f}),this.base.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: [${e}]: switch to P2P will be attempted within 10 seconds.`);{let t=this._p2pCheckTimeoutMap.get(e);t&&clearTimeout(t);let n=window.setTimeout(()=>{this._p2pCheckTimeoutMap.delete(e);let t=[],n=this.base.users.getRemoteUserContent(e);if(!(!n||!n.p2p)){for(let e of u){let r=n.p2p.activeRecv[e]||!1,i=n.getTrack(e);r&&i?.origin!==`p2p`&&t.push(e)}t.length!==0&&(n.p2p.setRecvTracksEnabled(t,!1),this.base._reportP2PConnect(`disconnect`,{desc:`Poor quality of P2P.`,pushId:n.id,pullId:this.base.config.userId,mediaTypes:t}))}},1e3*10);this._p2pCheckTimeoutMap.set(e,n)}}catch(r){this.base.users.getRemoteUserContent(e)?.p2p?.destroy(),this.base.config.debug&&console.info(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: [p2p]: onOpen p2p with ${e} is error.`,r),n===!0?await this.base._reportP2PConnect(`fail`,{action:0,desc:r.message||r,pullId:a,pushId:e,mediaTypes:t}):await this.base._reportP2PConnect(`fail`,{action:1,desc:r.message||r,pullId:e,pushId:a,mediaTypes:t})}};_onOffer=async e=>{let{code:t,data:n}=e;if(t!==200||!n)return;let{sdp:r,sender:i,tracks:a=[]}=n,o=i?.id;if(!o)return;let{userId:s,roomId:c}=this.base.config,l=this.base.users.localUser;try{let e=this.base.users.getrP2PConnectedCount(),t=[],n=[];for(let e of a){let{type:r,mid:i}=e;if(r===void 0)continue;let a=M[r];t.push(a),n.push({mediaType:a,mid:i,enabled:!1})}if(e+t.length>3){if(t.length===2){let e=t.findIndex(e=>e===`ss_video`);t.splice(e,1),await this.base._reportP2PConnect(`ignore`,{desc:`P2P connections have reached the maximum limit.`,pushId:s,pullId:o,mediaTypes:[`ss_video`]})}if(t.length===1){await this.base._reportP2PConnect(`ignore`,{desc:`P2P connections have reached the maximum limit.`,pushId:s,pullId:o,mediaTypes:t});return}}let i=this._getRemoteUserP2PContent(o,!0);this.base.config.debug&&console.log(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: [${o}]: start connect p2p.`),i.pc?.connectionState!==`connected`&&i.init(),await i.setOffer({type:`offer`,sdp:r});{let e=i.initSenders(n);i.setSendTracksEnabled(e,!1,`local`)}let u=await i.createAnswer(),d=i.getSenderUserTracksAsRoomTrack(t);await(async()=>{let{code:e=0,desc:t}=await this.base.cws.createRequest(`answer`).send({data:{roomId:c,tracks:d,sender:{id:l.id,callAction:l.callAction},receiverId:o,sdp:u.sdp??``}});if(e!==200)throw Error(t)})(),await new Promise(e=>setTimeout(()=>e(!0),1e3)),await(async()=>{let e=lf(await O(i.getIcecandidates,{message:`get send candidates is timeout.`,timeout:10*1e3})),{code:t=0,desc:n}=await this.base.cws.createRequest(`candidate`).send({data:{roomId:c,senderId:l.id,receiverId:o,candidates:e,isSubscribeReceiver:!1}});if(t!==200)throw Error(n)})(),await O(i.waitings.connected,{message:`ice connect is timeout.`,timeout:20*1e3})}catch(e){this.base.config.debug&&console.info(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: [p2p]: onReply p2p with ${o} is error.`,e)}};_onCandidate=async e=>{let{code:t,data:n}=e;if(t!==200)return;let{senderId:r,candidates:i=[],receiverId:a,isSubscribeReceiver:o=!1}=n,{userId:s}=this.base.config;if(o===!1||a!==s)return;let c=this.base.users.getRemoteUserContent(r);if(!c||!c.p2p){console.warn(`\x1B[38;2;0;151;255m%c%s\x1B[0m`,`color:#0097ff;`,`------->quickvo: An error occurred in onCandidate.`,c);return}let l=Array.from(i,({sdpMid:e,sdpMLineIndex:t,sdp:n})=>({sdpMid:e,sdpMLineIndex:t,candidate:n}));await c.p2p.addCandidates(l)};_getRemoteUserP2PContent=(e,t)=>{let n=this.base.users.getRemoteUserContent(e);if(!n)throw Error(`The remote user to be established does not exist.`);if(t===!0&&(n.p2p||this.base.users.createRemoteUserP2P(e)),!n.p2p)throw Error(`The remote user p2p to be established does not exist.`);return n.p2p};destroy=()=>{for(let e of this._p2pCheckTimeoutMap.values())clearTimeout(e);this._p2pCheckTimeoutMap.clear()}},df=`1.6.70`,ff=class{static version=df;_base=new nf;_ACTION_BASE=new rf({base:this._base});_ACTION_SFU=new cf({base:this._base});_ACTION_P2P=new uf({base:this._base});constructor(e){console.info(`[QuickVO] version is ${df}`),this._base.config.setOptions(e)}recorder=this._base.recorder;use=this._base.use;setCallStrategy=this._base.setCallStrategy;addNotify=this._base.notifys.add;setOptions=this._base.config.setOptions;getLocalStream=this._base.users.localUser.getStream;getLocalStreams=this._base.users.localUser.getStreams;setActiveNoise=this._base.users.localUser.setActiveNoise;hasPermissions=this._base.users.localUser.hasPermissions;getUserContent=this._base.users.getUserContent;getUserStream=this._base.users.getUserStream;getVolume=this._base.users.getVolume;getMaxVolumeUser=this._base.users.getMaxVolumeUser;setInputVolume=this._base.users.setInputVolume;setEnhanceGain=this._base.users.setEnhanceGain;setSpeakerVolume=this._base.users.setSpeakerVolume;getUserAudioMediaStreamContext=this._base.users.getUserAudioMediaStreamContext;playBgs=this._base.users.playBgs;changBgsMix=this._base.users.changBgsMix;stopBgs=this._base.users.stopBgs;setBgsGain=this._base.users.setBgsGain;playBgm=this._base.users.playBgm;changBgmMix=this._base.users.changBgmMix;stopBgm=this._base.users.stopBgm;setBgmGain=this._base.users.setBgmGain;getEnumerateDevices=this._base.localMedias.getEnumerateDevices;getMediaDeviceKind=this._base.localMedias.getMediaDeviceKind;getMediaDevicesErrInfo=this._base.localMedias.getMediaDevicesErrInfo;setLocalStream=this._ACTION_SFU.setLocalStream;setMediaDeviceKind=this._ACTION_SFU.setMediaDeviceKind;setMediaTrackConstraints=this._ACTION_SFU.setMediaTrackConstraints;earlyConnect=this._ACTION_SFU.earlyConnect;joinRoom=this._ACTION_SFU.joinRoom;publish=this._ACTION_SFU.publish;stopPublish=this._ACTION_SFU.stopPublish;subscribe=this._ACTION_SFU.subscribe;stopSubscribe=this._ACTION_SFU.stopSubscribe;setBehaviors=this._ACTION_SFU.setBehaviors;updateSimulcast=this._ACTION_SFU.updateSimulcast;toggleRoomSpeechLang=this._ACTION_SFU.toggleRoomSpeechLang;updateToken=this._ACTION_SFU.updateToken;quitRoom=this._ACTION_SFU.quitRoom;quitRoomEx=this._ACTION_SFU.quitRoomEx;destroy=()=>{this._ACTION_P2P.destroy(),this._ACTION_SFU.destroy(),yu(),wd()};addRequestAnimationFrame=this._base.animationFrame.addRequestAnimationFrame;clearRequestAnimationFrame=this._base.animationFrame.clearRequestAnimationFrame;getLocalUserTrackReports=this._base.users.getLocalUserTrackReports;getRemoteUserTrackReports=this._base.users.getRemoteUserTrackReports;getRoomAction=this._base.config.getRoomAction;_openP2P=this._ACTION_P2P._openP2P;_restoreRoom=this._ACTION_SFU._restoreRoom;_debugger=this._ACTION_BASE._debugger;_ai=this._ACTION_BASE._ai},pf={qualityPriority:`画质优先`,fluencyPriority:`流畅度优先`,balancedDowngrade:`均衡降级`},mf=h(pf),hf=Object.keys(pf),gf=Object.values(pf),_f={heartbeat:`心跳`,heartbeatEx:`慢心跳`,ackMsg:`确认收到消息`,reportNetwork:`上报网络类型`,connectCF:`连接CF`,genTurnAddress:`获取TURN地址`,publish:`发布流`,joinRoom:`加入房间`,joinRoomEx:`加入房间(提前建连)`,pubNotify:`广播已发布的轨道`,subscribe:`订阅流`,renegotiate:`协商流`,closeTrack:`关闭轨道`,preventUsersBehavior:`阻止用户行为`,networkQualityChange:`更新网络状态`,updateCall:`更新通话状态`,updateSimulcast:`切换大小流`,toggleRoomSpeechLang:`切换房间语音识别`,syncRoomInfo:`同步房间`,updateRoomToken:`更新房间SDKTOKEN`,offer:`发送P2P-offer`,answer:`回应P2P-answer`,candidate:`发送P2P候选信息-candidate`,reportP2PConnectEx:`上报P2P连接结果`,quitRoom:`退出房间`,quitRoomEx:`退出房间不断开连接`,debugger:`调试`,ai:`WorkerAi调试`,UpdateTrackActive:`p2p轨道状态`},vf=h(_f),yf=Object.keys(_f),bf=Object.values(_f),xf={0:`未知`,1:`极差`,2:`较差`,3:`一般`,4:`很好`,5:`极好`},Sf=h(xf),Cf=Object.keys(xf),wf=Object.values(xf),Tf={ready:`已就绪`,connecting:`连接中`,connected:`已连接`,reconnect:`正在重新连接`,disconnected:`已断开`,closed:`已关闭`},Ef=h(Tf),Df=Object.keys(Tf),Of=Object.values(Tf),kf={0:`麦克风-默认轨道`,1:`摄像头-默认轨道`,2:`屏幕共享-视频轨道`,3:`屏幕共享-音频轨道`},Af=h(kf),jf=Object.keys(kf),Mf=Object.values(kf);e.IceConnectType=Vi,e.QuickVO=ff,e.callStrategy_keys=hf,e.callStrategy_options=mf,e.callStrategy_vals=gf,e.defineCwsOn=nu,e.defineQuickvoNotify=de,e.enum_callStrategy=pf,e.enum_eventName=_f,e.enum_mediaType=pe,e.enum_notifyName=Bu,e.enum_quality=xf,e.enum_roomState=Tf,e.enum_trackType=kf,e.eventName_keys=yf,e.eventName_options=vf,e.eventName_vals=bf,e.mediaType_keys=M,e.mediaType_options=me,e.mediaType_vals=he,e.notifyName_keys=Hu,e.notifyName_options=Vu,e.notifyName_vals=Uu,e.quality_keys=Cf,e.quality_options=Sf,e.quality_vals=wf,e.roomState_keys=Df,e.roomState_options=Ef,e.roomState_vals=Of,Object.defineProperty(e,`tools`,{enumerable:!0,get:function(){return k}}),e.trackType_keys=jf,e.trackType_options=Af,e.trackType_vals=Mf});