quickvo-sdk-js 0.4.3 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  (function(at,ct){typeof exports=="object"&&typeof module<"u"?ct(exports):typeof define=="function"&&define.amd?define(["exports"],ct):(at=typeof globalThis<"u"?globalThis:at||self,ct(at["snqu-calls-sdk-js"]={}))})(this,function(exports){"use strict";var Vt=Object.defineProperty;var Qt=at=>{throw TypeError(at)};var Yt=(at,ct,dt)=>ct in at?Vt(at,ct,{enumerable:!0,configurable:!0,writable:!0,value:dt}):at[ct]=dt;var H=(at,ct,dt)=>Yt(at,typeof ct!="symbol"?ct+"":ct,dt),Gt=(at,ct,dt)=>ct.has(at)||Qt("Cannot "+dt);var G=(at,ct,dt)=>(Gt(at,ct,"read from private field"),dt?dt.call(at):ct.get(at)),lt=(at,ct,dt)=>ct.has(at)?Qt("Cannot add the same private member more than once"):ct instanceof WeakSet?ct.add(at):ct.set(at,dt),vt=(at,ct,dt,ht)=>(Gt(at,ct,"write to private field"),ht?ht.call(at,dt):ct.set(at,dt),dt);var at,ct,dt,ht,yt,It,Rt,Et,xt,$t,Nt,At,qt,kt,bt,_t,Tt,Dt,Ct,Ut,Ot,Mt,Pt,Bt,Lt,jt,gt,wt,Zt,Ft,Ht,zt;const v$1=(_,q=[])=>{const k={..._},D=Object.keys(k);for(const $ of D)q.findIndex(I=>String(I)===$)===-1&&delete k[$];return k},it=(_,q=[],k=!0)=>{const D=new Map;for(const I of _){const e=[];for(const N of q)e.push(I[N]);const u=`map-${e.join("-")}`;if(!D.has(u)){D.set(u,I);continue}k&&D.set(u,I)}const $=D.entries();return Array.from($,([I,e])=>e)},mt=(_,q=[])=>{const k=[];for(const D of _){const $=v$1(D,q);k.push($)}return k},ut=(_,q="value",k="label")=>{const D=[],$=Object.entries(_);for(const[I,e]of $){const u={[k]:e,[q]:I};D.push(u)}return D},O=(_=0,q=1)=>{const k=Math.max(0,_),D=Math.max(1,q),$=Math.random()*(D-k+1)+k;return parseInt(`${$}`,10)},pt=(_=16,q=16)=>{const k="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),D=Math.min(k.length,q),$=Date.now().toString(D),I=$.split(""),e=Math.max(4,_-$.length);for(let u=0;u<e;u++){const N=O(0,D-1),A=k[N];I.push(A)}return I.join("").toUpperCase()},j=(_,q)=>{try{let k=Number(_);if(isNaN(k)){const D=new Date(`${_}`);if(`${D}`=="Invalid Date")return 0;k=D.getTime()}if(q!==void 0){const D=new Date().getTimezoneOffset();k+=(D+q)*60*1e3}return k}catch(k){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:_,_offset:q,error:k}),0}},Q={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6","00":"日","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六"},E=(_,q="YYYY-MM-DD hh:mm:ss",k={})=>{const D={empty_str:"-",...k},{empty_str:$,offset:I}=D,e=j(_,I);if(Number(_)!==0&&e===0)return $;const u=new Date(e),N=[{k:"Y+",v:`${u.getFullYear()}`},{k:"M+",v:`${u.getMonth()+1}`},{k:"D+",v:`${u.getDate()}`},{k:"W+",v:`${u.getDay()}`},{k:"h+",v:`${u.getHours()}`},{k:"m+",v:`${u.getMinutes()}`},{k:"s+",v:`${u.getSeconds()}`}];let A;for(let{k:U,v:L}of N)if(A=new RegExp(`(${U})`).exec(q),A){const P=A[1];let Z=L.padStart(P.length,"0");P.includes("W")&&(Z=Q[Z.slice(0,2)]),q=q.replace(P,Z)}return q},enum_mediaType={microphoneCamera_audio:"麦克风-默认轨道",microphoneCamera_video:"摄像头-默认轨道",screenSharing_video:"屏幕共享-视频轨道",screenSharing_audio:"屏幕共享-音频轨道"};ut(enum_mediaType);const mediaType_keys=Object.keys(enum_mediaType);var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},lib={},parser={},grammar={exports:{}},hasRequiredGrammar;function requireGrammar(){if(hasRequiredGrammar)return grammar.exports;hasRequiredGrammar=1;var _=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(q){return q.encoding?"rtpmap:%d %s/%s/%s":q.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(q){return q.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(q){return q.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(q){return"extmap:%d"+(q.direction?"/%s":"%v")+(q["encrypt-uri"]?" %s":"%v")+" %s"+(q.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(q){return q.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"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%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(q){var k="candidate:%s %d %s %d %s %d typ %s";return k+=q.raddr!=null?" raddr %s rport %d":"%v%v",k+=q.tcptype!=null?" tcptype %s":"%v",q.generation!=null&&(k+=" generation %d"),k+=q["network-id"]!=null?" network-id %d":"%v",k+=q["network-cost"]!=null?" network-cost %d":"%v",k}},{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(q){var k="ssrc:%d";return q.attribute!=null&&(k+=" %s",q.value!=null&&(k+=":%s")),k}},{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(q){return q.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(q){return q.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(q){return"imageattr:%s %s %s"+(q.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(q){return"simulcast:%s %s"+(q.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(q){return"ts-refclk:%s"+(q.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(q){var k="mediaclk:";return k+=q.id!=null?"id=%s %s":"%v%s",k+=q.mediaClockValue!=null?"=%s":"",k+=q.rateNumerator!=null?" rate=%s":"",k+=q.rateDenominator!=null?"/%s":"",k}},{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(_).forEach(function(q){var k=_[q];k.forEach(function(D){D.reg||(D.reg=/(.*)/),D.format||(D.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function(_){var q=function(u){return String(Number(u))===u?Number(u):u},k=function(u,N,A,U){if(U&&!A)N[U]=q(u[1]);else for(var L=0;L<A.length;L+=1)u[L+1]!=null&&(N[A[L]]=q(u[L+1]))},D=function(u,N,A){var U=u.name&&u.names;u.push&&!N[u.push]?N[u.push]=[]:U&&!N[u.name]&&(N[u.name]={});var L=u.push?{}:U?N[u.name]:N;k(A.match(u.reg),L,u.names,u.name),u.push&&N[u.push].push(L)},$=requireGrammar(),I=RegExp.prototype.test.bind(/^([a-z])=(.*)/);_.parse=function(u){var N={},A=[],U=N;return u.split(/(\r\n|\r|\n)/).filter(I).forEach(function(L){var P=L[0],Z=L.slice(2);P==="m"&&(A.push({rtp:[],fmtp:[]}),U=A[A.length-1]);for(var F=0;F<($[P]||[]).length;F+=1){var W=$[P][F];if(W.reg.test(Z))return D(W,U,Z)}}),N.media=A,N};var e=function(u,N){var A=N.split(/=(.+)/,2);return A.length===2?u[A[0]]=q(A[1]):A.length===1&&N.length>1&&(u[A[0]]=void 0),u};_.parseParams=function(u){return u.split(/;\s?/).reduce(e,{})},_.parseFmtpConfig=_.parseParams,_.parsePayloads=function(u){return u.toString().split(" ").map(Number)},_.parseRemoteCandidates=function(u){for(var N=[],A=u.split(" ").map(q),U=0;U<A.length;U+=3)N.push({component:A[U],ip:A[U+1],port:A[U+2]});return N},_.parseImageAttributes=function(u){return u.split(" ").map(function(N){return N.substring(1,N.length-1).split(",").reduce(e,{})})},_.parseSimulcastStreamList=function(u){return u.split(";").map(function(N){return N.split(",").map(function(A){var U,L=!1;return A[0]!=="~"?U=q(A):(U=q(A.substring(1,A.length)),L=!0),{scid:U,paused:L}})})}}(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var _=requireGrammar(),q=/%[sdv%]/g,k=function(e){var u=1,N=arguments,A=N.length;return e.replace(q,function(U){if(u>=A)return U;var L=N[u];switch(u+=1,U){case"%%":return"%";case"%s":return String(L);case"%d":return Number(L);case"%v":return""}})},D=function(e,u,N){var A=u.format instanceof Function?u.format(u.push?N:N[u.name]):u.format,U=[e+"="+A];if(u.names)for(var L=0;L<u.names.length;L+=1){var P=u.names[L];u.name?U.push(N[u.name][P]):U.push(N[u.names[L]])}else U.push(N[u.name]);return k.apply(null,U)},$=["v","o","s","i","u","e","p","c","b","t","r","z","a"],I=["i","c","b","a"];return writer$1=function(e,u){u=u||{},e.version==null&&(e.version=0),e.name==null&&(e.name=" "),e.media.forEach(function(L){L.payloads==null&&(L.payloads="")});var N=u.outerOrder||$,A=u.innerOrder||I,U=[];return N.forEach(function(L){_[L].forEach(function(P){P.name in e&&e[P.name]!=null?U.push(D(L,P,e)):P.push in e&&e[P.push]!=null&&e[P.push].forEach(function(Z){U.push(D(L,P,Z))})})}),e.media.forEach(function(L){U.push(D("m",_.m[0],L)),A.forEach(function(P){_[P].forEach(function(Z){Z.name in L&&L[Z.name]!=null?U.push(D(P,Z,L)):Z.push in L&&L[Z.push]!=null&&L[Z.push].forEach(function(F){U.push(D(P,Z,F))})})})}),U.join(`\r
2
2
  `)+`\r
3
- `},writer$1}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var _=requireParser(),q=requireWriter$1(),k=requireGrammar();return lib.grammar=k,lib.write=q,lib.parse=_.parse,lib.parseParams=_.parseParams,lib.parseFmtpConfig=_.parseFmtpConfig,lib.parsePayloads=_.parsePayloads,lib.parseRemoteCandidates=_.parseRemoteCandidates,lib.parseImageAttributes=_.parseImageAttributes,lib.parseSimulcastStreamList=_.parseSimulcastStreamList,lib}var libExports=requireLib();class AudioMediaContext{constructor(q){H(this,"options",{autoGainControl:!1,noiseSuppression:!1,echoCancellation:!1});H(this,"kind","audio");H(this,"stream",new MediaStream);H(this,"audio",new Audio);H(this,"audioContext",new(window.AudioContext||window.webkitAudioContext));H(this,"mediaStreamAudioSourceNode");H(this,"autoGainNode");H(this,"biquadFilterNode");H(this,"delayNode");H(this,"gainNode");H(this,"analyserNode");H(this,"analyserArrayData");H(this,"stop",()=>{const q=this.stream.getTracks();for(const k of q)k.enabled=!1,k.stop(),this.stream.removeTrack(k)});H(this,"replaceStream",q=>{this.stop();const[k]=q.getAudioTracks();this.stream.addTrack(k)});H(this,"getStream",()=>this.mediaStreamAudioSourceNode.mediaStream);H(this,"setMute",(q=!0)=>{q?this.analyserNode.disconnect(this.audioContext.destination):this.analyserNode.connect(this.audioContext.destination)});H(this,"setVolumeGain",q=>{this.gainNode.gain.setValueAtTime(q,this.audioContext.currentTime)});H(this,"getVolume",()=>{const{analyserNode:q,analyserArrayData:k}=this;q.getByteFrequencyData(k);let D=0;for(let I=0;I<k.length;I++)D+=k[I];return Math.ceil(D/k.length)});H(this,"setFilter",(q={})=>{this.options={...this.options,...q};const{autoGainControl:k,noiseSuppression:D,echoCancellation:$}=this.options,{mediaStreamAudioSourceNode:I,autoGainNode:e,biquadFilterNode:u,delayNode:N,gainNode:A}=this,U=I;return k&&U.connect(e),D&&U.connect(u),$&&U.connect(N),U.connect(A),q});this.stream.addTrack(q),this.audio.srcObject=this.stream,this.audioContext=new(window.AudioContext||window.webkitAudioContext),this.mediaStreamAudioSourceNode=this.audioContext.createMediaStreamSource(this.stream),this.autoGainNode=this.audioContext.createGain(),this.autoGainNode.gain.setValueAtTime(.8,this.audioContext.currentTime),this.biquadFilterNode=this.audioContext.createBiquadFilter(),this.biquadFilterNode.type="lowpass",this.biquadFilterNode.frequency.value=1e3,this.delayNode=this.audioContext.createDelay(),this.delayNode.delayTime.value=.5,this.gainNode=this.audioContext.createGain(),this.gainNode.gain.setValueAtTime(1,this.audioContext.currentTime),this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=512,this.analyserArrayData=new Uint8Array(this.analyserNode.frequencyBinCount);const{gainNode:k,analyserNode:D}=this;k.connect(D),this.audioContext.state==="suspended"&&(this.audioContext.resume(),document.addEventListener("click",()=>this.audioContext.resume(),{once:!0})),this.setFilter()}}class VideoMediaContext{constructor(q){H(this,"kind","video");H(this,"stream",new MediaStream);H(this,"stop",()=>{const q=this.stream.getTracks();for(const k of q)k.enabled=!1,k.stop(),this.stream.removeTrack(k)});H(this,"replaceStream",q=>{this.stop();const[k]=q.getVideoTracks();this.stream.addTrack(k)});H(this,"getStream",()=>this.stream);H(this,"getTrack",()=>this.stream.getTracks()[0]);this.stream.addTrack(q)}}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",closed:"已关闭"};ut(enum_roomState);var C=Object.defineProperty,R=_=>{throw TypeError(_)},S=(_,q,k)=>q in _?C(_,q,{enumerable:!0,configurable:!0,writable:!0,value:k}):_[q]=k,l=(_,q,k)=>S(_,typeof q!="symbol"?q+"":q,k),v=(_,q,k)=>q.has(_)||R("Cannot "+k),t=(_,q,k)=>(v(_,q,"read from private field"),k?k.call(_):q.get(_)),c=(_,q,k)=>q.has(_)?R("Cannot add the same private member more than once"):q instanceof WeakSet?q.add(_):q.set(_,k),i=(_,q,k,D)=>(v(_,q,"write to private field"),q.set(_,k),k),s,r,h$1,p$1,m,f$1,w,x$1,g$1,b$1,B,y$1,T,d$1;class M{constructor(q){c(this,s,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,sendBeforAutoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4,checkReconnect:k=>!0,onReconnectSuccess:async k=>{},onReconnectStop:async k=>{},getHeartbeatMsg:()=>JSON.stringify({event:"heartbeat"}),onMessage:k=>{}}),l(this,"ws"),c(this,r,-1),c(this,h$1,-1),c(this,p$1,0),c(this,m,0),c(this,f$1,!1),c(this,w,k=>{}),l(this,"close",async(k=1e3,D="correctly close.")=>{var $;this.ws&&(i(this,f$1,!0),t(this,d$1).call(this),($=this.ws)==null||$.close(k,D))}),l(this,"connect",()=>new Promise(async k=>{i(this,w,k),this.ws=new WebSocket(t(this,s).url),this.ws.binaryType=t(this,s).binaryType,this.ws.onopen=t(this,b$1),this.ws.onmessage=t(this,g$1),this.ws.onerror=t(this,B),this.ws.onclose=t(this,y$1)})),l(this,"reconnect",async k=>new Promise(D=>{t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await reconnect.");const $=I=>{t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: ${I}`),t(this,s).onReconnectStop({msg:I}),D(I)};if(t(this,x$1).call(this)===!1)return $("stop reconnect. exceed maxReconnectionTime.");if(t(this,r)!==-1&&t(this,r)===0)return $("stop reconnect. surplusReconnectCount is 0.");if(!t(this,s).checkReconnect(k))return $("stop reconnect. checkReconnect is false.");t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: await ${t(this,s).reconnectIntervalTime}ms run reconnect. surplusReconnectCount is ${t(this,r)}`,k),i(this,p$1,setTimeout(async()=>{i(this,r,Math.max(-1,t(this,r)-1)),await this.connect();try{await t(this,s).onReconnectSuccess(this.ws)}catch(I){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->pr-ws: onReconnectSuccess is error",I)}D(!0)},t(this,s).reconnectIntervalTime))})),l(this,"sendMessage",async k=>{var D;(!this.ws||this.ws.readyState!==1)&&(t(this,s).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: ws is not ready."),t(this,s).sendBeforAutoConnect&&(t(this,s).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await ws connect."),await this.connect())),(D=this.ws)==null||D.send(k)}),c(this,x$1,()=>{const k=Date.now();return t(this,h$1)===-1&&i(this,h$1,k+t(this,s).reconnectTime),!(k>t(this,h$1))}),c(this,g$1,k=>{const{data:D}=k;t(this,s).onMessage(D)}),c(this,b$1,()=>{t(this,s).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is success.",this.ws),i(this,r,t(this,s).reconnectCount),i(this,h$1,-1),t(this,T).call(this),t(this,w).call(this,this.ws)}),c(this,B,k=>{t(this,s).debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is error.",k)}),c(this,y$1,k=>{if(t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: connect is close. code: ${k.code}, permanentClosed is ${t(this,f$1)}.`,k),t(this,d$1).call(this),!t(this,f$1))return this.reconnect(k);this.ws=void 0}),c(this,T,()=>{i(this,m,setInterval(()=>{const k=t(this,s).getHeartbeatMsg();k&&this.sendMessage(k)},t(this,s).heartbeatIntervalTime))}),c(this,d$1,()=>{clearInterval(t(this,p$1)),clearInterval(t(this,m))}),i(this,s,{...t(this,s),...q}),i(this,r,t(this,s).reconnectCount)}}s=new WeakMap,r=new WeakMap,h$1=new WeakMap,p$1=new WeakMap,m=new WeakMap,f$1=new WeakMap,w=new WeakMap,x$1=new WeakMap,g$1=new WeakMap,b$1=new WeakMap,B=new WeakMap,y$1=new WeakMap,T=new WeakMap,d$1=new WeakMap;var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=_;function _(q,k){for(var D=new Array(arguments.length-1),$=0,I=2,e=!0;I<arguments.length;)D[$++]=arguments[I++];return new Promise(function(N,A){D[$]=function(L){if(e)if(e=!1,L)A(L);else{for(var P=new Array(arguments.length-1),Z=0;Z<P.length;)P[Z++]=arguments[Z];N.apply(null,P)}};try{q.apply(k||null,D)}catch(U){e&&(e=!1,A(U))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(_){var q=_;q.length=function(u){var N=u.length;if(!N)return 0;for(var A=0;--N%4>1&&u.charAt(N)==="=";)++A;return Math.ceil(u.length*3)/4-A};for(var k=new Array(64),D=new Array(123),$=0;$<64;)D[k[$]=$<26?$+65:$<52?$+71:$<62?$-4:$-59|43]=$++;q.encode=function(u,N,A){for(var U=null,L=[],P=0,Z=0,F;N<A;){var W=u[N++];switch(Z){case 0:L[P++]=k[W>>2],F=(W&3)<<4,Z=1;break;case 1:L[P++]=k[F|W>>4],F=(W&15)<<2,Z=2;break;case 2:L[P++]=k[F|W>>6],L[P++]=k[W&63],Z=0;break}P>8191&&((U||(U=[])).push(String.fromCharCode.apply(String,L)),P=0)}return Z&&(L[P++]=k[F],L[P++]=61,Z===1&&(L[P++]=61)),U?(P&&U.push(String.fromCharCode.apply(String,L.slice(0,P))),U.join("")):String.fromCharCode.apply(String,L.slice(0,P))};var I="invalid encoding";q.decode=function(u,N,A){for(var U=A,L=0,P,Z=0;Z<u.length;){var F=u.charCodeAt(Z++);if(F===61&&L>1)break;if((F=D[F])===void 0)throw Error(I);switch(L){case 0:P=F,L=1;break;case 1:N[A++]=P<<2|(F&48)>>4,P=F,L=2;break;case 2:N[A++]=(P&15)<<4|(F&60)>>2,P=F,L=3;break;case 3:N[A++]=(P&3)<<6|F,L=0;break}}if(L===1)throw Error(I);return A-U},q.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=_;function _(){this._listeners={}}return _.prototype.on=function(k,D,$){return(this._listeners[k]||(this._listeners[k]=[])).push({fn:D,ctx:$||this}),this},_.prototype.off=function(k,D){if(k===void 0)this._listeners={};else if(D===void 0)this._listeners[k]=[];else for(var $=this._listeners[k],I=0;I<$.length;)$[I].fn===D?$.splice(I,1):++I;return this},_.prototype.emit=function(k){var D=this._listeners[k];if(D){for(var $=[],I=1;I<arguments.length;)$.push(arguments[I++]);for(I=0;I<D.length;)D[I].fn.apply(D[I++].ctx,$)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=_(_);function _(I){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),u=new Uint8Array(e.buffer),N=u[3]===128;function A(Z,F,W){e[0]=Z,F[W]=u[0],F[W+1]=u[1],F[W+2]=u[2],F[W+3]=u[3]}function U(Z,F,W){e[0]=Z,F[W]=u[3],F[W+1]=u[2],F[W+2]=u[1],F[W+3]=u[0]}I.writeFloatLE=N?A:U,I.writeFloatBE=N?U:A;function L(Z,F){return u[0]=Z[F],u[1]=Z[F+1],u[2]=Z[F+2],u[3]=Z[F+3],e[0]}function P(Z,F){return u[3]=Z[F],u[2]=Z[F+1],u[1]=Z[F+2],u[0]=Z[F+3],e[0]}I.readFloatLE=N?L:P,I.readFloatBE=N?P:L}():function(){function e(N,A,U,L){var P=A<0?1:0;if(P&&(A=-A),A===0)N(1/A>0?0:2147483648,U,L);else if(isNaN(A))N(2143289344,U,L);else if(A>34028234663852886e22)N((P<<31|2139095040)>>>0,U,L);else if(A<11754943508222875e-54)N((P<<31|Math.round(A/1401298464324817e-60))>>>0,U,L);else{var Z=Math.floor(Math.log(A)/Math.LN2),F=Math.round(A*Math.pow(2,-Z)*8388608)&8388607;N((P<<31|Z+127<<23|F)>>>0,U,L)}}I.writeFloatLE=e.bind(null,q),I.writeFloatBE=e.bind(null,k);function u(N,A,U){var L=N(A,U),P=(L>>31)*2+1,Z=L>>>23&255,F=L&8388607;return Z===255?F?NaN:P*(1/0):Z===0?P*1401298464324817e-60*F:P*Math.pow(2,Z-150)*(F+8388608)}I.readFloatLE=u.bind(null,D),I.readFloatBE=u.bind(null,$)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),u=new Uint8Array(e.buffer),N=u[7]===128;function A(Z,F,W){e[0]=Z,F[W]=u[0],F[W+1]=u[1],F[W+2]=u[2],F[W+3]=u[3],F[W+4]=u[4],F[W+5]=u[5],F[W+6]=u[6],F[W+7]=u[7]}function U(Z,F,W){e[0]=Z,F[W]=u[7],F[W+1]=u[6],F[W+2]=u[5],F[W+3]=u[4],F[W+4]=u[3],F[W+5]=u[2],F[W+6]=u[1],F[W+7]=u[0]}I.writeDoubleLE=N?A:U,I.writeDoubleBE=N?U:A;function L(Z,F){return u[0]=Z[F],u[1]=Z[F+1],u[2]=Z[F+2],u[3]=Z[F+3],u[4]=Z[F+4],u[5]=Z[F+5],u[6]=Z[F+6],u[7]=Z[F+7],e[0]}function P(Z,F){return u[7]=Z[F],u[6]=Z[F+1],u[5]=Z[F+2],u[4]=Z[F+3],u[3]=Z[F+4],u[2]=Z[F+5],u[1]=Z[F+6],u[0]=Z[F+7],e[0]}I.readDoubleLE=N?L:P,I.readDoubleBE=N?P:L}():function(){function e(N,A,U,L,P,Z){var F=L<0?1:0;if(F&&(L=-L),L===0)N(0,P,Z+A),N(1/L>0?0:2147483648,P,Z+U);else if(isNaN(L))N(0,P,Z+A),N(2146959360,P,Z+U);else if(L>17976931348623157e292)N(0,P,Z+A),N((F<<31|2146435072)>>>0,P,Z+U);else{var W;if(L<22250738585072014e-324)W=L/5e-324,N(W>>>0,P,Z+A),N((F<<31|W/4294967296)>>>0,P,Z+U);else{var J=Math.floor(Math.log(L)/Math.LN2);J===1024&&(J=1023),W=L*Math.pow(2,-J),N(W*4503599627370496>>>0,P,Z+A),N((F<<31|J+1023<<20|W*1048576&1048575)>>>0,P,Z+U)}}}I.writeDoubleLE=e.bind(null,q,0,4),I.writeDoubleBE=e.bind(null,k,4,0);function u(N,A,U,L,P){var Z=N(L,P+A),F=N(L,P+U),W=(F>>31)*2+1,J=F>>>20&2047,z=4294967296*(F&1048575)+Z;return J===2047?z?NaN:W*(1/0):J===0?W*5e-324*z:W*Math.pow(2,J-1075)*(z+4503599627370496)}I.readDoubleLE=u.bind(null,D,0,4),I.readDoubleBE=u.bind(null,$,4,0)}(),I}function q(I,e,u){e[u]=I&255,e[u+1]=I>>>8&255,e[u+2]=I>>>16&255,e[u+3]=I>>>24}function k(I,e,u){e[u]=I>>>24,e[u+1]=I>>>16&255,e[u+2]=I>>>8&255,e[u+3]=I&255}function D(I,e){return(I[e]|I[e+1]<<8|I[e+2]<<16|I[e+3]<<24)>>>0}function $(I,e){return(I[e]<<24|I[e+1]<<16|I[e+2]<<8|I[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(_){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(_){var q=_;q.length=function(D){for(var $=0,I=0,e=0;e<D.length;++e)I=D.charCodeAt(e),I<128?$+=1:I<2048?$+=2:(I&64512)===55296&&(D.charCodeAt(e+1)&64512)===56320?(++e,$+=4):$+=3;return $},q.read=function(D,$,I){var e=I-$;if(e<1)return"";for(var u=null,N=[],A=0,U;$<I;)U=D[$++],U<128?N[A++]=U:U>191&&U<224?N[A++]=(U&31)<<6|D[$++]&63:U>239&&U<365?(U=((U&7)<<18|(D[$++]&63)<<12|(D[$++]&63)<<6|D[$++]&63)-65536,N[A++]=55296+(U>>10),N[A++]=56320+(U&1023)):N[A++]=(U&15)<<12|(D[$++]&63)<<6|D[$++]&63,A>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,N)),A=0);return u?(A&&u.push(String.fromCharCode.apply(String,N.slice(0,A))),u.join("")):String.fromCharCode.apply(String,N.slice(0,A))},q.write=function(D,$,I){for(var e=I,u,N,A=0;A<D.length;++A)u=D.charCodeAt(A),u<128?$[I++]=u:u<2048?($[I++]=u>>6|192,$[I++]=u&63|128):(u&64512)===55296&&((N=D.charCodeAt(A+1))&64512)===56320?(u=65536+((u&1023)<<10)+(N&1023),++A,$[I++]=u>>18|240,$[I++]=u>>12&63|128,$[I++]=u>>6&63|128,$[I++]=u&63|128):($[I++]=u>>12|224,$[I++]=u>>6&63|128,$[I++]=u&63|128);return I-e}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=_;function _(q,k,D){var $=D||8192,I=$>>>1,e=null,u=$;return function(A){if(A<1||A>I)return q(A);u+A>$&&(e=q($),u=0);var U=k.call(e,u,u+=A);return u&7&&(u=(u|7)+1),U}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=q;var _=requireMinimal$1();function q(I,e){this.lo=I>>>0,this.hi=e>>>0}var k=q.zero=new q(0,0);k.toNumber=function(){return 0},k.zzEncode=k.zzDecode=function(){return this},k.length=function(){return 1};var D=q.zeroHash="\0\0\0\0\0\0\0\0";q.fromNumber=function(e){if(e===0)return k;var u=e<0;u&&(e=-e);var N=e>>>0,A=(e-N)/4294967296>>>0;return u&&(A=~A>>>0,N=~N>>>0,++N>4294967295&&(N=0,++A>4294967295&&(A=0))),new q(N,A)},q.from=function(e){if(typeof e=="number")return q.fromNumber(e);if(_.isString(e))if(_.Long)e=_.Long.fromString(e);else return q.fromNumber(parseInt(e,10));return e.low||e.high?new q(e.low>>>0,e.high>>>0):k},q.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var u=~this.lo+1>>>0,N=~this.hi>>>0;return u||(N=N+1>>>0),-(u+N*4294967296)}return this.lo+this.hi*4294967296},q.prototype.toLong=function(e){return _.Long?new _.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var $=String.prototype.charCodeAt;return q.fromHash=function(e){return e===D?k:new q(($.call(e,0)|$.call(e,1)<<8|$.call(e,2)<<16|$.call(e,3)<<24)>>>0,($.call(e,4)|$.call(e,5)<<8|$.call(e,6)<<16|$.call(e,7)<<24)>>>0)},q.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)},q.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},q.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},q.prototype.length=function(){var e=this.lo,u=(this.lo>>>28|this.hi<<4)>>>0,N=this.hi>>>24;return N===0?u===0?e<16384?e<128?1:2:e<2097152?3:4:u<16384?u<128?5:6:u<2097152?7:8:N<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(_){var q=_;q.asPromise=requireAspromise(),q.base64=requireBase64(),q.EventEmitter=requireEventemitter(),q.float=requireFloat(),q.inquire=requireInquire(),q.utf8=requireUtf8(),q.pool=requirePool(),q.LongBits=requireLongbits(),q.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),q.global=q.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,q.emptyArray=Object.freeze?Object.freeze([]):[],q.emptyObject=Object.freeze?Object.freeze({}):{},q.isInteger=Number.isInteger||function(I){return typeof I=="number"&&isFinite(I)&&Math.floor(I)===I},q.isString=function(I){return typeof I=="string"||I instanceof String},q.isObject=function(I){return I&&typeof I=="object"},q.isset=q.isSet=function(I,e){var u=I[e];return u!=null&&I.hasOwnProperty(e)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},q.Buffer=function(){try{var $=q.inquire("buffer").Buffer;return $.prototype.utf8Write?$:null}catch{return null}}(),q._Buffer_from=null,q._Buffer_allocUnsafe=null,q.newBuffer=function(I){return typeof I=="number"?q.Buffer?q._Buffer_allocUnsafe(I):new q.Array(I):q.Buffer?q._Buffer_from(I):typeof Uint8Array>"u"?I:new Uint8Array(I)},q.Array=typeof Uint8Array<"u"?Uint8Array:Array,q.Long=q.global.dcodeIO&&q.global.dcodeIO.Long||q.global.Long||q.inquire("long"),q.key2Re=/^true|false|0|1$/,q.key32Re=/^-?(?:0|[1-9][0-9]*)$/,q.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,q.longToHash=function(I){return I?q.LongBits.from(I).toHash():q.LongBits.zeroHash},q.longFromHash=function(I,e){var u=q.LongBits.fromHash(I);return q.Long?q.Long.fromBits(u.lo,u.hi,e):u.toNumber(!!e)};function k($,I,e){for(var u=Object.keys(I),N=0;N<u.length;++N)($[u[N]]===void 0||!e)&&($[u[N]]=I[u[N]]);return $}q.merge=k,q.lcFirst=function(I){return I.charAt(0).toLowerCase()+I.substring(1)};function D($){function I(e,u){if(!(this instanceof I))return new I(e,u);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,I):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&k(this,u)}return I.prototype=Object.create(Error.prototype,{constructor:{value:I,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return $},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),I}q.newError=D,q.ProtocolError=D("ProtocolError"),q.oneOfGetter=function(I){for(var e={},u=0;u<I.length;++u)e[I[u]]=1;return function(){for(var N=Object.keys(this),A=N.length-1;A>-1;--A)if(e[N[A]]===1&&this[N[A]]!==void 0&&this[N[A]]!==null)return N[A]}},q.oneOfSetter=function(I){return function(e){for(var u=0;u<I.length;++u)I[u]!==e&&delete this[I[u]]}},q.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},q._configure=function(){var $=q.Buffer;if(!$){q._Buffer_from=q._Buffer_allocUnsafe=null;return}q._Buffer_from=$.from!==Uint8Array.from&&$.from||function(e,u){return new $(e,u)},q._Buffer_allocUnsafe=$.allocUnsafe||function(e){return new $(e)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=N;var _=requireMinimal$1(),q,k=_.LongBits,D=_.base64,$=_.utf8;function I(J,z,V){this.fn=J,this.len=z,this.next=void 0,this.val=V}function e(){}function u(J){this.head=J.head,this.tail=J.tail,this.len=J.len,this.next=J.states}function N(){this.len=0,this.head=new I(e,0,0),this.tail=this.head,this.states=null}var A=function(){return _.Buffer?function(){return(N.create=function(){return new q})()}:function(){return new N}};N.create=A(),N.alloc=function(z){return new _.Array(z)},_.Array!==Array&&(N.alloc=_.pool(N.alloc,_.Array.prototype.subarray)),N.prototype._push=function(z,V,X){return this.tail=this.tail.next=new I(z,V,X),this.len+=V,this};function U(J,z,V){z[V]=J&255}function L(J,z,V){for(;J>127;)z[V++]=J&127|128,J>>>=7;z[V]=J}function P(J,z){this.len=J,this.next=void 0,this.val=z}P.prototype=Object.create(I.prototype),P.prototype.fn=L,N.prototype.uint32=function(z){return this.len+=(this.tail=this.tail.next=new P((z=z>>>0)<128?1:z<16384?2:z<2097152?3:z<268435456?4:5,z)).len,this},N.prototype.int32=function(z){return z<0?this._push(Z,10,k.fromNumber(z)):this.uint32(z)},N.prototype.sint32=function(z){return this.uint32((z<<1^z>>31)>>>0)};function Z(J,z,V){for(;J.hi;)z[V++]=J.lo&127|128,J.lo=(J.lo>>>7|J.hi<<25)>>>0,J.hi>>>=7;for(;J.lo>127;)z[V++]=J.lo&127|128,J.lo=J.lo>>>7;z[V++]=J.lo}N.prototype.uint64=function(z){var V=k.from(z);return this._push(Z,V.length(),V)},N.prototype.int64=N.prototype.uint64,N.prototype.sint64=function(z){var V=k.from(z).zzEncode();return this._push(Z,V.length(),V)},N.prototype.bool=function(z){return this._push(U,1,z?1:0)};function F(J,z,V){z[V]=J&255,z[V+1]=J>>>8&255,z[V+2]=J>>>16&255,z[V+3]=J>>>24}N.prototype.fixed32=function(z){return this._push(F,4,z>>>0)},N.prototype.sfixed32=N.prototype.fixed32,N.prototype.fixed64=function(z){var V=k.from(z);return this._push(F,4,V.lo)._push(F,4,V.hi)},N.prototype.sfixed64=N.prototype.fixed64,N.prototype.float=function(z){return this._push(_.float.writeFloatLE,4,z)},N.prototype.double=function(z){return this._push(_.float.writeDoubleLE,8,z)};var W=_.Array.prototype.set?function(z,V,X){V.set(z,X)}:function(z,V,X){for(var Y=0;Y<z.length;++Y)V[X+Y]=z[Y]};return N.prototype.bytes=function(z){var V=z.length>>>0;if(!V)return this._push(U,1,0);if(_.isString(z)){var X=N.alloc(V=D.length(z));D.decode(z,X,0),z=X}return this.uint32(V)._push(W,V,z)},N.prototype.string=function(z){var V=$.length(z);return V?this.uint32(V)._push($.write,V,z):this._push(U,1,0)},N.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new I(e,0,0),this.len=0,this},N.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 I(e,0,0),this.len=0),this},N.prototype.ldelim=function(){var z=this.head,V=this.tail,X=this.len;return this.reset().uint32(X),X&&(this.tail.next=z.next,this.tail=V,this.len+=X),this},N.prototype.finish=function(){for(var z=this.head.next,V=this.constructor.alloc(this.len),X=0;z;)z.fn(z.val,V,X),X+=z.len,z=z.next;return V},N._configure=function(J){q=J,N.create=A(),q._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=k;var _=requireWriter();(k.prototype=Object.create(_.prototype)).constructor=k;var q=requireMinimal$1();function k(){_.call(this)}k._configure=function(){k.alloc=q._Buffer_allocUnsafe,k.writeBytesBuffer=q.Buffer&&q.Buffer.prototype instanceof Uint8Array&&q.Buffer.prototype.set.name==="set"?function(I,e,u){e.set(I,u)}:function(I,e,u){if(I.copy)I.copy(e,u,0,I.length);else for(var N=0;N<I.length;)e[u++]=I[N++]}},k.prototype.bytes=function(I){q.isString(I)&&(I=q._Buffer_from(I,"base64"));var e=I.length>>>0;return this.uint32(e),e&&this._push(k.writeBytesBuffer,e,I),this};function D($,I,e){$.length<40?q.utf8.write($,I,e):I.utf8Write?I.utf8Write($,e):I.write($,e)}return k.prototype.string=function(I){var e=q.Buffer.byteLength(I);return this.uint32(e),e&&this._push(D,e,I),this},k._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=I;var _=requireMinimal$1(),q,k=_.LongBits,D=_.utf8;function $(L,P){return RangeError("index out of range: "+L.pos+" + "+(P||1)+" > "+L.len)}function I(L){this.buf=L,this.pos=0,this.len=L.length}var e=typeof Uint8Array<"u"?function(P){if(P instanceof Uint8Array||Array.isArray(P))return new I(P);throw Error("illegal buffer")}:function(P){if(Array.isArray(P))return new I(P);throw Error("illegal buffer")},u=function(){return _.Buffer?function(Z){return(I.create=function(W){return _.Buffer.isBuffer(W)?new q(W):e(W)})(Z)}:e};I.create=u(),I.prototype._slice=_.Array.prototype.subarray||_.Array.prototype.slice,I.prototype.uint32=function(){var P=4294967295;return function(){if(P=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(P=(P|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(P=(P|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(P=(P|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(P=(P|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return P;if((this.pos+=5)>this.len)throw this.pos=this.len,$(this,10);return P}}(),I.prototype.int32=function(){return this.uint32()|0},I.prototype.sint32=function(){var P=this.uint32();return P>>>1^-(P&1)|0};function N(){var L=new k(0,0),P=0;if(this.len-this.pos>4){for(;P<4;++P)if(L.lo=(L.lo|(this.buf[this.pos]&127)<<P*7)>>>0,this.buf[this.pos++]<128)return L;if(L.lo=(L.lo|(this.buf[this.pos]&127)<<28)>>>0,L.hi=(L.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return L;P=0}else{for(;P<3;++P){if(this.pos>=this.len)throw $(this);if(L.lo=(L.lo|(this.buf[this.pos]&127)<<P*7)>>>0,this.buf[this.pos++]<128)return L}return L.lo=(L.lo|(this.buf[this.pos++]&127)<<P*7)>>>0,L}if(this.len-this.pos>4){for(;P<5;++P)if(L.hi=(L.hi|(this.buf[this.pos]&127)<<P*7+3)>>>0,this.buf[this.pos++]<128)return L}else for(;P<5;++P){if(this.pos>=this.len)throw $(this);if(L.hi=(L.hi|(this.buf[this.pos]&127)<<P*7+3)>>>0,this.buf[this.pos++]<128)return L}throw Error("invalid varint encoding")}I.prototype.bool=function(){return this.uint32()!==0};function A(L,P){return(L[P-4]|L[P-3]<<8|L[P-2]<<16|L[P-1]<<24)>>>0}I.prototype.fixed32=function(){if(this.pos+4>this.len)throw $(this,4);return A(this.buf,this.pos+=4)},I.prototype.sfixed32=function(){if(this.pos+4>this.len)throw $(this,4);return A(this.buf,this.pos+=4)|0};function U(){if(this.pos+8>this.len)throw $(this,8);return new k(A(this.buf,this.pos+=4),A(this.buf,this.pos+=4))}return I.prototype.float=function(){if(this.pos+4>this.len)throw $(this,4);var P=_.float.readFloatLE(this.buf,this.pos);return this.pos+=4,P},I.prototype.double=function(){if(this.pos+8>this.len)throw $(this,4);var P=_.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,P},I.prototype.bytes=function(){var P=this.uint32(),Z=this.pos,F=this.pos+P;if(F>this.len)throw $(this,P);if(this.pos+=P,Array.isArray(this.buf))return this.buf.slice(Z,F);if(Z===F){var W=_.Buffer;return W?W.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,Z,F)},I.prototype.string=function(){var P=this.bytes();return D.read(P,0,P.length)},I.prototype.skip=function(P){if(typeof P=="number"){if(this.pos+P>this.len)throw $(this,P);this.pos+=P}else do if(this.pos>=this.len)throw $(this);while(this.buf[this.pos++]&128);return this},I.prototype.skipType=function(L){switch(L){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(L=this.uint32()&7)!==4;)this.skipType(L);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+L+" at offset "+this.pos)}return this},I._configure=function(L){q=L,I.create=u(),q._configure();var P=_.Long?"toLong":"toNumber";_.merge(I.prototype,{int64:function(){return N.call(this)[P](!1)},uint64:function(){return N.call(this)[P](!0)},sint64:function(){return N.call(this).zzDecode()[P](!1)},fixed64:function(){return U.call(this)[P](!0)},sfixed64:function(){return U.call(this)[P](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=k;var _=requireReader();(k.prototype=Object.create(_.prototype)).constructor=k;var q=requireMinimal$1();function k(D){_.call(this,D)}return k._configure=function(){q.Buffer&&(k.prototype._slice=q.Buffer.prototype.slice)},k.prototype.string=function(){var $=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+$,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+$,this.len))},k._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=q;var _=requireMinimal$1();(q.prototype=Object.create(_.EventEmitter.prototype)).constructor=q;function q(k,D,$){if(typeof k!="function")throw TypeError("rpcImpl must be a function");_.EventEmitter.call(this),this.rpcImpl=k,this.requestDelimited=!!D,this.responseDelimited=!!$}return q.prototype.rpcCall=function k(D,$,I,e,u){if(!e)throw TypeError("request must be specified");var N=this;if(!u)return _.asPromise(k,N,D,$,I,e);if(!N.rpcImpl){setTimeout(function(){u(Error("already ended"))},0);return}try{return N.rpcImpl(D,$[N.requestDelimited?"encodeDelimited":"encode"](e).finish(),function(U,L){if(U)return N.emit("error",U,D),u(U);if(L===null){N.end(!0);return}if(!(L instanceof I))try{L=I[N.responseDelimited?"decodeDelimited":"decode"](L)}catch(P){return N.emit("error",P,D),u(P)}return N.emit("data",L,D),u(null,L)})}catch(A){N.emit("error",A,D),setTimeout(function(){u(A)},0);return}},q.prototype.end=function(D){return this.rpcImpl&&(D||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,function(_){var q=_;q.Service=requireService()}(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(_){var q=_;q.build="minimal",q.Writer=requireWriter(),q.BufferWriter=requireWriter_buffer(),q.Reader=requireReader(),q.BufferReader=requireReader_buffer(),q.util=requireMinimal$1(),q.rpc=requireRpc(),q.roots=requireRoots(),q.configure=k;function k(){q.util._configure(),q.Writer._configure(q.BufferWriter),q.Reader._configure(q.BufferReader)}k()}(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 _={};return _.quick=function(){const q={};return q.voice=function(){const k={};return k.proto=function(){const D={};return D.CommonReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.event="",$.prototype.data=$util.newBuffer([]),$.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.version=0,$.prototype.compress=!1,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&u.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&u.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&u.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&u.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&u.uint32(40).int64(e.valid),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&u.uint32(48).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&u.uint32(56).bool(e.compress),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.CommonReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.event=e.string();break}case 2:{A.data=e.bytes();break}case 3:{A.sn=e.int64();break}case 4:{A.time=e.int64();break}case 5:{A.valid=e.int64();break}case 6:{A.version=e.int32();break}case 7:{A.compress=e.bool();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CommonReq)return e;let u=new $root.com.quick.voice.proto.CommonReq;return e.event!=null&&(u.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,u.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(u.data=e.data)),e.sn!=null&&($util.Long?(u.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?u.sn=parseInt(e.sn,10):typeof e.sn=="number"?u.sn=e.sn:typeof e.sn=="object"&&(u.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(u.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?u.time=parseInt(e.time,10):typeof e.time=="number"?u.time=e.time:typeof e.time=="object"&&(u.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(u.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?u.valid=parseInt(e.valid,10):typeof e.valid=="number"?u.valid=e.valid:typeof e.valid=="object"&&(u.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.version!=null&&(u.version=e.version|0),e.compress!=null&&(u.compress=!!e.compress),u},$.toObject=function(e,u){u||(u={});let N={};if(u.defaults){if(N.event="",u.bytes===String?N.data="":(N.data=[],u.bytes!==Array&&(N.data=$util.newBuffer(N.data))),$util.Long){let A=new $util.Long(0,0,!1);N.sn=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.sn=u.longs===String?"0":0;if($util.Long){let A=new $util.Long(0,0,!1);N.time=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.time=u.longs===String?"0":0;if($util.Long){let A=new $util.Long(0,0,!1);N.valid=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.valid=u.longs===String?"0":0;N.version=0,N.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(N.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(N.data=u.bytes===String?$util.base64.encode(e.data,0,e.data.length):u.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?N.sn=u.longs===String?String(e.sn):e.sn:N.sn=u.longs===String?$util.Long.prototype.toString.call(e.sn):u.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"?N.time=u.longs===String?String(e.time):e.time:N.time=u.longs===String?$util.Long.prototype.toString.call(e.time):u.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"?N.valid=u.longs===String?String(e.valid):e.valid:N.valid=u.longs===String?$util.Long.prototype.toString.call(e.valid):u.longs===Number?new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber():e.valid),e.version!=null&&e.hasOwnProperty("version")&&(N.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(N.compress=e.compress),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CommonReq"},$}(),D.CommonRsp=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.event="",$.prototype.data=$util.newBuffer([]),$.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.code=0,$.prototype.desc="",$.prototype.version=0,$.prototype.compress=!1,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&u.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&u.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&u.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&u.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&u.uint32(40).int64(e.valid),e.code!=null&&Object.hasOwnProperty.call(e,"code")&&u.uint32(48).int32(e.code),e.desc!=null&&Object.hasOwnProperty.call(e,"desc")&&u.uint32(58).string(e.desc),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&u.uint32(64).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&u.uint32(72).bool(e.compress),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.CommonRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.event=e.string();break}case 2:{A.data=e.bytes();break}case 3:{A.sn=e.int64();break}case 4:{A.time=e.int64();break}case 5:{A.valid=e.int64();break}case 6:{A.code=e.int32();break}case 7:{A.desc=e.string();break}case 8:{A.version=e.int32();break}case 9:{A.compress=e.bool();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CommonRsp)return e;let u=new $root.com.quick.voice.proto.CommonRsp;return e.event!=null&&(u.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,u.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(u.data=e.data)),e.sn!=null&&($util.Long?(u.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?u.sn=parseInt(e.sn,10):typeof e.sn=="number"?u.sn=e.sn:typeof e.sn=="object"&&(u.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(u.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?u.time=parseInt(e.time,10):typeof e.time=="number"?u.time=e.time:typeof e.time=="object"&&(u.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(u.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?u.valid=parseInt(e.valid,10):typeof e.valid=="number"?u.valid=e.valid:typeof e.valid=="object"&&(u.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.code!=null&&(u.code=e.code|0),e.desc!=null&&(u.desc=String(e.desc)),e.version!=null&&(u.version=e.version|0),e.compress!=null&&(u.compress=!!e.compress),u},$.toObject=function(e,u){u||(u={});let N={};if(u.defaults){if(N.event="",u.bytes===String?N.data="":(N.data=[],u.bytes!==Array&&(N.data=$util.newBuffer(N.data))),$util.Long){let A=new $util.Long(0,0,!1);N.sn=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.sn=u.longs===String?"0":0;if($util.Long){let A=new $util.Long(0,0,!1);N.time=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.time=u.longs===String?"0":0;if($util.Long){let A=new $util.Long(0,0,!1);N.valid=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.valid=u.longs===String?"0":0;N.code=0,N.desc="",N.version=0,N.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(N.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(N.data=u.bytes===String?$util.base64.encode(e.data,0,e.data.length):u.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?N.sn=u.longs===String?String(e.sn):e.sn:N.sn=u.longs===String?$util.Long.prototype.toString.call(e.sn):u.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"?N.time=u.longs===String?String(e.time):e.time:N.time=u.longs===String?$util.Long.prototype.toString.call(e.time):u.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"?N.valid=u.longs===String?String(e.valid):e.valid:N.valid=u.longs===String?$util.Long.prototype.toString.call(e.valid):u.longs===Number?new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber():e.valid),e.code!=null&&e.hasOwnProperty("code")&&(N.code=e.code),e.desc!=null&&e.hasOwnProperty("desc")&&(N.desc=e.desc),e.version!=null&&e.hasOwnProperty("version")&&(N.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(N.compress=e.compress),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CommonRsp"},$}(),D.User=function(){function $(e){if(this.tracks=[],e)for(let u=Object.keys(e),N=0;N<u.length;++N)e[u[N]]!=null&&(this[u[N]]=e[u[N]])}$.prototype.id="",$.prototype.callAction=null,$.prototype.callState=null,$.prototype.joinTime=null,$.prototype.tracks=$util.emptyArray,$.prototype.permissions=null,$.prototype.isPublished=null,$.prototype.behavior=null;let I;return Object.defineProperty($.prototype,"_callAction",{get:$util.oneOfGetter(I=["callAction"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_callState",{get:$util.oneOfGetter(I=["callState"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_joinTime",{get:$util.oneOfGetter(I=["joinTime"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_permissions",{get:$util.oneOfGetter(I=["permissions"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_isPublished",{get:$util.oneOfGetter(I=["isPublished"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_behavior",{get:$util.oneOfGetter(I=["behavior"]),set:$util.oneOfSetter(I)}),$.create=function(u){return new $(u)},$.encode=function(u,N){if(N||(N=$Writer.create()),u.id!=null&&Object.hasOwnProperty.call(u,"id")&&N.uint32(10).string(u.id),u.callAction!=null&&Object.hasOwnProperty.call(u,"callAction")&&N.uint32(16).int32(u.callAction),u.callState!=null&&Object.hasOwnProperty.call(u,"callState")&&N.uint32(24).int32(u.callState),u.joinTime!=null&&Object.hasOwnProperty.call(u,"joinTime")&&N.uint32(32).int64(u.joinTime),u.tracks!=null&&u.tracks.length)for(let A=0;A<u.tracks.length;++A)$root.com.quick.voice.proto.Track.encode(u.tracks[A],N.uint32(42).fork()).ldelim();return u.permissions!=null&&Object.hasOwnProperty.call(u,"permissions")&&N.uint32(48).int32(u.permissions),u.isPublished!=null&&Object.hasOwnProperty.call(u,"isPublished")&&N.uint32(56).bool(u.isPublished),u.behavior!=null&&Object.hasOwnProperty.call(u,"behavior")&&N.uint32(64).int32(u.behavior),N},$.encodeDelimited=function(u,N){return this.encode(u,N).ldelim()},$.decode=function(u,N){u instanceof $Reader||(u=$Reader.create(u));let A=N===void 0?u.len:u.pos+N,U=new $root.com.quick.voice.proto.User;for(;u.pos<A;){let L=u.uint32();switch(L>>>3){case 1:{U.id=u.string();break}case 2:{U.callAction=u.int32();break}case 3:{U.callState=u.int32();break}case 4:{U.joinTime=u.int64();break}case 5:{U.tracks&&U.tracks.length||(U.tracks=[]),U.tracks.push($root.com.quick.voice.proto.Track.decode(u,u.uint32()));break}case 6:{U.permissions=u.int32();break}case 7:{U.isPublished=u.bool();break}case 8:{U.behavior=u.int32();break}default:u.skipType(L&7);break}}return U},$.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},$.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.id!=null&&u.hasOwnProperty("id")&&!$util.isString(u.id))return"id: string expected";if(u.callAction!=null&&u.hasOwnProperty("callAction")&&!$util.isInteger(u.callAction))return"callAction: integer expected";if(u.callState!=null&&u.hasOwnProperty("callState")&&!$util.isInteger(u.callState))return"callState: integer expected";if(u.joinTime!=null&&u.hasOwnProperty("joinTime")&&!$util.isInteger(u.joinTime)&&!(u.joinTime&&$util.isInteger(u.joinTime.low)&&$util.isInteger(u.joinTime.high)))return"joinTime: integer|Long expected";if(u.tracks!=null&&u.hasOwnProperty("tracks")){if(!Array.isArray(u.tracks))return"tracks: array expected";for(let N=0;N<u.tracks.length;++N){let A=$root.com.quick.voice.proto.Track.verify(u.tracks[N]);if(A)return"tracks."+A}}return u.permissions!=null&&u.hasOwnProperty("permissions")&&!$util.isInteger(u.permissions)?"permissions: integer expected":u.isPublished!=null&&u.hasOwnProperty("isPublished")&&typeof u.isPublished!="boolean"?"isPublished: boolean expected":u.behavior!=null&&u.hasOwnProperty("behavior")&&!$util.isInteger(u.behavior)?"behavior: integer expected":null},$.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.User)return u;let N=new $root.com.quick.voice.proto.User;if(u.id!=null&&(N.id=String(u.id)),u.callAction!=null&&(N.callAction=u.callAction|0),u.callState!=null&&(N.callState=u.callState|0),u.joinTime!=null&&($util.Long?(N.joinTime=$util.Long.fromValue(u.joinTime)).unsigned=!1:typeof u.joinTime=="string"?N.joinTime=parseInt(u.joinTime,10):typeof u.joinTime=="number"?N.joinTime=u.joinTime:typeof u.joinTime=="object"&&(N.joinTime=new $util.LongBits(u.joinTime.low>>>0,u.joinTime.high>>>0).toNumber())),u.tracks){if(!Array.isArray(u.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");N.tracks=[];for(let A=0;A<u.tracks.length;++A){if(typeof u.tracks[A]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");N.tracks[A]=$root.com.quick.voice.proto.Track.fromObject(u.tracks[A])}}return u.permissions!=null&&(N.permissions=u.permissions|0),u.isPublished!=null&&(N.isPublished=!!u.isPublished),u.behavior!=null&&(N.behavior=u.behavior|0),N},$.toObject=function(u,N){N||(N={});let A={};if((N.arrays||N.defaults)&&(A.tracks=[]),N.defaults&&(A.id=""),u.id!=null&&u.hasOwnProperty("id")&&(A.id=u.id),u.callAction!=null&&u.hasOwnProperty("callAction")&&(A.callAction=u.callAction,N.oneofs&&(A._callAction="callAction")),u.callState!=null&&u.hasOwnProperty("callState")&&(A.callState=u.callState,N.oneofs&&(A._callState="callState")),u.joinTime!=null&&u.hasOwnProperty("joinTime")&&(typeof u.joinTime=="number"?A.joinTime=N.longs===String?String(u.joinTime):u.joinTime:A.joinTime=N.longs===String?$util.Long.prototype.toString.call(u.joinTime):N.longs===Number?new $util.LongBits(u.joinTime.low>>>0,u.joinTime.high>>>0).toNumber():u.joinTime,N.oneofs&&(A._joinTime="joinTime")),u.tracks&&u.tracks.length){A.tracks=[];for(let U=0;U<u.tracks.length;++U)A.tracks[U]=$root.com.quick.voice.proto.Track.toObject(u.tracks[U],N)}return u.permissions!=null&&u.hasOwnProperty("permissions")&&(A.permissions=u.permissions,N.oneofs&&(A._permissions="permissions")),u.isPublished!=null&&u.hasOwnProperty("isPublished")&&(A.isPublished=u.isPublished,N.oneofs&&(A._isPublished="isPublished")),u.behavior!=null&&u.hasOwnProperty("behavior")&&(A.behavior=u.behavior,N.oneofs&&(A._behavior="behavior")),A},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.User"},$}(),D.Login=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.appid="",$.prototype.userId="",$.prototype.sdkToken="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.appid!=null&&Object.hasOwnProperty.call(e,"appid")&&u.uint32(10).string(e.appid),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&u.uint32(18).string(e.userId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&u.uint32(26).string(e.sdkToken),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.Login;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.appid=e.string();break}case 2:{A.userId=e.string();break}case 3:{A.sdkToken=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.Login)return e;let u=new $root.com.quick.voice.proto.Login;return e.appid!=null&&(u.appid=String(e.appid)),e.userId!=null&&(u.userId=String(e.userId)),e.sdkToken!=null&&(u.sdkToken=String(e.sdkToken)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.appid="",N.userId="",N.sdkToken=""),e.appid!=null&&e.hasOwnProperty("appid")&&(N.appid=e.appid),e.userId!=null&&e.hasOwnProperty("userId")&&(N.userId=e.userId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(N.sdkToken=e.sdkToken),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.Login"},$}(),D.Track=function(){function $(e){if(e)for(let u=Object.keys(e),N=0;N<u.length;++N)e[u[N]]!=null&&(this[u[N]]=e[u[N]])}$.prototype.mid="",$.prototype.trackName=null,$.prototype.location=null,$.prototype.userId=null,$.prototype.code=null,$.prototype.desc=null,$.prototype.type=null,$.prototype.isValid=null;let I;return Object.defineProperty($.prototype,"_trackName",{get:$util.oneOfGetter(I=["trackName"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_location",{get:$util.oneOfGetter(I=["location"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_userId",{get:$util.oneOfGetter(I=["userId"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_code",{get:$util.oneOfGetter(I=["code"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_desc",{get:$util.oneOfGetter(I=["desc"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_type",{get:$util.oneOfGetter(I=["type"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_isValid",{get:$util.oneOfGetter(I=["isValid"]),set:$util.oneOfSetter(I)}),$.create=function(u){return new $(u)},$.encode=function(u,N){return N||(N=$Writer.create()),u.mid!=null&&Object.hasOwnProperty.call(u,"mid")&&N.uint32(10).string(u.mid),u.trackName!=null&&Object.hasOwnProperty.call(u,"trackName")&&N.uint32(18).string(u.trackName),u.location!=null&&Object.hasOwnProperty.call(u,"location")&&N.uint32(26).string(u.location),u.userId!=null&&Object.hasOwnProperty.call(u,"userId")&&N.uint32(34).string(u.userId),u.code!=null&&Object.hasOwnProperty.call(u,"code")&&N.uint32(40).int32(u.code),u.desc!=null&&Object.hasOwnProperty.call(u,"desc")&&N.uint32(50).string(u.desc),u.type!=null&&Object.hasOwnProperty.call(u,"type")&&N.uint32(56).int32(u.type),u.isValid!=null&&Object.hasOwnProperty.call(u,"isValid")&&N.uint32(64).bool(u.isValid),N},$.encodeDelimited=function(u,N){return this.encode(u,N).ldelim()},$.decode=function(u,N){u instanceof $Reader||(u=$Reader.create(u));let A=N===void 0?u.len:u.pos+N,U=new $root.com.quick.voice.proto.Track;for(;u.pos<A;){let L=u.uint32();switch(L>>>3){case 1:{U.mid=u.string();break}case 2:{U.trackName=u.string();break}case 3:{U.location=u.string();break}case 4:{U.userId=u.string();break}case 5:{U.code=u.int32();break}case 6:{U.desc=u.string();break}case 7:{U.type=u.int32();break}case 8:{U.isValid=u.bool();break}default:u.skipType(L&7);break}}return U},$.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},$.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.mid!=null&&u.hasOwnProperty("mid")&&!$util.isString(u.mid))return"mid: string expected";if(u.trackName!=null&&u.hasOwnProperty("trackName")&&!$util.isString(u.trackName))return"trackName: string expected";if(u.location!=null&&u.hasOwnProperty("location")&&!$util.isString(u.location))return"location: string expected";if(u.userId!=null&&u.hasOwnProperty("userId")&&!$util.isString(u.userId))return"userId: string expected";if(u.code!=null&&u.hasOwnProperty("code")&&!$util.isInteger(u.code))return"code: integer expected";if(u.desc!=null&&u.hasOwnProperty("desc")&&!$util.isString(u.desc))return"desc: string expected";if(u.type!=null&&u.hasOwnProperty("type"))switch(u.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return u.isValid!=null&&u.hasOwnProperty("isValid")&&typeof u.isValid!="boolean"?"isValid: boolean expected":null},$.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.Track)return u;let N=new $root.com.quick.voice.proto.Track;switch(u.mid!=null&&(N.mid=String(u.mid)),u.trackName!=null&&(N.trackName=String(u.trackName)),u.location!=null&&(N.location=String(u.location)),u.userId!=null&&(N.userId=String(u.userId)),u.code!=null&&(N.code=u.code|0),u.desc!=null&&(N.desc=String(u.desc)),u.type){default:if(typeof u.type=="number"){N.type=u.type;break}break;case"Microphone":case 0:N.type=0;break;case"Camera":case 1:N.type=1;break;case"Screen":case 2:N.type=2;break;case"SystemVoice":case 3:N.type=3;break}return u.isValid!=null&&(N.isValid=!!u.isValid),N},$.toObject=function(u,N){N||(N={});let A={};return N.defaults&&(A.mid=""),u.mid!=null&&u.hasOwnProperty("mid")&&(A.mid=u.mid),u.trackName!=null&&u.hasOwnProperty("trackName")&&(A.trackName=u.trackName,N.oneofs&&(A._trackName="trackName")),u.location!=null&&u.hasOwnProperty("location")&&(A.location=u.location,N.oneofs&&(A._location="location")),u.userId!=null&&u.hasOwnProperty("userId")&&(A.userId=u.userId,N.oneofs&&(A._userId="userId")),u.code!=null&&u.hasOwnProperty("code")&&(A.code=u.code,N.oneofs&&(A._code="code")),u.desc!=null&&u.hasOwnProperty("desc")&&(A.desc=u.desc,N.oneofs&&(A._desc="desc")),u.type!=null&&u.hasOwnProperty("type")&&(A.type=N.enums===String?$root.com.quick.voice.proto.TrackType[u.type]===void 0?u.type:$root.com.quick.voice.proto.TrackType[u.type]:u.type,N.oneofs&&(A._type="type")),u.isValid!=null&&u.hasOwnProperty("isValid")&&(A.isValid=u.isValid,N.oneofs&&(A._isValid="isValid")),A},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.Track"},$}(),D.JoinReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.user=null,$.prototype.callType=0,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(18).fork()).ldelim(),e.callType!=null&&Object.hasOwnProperty.call(e,"callType")&&u.uint32(24).int32(e.callType),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.JoinReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}case 3:{A.callType=e.int32();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}if(e.callType!=null&&e.hasOwnProperty("callType"))switch(e.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinReq)return e;let u=new $root.com.quick.voice.proto.JoinReq;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}switch(e.callType){default:if(typeof e.callType=="number"){u.callType=e.callType;break}break;case"Normal":case 0:u.callType=0;break;case"Meeting":case 1:u.callType=1;break;case"Live":case 2:u.callType=2;break}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.user=null,N.callType=u.enums===String?"Normal":0),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),e.callType!=null&&e.hasOwnProperty("callType")&&(N.callType=u.enums===String?$root.com.quick.voice.proto.CallType[e.callType]===void 0?e.callType:$root.com.quick.voice.proto.CallType[e.callType]:e.callType),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinReq"},$}(),D.JoinRsp=function(){function $(I){if(this.roomUsers=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.roomUsers=$util.emptyArray,$.prototype.callType=0,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.roomUsers!=null&&e.roomUsers.length)for(let N=0;N<e.roomUsers.length;++N)$root.com.quick.voice.proto.User.encode(e.roomUsers[N],u.uint32(18).fork()).ldelim();return e.callType!=null&&Object.hasOwnProperty.call(e,"callType")&&u.uint32(24).int32(e.callType),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.JoinRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.roomUsers&&A.roomUsers.length||(A.roomUsers=[]),A.roomUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 3:{A.callType=e.int32();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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.roomUsers!=null&&e.hasOwnProperty("roomUsers")){if(!Array.isArray(e.roomUsers))return"roomUsers: array expected";for(let u=0;u<e.roomUsers.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.roomUsers[u]);if(N)return"roomUsers."+N}}if(e.callType!=null&&e.hasOwnProperty("callType"))switch(e.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinRsp)return e;let u=new $root.com.quick.voice.proto.JoinRsp;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.roomUsers){if(!Array.isArray(e.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");u.roomUsers=[];for(let N=0;N<e.roomUsers.length;++N){if(typeof e.roomUsers[N]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");u.roomUsers[N]=$root.com.quick.voice.proto.User.fromObject(e.roomUsers[N])}}switch(e.callType){default:if(typeof e.callType=="number"){u.callType=e.callType;break}break;case"Normal":case 0:u.callType=0;break;case"Meeting":case 1:u.callType=1;break;case"Live":case 2:u.callType=2;break}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.roomUsers=[]),u.defaults&&(N.roomId="",N.callType=u.enums===String?"Normal":0),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.roomUsers&&e.roomUsers.length){N.roomUsers=[];for(let A=0;A<e.roomUsers.length;++A)N.roomUsers[A]=$root.com.quick.voice.proto.User.toObject(e.roomUsers[A],u)}return e.callType!=null&&e.hasOwnProperty("callType")&&(N.callType=u.enums===String?$root.com.quick.voice.proto.CallType[e.callType]===void 0?e.callType:$root.com.quick.voice.proto.CallType[e.callType]:e.callType),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinRsp"},$}(),D.JoinNotify=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.user=null,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(18).fork()).ldelim(),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.JoinNotify;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinNotify)return e;let u=new $root.com.quick.voice.proto.JoinNotify;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinNotify"},$}(),D.ConnectCFReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.sdp="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&u.uint32(10).string(e.sdp),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.ConnectCFReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.sdp=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ConnectCFReq)return e;let u=new $root.com.quick.voice.proto.ConnectCFReq;return e.sdp!=null&&(u.sdp=String(e.sdp)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.sdp=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(N.sdp=e.sdp),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ConnectCFReq"},$}(),D.ConnectCFRsp=function(){function $(I){if(this.subscribeUsers=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.remoteSdp="",$.prototype.subscribeUsers=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&u.uint32(10).string(e.remoteSdp),e.subscribeUsers!=null&&e.subscribeUsers.length)for(let N=0;N<e.subscribeUsers.length;++N)$root.com.quick.voice.proto.User.encode(e.subscribeUsers[N],u.uint32(18).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.ConnectCFRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.remoteSdp=e.string();break}case 2:{A.subscribeUsers&&A.subscribeUsers.length||(A.subscribeUsers=[]),A.subscribeUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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.subscribeUsers!=null&&e.hasOwnProperty("subscribeUsers")){if(!Array.isArray(e.subscribeUsers))return"subscribeUsers: array expected";for(let u=0;u<e.subscribeUsers.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.subscribeUsers[u]);if(N)return"subscribeUsers."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ConnectCFRsp)return e;let u=new $root.com.quick.voice.proto.ConnectCFRsp;if(e.remoteSdp!=null&&(u.remoteSdp=String(e.remoteSdp)),e.subscribeUsers){if(!Array.isArray(e.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");u.subscribeUsers=[];for(let N=0;N<e.subscribeUsers.length;++N){if(typeof e.subscribeUsers[N]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");u.subscribeUsers[N]=$root.com.quick.voice.proto.User.fromObject(e.subscribeUsers[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.subscribeUsers=[]),u.defaults&&(N.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(N.remoteSdp=e.remoteSdp),e.subscribeUsers&&e.subscribeUsers.length){N.subscribeUsers=[];for(let A=0;A<e.subscribeUsers.length;++A)N.subscribeUsers[A]=$root.com.quick.voice.proto.User.toObject(e.subscribeUsers[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ConnectCFRsp"},$}(),D.PublishReq=function(){function $(e){if(this.tracks=[],e)for(let u=Object.keys(e),N=0;N<u.length;++N)e[u[N]]!=null&&(this[u[N]]=e[u[N]])}$.prototype.sdp="",$.prototype.tracks=$util.emptyArray,$.prototype.callAction=0,$.prototype.recreate=null;let I;return Object.defineProperty($.prototype,"_recreate",{get:$util.oneOfGetter(I=["recreate"]),set:$util.oneOfSetter(I)}),$.create=function(u){return new $(u)},$.encode=function(u,N){if(N||(N=$Writer.create()),u.sdp!=null&&Object.hasOwnProperty.call(u,"sdp")&&N.uint32(10).string(u.sdp),u.tracks!=null&&u.tracks.length)for(let A=0;A<u.tracks.length;++A)$root.com.quick.voice.proto.Track.encode(u.tracks[A],N.uint32(18).fork()).ldelim();return u.callAction!=null&&Object.hasOwnProperty.call(u,"callAction")&&N.uint32(24).int32(u.callAction),u.recreate!=null&&Object.hasOwnProperty.call(u,"recreate")&&N.uint32(32).bool(u.recreate),N},$.encodeDelimited=function(u,N){return this.encode(u,N).ldelim()},$.decode=function(u,N){u instanceof $Reader||(u=$Reader.create(u));let A=N===void 0?u.len:u.pos+N,U=new $root.com.quick.voice.proto.PublishReq;for(;u.pos<A;){let L=u.uint32();switch(L>>>3){case 1:{U.sdp=u.string();break}case 2:{U.tracks&&U.tracks.length||(U.tracks=[]),U.tracks.push($root.com.quick.voice.proto.Track.decode(u,u.uint32()));break}case 3:{U.callAction=u.int32();break}case 4:{U.recreate=u.bool();break}default:u.skipType(L&7);break}}return U},$.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},$.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.sdp!=null&&u.hasOwnProperty("sdp")&&!$util.isString(u.sdp))return"sdp: string expected";if(u.tracks!=null&&u.hasOwnProperty("tracks")){if(!Array.isArray(u.tracks))return"tracks: array expected";for(let N=0;N<u.tracks.length;++N){let A=$root.com.quick.voice.proto.Track.verify(u.tracks[N]);if(A)return"tracks."+A}}return u.callAction!=null&&u.hasOwnProperty("callAction")&&!$util.isInteger(u.callAction)?"callAction: integer expected":u.recreate!=null&&u.hasOwnProperty("recreate")&&typeof u.recreate!="boolean"?"recreate: boolean expected":null},$.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.PublishReq)return u;let N=new $root.com.quick.voice.proto.PublishReq;if(u.sdp!=null&&(N.sdp=String(u.sdp)),u.tracks){if(!Array.isArray(u.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");N.tracks=[];for(let A=0;A<u.tracks.length;++A){if(typeof u.tracks[A]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");N.tracks[A]=$root.com.quick.voice.proto.Track.fromObject(u.tracks[A])}}return u.callAction!=null&&(N.callAction=u.callAction|0),u.recreate!=null&&(N.recreate=!!u.recreate),N},$.toObject=function(u,N){N||(N={});let A={};if((N.arrays||N.defaults)&&(A.tracks=[]),N.defaults&&(A.sdp="",A.callAction=0),u.sdp!=null&&u.hasOwnProperty("sdp")&&(A.sdp=u.sdp),u.tracks&&u.tracks.length){A.tracks=[];for(let U=0;U<u.tracks.length;++U)A.tracks[U]=$root.com.quick.voice.proto.Track.toObject(u.tracks[U],N)}return u.callAction!=null&&u.hasOwnProperty("callAction")&&(A.callAction=u.callAction),u.recreate!=null&&u.hasOwnProperty("recreate")&&(A.recreate=u.recreate,N.oneofs&&(A._recreate="recreate")),A},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.PublishReq"},$}(),D.PublishRsp=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.remoteSdp="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&u.uint32(10).string(e.remoteSdp),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.PublishRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.remoteSdp=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){return typeof e!="object"||e===null?"object expected":e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&!$util.isString(e.remoteSdp)?"remoteSdp: string expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PublishRsp)return e;let u=new $root.com.quick.voice.proto.PublishRsp;return e.remoteSdp!=null&&(u.remoteSdp=String(e.remoteSdp)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(N.remoteSdp=e.remoteSdp),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PublishRsp"},$}(),D.PublishNotify=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.user=null,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(18).fork()).ldelim(),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.PublishNotify;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PublishNotify)return e;let u=new $root.com.quick.voice.proto.PublishNotify;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PublishNotify"},$}(),D.SubscribeReq=function(){function $(I){if(this.users=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.users=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.users!=null&&e.users.length)for(let N=0;N<e.users.length;++N)$root.com.quick.voice.proto.User.encode(e.users[N],u.uint32(10).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.SubscribeReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.users&&A.users.length||(A.users=[]),A.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=0;u<e.users.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.users[u]);if(N)return"users."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SubscribeReq)return e;let u=new $root.com.quick.voice.proto.SubscribeReq;if(e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");u.users=[];for(let N=0;N<e.users.length;++N){if(typeof e.users[N]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");u.users[N]=$root.com.quick.voice.proto.User.fromObject(e.users[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.users=[]),e.users&&e.users.length){N.users=[];for(let A=0;A<e.users.length;++A)N.users[A]=$root.com.quick.voice.proto.User.toObject(e.users[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SubscribeReq"},$}(),D.SubscribeRsp=function(){function $(I){if(this.users=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.remoteSdp="",$.prototype.users=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&u.uint32(10).string(e.remoteSdp),e.users!=null&&e.users.length)for(let N=0;N<e.users.length;++N)$root.com.quick.voice.proto.User.encode(e.users[N],u.uint32(18).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.SubscribeRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.remoteSdp=e.string();break}case 2:{A.users&&A.users.length||(A.users=[]),A.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let u=0;u<e.users.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.users[u]);if(N)return"users."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SubscribeRsp)return e;let u=new $root.com.quick.voice.proto.SubscribeRsp;if(e.remoteSdp!=null&&(u.remoteSdp=String(e.remoteSdp)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");u.users=[];for(let N=0;N<e.users.length;++N){if(typeof e.users[N]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");u.users[N]=$root.com.quick.voice.proto.User.fromObject(e.users[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.users=[]),u.defaults&&(N.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(N.remoteSdp=e.remoteSdp),e.users&&e.users.length){N.users=[];for(let A=0;A<e.users.length;++A)N.users[A]=$root.com.quick.voice.proto.User.toObject(e.users[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SubscribeRsp"},$}(),D.RenegotiateReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.userId="",$.prototype.sdp="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&u.uint32(10).string(e.userId),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&u.uint32(18).string(e.sdp),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.RenegotiateReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.userId=e.string();break}case 2:{A.sdp=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.RenegotiateReq)return e;let u=new $root.com.quick.voice.proto.RenegotiateReq;return e.userId!=null&&(u.userId=String(e.userId)),e.sdp!=null&&(u.sdp=String(e.sdp)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.userId="",N.sdp=""),e.userId!=null&&e.hasOwnProperty("userId")&&(N.userId=e.userId),e.sdp!=null&&e.hasOwnProperty("sdp")&&(N.sdp=e.sdp),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.RenegotiateReq"},$}(),D.QuitReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.userId="",$.prototype.roomId="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&u.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(18).string(e.roomId),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.QuitReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.userId=e.string();break}case 2:{A.roomId=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.QuitReq)return e;let u=new $root.com.quick.voice.proto.QuitReq;return e.userId!=null&&(u.userId=String(e.userId)),e.roomId!=null&&(u.roomId=String(e.roomId)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.userId="",N.roomId=""),e.userId!=null&&e.hasOwnProperty("userId")&&(N.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.QuitReq"},$}(),D.QuitNotify=function(){function $(e){if(e)for(let u=Object.keys(e),N=0;N<u.length;++N)e[u[N]]!=null&&(this[u[N]]=e[u[N]])}$.prototype.roomId="",$.prototype.user=null,$.prototype.code=null,$.prototype.desc=null;let I;return Object.defineProperty($.prototype,"_code",{get:$util.oneOfGetter(I=["code"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_desc",{get:$util.oneOfGetter(I=["desc"]),set:$util.oneOfSetter(I)}),$.create=function(u){return new $(u)},$.encode=function(u,N){return N||(N=$Writer.create()),u.roomId!=null&&Object.hasOwnProperty.call(u,"roomId")&&N.uint32(10).string(u.roomId),u.user!=null&&Object.hasOwnProperty.call(u,"user")&&$root.com.quick.voice.proto.User.encode(u.user,N.uint32(18).fork()).ldelim(),u.code!=null&&Object.hasOwnProperty.call(u,"code")&&N.uint32(24).int32(u.code),u.desc!=null&&Object.hasOwnProperty.call(u,"desc")&&N.uint32(34).string(u.desc),N},$.encodeDelimited=function(u,N){return this.encode(u,N).ldelim()},$.decode=function(u,N){u instanceof $Reader||(u=$Reader.create(u));let A=N===void 0?u.len:u.pos+N,U=new $root.com.quick.voice.proto.QuitNotify;for(;u.pos<A;){let L=u.uint32();switch(L>>>3){case 1:{U.roomId=u.string();break}case 2:{U.user=$root.com.quick.voice.proto.User.decode(u,u.uint32());break}case 3:{U.code=u.int32();break}case 4:{U.desc=u.string();break}default:u.skipType(L&7);break}}return U},$.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},$.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.roomId!=null&&u.hasOwnProperty("roomId")&&!$util.isString(u.roomId))return"roomId: string expected";if(u.user!=null&&u.hasOwnProperty("user")){let N=$root.com.quick.voice.proto.User.verify(u.user);if(N)return"user."+N}return u.code!=null&&u.hasOwnProperty("code")&&!$util.isInteger(u.code)?"code: integer expected":u.desc!=null&&u.hasOwnProperty("desc")&&!$util.isString(u.desc)?"desc: string expected":null},$.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.QuitNotify)return u;let N=new $root.com.quick.voice.proto.QuitNotify;if(u.roomId!=null&&(N.roomId=String(u.roomId)),u.user!=null){if(typeof u.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");N.user=$root.com.quick.voice.proto.User.fromObject(u.user)}return u.code!=null&&(N.code=u.code|0),u.desc!=null&&(N.desc=String(u.desc)),N},$.toObject=function(u,N){N||(N={});let A={};return N.defaults&&(A.roomId="",A.user=null),u.roomId!=null&&u.hasOwnProperty("roomId")&&(A.roomId=u.roomId),u.user!=null&&u.hasOwnProperty("user")&&(A.user=$root.com.quick.voice.proto.User.toObject(u.user,N)),u.code!=null&&u.hasOwnProperty("code")&&(A.code=u.code,N.oneofs&&(A._code="code")),u.desc!=null&&u.hasOwnProperty("desc")&&(A.desc=u.desc,N.oneofs&&(A._desc="desc")),A},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.QuitNotify"},$}(),D.TokenExpireNotify=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.TokenExpireNotify;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.TokenExpireNotify)return e;let u=new $root.com.quick.voice.proto.TokenExpireNotify;return e.roomId!=null&&(u.roomId=String(e.roomId)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.TokenExpireNotify"},$}(),D.UpdateTokenReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.sdkToken="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&u.uint32(18).string(e.sdkToken),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.UpdateTokenReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.sdkToken=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTokenReq)return e;let u=new $root.com.quick.voice.proto.UpdateTokenReq;return e.roomId!=null&&(u.roomId=String(e.roomId)),e.sdkToken!=null&&(u.sdkToken=String(e.sdkToken)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.sdkToken=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(N.sdkToken=e.sdkToken),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTokenReq"},$}(),D.NetQualityChange=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.userId="",$.prototype.roomId="",$.prototype.egress=0,$.prototype.ingress=0,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&u.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(18).string(e.roomId),e.egress!=null&&Object.hasOwnProperty.call(e,"egress")&&u.uint32(24).int32(e.egress),e.ingress!=null&&Object.hasOwnProperty.call(e,"ingress")&&u.uint32(32).int32(e.ingress),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.NetQualityChange;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.userId=e.string();break}case 2:{A.roomId=e.string();break}case 3:{A.egress=e.int32();break}case 4:{A.ingress=e.int32();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.NetQualityChange)return e;let u=new $root.com.quick.voice.proto.NetQualityChange;return e.userId!=null&&(u.userId=String(e.userId)),e.roomId!=null&&(u.roomId=String(e.roomId)),e.egress!=null&&(u.egress=e.egress|0),e.ingress!=null&&(u.ingress=e.ingress|0),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.userId="",N.roomId="",N.egress=0,N.ingress=0),e.userId!=null&&e.hasOwnProperty("userId")&&(N.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.egress!=null&&e.hasOwnProperty("egress")&&(N.egress=e.egress),e.ingress!=null&&e.hasOwnProperty("ingress")&&(N.ingress=e.ingress),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.NetQualityChange"},$}(),D.NetQualityNotify=function(){function $(I){if(this.qualities=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.qualities=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.qualities!=null&&e.qualities.length)for(let N=0;N<e.qualities.length;++N)$root.com.quick.voice.proto.NetQualityChange.encode(e.qualities[N],u.uint32(10).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.NetQualityNotify;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.qualities&&A.qualities.length||(A.qualities=[]),A.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=0;u<e.qualities.length;++u){let N=$root.com.quick.voice.proto.NetQualityChange.verify(e.qualities[u]);if(N)return"qualities."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.NetQualityNotify)return e;let u=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");u.qualities=[];for(let N=0;N<e.qualities.length;++N){if(typeof e.qualities[N]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");u.qualities[N]=$root.com.quick.voice.proto.NetQualityChange.fromObject(e.qualities[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.qualities=[]),e.qualities&&e.qualities.length){N.qualities=[];for(let A=0;A<e.qualities.length;++A)N.qualities[A]=$root.com.quick.voice.proto.NetQualityChange.toObject(e.qualities[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.NetQualityNotify"},$}(),D.UpdateCall=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.user=null,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(18).fork()).ldelim(),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.UpdateCall;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateCall)return e;let u=new $root.com.quick.voice.proto.UpdateCall;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateCall"},$}(),D.SyncRoomInfoReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.user=null,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(18).fork()).ldelim(),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return e;let u=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SyncRoomInfoReq"},$}(),D.SyncRoomInfoRsp=function(){function $(I){if(this.users=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.isValid=!1,$.prototype.users=$util.emptyArray,$.prototype.isActive=!1,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.isValid!=null&&Object.hasOwnProperty.call(e,"isValid")&&u.uint32(16).bool(e.isValid),e.users!=null&&e.users.length)for(let N=0;N<e.users.length;++N)$root.com.quick.voice.proto.User.encode(e.users[N],u.uint32(26).fork()).ldelim();return e.isActive!=null&&Object.hasOwnProperty.call(e,"isActive")&&u.uint32(32).bool(e.isActive),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.isValid=e.bool();break}case 3:{A.users&&A.users.length||(A.users=[]),A.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 4:{A.isActive=e.bool();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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.isValid!=null&&e.hasOwnProperty("isValid")&&typeof e.isValid!="boolean")return"isValid: boolean expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let u=0;u<e.users.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.users[u]);if(N)return"users."+N}}return e.isActive!=null&&e.hasOwnProperty("isActive")&&typeof e.isActive!="boolean"?"isActive: boolean expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return e;let u=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.isValid!=null&&(u.isValid=!!e.isValid),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");u.users=[];for(let N=0;N<e.users.length;++N){if(typeof e.users[N]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");u.users[N]=$root.com.quick.voice.proto.User.fromObject(e.users[N])}}return e.isActive!=null&&(u.isActive=!!e.isActive),u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.users=[]),u.defaults&&(N.roomId="",N.isValid=!1,N.isActive=!1),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.isValid!=null&&e.hasOwnProperty("isValid")&&(N.isValid=e.isValid),e.users&&e.users.length){N.users=[];for(let A=0;A<e.users.length;++A)N.users[A]=$root.com.quick.voice.proto.User.toObject(e.users[A],u)}return e.isActive!=null&&e.hasOwnProperty("isActive")&&(N.isActive=e.isActive),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SyncRoomInfoRsp"},$}(),D.UpdateTime=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&u.uint32(8).int64(e.time),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.UpdateTime;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.time=e.int64();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTime)return e;let u=new $root.com.quick.voice.proto.UpdateTime;return e.time!=null&&($util.Long?(u.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?u.time=parseInt(e.time,10):typeof e.time=="number"?u.time=e.time:typeof e.time=="object"&&(u.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),u},$.toObject=function(e,u){u||(u={});let N={};if(u.defaults)if($util.Long){let A=new $util.Long(0,0,!1);N.time=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.time=u.longs===String?"0":0;return e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?N.time=u.longs===String?String(e.time):e.time:N.time=u.longs===String?$util.Long.prototype.toString.call(e.time):u.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTime"},$}(),D.CloseTrackReq=function(){function $(I){if(this.tracks=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.sdp="",$.prototype.tracks=$util.emptyArray,$.prototype.roomId="",$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&u.uint32(10).string(e.sdp),e.tracks!=null&&e.tracks.length)for(let N=0;N<e.tracks.length;++N)$root.com.quick.voice.proto.Track.encode(e.tracks[N],u.uint32(18).fork()).ldelim();return e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(26).string(e.roomId),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.CloseTrackReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.sdp=e.string();break}case 2:{A.tracks&&A.tracks.length||(A.tracks=[]),A.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}case 3:{A.roomId=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=0;u<e.tracks.length;++u){let N=$root.com.quick.voice.proto.Track.verify(e.tracks[u]);if(N)return"tracks."+N}}return e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackReq)return e;let u=new $root.com.quick.voice.proto.CloseTrackReq;if(e.sdp!=null&&(u.sdp=String(e.sdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");u.tracks=[];for(let N=0;N<e.tracks.length;++N){if(typeof e.tracks[N]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");u.tracks[N]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[N])}}return e.roomId!=null&&(u.roomId=String(e.roomId)),u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.tracks=[]),u.defaults&&(N.sdp="",N.roomId=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(N.sdp=e.sdp),e.tracks&&e.tracks.length){N.tracks=[];for(let A=0;A<e.tracks.length;++A)N.tracks[A]=$root.com.quick.voice.proto.Track.toObject(e.tracks[A],u)}return e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackReq"},$}(),D.CloseTrackRsp=function(){function $(I){if(this.tracks=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.remoteSdp="",$.prototype.tracks=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&u.uint32(10).string(e.remoteSdp),e.tracks!=null&&e.tracks.length)for(let N=0;N<e.tracks.length;++N)$root.com.quick.voice.proto.Track.encode(e.tracks[N],u.uint32(18).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.CloseTrackRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.remoteSdp=e.string();break}case 2:{A.tracks&&A.tracks.length||(A.tracks=[]),A.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=0;u<e.tracks.length;++u){let N=$root.com.quick.voice.proto.Track.verify(e.tracks[u]);if(N)return"tracks."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackRsp)return e;let u=new $root.com.quick.voice.proto.CloseTrackRsp;if(e.remoteSdp!=null&&(u.remoteSdp=String(e.remoteSdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");u.tracks=[];for(let N=0;N<e.tracks.length;++N){if(typeof e.tracks[N]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");u.tracks[N]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.tracks=[]),u.defaults&&(N.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(N.remoteSdp=e.remoteSdp),e.tracks&&e.tracks.length){N.tracks=[];for(let A=0;A<e.tracks.length;++A)N.tracks[A]=$root.com.quick.voice.proto.Track.toObject(e.tracks[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackRsp"},$}(),D.CloseTrackNotify=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.user=null,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(10).fork()).ldelim(),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.CloseTrackNotify;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.user!=null&&e.hasOwnProperty("user")){let u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackNotify)return e;let u=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");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.user=null),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackNotify"},$}(),D.ToggleLiveRoomReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.ToggleLiveRoomReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ToggleLiveRoomReq)return e;let u=new $root.com.quick.voice.proto.ToggleLiveRoomReq;return e.roomId!=null&&(u.roomId=String(e.roomId)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ToggleLiveRoomReq"},$}(),D.ToggleLiveRoomRsq=function(){function $(I){if(this.roomUsers=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.hash="",$.prototype.roomUsers=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.hash!=null&&Object.hasOwnProperty.call(e,"hash")&&u.uint32(18).string(e.hash),e.roomUsers!=null&&e.roomUsers.length)for(let N=0;N<e.roomUsers.length;++N)$root.com.quick.voice.proto.User.encode(e.roomUsers[N],u.uint32(26).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.hash=e.string();break}case 3:{A.roomUsers&&A.roomUsers.length||(A.roomUsers=[]),A.roomUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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.hash!=null&&e.hasOwnProperty("hash")&&!$util.isString(e.hash))return"hash: string expected";if(e.roomUsers!=null&&e.hasOwnProperty("roomUsers")){if(!Array.isArray(e.roomUsers))return"roomUsers: array expected";for(let u=0;u<e.roomUsers.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.roomUsers[u]);if(N)return"roomUsers."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ToggleLiveRoomRsq)return e;let u=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.hash!=null&&(u.hash=String(e.hash)),e.roomUsers){if(!Array.isArray(e.roomUsers))throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: array expected");u.roomUsers=[];for(let N=0;N<e.roomUsers.length;++N){if(typeof e.roomUsers[N]!="object")throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: object expected");u.roomUsers[N]=$root.com.quick.voice.proto.User.fromObject(e.roomUsers[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.roomUsers=[]),u.defaults&&(N.roomId="",N.hash=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.hash!=null&&e.hasOwnProperty("hash")&&(N.hash=e.hash),e.roomUsers&&e.roomUsers.length){N.roomUsers=[];for(let A=0;A<e.roomUsers.length;++A)N.roomUsers[A]=$root.com.quick.voice.proto.User.toObject(e.roomUsers[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ToggleLiveRoomRsq"},$}(),D.TrackType=function(){const $={},I=Object.create($);return I[$[0]="Microphone"]=0,I[$[1]="Camera"]=1,I[$[2]="Screen"]=2,I[$[3]="SystemVoice"]=3,I}(),D.ReportInfoReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.actionEvent="",$.prototype.userId="",$.prototype.platform="",$.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.actionData="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.actionEvent!=null&&Object.hasOwnProperty.call(e,"actionEvent")&&u.uint32(10).string(e.actionEvent),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&u.uint32(18).string(e.userId),e.platform!=null&&Object.hasOwnProperty.call(e,"platform")&&u.uint32(26).string(e.platform),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&u.uint32(32).int64(e.time),e.actionData!=null&&Object.hasOwnProperty.call(e,"actionData")&&u.uint32(42).string(e.actionData),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.ReportInfoReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.actionEvent=e.string();break}case 2:{A.userId=e.string();break}case 3:{A.platform=e.string();break}case 4:{A.time=e.int64();break}case 5:{A.actionData=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){return typeof e!="object"||e===null?"object expected":e.actionEvent!=null&&e.hasOwnProperty("actionEvent")&&!$util.isString(e.actionEvent)?"actionEvent: string expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.platform!=null&&e.hasOwnProperty("platform")&&!$util.isString(e.platform)?"platform: string 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.actionData!=null&&e.hasOwnProperty("actionData")&&!$util.isString(e.actionData)?"actionData: string expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ReportInfoReq)return e;let u=new $root.com.quick.voice.proto.ReportInfoReq;return e.actionEvent!=null&&(u.actionEvent=String(e.actionEvent)),e.userId!=null&&(u.userId=String(e.userId)),e.platform!=null&&(u.platform=String(e.platform)),e.time!=null&&($util.Long?(u.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?u.time=parseInt(e.time,10):typeof e.time=="number"?u.time=e.time:typeof e.time=="object"&&(u.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.actionData!=null&&(u.actionData=String(e.actionData)),u},$.toObject=function(e,u){u||(u={});let N={};if(u.defaults){if(N.actionEvent="",N.userId="",N.platform="",$util.Long){let A=new $util.Long(0,0,!1);N.time=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.time=u.longs===String?"0":0;N.actionData=""}return e.actionEvent!=null&&e.hasOwnProperty("actionEvent")&&(N.actionEvent=e.actionEvent),e.userId!=null&&e.hasOwnProperty("userId")&&(N.userId=e.userId),e.platform!=null&&e.hasOwnProperty("platform")&&(N.platform=e.platform),e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?N.time=u.longs===String?String(e.time):e.time:N.time=u.longs===String?$util.Long.prototype.toString.call(e.time):u.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),e.actionData!=null&&e.hasOwnProperty("actionData")&&(N.actionData=e.actionData),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ReportInfoReq"},$}(),D.UpdatePermissions=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.user=null,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(18).fork()).ldelim(),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.UpdatePermissions;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdatePermissions)return e;let u=new $root.com.quick.voice.proto.UpdatePermissions;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdatePermissions"},$}(),D.CallType=function(){const $={},I=Object.create($);return I[$[0]="Normal"]=0,I[$[1]="Meeting"]=1,I[$[2]="Live"]=2,I}(),D.QuitNotifyCode=function(){const $={},I=Object.create($);return I[$[0]="NormalQuit"]=0,I[$[2021]="Timeout"]=2021,I[$[2011]="TokenExpired"]=2011,I[$[2022]="KickOut"]=2022,I[$[2023]="EndPk"]=2023,I[$[2024]="EndLive"]=2024,I}(),D.UserBehavior=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.type=0,$.prototype.behavior=!1,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&u.uint32(8).int32(e.type),e.behavior!=null&&Object.hasOwnProperty.call(e,"behavior")&&u.uint32(16).bool(e.behavior),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.UserBehavior;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.type=e.int32();break}case 2:{A.behavior=e.bool();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UserBehavior)return e;let u=new $root.com.quick.voice.proto.UserBehavior;switch(e.type){default:if(typeof e.type=="number"){u.type=e.type;break}break;case"Microphone":case 0:u.type=0;break;case"Camera":case 1:u.type=1;break;case"Screen":case 2:u.type=2;break;case"SystemVoice":case 3:u.type=3;break}return e.behavior!=null&&(u.behavior=!!e.behavior),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.type=u.enums===String?"Microphone":0,N.behavior=!1),e.type!=null&&e.hasOwnProperty("type")&&(N.type=u.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")&&(N.behavior=e.behavior),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UserBehavior"},$}(),D.PreventUser=function(){function $(I){if(this.behaviors=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.id="",$.prototype.behaviors=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.id!=null&&Object.hasOwnProperty.call(e,"id")&&u.uint32(10).string(e.id),e.behaviors!=null&&e.behaviors.length)for(let N=0;N<e.behaviors.length;++N)$root.com.quick.voice.proto.UserBehavior.encode(e.behaviors[N],u.uint32(18).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.PreventUser;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.id=e.string();break}case 2:{A.behaviors&&A.behaviors.length||(A.behaviors=[]),A.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=0;u<e.behaviors.length;++u){let N=$root.com.quick.voice.proto.UserBehavior.verify(e.behaviors[u]);if(N)return"behaviors."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUser)return e;let u=new $root.com.quick.voice.proto.PreventUser;if(e.id!=null&&(u.id=String(e.id)),e.behaviors){if(!Array.isArray(e.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");u.behaviors=[];for(let N=0;N<e.behaviors.length;++N){if(typeof e.behaviors[N]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");u.behaviors[N]=$root.com.quick.voice.proto.UserBehavior.fromObject(e.behaviors[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.behaviors=[]),u.defaults&&(N.id=""),e.id!=null&&e.hasOwnProperty("id")&&(N.id=e.id),e.behaviors&&e.behaviors.length){N.behaviors=[];for(let A=0;A<e.behaviors.length;++A)N.behaviors[A]=$root.com.quick.voice.proto.UserBehavior.toObject(e.behaviors[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUser"},$}(),D.PreventUsersBehaviorReq=function(){function $(I){if(this.users=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.users=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let N=0;N<e.users.length;++N)$root.com.quick.voice.proto.PreventUser.encode(e.users[N],u.uint32(18).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.users&&A.users.length||(A.users=[]),A.users.push($root.com.quick.voice.proto.PreventUser.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=0;u<e.users.length;++u){let N=$root.com.quick.voice.proto.PreventUser.verify(e.users[u]);if(N)return"users."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return e;let u=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");u.users=[];for(let N=0;N<e.users.length;++N){if(typeof e.users[N]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");u.users[N]=$root.com.quick.voice.proto.PreventUser.fromObject(e.users[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.users=[]),u.defaults&&(N.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.users&&e.users.length){N.users=[];for(let A=0;A<e.users.length;++A)N.users[A]=$root.com.quick.voice.proto.PreventUser.toObject(e.users[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUsersBehaviorReq"},$}(),D.PreventUsersBehaviorNotify=function(){function $(I){if(this.users=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.users=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let N=0;N<e.users.length;++N)$root.com.quick.voice.proto.User.encode(e.users[N],u.uint32(18).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.users&&A.users.length||(A.users=[]),A.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=0;u<e.users.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.users[u]);if(N)return"users."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return e;let u=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");u.users=[];for(let N=0;N<e.users.length;++N){if(typeof e.users[N]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");u.users[N]=$root.com.quick.voice.proto.User.fromObject(e.users[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.users=[]),u.defaults&&(N.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.users&&e.users.length){N.users=[];for(let A=0;A<e.users.length;++A)N.users[A]=$root.com.quick.voice.proto.User.toObject(e.users[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},$}(),D.AccelerationAreas=function(){const $={},I=Object.create($);return I[$[0]="chinaMainland"]=0,I[$[1]="global"]=1,I[$[2]="overseas"]=2,I}(),D.CountMethods=function(){const $={},I=Object.create($);return I[$[0]="flow"]=0,I[$[1]="minutes"]=1,I}(),D.BaseCDNAddress=function(){function $(I){if(this.urlMap={},I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.area=0,$.prototype.countType=0,$.prototype.urlMap=$util.emptyObject,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.area!=null&&Object.hasOwnProperty.call(e,"area")&&u.uint32(8).int32(e.area),e.countType!=null&&Object.hasOwnProperty.call(e,"countType")&&u.uint32(16).int32(e.countType),e.urlMap!=null&&Object.hasOwnProperty.call(e,"urlMap"))for(let N=Object.keys(e.urlMap),A=0;A<N.length;++A)u.uint32(26).fork().uint32(10).string(N[A]).uint32(18).string(e.urlMap[N[A]]).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.BaseCDNAddress,U,L;for(;e.pos<N;){let P=e.uint32();switch(P>>>3){case 1:{A.area=e.int32();break}case 2:{A.countType=e.int32();break}case 3:{A.urlMap===$util.emptyObject&&(A.urlMap={});let Z=e.uint32()+e.pos;for(U="",L="";e.pos<Z;){let F=e.uint32();switch(F>>>3){case 1:U=e.string();break;case 2:L=e.string();break;default:e.skipType(F&7);break}}A.urlMap[U]=L;break}default:e.skipType(P&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=Object.keys(e.urlMap);for(let N=0;N<u.length;++N)if(!$util.isString(e.urlMap[u[N]]))return"urlMap: string{k:string} expected"}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.BaseCDNAddress)return e;let u=new $root.com.quick.voice.proto.BaseCDNAddress;switch(e.area){default:if(typeof e.area=="number"){u.area=e.area;break}break;case"chinaMainland":case 0:u.area=0;break;case"global":case 1:u.area=1;break;case"overseas":case 2:u.area=2;break}switch(e.countType){default:if(typeof e.countType=="number"){u.countType=e.countType;break}break;case"flow":case 0:u.countType=0;break;case"minutes":case 1:u.countType=1;break}if(e.urlMap){if(typeof e.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");u.urlMap={};for(let N=Object.keys(e.urlMap),A=0;A<N.length;++A)u.urlMap[N[A]]=String(e.urlMap[N[A]])}return u},$.toObject=function(e,u){u||(u={});let N={};(u.objects||u.defaults)&&(N.urlMap={}),u.defaults&&(N.area=u.enums===String?"chinaMainland":0,N.countType=u.enums===String?"flow":0),e.area!=null&&e.hasOwnProperty("area")&&(N.area=u.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")&&(N.countType=u.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 A;if(e.urlMap&&(A=Object.keys(e.urlMap)).length){N.urlMap={};for(let U=0;U<A.length;++U)N.urlMap[A[U]]=e.urlMap[A[U]]}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.BaseCDNAddress"},$}(),D.CDNPlayAddressNotify=function(){function $(e){if(this.standLines=[],e)for(let u=Object.keys(e),N=0;N<u.length;++N)e[u[N]]!=null&&(this[u[N]]=e[u[N]])}$.prototype.roomId="",$.prototype.m3u8=null,$.prototype.rtmp=null,$.prototype.flv=null,$.prototype.rtmps=null,$.prototype.mainLine=null,$.prototype.standLines=$util.emptyArray;let I;return Object.defineProperty($.prototype,"_m3u8",{get:$util.oneOfGetter(I=["m3u8"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_rtmp",{get:$util.oneOfGetter(I=["rtmp"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_flv",{get:$util.oneOfGetter(I=["flv"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_rtmps",{get:$util.oneOfGetter(I=["rtmps"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_mainLine",{get:$util.oneOfGetter(I=["mainLine"]),set:$util.oneOfSetter(I)}),$.create=function(u){return new $(u)},$.encode=function(u,N){if(N||(N=$Writer.create()),u.roomId!=null&&Object.hasOwnProperty.call(u,"roomId")&&N.uint32(10).string(u.roomId),u.m3u8!=null&&Object.hasOwnProperty.call(u,"m3u8")&&N.uint32(18).string(u.m3u8),u.rtmp!=null&&Object.hasOwnProperty.call(u,"rtmp")&&N.uint32(26).string(u.rtmp),u.flv!=null&&Object.hasOwnProperty.call(u,"flv")&&N.uint32(34).string(u.flv),u.rtmps!=null&&Object.hasOwnProperty.call(u,"rtmps")&&N.uint32(42).string(u.rtmps),u.mainLine!=null&&Object.hasOwnProperty.call(u,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(u.mainLine,N.uint32(50).fork()).ldelim(),u.standLines!=null&&u.standLines.length)for(let A=0;A<u.standLines.length;++A)$root.com.quick.voice.proto.BaseCDNAddress.encode(u.standLines[A],N.uint32(58).fork()).ldelim();return N},$.encodeDelimited=function(u,N){return this.encode(u,N).ldelim()},$.decode=function(u,N){u instanceof $Reader||(u=$Reader.create(u));let A=N===void 0?u.len:u.pos+N,U=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;u.pos<A;){let L=u.uint32();switch(L>>>3){case 1:{U.roomId=u.string();break}case 2:{U.m3u8=u.string();break}case 3:{U.rtmp=u.string();break}case 4:{U.flv=u.string();break}case 5:{U.rtmps=u.string();break}case 6:{U.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(u,u.uint32());break}case 7:{U.standLines&&U.standLines.length||(U.standLines=[]),U.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(u,u.uint32()));break}default:u.skipType(L&7);break}}return U},$.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},$.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.roomId!=null&&u.hasOwnProperty("roomId")&&!$util.isString(u.roomId))return"roomId: string expected";if(u.m3u8!=null&&u.hasOwnProperty("m3u8")&&!$util.isString(u.m3u8))return"m3u8: string expected";if(u.rtmp!=null&&u.hasOwnProperty("rtmp")&&!$util.isString(u.rtmp))return"rtmp: string expected";if(u.flv!=null&&u.hasOwnProperty("flv")&&!$util.isString(u.flv))return"flv: string expected";if(u.rtmps!=null&&u.hasOwnProperty("rtmps")&&!$util.isString(u.rtmps))return"rtmps: string expected";if(u.mainLine!=null&&u.hasOwnProperty("mainLine")){let N=$root.com.quick.voice.proto.BaseCDNAddress.verify(u.mainLine);if(N)return"mainLine."+N}if(u.standLines!=null&&u.hasOwnProperty("standLines")){if(!Array.isArray(u.standLines))return"standLines: array expected";for(let N=0;N<u.standLines.length;++N){let A=$root.com.quick.voice.proto.BaseCDNAddress.verify(u.standLines[N]);if(A)return"standLines."+A}}return null},$.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return u;let N=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(u.roomId!=null&&(N.roomId=String(u.roomId)),u.m3u8!=null&&(N.m3u8=String(u.m3u8)),u.rtmp!=null&&(N.rtmp=String(u.rtmp)),u.flv!=null&&(N.flv=String(u.flv)),u.rtmps!=null&&(N.rtmps=String(u.rtmps)),u.mainLine!=null){if(typeof u.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");N.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(u.mainLine)}if(u.standLines){if(!Array.isArray(u.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");N.standLines=[];for(let A=0;A<u.standLines.length;++A){if(typeof u.standLines[A]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");N.standLines[A]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(u.standLines[A])}}return N},$.toObject=function(u,N){N||(N={});let A={};if((N.arrays||N.defaults)&&(A.standLines=[]),N.defaults&&(A.roomId=""),u.roomId!=null&&u.hasOwnProperty("roomId")&&(A.roomId=u.roomId),u.m3u8!=null&&u.hasOwnProperty("m3u8")&&(A.m3u8=u.m3u8,N.oneofs&&(A._m3u8="m3u8")),u.rtmp!=null&&u.hasOwnProperty("rtmp")&&(A.rtmp=u.rtmp,N.oneofs&&(A._rtmp="rtmp")),u.flv!=null&&u.hasOwnProperty("flv")&&(A.flv=u.flv,N.oneofs&&(A._flv="flv")),u.rtmps!=null&&u.hasOwnProperty("rtmps")&&(A.rtmps=u.rtmps,N.oneofs&&(A._rtmps="rtmps")),u.mainLine!=null&&u.hasOwnProperty("mainLine")&&(A.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(u.mainLine,N),N.oneofs&&(A._mainLine="mainLine")),u.standLines&&u.standLines.length){A.standLines=[];for(let U=0;U<u.standLines.length;++U)A.standLines[U]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(u.standLines[U],N)}return A},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.CDNPlayAddressNotify"},$}(),D}(),k}(),q}(),_})(),ignoreEvent=["networkQualityChange","onNetQuality"],enum_notifyName={onChangeNetwork:"网络情况变更",healthCheck:"心跳检测",onNetQuality:"网络质量回调",onLogin:"登录回调",onLocalStream:"本地媒体流发生变化",onDevicechange:"媒体设备发生变化",onRoomUser:"房间用户变化",onRoomUsers:"房间所有用户所有变化",onRoomUsersStreams:"房间某些用户媒体流变化",onRoomState:"房间状态变化",onJoinRoom:"加入房间回调",onQuitRoom:"退出房间回调",onPublish:"监听到流发布",onCloseTrack:"关闭轨道",onUpdateCall:"更新通讯状态",onUpdateStreams:"更新媒体流",onUpdatePermissions:"更新推流权限通知",onTokenExpired:"Token已过期",onDestroyRoom:"直播模式房间销毁",destroyRoom:"服务器要求销毁房间",onCDNPlayUrlAdd:"cdn播放地址变化",onDestroy:"SDK销毁"};ut(enum_notifyName);const notifyName_keys=Object.keys(enum_notifyName);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Z_FIXED$1=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN$1=2;function zero$1(_){let q=_.length;for(;--q>=0;)_[q]=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(_,q,k,D,$){this.static_tree=_,this.extra_bits=q,this.extra_base=k,this.elems=D,this.max_length=$,this.has_stree=_&&_.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(_,q){this.dyn_tree=_,this.max_code=0,this.stat_desc=q}const d_code=_=>_<256?_dist_code[_]:_dist_code[256+(_>>>7)],put_short=(_,q)=>{_.pending_buf[_.pending++]=q&255,_.pending_buf[_.pending++]=q>>>8&255},send_bits=(_,q,k)=>{_.bi_valid>Buf_size-k?(_.bi_buf|=q<<_.bi_valid&65535,put_short(_,_.bi_buf),_.bi_buf=q>>Buf_size-_.bi_valid,_.bi_valid+=k-Buf_size):(_.bi_buf|=q<<_.bi_valid&65535,_.bi_valid+=k)},send_code=(_,q,k)=>{send_bits(_,k[q*2],k[q*2+1])},bi_reverse=(_,q)=>{let k=0;do k|=_&1,_>>>=1,k<<=1;while(--q>0);return k>>>1},bi_flush=_=>{_.bi_valid===16?(put_short(_,_.bi_buf),_.bi_buf=0,_.bi_valid=0):_.bi_valid>=8&&(_.pending_buf[_.pending++]=_.bi_buf&255,_.bi_buf>>=8,_.bi_valid-=8)},gen_bitlen=(_,q)=>{const k=q.dyn_tree,D=q.max_code,$=q.stat_desc.static_tree,I=q.stat_desc.has_stree,e=q.stat_desc.extra_bits,u=q.stat_desc.extra_base,N=q.stat_desc.max_length;let A,U,L,P,Z,F,W=0;for(P=0;P<=MAX_BITS$1;P++)_.bl_count[P]=0;for(k[_.heap[_.heap_max]*2+1]=0,A=_.heap_max+1;A<HEAP_SIZE$1;A++)U=_.heap[A],P=k[k[U*2+1]*2+1]+1,P>N&&(P=N,W++),k[U*2+1]=P,!(U>D)&&(_.bl_count[P]++,Z=0,U>=u&&(Z=e[U-u]),F=k[U*2],_.opt_len+=F*(P+Z),I&&(_.static_len+=F*($[U*2+1]+Z)));if(W!==0){do{for(P=N-1;_.bl_count[P]===0;)P--;_.bl_count[P]--,_.bl_count[P+1]+=2,_.bl_count[N]--,W-=2}while(W>0);for(P=N;P!==0;P--)for(U=_.bl_count[P];U!==0;)L=_.heap[--A],!(L>D)&&(k[L*2+1]!==P&&(_.opt_len+=(P-k[L*2+1])*k[L*2],k[L*2+1]=P),U--)}},gen_codes=(_,q,k)=>{const D=new Array(MAX_BITS$1+1);let $=0,I,e;for(I=1;I<=MAX_BITS$1;I++)$=$+k[I-1]<<1,D[I]=$;for(e=0;e<=q;e++){let u=_[e*2+1];u!==0&&(_[e*2]=bi_reverse(D[u]++,u))}},tr_static_init=()=>{let _,q,k,D,$;const I=new Array(MAX_BITS$1+1);for(k=0,D=0;D<LENGTH_CODES$1-1;D++)for(base_length[D]=k,_=0;_<1<<extra_lbits[D];_++)_length_code[k++]=D;for(_length_code[k-1]=D,$=0,D=0;D<16;D++)for(base_dist[D]=$,_=0;_<1<<extra_dbits[D];_++)_dist_code[$++]=D;for($>>=7;D<D_CODES$1;D++)for(base_dist[D]=$<<7,_=0;_<1<<extra_dbits[D]-7;_++)_dist_code[256+$++]=D;for(q=0;q<=MAX_BITS$1;q++)I[q]=0;for(_=0;_<=143;)static_ltree[_*2+1]=8,_++,I[8]++;for(;_<=255;)static_ltree[_*2+1]=9,_++,I[9]++;for(;_<=279;)static_ltree[_*2+1]=7,_++,I[7]++;for(;_<=287;)static_ltree[_*2+1]=8,_++,I[8]++;for(gen_codes(static_ltree,L_CODES$1+1,I),_=0;_<D_CODES$1;_++)static_dtree[_*2+1]=5,static_dtree[_*2]=bi_reverse(_,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=_=>{let q;for(q=0;q<L_CODES$1;q++)_.dyn_ltree[q*2]=0;for(q=0;q<D_CODES$1;q++)_.dyn_dtree[q*2]=0;for(q=0;q<BL_CODES$1;q++)_.bl_tree[q*2]=0;_.dyn_ltree[END_BLOCK*2]=1,_.opt_len=_.static_len=0,_.sym_next=_.matches=0},bi_windup=_=>{_.bi_valid>8?put_short(_,_.bi_buf):_.bi_valid>0&&(_.pending_buf[_.pending++]=_.bi_buf),_.bi_buf=0,_.bi_valid=0},smaller=(_,q,k,D)=>{const $=q*2,I=k*2;return _[$]<_[I]||_[$]===_[I]&&D[q]<=D[k]},pqdownheap=(_,q,k)=>{const D=_.heap[k];let $=k<<1;for(;$<=_.heap_len&&($<_.heap_len&&smaller(q,_.heap[$+1],_.heap[$],_.depth)&&$++,!smaller(q,D,_.heap[$],_.depth));)_.heap[k]=_.heap[$],k=$,$<<=1;_.heap[k]=D},compress_block=(_,q,k)=>{let D,$,I=0,e,u;if(_.sym_next!==0)do D=_.pending_buf[_.sym_buf+I++]&255,D+=(_.pending_buf[_.sym_buf+I++]&255)<<8,$=_.pending_buf[_.sym_buf+I++],D===0?send_code(_,$,q):(e=_length_code[$],send_code(_,e+LITERALS$1+1,q),u=extra_lbits[e],u!==0&&($-=base_length[e],send_bits(_,$,u)),D--,e=d_code(D),send_code(_,e,k),u=extra_dbits[e],u!==0&&(D-=base_dist[e],send_bits(_,D,u)));while(I<_.sym_next);send_code(_,END_BLOCK,q)},build_tree=(_,q)=>{const k=q.dyn_tree,D=q.stat_desc.static_tree,$=q.stat_desc.has_stree,I=q.stat_desc.elems;let e,u,N=-1,A;for(_.heap_len=0,_.heap_max=HEAP_SIZE$1,e=0;e<I;e++)k[e*2]!==0?(_.heap[++_.heap_len]=N=e,_.depth[e]=0):k[e*2+1]=0;for(;_.heap_len<2;)A=_.heap[++_.heap_len]=N<2?++N:0,k[A*2]=1,_.depth[A]=0,_.opt_len--,$&&(_.static_len-=D[A*2+1]);for(q.max_code=N,e=_.heap_len>>1;e>=1;e--)pqdownheap(_,k,e);A=I;do e=_.heap[1],_.heap[1]=_.heap[_.heap_len--],pqdownheap(_,k,1),u=_.heap[1],_.heap[--_.heap_max]=e,_.heap[--_.heap_max]=u,k[A*2]=k[e*2]+k[u*2],_.depth[A]=(_.depth[e]>=_.depth[u]?_.depth[e]:_.depth[u])+1,k[e*2+1]=k[u*2+1]=A,_.heap[1]=A++,pqdownheap(_,k,1);while(_.heap_len>=2);_.heap[--_.heap_max]=_.heap[1],gen_bitlen(_,q),gen_codes(k,N,_.bl_count)},scan_tree=(_,q,k)=>{let D,$=-1,I,e=q[0*2+1],u=0,N=7,A=4;for(e===0&&(N=138,A=3),q[(k+1)*2+1]=65535,D=0;D<=k;D++)I=e,e=q[(D+1)*2+1],!(++u<N&&I===e)&&(u<A?_.bl_tree[I*2]+=u:I!==0?(I!==$&&_.bl_tree[I*2]++,_.bl_tree[REP_3_6*2]++):u<=10?_.bl_tree[REPZ_3_10*2]++:_.bl_tree[REPZ_11_138*2]++,u=0,$=I,e===0?(N=138,A=3):I===e?(N=6,A=3):(N=7,A=4))},send_tree=(_,q,k)=>{let D,$=-1,I,e=q[0*2+1],u=0,N=7,A=4;for(e===0&&(N=138,A=3),D=0;D<=k;D++)if(I=e,e=q[(D+1)*2+1],!(++u<N&&I===e)){if(u<A)do send_code(_,I,_.bl_tree);while(--u!==0);else I!==0?(I!==$&&(send_code(_,I,_.bl_tree),u--),send_code(_,REP_3_6,_.bl_tree),send_bits(_,u-3,2)):u<=10?(send_code(_,REPZ_3_10,_.bl_tree),send_bits(_,u-3,3)):(send_code(_,REPZ_11_138,_.bl_tree),send_bits(_,u-11,7));u=0,$=I,e===0?(N=138,A=3):I===e?(N=6,A=3):(N=7,A=4)}},build_bl_tree=_=>{let q;for(scan_tree(_,_.dyn_ltree,_.l_desc.max_code),scan_tree(_,_.dyn_dtree,_.d_desc.max_code),build_tree(_,_.bl_desc),q=BL_CODES$1-1;q>=3&&_.bl_tree[bl_order[q]*2+1]===0;q--);return _.opt_len+=3*(q+1)+5+5+4,q},send_all_trees=(_,q,k,D)=>{let $;for(send_bits(_,q-257,5),send_bits(_,k-1,5),send_bits(_,D-4,4),$=0;$<D;$++)send_bits(_,_.bl_tree[bl_order[$]*2+1],3);send_tree(_,_.dyn_ltree,q-1),send_tree(_,_.dyn_dtree,k-1)},detect_data_type=_=>{let q=4093624447,k;for(k=0;k<=31;k++,q>>>=1)if(q&1&&_.dyn_ltree[k*2]!==0)return Z_BINARY;if(_.dyn_ltree[9*2]!==0||_.dyn_ltree[10*2]!==0||_.dyn_ltree[13*2]!==0)return Z_TEXT;for(k=32;k<LITERALS$1;k++)if(_.dyn_ltree[k*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=_=>{static_init_done||(tr_static_init(),static_init_done=!0),_.l_desc=new TreeDesc(_.dyn_ltree,static_l_desc),_.d_desc=new TreeDesc(_.dyn_dtree,static_d_desc),_.bl_desc=new TreeDesc(_.bl_tree,static_bl_desc),_.bi_buf=0,_.bi_valid=0,init_block(_)},_tr_stored_block$1=(_,q,k,D)=>{send_bits(_,(STORED_BLOCK<<1)+(D?1:0),3),bi_windup(_),put_short(_,k),put_short(_,~k),k&&_.pending_buf.set(_.window.subarray(q,q+k),_.pending),_.pending+=k},_tr_align$1=_=>{send_bits(_,STATIC_TREES<<1,3),send_code(_,END_BLOCK,static_ltree),bi_flush(_)},_tr_flush_block$1=(_,q,k,D)=>{let $,I,e=0;_.level>0?(_.strm.data_type===Z_UNKNOWN$1&&(_.strm.data_type=detect_data_type(_)),build_tree(_,_.l_desc),build_tree(_,_.d_desc),e=build_bl_tree(_),$=_.opt_len+3+7>>>3,I=_.static_len+3+7>>>3,I<=$&&($=I)):$=I=k+5,k+4<=$&&q!==-1?_tr_stored_block$1(_,q,k,D):_.strategy===Z_FIXED$1||I===$?(send_bits(_,(STATIC_TREES<<1)+(D?1:0),3),compress_block(_,static_ltree,static_dtree)):(send_bits(_,(DYN_TREES<<1)+(D?1:0),3),send_all_trees(_,_.l_desc.max_code+1,_.d_desc.max_code+1,e+1),compress_block(_,_.dyn_ltree,_.dyn_dtree)),init_block(_),D&&bi_windup(_)},_tr_tally$1=(_,q,k)=>(_.pending_buf[_.sym_buf+_.sym_next++]=q,_.pending_buf[_.sym_buf+_.sym_next++]=q>>8,_.pending_buf[_.sym_buf+_.sym_next++]=k,q===0?_.dyn_ltree[k*2]++:(_.matches++,q--,_.dyn_ltree[(_length_code[k]+LITERALS$1+1)*2]++,_.dyn_dtree[d_code(q)*2]++),_.sym_next===_.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=(_,q,k,D)=>{let $=_&65535|0,I=_>>>16&65535|0,e=0;for(;k!==0;){e=k>2e3?2e3:k,k-=e;do $=$+q[D++]|0,I=I+$|0;while(--e);$%=65521,I%=65521}return $|I<<16|0};var adler32_1=adler32;const makeTable=()=>{let _,q=[];for(var k=0;k<256;k++){_=k;for(var D=0;D<8;D++)_=_&1?3988292384^_>>>1:_>>>1;q[k]=_}return q},crcTable=new Uint32Array(makeTable()),crc32=(_,q,k,D)=>{const $=crcTable,I=D+k;_^=-1;for(let e=D;e<I;e++)_=_>>>8^$[(_^q[e])&255];return _^-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=(_,q)=>(_.msg=messages[q],q),rank=_=>_*2-(_>4?9:0),zero=_=>{let q=_.length;for(;--q>=0;)_[q]=0},slide_hash=_=>{let q,k,D,$=_.w_size;q=_.hash_size,D=q;do k=_.head[--D],_.head[D]=k>=$?k-$:0;while(--q);q=$,D=q;do k=_.prev[--D],_.prev[D]=k>=$?k-$:0;while(--q)};let HASH_ZLIB=(_,q,k)=>(q<<_.hash_shift^k)&_.hash_mask,HASH=HASH_ZLIB;const flush_pending=_=>{const q=_.state;let k=q.pending;k>_.avail_out&&(k=_.avail_out),k!==0&&(_.output.set(q.pending_buf.subarray(q.pending_out,q.pending_out+k),_.next_out),_.next_out+=k,q.pending_out+=k,_.total_out+=k,_.avail_out-=k,q.pending-=k,q.pending===0&&(q.pending_out=0))},flush_block_only=(_,q)=>{_tr_flush_block(_,_.block_start>=0?_.block_start:-1,_.strstart-_.block_start,q),_.block_start=_.strstart,flush_pending(_.strm)},put_byte=(_,q)=>{_.pending_buf[_.pending++]=q},putShortMSB=(_,q)=>{_.pending_buf[_.pending++]=q>>>8&255,_.pending_buf[_.pending++]=q&255},read_buf=(_,q,k,D)=>{let $=_.avail_in;return $>D&&($=D),$===0?0:(_.avail_in-=$,q.set(_.input.subarray(_.next_in,_.next_in+$),k),_.state.wrap===1?_.adler=adler32_1(_.adler,q,$,k):_.state.wrap===2&&(_.adler=crc32_1(_.adler,q,$,k)),_.next_in+=$,_.total_in+=$,$)},longest_match=(_,q)=>{let k=_.max_chain_length,D=_.strstart,$,I,e=_.prev_length,u=_.nice_match;const N=_.strstart>_.w_size-MIN_LOOKAHEAD?_.strstart-(_.w_size-MIN_LOOKAHEAD):0,A=_.window,U=_.w_mask,L=_.prev,P=_.strstart+MAX_MATCH;let Z=A[D+e-1],F=A[D+e];_.prev_length>=_.good_match&&(k>>=2),u>_.lookahead&&(u=_.lookahead);do if($=q,!(A[$+e]!==F||A[$+e-1]!==Z||A[$]!==A[D]||A[++$]!==A[D+1])){D+=2,$++;do;while(A[++D]===A[++$]&&A[++D]===A[++$]&&A[++D]===A[++$]&&A[++D]===A[++$]&&A[++D]===A[++$]&&A[++D]===A[++$]&&A[++D]===A[++$]&&A[++D]===A[++$]&&D<P);if(I=MAX_MATCH-(P-D),D=P-MAX_MATCH,I>e){if(_.match_start=q,e=I,I>=u)break;Z=A[D+e-1],F=A[D+e]}}while((q=L[q&U])>N&&--k!==0);return e<=_.lookahead?e:_.lookahead},fill_window=_=>{const q=_.w_size;let k,D,$;do{if(D=_.window_size-_.lookahead-_.strstart,_.strstart>=q+(q-MIN_LOOKAHEAD)&&(_.window.set(_.window.subarray(q,q+q-D),0),_.match_start-=q,_.strstart-=q,_.block_start-=q,_.insert>_.strstart&&(_.insert=_.strstart),slide_hash(_),D+=q),_.strm.avail_in===0)break;if(k=read_buf(_.strm,_.window,_.strstart+_.lookahead,D),_.lookahead+=k,_.lookahead+_.insert>=MIN_MATCH)for($=_.strstart-_.insert,_.ins_h=_.window[$],_.ins_h=HASH(_,_.ins_h,_.window[$+1]);_.insert&&(_.ins_h=HASH(_,_.ins_h,_.window[$+MIN_MATCH-1]),_.prev[$&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=$,$++,_.insert--,!(_.lookahead+_.insert<MIN_MATCH)););}while(_.lookahead<MIN_LOOKAHEAD&&_.strm.avail_in!==0)},deflate_stored=(_,q)=>{let k=_.pending_buf_size-5>_.w_size?_.w_size:_.pending_buf_size-5,D,$,I,e=0,u=_.strm.avail_in;do{if(D=65535,I=_.bi_valid+42>>3,_.strm.avail_out<I||(I=_.strm.avail_out-I,$=_.strstart-_.block_start,D>$+_.strm.avail_in&&(D=$+_.strm.avail_in),D>I&&(D=I),D<k&&(D===0&&q!==Z_FINISH$3||q===Z_NO_FLUSH$2||D!==$+_.strm.avail_in)))break;e=q===Z_FINISH$3&&D===$+_.strm.avail_in?1:0,_tr_stored_block(_,0,0,e),_.pending_buf[_.pending-4]=D,_.pending_buf[_.pending-3]=D>>8,_.pending_buf[_.pending-2]=~D,_.pending_buf[_.pending-1]=~D>>8,flush_pending(_.strm),$&&($>D&&($=D),_.strm.output.set(_.window.subarray(_.block_start,_.block_start+$),_.strm.next_out),_.strm.next_out+=$,_.strm.avail_out-=$,_.strm.total_out+=$,_.block_start+=$,D-=$),D&&(read_buf(_.strm,_.strm.output,_.strm.next_out,D),_.strm.next_out+=D,_.strm.avail_out-=D,_.strm.total_out+=D)}while(e===0);return u-=_.strm.avail_in,u&&(u>=_.w_size?(_.matches=2,_.window.set(_.strm.input.subarray(_.strm.next_in-_.w_size,_.strm.next_in),0),_.strstart=_.w_size,_.insert=_.strstart):(_.window_size-_.strstart<=u&&(_.strstart-=_.w_size,_.window.set(_.window.subarray(_.w_size,_.w_size+_.strstart),0),_.matches<2&&_.matches++,_.insert>_.strstart&&(_.insert=_.strstart)),_.window.set(_.strm.input.subarray(_.strm.next_in-u,_.strm.next_in),_.strstart),_.strstart+=u,_.insert+=u>_.w_size-_.insert?_.w_size-_.insert:u),_.block_start=_.strstart),_.high_water<_.strstart&&(_.high_water=_.strstart),e?BS_FINISH_DONE:q!==Z_NO_FLUSH$2&&q!==Z_FINISH$3&&_.strm.avail_in===0&&_.strstart===_.block_start?BS_BLOCK_DONE:(I=_.window_size-_.strstart,_.strm.avail_in>I&&_.block_start>=_.w_size&&(_.block_start-=_.w_size,_.strstart-=_.w_size,_.window.set(_.window.subarray(_.w_size,_.w_size+_.strstart),0),_.matches<2&&_.matches++,I+=_.w_size,_.insert>_.strstart&&(_.insert=_.strstart)),I>_.strm.avail_in&&(I=_.strm.avail_in),I&&(read_buf(_.strm,_.window,_.strstart,I),_.strstart+=I,_.insert+=I>_.w_size-_.insert?_.w_size-_.insert:I),_.high_water<_.strstart&&(_.high_water=_.strstart),I=_.bi_valid+42>>3,I=_.pending_buf_size-I>65535?65535:_.pending_buf_size-I,k=I>_.w_size?_.w_size:I,$=_.strstart-_.block_start,($>=k||($||q===Z_FINISH$3)&&q!==Z_NO_FLUSH$2&&_.strm.avail_in===0&&$<=I)&&(D=$>I?I:$,e=q===Z_FINISH$3&&_.strm.avail_in===0&&D===$?1:0,_tr_stored_block(_,_.block_start,D,e),_.block_start+=D,flush_pending(_.strm)),e?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(_,q)=>{let k,D;for(;;){if(_.lookahead<MIN_LOOKAHEAD){if(fill_window(_),_.lookahead<MIN_LOOKAHEAD&&q===Z_NO_FLUSH$2)return BS_NEED_MORE;if(_.lookahead===0)break}if(k=0,_.lookahead>=MIN_MATCH&&(_.ins_h=HASH(_,_.ins_h,_.window[_.strstart+MIN_MATCH-1]),k=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),k!==0&&_.strstart-k<=_.w_size-MIN_LOOKAHEAD&&(_.match_length=longest_match(_,k)),_.match_length>=MIN_MATCH)if(D=_tr_tally(_,_.strstart-_.match_start,_.match_length-MIN_MATCH),_.lookahead-=_.match_length,_.match_length<=_.max_lazy_match&&_.lookahead>=MIN_MATCH){_.match_length--;do _.strstart++,_.ins_h=HASH(_,_.ins_h,_.window[_.strstart+MIN_MATCH-1]),k=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart;while(--_.match_length!==0);_.strstart++}else _.strstart+=_.match_length,_.match_length=0,_.ins_h=_.window[_.strstart],_.ins_h=HASH(_,_.ins_h,_.window[_.strstart+1]);else D=_tr_tally(_,0,_.window[_.strstart]),_.lookahead--,_.strstart++;if(D&&(flush_block_only(_,!1),_.strm.avail_out===0))return BS_NEED_MORE}return _.insert=_.strstart<MIN_MATCH-1?_.strstart:MIN_MATCH-1,q===Z_FINISH$3?(flush_block_only(_,!0),_.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):_.sym_next&&(flush_block_only(_,!1),_.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(_,q)=>{let k,D,$;for(;;){if(_.lookahead<MIN_LOOKAHEAD){if(fill_window(_),_.lookahead<MIN_LOOKAHEAD&&q===Z_NO_FLUSH$2)return BS_NEED_MORE;if(_.lookahead===0)break}if(k=0,_.lookahead>=MIN_MATCH&&(_.ins_h=HASH(_,_.ins_h,_.window[_.strstart+MIN_MATCH-1]),k=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),_.prev_length=_.match_length,_.prev_match=_.match_start,_.match_length=MIN_MATCH-1,k!==0&&_.prev_length<_.max_lazy_match&&_.strstart-k<=_.w_size-MIN_LOOKAHEAD&&(_.match_length=longest_match(_,k),_.match_length<=5&&(_.strategy===Z_FILTERED||_.match_length===MIN_MATCH&&_.strstart-_.match_start>4096)&&(_.match_length=MIN_MATCH-1)),_.prev_length>=MIN_MATCH&&_.match_length<=_.prev_length){$=_.strstart+_.lookahead-MIN_MATCH,D=_tr_tally(_,_.strstart-1-_.prev_match,_.prev_length-MIN_MATCH),_.lookahead-=_.prev_length-1,_.prev_length-=2;do++_.strstart<=$&&(_.ins_h=HASH(_,_.ins_h,_.window[_.strstart+MIN_MATCH-1]),k=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart);while(--_.prev_length!==0);if(_.match_available=0,_.match_length=MIN_MATCH-1,_.strstart++,D&&(flush_block_only(_,!1),_.strm.avail_out===0))return BS_NEED_MORE}else if(_.match_available){if(D=_tr_tally(_,0,_.window[_.strstart-1]),D&&flush_block_only(_,!1),_.strstart++,_.lookahead--,_.strm.avail_out===0)return BS_NEED_MORE}else _.match_available=1,_.strstart++,_.lookahead--}return _.match_available&&(D=_tr_tally(_,0,_.window[_.strstart-1]),_.match_available=0),_.insert=_.strstart<MIN_MATCH-1?_.strstart:MIN_MATCH-1,q===Z_FINISH$3?(flush_block_only(_,!0),_.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):_.sym_next&&(flush_block_only(_,!1),_.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(_,q)=>{let k,D,$,I;const e=_.window;for(;;){if(_.lookahead<=MAX_MATCH){if(fill_window(_),_.lookahead<=MAX_MATCH&&q===Z_NO_FLUSH$2)return BS_NEED_MORE;if(_.lookahead===0)break}if(_.match_length=0,_.lookahead>=MIN_MATCH&&_.strstart>0&&($=_.strstart-1,D=e[$],D===e[++$]&&D===e[++$]&&D===e[++$])){I=_.strstart+MAX_MATCH;do;while(D===e[++$]&&D===e[++$]&&D===e[++$]&&D===e[++$]&&D===e[++$]&&D===e[++$]&&D===e[++$]&&D===e[++$]&&$<I);_.match_length=MAX_MATCH-(I-$),_.match_length>_.lookahead&&(_.match_length=_.lookahead)}if(_.match_length>=MIN_MATCH?(k=_tr_tally(_,1,_.match_length-MIN_MATCH),_.lookahead-=_.match_length,_.strstart+=_.match_length,_.match_length=0):(k=_tr_tally(_,0,_.window[_.strstart]),_.lookahead--,_.strstart++),k&&(flush_block_only(_,!1),_.strm.avail_out===0))return BS_NEED_MORE}return _.insert=0,q===Z_FINISH$3?(flush_block_only(_,!0),_.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):_.sym_next&&(flush_block_only(_,!1),_.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(_,q)=>{let k;for(;;){if(_.lookahead===0&&(fill_window(_),_.lookahead===0)){if(q===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(_.match_length=0,k=_tr_tally(_,0,_.window[_.strstart]),_.lookahead--,_.strstart++,k&&(flush_block_only(_,!1),_.strm.avail_out===0))return BS_NEED_MORE}return _.insert=0,q===Z_FINISH$3?(flush_block_only(_,!0),_.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):_.sym_next&&(flush_block_only(_,!1),_.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(_,q,k,D,$){this.good_length=_,this.max_lazy=q,this.nice_length=k,this.max_chain=D,this.func=$}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=_=>{_.window_size=2*_.w_size,zero(_.head),_.max_lazy_match=configuration_table[_.level].max_lazy,_.good_match=configuration_table[_.level].good_length,_.nice_match=configuration_table[_.level].nice_length,_.max_chain_length=configuration_table[_.level].max_chain,_.strstart=0,_.block_start=0,_.lookahead=0,_.insert=0,_.match_length=_.prev_length=MIN_MATCH-1,_.match_available=0,_.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=_=>{if(!_)return 1;const q=_.state;return!q||q.strm!==_||q.status!==INIT_STATE&&q.status!==GZIP_STATE&&q.status!==EXTRA_STATE&&q.status!==NAME_STATE&&q.status!==COMMENT_STATE&&q.status!==HCRC_STATE&&q.status!==BUSY_STATE&&q.status!==FINISH_STATE?1:0},deflateResetKeep=_=>{if(deflateStateCheck(_))return err(_,Z_STREAM_ERROR$2);_.total_in=_.total_out=0,_.data_type=Z_UNKNOWN;const q=_.state;return q.pending=0,q.pending_out=0,q.wrap<0&&(q.wrap=-q.wrap),q.status=q.wrap===2?GZIP_STATE:q.wrap?INIT_STATE:BUSY_STATE,_.adler=q.wrap===2?0:1,q.last_flush=-2,_tr_init(q),Z_OK$3},deflateReset=_=>{const q=deflateResetKeep(_);return q===Z_OK$3&&lm_init(_.state),q},deflateSetHeader=(_,q)=>deflateStateCheck(_)||_.state.wrap!==2?Z_STREAM_ERROR$2:(_.state.gzhead=q,Z_OK$3),deflateInit2=(_,q,k,D,$,I)=>{if(!_)return Z_STREAM_ERROR$2;let e=1;if(q===Z_DEFAULT_COMPRESSION$1&&(q=6),D<0?(e=0,D=-D):D>15&&(e=2,D-=16),$<1||$>MAX_MEM_LEVEL||k!==Z_DEFLATED$2||D<8||D>15||q<0||q>9||I<0||I>Z_FIXED||D===8&&e!==1)return err(_,Z_STREAM_ERROR$2);D===8&&(D=9);const u=new DeflateState;return _.state=u,u.strm=_,u.status=INIT_STATE,u.wrap=e,u.gzhead=null,u.w_bits=D,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=$+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+MIN_MATCH-1)/MIN_MATCH),u.window=new Uint8Array(u.w_size*2),u.head=new Uint16Array(u.hash_size),u.prev=new Uint16Array(u.w_size),u.lit_bufsize=1<<$+6,u.pending_buf_size=u.lit_bufsize*4,u.pending_buf=new Uint8Array(u.pending_buf_size),u.sym_buf=u.lit_bufsize,u.sym_end=(u.lit_bufsize-1)*3,u.level=q,u.strategy=I,u.method=k,deflateReset(_)},deflateInit=(_,q)=>deflateInit2(_,q,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(_,q)=>{if(deflateStateCheck(_)||q>Z_BLOCK$1||q<0)return _?err(_,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const k=_.state;if(!_.output||_.avail_in!==0&&!_.input||k.status===FINISH_STATE&&q!==Z_FINISH$3)return err(_,_.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const D=k.last_flush;if(k.last_flush=q,k.pending!==0){if(flush_pending(_),_.avail_out===0)return k.last_flush=-1,Z_OK$3}else if(_.avail_in===0&&rank(q)<=rank(D)&&q!==Z_FINISH$3)return err(_,Z_BUF_ERROR$1);if(k.status===FINISH_STATE&&_.avail_in!==0)return err(_,Z_BUF_ERROR$1);if(k.status===INIT_STATE&&k.wrap===0&&(k.status=BUSY_STATE),k.status===INIT_STATE){let $=Z_DEFLATED$2+(k.w_bits-8<<4)<<8,I=-1;if(k.strategy>=Z_HUFFMAN_ONLY||k.level<2?I=0:k.level<6?I=1:k.level===6?I=2:I=3,$|=I<<6,k.strstart!==0&&($|=PRESET_DICT),$+=31-$%31,putShortMSB(k,$),k.strstart!==0&&(putShortMSB(k,_.adler>>>16),putShortMSB(k,_.adler&65535)),_.adler=1,k.status=BUSY_STATE,flush_pending(_),k.pending!==0)return k.last_flush=-1,Z_OK$3}if(k.status===GZIP_STATE){if(_.adler=0,put_byte(k,31),put_byte(k,139),put_byte(k,8),k.gzhead)put_byte(k,(k.gzhead.text?1:0)+(k.gzhead.hcrc?2:0)+(k.gzhead.extra?4:0)+(k.gzhead.name?8:0)+(k.gzhead.comment?16:0)),put_byte(k,k.gzhead.time&255),put_byte(k,k.gzhead.time>>8&255),put_byte(k,k.gzhead.time>>16&255),put_byte(k,k.gzhead.time>>24&255),put_byte(k,k.level===9?2:k.strategy>=Z_HUFFMAN_ONLY||k.level<2?4:0),put_byte(k,k.gzhead.os&255),k.gzhead.extra&&k.gzhead.extra.length&&(put_byte(k,k.gzhead.extra.length&255),put_byte(k,k.gzhead.extra.length>>8&255)),k.gzhead.hcrc&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending,0)),k.gzindex=0,k.status=EXTRA_STATE;else if(put_byte(k,0),put_byte(k,0),put_byte(k,0),put_byte(k,0),put_byte(k,0),put_byte(k,k.level===9?2:k.strategy>=Z_HUFFMAN_ONLY||k.level<2?4:0),put_byte(k,OS_CODE),k.status=BUSY_STATE,flush_pending(_),k.pending!==0)return k.last_flush=-1,Z_OK$3}if(k.status===EXTRA_STATE){if(k.gzhead.extra){let $=k.pending,I=(k.gzhead.extra.length&65535)-k.gzindex;for(;k.pending+I>k.pending_buf_size;){let u=k.pending_buf_size-k.pending;if(k.pending_buf.set(k.gzhead.extra.subarray(k.gzindex,k.gzindex+u),k.pending),k.pending=k.pending_buf_size,k.gzhead.hcrc&&k.pending>$&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending-$,$)),k.gzindex+=u,flush_pending(_),k.pending!==0)return k.last_flush=-1,Z_OK$3;$=0,I-=u}let e=new Uint8Array(k.gzhead.extra);k.pending_buf.set(e.subarray(k.gzindex,k.gzindex+I),k.pending),k.pending+=I,k.gzhead.hcrc&&k.pending>$&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending-$,$)),k.gzindex=0}k.status=NAME_STATE}if(k.status===NAME_STATE){if(k.gzhead.name){let $=k.pending,I;do{if(k.pending===k.pending_buf_size){if(k.gzhead.hcrc&&k.pending>$&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending-$,$)),flush_pending(_),k.pending!==0)return k.last_flush=-1,Z_OK$3;$=0}k.gzindex<k.gzhead.name.length?I=k.gzhead.name.charCodeAt(k.gzindex++)&255:I=0,put_byte(k,I)}while(I!==0);k.gzhead.hcrc&&k.pending>$&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending-$,$)),k.gzindex=0}k.status=COMMENT_STATE}if(k.status===COMMENT_STATE){if(k.gzhead.comment){let $=k.pending,I;do{if(k.pending===k.pending_buf_size){if(k.gzhead.hcrc&&k.pending>$&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending-$,$)),flush_pending(_),k.pending!==0)return k.last_flush=-1,Z_OK$3;$=0}k.gzindex<k.gzhead.comment.length?I=k.gzhead.comment.charCodeAt(k.gzindex++)&255:I=0,put_byte(k,I)}while(I!==0);k.gzhead.hcrc&&k.pending>$&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending-$,$))}k.status=HCRC_STATE}if(k.status===HCRC_STATE){if(k.gzhead.hcrc){if(k.pending+2>k.pending_buf_size&&(flush_pending(_),k.pending!==0))return k.last_flush=-1,Z_OK$3;put_byte(k,_.adler&255),put_byte(k,_.adler>>8&255),_.adler=0}if(k.status=BUSY_STATE,flush_pending(_),k.pending!==0)return k.last_flush=-1,Z_OK$3}if(_.avail_in!==0||k.lookahead!==0||q!==Z_NO_FLUSH$2&&k.status!==FINISH_STATE){let $=k.level===0?deflate_stored(k,q):k.strategy===Z_HUFFMAN_ONLY?deflate_huff(k,q):k.strategy===Z_RLE?deflate_rle(k,q):configuration_table[k.level].func(k,q);if(($===BS_FINISH_STARTED||$===BS_FINISH_DONE)&&(k.status=FINISH_STATE),$===BS_NEED_MORE||$===BS_FINISH_STARTED)return _.avail_out===0&&(k.last_flush=-1),Z_OK$3;if($===BS_BLOCK_DONE&&(q===Z_PARTIAL_FLUSH?_tr_align(k):q!==Z_BLOCK$1&&(_tr_stored_block(k,0,0,!1),q===Z_FULL_FLUSH$1&&(zero(k.head),k.lookahead===0&&(k.strstart=0,k.block_start=0,k.insert=0))),flush_pending(_),_.avail_out===0))return k.last_flush=-1,Z_OK$3}return q!==Z_FINISH$3?Z_OK$3:k.wrap<=0?Z_STREAM_END$3:(k.wrap===2?(put_byte(k,_.adler&255),put_byte(k,_.adler>>8&255),put_byte(k,_.adler>>16&255),put_byte(k,_.adler>>24&255),put_byte(k,_.total_in&255),put_byte(k,_.total_in>>8&255),put_byte(k,_.total_in>>16&255),put_byte(k,_.total_in>>24&255)):(putShortMSB(k,_.adler>>>16),putShortMSB(k,_.adler&65535)),flush_pending(_),k.wrap>0&&(k.wrap=-k.wrap),k.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=_=>{if(deflateStateCheck(_))return Z_STREAM_ERROR$2;const q=_.state.status;return _.state=null,q===BUSY_STATE?err(_,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(_,q)=>{let k=q.length;if(deflateStateCheck(_))return Z_STREAM_ERROR$2;const D=_.state,$=D.wrap;if($===2||$===1&&D.status!==INIT_STATE||D.lookahead)return Z_STREAM_ERROR$2;if($===1&&(_.adler=adler32_1(_.adler,q,k,0)),D.wrap=0,k>=D.w_size){$===0&&(zero(D.head),D.strstart=0,D.block_start=0,D.insert=0);let N=new Uint8Array(D.w_size);N.set(q.subarray(k-D.w_size,k),0),q=N,k=D.w_size}const I=_.avail_in,e=_.next_in,u=_.input;for(_.avail_in=k,_.next_in=0,_.input=q,fill_window(D);D.lookahead>=MIN_MATCH;){let N=D.strstart,A=D.lookahead-(MIN_MATCH-1);do D.ins_h=HASH(D,D.ins_h,D.window[N+MIN_MATCH-1]),D.prev[N&D.w_mask]=D.head[D.ins_h],D.head[D.ins_h]=N,N++;while(--A);D.strstart=N,D.lookahead=MIN_MATCH-1,fill_window(D)}return D.strstart+=D.lookahead,D.block_start=D.strstart,D.insert=D.lookahead,D.lookahead=0,D.match_length=D.prev_length=MIN_MATCH-1,D.match_available=0,_.next_in=e,_.input=u,_.avail_in=I,D.wrap=$,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=(_,q)=>Object.prototype.hasOwnProperty.call(_,q);var assign=function(_){const q=Array.prototype.slice.call(arguments,1);for(;q.length;){const k=q.shift();if(k){if(typeof k!="object")throw new TypeError(k+"must be non-object");for(const D in k)_has(k,D)&&(_[D]=k[D])}}return _},flattenChunks=_=>{let q=0;for(let D=0,$=_.length;D<$;D++)q+=_[D].length;const k=new Uint8Array(q);for(let D=0,$=0,I=_.length;D<I;D++){let e=_[D];k.set(e,$),$+=e.length}return k},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(_){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let _=0;_<256;_++)_utf8len[_]=_>=252?6:_>=248?5:_>=240?4:_>=224?3:_>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=_=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(_);let q,k,D,$,I,e=_.length,u=0;for($=0;$<e;$++)k=_.charCodeAt($),(k&64512)===55296&&$+1<e&&(D=_.charCodeAt($+1),(D&64512)===56320&&(k=65536+(k-55296<<10)+(D-56320),$++)),u+=k<128?1:k<2048?2:k<65536?3:4;for(q=new Uint8Array(u),I=0,$=0;I<u;$++)k=_.charCodeAt($),(k&64512)===55296&&$+1<e&&(D=_.charCodeAt($+1),(D&64512)===56320&&(k=65536+(k-55296<<10)+(D-56320),$++)),k<128?q[I++]=k:k<2048?(q[I++]=192|k>>>6,q[I++]=128|k&63):k<65536?(q[I++]=224|k>>>12,q[I++]=128|k>>>6&63,q[I++]=128|k&63):(q[I++]=240|k>>>18,q[I++]=128|k>>>12&63,q[I++]=128|k>>>6&63,q[I++]=128|k&63);return q};const buf2binstring=(_,q)=>{if(q<65534&&_.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,_.length===q?_:_.subarray(0,q));let k="";for(let D=0;D<q;D++)k+=String.fromCharCode(_[D]);return k};var buf2string=(_,q)=>{const k=q||_.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(_.subarray(0,q));let D,$;const I=new Array(k*2);for($=0,D=0;D<k;){let e=_[D++];if(e<128){I[$++]=e;continue}let u=_utf8len[e];if(u>4){I[$++]=65533,D+=u-1;continue}for(e&=u===2?31:u===3?15:7;u>1&&D<k;)e=e<<6|_[D++]&63,u--;if(u>1){I[$++]=65533;continue}e<65536?I[$++]=e:(e-=65536,I[$++]=55296|e>>10&1023,I[$++]=56320|e&1023)}return buf2binstring(I,$)},utf8border=(_,q)=>{q=q||_.length,q>_.length&&(q=_.length);let k=q-1;for(;k>=0&&(_[k]&192)===128;)k--;return k<0||k===0?q:k+_utf8len[_[k]]>q?k:q},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(_){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},_||{});let q=this.options;q.raw&&q.windowBits>0?q.windowBits=-q.windowBits:q.gzip&&q.windowBits>0&&q.windowBits<16&&(q.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let k=deflate_1$2.deflateInit2(this.strm,q.level,q.method,q.windowBits,q.memLevel,q.strategy);if(k!==Z_OK$2)throw new Error(messages[k]);if(q.header&&deflate_1$2.deflateSetHeader(this.strm,q.header),q.dictionary){let D;if(typeof q.dictionary=="string"?D=strings.string2buf(q.dictionary):toString$1.call(q.dictionary)==="[object ArrayBuffer]"?D=new Uint8Array(q.dictionary):D=q.dictionary,k=deflate_1$2.deflateSetDictionary(this.strm,D),k!==Z_OK$2)throw new Error(messages[k]);this._dict_set=!0}}Deflate$1.prototype.push=function(_,q){const k=this.strm,D=this.options.chunkSize;let $,I;if(this.ended)return!1;for(q===~~q?I=q:I=q===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof _=="string"?k.input=strings.string2buf(_):toString$1.call(_)==="[object ArrayBuffer]"?k.input=new Uint8Array(_):k.input=_,k.next_in=0,k.avail_in=k.input.length;;){if(k.avail_out===0&&(k.output=new Uint8Array(D),k.next_out=0,k.avail_out=D),(I===Z_SYNC_FLUSH||I===Z_FULL_FLUSH)&&k.avail_out<=6){this.onData(k.output.subarray(0,k.next_out)),k.avail_out=0;continue}if($=deflate_1$2.deflate(k,I),$===Z_STREAM_END$2)return k.next_out>0&&this.onData(k.output.subarray(0,k.next_out)),$=deflate_1$2.deflateEnd(this.strm),this.onEnd($),this.ended=!0,$===Z_OK$2;if(k.avail_out===0){this.onData(k.output);continue}if(I>0&&k.next_out>0){this.onData(k.output.subarray(0,k.next_out)),k.avail_out=0;continue}if(k.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(_){this.chunks.push(_)},Deflate$1.prototype.onEnd=function(_){_===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=_,this.msg=this.strm.msg};function deflate$1(_,q){const k=new Deflate$1(q);if(k.push(_,!0),k.err)throw k.msg||messages[k.err];return k.result}function deflateRaw$1(_,q){return q=q||{},q.raw=!0,deflate$1(_,q)}function gzip$1(_,q){return q=q||{},q.gzip=!0,deflate$1(_,q)}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 _(q,k){let D,$,I,e,u,N,A,U,L,P,Z,F,W,J,z,V,X,Y,et,ft,tt,st,rt,nt;const ot=q.state;D=q.next_in,rt=q.input,$=D+(q.avail_in-5),I=q.next_out,nt=q.output,e=I-(k-q.avail_out),u=I+(q.avail_out-257),N=ot.dmax,A=ot.wsize,U=ot.whave,L=ot.wnext,P=ot.window,Z=ot.hold,F=ot.bits,W=ot.lencode,J=ot.distcode,z=(1<<ot.lenbits)-1,V=(1<<ot.distbits)-1;t:do{F<15&&(Z+=rt[D++]<<F,F+=8,Z+=rt[D++]<<F,F+=8),X=W[Z&z];e:for(;;){if(Y=X>>>24,Z>>>=Y,F-=Y,Y=X>>>16&255,Y===0)nt[I++]=X&65535;else if(Y&16){et=X&65535,Y&=15,Y&&(F<Y&&(Z+=rt[D++]<<F,F+=8),et+=Z&(1<<Y)-1,Z>>>=Y,F-=Y),F<15&&(Z+=rt[D++]<<F,F+=8,Z+=rt[D++]<<F,F+=8),X=J[Z&V];i:for(;;){if(Y=X>>>24,Z>>>=Y,F-=Y,Y=X>>>16&255,Y&16){if(ft=X&65535,Y&=15,F<Y&&(Z+=rt[D++]<<F,F+=8,F<Y&&(Z+=rt[D++]<<F,F+=8)),ft+=Z&(1<<Y)-1,ft>N){q.msg="invalid distance too far back",ot.mode=BAD$1;break t}if(Z>>>=Y,F-=Y,Y=I-e,ft>Y){if(Y=ft-Y,Y>U&&ot.sane){q.msg="invalid distance too far back",ot.mode=BAD$1;break t}if(tt=0,st=P,L===0){if(tt+=A-Y,Y<et){et-=Y;do nt[I++]=P[tt++];while(--Y);tt=I-ft,st=nt}}else if(L<Y){if(tt+=A+L-Y,Y-=L,Y<et){et-=Y;do nt[I++]=P[tt++];while(--Y);if(tt=0,L<et){Y=L,et-=Y;do nt[I++]=P[tt++];while(--Y);tt=I-ft,st=nt}}}else if(tt+=L-Y,Y<et){et-=Y;do nt[I++]=P[tt++];while(--Y);tt=I-ft,st=nt}for(;et>2;)nt[I++]=st[tt++],nt[I++]=st[tt++],nt[I++]=st[tt++],et-=3;et&&(nt[I++]=st[tt++],et>1&&(nt[I++]=st[tt++]))}else{tt=I-ft;do nt[I++]=nt[tt++],nt[I++]=nt[tt++],nt[I++]=nt[tt++],et-=3;while(et>2);et&&(nt[I++]=nt[tt++],et>1&&(nt[I++]=nt[tt++]))}}else if((Y&64)===0){X=J[(X&65535)+(Z&(1<<Y)-1)];continue i}else{q.msg="invalid distance code",ot.mode=BAD$1;break t}break}}else if((Y&64)===0){X=W[(X&65535)+(Z&(1<<Y)-1)];continue e}else if(Y&32){ot.mode=TYPE$1;break t}else{q.msg="invalid literal/length code",ot.mode=BAD$1;break t}break}}while(D<$&&I<u);et=F>>3,D-=et,F-=et<<3,Z&=(1<<F)-1,q.next_in=D,q.next_out=I,q.avail_in=D<$?5+($-D):5-(D-$),q.avail_out=I<u?257+(u-I):257-(I-u),ot.hold=Z,ot.bits=F};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=(_,q,k,D,$,I,e,u)=>{const N=u.bits;let A=0,U=0,L=0,P=0,Z=0,F=0,W=0,J=0,z=0,V=0,X,Y,et,ft,tt,st=null,rt;const nt=new Uint16Array(MAXBITS+1),ot=new Uint16Array(MAXBITS+1);let St=null,Kt,Jt,Wt;for(A=0;A<=MAXBITS;A++)nt[A]=0;for(U=0;U<D;U++)nt[q[k+U]]++;for(Z=N,P=MAXBITS;P>=1&&nt[P]===0;P--);if(Z>P&&(Z=P),P===0)return $[I++]=1<<24|64<<16|0,$[I++]=1<<24|64<<16|0,u.bits=1,0;for(L=1;L<P&&nt[L]===0;L++);for(Z<L&&(Z=L),J=1,A=1;A<=MAXBITS;A++)if(J<<=1,J-=nt[A],J<0)return-1;if(J>0&&(_===CODES$1||P!==1))return-1;for(ot[1]=0,A=1;A<MAXBITS;A++)ot[A+1]=ot[A]+nt[A];for(U=0;U<D;U++)q[k+U]!==0&&(e[ot[q[k+U]]++]=U);if(_===CODES$1?(st=St=e,rt=20):_===LENS$1?(st=lbase,St=lext,rt=257):(st=dbase,St=dext,rt=0),V=0,U=0,A=L,tt=I,F=Z,W=0,et=-1,z=1<<Z,ft=z-1,_===LENS$1&&z>ENOUGH_LENS$1||_===DISTS$1&&z>ENOUGH_DISTS$1)return 1;for(;;){Kt=A-W,e[U]+1<rt?(Jt=0,Wt=e[U]):e[U]>=rt?(Jt=St[e[U]-rt],Wt=st[e[U]-rt]):(Jt=96,Wt=0),X=1<<A-W,Y=1<<F,L=Y;do Y-=X,$[tt+(V>>W)+Y]=Kt<<24|Jt<<16|Wt|0;while(Y!==0);for(X=1<<A-1;V&X;)X>>=1;if(X!==0?(V&=X-1,V+=X):V=0,U++,--nt[A]===0){if(A===P)break;A=q[k+e[U]]}if(A>Z&&(V&ft)!==et){for(W===0&&(W=Z),tt+=L,F=A-W,J=1<<F;F+W<P&&(J-=nt[F+W],!(J<=0));)F++,J<<=1;if(z+=1<<F,_===LENS$1&&z>ENOUGH_LENS$1||_===DISTS$1&&z>ENOUGH_DISTS$1)return 1;et=V&ft,$[et]=Z<<24|F<<16|tt-I|0}}return V!==0&&($[tt+V]=A-W<<24|64<<16|0),u.bits=Z,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=_=>(_>>>24&255)+(_>>>8&65280)+((_&65280)<<8)+((_&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=_=>{if(!_)return 1;const q=_.state;return!q||q.strm!==_||q.mode<HEAD||q.mode>SYNC?1:0},inflateResetKeep=_=>{if(inflateStateCheck(_))return Z_STREAM_ERROR$1;const q=_.state;return _.total_in=_.total_out=q.total=0,_.msg="",q.wrap&&(_.adler=q.wrap&1),q.mode=HEAD,q.last=0,q.havedict=0,q.flags=-1,q.dmax=32768,q.head=null,q.hold=0,q.bits=0,q.lencode=q.lendyn=new Int32Array(ENOUGH_LENS),q.distcode=q.distdyn=new Int32Array(ENOUGH_DISTS),q.sane=1,q.back=-1,Z_OK$1},inflateReset=_=>{if(inflateStateCheck(_))return Z_STREAM_ERROR$1;const q=_.state;return q.wsize=0,q.whave=0,q.wnext=0,inflateResetKeep(_)},inflateReset2=(_,q)=>{let k;if(inflateStateCheck(_))return Z_STREAM_ERROR$1;const D=_.state;return q<0?(k=0,q=-q):(k=(q>>4)+5,q<48&&(q&=15)),q&&(q<8||q>15)?Z_STREAM_ERROR$1:(D.window!==null&&D.wbits!==q&&(D.window=null),D.wrap=k,D.wbits=q,inflateReset(_))},inflateInit2=(_,q)=>{if(!_)return Z_STREAM_ERROR$1;const k=new InflateState;_.state=k,k.strm=_,k.window=null,k.mode=HEAD;const D=inflateReset2(_,q);return D!==Z_OK$1&&(_.state=null),D},inflateInit=_=>inflateInit2(_,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=_=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let q=0;for(;q<144;)_.lens[q++]=8;for(;q<256;)_.lens[q++]=9;for(;q<280;)_.lens[q++]=7;for(;q<288;)_.lens[q++]=8;for(inftrees(LENS,_.lens,0,288,lenfix,0,_.work,{bits:9}),q=0;q<32;)_.lens[q++]=5;inftrees(DISTS,_.lens,0,32,distfix,0,_.work,{bits:5}),virgin=!1}_.lencode=lenfix,_.lenbits=9,_.distcode=distfix,_.distbits=5},updatewindow=(_,q,k,D)=>{let $;const I=_.state;return I.window===null&&(I.wsize=1<<I.wbits,I.wnext=0,I.whave=0,I.window=new Uint8Array(I.wsize)),D>=I.wsize?(I.window.set(q.subarray(k-I.wsize,k),0),I.wnext=0,I.whave=I.wsize):($=I.wsize-I.wnext,$>D&&($=D),I.window.set(q.subarray(k-D,k-D+$),I.wnext),D-=$,D?(I.window.set(q.subarray(k-D,k),0),I.wnext=D,I.whave=I.wsize):(I.wnext+=$,I.wnext===I.wsize&&(I.wnext=0),I.whave<I.wsize&&(I.whave+=$))),0},inflate$2=(_,q)=>{let k,D,$,I,e,u,N,A,U,L,P,Z,F,W,J=0,z,V,X,Y,et,ft,tt,st;const rt=new Uint8Array(4);let nt,ot;const St=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(_)||!_.output||!_.input&&_.avail_in!==0)return Z_STREAM_ERROR$1;k=_.state,k.mode===TYPE&&(k.mode=TYPEDO),e=_.next_out,$=_.output,N=_.avail_out,I=_.next_in,D=_.input,u=_.avail_in,A=k.hold,U=k.bits,L=u,P=N,st=Z_OK$1;t:for(;;)switch(k.mode){case HEAD:if(k.wrap===0){k.mode=TYPEDO;break}for(;U<16;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(k.wrap&2&&A===35615){k.wbits===0&&(k.wbits=15),k.check=0,rt[0]=A&255,rt[1]=A>>>8&255,k.check=crc32_1(k.check,rt,2,0),A=0,U=0,k.mode=FLAGS;break}if(k.head&&(k.head.done=!1),!(k.wrap&1)||(((A&255)<<8)+(A>>8))%31){_.msg="incorrect header check",k.mode=BAD;break}if((A&15)!==Z_DEFLATED){_.msg="unknown compression method",k.mode=BAD;break}if(A>>>=4,U-=4,tt=(A&15)+8,k.wbits===0&&(k.wbits=tt),tt>15||tt>k.wbits){_.msg="invalid window size",k.mode=BAD;break}k.dmax=1<<k.wbits,k.flags=0,_.adler=k.check=1,k.mode=A&512?DICTID:TYPE,A=0,U=0;break;case FLAGS:for(;U<16;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(k.flags=A,(k.flags&255)!==Z_DEFLATED){_.msg="unknown compression method",k.mode=BAD;break}if(k.flags&57344){_.msg="unknown header flags set",k.mode=BAD;break}k.head&&(k.head.text=A>>8&1),k.flags&512&&k.wrap&4&&(rt[0]=A&255,rt[1]=A>>>8&255,k.check=crc32_1(k.check,rt,2,0)),A=0,U=0,k.mode=TIME;case TIME:for(;U<32;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}k.head&&(k.head.time=A),k.flags&512&&k.wrap&4&&(rt[0]=A&255,rt[1]=A>>>8&255,rt[2]=A>>>16&255,rt[3]=A>>>24&255,k.check=crc32_1(k.check,rt,4,0)),A=0,U=0,k.mode=OS;case OS:for(;U<16;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}k.head&&(k.head.xflags=A&255,k.head.os=A>>8),k.flags&512&&k.wrap&4&&(rt[0]=A&255,rt[1]=A>>>8&255,k.check=crc32_1(k.check,rt,2,0)),A=0,U=0,k.mode=EXLEN;case EXLEN:if(k.flags&1024){for(;U<16;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}k.length=A,k.head&&(k.head.extra_len=A),k.flags&512&&k.wrap&4&&(rt[0]=A&255,rt[1]=A>>>8&255,k.check=crc32_1(k.check,rt,2,0)),A=0,U=0}else k.head&&(k.head.extra=null);k.mode=EXTRA;case EXTRA:if(k.flags&1024&&(Z=k.length,Z>u&&(Z=u),Z&&(k.head&&(tt=k.head.extra_len-k.length,k.head.extra||(k.head.extra=new Uint8Array(k.head.extra_len)),k.head.extra.set(D.subarray(I,I+Z),tt)),k.flags&512&&k.wrap&4&&(k.check=crc32_1(k.check,D,Z,I)),u-=Z,I+=Z,k.length-=Z),k.length))break t;k.length=0,k.mode=NAME;case NAME:if(k.flags&2048){if(u===0)break t;Z=0;do tt=D[I+Z++],k.head&&tt&&k.length<65536&&(k.head.name+=String.fromCharCode(tt));while(tt&&Z<u);if(k.flags&512&&k.wrap&4&&(k.check=crc32_1(k.check,D,Z,I)),u-=Z,I+=Z,tt)break t}else k.head&&(k.head.name=null);k.length=0,k.mode=COMMENT;case COMMENT:if(k.flags&4096){if(u===0)break t;Z=0;do tt=D[I+Z++],k.head&&tt&&k.length<65536&&(k.head.comment+=String.fromCharCode(tt));while(tt&&Z<u);if(k.flags&512&&k.wrap&4&&(k.check=crc32_1(k.check,D,Z,I)),u-=Z,I+=Z,tt)break t}else k.head&&(k.head.comment=null);k.mode=HCRC;case HCRC:if(k.flags&512){for(;U<16;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(k.wrap&4&&A!==(k.check&65535)){_.msg="header crc mismatch",k.mode=BAD;break}A=0,U=0}k.head&&(k.head.hcrc=k.flags>>9&1,k.head.done=!0),_.adler=k.check=0,k.mode=TYPE;break;case DICTID:for(;U<32;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}_.adler=k.check=zswap32(A),A=0,U=0,k.mode=DICT;case DICT:if(k.havedict===0)return _.next_out=e,_.avail_out=N,_.next_in=I,_.avail_in=u,k.hold=A,k.bits=U,Z_NEED_DICT$1;_.adler=k.check=1,k.mode=TYPE;case TYPE:if(q===Z_BLOCK||q===Z_TREES)break t;case TYPEDO:if(k.last){A>>>=U&7,U-=U&7,k.mode=CHECK;break}for(;U<3;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}switch(k.last=A&1,A>>>=1,U-=1,A&3){case 0:k.mode=STORED;break;case 1:if(fixedtables(k),k.mode=LEN_,q===Z_TREES){A>>>=2,U-=2;break t}break;case 2:k.mode=TABLE;break;case 3:_.msg="invalid block type",k.mode=BAD}A>>>=2,U-=2;break;case STORED:for(A>>>=U&7,U-=U&7;U<32;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if((A&65535)!==(A>>>16^65535)){_.msg="invalid stored block lengths",k.mode=BAD;break}if(k.length=A&65535,A=0,U=0,k.mode=COPY_,q===Z_TREES)break t;case COPY_:k.mode=COPY;case COPY:if(Z=k.length,Z){if(Z>u&&(Z=u),Z>N&&(Z=N),Z===0)break t;$.set(D.subarray(I,I+Z),e),u-=Z,I+=Z,N-=Z,e+=Z,k.length-=Z;break}k.mode=TYPE;break;case TABLE:for(;U<14;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(k.nlen=(A&31)+257,A>>>=5,U-=5,k.ndist=(A&31)+1,A>>>=5,U-=5,k.ncode=(A&15)+4,A>>>=4,U-=4,k.nlen>286||k.ndist>30){_.msg="too many length or distance symbols",k.mode=BAD;break}k.have=0,k.mode=LENLENS;case LENLENS:for(;k.have<k.ncode;){for(;U<3;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}k.lens[St[k.have++]]=A&7,A>>>=3,U-=3}for(;k.have<19;)k.lens[St[k.have++]]=0;if(k.lencode=k.lendyn,k.lenbits=7,nt={bits:k.lenbits},st=inftrees(CODES,k.lens,0,19,k.lencode,0,k.work,nt),k.lenbits=nt.bits,st){_.msg="invalid code lengths set",k.mode=BAD;break}k.have=0,k.mode=CODELENS;case CODELENS:for(;k.have<k.nlen+k.ndist;){for(;J=k.lencode[A&(1<<k.lenbits)-1],z=J>>>24,V=J>>>16&255,X=J&65535,!(z<=U);){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(X<16)A>>>=z,U-=z,k.lens[k.have++]=X;else{if(X===16){for(ot=z+2;U<ot;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(A>>>=z,U-=z,k.have===0){_.msg="invalid bit length repeat",k.mode=BAD;break}tt=k.lens[k.have-1],Z=3+(A&3),A>>>=2,U-=2}else if(X===17){for(ot=z+3;U<ot;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}A>>>=z,U-=z,tt=0,Z=3+(A&7),A>>>=3,U-=3}else{for(ot=z+7;U<ot;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}A>>>=z,U-=z,tt=0,Z=11+(A&127),A>>>=7,U-=7}if(k.have+Z>k.nlen+k.ndist){_.msg="invalid bit length repeat",k.mode=BAD;break}for(;Z--;)k.lens[k.have++]=tt}}if(k.mode===BAD)break;if(k.lens[256]===0){_.msg="invalid code -- missing end-of-block",k.mode=BAD;break}if(k.lenbits=9,nt={bits:k.lenbits},st=inftrees(LENS,k.lens,0,k.nlen,k.lencode,0,k.work,nt),k.lenbits=nt.bits,st){_.msg="invalid literal/lengths set",k.mode=BAD;break}if(k.distbits=6,k.distcode=k.distdyn,nt={bits:k.distbits},st=inftrees(DISTS,k.lens,k.nlen,k.ndist,k.distcode,0,k.work,nt),k.distbits=nt.bits,st){_.msg="invalid distances set",k.mode=BAD;break}if(k.mode=LEN_,q===Z_TREES)break t;case LEN_:k.mode=LEN;case LEN:if(u>=6&&N>=258){_.next_out=e,_.avail_out=N,_.next_in=I,_.avail_in=u,k.hold=A,k.bits=U,inffast(_,P),e=_.next_out,$=_.output,N=_.avail_out,I=_.next_in,D=_.input,u=_.avail_in,A=k.hold,U=k.bits,k.mode===TYPE&&(k.back=-1);break}for(k.back=0;J=k.lencode[A&(1<<k.lenbits)-1],z=J>>>24,V=J>>>16&255,X=J&65535,!(z<=U);){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(V&&(V&240)===0){for(Y=z,et=V,ft=X;J=k.lencode[ft+((A&(1<<Y+et)-1)>>Y)],z=J>>>24,V=J>>>16&255,X=J&65535,!(Y+z<=U);){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}A>>>=Y,U-=Y,k.back+=Y}if(A>>>=z,U-=z,k.back+=z,k.length=X,V===0){k.mode=LIT;break}if(V&32){k.back=-1,k.mode=TYPE;break}if(V&64){_.msg="invalid literal/length code",k.mode=BAD;break}k.extra=V&15,k.mode=LENEXT;case LENEXT:if(k.extra){for(ot=k.extra;U<ot;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}k.length+=A&(1<<k.extra)-1,A>>>=k.extra,U-=k.extra,k.back+=k.extra}k.was=k.length,k.mode=DIST;case DIST:for(;J=k.distcode[A&(1<<k.distbits)-1],z=J>>>24,V=J>>>16&255,X=J&65535,!(z<=U);){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if((V&240)===0){for(Y=z,et=V,ft=X;J=k.distcode[ft+((A&(1<<Y+et)-1)>>Y)],z=J>>>24,V=J>>>16&255,X=J&65535,!(Y+z<=U);){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}A>>>=Y,U-=Y,k.back+=Y}if(A>>>=z,U-=z,k.back+=z,V&64){_.msg="invalid distance code",k.mode=BAD;break}k.offset=X,k.extra=V&15,k.mode=DISTEXT;case DISTEXT:if(k.extra){for(ot=k.extra;U<ot;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}k.offset+=A&(1<<k.extra)-1,A>>>=k.extra,U-=k.extra,k.back+=k.extra}if(k.offset>k.dmax){_.msg="invalid distance too far back",k.mode=BAD;break}k.mode=MATCH;case MATCH:if(N===0)break t;if(Z=P-N,k.offset>Z){if(Z=k.offset-Z,Z>k.whave&&k.sane){_.msg="invalid distance too far back",k.mode=BAD;break}Z>k.wnext?(Z-=k.wnext,F=k.wsize-Z):F=k.wnext-Z,Z>k.length&&(Z=k.length),W=k.window}else W=$,F=e-k.offset,Z=k.length;Z>N&&(Z=N),N-=Z,k.length-=Z;do $[e++]=W[F++];while(--Z);k.length===0&&(k.mode=LEN);break;case LIT:if(N===0)break t;$[e++]=k.length,N--,k.mode=LEN;break;case CHECK:if(k.wrap){for(;U<32;){if(u===0)break t;u--,A|=D[I++]<<U,U+=8}if(P-=N,_.total_out+=P,k.total+=P,k.wrap&4&&P&&(_.adler=k.check=k.flags?crc32_1(k.check,$,P,e-P):adler32_1(k.check,$,P,e-P)),P=N,k.wrap&4&&(k.flags?A:zswap32(A))!==k.check){_.msg="incorrect data check",k.mode=BAD;break}A=0,U=0}k.mode=LENGTH;case LENGTH:if(k.wrap&&k.flags){for(;U<32;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(k.wrap&4&&A!==(k.total&4294967295)){_.msg="incorrect length check",k.mode=BAD;break}A=0,U=0}k.mode=DONE;case DONE:st=Z_STREAM_END$1;break t;case BAD:st=Z_DATA_ERROR$1;break t;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return _.next_out=e,_.avail_out=N,_.next_in=I,_.avail_in=u,k.hold=A,k.bits=U,(k.wsize||P!==_.avail_out&&k.mode<BAD&&(k.mode<CHECK||q!==Z_FINISH$1))&&updatewindow(_,_.output,_.next_out,P-_.avail_out),L-=_.avail_in,P-=_.avail_out,_.total_in+=L,_.total_out+=P,k.total+=P,k.wrap&4&&P&&(_.adler=k.check=k.flags?crc32_1(k.check,$,P,_.next_out-P):adler32_1(k.check,$,P,_.next_out-P)),_.data_type=k.bits+(k.last?64:0)+(k.mode===TYPE?128:0)+(k.mode===LEN_||k.mode===COPY_?256:0),(L===0&&P===0||q===Z_FINISH$1)&&st===Z_OK$1&&(st=Z_BUF_ERROR),st},inflateEnd=_=>{if(inflateStateCheck(_))return Z_STREAM_ERROR$1;let q=_.state;return q.window&&(q.window=null),_.state=null,Z_OK$1},inflateGetHeader=(_,q)=>{if(inflateStateCheck(_))return Z_STREAM_ERROR$1;const k=_.state;return(k.wrap&2)===0?Z_STREAM_ERROR$1:(k.head=q,q.done=!1,Z_OK$1)},inflateSetDictionary=(_,q)=>{const k=q.length;let D,$,I;return inflateStateCheck(_)||(D=_.state,D.wrap!==0&&D.mode!==DICT)?Z_STREAM_ERROR$1:D.mode===DICT&&($=1,$=adler32_1($,q,k,0),$!==D.check)?Z_DATA_ERROR$1:(I=updatewindow(_,q,k,k),I?(D.mode=MEM,Z_MEM_ERROR$1):(D.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(_){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},_||{});const q=this.options;q.raw&&q.windowBits>=0&&q.windowBits<16&&(q.windowBits=-q.windowBits,q.windowBits===0&&(q.windowBits=-15)),q.windowBits>=0&&q.windowBits<16&&!(_&&_.windowBits)&&(q.windowBits+=32),q.windowBits>15&&q.windowBits<48&&(q.windowBits&15)===0&&(q.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let k=inflate_1$2.inflateInit2(this.strm,q.windowBits);if(k!==Z_OK)throw new Error(messages[k]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),q.dictionary&&(typeof q.dictionary=="string"?q.dictionary=strings.string2buf(q.dictionary):toString.call(q.dictionary)==="[object ArrayBuffer]"&&(q.dictionary=new Uint8Array(q.dictionary)),q.raw&&(k=inflate_1$2.inflateSetDictionary(this.strm,q.dictionary),k!==Z_OK)))throw new Error(messages[k])}Inflate$1.prototype.push=function(_,q){const k=this.strm,D=this.options.chunkSize,$=this.options.dictionary;let I,e,u;if(this.ended)return!1;for(q===~~q?e=q:e=q===!0?Z_FINISH:Z_NO_FLUSH,toString.call(_)==="[object ArrayBuffer]"?k.input=new Uint8Array(_):k.input=_,k.next_in=0,k.avail_in=k.input.length;;){for(k.avail_out===0&&(k.output=new Uint8Array(D),k.next_out=0,k.avail_out=D),I=inflate_1$2.inflate(k,e),I===Z_NEED_DICT&&$&&(I=inflate_1$2.inflateSetDictionary(k,$),I===Z_OK?I=inflate_1$2.inflate(k,e):I===Z_DATA_ERROR&&(I=Z_NEED_DICT));k.avail_in>0&&I===Z_STREAM_END&&k.state.wrap>0&&_[k.next_in]!==0;)inflate_1$2.inflateReset(k),I=inflate_1$2.inflate(k,e);switch(I){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(I),this.ended=!0,!1}if(u=k.avail_out,k.next_out&&(k.avail_out===0||I===Z_STREAM_END))if(this.options.to==="string"){let N=strings.utf8border(k.output,k.next_out),A=k.next_out-N,U=strings.buf2string(k.output,N);k.next_out=A,k.avail_out=D-A,A&&k.output.set(k.output.subarray(N,N+A),0),this.onData(U)}else this.onData(k.output.length===k.next_out?k.output:k.output.subarray(0,k.next_out));if(!(I===Z_OK&&u===0)){if(I===Z_STREAM_END)return I=inflate_1$2.inflateEnd(this.strm),this.onEnd(I),this.ended=!0,!0;if(k.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(_){this.chunks.push(_)},Inflate$1.prototype.onEnd=function(_){_===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=_,this.msg=this.strm.msg};function inflate$1(_,q){const k=new Inflate$1(q);if(k.push(_),k.err)throw k.msg||messages[k.err];return k.result}function inflateRaw$1(_,q){return q=q||{},q.raw=!0,inflate$1(_,q)}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};const noLogEvents=["heartbeat","onNetQuality","networkQualityChange"],compressArrayBuffer=_=>{const q=new Uint8Array(_),k=pako.deflate(q,{gzip:!0});return new Uint8Array(k==null?void 0:k.buffer)},decompressArrayBuffer=_=>{const q=new Uint8Array(_),k=pako.inflate(q,{gzip:!0});return new Uint8Array(k==null?void 0:k.buffer)},sendMessageFormat=_=>{const{event:q}=_;switch(_.data_original=_.data,_.time&&(_.timeStr=E(_.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),q){case"login":_.data=com.quick.voice.proto.Login.encode(_.data).finish();break;case"joinRoom":case"joinRoomEx":_.data=com.quick.voice.proto.JoinReq.encode(_.data).finish();break;case"quitRoom":_.data=com.quick.voice.proto.QuitReq.encode(_.data).finish();break;case"connectCF":_.data=com.quick.voice.proto.ConnectCFReq.encode(_.data).finish(),_.data=compressArrayBuffer(_.data),_.compress=!0;break;case"publish":_.data=com.quick.voice.proto.PublishReq.encode(_.data).finish(),_.data=compressArrayBuffer(_.data),_.compress=!0;break;case"subscribe":_.data=com.quick.voice.proto.SubscribeReq.encode(_.data).finish();break;case"closeTrack":_.data=com.quick.voice.proto.CloseTrackReq.encode(_.data).finish(),_.data=compressArrayBuffer(_.data),_.compress=!0;break;case"renegotiate":_.data=com.quick.voice.proto.RenegotiateReq.encode(_.data).finish(),_.data=compressArrayBuffer(_.data),_.compress=!0;break;case"syncRoomInfo":_.data=com.quick.voice.proto.SyncRoomInfoReq.encode(_.data).finish();break;case"updateCall":_.data=com.quick.voice.proto.UpdateCall.encode(_.data).finish();break;case"networkQualityChange":_.data=com.quick.voice.proto.NetQualityChange.encode(_.data).finish();break;case"pubNotify":_.data=com.quick.voice.proto.PublishNotify.encode(_.data).finish();break;default:_.data=new Uint8Array;break}return _},onMessageFormat=_=>{const{event:q,compress:k=!1}=_;if(_.data_remote=_.data,_.time&&(_.timeStr=E(_.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),k)try{_.data=decompressArrayBuffer(_.data)}catch(D){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",D)}switch(q){case"login":_.data=com.quick.voice.proto.Login.decode(_.data);break;case"joinRoom":case"joinRoomEx":_.data=com.quick.voice.proto.JoinRsp.decode(_.data);break;case"onJoinRoom":_.data=com.quick.voice.proto.JoinNotify.decode(_.data);break;case"onQuitRoom":_.data=com.quick.voice.proto.QuitNotify.decode(_.data);break;case"connectCF":_.data=com.quick.voice.proto.ConnectCFRsp.decode(_.data);break;case"publish":_.data=com.quick.voice.proto.PublishRsp.decode(_.data);break;case"onPublish":_.data=com.quick.voice.proto.PublishNotify.decode(_.data);break;case"subscribe":_.data=com.quick.voice.proto.SubscribeRsp.decode(_.data);break;case"closeTrack":_.data=com.quick.voice.proto.CloseTrackRsp.decode(_.data);break;case"onCloseTrack":_.data=com.quick.voice.proto.CloseTrackNotify.decode(_.data);break;case"onUpdateCall":_.data=com.quick.voice.proto.UpdateCall.decode(_.data);break;case"onDestroyRoom":_.data=com.quick.voice.proto.QuitNotify.decode(_.data);break;case"onUpdatePermissions":_.data=com.quick.voice.proto.UpdatePermissions.decode(_.data);break;case"onNetQuality":_.data=com.quick.voice.proto.NetQualityNotify.decode(_.data);break;case"syncRoomInfo":_.data=com.quick.voice.proto.SyncRoomInfoRsp.decode(_.data);break;case"onCDNPlayUrlAdd":_.data=com.quick.voice.proto.CDNPlayAddressNotify.decode(_.data);break;case"debugger":_.data=JSON.parse(new TextDecoder().decode(_.data));break}return _};class CallsWebSocket{constructor(q){lt(this,at);lt(this,ct,{url:"wss://demo.putplay.cc/websocket",debug:!1,reconnectCount:10,timeout:30*1e3});lt(this,dt,"");lt(this,ht,{});lt(this,yt,{});H(this,"state","closed");H(this,"sendMessageBefore",async()=>{});H(this,"onReconnectSuccess",q=>{});H(this,"onReconnectStop",q=>{});lt(this,It,q=>{let k=!0;const{code:D=1e3,reason:$=""}=q;return D===1e3&&($==="quit success!"||$==="replace old connection!")&&(k=!1),k});lt(this,Rt,async q=>{G(this,ct).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连成功",q),this.state="connected",this.onReconnectSuccess(q)});lt(this,Et,async q=>{G(this,ct).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连停止",q),this.close(),this.state="closed",this.onReconnectStop(q)});lt(this,xt,()=>{const q={event:"heartbeat",sn:+`${O(1e5,999999)}`};return com.quick.voice.proto.CommonReq.encode(q).finish()});lt(this,$t,(q,k={})=>{try{const{time:D,event:$,data:I={},data_original:e={},data_remote:u,...N}=k,A=E(D,"YYYY-MM-DD hh:mm:ss",{offset:480});let U={};const L=(V={})=>{const X=JSON.parse(JSON.stringify(V)),Y=Object.keys(X);for(const et of Y)(et.includes("sdp")||et.includes("Sdp"))&&(X[et]="");return X};let P="res ↓";switch(q){case"res":P="res ↓",U=L(I);break;case"req":P="req ↑",U=L(e);break}let Z="#quickvo.logs";ignoreEvent.includes($)&&(Z="#quickvo.ignoreEvents");const F={"#action":P,timeStr:A,event:$,data:U,time:D,...N},W=localStorage.getItem(Z)||JSON.stringify([]),J=JSON.parse(W),z=[F,...J].slice(0,500);localStorage.setItem(Z,JSON.stringify(z))}catch(D){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",D)}});lt(this,Nt,(q,{resolve:k,reject:D})=>{const{sn:$}=q,I=()=>{const u=G(this,ht)[$];clearTimeout(u.destructionTimer),delete G(this,ht)[$]},e=setTimeout(()=>{const u=G(this,ht)[$];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:event is timeout",u.message),I(),D("event is timeout")},G(this,ct).timeout);G(this,ht)[$]={message:q,resolve:k,reject:D,destruction:I,destructionTimer:e}});lt(this,At,q=>G(this,ht)[q]);lt(this,qt,async q=>{const k=new Uint8Array(q),D=com.quick.voice.proto.CommonRsp.decode(k),{sn:$,event:I}=D,e=onMessageFormat(D);if(G(this,ct).debug&&(noLogEvents.includes(I)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",e),ignoreEvent.includes(I)||G(this,$t).call(this,"res",e)),notifyName_keys.includes(I))return this.emitNotify(I,v$1(e,["code","data","desc"]));const N=G(this,At).call(this,$);if(N){const{resolve:A=L=>{},destruction:U=()=>{}}=N;A(v$1(e,["code","data","desc"])),U()}});H(this,"clearEvents",(q=[])=>{const k=Object.keys(G(this,ht));q.length===0&&(q=k);for(const D of k){if(!q.includes(D))continue;const $=G(this,ht)[D];clearTimeout($.destructionTimer),delete G(this,ht)[D]}});H(this,"connect",async(q="")=>new Promise(async k=>{q&&vt(this,dt,q),G(this,at)&&(await G(this,at).close(),this.state="closed");const D=`${G(this,ct).url}?s=${G(this,dt)}&t=${Date.now()}`;vt(this,at,new M({...G(this,ct),url:D,binaryType:"arraybuffer",onMessage:G(this,qt),checkReconnect:G(this,It),getHeartbeatMsg:G(this,xt),onReconnectSuccess:G(this,Rt),onReconnectStop:G(this,Et)})),this.state="connecting",await G(this,at).connect(),this.state="connected",G(this,ct).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 当前广播事件",G(this,yt)),k(G(this,at))}));H(this,"close",async()=>{var k;G(this,ct).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.");const q=Object.keys(G(this,ht));for(const D of q){const{destructionTimer:$}=G(this,ht)[D];clearTimeout($)}vt(this,ht,{}),vt(this,yt,{}),await((k=G(this,at))==null?void 0:k.close()),vt(this,at,void 0),this.state="closed"});H(this,"sendMessage",(q,k=!0)=>new Promise(async(D,$)=>{var U;await this.sendMessageBefore();const{event:I,...e}=q,u=Date.now(),N=sendMessageFormat({event:I,sn:+`${u}${O(1e3,9999)}`,time:u,valid:G(this,ct).timeout,version:1,compress:!1,...e});G(this,ct).debug&&(noLogEvents.includes(I)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",N),ignoreEvent.includes(I)||G(this,$t).call(this,"req",N)),k&&G(this,Nt).call(this,N,{resolve:D,reject:$});const A=com.quick.voice.proto.CommonReq.encode(N).finish();(U=G(this,at))==null||U.sendMessage(A)}));H(this,"emitNotify",async(q,k)=>{const D=G(this,yt)[q]||[];for(const $ of D){const{callback:I=async()=>{}}=$;await I(k)}});H(this,"addNotify",(q,k=!1)=>{const{event:D,sn:$=pt(32)}=q;G(this,yt)[D]||(G(this,yt)[D]=[]);const I=G(this,yt)[D],e=I.findIndex(u=>u.sn===$);return e!==-1&&I.splice(e,1),k?I.unshift(q):I.push(q),$});H(this,"removeNotify",(q=[])=>{if(q.length===0)vt(this,yt,{});else{const k=Object.keys(G(this,yt));for(const D of k)G(this,yt)[D]=G(this,yt)[D].filter($=>!q.includes($.sn||""))}G(this,ct).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",G(this,yt))});vt(this,ct,{...G(this,ct),...q})}}at=new WeakMap,ct=new WeakMap,dt=new WeakMap,ht=new WeakMap,yt=new WeakMap,It=new WeakMap,Rt=new WeakMap,Et=new WeakMap,xt=new WeakMap,$t=new WeakMap,Nt=new WeakMap,At=new WeakMap,qt=new WeakMap;var p=Object.defineProperty,x=_=>{throw TypeError(_)},g=(_,q,k)=>q in _?p(_,q,{enumerable:!0,configurable:!0,writable:!0,value:k}):_[q]=k,h=(_,q,k)=>g(_,typeof q!="symbol"?q+"":q,k),y=(_,q,k)=>q.has(_)||x("Cannot "+k),n=(_,q,k)=>(y(_,q,"read from private field"),k?k.call(_):q.get(_)),a=(_,q,k)=>q.has(_)?x("Cannot add the same private member more than once"):q instanceof WeakSet?q.add(_):q.set(_,k),b=(_,q,k,D)=>(y(_,q,"write to private field"),q.set(_,k),k),d,o,f;class K{constructor(q){a(this,d,new Map),a(this,o,[]),h(this,"index"),h(this,"setCondition",(k,D)=>{n(this,d).set(k,D),D&&n(this,f).call(this)}),h(this,"addTask",(k,D,$={})=>{const I={key:"",strict:!1,describe:"",...$};let{key:e,strict:u,describe:N}=I;e?this.clear([e]):e=`${this.index++}`;{const A={key:e,func:k,conditionKeys:D,describe:N,strict:u};n(this,o).unshift(A)}return n(this,f).call(this),e}),h(this,"clear",(k=[])=>{if(k.length===0){b(this,o,[]);return}for(const D of k){const $=n(this,o).findIndex(I=>I.key===D);$!==-1&&n(this,o).splice($,1)}}),h(this,"getConditions",()=>Object.fromEntries(n(this,d))),h(this,"getTasks",()=>{const k=[];for(const D of n(this,o)){const{key:$,describe:I,conditionKeys:e}=D;k.push({key:$,describe:I,conditionKeys:e})}return k}),h(this,"checkConditions",k=>{let D=!0;for(const $ of k)if(n(this,d).get($)===!1){D=!1;break}return D}),a(this,f,()=>{const k=n(this,o).length;for(let D=k;D>0;D--){const $=D-1,I=n(this,o)[$],{conditionKeys:e,func:u,strict:N}=I,A=this.checkConditions(e);{if(!A)return;u()}{if(N)return;n(this,o).splice($,1)}}}),this.index=0;for(const k of q)n(this,d).set(k,!1)}}d=new WeakMap,o=new WeakMap,f=new WeakMap;class RoomBase{constructor(){H(this,"options",{appid:"",sdkToken:"",roomId:"",userId:"",callType:0,debug:!1,newPublishAutoSubscribe:!0});H(this,"prohibitNotify",!1);H(this,"isEarly",!1);H(this,"taskQueue",new K(["createWs","createSession","ice","createTrack","subscribe","closeTrack","publish"]));H(this,"roomState","ready");H(this,"createAt",Date.now());H(this,"cwsIns",new CallsWebSocket);H(this,"peerIns",new RTCPeerConnection({bundlePolicy:"max-bundle"}));H(this,"transceiverMap",new Map);H(this,"userMap",new Map);H(this,"mediaDevicesErrInfo",{microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""});H(this,"initAsyncQueue",()=>{this.taskQueue.clear(),this.taskQueue.setCondition("createTrack",!0),this.taskQueue.setCondition("closeTrack",!0),this.taskQueue.setCondition("subscribe",!0),this.taskQueue.setCondition("publish",!0)});H(this,"getRoomInfo",()=>{const{options:q,roomState:k,createAt:D}=this;return{...q,roomState:k,createAt:D}});H(this,"setRoomState",q=>{this.roomState=q;const k=enum_roomState[q],D={state:q,stateStr:k};this.cwsIns.emitNotify("onRoomState",{code:200,data:D,desc:"room state is change."})});H(this,"setOptions",async q=>{const k={...this.options,...q};this.options=k});H(this,"initCwsCall",()=>{this.cwsIns=new CallsWebSocket({...this.options})});H(this,"getMediaDevicesErrInfo",async()=>{try{const q=await navigator.mediaDevices.enumerateDevices();q.find(D=>D.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),q.find(D=>D.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(q){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe:error",q)}return this.mediaDevicesErrInfo});H(this,"getUserMediaKey",(q,k)=>`${q}-${k}`);H(this,"getCallActionMap",(q=0)=>{const D=Number(q).toString(2).padStart(4,"0").split(""),[$,I,e,u]=D;return{microphoneCamera_audio:!!Number(u),microphoneCamera_video:!!Number(e),screenSharing_video:!!Number(I),screenSharing_audio:!!Number($)}});H(this,"getAverageVolume",(q,k)=>{q.getByteFrequencyData(k);let D=0;for(let I=0;I<k.length;I++)D+=k[I];return Math.ceil(D/k.length)});H(this,"getCallAction",async q=>{let k="";const D=I=>q.findIndex(({type:u,enabled:N=!0})=>u===I&&N)===-1?"0":"1";return k=`${D(0)}${k}`,k=`${D(1)}${k}`,k=`${D(2)}${k}`,k=`${D(3)}${k}`,parseInt(k,2)});H(this,"getTrackNamesFormTracks",(q,k=[],D="trackName")=>{const $=[];for(const I of q){const{type:e}=I;if(k.length===0||k.includes(e)){const u=I[D];u&&$.push(`${u}`)}}return $});H(this,"usersFilter",q=>mt(q,["id","isSelf","joinTime","tracks","callAction","callActionStr","callActionMap","network","updateStreams","permissions","isPublished"]).sort(($,I)=>$.id.localeCompare(I.id,"en")));this.initAsyncQueue()}}const createMutedAudioStream=()=>{const _=new AudioContext,q=_.createOscillator();q.type="sine",q.frequency.setValueAtTime(0,_.currentTime);const k=_.createGain();k.gain.value=0,q.connect(k),k.connect(_.destination),q.start();const D=_.createMediaStreamDestination();return k.disconnect(),q.connect(D),D.stream},createFakeVideoStream=(_=10,q=10,k=30)=>{const D=document.createElement("canvas"),$=D.getContext("2d");D.width=_,D.height=q;let I=0;return setInterval(()=>{$.clearRect(0,0,D.width,D.height);const N=$.createLinearGradient(0,0,D.width,D.height);N.addColorStop(0,`hsla(${I}, 100%, 50%, 0)`),N.addColorStop(1,`hsla(${I+120}, 100%, 50%, 0)`),$.fillStyle=N,$.fillRect(0,0,D.width,D.height),I=(I+1)%360},100),D.captureStream(k)},phoneyStreams={microphoneCamera_audio:createMutedAudioStream(),microphoneCamera_video:createFakeVideoStream(),screenSharing_video:createFakeVideoStream(),screenSharing_audio:createMutedAudioStream()};class RoomMedias extends RoomBase{constructor(){super();H(this,"mediaDevices",[]);lt(this,kt,new Map);lt(this,bt,new Map);lt(this,_t,new Map);lt(this,Tt,new Map);lt(this,Dt,()=>{for(const k of mediaType_keys)G(this,Tt).set(k,phoneyStreams[k])});H(this,"getPhoneyStreams",k=>G(this,Tt).get(k));lt(this,Ct,()=>{G(this,bt).set("microphoneCamera_audio",{}),G(this,bt).set("microphoneCamera_video",{width:{ideal:1920},height:{ideal:1080},frameRate:{min:10,ideal:30}}),G(this,bt).set("screenSharing_video",{width:{ideal:1920},height:{ideal:1080},frameRate:{min:10,ideal:30}}),G(this,bt).set("screenSharing_audio",{})});lt(this,Ut,()=>{G(this,kt).set("audioinput","default"),G(this,kt).set("videoinput","default"),G(this,kt).set("audiooutput","default")});H(this,"emitNotifyUpdateUsersStreams",async k=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:k,desc:"users streams is change."})});H(this,"initUserMediaStreamContext",async(k,D,$)=>{var N;const[I]=$.getTracks();if(!I){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: tracks.length is 0.",{userId:k,mediaType:D,stream:$});return}this.removeUserMediaStreamContext(k,D);const e=this.getUserMediaKey(k,D),{kind:u}=I;switch(u){case"audio":{const A=new AudioMediaContext(I);G(this,_t).set(e,A)}break;case"video":{const A=new VideoMediaContext(I);G(this,_t).set(e,A)}break}{const A=this.getUserMediaStreamContext(k,D);if(A&&A.kind==="audio")try{const U=G(this,kt).get("audiooutput");(N=A.audioContext)==null||N.setSinkId(U)}catch(U){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error",U)}}});H(this,"getUserMediaStreamContext",(k,D)=>{const $=this.getUserMediaKey(k,D);return G(this,_t).get($)});H(this,"getUserAudioMediaStreamContext",(k,D)=>{const $=this.getUserMediaKey(k,D);return G(this,_t).get($)});H(this,"removeUserMediaStreamContext",(k,D)=>{const $=this.getUserMediaKey(k,D),I=G(this,_t).get($);I==null||I.stop(),G(this,_t).delete($)});H(this,"getUserStream",(k,D)=>{const $=this.getUserMediaStreamContext(k,D);return($==null?void 0:$.getStream())||new MediaStream});H(this,"getUserStreams",(k,D=[])=>{D.length===0&&(D=mediaType_keys);const $={};for(const I of D){const e=this.getUserStream(k,I);$[I]=e}return $});H(this,"removeUserStreams",async(k,D=[])=>{D.length===0&&(D=mediaType_keys);for(const $ of D)this.removeUserMediaStreamContext(k,$)});H(this,"clearUserStreams",()=>{const k=G(this,_t).values();for(const D of k)D.stop();vt(this,_t,new Map)});H(this,"setMediaTrackConstraints",async(k,D)=>{G(this,bt).set(k,D);const I=this.getUserStream(this.options.userId,k).getTracks();if(I.length!==0)for(const e of I){const N={...e.getConstraints(),...D};await e.applyConstraints(N)}});H(this,"initLocalStream",async k=>{const{userId:D}=this.options,$=G(this,bt).get(k);switch(k){case"microphoneCamera_audio":{const I=G(this,kt).get("audioinput"),e=await navigator.mediaDevices.getUserMedia({audio:{deviceId:I,...$},video:!1});await this.initUserMediaStreamContext(D,"microphoneCamera_audio",e)}break;case"microphoneCamera_video":{const I=G(this,kt).get("videoinput"),e=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:I,...$}});await this.initUserMediaStreamContext(D,"microphoneCamera_video",e)}break;case"screenSharing_audio":{const I=await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...$}),e=I.getTracks();for(const u of e){const{kind:N}=u,A=new MediaStream;A.addTrack(u),I.removeTrack(u),N==="audio"&&await this.initUserMediaStreamContext(D,"screenSharing_audio",A),N==="video"&&await this.initUserMediaStreamContext(D,"screenSharing_video",A)}}break;case"screenSharing_video":{const I=await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...$});await this.initUserMediaStreamContext(D,"screenSharing_video",I)}break}this.emitNotifyUpdateUsersStreams([{userId:D,updateStreams:{[k]:!0}}])});lt(this,Ot,async()=>!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices?(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 不支持 enumerateDevices"),[]):(await navigator.mediaDevices.enumerateDevices().then(k=>{this.mediaDevices=k}).catch(function(k){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",k)}),this.mediaDevices));lt(this,Mt,()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await G(this,Ot).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),G(this,Ot).call(this)});H(this,"getMediaDeviceKind",k=>G(this,kt).get(k));H(this,"replaceSenderStream",async(k=[],D)=>{const{userId:$}=this.options;k.length===0&&(k=mediaType_keys);for(const I of k){const e=this.transceiverMap.get(I);let u;if(e){const{sender:N}=e;D?u=this.getUserStream($,I):u=this.getPhoneyStreams(I);const[A]=u.getTracks();N.replaceTrack(A)}}});H(this,"setMediaDeviceKind",async(k,D)=>{G(this,kt).set(k,D);const{userId:$}=this.options;if(k==="audioinput"&&this.getUserMediaStreamContext($,"microphoneCamera_audio")&&(await this.initLocalStream("microphoneCamera_audio"),await this.replaceSenderStream(["microphoneCamera_audio"],!0)),k==="videoinput"&&this.getUserMediaStreamContext($,"microphoneCamera_video")&&(await this.initLocalStream("microphoneCamera_video"),await this.replaceSenderStream(["microphoneCamera_video"],!0)),k==="audiooutput"){const I=G(this,_t).values();for(const e of I)e.kind==="audio"&&"setSinkId"in HTMLMediaElement.prototype&&e.audioContext.setSinkId(D)}});H(this,"setAudioOutputDevice",k=>this.setMediaDeviceKind("audiooutput",k));H(this,"getEnumerateDevices",async k=>(await G(this,Ot).call(this),this.mediaDevices.filter($=>$.kind===k)));H(this,"getEnumerateAudioinputDevices",()=>this.getEnumerateDevices("audioinput"));H(this,"getEnumerateAudioOutputDevices",()=>this.getEnumerateDevices("audiooutput"));H(this,"getEnumerateVideoinputDevices",()=>this.getEnumerateDevices("videoinput"));G(this,Mt).call(this),G(this,Ut).call(this),G(this,Ct).call(this),G(this,Dt).call(this)}}kt=new WeakMap,bt=new WeakMap,_t=new WeakMap,Tt=new WeakMap,Dt=new WeakMap,Ct=new WeakMap,Ut=new WeakMap,Ot=new WeakMap,Mt=new WeakMap;class RoomUsers extends RoomMedias{constructor(){super();H(this,"getMaxVolumeUser",()=>{const k=Array.from(this.userMap.values(),({id:$})=>$);if(k.length===0)return;let D=[];for(const $ of k){const I=this.getUserMediaStreamContext($,"microphoneCamera_audio");if(!I||I.kind!=="audio")continue;const e=I.getVolume();D.push({id:$,volume:e})}return D=D.sort(($,I)=>$.volume-I.volume>0?-1:1),D[0]});H(this,"setAudioFilter",async(k={})=>{const D=await this.getUsersId();for(const $ of D){{const I=this.getUserMediaStreamContext($,"microphoneCamera_audio");(I==null?void 0:I.kind)==="audio"&&(I==null||I.setFilter(k))}{const I=this.getUserMediaStreamContext($,"screenSharing_audio");(I==null?void 0:I.kind)==="audio"&&(I==null||I.setFilter(k))}}});H(this,"setVolume",(k,D,$)=>{const I=this.getUserMediaStreamContext(k,D);(I==null?void 0:I.kind)==="audio"&&(I==null||I.setVolumeGain($))});H(this,"getVolume",(k,D)=>{const $=this.getUserMediaStreamContext(k,D);let I=0;return($==null?void 0:$.kind)==="audio"&&(I=$==null?void 0:$.getVolume()),I});H(this,"clearUsers",()=>{this.userMap=new Map});H(this,"removeUsers",async k=>{for(const D of k)this.userMap.delete(D),await this.removeUserStreams(D)});H(this,"createUser",async k=>{const D=Date.now(),$={id:k,permissions:0,callAction:0,callActionStr:"",callActionMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},callState:0,isSelf:k===this.options.userId,isPublished:!1,joinTime:D,updateAt:D,network:{egress:0,ingress:0},tracks:[],updateStreams:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1}};this.userMap.set(k,$)});H(this,"getUser",async k=>(this.userMap.has(k)||await this.createUser(k),this.userMap.get(k)));H(this,"getUsers",async(k=[])=>{k.length===0&&(k=[...this.userMap.keys()]);const D=[];for(const $ of k){const I=await this.getUser($);D.push(I)}return D});H(this,"getAllUserTrackMids",async()=>{const k=await this.getUsers(),D=[];for(const $ of k){const{tracks:I=[]}=$;for(const e of I)D.push(e.mid)}return D});H(this,"getUserTrackByTrackName",async k=>{const D=await this.getUsers(),$=[];for(const I of D){const{tracks:e=[]}=I;for(const u of e){const{trackName:N}=u;k.includes(N)&&$.push(u)}}return $});H(this,"getUserTrackFromMid",async k=>{const D=await this.getUsers();let $;for(const I of D){const{tracks:e=[]}=I;for(const u of e)if(u.mid===k){$=u;break}}return $});H(this,"checkUserInRoom",k=>this.userMap.has(k));H(this,"getUsersId",async()=>[...this.userMap.keys()]);H(this,"getCaller",async()=>await this.getUser(this.options.userId));H(this,"updateIsPublished",async(k,D=!1)=>{const $=await this.getUser(k);$.isPublished=D});H(this,"setUserUpdateStreams",async(k,D,$=!0)=>{const I=await this.getUser(k),e={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};e[D]=$,I.updateStreams=e});H(this,"updateUsertracks",async(k,D=[],$)=>{const I=await this.getUser(k);$&&(D=[...I.tracks,...D]),D=D.filter(({mid:N=""})=>N!==""),D=it(D,["type"]),D=D.sort((N,A)=>N.type-A.type<0?-1:1);for(const N of D)N.userId=k,N.mediaType=mediaType_keys[N.type],N.enabled===void 0&&(N.enabled=!0);I.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const e=mt(I.tracks,["mediaType","enabled","mid","msid","trackName"]),u=mt(D,["mediaType","enabled","mid","msid","trackName"]);{const N="microphoneCamera_audio",A=u.find(P=>P.mediaType===N),U=e.find(P=>P.mediaType===N),L=JSON.stringify(A)!==JSON.stringify(U);I.updateStreams[N]=L}{const N="microphoneCamera_video",A=u.find(P=>P.mediaType===N),U=e.find(P=>P.mediaType===N),L=JSON.stringify(A)!==JSON.stringify(U);I.updateStreams[N]=L}{const N="screenSharing_audio",A=u.find(P=>P.mediaType===N),U=e.find(P=>P.mediaType===N),L=JSON.stringify(A)!==JSON.stringify(U);I.updateStreams[N]=L}{const N="screenSharing_video",A=u.find(P=>P.mediaType===N),U=e.find(P=>P.mediaType===N),L=JSON.stringify(A)!==JSON.stringify(U);I.updateStreams[N]=L}I.tracks=D});H(this,"updateUserCallAction",async(k,D=0)=>{const $=await this.getUser(k);$.callAction=D,$.callActionStr=D.toString(2).padStart(4,"0"),$.callActionMap=this.getCallActionMap(D)});H(this,"updateUserNetwork",async(k,D={egress:5,ingress:5})=>{const $=await this.getUser(k);$.network=D});H(this,"updateUserPermissions",async(k,D)=>{if(D){const $=await this.getUser(k);$.permissions=D}});H(this,"updateUserBase",async k=>{const D=await this.getUser(k);D.isSelf=k===this.options.userId,D.updateAt=Date.now()});H(this,"updateUsers",async k=>{for(const D of k){const{id:$,tracks:I,callAction:e,permissions:u,isPublished:N}=D;await this.updateUserBase($),await this.updateIsPublished($,N),await this.updateUserPermissions($,u),await this.updateUsertracks($,I,!0),await this.updateUserCallAction($,e),await this.updateUserNetwork($)}});H(this,"emitNotifyUpdateUser",async k=>{const D=await this.getUsers([k]),[$]=this.usersFilter(D);this.cwsIns.emitNotify("onRoomUser",{code:200,data:$,desc:"user info is change."})});H(this,"emitNotifyUpdateUsers",async()=>{const k=await this.getUsers(),D=this.usersFilter(k);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:D,desc:"all users info is change."})})}}class RoomPeer extends RoomUsers{constructor(){super();H(this,"getPeerStatsTimer",0);H(this,"reports",[]);H(this,"peerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});H(this,"connectedResolveMap",new Map);H(this,"initPeer",()=>{this.peerIns=new RTCPeerConnection({bundlePolicy:"max-bundle"}),this.transceiverMap=new Map,G(this,Pt).call(this),G(this,Lt).call(this)});H(this,"getSenderTracks",(k=[])=>{const D=[];for(const $ of k){const I=this.transceiverMap.get($);if(!I)continue;const{mid:e,sender:u}=I,{track:N}=u;if(!N)continue;const{id:A,enabled:U}=N,P={type:mediaType_keys.findIndex(Z=>Z===$),enabled:U,trackName:A,location:"local",mid:e};D.push(P)}return D});H(this,"addSenders",async(k=[])=>{k.length===0&&this.peerIns.addTransceiver("audio",{direction:"sendonly"});const D=[];for(const $ of k){if(this.transceiverMap.has($))continue;const I=this.getPhoneyStreams($),[e]=I.getTracks(),u=this.peerIns.addTransceiver(e,{direction:"sendonly"});this.transceiverMap.set($,u),D.push($)}if(k.length===0||D.length){const $=await this.peerIns.createOffer();if(this.options.debug){const I=libExports.parse($.sdp),e=mt(I.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->Breathe: setLocalDescription",{msidArr:e,sdpJson:I,description:$})}await this.peerIns.setLocalDescription($)}return D});H(this,"removeSenders",async(k=[])=>{for(const D of k)this.transceiverMap.has(D)&&this.transceiverMap.delete(D)});H(this,"clearTransceivers",async()=>{const k=await this.getAllUserTrackMids(),D=this.peerIns.getTransceivers();for(const $ of D){const{mid:I}=$;Number(I)===0||k.includes(I)||($.stop(),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->Breathe: clearTransceivers: ${I} is stop.`,$))}});H(this,"onSubscribeUserTracks",k=>{let D=0;return new Promise(async $=>{const I=[];for(const e of k){const{tracks:u=[]}=e;for(const N of u){const{trackName:A,mid:U}=N,[L]=await this.getUserTrackByTrackName([A]);I.push({...L,mid:U})}}{let e=[];const u=async()=>{clearTimeout(D);const A=new Map;for(const L of e){const{userId:P,mediaType:Z}=L;if(!P||!Z)continue;A.has(P)||A.set(P,{userId:P,tracks:[],updateStreams:{}});const W=A.get(P);W.tracks.push(L),W.updateStreams[Z]=!0}const U=[...A.values()];for(const L of U){const{userId:P,tracks:Z}=L;await this.updateUsertracks(P,Z,!0)}await this.emitNotifyUpdateUsersStreams(U),this.peerIns.removeEventListener("track",N),$(!0)},N=async A=>{const{streams:U,transceiver:L}=A,[P]=U,{mid:Z,receiver:F}=L,{track:W}=F,{id:J,kind:z}=W,V=I.find(et=>et.mid===`${Z}`);if(!V)return;const{userId:X,mediaType:Y}=V;if(!(!X||!Y)){if(await this.initUserMediaStreamContext(X,Y,P),z==="audio"){const et=this.getUserMediaStreamContext(X,Y);(et==null?void 0:et.kind)==="audio"&&et.setMute(!1)}{const et={...V,mid:Z,msid:J};e.push(et)}this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->Breathe: await subscribe ${e.length}/${I.length}`,{mediaType:Y,mid:Z,userTrack:V,e:A}),I.length===e.length&&u()}};this.peerIns.addEventListener("track",N),D=setTimeout(()=>u(),5*1e3)}})});lt(this,Pt,()=>{let k=0;const D=()=>{this.setRoomState("closed")};this.peerIns.onconnectionstatechange=()=>{const $=this.peerIns.connectionState;switch(clearTimeout(k),this.taskQueue.setCondition("ice",!1),$){case"connected":this.taskQueue.setCondition("ice",!0),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${$}`);break;case"disconnected":k=setTimeout(D,30*1e3),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${$}`);break;case"failed":this.peerIns.restartIce();break;case"closed":D(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${$}`);break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${$}`);break}}});H(this,"closeUserTracks",async(k,D=[],$=!1)=>{const I=[];for(const A of D){const{trackName:U,msid:L}=A;I.push(U),L&&I.push(L)}const e=A=>I.includes(A),u=await this.getUser(k);if(!u)return;for(const A of u.tracks){const{trackName:U,msid:L,userId:P,mediaType:Z}=A;!P||!Z||!e(U)||(this.removeUserMediaStreamContext(P,Z),L&&delete A.msid)}if($){const A=u.tracks.filter(({trackName:U})=>!e(U));await this.updateUsertracks(k,A,!1)}const N=this.peerIns.getTransceivers();for(const A of N){const{sender:U,receiver:L}=A;U.track&&e(U.track.id)&&(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->Breathe: sender: ${U.track.id} is stop.`,A),U.track.enabled=!1,U.track.stop(),this.peerIns.removeTrack(U),A.stop()),L.track&&e(L.track.id)&&(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->Breathe: receiver: ${L.track.id} is stop.`,A),L.track.enabled=!1,L.track.stop(),A.stop())}});H(this,"createOffer",async()=>{const k=await this.peerIns.createOffer();if(this.options.debug){const D=libExports.parse(k.sdp),$=mt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->Breathe: createOffer",{msidArr:$,sdpJson:D,description:k})}await this.peerIns.setLocalDescription(k)});H(this,"createAnswer",async()=>{const k=await this.peerIns.createAnswer();if(this.options.debug){const D=libExports.parse(k.sdp),$=mt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->Breathe: createAnswer",{msidArr:$,sdpJson:D,description:k})}await this.peerIns.setLocalDescription(k)});H(this,"getSdp",()=>{var k;return(k=this.peerIns.localDescription)==null?void 0:k.sdp});H(this,"setRemoteDescription",async k=>{if(this.options.debug){const D=libExports.parse(k.sdp),$=mt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->Breathe: setRemoteDescription",{msidArr:$,sdpJson:D,description:k})}return await this.peerIns.setRemoteDescription(k),k});H(this,"getPeerNetwork",()=>this.peerNetwork);H(this,"setCallStrategy",async(k,D=[])=>{D.length===0&&(D=mediaType_keys);let $="balanced";switch(k){case"qualityPriority":$="maintain-resolution";break;case"fluencyPriority":$="maintain-framerate";break;case"balancedDowngrade":$="balanced";break}const I=await this.getCaller(),e=Array.from(I.tracks,({trackName:N})=>N),u=this.peerIns.getSenders();for(const N of u){const{track:A}=N;if(!A||!e.includes(A.id))continue;const U=N.getParameters();N.setParameters({...U,degradationPreference:$})}});H(this,"setRTCRtpSenderParameters",k=>{try{const D=this.peerIns.getSenders();for(const $ of D){const I=$.getParameters();$.setParameters({...I,...k})}}catch(D){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",D)}});H(this,"getReportsByMid",async(k=[])=>k.length===0?this.reports:this.reports.filter(D=>k.includes(D.mid)));H(this,"getRoomNetwork",()=>this.peerNetwork);lt(this,Bt,async()=>{try{const k=await this.peerIns.getStats(),D=["inbound-rtp","remote-inbound-rtp","outbound-rtp"],I=[...k.values()].filter(et=>D.includes(et.type));let e=0,u=0,N=0,A=0,U=0,L=0,P=[],Z=[];for(const et of this.reports){const{packetsSent:ft,packetsLost:tt}=et;ft&&(N+=ft),tt&&(A+=tt)}this.reports=I;for(const et of this.reports){const{bytesReceived:ft,bytesSent:tt,packetsSent:st,packetsLost:rt,jitter:nt,roundTripTime:ot}=et;ft&&(e=ft),tt&&(u=tt),st&&(U+=st),rt&&(L+=rt),ot&&P.push((ot*100).toFixed(2)),nt&&Z.push(nt.toFixed(2))}Z.sort().reverse(),P.sort().reverse();const F=U-N,W=L-A,J=F===0?"0.00":(W/F).toFixed(2),[z="0"]=P,[V="0"]=Z,X={inboundBytes:e,outboundBytes:u,lostRate:J,roundTripTime:z,jitter:V};this.peerNetwork=X;const Y=(et,ft,tt)=>{const st=Number(et),rt=Number(ft),nt=Number(tt);let ot="0";return st<.03&&rt<100&&nt<.05?ot="5":st<.06&&rt<160&&nt<.1?ot="4":st<.1&&rt<250&&nt<.15?ot="3":st<.15&&rt<400&&nt<.2?ot="2":ot="1",Number(ot)};{const et=Y(J,z,V),ft=await this.getCaller(),{network:tt}=ft,st={egress:et,ingress:et},rt=JSON.stringify(tt)!==JSON.stringify(st);if(await this.updateUserNetwork(this.options.userId,st),rt){this.emitNotifyUpdateUsers();const{userId:nt,roomId:ot}=this.options;this.cwsIns.sendMessage({event:"networkQualityChange",data:{...st,userId:nt,roomId:ot}},!1)}}}catch(k){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: setNetQuality is err.",k)}});lt(this,Lt,()=>{const k=async()=>{this.peerIns.connectionState!=="connected"||!this.options.roomId||G(this,Bt).call(this)};this.getPeerStatsTimer=setInterval(k,1*1e3)});H(this,"stopGetPeerStats",()=>clearInterval(this.getPeerStatsTimer))}}Pt=new WeakMap,Bt=new WeakMap,Lt=new WeakMap;class RoomCalls extends RoomPeer{constructor(){super();H(this,"sdk_service_version","1.0.5");H(this,"setLocalStream",(k,D)=>new Promise(async($,I)=>{try{const{userId:e}=this.options;if(D?await this.initLocalStream(k):this.removeUserMediaStreamContext(e,k),k==="screenSharing_audio"||k==="screenSharing_video"){{const A=this.getUserStream(e,"screenSharing_audio").getTracks();for(const U of A)U.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}{const A=this.getUserStream(e,"screenSharing_video").getTracks();for(const U of A)U.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}const u=this.getUserStreams(e);this.cwsIns.emitNotify("onLocalStream",{code:200,data:u,desc:"local stream is change."}),$(u)}catch(e){I(e)}}));H(this,"addNotify",k=>this.cwsIns.addNotify(k));lt(this,jt,async k=>{const{roomId:D}=this.options;if(!D)return;const{id:$,tracks:I=[]}=await this.getCaller();if(I.length===0)return;const e=I.filter(u=>u.mediaType&&k.includes(u.mediaType));this.cwsIns.sendMessage({event:"pubNotify",data:{roomId:D,user:{id:$,tracks:e}}})});H(this,"joinRoom",async k=>new Promise((D,$)=>{this.setOptions(k),this.clearUsers(),this.createWs();let I="";const e=async()=>{this.taskQueue.clear([I]),await this.emitNotifyUpdateUsers();const N=await this.getUsers();D(N)},u=async()=>{try{const{roomId:N,userId:A,callType:U}=this.options;this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:U,roomId:N,user:{id:A,tracks:[],callAction:0}}}).then(async L=>{const{code:P=0,desc:Z="服务器繁忙",data:F}=L;if(P!==200)return $(Z);const{roomId:W="",roomUsers:J=[]}=F;if(W!==N)return $("加入的房间不匹配");this.createSession(),await this.updateUsers(J),e()})}catch(N){$(`加入房间失败: ${N.message||N||"服务器繁忙"}`)}};I=this.taskQueue.addTask(u,["createWs"],{describe:"joinRoom",strict:!0})}));H(this,"quitRoom",()=>new Promise(async k=>{const{roomId:D,userId:$}=this.options,I={roomId:D,user:{id:$}};try{this.stopSubscribe(),this.stopGetPeerStats(),this.initAsyncQueue(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.setRoomState("ready")}catch{}await new Promise(e=>setTimeout(()=>e(!0),300)),this.cwsIns.sendMessage({event:"quitRoom",data:I}),k(!0)}));H(this,"quitRoomEx",()=>new Promise(async k=>{const{roomId:D,userId:$}=this.options,I={roomId:D,user:{id:$}};try{this.stopSubscribe(),this.stopGetPeerStats(),this.initAsyncQueue(),this.clearUsers(),this.clearUserStreams(),await this.replaceSenderStream([],!1)}catch{}await new Promise(e=>setTimeout(()=>e(!0),300)),this.cwsIns.sendMessage({event:"quitRoomEx",data:I}),k(!0)}));H(this,"syncRoomInfo",()=>new Promise((k,D)=>{const $=async()=>{const{userId:I}=this.options,e=await this.getUser(I),{id:u=I,callAction:N=0}=e;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:u,callAction:N}}}).then(async A=>{if(A.code!==200)return D(A.desc);const U=A.data.users;this.clearUsers(),await this.updateUsers(U),await this.updateUsertracks(e.id,e.tracks,!1),await this.subscribe();{const L=await this.getUsers();k(L)}}).catch(A=>D(A))};this.taskQueue.addTask($,["createWs"],{describe:"syncRoomInfo"})}));H(this,"publish",k=>new Promise(async(D,$)=>{const I=async()=>{try{this.taskQueue.setCondition("publish",!1),k.includes("screenSharing_audio")&&!k.includes("screenSharing_video")&&(k=[...k,"screenSharing_video"]),await this.replaceSenderStream(k,!1);const e=await this.getCaller();for(const L of k)this.getUserStream(e.id,L).getTracks().length===0&&await this.setLocalStream(L,!0);const u=[];for(const L of k)this.getUserStream(e.id,L).getTracks().length!==0&&u.push(L);await this.createTrack(u),await this.replaceSenderStream(u,!0);const N=this.getSenderTracks(k),A=[...e.tracks,...N],U=await this.getCallAction(A);await this.updateUsertracks(e.id,A,!0),G(this,jt).call(this,k),await G(this,gt).call(this,U);{await this.emitNotifyUpdateUsers();const L=await this.getCaller();this.taskQueue.setCondition("publish",!0),D(L)}}catch(e){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: error",e);for(const u of k)await this.setLocalStream(u,!1);this.taskQueue.setCondition("publish",!0),$(`publish is error: ${e.message||e}`)}};this.taskQueue.addTask(I,["createWs","createSession","ice","createTrack","subscribe","publish"],{describe:"replaceSenderStream"})}));H(this,"stopPublish",(k=[])=>new Promise((D,$)=>{const I=async()=>{try{this.taskQueue.setCondition("closeTrack",!1);const e=await this.getCaller();k.length===0&&(k=mediaType_keys);const u=e.tracks.filter(({mediaType:A})=>A&&k.includes(A)),N=async()=>{this.taskQueue.setCondition("closeTrack",!0);const A=await this.getCaller();await this.emitNotifyUpdateUsers(),D(A)};if(u.length===0)return N();await this.replaceSenderStream(k,!0),await this.removeSenders(k),await this.closeUserTracks(e.id,u,!0);{const A=await this.getCallAction(e.tracks);await G(this,gt).call(this,A)}await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:u}}).then(async A=>{const{remoteSdp:U}=A.data;await this.setRemoteDescription({type:"answer",sdp:U})}),N()}catch(e){this.taskQueue.setCondition("closeTrack",!0),$(`stop publish is error: ${e.message||e}`)}};this.taskQueue.addTask(I,["createWs","createSession","ice","createTrack","subscribe"],{describe:"stopPublish"})}));H(this,"subscribe",(k=[],D=3)=>new Promise(($,I)=>{const e=async()=>{try{this.taskQueue.setCondition("subscribe",!1);const u=await this.getUsers();let N=[];for(const P of u){const{isSelf:Z,tracks:F=[]}=P;if(!Z){const W=F.filter(({trackName:J,mid:z=""})=>z!==""&&(k.includes(J)||k.length===0));W.length!==0&&N.push({...P,tracks:W})}}const A=async()=>{const P=Array.from(N,({id:F})=>F),Z=await this.getUsers(P);await this.emitNotifyUpdateUsers(),this.taskQueue.setCondition("subscribe",!0),$(Z)};if(N.length===0)return A();const U=[];for(const P of N){const{id:Z,tracks:F}=P,W=mt(F,["type","trackName"]),J={id:Z,tracks:W};U.push(J)}const L=async()=>{this.options.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: surplus subscribe count is ${D}`),await this.cwsIns.sendMessage({event:"subscribe",data:{users:U}}).then(async P=>{const{code:Z=0,data:F,desc:W}=P;if(Z!==200){if(D>0)return await new Promise(V=>setTimeout(()=>V(!0),300)),D=D-1,L();throw this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: subscribe is error. count 0",{trackNames:k}),new Error(W)}const{remoteSdp:J,users:z=[]}=F;this.onSubscribeUserTracks(z).then(async()=>{await this.renegotiate(),A()}),await this.setRemoteDescription({type:"offer",sdp:J})})};await L()}catch(u){this.taskQueue.setCondition("subscribe",!0),I(`subscribe is error: ${u.message||u}`)}};this.taskQueue.addTask(e,["createWs","createSession","ice","createTrack","closeTrack"],{describe:"subscribe"})}));H(this,"stopSubscribe",(k=[])=>new Promise((D,$)=>{const I=async()=>{try{this.taskQueue.setCondition("closeTrack",!1);const e=await this.getUsers(),u=[];for(const A of e){const{tracks:U=[]}=A;for(const L of U){const{type:P,mid:Z,trackName:F,mediaType:W,msid:J}=L;if(!(!W||!J)&&(k.length===0||k.includes(F))){const z={type:P,mid:Z,trackName:J};u.push(z),await this.closeUserTracks(A.id,[L])}}}const N=async()=>{await this.emitNotifyUpdateUsers(),this.taskQueue.setCondition("closeTrack",!0),D(!0)};if(u.length===0)return N();await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:u}}).then(async A=>{const{remoteSdp:U}=A.data;await this.setRemoteDescription({type:"answer",sdp:U})}),N()}catch(e){this.taskQueue.setCondition("closeTrack",!0),$(`stop subscribe is error: ${e.message||e}`)}};this.taskQueue.addTask(I,["createWs","createSession","ice","createTrack","subscribe"],{describe:"closeTrack"})}));H(this,"inactiveTracks",async(k,D)=>new Promise(async $=>{const I=await this.getCaller();if(!I)return;const{tracks:e=[]}=I,u=[...e];await this.replaceSenderStream(k,!0);for(let A of u){const{mediaType:U}=A;if(U&&k.includes(U)){A.enabled=D;const P=this.getUserStream(I.id,U).getTracks();for(const Z of P)Z.enabled=D}}const N=await this.getCallAction(u);await G(this,gt).call(this,N),await this.emitNotifyUpdateUsers(),$(!0)}));H(this,"debugger",()=>new Promise(async(k,D)=>{await this.cwsIns.sendMessage({event:"debugger"},!1).then(async $=>{if($.code!==200)return D($.desc);k(!0)}).catch($=>{D($)})}));lt(this,gt,async k=>new Promise(async(D,$)=>{const{roomId:I,userId:e}=this.options,u={roomId:I,user:{id:e,callAction:k}};await this.cwsIns.sendMessage({event:"updateCall",data:u}).then(async N=>{const{code:A=0}=N;if(A!==200)return $(N);await this.updateUserCallAction(e,k),D(k)}).catch(N=>$(N))}));H(this,"renegotiate",()=>new Promise(async(k,D)=>{await this.createAnswer(),await this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then($=>{if($.code!==200)return D("协商流错误");k(!0)}).catch($=>{console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe:error",$),D(`协商流错误: ${$.message||$}`)})}));H(this,"createWs",()=>new Promise(async(k,D)=>{try{if(["connecting","connected"].includes(this.cwsIns.state))return k(!0);this.taskQueue.setCondition("createWs",!1),this.cwsIns.clearEvents(),this.initPeer();const{appid:$}=this.options,{userId:I,sdkToken:e,roomId:u}=this.options;if(!I)return D("You must first use QuickVO.setOptions to set the userId.");const N={a:e,b:I,c:$,r:u,v:this.sdk_service_version};this.isEarly&&(N.i=pt()),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: createWs",N);const A=btoa(encodeURI(JSON.stringify(N)));await this.cwsIns.connect(A),this.taskQueue.setCondition("createWs",!0),k(!0)}catch($){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe:error",$),D($)}}));H(this,"createSession",()=>new Promise(k=>{if(["connecting","connected"].includes(this.roomState))return k(!0);const D=async()=>(this.taskQueue.setCondition("ice",!1),this.taskQueue.setCondition("createSession",!1),this.setRoomState("connecting"),await this.addSenders(),this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}).then(async $=>{const{code:I=0,desc:e,data:u}=$;if(I!==200)throw new Error(e);const{remoteSdp:N}=u;await this.setRemoteDescription({type:"answer",sdp:N}),this.taskQueue.setCondition("createSession",!0),k(!0)}));this.taskQueue.addTask(D,["createWs"],{describe:"createSession"})}));H(this,"createTrack",async k=>new Promise(D=>{const $=async()=>{try{this.taskQueue.setCondition("createTrack",!1);const I=await this.addSenders(k),e=this.getSenderTracks(I);if(e.length===0)return this.taskQueue.setCondition("createTrack",!0),D(!0);await this.cwsIns.sendMessage({event:"publish",data:{sdp:this.getSdp(),tracks:e,callAction:0}}).then(async u=>{const{code:N=0,desc:A,data:U}=u;if(N!==200)throw this.options.debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createTrack is error.",{mediaTypes:k}),new Error(A);const{remoteSdp:L}=U;await this.setRemoteDescription({type:"answer",sdp:L}),this.taskQueue.setCondition("createTrack",!0),D(!0)})}catch{await this.removeSenders(k),this.taskQueue.setCondition("createTrack",!0),D(!0)}};this.taskQueue.addTask($,["createWs","createSession","ice","subscribe","closeTrack"],{describe:"createTrack"})}));H(this,"earlyConnect",()=>{this.isEarly=!0,this.createWs(),this.createSession(),this.createTrack(["microphoneCamera_audio","microphoneCamera_video"])});this.setRoomState("ready")}}jt=new WeakMap,gt=new WeakMap;class Room extends RoomCalls{constructor(){super()}}class QuickVO extends Room{constructor(k){super();lt(this,wt,new Map);lt(this,Zt,()=>{{const k=async D=>{const{qualities:$=[]}=D.data,[I]=$;if(!(I&&I.userId===this.options.userId&&$.length===1)){for(const e of $){const{userId:u,egress:N,ingress:A}=e;this.checkUserInRoom(u)&&await this.updateUserNetwork(u,{egress:N,ingress:A})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:k},!0)}{const k=async D=>{const $=D.data.user;await this.updateUsers([$]),await this.updateUsertracks($.id,$.track,!1),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:k},!0)}{const k=async D=>{await this.removeUsers([D.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:k},!0)}{const k=async D=>{const{user:$}=D.data,{id:I,tracks:e=[]}=$;await this.updateUserPermissions(I,3);const u=[];{const{tracks:N}=await this.getUser(I);for(const A of e){const{mid:U,trackName:L}=A;if(N.find(Z=>Z.mid===U&&Z.trackName===L))continue;u.push(A)}}if(u.length!==0)if(await this.updateUsertracks(I,u,!0),this.options.newPublishAutoSubscribe){const N=this.getTrackNamesFormTracks(u);await this.subscribe(N)}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:k},!0)}{const k=async D=>{const{id:$,tracks:I}=D.data.user;$!==this.options.userId&&(await this.closeUserTracks($,I,!0),await this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onCloseTrack",callback:k},!0)}{const k=async D=>{const{id:$,callAction:I}=D.data.user;this.checkUserInRoom($)&&(await this.updateUserCallAction($,I),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:k},!0)}{const k=async D=>{const{user:$}=D.data,{id:I,permissions:e=1}=$;e===1?await this.removeUsers([I]):e===3&&await this.updateUsers([$]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:k},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async k=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)});lt(this,Ft,()=>{this.cwsIns.sendMessageBefore=async()=>{}});lt(this,Ht,()=>{this.cwsIns.onReconnectSuccess=async()=>{this.syncRoomInfo()}});lt(this,zt,async()=>{});H(this,"addRequestAnimationFrame",async(k,D)=>{{const I=G(this,wt).get(k);I&&cancelAnimationFrame(I)}const $=(I=Date.now())=>{D(I);const e=requestAnimationFrame($);G(this,wt).set(k,e)};$()});H(this,"clearRequestAnimationFrame",async(k=[])=>{k.length===0&&(k=[...G(this,wt).keys()]);const D=[];for(const $ of k){const I=G(this,wt).get($);I&&(cancelAnimationFrame(I),D.push(I))}return D});H(this,"destroy",async()=>{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 销毁SDK"),this.stopGetPeerStats(),this.initAsyncQueue(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.cwsIns.emitNotify("onDestroy",{code:200,data:{},desc:"sdk is destroy."}),await this.cwsIns.close()});this.setOptions(k),this.initCwsCall(),G(this,Ft).call(this),G(this,Ht).call(this),G(this,zt).call(this),G(this,Zt).call(this)}}wt=new WeakMap,Zt=new WeakMap,Ft=new WeakMap,Ht=new WeakMap,zt=new WeakMap,exports.QuickVO=QuickVO,exports.ignoreEvent=ignoreEvent,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
3
+ `},writer$1}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var _=requireParser(),q=requireWriter$1(),k=requireGrammar();return lib.grammar=k,lib.write=q,lib.parse=_.parse,lib.parseParams=_.parseParams,lib.parseFmtpConfig=_.parseFmtpConfig,lib.parsePayloads=_.parsePayloads,lib.parseRemoteCandidates=_.parseRemoteCandidates,lib.parseImageAttributes=_.parseImageAttributes,lib.parseSimulcastStreamList=_.parseSimulcastStreamList,lib}var libExports=requireLib();class AudioMediaContext{constructor(q){H(this,"options",{autoGainControl:!1,noiseSuppression:!1,echoCancellation:!1});H(this,"kind","audio");H(this,"stream",new MediaStream);H(this,"audio",new Audio);H(this,"audioContext",new(window.AudioContext||window.webkitAudioContext));H(this,"mediaStreamAudioSourceNode");H(this,"autoGainNode");H(this,"biquadFilterNode");H(this,"delayNode");H(this,"gainNode");H(this,"analyserNode");H(this,"analyserArrayData");H(this,"stop",()=>{const q=this.stream.getTracks();for(const k of q)k.enabled=!1,k.stop(),this.stream.removeTrack(k)});H(this,"replaceStream",q=>{this.stop();const[k]=q.getAudioTracks();this.stream.addTrack(k)});H(this,"getStream",()=>this.mediaStreamAudioSourceNode.mediaStream);H(this,"setMute",(q=!0)=>{q?this.analyserNode.disconnect(this.audioContext.destination):this.analyserNode.connect(this.audioContext.destination)});H(this,"setVolumeGain",q=>{this.gainNode.gain.setValueAtTime(q,this.audioContext.currentTime)});H(this,"getVolume",()=>{const{analyserNode:q,analyserArrayData:k}=this;q.getByteFrequencyData(k);let D=0;for(let I=0;I<k.length;I++)D+=k[I];return Math.ceil(D/k.length)});H(this,"setFilter",(q={})=>{this.options={...this.options,...q};const{autoGainControl:k,noiseSuppression:D,echoCancellation:$}=this.options,{mediaStreamAudioSourceNode:I,autoGainNode:e,biquadFilterNode:u,delayNode:N,gainNode:A}=this,U=I;return k&&U.connect(e),D&&U.connect(u),$&&U.connect(N),U.connect(A),q});this.stream.addTrack(q),this.audio.srcObject=this.stream,this.audioContext=new(window.AudioContext||window.webkitAudioContext),this.mediaStreamAudioSourceNode=this.audioContext.createMediaStreamSource(this.stream),this.autoGainNode=this.audioContext.createGain(),this.autoGainNode.gain.setValueAtTime(.8,this.audioContext.currentTime),this.biquadFilterNode=this.audioContext.createBiquadFilter(),this.biquadFilterNode.type="lowpass",this.biquadFilterNode.frequency.value=1e3,this.delayNode=this.audioContext.createDelay(),this.delayNode.delayTime.value=.5,this.gainNode=this.audioContext.createGain(),this.gainNode.gain.setValueAtTime(1,this.audioContext.currentTime),this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=512,this.analyserArrayData=new Uint8Array(this.analyserNode.frequencyBinCount);const{gainNode:k,analyserNode:D}=this;k.connect(D),this.audioContext.state==="suspended"&&(this.audioContext.resume(),document.addEventListener("click",()=>this.audioContext.resume(),{once:!0})),this.setFilter()}}class VideoMediaContext{constructor(q){H(this,"kind","video");H(this,"stream",new MediaStream);H(this,"stop",()=>{const q=this.stream.getTracks();for(const k of q)k.enabled=!1,k.stop(),this.stream.removeTrack(k)});H(this,"replaceStream",q=>{this.stop();const[k]=q.getVideoTracks();this.stream.addTrack(k)});H(this,"getStream",()=>this.stream);H(this,"getTrack",()=>this.stream.getTracks()[0]);this.stream.addTrack(q)}}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",closed:"已关闭"};ut(enum_roomState);var C=Object.defineProperty,R=_=>{throw TypeError(_)},S=(_,q,k)=>q in _?C(_,q,{enumerable:!0,configurable:!0,writable:!0,value:k}):_[q]=k,l=(_,q,k)=>S(_,typeof q!="symbol"?q+"":q,k),v=(_,q,k)=>q.has(_)||R("Cannot "+k),t=(_,q,k)=>(v(_,q,"read from private field"),k?k.call(_):q.get(_)),c=(_,q,k)=>q.has(_)?R("Cannot add the same private member more than once"):q instanceof WeakSet?q.add(_):q.set(_,k),i=(_,q,k,D)=>(v(_,q,"write to private field"),q.set(_,k),k),s,r,h$1,p$1,m,f$1,w,x$1,g$1,b$1,B,y$1,T,d$1;class M{constructor(q){c(this,s,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,sendBeforAutoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4,checkReconnect:k=>!0,onReconnectSuccess:async k=>{},onReconnectStop:async k=>{},getHeartbeatMsg:()=>JSON.stringify({event:"heartbeat"}),onMessage:k=>{}}),l(this,"ws"),c(this,r,-1),c(this,h$1,-1),c(this,p$1,0),c(this,m,0),c(this,f$1,!1),c(this,w,k=>{}),l(this,"close",async(k=1e3,D="correctly close.")=>{var $;this.ws&&(i(this,f$1,!0),t(this,d$1).call(this),($=this.ws)==null||$.close(k,D))}),l(this,"connect",()=>new Promise(async k=>{i(this,w,k),this.ws=new WebSocket(t(this,s).url),this.ws.binaryType=t(this,s).binaryType,this.ws.onopen=t(this,b$1),this.ws.onmessage=t(this,g$1),this.ws.onerror=t(this,B),this.ws.onclose=t(this,y$1)})),l(this,"reconnect",async k=>new Promise(D=>{t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await reconnect.");const $=I=>{t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: ${I}`),t(this,s).onReconnectStop({msg:I}),D(I)};if(t(this,x$1).call(this)===!1)return $("stop reconnect. exceed maxReconnectionTime.");if(t(this,r)!==-1&&t(this,r)===0)return $("stop reconnect. surplusReconnectCount is 0.");if(!t(this,s).checkReconnect(k))return $("stop reconnect. checkReconnect is false.");t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: await ${t(this,s).reconnectIntervalTime}ms run reconnect. surplusReconnectCount is ${t(this,r)}`,k),i(this,p$1,setTimeout(async()=>{i(this,r,Math.max(-1,t(this,r)-1)),await this.connect();try{await t(this,s).onReconnectSuccess(this.ws)}catch(I){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->pr-ws: onReconnectSuccess is error",I)}D(!0)},t(this,s).reconnectIntervalTime))})),l(this,"sendMessage",async k=>{var D;(!this.ws||this.ws.readyState!==1)&&(t(this,s).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: ws is not ready."),t(this,s).sendBeforAutoConnect&&(t(this,s).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await ws connect."),await this.connect())),(D=this.ws)==null||D.send(k)}),c(this,x$1,()=>{const k=Date.now();return t(this,h$1)===-1&&i(this,h$1,k+t(this,s).reconnectTime),!(k>t(this,h$1))}),c(this,g$1,k=>{const{data:D}=k;t(this,s).onMessage(D)}),c(this,b$1,()=>{t(this,s).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is success.",this.ws),i(this,r,t(this,s).reconnectCount),i(this,h$1,-1),t(this,T).call(this),t(this,w).call(this,this.ws)}),c(this,B,k=>{t(this,s).debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is error.",k)}),c(this,y$1,k=>{if(t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: connect is close. code: ${k.code}, permanentClosed is ${t(this,f$1)}.`,k),t(this,d$1).call(this),!t(this,f$1))return this.reconnect(k);this.ws=void 0}),c(this,T,()=>{i(this,m,setInterval(()=>{const k=t(this,s).getHeartbeatMsg();k&&this.sendMessage(k)},t(this,s).heartbeatIntervalTime))}),c(this,d$1,()=>{clearInterval(t(this,p$1)),clearInterval(t(this,m))}),i(this,s,{...t(this,s),...q}),i(this,r,t(this,s).reconnectCount)}}s=new WeakMap,r=new WeakMap,h$1=new WeakMap,p$1=new WeakMap,m=new WeakMap,f$1=new WeakMap,w=new WeakMap,x$1=new WeakMap,g$1=new WeakMap,b$1=new WeakMap,B=new WeakMap,y$1=new WeakMap,T=new WeakMap,d$1=new WeakMap;var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=_;function _(q,k){for(var D=new Array(arguments.length-1),$=0,I=2,e=!0;I<arguments.length;)D[$++]=arguments[I++];return new Promise(function(N,A){D[$]=function(L){if(e)if(e=!1,L)A(L);else{for(var P=new Array(arguments.length-1),Z=0;Z<P.length;)P[Z++]=arguments[Z];N.apply(null,P)}};try{q.apply(k||null,D)}catch(U){e&&(e=!1,A(U))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(_){var q=_;q.length=function(u){var N=u.length;if(!N)return 0;for(var A=0;--N%4>1&&u.charAt(N)==="=";)++A;return Math.ceil(u.length*3)/4-A};for(var k=new Array(64),D=new Array(123),$=0;$<64;)D[k[$]=$<26?$+65:$<52?$+71:$<62?$-4:$-59|43]=$++;q.encode=function(u,N,A){for(var U=null,L=[],P=0,Z=0,F;N<A;){var W=u[N++];switch(Z){case 0:L[P++]=k[W>>2],F=(W&3)<<4,Z=1;break;case 1:L[P++]=k[F|W>>4],F=(W&15)<<2,Z=2;break;case 2:L[P++]=k[F|W>>6],L[P++]=k[W&63],Z=0;break}P>8191&&((U||(U=[])).push(String.fromCharCode.apply(String,L)),P=0)}return Z&&(L[P++]=k[F],L[P++]=61,Z===1&&(L[P++]=61)),U?(P&&U.push(String.fromCharCode.apply(String,L.slice(0,P))),U.join("")):String.fromCharCode.apply(String,L.slice(0,P))};var I="invalid encoding";q.decode=function(u,N,A){for(var U=A,L=0,P,Z=0;Z<u.length;){var F=u.charCodeAt(Z++);if(F===61&&L>1)break;if((F=D[F])===void 0)throw Error(I);switch(L){case 0:P=F,L=1;break;case 1:N[A++]=P<<2|(F&48)>>4,P=F,L=2;break;case 2:N[A++]=(P&15)<<4|(F&60)>>2,P=F,L=3;break;case 3:N[A++]=(P&3)<<6|F,L=0;break}}if(L===1)throw Error(I);return A-U},q.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=_;function _(){this._listeners={}}return _.prototype.on=function(k,D,$){return(this._listeners[k]||(this._listeners[k]=[])).push({fn:D,ctx:$||this}),this},_.prototype.off=function(k,D){if(k===void 0)this._listeners={};else if(D===void 0)this._listeners[k]=[];else for(var $=this._listeners[k],I=0;I<$.length;)$[I].fn===D?$.splice(I,1):++I;return this},_.prototype.emit=function(k){var D=this._listeners[k];if(D){for(var $=[],I=1;I<arguments.length;)$.push(arguments[I++]);for(I=0;I<D.length;)D[I].fn.apply(D[I++].ctx,$)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=_(_);function _(I){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),u=new Uint8Array(e.buffer),N=u[3]===128;function A(Z,F,W){e[0]=Z,F[W]=u[0],F[W+1]=u[1],F[W+2]=u[2],F[W+3]=u[3]}function U(Z,F,W){e[0]=Z,F[W]=u[3],F[W+1]=u[2],F[W+2]=u[1],F[W+3]=u[0]}I.writeFloatLE=N?A:U,I.writeFloatBE=N?U:A;function L(Z,F){return u[0]=Z[F],u[1]=Z[F+1],u[2]=Z[F+2],u[3]=Z[F+3],e[0]}function P(Z,F){return u[3]=Z[F],u[2]=Z[F+1],u[1]=Z[F+2],u[0]=Z[F+3],e[0]}I.readFloatLE=N?L:P,I.readFloatBE=N?P:L}():function(){function e(N,A,U,L){var P=A<0?1:0;if(P&&(A=-A),A===0)N(1/A>0?0:2147483648,U,L);else if(isNaN(A))N(2143289344,U,L);else if(A>34028234663852886e22)N((P<<31|2139095040)>>>0,U,L);else if(A<11754943508222875e-54)N((P<<31|Math.round(A/1401298464324817e-60))>>>0,U,L);else{var Z=Math.floor(Math.log(A)/Math.LN2),F=Math.round(A*Math.pow(2,-Z)*8388608)&8388607;N((P<<31|Z+127<<23|F)>>>0,U,L)}}I.writeFloatLE=e.bind(null,q),I.writeFloatBE=e.bind(null,k);function u(N,A,U){var L=N(A,U),P=(L>>31)*2+1,Z=L>>>23&255,F=L&8388607;return Z===255?F?NaN:P*(1/0):Z===0?P*1401298464324817e-60*F:P*Math.pow(2,Z-150)*(F+8388608)}I.readFloatLE=u.bind(null,D),I.readFloatBE=u.bind(null,$)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),u=new Uint8Array(e.buffer),N=u[7]===128;function A(Z,F,W){e[0]=Z,F[W]=u[0],F[W+1]=u[1],F[W+2]=u[2],F[W+3]=u[3],F[W+4]=u[4],F[W+5]=u[5],F[W+6]=u[6],F[W+7]=u[7]}function U(Z,F,W){e[0]=Z,F[W]=u[7],F[W+1]=u[6],F[W+2]=u[5],F[W+3]=u[4],F[W+4]=u[3],F[W+5]=u[2],F[W+6]=u[1],F[W+7]=u[0]}I.writeDoubleLE=N?A:U,I.writeDoubleBE=N?U:A;function L(Z,F){return u[0]=Z[F],u[1]=Z[F+1],u[2]=Z[F+2],u[3]=Z[F+3],u[4]=Z[F+4],u[5]=Z[F+5],u[6]=Z[F+6],u[7]=Z[F+7],e[0]}function P(Z,F){return u[7]=Z[F],u[6]=Z[F+1],u[5]=Z[F+2],u[4]=Z[F+3],u[3]=Z[F+4],u[2]=Z[F+5],u[1]=Z[F+6],u[0]=Z[F+7],e[0]}I.readDoubleLE=N?L:P,I.readDoubleBE=N?P:L}():function(){function e(N,A,U,L,P,Z){var F=L<0?1:0;if(F&&(L=-L),L===0)N(0,P,Z+A),N(1/L>0?0:2147483648,P,Z+U);else if(isNaN(L))N(0,P,Z+A),N(2146959360,P,Z+U);else if(L>17976931348623157e292)N(0,P,Z+A),N((F<<31|2146435072)>>>0,P,Z+U);else{var W;if(L<22250738585072014e-324)W=L/5e-324,N(W>>>0,P,Z+A),N((F<<31|W/4294967296)>>>0,P,Z+U);else{var J=Math.floor(Math.log(L)/Math.LN2);J===1024&&(J=1023),W=L*Math.pow(2,-J),N(W*4503599627370496>>>0,P,Z+A),N((F<<31|J+1023<<20|W*1048576&1048575)>>>0,P,Z+U)}}}I.writeDoubleLE=e.bind(null,q,0,4),I.writeDoubleBE=e.bind(null,k,4,0);function u(N,A,U,L,P){var Z=N(L,P+A),F=N(L,P+U),W=(F>>31)*2+1,J=F>>>20&2047,z=4294967296*(F&1048575)+Z;return J===2047?z?NaN:W*(1/0):J===0?W*5e-324*z:W*Math.pow(2,J-1075)*(z+4503599627370496)}I.readDoubleLE=u.bind(null,D,0,4),I.readDoubleBE=u.bind(null,$,4,0)}(),I}function q(I,e,u){e[u]=I&255,e[u+1]=I>>>8&255,e[u+2]=I>>>16&255,e[u+3]=I>>>24}function k(I,e,u){e[u]=I>>>24,e[u+1]=I>>>16&255,e[u+2]=I>>>8&255,e[u+3]=I&255}function D(I,e){return(I[e]|I[e+1]<<8|I[e+2]<<16|I[e+3]<<24)>>>0}function $(I,e){return(I[e]<<24|I[e+1]<<16|I[e+2]<<8|I[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(_){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(_){var q=_;q.length=function(D){for(var $=0,I=0,e=0;e<D.length;++e)I=D.charCodeAt(e),I<128?$+=1:I<2048?$+=2:(I&64512)===55296&&(D.charCodeAt(e+1)&64512)===56320?(++e,$+=4):$+=3;return $},q.read=function(D,$,I){var e=I-$;if(e<1)return"";for(var u=null,N=[],A=0,U;$<I;)U=D[$++],U<128?N[A++]=U:U>191&&U<224?N[A++]=(U&31)<<6|D[$++]&63:U>239&&U<365?(U=((U&7)<<18|(D[$++]&63)<<12|(D[$++]&63)<<6|D[$++]&63)-65536,N[A++]=55296+(U>>10),N[A++]=56320+(U&1023)):N[A++]=(U&15)<<12|(D[$++]&63)<<6|D[$++]&63,A>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,N)),A=0);return u?(A&&u.push(String.fromCharCode.apply(String,N.slice(0,A))),u.join("")):String.fromCharCode.apply(String,N.slice(0,A))},q.write=function(D,$,I){for(var e=I,u,N,A=0;A<D.length;++A)u=D.charCodeAt(A),u<128?$[I++]=u:u<2048?($[I++]=u>>6|192,$[I++]=u&63|128):(u&64512)===55296&&((N=D.charCodeAt(A+1))&64512)===56320?(u=65536+((u&1023)<<10)+(N&1023),++A,$[I++]=u>>18|240,$[I++]=u>>12&63|128,$[I++]=u>>6&63|128,$[I++]=u&63|128):($[I++]=u>>12|224,$[I++]=u>>6&63|128,$[I++]=u&63|128);return I-e}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=_;function _(q,k,D){var $=D||8192,I=$>>>1,e=null,u=$;return function(A){if(A<1||A>I)return q(A);u+A>$&&(e=q($),u=0);var U=k.call(e,u,u+=A);return u&7&&(u=(u|7)+1),U}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=q;var _=requireMinimal$1();function q(I,e){this.lo=I>>>0,this.hi=e>>>0}var k=q.zero=new q(0,0);k.toNumber=function(){return 0},k.zzEncode=k.zzDecode=function(){return this},k.length=function(){return 1};var D=q.zeroHash="\0\0\0\0\0\0\0\0";q.fromNumber=function(e){if(e===0)return k;var u=e<0;u&&(e=-e);var N=e>>>0,A=(e-N)/4294967296>>>0;return u&&(A=~A>>>0,N=~N>>>0,++N>4294967295&&(N=0,++A>4294967295&&(A=0))),new q(N,A)},q.from=function(e){if(typeof e=="number")return q.fromNumber(e);if(_.isString(e))if(_.Long)e=_.Long.fromString(e);else return q.fromNumber(parseInt(e,10));return e.low||e.high?new q(e.low>>>0,e.high>>>0):k},q.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var u=~this.lo+1>>>0,N=~this.hi>>>0;return u||(N=N+1>>>0),-(u+N*4294967296)}return this.lo+this.hi*4294967296},q.prototype.toLong=function(e){return _.Long?new _.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var $=String.prototype.charCodeAt;return q.fromHash=function(e){return e===D?k:new q(($.call(e,0)|$.call(e,1)<<8|$.call(e,2)<<16|$.call(e,3)<<24)>>>0,($.call(e,4)|$.call(e,5)<<8|$.call(e,6)<<16|$.call(e,7)<<24)>>>0)},q.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)},q.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},q.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},q.prototype.length=function(){var e=this.lo,u=(this.lo>>>28|this.hi<<4)>>>0,N=this.hi>>>24;return N===0?u===0?e<16384?e<128?1:2:e<2097152?3:4:u<16384?u<128?5:6:u<2097152?7:8:N<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(_){var q=_;q.asPromise=requireAspromise(),q.base64=requireBase64(),q.EventEmitter=requireEventemitter(),q.float=requireFloat(),q.inquire=requireInquire(),q.utf8=requireUtf8(),q.pool=requirePool(),q.LongBits=requireLongbits(),q.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),q.global=q.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,q.emptyArray=Object.freeze?Object.freeze([]):[],q.emptyObject=Object.freeze?Object.freeze({}):{},q.isInteger=Number.isInteger||function(I){return typeof I=="number"&&isFinite(I)&&Math.floor(I)===I},q.isString=function(I){return typeof I=="string"||I instanceof String},q.isObject=function(I){return I&&typeof I=="object"},q.isset=q.isSet=function(I,e){var u=I[e];return u!=null&&I.hasOwnProperty(e)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},q.Buffer=function(){try{var $=q.inquire("buffer").Buffer;return $.prototype.utf8Write?$:null}catch{return null}}(),q._Buffer_from=null,q._Buffer_allocUnsafe=null,q.newBuffer=function(I){return typeof I=="number"?q.Buffer?q._Buffer_allocUnsafe(I):new q.Array(I):q.Buffer?q._Buffer_from(I):typeof Uint8Array>"u"?I:new Uint8Array(I)},q.Array=typeof Uint8Array<"u"?Uint8Array:Array,q.Long=q.global.dcodeIO&&q.global.dcodeIO.Long||q.global.Long||q.inquire("long"),q.key2Re=/^true|false|0|1$/,q.key32Re=/^-?(?:0|[1-9][0-9]*)$/,q.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,q.longToHash=function(I){return I?q.LongBits.from(I).toHash():q.LongBits.zeroHash},q.longFromHash=function(I,e){var u=q.LongBits.fromHash(I);return q.Long?q.Long.fromBits(u.lo,u.hi,e):u.toNumber(!!e)};function k($,I,e){for(var u=Object.keys(I),N=0;N<u.length;++N)($[u[N]]===void 0||!e)&&($[u[N]]=I[u[N]]);return $}q.merge=k,q.lcFirst=function(I){return I.charAt(0).toLowerCase()+I.substring(1)};function D($){function I(e,u){if(!(this instanceof I))return new I(e,u);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,I):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&k(this,u)}return I.prototype=Object.create(Error.prototype,{constructor:{value:I,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return $},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),I}q.newError=D,q.ProtocolError=D("ProtocolError"),q.oneOfGetter=function(I){for(var e={},u=0;u<I.length;++u)e[I[u]]=1;return function(){for(var N=Object.keys(this),A=N.length-1;A>-1;--A)if(e[N[A]]===1&&this[N[A]]!==void 0&&this[N[A]]!==null)return N[A]}},q.oneOfSetter=function(I){return function(e){for(var u=0;u<I.length;++u)I[u]!==e&&delete this[I[u]]}},q.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},q._configure=function(){var $=q.Buffer;if(!$){q._Buffer_from=q._Buffer_allocUnsafe=null;return}q._Buffer_from=$.from!==Uint8Array.from&&$.from||function(e,u){return new $(e,u)},q._Buffer_allocUnsafe=$.allocUnsafe||function(e){return new $(e)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=N;var _=requireMinimal$1(),q,k=_.LongBits,D=_.base64,$=_.utf8;function I(J,z,V){this.fn=J,this.len=z,this.next=void 0,this.val=V}function e(){}function u(J){this.head=J.head,this.tail=J.tail,this.len=J.len,this.next=J.states}function N(){this.len=0,this.head=new I(e,0,0),this.tail=this.head,this.states=null}var A=function(){return _.Buffer?function(){return(N.create=function(){return new q})()}:function(){return new N}};N.create=A(),N.alloc=function(z){return new _.Array(z)},_.Array!==Array&&(N.alloc=_.pool(N.alloc,_.Array.prototype.subarray)),N.prototype._push=function(z,V,X){return this.tail=this.tail.next=new I(z,V,X),this.len+=V,this};function U(J,z,V){z[V]=J&255}function L(J,z,V){for(;J>127;)z[V++]=J&127|128,J>>>=7;z[V]=J}function P(J,z){this.len=J,this.next=void 0,this.val=z}P.prototype=Object.create(I.prototype),P.prototype.fn=L,N.prototype.uint32=function(z){return this.len+=(this.tail=this.tail.next=new P((z=z>>>0)<128?1:z<16384?2:z<2097152?3:z<268435456?4:5,z)).len,this},N.prototype.int32=function(z){return z<0?this._push(Z,10,k.fromNumber(z)):this.uint32(z)},N.prototype.sint32=function(z){return this.uint32((z<<1^z>>31)>>>0)};function Z(J,z,V){for(;J.hi;)z[V++]=J.lo&127|128,J.lo=(J.lo>>>7|J.hi<<25)>>>0,J.hi>>>=7;for(;J.lo>127;)z[V++]=J.lo&127|128,J.lo=J.lo>>>7;z[V++]=J.lo}N.prototype.uint64=function(z){var V=k.from(z);return this._push(Z,V.length(),V)},N.prototype.int64=N.prototype.uint64,N.prototype.sint64=function(z){var V=k.from(z).zzEncode();return this._push(Z,V.length(),V)},N.prototype.bool=function(z){return this._push(U,1,z?1:0)};function F(J,z,V){z[V]=J&255,z[V+1]=J>>>8&255,z[V+2]=J>>>16&255,z[V+3]=J>>>24}N.prototype.fixed32=function(z){return this._push(F,4,z>>>0)},N.prototype.sfixed32=N.prototype.fixed32,N.prototype.fixed64=function(z){var V=k.from(z);return this._push(F,4,V.lo)._push(F,4,V.hi)},N.prototype.sfixed64=N.prototype.fixed64,N.prototype.float=function(z){return this._push(_.float.writeFloatLE,4,z)},N.prototype.double=function(z){return this._push(_.float.writeDoubleLE,8,z)};var W=_.Array.prototype.set?function(z,V,X){V.set(z,X)}:function(z,V,X){for(var Y=0;Y<z.length;++Y)V[X+Y]=z[Y]};return N.prototype.bytes=function(z){var V=z.length>>>0;if(!V)return this._push(U,1,0);if(_.isString(z)){var X=N.alloc(V=D.length(z));D.decode(z,X,0),z=X}return this.uint32(V)._push(W,V,z)},N.prototype.string=function(z){var V=$.length(z);return V?this.uint32(V)._push($.write,V,z):this._push(U,1,0)},N.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new I(e,0,0),this.len=0,this},N.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 I(e,0,0),this.len=0),this},N.prototype.ldelim=function(){var z=this.head,V=this.tail,X=this.len;return this.reset().uint32(X),X&&(this.tail.next=z.next,this.tail=V,this.len+=X),this},N.prototype.finish=function(){for(var z=this.head.next,V=this.constructor.alloc(this.len),X=0;z;)z.fn(z.val,V,X),X+=z.len,z=z.next;return V},N._configure=function(J){q=J,N.create=A(),q._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=k;var _=requireWriter();(k.prototype=Object.create(_.prototype)).constructor=k;var q=requireMinimal$1();function k(){_.call(this)}k._configure=function(){k.alloc=q._Buffer_allocUnsafe,k.writeBytesBuffer=q.Buffer&&q.Buffer.prototype instanceof Uint8Array&&q.Buffer.prototype.set.name==="set"?function(I,e,u){e.set(I,u)}:function(I,e,u){if(I.copy)I.copy(e,u,0,I.length);else for(var N=0;N<I.length;)e[u++]=I[N++]}},k.prototype.bytes=function(I){q.isString(I)&&(I=q._Buffer_from(I,"base64"));var e=I.length>>>0;return this.uint32(e),e&&this._push(k.writeBytesBuffer,e,I),this};function D($,I,e){$.length<40?q.utf8.write($,I,e):I.utf8Write?I.utf8Write($,e):I.write($,e)}return k.prototype.string=function(I){var e=q.Buffer.byteLength(I);return this.uint32(e),e&&this._push(D,e,I),this},k._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=I;var _=requireMinimal$1(),q,k=_.LongBits,D=_.utf8;function $(L,P){return RangeError("index out of range: "+L.pos+" + "+(P||1)+" > "+L.len)}function I(L){this.buf=L,this.pos=0,this.len=L.length}var e=typeof Uint8Array<"u"?function(P){if(P instanceof Uint8Array||Array.isArray(P))return new I(P);throw Error("illegal buffer")}:function(P){if(Array.isArray(P))return new I(P);throw Error("illegal buffer")},u=function(){return _.Buffer?function(Z){return(I.create=function(W){return _.Buffer.isBuffer(W)?new q(W):e(W)})(Z)}:e};I.create=u(),I.prototype._slice=_.Array.prototype.subarray||_.Array.prototype.slice,I.prototype.uint32=function(){var P=4294967295;return function(){if(P=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(P=(P|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(P=(P|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(P=(P|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(P=(P|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return P;if((this.pos+=5)>this.len)throw this.pos=this.len,$(this,10);return P}}(),I.prototype.int32=function(){return this.uint32()|0},I.prototype.sint32=function(){var P=this.uint32();return P>>>1^-(P&1)|0};function N(){var L=new k(0,0),P=0;if(this.len-this.pos>4){for(;P<4;++P)if(L.lo=(L.lo|(this.buf[this.pos]&127)<<P*7)>>>0,this.buf[this.pos++]<128)return L;if(L.lo=(L.lo|(this.buf[this.pos]&127)<<28)>>>0,L.hi=(L.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return L;P=0}else{for(;P<3;++P){if(this.pos>=this.len)throw $(this);if(L.lo=(L.lo|(this.buf[this.pos]&127)<<P*7)>>>0,this.buf[this.pos++]<128)return L}return L.lo=(L.lo|(this.buf[this.pos++]&127)<<P*7)>>>0,L}if(this.len-this.pos>4){for(;P<5;++P)if(L.hi=(L.hi|(this.buf[this.pos]&127)<<P*7+3)>>>0,this.buf[this.pos++]<128)return L}else for(;P<5;++P){if(this.pos>=this.len)throw $(this);if(L.hi=(L.hi|(this.buf[this.pos]&127)<<P*7+3)>>>0,this.buf[this.pos++]<128)return L}throw Error("invalid varint encoding")}I.prototype.bool=function(){return this.uint32()!==0};function A(L,P){return(L[P-4]|L[P-3]<<8|L[P-2]<<16|L[P-1]<<24)>>>0}I.prototype.fixed32=function(){if(this.pos+4>this.len)throw $(this,4);return A(this.buf,this.pos+=4)},I.prototype.sfixed32=function(){if(this.pos+4>this.len)throw $(this,4);return A(this.buf,this.pos+=4)|0};function U(){if(this.pos+8>this.len)throw $(this,8);return new k(A(this.buf,this.pos+=4),A(this.buf,this.pos+=4))}return I.prototype.float=function(){if(this.pos+4>this.len)throw $(this,4);var P=_.float.readFloatLE(this.buf,this.pos);return this.pos+=4,P},I.prototype.double=function(){if(this.pos+8>this.len)throw $(this,4);var P=_.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,P},I.prototype.bytes=function(){var P=this.uint32(),Z=this.pos,F=this.pos+P;if(F>this.len)throw $(this,P);if(this.pos+=P,Array.isArray(this.buf))return this.buf.slice(Z,F);if(Z===F){var W=_.Buffer;return W?W.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,Z,F)},I.prototype.string=function(){var P=this.bytes();return D.read(P,0,P.length)},I.prototype.skip=function(P){if(typeof P=="number"){if(this.pos+P>this.len)throw $(this,P);this.pos+=P}else do if(this.pos>=this.len)throw $(this);while(this.buf[this.pos++]&128);return this},I.prototype.skipType=function(L){switch(L){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(L=this.uint32()&7)!==4;)this.skipType(L);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+L+" at offset "+this.pos)}return this},I._configure=function(L){q=L,I.create=u(),q._configure();var P=_.Long?"toLong":"toNumber";_.merge(I.prototype,{int64:function(){return N.call(this)[P](!1)},uint64:function(){return N.call(this)[P](!0)},sint64:function(){return N.call(this).zzDecode()[P](!1)},fixed64:function(){return U.call(this)[P](!0)},sfixed64:function(){return U.call(this)[P](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=k;var _=requireReader();(k.prototype=Object.create(_.prototype)).constructor=k;var q=requireMinimal$1();function k(D){_.call(this,D)}return k._configure=function(){q.Buffer&&(k.prototype._slice=q.Buffer.prototype.slice)},k.prototype.string=function(){var $=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+$,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+$,this.len))},k._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=q;var _=requireMinimal$1();(q.prototype=Object.create(_.EventEmitter.prototype)).constructor=q;function q(k,D,$){if(typeof k!="function")throw TypeError("rpcImpl must be a function");_.EventEmitter.call(this),this.rpcImpl=k,this.requestDelimited=!!D,this.responseDelimited=!!$}return q.prototype.rpcCall=function k(D,$,I,e,u){if(!e)throw TypeError("request must be specified");var N=this;if(!u)return _.asPromise(k,N,D,$,I,e);if(!N.rpcImpl){setTimeout(function(){u(Error("already ended"))},0);return}try{return N.rpcImpl(D,$[N.requestDelimited?"encodeDelimited":"encode"](e).finish(),function(U,L){if(U)return N.emit("error",U,D),u(U);if(L===null){N.end(!0);return}if(!(L instanceof I))try{L=I[N.responseDelimited?"decodeDelimited":"decode"](L)}catch(P){return N.emit("error",P,D),u(P)}return N.emit("data",L,D),u(null,L)})}catch(A){N.emit("error",A,D),setTimeout(function(){u(A)},0);return}},q.prototype.end=function(D){return this.rpcImpl&&(D||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,function(_){var q=_;q.Service=requireService()}(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(_){var q=_;q.build="minimal",q.Writer=requireWriter(),q.BufferWriter=requireWriter_buffer(),q.Reader=requireReader(),q.BufferReader=requireReader_buffer(),q.util=requireMinimal$1(),q.rpc=requireRpc(),q.roots=requireRoots(),q.configure=k;function k(){q.util._configure(),q.Writer._configure(q.BufferWriter),q.Reader._configure(q.BufferReader)}k()}(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 _={};return _.quick=function(){const q={};return q.voice=function(){const k={};return k.proto=function(){const D={};return D.CommonReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.event="",$.prototype.data=$util.newBuffer([]),$.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.version=0,$.prototype.compress=!1,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&u.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&u.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&u.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&u.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&u.uint32(40).int64(e.valid),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&u.uint32(48).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&u.uint32(56).bool(e.compress),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.CommonReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.event=e.string();break}case 2:{A.data=e.bytes();break}case 3:{A.sn=e.int64();break}case 4:{A.time=e.int64();break}case 5:{A.valid=e.int64();break}case 6:{A.version=e.int32();break}case 7:{A.compress=e.bool();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CommonReq)return e;let u=new $root.com.quick.voice.proto.CommonReq;return e.event!=null&&(u.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,u.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(u.data=e.data)),e.sn!=null&&($util.Long?(u.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?u.sn=parseInt(e.sn,10):typeof e.sn=="number"?u.sn=e.sn:typeof e.sn=="object"&&(u.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(u.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?u.time=parseInt(e.time,10):typeof e.time=="number"?u.time=e.time:typeof e.time=="object"&&(u.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(u.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?u.valid=parseInt(e.valid,10):typeof e.valid=="number"?u.valid=e.valid:typeof e.valid=="object"&&(u.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.version!=null&&(u.version=e.version|0),e.compress!=null&&(u.compress=!!e.compress),u},$.toObject=function(e,u){u||(u={});let N={};if(u.defaults){if(N.event="",u.bytes===String?N.data="":(N.data=[],u.bytes!==Array&&(N.data=$util.newBuffer(N.data))),$util.Long){let A=new $util.Long(0,0,!1);N.sn=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.sn=u.longs===String?"0":0;if($util.Long){let A=new $util.Long(0,0,!1);N.time=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.time=u.longs===String?"0":0;if($util.Long){let A=new $util.Long(0,0,!1);N.valid=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.valid=u.longs===String?"0":0;N.version=0,N.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(N.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(N.data=u.bytes===String?$util.base64.encode(e.data,0,e.data.length):u.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?N.sn=u.longs===String?String(e.sn):e.sn:N.sn=u.longs===String?$util.Long.prototype.toString.call(e.sn):u.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"?N.time=u.longs===String?String(e.time):e.time:N.time=u.longs===String?$util.Long.prototype.toString.call(e.time):u.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"?N.valid=u.longs===String?String(e.valid):e.valid:N.valid=u.longs===String?$util.Long.prototype.toString.call(e.valid):u.longs===Number?new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber():e.valid),e.version!=null&&e.hasOwnProperty("version")&&(N.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(N.compress=e.compress),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CommonReq"},$}(),D.CommonRsp=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.event="",$.prototype.data=$util.newBuffer([]),$.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.code=0,$.prototype.desc="",$.prototype.version=0,$.prototype.compress=!1,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&u.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&u.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&u.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&u.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&u.uint32(40).int64(e.valid),e.code!=null&&Object.hasOwnProperty.call(e,"code")&&u.uint32(48).int32(e.code),e.desc!=null&&Object.hasOwnProperty.call(e,"desc")&&u.uint32(58).string(e.desc),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&u.uint32(64).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&u.uint32(72).bool(e.compress),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.CommonRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.event=e.string();break}case 2:{A.data=e.bytes();break}case 3:{A.sn=e.int64();break}case 4:{A.time=e.int64();break}case 5:{A.valid=e.int64();break}case 6:{A.code=e.int32();break}case 7:{A.desc=e.string();break}case 8:{A.version=e.int32();break}case 9:{A.compress=e.bool();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CommonRsp)return e;let u=new $root.com.quick.voice.proto.CommonRsp;return e.event!=null&&(u.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,u.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(u.data=e.data)),e.sn!=null&&($util.Long?(u.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?u.sn=parseInt(e.sn,10):typeof e.sn=="number"?u.sn=e.sn:typeof e.sn=="object"&&(u.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(u.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?u.time=parseInt(e.time,10):typeof e.time=="number"?u.time=e.time:typeof e.time=="object"&&(u.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(u.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?u.valid=parseInt(e.valid,10):typeof e.valid=="number"?u.valid=e.valid:typeof e.valid=="object"&&(u.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.code!=null&&(u.code=e.code|0),e.desc!=null&&(u.desc=String(e.desc)),e.version!=null&&(u.version=e.version|0),e.compress!=null&&(u.compress=!!e.compress),u},$.toObject=function(e,u){u||(u={});let N={};if(u.defaults){if(N.event="",u.bytes===String?N.data="":(N.data=[],u.bytes!==Array&&(N.data=$util.newBuffer(N.data))),$util.Long){let A=new $util.Long(0,0,!1);N.sn=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.sn=u.longs===String?"0":0;if($util.Long){let A=new $util.Long(0,0,!1);N.time=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.time=u.longs===String?"0":0;if($util.Long){let A=new $util.Long(0,0,!1);N.valid=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.valid=u.longs===String?"0":0;N.code=0,N.desc="",N.version=0,N.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(N.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(N.data=u.bytes===String?$util.base64.encode(e.data,0,e.data.length):u.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?N.sn=u.longs===String?String(e.sn):e.sn:N.sn=u.longs===String?$util.Long.prototype.toString.call(e.sn):u.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"?N.time=u.longs===String?String(e.time):e.time:N.time=u.longs===String?$util.Long.prototype.toString.call(e.time):u.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"?N.valid=u.longs===String?String(e.valid):e.valid:N.valid=u.longs===String?$util.Long.prototype.toString.call(e.valid):u.longs===Number?new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber():e.valid),e.code!=null&&e.hasOwnProperty("code")&&(N.code=e.code),e.desc!=null&&e.hasOwnProperty("desc")&&(N.desc=e.desc),e.version!=null&&e.hasOwnProperty("version")&&(N.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(N.compress=e.compress),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CommonRsp"},$}(),D.User=function(){function $(e){if(this.tracks=[],e)for(let u=Object.keys(e),N=0;N<u.length;++N)e[u[N]]!=null&&(this[u[N]]=e[u[N]])}$.prototype.id="",$.prototype.callAction=null,$.prototype.callState=null,$.prototype.joinTime=null,$.prototype.tracks=$util.emptyArray,$.prototype.permissions=null,$.prototype.isPublished=null,$.prototype.behavior=null;let I;return Object.defineProperty($.prototype,"_callAction",{get:$util.oneOfGetter(I=["callAction"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_callState",{get:$util.oneOfGetter(I=["callState"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_joinTime",{get:$util.oneOfGetter(I=["joinTime"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_permissions",{get:$util.oneOfGetter(I=["permissions"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_isPublished",{get:$util.oneOfGetter(I=["isPublished"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_behavior",{get:$util.oneOfGetter(I=["behavior"]),set:$util.oneOfSetter(I)}),$.create=function(u){return new $(u)},$.encode=function(u,N){if(N||(N=$Writer.create()),u.id!=null&&Object.hasOwnProperty.call(u,"id")&&N.uint32(10).string(u.id),u.callAction!=null&&Object.hasOwnProperty.call(u,"callAction")&&N.uint32(16).int32(u.callAction),u.callState!=null&&Object.hasOwnProperty.call(u,"callState")&&N.uint32(24).int32(u.callState),u.joinTime!=null&&Object.hasOwnProperty.call(u,"joinTime")&&N.uint32(32).int64(u.joinTime),u.tracks!=null&&u.tracks.length)for(let A=0;A<u.tracks.length;++A)$root.com.quick.voice.proto.Track.encode(u.tracks[A],N.uint32(42).fork()).ldelim();return u.permissions!=null&&Object.hasOwnProperty.call(u,"permissions")&&N.uint32(48).int32(u.permissions),u.isPublished!=null&&Object.hasOwnProperty.call(u,"isPublished")&&N.uint32(56).bool(u.isPublished),u.behavior!=null&&Object.hasOwnProperty.call(u,"behavior")&&N.uint32(64).int32(u.behavior),N},$.encodeDelimited=function(u,N){return this.encode(u,N).ldelim()},$.decode=function(u,N){u instanceof $Reader||(u=$Reader.create(u));let A=N===void 0?u.len:u.pos+N,U=new $root.com.quick.voice.proto.User;for(;u.pos<A;){let L=u.uint32();switch(L>>>3){case 1:{U.id=u.string();break}case 2:{U.callAction=u.int32();break}case 3:{U.callState=u.int32();break}case 4:{U.joinTime=u.int64();break}case 5:{U.tracks&&U.tracks.length||(U.tracks=[]),U.tracks.push($root.com.quick.voice.proto.Track.decode(u,u.uint32()));break}case 6:{U.permissions=u.int32();break}case 7:{U.isPublished=u.bool();break}case 8:{U.behavior=u.int32();break}default:u.skipType(L&7);break}}return U},$.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},$.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.id!=null&&u.hasOwnProperty("id")&&!$util.isString(u.id))return"id: string expected";if(u.callAction!=null&&u.hasOwnProperty("callAction")&&!$util.isInteger(u.callAction))return"callAction: integer expected";if(u.callState!=null&&u.hasOwnProperty("callState")&&!$util.isInteger(u.callState))return"callState: integer expected";if(u.joinTime!=null&&u.hasOwnProperty("joinTime")&&!$util.isInteger(u.joinTime)&&!(u.joinTime&&$util.isInteger(u.joinTime.low)&&$util.isInteger(u.joinTime.high)))return"joinTime: integer|Long expected";if(u.tracks!=null&&u.hasOwnProperty("tracks")){if(!Array.isArray(u.tracks))return"tracks: array expected";for(let N=0;N<u.tracks.length;++N){let A=$root.com.quick.voice.proto.Track.verify(u.tracks[N]);if(A)return"tracks."+A}}return u.permissions!=null&&u.hasOwnProperty("permissions")&&!$util.isInteger(u.permissions)?"permissions: integer expected":u.isPublished!=null&&u.hasOwnProperty("isPublished")&&typeof u.isPublished!="boolean"?"isPublished: boolean expected":u.behavior!=null&&u.hasOwnProperty("behavior")&&!$util.isInteger(u.behavior)?"behavior: integer expected":null},$.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.User)return u;let N=new $root.com.quick.voice.proto.User;if(u.id!=null&&(N.id=String(u.id)),u.callAction!=null&&(N.callAction=u.callAction|0),u.callState!=null&&(N.callState=u.callState|0),u.joinTime!=null&&($util.Long?(N.joinTime=$util.Long.fromValue(u.joinTime)).unsigned=!1:typeof u.joinTime=="string"?N.joinTime=parseInt(u.joinTime,10):typeof u.joinTime=="number"?N.joinTime=u.joinTime:typeof u.joinTime=="object"&&(N.joinTime=new $util.LongBits(u.joinTime.low>>>0,u.joinTime.high>>>0).toNumber())),u.tracks){if(!Array.isArray(u.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");N.tracks=[];for(let A=0;A<u.tracks.length;++A){if(typeof u.tracks[A]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");N.tracks[A]=$root.com.quick.voice.proto.Track.fromObject(u.tracks[A])}}return u.permissions!=null&&(N.permissions=u.permissions|0),u.isPublished!=null&&(N.isPublished=!!u.isPublished),u.behavior!=null&&(N.behavior=u.behavior|0),N},$.toObject=function(u,N){N||(N={});let A={};if((N.arrays||N.defaults)&&(A.tracks=[]),N.defaults&&(A.id=""),u.id!=null&&u.hasOwnProperty("id")&&(A.id=u.id),u.callAction!=null&&u.hasOwnProperty("callAction")&&(A.callAction=u.callAction,N.oneofs&&(A._callAction="callAction")),u.callState!=null&&u.hasOwnProperty("callState")&&(A.callState=u.callState,N.oneofs&&(A._callState="callState")),u.joinTime!=null&&u.hasOwnProperty("joinTime")&&(typeof u.joinTime=="number"?A.joinTime=N.longs===String?String(u.joinTime):u.joinTime:A.joinTime=N.longs===String?$util.Long.prototype.toString.call(u.joinTime):N.longs===Number?new $util.LongBits(u.joinTime.low>>>0,u.joinTime.high>>>0).toNumber():u.joinTime,N.oneofs&&(A._joinTime="joinTime")),u.tracks&&u.tracks.length){A.tracks=[];for(let U=0;U<u.tracks.length;++U)A.tracks[U]=$root.com.quick.voice.proto.Track.toObject(u.tracks[U],N)}return u.permissions!=null&&u.hasOwnProperty("permissions")&&(A.permissions=u.permissions,N.oneofs&&(A._permissions="permissions")),u.isPublished!=null&&u.hasOwnProperty("isPublished")&&(A.isPublished=u.isPublished,N.oneofs&&(A._isPublished="isPublished")),u.behavior!=null&&u.hasOwnProperty("behavior")&&(A.behavior=u.behavior,N.oneofs&&(A._behavior="behavior")),A},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.User"},$}(),D.Login=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.appid="",$.prototype.userId="",$.prototype.sdkToken="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.appid!=null&&Object.hasOwnProperty.call(e,"appid")&&u.uint32(10).string(e.appid),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&u.uint32(18).string(e.userId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&u.uint32(26).string(e.sdkToken),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.Login;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.appid=e.string();break}case 2:{A.userId=e.string();break}case 3:{A.sdkToken=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.Login)return e;let u=new $root.com.quick.voice.proto.Login;return e.appid!=null&&(u.appid=String(e.appid)),e.userId!=null&&(u.userId=String(e.userId)),e.sdkToken!=null&&(u.sdkToken=String(e.sdkToken)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.appid="",N.userId="",N.sdkToken=""),e.appid!=null&&e.hasOwnProperty("appid")&&(N.appid=e.appid),e.userId!=null&&e.hasOwnProperty("userId")&&(N.userId=e.userId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(N.sdkToken=e.sdkToken),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.Login"},$}(),D.Track=function(){function $(e){if(e)for(let u=Object.keys(e),N=0;N<u.length;++N)e[u[N]]!=null&&(this[u[N]]=e[u[N]])}$.prototype.mid="",$.prototype.trackName=null,$.prototype.location=null,$.prototype.userId=null,$.prototype.code=null,$.prototype.desc=null,$.prototype.type=null,$.prototype.isValid=null;let I;return Object.defineProperty($.prototype,"_trackName",{get:$util.oneOfGetter(I=["trackName"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_location",{get:$util.oneOfGetter(I=["location"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_userId",{get:$util.oneOfGetter(I=["userId"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_code",{get:$util.oneOfGetter(I=["code"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_desc",{get:$util.oneOfGetter(I=["desc"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_type",{get:$util.oneOfGetter(I=["type"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_isValid",{get:$util.oneOfGetter(I=["isValid"]),set:$util.oneOfSetter(I)}),$.create=function(u){return new $(u)},$.encode=function(u,N){return N||(N=$Writer.create()),u.mid!=null&&Object.hasOwnProperty.call(u,"mid")&&N.uint32(10).string(u.mid),u.trackName!=null&&Object.hasOwnProperty.call(u,"trackName")&&N.uint32(18).string(u.trackName),u.location!=null&&Object.hasOwnProperty.call(u,"location")&&N.uint32(26).string(u.location),u.userId!=null&&Object.hasOwnProperty.call(u,"userId")&&N.uint32(34).string(u.userId),u.code!=null&&Object.hasOwnProperty.call(u,"code")&&N.uint32(40).int32(u.code),u.desc!=null&&Object.hasOwnProperty.call(u,"desc")&&N.uint32(50).string(u.desc),u.type!=null&&Object.hasOwnProperty.call(u,"type")&&N.uint32(56).int32(u.type),u.isValid!=null&&Object.hasOwnProperty.call(u,"isValid")&&N.uint32(64).bool(u.isValid),N},$.encodeDelimited=function(u,N){return this.encode(u,N).ldelim()},$.decode=function(u,N){u instanceof $Reader||(u=$Reader.create(u));let A=N===void 0?u.len:u.pos+N,U=new $root.com.quick.voice.proto.Track;for(;u.pos<A;){let L=u.uint32();switch(L>>>3){case 1:{U.mid=u.string();break}case 2:{U.trackName=u.string();break}case 3:{U.location=u.string();break}case 4:{U.userId=u.string();break}case 5:{U.code=u.int32();break}case 6:{U.desc=u.string();break}case 7:{U.type=u.int32();break}case 8:{U.isValid=u.bool();break}default:u.skipType(L&7);break}}return U},$.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},$.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.mid!=null&&u.hasOwnProperty("mid")&&!$util.isString(u.mid))return"mid: string expected";if(u.trackName!=null&&u.hasOwnProperty("trackName")&&!$util.isString(u.trackName))return"trackName: string expected";if(u.location!=null&&u.hasOwnProperty("location")&&!$util.isString(u.location))return"location: string expected";if(u.userId!=null&&u.hasOwnProperty("userId")&&!$util.isString(u.userId))return"userId: string expected";if(u.code!=null&&u.hasOwnProperty("code")&&!$util.isInteger(u.code))return"code: integer expected";if(u.desc!=null&&u.hasOwnProperty("desc")&&!$util.isString(u.desc))return"desc: string expected";if(u.type!=null&&u.hasOwnProperty("type"))switch(u.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return u.isValid!=null&&u.hasOwnProperty("isValid")&&typeof u.isValid!="boolean"?"isValid: boolean expected":null},$.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.Track)return u;let N=new $root.com.quick.voice.proto.Track;switch(u.mid!=null&&(N.mid=String(u.mid)),u.trackName!=null&&(N.trackName=String(u.trackName)),u.location!=null&&(N.location=String(u.location)),u.userId!=null&&(N.userId=String(u.userId)),u.code!=null&&(N.code=u.code|0),u.desc!=null&&(N.desc=String(u.desc)),u.type){default:if(typeof u.type=="number"){N.type=u.type;break}break;case"Microphone":case 0:N.type=0;break;case"Camera":case 1:N.type=1;break;case"Screen":case 2:N.type=2;break;case"SystemVoice":case 3:N.type=3;break}return u.isValid!=null&&(N.isValid=!!u.isValid),N},$.toObject=function(u,N){N||(N={});let A={};return N.defaults&&(A.mid=""),u.mid!=null&&u.hasOwnProperty("mid")&&(A.mid=u.mid),u.trackName!=null&&u.hasOwnProperty("trackName")&&(A.trackName=u.trackName,N.oneofs&&(A._trackName="trackName")),u.location!=null&&u.hasOwnProperty("location")&&(A.location=u.location,N.oneofs&&(A._location="location")),u.userId!=null&&u.hasOwnProperty("userId")&&(A.userId=u.userId,N.oneofs&&(A._userId="userId")),u.code!=null&&u.hasOwnProperty("code")&&(A.code=u.code,N.oneofs&&(A._code="code")),u.desc!=null&&u.hasOwnProperty("desc")&&(A.desc=u.desc,N.oneofs&&(A._desc="desc")),u.type!=null&&u.hasOwnProperty("type")&&(A.type=N.enums===String?$root.com.quick.voice.proto.TrackType[u.type]===void 0?u.type:$root.com.quick.voice.proto.TrackType[u.type]:u.type,N.oneofs&&(A._type="type")),u.isValid!=null&&u.hasOwnProperty("isValid")&&(A.isValid=u.isValid,N.oneofs&&(A._isValid="isValid")),A},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.Track"},$}(),D.JoinReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.user=null,$.prototype.callType=0,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(18).fork()).ldelim(),e.callType!=null&&Object.hasOwnProperty.call(e,"callType")&&u.uint32(24).int32(e.callType),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.JoinReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}case 3:{A.callType=e.int32();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}if(e.callType!=null&&e.hasOwnProperty("callType"))switch(e.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinReq)return e;let u=new $root.com.quick.voice.proto.JoinReq;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}switch(e.callType){default:if(typeof e.callType=="number"){u.callType=e.callType;break}break;case"Normal":case 0:u.callType=0;break;case"Meeting":case 1:u.callType=1;break;case"Live":case 2:u.callType=2;break}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.user=null,N.callType=u.enums===String?"Normal":0),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),e.callType!=null&&e.hasOwnProperty("callType")&&(N.callType=u.enums===String?$root.com.quick.voice.proto.CallType[e.callType]===void 0?e.callType:$root.com.quick.voice.proto.CallType[e.callType]:e.callType),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinReq"},$}(),D.JoinRsp=function(){function $(I){if(this.roomUsers=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.roomUsers=$util.emptyArray,$.prototype.callType=0,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.roomUsers!=null&&e.roomUsers.length)for(let N=0;N<e.roomUsers.length;++N)$root.com.quick.voice.proto.User.encode(e.roomUsers[N],u.uint32(18).fork()).ldelim();return e.callType!=null&&Object.hasOwnProperty.call(e,"callType")&&u.uint32(24).int32(e.callType),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.JoinRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.roomUsers&&A.roomUsers.length||(A.roomUsers=[]),A.roomUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 3:{A.callType=e.int32();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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.roomUsers!=null&&e.hasOwnProperty("roomUsers")){if(!Array.isArray(e.roomUsers))return"roomUsers: array expected";for(let u=0;u<e.roomUsers.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.roomUsers[u]);if(N)return"roomUsers."+N}}if(e.callType!=null&&e.hasOwnProperty("callType"))switch(e.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinRsp)return e;let u=new $root.com.quick.voice.proto.JoinRsp;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.roomUsers){if(!Array.isArray(e.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");u.roomUsers=[];for(let N=0;N<e.roomUsers.length;++N){if(typeof e.roomUsers[N]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");u.roomUsers[N]=$root.com.quick.voice.proto.User.fromObject(e.roomUsers[N])}}switch(e.callType){default:if(typeof e.callType=="number"){u.callType=e.callType;break}break;case"Normal":case 0:u.callType=0;break;case"Meeting":case 1:u.callType=1;break;case"Live":case 2:u.callType=2;break}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.roomUsers=[]),u.defaults&&(N.roomId="",N.callType=u.enums===String?"Normal":0),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.roomUsers&&e.roomUsers.length){N.roomUsers=[];for(let A=0;A<e.roomUsers.length;++A)N.roomUsers[A]=$root.com.quick.voice.proto.User.toObject(e.roomUsers[A],u)}return e.callType!=null&&e.hasOwnProperty("callType")&&(N.callType=u.enums===String?$root.com.quick.voice.proto.CallType[e.callType]===void 0?e.callType:$root.com.quick.voice.proto.CallType[e.callType]:e.callType),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinRsp"},$}(),D.JoinNotify=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.user=null,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(18).fork()).ldelim(),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.JoinNotify;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinNotify)return e;let u=new $root.com.quick.voice.proto.JoinNotify;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinNotify"},$}(),D.ConnectCFReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.sdp="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&u.uint32(10).string(e.sdp),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.ConnectCFReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.sdp=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ConnectCFReq)return e;let u=new $root.com.quick.voice.proto.ConnectCFReq;return e.sdp!=null&&(u.sdp=String(e.sdp)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.sdp=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(N.sdp=e.sdp),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ConnectCFReq"},$}(),D.ConnectCFRsp=function(){function $(I){if(this.subscribeUsers=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.remoteSdp="",$.prototype.subscribeUsers=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&u.uint32(10).string(e.remoteSdp),e.subscribeUsers!=null&&e.subscribeUsers.length)for(let N=0;N<e.subscribeUsers.length;++N)$root.com.quick.voice.proto.User.encode(e.subscribeUsers[N],u.uint32(18).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.ConnectCFRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.remoteSdp=e.string();break}case 2:{A.subscribeUsers&&A.subscribeUsers.length||(A.subscribeUsers=[]),A.subscribeUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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.subscribeUsers!=null&&e.hasOwnProperty("subscribeUsers")){if(!Array.isArray(e.subscribeUsers))return"subscribeUsers: array expected";for(let u=0;u<e.subscribeUsers.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.subscribeUsers[u]);if(N)return"subscribeUsers."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ConnectCFRsp)return e;let u=new $root.com.quick.voice.proto.ConnectCFRsp;if(e.remoteSdp!=null&&(u.remoteSdp=String(e.remoteSdp)),e.subscribeUsers){if(!Array.isArray(e.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");u.subscribeUsers=[];for(let N=0;N<e.subscribeUsers.length;++N){if(typeof e.subscribeUsers[N]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");u.subscribeUsers[N]=$root.com.quick.voice.proto.User.fromObject(e.subscribeUsers[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.subscribeUsers=[]),u.defaults&&(N.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(N.remoteSdp=e.remoteSdp),e.subscribeUsers&&e.subscribeUsers.length){N.subscribeUsers=[];for(let A=0;A<e.subscribeUsers.length;++A)N.subscribeUsers[A]=$root.com.quick.voice.proto.User.toObject(e.subscribeUsers[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ConnectCFRsp"},$}(),D.PublishReq=function(){function $(e){if(this.tracks=[],e)for(let u=Object.keys(e),N=0;N<u.length;++N)e[u[N]]!=null&&(this[u[N]]=e[u[N]])}$.prototype.sdp="",$.prototype.tracks=$util.emptyArray,$.prototype.callAction=0,$.prototype.recreate=null;let I;return Object.defineProperty($.prototype,"_recreate",{get:$util.oneOfGetter(I=["recreate"]),set:$util.oneOfSetter(I)}),$.create=function(u){return new $(u)},$.encode=function(u,N){if(N||(N=$Writer.create()),u.sdp!=null&&Object.hasOwnProperty.call(u,"sdp")&&N.uint32(10).string(u.sdp),u.tracks!=null&&u.tracks.length)for(let A=0;A<u.tracks.length;++A)$root.com.quick.voice.proto.Track.encode(u.tracks[A],N.uint32(18).fork()).ldelim();return u.callAction!=null&&Object.hasOwnProperty.call(u,"callAction")&&N.uint32(24).int32(u.callAction),u.recreate!=null&&Object.hasOwnProperty.call(u,"recreate")&&N.uint32(32).bool(u.recreate),N},$.encodeDelimited=function(u,N){return this.encode(u,N).ldelim()},$.decode=function(u,N){u instanceof $Reader||(u=$Reader.create(u));let A=N===void 0?u.len:u.pos+N,U=new $root.com.quick.voice.proto.PublishReq;for(;u.pos<A;){let L=u.uint32();switch(L>>>3){case 1:{U.sdp=u.string();break}case 2:{U.tracks&&U.tracks.length||(U.tracks=[]),U.tracks.push($root.com.quick.voice.proto.Track.decode(u,u.uint32()));break}case 3:{U.callAction=u.int32();break}case 4:{U.recreate=u.bool();break}default:u.skipType(L&7);break}}return U},$.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},$.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.sdp!=null&&u.hasOwnProperty("sdp")&&!$util.isString(u.sdp))return"sdp: string expected";if(u.tracks!=null&&u.hasOwnProperty("tracks")){if(!Array.isArray(u.tracks))return"tracks: array expected";for(let N=0;N<u.tracks.length;++N){let A=$root.com.quick.voice.proto.Track.verify(u.tracks[N]);if(A)return"tracks."+A}}return u.callAction!=null&&u.hasOwnProperty("callAction")&&!$util.isInteger(u.callAction)?"callAction: integer expected":u.recreate!=null&&u.hasOwnProperty("recreate")&&typeof u.recreate!="boolean"?"recreate: boolean expected":null},$.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.PublishReq)return u;let N=new $root.com.quick.voice.proto.PublishReq;if(u.sdp!=null&&(N.sdp=String(u.sdp)),u.tracks){if(!Array.isArray(u.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");N.tracks=[];for(let A=0;A<u.tracks.length;++A){if(typeof u.tracks[A]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");N.tracks[A]=$root.com.quick.voice.proto.Track.fromObject(u.tracks[A])}}return u.callAction!=null&&(N.callAction=u.callAction|0),u.recreate!=null&&(N.recreate=!!u.recreate),N},$.toObject=function(u,N){N||(N={});let A={};if((N.arrays||N.defaults)&&(A.tracks=[]),N.defaults&&(A.sdp="",A.callAction=0),u.sdp!=null&&u.hasOwnProperty("sdp")&&(A.sdp=u.sdp),u.tracks&&u.tracks.length){A.tracks=[];for(let U=0;U<u.tracks.length;++U)A.tracks[U]=$root.com.quick.voice.proto.Track.toObject(u.tracks[U],N)}return u.callAction!=null&&u.hasOwnProperty("callAction")&&(A.callAction=u.callAction),u.recreate!=null&&u.hasOwnProperty("recreate")&&(A.recreate=u.recreate,N.oneofs&&(A._recreate="recreate")),A},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.PublishReq"},$}(),D.PublishRsp=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.remoteSdp="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&u.uint32(10).string(e.remoteSdp),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.PublishRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.remoteSdp=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){return typeof e!="object"||e===null?"object expected":e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&!$util.isString(e.remoteSdp)?"remoteSdp: string expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PublishRsp)return e;let u=new $root.com.quick.voice.proto.PublishRsp;return e.remoteSdp!=null&&(u.remoteSdp=String(e.remoteSdp)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(N.remoteSdp=e.remoteSdp),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PublishRsp"},$}(),D.PublishNotify=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.user=null,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(18).fork()).ldelim(),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.PublishNotify;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PublishNotify)return e;let u=new $root.com.quick.voice.proto.PublishNotify;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PublishNotify"},$}(),D.SubscribeReq=function(){function $(I){if(this.users=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.users=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.users!=null&&e.users.length)for(let N=0;N<e.users.length;++N)$root.com.quick.voice.proto.User.encode(e.users[N],u.uint32(10).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.SubscribeReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.users&&A.users.length||(A.users=[]),A.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=0;u<e.users.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.users[u]);if(N)return"users."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SubscribeReq)return e;let u=new $root.com.quick.voice.proto.SubscribeReq;if(e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");u.users=[];for(let N=0;N<e.users.length;++N){if(typeof e.users[N]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");u.users[N]=$root.com.quick.voice.proto.User.fromObject(e.users[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.users=[]),e.users&&e.users.length){N.users=[];for(let A=0;A<e.users.length;++A)N.users[A]=$root.com.quick.voice.proto.User.toObject(e.users[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SubscribeReq"},$}(),D.SubscribeRsp=function(){function $(I){if(this.users=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.remoteSdp="",$.prototype.users=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&u.uint32(10).string(e.remoteSdp),e.users!=null&&e.users.length)for(let N=0;N<e.users.length;++N)$root.com.quick.voice.proto.User.encode(e.users[N],u.uint32(18).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.SubscribeRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.remoteSdp=e.string();break}case 2:{A.users&&A.users.length||(A.users=[]),A.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let u=0;u<e.users.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.users[u]);if(N)return"users."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SubscribeRsp)return e;let u=new $root.com.quick.voice.proto.SubscribeRsp;if(e.remoteSdp!=null&&(u.remoteSdp=String(e.remoteSdp)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");u.users=[];for(let N=0;N<e.users.length;++N){if(typeof e.users[N]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");u.users[N]=$root.com.quick.voice.proto.User.fromObject(e.users[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.users=[]),u.defaults&&(N.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(N.remoteSdp=e.remoteSdp),e.users&&e.users.length){N.users=[];for(let A=0;A<e.users.length;++A)N.users[A]=$root.com.quick.voice.proto.User.toObject(e.users[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SubscribeRsp"},$}(),D.RenegotiateReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.userId="",$.prototype.sdp="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&u.uint32(10).string(e.userId),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&u.uint32(18).string(e.sdp),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.RenegotiateReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.userId=e.string();break}case 2:{A.sdp=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.RenegotiateReq)return e;let u=new $root.com.quick.voice.proto.RenegotiateReq;return e.userId!=null&&(u.userId=String(e.userId)),e.sdp!=null&&(u.sdp=String(e.sdp)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.userId="",N.sdp=""),e.userId!=null&&e.hasOwnProperty("userId")&&(N.userId=e.userId),e.sdp!=null&&e.hasOwnProperty("sdp")&&(N.sdp=e.sdp),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.RenegotiateReq"},$}(),D.QuitReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.userId="",$.prototype.roomId="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&u.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(18).string(e.roomId),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.QuitReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.userId=e.string();break}case 2:{A.roomId=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.QuitReq)return e;let u=new $root.com.quick.voice.proto.QuitReq;return e.userId!=null&&(u.userId=String(e.userId)),e.roomId!=null&&(u.roomId=String(e.roomId)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.userId="",N.roomId=""),e.userId!=null&&e.hasOwnProperty("userId")&&(N.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.QuitReq"},$}(),D.QuitNotify=function(){function $(e){if(e)for(let u=Object.keys(e),N=0;N<u.length;++N)e[u[N]]!=null&&(this[u[N]]=e[u[N]])}$.prototype.roomId="",$.prototype.user=null,$.prototype.code=null,$.prototype.desc=null;let I;return Object.defineProperty($.prototype,"_code",{get:$util.oneOfGetter(I=["code"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_desc",{get:$util.oneOfGetter(I=["desc"]),set:$util.oneOfSetter(I)}),$.create=function(u){return new $(u)},$.encode=function(u,N){return N||(N=$Writer.create()),u.roomId!=null&&Object.hasOwnProperty.call(u,"roomId")&&N.uint32(10).string(u.roomId),u.user!=null&&Object.hasOwnProperty.call(u,"user")&&$root.com.quick.voice.proto.User.encode(u.user,N.uint32(18).fork()).ldelim(),u.code!=null&&Object.hasOwnProperty.call(u,"code")&&N.uint32(24).int32(u.code),u.desc!=null&&Object.hasOwnProperty.call(u,"desc")&&N.uint32(34).string(u.desc),N},$.encodeDelimited=function(u,N){return this.encode(u,N).ldelim()},$.decode=function(u,N){u instanceof $Reader||(u=$Reader.create(u));let A=N===void 0?u.len:u.pos+N,U=new $root.com.quick.voice.proto.QuitNotify;for(;u.pos<A;){let L=u.uint32();switch(L>>>3){case 1:{U.roomId=u.string();break}case 2:{U.user=$root.com.quick.voice.proto.User.decode(u,u.uint32());break}case 3:{U.code=u.int32();break}case 4:{U.desc=u.string();break}default:u.skipType(L&7);break}}return U},$.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},$.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.roomId!=null&&u.hasOwnProperty("roomId")&&!$util.isString(u.roomId))return"roomId: string expected";if(u.user!=null&&u.hasOwnProperty("user")){let N=$root.com.quick.voice.proto.User.verify(u.user);if(N)return"user."+N}return u.code!=null&&u.hasOwnProperty("code")&&!$util.isInteger(u.code)?"code: integer expected":u.desc!=null&&u.hasOwnProperty("desc")&&!$util.isString(u.desc)?"desc: string expected":null},$.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.QuitNotify)return u;let N=new $root.com.quick.voice.proto.QuitNotify;if(u.roomId!=null&&(N.roomId=String(u.roomId)),u.user!=null){if(typeof u.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");N.user=$root.com.quick.voice.proto.User.fromObject(u.user)}return u.code!=null&&(N.code=u.code|0),u.desc!=null&&(N.desc=String(u.desc)),N},$.toObject=function(u,N){N||(N={});let A={};return N.defaults&&(A.roomId="",A.user=null),u.roomId!=null&&u.hasOwnProperty("roomId")&&(A.roomId=u.roomId),u.user!=null&&u.hasOwnProperty("user")&&(A.user=$root.com.quick.voice.proto.User.toObject(u.user,N)),u.code!=null&&u.hasOwnProperty("code")&&(A.code=u.code,N.oneofs&&(A._code="code")),u.desc!=null&&u.hasOwnProperty("desc")&&(A.desc=u.desc,N.oneofs&&(A._desc="desc")),A},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.QuitNotify"},$}(),D.TokenExpireNotify=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.TokenExpireNotify;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.TokenExpireNotify)return e;let u=new $root.com.quick.voice.proto.TokenExpireNotify;return e.roomId!=null&&(u.roomId=String(e.roomId)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.TokenExpireNotify"},$}(),D.UpdateTokenReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.sdkToken="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&u.uint32(18).string(e.sdkToken),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.UpdateTokenReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.sdkToken=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTokenReq)return e;let u=new $root.com.quick.voice.proto.UpdateTokenReq;return e.roomId!=null&&(u.roomId=String(e.roomId)),e.sdkToken!=null&&(u.sdkToken=String(e.sdkToken)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.sdkToken=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(N.sdkToken=e.sdkToken),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTokenReq"},$}(),D.NetQualityChange=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.userId="",$.prototype.roomId="",$.prototype.egress=0,$.prototype.ingress=0,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&u.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(18).string(e.roomId),e.egress!=null&&Object.hasOwnProperty.call(e,"egress")&&u.uint32(24).int32(e.egress),e.ingress!=null&&Object.hasOwnProperty.call(e,"ingress")&&u.uint32(32).int32(e.ingress),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.NetQualityChange;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.userId=e.string();break}case 2:{A.roomId=e.string();break}case 3:{A.egress=e.int32();break}case 4:{A.ingress=e.int32();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.NetQualityChange)return e;let u=new $root.com.quick.voice.proto.NetQualityChange;return e.userId!=null&&(u.userId=String(e.userId)),e.roomId!=null&&(u.roomId=String(e.roomId)),e.egress!=null&&(u.egress=e.egress|0),e.ingress!=null&&(u.ingress=e.ingress|0),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.userId="",N.roomId="",N.egress=0,N.ingress=0),e.userId!=null&&e.hasOwnProperty("userId")&&(N.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.egress!=null&&e.hasOwnProperty("egress")&&(N.egress=e.egress),e.ingress!=null&&e.hasOwnProperty("ingress")&&(N.ingress=e.ingress),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.NetQualityChange"},$}(),D.NetQualityNotify=function(){function $(I){if(this.qualities=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.qualities=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.qualities!=null&&e.qualities.length)for(let N=0;N<e.qualities.length;++N)$root.com.quick.voice.proto.NetQualityChange.encode(e.qualities[N],u.uint32(10).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.NetQualityNotify;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.qualities&&A.qualities.length||(A.qualities=[]),A.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=0;u<e.qualities.length;++u){let N=$root.com.quick.voice.proto.NetQualityChange.verify(e.qualities[u]);if(N)return"qualities."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.NetQualityNotify)return e;let u=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");u.qualities=[];for(let N=0;N<e.qualities.length;++N){if(typeof e.qualities[N]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");u.qualities[N]=$root.com.quick.voice.proto.NetQualityChange.fromObject(e.qualities[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.qualities=[]),e.qualities&&e.qualities.length){N.qualities=[];for(let A=0;A<e.qualities.length;++A)N.qualities[A]=$root.com.quick.voice.proto.NetQualityChange.toObject(e.qualities[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.NetQualityNotify"},$}(),D.UpdateCall=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.user=null,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(18).fork()).ldelim(),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.UpdateCall;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateCall)return e;let u=new $root.com.quick.voice.proto.UpdateCall;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateCall"},$}(),D.SyncRoomInfoReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.user=null,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(18).fork()).ldelim(),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return e;let u=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SyncRoomInfoReq"},$}(),D.SyncRoomInfoRsp=function(){function $(I){if(this.users=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.isValid=!1,$.prototype.users=$util.emptyArray,$.prototype.isActive=!1,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.isValid!=null&&Object.hasOwnProperty.call(e,"isValid")&&u.uint32(16).bool(e.isValid),e.users!=null&&e.users.length)for(let N=0;N<e.users.length;++N)$root.com.quick.voice.proto.User.encode(e.users[N],u.uint32(26).fork()).ldelim();return e.isActive!=null&&Object.hasOwnProperty.call(e,"isActive")&&u.uint32(32).bool(e.isActive),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.isValid=e.bool();break}case 3:{A.users&&A.users.length||(A.users=[]),A.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 4:{A.isActive=e.bool();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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.isValid!=null&&e.hasOwnProperty("isValid")&&typeof e.isValid!="boolean")return"isValid: boolean expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let u=0;u<e.users.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.users[u]);if(N)return"users."+N}}return e.isActive!=null&&e.hasOwnProperty("isActive")&&typeof e.isActive!="boolean"?"isActive: boolean expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return e;let u=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.isValid!=null&&(u.isValid=!!e.isValid),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");u.users=[];for(let N=0;N<e.users.length;++N){if(typeof e.users[N]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");u.users[N]=$root.com.quick.voice.proto.User.fromObject(e.users[N])}}return e.isActive!=null&&(u.isActive=!!e.isActive),u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.users=[]),u.defaults&&(N.roomId="",N.isValid=!1,N.isActive=!1),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.isValid!=null&&e.hasOwnProperty("isValid")&&(N.isValid=e.isValid),e.users&&e.users.length){N.users=[];for(let A=0;A<e.users.length;++A)N.users[A]=$root.com.quick.voice.proto.User.toObject(e.users[A],u)}return e.isActive!=null&&e.hasOwnProperty("isActive")&&(N.isActive=e.isActive),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SyncRoomInfoRsp"},$}(),D.UpdateTime=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&u.uint32(8).int64(e.time),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.UpdateTime;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.time=e.int64();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTime)return e;let u=new $root.com.quick.voice.proto.UpdateTime;return e.time!=null&&($util.Long?(u.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?u.time=parseInt(e.time,10):typeof e.time=="number"?u.time=e.time:typeof e.time=="object"&&(u.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),u},$.toObject=function(e,u){u||(u={});let N={};if(u.defaults)if($util.Long){let A=new $util.Long(0,0,!1);N.time=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.time=u.longs===String?"0":0;return e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?N.time=u.longs===String?String(e.time):e.time:N.time=u.longs===String?$util.Long.prototype.toString.call(e.time):u.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTime"},$}(),D.CloseTrackReq=function(){function $(I){if(this.tracks=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.sdp="",$.prototype.tracks=$util.emptyArray,$.prototype.roomId="",$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&u.uint32(10).string(e.sdp),e.tracks!=null&&e.tracks.length)for(let N=0;N<e.tracks.length;++N)$root.com.quick.voice.proto.Track.encode(e.tracks[N],u.uint32(18).fork()).ldelim();return e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(26).string(e.roomId),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.CloseTrackReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.sdp=e.string();break}case 2:{A.tracks&&A.tracks.length||(A.tracks=[]),A.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}case 3:{A.roomId=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=0;u<e.tracks.length;++u){let N=$root.com.quick.voice.proto.Track.verify(e.tracks[u]);if(N)return"tracks."+N}}return e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackReq)return e;let u=new $root.com.quick.voice.proto.CloseTrackReq;if(e.sdp!=null&&(u.sdp=String(e.sdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");u.tracks=[];for(let N=0;N<e.tracks.length;++N){if(typeof e.tracks[N]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");u.tracks[N]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[N])}}return e.roomId!=null&&(u.roomId=String(e.roomId)),u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.tracks=[]),u.defaults&&(N.sdp="",N.roomId=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(N.sdp=e.sdp),e.tracks&&e.tracks.length){N.tracks=[];for(let A=0;A<e.tracks.length;++A)N.tracks[A]=$root.com.quick.voice.proto.Track.toObject(e.tracks[A],u)}return e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackReq"},$}(),D.CloseTrackRsp=function(){function $(I){if(this.tracks=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.remoteSdp="",$.prototype.tracks=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&u.uint32(10).string(e.remoteSdp),e.tracks!=null&&e.tracks.length)for(let N=0;N<e.tracks.length;++N)$root.com.quick.voice.proto.Track.encode(e.tracks[N],u.uint32(18).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.CloseTrackRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.remoteSdp=e.string();break}case 2:{A.tracks&&A.tracks.length||(A.tracks=[]),A.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=0;u<e.tracks.length;++u){let N=$root.com.quick.voice.proto.Track.verify(e.tracks[u]);if(N)return"tracks."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackRsp)return e;let u=new $root.com.quick.voice.proto.CloseTrackRsp;if(e.remoteSdp!=null&&(u.remoteSdp=String(e.remoteSdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");u.tracks=[];for(let N=0;N<e.tracks.length;++N){if(typeof e.tracks[N]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");u.tracks[N]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.tracks=[]),u.defaults&&(N.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(N.remoteSdp=e.remoteSdp),e.tracks&&e.tracks.length){N.tracks=[];for(let A=0;A<e.tracks.length;++A)N.tracks[A]=$root.com.quick.voice.proto.Track.toObject(e.tracks[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackRsp"},$}(),D.CloseTrackNotify=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.user=null,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(10).fork()).ldelim(),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.CloseTrackNotify;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.user!=null&&e.hasOwnProperty("user")){let u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackNotify)return e;let u=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");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.user=null),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackNotify"},$}(),D.ToggleLiveRoomReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.ToggleLiveRoomReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ToggleLiveRoomReq)return e;let u=new $root.com.quick.voice.proto.ToggleLiveRoomReq;return e.roomId!=null&&(u.roomId=String(e.roomId)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ToggleLiveRoomReq"},$}(),D.ToggleLiveRoomRsq=function(){function $(I){if(this.roomUsers=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.hash="",$.prototype.roomUsers=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.hash!=null&&Object.hasOwnProperty.call(e,"hash")&&u.uint32(18).string(e.hash),e.roomUsers!=null&&e.roomUsers.length)for(let N=0;N<e.roomUsers.length;++N)$root.com.quick.voice.proto.User.encode(e.roomUsers[N],u.uint32(26).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.hash=e.string();break}case 3:{A.roomUsers&&A.roomUsers.length||(A.roomUsers=[]),A.roomUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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.hash!=null&&e.hasOwnProperty("hash")&&!$util.isString(e.hash))return"hash: string expected";if(e.roomUsers!=null&&e.hasOwnProperty("roomUsers")){if(!Array.isArray(e.roomUsers))return"roomUsers: array expected";for(let u=0;u<e.roomUsers.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.roomUsers[u]);if(N)return"roomUsers."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ToggleLiveRoomRsq)return e;let u=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.hash!=null&&(u.hash=String(e.hash)),e.roomUsers){if(!Array.isArray(e.roomUsers))throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: array expected");u.roomUsers=[];for(let N=0;N<e.roomUsers.length;++N){if(typeof e.roomUsers[N]!="object")throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: object expected");u.roomUsers[N]=$root.com.quick.voice.proto.User.fromObject(e.roomUsers[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.roomUsers=[]),u.defaults&&(N.roomId="",N.hash=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.hash!=null&&e.hasOwnProperty("hash")&&(N.hash=e.hash),e.roomUsers&&e.roomUsers.length){N.roomUsers=[];for(let A=0;A<e.roomUsers.length;++A)N.roomUsers[A]=$root.com.quick.voice.proto.User.toObject(e.roomUsers[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ToggleLiveRoomRsq"},$}(),D.TrackType=function(){const $={},I=Object.create($);return I[$[0]="Microphone"]=0,I[$[1]="Camera"]=1,I[$[2]="Screen"]=2,I[$[3]="SystemVoice"]=3,I}(),D.ReportInfoReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.actionEvent="",$.prototype.userId="",$.prototype.platform="",$.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.actionData="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.actionEvent!=null&&Object.hasOwnProperty.call(e,"actionEvent")&&u.uint32(10).string(e.actionEvent),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&u.uint32(18).string(e.userId),e.platform!=null&&Object.hasOwnProperty.call(e,"platform")&&u.uint32(26).string(e.platform),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&u.uint32(32).int64(e.time),e.actionData!=null&&Object.hasOwnProperty.call(e,"actionData")&&u.uint32(42).string(e.actionData),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.ReportInfoReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.actionEvent=e.string();break}case 2:{A.userId=e.string();break}case 3:{A.platform=e.string();break}case 4:{A.time=e.int64();break}case 5:{A.actionData=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){return typeof e!="object"||e===null?"object expected":e.actionEvent!=null&&e.hasOwnProperty("actionEvent")&&!$util.isString(e.actionEvent)?"actionEvent: string expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.platform!=null&&e.hasOwnProperty("platform")&&!$util.isString(e.platform)?"platform: string 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.actionData!=null&&e.hasOwnProperty("actionData")&&!$util.isString(e.actionData)?"actionData: string expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ReportInfoReq)return e;let u=new $root.com.quick.voice.proto.ReportInfoReq;return e.actionEvent!=null&&(u.actionEvent=String(e.actionEvent)),e.userId!=null&&(u.userId=String(e.userId)),e.platform!=null&&(u.platform=String(e.platform)),e.time!=null&&($util.Long?(u.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?u.time=parseInt(e.time,10):typeof e.time=="number"?u.time=e.time:typeof e.time=="object"&&(u.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.actionData!=null&&(u.actionData=String(e.actionData)),u},$.toObject=function(e,u){u||(u={});let N={};if(u.defaults){if(N.actionEvent="",N.userId="",N.platform="",$util.Long){let A=new $util.Long(0,0,!1);N.time=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.time=u.longs===String?"0":0;N.actionData=""}return e.actionEvent!=null&&e.hasOwnProperty("actionEvent")&&(N.actionEvent=e.actionEvent),e.userId!=null&&e.hasOwnProperty("userId")&&(N.userId=e.userId),e.platform!=null&&e.hasOwnProperty("platform")&&(N.platform=e.platform),e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?N.time=u.longs===String?String(e.time):e.time:N.time=u.longs===String?$util.Long.prototype.toString.call(e.time):u.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),e.actionData!=null&&e.hasOwnProperty("actionData")&&(N.actionData=e.actionData),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ReportInfoReq"},$}(),D.UpdatePermissions=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.user=null,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(18).fork()).ldelim(),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.UpdatePermissions;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdatePermissions)return e;let u=new $root.com.quick.voice.proto.UpdatePermissions;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdatePermissions"},$}(),D.CallType=function(){const $={},I=Object.create($);return I[$[0]="Normal"]=0,I[$[1]="Meeting"]=1,I[$[2]="Live"]=2,I}(),D.QuitNotifyCode=function(){const $={},I=Object.create($);return I[$[0]="NormalQuit"]=0,I[$[2021]="Timeout"]=2021,I[$[2011]="TokenExpired"]=2011,I[$[2022]="KickOut"]=2022,I[$[2023]="EndPk"]=2023,I[$[2024]="EndLive"]=2024,I}(),D.UserBehavior=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.type=0,$.prototype.behavior=!1,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&u.uint32(8).int32(e.type),e.behavior!=null&&Object.hasOwnProperty.call(e,"behavior")&&u.uint32(16).bool(e.behavior),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.UserBehavior;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.type=e.int32();break}case 2:{A.behavior=e.bool();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UserBehavior)return e;let u=new $root.com.quick.voice.proto.UserBehavior;switch(e.type){default:if(typeof e.type=="number"){u.type=e.type;break}break;case"Microphone":case 0:u.type=0;break;case"Camera":case 1:u.type=1;break;case"Screen":case 2:u.type=2;break;case"SystemVoice":case 3:u.type=3;break}return e.behavior!=null&&(u.behavior=!!e.behavior),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.type=u.enums===String?"Microphone":0,N.behavior=!1),e.type!=null&&e.hasOwnProperty("type")&&(N.type=u.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")&&(N.behavior=e.behavior),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UserBehavior"},$}(),D.PreventUser=function(){function $(I){if(this.behaviors=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.id="",$.prototype.behaviors=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.id!=null&&Object.hasOwnProperty.call(e,"id")&&u.uint32(10).string(e.id),e.behaviors!=null&&e.behaviors.length)for(let N=0;N<e.behaviors.length;++N)$root.com.quick.voice.proto.UserBehavior.encode(e.behaviors[N],u.uint32(18).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.PreventUser;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.id=e.string();break}case 2:{A.behaviors&&A.behaviors.length||(A.behaviors=[]),A.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=0;u<e.behaviors.length;++u){let N=$root.com.quick.voice.proto.UserBehavior.verify(e.behaviors[u]);if(N)return"behaviors."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUser)return e;let u=new $root.com.quick.voice.proto.PreventUser;if(e.id!=null&&(u.id=String(e.id)),e.behaviors){if(!Array.isArray(e.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");u.behaviors=[];for(let N=0;N<e.behaviors.length;++N){if(typeof e.behaviors[N]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");u.behaviors[N]=$root.com.quick.voice.proto.UserBehavior.fromObject(e.behaviors[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.behaviors=[]),u.defaults&&(N.id=""),e.id!=null&&e.hasOwnProperty("id")&&(N.id=e.id),e.behaviors&&e.behaviors.length){N.behaviors=[];for(let A=0;A<e.behaviors.length;++A)N.behaviors[A]=$root.com.quick.voice.proto.UserBehavior.toObject(e.behaviors[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUser"},$}(),D.PreventUsersBehaviorReq=function(){function $(I){if(this.users=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.users=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let N=0;N<e.users.length;++N)$root.com.quick.voice.proto.PreventUser.encode(e.users[N],u.uint32(18).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.users&&A.users.length||(A.users=[]),A.users.push($root.com.quick.voice.proto.PreventUser.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=0;u<e.users.length;++u){let N=$root.com.quick.voice.proto.PreventUser.verify(e.users[u]);if(N)return"users."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return e;let u=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");u.users=[];for(let N=0;N<e.users.length;++N){if(typeof e.users[N]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");u.users[N]=$root.com.quick.voice.proto.PreventUser.fromObject(e.users[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.users=[]),u.defaults&&(N.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.users&&e.users.length){N.users=[];for(let A=0;A<e.users.length;++A)N.users[A]=$root.com.quick.voice.proto.PreventUser.toObject(e.users[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUsersBehaviorReq"},$}(),D.PreventUsersBehaviorNotify=function(){function $(I){if(this.users=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.users=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let N=0;N<e.users.length;++N)$root.com.quick.voice.proto.User.encode(e.users[N],u.uint32(18).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.users&&A.users.length||(A.users=[]),A.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=0;u<e.users.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.users[u]);if(N)return"users."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return e;let u=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");u.users=[];for(let N=0;N<e.users.length;++N){if(typeof e.users[N]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");u.users[N]=$root.com.quick.voice.proto.User.fromObject(e.users[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.users=[]),u.defaults&&(N.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.users&&e.users.length){N.users=[];for(let A=0;A<e.users.length;++A)N.users[A]=$root.com.quick.voice.proto.User.toObject(e.users[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},$}(),D.AccelerationAreas=function(){const $={},I=Object.create($);return I[$[0]="chinaMainland"]=0,I[$[1]="global"]=1,I[$[2]="overseas"]=2,I}(),D.CountMethods=function(){const $={},I=Object.create($);return I[$[0]="flow"]=0,I[$[1]="minutes"]=1,I}(),D.BaseCDNAddress=function(){function $(I){if(this.urlMap={},I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.area=0,$.prototype.countType=0,$.prototype.urlMap=$util.emptyObject,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.area!=null&&Object.hasOwnProperty.call(e,"area")&&u.uint32(8).int32(e.area),e.countType!=null&&Object.hasOwnProperty.call(e,"countType")&&u.uint32(16).int32(e.countType),e.urlMap!=null&&Object.hasOwnProperty.call(e,"urlMap"))for(let N=Object.keys(e.urlMap),A=0;A<N.length;++A)u.uint32(26).fork().uint32(10).string(N[A]).uint32(18).string(e.urlMap[N[A]]).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.BaseCDNAddress,U,L;for(;e.pos<N;){let P=e.uint32();switch(P>>>3){case 1:{A.area=e.int32();break}case 2:{A.countType=e.int32();break}case 3:{A.urlMap===$util.emptyObject&&(A.urlMap={});let Z=e.uint32()+e.pos;for(U="",L="";e.pos<Z;){let F=e.uint32();switch(F>>>3){case 1:U=e.string();break;case 2:L=e.string();break;default:e.skipType(F&7);break}}A.urlMap[U]=L;break}default:e.skipType(P&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.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 u=Object.keys(e.urlMap);for(let N=0;N<u.length;++N)if(!$util.isString(e.urlMap[u[N]]))return"urlMap: string{k:string} expected"}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.BaseCDNAddress)return e;let u=new $root.com.quick.voice.proto.BaseCDNAddress;switch(e.area){default:if(typeof e.area=="number"){u.area=e.area;break}break;case"chinaMainland":case 0:u.area=0;break;case"global":case 1:u.area=1;break;case"overseas":case 2:u.area=2;break}switch(e.countType){default:if(typeof e.countType=="number"){u.countType=e.countType;break}break;case"flow":case 0:u.countType=0;break;case"minutes":case 1:u.countType=1;break}if(e.urlMap){if(typeof e.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");u.urlMap={};for(let N=Object.keys(e.urlMap),A=0;A<N.length;++A)u.urlMap[N[A]]=String(e.urlMap[N[A]])}return u},$.toObject=function(e,u){u||(u={});let N={};(u.objects||u.defaults)&&(N.urlMap={}),u.defaults&&(N.area=u.enums===String?"chinaMainland":0,N.countType=u.enums===String?"flow":0),e.area!=null&&e.hasOwnProperty("area")&&(N.area=u.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")&&(N.countType=u.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 A;if(e.urlMap&&(A=Object.keys(e.urlMap)).length){N.urlMap={};for(let U=0;U<A.length;++U)N.urlMap[A[U]]=e.urlMap[A[U]]}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.BaseCDNAddress"},$}(),D.CDNPlayAddressNotify=function(){function $(e){if(this.standLines=[],e)for(let u=Object.keys(e),N=0;N<u.length;++N)e[u[N]]!=null&&(this[u[N]]=e[u[N]])}$.prototype.roomId="",$.prototype.m3u8=null,$.prototype.rtmp=null,$.prototype.flv=null,$.prototype.rtmps=null,$.prototype.mainLine=null,$.prototype.standLines=$util.emptyArray;let I;return Object.defineProperty($.prototype,"_m3u8",{get:$util.oneOfGetter(I=["m3u8"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_rtmp",{get:$util.oneOfGetter(I=["rtmp"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_flv",{get:$util.oneOfGetter(I=["flv"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_rtmps",{get:$util.oneOfGetter(I=["rtmps"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_mainLine",{get:$util.oneOfGetter(I=["mainLine"]),set:$util.oneOfSetter(I)}),$.create=function(u){return new $(u)},$.encode=function(u,N){if(N||(N=$Writer.create()),u.roomId!=null&&Object.hasOwnProperty.call(u,"roomId")&&N.uint32(10).string(u.roomId),u.m3u8!=null&&Object.hasOwnProperty.call(u,"m3u8")&&N.uint32(18).string(u.m3u8),u.rtmp!=null&&Object.hasOwnProperty.call(u,"rtmp")&&N.uint32(26).string(u.rtmp),u.flv!=null&&Object.hasOwnProperty.call(u,"flv")&&N.uint32(34).string(u.flv),u.rtmps!=null&&Object.hasOwnProperty.call(u,"rtmps")&&N.uint32(42).string(u.rtmps),u.mainLine!=null&&Object.hasOwnProperty.call(u,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(u.mainLine,N.uint32(50).fork()).ldelim(),u.standLines!=null&&u.standLines.length)for(let A=0;A<u.standLines.length;++A)$root.com.quick.voice.proto.BaseCDNAddress.encode(u.standLines[A],N.uint32(58).fork()).ldelim();return N},$.encodeDelimited=function(u,N){return this.encode(u,N).ldelim()},$.decode=function(u,N){u instanceof $Reader||(u=$Reader.create(u));let A=N===void 0?u.len:u.pos+N,U=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;u.pos<A;){let L=u.uint32();switch(L>>>3){case 1:{U.roomId=u.string();break}case 2:{U.m3u8=u.string();break}case 3:{U.rtmp=u.string();break}case 4:{U.flv=u.string();break}case 5:{U.rtmps=u.string();break}case 6:{U.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(u,u.uint32());break}case 7:{U.standLines&&U.standLines.length||(U.standLines=[]),U.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(u,u.uint32()));break}default:u.skipType(L&7);break}}return U},$.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},$.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.roomId!=null&&u.hasOwnProperty("roomId")&&!$util.isString(u.roomId))return"roomId: string expected";if(u.m3u8!=null&&u.hasOwnProperty("m3u8")&&!$util.isString(u.m3u8))return"m3u8: string expected";if(u.rtmp!=null&&u.hasOwnProperty("rtmp")&&!$util.isString(u.rtmp))return"rtmp: string expected";if(u.flv!=null&&u.hasOwnProperty("flv")&&!$util.isString(u.flv))return"flv: string expected";if(u.rtmps!=null&&u.hasOwnProperty("rtmps")&&!$util.isString(u.rtmps))return"rtmps: string expected";if(u.mainLine!=null&&u.hasOwnProperty("mainLine")){let N=$root.com.quick.voice.proto.BaseCDNAddress.verify(u.mainLine);if(N)return"mainLine."+N}if(u.standLines!=null&&u.hasOwnProperty("standLines")){if(!Array.isArray(u.standLines))return"standLines: array expected";for(let N=0;N<u.standLines.length;++N){let A=$root.com.quick.voice.proto.BaseCDNAddress.verify(u.standLines[N]);if(A)return"standLines."+A}}return null},$.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return u;let N=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(u.roomId!=null&&(N.roomId=String(u.roomId)),u.m3u8!=null&&(N.m3u8=String(u.m3u8)),u.rtmp!=null&&(N.rtmp=String(u.rtmp)),u.flv!=null&&(N.flv=String(u.flv)),u.rtmps!=null&&(N.rtmps=String(u.rtmps)),u.mainLine!=null){if(typeof u.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");N.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(u.mainLine)}if(u.standLines){if(!Array.isArray(u.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");N.standLines=[];for(let A=0;A<u.standLines.length;++A){if(typeof u.standLines[A]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");N.standLines[A]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(u.standLines[A])}}return N},$.toObject=function(u,N){N||(N={});let A={};if((N.arrays||N.defaults)&&(A.standLines=[]),N.defaults&&(A.roomId=""),u.roomId!=null&&u.hasOwnProperty("roomId")&&(A.roomId=u.roomId),u.m3u8!=null&&u.hasOwnProperty("m3u8")&&(A.m3u8=u.m3u8,N.oneofs&&(A._m3u8="m3u8")),u.rtmp!=null&&u.hasOwnProperty("rtmp")&&(A.rtmp=u.rtmp,N.oneofs&&(A._rtmp="rtmp")),u.flv!=null&&u.hasOwnProperty("flv")&&(A.flv=u.flv,N.oneofs&&(A._flv="flv")),u.rtmps!=null&&u.hasOwnProperty("rtmps")&&(A.rtmps=u.rtmps,N.oneofs&&(A._rtmps="rtmps")),u.mainLine!=null&&u.hasOwnProperty("mainLine")&&(A.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(u.mainLine,N),N.oneofs&&(A._mainLine="mainLine")),u.standLines&&u.standLines.length){A.standLines=[];for(let U=0;U<u.standLines.length;++U)A.standLines[U]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(u.standLines[U],N)}return A},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.CDNPlayAddressNotify"},$}(),D}(),k}(),q}(),_})(),ignoreEvent=["networkQualityChange","onNetQuality"],enum_notifyName={onChangeNetwork:"网络情况变更",healthCheck:"心跳检测",onNetQuality:"网络质量回调",onLogin:"登录回调",onLocalStream:"本地媒体流发生变化",onDevicechange:"媒体设备发生变化",onRoomUser:"房间用户变化",onRoomUsers:"房间所有用户所有变化",onRoomUsersStreams:"房间某些用户媒体流变化",onRoomState:"房间状态变化",onJoinRoom:"加入房间回调",onQuitRoom:"退出房间回调",onPublish:"监听到流发布",onCloseTrack:"关闭轨道",onUpdateCall:"更新通讯状态",onUpdateStreams:"更新媒体流",onUpdatePermissions:"更新推流权限通知",onTokenExpired:"Token已过期",onDestroyRoom:"直播模式房间销毁",destroyRoom:"服务器要求销毁房间",onCDNPlayUrlAdd:"cdn播放地址变化",onDestroy:"SDK销毁"};ut(enum_notifyName);const notifyName_keys=Object.keys(enum_notifyName);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Z_FIXED$1=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN$1=2;function zero$1(_){let q=_.length;for(;--q>=0;)_[q]=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(_,q,k,D,$){this.static_tree=_,this.extra_bits=q,this.extra_base=k,this.elems=D,this.max_length=$,this.has_stree=_&&_.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(_,q){this.dyn_tree=_,this.max_code=0,this.stat_desc=q}const d_code=_=>_<256?_dist_code[_]:_dist_code[256+(_>>>7)],put_short=(_,q)=>{_.pending_buf[_.pending++]=q&255,_.pending_buf[_.pending++]=q>>>8&255},send_bits=(_,q,k)=>{_.bi_valid>Buf_size-k?(_.bi_buf|=q<<_.bi_valid&65535,put_short(_,_.bi_buf),_.bi_buf=q>>Buf_size-_.bi_valid,_.bi_valid+=k-Buf_size):(_.bi_buf|=q<<_.bi_valid&65535,_.bi_valid+=k)},send_code=(_,q,k)=>{send_bits(_,k[q*2],k[q*2+1])},bi_reverse=(_,q)=>{let k=0;do k|=_&1,_>>>=1,k<<=1;while(--q>0);return k>>>1},bi_flush=_=>{_.bi_valid===16?(put_short(_,_.bi_buf),_.bi_buf=0,_.bi_valid=0):_.bi_valid>=8&&(_.pending_buf[_.pending++]=_.bi_buf&255,_.bi_buf>>=8,_.bi_valid-=8)},gen_bitlen=(_,q)=>{const k=q.dyn_tree,D=q.max_code,$=q.stat_desc.static_tree,I=q.stat_desc.has_stree,e=q.stat_desc.extra_bits,u=q.stat_desc.extra_base,N=q.stat_desc.max_length;let A,U,L,P,Z,F,W=0;for(P=0;P<=MAX_BITS$1;P++)_.bl_count[P]=0;for(k[_.heap[_.heap_max]*2+1]=0,A=_.heap_max+1;A<HEAP_SIZE$1;A++)U=_.heap[A],P=k[k[U*2+1]*2+1]+1,P>N&&(P=N,W++),k[U*2+1]=P,!(U>D)&&(_.bl_count[P]++,Z=0,U>=u&&(Z=e[U-u]),F=k[U*2],_.opt_len+=F*(P+Z),I&&(_.static_len+=F*($[U*2+1]+Z)));if(W!==0){do{for(P=N-1;_.bl_count[P]===0;)P--;_.bl_count[P]--,_.bl_count[P+1]+=2,_.bl_count[N]--,W-=2}while(W>0);for(P=N;P!==0;P--)for(U=_.bl_count[P];U!==0;)L=_.heap[--A],!(L>D)&&(k[L*2+1]!==P&&(_.opt_len+=(P-k[L*2+1])*k[L*2],k[L*2+1]=P),U--)}},gen_codes=(_,q,k)=>{const D=new Array(MAX_BITS$1+1);let $=0,I,e;for(I=1;I<=MAX_BITS$1;I++)$=$+k[I-1]<<1,D[I]=$;for(e=0;e<=q;e++){let u=_[e*2+1];u!==0&&(_[e*2]=bi_reverse(D[u]++,u))}},tr_static_init=()=>{let _,q,k,D,$;const I=new Array(MAX_BITS$1+1);for(k=0,D=0;D<LENGTH_CODES$1-1;D++)for(base_length[D]=k,_=0;_<1<<extra_lbits[D];_++)_length_code[k++]=D;for(_length_code[k-1]=D,$=0,D=0;D<16;D++)for(base_dist[D]=$,_=0;_<1<<extra_dbits[D];_++)_dist_code[$++]=D;for($>>=7;D<D_CODES$1;D++)for(base_dist[D]=$<<7,_=0;_<1<<extra_dbits[D]-7;_++)_dist_code[256+$++]=D;for(q=0;q<=MAX_BITS$1;q++)I[q]=0;for(_=0;_<=143;)static_ltree[_*2+1]=8,_++,I[8]++;for(;_<=255;)static_ltree[_*2+1]=9,_++,I[9]++;for(;_<=279;)static_ltree[_*2+1]=7,_++,I[7]++;for(;_<=287;)static_ltree[_*2+1]=8,_++,I[8]++;for(gen_codes(static_ltree,L_CODES$1+1,I),_=0;_<D_CODES$1;_++)static_dtree[_*2+1]=5,static_dtree[_*2]=bi_reverse(_,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=_=>{let q;for(q=0;q<L_CODES$1;q++)_.dyn_ltree[q*2]=0;for(q=0;q<D_CODES$1;q++)_.dyn_dtree[q*2]=0;for(q=0;q<BL_CODES$1;q++)_.bl_tree[q*2]=0;_.dyn_ltree[END_BLOCK*2]=1,_.opt_len=_.static_len=0,_.sym_next=_.matches=0},bi_windup=_=>{_.bi_valid>8?put_short(_,_.bi_buf):_.bi_valid>0&&(_.pending_buf[_.pending++]=_.bi_buf),_.bi_buf=0,_.bi_valid=0},smaller=(_,q,k,D)=>{const $=q*2,I=k*2;return _[$]<_[I]||_[$]===_[I]&&D[q]<=D[k]},pqdownheap=(_,q,k)=>{const D=_.heap[k];let $=k<<1;for(;$<=_.heap_len&&($<_.heap_len&&smaller(q,_.heap[$+1],_.heap[$],_.depth)&&$++,!smaller(q,D,_.heap[$],_.depth));)_.heap[k]=_.heap[$],k=$,$<<=1;_.heap[k]=D},compress_block=(_,q,k)=>{let D,$,I=0,e,u;if(_.sym_next!==0)do D=_.pending_buf[_.sym_buf+I++]&255,D+=(_.pending_buf[_.sym_buf+I++]&255)<<8,$=_.pending_buf[_.sym_buf+I++],D===0?send_code(_,$,q):(e=_length_code[$],send_code(_,e+LITERALS$1+1,q),u=extra_lbits[e],u!==0&&($-=base_length[e],send_bits(_,$,u)),D--,e=d_code(D),send_code(_,e,k),u=extra_dbits[e],u!==0&&(D-=base_dist[e],send_bits(_,D,u)));while(I<_.sym_next);send_code(_,END_BLOCK,q)},build_tree=(_,q)=>{const k=q.dyn_tree,D=q.stat_desc.static_tree,$=q.stat_desc.has_stree,I=q.stat_desc.elems;let e,u,N=-1,A;for(_.heap_len=0,_.heap_max=HEAP_SIZE$1,e=0;e<I;e++)k[e*2]!==0?(_.heap[++_.heap_len]=N=e,_.depth[e]=0):k[e*2+1]=0;for(;_.heap_len<2;)A=_.heap[++_.heap_len]=N<2?++N:0,k[A*2]=1,_.depth[A]=0,_.opt_len--,$&&(_.static_len-=D[A*2+1]);for(q.max_code=N,e=_.heap_len>>1;e>=1;e--)pqdownheap(_,k,e);A=I;do e=_.heap[1],_.heap[1]=_.heap[_.heap_len--],pqdownheap(_,k,1),u=_.heap[1],_.heap[--_.heap_max]=e,_.heap[--_.heap_max]=u,k[A*2]=k[e*2]+k[u*2],_.depth[A]=(_.depth[e]>=_.depth[u]?_.depth[e]:_.depth[u])+1,k[e*2+1]=k[u*2+1]=A,_.heap[1]=A++,pqdownheap(_,k,1);while(_.heap_len>=2);_.heap[--_.heap_max]=_.heap[1],gen_bitlen(_,q),gen_codes(k,N,_.bl_count)},scan_tree=(_,q,k)=>{let D,$=-1,I,e=q[0*2+1],u=0,N=7,A=4;for(e===0&&(N=138,A=3),q[(k+1)*2+1]=65535,D=0;D<=k;D++)I=e,e=q[(D+1)*2+1],!(++u<N&&I===e)&&(u<A?_.bl_tree[I*2]+=u:I!==0?(I!==$&&_.bl_tree[I*2]++,_.bl_tree[REP_3_6*2]++):u<=10?_.bl_tree[REPZ_3_10*2]++:_.bl_tree[REPZ_11_138*2]++,u=0,$=I,e===0?(N=138,A=3):I===e?(N=6,A=3):(N=7,A=4))},send_tree=(_,q,k)=>{let D,$=-1,I,e=q[0*2+1],u=0,N=7,A=4;for(e===0&&(N=138,A=3),D=0;D<=k;D++)if(I=e,e=q[(D+1)*2+1],!(++u<N&&I===e)){if(u<A)do send_code(_,I,_.bl_tree);while(--u!==0);else I!==0?(I!==$&&(send_code(_,I,_.bl_tree),u--),send_code(_,REP_3_6,_.bl_tree),send_bits(_,u-3,2)):u<=10?(send_code(_,REPZ_3_10,_.bl_tree),send_bits(_,u-3,3)):(send_code(_,REPZ_11_138,_.bl_tree),send_bits(_,u-11,7));u=0,$=I,e===0?(N=138,A=3):I===e?(N=6,A=3):(N=7,A=4)}},build_bl_tree=_=>{let q;for(scan_tree(_,_.dyn_ltree,_.l_desc.max_code),scan_tree(_,_.dyn_dtree,_.d_desc.max_code),build_tree(_,_.bl_desc),q=BL_CODES$1-1;q>=3&&_.bl_tree[bl_order[q]*2+1]===0;q--);return _.opt_len+=3*(q+1)+5+5+4,q},send_all_trees=(_,q,k,D)=>{let $;for(send_bits(_,q-257,5),send_bits(_,k-1,5),send_bits(_,D-4,4),$=0;$<D;$++)send_bits(_,_.bl_tree[bl_order[$]*2+1],3);send_tree(_,_.dyn_ltree,q-1),send_tree(_,_.dyn_dtree,k-1)},detect_data_type=_=>{let q=4093624447,k;for(k=0;k<=31;k++,q>>>=1)if(q&1&&_.dyn_ltree[k*2]!==0)return Z_BINARY;if(_.dyn_ltree[9*2]!==0||_.dyn_ltree[10*2]!==0||_.dyn_ltree[13*2]!==0)return Z_TEXT;for(k=32;k<LITERALS$1;k++)if(_.dyn_ltree[k*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=_=>{static_init_done||(tr_static_init(),static_init_done=!0),_.l_desc=new TreeDesc(_.dyn_ltree,static_l_desc),_.d_desc=new TreeDesc(_.dyn_dtree,static_d_desc),_.bl_desc=new TreeDesc(_.bl_tree,static_bl_desc),_.bi_buf=0,_.bi_valid=0,init_block(_)},_tr_stored_block$1=(_,q,k,D)=>{send_bits(_,(STORED_BLOCK<<1)+(D?1:0),3),bi_windup(_),put_short(_,k),put_short(_,~k),k&&_.pending_buf.set(_.window.subarray(q,q+k),_.pending),_.pending+=k},_tr_align$1=_=>{send_bits(_,STATIC_TREES<<1,3),send_code(_,END_BLOCK,static_ltree),bi_flush(_)},_tr_flush_block$1=(_,q,k,D)=>{let $,I,e=0;_.level>0?(_.strm.data_type===Z_UNKNOWN$1&&(_.strm.data_type=detect_data_type(_)),build_tree(_,_.l_desc),build_tree(_,_.d_desc),e=build_bl_tree(_),$=_.opt_len+3+7>>>3,I=_.static_len+3+7>>>3,I<=$&&($=I)):$=I=k+5,k+4<=$&&q!==-1?_tr_stored_block$1(_,q,k,D):_.strategy===Z_FIXED$1||I===$?(send_bits(_,(STATIC_TREES<<1)+(D?1:0),3),compress_block(_,static_ltree,static_dtree)):(send_bits(_,(DYN_TREES<<1)+(D?1:0),3),send_all_trees(_,_.l_desc.max_code+1,_.d_desc.max_code+1,e+1),compress_block(_,_.dyn_ltree,_.dyn_dtree)),init_block(_),D&&bi_windup(_)},_tr_tally$1=(_,q,k)=>(_.pending_buf[_.sym_buf+_.sym_next++]=q,_.pending_buf[_.sym_buf+_.sym_next++]=q>>8,_.pending_buf[_.sym_buf+_.sym_next++]=k,q===0?_.dyn_ltree[k*2]++:(_.matches++,q--,_.dyn_ltree[(_length_code[k]+LITERALS$1+1)*2]++,_.dyn_dtree[d_code(q)*2]++),_.sym_next===_.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=(_,q,k,D)=>{let $=_&65535|0,I=_>>>16&65535|0,e=0;for(;k!==0;){e=k>2e3?2e3:k,k-=e;do $=$+q[D++]|0,I=I+$|0;while(--e);$%=65521,I%=65521}return $|I<<16|0};var adler32_1=adler32;const makeTable=()=>{let _,q=[];for(var k=0;k<256;k++){_=k;for(var D=0;D<8;D++)_=_&1?3988292384^_>>>1:_>>>1;q[k]=_}return q},crcTable=new Uint32Array(makeTable()),crc32=(_,q,k,D)=>{const $=crcTable,I=D+k;_^=-1;for(let e=D;e<I;e++)_=_>>>8^$[(_^q[e])&255];return _^-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=(_,q)=>(_.msg=messages[q],q),rank=_=>_*2-(_>4?9:0),zero=_=>{let q=_.length;for(;--q>=0;)_[q]=0},slide_hash=_=>{let q,k,D,$=_.w_size;q=_.hash_size,D=q;do k=_.head[--D],_.head[D]=k>=$?k-$:0;while(--q);q=$,D=q;do k=_.prev[--D],_.prev[D]=k>=$?k-$:0;while(--q)};let HASH_ZLIB=(_,q,k)=>(q<<_.hash_shift^k)&_.hash_mask,HASH=HASH_ZLIB;const flush_pending=_=>{const q=_.state;let k=q.pending;k>_.avail_out&&(k=_.avail_out),k!==0&&(_.output.set(q.pending_buf.subarray(q.pending_out,q.pending_out+k),_.next_out),_.next_out+=k,q.pending_out+=k,_.total_out+=k,_.avail_out-=k,q.pending-=k,q.pending===0&&(q.pending_out=0))},flush_block_only=(_,q)=>{_tr_flush_block(_,_.block_start>=0?_.block_start:-1,_.strstart-_.block_start,q),_.block_start=_.strstart,flush_pending(_.strm)},put_byte=(_,q)=>{_.pending_buf[_.pending++]=q},putShortMSB=(_,q)=>{_.pending_buf[_.pending++]=q>>>8&255,_.pending_buf[_.pending++]=q&255},read_buf=(_,q,k,D)=>{let $=_.avail_in;return $>D&&($=D),$===0?0:(_.avail_in-=$,q.set(_.input.subarray(_.next_in,_.next_in+$),k),_.state.wrap===1?_.adler=adler32_1(_.adler,q,$,k):_.state.wrap===2&&(_.adler=crc32_1(_.adler,q,$,k)),_.next_in+=$,_.total_in+=$,$)},longest_match=(_,q)=>{let k=_.max_chain_length,D=_.strstart,$,I,e=_.prev_length,u=_.nice_match;const N=_.strstart>_.w_size-MIN_LOOKAHEAD?_.strstart-(_.w_size-MIN_LOOKAHEAD):0,A=_.window,U=_.w_mask,L=_.prev,P=_.strstart+MAX_MATCH;let Z=A[D+e-1],F=A[D+e];_.prev_length>=_.good_match&&(k>>=2),u>_.lookahead&&(u=_.lookahead);do if($=q,!(A[$+e]!==F||A[$+e-1]!==Z||A[$]!==A[D]||A[++$]!==A[D+1])){D+=2,$++;do;while(A[++D]===A[++$]&&A[++D]===A[++$]&&A[++D]===A[++$]&&A[++D]===A[++$]&&A[++D]===A[++$]&&A[++D]===A[++$]&&A[++D]===A[++$]&&A[++D]===A[++$]&&D<P);if(I=MAX_MATCH-(P-D),D=P-MAX_MATCH,I>e){if(_.match_start=q,e=I,I>=u)break;Z=A[D+e-1],F=A[D+e]}}while((q=L[q&U])>N&&--k!==0);return e<=_.lookahead?e:_.lookahead},fill_window=_=>{const q=_.w_size;let k,D,$;do{if(D=_.window_size-_.lookahead-_.strstart,_.strstart>=q+(q-MIN_LOOKAHEAD)&&(_.window.set(_.window.subarray(q,q+q-D),0),_.match_start-=q,_.strstart-=q,_.block_start-=q,_.insert>_.strstart&&(_.insert=_.strstart),slide_hash(_),D+=q),_.strm.avail_in===0)break;if(k=read_buf(_.strm,_.window,_.strstart+_.lookahead,D),_.lookahead+=k,_.lookahead+_.insert>=MIN_MATCH)for($=_.strstart-_.insert,_.ins_h=_.window[$],_.ins_h=HASH(_,_.ins_h,_.window[$+1]);_.insert&&(_.ins_h=HASH(_,_.ins_h,_.window[$+MIN_MATCH-1]),_.prev[$&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=$,$++,_.insert--,!(_.lookahead+_.insert<MIN_MATCH)););}while(_.lookahead<MIN_LOOKAHEAD&&_.strm.avail_in!==0)},deflate_stored=(_,q)=>{let k=_.pending_buf_size-5>_.w_size?_.w_size:_.pending_buf_size-5,D,$,I,e=0,u=_.strm.avail_in;do{if(D=65535,I=_.bi_valid+42>>3,_.strm.avail_out<I||(I=_.strm.avail_out-I,$=_.strstart-_.block_start,D>$+_.strm.avail_in&&(D=$+_.strm.avail_in),D>I&&(D=I),D<k&&(D===0&&q!==Z_FINISH$3||q===Z_NO_FLUSH$2||D!==$+_.strm.avail_in)))break;e=q===Z_FINISH$3&&D===$+_.strm.avail_in?1:0,_tr_stored_block(_,0,0,e),_.pending_buf[_.pending-4]=D,_.pending_buf[_.pending-3]=D>>8,_.pending_buf[_.pending-2]=~D,_.pending_buf[_.pending-1]=~D>>8,flush_pending(_.strm),$&&($>D&&($=D),_.strm.output.set(_.window.subarray(_.block_start,_.block_start+$),_.strm.next_out),_.strm.next_out+=$,_.strm.avail_out-=$,_.strm.total_out+=$,_.block_start+=$,D-=$),D&&(read_buf(_.strm,_.strm.output,_.strm.next_out,D),_.strm.next_out+=D,_.strm.avail_out-=D,_.strm.total_out+=D)}while(e===0);return u-=_.strm.avail_in,u&&(u>=_.w_size?(_.matches=2,_.window.set(_.strm.input.subarray(_.strm.next_in-_.w_size,_.strm.next_in),0),_.strstart=_.w_size,_.insert=_.strstart):(_.window_size-_.strstart<=u&&(_.strstart-=_.w_size,_.window.set(_.window.subarray(_.w_size,_.w_size+_.strstart),0),_.matches<2&&_.matches++,_.insert>_.strstart&&(_.insert=_.strstart)),_.window.set(_.strm.input.subarray(_.strm.next_in-u,_.strm.next_in),_.strstart),_.strstart+=u,_.insert+=u>_.w_size-_.insert?_.w_size-_.insert:u),_.block_start=_.strstart),_.high_water<_.strstart&&(_.high_water=_.strstart),e?BS_FINISH_DONE:q!==Z_NO_FLUSH$2&&q!==Z_FINISH$3&&_.strm.avail_in===0&&_.strstart===_.block_start?BS_BLOCK_DONE:(I=_.window_size-_.strstart,_.strm.avail_in>I&&_.block_start>=_.w_size&&(_.block_start-=_.w_size,_.strstart-=_.w_size,_.window.set(_.window.subarray(_.w_size,_.w_size+_.strstart),0),_.matches<2&&_.matches++,I+=_.w_size,_.insert>_.strstart&&(_.insert=_.strstart)),I>_.strm.avail_in&&(I=_.strm.avail_in),I&&(read_buf(_.strm,_.window,_.strstart,I),_.strstart+=I,_.insert+=I>_.w_size-_.insert?_.w_size-_.insert:I),_.high_water<_.strstart&&(_.high_water=_.strstart),I=_.bi_valid+42>>3,I=_.pending_buf_size-I>65535?65535:_.pending_buf_size-I,k=I>_.w_size?_.w_size:I,$=_.strstart-_.block_start,($>=k||($||q===Z_FINISH$3)&&q!==Z_NO_FLUSH$2&&_.strm.avail_in===0&&$<=I)&&(D=$>I?I:$,e=q===Z_FINISH$3&&_.strm.avail_in===0&&D===$?1:0,_tr_stored_block(_,_.block_start,D,e),_.block_start+=D,flush_pending(_.strm)),e?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(_,q)=>{let k,D;for(;;){if(_.lookahead<MIN_LOOKAHEAD){if(fill_window(_),_.lookahead<MIN_LOOKAHEAD&&q===Z_NO_FLUSH$2)return BS_NEED_MORE;if(_.lookahead===0)break}if(k=0,_.lookahead>=MIN_MATCH&&(_.ins_h=HASH(_,_.ins_h,_.window[_.strstart+MIN_MATCH-1]),k=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),k!==0&&_.strstart-k<=_.w_size-MIN_LOOKAHEAD&&(_.match_length=longest_match(_,k)),_.match_length>=MIN_MATCH)if(D=_tr_tally(_,_.strstart-_.match_start,_.match_length-MIN_MATCH),_.lookahead-=_.match_length,_.match_length<=_.max_lazy_match&&_.lookahead>=MIN_MATCH){_.match_length--;do _.strstart++,_.ins_h=HASH(_,_.ins_h,_.window[_.strstart+MIN_MATCH-1]),k=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart;while(--_.match_length!==0);_.strstart++}else _.strstart+=_.match_length,_.match_length=0,_.ins_h=_.window[_.strstart],_.ins_h=HASH(_,_.ins_h,_.window[_.strstart+1]);else D=_tr_tally(_,0,_.window[_.strstart]),_.lookahead--,_.strstart++;if(D&&(flush_block_only(_,!1),_.strm.avail_out===0))return BS_NEED_MORE}return _.insert=_.strstart<MIN_MATCH-1?_.strstart:MIN_MATCH-1,q===Z_FINISH$3?(flush_block_only(_,!0),_.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):_.sym_next&&(flush_block_only(_,!1),_.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(_,q)=>{let k,D,$;for(;;){if(_.lookahead<MIN_LOOKAHEAD){if(fill_window(_),_.lookahead<MIN_LOOKAHEAD&&q===Z_NO_FLUSH$2)return BS_NEED_MORE;if(_.lookahead===0)break}if(k=0,_.lookahead>=MIN_MATCH&&(_.ins_h=HASH(_,_.ins_h,_.window[_.strstart+MIN_MATCH-1]),k=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),_.prev_length=_.match_length,_.prev_match=_.match_start,_.match_length=MIN_MATCH-1,k!==0&&_.prev_length<_.max_lazy_match&&_.strstart-k<=_.w_size-MIN_LOOKAHEAD&&(_.match_length=longest_match(_,k),_.match_length<=5&&(_.strategy===Z_FILTERED||_.match_length===MIN_MATCH&&_.strstart-_.match_start>4096)&&(_.match_length=MIN_MATCH-1)),_.prev_length>=MIN_MATCH&&_.match_length<=_.prev_length){$=_.strstart+_.lookahead-MIN_MATCH,D=_tr_tally(_,_.strstart-1-_.prev_match,_.prev_length-MIN_MATCH),_.lookahead-=_.prev_length-1,_.prev_length-=2;do++_.strstart<=$&&(_.ins_h=HASH(_,_.ins_h,_.window[_.strstart+MIN_MATCH-1]),k=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart);while(--_.prev_length!==0);if(_.match_available=0,_.match_length=MIN_MATCH-1,_.strstart++,D&&(flush_block_only(_,!1),_.strm.avail_out===0))return BS_NEED_MORE}else if(_.match_available){if(D=_tr_tally(_,0,_.window[_.strstart-1]),D&&flush_block_only(_,!1),_.strstart++,_.lookahead--,_.strm.avail_out===0)return BS_NEED_MORE}else _.match_available=1,_.strstart++,_.lookahead--}return _.match_available&&(D=_tr_tally(_,0,_.window[_.strstart-1]),_.match_available=0),_.insert=_.strstart<MIN_MATCH-1?_.strstart:MIN_MATCH-1,q===Z_FINISH$3?(flush_block_only(_,!0),_.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):_.sym_next&&(flush_block_only(_,!1),_.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(_,q)=>{let k,D,$,I;const e=_.window;for(;;){if(_.lookahead<=MAX_MATCH){if(fill_window(_),_.lookahead<=MAX_MATCH&&q===Z_NO_FLUSH$2)return BS_NEED_MORE;if(_.lookahead===0)break}if(_.match_length=0,_.lookahead>=MIN_MATCH&&_.strstart>0&&($=_.strstart-1,D=e[$],D===e[++$]&&D===e[++$]&&D===e[++$])){I=_.strstart+MAX_MATCH;do;while(D===e[++$]&&D===e[++$]&&D===e[++$]&&D===e[++$]&&D===e[++$]&&D===e[++$]&&D===e[++$]&&D===e[++$]&&$<I);_.match_length=MAX_MATCH-(I-$),_.match_length>_.lookahead&&(_.match_length=_.lookahead)}if(_.match_length>=MIN_MATCH?(k=_tr_tally(_,1,_.match_length-MIN_MATCH),_.lookahead-=_.match_length,_.strstart+=_.match_length,_.match_length=0):(k=_tr_tally(_,0,_.window[_.strstart]),_.lookahead--,_.strstart++),k&&(flush_block_only(_,!1),_.strm.avail_out===0))return BS_NEED_MORE}return _.insert=0,q===Z_FINISH$3?(flush_block_only(_,!0),_.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):_.sym_next&&(flush_block_only(_,!1),_.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(_,q)=>{let k;for(;;){if(_.lookahead===0&&(fill_window(_),_.lookahead===0)){if(q===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(_.match_length=0,k=_tr_tally(_,0,_.window[_.strstart]),_.lookahead--,_.strstart++,k&&(flush_block_only(_,!1),_.strm.avail_out===0))return BS_NEED_MORE}return _.insert=0,q===Z_FINISH$3?(flush_block_only(_,!0),_.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):_.sym_next&&(flush_block_only(_,!1),_.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(_,q,k,D,$){this.good_length=_,this.max_lazy=q,this.nice_length=k,this.max_chain=D,this.func=$}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=_=>{_.window_size=2*_.w_size,zero(_.head),_.max_lazy_match=configuration_table[_.level].max_lazy,_.good_match=configuration_table[_.level].good_length,_.nice_match=configuration_table[_.level].nice_length,_.max_chain_length=configuration_table[_.level].max_chain,_.strstart=0,_.block_start=0,_.lookahead=0,_.insert=0,_.match_length=_.prev_length=MIN_MATCH-1,_.match_available=0,_.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=_=>{if(!_)return 1;const q=_.state;return!q||q.strm!==_||q.status!==INIT_STATE&&q.status!==GZIP_STATE&&q.status!==EXTRA_STATE&&q.status!==NAME_STATE&&q.status!==COMMENT_STATE&&q.status!==HCRC_STATE&&q.status!==BUSY_STATE&&q.status!==FINISH_STATE?1:0},deflateResetKeep=_=>{if(deflateStateCheck(_))return err(_,Z_STREAM_ERROR$2);_.total_in=_.total_out=0,_.data_type=Z_UNKNOWN;const q=_.state;return q.pending=0,q.pending_out=0,q.wrap<0&&(q.wrap=-q.wrap),q.status=q.wrap===2?GZIP_STATE:q.wrap?INIT_STATE:BUSY_STATE,_.adler=q.wrap===2?0:1,q.last_flush=-2,_tr_init(q),Z_OK$3},deflateReset=_=>{const q=deflateResetKeep(_);return q===Z_OK$3&&lm_init(_.state),q},deflateSetHeader=(_,q)=>deflateStateCheck(_)||_.state.wrap!==2?Z_STREAM_ERROR$2:(_.state.gzhead=q,Z_OK$3),deflateInit2=(_,q,k,D,$,I)=>{if(!_)return Z_STREAM_ERROR$2;let e=1;if(q===Z_DEFAULT_COMPRESSION$1&&(q=6),D<0?(e=0,D=-D):D>15&&(e=2,D-=16),$<1||$>MAX_MEM_LEVEL||k!==Z_DEFLATED$2||D<8||D>15||q<0||q>9||I<0||I>Z_FIXED||D===8&&e!==1)return err(_,Z_STREAM_ERROR$2);D===8&&(D=9);const u=new DeflateState;return _.state=u,u.strm=_,u.status=INIT_STATE,u.wrap=e,u.gzhead=null,u.w_bits=D,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=$+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+MIN_MATCH-1)/MIN_MATCH),u.window=new Uint8Array(u.w_size*2),u.head=new Uint16Array(u.hash_size),u.prev=new Uint16Array(u.w_size),u.lit_bufsize=1<<$+6,u.pending_buf_size=u.lit_bufsize*4,u.pending_buf=new Uint8Array(u.pending_buf_size),u.sym_buf=u.lit_bufsize,u.sym_end=(u.lit_bufsize-1)*3,u.level=q,u.strategy=I,u.method=k,deflateReset(_)},deflateInit=(_,q)=>deflateInit2(_,q,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(_,q)=>{if(deflateStateCheck(_)||q>Z_BLOCK$1||q<0)return _?err(_,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const k=_.state;if(!_.output||_.avail_in!==0&&!_.input||k.status===FINISH_STATE&&q!==Z_FINISH$3)return err(_,_.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const D=k.last_flush;if(k.last_flush=q,k.pending!==0){if(flush_pending(_),_.avail_out===0)return k.last_flush=-1,Z_OK$3}else if(_.avail_in===0&&rank(q)<=rank(D)&&q!==Z_FINISH$3)return err(_,Z_BUF_ERROR$1);if(k.status===FINISH_STATE&&_.avail_in!==0)return err(_,Z_BUF_ERROR$1);if(k.status===INIT_STATE&&k.wrap===0&&(k.status=BUSY_STATE),k.status===INIT_STATE){let $=Z_DEFLATED$2+(k.w_bits-8<<4)<<8,I=-1;if(k.strategy>=Z_HUFFMAN_ONLY||k.level<2?I=0:k.level<6?I=1:k.level===6?I=2:I=3,$|=I<<6,k.strstart!==0&&($|=PRESET_DICT),$+=31-$%31,putShortMSB(k,$),k.strstart!==0&&(putShortMSB(k,_.adler>>>16),putShortMSB(k,_.adler&65535)),_.adler=1,k.status=BUSY_STATE,flush_pending(_),k.pending!==0)return k.last_flush=-1,Z_OK$3}if(k.status===GZIP_STATE){if(_.adler=0,put_byte(k,31),put_byte(k,139),put_byte(k,8),k.gzhead)put_byte(k,(k.gzhead.text?1:0)+(k.gzhead.hcrc?2:0)+(k.gzhead.extra?4:0)+(k.gzhead.name?8:0)+(k.gzhead.comment?16:0)),put_byte(k,k.gzhead.time&255),put_byte(k,k.gzhead.time>>8&255),put_byte(k,k.gzhead.time>>16&255),put_byte(k,k.gzhead.time>>24&255),put_byte(k,k.level===9?2:k.strategy>=Z_HUFFMAN_ONLY||k.level<2?4:0),put_byte(k,k.gzhead.os&255),k.gzhead.extra&&k.gzhead.extra.length&&(put_byte(k,k.gzhead.extra.length&255),put_byte(k,k.gzhead.extra.length>>8&255)),k.gzhead.hcrc&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending,0)),k.gzindex=0,k.status=EXTRA_STATE;else if(put_byte(k,0),put_byte(k,0),put_byte(k,0),put_byte(k,0),put_byte(k,0),put_byte(k,k.level===9?2:k.strategy>=Z_HUFFMAN_ONLY||k.level<2?4:0),put_byte(k,OS_CODE),k.status=BUSY_STATE,flush_pending(_),k.pending!==0)return k.last_flush=-1,Z_OK$3}if(k.status===EXTRA_STATE){if(k.gzhead.extra){let $=k.pending,I=(k.gzhead.extra.length&65535)-k.gzindex;for(;k.pending+I>k.pending_buf_size;){let u=k.pending_buf_size-k.pending;if(k.pending_buf.set(k.gzhead.extra.subarray(k.gzindex,k.gzindex+u),k.pending),k.pending=k.pending_buf_size,k.gzhead.hcrc&&k.pending>$&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending-$,$)),k.gzindex+=u,flush_pending(_),k.pending!==0)return k.last_flush=-1,Z_OK$3;$=0,I-=u}let e=new Uint8Array(k.gzhead.extra);k.pending_buf.set(e.subarray(k.gzindex,k.gzindex+I),k.pending),k.pending+=I,k.gzhead.hcrc&&k.pending>$&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending-$,$)),k.gzindex=0}k.status=NAME_STATE}if(k.status===NAME_STATE){if(k.gzhead.name){let $=k.pending,I;do{if(k.pending===k.pending_buf_size){if(k.gzhead.hcrc&&k.pending>$&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending-$,$)),flush_pending(_),k.pending!==0)return k.last_flush=-1,Z_OK$3;$=0}k.gzindex<k.gzhead.name.length?I=k.gzhead.name.charCodeAt(k.gzindex++)&255:I=0,put_byte(k,I)}while(I!==0);k.gzhead.hcrc&&k.pending>$&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending-$,$)),k.gzindex=0}k.status=COMMENT_STATE}if(k.status===COMMENT_STATE){if(k.gzhead.comment){let $=k.pending,I;do{if(k.pending===k.pending_buf_size){if(k.gzhead.hcrc&&k.pending>$&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending-$,$)),flush_pending(_),k.pending!==0)return k.last_flush=-1,Z_OK$3;$=0}k.gzindex<k.gzhead.comment.length?I=k.gzhead.comment.charCodeAt(k.gzindex++)&255:I=0,put_byte(k,I)}while(I!==0);k.gzhead.hcrc&&k.pending>$&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending-$,$))}k.status=HCRC_STATE}if(k.status===HCRC_STATE){if(k.gzhead.hcrc){if(k.pending+2>k.pending_buf_size&&(flush_pending(_),k.pending!==0))return k.last_flush=-1,Z_OK$3;put_byte(k,_.adler&255),put_byte(k,_.adler>>8&255),_.adler=0}if(k.status=BUSY_STATE,flush_pending(_),k.pending!==0)return k.last_flush=-1,Z_OK$3}if(_.avail_in!==0||k.lookahead!==0||q!==Z_NO_FLUSH$2&&k.status!==FINISH_STATE){let $=k.level===0?deflate_stored(k,q):k.strategy===Z_HUFFMAN_ONLY?deflate_huff(k,q):k.strategy===Z_RLE?deflate_rle(k,q):configuration_table[k.level].func(k,q);if(($===BS_FINISH_STARTED||$===BS_FINISH_DONE)&&(k.status=FINISH_STATE),$===BS_NEED_MORE||$===BS_FINISH_STARTED)return _.avail_out===0&&(k.last_flush=-1),Z_OK$3;if($===BS_BLOCK_DONE&&(q===Z_PARTIAL_FLUSH?_tr_align(k):q!==Z_BLOCK$1&&(_tr_stored_block(k,0,0,!1),q===Z_FULL_FLUSH$1&&(zero(k.head),k.lookahead===0&&(k.strstart=0,k.block_start=0,k.insert=0))),flush_pending(_),_.avail_out===0))return k.last_flush=-1,Z_OK$3}return q!==Z_FINISH$3?Z_OK$3:k.wrap<=0?Z_STREAM_END$3:(k.wrap===2?(put_byte(k,_.adler&255),put_byte(k,_.adler>>8&255),put_byte(k,_.adler>>16&255),put_byte(k,_.adler>>24&255),put_byte(k,_.total_in&255),put_byte(k,_.total_in>>8&255),put_byte(k,_.total_in>>16&255),put_byte(k,_.total_in>>24&255)):(putShortMSB(k,_.adler>>>16),putShortMSB(k,_.adler&65535)),flush_pending(_),k.wrap>0&&(k.wrap=-k.wrap),k.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=_=>{if(deflateStateCheck(_))return Z_STREAM_ERROR$2;const q=_.state.status;return _.state=null,q===BUSY_STATE?err(_,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(_,q)=>{let k=q.length;if(deflateStateCheck(_))return Z_STREAM_ERROR$2;const D=_.state,$=D.wrap;if($===2||$===1&&D.status!==INIT_STATE||D.lookahead)return Z_STREAM_ERROR$2;if($===1&&(_.adler=adler32_1(_.adler,q,k,0)),D.wrap=0,k>=D.w_size){$===0&&(zero(D.head),D.strstart=0,D.block_start=0,D.insert=0);let N=new Uint8Array(D.w_size);N.set(q.subarray(k-D.w_size,k),0),q=N,k=D.w_size}const I=_.avail_in,e=_.next_in,u=_.input;for(_.avail_in=k,_.next_in=0,_.input=q,fill_window(D);D.lookahead>=MIN_MATCH;){let N=D.strstart,A=D.lookahead-(MIN_MATCH-1);do D.ins_h=HASH(D,D.ins_h,D.window[N+MIN_MATCH-1]),D.prev[N&D.w_mask]=D.head[D.ins_h],D.head[D.ins_h]=N,N++;while(--A);D.strstart=N,D.lookahead=MIN_MATCH-1,fill_window(D)}return D.strstart+=D.lookahead,D.block_start=D.strstart,D.insert=D.lookahead,D.lookahead=0,D.match_length=D.prev_length=MIN_MATCH-1,D.match_available=0,_.next_in=e,_.input=u,_.avail_in=I,D.wrap=$,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=(_,q)=>Object.prototype.hasOwnProperty.call(_,q);var assign=function(_){const q=Array.prototype.slice.call(arguments,1);for(;q.length;){const k=q.shift();if(k){if(typeof k!="object")throw new TypeError(k+"must be non-object");for(const D in k)_has(k,D)&&(_[D]=k[D])}}return _},flattenChunks=_=>{let q=0;for(let D=0,$=_.length;D<$;D++)q+=_[D].length;const k=new Uint8Array(q);for(let D=0,$=0,I=_.length;D<I;D++){let e=_[D];k.set(e,$),$+=e.length}return k},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(_){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let _=0;_<256;_++)_utf8len[_]=_>=252?6:_>=248?5:_>=240?4:_>=224?3:_>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=_=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(_);let q,k,D,$,I,e=_.length,u=0;for($=0;$<e;$++)k=_.charCodeAt($),(k&64512)===55296&&$+1<e&&(D=_.charCodeAt($+1),(D&64512)===56320&&(k=65536+(k-55296<<10)+(D-56320),$++)),u+=k<128?1:k<2048?2:k<65536?3:4;for(q=new Uint8Array(u),I=0,$=0;I<u;$++)k=_.charCodeAt($),(k&64512)===55296&&$+1<e&&(D=_.charCodeAt($+1),(D&64512)===56320&&(k=65536+(k-55296<<10)+(D-56320),$++)),k<128?q[I++]=k:k<2048?(q[I++]=192|k>>>6,q[I++]=128|k&63):k<65536?(q[I++]=224|k>>>12,q[I++]=128|k>>>6&63,q[I++]=128|k&63):(q[I++]=240|k>>>18,q[I++]=128|k>>>12&63,q[I++]=128|k>>>6&63,q[I++]=128|k&63);return q};const buf2binstring=(_,q)=>{if(q<65534&&_.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,_.length===q?_:_.subarray(0,q));let k="";for(let D=0;D<q;D++)k+=String.fromCharCode(_[D]);return k};var buf2string=(_,q)=>{const k=q||_.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(_.subarray(0,q));let D,$;const I=new Array(k*2);for($=0,D=0;D<k;){let e=_[D++];if(e<128){I[$++]=e;continue}let u=_utf8len[e];if(u>4){I[$++]=65533,D+=u-1;continue}for(e&=u===2?31:u===3?15:7;u>1&&D<k;)e=e<<6|_[D++]&63,u--;if(u>1){I[$++]=65533;continue}e<65536?I[$++]=e:(e-=65536,I[$++]=55296|e>>10&1023,I[$++]=56320|e&1023)}return buf2binstring(I,$)},utf8border=(_,q)=>{q=q||_.length,q>_.length&&(q=_.length);let k=q-1;for(;k>=0&&(_[k]&192)===128;)k--;return k<0||k===0?q:k+_utf8len[_[k]]>q?k:q},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(_){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},_||{});let q=this.options;q.raw&&q.windowBits>0?q.windowBits=-q.windowBits:q.gzip&&q.windowBits>0&&q.windowBits<16&&(q.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let k=deflate_1$2.deflateInit2(this.strm,q.level,q.method,q.windowBits,q.memLevel,q.strategy);if(k!==Z_OK$2)throw new Error(messages[k]);if(q.header&&deflate_1$2.deflateSetHeader(this.strm,q.header),q.dictionary){let D;if(typeof q.dictionary=="string"?D=strings.string2buf(q.dictionary):toString$1.call(q.dictionary)==="[object ArrayBuffer]"?D=new Uint8Array(q.dictionary):D=q.dictionary,k=deflate_1$2.deflateSetDictionary(this.strm,D),k!==Z_OK$2)throw new Error(messages[k]);this._dict_set=!0}}Deflate$1.prototype.push=function(_,q){const k=this.strm,D=this.options.chunkSize;let $,I;if(this.ended)return!1;for(q===~~q?I=q:I=q===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof _=="string"?k.input=strings.string2buf(_):toString$1.call(_)==="[object ArrayBuffer]"?k.input=new Uint8Array(_):k.input=_,k.next_in=0,k.avail_in=k.input.length;;){if(k.avail_out===0&&(k.output=new Uint8Array(D),k.next_out=0,k.avail_out=D),(I===Z_SYNC_FLUSH||I===Z_FULL_FLUSH)&&k.avail_out<=6){this.onData(k.output.subarray(0,k.next_out)),k.avail_out=0;continue}if($=deflate_1$2.deflate(k,I),$===Z_STREAM_END$2)return k.next_out>0&&this.onData(k.output.subarray(0,k.next_out)),$=deflate_1$2.deflateEnd(this.strm),this.onEnd($),this.ended=!0,$===Z_OK$2;if(k.avail_out===0){this.onData(k.output);continue}if(I>0&&k.next_out>0){this.onData(k.output.subarray(0,k.next_out)),k.avail_out=0;continue}if(k.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(_){this.chunks.push(_)},Deflate$1.prototype.onEnd=function(_){_===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=_,this.msg=this.strm.msg};function deflate$1(_,q){const k=new Deflate$1(q);if(k.push(_,!0),k.err)throw k.msg||messages[k.err];return k.result}function deflateRaw$1(_,q){return q=q||{},q.raw=!0,deflate$1(_,q)}function gzip$1(_,q){return q=q||{},q.gzip=!0,deflate$1(_,q)}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 _(q,k){let D,$,I,e,u,N,A,U,L,P,Z,F,W,J,z,V,X,Y,et,ft,tt,st,rt,nt;const ot=q.state;D=q.next_in,rt=q.input,$=D+(q.avail_in-5),I=q.next_out,nt=q.output,e=I-(k-q.avail_out),u=I+(q.avail_out-257),N=ot.dmax,A=ot.wsize,U=ot.whave,L=ot.wnext,P=ot.window,Z=ot.hold,F=ot.bits,W=ot.lencode,J=ot.distcode,z=(1<<ot.lenbits)-1,V=(1<<ot.distbits)-1;t:do{F<15&&(Z+=rt[D++]<<F,F+=8,Z+=rt[D++]<<F,F+=8),X=W[Z&z];e:for(;;){if(Y=X>>>24,Z>>>=Y,F-=Y,Y=X>>>16&255,Y===0)nt[I++]=X&65535;else if(Y&16){et=X&65535,Y&=15,Y&&(F<Y&&(Z+=rt[D++]<<F,F+=8),et+=Z&(1<<Y)-1,Z>>>=Y,F-=Y),F<15&&(Z+=rt[D++]<<F,F+=8,Z+=rt[D++]<<F,F+=8),X=J[Z&V];i:for(;;){if(Y=X>>>24,Z>>>=Y,F-=Y,Y=X>>>16&255,Y&16){if(ft=X&65535,Y&=15,F<Y&&(Z+=rt[D++]<<F,F+=8,F<Y&&(Z+=rt[D++]<<F,F+=8)),ft+=Z&(1<<Y)-1,ft>N){q.msg="invalid distance too far back",ot.mode=BAD$1;break t}if(Z>>>=Y,F-=Y,Y=I-e,ft>Y){if(Y=ft-Y,Y>U&&ot.sane){q.msg="invalid distance too far back",ot.mode=BAD$1;break t}if(tt=0,st=P,L===0){if(tt+=A-Y,Y<et){et-=Y;do nt[I++]=P[tt++];while(--Y);tt=I-ft,st=nt}}else if(L<Y){if(tt+=A+L-Y,Y-=L,Y<et){et-=Y;do nt[I++]=P[tt++];while(--Y);if(tt=0,L<et){Y=L,et-=Y;do nt[I++]=P[tt++];while(--Y);tt=I-ft,st=nt}}}else if(tt+=L-Y,Y<et){et-=Y;do nt[I++]=P[tt++];while(--Y);tt=I-ft,st=nt}for(;et>2;)nt[I++]=st[tt++],nt[I++]=st[tt++],nt[I++]=st[tt++],et-=3;et&&(nt[I++]=st[tt++],et>1&&(nt[I++]=st[tt++]))}else{tt=I-ft;do nt[I++]=nt[tt++],nt[I++]=nt[tt++],nt[I++]=nt[tt++],et-=3;while(et>2);et&&(nt[I++]=nt[tt++],et>1&&(nt[I++]=nt[tt++]))}}else if((Y&64)===0){X=J[(X&65535)+(Z&(1<<Y)-1)];continue i}else{q.msg="invalid distance code",ot.mode=BAD$1;break t}break}}else if((Y&64)===0){X=W[(X&65535)+(Z&(1<<Y)-1)];continue e}else if(Y&32){ot.mode=TYPE$1;break t}else{q.msg="invalid literal/length code",ot.mode=BAD$1;break t}break}}while(D<$&&I<u);et=F>>3,D-=et,F-=et<<3,Z&=(1<<F)-1,q.next_in=D,q.next_out=I,q.avail_in=D<$?5+($-D):5-(D-$),q.avail_out=I<u?257+(u-I):257-(I-u),ot.hold=Z,ot.bits=F};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=(_,q,k,D,$,I,e,u)=>{const N=u.bits;let A=0,U=0,L=0,P=0,Z=0,F=0,W=0,J=0,z=0,V=0,X,Y,et,ft,tt,st=null,rt;const nt=new Uint16Array(MAXBITS+1),ot=new Uint16Array(MAXBITS+1);let St=null,Kt,Jt,Wt;for(A=0;A<=MAXBITS;A++)nt[A]=0;for(U=0;U<D;U++)nt[q[k+U]]++;for(Z=N,P=MAXBITS;P>=1&&nt[P]===0;P--);if(Z>P&&(Z=P),P===0)return $[I++]=1<<24|64<<16|0,$[I++]=1<<24|64<<16|0,u.bits=1,0;for(L=1;L<P&&nt[L]===0;L++);for(Z<L&&(Z=L),J=1,A=1;A<=MAXBITS;A++)if(J<<=1,J-=nt[A],J<0)return-1;if(J>0&&(_===CODES$1||P!==1))return-1;for(ot[1]=0,A=1;A<MAXBITS;A++)ot[A+1]=ot[A]+nt[A];for(U=0;U<D;U++)q[k+U]!==0&&(e[ot[q[k+U]]++]=U);if(_===CODES$1?(st=St=e,rt=20):_===LENS$1?(st=lbase,St=lext,rt=257):(st=dbase,St=dext,rt=0),V=0,U=0,A=L,tt=I,F=Z,W=0,et=-1,z=1<<Z,ft=z-1,_===LENS$1&&z>ENOUGH_LENS$1||_===DISTS$1&&z>ENOUGH_DISTS$1)return 1;for(;;){Kt=A-W,e[U]+1<rt?(Jt=0,Wt=e[U]):e[U]>=rt?(Jt=St[e[U]-rt],Wt=st[e[U]-rt]):(Jt=96,Wt=0),X=1<<A-W,Y=1<<F,L=Y;do Y-=X,$[tt+(V>>W)+Y]=Kt<<24|Jt<<16|Wt|0;while(Y!==0);for(X=1<<A-1;V&X;)X>>=1;if(X!==0?(V&=X-1,V+=X):V=0,U++,--nt[A]===0){if(A===P)break;A=q[k+e[U]]}if(A>Z&&(V&ft)!==et){for(W===0&&(W=Z),tt+=L,F=A-W,J=1<<F;F+W<P&&(J-=nt[F+W],!(J<=0));)F++,J<<=1;if(z+=1<<F,_===LENS$1&&z>ENOUGH_LENS$1||_===DISTS$1&&z>ENOUGH_DISTS$1)return 1;et=V&ft,$[et]=Z<<24|F<<16|tt-I|0}}return V!==0&&($[tt+V]=A-W<<24|64<<16|0),u.bits=Z,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=_=>(_>>>24&255)+(_>>>8&65280)+((_&65280)<<8)+((_&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=_=>{if(!_)return 1;const q=_.state;return!q||q.strm!==_||q.mode<HEAD||q.mode>SYNC?1:0},inflateResetKeep=_=>{if(inflateStateCheck(_))return Z_STREAM_ERROR$1;const q=_.state;return _.total_in=_.total_out=q.total=0,_.msg="",q.wrap&&(_.adler=q.wrap&1),q.mode=HEAD,q.last=0,q.havedict=0,q.flags=-1,q.dmax=32768,q.head=null,q.hold=0,q.bits=0,q.lencode=q.lendyn=new Int32Array(ENOUGH_LENS),q.distcode=q.distdyn=new Int32Array(ENOUGH_DISTS),q.sane=1,q.back=-1,Z_OK$1},inflateReset=_=>{if(inflateStateCheck(_))return Z_STREAM_ERROR$1;const q=_.state;return q.wsize=0,q.whave=0,q.wnext=0,inflateResetKeep(_)},inflateReset2=(_,q)=>{let k;if(inflateStateCheck(_))return Z_STREAM_ERROR$1;const D=_.state;return q<0?(k=0,q=-q):(k=(q>>4)+5,q<48&&(q&=15)),q&&(q<8||q>15)?Z_STREAM_ERROR$1:(D.window!==null&&D.wbits!==q&&(D.window=null),D.wrap=k,D.wbits=q,inflateReset(_))},inflateInit2=(_,q)=>{if(!_)return Z_STREAM_ERROR$1;const k=new InflateState;_.state=k,k.strm=_,k.window=null,k.mode=HEAD;const D=inflateReset2(_,q);return D!==Z_OK$1&&(_.state=null),D},inflateInit=_=>inflateInit2(_,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=_=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let q=0;for(;q<144;)_.lens[q++]=8;for(;q<256;)_.lens[q++]=9;for(;q<280;)_.lens[q++]=7;for(;q<288;)_.lens[q++]=8;for(inftrees(LENS,_.lens,0,288,lenfix,0,_.work,{bits:9}),q=0;q<32;)_.lens[q++]=5;inftrees(DISTS,_.lens,0,32,distfix,0,_.work,{bits:5}),virgin=!1}_.lencode=lenfix,_.lenbits=9,_.distcode=distfix,_.distbits=5},updatewindow=(_,q,k,D)=>{let $;const I=_.state;return I.window===null&&(I.wsize=1<<I.wbits,I.wnext=0,I.whave=0,I.window=new Uint8Array(I.wsize)),D>=I.wsize?(I.window.set(q.subarray(k-I.wsize,k),0),I.wnext=0,I.whave=I.wsize):($=I.wsize-I.wnext,$>D&&($=D),I.window.set(q.subarray(k-D,k-D+$),I.wnext),D-=$,D?(I.window.set(q.subarray(k-D,k),0),I.wnext=D,I.whave=I.wsize):(I.wnext+=$,I.wnext===I.wsize&&(I.wnext=0),I.whave<I.wsize&&(I.whave+=$))),0},inflate$2=(_,q)=>{let k,D,$,I,e,u,N,A,U,L,P,Z,F,W,J=0,z,V,X,Y,et,ft,tt,st;const rt=new Uint8Array(4);let nt,ot;const St=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(_)||!_.output||!_.input&&_.avail_in!==0)return Z_STREAM_ERROR$1;k=_.state,k.mode===TYPE&&(k.mode=TYPEDO),e=_.next_out,$=_.output,N=_.avail_out,I=_.next_in,D=_.input,u=_.avail_in,A=k.hold,U=k.bits,L=u,P=N,st=Z_OK$1;t:for(;;)switch(k.mode){case HEAD:if(k.wrap===0){k.mode=TYPEDO;break}for(;U<16;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(k.wrap&2&&A===35615){k.wbits===0&&(k.wbits=15),k.check=0,rt[0]=A&255,rt[1]=A>>>8&255,k.check=crc32_1(k.check,rt,2,0),A=0,U=0,k.mode=FLAGS;break}if(k.head&&(k.head.done=!1),!(k.wrap&1)||(((A&255)<<8)+(A>>8))%31){_.msg="incorrect header check",k.mode=BAD;break}if((A&15)!==Z_DEFLATED){_.msg="unknown compression method",k.mode=BAD;break}if(A>>>=4,U-=4,tt=(A&15)+8,k.wbits===0&&(k.wbits=tt),tt>15||tt>k.wbits){_.msg="invalid window size",k.mode=BAD;break}k.dmax=1<<k.wbits,k.flags=0,_.adler=k.check=1,k.mode=A&512?DICTID:TYPE,A=0,U=0;break;case FLAGS:for(;U<16;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(k.flags=A,(k.flags&255)!==Z_DEFLATED){_.msg="unknown compression method",k.mode=BAD;break}if(k.flags&57344){_.msg="unknown header flags set",k.mode=BAD;break}k.head&&(k.head.text=A>>8&1),k.flags&512&&k.wrap&4&&(rt[0]=A&255,rt[1]=A>>>8&255,k.check=crc32_1(k.check,rt,2,0)),A=0,U=0,k.mode=TIME;case TIME:for(;U<32;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}k.head&&(k.head.time=A),k.flags&512&&k.wrap&4&&(rt[0]=A&255,rt[1]=A>>>8&255,rt[2]=A>>>16&255,rt[3]=A>>>24&255,k.check=crc32_1(k.check,rt,4,0)),A=0,U=0,k.mode=OS;case OS:for(;U<16;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}k.head&&(k.head.xflags=A&255,k.head.os=A>>8),k.flags&512&&k.wrap&4&&(rt[0]=A&255,rt[1]=A>>>8&255,k.check=crc32_1(k.check,rt,2,0)),A=0,U=0,k.mode=EXLEN;case EXLEN:if(k.flags&1024){for(;U<16;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}k.length=A,k.head&&(k.head.extra_len=A),k.flags&512&&k.wrap&4&&(rt[0]=A&255,rt[1]=A>>>8&255,k.check=crc32_1(k.check,rt,2,0)),A=0,U=0}else k.head&&(k.head.extra=null);k.mode=EXTRA;case EXTRA:if(k.flags&1024&&(Z=k.length,Z>u&&(Z=u),Z&&(k.head&&(tt=k.head.extra_len-k.length,k.head.extra||(k.head.extra=new Uint8Array(k.head.extra_len)),k.head.extra.set(D.subarray(I,I+Z),tt)),k.flags&512&&k.wrap&4&&(k.check=crc32_1(k.check,D,Z,I)),u-=Z,I+=Z,k.length-=Z),k.length))break t;k.length=0,k.mode=NAME;case NAME:if(k.flags&2048){if(u===0)break t;Z=0;do tt=D[I+Z++],k.head&&tt&&k.length<65536&&(k.head.name+=String.fromCharCode(tt));while(tt&&Z<u);if(k.flags&512&&k.wrap&4&&(k.check=crc32_1(k.check,D,Z,I)),u-=Z,I+=Z,tt)break t}else k.head&&(k.head.name=null);k.length=0,k.mode=COMMENT;case COMMENT:if(k.flags&4096){if(u===0)break t;Z=0;do tt=D[I+Z++],k.head&&tt&&k.length<65536&&(k.head.comment+=String.fromCharCode(tt));while(tt&&Z<u);if(k.flags&512&&k.wrap&4&&(k.check=crc32_1(k.check,D,Z,I)),u-=Z,I+=Z,tt)break t}else k.head&&(k.head.comment=null);k.mode=HCRC;case HCRC:if(k.flags&512){for(;U<16;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(k.wrap&4&&A!==(k.check&65535)){_.msg="header crc mismatch",k.mode=BAD;break}A=0,U=0}k.head&&(k.head.hcrc=k.flags>>9&1,k.head.done=!0),_.adler=k.check=0,k.mode=TYPE;break;case DICTID:for(;U<32;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}_.adler=k.check=zswap32(A),A=0,U=0,k.mode=DICT;case DICT:if(k.havedict===0)return _.next_out=e,_.avail_out=N,_.next_in=I,_.avail_in=u,k.hold=A,k.bits=U,Z_NEED_DICT$1;_.adler=k.check=1,k.mode=TYPE;case TYPE:if(q===Z_BLOCK||q===Z_TREES)break t;case TYPEDO:if(k.last){A>>>=U&7,U-=U&7,k.mode=CHECK;break}for(;U<3;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}switch(k.last=A&1,A>>>=1,U-=1,A&3){case 0:k.mode=STORED;break;case 1:if(fixedtables(k),k.mode=LEN_,q===Z_TREES){A>>>=2,U-=2;break t}break;case 2:k.mode=TABLE;break;case 3:_.msg="invalid block type",k.mode=BAD}A>>>=2,U-=2;break;case STORED:for(A>>>=U&7,U-=U&7;U<32;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if((A&65535)!==(A>>>16^65535)){_.msg="invalid stored block lengths",k.mode=BAD;break}if(k.length=A&65535,A=0,U=0,k.mode=COPY_,q===Z_TREES)break t;case COPY_:k.mode=COPY;case COPY:if(Z=k.length,Z){if(Z>u&&(Z=u),Z>N&&(Z=N),Z===0)break t;$.set(D.subarray(I,I+Z),e),u-=Z,I+=Z,N-=Z,e+=Z,k.length-=Z;break}k.mode=TYPE;break;case TABLE:for(;U<14;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(k.nlen=(A&31)+257,A>>>=5,U-=5,k.ndist=(A&31)+1,A>>>=5,U-=5,k.ncode=(A&15)+4,A>>>=4,U-=4,k.nlen>286||k.ndist>30){_.msg="too many length or distance symbols",k.mode=BAD;break}k.have=0,k.mode=LENLENS;case LENLENS:for(;k.have<k.ncode;){for(;U<3;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}k.lens[St[k.have++]]=A&7,A>>>=3,U-=3}for(;k.have<19;)k.lens[St[k.have++]]=0;if(k.lencode=k.lendyn,k.lenbits=7,nt={bits:k.lenbits},st=inftrees(CODES,k.lens,0,19,k.lencode,0,k.work,nt),k.lenbits=nt.bits,st){_.msg="invalid code lengths set",k.mode=BAD;break}k.have=0,k.mode=CODELENS;case CODELENS:for(;k.have<k.nlen+k.ndist;){for(;J=k.lencode[A&(1<<k.lenbits)-1],z=J>>>24,V=J>>>16&255,X=J&65535,!(z<=U);){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(X<16)A>>>=z,U-=z,k.lens[k.have++]=X;else{if(X===16){for(ot=z+2;U<ot;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(A>>>=z,U-=z,k.have===0){_.msg="invalid bit length repeat",k.mode=BAD;break}tt=k.lens[k.have-1],Z=3+(A&3),A>>>=2,U-=2}else if(X===17){for(ot=z+3;U<ot;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}A>>>=z,U-=z,tt=0,Z=3+(A&7),A>>>=3,U-=3}else{for(ot=z+7;U<ot;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}A>>>=z,U-=z,tt=0,Z=11+(A&127),A>>>=7,U-=7}if(k.have+Z>k.nlen+k.ndist){_.msg="invalid bit length repeat",k.mode=BAD;break}for(;Z--;)k.lens[k.have++]=tt}}if(k.mode===BAD)break;if(k.lens[256]===0){_.msg="invalid code -- missing end-of-block",k.mode=BAD;break}if(k.lenbits=9,nt={bits:k.lenbits},st=inftrees(LENS,k.lens,0,k.nlen,k.lencode,0,k.work,nt),k.lenbits=nt.bits,st){_.msg="invalid literal/lengths set",k.mode=BAD;break}if(k.distbits=6,k.distcode=k.distdyn,nt={bits:k.distbits},st=inftrees(DISTS,k.lens,k.nlen,k.ndist,k.distcode,0,k.work,nt),k.distbits=nt.bits,st){_.msg="invalid distances set",k.mode=BAD;break}if(k.mode=LEN_,q===Z_TREES)break t;case LEN_:k.mode=LEN;case LEN:if(u>=6&&N>=258){_.next_out=e,_.avail_out=N,_.next_in=I,_.avail_in=u,k.hold=A,k.bits=U,inffast(_,P),e=_.next_out,$=_.output,N=_.avail_out,I=_.next_in,D=_.input,u=_.avail_in,A=k.hold,U=k.bits,k.mode===TYPE&&(k.back=-1);break}for(k.back=0;J=k.lencode[A&(1<<k.lenbits)-1],z=J>>>24,V=J>>>16&255,X=J&65535,!(z<=U);){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(V&&(V&240)===0){for(Y=z,et=V,ft=X;J=k.lencode[ft+((A&(1<<Y+et)-1)>>Y)],z=J>>>24,V=J>>>16&255,X=J&65535,!(Y+z<=U);){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}A>>>=Y,U-=Y,k.back+=Y}if(A>>>=z,U-=z,k.back+=z,k.length=X,V===0){k.mode=LIT;break}if(V&32){k.back=-1,k.mode=TYPE;break}if(V&64){_.msg="invalid literal/length code",k.mode=BAD;break}k.extra=V&15,k.mode=LENEXT;case LENEXT:if(k.extra){for(ot=k.extra;U<ot;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}k.length+=A&(1<<k.extra)-1,A>>>=k.extra,U-=k.extra,k.back+=k.extra}k.was=k.length,k.mode=DIST;case DIST:for(;J=k.distcode[A&(1<<k.distbits)-1],z=J>>>24,V=J>>>16&255,X=J&65535,!(z<=U);){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if((V&240)===0){for(Y=z,et=V,ft=X;J=k.distcode[ft+((A&(1<<Y+et)-1)>>Y)],z=J>>>24,V=J>>>16&255,X=J&65535,!(Y+z<=U);){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}A>>>=Y,U-=Y,k.back+=Y}if(A>>>=z,U-=z,k.back+=z,V&64){_.msg="invalid distance code",k.mode=BAD;break}k.offset=X,k.extra=V&15,k.mode=DISTEXT;case DISTEXT:if(k.extra){for(ot=k.extra;U<ot;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}k.offset+=A&(1<<k.extra)-1,A>>>=k.extra,U-=k.extra,k.back+=k.extra}if(k.offset>k.dmax){_.msg="invalid distance too far back",k.mode=BAD;break}k.mode=MATCH;case MATCH:if(N===0)break t;if(Z=P-N,k.offset>Z){if(Z=k.offset-Z,Z>k.whave&&k.sane){_.msg="invalid distance too far back",k.mode=BAD;break}Z>k.wnext?(Z-=k.wnext,F=k.wsize-Z):F=k.wnext-Z,Z>k.length&&(Z=k.length),W=k.window}else W=$,F=e-k.offset,Z=k.length;Z>N&&(Z=N),N-=Z,k.length-=Z;do $[e++]=W[F++];while(--Z);k.length===0&&(k.mode=LEN);break;case LIT:if(N===0)break t;$[e++]=k.length,N--,k.mode=LEN;break;case CHECK:if(k.wrap){for(;U<32;){if(u===0)break t;u--,A|=D[I++]<<U,U+=8}if(P-=N,_.total_out+=P,k.total+=P,k.wrap&4&&P&&(_.adler=k.check=k.flags?crc32_1(k.check,$,P,e-P):adler32_1(k.check,$,P,e-P)),P=N,k.wrap&4&&(k.flags?A:zswap32(A))!==k.check){_.msg="incorrect data check",k.mode=BAD;break}A=0,U=0}k.mode=LENGTH;case LENGTH:if(k.wrap&&k.flags){for(;U<32;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(k.wrap&4&&A!==(k.total&4294967295)){_.msg="incorrect length check",k.mode=BAD;break}A=0,U=0}k.mode=DONE;case DONE:st=Z_STREAM_END$1;break t;case BAD:st=Z_DATA_ERROR$1;break t;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return _.next_out=e,_.avail_out=N,_.next_in=I,_.avail_in=u,k.hold=A,k.bits=U,(k.wsize||P!==_.avail_out&&k.mode<BAD&&(k.mode<CHECK||q!==Z_FINISH$1))&&updatewindow(_,_.output,_.next_out,P-_.avail_out),L-=_.avail_in,P-=_.avail_out,_.total_in+=L,_.total_out+=P,k.total+=P,k.wrap&4&&P&&(_.adler=k.check=k.flags?crc32_1(k.check,$,P,_.next_out-P):adler32_1(k.check,$,P,_.next_out-P)),_.data_type=k.bits+(k.last?64:0)+(k.mode===TYPE?128:0)+(k.mode===LEN_||k.mode===COPY_?256:0),(L===0&&P===0||q===Z_FINISH$1)&&st===Z_OK$1&&(st=Z_BUF_ERROR),st},inflateEnd=_=>{if(inflateStateCheck(_))return Z_STREAM_ERROR$1;let q=_.state;return q.window&&(q.window=null),_.state=null,Z_OK$1},inflateGetHeader=(_,q)=>{if(inflateStateCheck(_))return Z_STREAM_ERROR$1;const k=_.state;return(k.wrap&2)===0?Z_STREAM_ERROR$1:(k.head=q,q.done=!1,Z_OK$1)},inflateSetDictionary=(_,q)=>{const k=q.length;let D,$,I;return inflateStateCheck(_)||(D=_.state,D.wrap!==0&&D.mode!==DICT)?Z_STREAM_ERROR$1:D.mode===DICT&&($=1,$=adler32_1($,q,k,0),$!==D.check)?Z_DATA_ERROR$1:(I=updatewindow(_,q,k,k),I?(D.mode=MEM,Z_MEM_ERROR$1):(D.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(_){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},_||{});const q=this.options;q.raw&&q.windowBits>=0&&q.windowBits<16&&(q.windowBits=-q.windowBits,q.windowBits===0&&(q.windowBits=-15)),q.windowBits>=0&&q.windowBits<16&&!(_&&_.windowBits)&&(q.windowBits+=32),q.windowBits>15&&q.windowBits<48&&(q.windowBits&15)===0&&(q.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let k=inflate_1$2.inflateInit2(this.strm,q.windowBits);if(k!==Z_OK)throw new Error(messages[k]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),q.dictionary&&(typeof q.dictionary=="string"?q.dictionary=strings.string2buf(q.dictionary):toString.call(q.dictionary)==="[object ArrayBuffer]"&&(q.dictionary=new Uint8Array(q.dictionary)),q.raw&&(k=inflate_1$2.inflateSetDictionary(this.strm,q.dictionary),k!==Z_OK)))throw new Error(messages[k])}Inflate$1.prototype.push=function(_,q){const k=this.strm,D=this.options.chunkSize,$=this.options.dictionary;let I,e,u;if(this.ended)return!1;for(q===~~q?e=q:e=q===!0?Z_FINISH:Z_NO_FLUSH,toString.call(_)==="[object ArrayBuffer]"?k.input=new Uint8Array(_):k.input=_,k.next_in=0,k.avail_in=k.input.length;;){for(k.avail_out===0&&(k.output=new Uint8Array(D),k.next_out=0,k.avail_out=D),I=inflate_1$2.inflate(k,e),I===Z_NEED_DICT&&$&&(I=inflate_1$2.inflateSetDictionary(k,$),I===Z_OK?I=inflate_1$2.inflate(k,e):I===Z_DATA_ERROR&&(I=Z_NEED_DICT));k.avail_in>0&&I===Z_STREAM_END&&k.state.wrap>0&&_[k.next_in]!==0;)inflate_1$2.inflateReset(k),I=inflate_1$2.inflate(k,e);switch(I){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(I),this.ended=!0,!1}if(u=k.avail_out,k.next_out&&(k.avail_out===0||I===Z_STREAM_END))if(this.options.to==="string"){let N=strings.utf8border(k.output,k.next_out),A=k.next_out-N,U=strings.buf2string(k.output,N);k.next_out=A,k.avail_out=D-A,A&&k.output.set(k.output.subarray(N,N+A),0),this.onData(U)}else this.onData(k.output.length===k.next_out?k.output:k.output.subarray(0,k.next_out));if(!(I===Z_OK&&u===0)){if(I===Z_STREAM_END)return I=inflate_1$2.inflateEnd(this.strm),this.onEnd(I),this.ended=!0,!0;if(k.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(_){this.chunks.push(_)},Inflate$1.prototype.onEnd=function(_){_===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=_,this.msg=this.strm.msg};function inflate$1(_,q){const k=new Inflate$1(q);if(k.push(_),k.err)throw k.msg||messages[k.err];return k.result}function inflateRaw$1(_,q){return q=q||{},q.raw=!0,inflate$1(_,q)}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};const noLogEvents=["heartbeat","onNetQuality","networkQualityChange"],compressArrayBuffer=_=>{const q=new Uint8Array(_),k=pako.deflate(q,{gzip:!0});return new Uint8Array(k==null?void 0:k.buffer)},decompressArrayBuffer=_=>{const q=new Uint8Array(_),k=pako.inflate(q,{gzip:!0});return new Uint8Array(k==null?void 0:k.buffer)},sendMessageFormat=_=>{const{event:q}=_;switch(_.data_original=_.data,_.time&&(_.timeStr=E(_.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),q){case"login":_.data=com.quick.voice.proto.Login.encode(_.data).finish();break;case"joinRoom":case"joinRoomEx":_.data=com.quick.voice.proto.JoinReq.encode(_.data).finish();break;case"quitRoom":_.data=com.quick.voice.proto.QuitReq.encode(_.data).finish();break;case"connectCF":_.data=com.quick.voice.proto.ConnectCFReq.encode(_.data).finish(),_.data=compressArrayBuffer(_.data),_.compress=!0;break;case"publish":_.data=com.quick.voice.proto.PublishReq.encode(_.data).finish(),_.data=compressArrayBuffer(_.data),_.compress=!0;break;case"subscribe":_.data=com.quick.voice.proto.SubscribeReq.encode(_.data).finish();break;case"closeTrack":_.data=com.quick.voice.proto.CloseTrackReq.encode(_.data).finish(),_.data=compressArrayBuffer(_.data),_.compress=!0;break;case"renegotiate":_.data=com.quick.voice.proto.RenegotiateReq.encode(_.data).finish(),_.data=compressArrayBuffer(_.data),_.compress=!0;break;case"syncRoomInfo":_.data=com.quick.voice.proto.SyncRoomInfoReq.encode(_.data).finish();break;case"updateCall":_.data=com.quick.voice.proto.UpdateCall.encode(_.data).finish();break;case"networkQualityChange":_.data=com.quick.voice.proto.NetQualityChange.encode(_.data).finish();break;case"pubNotify":_.data=com.quick.voice.proto.PublishNotify.encode(_.data).finish();break;default:_.data=new Uint8Array;break}return _},onMessageFormat=_=>{const{event:q,compress:k=!1}=_;if(_.data_remote=_.data,_.time&&(_.timeStr=E(_.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),k)try{_.data=decompressArrayBuffer(_.data)}catch(D){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",D)}switch(q){case"login":_.data=com.quick.voice.proto.Login.decode(_.data);break;case"joinRoom":case"joinRoomEx":_.data=com.quick.voice.proto.JoinRsp.decode(_.data);break;case"onJoinRoom":_.data=com.quick.voice.proto.JoinNotify.decode(_.data);break;case"onQuitRoom":_.data=com.quick.voice.proto.QuitNotify.decode(_.data);break;case"connectCF":_.data=com.quick.voice.proto.ConnectCFRsp.decode(_.data);break;case"publish":_.data=com.quick.voice.proto.PublishRsp.decode(_.data);break;case"onPublish":_.data=com.quick.voice.proto.PublishNotify.decode(_.data);break;case"subscribe":_.data=com.quick.voice.proto.SubscribeRsp.decode(_.data);break;case"closeTrack":_.data=com.quick.voice.proto.CloseTrackRsp.decode(_.data);break;case"onCloseTrack":_.data=com.quick.voice.proto.CloseTrackNotify.decode(_.data);break;case"onUpdateCall":_.data=com.quick.voice.proto.UpdateCall.decode(_.data);break;case"onDestroyRoom":_.data=com.quick.voice.proto.QuitNotify.decode(_.data);break;case"onUpdatePermissions":_.data=com.quick.voice.proto.UpdatePermissions.decode(_.data);break;case"onNetQuality":_.data=com.quick.voice.proto.NetQualityNotify.decode(_.data);break;case"syncRoomInfo":_.data=com.quick.voice.proto.SyncRoomInfoRsp.decode(_.data);break;case"onCDNPlayUrlAdd":_.data=com.quick.voice.proto.CDNPlayAddressNotify.decode(_.data);break;case"debugger":_.data=JSON.parse(new TextDecoder().decode(_.data));break}return _};class CallsWebSocket{constructor(q){lt(this,at);lt(this,ct,{url:"wss://demo.putplay.cc/websocket",debug:!1,reconnectCount:10,timeout:30*1e3});lt(this,dt,"");lt(this,ht,{});lt(this,yt,{});H(this,"state","closed");H(this,"sendMessageBefore",async()=>{});H(this,"onReconnectSuccess",q=>{});H(this,"onReconnectStop",q=>{});lt(this,It,q=>{let k=!0;const{code:D=1e3,reason:$=""}=q;return D===1e3&&($==="quit success!"||$==="replace old connection!")&&(k=!1),k});lt(this,Rt,async q=>{G(this,ct).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连成功",q),this.state="connected",this.onReconnectSuccess(q)});lt(this,Et,async q=>{G(this,ct).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连停止",q),this.close(),this.state="closed",this.onReconnectStop(q)});lt(this,xt,()=>{const q={event:"heartbeat",sn:+`${O(1e5,999999)}`};return com.quick.voice.proto.CommonReq.encode(q).finish()});lt(this,$t,(q,k={})=>{try{const{time:D,event:$,data:I={},data_original:e={},data_remote:u,...N}=k,A=E(D,"YYYY-MM-DD hh:mm:ss",{offset:480});let U={};const L=(V={})=>{const X=JSON.parse(JSON.stringify(V)),Y=Object.keys(X);for(const et of Y)(et.includes("sdp")||et.includes("Sdp"))&&(X[et]="");return X};let P="res ↓";switch(q){case"res":P="res ↓",U=L(I);break;case"req":P="req ↑",U=L(e);break}let Z="#quickvo.logs";ignoreEvent.includes($)&&(Z="#quickvo.ignoreEvents");const F={"#action":P,timeStr:A,event:$,data:U,time:D,...N},W=localStorage.getItem(Z)||JSON.stringify([]),J=JSON.parse(W),z=[F,...J].slice(0,500);localStorage.setItem(Z,JSON.stringify(z))}catch(D){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",D)}});lt(this,Nt,(q,{resolve:k,reject:D})=>{const{sn:$}=q,I=()=>{const u=G(this,ht)[$];clearTimeout(u.destructionTimer),delete G(this,ht)[$]},e=setTimeout(()=>{const u=G(this,ht)[$];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:event is timeout",u.message),I(),D("event is timeout")},G(this,ct).timeout);G(this,ht)[$]={message:q,resolve:k,reject:D,destruction:I,destructionTimer:e}});lt(this,At,q=>G(this,ht)[q]);lt(this,qt,async q=>{const k=new Uint8Array(q),D=com.quick.voice.proto.CommonRsp.decode(k),{sn:$,event:I}=D,e=onMessageFormat(D);if(G(this,ct).debug&&(noLogEvents.includes(I)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",e),ignoreEvent.includes(I)||G(this,$t).call(this,"res",e)),notifyName_keys.includes(I))return this.emitNotify(I,v$1(e,["code","data","desc"]));const N=G(this,At).call(this,$);if(N){const{resolve:A=L=>{},destruction:U=()=>{}}=N;A(v$1(e,["code","data","desc"])),U()}});H(this,"clearEvents",(q=[])=>{const k=Object.keys(G(this,ht));q.length===0&&(q=k);for(const D of k){if(!q.includes(D))continue;const $=G(this,ht)[D];clearTimeout($.destructionTimer),delete G(this,ht)[D]}});H(this,"connect",async(q="")=>new Promise(async k=>{q&&vt(this,dt,q),G(this,at)&&(await G(this,at).close(),this.state="closed");const D=`${G(this,ct).url}?s=${G(this,dt)}&t=${Date.now()}`;vt(this,at,new M({...G(this,ct),url:D,binaryType:"arraybuffer",onMessage:G(this,qt),checkReconnect:G(this,It),getHeartbeatMsg:G(this,xt),onReconnectSuccess:G(this,Rt),onReconnectStop:G(this,Et)})),this.state="connecting",await G(this,at).connect(),this.state="connected",G(this,ct).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 当前广播事件",G(this,yt)),k(G(this,at))}));H(this,"close",async()=>{var k;G(this,ct).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.");const q=Object.keys(G(this,ht));for(const D of q){const{destructionTimer:$}=G(this,ht)[D];clearTimeout($)}vt(this,ht,{}),await((k=G(this,at))==null?void 0:k.close()),vt(this,at,void 0),this.state="closed"});H(this,"sendMessage",(q,k=!0)=>new Promise(async(D,$)=>{var U;await this.sendMessageBefore();const{event:I,...e}=q,u=Date.now(),N=sendMessageFormat({event:I,sn:+`${u}${O(1e3,9999)}`,time:u,valid:G(this,ct).timeout,version:1,compress:!1,...e});G(this,ct).debug&&(noLogEvents.includes(I)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",N),ignoreEvent.includes(I)||G(this,$t).call(this,"req",N)),k&&G(this,Nt).call(this,N,{resolve:D,reject:$});const A=com.quick.voice.proto.CommonReq.encode(N).finish();(U=G(this,at))==null||U.sendMessage(A)}));H(this,"emitNotify",async(q,k)=>{const D=G(this,yt)[q]||[];for(const $ of D){const{callback:I=async()=>{}}=$;await I(k)}});H(this,"addNotify",(q,k=!1)=>{const{event:D,sn:$=pt(32)}=q;G(this,yt)[D]||(G(this,yt)[D]=[]);const I=G(this,yt)[D],e=I.findIndex(u=>u.sn===$);return e!==-1&&I.splice(e,1),k?I.unshift(q):I.push(q),$});H(this,"removeNotify",(q=[])=>{if(q.length===0)vt(this,yt,{});else{const k=Object.keys(G(this,yt));for(const D of k)G(this,yt)[D]=G(this,yt)[D].filter($=>!q.includes($.sn||""))}G(this,ct).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",G(this,yt))});vt(this,ct,{...G(this,ct),...q})}}at=new WeakMap,ct=new WeakMap,dt=new WeakMap,ht=new WeakMap,yt=new WeakMap,It=new WeakMap,Rt=new WeakMap,Et=new WeakMap,xt=new WeakMap,$t=new WeakMap,Nt=new WeakMap,At=new WeakMap,qt=new WeakMap;var p=Object.defineProperty,x=_=>{throw TypeError(_)},g=(_,q,k)=>q in _?p(_,q,{enumerable:!0,configurable:!0,writable:!0,value:k}):_[q]=k,h=(_,q,k)=>g(_,typeof q!="symbol"?q+"":q,k),y=(_,q,k)=>q.has(_)||x("Cannot "+k),n=(_,q,k)=>(y(_,q,"read from private field"),k?k.call(_):q.get(_)),a=(_,q,k)=>q.has(_)?x("Cannot add the same private member more than once"):q instanceof WeakSet?q.add(_):q.set(_,k),b=(_,q,k,D)=>(y(_,q,"write to private field"),q.set(_,k),k),d,o,f;class K{constructor(q){a(this,d,new Map),a(this,o,[]),h(this,"index"),h(this,"setCondition",(k,D)=>{n(this,d).set(k,D),D&&n(this,f).call(this)}),h(this,"addTask",(k,D,$={})=>{const I={key:"",strict:!1,describe:"",...$};let{key:e,strict:u,describe:N}=I;e?this.clear([e]):e=`${this.index++}`;{const A={key:e,func:k,conditionKeys:D,describe:N,strict:u};n(this,o).unshift(A)}return n(this,f).call(this),e}),h(this,"clear",(k=[])=>{if(k.length===0){b(this,o,[]);return}for(const D of k){const $=n(this,o).findIndex(I=>I.key===D);$!==-1&&n(this,o).splice($,1)}}),h(this,"getConditions",()=>Object.fromEntries(n(this,d))),h(this,"getTasks",()=>{const k=[];for(const D of n(this,o)){const{key:$,describe:I,conditionKeys:e}=D;k.push({key:$,describe:I,conditionKeys:e})}return k}),h(this,"checkConditions",k=>{let D=!0;for(const $ of k)if(n(this,d).get($)===!1){D=!1;break}return D}),a(this,f,()=>{const k=n(this,o).length;for(let D=k;D>0;D--){const $=D-1,I=n(this,o)[$],{conditionKeys:e,func:u,strict:N}=I,A=this.checkConditions(e);{if(!A)return;u()}{if(N)return;n(this,o).splice($,1)}}}),this.index=0;for(const k of q)n(this,d).set(k,!1)}}d=new WeakMap,o=new WeakMap,f=new WeakMap;class RoomBase{constructor(){H(this,"options",{appid:"",sdkToken:"",roomId:"",userId:"",callType:0,debug:!1,newPublishAutoSubscribe:!0});H(this,"prohibitNotify",!1);H(this,"isEarly",!1);H(this,"taskQueue",new K(["createWs","createSession","ice","joinRoom","createTrack","subscribe","closeTrack","publish"]));H(this,"roomState","ready");H(this,"createAt",Date.now());H(this,"cwsIns",new CallsWebSocket);H(this,"peerIns",new RTCPeerConnection({bundlePolicy:"max-bundle"}));H(this,"transceiverMap",new Map);H(this,"userMap",new Map);H(this,"mediaDevicesErrInfo",{microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""});H(this,"initAsyncQueue",()=>{this.taskQueue.clear(),this.taskQueue.setCondition("joinRoom",!0),this.taskQueue.setCondition("createTrack",!0),this.taskQueue.setCondition("closeTrack",!0),this.taskQueue.setCondition("subscribe",!0),this.taskQueue.setCondition("publish",!0)});H(this,"getRoomInfo",()=>{const{options:q,roomState:k,createAt:D}=this;return{...q,roomState:k,createAt:D}});H(this,"setRoomState",q=>{this.roomState=q;const k=enum_roomState[q],D={state:q,stateStr:k};this.cwsIns.emitNotify("onRoomState",{code:200,data:D,desc:"room state is change."})});H(this,"setOptions",async q=>{const k={...this.options,...q};this.options=k});H(this,"initCwsCall",()=>{this.cwsIns=new CallsWebSocket({...this.options})});H(this,"getMediaDevicesErrInfo",async()=>{try{const q=await navigator.mediaDevices.enumerateDevices();q.find(D=>D.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),q.find(D=>D.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(q){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe:error",q)}return this.mediaDevicesErrInfo});H(this,"getUserMediaKey",(q,k)=>`${q}-${k}`);H(this,"getCallActionMap",(q=0)=>{const D=Number(q).toString(2).padStart(4,"0").split(""),[$,I,e,u]=D;return{microphoneCamera_audio:!!Number(u),microphoneCamera_video:!!Number(e),screenSharing_video:!!Number(I),screenSharing_audio:!!Number($)}});H(this,"getAverageVolume",(q,k)=>{q.getByteFrequencyData(k);let D=0;for(let I=0;I<k.length;I++)D+=k[I];return Math.ceil(D/k.length)});H(this,"getCallAction",async q=>{let k="";const D=I=>q.findIndex(({type:u,enabled:N=!0})=>u===I&&N)===-1?"0":"1";return k=`${D(0)}${k}`,k=`${D(1)}${k}`,k=`${D(2)}${k}`,k=`${D(3)}${k}`,parseInt(k,2)});H(this,"getTrackNamesFormTracks",(q,k=[],D="trackName")=>{const $=[];for(const I of q){const{type:e}=I;if(k.length===0||k.includes(e)){const u=I[D];u&&$.push(`${u}`)}}return $});H(this,"usersFilter",q=>mt(q,["id","isSelf","joinTime","tracks","callAction","callActionStr","callActionMap","network","updateStreams","permissions","isPublished"]).sort(($,I)=>$.id.localeCompare(I.id,"en")));this.initAsyncQueue()}}const createMutedAudioStream=()=>{const _=new AudioContext,q=_.createOscillator();q.type="sine",q.frequency.setValueAtTime(0,_.currentTime);const k=_.createGain();k.gain.value=0,q.connect(k),k.connect(_.destination),q.start();const D=_.createMediaStreamDestination();return k.disconnect(),q.connect(D),D.stream},createFakeVideoStream=(_=10,q=10,k=30)=>{const D=document.createElement("canvas"),$=D.getContext("2d");D.width=_,D.height=q;let I=0;return setInterval(()=>{$.clearRect(0,0,D.width,D.height);const N=$.createLinearGradient(0,0,D.width,D.height);N.addColorStop(0,`hsla(${I}, 100%, 50%, 0)`),N.addColorStop(1,`hsla(${I+120}, 100%, 50%, 0)`),$.fillStyle=N,$.fillRect(0,0,D.width,D.height),I=(I+1)%360},100),D.captureStream(k)},phoneyStreams={microphoneCamera_audio:createMutedAudioStream(),microphoneCamera_video:createFakeVideoStream(),screenSharing_video:createFakeVideoStream(),screenSharing_audio:createMutedAudioStream()};class RoomMedias extends RoomBase{constructor(){super();H(this,"mediaDevices",[]);lt(this,kt,new Map);lt(this,bt,new Map);lt(this,_t,new Map);lt(this,Tt,new Map);lt(this,Dt,()=>{for(const k of mediaType_keys)G(this,Tt).set(k,phoneyStreams[k])});H(this,"getPhoneyStreams",k=>G(this,Tt).get(k));lt(this,Ct,()=>{G(this,bt).set("microphoneCamera_audio",{}),G(this,bt).set("microphoneCamera_video",{width:{ideal:1920},height:{ideal:1080},frameRate:{min:10,ideal:30}}),G(this,bt).set("screenSharing_video",{width:{ideal:1920},height:{ideal:1080},frameRate:{min:10,ideal:30}}),G(this,bt).set("screenSharing_audio",{})});lt(this,Ut,()=>{G(this,kt).set("audioinput","default"),G(this,kt).set("videoinput","default"),G(this,kt).set("audiooutput","default")});H(this,"emitNotifyUpdateUsersStreams",async k=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:k,desc:"users streams is change."})});H(this,"initUserMediaStreamContext",async(k,D,$)=>{var N;const[I]=$.getTracks();if(!I){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: tracks.length is 0.",{userId:k,mediaType:D,stream:$});return}this.removeUserMediaStreamContext(k,D);const e=this.getUserMediaKey(k,D),{kind:u}=I;switch(u){case"audio":{const A=new AudioMediaContext(I);G(this,_t).set(e,A)}break;case"video":{const A=new VideoMediaContext(I);G(this,_t).set(e,A)}break}{const A=this.getUserMediaStreamContext(k,D);if(A&&A.kind==="audio")try{const U=G(this,kt).get("audiooutput");(N=A.audioContext)==null||N.setSinkId(U)}catch(U){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error",U)}}});H(this,"getUserMediaStreamContext",(k,D)=>{const $=this.getUserMediaKey(k,D);return G(this,_t).get($)});H(this,"getUserAudioMediaStreamContext",(k,D)=>{const $=this.getUserMediaKey(k,D);return G(this,_t).get($)});H(this,"removeUserMediaStreamContext",(k,D)=>{const $=this.getUserMediaKey(k,D),I=G(this,_t).get($);I==null||I.stop(),G(this,_t).delete($)});H(this,"getUserStream",(k,D)=>{const $=this.getUserMediaStreamContext(k,D);return($==null?void 0:$.getStream())||new MediaStream});H(this,"getUserStreams",(k,D=[])=>{D.length===0&&(D=mediaType_keys);const $={};for(const I of D){const e=this.getUserStream(k,I);$[I]=e}return $});H(this,"removeUserStreams",async(k,D=[])=>{D.length===0&&(D=mediaType_keys);for(const $ of D)this.removeUserMediaStreamContext(k,$)});H(this,"clearUserStreams",()=>{const k=G(this,_t).values();for(const D of k)D.stop();vt(this,_t,new Map)});H(this,"setMediaTrackConstraints",async(k,D)=>{G(this,bt).set(k,D);const I=this.getUserStream(this.options.userId,k).getTracks();if(I.length!==0)for(const e of I){const N={...e.getConstraints(),...D};await e.applyConstraints(N)}});H(this,"initLocalStream",async k=>{const{userId:D}=this.options,$=G(this,bt).get(k);switch(k){case"microphoneCamera_audio":{const I=G(this,kt).get("audioinput"),e=await navigator.mediaDevices.getUserMedia({audio:{deviceId:I,...$},video:!1});await this.initUserMediaStreamContext(D,"microphoneCamera_audio",e)}break;case"microphoneCamera_video":{const I=G(this,kt).get("videoinput"),e=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:I,...$}});await this.initUserMediaStreamContext(D,"microphoneCamera_video",e)}break;case"screenSharing_audio":{const I=await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...$}),e=I.getTracks();for(const u of e){const{kind:N}=u,A=new MediaStream;A.addTrack(u),I.removeTrack(u),N==="audio"&&await this.initUserMediaStreamContext(D,"screenSharing_audio",A),N==="video"&&await this.initUserMediaStreamContext(D,"screenSharing_video",A)}}break;case"screenSharing_video":{const I=await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...$});await this.initUserMediaStreamContext(D,"screenSharing_video",I)}break}this.emitNotifyUpdateUsersStreams([{userId:D,updateStreams:{[k]:!0}}])});lt(this,Ot,async()=>!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices?(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 不支持 enumerateDevices"),[]):(await navigator.mediaDevices.enumerateDevices().then(k=>{this.mediaDevices=k}).catch(function(k){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",k)}),this.mediaDevices));lt(this,Mt,()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await G(this,Ot).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),G(this,Ot).call(this)});H(this,"getMediaDeviceKind",k=>G(this,kt).get(k));H(this,"replaceSenderStream",async(k=[],D)=>{const{userId:$}=this.options;k.length===0&&(k=mediaType_keys);for(const I of k){const e=this.transceiverMap.get(I);let u;if(e){const{sender:N}=e;D?u=this.getUserStream($,I):u=this.getPhoneyStreams(I);const[A]=u.getTracks();N.replaceTrack(A)}}});H(this,"setMediaDeviceKind",async(k,D)=>{G(this,kt).set(k,D);const{userId:$}=this.options;if(k==="audioinput"&&this.getUserMediaStreamContext($,"microphoneCamera_audio")&&(await this.initLocalStream("microphoneCamera_audio"),await this.replaceSenderStream(["microphoneCamera_audio"],!0)),k==="videoinput"&&this.getUserMediaStreamContext($,"microphoneCamera_video")&&(await this.initLocalStream("microphoneCamera_video"),await this.replaceSenderStream(["microphoneCamera_video"],!0)),k==="audiooutput"){const I=G(this,_t).values();for(const e of I)e.kind==="audio"&&"setSinkId"in HTMLMediaElement.prototype&&e.audioContext.setSinkId(D)}});H(this,"setAudioOutputDevice",k=>this.setMediaDeviceKind("audiooutput",k));H(this,"getEnumerateDevices",async k=>(await G(this,Ot).call(this),this.mediaDevices.filter($=>$.kind===k)));H(this,"getEnumerateAudioinputDevices",()=>this.getEnumerateDevices("audioinput"));H(this,"getEnumerateAudioOutputDevices",()=>this.getEnumerateDevices("audiooutput"));H(this,"getEnumerateVideoinputDevices",()=>this.getEnumerateDevices("videoinput"));G(this,Mt).call(this),G(this,Ut).call(this),G(this,Ct).call(this),G(this,Dt).call(this)}}kt=new WeakMap,bt=new WeakMap,_t=new WeakMap,Tt=new WeakMap,Dt=new WeakMap,Ct=new WeakMap,Ut=new WeakMap,Ot=new WeakMap,Mt=new WeakMap;class RoomUsers extends RoomMedias{constructor(){super();H(this,"getMaxVolumeUser",()=>{const k=Array.from(this.userMap.values(),({id:$})=>$);if(k.length===0)return;let D=[];for(const $ of k){const I=this.getUserMediaStreamContext($,"microphoneCamera_audio");if(!I||I.kind!=="audio")continue;const e=I.getVolume();D.push({id:$,volume:e})}return D=D.sort(($,I)=>$.volume-I.volume>0?-1:1),D[0]});H(this,"setAudioFilter",async(k={})=>{const D=await this.getUsersId();for(const $ of D){{const I=this.getUserMediaStreamContext($,"microphoneCamera_audio");(I==null?void 0:I.kind)==="audio"&&(I==null||I.setFilter(k))}{const I=this.getUserMediaStreamContext($,"screenSharing_audio");(I==null?void 0:I.kind)==="audio"&&(I==null||I.setFilter(k))}}});H(this,"setVolume",(k,D,$)=>{const I=this.getUserMediaStreamContext(k,D);(I==null?void 0:I.kind)==="audio"&&(I==null||I.setVolumeGain($))});H(this,"getVolume",(k,D)=>{const $=this.getUserMediaStreamContext(k,D);let I=0;return($==null?void 0:$.kind)==="audio"&&(I=$==null?void 0:$.getVolume()),I});H(this,"clearUsers",()=>{this.userMap=new Map});H(this,"removeUsers",async k=>{for(const D of k)this.userMap.delete(D),await this.removeUserStreams(D)});H(this,"createUser",async k=>{const D=Date.now(),$={id:k,permissions:0,callAction:0,callActionStr:"",callActionMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},callState:0,isSelf:k===this.options.userId,isPublished:!1,joinTime:D,updateAt:D,network:{egress:0,ingress:0},tracks:[],updateStreams:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1}};this.userMap.set(k,$)});H(this,"getUser",async k=>(this.userMap.has(k)||await this.createUser(k),this.userMap.get(k)));H(this,"getUsers",async(k=[])=>{k.length===0&&(k=[...this.userMap.keys()]);const D=[];for(const $ of k){const I=await this.getUser($);D.push(I)}return D});H(this,"getAllUserTrackMids",async()=>{const k=await this.getUsers(),D=[];for(const $ of k){const{tracks:I=[]}=$;for(const e of I)D.push(e.mid)}return D});H(this,"getUserTrackByTrackName",async k=>{const D=await this.getUsers(),$=[];for(const I of D){const{tracks:e=[]}=I;for(const u of e){const{trackName:N}=u;k.includes(N)&&$.push(u)}}return $});H(this,"getUserTrackFromMid",async k=>{const D=await this.getUsers();let $;for(const I of D){const{tracks:e=[]}=I;for(const u of e)if(u.mid===k){$=u;break}}return $});H(this,"checkUserInRoom",k=>this.userMap.has(k));H(this,"getUsersId",async()=>[...this.userMap.keys()]);H(this,"getCaller",async()=>await this.getUser(this.options.userId));H(this,"updateIsPublished",async(k,D=!1)=>{const $=await this.getUser(k);$.isPublished=D});H(this,"setUserUpdateStreams",async(k,D,$=!0)=>{const I=await this.getUser(k),e={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};e[D]=$,I.updateStreams=e});H(this,"updateUsertracks",async(k,D=[],$)=>{const I=await this.getUser(k);$&&(D=[...I.tracks,...D]),D=D.filter(({mid:N=""})=>N!==""),D=it(D,["type"]),D=D.sort((N,A)=>N.type-A.type<0?-1:1);for(const N of D)N.userId=k,N.mediaType=mediaType_keys[N.type],N.enabled===void 0&&(N.enabled=!0);I.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const e=mt(I.tracks,["mediaType","enabled","mid","msid","trackName"]),u=mt(D,["mediaType","enabled","mid","msid","trackName"]);{const N="microphoneCamera_audio",A=u.find(P=>P.mediaType===N),U=e.find(P=>P.mediaType===N),L=JSON.stringify(A)!==JSON.stringify(U);I.updateStreams[N]=L}{const N="microphoneCamera_video",A=u.find(P=>P.mediaType===N),U=e.find(P=>P.mediaType===N),L=JSON.stringify(A)!==JSON.stringify(U);I.updateStreams[N]=L}{const N="screenSharing_audio",A=u.find(P=>P.mediaType===N),U=e.find(P=>P.mediaType===N),L=JSON.stringify(A)!==JSON.stringify(U);I.updateStreams[N]=L}{const N="screenSharing_video",A=u.find(P=>P.mediaType===N),U=e.find(P=>P.mediaType===N),L=JSON.stringify(A)!==JSON.stringify(U);I.updateStreams[N]=L}I.tracks=D});H(this,"updateUserCallAction",async(k,D=0)=>{const $=await this.getUser(k);$.callAction=D,$.callActionStr=D.toString(2).padStart(4,"0"),$.callActionMap=this.getCallActionMap(D)});H(this,"updateUserNetwork",async(k,D={egress:5,ingress:5})=>{const $=await this.getUser(k);$.network=D});H(this,"updateUserPermissions",async(k,D)=>{if(D){const $=await this.getUser(k);$.permissions=D}});H(this,"updateUserBase",async k=>{const D=await this.getUser(k);D.isSelf=k===this.options.userId,D.updateAt=Date.now()});H(this,"updateUsers",async k=>{for(const D of k){const{id:$,tracks:I,callAction:e,permissions:u,isPublished:N}=D;await this.updateUserBase($),await this.updateIsPublished($,N),await this.updateUserPermissions($,u),await this.updateUsertracks($,I,!0),await this.updateUserCallAction($,e),await this.updateUserNetwork($)}});H(this,"emitNotifyUpdateUser",async k=>{const D=await this.getUsers([k]),[$]=this.usersFilter(D);this.cwsIns.emitNotify("onRoomUser",{code:200,data:$,desc:"user info is change."})});H(this,"emitNotifyUpdateUsers",async()=>{const k=await this.getUsers(),D=this.usersFilter(k);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:D,desc:"all users info is change."})})}}class RoomPeer extends RoomUsers{constructor(){super();H(this,"getPeerStatsTimer",0);H(this,"reports",[]);H(this,"peerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});H(this,"connectedResolveMap",new Map);H(this,"initPeer",()=>{this.peerIns=new RTCPeerConnection({bundlePolicy:"max-bundle"}),this.transceiverMap=new Map,G(this,Pt).call(this),G(this,Lt).call(this)});H(this,"getSenderTracks",(k=[])=>{const D=[];for(const $ of k){const I=this.transceiverMap.get($);if(!I)continue;const{mid:e,sender:u}=I,{track:N}=u;if(!N)continue;const{id:A,enabled:U}=N,P={type:mediaType_keys.findIndex(Z=>Z===$),enabled:U,trackName:A,location:"local",mid:e};D.push(P)}return D});H(this,"addSenders",async(k=[])=>{k.length===0&&this.peerIns.addTransceiver("audio",{direction:"sendonly"});const D=[];for(const $ of k){if(this.transceiverMap.has($))continue;const I=this.getPhoneyStreams($),[e]=I.getTracks(),u=this.peerIns.addTransceiver(e,{direction:"sendonly"});this.transceiverMap.set($,u),D.push($)}if(k.length===0||D.length){const $=await this.peerIns.createOffer();if(this.options.debug){const I=libExports.parse($.sdp),e=mt(I.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->Breathe: setLocalDescription",{msidArr:e,sdpJson:I,description:$})}await this.peerIns.setLocalDescription($)}return D});H(this,"removeSenders",async(k=[])=>{for(const D of k)this.transceiverMap.has(D)&&this.transceiverMap.delete(D)});H(this,"clearTransceivers",async()=>{const k=await this.getAllUserTrackMids(),D=this.peerIns.getTransceivers();for(const $ of D){const{mid:I}=$;Number(I)===0||k.includes(I)||($.stop(),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->Breathe: clearTransceivers: ${I} is stop.`,$))}});H(this,"onSubscribeUserTracks",k=>{let D=0;return new Promise(async $=>{const I=[];for(const e of k){const{tracks:u=[]}=e;for(const N of u){const{trackName:A,mid:U}=N,[L]=await this.getUserTrackByTrackName([A]);I.push({...L,mid:U})}}{let e=[];const u=async()=>{clearTimeout(D);const A=new Map;for(const L of e){const{userId:P,mediaType:Z}=L;if(!P||!Z)continue;A.has(P)||A.set(P,{userId:P,tracks:[],updateStreams:{}});const W=A.get(P);W.tracks.push(L),W.updateStreams[Z]=!0}const U=[...A.values()];for(const L of U){const{userId:P,tracks:Z}=L;await this.updateUsertracks(P,Z,!0)}await this.emitNotifyUpdateUsersStreams(U),this.peerIns.removeEventListener("track",N),$(!0)},N=async A=>{const{streams:U,transceiver:L}=A,[P]=U,{mid:Z,receiver:F}=L,{track:W}=F,{id:J,kind:z}=W,V=I.find(et=>et.mid===`${Z}`);if(!V)return;const{userId:X,mediaType:Y}=V;if(!(!X||!Y)){if(await this.initUserMediaStreamContext(X,Y,P),z==="audio"){const et=this.getUserMediaStreamContext(X,Y);(et==null?void 0:et.kind)==="audio"&&et.setMute(!1)}{const et={...V,mid:Z,msid:J};e.push(et)}this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->Breathe: await subscribe ${e.length}/${I.length}`,{mediaType:Y,mid:Z,userTrack:V,e:A}),I.length===e.length&&u()}};this.peerIns.addEventListener("track",N),D=setTimeout(()=>u(),5*1e3)}})});lt(this,Pt,()=>{let k=0;const D=()=>{this.setRoomState("closed")};this.peerIns.onconnectionstatechange=()=>{const $=this.peerIns.connectionState;switch(clearTimeout(k),this.taskQueue.setCondition("ice",!1),$){case"connected":this.taskQueue.setCondition("ice",!0),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${$}`);break;case"disconnected":k=setTimeout(D,30*1e3),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${$}`);break;case"failed":this.peerIns.restartIce();break;case"closed":D(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${$}`);break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${$}`);break}}});H(this,"closeUserTracks",async(k,D=[],$=!1)=>{const I=[];for(const A of D){const{trackName:U,msid:L}=A;I.push(U),L&&I.push(L)}const e=A=>I.includes(A),u=await this.getUser(k);if(!u)return;for(const A of u.tracks){const{trackName:U,msid:L,userId:P,mediaType:Z}=A;!P||!Z||!e(U)||(this.removeUserMediaStreamContext(P,Z),L&&delete A.msid)}if($){const A=u.tracks.filter(({trackName:U})=>!e(U));await this.updateUsertracks(k,A,!1)}const N=this.peerIns.getTransceivers();for(const A of N){const{sender:U,receiver:L}=A;U.track&&e(U.track.id)&&(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->Breathe: sender: ${U.track.id} is stop.`,A),U.track.enabled=!1,U.track.stop(),this.peerIns.removeTrack(U),A.stop()),L.track&&e(L.track.id)&&(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->Breathe: receiver: ${L.track.id} is stop.`,A),L.track.enabled=!1,L.track.stop(),A.stop())}});H(this,"createOffer",async()=>{const k=await this.peerIns.createOffer();if(this.options.debug){const D=libExports.parse(k.sdp),$=mt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->Breathe: createOffer",{msidArr:$,sdpJson:D,description:k})}await this.peerIns.setLocalDescription(k)});H(this,"createAnswer",async()=>{const k=await this.peerIns.createAnswer();if(this.options.debug){const D=libExports.parse(k.sdp),$=mt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->Breathe: createAnswer",{msidArr:$,sdpJson:D,description:k})}await this.peerIns.setLocalDescription(k)});H(this,"getSdp",()=>{var k;return(k=this.peerIns.localDescription)==null?void 0:k.sdp});H(this,"setRemoteDescription",async k=>{if(this.options.debug){const D=libExports.parse(k.sdp),$=mt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->Breathe: setRemoteDescription",{msidArr:$,sdpJson:D,description:k})}return await this.peerIns.setRemoteDescription(k),k});H(this,"getPeerNetwork",()=>this.peerNetwork);H(this,"setCallStrategy",async(k,D=[])=>{D.length===0&&(D=mediaType_keys);let $="balanced";switch(k){case"qualityPriority":$="maintain-resolution";break;case"fluencyPriority":$="maintain-framerate";break;case"balancedDowngrade":$="balanced";break}const I=await this.getCaller(),e=Array.from(I.tracks,({trackName:N})=>N),u=this.peerIns.getSenders();for(const N of u){const{track:A}=N;if(!A||!e.includes(A.id))continue;const U=N.getParameters();N.setParameters({...U,degradationPreference:$})}});H(this,"setRTCRtpSenderParameters",k=>{try{const D=this.peerIns.getSenders();for(const $ of D){const I=$.getParameters();$.setParameters({...I,...k})}}catch(D){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",D)}});H(this,"getReportsByMid",async(k=[])=>k.length===0?this.reports:this.reports.filter(D=>k.includes(D.mid)));H(this,"getRoomNetwork",()=>this.peerNetwork);lt(this,Bt,async()=>{try{const k=await this.peerIns.getStats(),D=["inbound-rtp","remote-inbound-rtp","outbound-rtp"],I=[...k.values()].filter(et=>D.includes(et.type));let e=0,u=0,N=0,A=0,U=0,L=0,P=[],Z=[];for(const et of this.reports){const{packetsSent:ft,packetsLost:tt}=et;ft&&(N+=ft),tt&&(A+=tt)}this.reports=I;for(const et of this.reports){const{bytesReceived:ft,bytesSent:tt,packetsSent:st,packetsLost:rt,jitter:nt,roundTripTime:ot}=et;ft&&(e=ft),tt&&(u=tt),st&&(U+=st),rt&&(L+=rt),ot&&P.push((ot*100).toFixed(2)),nt&&Z.push(nt.toFixed(2))}Z.sort().reverse(),P.sort().reverse();const F=U-N,W=L-A,J=F===0?"0.00":(W/F).toFixed(2),[z="0"]=P,[V="0"]=Z,X={inboundBytes:e,outboundBytes:u,lostRate:J,roundTripTime:z,jitter:V};this.peerNetwork=X;const Y=(et,ft,tt)=>{const st=Number(et),rt=Number(ft),nt=Number(tt);let ot="0";return st<.03&&rt<100&&nt<.05?ot="5":st<.06&&rt<160&&nt<.1?ot="4":st<.1&&rt<250&&nt<.15?ot="3":st<.15&&rt<400&&nt<.2?ot="2":ot="1",Number(ot)};{const et=Y(J,z,V),ft=await this.getCaller(),{network:tt}=ft,st={egress:et,ingress:et},rt=JSON.stringify(tt)!==JSON.stringify(st);if(await this.updateUserNetwork(this.options.userId,st),rt){this.emitNotifyUpdateUsers();const{userId:nt,roomId:ot}=this.options;this.cwsIns.sendMessage({event:"networkQualityChange",data:{...st,userId:nt,roomId:ot}},!1)}}}catch(k){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: setNetQuality is err.",k)}});lt(this,Lt,()=>{const k=async()=>{this.peerIns.connectionState!=="connected"||!this.options.roomId||G(this,Bt).call(this)};this.getPeerStatsTimer=setInterval(k,1*1e3)});H(this,"stopGetPeerStats",()=>clearInterval(this.getPeerStatsTimer))}}Pt=new WeakMap,Bt=new WeakMap,Lt=new WeakMap;class RoomCalls extends RoomPeer{constructor(){super();H(this,"sdk_service_version","1.0.5");H(this,"setLocalStream",(k,D)=>new Promise(async($,I)=>{try{const{userId:e}=this.options;if(D?await this.initLocalStream(k):this.removeUserMediaStreamContext(e,k),k==="screenSharing_audio"||k==="screenSharing_video"){{const A=this.getUserStream(e,"screenSharing_audio").getTracks();for(const U of A)U.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}{const A=this.getUserStream(e,"screenSharing_video").getTracks();for(const U of A)U.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}const u=this.getUserStreams(e);this.cwsIns.emitNotify("onLocalStream",{code:200,data:u,desc:"local stream is change."}),$(u)}catch(e){I(e)}}));H(this,"addNotify",k=>this.cwsIns.addNotify(k));lt(this,jt,async k=>{const{roomId:D}=this.options;if(!D)return;const{id:$,tracks:I=[]}=await this.getCaller();if(I.length===0)return;const e=I.filter(u=>u.mediaType&&k.includes(u.mediaType));this.cwsIns.sendMessage({event:"pubNotify",data:{roomId:D,user:{id:$,tracks:e}}})});H(this,"joinRoom",async k=>(this.setOptions(k),await this.createWs(),new Promise((D,$)=>{this.clearUsers();let I="";const e=async()=>{this.taskQueue.clear([I]),await this.emitNotifyUpdateUsers();const N=await this.getUsers();this.taskQueue.setCondition("joinRoom",!0),D(N)},u=async()=>{try{this.taskQueue.setCondition("joinRoom",!1);const{roomId:N,userId:A,callType:U}=this.options;this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:U,roomId:N,user:{id:A,tracks:[],callAction:0}}}).then(async L=>{const{code:P=0,desc:Z="服务器繁忙",data:F}=L;if(P!==200)return $(Z);const{roomId:W="",roomUsers:J=[]}=F;if(W!==N)return $("加入的房间不匹配");this.createSession(),await this.updateUsers(J),e()})}catch(N){this.taskQueue.setCondition("joinRoom",!0),$(`加入房间失败: ${N.message||N||"服务器繁忙"}`)}};I=this.taskQueue.addTask(u,["createWs","joinRoom"],{describe:"joinRoom",strict:!0})})));H(this,"quitRoom",()=>new Promise(async k=>{const{roomId:D,userId:$}=this.options,I={roomId:D,user:{id:$}};try{this.stopSubscribe(),this.stopGetPeerStats(),this.initAsyncQueue(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.setRoomState("ready")}catch{}await new Promise(e=>setTimeout(()=>e(!0),300)),this.cwsIns.sendMessage({event:"quitRoom",data:I}),k(!0)}));H(this,"quitRoomEx",()=>new Promise(async k=>{const{roomId:D,userId:$}=this.options,I={roomId:D,user:{id:$}};try{this.stopSubscribe(),this.stopGetPeerStats(),this.initAsyncQueue(),this.clearUsers(),this.clearUserStreams(),await this.replaceSenderStream([],!1)}catch{}await new Promise(e=>setTimeout(()=>e(!0),300)),this.cwsIns.sendMessage({event:"quitRoomEx",data:I}),k(!0)}));H(this,"syncRoomInfo",()=>new Promise((k,D)=>{const $=async()=>{const{userId:I}=this.options,e=await this.getUser(I),{id:u=I,callAction:N=0}=e;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:u,callAction:N}}}).then(async A=>{if(A.code!==200)return D(A.desc);const U=A.data.users;this.clearUsers(),await this.updateUsers(U),await this.updateUsertracks(e.id,e.tracks,!1),await this.subscribe();{const L=await this.getUsers();k(L)}}).catch(A=>D(A))};this.taskQueue.addTask($,["createWs"],{describe:"syncRoomInfo"})}));H(this,"publish",k=>new Promise(async(D,$)=>{const I=async()=>{try{this.taskQueue.setCondition("publish",!1),k.includes("screenSharing_audio")&&!k.includes("screenSharing_video")&&(k=[...k,"screenSharing_video"]),await this.replaceSenderStream(k,!1);const e=await this.getCaller();for(const L of k)this.getUserStream(e.id,L).getTracks().length===0&&await this.setLocalStream(L,!0);const u=[];for(const L of k)this.getUserStream(e.id,L).getTracks().length!==0&&u.push(L);await this.createTrack(u),await this.replaceSenderStream(u,!0);const N=this.getSenderTracks(k),A=[...e.tracks,...N],U=await this.getCallAction(A);await this.updateUsertracks(e.id,A,!0),G(this,jt).call(this,k),await G(this,gt).call(this,U);{await this.emitNotifyUpdateUsers();const L=await this.getCaller();this.taskQueue.setCondition("publish",!0),D(L)}}catch(e){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: error",e);for(const u of k)await this.setLocalStream(u,!1);this.taskQueue.setCondition("publish",!0),$(`publish is error: ${e.message||e}`)}};this.taskQueue.addTask(I,["createWs","createSession","ice","createTrack","subscribe","publish"],{describe:"replaceSenderStream"})}));H(this,"stopPublish",(k=[])=>new Promise((D,$)=>{const I=async()=>{try{this.taskQueue.setCondition("closeTrack",!1);const e=await this.getCaller();k.length===0&&(k=mediaType_keys);const u=e.tracks.filter(({mediaType:A})=>A&&k.includes(A)),N=async()=>{this.taskQueue.setCondition("closeTrack",!0);const A=await this.getCaller();await this.emitNotifyUpdateUsers(),D(A)};if(u.length===0)return N();await this.replaceSenderStream(k,!0),await this.removeSenders(k),await this.closeUserTracks(e.id,u,!0);{const A=await this.getCallAction(e.tracks);await G(this,gt).call(this,A)}await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:u}}).then(async A=>{const{remoteSdp:U}=A.data;await this.setRemoteDescription({type:"answer",sdp:U})}),N()}catch(e){this.taskQueue.setCondition("closeTrack",!0),$(`stop publish is error: ${e.message||e}`)}};this.taskQueue.addTask(I,["createWs","createSession","ice","createTrack","subscribe"],{describe:"stopPublish"})}));H(this,"subscribe",(k=[],D=3)=>new Promise(($,I)=>{const e=async()=>{try{this.taskQueue.setCondition("subscribe",!1);const u=await this.getUsers();let N=[];for(const P of u){const{isSelf:Z,tracks:F=[]}=P;if(!Z){const W=F.filter(({trackName:J,mid:z=""})=>z!==""&&(k.includes(J)||k.length===0));W.length!==0&&N.push({...P,tracks:W})}}const A=async()=>{const P=Array.from(N,({id:F})=>F),Z=await this.getUsers(P);await this.emitNotifyUpdateUsers(),this.taskQueue.setCondition("subscribe",!0),$(Z)};if(N.length===0)return A();const U=[];for(const P of N){const{id:Z,tracks:F}=P,W=mt(F,["type","trackName"]),J={id:Z,tracks:W};U.push(J)}const L=async()=>{this.options.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: surplus subscribe count is ${D}`),await this.cwsIns.sendMessage({event:"subscribe",data:{users:U}}).then(async P=>{const{code:Z=0,data:F,desc:W}=P;if(Z!==200){if(D>0)return await new Promise(V=>setTimeout(()=>V(!0),300)),D=D-1,L();throw this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: subscribe is error. count 0",{trackNames:k}),new Error(W)}const{remoteSdp:J,users:z=[]}=F;this.onSubscribeUserTracks(z).then(async()=>{await this.renegotiate(),A()}),await this.setRemoteDescription({type:"offer",sdp:J})})};await L()}catch(u){this.taskQueue.setCondition("subscribe",!0),I(`subscribe is error: ${u.message||u}`)}};this.taskQueue.addTask(e,["createWs","createSession","ice","createTrack","closeTrack"],{describe:"subscribe"})}));H(this,"stopSubscribe",(k=[])=>new Promise((D,$)=>{const I=async()=>{try{this.taskQueue.setCondition("closeTrack",!1);const e=await this.getUsers(),u=[];for(const A of e){const{tracks:U=[]}=A;for(const L of U){const{type:P,mid:Z,trackName:F,mediaType:W,msid:J}=L;if(!(!W||!J)&&(k.length===0||k.includes(F))){const z={type:P,mid:Z,trackName:J};u.push(z),await this.closeUserTracks(A.id,[L])}}}const N=async()=>{await this.emitNotifyUpdateUsers(),this.taskQueue.setCondition("closeTrack",!0),D(!0)};if(u.length===0)return N();await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:u}}).then(async A=>{const{remoteSdp:U}=A.data;await this.setRemoteDescription({type:"answer",sdp:U})}),N()}catch(e){this.taskQueue.setCondition("closeTrack",!0),$(`stop subscribe is error: ${e.message||e}`)}};this.taskQueue.addTask(I,["createWs","createSession","ice","createTrack","subscribe"],{describe:"closeTrack"})}));H(this,"inactiveTracks",async(k,D)=>new Promise(async $=>{const I=await this.getCaller();if(!I)return;const{tracks:e=[]}=I,u=[...e];await this.replaceSenderStream(k,!0);for(let A of u){const{mediaType:U}=A;if(U&&k.includes(U)){A.enabled=D;const P=this.getUserStream(I.id,U).getTracks();for(const Z of P)Z.enabled=D}}const N=await this.getCallAction(u);await G(this,gt).call(this,N),await this.emitNotifyUpdateUsers(),$(!0)}));H(this,"debugger",()=>new Promise(async(k,D)=>{await this.cwsIns.sendMessage({event:"debugger"},!1).then(async $=>{if($.code!==200)return D($.desc);k(!0)}).catch($=>{D($)})}));lt(this,gt,async k=>new Promise(async(D,$)=>{const{roomId:I,userId:e}=this.options,u={roomId:I,user:{id:e,callAction:k}};await this.cwsIns.sendMessage({event:"updateCall",data:u}).then(async N=>{const{code:A=0}=N;if(A!==200)return $(N);await this.updateUserCallAction(e,k),D(k)}).catch(N=>$(N))}));H(this,"renegotiate",()=>new Promise(async(k,D)=>{await this.createAnswer(),await this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then($=>{if($.code!==200)return D("协商流错误");k(!0)}).catch($=>{console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe:error",$),D(`协商流错误: ${$.message||$}`)})}));H(this,"createWs",()=>new Promise(async(k,D)=>{try{if(["connecting","connected"].includes(this.cwsIns.state))return k(!0);this.taskQueue.setCondition("createWs",!1),this.cwsIns.clearEvents(),this.initPeer();const{appid:$}=this.options,{userId:I,sdkToken:e,roomId:u}=this.options;if(!I)return D("You must first use QuickVO.setOptions to set the userId.");const N={a:e,b:I,c:$,r:u,v:this.sdk_service_version};this.isEarly&&(N.i=pt()),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: createWs",N);const A=btoa(encodeURI(JSON.stringify(N)));await this.cwsIns.connect(A),this.taskQueue.setCondition("createWs",!0),k(!0)}catch($){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe:error",$),D($)}}));H(this,"createSession",()=>new Promise(k=>{if(["connecting","connected"].includes(this.roomState))return k(!0);const D=async()=>(this.taskQueue.setCondition("ice",!1),this.taskQueue.setCondition("createSession",!1),this.setRoomState("connecting"),await this.addSenders(),this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}).then(async $=>{const{code:I=0,desc:e,data:u}=$;if(I!==200)throw new Error(e);const{remoteSdp:N}=u;await this.setRemoteDescription({type:"answer",sdp:N}),this.taskQueue.setCondition("createSession",!0),k(!0)}));this.taskQueue.addTask(D,["createWs"],{describe:"createSession"})}));H(this,"createTrack",async k=>new Promise(D=>{const $=async()=>{try{this.taskQueue.setCondition("createTrack",!1);const I=await this.addSenders(k),e=this.getSenderTracks(I);if(e.length===0)return this.taskQueue.setCondition("createTrack",!0),D(!0);await this.cwsIns.sendMessage({event:"publish",data:{sdp:this.getSdp(),tracks:e,callAction:0}}).then(async u=>{const{code:N=0,desc:A,data:U}=u;if(N!==200)throw this.options.debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createTrack is error.",{mediaTypes:k}),new Error(A);const{remoteSdp:L}=U;await this.setRemoteDescription({type:"answer",sdp:L}),this.taskQueue.setCondition("createTrack",!0),D(!0)})}catch{await this.removeSenders(k),this.taskQueue.setCondition("createTrack",!0),D(!0)}};this.taskQueue.addTask($,["createWs","createSession","ice","subscribe","closeTrack"],{describe:"createTrack"})}));H(this,"earlyConnect",()=>{this.isEarly=!0,this.createWs(),this.createSession(),this.createTrack(["microphoneCamera_audio","microphoneCamera_video"])});this.setRoomState("ready")}}jt=new WeakMap,gt=new WeakMap;class Room extends RoomCalls{constructor(){super()}}class QuickVO extends Room{constructor(k){super();lt(this,wt,new Map);lt(this,Zt,()=>{{const k=async D=>{const{qualities:$=[]}=D.data,[I]=$;if(!(I&&I.userId===this.options.userId&&$.length===1)){for(const e of $){const{userId:u,egress:N,ingress:A}=e;this.checkUserInRoom(u)&&await this.updateUserNetwork(u,{egress:N,ingress:A})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:k},!0)}{const k=async D=>{const $=D.data.user;await this.updateUsers([$]),await this.updateUsertracks($.id,$.track,!1),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:k},!0)}{const k=async D=>{await this.removeUsers([D.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:k},!0)}{const k=async D=>{const{user:$}=D.data,{id:I,tracks:e=[]}=$;await this.updateUserPermissions(I,3);const u=[];{const{tracks:N}=await this.getUser(I);for(const A of e){const{mid:U,trackName:L}=A;if(N.find(Z=>Z.mid===U&&Z.trackName===L))continue;u.push(A)}}if(u.length!==0)if(await this.updateUsertracks(I,u,!0),this.options.newPublishAutoSubscribe){const N=this.getTrackNamesFormTracks(u);await this.subscribe(N)}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:k},!0)}{const k=async D=>{const{id:$,tracks:I}=D.data.user;$!==this.options.userId&&(await this.closeUserTracks($,I,!0),await this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onCloseTrack",callback:k},!0)}{const k=async D=>{const{id:$,callAction:I}=D.data.user;this.checkUserInRoom($)&&(await this.updateUserCallAction($,I),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:k},!0)}{const k=async D=>{const{user:$}=D.data,{id:I,permissions:e=1}=$;e===1?await this.removeUsers([I]):e===3&&await this.updateUsers([$]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:k},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async k=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)});lt(this,Ft,()=>{this.cwsIns.sendMessageBefore=async()=>{}});lt(this,Ht,()=>{this.cwsIns.onReconnectSuccess=async()=>{this.syncRoomInfo()}});lt(this,zt,async()=>{});H(this,"addRequestAnimationFrame",async(k,D)=>{{const I=G(this,wt).get(k);I&&cancelAnimationFrame(I)}const $=(I=Date.now())=>{D(I);const e=requestAnimationFrame($);G(this,wt).set(k,e)};$()});H(this,"clearRequestAnimationFrame",async(k=[])=>{k.length===0&&(k=[...G(this,wt).keys()]);const D=[];for(const $ of k){const I=G(this,wt).get($);I&&(cancelAnimationFrame(I),D.push(I))}return D});H(this,"destroy",async()=>{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 销毁SDK"),this.stopGetPeerStats(),this.initAsyncQueue(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.cwsIns.emitNotify("onDestroy",{code:200,data:{},desc:"sdk is destroy."}),await this.cwsIns.close()});this.setOptions(k),this.initCwsCall(),G(this,Ft).call(this),G(this,Ht).call(this),G(this,zt).call(this),G(this,Zt).call(this)}}wt=new WeakMap,Zt=new WeakMap,Ft=new WeakMap,Ht=new WeakMap,zt=new WeakMap,exports.QuickVO=QuickVO,exports.ignoreEvent=ignoreEvent,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});