quickvo-sdk-js 0.5.1 → 0.5.2
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.
- package/dist/index.js +10 -15
- package/dist/index.umd.cjs +1 -1
- package/dist/room/RoomBase.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
(function(lt,st){typeof exports=="object"&&typeof module<"u"?st(exports):typeof define=="function"&&define.amd?define(["exports"],st):(lt=typeof globalThis<"u"?globalThis:lt||self,st(lt["snqu-calls-sdk-js"]={}))})(this,function(exports){"use strict";var Xt=Object.defineProperty;var Vt=lt=>{throw TypeError(lt)};var te=(lt,st,yt)=>st in lt?Xt(lt,st,{enumerable:!0,configurable:!0,writable:!0,value:yt}):lt[st]=yt;var Z=(lt,st,yt)=>te(lt,typeof st!="symbol"?st+"":st,yt),Yt=(lt,st,yt)=>st.has(lt)||Vt("Cannot "+yt);var V=(lt,st,yt)=>(Yt(lt,st,"read from private field"),yt?yt.call(lt):st.get(lt)),ut=(lt,st,yt)=>st.has(lt)?Vt("Cannot add the same private member more than once"):st instanceof WeakSet?st.add(lt):st.set(lt,yt),Ot=(lt,st,yt,_t)=>(Yt(lt,st,"write to private field"),_t?_t.call(lt,yt):st.set(lt,yt),yt);var lt,st,yt,_t,kt,Et,xt,Nt,At,Rt,qt,Dt,Ct,vt,wt,bt,St,Ut,Mt,Pt,Tt,Bt,Lt,jt,Zt,Ft,It,gt,Ht,zt,Jt,Wt;const L=(a,I=[])=>{const u={...a},E=Object.keys(u);for(const _ of E)I.findIndex(k=>String(k)===_)===-1&&delete u[_];return u},mt=(a,I=[],u=!0)=>{const E=new Map;for(const k of a){const e=[];for(const O of I)e.push(k[O]);const n=`map-${e.join("-")}`;if(!E.has(n)){E.set(n,k);continue}u&&E.set(n,k)}const _=E.entries();return Array.from(_,([k,e])=>e)},ft=(a,I=[])=>{const u=[];for(const E of a){const _=L(E,I);u.push(_)}return u},pt=(a,I="value",u="label")=>{const E=[],_=Object.entries(a);for(const[k,e]of _){const n={[u]:e,[I]:k};E.push(n)}return E},F=(a=0,I=1)=>{const u=Math.max(0,a),E=Math.max(1,I),_=Math.random()*(E-u+1)+u;return parseInt(`${_}`,10)},ht=(a=16,I=16)=>{const u="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),E=Math.min(u.length,I),_=Date.now().toString(E),k=_.split(""),e=Math.max(4,a-_.length);for(let n=0;n<e;n++){const O=F(0,E-1),$=u[O];k.push($)}return k.join("").toUpperCase()},W=(a,I)=>{try{let u=Number(a);if(isNaN(u)){const E=new Date(`${a}`);if(`${E}`=="Invalid Date")return 0;u=E.getTime()}if(I!==void 0){const E=new Date().getTimezoneOffset();u+=(E+I)*60*1e3}return u}catch(u){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:a,_offset:I,error:u}),0}},v$1=1e3,H=6e4,R$1=36e5,A=864e5,X={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六","07":"日"},G=a=>W(a),U=(a,I="YYYY-MM-DD hh:mm:ss",u={})=>{const E={empty_str:"-",...u},{empty_str:_,offset:k}=E,e=W(a,k);if(Number(a)!==0&&e===0)return _;const n=new Date(e),O=`${n.getFullYear()}`,$=`${n.getMonth()+1}`,N=`${n.getDate()}`,D=`${n.getDay()===0?7:n.getDay()}`,q=`${n.getHours()}`,P=`${n.getMinutes()}`,j=`${n.getSeconds()}`,Q=`${Math.ceil((e-G(`${O}/01/01 00:00:00`)+1)/864e5)}`,J=`${Math.ceil(((e-G(`${O}/01/01 00:00:00`))/864e5-Number(D))/7)+1}`,z=[{k:"Y+",v:O},{k:"M+",v:$},{k:"D+",v:N},{k:"W+",v:D},{k:"h+",v:q},{k:"m+",v:P},{k:"s+",v:j},{k:"d+",v:Q},{k:"w+",v:J}];let Y;for(let{k:et,v:tt}of z)if(Y=new RegExp(`(${et})`).exec(I),Y){const nt=Y[1];let dt=tt.padStart(nt.length,"0");nt.includes("W")&&(dt=X[dt.slice(0,2)]),I=I.replace(nt,dt)}return I},enum_mediaType={microphoneCamera_audio:"麦克风-默认轨道",microphoneCamera_video:"摄像头-默认轨道",screenSharing_video:"屏幕共享-视频轨道",screenSharing_audio:"屏幕共享-音频轨道"};pt(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 a=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(I){return I.encoding?"rtpmap:%d %s/%s/%s":I.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(I){return I.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(I){return I.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(I){return"extmap:%d"+(I.direction?"/%s":"%v")+(I["encrypt-uri"]?" %s":"%v")+" %s"+(I.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(I){return I.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(I){var u="candidate:%s %d %s %d %s %d typ %s";return u+=I.raddr!=null?" raddr %s rport %d":"%v%v",u+=I.tcptype!=null?" tcptype %s":"%v",I.generation!=null&&(u+=" generation %d"),u+=I["network-id"]!=null?" network-id %d":"%v",u+=I["network-cost"]!=null?" network-cost %d":"%v",u}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(I){var u="ssrc:%d";return I.attribute!=null&&(u+=" %s",I.value!=null&&(u+=":%s")),u}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(I){return I.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(I){return I.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(I){return"imageattr:%s %s %s"+(I.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(I){return"simulcast:%s %s"+(I.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(I){return"ts-refclk:%s"+(I.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(I){var u="mediaclk:";return u+=I.id!=null?"id=%s %s":"%v%s",u+=I.mediaClockValue!=null?"=%s":"",u+=I.rateNumerator!=null?" rate=%s":"",u+=I.rateDenominator!=null?"/%s":"",u}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(a).forEach(function(I){var u=a[I];u.forEach(function(E){E.reg||(E.reg=/(.*)/),E.format||(E.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function(a){var I=function(n){return String(Number(n))===n?Number(n):n},u=function(n,O,$,N){if(N&&!$)O[N]=I(n[1]);else for(var D=0;D<$.length;D+=1)n[D+1]!=null&&(O[$[D]]=I(n[D+1]))},E=function(n,O,$){var N=n.name&&n.names;n.push&&!O[n.push]?O[n.push]=[]:N&&!O[n.name]&&(O[n.name]={});var D=n.push?{}:N?O[n.name]:O;u($.match(n.reg),D,n.names,n.name),n.push&&O[n.push].push(D)},_=requireGrammar(),k=RegExp.prototype.test.bind(/^([a-z])=(.*)/);a.parse=function(n){var O={},$=[],N=O;return n.split(/(\r\n|\r|\n)/).filter(k).forEach(function(D){var q=D[0],P=D.slice(2);q==="m"&&($.push({rtp:[],fmtp:[]}),N=$[$.length-1]);for(var j=0;j<(_[q]||[]).length;j+=1){var Q=_[q][j];if(Q.reg.test(P))return E(Q,N,P)}}),O.media=$,O};var e=function(n,O){var $=O.split(/=(.+)/,2);return $.length===2?n[$[0]]=I($[1]):$.length===1&&O.length>1&&(n[$[0]]=void 0),n};a.parseParams=function(n){return n.split(/;\s?/).reduce(e,{})},a.parseFmtpConfig=a.parseParams,a.parsePayloads=function(n){return n.toString().split(" ").map(Number)},a.parseRemoteCandidates=function(n){for(var O=[],$=n.split(" ").map(I),N=0;N<$.length;N+=3)O.push({component:$[N],ip:$[N+1],port:$[N+2]});return O},a.parseImageAttributes=function(n){return n.split(" ").map(function(O){return O.substring(1,O.length-1).split(",").reduce(e,{})})},a.parseSimulcastStreamList=function(n){return n.split(";").map(function(O){return O.split(",").map(function($){var N,D=!1;return $[0]!=="~"?N=I($):(N=I($.substring(1,$.length)),D=!0),{scid:N,paused:D}})})}}(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var a=requireGrammar(),I=/%[sdv%]/g,u=function(e){var n=1,O=arguments,$=O.length;return e.replace(I,function(N){if(n>=$)return N;var D=O[n];switch(n+=1,N){case"%%":return"%";case"%s":return String(D);case"%d":return Number(D);case"%v":return""}})},E=function(e,n,O){var $=n.format instanceof Function?n.format(n.push?O:O[n.name]):n.format,N=[e+"="+$];if(n.names)for(var D=0;D<n.names.length;D+=1){var q=n.names[D];n.name?N.push(O[n.name][q]):N.push(O[n.names[D]])}else N.push(O[n.name]);return u.apply(null,N)},_=["v","o","s","i","u","e","p","c","b","t","r","z","a"],k=["i","c","b","a"];return writer$1=function(e,n){n=n||{},e.version==null&&(e.version=0),e.name==null&&(e.name=" "),e.media.forEach(function(D){D.payloads==null&&(D.payloads="")});var O=n.outerOrder||_,$=n.innerOrder||k,N=[];return O.forEach(function(D){a[D].forEach(function(q){q.name in e&&e[q.name]!=null?N.push(E(D,q,e)):q.push in e&&e[q.push]!=null&&e[q.push].forEach(function(P){N.push(E(D,q,P))})})}),e.media.forEach(function(D){N.push(E("m",a.m[0],D)),$.forEach(function(q){a[q].forEach(function(P){P.name in D&&D[P.name]!=null?N.push(E(q,P,D)):P.push in D&&D[P.push]!=null&&D[P.push].forEach(function(j){N.push(E(q,P,j))})})})}),N.join(`\r
|
|
2
2
|
`)+`\r
|
|
3
|
-
`},writer$1}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var a=requireParser(),I=requireWriter$1(),u=requireGrammar();return lib.grammar=u,lib.write=I,lib.parse=a.parse,lib.parseParams=a.parseParams,lib.parseFmtpConfig=a.parseFmtpConfig,lib.parsePayloads=a.parsePayloads,lib.parseRemoteCandidates=a.parseRemoteCandidates,lib.parseImageAttributes=a.parseImageAttributes,lib.parseSimulcastStreamList=a.parseSimulcastStreamList,lib}var libExports=requireLib();class AudioMediaContext{constructor(I){Z(this,"options",{autoGainControl:!1,noiseSuppression:!1,echoCancellation:!1});Z(this,"kind","audio");Z(this,"stream",new MediaStream);Z(this,"audio",new Audio);Z(this,"audioContext",new(window.AudioContext||window.webkitAudioContext));Z(this,"mediaStreamAudioSourceNode");Z(this,"autoGainNode");Z(this,"biquadFilterNode");Z(this,"delayNode");Z(this,"gainNode");Z(this,"analyserNode");Z(this,"analyserArrayData");Z(this,"stop",()=>{const I=this.stream.getTracks();for(const u of I)u.enabled=!1,u.stop(),this.stream.removeTrack(u)});Z(this,"replaceStream",I=>{this.stop();const[u]=I.getAudioTracks();this.stream.addTrack(u)});Z(this,"getStream",()=>this.mediaStreamAudioSourceNode.mediaStream);Z(this,"setMute",(I=!0)=>{I?this.analyserNode.disconnect(this.audioContext.destination):this.analyserNode.connect(this.audioContext.destination)});Z(this,"setEnhanceGain",async I=>{});Z(this,"setVolumeGain",I=>{this.gainNode.gain.setValueAtTime(I,this.audioContext.currentTime)});Z(this,"getVolume",()=>{const{analyserNode:I,analyserArrayData:u}=this;I.getByteFrequencyData(u);let E=0;for(let k=0;k<u.length;k++)E+=u[k];return Math.ceil(E/u.length)});Z(this,"setFilter",(I={})=>{this.options={...this.options,...I};const{autoGainControl:u,noiseSuppression:E,echoCancellation:_}=this.options,{mediaStreamAudioSourceNode:k,autoGainNode:e,biquadFilterNode:n,delayNode:O,gainNode:$}=this,N=k;return u&&N.connect(e),E&&N.connect(n),_&&N.connect(O),N.connect($),I});this.stream.addTrack(I),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:u,analyserNode:E}=this;u.connect(E),this.audioContext.state==="suspended"&&(this.audioContext.resume(),document.addEventListener("click",()=>this.audioContext.resume(),{once:!0})),this.setFilter()}}class VideoMediaContext{constructor(I){Z(this,"kind","video");Z(this,"stream",new MediaStream);Z(this,"stop",()=>{const I=this.stream.getTracks();for(const u of I)u.enabled=!1,u.stop(),this.stream.removeTrack(u)});Z(this,"replaceStream",I=>{this.stop();const[u]=I.getVideoTracks();this.stream.addTrack(u)});Z(this,"getStream",()=>this.stream);Z(this,"getTrack",()=>this.stream.getTracks()[0]);this.stream.addTrack(I)}}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",closed:"已关闭"};pt(enum_roomState);var C=Object.defineProperty,R=a=>{throw TypeError(a)},S=(a,I,u)=>I in a?C(a,I,{enumerable:!0,configurable:!0,writable:!0,value:u}):a[I]=u,l$1=(a,I,u)=>S(a,typeof I!="symbol"?I+"":I,u),v=(a,I,u)=>I.has(a)||R("Cannot "+u),t=(a,I,u)=>(v(a,I,"read from private field"),u?u.call(a):I.get(a)),c$1=(a,I,u)=>I.has(a)?R("Cannot add the same private member more than once"):I instanceof WeakSet?I.add(a):I.set(a,u),i=(a,I,u,E)=>(v(a,I,"write to private field"),I.set(a,u),u),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(I){c$1(this,s,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,sendBeforAutoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4,checkReconnect:u=>!0,onReconnectSuccess:async u=>{},onReconnectStop:async u=>{},getHeartbeatMsg:()=>JSON.stringify({event:"heartbeat"}),onMessage:u=>{}}),l$1(this,"ws"),c$1(this,r,-1),c$1(this,h$1,-1),c$1(this,p$1,0),c$1(this,m,0),c$1(this,f$1,!1),c$1(this,w,u=>{}),l$1(this,"close",async(u=1e3,E="correctly close.")=>{var _;this.ws&&(i(this,f$1,!0),t(this,d$1).call(this),(_=this.ws)==null||_.close(u,E))}),l$1(this,"connect",()=>new Promise(async u=>{i(this,w,u),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$1(this,"reconnect",async u=>new Promise(E=>{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 _=k=>{t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: ${k}`),t(this,s).onReconnectStop({msg:k}),E(k)};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(u))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)}`,u),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(k){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->pr-ws: onReconnectSuccess is error",k)}E(!0)},t(this,s).reconnectIntervalTime))})),l$1(this,"sendMessage",async u=>{var E;(!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())),(E=this.ws)==null||E.send(u)}),c$1(this,x$1,()=>{const u=Date.now();return t(this,h$1)===-1&&i(this,h$1,u+t(this,s).reconnectTime),!(u>t(this,h$1))}),c$1(this,g$1,u=>{const{data:E}=u;t(this,s).onMessage(E)}),c$1(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$1(this,B,u=>{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.",u)}),c$1(this,y$1,u=>{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: ${u.code}, permanentClosed is ${t(this,f$1)}.`,u),t(this,d$1).call(this),!t(this,f$1))return this.reconnect(u);this.ws=void 0}),c$1(this,T,()=>{i(this,m,setInterval(()=>{const u=t(this,s).getHeartbeatMsg();u&&this.sendMessage(u)},t(this,s).heartbeatIntervalTime))}),c$1(this,d$1,()=>{clearInterval(t(this,p$1)),clearInterval(t(this,m))}),i(this,s,{...t(this,s),...I}),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=a;function a(I,u){for(var E=new Array(arguments.length-1),_=0,k=2,e=!0;k<arguments.length;)E[_++]=arguments[k++];return new Promise(function(O,$){E[_]=function(D){if(e)if(e=!1,D)$(D);else{for(var q=new Array(arguments.length-1),P=0;P<q.length;)q[P++]=arguments[P];O.apply(null,q)}};try{I.apply(u||null,E)}catch(N){e&&(e=!1,$(N))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(a){var I=a;I.length=function(n){var O=n.length;if(!O)return 0;for(var $=0;--O%4>1&&n.charAt(O)==="=";)++$;return Math.ceil(n.length*3)/4-$};for(var u=new Array(64),E=new Array(123),_=0;_<64;)E[u[_]=_<26?_+65:_<52?_+71:_<62?_-4:_-59|43]=_++;I.encode=function(n,O,$){for(var N=null,D=[],q=0,P=0,j;O<$;){var Q=n[O++];switch(P){case 0:D[q++]=u[Q>>2],j=(Q&3)<<4,P=1;break;case 1:D[q++]=u[j|Q>>4],j=(Q&15)<<2,P=2;break;case 2:D[q++]=u[j|Q>>6],D[q++]=u[Q&63],P=0;break}q>8191&&((N||(N=[])).push(String.fromCharCode.apply(String,D)),q=0)}return P&&(D[q++]=u[j],D[q++]=61,P===1&&(D[q++]=61)),N?(q&&N.push(String.fromCharCode.apply(String,D.slice(0,q))),N.join("")):String.fromCharCode.apply(String,D.slice(0,q))};var k="invalid encoding";I.decode=function(n,O,$){for(var N=$,D=0,q,P=0;P<n.length;){var j=n.charCodeAt(P++);if(j===61&&D>1)break;if((j=E[j])===void 0)throw Error(k);switch(D){case 0:q=j,D=1;break;case 1:O[$++]=q<<2|(j&48)>>4,q=j,D=2;break;case 2:O[$++]=(q&15)<<4|(j&60)>>2,q=j,D=3;break;case 3:O[$++]=(q&3)<<6|j,D=0;break}}if(D===1)throw Error(k);return $-N},I.test=function(n){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(n)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=a;function a(){this._listeners={}}return a.prototype.on=function(u,E,_){return(this._listeners[u]||(this._listeners[u]=[])).push({fn:E,ctx:_||this}),this},a.prototype.off=function(u,E){if(u===void 0)this._listeners={};else if(E===void 0)this._listeners[u]=[];else for(var _=this._listeners[u],k=0;k<_.length;)_[k].fn===E?_.splice(k,1):++k;return this},a.prototype.emit=function(u){var E=this._listeners[u];if(E){for(var _=[],k=1;k<arguments.length;)_.push(arguments[k++]);for(k=0;k<E.length;)E[k].fn.apply(E[k++].ctx,_)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=a(a);function a(k){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),n=new Uint8Array(e.buffer),O=n[3]===128;function $(P,j,Q){e[0]=P,j[Q]=n[0],j[Q+1]=n[1],j[Q+2]=n[2],j[Q+3]=n[3]}function N(P,j,Q){e[0]=P,j[Q]=n[3],j[Q+1]=n[2],j[Q+2]=n[1],j[Q+3]=n[0]}k.writeFloatLE=O?$:N,k.writeFloatBE=O?N:$;function D(P,j){return n[0]=P[j],n[1]=P[j+1],n[2]=P[j+2],n[3]=P[j+3],e[0]}function q(P,j){return n[3]=P[j],n[2]=P[j+1],n[1]=P[j+2],n[0]=P[j+3],e[0]}k.readFloatLE=O?D:q,k.readFloatBE=O?q:D}():function(){function e(O,$,N,D){var q=$<0?1:0;if(q&&($=-$),$===0)O(1/$>0?0:2147483648,N,D);else if(isNaN($))O(2143289344,N,D);else if($>34028234663852886e22)O((q<<31|2139095040)>>>0,N,D);else if($<11754943508222875e-54)O((q<<31|Math.round($/1401298464324817e-60))>>>0,N,D);else{var P=Math.floor(Math.log($)/Math.LN2),j=Math.round($*Math.pow(2,-P)*8388608)&8388607;O((q<<31|P+127<<23|j)>>>0,N,D)}}k.writeFloatLE=e.bind(null,I),k.writeFloatBE=e.bind(null,u);function n(O,$,N){var D=O($,N),q=(D>>31)*2+1,P=D>>>23&255,j=D&8388607;return P===255?j?NaN:q*(1/0):P===0?q*1401298464324817e-60*j:q*Math.pow(2,P-150)*(j+8388608)}k.readFloatLE=n.bind(null,E),k.readFloatBE=n.bind(null,_)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),n=new Uint8Array(e.buffer),O=n[7]===128;function $(P,j,Q){e[0]=P,j[Q]=n[0],j[Q+1]=n[1],j[Q+2]=n[2],j[Q+3]=n[3],j[Q+4]=n[4],j[Q+5]=n[5],j[Q+6]=n[6],j[Q+7]=n[7]}function N(P,j,Q){e[0]=P,j[Q]=n[7],j[Q+1]=n[6],j[Q+2]=n[5],j[Q+3]=n[4],j[Q+4]=n[3],j[Q+5]=n[2],j[Q+6]=n[1],j[Q+7]=n[0]}k.writeDoubleLE=O?$:N,k.writeDoubleBE=O?N:$;function D(P,j){return n[0]=P[j],n[1]=P[j+1],n[2]=P[j+2],n[3]=P[j+3],n[4]=P[j+4],n[5]=P[j+5],n[6]=P[j+6],n[7]=P[j+7],e[0]}function q(P,j){return n[7]=P[j],n[6]=P[j+1],n[5]=P[j+2],n[4]=P[j+3],n[3]=P[j+4],n[2]=P[j+5],n[1]=P[j+6],n[0]=P[j+7],e[0]}k.readDoubleLE=O?D:q,k.readDoubleBE=O?q:D}():function(){function e(O,$,N,D,q,P){var j=D<0?1:0;if(j&&(D=-D),D===0)O(0,q,P+$),O(1/D>0?0:2147483648,q,P+N);else if(isNaN(D))O(0,q,P+$),O(2146959360,q,P+N);else if(D>17976931348623157e292)O(0,q,P+$),O((j<<31|2146435072)>>>0,q,P+N);else{var Q;if(D<22250738585072014e-324)Q=D/5e-324,O(Q>>>0,q,P+$),O((j<<31|Q/4294967296)>>>0,q,P+N);else{var J=Math.floor(Math.log(D)/Math.LN2);J===1024&&(J=1023),Q=D*Math.pow(2,-J),O(Q*4503599627370496>>>0,q,P+$),O((j<<31|J+1023<<20|Q*1048576&1048575)>>>0,q,P+N)}}}k.writeDoubleLE=e.bind(null,I,0,4),k.writeDoubleBE=e.bind(null,u,4,0);function n(O,$,N,D,q){var P=O(D,q+$),j=O(D,q+N),Q=(j>>31)*2+1,J=j>>>20&2047,z=4294967296*(j&1048575)+P;return J===2047?z?NaN:Q*(1/0):J===0?Q*5e-324*z:Q*Math.pow(2,J-1075)*(z+4503599627370496)}k.readDoubleLE=n.bind(null,E,0,4),k.readDoubleBE=n.bind(null,_,4,0)}(),k}function I(k,e,n){e[n]=k&255,e[n+1]=k>>>8&255,e[n+2]=k>>>16&255,e[n+3]=k>>>24}function u(k,e,n){e[n]=k>>>24,e[n+1]=k>>>16&255,e[n+2]=k>>>8&255,e[n+3]=k&255}function E(k,e){return(k[e]|k[e+1]<<8|k[e+2]<<16|k[e+3]<<24)>>>0}function _(k,e){return(k[e]<<24|k[e+1]<<16|k[e+2]<<8|k[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(a){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(a){var I=a;I.length=function(E){for(var _=0,k=0,e=0;e<E.length;++e)k=E.charCodeAt(e),k<128?_+=1:k<2048?_+=2:(k&64512)===55296&&(E.charCodeAt(e+1)&64512)===56320?(++e,_+=4):_+=3;return _},I.read=function(E,_,k){var e=k-_;if(e<1)return"";for(var n=null,O=[],$=0,N;_<k;)N=E[_++],N<128?O[$++]=N:N>191&&N<224?O[$++]=(N&31)<<6|E[_++]&63:N>239&&N<365?(N=((N&7)<<18|(E[_++]&63)<<12|(E[_++]&63)<<6|E[_++]&63)-65536,O[$++]=55296+(N>>10),O[$++]=56320+(N&1023)):O[$++]=(N&15)<<12|(E[_++]&63)<<6|E[_++]&63,$>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,O)),$=0);return n?($&&n.push(String.fromCharCode.apply(String,O.slice(0,$))),n.join("")):String.fromCharCode.apply(String,O.slice(0,$))},I.write=function(E,_,k){for(var e=k,n,O,$=0;$<E.length;++$)n=E.charCodeAt($),n<128?_[k++]=n:n<2048?(_[k++]=n>>6|192,_[k++]=n&63|128):(n&64512)===55296&&((O=E.charCodeAt($+1))&64512)===56320?(n=65536+((n&1023)<<10)+(O&1023),++$,_[k++]=n>>18|240,_[k++]=n>>12&63|128,_[k++]=n>>6&63|128,_[k++]=n&63|128):(_[k++]=n>>12|224,_[k++]=n>>6&63|128,_[k++]=n&63|128);return k-e}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=a;function a(I,u,E){var _=E||8192,k=_>>>1,e=null,n=_;return function($){if($<1||$>k)return I($);n+$>_&&(e=I(_),n=0);var N=u.call(e,n,n+=$);return n&7&&(n=(n|7)+1),N}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=I;var a=requireMinimal$1();function I(k,e){this.lo=k>>>0,this.hi=e>>>0}var u=I.zero=new I(0,0);u.toNumber=function(){return 0},u.zzEncode=u.zzDecode=function(){return this},u.length=function(){return 1};var E=I.zeroHash="\0\0\0\0\0\0\0\0";I.fromNumber=function(e){if(e===0)return u;var n=e<0;n&&(e=-e);var O=e>>>0,$=(e-O)/4294967296>>>0;return n&&($=~$>>>0,O=~O>>>0,++O>4294967295&&(O=0,++$>4294967295&&($=0))),new I(O,$)},I.from=function(e){if(typeof e=="number")return I.fromNumber(e);if(a.isString(e))if(a.Long)e=a.Long.fromString(e);else return I.fromNumber(parseInt(e,10));return e.low||e.high?new I(e.low>>>0,e.high>>>0):u},I.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var n=~this.lo+1>>>0,O=~this.hi>>>0;return n||(O=O+1>>>0),-(n+O*4294967296)}return this.lo+this.hi*4294967296},I.prototype.toLong=function(e){return a.Long?new a.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var _=String.prototype.charCodeAt;return I.fromHash=function(e){return e===E?u:new I((_.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)},I.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)},I.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},I.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},I.prototype.length=function(){var e=this.lo,n=(this.lo>>>28|this.hi<<4)>>>0,O=this.hi>>>24;return O===0?n===0?e<16384?e<128?1:2:e<2097152?3:4:n<16384?n<128?5:6:n<2097152?7:8:O<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(a){var I=a;I.asPromise=requireAspromise(),I.base64=requireBase64(),I.EventEmitter=requireEventemitter(),I.float=requireFloat(),I.inquire=requireInquire(),I.utf8=requireUtf8(),I.pool=requirePool(),I.LongBits=requireLongbits(),I.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),I.global=I.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,I.emptyArray=Object.freeze?Object.freeze([]):[],I.emptyObject=Object.freeze?Object.freeze({}):{},I.isInteger=Number.isInteger||function(k){return typeof k=="number"&&isFinite(k)&&Math.floor(k)===k},I.isString=function(k){return typeof k=="string"||k instanceof String},I.isObject=function(k){return k&&typeof k=="object"},I.isset=I.isSet=function(k,e){var n=k[e];return n!=null&&k.hasOwnProperty(e)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1},I.Buffer=function(){try{var _=I.inquire("buffer").Buffer;return _.prototype.utf8Write?_:null}catch{return null}}(),I._Buffer_from=null,I._Buffer_allocUnsafe=null,I.newBuffer=function(k){return typeof k=="number"?I.Buffer?I._Buffer_allocUnsafe(k):new I.Array(k):I.Buffer?I._Buffer_from(k):typeof Uint8Array>"u"?k:new Uint8Array(k)},I.Array=typeof Uint8Array<"u"?Uint8Array:Array,I.Long=I.global.dcodeIO&&I.global.dcodeIO.Long||I.global.Long||I.inquire("long"),I.key2Re=/^true|false|0|1$/,I.key32Re=/^-?(?:0|[1-9][0-9]*)$/,I.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,I.longToHash=function(k){return k?I.LongBits.from(k).toHash():I.LongBits.zeroHash},I.longFromHash=function(k,e){var n=I.LongBits.fromHash(k);return I.Long?I.Long.fromBits(n.lo,n.hi,e):n.toNumber(!!e)};function u(_,k,e){for(var n=Object.keys(k),O=0;O<n.length;++O)(_[n[O]]===void 0||!e)&&(_[n[O]]=k[n[O]]);return _}I.merge=u,I.lcFirst=function(k){return k.charAt(0).toLowerCase()+k.substring(1)};function E(_){function k(e,n){if(!(this instanceof k))return new k(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,k):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&u(this,n)}return k.prototype=Object.create(Error.prototype,{constructor:{value:k,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}}),k}I.newError=E,I.ProtocolError=E("ProtocolError"),I.oneOfGetter=function(k){for(var e={},n=0;n<k.length;++n)e[k[n]]=1;return function(){for(var O=Object.keys(this),$=O.length-1;$>-1;--$)if(e[O[$]]===1&&this[O[$]]!==void 0&&this[O[$]]!==null)return O[$]}},I.oneOfSetter=function(k){return function(e){for(var n=0;n<k.length;++n)k[n]!==e&&delete this[k[n]]}},I.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},I._configure=function(){var _=I.Buffer;if(!_){I._Buffer_from=I._Buffer_allocUnsafe=null;return}I._Buffer_from=_.from!==Uint8Array.from&&_.from||function(e,n){return new _(e,n)},I._Buffer_allocUnsafe=_.allocUnsafe||function(e){return new _(e)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=O;var a=requireMinimal$1(),I,u=a.LongBits,E=a.base64,_=a.utf8;function k(J,z,Y){this.fn=J,this.len=z,this.next=void 0,this.val=Y}function e(){}function n(J){this.head=J.head,this.tail=J.tail,this.len=J.len,this.next=J.states}function O(){this.len=0,this.head=new k(e,0,0),this.tail=this.head,this.states=null}var $=function(){return a.Buffer?function(){return(O.create=function(){return new I})()}:function(){return new O}};O.create=$(),O.alloc=function(z){return new a.Array(z)},a.Array!==Array&&(O.alloc=a.pool(O.alloc,a.Array.prototype.subarray)),O.prototype._push=function(z,Y,et){return this.tail=this.tail.next=new k(z,Y,et),this.len+=Y,this};function N(J,z,Y){z[Y]=J&255}function D(J,z,Y){for(;J>127;)z[Y++]=J&127|128,J>>>=7;z[Y]=J}function q(J,z){this.len=J,this.next=void 0,this.val=z}q.prototype=Object.create(k.prototype),q.prototype.fn=D,O.prototype.uint32=function(z){return this.len+=(this.tail=this.tail.next=new q((z=z>>>0)<128?1:z<16384?2:z<2097152?3:z<268435456?4:5,z)).len,this},O.prototype.int32=function(z){return z<0?this._push(P,10,u.fromNumber(z)):this.uint32(z)},O.prototype.sint32=function(z){return this.uint32((z<<1^z>>31)>>>0)};function P(J,z,Y){for(;J.hi;)z[Y++]=J.lo&127|128,J.lo=(J.lo>>>7|J.hi<<25)>>>0,J.hi>>>=7;for(;J.lo>127;)z[Y++]=J.lo&127|128,J.lo=J.lo>>>7;z[Y++]=J.lo}O.prototype.uint64=function(z){var Y=u.from(z);return this._push(P,Y.length(),Y)},O.prototype.int64=O.prototype.uint64,O.prototype.sint64=function(z){var Y=u.from(z).zzEncode();return this._push(P,Y.length(),Y)},O.prototype.bool=function(z){return this._push(N,1,z?1:0)};function j(J,z,Y){z[Y]=J&255,z[Y+1]=J>>>8&255,z[Y+2]=J>>>16&255,z[Y+3]=J>>>24}O.prototype.fixed32=function(z){return this._push(j,4,z>>>0)},O.prototype.sfixed32=O.prototype.fixed32,O.prototype.fixed64=function(z){var Y=u.from(z);return this._push(j,4,Y.lo)._push(j,4,Y.hi)},O.prototype.sfixed64=O.prototype.fixed64,O.prototype.float=function(z){return this._push(a.float.writeFloatLE,4,z)},O.prototype.double=function(z){return this._push(a.float.writeDoubleLE,8,z)};var Q=a.Array.prototype.set?function(z,Y,et){Y.set(z,et)}:function(z,Y,et){for(var tt=0;tt<z.length;++tt)Y[et+tt]=z[tt]};return O.prototype.bytes=function(z){var Y=z.length>>>0;if(!Y)return this._push(N,1,0);if(a.isString(z)){var et=O.alloc(Y=E.length(z));E.decode(z,et,0),z=et}return this.uint32(Y)._push(Q,Y,z)},O.prototype.string=function(z){var Y=_.length(z);return Y?this.uint32(Y)._push(_.write,Y,z):this._push(N,1,0)},O.prototype.fork=function(){return this.states=new n(this),this.head=this.tail=new k(e,0,0),this.len=0,this},O.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 k(e,0,0),this.len=0),this},O.prototype.ldelim=function(){var z=this.head,Y=this.tail,et=this.len;return this.reset().uint32(et),et&&(this.tail.next=z.next,this.tail=Y,this.len+=et),this},O.prototype.finish=function(){for(var z=this.head.next,Y=this.constructor.alloc(this.len),et=0;z;)z.fn(z.val,Y,et),et+=z.len,z=z.next;return Y},O._configure=function(J){I=J,O.create=$(),I._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=u;var a=requireWriter();(u.prototype=Object.create(a.prototype)).constructor=u;var I=requireMinimal$1();function u(){a.call(this)}u._configure=function(){u.alloc=I._Buffer_allocUnsafe,u.writeBytesBuffer=I.Buffer&&I.Buffer.prototype instanceof Uint8Array&&I.Buffer.prototype.set.name==="set"?function(k,e,n){e.set(k,n)}:function(k,e,n){if(k.copy)k.copy(e,n,0,k.length);else for(var O=0;O<k.length;)e[n++]=k[O++]}},u.prototype.bytes=function(k){I.isString(k)&&(k=I._Buffer_from(k,"base64"));var e=k.length>>>0;return this.uint32(e),e&&this._push(u.writeBytesBuffer,e,k),this};function E(_,k,e){_.length<40?I.utf8.write(_,k,e):k.utf8Write?k.utf8Write(_,e):k.write(_,e)}return u.prototype.string=function(k){var e=I.Buffer.byteLength(k);return this.uint32(e),e&&this._push(E,e,k),this},u._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=k;var a=requireMinimal$1(),I,u=a.LongBits,E=a.utf8;function _(D,q){return RangeError("index out of range: "+D.pos+" + "+(q||1)+" > "+D.len)}function k(D){this.buf=D,this.pos=0,this.len=D.length}var e=typeof Uint8Array<"u"?function(q){if(q instanceof Uint8Array||Array.isArray(q))return new k(q);throw Error("illegal buffer")}:function(q){if(Array.isArray(q))return new k(q);throw Error("illegal buffer")},n=function(){return a.Buffer?function(P){return(k.create=function(Q){return a.Buffer.isBuffer(Q)?new I(Q):e(Q)})(P)}:e};k.create=n(),k.prototype._slice=a.Array.prototype.subarray||a.Array.prototype.slice,k.prototype.uint32=function(){var q=4294967295;return function(){if(q=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(q=(q|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(q=(q|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(q=(q|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(q=(q|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return q;if((this.pos+=5)>this.len)throw this.pos=this.len,_(this,10);return q}}(),k.prototype.int32=function(){return this.uint32()|0},k.prototype.sint32=function(){var q=this.uint32();return q>>>1^-(q&1)|0};function O(){var D=new u(0,0),q=0;if(this.len-this.pos>4){for(;q<4;++q)if(D.lo=(D.lo|(this.buf[this.pos]&127)<<q*7)>>>0,this.buf[this.pos++]<128)return D;if(D.lo=(D.lo|(this.buf[this.pos]&127)<<28)>>>0,D.hi=(D.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return D;q=0}else{for(;q<3;++q){if(this.pos>=this.len)throw _(this);if(D.lo=(D.lo|(this.buf[this.pos]&127)<<q*7)>>>0,this.buf[this.pos++]<128)return D}return D.lo=(D.lo|(this.buf[this.pos++]&127)<<q*7)>>>0,D}if(this.len-this.pos>4){for(;q<5;++q)if(D.hi=(D.hi|(this.buf[this.pos]&127)<<q*7+3)>>>0,this.buf[this.pos++]<128)return D}else for(;q<5;++q){if(this.pos>=this.len)throw _(this);if(D.hi=(D.hi|(this.buf[this.pos]&127)<<q*7+3)>>>0,this.buf[this.pos++]<128)return D}throw Error("invalid varint encoding")}k.prototype.bool=function(){return this.uint32()!==0};function $(D,q){return(D[q-4]|D[q-3]<<8|D[q-2]<<16|D[q-1]<<24)>>>0}k.prototype.fixed32=function(){if(this.pos+4>this.len)throw _(this,4);return $(this.buf,this.pos+=4)},k.prototype.sfixed32=function(){if(this.pos+4>this.len)throw _(this,4);return $(this.buf,this.pos+=4)|0};function N(){if(this.pos+8>this.len)throw _(this,8);return new u($(this.buf,this.pos+=4),$(this.buf,this.pos+=4))}return k.prototype.float=function(){if(this.pos+4>this.len)throw _(this,4);var q=a.float.readFloatLE(this.buf,this.pos);return this.pos+=4,q},k.prototype.double=function(){if(this.pos+8>this.len)throw _(this,4);var q=a.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,q},k.prototype.bytes=function(){var q=this.uint32(),P=this.pos,j=this.pos+q;if(j>this.len)throw _(this,q);if(this.pos+=q,Array.isArray(this.buf))return this.buf.slice(P,j);if(P===j){var Q=a.Buffer;return Q?Q.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,P,j)},k.prototype.string=function(){var q=this.bytes();return E.read(q,0,q.length)},k.prototype.skip=function(q){if(typeof q=="number"){if(this.pos+q>this.len)throw _(this,q);this.pos+=q}else do if(this.pos>=this.len)throw _(this);while(this.buf[this.pos++]&128);return this},k.prototype.skipType=function(D){switch(D){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(D=this.uint32()&7)!==4;)this.skipType(D);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+D+" at offset "+this.pos)}return this},k._configure=function(D){I=D,k.create=n(),I._configure();var q=a.Long?"toLong":"toNumber";a.merge(k.prototype,{int64:function(){return O.call(this)[q](!1)},uint64:function(){return O.call(this)[q](!0)},sint64:function(){return O.call(this).zzDecode()[q](!1)},fixed64:function(){return N.call(this)[q](!0)},sfixed64:function(){return N.call(this)[q](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=u;var a=requireReader();(u.prototype=Object.create(a.prototype)).constructor=u;var I=requireMinimal$1();function u(E){a.call(this,E)}return u._configure=function(){I.Buffer&&(u.prototype._slice=I.Buffer.prototype.slice)},u.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))},u._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=I;var a=requireMinimal$1();(I.prototype=Object.create(a.EventEmitter.prototype)).constructor=I;function I(u,E,_){if(typeof u!="function")throw TypeError("rpcImpl must be a function");a.EventEmitter.call(this),this.rpcImpl=u,this.requestDelimited=!!E,this.responseDelimited=!!_}return I.prototype.rpcCall=function u(E,_,k,e,n){if(!e)throw TypeError("request must be specified");var O=this;if(!n)return a.asPromise(u,O,E,_,k,e);if(!O.rpcImpl){setTimeout(function(){n(Error("already ended"))},0);return}try{return O.rpcImpl(E,_[O.requestDelimited?"encodeDelimited":"encode"](e).finish(),function(N,D){if(N)return O.emit("error",N,E),n(N);if(D===null){O.end(!0);return}if(!(D instanceof k))try{D=k[O.responseDelimited?"decodeDelimited":"decode"](D)}catch(q){return O.emit("error",q,E),n(q)}return O.emit("data",D,E),n(null,D)})}catch($){O.emit("error",$,E),setTimeout(function(){n($)},0);return}},I.prototype.end=function(E){return this.rpcImpl&&(E||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,function(a){var I=a;I.Service=requireService()}(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(a){var I=a;I.build="minimal",I.Writer=requireWriter(),I.BufferWriter=requireWriter_buffer(),I.Reader=requireReader(),I.BufferReader=requireReader_buffer(),I.util=requireMinimal$1(),I.rpc=requireRpc(),I.roots=requireRoots(),I.configure=u;function u(){I.util._configure(),I.Writer._configure(I.BufferWriter),I.Reader._configure(I.BufferReader)}u()}(indexMinimal)),indexMinimal}var minimal,hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,minimal=requireIndexMinimal()),minimal}var minimalExports=requireMinimal();const $Reader=minimalExports.Reader,$Writer=minimalExports.Writer,$util=minimalExports.util,$root=minimalExports.roots.default||(minimalExports.roots.default={}),com=$root.com=(()=>{const a={};return a.quick=function(){const I={};return I.voice=function(){const u={};return u.proto=function(){const E={};return E.CommonReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}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,n){return n||(n=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&n.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&n.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&n.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&n.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&n.uint32(40).int64(e.valid),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&n.uint32(48).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&n.uint32(56).bool(e.compress),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.CommonReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.event=e.string();break}case 2:{$.data=e.bytes();break}case 3:{$.sn=e.int64();break}case 4:{$.time=e.int64();break}case 5:{$.valid=e.int64();break}case 6:{$.version=e.int32();break}case 7:{$.compress=e.bool();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.CommonReq;return e.event!=null&&(n.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,n.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(n.data=e.data)),e.sn!=null&&($util.Long?(n.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?n.sn=parseInt(e.sn,10):typeof e.sn=="number"?n.sn=e.sn:typeof e.sn=="object"&&(n.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(n.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?n.time=parseInt(e.time,10):typeof e.time=="number"?n.time=e.time:typeof e.time=="object"&&(n.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(n.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?n.valid=parseInt(e.valid,10):typeof e.valid=="number"?n.valid=e.valid:typeof e.valid=="object"&&(n.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.version!=null&&(n.version=e.version|0),e.compress!=null&&(n.compress=!!e.compress),n},_.toObject=function(e,n){n||(n={});let O={};if(n.defaults){if(O.event="",n.bytes===String?O.data="":(O.data=[],n.bytes!==Array&&(O.data=$util.newBuffer(O.data))),$util.Long){let $=new $util.Long(0,0,!1);O.sn=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.sn=n.longs===String?"0":0;if($util.Long){let $=new $util.Long(0,0,!1);O.time=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.time=n.longs===String?"0":0;if($util.Long){let $=new $util.Long(0,0,!1);O.valid=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.valid=n.longs===String?"0":0;O.version=0,O.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(O.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(O.data=n.bytes===String?$util.base64.encode(e.data,0,e.data.length):n.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?O.sn=n.longs===String?String(e.sn):e.sn:O.sn=n.longs===String?$util.Long.prototype.toString.call(e.sn):n.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"?O.time=n.longs===String?String(e.time):e.time:O.time=n.longs===String?$util.Long.prototype.toString.call(e.time):n.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"?O.valid=n.longs===String?String(e.valid):e.valid:O.valid=n.longs===String?$util.Long.prototype.toString.call(e.valid):n.longs===Number?new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber():e.valid),e.version!=null&&e.hasOwnProperty("version")&&(O.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(O.compress=e.compress),O},_.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"},_}(),E.CommonRsp=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}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,n){return n||(n=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&n.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&n.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&n.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&n.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&n.uint32(40).int64(e.valid),e.code!=null&&Object.hasOwnProperty.call(e,"code")&&n.uint32(48).int32(e.code),e.desc!=null&&Object.hasOwnProperty.call(e,"desc")&&n.uint32(58).string(e.desc),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&n.uint32(64).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&n.uint32(72).bool(e.compress),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.CommonRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.event=e.string();break}case 2:{$.data=e.bytes();break}case 3:{$.sn=e.int64();break}case 4:{$.time=e.int64();break}case 5:{$.valid=e.int64();break}case 6:{$.code=e.int32();break}case 7:{$.desc=e.string();break}case 8:{$.version=e.int32();break}case 9:{$.compress=e.bool();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.CommonRsp;return e.event!=null&&(n.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,n.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(n.data=e.data)),e.sn!=null&&($util.Long?(n.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?n.sn=parseInt(e.sn,10):typeof e.sn=="number"?n.sn=e.sn:typeof e.sn=="object"&&(n.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(n.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?n.time=parseInt(e.time,10):typeof e.time=="number"?n.time=e.time:typeof e.time=="object"&&(n.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(n.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?n.valid=parseInt(e.valid,10):typeof e.valid=="number"?n.valid=e.valid:typeof e.valid=="object"&&(n.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.code!=null&&(n.code=e.code|0),e.desc!=null&&(n.desc=String(e.desc)),e.version!=null&&(n.version=e.version|0),e.compress!=null&&(n.compress=!!e.compress),n},_.toObject=function(e,n){n||(n={});let O={};if(n.defaults){if(O.event="",n.bytes===String?O.data="":(O.data=[],n.bytes!==Array&&(O.data=$util.newBuffer(O.data))),$util.Long){let $=new $util.Long(0,0,!1);O.sn=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.sn=n.longs===String?"0":0;if($util.Long){let $=new $util.Long(0,0,!1);O.time=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.time=n.longs===String?"0":0;if($util.Long){let $=new $util.Long(0,0,!1);O.valid=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.valid=n.longs===String?"0":0;O.code=0,O.desc="",O.version=0,O.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(O.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(O.data=n.bytes===String?$util.base64.encode(e.data,0,e.data.length):n.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?O.sn=n.longs===String?String(e.sn):e.sn:O.sn=n.longs===String?$util.Long.prototype.toString.call(e.sn):n.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"?O.time=n.longs===String?String(e.time):e.time:O.time=n.longs===String?$util.Long.prototype.toString.call(e.time):n.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"?O.valid=n.longs===String?String(e.valid):e.valid:O.valid=n.longs===String?$util.Long.prototype.toString.call(e.valid):n.longs===Number?new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber():e.valid),e.code!=null&&e.hasOwnProperty("code")&&(O.code=e.code),e.desc!=null&&e.hasOwnProperty("desc")&&(O.desc=e.desc),e.version!=null&&e.hasOwnProperty("version")&&(O.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(O.compress=e.compress),O},_.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"},_}(),E.User=function(){function _(e){if(this.tracks=[],e)for(let n=Object.keys(e),O=0;O<n.length;++O)e[n[O]]!=null&&(this[n[O]]=e[n[O]])}_.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 k;return Object.defineProperty(_.prototype,"_callAction",{get:$util.oneOfGetter(k=["callAction"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_callState",{get:$util.oneOfGetter(k=["callState"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_joinTime",{get:$util.oneOfGetter(k=["joinTime"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_permissions",{get:$util.oneOfGetter(k=["permissions"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_isPublished",{get:$util.oneOfGetter(k=["isPublished"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_behavior",{get:$util.oneOfGetter(k=["behavior"]),set:$util.oneOfSetter(k)}),_.create=function(n){return new _(n)},_.encode=function(n,O){if(O||(O=$Writer.create()),n.id!=null&&Object.hasOwnProperty.call(n,"id")&&O.uint32(10).string(n.id),n.callAction!=null&&Object.hasOwnProperty.call(n,"callAction")&&O.uint32(16).int32(n.callAction),n.callState!=null&&Object.hasOwnProperty.call(n,"callState")&&O.uint32(24).int32(n.callState),n.joinTime!=null&&Object.hasOwnProperty.call(n,"joinTime")&&O.uint32(32).int64(n.joinTime),n.tracks!=null&&n.tracks.length)for(let $=0;$<n.tracks.length;++$)$root.com.quick.voice.proto.Track.encode(n.tracks[$],O.uint32(42).fork()).ldelim();return n.permissions!=null&&Object.hasOwnProperty.call(n,"permissions")&&O.uint32(48).int32(n.permissions),n.isPublished!=null&&Object.hasOwnProperty.call(n,"isPublished")&&O.uint32(56).bool(n.isPublished),n.behavior!=null&&Object.hasOwnProperty.call(n,"behavior")&&O.uint32(64).int32(n.behavior),O},_.encodeDelimited=function(n,O){return this.encode(n,O).ldelim()},_.decode=function(n,O){n instanceof $Reader||(n=$Reader.create(n));let $=O===void 0?n.len:n.pos+O,N=new $root.com.quick.voice.proto.User;for(;n.pos<$;){let D=n.uint32();switch(D>>>3){case 1:{N.id=n.string();break}case 2:{N.callAction=n.int32();break}case 3:{N.callState=n.int32();break}case 4:{N.joinTime=n.int64();break}case 5:{N.tracks&&N.tracks.length||(N.tracks=[]),N.tracks.push($root.com.quick.voice.proto.Track.decode(n,n.uint32()));break}case 6:{N.permissions=n.int32();break}case 7:{N.isPublished=n.bool();break}case 8:{N.behavior=n.int32();break}default:n.skipType(D&7);break}}return N},_.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},_.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.id!=null&&n.hasOwnProperty("id")&&!$util.isString(n.id))return"id: string expected";if(n.callAction!=null&&n.hasOwnProperty("callAction")&&!$util.isInteger(n.callAction))return"callAction: integer expected";if(n.callState!=null&&n.hasOwnProperty("callState")&&!$util.isInteger(n.callState))return"callState: integer expected";if(n.joinTime!=null&&n.hasOwnProperty("joinTime")&&!$util.isInteger(n.joinTime)&&!(n.joinTime&&$util.isInteger(n.joinTime.low)&&$util.isInteger(n.joinTime.high)))return"joinTime: integer|Long expected";if(n.tracks!=null&&n.hasOwnProperty("tracks")){if(!Array.isArray(n.tracks))return"tracks: array expected";for(let O=0;O<n.tracks.length;++O){let $=$root.com.quick.voice.proto.Track.verify(n.tracks[O]);if($)return"tracks."+$}}return n.permissions!=null&&n.hasOwnProperty("permissions")&&!$util.isInteger(n.permissions)?"permissions: integer expected":n.isPublished!=null&&n.hasOwnProperty("isPublished")&&typeof n.isPublished!="boolean"?"isPublished: boolean expected":n.behavior!=null&&n.hasOwnProperty("behavior")&&!$util.isInteger(n.behavior)?"behavior: integer expected":null},_.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.User)return n;let O=new $root.com.quick.voice.proto.User;if(n.id!=null&&(O.id=String(n.id)),n.callAction!=null&&(O.callAction=n.callAction|0),n.callState!=null&&(O.callState=n.callState|0),n.joinTime!=null&&($util.Long?(O.joinTime=$util.Long.fromValue(n.joinTime)).unsigned=!1:typeof n.joinTime=="string"?O.joinTime=parseInt(n.joinTime,10):typeof n.joinTime=="number"?O.joinTime=n.joinTime:typeof n.joinTime=="object"&&(O.joinTime=new $util.LongBits(n.joinTime.low>>>0,n.joinTime.high>>>0).toNumber())),n.tracks){if(!Array.isArray(n.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");O.tracks=[];for(let $=0;$<n.tracks.length;++$){if(typeof n.tracks[$]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");O.tracks[$]=$root.com.quick.voice.proto.Track.fromObject(n.tracks[$])}}return n.permissions!=null&&(O.permissions=n.permissions|0),n.isPublished!=null&&(O.isPublished=!!n.isPublished),n.behavior!=null&&(O.behavior=n.behavior|0),O},_.toObject=function(n,O){O||(O={});let $={};if((O.arrays||O.defaults)&&($.tracks=[]),O.defaults&&($.id=""),n.id!=null&&n.hasOwnProperty("id")&&($.id=n.id),n.callAction!=null&&n.hasOwnProperty("callAction")&&($.callAction=n.callAction,O.oneofs&&($._callAction="callAction")),n.callState!=null&&n.hasOwnProperty("callState")&&($.callState=n.callState,O.oneofs&&($._callState="callState")),n.joinTime!=null&&n.hasOwnProperty("joinTime")&&(typeof n.joinTime=="number"?$.joinTime=O.longs===String?String(n.joinTime):n.joinTime:$.joinTime=O.longs===String?$util.Long.prototype.toString.call(n.joinTime):O.longs===Number?new $util.LongBits(n.joinTime.low>>>0,n.joinTime.high>>>0).toNumber():n.joinTime,O.oneofs&&($._joinTime="joinTime")),n.tracks&&n.tracks.length){$.tracks=[];for(let N=0;N<n.tracks.length;++N)$.tracks[N]=$root.com.quick.voice.proto.Track.toObject(n.tracks[N],O)}return n.permissions!=null&&n.hasOwnProperty("permissions")&&($.permissions=n.permissions,O.oneofs&&($._permissions="permissions")),n.isPublished!=null&&n.hasOwnProperty("isPublished")&&($.isPublished=n.isPublished,O.oneofs&&($._isPublished="isPublished")),n.behavior!=null&&n.hasOwnProperty("behavior")&&($.behavior=n.behavior,O.oneofs&&($._behavior="behavior")),$},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.User"},_}(),E.Login=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.appid="",_.prototype.userId="",_.prototype.sdkToken="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.appid!=null&&Object.hasOwnProperty.call(e,"appid")&&n.uint32(10).string(e.appid),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(18).string(e.userId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&n.uint32(26).string(e.sdkToken),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.Login;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.appid=e.string();break}case 2:{$.userId=e.string();break}case 3:{$.sdkToken=e.string();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.Login;return e.appid!=null&&(n.appid=String(e.appid)),e.userId!=null&&(n.userId=String(e.userId)),e.sdkToken!=null&&(n.sdkToken=String(e.sdkToken)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.appid="",O.userId="",O.sdkToken=""),e.appid!=null&&e.hasOwnProperty("appid")&&(O.appid=e.appid),e.userId!=null&&e.hasOwnProperty("userId")&&(O.userId=e.userId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(O.sdkToken=e.sdkToken),O},_.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"},_}(),E.Track=function(){function _(e){if(e)for(let n=Object.keys(e),O=0;O<n.length;++O)e[n[O]]!=null&&(this[n[O]]=e[n[O]])}_.prototype.mid="",_.prototype.trackName=null,_.prototype.location=null,_.prototype.userId=null,_.prototype.code=null,_.prototype.desc=null,_.prototype.type=null,_.prototype.isValid=null;let k;return Object.defineProperty(_.prototype,"_trackName",{get:$util.oneOfGetter(k=["trackName"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_location",{get:$util.oneOfGetter(k=["location"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_userId",{get:$util.oneOfGetter(k=["userId"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_code",{get:$util.oneOfGetter(k=["code"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_desc",{get:$util.oneOfGetter(k=["desc"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_type",{get:$util.oneOfGetter(k=["type"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_isValid",{get:$util.oneOfGetter(k=["isValid"]),set:$util.oneOfSetter(k)}),_.create=function(n){return new _(n)},_.encode=function(n,O){return O||(O=$Writer.create()),n.mid!=null&&Object.hasOwnProperty.call(n,"mid")&&O.uint32(10).string(n.mid),n.trackName!=null&&Object.hasOwnProperty.call(n,"trackName")&&O.uint32(18).string(n.trackName),n.location!=null&&Object.hasOwnProperty.call(n,"location")&&O.uint32(26).string(n.location),n.userId!=null&&Object.hasOwnProperty.call(n,"userId")&&O.uint32(34).string(n.userId),n.code!=null&&Object.hasOwnProperty.call(n,"code")&&O.uint32(40).int32(n.code),n.desc!=null&&Object.hasOwnProperty.call(n,"desc")&&O.uint32(50).string(n.desc),n.type!=null&&Object.hasOwnProperty.call(n,"type")&&O.uint32(56).int32(n.type),n.isValid!=null&&Object.hasOwnProperty.call(n,"isValid")&&O.uint32(64).bool(n.isValid),O},_.encodeDelimited=function(n,O){return this.encode(n,O).ldelim()},_.decode=function(n,O){n instanceof $Reader||(n=$Reader.create(n));let $=O===void 0?n.len:n.pos+O,N=new $root.com.quick.voice.proto.Track;for(;n.pos<$;){let D=n.uint32();switch(D>>>3){case 1:{N.mid=n.string();break}case 2:{N.trackName=n.string();break}case 3:{N.location=n.string();break}case 4:{N.userId=n.string();break}case 5:{N.code=n.int32();break}case 6:{N.desc=n.string();break}case 7:{N.type=n.int32();break}case 8:{N.isValid=n.bool();break}default:n.skipType(D&7);break}}return N},_.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},_.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.mid!=null&&n.hasOwnProperty("mid")&&!$util.isString(n.mid))return"mid: string expected";if(n.trackName!=null&&n.hasOwnProperty("trackName")&&!$util.isString(n.trackName))return"trackName: string expected";if(n.location!=null&&n.hasOwnProperty("location")&&!$util.isString(n.location))return"location: string expected";if(n.userId!=null&&n.hasOwnProperty("userId")&&!$util.isString(n.userId))return"userId: string expected";if(n.code!=null&&n.hasOwnProperty("code")&&!$util.isInteger(n.code))return"code: integer expected";if(n.desc!=null&&n.hasOwnProperty("desc")&&!$util.isString(n.desc))return"desc: string expected";if(n.type!=null&&n.hasOwnProperty("type"))switch(n.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return n.isValid!=null&&n.hasOwnProperty("isValid")&&typeof n.isValid!="boolean"?"isValid: boolean expected":null},_.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.Track)return n;let O=new $root.com.quick.voice.proto.Track;switch(n.mid!=null&&(O.mid=String(n.mid)),n.trackName!=null&&(O.trackName=String(n.trackName)),n.location!=null&&(O.location=String(n.location)),n.userId!=null&&(O.userId=String(n.userId)),n.code!=null&&(O.code=n.code|0),n.desc!=null&&(O.desc=String(n.desc)),n.type){default:if(typeof n.type=="number"){O.type=n.type;break}break;case"Microphone":case 0:O.type=0;break;case"Camera":case 1:O.type=1;break;case"Screen":case 2:O.type=2;break;case"SystemVoice":case 3:O.type=3;break}return n.isValid!=null&&(O.isValid=!!n.isValid),O},_.toObject=function(n,O){O||(O={});let $={};return O.defaults&&($.mid=""),n.mid!=null&&n.hasOwnProperty("mid")&&($.mid=n.mid),n.trackName!=null&&n.hasOwnProperty("trackName")&&($.trackName=n.trackName,O.oneofs&&($._trackName="trackName")),n.location!=null&&n.hasOwnProperty("location")&&($.location=n.location,O.oneofs&&($._location="location")),n.userId!=null&&n.hasOwnProperty("userId")&&($.userId=n.userId,O.oneofs&&($._userId="userId")),n.code!=null&&n.hasOwnProperty("code")&&($.code=n.code,O.oneofs&&($._code="code")),n.desc!=null&&n.hasOwnProperty("desc")&&($.desc=n.desc,O.oneofs&&($._desc="desc")),n.type!=null&&n.hasOwnProperty("type")&&($.type=O.enums===String?$root.com.quick.voice.proto.TrackType[n.type]===void 0?n.type:$root.com.quick.voice.proto.TrackType[n.type]:n.type,O.oneofs&&($._type="type")),n.isValid!=null&&n.hasOwnProperty("isValid")&&($.isValid=n.isValid,O.oneofs&&($._isValid="isValid")),$},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.Track"},_}(),E.JoinReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.prototype.callType=0,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),e.callType!=null&&Object.hasOwnProperty.call(e,"callType")&&n.uint32(24).int32(e.callType),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.JoinReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}case 3:{$.callType=e.int32();break}default:e.skipType(N&7);break}}return $},_.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 n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+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.JoinReq)return e;let n=new $root.com.quick.voice.proto.JoinReq;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}switch(e.callType){default:if(typeof e.callType=="number"){n.callType=e.callType;break}break;case"Normal":case 0:n.callType=0;break;case"Meeting":case 1:n.callType=1;break;case"Live":case 2:n.callType=2;break}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null,O.callType=n.enums===String?"Normal":0),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),e.callType!=null&&e.hasOwnProperty("callType")&&(O.callType=n.enums===String?$root.com.quick.voice.proto.CallType[e.callType]===void 0?e.callType:$root.com.quick.voice.proto.CallType[e.callType]:e.callType),O},_.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"},_}(),E.JoinRsp=function(){function _(k){if(this.roomUsers=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.roomUsers=$util.emptyArray,_.prototype.callType=0,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.roomUsers!=null&&e.roomUsers.length)for(let O=0;O<e.roomUsers.length;++O)$root.com.quick.voice.proto.User.encode(e.roomUsers[O],n.uint32(18).fork()).ldelim();return e.callType!=null&&Object.hasOwnProperty.call(e,"callType")&&n.uint32(24).int32(e.callType),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.JoinRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.roomUsers&&$.roomUsers.length||($.roomUsers=[]),$.roomUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 3:{$.callType=e.int32();break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.roomUsers.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.roomUsers[n]);if(O)return"roomUsers."+O}}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 n=new $root.com.quick.voice.proto.JoinRsp;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.roomUsers){if(!Array.isArray(e.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");n.roomUsers=[];for(let O=0;O<e.roomUsers.length;++O){if(typeof e.roomUsers[O]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");n.roomUsers[O]=$root.com.quick.voice.proto.User.fromObject(e.roomUsers[O])}}switch(e.callType){default:if(typeof e.callType=="number"){n.callType=e.callType;break}break;case"Normal":case 0:n.callType=0;break;case"Meeting":case 1:n.callType=1;break;case"Live":case 2:n.callType=2;break}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.roomUsers=[]),n.defaults&&(O.roomId="",O.callType=n.enums===String?"Normal":0),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.roomUsers&&e.roomUsers.length){O.roomUsers=[];for(let $=0;$<e.roomUsers.length;++$)O.roomUsers[$]=$root.com.quick.voice.proto.User.toObject(e.roomUsers[$],n)}return e.callType!=null&&e.hasOwnProperty("callType")&&(O.callType=n.enums===String?$root.com.quick.voice.proto.CallType[e.callType]===void 0?e.callType:$root.com.quick.voice.proto.CallType[e.callType]:e.callType),O},_.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"},_}(),E.JoinNotify=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.JoinNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.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 n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinNotify)return e;let n=new $root.com.quick.voice.proto.JoinNotify;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.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"},_}(),E.ConnectCFReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.sdp="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&n.uint32(10).string(e.sdp),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.ConnectCFReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.sdp=e.string();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.ConnectCFReq;return e.sdp!=null&&(n.sdp=String(e.sdp)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.sdp=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(O.sdp=e.sdp),O},_.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"},_}(),E.ConnectCFRsp=function(){function _(k){if(this.subscribeUsers=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.remoteSdp="",_.prototype.subscribeUsers=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&n.uint32(10).string(e.remoteSdp),e.subscribeUsers!=null&&e.subscribeUsers.length)for(let O=0;O<e.subscribeUsers.length;++O)$root.com.quick.voice.proto.User.encode(e.subscribeUsers[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.ConnectCFRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.remoteSdp=e.string();break}case 2:{$.subscribeUsers&&$.subscribeUsers.length||($.subscribeUsers=[]),$.subscribeUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.subscribeUsers.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.subscribeUsers[n]);if(O)return"subscribeUsers."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ConnectCFRsp)return e;let n=new $root.com.quick.voice.proto.ConnectCFRsp;if(e.remoteSdp!=null&&(n.remoteSdp=String(e.remoteSdp)),e.subscribeUsers){if(!Array.isArray(e.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");n.subscribeUsers=[];for(let O=0;O<e.subscribeUsers.length;++O){if(typeof e.subscribeUsers[O]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");n.subscribeUsers[O]=$root.com.quick.voice.proto.User.fromObject(e.subscribeUsers[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.subscribeUsers=[]),n.defaults&&(O.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(O.remoteSdp=e.remoteSdp),e.subscribeUsers&&e.subscribeUsers.length){O.subscribeUsers=[];for(let $=0;$<e.subscribeUsers.length;++$)O.subscribeUsers[$]=$root.com.quick.voice.proto.User.toObject(e.subscribeUsers[$],n)}return O},_.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"},_}(),E.PublishReq=function(){function _(e){if(this.tracks=[],e)for(let n=Object.keys(e),O=0;O<n.length;++O)e[n[O]]!=null&&(this[n[O]]=e[n[O]])}_.prototype.sdp="",_.prototype.tracks=$util.emptyArray,_.prototype.callAction=0,_.prototype.recreate=null;let k;return Object.defineProperty(_.prototype,"_recreate",{get:$util.oneOfGetter(k=["recreate"]),set:$util.oneOfSetter(k)}),_.create=function(n){return new _(n)},_.encode=function(n,O){if(O||(O=$Writer.create()),n.sdp!=null&&Object.hasOwnProperty.call(n,"sdp")&&O.uint32(10).string(n.sdp),n.tracks!=null&&n.tracks.length)for(let $=0;$<n.tracks.length;++$)$root.com.quick.voice.proto.Track.encode(n.tracks[$],O.uint32(18).fork()).ldelim();return n.callAction!=null&&Object.hasOwnProperty.call(n,"callAction")&&O.uint32(24).int32(n.callAction),n.recreate!=null&&Object.hasOwnProperty.call(n,"recreate")&&O.uint32(32).bool(n.recreate),O},_.encodeDelimited=function(n,O){return this.encode(n,O).ldelim()},_.decode=function(n,O){n instanceof $Reader||(n=$Reader.create(n));let $=O===void 0?n.len:n.pos+O,N=new $root.com.quick.voice.proto.PublishReq;for(;n.pos<$;){let D=n.uint32();switch(D>>>3){case 1:{N.sdp=n.string();break}case 2:{N.tracks&&N.tracks.length||(N.tracks=[]),N.tracks.push($root.com.quick.voice.proto.Track.decode(n,n.uint32()));break}case 3:{N.callAction=n.int32();break}case 4:{N.recreate=n.bool();break}default:n.skipType(D&7);break}}return N},_.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},_.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.sdp!=null&&n.hasOwnProperty("sdp")&&!$util.isString(n.sdp))return"sdp: string expected";if(n.tracks!=null&&n.hasOwnProperty("tracks")){if(!Array.isArray(n.tracks))return"tracks: array expected";for(let O=0;O<n.tracks.length;++O){let $=$root.com.quick.voice.proto.Track.verify(n.tracks[O]);if($)return"tracks."+$}}return n.callAction!=null&&n.hasOwnProperty("callAction")&&!$util.isInteger(n.callAction)?"callAction: integer expected":n.recreate!=null&&n.hasOwnProperty("recreate")&&typeof n.recreate!="boolean"?"recreate: boolean expected":null},_.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.PublishReq)return n;let O=new $root.com.quick.voice.proto.PublishReq;if(n.sdp!=null&&(O.sdp=String(n.sdp)),n.tracks){if(!Array.isArray(n.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");O.tracks=[];for(let $=0;$<n.tracks.length;++$){if(typeof n.tracks[$]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");O.tracks[$]=$root.com.quick.voice.proto.Track.fromObject(n.tracks[$])}}return n.callAction!=null&&(O.callAction=n.callAction|0),n.recreate!=null&&(O.recreate=!!n.recreate),O},_.toObject=function(n,O){O||(O={});let $={};if((O.arrays||O.defaults)&&($.tracks=[]),O.defaults&&($.sdp="",$.callAction=0),n.sdp!=null&&n.hasOwnProperty("sdp")&&($.sdp=n.sdp),n.tracks&&n.tracks.length){$.tracks=[];for(let N=0;N<n.tracks.length;++N)$.tracks[N]=$root.com.quick.voice.proto.Track.toObject(n.tracks[N],O)}return n.callAction!=null&&n.hasOwnProperty("callAction")&&($.callAction=n.callAction),n.recreate!=null&&n.hasOwnProperty("recreate")&&($.recreate=n.recreate,O.oneofs&&($._recreate="recreate")),$},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.PublishReq"},_}(),E.PublishRsp=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.remoteSdp="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&n.uint32(10).string(e.remoteSdp),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.PublishRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.remoteSdp=e.string();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.PublishRsp;return e.remoteSdp!=null&&(n.remoteSdp=String(e.remoteSdp)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(O.remoteSdp=e.remoteSdp),O},_.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"},_}(),E.PublishNotify=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.PublishNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.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 n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PublishNotify)return e;let n=new $root.com.quick.voice.proto.PublishNotify;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.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"},_}(),E.SubscribeReq=function(){function _(k){if(this.users=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.users=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.users!=null&&e.users.length)for(let O=0;O<e.users.length;++O)$root.com.quick.voice.proto.User.encode(e.users[O],n.uint32(10).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.SubscribeReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.users&&$.users.length||($.users=[]),$.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.users.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.users[n]);if(O)return"users."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SubscribeReq)return e;let n=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");n.users=[];for(let O=0;O<e.users.length;++O){if(typeof e.users[O]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");n.users[O]=$root.com.quick.voice.proto.User.fromObject(e.users[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.users=[]),e.users&&e.users.length){O.users=[];for(let $=0;$<e.users.length;++$)O.users[$]=$root.com.quick.voice.proto.User.toObject(e.users[$],n)}return O},_.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"},_}(),E.SubscribeRsp=function(){function _(k){if(this.users=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.remoteSdp="",_.prototype.users=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&n.uint32(10).string(e.remoteSdp),e.users!=null&&e.users.length)for(let O=0;O<e.users.length;++O)$root.com.quick.voice.proto.User.encode(e.users[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.SubscribeRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.remoteSdp=e.string();break}case 2:{$.users&&$.users.length||($.users=[]),$.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.users.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.users[n]);if(O)return"users."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SubscribeRsp)return e;let n=new $root.com.quick.voice.proto.SubscribeRsp;if(e.remoteSdp!=null&&(n.remoteSdp=String(e.remoteSdp)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");n.users=[];for(let O=0;O<e.users.length;++O){if(typeof e.users[O]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");n.users[O]=$root.com.quick.voice.proto.User.fromObject(e.users[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.users=[]),n.defaults&&(O.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(O.remoteSdp=e.remoteSdp),e.users&&e.users.length){O.users=[];for(let $=0;$<e.users.length;++$)O.users[$]=$root.com.quick.voice.proto.User.toObject(e.users[$],n)}return O},_.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"},_}(),E.RenegotiateReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.userId="",_.prototype.sdp="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(10).string(e.userId),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&n.uint32(18).string(e.sdp),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.RenegotiateReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.userId=e.string();break}case 2:{$.sdp=e.string();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.RenegotiateReq;return e.userId!=null&&(n.userId=String(e.userId)),e.sdp!=null&&(n.sdp=String(e.sdp)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.userId="",O.sdp=""),e.userId!=null&&e.hasOwnProperty("userId")&&(O.userId=e.userId),e.sdp!=null&&e.hasOwnProperty("sdp")&&(O.sdp=e.sdp),O},_.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"},_}(),E.QuitReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.userId="",_.prototype.roomId="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(18).string(e.roomId),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.QuitReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.userId=e.string();break}case 2:{$.roomId=e.string();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.QuitReq;return e.userId!=null&&(n.userId=String(e.userId)),e.roomId!=null&&(n.roomId=String(e.roomId)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.userId="",O.roomId=""),e.userId!=null&&e.hasOwnProperty("userId")&&(O.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),O},_.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"},_}(),E.QuitNotify=function(){function _(e){if(e)for(let n=Object.keys(e),O=0;O<n.length;++O)e[n[O]]!=null&&(this[n[O]]=e[n[O]])}_.prototype.roomId="",_.prototype.user=null,_.prototype.code=null,_.prototype.desc=null;let k;return Object.defineProperty(_.prototype,"_code",{get:$util.oneOfGetter(k=["code"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_desc",{get:$util.oneOfGetter(k=["desc"]),set:$util.oneOfSetter(k)}),_.create=function(n){return new _(n)},_.encode=function(n,O){return O||(O=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&O.uint32(10).string(n.roomId),n.user!=null&&Object.hasOwnProperty.call(n,"user")&&$root.com.quick.voice.proto.User.encode(n.user,O.uint32(18).fork()).ldelim(),n.code!=null&&Object.hasOwnProperty.call(n,"code")&&O.uint32(24).int32(n.code),n.desc!=null&&Object.hasOwnProperty.call(n,"desc")&&O.uint32(34).string(n.desc),O},_.encodeDelimited=function(n,O){return this.encode(n,O).ldelim()},_.decode=function(n,O){n instanceof $Reader||(n=$Reader.create(n));let $=O===void 0?n.len:n.pos+O,N=new $root.com.quick.voice.proto.QuitNotify;for(;n.pos<$;){let D=n.uint32();switch(D>>>3){case 1:{N.roomId=n.string();break}case 2:{N.user=$root.com.quick.voice.proto.User.decode(n,n.uint32());break}case 3:{N.code=n.int32();break}case 4:{N.desc=n.string();break}default:n.skipType(D&7);break}}return N},_.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},_.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.user!=null&&n.hasOwnProperty("user")){let O=$root.com.quick.voice.proto.User.verify(n.user);if(O)return"user."+O}return n.code!=null&&n.hasOwnProperty("code")&&!$util.isInteger(n.code)?"code: integer expected":n.desc!=null&&n.hasOwnProperty("desc")&&!$util.isString(n.desc)?"desc: string expected":null},_.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.QuitNotify)return n;let O=new $root.com.quick.voice.proto.QuitNotify;if(n.roomId!=null&&(O.roomId=String(n.roomId)),n.user!=null){if(typeof n.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");O.user=$root.com.quick.voice.proto.User.fromObject(n.user)}return n.code!=null&&(O.code=n.code|0),n.desc!=null&&(O.desc=String(n.desc)),O},_.toObject=function(n,O){O||(O={});let $={};return O.defaults&&($.roomId="",$.user=null),n.roomId!=null&&n.hasOwnProperty("roomId")&&($.roomId=n.roomId),n.user!=null&&n.hasOwnProperty("user")&&($.user=$root.com.quick.voice.proto.User.toObject(n.user,O)),n.code!=null&&n.hasOwnProperty("code")&&($.code=n.code,O.oneofs&&($._code="code")),n.desc!=null&&n.hasOwnProperty("desc")&&($.desc=n.desc,O.oneofs&&($._desc="desc")),$},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.QuitNotify"},_}(),E.TokenExpireNotify=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.TokenExpireNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.TokenExpireNotify;return e.roomId!=null&&(n.roomId=String(e.roomId)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),O},_.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"},_}(),E.UpdateTokenReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.sdkToken="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&n.uint32(18).string(e.sdkToken),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.UpdateTokenReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.sdkToken=e.string();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.UpdateTokenReq;return e.roomId!=null&&(n.roomId=String(e.roomId)),e.sdkToken!=null&&(n.sdkToken=String(e.sdkToken)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.sdkToken=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(O.sdkToken=e.sdkToken),O},_.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"},_}(),E.NetQualityChange=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.userId="",_.prototype.roomId="",_.prototype.egress=0,_.prototype.ingress=0,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(18).string(e.roomId),e.egress!=null&&Object.hasOwnProperty.call(e,"egress")&&n.uint32(24).int32(e.egress),e.ingress!=null&&Object.hasOwnProperty.call(e,"ingress")&&n.uint32(32).int32(e.ingress),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.NetQualityChange;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.userId=e.string();break}case 2:{$.roomId=e.string();break}case 3:{$.egress=e.int32();break}case 4:{$.ingress=e.int32();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.NetQualityChange;return e.userId!=null&&(n.userId=String(e.userId)),e.roomId!=null&&(n.roomId=String(e.roomId)),e.egress!=null&&(n.egress=e.egress|0),e.ingress!=null&&(n.ingress=e.ingress|0),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.userId="",O.roomId="",O.egress=0,O.ingress=0),e.userId!=null&&e.hasOwnProperty("userId")&&(O.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.egress!=null&&e.hasOwnProperty("egress")&&(O.egress=e.egress),e.ingress!=null&&e.hasOwnProperty("ingress")&&(O.ingress=e.ingress),O},_.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"},_}(),E.NetQualityNotify=function(){function _(k){if(this.qualities=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.qualities=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.qualities!=null&&e.qualities.length)for(let O=0;O<e.qualities.length;++O)$root.com.quick.voice.proto.NetQualityChange.encode(e.qualities[O],n.uint32(10).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.NetQualityNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.qualities&&$.qualities.length||($.qualities=[]),$.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.qualities.length;++n){let O=$root.com.quick.voice.proto.NetQualityChange.verify(e.qualities[n]);if(O)return"qualities."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.NetQualityNotify)return e;let n=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");n.qualities=[];for(let O=0;O<e.qualities.length;++O){if(typeof e.qualities[O]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");n.qualities[O]=$root.com.quick.voice.proto.NetQualityChange.fromObject(e.qualities[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.qualities=[]),e.qualities&&e.qualities.length){O.qualities=[];for(let $=0;$<e.qualities.length;++$)O.qualities[$]=$root.com.quick.voice.proto.NetQualityChange.toObject(e.qualities[$],n)}return O},_.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"},_}(),E.UpdateCall=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.UpdateCall;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.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 n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateCall)return e;let n=new $root.com.quick.voice.proto.UpdateCall;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.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"},_}(),E.SyncRoomInfoReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.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 n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return e;let n=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.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"},_}(),E.SyncRoomInfoRsp=function(){function _(k){if(this.users=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.isValid=!1,_.prototype.users=$util.emptyArray,_.prototype.isActive=!1,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.isValid!=null&&Object.hasOwnProperty.call(e,"isValid")&&n.uint32(16).bool(e.isValid),e.users!=null&&e.users.length)for(let O=0;O<e.users.length;++O)$root.com.quick.voice.proto.User.encode(e.users[O],n.uint32(26).fork()).ldelim();return e.isActive!=null&&Object.hasOwnProperty.call(e,"isActive")&&n.uint32(32).bool(e.isActive),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.isValid=e.bool();break}case 3:{$.users&&$.users.length||($.users=[]),$.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 4:{$.isActive=e.bool();break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.users.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.users[n]);if(O)return"users."+O}}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 n=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.isValid!=null&&(n.isValid=!!e.isValid),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");n.users=[];for(let O=0;O<e.users.length;++O){if(typeof e.users[O]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");n.users[O]=$root.com.quick.voice.proto.User.fromObject(e.users[O])}}return e.isActive!=null&&(n.isActive=!!e.isActive),n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.users=[]),n.defaults&&(O.roomId="",O.isValid=!1,O.isActive=!1),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.isValid!=null&&e.hasOwnProperty("isValid")&&(O.isValid=e.isValid),e.users&&e.users.length){O.users=[];for(let $=0;$<e.users.length;++$)O.users[$]=$root.com.quick.voice.proto.User.toObject(e.users[$],n)}return e.isActive!=null&&e.hasOwnProperty("isActive")&&(O.isActive=e.isActive),O},_.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"},_}(),E.UpdateTime=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&n.uint32(8).int64(e.time),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.UpdateTime;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.time=e.int64();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.UpdateTime;return e.time!=null&&($util.Long?(n.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?n.time=parseInt(e.time,10):typeof e.time=="number"?n.time=e.time:typeof e.time=="object"&&(n.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),n},_.toObject=function(e,n){n||(n={});let O={};if(n.defaults)if($util.Long){let $=new $util.Long(0,0,!1);O.time=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.time=n.longs===String?"0":0;return e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?O.time=n.longs===String?String(e.time):e.time:O.time=n.longs===String?$util.Long.prototype.toString.call(e.time):n.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),O},_.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"},_}(),E.CloseTrackReq=function(){function _(k){if(this.tracks=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.sdp="",_.prototype.tracks=$util.emptyArray,_.prototype.roomId="",_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&n.uint32(10).string(e.sdp),e.tracks!=null&&e.tracks.length)for(let O=0;O<e.tracks.length;++O)$root.com.quick.voice.proto.Track.encode(e.tracks[O],n.uint32(18).fork()).ldelim();return e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(26).string(e.roomId),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.CloseTrackReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.sdp=e.string();break}case 2:{$.tracks&&$.tracks.length||($.tracks=[]),$.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}case 3:{$.roomId=e.string();break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.tracks.length;++n){let O=$root.com.quick.voice.proto.Track.verify(e.tracks[n]);if(O)return"tracks."+O}}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 n=new $root.com.quick.voice.proto.CloseTrackReq;if(e.sdp!=null&&(n.sdp=String(e.sdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");n.tracks=[];for(let O=0;O<e.tracks.length;++O){if(typeof e.tracks[O]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");n.tracks[O]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[O])}}return e.roomId!=null&&(n.roomId=String(e.roomId)),n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.tracks=[]),n.defaults&&(O.sdp="",O.roomId=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(O.sdp=e.sdp),e.tracks&&e.tracks.length){O.tracks=[];for(let $=0;$<e.tracks.length;++$)O.tracks[$]=$root.com.quick.voice.proto.Track.toObject(e.tracks[$],n)}return e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),O},_.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"},_}(),E.CloseTrackRsp=function(){function _(k){if(this.tracks=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.remoteSdp="",_.prototype.tracks=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&n.uint32(10).string(e.remoteSdp),e.tracks!=null&&e.tracks.length)for(let O=0;O<e.tracks.length;++O)$root.com.quick.voice.proto.Track.encode(e.tracks[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.CloseTrackRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.remoteSdp=e.string();break}case 2:{$.tracks&&$.tracks.length||($.tracks=[]),$.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.tracks.length;++n){let O=$root.com.quick.voice.proto.Track.verify(e.tracks[n]);if(O)return"tracks."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackRsp)return e;let n=new $root.com.quick.voice.proto.CloseTrackRsp;if(e.remoteSdp!=null&&(n.remoteSdp=String(e.remoteSdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");n.tracks=[];for(let O=0;O<e.tracks.length;++O){if(typeof e.tracks[O]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");n.tracks[O]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.tracks=[]),n.defaults&&(O.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(O.remoteSdp=e.remoteSdp),e.tracks&&e.tracks.length){O.tracks=[];for(let $=0;$<e.tracks.length;++$)O.tracks[$]=$root.com.quick.voice.proto.Track.toObject(e.tracks[$],n)}return O},_.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"},_}(),E.CloseTrackNotify=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(10).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.CloseTrackNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.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 n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackNotify)return e;let n=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");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.user=null),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.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"},_}(),E.ToggleLiveRoomReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.ToggleLiveRoomReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.ToggleLiveRoomReq;return e.roomId!=null&&(n.roomId=String(e.roomId)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),O},_.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"},_}(),E.ToggleLiveRoomRsq=function(){function _(k){if(this.roomUsers=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.hash="",_.prototype.roomUsers=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.hash!=null&&Object.hasOwnProperty.call(e,"hash")&&n.uint32(18).string(e.hash),e.roomUsers!=null&&e.roomUsers.length)for(let O=0;O<e.roomUsers.length;++O)$root.com.quick.voice.proto.User.encode(e.roomUsers[O],n.uint32(26).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.hash=e.string();break}case 3:{$.roomUsers&&$.roomUsers.length||($.roomUsers=[]),$.roomUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.roomUsers.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.roomUsers[n]);if(O)return"roomUsers."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ToggleLiveRoomRsq)return e;let n=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.hash!=null&&(n.hash=String(e.hash)),e.roomUsers){if(!Array.isArray(e.roomUsers))throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: array expected");n.roomUsers=[];for(let O=0;O<e.roomUsers.length;++O){if(typeof e.roomUsers[O]!="object")throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: object expected");n.roomUsers[O]=$root.com.quick.voice.proto.User.fromObject(e.roomUsers[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.roomUsers=[]),n.defaults&&(O.roomId="",O.hash=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.hash!=null&&e.hasOwnProperty("hash")&&(O.hash=e.hash),e.roomUsers&&e.roomUsers.length){O.roomUsers=[];for(let $=0;$<e.roomUsers.length;++$)O.roomUsers[$]=$root.com.quick.voice.proto.User.toObject(e.roomUsers[$],n)}return O},_.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"},_}(),E.TrackType=function(){const _={},k=Object.create(_);return k[_[0]="Microphone"]=0,k[_[1]="Camera"]=1,k[_[2]="Screen"]=2,k[_[3]="SystemVoice"]=3,k}(),E.ReportInfoReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}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,n){return n||(n=$Writer.create()),e.actionEvent!=null&&Object.hasOwnProperty.call(e,"actionEvent")&&n.uint32(10).string(e.actionEvent),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(18).string(e.userId),e.platform!=null&&Object.hasOwnProperty.call(e,"platform")&&n.uint32(26).string(e.platform),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&n.uint32(32).int64(e.time),e.actionData!=null&&Object.hasOwnProperty.call(e,"actionData")&&n.uint32(42).string(e.actionData),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.ReportInfoReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.actionEvent=e.string();break}case 2:{$.userId=e.string();break}case 3:{$.platform=e.string();break}case 4:{$.time=e.int64();break}case 5:{$.actionData=e.string();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.ReportInfoReq;return e.actionEvent!=null&&(n.actionEvent=String(e.actionEvent)),e.userId!=null&&(n.userId=String(e.userId)),e.platform!=null&&(n.platform=String(e.platform)),e.time!=null&&($util.Long?(n.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?n.time=parseInt(e.time,10):typeof e.time=="number"?n.time=e.time:typeof e.time=="object"&&(n.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.actionData!=null&&(n.actionData=String(e.actionData)),n},_.toObject=function(e,n){n||(n={});let O={};if(n.defaults){if(O.actionEvent="",O.userId="",O.platform="",$util.Long){let $=new $util.Long(0,0,!1);O.time=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.time=n.longs===String?"0":0;O.actionData=""}return e.actionEvent!=null&&e.hasOwnProperty("actionEvent")&&(O.actionEvent=e.actionEvent),e.userId!=null&&e.hasOwnProperty("userId")&&(O.userId=e.userId),e.platform!=null&&e.hasOwnProperty("platform")&&(O.platform=e.platform),e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?O.time=n.longs===String?String(e.time):e.time:O.time=n.longs===String?$util.Long.prototype.toString.call(e.time):n.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),e.actionData!=null&&e.hasOwnProperty("actionData")&&(O.actionData=e.actionData),O},_.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"},_}(),E.UpdatePermissions=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.UpdatePermissions;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.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 n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdatePermissions)return e;let n=new $root.com.quick.voice.proto.UpdatePermissions;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.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"},_}(),E.CallType=function(){const _={},k=Object.create(_);return k[_[0]="Normal"]=0,k[_[1]="Meeting"]=1,k[_[2]="Live"]=2,k}(),E.QuitNotifyCode=function(){const _={},k=Object.create(_);return k[_[0]="NormalQuit"]=0,k[_[2021]="Timeout"]=2021,k[_[2011]="TokenExpired"]=2011,k[_[2022]="KickOut"]=2022,k[_[2023]="EndPk"]=2023,k[_[2024]="EndLive"]=2024,k}(),E.UserBehavior=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.type=0,_.prototype.behavior=!1,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&n.uint32(8).int32(e.type),e.behavior!=null&&Object.hasOwnProperty.call(e,"behavior")&&n.uint32(16).bool(e.behavior),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.UserBehavior;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.type=e.int32();break}case 2:{$.behavior=e.bool();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.UserBehavior;switch(e.type){default:if(typeof e.type=="number"){n.type=e.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 e.behavior!=null&&(n.behavior=!!e.behavior),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.type=n.enums===String?"Microphone":0,O.behavior=!1),e.type!=null&&e.hasOwnProperty("type")&&(O.type=n.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")&&(O.behavior=e.behavior),O},_.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"},_}(),E.PreventUser=function(){function _(k){if(this.behaviors=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.id="",_.prototype.behaviors=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.id!=null&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),e.behaviors!=null&&e.behaviors.length)for(let O=0;O<e.behaviors.length;++O)$root.com.quick.voice.proto.UserBehavior.encode(e.behaviors[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.PreventUser;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.id=e.string();break}case 2:{$.behaviors&&$.behaviors.length||($.behaviors=[]),$.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.behaviors.length;++n){let O=$root.com.quick.voice.proto.UserBehavior.verify(e.behaviors[n]);if(O)return"behaviors."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUser)return e;let n=new $root.com.quick.voice.proto.PreventUser;if(e.id!=null&&(n.id=String(e.id)),e.behaviors){if(!Array.isArray(e.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");n.behaviors=[];for(let O=0;O<e.behaviors.length;++O){if(typeof e.behaviors[O]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");n.behaviors[O]=$root.com.quick.voice.proto.UserBehavior.fromObject(e.behaviors[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.behaviors=[]),n.defaults&&(O.id=""),e.id!=null&&e.hasOwnProperty("id")&&(O.id=e.id),e.behaviors&&e.behaviors.length){O.behaviors=[];for(let $=0;$<e.behaviors.length;++$)O.behaviors[$]=$root.com.quick.voice.proto.UserBehavior.toObject(e.behaviors[$],n)}return O},_.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"},_}(),E.PreventUsersBehaviorReq=function(){function _(k){if(this.users=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.users=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let O=0;O<e.users.length;++O)$root.com.quick.voice.proto.PreventUser.encode(e.users[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.users&&$.users.length||($.users=[]),$.users.push($root.com.quick.voice.proto.PreventUser.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.users.length;++n){let O=$root.com.quick.voice.proto.PreventUser.verify(e.users[n]);if(O)return"users."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return e;let n=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");n.users=[];for(let O=0;O<e.users.length;++O){if(typeof e.users[O]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");n.users[O]=$root.com.quick.voice.proto.PreventUser.fromObject(e.users[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.users=[]),n.defaults&&(O.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.users&&e.users.length){O.users=[];for(let $=0;$<e.users.length;++$)O.users[$]=$root.com.quick.voice.proto.PreventUser.toObject(e.users[$],n)}return O},_.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"},_}(),E.PreventUsersBehaviorNotify=function(){function _(k){if(this.users=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.users=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let O=0;O<e.users.length;++O)$root.com.quick.voice.proto.User.encode(e.users[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.users&&$.users.length||($.users=[]),$.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.users.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.users[n]);if(O)return"users."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return e;let n=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");n.users=[];for(let O=0;O<e.users.length;++O){if(typeof e.users[O]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");n.users[O]=$root.com.quick.voice.proto.User.fromObject(e.users[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.users=[]),n.defaults&&(O.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.users&&e.users.length){O.users=[];for(let $=0;$<e.users.length;++$)O.users[$]=$root.com.quick.voice.proto.User.toObject(e.users[$],n)}return O},_.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"},_}(),E.AccelerationAreas=function(){const _={},k=Object.create(_);return k[_[0]="chinaMainland"]=0,k[_[1]="global"]=1,k[_[2]="overseas"]=2,k}(),E.CountMethods=function(){const _={},k=Object.create(_);return k[_[0]="flow"]=0,k[_[1]="minutes"]=1,k}(),E.BaseCDNAddress=function(){function _(k){if(this.urlMap={},k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.area=0,_.prototype.countType=0,_.prototype.urlMap=$util.emptyObject,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.area!=null&&Object.hasOwnProperty.call(e,"area")&&n.uint32(8).int32(e.area),e.countType!=null&&Object.hasOwnProperty.call(e,"countType")&&n.uint32(16).int32(e.countType),e.urlMap!=null&&Object.hasOwnProperty.call(e,"urlMap"))for(let O=Object.keys(e.urlMap),$=0;$<O.length;++$)n.uint32(26).fork().uint32(10).string(O[$]).uint32(18).string(e.urlMap[O[$]]).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.BaseCDNAddress,N,D;for(;e.pos<O;){let q=e.uint32();switch(q>>>3){case 1:{$.area=e.int32();break}case 2:{$.countType=e.int32();break}case 3:{$.urlMap===$util.emptyObject&&($.urlMap={});let P=e.uint32()+e.pos;for(N="",D="";e.pos<P;){let j=e.uint32();switch(j>>>3){case 1:N=e.string();break;case 2:D=e.string();break;default:e.skipType(j&7);break}}$.urlMap[N]=D;break}default:e.skipType(q&7);break}}return $},_.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 n=Object.keys(e.urlMap);for(let O=0;O<n.length;++O)if(!$util.isString(e.urlMap[n[O]]))return"urlMap: string{k:string} expected"}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.BaseCDNAddress)return e;let n=new $root.com.quick.voice.proto.BaseCDNAddress;switch(e.area){default:if(typeof e.area=="number"){n.area=e.area;break}break;case"chinaMainland":case 0:n.area=0;break;case"global":case 1:n.area=1;break;case"overseas":case 2:n.area=2;break}switch(e.countType){default:if(typeof e.countType=="number"){n.countType=e.countType;break}break;case"flow":case 0:n.countType=0;break;case"minutes":case 1:n.countType=1;break}if(e.urlMap){if(typeof e.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");n.urlMap={};for(let O=Object.keys(e.urlMap),$=0;$<O.length;++$)n.urlMap[O[$]]=String(e.urlMap[O[$]])}return n},_.toObject=function(e,n){n||(n={});let O={};(n.objects||n.defaults)&&(O.urlMap={}),n.defaults&&(O.area=n.enums===String?"chinaMainland":0,O.countType=n.enums===String?"flow":0),e.area!=null&&e.hasOwnProperty("area")&&(O.area=n.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")&&(O.countType=n.enums===String?$root.com.quick.voice.proto.CountMethods[e.countType]===void 0?e.countType:$root.com.quick.voice.proto.CountMethods[e.countType]:e.countType);let $;if(e.urlMap&&($=Object.keys(e.urlMap)).length){O.urlMap={};for(let N=0;N<$.length;++N)O.urlMap[$[N]]=e.urlMap[$[N]]}return O},_.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"},_}(),E.CDNPlayAddressNotify=function(){function _(e){if(this.standLines=[],e)for(let n=Object.keys(e),O=0;O<n.length;++O)e[n[O]]!=null&&(this[n[O]]=e[n[O]])}_.prototype.roomId="",_.prototype.m3u8=null,_.prototype.rtmp=null,_.prototype.flv=null,_.prototype.rtmps=null,_.prototype.mainLine=null,_.prototype.standLines=$util.emptyArray;let k;return Object.defineProperty(_.prototype,"_m3u8",{get:$util.oneOfGetter(k=["m3u8"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_rtmp",{get:$util.oneOfGetter(k=["rtmp"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_flv",{get:$util.oneOfGetter(k=["flv"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_rtmps",{get:$util.oneOfGetter(k=["rtmps"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_mainLine",{get:$util.oneOfGetter(k=["mainLine"]),set:$util.oneOfSetter(k)}),_.create=function(n){return new _(n)},_.encode=function(n,O){if(O||(O=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&O.uint32(10).string(n.roomId),n.m3u8!=null&&Object.hasOwnProperty.call(n,"m3u8")&&O.uint32(18).string(n.m3u8),n.rtmp!=null&&Object.hasOwnProperty.call(n,"rtmp")&&O.uint32(26).string(n.rtmp),n.flv!=null&&Object.hasOwnProperty.call(n,"flv")&&O.uint32(34).string(n.flv),n.rtmps!=null&&Object.hasOwnProperty.call(n,"rtmps")&&O.uint32(42).string(n.rtmps),n.mainLine!=null&&Object.hasOwnProperty.call(n,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(n.mainLine,O.uint32(50).fork()).ldelim(),n.standLines!=null&&n.standLines.length)for(let $=0;$<n.standLines.length;++$)$root.com.quick.voice.proto.BaseCDNAddress.encode(n.standLines[$],O.uint32(58).fork()).ldelim();return O},_.encodeDelimited=function(n,O){return this.encode(n,O).ldelim()},_.decode=function(n,O){n instanceof $Reader||(n=$Reader.create(n));let $=O===void 0?n.len:n.pos+O,N=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;n.pos<$;){let D=n.uint32();switch(D>>>3){case 1:{N.roomId=n.string();break}case 2:{N.m3u8=n.string();break}case 3:{N.rtmp=n.string();break}case 4:{N.flv=n.string();break}case 5:{N.rtmps=n.string();break}case 6:{N.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(n,n.uint32());break}case 7:{N.standLines&&N.standLines.length||(N.standLines=[]),N.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(n,n.uint32()));break}default:n.skipType(D&7);break}}return N},_.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},_.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.m3u8!=null&&n.hasOwnProperty("m3u8")&&!$util.isString(n.m3u8))return"m3u8: string expected";if(n.rtmp!=null&&n.hasOwnProperty("rtmp")&&!$util.isString(n.rtmp))return"rtmp: string expected";if(n.flv!=null&&n.hasOwnProperty("flv")&&!$util.isString(n.flv))return"flv: string expected";if(n.rtmps!=null&&n.hasOwnProperty("rtmps")&&!$util.isString(n.rtmps))return"rtmps: string expected";if(n.mainLine!=null&&n.hasOwnProperty("mainLine")){let O=$root.com.quick.voice.proto.BaseCDNAddress.verify(n.mainLine);if(O)return"mainLine."+O}if(n.standLines!=null&&n.hasOwnProperty("standLines")){if(!Array.isArray(n.standLines))return"standLines: array expected";for(let O=0;O<n.standLines.length;++O){let $=$root.com.quick.voice.proto.BaseCDNAddress.verify(n.standLines[O]);if($)return"standLines."+$}}return null},_.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return n;let O=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(n.roomId!=null&&(O.roomId=String(n.roomId)),n.m3u8!=null&&(O.m3u8=String(n.m3u8)),n.rtmp!=null&&(O.rtmp=String(n.rtmp)),n.flv!=null&&(O.flv=String(n.flv)),n.rtmps!=null&&(O.rtmps=String(n.rtmps)),n.mainLine!=null){if(typeof n.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");O.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(n.mainLine)}if(n.standLines){if(!Array.isArray(n.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");O.standLines=[];for(let $=0;$<n.standLines.length;++$){if(typeof n.standLines[$]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");O.standLines[$]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(n.standLines[$])}}return O},_.toObject=function(n,O){O||(O={});let $={};if((O.arrays||O.defaults)&&($.standLines=[]),O.defaults&&($.roomId=""),n.roomId!=null&&n.hasOwnProperty("roomId")&&($.roomId=n.roomId),n.m3u8!=null&&n.hasOwnProperty("m3u8")&&($.m3u8=n.m3u8,O.oneofs&&($._m3u8="m3u8")),n.rtmp!=null&&n.hasOwnProperty("rtmp")&&($.rtmp=n.rtmp,O.oneofs&&($._rtmp="rtmp")),n.flv!=null&&n.hasOwnProperty("flv")&&($.flv=n.flv,O.oneofs&&($._flv="flv")),n.rtmps!=null&&n.hasOwnProperty("rtmps")&&($.rtmps=n.rtmps,O.oneofs&&($._rtmps="rtmps")),n.mainLine!=null&&n.hasOwnProperty("mainLine")&&($.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(n.mainLine,O),O.oneofs&&($._mainLine="mainLine")),n.standLines&&n.standLines.length){$.standLines=[];for(let N=0;N<n.standLines.length;++N)$.standLines[N]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(n.standLines[N],O)}return $},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.CDNPlayAddressNotify"},_}(),E}(),u}(),I}(),a})(),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销毁"};pt(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(a){let I=a.length;for(;--I>=0;)a[I]=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(a,I,u,E,_){this.static_tree=a,this.extra_bits=I,this.extra_base=u,this.elems=E,this.max_length=_,this.has_stree=a&&a.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(a,I){this.dyn_tree=a,this.max_code=0,this.stat_desc=I}const d_code=a=>a<256?_dist_code[a]:_dist_code[256+(a>>>7)],put_short=(a,I)=>{a.pending_buf[a.pending++]=I&255,a.pending_buf[a.pending++]=I>>>8&255},send_bits=(a,I,u)=>{a.bi_valid>Buf_size-u?(a.bi_buf|=I<<a.bi_valid&65535,put_short(a,a.bi_buf),a.bi_buf=I>>Buf_size-a.bi_valid,a.bi_valid+=u-Buf_size):(a.bi_buf|=I<<a.bi_valid&65535,a.bi_valid+=u)},send_code=(a,I,u)=>{send_bits(a,u[I*2],u[I*2+1])},bi_reverse=(a,I)=>{let u=0;do u|=a&1,a>>>=1,u<<=1;while(--I>0);return u>>>1},bi_flush=a=>{a.bi_valid===16?(put_short(a,a.bi_buf),a.bi_buf=0,a.bi_valid=0):a.bi_valid>=8&&(a.pending_buf[a.pending++]=a.bi_buf&255,a.bi_buf>>=8,a.bi_valid-=8)},gen_bitlen=(a,I)=>{const u=I.dyn_tree,E=I.max_code,_=I.stat_desc.static_tree,k=I.stat_desc.has_stree,e=I.stat_desc.extra_bits,n=I.stat_desc.extra_base,O=I.stat_desc.max_length;let $,N,D,q,P,j,Q=0;for(q=0;q<=MAX_BITS$1;q++)a.bl_count[q]=0;for(u[a.heap[a.heap_max]*2+1]=0,$=a.heap_max+1;$<HEAP_SIZE$1;$++)N=a.heap[$],q=u[u[N*2+1]*2+1]+1,q>O&&(q=O,Q++),u[N*2+1]=q,!(N>E)&&(a.bl_count[q]++,P=0,N>=n&&(P=e[N-n]),j=u[N*2],a.opt_len+=j*(q+P),k&&(a.static_len+=j*(_[N*2+1]+P)));if(Q!==0){do{for(q=O-1;a.bl_count[q]===0;)q--;a.bl_count[q]--,a.bl_count[q+1]+=2,a.bl_count[O]--,Q-=2}while(Q>0);for(q=O;q!==0;q--)for(N=a.bl_count[q];N!==0;)D=a.heap[--$],!(D>E)&&(u[D*2+1]!==q&&(a.opt_len+=(q-u[D*2+1])*u[D*2],u[D*2+1]=q),N--)}},gen_codes=(a,I,u)=>{const E=new Array(MAX_BITS$1+1);let _=0,k,e;for(k=1;k<=MAX_BITS$1;k++)_=_+u[k-1]<<1,E[k]=_;for(e=0;e<=I;e++){let n=a[e*2+1];n!==0&&(a[e*2]=bi_reverse(E[n]++,n))}},tr_static_init=()=>{let a,I,u,E,_;const k=new Array(MAX_BITS$1+1);for(u=0,E=0;E<LENGTH_CODES$1-1;E++)for(base_length[E]=u,a=0;a<1<<extra_lbits[E];a++)_length_code[u++]=E;for(_length_code[u-1]=E,_=0,E=0;E<16;E++)for(base_dist[E]=_,a=0;a<1<<extra_dbits[E];a++)_dist_code[_++]=E;for(_>>=7;E<D_CODES$1;E++)for(base_dist[E]=_<<7,a=0;a<1<<extra_dbits[E]-7;a++)_dist_code[256+_++]=E;for(I=0;I<=MAX_BITS$1;I++)k[I]=0;for(a=0;a<=143;)static_ltree[a*2+1]=8,a++,k[8]++;for(;a<=255;)static_ltree[a*2+1]=9,a++,k[9]++;for(;a<=279;)static_ltree[a*2+1]=7,a++,k[7]++;for(;a<=287;)static_ltree[a*2+1]=8,a++,k[8]++;for(gen_codes(static_ltree,L_CODES$1+1,k),a=0;a<D_CODES$1;a++)static_dtree[a*2+1]=5,static_dtree[a*2]=bi_reverse(a,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=a=>{let I;for(I=0;I<L_CODES$1;I++)a.dyn_ltree[I*2]=0;for(I=0;I<D_CODES$1;I++)a.dyn_dtree[I*2]=0;for(I=0;I<BL_CODES$1;I++)a.bl_tree[I*2]=0;a.dyn_ltree[END_BLOCK*2]=1,a.opt_len=a.static_len=0,a.sym_next=a.matches=0},bi_windup=a=>{a.bi_valid>8?put_short(a,a.bi_buf):a.bi_valid>0&&(a.pending_buf[a.pending++]=a.bi_buf),a.bi_buf=0,a.bi_valid=0},smaller=(a,I,u,E)=>{const _=I*2,k=u*2;return a[_]<a[k]||a[_]===a[k]&&E[I]<=E[u]},pqdownheap=(a,I,u)=>{const E=a.heap[u];let _=u<<1;for(;_<=a.heap_len&&(_<a.heap_len&&smaller(I,a.heap[_+1],a.heap[_],a.depth)&&_++,!smaller(I,E,a.heap[_],a.depth));)a.heap[u]=a.heap[_],u=_,_<<=1;a.heap[u]=E},compress_block=(a,I,u)=>{let E,_,k=0,e,n;if(a.sym_next!==0)do E=a.pending_buf[a.sym_buf+k++]&255,E+=(a.pending_buf[a.sym_buf+k++]&255)<<8,_=a.pending_buf[a.sym_buf+k++],E===0?send_code(a,_,I):(e=_length_code[_],send_code(a,e+LITERALS$1+1,I),n=extra_lbits[e],n!==0&&(_-=base_length[e],send_bits(a,_,n)),E--,e=d_code(E),send_code(a,e,u),n=extra_dbits[e],n!==0&&(E-=base_dist[e],send_bits(a,E,n)));while(k<a.sym_next);send_code(a,END_BLOCK,I)},build_tree=(a,I)=>{const u=I.dyn_tree,E=I.stat_desc.static_tree,_=I.stat_desc.has_stree,k=I.stat_desc.elems;let e,n,O=-1,$;for(a.heap_len=0,a.heap_max=HEAP_SIZE$1,e=0;e<k;e++)u[e*2]!==0?(a.heap[++a.heap_len]=O=e,a.depth[e]=0):u[e*2+1]=0;for(;a.heap_len<2;)$=a.heap[++a.heap_len]=O<2?++O:0,u[$*2]=1,a.depth[$]=0,a.opt_len--,_&&(a.static_len-=E[$*2+1]);for(I.max_code=O,e=a.heap_len>>1;e>=1;e--)pqdownheap(a,u,e);$=k;do e=a.heap[1],a.heap[1]=a.heap[a.heap_len--],pqdownheap(a,u,1),n=a.heap[1],a.heap[--a.heap_max]=e,a.heap[--a.heap_max]=n,u[$*2]=u[e*2]+u[n*2],a.depth[$]=(a.depth[e]>=a.depth[n]?a.depth[e]:a.depth[n])+1,u[e*2+1]=u[n*2+1]=$,a.heap[1]=$++,pqdownheap(a,u,1);while(a.heap_len>=2);a.heap[--a.heap_max]=a.heap[1],gen_bitlen(a,I),gen_codes(u,O,a.bl_count)},scan_tree=(a,I,u)=>{let E,_=-1,k,e=I[0*2+1],n=0,O=7,$=4;for(e===0&&(O=138,$=3),I[(u+1)*2+1]=65535,E=0;E<=u;E++)k=e,e=I[(E+1)*2+1],!(++n<O&&k===e)&&(n<$?a.bl_tree[k*2]+=n:k!==0?(k!==_&&a.bl_tree[k*2]++,a.bl_tree[REP_3_6*2]++):n<=10?a.bl_tree[REPZ_3_10*2]++:a.bl_tree[REPZ_11_138*2]++,n=0,_=k,e===0?(O=138,$=3):k===e?(O=6,$=3):(O=7,$=4))},send_tree=(a,I,u)=>{let E,_=-1,k,e=I[0*2+1],n=0,O=7,$=4;for(e===0&&(O=138,$=3),E=0;E<=u;E++)if(k=e,e=I[(E+1)*2+1],!(++n<O&&k===e)){if(n<$)do send_code(a,k,a.bl_tree);while(--n!==0);else k!==0?(k!==_&&(send_code(a,k,a.bl_tree),n--),send_code(a,REP_3_6,a.bl_tree),send_bits(a,n-3,2)):n<=10?(send_code(a,REPZ_3_10,a.bl_tree),send_bits(a,n-3,3)):(send_code(a,REPZ_11_138,a.bl_tree),send_bits(a,n-11,7));n=0,_=k,e===0?(O=138,$=3):k===e?(O=6,$=3):(O=7,$=4)}},build_bl_tree=a=>{let I;for(scan_tree(a,a.dyn_ltree,a.l_desc.max_code),scan_tree(a,a.dyn_dtree,a.d_desc.max_code),build_tree(a,a.bl_desc),I=BL_CODES$1-1;I>=3&&a.bl_tree[bl_order[I]*2+1]===0;I--);return a.opt_len+=3*(I+1)+5+5+4,I},send_all_trees=(a,I,u,E)=>{let _;for(send_bits(a,I-257,5),send_bits(a,u-1,5),send_bits(a,E-4,4),_=0;_<E;_++)send_bits(a,a.bl_tree[bl_order[_]*2+1],3);send_tree(a,a.dyn_ltree,I-1),send_tree(a,a.dyn_dtree,u-1)},detect_data_type=a=>{let I=4093624447,u;for(u=0;u<=31;u++,I>>>=1)if(I&1&&a.dyn_ltree[u*2]!==0)return Z_BINARY;if(a.dyn_ltree[9*2]!==0||a.dyn_ltree[10*2]!==0||a.dyn_ltree[13*2]!==0)return Z_TEXT;for(u=32;u<LITERALS$1;u++)if(a.dyn_ltree[u*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=a=>{static_init_done||(tr_static_init(),static_init_done=!0),a.l_desc=new TreeDesc(a.dyn_ltree,static_l_desc),a.d_desc=new TreeDesc(a.dyn_dtree,static_d_desc),a.bl_desc=new TreeDesc(a.bl_tree,static_bl_desc),a.bi_buf=0,a.bi_valid=0,init_block(a)},_tr_stored_block$1=(a,I,u,E)=>{send_bits(a,(STORED_BLOCK<<1)+(E?1:0),3),bi_windup(a),put_short(a,u),put_short(a,~u),u&&a.pending_buf.set(a.window.subarray(I,I+u),a.pending),a.pending+=u},_tr_align$1=a=>{send_bits(a,STATIC_TREES<<1,3),send_code(a,END_BLOCK,static_ltree),bi_flush(a)},_tr_flush_block$1=(a,I,u,E)=>{let _,k,e=0;a.level>0?(a.strm.data_type===Z_UNKNOWN$1&&(a.strm.data_type=detect_data_type(a)),build_tree(a,a.l_desc),build_tree(a,a.d_desc),e=build_bl_tree(a),_=a.opt_len+3+7>>>3,k=a.static_len+3+7>>>3,k<=_&&(_=k)):_=k=u+5,u+4<=_&&I!==-1?_tr_stored_block$1(a,I,u,E):a.strategy===Z_FIXED$1||k===_?(send_bits(a,(STATIC_TREES<<1)+(E?1:0),3),compress_block(a,static_ltree,static_dtree)):(send_bits(a,(DYN_TREES<<1)+(E?1:0),3),send_all_trees(a,a.l_desc.max_code+1,a.d_desc.max_code+1,e+1),compress_block(a,a.dyn_ltree,a.dyn_dtree)),init_block(a),E&&bi_windup(a)},_tr_tally$1=(a,I,u)=>(a.pending_buf[a.sym_buf+a.sym_next++]=I,a.pending_buf[a.sym_buf+a.sym_next++]=I>>8,a.pending_buf[a.sym_buf+a.sym_next++]=u,I===0?a.dyn_ltree[u*2]++:(a.matches++,I--,a.dyn_ltree[(_length_code[u]+LITERALS$1+1)*2]++,a.dyn_dtree[d_code(I)*2]++),a.sym_next===a.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=(a,I,u,E)=>{let _=a&65535|0,k=a>>>16&65535|0,e=0;for(;u!==0;){e=u>2e3?2e3:u,u-=e;do _=_+I[E++]|0,k=k+_|0;while(--e);_%=65521,k%=65521}return _|k<<16|0};var adler32_1=adler32;const makeTable=()=>{let a,I=[];for(var u=0;u<256;u++){a=u;for(var E=0;E<8;E++)a=a&1?3988292384^a>>>1:a>>>1;I[u]=a}return I},crcTable=new Uint32Array(makeTable()),crc32=(a,I,u,E)=>{const _=crcTable,k=E+u;a^=-1;for(let e=E;e<k;e++)a=a>>>8^_[(a^I[e])&255];return a^-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=(a,I)=>(a.msg=messages[I],I),rank=a=>a*2-(a>4?9:0),zero=a=>{let I=a.length;for(;--I>=0;)a[I]=0},slide_hash=a=>{let I,u,E,_=a.w_size;I=a.hash_size,E=I;do u=a.head[--E],a.head[E]=u>=_?u-_:0;while(--I);I=_,E=I;do u=a.prev[--E],a.prev[E]=u>=_?u-_:0;while(--I)};let HASH_ZLIB=(a,I,u)=>(I<<a.hash_shift^u)&a.hash_mask,HASH=HASH_ZLIB;const flush_pending=a=>{const I=a.state;let u=I.pending;u>a.avail_out&&(u=a.avail_out),u!==0&&(a.output.set(I.pending_buf.subarray(I.pending_out,I.pending_out+u),a.next_out),a.next_out+=u,I.pending_out+=u,a.total_out+=u,a.avail_out-=u,I.pending-=u,I.pending===0&&(I.pending_out=0))},flush_block_only=(a,I)=>{_tr_flush_block(a,a.block_start>=0?a.block_start:-1,a.strstart-a.block_start,I),a.block_start=a.strstart,flush_pending(a.strm)},put_byte=(a,I)=>{a.pending_buf[a.pending++]=I},putShortMSB=(a,I)=>{a.pending_buf[a.pending++]=I>>>8&255,a.pending_buf[a.pending++]=I&255},read_buf=(a,I,u,E)=>{let _=a.avail_in;return _>E&&(_=E),_===0?0:(a.avail_in-=_,I.set(a.input.subarray(a.next_in,a.next_in+_),u),a.state.wrap===1?a.adler=adler32_1(a.adler,I,_,u):a.state.wrap===2&&(a.adler=crc32_1(a.adler,I,_,u)),a.next_in+=_,a.total_in+=_,_)},longest_match=(a,I)=>{let u=a.max_chain_length,E=a.strstart,_,k,e=a.prev_length,n=a.nice_match;const O=a.strstart>a.w_size-MIN_LOOKAHEAD?a.strstart-(a.w_size-MIN_LOOKAHEAD):0,$=a.window,N=a.w_mask,D=a.prev,q=a.strstart+MAX_MATCH;let P=$[E+e-1],j=$[E+e];a.prev_length>=a.good_match&&(u>>=2),n>a.lookahead&&(n=a.lookahead);do if(_=I,!($[_+e]!==j||$[_+e-1]!==P||$[_]!==$[E]||$[++_]!==$[E+1])){E+=2,_++;do;while($[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&E<q);if(k=MAX_MATCH-(q-E),E=q-MAX_MATCH,k>e){if(a.match_start=I,e=k,k>=n)break;P=$[E+e-1],j=$[E+e]}}while((I=D[I&N])>O&&--u!==0);return e<=a.lookahead?e:a.lookahead},fill_window=a=>{const I=a.w_size;let u,E,_;do{if(E=a.window_size-a.lookahead-a.strstart,a.strstart>=I+(I-MIN_LOOKAHEAD)&&(a.window.set(a.window.subarray(I,I+I-E),0),a.match_start-=I,a.strstart-=I,a.block_start-=I,a.insert>a.strstart&&(a.insert=a.strstart),slide_hash(a),E+=I),a.strm.avail_in===0)break;if(u=read_buf(a.strm,a.window,a.strstart+a.lookahead,E),a.lookahead+=u,a.lookahead+a.insert>=MIN_MATCH)for(_=a.strstart-a.insert,a.ins_h=a.window[_],a.ins_h=HASH(a,a.ins_h,a.window[_+1]);a.insert&&(a.ins_h=HASH(a,a.ins_h,a.window[_+MIN_MATCH-1]),a.prev[_&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=_,_++,a.insert--,!(a.lookahead+a.insert<MIN_MATCH)););}while(a.lookahead<MIN_LOOKAHEAD&&a.strm.avail_in!==0)},deflate_stored=(a,I)=>{let u=a.pending_buf_size-5>a.w_size?a.w_size:a.pending_buf_size-5,E,_,k,e=0,n=a.strm.avail_in;do{if(E=65535,k=a.bi_valid+42>>3,a.strm.avail_out<k||(k=a.strm.avail_out-k,_=a.strstart-a.block_start,E>_+a.strm.avail_in&&(E=_+a.strm.avail_in),E>k&&(E=k),E<u&&(E===0&&I!==Z_FINISH$3||I===Z_NO_FLUSH$2||E!==_+a.strm.avail_in)))break;e=I===Z_FINISH$3&&E===_+a.strm.avail_in?1:0,_tr_stored_block(a,0,0,e),a.pending_buf[a.pending-4]=E,a.pending_buf[a.pending-3]=E>>8,a.pending_buf[a.pending-2]=~E,a.pending_buf[a.pending-1]=~E>>8,flush_pending(a.strm),_&&(_>E&&(_=E),a.strm.output.set(a.window.subarray(a.block_start,a.block_start+_),a.strm.next_out),a.strm.next_out+=_,a.strm.avail_out-=_,a.strm.total_out+=_,a.block_start+=_,E-=_),E&&(read_buf(a.strm,a.strm.output,a.strm.next_out,E),a.strm.next_out+=E,a.strm.avail_out-=E,a.strm.total_out+=E)}while(e===0);return n-=a.strm.avail_in,n&&(n>=a.w_size?(a.matches=2,a.window.set(a.strm.input.subarray(a.strm.next_in-a.w_size,a.strm.next_in),0),a.strstart=a.w_size,a.insert=a.strstart):(a.window_size-a.strstart<=n&&(a.strstart-=a.w_size,a.window.set(a.window.subarray(a.w_size,a.w_size+a.strstart),0),a.matches<2&&a.matches++,a.insert>a.strstart&&(a.insert=a.strstart)),a.window.set(a.strm.input.subarray(a.strm.next_in-n,a.strm.next_in),a.strstart),a.strstart+=n,a.insert+=n>a.w_size-a.insert?a.w_size-a.insert:n),a.block_start=a.strstart),a.high_water<a.strstart&&(a.high_water=a.strstart),e?BS_FINISH_DONE:I!==Z_NO_FLUSH$2&&I!==Z_FINISH$3&&a.strm.avail_in===0&&a.strstart===a.block_start?BS_BLOCK_DONE:(k=a.window_size-a.strstart,a.strm.avail_in>k&&a.block_start>=a.w_size&&(a.block_start-=a.w_size,a.strstart-=a.w_size,a.window.set(a.window.subarray(a.w_size,a.w_size+a.strstart),0),a.matches<2&&a.matches++,k+=a.w_size,a.insert>a.strstart&&(a.insert=a.strstart)),k>a.strm.avail_in&&(k=a.strm.avail_in),k&&(read_buf(a.strm,a.window,a.strstart,k),a.strstart+=k,a.insert+=k>a.w_size-a.insert?a.w_size-a.insert:k),a.high_water<a.strstart&&(a.high_water=a.strstart),k=a.bi_valid+42>>3,k=a.pending_buf_size-k>65535?65535:a.pending_buf_size-k,u=k>a.w_size?a.w_size:k,_=a.strstart-a.block_start,(_>=u||(_||I===Z_FINISH$3)&&I!==Z_NO_FLUSH$2&&a.strm.avail_in===0&&_<=k)&&(E=_>k?k:_,e=I===Z_FINISH$3&&a.strm.avail_in===0&&E===_?1:0,_tr_stored_block(a,a.block_start,E,e),a.block_start+=E,flush_pending(a.strm)),e?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(a,I)=>{let u,E;for(;;){if(a.lookahead<MIN_LOOKAHEAD){if(fill_window(a),a.lookahead<MIN_LOOKAHEAD&&I===Z_NO_FLUSH$2)return BS_NEED_MORE;if(a.lookahead===0)break}if(u=0,a.lookahead>=MIN_MATCH&&(a.ins_h=HASH(a,a.ins_h,a.window[a.strstart+MIN_MATCH-1]),u=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),u!==0&&a.strstart-u<=a.w_size-MIN_LOOKAHEAD&&(a.match_length=longest_match(a,u)),a.match_length>=MIN_MATCH)if(E=_tr_tally(a,a.strstart-a.match_start,a.match_length-MIN_MATCH),a.lookahead-=a.match_length,a.match_length<=a.max_lazy_match&&a.lookahead>=MIN_MATCH){a.match_length--;do a.strstart++,a.ins_h=HASH(a,a.ins_h,a.window[a.strstart+MIN_MATCH-1]),u=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart;while(--a.match_length!==0);a.strstart++}else a.strstart+=a.match_length,a.match_length=0,a.ins_h=a.window[a.strstart],a.ins_h=HASH(a,a.ins_h,a.window[a.strstart+1]);else E=_tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++;if(E&&(flush_block_only(a,!1),a.strm.avail_out===0))return BS_NEED_MORE}return a.insert=a.strstart<MIN_MATCH-1?a.strstart:MIN_MATCH-1,I===Z_FINISH$3?(flush_block_only(a,!0),a.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):a.sym_next&&(flush_block_only(a,!1),a.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(a,I)=>{let u,E,_;for(;;){if(a.lookahead<MIN_LOOKAHEAD){if(fill_window(a),a.lookahead<MIN_LOOKAHEAD&&I===Z_NO_FLUSH$2)return BS_NEED_MORE;if(a.lookahead===0)break}if(u=0,a.lookahead>=MIN_MATCH&&(a.ins_h=HASH(a,a.ins_h,a.window[a.strstart+MIN_MATCH-1]),u=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),a.prev_length=a.match_length,a.prev_match=a.match_start,a.match_length=MIN_MATCH-1,u!==0&&a.prev_length<a.max_lazy_match&&a.strstart-u<=a.w_size-MIN_LOOKAHEAD&&(a.match_length=longest_match(a,u),a.match_length<=5&&(a.strategy===Z_FILTERED||a.match_length===MIN_MATCH&&a.strstart-a.match_start>4096)&&(a.match_length=MIN_MATCH-1)),a.prev_length>=MIN_MATCH&&a.match_length<=a.prev_length){_=a.strstart+a.lookahead-MIN_MATCH,E=_tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-MIN_MATCH),a.lookahead-=a.prev_length-1,a.prev_length-=2;do++a.strstart<=_&&(a.ins_h=HASH(a,a.ins_h,a.window[a.strstart+MIN_MATCH-1]),u=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);while(--a.prev_length!==0);if(a.match_available=0,a.match_length=MIN_MATCH-1,a.strstart++,E&&(flush_block_only(a,!1),a.strm.avail_out===0))return BS_NEED_MORE}else if(a.match_available){if(E=_tr_tally(a,0,a.window[a.strstart-1]),E&&flush_block_only(a,!1),a.strstart++,a.lookahead--,a.strm.avail_out===0)return BS_NEED_MORE}else a.match_available=1,a.strstart++,a.lookahead--}return a.match_available&&(E=_tr_tally(a,0,a.window[a.strstart-1]),a.match_available=0),a.insert=a.strstart<MIN_MATCH-1?a.strstart:MIN_MATCH-1,I===Z_FINISH$3?(flush_block_only(a,!0),a.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):a.sym_next&&(flush_block_only(a,!1),a.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(a,I)=>{let u,E,_,k;const e=a.window;for(;;){if(a.lookahead<=MAX_MATCH){if(fill_window(a),a.lookahead<=MAX_MATCH&&I===Z_NO_FLUSH$2)return BS_NEED_MORE;if(a.lookahead===0)break}if(a.match_length=0,a.lookahead>=MIN_MATCH&&a.strstart>0&&(_=a.strstart-1,E=e[_],E===e[++_]&&E===e[++_]&&E===e[++_])){k=a.strstart+MAX_MATCH;do;while(E===e[++_]&&E===e[++_]&&E===e[++_]&&E===e[++_]&&E===e[++_]&&E===e[++_]&&E===e[++_]&&E===e[++_]&&_<k);a.match_length=MAX_MATCH-(k-_),a.match_length>a.lookahead&&(a.match_length=a.lookahead)}if(a.match_length>=MIN_MATCH?(u=_tr_tally(a,1,a.match_length-MIN_MATCH),a.lookahead-=a.match_length,a.strstart+=a.match_length,a.match_length=0):(u=_tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++),u&&(flush_block_only(a,!1),a.strm.avail_out===0))return BS_NEED_MORE}return a.insert=0,I===Z_FINISH$3?(flush_block_only(a,!0),a.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):a.sym_next&&(flush_block_only(a,!1),a.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(a,I)=>{let u;for(;;){if(a.lookahead===0&&(fill_window(a),a.lookahead===0)){if(I===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(a.match_length=0,u=_tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++,u&&(flush_block_only(a,!1),a.strm.avail_out===0))return BS_NEED_MORE}return a.insert=0,I===Z_FINISH$3?(flush_block_only(a,!0),a.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):a.sym_next&&(flush_block_only(a,!1),a.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(a,I,u,E,_){this.good_length=a,this.max_lazy=I,this.nice_length=u,this.max_chain=E,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=a=>{a.window_size=2*a.w_size,zero(a.head),a.max_lazy_match=configuration_table[a.level].max_lazy,a.good_match=configuration_table[a.level].good_length,a.nice_match=configuration_table[a.level].nice_length,a.max_chain_length=configuration_table[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=MIN_MATCH-1,a.match_available=0,a.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=a=>{if(!a)return 1;const I=a.state;return!I||I.strm!==a||I.status!==INIT_STATE&&I.status!==GZIP_STATE&&I.status!==EXTRA_STATE&&I.status!==NAME_STATE&&I.status!==COMMENT_STATE&&I.status!==HCRC_STATE&&I.status!==BUSY_STATE&&I.status!==FINISH_STATE?1:0},deflateResetKeep=a=>{if(deflateStateCheck(a))return err(a,Z_STREAM_ERROR$2);a.total_in=a.total_out=0,a.data_type=Z_UNKNOWN;const I=a.state;return I.pending=0,I.pending_out=0,I.wrap<0&&(I.wrap=-I.wrap),I.status=I.wrap===2?GZIP_STATE:I.wrap?INIT_STATE:BUSY_STATE,a.adler=I.wrap===2?0:1,I.last_flush=-2,_tr_init(I),Z_OK$3},deflateReset=a=>{const I=deflateResetKeep(a);return I===Z_OK$3&&lm_init(a.state),I},deflateSetHeader=(a,I)=>deflateStateCheck(a)||a.state.wrap!==2?Z_STREAM_ERROR$2:(a.state.gzhead=I,Z_OK$3),deflateInit2=(a,I,u,E,_,k)=>{if(!a)return Z_STREAM_ERROR$2;let e=1;if(I===Z_DEFAULT_COMPRESSION$1&&(I=6),E<0?(e=0,E=-E):E>15&&(e=2,E-=16),_<1||_>MAX_MEM_LEVEL||u!==Z_DEFLATED$2||E<8||E>15||I<0||I>9||k<0||k>Z_FIXED||E===8&&e!==1)return err(a,Z_STREAM_ERROR$2);E===8&&(E=9);const n=new DeflateState;return a.state=n,n.strm=a,n.status=INIT_STATE,n.wrap=e,n.gzhead=null,n.w_bits=E,n.w_size=1<<n.w_bits,n.w_mask=n.w_size-1,n.hash_bits=_+7,n.hash_size=1<<n.hash_bits,n.hash_mask=n.hash_size-1,n.hash_shift=~~((n.hash_bits+MIN_MATCH-1)/MIN_MATCH),n.window=new Uint8Array(n.w_size*2),n.head=new Uint16Array(n.hash_size),n.prev=new Uint16Array(n.w_size),n.lit_bufsize=1<<_+6,n.pending_buf_size=n.lit_bufsize*4,n.pending_buf=new Uint8Array(n.pending_buf_size),n.sym_buf=n.lit_bufsize,n.sym_end=(n.lit_bufsize-1)*3,n.level=I,n.strategy=k,n.method=u,deflateReset(a)},deflateInit=(a,I)=>deflateInit2(a,I,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(a,I)=>{if(deflateStateCheck(a)||I>Z_BLOCK$1||I<0)return a?err(a,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const u=a.state;if(!a.output||a.avail_in!==0&&!a.input||u.status===FINISH_STATE&&I!==Z_FINISH$3)return err(a,a.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const E=u.last_flush;if(u.last_flush=I,u.pending!==0){if(flush_pending(a),a.avail_out===0)return u.last_flush=-1,Z_OK$3}else if(a.avail_in===0&&rank(I)<=rank(E)&&I!==Z_FINISH$3)return err(a,Z_BUF_ERROR$1);if(u.status===FINISH_STATE&&a.avail_in!==0)return err(a,Z_BUF_ERROR$1);if(u.status===INIT_STATE&&u.wrap===0&&(u.status=BUSY_STATE),u.status===INIT_STATE){let _=Z_DEFLATED$2+(u.w_bits-8<<4)<<8,k=-1;if(u.strategy>=Z_HUFFMAN_ONLY||u.level<2?k=0:u.level<6?k=1:u.level===6?k=2:k=3,_|=k<<6,u.strstart!==0&&(_|=PRESET_DICT),_+=31-_%31,putShortMSB(u,_),u.strstart!==0&&(putShortMSB(u,a.adler>>>16),putShortMSB(u,a.adler&65535)),a.adler=1,u.status=BUSY_STATE,flush_pending(a),u.pending!==0)return u.last_flush=-1,Z_OK$3}if(u.status===GZIP_STATE){if(a.adler=0,put_byte(u,31),put_byte(u,139),put_byte(u,8),u.gzhead)put_byte(u,(u.gzhead.text?1:0)+(u.gzhead.hcrc?2:0)+(u.gzhead.extra?4:0)+(u.gzhead.name?8:0)+(u.gzhead.comment?16:0)),put_byte(u,u.gzhead.time&255),put_byte(u,u.gzhead.time>>8&255),put_byte(u,u.gzhead.time>>16&255),put_byte(u,u.gzhead.time>>24&255),put_byte(u,u.level===9?2:u.strategy>=Z_HUFFMAN_ONLY||u.level<2?4:0),put_byte(u,u.gzhead.os&255),u.gzhead.extra&&u.gzhead.extra.length&&(put_byte(u,u.gzhead.extra.length&255),put_byte(u,u.gzhead.extra.length>>8&255)),u.gzhead.hcrc&&(a.adler=crc32_1(a.adler,u.pending_buf,u.pending,0)),u.gzindex=0,u.status=EXTRA_STATE;else if(put_byte(u,0),put_byte(u,0),put_byte(u,0),put_byte(u,0),put_byte(u,0),put_byte(u,u.level===9?2:u.strategy>=Z_HUFFMAN_ONLY||u.level<2?4:0),put_byte(u,OS_CODE),u.status=BUSY_STATE,flush_pending(a),u.pending!==0)return u.last_flush=-1,Z_OK$3}if(u.status===EXTRA_STATE){if(u.gzhead.extra){let _=u.pending,k=(u.gzhead.extra.length&65535)-u.gzindex;for(;u.pending+k>u.pending_buf_size;){let n=u.pending_buf_size-u.pending;if(u.pending_buf.set(u.gzhead.extra.subarray(u.gzindex,u.gzindex+n),u.pending),u.pending=u.pending_buf_size,u.gzhead.hcrc&&u.pending>_&&(a.adler=crc32_1(a.adler,u.pending_buf,u.pending-_,_)),u.gzindex+=n,flush_pending(a),u.pending!==0)return u.last_flush=-1,Z_OK$3;_=0,k-=n}let e=new Uint8Array(u.gzhead.extra);u.pending_buf.set(e.subarray(u.gzindex,u.gzindex+k),u.pending),u.pending+=k,u.gzhead.hcrc&&u.pending>_&&(a.adler=crc32_1(a.adler,u.pending_buf,u.pending-_,_)),u.gzindex=0}u.status=NAME_STATE}if(u.status===NAME_STATE){if(u.gzhead.name){let _=u.pending,k;do{if(u.pending===u.pending_buf_size){if(u.gzhead.hcrc&&u.pending>_&&(a.adler=crc32_1(a.adler,u.pending_buf,u.pending-_,_)),flush_pending(a),u.pending!==0)return u.last_flush=-1,Z_OK$3;_=0}u.gzindex<u.gzhead.name.length?k=u.gzhead.name.charCodeAt(u.gzindex++)&255:k=0,put_byte(u,k)}while(k!==0);u.gzhead.hcrc&&u.pending>_&&(a.adler=crc32_1(a.adler,u.pending_buf,u.pending-_,_)),u.gzindex=0}u.status=COMMENT_STATE}if(u.status===COMMENT_STATE){if(u.gzhead.comment){let _=u.pending,k;do{if(u.pending===u.pending_buf_size){if(u.gzhead.hcrc&&u.pending>_&&(a.adler=crc32_1(a.adler,u.pending_buf,u.pending-_,_)),flush_pending(a),u.pending!==0)return u.last_flush=-1,Z_OK$3;_=0}u.gzindex<u.gzhead.comment.length?k=u.gzhead.comment.charCodeAt(u.gzindex++)&255:k=0,put_byte(u,k)}while(k!==0);u.gzhead.hcrc&&u.pending>_&&(a.adler=crc32_1(a.adler,u.pending_buf,u.pending-_,_))}u.status=HCRC_STATE}if(u.status===HCRC_STATE){if(u.gzhead.hcrc){if(u.pending+2>u.pending_buf_size&&(flush_pending(a),u.pending!==0))return u.last_flush=-1,Z_OK$3;put_byte(u,a.adler&255),put_byte(u,a.adler>>8&255),a.adler=0}if(u.status=BUSY_STATE,flush_pending(a),u.pending!==0)return u.last_flush=-1,Z_OK$3}if(a.avail_in!==0||u.lookahead!==0||I!==Z_NO_FLUSH$2&&u.status!==FINISH_STATE){let _=u.level===0?deflate_stored(u,I):u.strategy===Z_HUFFMAN_ONLY?deflate_huff(u,I):u.strategy===Z_RLE?deflate_rle(u,I):configuration_table[u.level].func(u,I);if((_===BS_FINISH_STARTED||_===BS_FINISH_DONE)&&(u.status=FINISH_STATE),_===BS_NEED_MORE||_===BS_FINISH_STARTED)return a.avail_out===0&&(u.last_flush=-1),Z_OK$3;if(_===BS_BLOCK_DONE&&(I===Z_PARTIAL_FLUSH?_tr_align(u):I!==Z_BLOCK$1&&(_tr_stored_block(u,0,0,!1),I===Z_FULL_FLUSH$1&&(zero(u.head),u.lookahead===0&&(u.strstart=0,u.block_start=0,u.insert=0))),flush_pending(a),a.avail_out===0))return u.last_flush=-1,Z_OK$3}return I!==Z_FINISH$3?Z_OK$3:u.wrap<=0?Z_STREAM_END$3:(u.wrap===2?(put_byte(u,a.adler&255),put_byte(u,a.adler>>8&255),put_byte(u,a.adler>>16&255),put_byte(u,a.adler>>24&255),put_byte(u,a.total_in&255),put_byte(u,a.total_in>>8&255),put_byte(u,a.total_in>>16&255),put_byte(u,a.total_in>>24&255)):(putShortMSB(u,a.adler>>>16),putShortMSB(u,a.adler&65535)),flush_pending(a),u.wrap>0&&(u.wrap=-u.wrap),u.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=a=>{if(deflateStateCheck(a))return Z_STREAM_ERROR$2;const I=a.state.status;return a.state=null,I===BUSY_STATE?err(a,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(a,I)=>{let u=I.length;if(deflateStateCheck(a))return Z_STREAM_ERROR$2;const E=a.state,_=E.wrap;if(_===2||_===1&&E.status!==INIT_STATE||E.lookahead)return Z_STREAM_ERROR$2;if(_===1&&(a.adler=adler32_1(a.adler,I,u,0)),E.wrap=0,u>=E.w_size){_===0&&(zero(E.head),E.strstart=0,E.block_start=0,E.insert=0);let O=new Uint8Array(E.w_size);O.set(I.subarray(u-E.w_size,u),0),I=O,u=E.w_size}const k=a.avail_in,e=a.next_in,n=a.input;for(a.avail_in=u,a.next_in=0,a.input=I,fill_window(E);E.lookahead>=MIN_MATCH;){let O=E.strstart,$=E.lookahead-(MIN_MATCH-1);do E.ins_h=HASH(E,E.ins_h,E.window[O+MIN_MATCH-1]),E.prev[O&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=O,O++;while(--$);E.strstart=O,E.lookahead=MIN_MATCH-1,fill_window(E)}return E.strstart+=E.lookahead,E.block_start=E.strstart,E.insert=E.lookahead,E.lookahead=0,E.match_length=E.prev_length=MIN_MATCH-1,E.match_available=0,a.next_in=e,a.input=n,a.avail_in=k,E.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=(a,I)=>Object.prototype.hasOwnProperty.call(a,I);var assign=function(a){const I=Array.prototype.slice.call(arguments,1);for(;I.length;){const u=I.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(const E in u)_has(u,E)&&(a[E]=u[E])}}return a},flattenChunks=a=>{let I=0;for(let E=0,_=a.length;E<_;E++)I+=a[E].length;const u=new Uint8Array(I);for(let E=0,_=0,k=a.length;E<k;E++){let e=a[E];u.set(e,_),_+=e.length}return u},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(a){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let a=0;a<256;a++)_utf8len[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=a=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(a);let I,u,E,_,k,e=a.length,n=0;for(_=0;_<e;_++)u=a.charCodeAt(_),(u&64512)===55296&&_+1<e&&(E=a.charCodeAt(_+1),(E&64512)===56320&&(u=65536+(u-55296<<10)+(E-56320),_++)),n+=u<128?1:u<2048?2:u<65536?3:4;for(I=new Uint8Array(n),k=0,_=0;k<n;_++)u=a.charCodeAt(_),(u&64512)===55296&&_+1<e&&(E=a.charCodeAt(_+1),(E&64512)===56320&&(u=65536+(u-55296<<10)+(E-56320),_++)),u<128?I[k++]=u:u<2048?(I[k++]=192|u>>>6,I[k++]=128|u&63):u<65536?(I[k++]=224|u>>>12,I[k++]=128|u>>>6&63,I[k++]=128|u&63):(I[k++]=240|u>>>18,I[k++]=128|u>>>12&63,I[k++]=128|u>>>6&63,I[k++]=128|u&63);return I};const buf2binstring=(a,I)=>{if(I<65534&&a.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,a.length===I?a:a.subarray(0,I));let u="";for(let E=0;E<I;E++)u+=String.fromCharCode(a[E]);return u};var buf2string=(a,I)=>{const u=I||a.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(a.subarray(0,I));let E,_;const k=new Array(u*2);for(_=0,E=0;E<u;){let e=a[E++];if(e<128){k[_++]=e;continue}let n=_utf8len[e];if(n>4){k[_++]=65533,E+=n-1;continue}for(e&=n===2?31:n===3?15:7;n>1&&E<u;)e=e<<6|a[E++]&63,n--;if(n>1){k[_++]=65533;continue}e<65536?k[_++]=e:(e-=65536,k[_++]=55296|e>>10&1023,k[_++]=56320|e&1023)}return buf2binstring(k,_)},utf8border=(a,I)=>{I=I||a.length,I>a.length&&(I=a.length);let u=I-1;for(;u>=0&&(a[u]&192)===128;)u--;return u<0||u===0?I:u+_utf8len[a[u]]>I?u:I},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(a){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},a||{});let I=this.options;I.raw&&I.windowBits>0?I.windowBits=-I.windowBits:I.gzip&&I.windowBits>0&&I.windowBits<16&&(I.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let u=deflate_1$2.deflateInit2(this.strm,I.level,I.method,I.windowBits,I.memLevel,I.strategy);if(u!==Z_OK$2)throw new Error(messages[u]);if(I.header&&deflate_1$2.deflateSetHeader(this.strm,I.header),I.dictionary){let E;if(typeof I.dictionary=="string"?E=strings.string2buf(I.dictionary):toString$1.call(I.dictionary)==="[object ArrayBuffer]"?E=new Uint8Array(I.dictionary):E=I.dictionary,u=deflate_1$2.deflateSetDictionary(this.strm,E),u!==Z_OK$2)throw new Error(messages[u]);this._dict_set=!0}}Deflate$1.prototype.push=function(a,I){const u=this.strm,E=this.options.chunkSize;let _,k;if(this.ended)return!1;for(I===~~I?k=I:k=I===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof a=="string"?u.input=strings.string2buf(a):toString$1.call(a)==="[object ArrayBuffer]"?u.input=new Uint8Array(a):u.input=a,u.next_in=0,u.avail_in=u.input.length;;){if(u.avail_out===0&&(u.output=new Uint8Array(E),u.next_out=0,u.avail_out=E),(k===Z_SYNC_FLUSH||k===Z_FULL_FLUSH)&&u.avail_out<=6){this.onData(u.output.subarray(0,u.next_out)),u.avail_out=0;continue}if(_=deflate_1$2.deflate(u,k),_===Z_STREAM_END$2)return u.next_out>0&&this.onData(u.output.subarray(0,u.next_out)),_=deflate_1$2.deflateEnd(this.strm),this.onEnd(_),this.ended=!0,_===Z_OK$2;if(u.avail_out===0){this.onData(u.output);continue}if(k>0&&u.next_out>0){this.onData(u.output.subarray(0,u.next_out)),u.avail_out=0;continue}if(u.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(a){this.chunks.push(a)},Deflate$1.prototype.onEnd=function(a){a===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg};function deflate$1(a,I){const u=new Deflate$1(I);if(u.push(a,!0),u.err)throw u.msg||messages[u.err];return u.result}function deflateRaw$1(a,I){return I=I||{},I.raw=!0,deflate$1(a,I)}function gzip$1(a,I){return I=I||{},I.gzip=!0,deflate$1(a,I)}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 a(I,u){let E,_,k,e,n,O,$,N,D,q,P,j,Q,J,z,Y,et,tt,nt,dt,it,at,ct,ot;const rt=I.state;E=I.next_in,ct=I.input,_=E+(I.avail_in-5),k=I.next_out,ot=I.output,e=k-(u-I.avail_out),n=k+(I.avail_out-257),O=rt.dmax,$=rt.wsize,N=rt.whave,D=rt.wnext,q=rt.window,P=rt.hold,j=rt.bits,Q=rt.lencode,J=rt.distcode,z=(1<<rt.lenbits)-1,Y=(1<<rt.distbits)-1;t:do{j<15&&(P+=ct[E++]<<j,j+=8,P+=ct[E++]<<j,j+=8),et=Q[P&z];e:for(;;){if(tt=et>>>24,P>>>=tt,j-=tt,tt=et>>>16&255,tt===0)ot[k++]=et&65535;else if(tt&16){nt=et&65535,tt&=15,tt&&(j<tt&&(P+=ct[E++]<<j,j+=8),nt+=P&(1<<tt)-1,P>>>=tt,j-=tt),j<15&&(P+=ct[E++]<<j,j+=8,P+=ct[E++]<<j,j+=8),et=J[P&Y];i:for(;;){if(tt=et>>>24,P>>>=tt,j-=tt,tt=et>>>16&255,tt&16){if(dt=et&65535,tt&=15,j<tt&&(P+=ct[E++]<<j,j+=8,j<tt&&(P+=ct[E++]<<j,j+=8)),dt+=P&(1<<tt)-1,dt>O){I.msg="invalid distance too far back",rt.mode=BAD$1;break t}if(P>>>=tt,j-=tt,tt=k-e,dt>tt){if(tt=dt-tt,tt>N&&rt.sane){I.msg="invalid distance too far back",rt.mode=BAD$1;break t}if(it=0,at=q,D===0){if(it+=$-tt,tt<nt){nt-=tt;do ot[k++]=q[it++];while(--tt);it=k-dt,at=ot}}else if(D<tt){if(it+=$+D-tt,tt-=D,tt<nt){nt-=tt;do ot[k++]=q[it++];while(--tt);if(it=0,D<nt){tt=D,nt-=tt;do ot[k++]=q[it++];while(--tt);it=k-dt,at=ot}}}else if(it+=D-tt,tt<nt){nt-=tt;do ot[k++]=q[it++];while(--tt);it=k-dt,at=ot}for(;nt>2;)ot[k++]=at[it++],ot[k++]=at[it++],ot[k++]=at[it++],nt-=3;nt&&(ot[k++]=at[it++],nt>1&&(ot[k++]=at[it++]))}else{it=k-dt;do ot[k++]=ot[it++],ot[k++]=ot[it++],ot[k++]=ot[it++],nt-=3;while(nt>2);nt&&(ot[k++]=ot[it++],nt>1&&(ot[k++]=ot[it++]))}}else if((tt&64)===0){et=J[(et&65535)+(P&(1<<tt)-1)];continue i}else{I.msg="invalid distance code",rt.mode=BAD$1;break t}break}}else if((tt&64)===0){et=Q[(et&65535)+(P&(1<<tt)-1)];continue e}else if(tt&32){rt.mode=TYPE$1;break t}else{I.msg="invalid literal/length code",rt.mode=BAD$1;break t}break}}while(E<_&&k<n);nt=j>>3,E-=nt,j-=nt<<3,P&=(1<<j)-1,I.next_in=E,I.next_out=k,I.avail_in=E<_?5+(_-E):5-(E-_),I.avail_out=k<n?257+(n-k):257-(k-n),rt.hold=P,rt.bits=j};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=(a,I,u,E,_,k,e,n)=>{const O=n.bits;let $=0,N=0,D=0,q=0,P=0,j=0,Q=0,J=0,z=0,Y=0,et,tt,nt,dt,it,at=null,ct;const ot=new Uint16Array(MAXBITS+1),rt=new Uint16Array(MAXBITS+1);let $t=null,Gt,Kt,Qt;for($=0;$<=MAXBITS;$++)ot[$]=0;for(N=0;N<E;N++)ot[I[u+N]]++;for(P=O,q=MAXBITS;q>=1&&ot[q]===0;q--);if(P>q&&(P=q),q===0)return _[k++]=1<<24|64<<16|0,_[k++]=1<<24|64<<16|0,n.bits=1,0;for(D=1;D<q&&ot[D]===0;D++);for(P<D&&(P=D),J=1,$=1;$<=MAXBITS;$++)if(J<<=1,J-=ot[$],J<0)return-1;if(J>0&&(a===CODES$1||q!==1))return-1;for(rt[1]=0,$=1;$<MAXBITS;$++)rt[$+1]=rt[$]+ot[$];for(N=0;N<E;N++)I[u+N]!==0&&(e[rt[I[u+N]]++]=N);if(a===CODES$1?(at=$t=e,ct=20):a===LENS$1?(at=lbase,$t=lext,ct=257):(at=dbase,$t=dext,ct=0),Y=0,N=0,$=D,it=k,j=P,Q=0,nt=-1,z=1<<P,dt=z-1,a===LENS$1&&z>ENOUGH_LENS$1||a===DISTS$1&&z>ENOUGH_DISTS$1)return 1;for(;;){Gt=$-Q,e[N]+1<ct?(Kt=0,Qt=e[N]):e[N]>=ct?(Kt=$t[e[N]-ct],Qt=at[e[N]-ct]):(Kt=96,Qt=0),et=1<<$-Q,tt=1<<j,D=tt;do tt-=et,_[it+(Y>>Q)+tt]=Gt<<24|Kt<<16|Qt|0;while(tt!==0);for(et=1<<$-1;Y&et;)et>>=1;if(et!==0?(Y&=et-1,Y+=et):Y=0,N++,--ot[$]===0){if($===q)break;$=I[u+e[N]]}if($>P&&(Y&dt)!==nt){for(Q===0&&(Q=P),it+=D,j=$-Q,J=1<<j;j+Q<q&&(J-=ot[j+Q],!(J<=0));)j++,J<<=1;if(z+=1<<j,a===LENS$1&&z>ENOUGH_LENS$1||a===DISTS$1&&z>ENOUGH_DISTS$1)return 1;nt=Y&dt,_[nt]=P<<24|j<<16|it-k|0}}return Y!==0&&(_[it+Y]=$-Q<<24|64<<16|0),n.bits=P,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=a=>(a>>>24&255)+(a>>>8&65280)+((a&65280)<<8)+((a&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=a=>{if(!a)return 1;const I=a.state;return!I||I.strm!==a||I.mode<HEAD||I.mode>SYNC?1:0},inflateResetKeep=a=>{if(inflateStateCheck(a))return Z_STREAM_ERROR$1;const I=a.state;return a.total_in=a.total_out=I.total=0,a.msg="",I.wrap&&(a.adler=I.wrap&1),I.mode=HEAD,I.last=0,I.havedict=0,I.flags=-1,I.dmax=32768,I.head=null,I.hold=0,I.bits=0,I.lencode=I.lendyn=new Int32Array(ENOUGH_LENS),I.distcode=I.distdyn=new Int32Array(ENOUGH_DISTS),I.sane=1,I.back=-1,Z_OK$1},inflateReset=a=>{if(inflateStateCheck(a))return Z_STREAM_ERROR$1;const I=a.state;return I.wsize=0,I.whave=0,I.wnext=0,inflateResetKeep(a)},inflateReset2=(a,I)=>{let u;if(inflateStateCheck(a))return Z_STREAM_ERROR$1;const E=a.state;return I<0?(u=0,I=-I):(u=(I>>4)+5,I<48&&(I&=15)),I&&(I<8||I>15)?Z_STREAM_ERROR$1:(E.window!==null&&E.wbits!==I&&(E.window=null),E.wrap=u,E.wbits=I,inflateReset(a))},inflateInit2=(a,I)=>{if(!a)return Z_STREAM_ERROR$1;const u=new InflateState;a.state=u,u.strm=a,u.window=null,u.mode=HEAD;const E=inflateReset2(a,I);return E!==Z_OK$1&&(a.state=null),E},inflateInit=a=>inflateInit2(a,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=a=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let I=0;for(;I<144;)a.lens[I++]=8;for(;I<256;)a.lens[I++]=9;for(;I<280;)a.lens[I++]=7;for(;I<288;)a.lens[I++]=8;for(inftrees(LENS,a.lens,0,288,lenfix,0,a.work,{bits:9}),I=0;I<32;)a.lens[I++]=5;inftrees(DISTS,a.lens,0,32,distfix,0,a.work,{bits:5}),virgin=!1}a.lencode=lenfix,a.lenbits=9,a.distcode=distfix,a.distbits=5},updatewindow=(a,I,u,E)=>{let _;const k=a.state;return k.window===null&&(k.wsize=1<<k.wbits,k.wnext=0,k.whave=0,k.window=new Uint8Array(k.wsize)),E>=k.wsize?(k.window.set(I.subarray(u-k.wsize,u),0),k.wnext=0,k.whave=k.wsize):(_=k.wsize-k.wnext,_>E&&(_=E),k.window.set(I.subarray(u-E,u-E+_),k.wnext),E-=_,E?(k.window.set(I.subarray(u-E,u),0),k.wnext=E,k.whave=k.wsize):(k.wnext+=_,k.wnext===k.wsize&&(k.wnext=0),k.whave<k.wsize&&(k.whave+=_))),0},inflate$2=(a,I)=>{let u,E,_,k,e,n,O,$,N,D,q,P,j,Q,J=0,z,Y,et,tt,nt,dt,it,at;const ct=new Uint8Array(4);let ot,rt;const $t=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(a)||!a.output||!a.input&&a.avail_in!==0)return Z_STREAM_ERROR$1;u=a.state,u.mode===TYPE&&(u.mode=TYPEDO),e=a.next_out,_=a.output,O=a.avail_out,k=a.next_in,E=a.input,n=a.avail_in,$=u.hold,N=u.bits,D=n,q=O,at=Z_OK$1;t:for(;;)switch(u.mode){case HEAD:if(u.wrap===0){u.mode=TYPEDO;break}for(;N<16;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(u.wrap&2&&$===35615){u.wbits===0&&(u.wbits=15),u.check=0,ct[0]=$&255,ct[1]=$>>>8&255,u.check=crc32_1(u.check,ct,2,0),$=0,N=0,u.mode=FLAGS;break}if(u.head&&(u.head.done=!1),!(u.wrap&1)||((($&255)<<8)+($>>8))%31){a.msg="incorrect header check",u.mode=BAD;break}if(($&15)!==Z_DEFLATED){a.msg="unknown compression method",u.mode=BAD;break}if($>>>=4,N-=4,it=($&15)+8,u.wbits===0&&(u.wbits=it),it>15||it>u.wbits){a.msg="invalid window size",u.mode=BAD;break}u.dmax=1<<u.wbits,u.flags=0,a.adler=u.check=1,u.mode=$&512?DICTID:TYPE,$=0,N=0;break;case FLAGS:for(;N<16;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(u.flags=$,(u.flags&255)!==Z_DEFLATED){a.msg="unknown compression method",u.mode=BAD;break}if(u.flags&57344){a.msg="unknown header flags set",u.mode=BAD;break}u.head&&(u.head.text=$>>8&1),u.flags&512&&u.wrap&4&&(ct[0]=$&255,ct[1]=$>>>8&255,u.check=crc32_1(u.check,ct,2,0)),$=0,N=0,u.mode=TIME;case TIME:for(;N<32;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}u.head&&(u.head.time=$),u.flags&512&&u.wrap&4&&(ct[0]=$&255,ct[1]=$>>>8&255,ct[2]=$>>>16&255,ct[3]=$>>>24&255,u.check=crc32_1(u.check,ct,4,0)),$=0,N=0,u.mode=OS;case OS:for(;N<16;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}u.head&&(u.head.xflags=$&255,u.head.os=$>>8),u.flags&512&&u.wrap&4&&(ct[0]=$&255,ct[1]=$>>>8&255,u.check=crc32_1(u.check,ct,2,0)),$=0,N=0,u.mode=EXLEN;case EXLEN:if(u.flags&1024){for(;N<16;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}u.length=$,u.head&&(u.head.extra_len=$),u.flags&512&&u.wrap&4&&(ct[0]=$&255,ct[1]=$>>>8&255,u.check=crc32_1(u.check,ct,2,0)),$=0,N=0}else u.head&&(u.head.extra=null);u.mode=EXTRA;case EXTRA:if(u.flags&1024&&(P=u.length,P>n&&(P=n),P&&(u.head&&(it=u.head.extra_len-u.length,u.head.extra||(u.head.extra=new Uint8Array(u.head.extra_len)),u.head.extra.set(E.subarray(k,k+P),it)),u.flags&512&&u.wrap&4&&(u.check=crc32_1(u.check,E,P,k)),n-=P,k+=P,u.length-=P),u.length))break t;u.length=0,u.mode=NAME;case NAME:if(u.flags&2048){if(n===0)break t;P=0;do it=E[k+P++],u.head&&it&&u.length<65536&&(u.head.name+=String.fromCharCode(it));while(it&&P<n);if(u.flags&512&&u.wrap&4&&(u.check=crc32_1(u.check,E,P,k)),n-=P,k+=P,it)break t}else u.head&&(u.head.name=null);u.length=0,u.mode=COMMENT;case COMMENT:if(u.flags&4096){if(n===0)break t;P=0;do it=E[k+P++],u.head&&it&&u.length<65536&&(u.head.comment+=String.fromCharCode(it));while(it&&P<n);if(u.flags&512&&u.wrap&4&&(u.check=crc32_1(u.check,E,P,k)),n-=P,k+=P,it)break t}else u.head&&(u.head.comment=null);u.mode=HCRC;case HCRC:if(u.flags&512){for(;N<16;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(u.wrap&4&&$!==(u.check&65535)){a.msg="header crc mismatch",u.mode=BAD;break}$=0,N=0}u.head&&(u.head.hcrc=u.flags>>9&1,u.head.done=!0),a.adler=u.check=0,u.mode=TYPE;break;case DICTID:for(;N<32;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}a.adler=u.check=zswap32($),$=0,N=0,u.mode=DICT;case DICT:if(u.havedict===0)return a.next_out=e,a.avail_out=O,a.next_in=k,a.avail_in=n,u.hold=$,u.bits=N,Z_NEED_DICT$1;a.adler=u.check=1,u.mode=TYPE;case TYPE:if(I===Z_BLOCK||I===Z_TREES)break t;case TYPEDO:if(u.last){$>>>=N&7,N-=N&7,u.mode=CHECK;break}for(;N<3;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}switch(u.last=$&1,$>>>=1,N-=1,$&3){case 0:u.mode=STORED;break;case 1:if(fixedtables(u),u.mode=LEN_,I===Z_TREES){$>>>=2,N-=2;break t}break;case 2:u.mode=TABLE;break;case 3:a.msg="invalid block type",u.mode=BAD}$>>>=2,N-=2;break;case STORED:for($>>>=N&7,N-=N&7;N<32;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(($&65535)!==($>>>16^65535)){a.msg="invalid stored block lengths",u.mode=BAD;break}if(u.length=$&65535,$=0,N=0,u.mode=COPY_,I===Z_TREES)break t;case COPY_:u.mode=COPY;case COPY:if(P=u.length,P){if(P>n&&(P=n),P>O&&(P=O),P===0)break t;_.set(E.subarray(k,k+P),e),n-=P,k+=P,O-=P,e+=P,u.length-=P;break}u.mode=TYPE;break;case TABLE:for(;N<14;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(u.nlen=($&31)+257,$>>>=5,N-=5,u.ndist=($&31)+1,$>>>=5,N-=5,u.ncode=($&15)+4,$>>>=4,N-=4,u.nlen>286||u.ndist>30){a.msg="too many length or distance symbols",u.mode=BAD;break}u.have=0,u.mode=LENLENS;case LENLENS:for(;u.have<u.ncode;){for(;N<3;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}u.lens[$t[u.have++]]=$&7,$>>>=3,N-=3}for(;u.have<19;)u.lens[$t[u.have++]]=0;if(u.lencode=u.lendyn,u.lenbits=7,ot={bits:u.lenbits},at=inftrees(CODES,u.lens,0,19,u.lencode,0,u.work,ot),u.lenbits=ot.bits,at){a.msg="invalid code lengths set",u.mode=BAD;break}u.have=0,u.mode=CODELENS;case CODELENS:for(;u.have<u.nlen+u.ndist;){for(;J=u.lencode[$&(1<<u.lenbits)-1],z=J>>>24,Y=J>>>16&255,et=J&65535,!(z<=N);){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(et<16)$>>>=z,N-=z,u.lens[u.have++]=et;else{if(et===16){for(rt=z+2;N<rt;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if($>>>=z,N-=z,u.have===0){a.msg="invalid bit length repeat",u.mode=BAD;break}it=u.lens[u.have-1],P=3+($&3),$>>>=2,N-=2}else if(et===17){for(rt=z+3;N<rt;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}$>>>=z,N-=z,it=0,P=3+($&7),$>>>=3,N-=3}else{for(rt=z+7;N<rt;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}$>>>=z,N-=z,it=0,P=11+($&127),$>>>=7,N-=7}if(u.have+P>u.nlen+u.ndist){a.msg="invalid bit length repeat",u.mode=BAD;break}for(;P--;)u.lens[u.have++]=it}}if(u.mode===BAD)break;if(u.lens[256]===0){a.msg="invalid code -- missing end-of-block",u.mode=BAD;break}if(u.lenbits=9,ot={bits:u.lenbits},at=inftrees(LENS,u.lens,0,u.nlen,u.lencode,0,u.work,ot),u.lenbits=ot.bits,at){a.msg="invalid literal/lengths set",u.mode=BAD;break}if(u.distbits=6,u.distcode=u.distdyn,ot={bits:u.distbits},at=inftrees(DISTS,u.lens,u.nlen,u.ndist,u.distcode,0,u.work,ot),u.distbits=ot.bits,at){a.msg="invalid distances set",u.mode=BAD;break}if(u.mode=LEN_,I===Z_TREES)break t;case LEN_:u.mode=LEN;case LEN:if(n>=6&&O>=258){a.next_out=e,a.avail_out=O,a.next_in=k,a.avail_in=n,u.hold=$,u.bits=N,inffast(a,q),e=a.next_out,_=a.output,O=a.avail_out,k=a.next_in,E=a.input,n=a.avail_in,$=u.hold,N=u.bits,u.mode===TYPE&&(u.back=-1);break}for(u.back=0;J=u.lencode[$&(1<<u.lenbits)-1],z=J>>>24,Y=J>>>16&255,et=J&65535,!(z<=N);){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(Y&&(Y&240)===0){for(tt=z,nt=Y,dt=et;J=u.lencode[dt+(($&(1<<tt+nt)-1)>>tt)],z=J>>>24,Y=J>>>16&255,et=J&65535,!(tt+z<=N);){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}$>>>=tt,N-=tt,u.back+=tt}if($>>>=z,N-=z,u.back+=z,u.length=et,Y===0){u.mode=LIT;break}if(Y&32){u.back=-1,u.mode=TYPE;break}if(Y&64){a.msg="invalid literal/length code",u.mode=BAD;break}u.extra=Y&15,u.mode=LENEXT;case LENEXT:if(u.extra){for(rt=u.extra;N<rt;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}u.length+=$&(1<<u.extra)-1,$>>>=u.extra,N-=u.extra,u.back+=u.extra}u.was=u.length,u.mode=DIST;case DIST:for(;J=u.distcode[$&(1<<u.distbits)-1],z=J>>>24,Y=J>>>16&255,et=J&65535,!(z<=N);){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if((Y&240)===0){for(tt=z,nt=Y,dt=et;J=u.distcode[dt+(($&(1<<tt+nt)-1)>>tt)],z=J>>>24,Y=J>>>16&255,et=J&65535,!(tt+z<=N);){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}$>>>=tt,N-=tt,u.back+=tt}if($>>>=z,N-=z,u.back+=z,Y&64){a.msg="invalid distance code",u.mode=BAD;break}u.offset=et,u.extra=Y&15,u.mode=DISTEXT;case DISTEXT:if(u.extra){for(rt=u.extra;N<rt;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}u.offset+=$&(1<<u.extra)-1,$>>>=u.extra,N-=u.extra,u.back+=u.extra}if(u.offset>u.dmax){a.msg="invalid distance too far back",u.mode=BAD;break}u.mode=MATCH;case MATCH:if(O===0)break t;if(P=q-O,u.offset>P){if(P=u.offset-P,P>u.whave&&u.sane){a.msg="invalid distance too far back",u.mode=BAD;break}P>u.wnext?(P-=u.wnext,j=u.wsize-P):j=u.wnext-P,P>u.length&&(P=u.length),Q=u.window}else Q=_,j=e-u.offset,P=u.length;P>O&&(P=O),O-=P,u.length-=P;do _[e++]=Q[j++];while(--P);u.length===0&&(u.mode=LEN);break;case LIT:if(O===0)break t;_[e++]=u.length,O--,u.mode=LEN;break;case CHECK:if(u.wrap){for(;N<32;){if(n===0)break t;n--,$|=E[k++]<<N,N+=8}if(q-=O,a.total_out+=q,u.total+=q,u.wrap&4&&q&&(a.adler=u.check=u.flags?crc32_1(u.check,_,q,e-q):adler32_1(u.check,_,q,e-q)),q=O,u.wrap&4&&(u.flags?$:zswap32($))!==u.check){a.msg="incorrect data check",u.mode=BAD;break}$=0,N=0}u.mode=LENGTH;case LENGTH:if(u.wrap&&u.flags){for(;N<32;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(u.wrap&4&&$!==(u.total&4294967295)){a.msg="incorrect length check",u.mode=BAD;break}$=0,N=0}u.mode=DONE;case DONE:at=Z_STREAM_END$1;break t;case BAD:at=Z_DATA_ERROR$1;break t;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return a.next_out=e,a.avail_out=O,a.next_in=k,a.avail_in=n,u.hold=$,u.bits=N,(u.wsize||q!==a.avail_out&&u.mode<BAD&&(u.mode<CHECK||I!==Z_FINISH$1))&&updatewindow(a,a.output,a.next_out,q-a.avail_out),D-=a.avail_in,q-=a.avail_out,a.total_in+=D,a.total_out+=q,u.total+=q,u.wrap&4&&q&&(a.adler=u.check=u.flags?crc32_1(u.check,_,q,a.next_out-q):adler32_1(u.check,_,q,a.next_out-q)),a.data_type=u.bits+(u.last?64:0)+(u.mode===TYPE?128:0)+(u.mode===LEN_||u.mode===COPY_?256:0),(D===0&&q===0||I===Z_FINISH$1)&&at===Z_OK$1&&(at=Z_BUF_ERROR),at},inflateEnd=a=>{if(inflateStateCheck(a))return Z_STREAM_ERROR$1;let I=a.state;return I.window&&(I.window=null),a.state=null,Z_OK$1},inflateGetHeader=(a,I)=>{if(inflateStateCheck(a))return Z_STREAM_ERROR$1;const u=a.state;return(u.wrap&2)===0?Z_STREAM_ERROR$1:(u.head=I,I.done=!1,Z_OK$1)},inflateSetDictionary=(a,I)=>{const u=I.length;let E,_,k;return inflateStateCheck(a)||(E=a.state,E.wrap!==0&&E.mode!==DICT)?Z_STREAM_ERROR$1:E.mode===DICT&&(_=1,_=adler32_1(_,I,u,0),_!==E.check)?Z_DATA_ERROR$1:(k=updatewindow(a,I,u,u),k?(E.mode=MEM,Z_MEM_ERROR$1):(E.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(a){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},a||{});const I=this.options;I.raw&&I.windowBits>=0&&I.windowBits<16&&(I.windowBits=-I.windowBits,I.windowBits===0&&(I.windowBits=-15)),I.windowBits>=0&&I.windowBits<16&&!(a&&a.windowBits)&&(I.windowBits+=32),I.windowBits>15&&I.windowBits<48&&(I.windowBits&15)===0&&(I.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let u=inflate_1$2.inflateInit2(this.strm,I.windowBits);if(u!==Z_OK)throw new Error(messages[u]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),I.dictionary&&(typeof I.dictionary=="string"?I.dictionary=strings.string2buf(I.dictionary):toString.call(I.dictionary)==="[object ArrayBuffer]"&&(I.dictionary=new Uint8Array(I.dictionary)),I.raw&&(u=inflate_1$2.inflateSetDictionary(this.strm,I.dictionary),u!==Z_OK)))throw new Error(messages[u])}Inflate$1.prototype.push=function(a,I){const u=this.strm,E=this.options.chunkSize,_=this.options.dictionary;let k,e,n;if(this.ended)return!1;for(I===~~I?e=I:e=I===!0?Z_FINISH:Z_NO_FLUSH,toString.call(a)==="[object ArrayBuffer]"?u.input=new Uint8Array(a):u.input=a,u.next_in=0,u.avail_in=u.input.length;;){for(u.avail_out===0&&(u.output=new Uint8Array(E),u.next_out=0,u.avail_out=E),k=inflate_1$2.inflate(u,e),k===Z_NEED_DICT&&_&&(k=inflate_1$2.inflateSetDictionary(u,_),k===Z_OK?k=inflate_1$2.inflate(u,e):k===Z_DATA_ERROR&&(k=Z_NEED_DICT));u.avail_in>0&&k===Z_STREAM_END&&u.state.wrap>0&&a[u.next_in]!==0;)inflate_1$2.inflateReset(u),k=inflate_1$2.inflate(u,e);switch(k){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(k),this.ended=!0,!1}if(n=u.avail_out,u.next_out&&(u.avail_out===0||k===Z_STREAM_END))if(this.options.to==="string"){let O=strings.utf8border(u.output,u.next_out),$=u.next_out-O,N=strings.buf2string(u.output,O);u.next_out=$,u.avail_out=E-$,$&&u.output.set(u.output.subarray(O,O+$),0),this.onData(N)}else this.onData(u.output.length===u.next_out?u.output:u.output.subarray(0,u.next_out));if(!(k===Z_OK&&n===0)){if(k===Z_STREAM_END)return k=inflate_1$2.inflateEnd(this.strm),this.onEnd(k),this.ended=!0,!0;if(u.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(a){this.chunks.push(a)},Inflate$1.prototype.onEnd=function(a){a===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg};function inflate$1(a,I){const u=new Inflate$1(I);if(u.push(a),u.err)throw u.msg||messages[u.err];return u.result}function inflateRaw$1(a,I){return I=I||{},I.raw=!0,inflate$1(a,I)}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=a=>{const I=new Uint8Array(a),u=pako.deflate(I,{gzip:!0});return new Uint8Array(u==null?void 0:u.buffer)},decompressArrayBuffer=a=>{const I=new Uint8Array(a),u=pako.inflate(I,{gzip:!0});return new Uint8Array(u==null?void 0:u.buffer)},sendMessageFormat=a=>{const{event:I}=a;switch(a.data_original=a.data,a.time&&(a.timeStr=U(a.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),I){case"login":a.data=com.quick.voice.proto.Login.encode(a.data).finish();break;case"joinRoom":case"joinRoomEx":a.data=com.quick.voice.proto.JoinReq.encode(a.data).finish();break;case"quitRoom":a.data=com.quick.voice.proto.QuitReq.encode(a.data).finish();break;case"connectCF":a.data=com.quick.voice.proto.ConnectCFReq.encode(a.data).finish(),a.data=compressArrayBuffer(a.data),a.compress=!0;break;case"publish":a.data=com.quick.voice.proto.PublishReq.encode(a.data).finish(),a.data=compressArrayBuffer(a.data),a.compress=!0;break;case"subscribe":a.data=com.quick.voice.proto.SubscribeReq.encode(a.data).finish();break;case"closeTrack":a.data=com.quick.voice.proto.CloseTrackReq.encode(a.data).finish(),a.data=compressArrayBuffer(a.data),a.compress=!0;break;case"renegotiate":a.data=com.quick.voice.proto.RenegotiateReq.encode(a.data).finish(),a.data=compressArrayBuffer(a.data),a.compress=!0;break;case"syncRoomInfo":a.data=com.quick.voice.proto.SyncRoomInfoReq.encode(a.data).finish();break;case"updateCall":a.data=com.quick.voice.proto.UpdateCall.encode(a.data).finish();break;case"networkQualityChange":a.data=com.quick.voice.proto.NetQualityChange.encode(a.data).finish();break;case"pubNotify":a.data=com.quick.voice.proto.PublishNotify.encode(a.data).finish();break;default:a.data=new Uint8Array;break}return a},onMessageFormat=a=>{const{event:I,compress:u=!1}=a;if(a.data_remote=a.data,a.time&&(a.timeStr=U(a.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),u)try{a.data=decompressArrayBuffer(a.data)}catch(E){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",E)}switch(I){case"login":a.data=com.quick.voice.proto.Login.decode(a.data);break;case"joinRoom":case"joinRoomEx":a.data=com.quick.voice.proto.JoinRsp.decode(a.data);break;case"onJoinRoom":a.data=com.quick.voice.proto.JoinNotify.decode(a.data);break;case"onQuitRoom":a.data=com.quick.voice.proto.QuitNotify.decode(a.data);break;case"connectCF":a.data=com.quick.voice.proto.ConnectCFRsp.decode(a.data);break;case"publish":a.data=com.quick.voice.proto.PublishRsp.decode(a.data);break;case"onPublish":a.data=com.quick.voice.proto.PublishNotify.decode(a.data);break;case"subscribe":a.data=com.quick.voice.proto.SubscribeRsp.decode(a.data);break;case"closeTrack":a.data=com.quick.voice.proto.CloseTrackRsp.decode(a.data);break;case"onCloseTrack":a.data=com.quick.voice.proto.CloseTrackNotify.decode(a.data);break;case"onUpdateCall":a.data=com.quick.voice.proto.UpdateCall.decode(a.data);break;case"onDestroyRoom":a.data=com.quick.voice.proto.QuitNotify.decode(a.data);break;case"onUpdatePermissions":a.data=com.quick.voice.proto.UpdatePermissions.decode(a.data);break;case"onNetQuality":a.data=com.quick.voice.proto.NetQualityNotify.decode(a.data);break;case"syncRoomInfo":a.data=com.quick.voice.proto.SyncRoomInfoRsp.decode(a.data);break;case"onCDNPlayUrlAdd":a.data=com.quick.voice.proto.CDNPlayAddressNotify.decode(a.data);break;case"debugger":a.data=JSON.parse(new TextDecoder().decode(a.data));break}return a};class CallsWebSocket{constructor(I){ut(this,lt);ut(this,st,{url:"wss://demo.putplay.cc/websocket",debug:!1,reconnectCount:10,timeout:30*1e3});ut(this,yt,"");ut(this,_t,{});ut(this,kt,{});Z(this,"state","closed");Z(this,"sendMessageBefore",async()=>{});Z(this,"onReconnectSuccess",I=>{});Z(this,"onReconnectStop",I=>{});ut(this,Et,I=>{let u=!0;const{code:E=1e3,reason:_=""}=I;return E===1e3&&(_==="quit success!"||_==="replace old connection!")&&(u=!1),u});ut(this,xt,async I=>{V(this,st).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连成功",I),this.state="connected",this.onReconnectSuccess(I)});ut(this,Nt,async I=>{V(this,st).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连停止",I),this.close(),this.state="closed",this.onReconnectStop(I)});ut(this,At,()=>{const I={event:"heartbeat",sn:+`${F(1e5,999999)}`};return com.quick.voice.proto.CommonReq.encode(I).finish()});ut(this,Rt,(I,u={})=>{try{const{time:E,event:_,data:k={},data_original:e={},data_remote:n,...O}=u,$=U(E,"YYYY-MM-DD hh:mm:ss",{offset:480});let N={};const D=(Y={})=>{const et=JSON.parse(JSON.stringify(Y)),tt=Object.keys(et);for(const nt of tt)(nt.includes("sdp")||nt.includes("Sdp"))&&(et[nt]="");return et};let q="res ↓";switch(I){case"res":q="res ↓",N=D(k);break;case"req":q="req ↑",N=D(e);break}let P="#quickvo.logs";ignoreEvent.includes(_)&&(P="#quickvo.ignoreEvents");const j={"#action":q,timeStr:$,event:_,data:N,time:E,...O},Q=localStorage.getItem(P)||JSON.stringify([]),J=JSON.parse(Q),z=[j,...J].slice(0,500);localStorage.setItem(P,JSON.stringify(z))}catch(E){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",E)}});ut(this,qt,(I,{resolve:u,reject:E})=>{const{sn:_}=I,k=()=>{const n=V(this,_t)[_];clearTimeout(n.destructionTimer),delete V(this,_t)[_]},e=setTimeout(()=>{const n=V(this,_t)[_];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:event is timeout",n.message),k(),E("event is timeout")},V(this,st).timeout);V(this,_t)[_]={message:I,resolve:u,reject:E,destruction:k,destructionTimer:e}});ut(this,Dt,I=>V(this,_t)[I]);ut(this,Ct,async I=>{const u=new Uint8Array(I),E=com.quick.voice.proto.CommonRsp.decode(u),{sn:_,event:k}=E,e=onMessageFormat(E);if(V(this,st).debug&&(noLogEvents.includes(k)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",e),ignoreEvent.includes(k)||V(this,Rt).call(this,"res",e)),notifyName_keys.includes(k))return this.emitNotify(k,L(e,["code","data","desc"]));const O=V(this,Dt).call(this,_);if(O){const{resolve:$=D=>{},destruction:N=()=>{}}=O;$(L(e,["code","data","desc"])),N()}});Z(this,"clearEvents",(I=[])=>{const u=Object.keys(V(this,_t));I.length===0&&(I=u);for(const E of u){if(!I.includes(E))continue;const _=V(this,_t)[E];clearTimeout(_.destructionTimer),delete V(this,_t)[E]}});Z(this,"connect",async(I="")=>new Promise(async u=>{I&&Ot(this,yt,I),V(this,lt)&&(await V(this,lt).close(),this.state="closed");const E=`${V(this,st).url}?s=${V(this,yt)}&t=${Date.now()}`;Ot(this,lt,new M({...V(this,st),url:E,binaryType:"arraybuffer",onMessage:V(this,Ct),checkReconnect:V(this,Et),getHeartbeatMsg:V(this,At),onReconnectSuccess:V(this,xt),onReconnectStop:V(this,Nt)})),this.state="connecting",await V(this,lt).connect(),this.state="connected",V(this,st).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 当前广播事件",V(this,kt)),u(V(this,lt))}));Z(this,"close",async()=>{var u;V(this,st).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.");const I=Object.keys(V(this,_t));for(const E of I){const{destructionTimer:_}=V(this,_t)[E];clearTimeout(_)}Ot(this,_t,{}),await((u=V(this,lt))==null?void 0:u.close()),Ot(this,lt,void 0),this.state="closed"});Z(this,"sendMessage",(I,u=!0)=>new Promise(async(E,_)=>{var N;await this.sendMessageBefore();const{event:k,...e}=I,n=Date.now(),O=sendMessageFormat({event:k,sn:+`${n}${F(1e3,9999)}`,time:n,valid:V(this,st).timeout,version:1,compress:!1,...e});V(this,st).debug&&(noLogEvents.includes(k)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",O),ignoreEvent.includes(k)||V(this,Rt).call(this,"req",O)),u&&V(this,qt).call(this,O,{resolve:E,reject:_});const $=com.quick.voice.proto.CommonReq.encode(O).finish();(N=V(this,lt))==null||N.sendMessage($)}));Z(this,"emitNotify",async(I,u)=>{const E=V(this,kt)[I]||[];for(const _ of E){const{callback:k=async()=>{}}=_;await k(u)}});Z(this,"addNotify",(I,u=!1)=>{const{event:E,sn:_=ht(32)}=I;V(this,kt)[E]||(V(this,kt)[E]=[]);const k=V(this,kt)[E],e=k.findIndex(n=>n.sn===_);return e!==-1&&k.splice(e,1),u?k.unshift(I):k.push(I),_});Z(this,"removeNotify",(I=[])=>{if(I.length===0)Ot(this,kt,{});else{const u=Object.keys(V(this,kt));for(const E of u)V(this,kt)[E]=V(this,kt)[E].filter(_=>!I.includes(_.sn||""))}V(this,st).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",V(this,kt))});Ot(this,st,{...V(this,st),...I})}}lt=new WeakMap,st=new WeakMap,yt=new WeakMap,_t=new WeakMap,kt=new WeakMap,Et=new WeakMap,xt=new WeakMap,Nt=new WeakMap,At=new WeakMap,Rt=new WeakMap,qt=new WeakMap,Dt=new WeakMap,Ct=new WeakMap;var y=Object.defineProperty,x=a=>{throw TypeError(a)},g=(a,I,u)=>I in a?y(a,I,{enumerable:!0,configurable:!0,writable:!0,value:u}):a[I]=u,h=(a,I,u)=>g(a,typeof I!="symbol"?I+"":I,u),b=(a,I,u)=>I.has(a)||x("Cannot "+u),o=(a,I,u)=>(b(a,I,"read from private field"),u?u.call(a):I.get(a)),f=(a,I,u)=>I.has(a)?x("Cannot add the same private member more than once"):I instanceof WeakSet?I.add(a):I.set(a,u),p=(a,I,u,E)=>(b(a,I,"write to private field"),I.set(a,u),u),d,c,l;class K{constructor(I){f(this,d,new Map),f(this,c,[]),h(this,"index"),h(this,"setCondition",(u,E)=>{o(this,d).set(u,E),E&&o(this,l).call(this)}),h(this,"addTask",(u,E,_={})=>{const k={key:"",strict:!1,describe:"",..._};let{key:e,strict:n,describe:O}=k;e?this.clear([e]):e=`${this.index++}`;const $={key:e,func:u,conditionKeys:E,describe:O,strict:n};return o(this,c).unshift($),this.checkConditions(E)&&(u(),n===!1&&this.clear([e])),e}),h(this,"clear",(u=[])=>{if(u.length===0){p(this,c,[]);return}for(const E of u){const _=o(this,c).findIndex(k=>k.key===E);_!==-1&&o(this,c).splice(_,1)}}),h(this,"getConditions",()=>Object.fromEntries(o(this,d))),h(this,"getTasks",()=>{const u=[];for(const E of o(this,c)){const{key:_,describe:k,conditionKeys:e}=E;u.push({key:_,describe:k,conditionKeys:e})}return u}),h(this,"checkConditions",u=>{let E=!0;for(const _ of u)if(o(this,d).get(_)===!1){E=!1;break}return E}),f(this,l,()=>{const u=o(this,c).length;for(let E=u;E>0;E--){const _=E-1,k=o(this,c)[_],{conditionKeys:e,func:n,strict:O}=k;this.checkConditions(e)&&(n(),O===!1&&o(this,c).splice(_,1))}}),this.index=0;for(const u of I)o(this,d).set(u,!0)}}d=new WeakMap,c=new WeakMap,l=new WeakMap;class RoomBase{constructor(){Z(this,"options",{appid:"",sdkToken:"",roomId:"",userId:"",callType:0,debug:!1,newPublishAutoSubscribe:!0});Z(this,"prohibitNotify",!1);Z(this,"isEarly",!1);Z(this,"taskQueue",new K(["createWs","createSession","ice","joinRoom","createTrack","subscribe","closeTrack"]));Z(this,"roomState","ready");Z(this,"createAt",Date.now());Z(this,"cwsIns",new CallsWebSocket);Z(this,"peerIns",new RTCPeerConnection({bundlePolicy:"max-bundle"}));Z(this,"transceiverMap",new Map);Z(this,"userMap",new Map);Z(this,"mediaDevicesErrInfo",{microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""});Z(this,"initAsyncQueue",()=>{this.taskQueue.clear(),this.taskQueue.setCondition("createWs",!0),this.taskQueue.setCondition("createSession",!1),this.taskQueue.setCondition("ice",!1)});Z(this,"getRoomInfo",()=>{const{options:I,roomState:u,createAt:E}=this;return{...I,roomState:u,createAt:E}});Z(this,"setRoomState",I=>{this.roomState=I;const u=enum_roomState[I],E={state:I,stateStr:u};this.cwsIns.emitNotify("onRoomState",{code:200,data:E,desc:"room state is change."})});Z(this,"setOptions",async I=>{const u={...this.options,...I};this.options=u});Z(this,"initCwsCall",()=>{this.cwsIns=new CallsWebSocket({...this.options})});Z(this,"getMediaDevicesErrInfo",async()=>{try{const I=await navigator.mediaDevices.enumerateDevices();I.find(E=>E.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),I.find(E=>E.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(I){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe:error",I)}return this.mediaDevicesErrInfo});Z(this,"getUserMediaKey",(I,u)=>`${I}-${u}`);Z(this,"getCallActionMap",(I=0)=>{const E=Number(I).toString(2).padStart(4,"0").split(""),[_,k,e,n]=E;return{microphoneCamera_audio:!!Number(n),microphoneCamera_video:!!Number(e),screenSharing_video:!!Number(k),screenSharing_audio:!!Number(_)}});Z(this,"getAverageVolume",(I,u)=>{I.getByteFrequencyData(u);let E=0;for(let k=0;k<u.length;k++)E+=u[k];return Math.ceil(E/u.length)});Z(this,"getCallAction",async I=>{let u="";const E=k=>I.findIndex(({type:n,enabled:O=!0})=>n===k&&O)===-1?"0":"1";return u=`${E(0)}${u}`,u=`${E(1)}${u}`,u=`${E(2)}${u}`,u=`${E(3)}${u}`,parseInt(u,2)});Z(this,"getTrackNamesFormTracks",(I,u=[],E="trackName")=>{const _=[];for(const k of I){const{type:e}=k;if(u.length===0||u.includes(e)){const n=k[E];n&&_.push(`${n}`)}}return _});Z(this,"usersFilter",I=>ft(I,["id","isSelf","joinTime","tracks","callAction","callActionStr","callActionMap","network","updateStreams","permissions","isPublished"]).sort((_,k)=>_.id.localeCompare(k.id,"en")));this.initAsyncQueue()}}const createMutedAudioStream=()=>{const a=new AudioContext,I=a.createOscillator();I.type="sine",I.frequency.setValueAtTime(0,a.currentTime);const u=a.createGain();u.gain.value=0,I.connect(u),u.connect(a.destination),I.start();const E=a.createMediaStreamDestination();return u.disconnect(),I.connect(E),E.stream},createFakeVideoStream=(a=10,I=10,u=30)=>{const E=document.createElement("canvas"),_=E.getContext("2d");E.width=a,E.height=I;let k=0;return setInterval(()=>{_.clearRect(0,0,E.width,E.height);const O=_.createLinearGradient(0,0,E.width,E.height);O.addColorStop(0,`hsla(${k}, 100%, 50%, 0)`),O.addColorStop(1,`hsla(${k+120}, 100%, 50%, 0)`),_.fillStyle=O,_.fillRect(0,0,E.width,E.height),k=(k+1)%360},100),E.captureStream(u)};class RoomMedias extends RoomBase{constructor(){super();Z(this,"mediaDevices",[]);ut(this,vt,new Map);ut(this,wt,new Map);ut(this,bt,new Map);ut(this,St,new Map);ut(this,Ut,()=>{for(const u of mediaType_keys)switch(u){case"microphoneCamera_audio":V(this,St).set("microphoneCamera_audio",createMutedAudioStream());break;case"microphoneCamera_video":V(this,St).set("microphoneCamera_video",createFakeVideoStream());break;case"screenSharing_audio":V(this,St).set("screenSharing_audio",createMutedAudioStream());break;case"screenSharing_video":V(this,St).set("screenSharing_video",createFakeVideoStream());break}});Z(this,"getPhoneyStreams",u=>V(this,St).get(u));ut(this,Mt,()=>{V(this,wt).set("microphoneCamera_audio",{}),V(this,wt).set("microphoneCamera_video",{width:{ideal:1920},height:{ideal:1080},frameRate:{min:10,ideal:30}}),V(this,wt).set("screenSharing_video",{width:{ideal:1920},height:{ideal:1080},frameRate:{min:10,ideal:30}}),V(this,wt).set("screenSharing_audio",{})});ut(this,Pt,()=>{V(this,vt).set("audioinput","default"),V(this,vt).set("videoinput","default"),V(this,vt).set("audiooutput","default")});Z(this,"emitNotifyUpdateUsersStreams",async u=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:u,desc:"users streams is change."})});Z(this,"initUserMediaStreamContext",async(u,E,_)=>{var O;const[k]=_.getTracks();if(!k){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: tracks.length is 0.",{userId:u,mediaType:E,stream:_});return}this.removeUserMediaStreamContext(u,E);const e=this.getUserMediaKey(u,E),{kind:n}=k;switch(n){case"audio":{const $=new AudioMediaContext(k);V(this,bt).set(e,$)}break;case"video":{const $=new VideoMediaContext(k);V(this,bt).set(e,$)}break}{const $=this.getUserMediaStreamContext(u,E);if($&&$.kind==="audio")try{const N=V(this,vt).get("audiooutput");(O=$.audioContext)==null||O.setSinkId(N)}catch(N){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error",N)}}});Z(this,"getUserMediaStreamContext",(u,E)=>{const _=this.getUserMediaKey(u,E);return V(this,bt).get(_)});Z(this,"getUserAudioMediaStreamContext",(u,E)=>{const _=this.getUserMediaKey(u,E);return V(this,bt).get(_)});Z(this,"removeUserMediaStreamContext",(u,E)=>{const _=this.getUserMediaKey(u,E),k=V(this,bt).get(_);k==null||k.stop(),V(this,bt).delete(_)});Z(this,"getUserStream",(u,E)=>{const _=this.getUserMediaStreamContext(u,E);return(_==null?void 0:_.getStream())||new MediaStream});Z(this,"getUserStreams",(u,E=[])=>{E.length===0&&(E=mediaType_keys);const _={};for(const k of E){const e=this.getUserStream(u,k);_[k]=e}return _});Z(this,"removeUserStreams",async(u,E=[])=>{E.length===0&&(E=mediaType_keys);for(const _ of E)this.removeUserMediaStreamContext(u,_)});Z(this,"clearUserStreams",()=>{const u=V(this,bt).values();for(const E of u)E.stop();Ot(this,bt,new Map)});Z(this,"setMediaTrackConstraints",async(u,E)=>{V(this,wt).set(u,E);const k=this.getUserStream(this.options.userId,u).getTracks();if(k.length!==0)for(const e of k){const O={...e.getConstraints(),...E};await e.applyConstraints(O)}});Z(this,"initLocalStream",async u=>{const{userId:E}=this.options,_=V(this,wt).get(u);switch(this.removeUserMediaStreamContext(E,u),u){case"microphoneCamera_audio":{const k=V(this,vt).get("audioinput"),e=await navigator.mediaDevices.getUserMedia({audio:{deviceId:k,..._},video:!1});await this.initUserMediaStreamContext(E,"microphoneCamera_audio",e)}break;case"microphoneCamera_video":{const k=V(this,vt).get("videoinput"),e=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:k,..._}});await this.initUserMediaStreamContext(E,"microphoneCamera_video",e)}break;case"screenSharing_audio":{const k=await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,..._}),e=k.getTracks();for(const n of e){const{kind:O}=n,$=new MediaStream;$.addTrack(n),k.removeTrack(n),O==="audio"&&await this.initUserMediaStreamContext(E,"screenSharing_audio",$),O==="video"&&await this.initUserMediaStreamContext(E,"screenSharing_video",$)}}break;case"screenSharing_video":{const k=await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,..._});await this.initUserMediaStreamContext(E,"screenSharing_video",k)}break}{this.emitNotifyUpdateUsersStreams([{userId:E,updateStreams:{[u]:!0}}]);const k=this.getUserStreams(E);this.cwsIns.emitNotify("onLocalStream",{code:200,data:k,desc:"local stream is change."})}});ut(this,Tt,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(u=>{this.mediaDevices=u}).catch(function(u){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",u)}),this.mediaDevices));ut(this,Bt,()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await V(this,Tt).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),V(this,Tt).call(this)});Z(this,"getMediaDeviceKind",u=>V(this,vt).get(u));Z(this,"setDeviceKind",async(u,E)=>{if(V(this,vt).set(u,E),u==="audiooutput"){const _=V(this,bt).values();for(const k of _)k.kind==="audio"&&"setSinkId"in HTMLMediaElement.prototype&&k.audioContext.setSinkId(E)}});Z(this,"setAudioOutputDevice",u=>this.setDeviceKind("audiooutput",u));Z(this,"getEnumerateDevices",async u=>(await V(this,Tt).call(this),this.mediaDevices.filter(_=>_.kind===u)));Z(this,"getEnumerateAudioinputDevices",()=>this.getEnumerateDevices("audioinput"));Z(this,"getEnumerateAudioOutputDevices",()=>this.getEnumerateDevices("audiooutput"));Z(this,"getEnumerateVideoinputDevices",()=>this.getEnumerateDevices("videoinput"));V(this,Bt).call(this),V(this,Pt).call(this),V(this,Mt).call(this),V(this,Ut).call(this)}}vt=new WeakMap,wt=new WeakMap,bt=new WeakMap,St=new WeakMap,Ut=new WeakMap,Mt=new WeakMap,Pt=new WeakMap,Tt=new WeakMap,Bt=new WeakMap;class RoomUsers extends RoomMedias{constructor(){super();Z(this,"getMaxVolumeUser",()=>{const u=Array.from(this.userMap.values(),({id:_})=>_);if(u.length===0)return;let E=[];for(const _ of u){const k=this.getUserMediaStreamContext(_,"microphoneCamera_audio");if(!k||k.kind!=="audio")continue;const e=k.getVolume();E.push({id:_,volume:e})}return E=E.sort((_,k)=>_.volume-k.volume>0?-1:1),E[0]});Z(this,"setAudioFilter",async(u={})=>{const E=await this.getUsersId();for(const _ of E){{const k=this.getUserMediaStreamContext(_,"microphoneCamera_audio");(k==null?void 0:k.kind)==="audio"&&(k==null||k.setFilter(u))}{const k=this.getUserMediaStreamContext(_,"screenSharing_audio");(k==null?void 0:k.kind)==="audio"&&(k==null||k.setFilter(u))}}});Z(this,"setEnhanceGain",async(u,E,_)=>{const k=this.getUserMediaStreamContext(u,E);(k==null?void 0:k.kind)==="audio"&&(k==null||k.setEnhanceGain(_))});Z(this,"setVolume",(u,E,_)=>{const k=this.getUserMediaStreamContext(u,E);(k==null?void 0:k.kind)==="audio"&&(k==null||k.setVolumeGain(_))});Z(this,"getVolume",(u,E)=>{const _=this.getUserMediaStreamContext(u,E);let k=0;return(_==null?void 0:_.kind)==="audio"&&(k=_==null?void 0:_.getVolume()),k});Z(this,"clearUsers",()=>{this.userMap=new Map});Z(this,"removeUsers",async u=>{for(const E of u)this.userMap.delete(E),await this.removeUserStreams(E)});Z(this,"createUser",async u=>{const E=Date.now(),_={id:u,permissions:0,callAction:0,callActionStr:"",callActionMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},callState:0,isSelf:u===this.options.userId,isPublished:!1,joinTime:E,updateAt:E,network:{egress:0,ingress:0},tracks:[],updateStreams:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1}};this.userMap.set(u,_)});Z(this,"getUser",async u=>(this.userMap.has(u)||await this.createUser(u),this.userMap.get(u)));Z(this,"getUsers",async(u=[])=>{u.length===0&&(u=[...this.userMap.keys()]);const E=[];for(const _ of u){const k=await this.getUser(_);E.push(k)}return E});Z(this,"getAllUserTrackMids",async()=>{const u=await this.getUsers(),E=[];for(const _ of u){const{tracks:k=[]}=_;for(const e of k)E.push(e.mid)}return E});Z(this,"getUserTrackByTrackName",async u=>{const E=await this.getUsers(),_=[];for(const k of E){const{tracks:e=[]}=k;for(const n of e){const{trackName:O}=n;u.includes(O)&&_.push(n)}}return _});Z(this,"getUserTrackFromMid",async u=>{const E=await this.getUsers();let _;for(const k of E){const{tracks:e=[]}=k;for(const n of e)if(n.mid===u){_=n;break}}return _});Z(this,"checkUserInRoom",u=>this.userMap.has(u));Z(this,"getUsersId",async()=>[...this.userMap.keys()]);Z(this,"getCaller",async()=>await this.getUser(this.options.userId));Z(this,"updateIsPublished",async(u,E=!1)=>{const _=await this.getUser(u);_.isPublished=E});Z(this,"setUserUpdateStreams",async(u,E,_=!0)=>{const k=await this.getUser(u),e={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};e[E]=_,k.updateStreams=e});Z(this,"updateUsertracks",async(u,E=[],_)=>{const k=await this.getUser(u);_&&(E=[...k.tracks,...E]),E=E.filter(({mid:O=""})=>O!==""),E=mt(E,["type"]),E=E.sort((O,$)=>O.type-$.type<0?-1:1);for(const O of E)O.userId=u,O.mediaType=mediaType_keys[O.type],O.enabled===void 0&&(O.enabled=!0);k.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const e=ft(k.tracks,["mediaType","enabled","mid","msid","trackName"]),n=ft(E,["mediaType","enabled","mid","msid","trackName"]);{const O="microphoneCamera_audio",$=n.find(q=>q.mediaType===O),N=e.find(q=>q.mediaType===O),D=JSON.stringify($)!==JSON.stringify(N);k.updateStreams[O]=D}{const O="microphoneCamera_video",$=n.find(q=>q.mediaType===O),N=e.find(q=>q.mediaType===O),D=JSON.stringify($)!==JSON.stringify(N);k.updateStreams[O]=D}{const O="screenSharing_audio",$=n.find(q=>q.mediaType===O),N=e.find(q=>q.mediaType===O),D=JSON.stringify($)!==JSON.stringify(N);k.updateStreams[O]=D}{const O="screenSharing_video",$=n.find(q=>q.mediaType===O),N=e.find(q=>q.mediaType===O),D=JSON.stringify($)!==JSON.stringify(N);k.updateStreams[O]=D}k.tracks=E});Z(this,"updateUserCallAction",async(u,E=0)=>{const _=await this.getUser(u);_.callAction=E,_.callActionStr=E.toString(2).padStart(4,"0"),_.callActionMap=this.getCallActionMap(E)});Z(this,"updateUserNetwork",async(u,E={egress:5,ingress:5})=>{const _=await this.getUser(u);_.network=E});Z(this,"updateUserPermissions",async(u,E)=>{if(E){const _=await this.getUser(u);_.permissions=E}});Z(this,"updateUserBase",async u=>{const E=await this.getUser(u);E.isSelf=u===this.options.userId,E.updateAt=Date.now()});Z(this,"updateUsers",async u=>{for(const E of u){const{id:_,tracks:k,callAction:e,permissions:n,isPublished:O}=E;await this.updateUserBase(_),await this.updateIsPublished(_,O),await this.updateUserPermissions(_,n),await this.updateUsertracks(_,k,!0),await this.updateUserCallAction(_,e),await this.updateUserNetwork(_)}});Z(this,"emitNotifyUpdateUser",async u=>{const E=await this.getUsers([u]),[_]=this.usersFilter(E);this.cwsIns.emitNotify("onRoomUser",{code:200,data:_,desc:"user info is change."})});Z(this,"emitNotifyUpdateUsers",async()=>{const u=await this.getUsers(),E=this.usersFilter(u);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:E,desc:"all users info is change."})})}}class RoomPeer extends RoomUsers{constructor(){super();Z(this,"getPeerStatsTimer",0);Z(this,"reports",[]);Z(this,"peerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});Z(this,"connectedResolveMap",new Map);Z(this,"initPeer",()=>{this.peerIns=new RTCPeerConnection({bundlePolicy:"max-bundle"}),this.transceiverMap=new Map,V(this,Lt).call(this),V(this,Zt).call(this)});Z(this,"setMediaDeviceKind",async(u,E)=>{await this.setDeviceKind(u,E);const _=await this.getCaller(),{id:k,tracks:e=[]}=_;switch(u){case"audioinput":this.getUserMediaStreamContext(k,"microphoneCamera_audio")&&await this.initLocalStream("microphoneCamera_audio"),e.find($=>$.mediaType==="microphoneCamera_audio")&&await this.replaceSenderStream(["microphoneCamera_audio"],!0);break;case"videoinput":this.getUserMediaStreamContext(k,"microphoneCamera_video")&&await this.initLocalStream("microphoneCamera_video"),e.find($=>$.mediaType==="microphoneCamera_video")&&await this.replaceSenderStream(["microphoneCamera_video"],!0);break}});Z(this,"replaceSenderStream",async(u=[],E)=>{const{userId:_}=this.options;u.length===0&&(u=mediaType_keys);for(const k of u){const e=this.transceiverMap.get(k);let n;if(e){const{sender:O}=e;E?n=this.getUserStream(_,k):n=this.getPhoneyStreams(k);const[$]=n.getTracks();O.replaceTrack($)}}});Z(this,"getSenderTracks",(u=[])=>{const E=[];for(const _ of u){const k=this.transceiverMap.get(_);if(!k)continue;const{mid:e,sender:n}=k,{track:O}=n;if(!O)continue;const{id:$,enabled:N}=O,q={type:mediaType_keys.findIndex(P=>P===_),enabled:N,trackName:$,location:"local",mid:e};E.push(q)}return E});Z(this,"addSenders",async(u=[])=>{u.length===0&&this.peerIns.addTransceiver("audio",{direction:"sendonly"});const E=[];for(const _ of u){if(this.transceiverMap.has(_))continue;const k=this.getPhoneyStreams(_),[e]=k.getTracks(),n=this.peerIns.addTransceiver(e,{direction:"sendonly"});this.transceiverMap.set(_,n),E.push(_)}if(u.length===0||E.length){const _=await this.peerIns.createOffer();if(this.options.debug){const k=libExports.parse(_.sdp),e=ft(k.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->Breathe: setLocalDescription",{msidArr:e,sdpJson:k,description:_})}await this.peerIns.setLocalDescription(_)}return E});Z(this,"removeSenders",async(u=[])=>{for(const E of u)this.transceiverMap.has(E)&&this.transceiverMap.delete(E)});Z(this,"clearTransceivers",async()=>{const u=await this.getAllUserTrackMids(),E=this.peerIns.getTransceivers();for(const _ of E){const{mid:k}=_;Number(k)===0||u.includes(k)||(_.stop(),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->Breathe: clearTransceivers: ${k} is stop.`,_))}});Z(this,"onSubscribeUserTracks",u=>{let E=0;return new Promise(async _=>{const k=[];for(const e of u){const{tracks:n=[]}=e;for(const O of n){const{trackName:$,mid:N}=O,[D]=await this.getUserTrackByTrackName([$]);k.push({...D,mid:N})}}{let e=[];const n=async()=>{clearTimeout(E);const $=new Map;for(const D of e){const{userId:q,mediaType:P}=D;if(!q||!P)continue;$.has(q)||$.set(q,{userId:q,tracks:[],updateStreams:{}});const Q=$.get(q);Q.tracks.push(D),Q.updateStreams[P]=!0}const N=[...$.values()];for(const D of N){const{userId:q,tracks:P}=D;await this.updateUsertracks(q,P,!0)}await this.emitNotifyUpdateUsersStreams(N),this.peerIns.removeEventListener("track",O),_(!0)},O=async $=>{const{streams:N,transceiver:D}=$,[q]=N,{mid:P,receiver:j}=D,{track:Q}=j,{id:J,kind:z}=Q,Y=k.find(nt=>nt.mid===`${P}`);if(!Y)return;const{userId:et,mediaType:tt}=Y;if(!(!et||!tt)){if(await this.initUserMediaStreamContext(et,tt,q),z==="audio"){const nt=this.getUserMediaStreamContext(et,tt);(nt==null?void 0:nt.kind)==="audio"&&nt.setMute(!1)}{const nt={...Y,mid:P,msid:J};e.push(nt)}this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->Breathe: await subscribe ${e.length}/${k.length}`,{mediaType:tt,mid:P,userTrack:Y,e:$}),k.length===e.length&&n()}};this.peerIns.addEventListener("track",O),E=setTimeout(()=>n(),5*1e3)}})});ut(this,Lt,()=>{let u=0;const E=()=>{this.setRoomState("closed")};this.peerIns.onconnectionstatechange=()=>{const _=this.peerIns.connectionState;switch(clearTimeout(u),_){case"connected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${_}`),this.taskQueue.setCondition("ice",!0);break;case"disconnected":u=setTimeout(E,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":E(),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}}});Z(this,"closeUserTracks",async(u,E=[],_=!1)=>{const k=[];for(const $ of E){const{trackName:N,msid:D}=$;k.push(N),D&&k.push(D)}const e=$=>k.includes($),n=await this.getUser(u);if(!n)return;for(const $ of n.tracks){const{trackName:N,msid:D,userId:q,mediaType:P}=$;!q||!P||!e(N)||(this.removeUserMediaStreamContext(q,P),D&&delete $.msid)}if(_){const $=n.tracks.filter(({trackName:N})=>!e(N));await this.updateUsertracks(u,$,!1)}const O=this.peerIns.getTransceivers();for(const $ of O){const{sender:N,receiver:D}=$;N.track&&e(N.track.id)&&(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->Breathe: sender: ${N.track.id} is stop.`,$),N.track.enabled=!1,N.track.stop(),this.peerIns.removeTrack(N),$.stop()),D.track&&e(D.track.id)&&(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->Breathe: receiver: ${D.track.id} is stop.`,$),D.track.enabled=!1,D.track.stop(),$.stop())}});Z(this,"createOffer",async()=>{const u=await this.peerIns.createOffer();if(this.options.debug){const E=libExports.parse(u.sdp),_=ft(E.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->Breathe: createOffer",{msidArr:_,sdpJson:E,description:u})}await this.peerIns.setLocalDescription(u)});Z(this,"createAnswer",async()=>{const u=await this.peerIns.createAnswer();if(this.options.debug){const E=libExports.parse(u.sdp),_=ft(E.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->Breathe: createAnswer",{msidArr:_,sdpJson:E,description:u})}await this.peerIns.setLocalDescription(u)});Z(this,"getSdp",()=>{var u;return(u=this.peerIns.localDescription)==null?void 0:u.sdp});Z(this,"setRemoteDescription",async u=>{if(this.options.debug){const E=libExports.parse(u.sdp),_=ft(E.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->Breathe: setRemoteDescription",{msidArr:_,sdpJson:E,description:u})}return await this.peerIns.setRemoteDescription(u),u});Z(this,"getPeerNetwork",()=>this.peerNetwork);Z(this,"setCallStrategy",async(u,E=[])=>{E.length===0&&(E=mediaType_keys);let _="balanced";switch(u){case"qualityPriority":_="maintain-resolution";break;case"fluencyPriority":_="maintain-framerate";break;case"balancedDowngrade":_="balanced";break}const k=await this.getCaller(),e=Array.from(k.tracks,({trackName:O})=>O),n=this.peerIns.getSenders();for(const O of n){const{track:$}=O;if(!$||!e.includes($.id))continue;const N=O.getParameters();O.setParameters({...N,degradationPreference:_})}});Z(this,"setRTCRtpSenderParameters",u=>{try{const E=this.peerIns.getSenders();for(const _ of E){const k=_.getParameters();_.setParameters({...k,...u})}}catch(E){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",E)}});Z(this,"getReportsByMid",async(u=[])=>u.length===0?this.reports:this.reports.filter(E=>u.includes(E.mid)));Z(this,"getRoomNetwork",()=>this.peerNetwork);ut(this,jt,async()=>{try{const u=await this.peerIns.getStats(),E=["inbound-rtp","remote-inbound-rtp","outbound-rtp"],k=[...u.values()].filter(nt=>E.includes(nt.type));let e=0,n=0,O=0,$=0,N=0,D=0,q=[],P=[];for(const nt of this.reports){const{packetsSent:dt,packetsLost:it}=nt;dt&&(O+=dt),it&&($+=it)}this.reports=k;for(const nt of this.reports){const{bytesReceived:dt,bytesSent:it,packetsSent:at,packetsLost:ct,jitter:ot,roundTripTime:rt}=nt;dt&&(e=dt),it&&(n=it),at&&(N+=at),ct&&(D+=ct),rt&&q.push((rt*100).toFixed(2)),ot&&P.push(ot.toFixed(2))}P.sort().reverse(),q.sort().reverse();const j=N-O,Q=D-$,J=j===0?"0.00":(Q/j).toFixed(2),[z="0"]=q,[Y="0"]=P,et={inboundBytes:e,outboundBytes:n,lostRate:J,roundTripTime:z,jitter:Y};this.peerNetwork=et;const tt=(nt,dt,it)=>{const at=Number(nt),ct=Number(dt),ot=Number(it);let rt="0";return at<.03&&ct<100&&ot<.05?rt="5":at<.06&&ct<160&&ot<.1?rt="4":at<.1&&ct<250&&ot<.15?rt="3":at<.15&&ct<400&&ot<.2?rt="2":rt="1",Number(rt)};{const nt=tt(J,z,Y),dt=await this.getCaller(),{network:it}=dt,at={egress:nt,ingress:nt},ct=JSON.stringify(it)!==JSON.stringify(at);if(await this.updateUserNetwork(this.options.userId,at),ct){this.emitNotifyUpdateUsers();const{userId:ot,roomId:rt}=this.options;this.cwsIns.sendMessage({event:"networkQualityChange",data:{...at,userId:ot,roomId:rt}},!1)}}}catch(u){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: setNetQuality is err.",u)}});ut(this,Zt,()=>{const u=async()=>{this.peerIns.connectionState!=="connected"||!this.options.roomId||V(this,jt).call(this)};this.getPeerStatsTimer=setInterval(u,1*1e3)});Z(this,"stopGetPeerStats",()=>clearInterval(this.getPeerStatsTimer))}}Lt=new WeakMap,jt=new WeakMap,Zt=new WeakMap;class RoomCalls extends RoomPeer{constructor(){super();Z(this,"sdk_service_version","1.0.5");Z(this,"setLocalStream",(u,E)=>new Promise(async(_,k)=>{try{const{userId:e}=this.options;if(E?await this.initLocalStream(u):this.removeUserMediaStreamContext(e,u),u==="screenSharing_audio"||u==="screenSharing_video"){{const $=this.getUserStream(e,"screenSharing_audio").getTracks();for(const N of $)N.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}{const $=this.getUserStream(e,"screenSharing_video").getTracks();for(const N of $)N.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}const n=this.getUserStreams(e);this.cwsIns.emitNotify("onLocalStream",{code:200,data:n,desc:"local stream is change."}),_(n)}catch(e){k(e)}}));Z(this,"addNotify",u=>this.cwsIns.addNotify(u));ut(this,Ft,async u=>{const{roomId:E}=this.options;if(!E)return;const{id:_,tracks:k=[]}=await this.getCaller();if(k.length===0)return;const e=k.filter(n=>n.mediaType&&u.includes(n.mediaType));this.cwsIns.sendMessage({event:"pubNotify",data:{roomId:E,user:{id:_,tracks:e}}})});Z(this,"joinRoom",async u=>(this.setOptions(u),await this.createWs(),new Promise((E,_)=>{this.clearUsers();let k="";const e=async()=>{this.taskQueue.clear([k]),await this.emitNotifyUpdateUsers();const O=await this.getUsers();this.taskQueue.setCondition("joinRoom",!0),E(O)},n=async()=>{try{this.taskQueue.setCondition("joinRoom",!1);const{roomId:O,userId:$,callType:N}=this.options;this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:N,roomId:O,user:{id:$,tracks:[],callAction:0}}}).then(async D=>{const{code:q=0,desc:P="服务器繁忙",data:j}=D;if(q!==200)return _(P);const{roomId:Q="",roomUsers:J=[]}=j;if(Q!==O)return _("加入的房间不匹配");this.createSession(),await this.updateUsers(J),e()})}catch(O){this.taskQueue.setCondition("joinRoom",!0),_(`加入房间失败: ${O.message||O||"服务器繁忙"}`)}};k=this.taskQueue.addTask(n,["createWs","joinRoom"],{describe:"joinRoom",strict:!0})})));Z(this,"quitRoom",()=>new Promise(async u=>{const{roomId:E,userId:_}=this.options,k={roomId:E,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:k}),u(!0)}));Z(this,"quitRoomEx",()=>new Promise(async u=>{const{roomId:E,userId:_}=this.options,k={roomId:E,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:k}),u(!0)}));Z(this,"syncRoomInfo",()=>new Promise((u,E)=>{const _=async()=>{const{userId:k}=this.options,e=await this.getUser(k),{id:n=k,callAction:O=0}=e;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:n,callAction:O}}}).then(async $=>{if($.code!==200)return E($.desc);const N=$.data.users;this.clearUsers(),await this.updateUsers(N),await this.updateUsertracks(e.id,e.tracks,!1),await this.subscribe();{const D=await this.getUsers();u(D)}}).catch($=>E($))};this.taskQueue.addTask(_,["createWs"],{describe:"syncRoomInfo"})}));Z(this,"publish",u=>new Promise(async(E,_)=>{const k=async()=>{try{u.includes("screenSharing_audio")&&!u.includes("screenSharing_video")&&(u=[...u,"screenSharing_video"]);const e=await this.getCaller();for(const D of u)this.getUserStream(e.id,D).getTracks().length===0&&await this.setLocalStream(D,!0);const n=[];for(const D of u)this.getUserStream(e.id,D).getTracks().length!==0&&n.push(D);await this.createTrack(n),await this.replaceSenderStream(n,!0);const O=this.getSenderTracks(u),$=[...e.tracks,...O],N=await this.getCallAction($);await this.updateUsertracks(e.id,$,!0),V(this,Ft).call(this,u),await V(this,It).call(this,N);{await this.emitNotifyUpdateUsers();const D=await this.getCaller();E(D)}}catch(e){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: error",e);for(const n of u)await this.setLocalStream(n,!1);_(`publish is error: ${e.message||e}`)}};this.taskQueue.addTask(k,["createWs","createSession","ice","createTrack","subscribe"],{describe:"replaceSenderStream"})}));Z(this,"stopPublish",(u=[])=>new Promise((E,_)=>{const k=async()=>{try{this.taskQueue.setCondition("closeTrack",!1);const e=await this.getCaller();u.length===0&&(u=mediaType_keys);const n=e.tracks.filter(({mediaType:$})=>$&&u.includes($)),O=async()=>{this.taskQueue.setCondition("closeTrack",!0);const $=await this.getCaller();await this.emitNotifyUpdateUsers(),E($)};if(n.length===0)return O();await this.replaceSenderStream(u,!0),await this.removeSenders(u),await this.closeUserTracks(e.id,n,!0);{const $=await this.getCallAction(e.tracks);await V(this,It).call(this,$)}await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:n}}).then(async $=>{const{remoteSdp:N}=$.data;await this.setRemoteDescription({type:"answer",sdp:N})}),O()}catch(e){this.taskQueue.setCondition("closeTrack",!0),_(`stop publish is error: ${e.message||e}`)}};this.taskQueue.addTask(k,["createWs","createSession","ice","createTrack","subscribe"],{describe:"stopPublish"})}));Z(this,"subscribe",(u=[],E=3)=>new Promise((_,k)=>{const e=async()=>{try{this.taskQueue.setCondition("subscribe",!1);const n=await this.getUsers();let O=[];for(const q of n){const{isSelf:P,tracks:j=[]}=q;if(!P){const Q=j.filter(({trackName:J,mid:z=""})=>z!==""&&(u.includes(J)||u.length===0));Q.length!==0&&O.push({...q,tracks:Q})}}const $=async()=>{const q=Array.from(O,({id:j})=>j),P=await this.getUsers(q);await this.emitNotifyUpdateUsers(),this.taskQueue.setCondition("subscribe",!0),_(P)};if(O.length===0)return $();const N=[];for(const q of O){const{id:P,tracks:j}=q,Q=ft(j,["type","trackName"]),J={id:P,tracks:Q};N.push(J)}const D=async()=>{this.options.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: surplus subscribe count is ${E}`),await this.cwsIns.sendMessage({event:"subscribe",data:{users:N}}).then(async q=>{const{code:P=0,data:j,desc:Q}=q;if(P!==200){if(E>0)return await new Promise(Y=>setTimeout(()=>Y(!0),300)),E=E-1,D();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:u}),new Error(Q)}const{remoteSdp:J,users:z=[]}=j;this.onSubscribeUserTracks(z).then(async()=>{await this.renegotiate(),$()}),await this.setRemoteDescription({type:"offer",sdp:J})})};await D()}catch(n){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: error",n),this.taskQueue.setCondition("subscribe",!0),k(`subscribe is error: ${n.message||n}`)}};this.taskQueue.addTask(e,["createWs","createSession","ice","createTrack","closeTrack"],{describe:"subscribe"})}));Z(this,"stopSubscribe",(u=[])=>new Promise((E,_)=>{const k=async()=>{try{this.taskQueue.setCondition("closeTrack",!1);const e=await this.getUsers(),n=[];for(const $ of e){const{tracks:N=[]}=$;for(const D of N){const{type:q,mid:P,trackName:j,mediaType:Q,msid:J}=D;if(!(!Q||!J)&&(u.length===0||u.includes(j))){const z={type:q,mid:P,trackName:J};n.push(z),await this.closeUserTracks($.id,[D])}}}const O=async()=>{await this.emitNotifyUpdateUsers(),this.taskQueue.setCondition("closeTrack",!0),E(!0)};if(n.length===0)return O();await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:n}}).then(async $=>{const{remoteSdp:N}=$.data;await this.setRemoteDescription({type:"answer",sdp:N})}),O()}catch(e){this.taskQueue.setCondition("closeTrack",!0),_(`stop subscribe is error: ${e.message||e}`)}};this.taskQueue.addTask(k,["createWs","createSession","ice","createTrack","subscribe"],{describe:"closeTrack"})}));Z(this,"inactiveTracks",async(u,E)=>new Promise(async _=>{const k=await this.getCaller();if(!k)return;const{tracks:e=[]}=k,n=[...e];await this.replaceSenderStream(u,!0);for(let $ of n){const{mediaType:N}=$;if(N&&u.includes(N)){$.enabled=E;const q=this.getUserStream(k.id,N).getTracks();for(const P of q)P.enabled=E}}const O=await this.getCallAction(n);await V(this,It).call(this,O),await this.emitNotifyUpdateUsers(),_(!0)}));Z(this,"debugger",()=>new Promise(async(u,E)=>{await this.cwsIns.sendMessage({event:"debugger"},!1).then(async _=>{if(_.code!==200)return E(_.desc);u(!0)}).catch(_=>{E(_)})}));ut(this,It,async u=>new Promise(async(E,_)=>{const{roomId:k,userId:e}=this.options,n={roomId:k,user:{id:e,callAction:u}};await this.cwsIns.sendMessage({event:"updateCall",data:n}).then(async O=>{const{code:$=0}=O;if($!==200)return _(O);await this.updateUserCallAction(e,u),E(u)}).catch(O=>_(O))}));Z(this,"renegotiate",()=>new Promise(async(u,E)=>{await this.createAnswer(),await this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then(_=>{if(_.code!==200)return E("协商流错误");u(!0)}).catch(_=>{console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe:error",_),E(`协商流错误: ${_.message||_}`)})}));Z(this,"createWs",()=>new Promise(async(u,E)=>{try{if(["connecting","connected"].includes(this.cwsIns.state))return u(!0);this.taskQueue.setCondition("createWs",!1),this.cwsIns.clearEvents(),this.initPeer();const{appid:_}=this.options,{userId:k,sdkToken:e,roomId:n}=this.options;if(!_)return E("quickvo: createWs is error. You must first use QuickVO.setOptions to set the appid.");if(!k)return E("quickvo: createWs is error. You must first use QuickVO.setOptions to set the userId.");const O={a:e,b:k,c:_,r:n,v:this.sdk_service_version};this.isEarly&&(O.i=ht()),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs",O);const $=btoa(encodeURI(JSON.stringify(O)));await this.cwsIns.connect($),this.taskQueue.setCondition("createWs",!0),u(!0)}catch(_){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs is error.",_),E(_)}}));Z(this,"createSession",()=>{if(!["connecting","connected"].includes(this.roomState))return this.setRoomState("connecting"),new Promise(u=>{const E=async()=>{try{this.taskQueue.setCondition("createSession",!1),await this.addSenders(),await this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}).then(async _=>{const{code:k=0,desc:e,data:n}=_;if(k!==200)throw new Error(e);const{remoteSdp:O}=n;this.taskQueue.setCondition("ice",!1),await this.setRemoteDescription({type:"answer",sdp:O}),this.taskQueue.setCondition("createSession",!0),u(!0)})}catch(_){this.taskQueue.setCondition("createSession",!0),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo create session is error.",_)}};this.taskQueue.addTask(E,["createWs"],{key:"createSession",describe:"createSession"})})});Z(this,"createTrack",async u=>new Promise(E=>{const _=async()=>{try{this.taskQueue.setCondition("createTrack",!1);const k=await this.addSenders(u),e=this.getSenderTracks(k);if(e.length===0)return this.taskQueue.setCondition("createTrack",!0),E(!0);await this.cwsIns.sendMessage({event:"publish",data:{sdp:this.getSdp(),tracks:e,callAction:0}}).then(async n=>{const{code:O=0,desc:$,data:N}=n;if(O!==200)throw this.options.debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createTrack is error.",{mediaTypes:u}),new Error($);const{remoteSdp:D}=N;await this.setRemoteDescription({type:"answer",sdp:D}),this.taskQueue.setCondition("createTrack",!0),E(!0)})}catch{await this.removeSenders(u),this.taskQueue.setCondition("createTrack",!0),E(!0)}};this.taskQueue.addTask(_,["createWs","createSession","ice","subscribe","createTrack","closeTrack"],{describe:"createTrack"})}));Z(this,"earlyConnect",()=>{this.isEarly=!0,this.createWs(),this.createSession(),this.createTrack(["microphoneCamera_audio","microphoneCamera_video"])});this.setRoomState("ready")}}Ft=new WeakMap,It=new WeakMap;class Room extends RoomCalls{constructor(){super()}}class QuickVO extends Room{constructor(u){super();ut(this,gt,new Map);ut(this,Ht,()=>{{const u=async E=>{const{qualities:_=[]}=E.data,[k]=_;if(!(k&&k.userId===this.options.userId&&_.length===1)){for(const e of _){const{userId:n,egress:O,ingress:$}=e;this.checkUserInRoom(n)&&await this.updateUserNetwork(n,{egress:O,ingress:$})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:u},!0)}{const u=async E=>{const _=E.data.user;await this.updateUsers([_]),await this.updateUsertracks(_.id,_.track,!1),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:u},!0)}{const u=async E=>{await this.removeUsers([E.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:u},!0)}{const u=async E=>{const{user:_}=E.data,{id:k,tracks:e=[]}=_;await this.updateUserPermissions(k,3);const n=[];{const{tracks:O}=await this.getUser(k);for(const $ of e){const{mid:N,trackName:D}=$;if(O.find(P=>P.mid===N&&P.trackName===D))continue;n.push($)}}if(n.length!==0)if(await this.updateUsertracks(k,n,!0),this.options.newPublishAutoSubscribe){const O=this.getTrackNamesFormTracks(n);await this.subscribe(O)}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:u},!0)}{const u=async E=>{const{id:_,tracks:k}=E.data.user;_!==this.options.userId&&(await this.closeUserTracks(_,k,!0),await this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onCloseTrack",callback:u},!0)}{const u=async E=>{const{id:_,callAction:k}=E.data.user;this.checkUserInRoom(_)&&(await this.updateUserCallAction(_,k),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:u},!0)}{const u=async E=>{const{user:_}=E.data,{id:k,permissions:e=1}=_;e===1?await this.removeUsers([k]):e===3&&await this.updateUsers([_]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:u},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async u=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)});ut(this,zt,()=>{this.cwsIns.sendMessageBefore=async()=>{}});ut(this,Jt,()=>{this.cwsIns.onReconnectSuccess=async()=>{this.syncRoomInfo()}});ut(this,Wt,async()=>{});Z(this,"addRequestAnimationFrame",async(u,E)=>{{const k=V(this,gt).get(u);k&&cancelAnimationFrame(k)}const _=(k=Date.now())=>{E(k);const e=requestAnimationFrame(_);V(this,gt).set(u,e)};_()});Z(this,"clearRequestAnimationFrame",async(u=[])=>{u.length===0&&(u=[...V(this,gt).keys()]);const E=[];for(const _ of u){const k=V(this,gt).get(_);k&&(cancelAnimationFrame(k),E.push(k))}return E});Z(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(u),this.initCwsCall(),V(this,zt).call(this),V(this,Jt).call(this),V(this,Wt).call(this),V(this,Ht).call(this)}}gt=new WeakMap,Ht=new WeakMap,zt=new WeakMap,Jt=new WeakMap,Wt=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 a=requireParser(),I=requireWriter$1(),u=requireGrammar();return lib.grammar=u,lib.write=I,lib.parse=a.parse,lib.parseParams=a.parseParams,lib.parseFmtpConfig=a.parseFmtpConfig,lib.parsePayloads=a.parsePayloads,lib.parseRemoteCandidates=a.parseRemoteCandidates,lib.parseImageAttributes=a.parseImageAttributes,lib.parseSimulcastStreamList=a.parseSimulcastStreamList,lib}var libExports=requireLib();class AudioMediaContext{constructor(I){Z(this,"options",{autoGainControl:!1,noiseSuppression:!1,echoCancellation:!1});Z(this,"kind","audio");Z(this,"stream",new MediaStream);Z(this,"audio",new Audio);Z(this,"audioContext",new(window.AudioContext||window.webkitAudioContext));Z(this,"mediaStreamAudioSourceNode");Z(this,"autoGainNode");Z(this,"biquadFilterNode");Z(this,"delayNode");Z(this,"gainNode");Z(this,"analyserNode");Z(this,"analyserArrayData");Z(this,"stop",()=>{const I=this.stream.getTracks();for(const u of I)u.enabled=!1,u.stop(),this.stream.removeTrack(u)});Z(this,"replaceStream",I=>{this.stop();const[u]=I.getAudioTracks();this.stream.addTrack(u)});Z(this,"getStream",()=>this.mediaStreamAudioSourceNode.mediaStream);Z(this,"setMute",(I=!0)=>{I?this.analyserNode.disconnect(this.audioContext.destination):this.analyserNode.connect(this.audioContext.destination)});Z(this,"setEnhanceGain",async I=>{});Z(this,"setVolumeGain",I=>{this.gainNode.gain.setValueAtTime(I,this.audioContext.currentTime)});Z(this,"getVolume",()=>{const{analyserNode:I,analyserArrayData:u}=this;I.getByteFrequencyData(u);let E=0;for(let k=0;k<u.length;k++)E+=u[k];return Math.ceil(E/u.length)});Z(this,"setFilter",(I={})=>{this.options={...this.options,...I};const{autoGainControl:u,noiseSuppression:E,echoCancellation:_}=this.options,{mediaStreamAudioSourceNode:k,autoGainNode:e,biquadFilterNode:n,delayNode:O,gainNode:$}=this,N=k;return u&&N.connect(e),E&&N.connect(n),_&&N.connect(O),N.connect($),I});this.stream.addTrack(I),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:u,analyserNode:E}=this;u.connect(E),this.audioContext.state==="suspended"&&(this.audioContext.resume(),document.addEventListener("click",()=>this.audioContext.resume(),{once:!0})),this.setFilter()}}class VideoMediaContext{constructor(I){Z(this,"kind","video");Z(this,"stream",new MediaStream);Z(this,"stop",()=>{const I=this.stream.getTracks();for(const u of I)u.enabled=!1,u.stop(),this.stream.removeTrack(u)});Z(this,"replaceStream",I=>{this.stop();const[u]=I.getVideoTracks();this.stream.addTrack(u)});Z(this,"getStream",()=>this.stream);Z(this,"getTrack",()=>this.stream.getTracks()[0]);this.stream.addTrack(I)}}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",closed:"已关闭"};pt(enum_roomState);var C=Object.defineProperty,R=a=>{throw TypeError(a)},S=(a,I,u)=>I in a?C(a,I,{enumerable:!0,configurable:!0,writable:!0,value:u}):a[I]=u,l$1=(a,I,u)=>S(a,typeof I!="symbol"?I+"":I,u),v=(a,I,u)=>I.has(a)||R("Cannot "+u),t=(a,I,u)=>(v(a,I,"read from private field"),u?u.call(a):I.get(a)),c$1=(a,I,u)=>I.has(a)?R("Cannot add the same private member more than once"):I instanceof WeakSet?I.add(a):I.set(a,u),i=(a,I,u,E)=>(v(a,I,"write to private field"),I.set(a,u),u),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(I){c$1(this,s,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,sendBeforAutoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4,checkReconnect:u=>!0,onReconnectSuccess:async u=>{},onReconnectStop:async u=>{},getHeartbeatMsg:()=>JSON.stringify({event:"heartbeat"}),onMessage:u=>{}}),l$1(this,"ws"),c$1(this,r,-1),c$1(this,h$1,-1),c$1(this,p$1,0),c$1(this,m,0),c$1(this,f$1,!1),c$1(this,w,u=>{}),l$1(this,"close",async(u=1e3,E="correctly close.")=>{var _;this.ws&&(i(this,f$1,!0),t(this,d$1).call(this),(_=this.ws)==null||_.close(u,E))}),l$1(this,"connect",()=>new Promise(async u=>{i(this,w,u),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$1(this,"reconnect",async u=>new Promise(E=>{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 _=k=>{t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: ${k}`),t(this,s).onReconnectStop({msg:k}),E(k)};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(u))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)}`,u),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(k){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->pr-ws: onReconnectSuccess is error",k)}E(!0)},t(this,s).reconnectIntervalTime))})),l$1(this,"sendMessage",async u=>{var E;(!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())),(E=this.ws)==null||E.send(u)}),c$1(this,x$1,()=>{const u=Date.now();return t(this,h$1)===-1&&i(this,h$1,u+t(this,s).reconnectTime),!(u>t(this,h$1))}),c$1(this,g$1,u=>{const{data:E}=u;t(this,s).onMessage(E)}),c$1(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$1(this,B,u=>{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.",u)}),c$1(this,y$1,u=>{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: ${u.code}, permanentClosed is ${t(this,f$1)}.`,u),t(this,d$1).call(this),!t(this,f$1))return this.reconnect(u);this.ws=void 0}),c$1(this,T,()=>{i(this,m,setInterval(()=>{const u=t(this,s).getHeartbeatMsg();u&&this.sendMessage(u)},t(this,s).heartbeatIntervalTime))}),c$1(this,d$1,()=>{clearInterval(t(this,p$1)),clearInterval(t(this,m))}),i(this,s,{...t(this,s),...I}),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=a;function a(I,u){for(var E=new Array(arguments.length-1),_=0,k=2,e=!0;k<arguments.length;)E[_++]=arguments[k++];return new Promise(function(O,$){E[_]=function(D){if(e)if(e=!1,D)$(D);else{for(var q=new Array(arguments.length-1),P=0;P<q.length;)q[P++]=arguments[P];O.apply(null,q)}};try{I.apply(u||null,E)}catch(N){e&&(e=!1,$(N))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(a){var I=a;I.length=function(n){var O=n.length;if(!O)return 0;for(var $=0;--O%4>1&&n.charAt(O)==="=";)++$;return Math.ceil(n.length*3)/4-$};for(var u=new Array(64),E=new Array(123),_=0;_<64;)E[u[_]=_<26?_+65:_<52?_+71:_<62?_-4:_-59|43]=_++;I.encode=function(n,O,$){for(var N=null,D=[],q=0,P=0,j;O<$;){var Q=n[O++];switch(P){case 0:D[q++]=u[Q>>2],j=(Q&3)<<4,P=1;break;case 1:D[q++]=u[j|Q>>4],j=(Q&15)<<2,P=2;break;case 2:D[q++]=u[j|Q>>6],D[q++]=u[Q&63],P=0;break}q>8191&&((N||(N=[])).push(String.fromCharCode.apply(String,D)),q=0)}return P&&(D[q++]=u[j],D[q++]=61,P===1&&(D[q++]=61)),N?(q&&N.push(String.fromCharCode.apply(String,D.slice(0,q))),N.join("")):String.fromCharCode.apply(String,D.slice(0,q))};var k="invalid encoding";I.decode=function(n,O,$){for(var N=$,D=0,q,P=0;P<n.length;){var j=n.charCodeAt(P++);if(j===61&&D>1)break;if((j=E[j])===void 0)throw Error(k);switch(D){case 0:q=j,D=1;break;case 1:O[$++]=q<<2|(j&48)>>4,q=j,D=2;break;case 2:O[$++]=(q&15)<<4|(j&60)>>2,q=j,D=3;break;case 3:O[$++]=(q&3)<<6|j,D=0;break}}if(D===1)throw Error(k);return $-N},I.test=function(n){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(n)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=a;function a(){this._listeners={}}return a.prototype.on=function(u,E,_){return(this._listeners[u]||(this._listeners[u]=[])).push({fn:E,ctx:_||this}),this},a.prototype.off=function(u,E){if(u===void 0)this._listeners={};else if(E===void 0)this._listeners[u]=[];else for(var _=this._listeners[u],k=0;k<_.length;)_[k].fn===E?_.splice(k,1):++k;return this},a.prototype.emit=function(u){var E=this._listeners[u];if(E){for(var _=[],k=1;k<arguments.length;)_.push(arguments[k++]);for(k=0;k<E.length;)E[k].fn.apply(E[k++].ctx,_)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=a(a);function a(k){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),n=new Uint8Array(e.buffer),O=n[3]===128;function $(P,j,Q){e[0]=P,j[Q]=n[0],j[Q+1]=n[1],j[Q+2]=n[2],j[Q+3]=n[3]}function N(P,j,Q){e[0]=P,j[Q]=n[3],j[Q+1]=n[2],j[Q+2]=n[1],j[Q+3]=n[0]}k.writeFloatLE=O?$:N,k.writeFloatBE=O?N:$;function D(P,j){return n[0]=P[j],n[1]=P[j+1],n[2]=P[j+2],n[3]=P[j+3],e[0]}function q(P,j){return n[3]=P[j],n[2]=P[j+1],n[1]=P[j+2],n[0]=P[j+3],e[0]}k.readFloatLE=O?D:q,k.readFloatBE=O?q:D}():function(){function e(O,$,N,D){var q=$<0?1:0;if(q&&($=-$),$===0)O(1/$>0?0:2147483648,N,D);else if(isNaN($))O(2143289344,N,D);else if($>34028234663852886e22)O((q<<31|2139095040)>>>0,N,D);else if($<11754943508222875e-54)O((q<<31|Math.round($/1401298464324817e-60))>>>0,N,D);else{var P=Math.floor(Math.log($)/Math.LN2),j=Math.round($*Math.pow(2,-P)*8388608)&8388607;O((q<<31|P+127<<23|j)>>>0,N,D)}}k.writeFloatLE=e.bind(null,I),k.writeFloatBE=e.bind(null,u);function n(O,$,N){var D=O($,N),q=(D>>31)*2+1,P=D>>>23&255,j=D&8388607;return P===255?j?NaN:q*(1/0):P===0?q*1401298464324817e-60*j:q*Math.pow(2,P-150)*(j+8388608)}k.readFloatLE=n.bind(null,E),k.readFloatBE=n.bind(null,_)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),n=new Uint8Array(e.buffer),O=n[7]===128;function $(P,j,Q){e[0]=P,j[Q]=n[0],j[Q+1]=n[1],j[Q+2]=n[2],j[Q+3]=n[3],j[Q+4]=n[4],j[Q+5]=n[5],j[Q+6]=n[6],j[Q+7]=n[7]}function N(P,j,Q){e[0]=P,j[Q]=n[7],j[Q+1]=n[6],j[Q+2]=n[5],j[Q+3]=n[4],j[Q+4]=n[3],j[Q+5]=n[2],j[Q+6]=n[1],j[Q+7]=n[0]}k.writeDoubleLE=O?$:N,k.writeDoubleBE=O?N:$;function D(P,j){return n[0]=P[j],n[1]=P[j+1],n[2]=P[j+2],n[3]=P[j+3],n[4]=P[j+4],n[5]=P[j+5],n[6]=P[j+6],n[7]=P[j+7],e[0]}function q(P,j){return n[7]=P[j],n[6]=P[j+1],n[5]=P[j+2],n[4]=P[j+3],n[3]=P[j+4],n[2]=P[j+5],n[1]=P[j+6],n[0]=P[j+7],e[0]}k.readDoubleLE=O?D:q,k.readDoubleBE=O?q:D}():function(){function e(O,$,N,D,q,P){var j=D<0?1:0;if(j&&(D=-D),D===0)O(0,q,P+$),O(1/D>0?0:2147483648,q,P+N);else if(isNaN(D))O(0,q,P+$),O(2146959360,q,P+N);else if(D>17976931348623157e292)O(0,q,P+$),O((j<<31|2146435072)>>>0,q,P+N);else{var Q;if(D<22250738585072014e-324)Q=D/5e-324,O(Q>>>0,q,P+$),O((j<<31|Q/4294967296)>>>0,q,P+N);else{var J=Math.floor(Math.log(D)/Math.LN2);J===1024&&(J=1023),Q=D*Math.pow(2,-J),O(Q*4503599627370496>>>0,q,P+$),O((j<<31|J+1023<<20|Q*1048576&1048575)>>>0,q,P+N)}}}k.writeDoubleLE=e.bind(null,I,0,4),k.writeDoubleBE=e.bind(null,u,4,0);function n(O,$,N,D,q){var P=O(D,q+$),j=O(D,q+N),Q=(j>>31)*2+1,J=j>>>20&2047,z=4294967296*(j&1048575)+P;return J===2047?z?NaN:Q*(1/0):J===0?Q*5e-324*z:Q*Math.pow(2,J-1075)*(z+4503599627370496)}k.readDoubleLE=n.bind(null,E,0,4),k.readDoubleBE=n.bind(null,_,4,0)}(),k}function I(k,e,n){e[n]=k&255,e[n+1]=k>>>8&255,e[n+2]=k>>>16&255,e[n+3]=k>>>24}function u(k,e,n){e[n]=k>>>24,e[n+1]=k>>>16&255,e[n+2]=k>>>8&255,e[n+3]=k&255}function E(k,e){return(k[e]|k[e+1]<<8|k[e+2]<<16|k[e+3]<<24)>>>0}function _(k,e){return(k[e]<<24|k[e+1]<<16|k[e+2]<<8|k[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(a){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(a){var I=a;I.length=function(E){for(var _=0,k=0,e=0;e<E.length;++e)k=E.charCodeAt(e),k<128?_+=1:k<2048?_+=2:(k&64512)===55296&&(E.charCodeAt(e+1)&64512)===56320?(++e,_+=4):_+=3;return _},I.read=function(E,_,k){var e=k-_;if(e<1)return"";for(var n=null,O=[],$=0,N;_<k;)N=E[_++],N<128?O[$++]=N:N>191&&N<224?O[$++]=(N&31)<<6|E[_++]&63:N>239&&N<365?(N=((N&7)<<18|(E[_++]&63)<<12|(E[_++]&63)<<6|E[_++]&63)-65536,O[$++]=55296+(N>>10),O[$++]=56320+(N&1023)):O[$++]=(N&15)<<12|(E[_++]&63)<<6|E[_++]&63,$>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,O)),$=0);return n?($&&n.push(String.fromCharCode.apply(String,O.slice(0,$))),n.join("")):String.fromCharCode.apply(String,O.slice(0,$))},I.write=function(E,_,k){for(var e=k,n,O,$=0;$<E.length;++$)n=E.charCodeAt($),n<128?_[k++]=n:n<2048?(_[k++]=n>>6|192,_[k++]=n&63|128):(n&64512)===55296&&((O=E.charCodeAt($+1))&64512)===56320?(n=65536+((n&1023)<<10)+(O&1023),++$,_[k++]=n>>18|240,_[k++]=n>>12&63|128,_[k++]=n>>6&63|128,_[k++]=n&63|128):(_[k++]=n>>12|224,_[k++]=n>>6&63|128,_[k++]=n&63|128);return k-e}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=a;function a(I,u,E){var _=E||8192,k=_>>>1,e=null,n=_;return function($){if($<1||$>k)return I($);n+$>_&&(e=I(_),n=0);var N=u.call(e,n,n+=$);return n&7&&(n=(n|7)+1),N}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=I;var a=requireMinimal$1();function I(k,e){this.lo=k>>>0,this.hi=e>>>0}var u=I.zero=new I(0,0);u.toNumber=function(){return 0},u.zzEncode=u.zzDecode=function(){return this},u.length=function(){return 1};var E=I.zeroHash="\0\0\0\0\0\0\0\0";I.fromNumber=function(e){if(e===0)return u;var n=e<0;n&&(e=-e);var O=e>>>0,$=(e-O)/4294967296>>>0;return n&&($=~$>>>0,O=~O>>>0,++O>4294967295&&(O=0,++$>4294967295&&($=0))),new I(O,$)},I.from=function(e){if(typeof e=="number")return I.fromNumber(e);if(a.isString(e))if(a.Long)e=a.Long.fromString(e);else return I.fromNumber(parseInt(e,10));return e.low||e.high?new I(e.low>>>0,e.high>>>0):u},I.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var n=~this.lo+1>>>0,O=~this.hi>>>0;return n||(O=O+1>>>0),-(n+O*4294967296)}return this.lo+this.hi*4294967296},I.prototype.toLong=function(e){return a.Long?new a.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var _=String.prototype.charCodeAt;return I.fromHash=function(e){return e===E?u:new I((_.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)},I.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)},I.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},I.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},I.prototype.length=function(){var e=this.lo,n=(this.lo>>>28|this.hi<<4)>>>0,O=this.hi>>>24;return O===0?n===0?e<16384?e<128?1:2:e<2097152?3:4:n<16384?n<128?5:6:n<2097152?7:8:O<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(a){var I=a;I.asPromise=requireAspromise(),I.base64=requireBase64(),I.EventEmitter=requireEventemitter(),I.float=requireFloat(),I.inquire=requireInquire(),I.utf8=requireUtf8(),I.pool=requirePool(),I.LongBits=requireLongbits(),I.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),I.global=I.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,I.emptyArray=Object.freeze?Object.freeze([]):[],I.emptyObject=Object.freeze?Object.freeze({}):{},I.isInteger=Number.isInteger||function(k){return typeof k=="number"&&isFinite(k)&&Math.floor(k)===k},I.isString=function(k){return typeof k=="string"||k instanceof String},I.isObject=function(k){return k&&typeof k=="object"},I.isset=I.isSet=function(k,e){var n=k[e];return n!=null&&k.hasOwnProperty(e)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1},I.Buffer=function(){try{var _=I.inquire("buffer").Buffer;return _.prototype.utf8Write?_:null}catch{return null}}(),I._Buffer_from=null,I._Buffer_allocUnsafe=null,I.newBuffer=function(k){return typeof k=="number"?I.Buffer?I._Buffer_allocUnsafe(k):new I.Array(k):I.Buffer?I._Buffer_from(k):typeof Uint8Array>"u"?k:new Uint8Array(k)},I.Array=typeof Uint8Array<"u"?Uint8Array:Array,I.Long=I.global.dcodeIO&&I.global.dcodeIO.Long||I.global.Long||I.inquire("long"),I.key2Re=/^true|false|0|1$/,I.key32Re=/^-?(?:0|[1-9][0-9]*)$/,I.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,I.longToHash=function(k){return k?I.LongBits.from(k).toHash():I.LongBits.zeroHash},I.longFromHash=function(k,e){var n=I.LongBits.fromHash(k);return I.Long?I.Long.fromBits(n.lo,n.hi,e):n.toNumber(!!e)};function u(_,k,e){for(var n=Object.keys(k),O=0;O<n.length;++O)(_[n[O]]===void 0||!e)&&(_[n[O]]=k[n[O]]);return _}I.merge=u,I.lcFirst=function(k){return k.charAt(0).toLowerCase()+k.substring(1)};function E(_){function k(e,n){if(!(this instanceof k))return new k(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,k):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&u(this,n)}return k.prototype=Object.create(Error.prototype,{constructor:{value:k,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}}),k}I.newError=E,I.ProtocolError=E("ProtocolError"),I.oneOfGetter=function(k){for(var e={},n=0;n<k.length;++n)e[k[n]]=1;return function(){for(var O=Object.keys(this),$=O.length-1;$>-1;--$)if(e[O[$]]===1&&this[O[$]]!==void 0&&this[O[$]]!==null)return O[$]}},I.oneOfSetter=function(k){return function(e){for(var n=0;n<k.length;++n)k[n]!==e&&delete this[k[n]]}},I.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},I._configure=function(){var _=I.Buffer;if(!_){I._Buffer_from=I._Buffer_allocUnsafe=null;return}I._Buffer_from=_.from!==Uint8Array.from&&_.from||function(e,n){return new _(e,n)},I._Buffer_allocUnsafe=_.allocUnsafe||function(e){return new _(e)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=O;var a=requireMinimal$1(),I,u=a.LongBits,E=a.base64,_=a.utf8;function k(J,z,Y){this.fn=J,this.len=z,this.next=void 0,this.val=Y}function e(){}function n(J){this.head=J.head,this.tail=J.tail,this.len=J.len,this.next=J.states}function O(){this.len=0,this.head=new k(e,0,0),this.tail=this.head,this.states=null}var $=function(){return a.Buffer?function(){return(O.create=function(){return new I})()}:function(){return new O}};O.create=$(),O.alloc=function(z){return new a.Array(z)},a.Array!==Array&&(O.alloc=a.pool(O.alloc,a.Array.prototype.subarray)),O.prototype._push=function(z,Y,et){return this.tail=this.tail.next=new k(z,Y,et),this.len+=Y,this};function N(J,z,Y){z[Y]=J&255}function D(J,z,Y){for(;J>127;)z[Y++]=J&127|128,J>>>=7;z[Y]=J}function q(J,z){this.len=J,this.next=void 0,this.val=z}q.prototype=Object.create(k.prototype),q.prototype.fn=D,O.prototype.uint32=function(z){return this.len+=(this.tail=this.tail.next=new q((z=z>>>0)<128?1:z<16384?2:z<2097152?3:z<268435456?4:5,z)).len,this},O.prototype.int32=function(z){return z<0?this._push(P,10,u.fromNumber(z)):this.uint32(z)},O.prototype.sint32=function(z){return this.uint32((z<<1^z>>31)>>>0)};function P(J,z,Y){for(;J.hi;)z[Y++]=J.lo&127|128,J.lo=(J.lo>>>7|J.hi<<25)>>>0,J.hi>>>=7;for(;J.lo>127;)z[Y++]=J.lo&127|128,J.lo=J.lo>>>7;z[Y++]=J.lo}O.prototype.uint64=function(z){var Y=u.from(z);return this._push(P,Y.length(),Y)},O.prototype.int64=O.prototype.uint64,O.prototype.sint64=function(z){var Y=u.from(z).zzEncode();return this._push(P,Y.length(),Y)},O.prototype.bool=function(z){return this._push(N,1,z?1:0)};function j(J,z,Y){z[Y]=J&255,z[Y+1]=J>>>8&255,z[Y+2]=J>>>16&255,z[Y+3]=J>>>24}O.prototype.fixed32=function(z){return this._push(j,4,z>>>0)},O.prototype.sfixed32=O.prototype.fixed32,O.prototype.fixed64=function(z){var Y=u.from(z);return this._push(j,4,Y.lo)._push(j,4,Y.hi)},O.prototype.sfixed64=O.prototype.fixed64,O.prototype.float=function(z){return this._push(a.float.writeFloatLE,4,z)},O.prototype.double=function(z){return this._push(a.float.writeDoubleLE,8,z)};var Q=a.Array.prototype.set?function(z,Y,et){Y.set(z,et)}:function(z,Y,et){for(var tt=0;tt<z.length;++tt)Y[et+tt]=z[tt]};return O.prototype.bytes=function(z){var Y=z.length>>>0;if(!Y)return this._push(N,1,0);if(a.isString(z)){var et=O.alloc(Y=E.length(z));E.decode(z,et,0),z=et}return this.uint32(Y)._push(Q,Y,z)},O.prototype.string=function(z){var Y=_.length(z);return Y?this.uint32(Y)._push(_.write,Y,z):this._push(N,1,0)},O.prototype.fork=function(){return this.states=new n(this),this.head=this.tail=new k(e,0,0),this.len=0,this},O.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 k(e,0,0),this.len=0),this},O.prototype.ldelim=function(){var z=this.head,Y=this.tail,et=this.len;return this.reset().uint32(et),et&&(this.tail.next=z.next,this.tail=Y,this.len+=et),this},O.prototype.finish=function(){for(var z=this.head.next,Y=this.constructor.alloc(this.len),et=0;z;)z.fn(z.val,Y,et),et+=z.len,z=z.next;return Y},O._configure=function(J){I=J,O.create=$(),I._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=u;var a=requireWriter();(u.prototype=Object.create(a.prototype)).constructor=u;var I=requireMinimal$1();function u(){a.call(this)}u._configure=function(){u.alloc=I._Buffer_allocUnsafe,u.writeBytesBuffer=I.Buffer&&I.Buffer.prototype instanceof Uint8Array&&I.Buffer.prototype.set.name==="set"?function(k,e,n){e.set(k,n)}:function(k,e,n){if(k.copy)k.copy(e,n,0,k.length);else for(var O=0;O<k.length;)e[n++]=k[O++]}},u.prototype.bytes=function(k){I.isString(k)&&(k=I._Buffer_from(k,"base64"));var e=k.length>>>0;return this.uint32(e),e&&this._push(u.writeBytesBuffer,e,k),this};function E(_,k,e){_.length<40?I.utf8.write(_,k,e):k.utf8Write?k.utf8Write(_,e):k.write(_,e)}return u.prototype.string=function(k){var e=I.Buffer.byteLength(k);return this.uint32(e),e&&this._push(E,e,k),this},u._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=k;var a=requireMinimal$1(),I,u=a.LongBits,E=a.utf8;function _(D,q){return RangeError("index out of range: "+D.pos+" + "+(q||1)+" > "+D.len)}function k(D){this.buf=D,this.pos=0,this.len=D.length}var e=typeof Uint8Array<"u"?function(q){if(q instanceof Uint8Array||Array.isArray(q))return new k(q);throw Error("illegal buffer")}:function(q){if(Array.isArray(q))return new k(q);throw Error("illegal buffer")},n=function(){return a.Buffer?function(P){return(k.create=function(Q){return a.Buffer.isBuffer(Q)?new I(Q):e(Q)})(P)}:e};k.create=n(),k.prototype._slice=a.Array.prototype.subarray||a.Array.prototype.slice,k.prototype.uint32=function(){var q=4294967295;return function(){if(q=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(q=(q|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(q=(q|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(q=(q|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(q=(q|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return q;if((this.pos+=5)>this.len)throw this.pos=this.len,_(this,10);return q}}(),k.prototype.int32=function(){return this.uint32()|0},k.prototype.sint32=function(){var q=this.uint32();return q>>>1^-(q&1)|0};function O(){var D=new u(0,0),q=0;if(this.len-this.pos>4){for(;q<4;++q)if(D.lo=(D.lo|(this.buf[this.pos]&127)<<q*7)>>>0,this.buf[this.pos++]<128)return D;if(D.lo=(D.lo|(this.buf[this.pos]&127)<<28)>>>0,D.hi=(D.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return D;q=0}else{for(;q<3;++q){if(this.pos>=this.len)throw _(this);if(D.lo=(D.lo|(this.buf[this.pos]&127)<<q*7)>>>0,this.buf[this.pos++]<128)return D}return D.lo=(D.lo|(this.buf[this.pos++]&127)<<q*7)>>>0,D}if(this.len-this.pos>4){for(;q<5;++q)if(D.hi=(D.hi|(this.buf[this.pos]&127)<<q*7+3)>>>0,this.buf[this.pos++]<128)return D}else for(;q<5;++q){if(this.pos>=this.len)throw _(this);if(D.hi=(D.hi|(this.buf[this.pos]&127)<<q*7+3)>>>0,this.buf[this.pos++]<128)return D}throw Error("invalid varint encoding")}k.prototype.bool=function(){return this.uint32()!==0};function $(D,q){return(D[q-4]|D[q-3]<<8|D[q-2]<<16|D[q-1]<<24)>>>0}k.prototype.fixed32=function(){if(this.pos+4>this.len)throw _(this,4);return $(this.buf,this.pos+=4)},k.prototype.sfixed32=function(){if(this.pos+4>this.len)throw _(this,4);return $(this.buf,this.pos+=4)|0};function N(){if(this.pos+8>this.len)throw _(this,8);return new u($(this.buf,this.pos+=4),$(this.buf,this.pos+=4))}return k.prototype.float=function(){if(this.pos+4>this.len)throw _(this,4);var q=a.float.readFloatLE(this.buf,this.pos);return this.pos+=4,q},k.prototype.double=function(){if(this.pos+8>this.len)throw _(this,4);var q=a.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,q},k.prototype.bytes=function(){var q=this.uint32(),P=this.pos,j=this.pos+q;if(j>this.len)throw _(this,q);if(this.pos+=q,Array.isArray(this.buf))return this.buf.slice(P,j);if(P===j){var Q=a.Buffer;return Q?Q.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,P,j)},k.prototype.string=function(){var q=this.bytes();return E.read(q,0,q.length)},k.prototype.skip=function(q){if(typeof q=="number"){if(this.pos+q>this.len)throw _(this,q);this.pos+=q}else do if(this.pos>=this.len)throw _(this);while(this.buf[this.pos++]&128);return this},k.prototype.skipType=function(D){switch(D){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(D=this.uint32()&7)!==4;)this.skipType(D);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+D+" at offset "+this.pos)}return this},k._configure=function(D){I=D,k.create=n(),I._configure();var q=a.Long?"toLong":"toNumber";a.merge(k.prototype,{int64:function(){return O.call(this)[q](!1)},uint64:function(){return O.call(this)[q](!0)},sint64:function(){return O.call(this).zzDecode()[q](!1)},fixed64:function(){return N.call(this)[q](!0)},sfixed64:function(){return N.call(this)[q](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=u;var a=requireReader();(u.prototype=Object.create(a.prototype)).constructor=u;var I=requireMinimal$1();function u(E){a.call(this,E)}return u._configure=function(){I.Buffer&&(u.prototype._slice=I.Buffer.prototype.slice)},u.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))},u._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=I;var a=requireMinimal$1();(I.prototype=Object.create(a.EventEmitter.prototype)).constructor=I;function I(u,E,_){if(typeof u!="function")throw TypeError("rpcImpl must be a function");a.EventEmitter.call(this),this.rpcImpl=u,this.requestDelimited=!!E,this.responseDelimited=!!_}return I.prototype.rpcCall=function u(E,_,k,e,n){if(!e)throw TypeError("request must be specified");var O=this;if(!n)return a.asPromise(u,O,E,_,k,e);if(!O.rpcImpl){setTimeout(function(){n(Error("already ended"))},0);return}try{return O.rpcImpl(E,_[O.requestDelimited?"encodeDelimited":"encode"](e).finish(),function(N,D){if(N)return O.emit("error",N,E),n(N);if(D===null){O.end(!0);return}if(!(D instanceof k))try{D=k[O.responseDelimited?"decodeDelimited":"decode"](D)}catch(q){return O.emit("error",q,E),n(q)}return O.emit("data",D,E),n(null,D)})}catch($){O.emit("error",$,E),setTimeout(function(){n($)},0);return}},I.prototype.end=function(E){return this.rpcImpl&&(E||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,function(a){var I=a;I.Service=requireService()}(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(a){var I=a;I.build="minimal",I.Writer=requireWriter(),I.BufferWriter=requireWriter_buffer(),I.Reader=requireReader(),I.BufferReader=requireReader_buffer(),I.util=requireMinimal$1(),I.rpc=requireRpc(),I.roots=requireRoots(),I.configure=u;function u(){I.util._configure(),I.Writer._configure(I.BufferWriter),I.Reader._configure(I.BufferReader)}u()}(indexMinimal)),indexMinimal}var minimal,hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,minimal=requireIndexMinimal()),minimal}var minimalExports=requireMinimal();const $Reader=minimalExports.Reader,$Writer=minimalExports.Writer,$util=minimalExports.util,$root=minimalExports.roots.default||(minimalExports.roots.default={}),com=$root.com=(()=>{const a={};return a.quick=function(){const I={};return I.voice=function(){const u={};return u.proto=function(){const E={};return E.CommonReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}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,n){return n||(n=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&n.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&n.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&n.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&n.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&n.uint32(40).int64(e.valid),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&n.uint32(48).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&n.uint32(56).bool(e.compress),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.CommonReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.event=e.string();break}case 2:{$.data=e.bytes();break}case 3:{$.sn=e.int64();break}case 4:{$.time=e.int64();break}case 5:{$.valid=e.int64();break}case 6:{$.version=e.int32();break}case 7:{$.compress=e.bool();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.CommonReq;return e.event!=null&&(n.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,n.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(n.data=e.data)),e.sn!=null&&($util.Long?(n.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?n.sn=parseInt(e.sn,10):typeof e.sn=="number"?n.sn=e.sn:typeof e.sn=="object"&&(n.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(n.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?n.time=parseInt(e.time,10):typeof e.time=="number"?n.time=e.time:typeof e.time=="object"&&(n.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(n.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?n.valid=parseInt(e.valid,10):typeof e.valid=="number"?n.valid=e.valid:typeof e.valid=="object"&&(n.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.version!=null&&(n.version=e.version|0),e.compress!=null&&(n.compress=!!e.compress),n},_.toObject=function(e,n){n||(n={});let O={};if(n.defaults){if(O.event="",n.bytes===String?O.data="":(O.data=[],n.bytes!==Array&&(O.data=$util.newBuffer(O.data))),$util.Long){let $=new $util.Long(0,0,!1);O.sn=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.sn=n.longs===String?"0":0;if($util.Long){let $=new $util.Long(0,0,!1);O.time=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.time=n.longs===String?"0":0;if($util.Long){let $=new $util.Long(0,0,!1);O.valid=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.valid=n.longs===String?"0":0;O.version=0,O.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(O.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(O.data=n.bytes===String?$util.base64.encode(e.data,0,e.data.length):n.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?O.sn=n.longs===String?String(e.sn):e.sn:O.sn=n.longs===String?$util.Long.prototype.toString.call(e.sn):n.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"?O.time=n.longs===String?String(e.time):e.time:O.time=n.longs===String?$util.Long.prototype.toString.call(e.time):n.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"?O.valid=n.longs===String?String(e.valid):e.valid:O.valid=n.longs===String?$util.Long.prototype.toString.call(e.valid):n.longs===Number?new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber():e.valid),e.version!=null&&e.hasOwnProperty("version")&&(O.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(O.compress=e.compress),O},_.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"},_}(),E.CommonRsp=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}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,n){return n||(n=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&n.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&n.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&n.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&n.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&n.uint32(40).int64(e.valid),e.code!=null&&Object.hasOwnProperty.call(e,"code")&&n.uint32(48).int32(e.code),e.desc!=null&&Object.hasOwnProperty.call(e,"desc")&&n.uint32(58).string(e.desc),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&n.uint32(64).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&n.uint32(72).bool(e.compress),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.CommonRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.event=e.string();break}case 2:{$.data=e.bytes();break}case 3:{$.sn=e.int64();break}case 4:{$.time=e.int64();break}case 5:{$.valid=e.int64();break}case 6:{$.code=e.int32();break}case 7:{$.desc=e.string();break}case 8:{$.version=e.int32();break}case 9:{$.compress=e.bool();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.CommonRsp;return e.event!=null&&(n.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,n.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(n.data=e.data)),e.sn!=null&&($util.Long?(n.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?n.sn=parseInt(e.sn,10):typeof e.sn=="number"?n.sn=e.sn:typeof e.sn=="object"&&(n.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(n.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?n.time=parseInt(e.time,10):typeof e.time=="number"?n.time=e.time:typeof e.time=="object"&&(n.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(n.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?n.valid=parseInt(e.valid,10):typeof e.valid=="number"?n.valid=e.valid:typeof e.valid=="object"&&(n.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.code!=null&&(n.code=e.code|0),e.desc!=null&&(n.desc=String(e.desc)),e.version!=null&&(n.version=e.version|0),e.compress!=null&&(n.compress=!!e.compress),n},_.toObject=function(e,n){n||(n={});let O={};if(n.defaults){if(O.event="",n.bytes===String?O.data="":(O.data=[],n.bytes!==Array&&(O.data=$util.newBuffer(O.data))),$util.Long){let $=new $util.Long(0,0,!1);O.sn=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.sn=n.longs===String?"0":0;if($util.Long){let $=new $util.Long(0,0,!1);O.time=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.time=n.longs===String?"0":0;if($util.Long){let $=new $util.Long(0,0,!1);O.valid=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.valid=n.longs===String?"0":0;O.code=0,O.desc="",O.version=0,O.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(O.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(O.data=n.bytes===String?$util.base64.encode(e.data,0,e.data.length):n.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?O.sn=n.longs===String?String(e.sn):e.sn:O.sn=n.longs===String?$util.Long.prototype.toString.call(e.sn):n.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"?O.time=n.longs===String?String(e.time):e.time:O.time=n.longs===String?$util.Long.prototype.toString.call(e.time):n.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"?O.valid=n.longs===String?String(e.valid):e.valid:O.valid=n.longs===String?$util.Long.prototype.toString.call(e.valid):n.longs===Number?new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber():e.valid),e.code!=null&&e.hasOwnProperty("code")&&(O.code=e.code),e.desc!=null&&e.hasOwnProperty("desc")&&(O.desc=e.desc),e.version!=null&&e.hasOwnProperty("version")&&(O.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(O.compress=e.compress),O},_.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"},_}(),E.User=function(){function _(e){if(this.tracks=[],e)for(let n=Object.keys(e),O=0;O<n.length;++O)e[n[O]]!=null&&(this[n[O]]=e[n[O]])}_.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 k;return Object.defineProperty(_.prototype,"_callAction",{get:$util.oneOfGetter(k=["callAction"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_callState",{get:$util.oneOfGetter(k=["callState"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_joinTime",{get:$util.oneOfGetter(k=["joinTime"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_permissions",{get:$util.oneOfGetter(k=["permissions"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_isPublished",{get:$util.oneOfGetter(k=["isPublished"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_behavior",{get:$util.oneOfGetter(k=["behavior"]),set:$util.oneOfSetter(k)}),_.create=function(n){return new _(n)},_.encode=function(n,O){if(O||(O=$Writer.create()),n.id!=null&&Object.hasOwnProperty.call(n,"id")&&O.uint32(10).string(n.id),n.callAction!=null&&Object.hasOwnProperty.call(n,"callAction")&&O.uint32(16).int32(n.callAction),n.callState!=null&&Object.hasOwnProperty.call(n,"callState")&&O.uint32(24).int32(n.callState),n.joinTime!=null&&Object.hasOwnProperty.call(n,"joinTime")&&O.uint32(32).int64(n.joinTime),n.tracks!=null&&n.tracks.length)for(let $=0;$<n.tracks.length;++$)$root.com.quick.voice.proto.Track.encode(n.tracks[$],O.uint32(42).fork()).ldelim();return n.permissions!=null&&Object.hasOwnProperty.call(n,"permissions")&&O.uint32(48).int32(n.permissions),n.isPublished!=null&&Object.hasOwnProperty.call(n,"isPublished")&&O.uint32(56).bool(n.isPublished),n.behavior!=null&&Object.hasOwnProperty.call(n,"behavior")&&O.uint32(64).int32(n.behavior),O},_.encodeDelimited=function(n,O){return this.encode(n,O).ldelim()},_.decode=function(n,O){n instanceof $Reader||(n=$Reader.create(n));let $=O===void 0?n.len:n.pos+O,N=new $root.com.quick.voice.proto.User;for(;n.pos<$;){let D=n.uint32();switch(D>>>3){case 1:{N.id=n.string();break}case 2:{N.callAction=n.int32();break}case 3:{N.callState=n.int32();break}case 4:{N.joinTime=n.int64();break}case 5:{N.tracks&&N.tracks.length||(N.tracks=[]),N.tracks.push($root.com.quick.voice.proto.Track.decode(n,n.uint32()));break}case 6:{N.permissions=n.int32();break}case 7:{N.isPublished=n.bool();break}case 8:{N.behavior=n.int32();break}default:n.skipType(D&7);break}}return N},_.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},_.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.id!=null&&n.hasOwnProperty("id")&&!$util.isString(n.id))return"id: string expected";if(n.callAction!=null&&n.hasOwnProperty("callAction")&&!$util.isInteger(n.callAction))return"callAction: integer expected";if(n.callState!=null&&n.hasOwnProperty("callState")&&!$util.isInteger(n.callState))return"callState: integer expected";if(n.joinTime!=null&&n.hasOwnProperty("joinTime")&&!$util.isInteger(n.joinTime)&&!(n.joinTime&&$util.isInteger(n.joinTime.low)&&$util.isInteger(n.joinTime.high)))return"joinTime: integer|Long expected";if(n.tracks!=null&&n.hasOwnProperty("tracks")){if(!Array.isArray(n.tracks))return"tracks: array expected";for(let O=0;O<n.tracks.length;++O){let $=$root.com.quick.voice.proto.Track.verify(n.tracks[O]);if($)return"tracks."+$}}return n.permissions!=null&&n.hasOwnProperty("permissions")&&!$util.isInteger(n.permissions)?"permissions: integer expected":n.isPublished!=null&&n.hasOwnProperty("isPublished")&&typeof n.isPublished!="boolean"?"isPublished: boolean expected":n.behavior!=null&&n.hasOwnProperty("behavior")&&!$util.isInteger(n.behavior)?"behavior: integer expected":null},_.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.User)return n;let O=new $root.com.quick.voice.proto.User;if(n.id!=null&&(O.id=String(n.id)),n.callAction!=null&&(O.callAction=n.callAction|0),n.callState!=null&&(O.callState=n.callState|0),n.joinTime!=null&&($util.Long?(O.joinTime=$util.Long.fromValue(n.joinTime)).unsigned=!1:typeof n.joinTime=="string"?O.joinTime=parseInt(n.joinTime,10):typeof n.joinTime=="number"?O.joinTime=n.joinTime:typeof n.joinTime=="object"&&(O.joinTime=new $util.LongBits(n.joinTime.low>>>0,n.joinTime.high>>>0).toNumber())),n.tracks){if(!Array.isArray(n.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");O.tracks=[];for(let $=0;$<n.tracks.length;++$){if(typeof n.tracks[$]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");O.tracks[$]=$root.com.quick.voice.proto.Track.fromObject(n.tracks[$])}}return n.permissions!=null&&(O.permissions=n.permissions|0),n.isPublished!=null&&(O.isPublished=!!n.isPublished),n.behavior!=null&&(O.behavior=n.behavior|0),O},_.toObject=function(n,O){O||(O={});let $={};if((O.arrays||O.defaults)&&($.tracks=[]),O.defaults&&($.id=""),n.id!=null&&n.hasOwnProperty("id")&&($.id=n.id),n.callAction!=null&&n.hasOwnProperty("callAction")&&($.callAction=n.callAction,O.oneofs&&($._callAction="callAction")),n.callState!=null&&n.hasOwnProperty("callState")&&($.callState=n.callState,O.oneofs&&($._callState="callState")),n.joinTime!=null&&n.hasOwnProperty("joinTime")&&(typeof n.joinTime=="number"?$.joinTime=O.longs===String?String(n.joinTime):n.joinTime:$.joinTime=O.longs===String?$util.Long.prototype.toString.call(n.joinTime):O.longs===Number?new $util.LongBits(n.joinTime.low>>>0,n.joinTime.high>>>0).toNumber():n.joinTime,O.oneofs&&($._joinTime="joinTime")),n.tracks&&n.tracks.length){$.tracks=[];for(let N=0;N<n.tracks.length;++N)$.tracks[N]=$root.com.quick.voice.proto.Track.toObject(n.tracks[N],O)}return n.permissions!=null&&n.hasOwnProperty("permissions")&&($.permissions=n.permissions,O.oneofs&&($._permissions="permissions")),n.isPublished!=null&&n.hasOwnProperty("isPublished")&&($.isPublished=n.isPublished,O.oneofs&&($._isPublished="isPublished")),n.behavior!=null&&n.hasOwnProperty("behavior")&&($.behavior=n.behavior,O.oneofs&&($._behavior="behavior")),$},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.User"},_}(),E.Login=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.appid="",_.prototype.userId="",_.prototype.sdkToken="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.appid!=null&&Object.hasOwnProperty.call(e,"appid")&&n.uint32(10).string(e.appid),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(18).string(e.userId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&n.uint32(26).string(e.sdkToken),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.Login;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.appid=e.string();break}case 2:{$.userId=e.string();break}case 3:{$.sdkToken=e.string();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.Login;return e.appid!=null&&(n.appid=String(e.appid)),e.userId!=null&&(n.userId=String(e.userId)),e.sdkToken!=null&&(n.sdkToken=String(e.sdkToken)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.appid="",O.userId="",O.sdkToken=""),e.appid!=null&&e.hasOwnProperty("appid")&&(O.appid=e.appid),e.userId!=null&&e.hasOwnProperty("userId")&&(O.userId=e.userId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(O.sdkToken=e.sdkToken),O},_.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"},_}(),E.Track=function(){function _(e){if(e)for(let n=Object.keys(e),O=0;O<n.length;++O)e[n[O]]!=null&&(this[n[O]]=e[n[O]])}_.prototype.mid="",_.prototype.trackName=null,_.prototype.location=null,_.prototype.userId=null,_.prototype.code=null,_.prototype.desc=null,_.prototype.type=null,_.prototype.isValid=null;let k;return Object.defineProperty(_.prototype,"_trackName",{get:$util.oneOfGetter(k=["trackName"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_location",{get:$util.oneOfGetter(k=["location"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_userId",{get:$util.oneOfGetter(k=["userId"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_code",{get:$util.oneOfGetter(k=["code"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_desc",{get:$util.oneOfGetter(k=["desc"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_type",{get:$util.oneOfGetter(k=["type"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_isValid",{get:$util.oneOfGetter(k=["isValid"]),set:$util.oneOfSetter(k)}),_.create=function(n){return new _(n)},_.encode=function(n,O){return O||(O=$Writer.create()),n.mid!=null&&Object.hasOwnProperty.call(n,"mid")&&O.uint32(10).string(n.mid),n.trackName!=null&&Object.hasOwnProperty.call(n,"trackName")&&O.uint32(18).string(n.trackName),n.location!=null&&Object.hasOwnProperty.call(n,"location")&&O.uint32(26).string(n.location),n.userId!=null&&Object.hasOwnProperty.call(n,"userId")&&O.uint32(34).string(n.userId),n.code!=null&&Object.hasOwnProperty.call(n,"code")&&O.uint32(40).int32(n.code),n.desc!=null&&Object.hasOwnProperty.call(n,"desc")&&O.uint32(50).string(n.desc),n.type!=null&&Object.hasOwnProperty.call(n,"type")&&O.uint32(56).int32(n.type),n.isValid!=null&&Object.hasOwnProperty.call(n,"isValid")&&O.uint32(64).bool(n.isValid),O},_.encodeDelimited=function(n,O){return this.encode(n,O).ldelim()},_.decode=function(n,O){n instanceof $Reader||(n=$Reader.create(n));let $=O===void 0?n.len:n.pos+O,N=new $root.com.quick.voice.proto.Track;for(;n.pos<$;){let D=n.uint32();switch(D>>>3){case 1:{N.mid=n.string();break}case 2:{N.trackName=n.string();break}case 3:{N.location=n.string();break}case 4:{N.userId=n.string();break}case 5:{N.code=n.int32();break}case 6:{N.desc=n.string();break}case 7:{N.type=n.int32();break}case 8:{N.isValid=n.bool();break}default:n.skipType(D&7);break}}return N},_.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},_.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.mid!=null&&n.hasOwnProperty("mid")&&!$util.isString(n.mid))return"mid: string expected";if(n.trackName!=null&&n.hasOwnProperty("trackName")&&!$util.isString(n.trackName))return"trackName: string expected";if(n.location!=null&&n.hasOwnProperty("location")&&!$util.isString(n.location))return"location: string expected";if(n.userId!=null&&n.hasOwnProperty("userId")&&!$util.isString(n.userId))return"userId: string expected";if(n.code!=null&&n.hasOwnProperty("code")&&!$util.isInteger(n.code))return"code: integer expected";if(n.desc!=null&&n.hasOwnProperty("desc")&&!$util.isString(n.desc))return"desc: string expected";if(n.type!=null&&n.hasOwnProperty("type"))switch(n.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return n.isValid!=null&&n.hasOwnProperty("isValid")&&typeof n.isValid!="boolean"?"isValid: boolean expected":null},_.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.Track)return n;let O=new $root.com.quick.voice.proto.Track;switch(n.mid!=null&&(O.mid=String(n.mid)),n.trackName!=null&&(O.trackName=String(n.trackName)),n.location!=null&&(O.location=String(n.location)),n.userId!=null&&(O.userId=String(n.userId)),n.code!=null&&(O.code=n.code|0),n.desc!=null&&(O.desc=String(n.desc)),n.type){default:if(typeof n.type=="number"){O.type=n.type;break}break;case"Microphone":case 0:O.type=0;break;case"Camera":case 1:O.type=1;break;case"Screen":case 2:O.type=2;break;case"SystemVoice":case 3:O.type=3;break}return n.isValid!=null&&(O.isValid=!!n.isValid),O},_.toObject=function(n,O){O||(O={});let $={};return O.defaults&&($.mid=""),n.mid!=null&&n.hasOwnProperty("mid")&&($.mid=n.mid),n.trackName!=null&&n.hasOwnProperty("trackName")&&($.trackName=n.trackName,O.oneofs&&($._trackName="trackName")),n.location!=null&&n.hasOwnProperty("location")&&($.location=n.location,O.oneofs&&($._location="location")),n.userId!=null&&n.hasOwnProperty("userId")&&($.userId=n.userId,O.oneofs&&($._userId="userId")),n.code!=null&&n.hasOwnProperty("code")&&($.code=n.code,O.oneofs&&($._code="code")),n.desc!=null&&n.hasOwnProperty("desc")&&($.desc=n.desc,O.oneofs&&($._desc="desc")),n.type!=null&&n.hasOwnProperty("type")&&($.type=O.enums===String?$root.com.quick.voice.proto.TrackType[n.type]===void 0?n.type:$root.com.quick.voice.proto.TrackType[n.type]:n.type,O.oneofs&&($._type="type")),n.isValid!=null&&n.hasOwnProperty("isValid")&&($.isValid=n.isValid,O.oneofs&&($._isValid="isValid")),$},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.Track"},_}(),E.JoinReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.prototype.callType=0,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),e.callType!=null&&Object.hasOwnProperty.call(e,"callType")&&n.uint32(24).int32(e.callType),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.JoinReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}case 3:{$.callType=e.int32();break}default:e.skipType(N&7);break}}return $},_.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 n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+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.JoinReq)return e;let n=new $root.com.quick.voice.proto.JoinReq;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}switch(e.callType){default:if(typeof e.callType=="number"){n.callType=e.callType;break}break;case"Normal":case 0:n.callType=0;break;case"Meeting":case 1:n.callType=1;break;case"Live":case 2:n.callType=2;break}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null,O.callType=n.enums===String?"Normal":0),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),e.callType!=null&&e.hasOwnProperty("callType")&&(O.callType=n.enums===String?$root.com.quick.voice.proto.CallType[e.callType]===void 0?e.callType:$root.com.quick.voice.proto.CallType[e.callType]:e.callType),O},_.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"},_}(),E.JoinRsp=function(){function _(k){if(this.roomUsers=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.roomUsers=$util.emptyArray,_.prototype.callType=0,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.roomUsers!=null&&e.roomUsers.length)for(let O=0;O<e.roomUsers.length;++O)$root.com.quick.voice.proto.User.encode(e.roomUsers[O],n.uint32(18).fork()).ldelim();return e.callType!=null&&Object.hasOwnProperty.call(e,"callType")&&n.uint32(24).int32(e.callType),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.JoinRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.roomUsers&&$.roomUsers.length||($.roomUsers=[]),$.roomUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 3:{$.callType=e.int32();break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.roomUsers.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.roomUsers[n]);if(O)return"roomUsers."+O}}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 n=new $root.com.quick.voice.proto.JoinRsp;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.roomUsers){if(!Array.isArray(e.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");n.roomUsers=[];for(let O=0;O<e.roomUsers.length;++O){if(typeof e.roomUsers[O]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");n.roomUsers[O]=$root.com.quick.voice.proto.User.fromObject(e.roomUsers[O])}}switch(e.callType){default:if(typeof e.callType=="number"){n.callType=e.callType;break}break;case"Normal":case 0:n.callType=0;break;case"Meeting":case 1:n.callType=1;break;case"Live":case 2:n.callType=2;break}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.roomUsers=[]),n.defaults&&(O.roomId="",O.callType=n.enums===String?"Normal":0),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.roomUsers&&e.roomUsers.length){O.roomUsers=[];for(let $=0;$<e.roomUsers.length;++$)O.roomUsers[$]=$root.com.quick.voice.proto.User.toObject(e.roomUsers[$],n)}return e.callType!=null&&e.hasOwnProperty("callType")&&(O.callType=n.enums===String?$root.com.quick.voice.proto.CallType[e.callType]===void 0?e.callType:$root.com.quick.voice.proto.CallType[e.callType]:e.callType),O},_.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"},_}(),E.JoinNotify=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.JoinNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.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 n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinNotify)return e;let n=new $root.com.quick.voice.proto.JoinNotify;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.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"},_}(),E.ConnectCFReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.sdp="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&n.uint32(10).string(e.sdp),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.ConnectCFReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.sdp=e.string();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.ConnectCFReq;return e.sdp!=null&&(n.sdp=String(e.sdp)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.sdp=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(O.sdp=e.sdp),O},_.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"},_}(),E.ConnectCFRsp=function(){function _(k){if(this.subscribeUsers=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.remoteSdp="",_.prototype.subscribeUsers=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&n.uint32(10).string(e.remoteSdp),e.subscribeUsers!=null&&e.subscribeUsers.length)for(let O=0;O<e.subscribeUsers.length;++O)$root.com.quick.voice.proto.User.encode(e.subscribeUsers[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.ConnectCFRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.remoteSdp=e.string();break}case 2:{$.subscribeUsers&&$.subscribeUsers.length||($.subscribeUsers=[]),$.subscribeUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.subscribeUsers.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.subscribeUsers[n]);if(O)return"subscribeUsers."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ConnectCFRsp)return e;let n=new $root.com.quick.voice.proto.ConnectCFRsp;if(e.remoteSdp!=null&&(n.remoteSdp=String(e.remoteSdp)),e.subscribeUsers){if(!Array.isArray(e.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");n.subscribeUsers=[];for(let O=0;O<e.subscribeUsers.length;++O){if(typeof e.subscribeUsers[O]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");n.subscribeUsers[O]=$root.com.quick.voice.proto.User.fromObject(e.subscribeUsers[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.subscribeUsers=[]),n.defaults&&(O.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(O.remoteSdp=e.remoteSdp),e.subscribeUsers&&e.subscribeUsers.length){O.subscribeUsers=[];for(let $=0;$<e.subscribeUsers.length;++$)O.subscribeUsers[$]=$root.com.quick.voice.proto.User.toObject(e.subscribeUsers[$],n)}return O},_.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"},_}(),E.PublishReq=function(){function _(e){if(this.tracks=[],e)for(let n=Object.keys(e),O=0;O<n.length;++O)e[n[O]]!=null&&(this[n[O]]=e[n[O]])}_.prototype.sdp="",_.prototype.tracks=$util.emptyArray,_.prototype.callAction=0,_.prototype.recreate=null;let k;return Object.defineProperty(_.prototype,"_recreate",{get:$util.oneOfGetter(k=["recreate"]),set:$util.oneOfSetter(k)}),_.create=function(n){return new _(n)},_.encode=function(n,O){if(O||(O=$Writer.create()),n.sdp!=null&&Object.hasOwnProperty.call(n,"sdp")&&O.uint32(10).string(n.sdp),n.tracks!=null&&n.tracks.length)for(let $=0;$<n.tracks.length;++$)$root.com.quick.voice.proto.Track.encode(n.tracks[$],O.uint32(18).fork()).ldelim();return n.callAction!=null&&Object.hasOwnProperty.call(n,"callAction")&&O.uint32(24).int32(n.callAction),n.recreate!=null&&Object.hasOwnProperty.call(n,"recreate")&&O.uint32(32).bool(n.recreate),O},_.encodeDelimited=function(n,O){return this.encode(n,O).ldelim()},_.decode=function(n,O){n instanceof $Reader||(n=$Reader.create(n));let $=O===void 0?n.len:n.pos+O,N=new $root.com.quick.voice.proto.PublishReq;for(;n.pos<$;){let D=n.uint32();switch(D>>>3){case 1:{N.sdp=n.string();break}case 2:{N.tracks&&N.tracks.length||(N.tracks=[]),N.tracks.push($root.com.quick.voice.proto.Track.decode(n,n.uint32()));break}case 3:{N.callAction=n.int32();break}case 4:{N.recreate=n.bool();break}default:n.skipType(D&7);break}}return N},_.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},_.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.sdp!=null&&n.hasOwnProperty("sdp")&&!$util.isString(n.sdp))return"sdp: string expected";if(n.tracks!=null&&n.hasOwnProperty("tracks")){if(!Array.isArray(n.tracks))return"tracks: array expected";for(let O=0;O<n.tracks.length;++O){let $=$root.com.quick.voice.proto.Track.verify(n.tracks[O]);if($)return"tracks."+$}}return n.callAction!=null&&n.hasOwnProperty("callAction")&&!$util.isInteger(n.callAction)?"callAction: integer expected":n.recreate!=null&&n.hasOwnProperty("recreate")&&typeof n.recreate!="boolean"?"recreate: boolean expected":null},_.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.PublishReq)return n;let O=new $root.com.quick.voice.proto.PublishReq;if(n.sdp!=null&&(O.sdp=String(n.sdp)),n.tracks){if(!Array.isArray(n.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");O.tracks=[];for(let $=0;$<n.tracks.length;++$){if(typeof n.tracks[$]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");O.tracks[$]=$root.com.quick.voice.proto.Track.fromObject(n.tracks[$])}}return n.callAction!=null&&(O.callAction=n.callAction|0),n.recreate!=null&&(O.recreate=!!n.recreate),O},_.toObject=function(n,O){O||(O={});let $={};if((O.arrays||O.defaults)&&($.tracks=[]),O.defaults&&($.sdp="",$.callAction=0),n.sdp!=null&&n.hasOwnProperty("sdp")&&($.sdp=n.sdp),n.tracks&&n.tracks.length){$.tracks=[];for(let N=0;N<n.tracks.length;++N)$.tracks[N]=$root.com.quick.voice.proto.Track.toObject(n.tracks[N],O)}return n.callAction!=null&&n.hasOwnProperty("callAction")&&($.callAction=n.callAction),n.recreate!=null&&n.hasOwnProperty("recreate")&&($.recreate=n.recreate,O.oneofs&&($._recreate="recreate")),$},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.PublishReq"},_}(),E.PublishRsp=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.remoteSdp="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&n.uint32(10).string(e.remoteSdp),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.PublishRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.remoteSdp=e.string();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.PublishRsp;return e.remoteSdp!=null&&(n.remoteSdp=String(e.remoteSdp)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(O.remoteSdp=e.remoteSdp),O},_.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"},_}(),E.PublishNotify=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.PublishNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.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 n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PublishNotify)return e;let n=new $root.com.quick.voice.proto.PublishNotify;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.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"},_}(),E.SubscribeReq=function(){function _(k){if(this.users=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.users=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.users!=null&&e.users.length)for(let O=0;O<e.users.length;++O)$root.com.quick.voice.proto.User.encode(e.users[O],n.uint32(10).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.SubscribeReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.users&&$.users.length||($.users=[]),$.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.users.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.users[n]);if(O)return"users."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SubscribeReq)return e;let n=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");n.users=[];for(let O=0;O<e.users.length;++O){if(typeof e.users[O]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");n.users[O]=$root.com.quick.voice.proto.User.fromObject(e.users[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.users=[]),e.users&&e.users.length){O.users=[];for(let $=0;$<e.users.length;++$)O.users[$]=$root.com.quick.voice.proto.User.toObject(e.users[$],n)}return O},_.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"},_}(),E.SubscribeRsp=function(){function _(k){if(this.users=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.remoteSdp="",_.prototype.users=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&n.uint32(10).string(e.remoteSdp),e.users!=null&&e.users.length)for(let O=0;O<e.users.length;++O)$root.com.quick.voice.proto.User.encode(e.users[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.SubscribeRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.remoteSdp=e.string();break}case 2:{$.users&&$.users.length||($.users=[]),$.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.users.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.users[n]);if(O)return"users."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SubscribeRsp)return e;let n=new $root.com.quick.voice.proto.SubscribeRsp;if(e.remoteSdp!=null&&(n.remoteSdp=String(e.remoteSdp)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");n.users=[];for(let O=0;O<e.users.length;++O){if(typeof e.users[O]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");n.users[O]=$root.com.quick.voice.proto.User.fromObject(e.users[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.users=[]),n.defaults&&(O.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(O.remoteSdp=e.remoteSdp),e.users&&e.users.length){O.users=[];for(let $=0;$<e.users.length;++$)O.users[$]=$root.com.quick.voice.proto.User.toObject(e.users[$],n)}return O},_.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"},_}(),E.RenegotiateReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.userId="",_.prototype.sdp="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(10).string(e.userId),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&n.uint32(18).string(e.sdp),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.RenegotiateReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.userId=e.string();break}case 2:{$.sdp=e.string();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.RenegotiateReq;return e.userId!=null&&(n.userId=String(e.userId)),e.sdp!=null&&(n.sdp=String(e.sdp)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.userId="",O.sdp=""),e.userId!=null&&e.hasOwnProperty("userId")&&(O.userId=e.userId),e.sdp!=null&&e.hasOwnProperty("sdp")&&(O.sdp=e.sdp),O},_.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"},_}(),E.QuitReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.userId="",_.prototype.roomId="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(18).string(e.roomId),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.QuitReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.userId=e.string();break}case 2:{$.roomId=e.string();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.QuitReq;return e.userId!=null&&(n.userId=String(e.userId)),e.roomId!=null&&(n.roomId=String(e.roomId)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.userId="",O.roomId=""),e.userId!=null&&e.hasOwnProperty("userId")&&(O.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),O},_.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"},_}(),E.QuitNotify=function(){function _(e){if(e)for(let n=Object.keys(e),O=0;O<n.length;++O)e[n[O]]!=null&&(this[n[O]]=e[n[O]])}_.prototype.roomId="",_.prototype.user=null,_.prototype.code=null,_.prototype.desc=null;let k;return Object.defineProperty(_.prototype,"_code",{get:$util.oneOfGetter(k=["code"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_desc",{get:$util.oneOfGetter(k=["desc"]),set:$util.oneOfSetter(k)}),_.create=function(n){return new _(n)},_.encode=function(n,O){return O||(O=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&O.uint32(10).string(n.roomId),n.user!=null&&Object.hasOwnProperty.call(n,"user")&&$root.com.quick.voice.proto.User.encode(n.user,O.uint32(18).fork()).ldelim(),n.code!=null&&Object.hasOwnProperty.call(n,"code")&&O.uint32(24).int32(n.code),n.desc!=null&&Object.hasOwnProperty.call(n,"desc")&&O.uint32(34).string(n.desc),O},_.encodeDelimited=function(n,O){return this.encode(n,O).ldelim()},_.decode=function(n,O){n instanceof $Reader||(n=$Reader.create(n));let $=O===void 0?n.len:n.pos+O,N=new $root.com.quick.voice.proto.QuitNotify;for(;n.pos<$;){let D=n.uint32();switch(D>>>3){case 1:{N.roomId=n.string();break}case 2:{N.user=$root.com.quick.voice.proto.User.decode(n,n.uint32());break}case 3:{N.code=n.int32();break}case 4:{N.desc=n.string();break}default:n.skipType(D&7);break}}return N},_.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},_.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.user!=null&&n.hasOwnProperty("user")){let O=$root.com.quick.voice.proto.User.verify(n.user);if(O)return"user."+O}return n.code!=null&&n.hasOwnProperty("code")&&!$util.isInteger(n.code)?"code: integer expected":n.desc!=null&&n.hasOwnProperty("desc")&&!$util.isString(n.desc)?"desc: string expected":null},_.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.QuitNotify)return n;let O=new $root.com.quick.voice.proto.QuitNotify;if(n.roomId!=null&&(O.roomId=String(n.roomId)),n.user!=null){if(typeof n.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");O.user=$root.com.quick.voice.proto.User.fromObject(n.user)}return n.code!=null&&(O.code=n.code|0),n.desc!=null&&(O.desc=String(n.desc)),O},_.toObject=function(n,O){O||(O={});let $={};return O.defaults&&($.roomId="",$.user=null),n.roomId!=null&&n.hasOwnProperty("roomId")&&($.roomId=n.roomId),n.user!=null&&n.hasOwnProperty("user")&&($.user=$root.com.quick.voice.proto.User.toObject(n.user,O)),n.code!=null&&n.hasOwnProperty("code")&&($.code=n.code,O.oneofs&&($._code="code")),n.desc!=null&&n.hasOwnProperty("desc")&&($.desc=n.desc,O.oneofs&&($._desc="desc")),$},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.QuitNotify"},_}(),E.TokenExpireNotify=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.TokenExpireNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.TokenExpireNotify;return e.roomId!=null&&(n.roomId=String(e.roomId)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),O},_.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"},_}(),E.UpdateTokenReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.sdkToken="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&n.uint32(18).string(e.sdkToken),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.UpdateTokenReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.sdkToken=e.string();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.UpdateTokenReq;return e.roomId!=null&&(n.roomId=String(e.roomId)),e.sdkToken!=null&&(n.sdkToken=String(e.sdkToken)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.sdkToken=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(O.sdkToken=e.sdkToken),O},_.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"},_}(),E.NetQualityChange=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.userId="",_.prototype.roomId="",_.prototype.egress=0,_.prototype.ingress=0,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(18).string(e.roomId),e.egress!=null&&Object.hasOwnProperty.call(e,"egress")&&n.uint32(24).int32(e.egress),e.ingress!=null&&Object.hasOwnProperty.call(e,"ingress")&&n.uint32(32).int32(e.ingress),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.NetQualityChange;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.userId=e.string();break}case 2:{$.roomId=e.string();break}case 3:{$.egress=e.int32();break}case 4:{$.ingress=e.int32();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.NetQualityChange;return e.userId!=null&&(n.userId=String(e.userId)),e.roomId!=null&&(n.roomId=String(e.roomId)),e.egress!=null&&(n.egress=e.egress|0),e.ingress!=null&&(n.ingress=e.ingress|0),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.userId="",O.roomId="",O.egress=0,O.ingress=0),e.userId!=null&&e.hasOwnProperty("userId")&&(O.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.egress!=null&&e.hasOwnProperty("egress")&&(O.egress=e.egress),e.ingress!=null&&e.hasOwnProperty("ingress")&&(O.ingress=e.ingress),O},_.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"},_}(),E.NetQualityNotify=function(){function _(k){if(this.qualities=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.qualities=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.qualities!=null&&e.qualities.length)for(let O=0;O<e.qualities.length;++O)$root.com.quick.voice.proto.NetQualityChange.encode(e.qualities[O],n.uint32(10).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.NetQualityNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.qualities&&$.qualities.length||($.qualities=[]),$.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.qualities.length;++n){let O=$root.com.quick.voice.proto.NetQualityChange.verify(e.qualities[n]);if(O)return"qualities."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.NetQualityNotify)return e;let n=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");n.qualities=[];for(let O=0;O<e.qualities.length;++O){if(typeof e.qualities[O]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");n.qualities[O]=$root.com.quick.voice.proto.NetQualityChange.fromObject(e.qualities[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.qualities=[]),e.qualities&&e.qualities.length){O.qualities=[];for(let $=0;$<e.qualities.length;++$)O.qualities[$]=$root.com.quick.voice.proto.NetQualityChange.toObject(e.qualities[$],n)}return O},_.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"},_}(),E.UpdateCall=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.UpdateCall;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.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 n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateCall)return e;let n=new $root.com.quick.voice.proto.UpdateCall;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.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"},_}(),E.SyncRoomInfoReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.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 n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return e;let n=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.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"},_}(),E.SyncRoomInfoRsp=function(){function _(k){if(this.users=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.isValid=!1,_.prototype.users=$util.emptyArray,_.prototype.isActive=!1,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.isValid!=null&&Object.hasOwnProperty.call(e,"isValid")&&n.uint32(16).bool(e.isValid),e.users!=null&&e.users.length)for(let O=0;O<e.users.length;++O)$root.com.quick.voice.proto.User.encode(e.users[O],n.uint32(26).fork()).ldelim();return e.isActive!=null&&Object.hasOwnProperty.call(e,"isActive")&&n.uint32(32).bool(e.isActive),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.isValid=e.bool();break}case 3:{$.users&&$.users.length||($.users=[]),$.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 4:{$.isActive=e.bool();break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.users.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.users[n]);if(O)return"users."+O}}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 n=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.isValid!=null&&(n.isValid=!!e.isValid),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");n.users=[];for(let O=0;O<e.users.length;++O){if(typeof e.users[O]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");n.users[O]=$root.com.quick.voice.proto.User.fromObject(e.users[O])}}return e.isActive!=null&&(n.isActive=!!e.isActive),n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.users=[]),n.defaults&&(O.roomId="",O.isValid=!1,O.isActive=!1),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.isValid!=null&&e.hasOwnProperty("isValid")&&(O.isValid=e.isValid),e.users&&e.users.length){O.users=[];for(let $=0;$<e.users.length;++$)O.users[$]=$root.com.quick.voice.proto.User.toObject(e.users[$],n)}return e.isActive!=null&&e.hasOwnProperty("isActive")&&(O.isActive=e.isActive),O},_.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"},_}(),E.UpdateTime=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&n.uint32(8).int64(e.time),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.UpdateTime;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.time=e.int64();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.UpdateTime;return e.time!=null&&($util.Long?(n.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?n.time=parseInt(e.time,10):typeof e.time=="number"?n.time=e.time:typeof e.time=="object"&&(n.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),n},_.toObject=function(e,n){n||(n={});let O={};if(n.defaults)if($util.Long){let $=new $util.Long(0,0,!1);O.time=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.time=n.longs===String?"0":0;return e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?O.time=n.longs===String?String(e.time):e.time:O.time=n.longs===String?$util.Long.prototype.toString.call(e.time):n.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),O},_.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"},_}(),E.CloseTrackReq=function(){function _(k){if(this.tracks=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.sdp="",_.prototype.tracks=$util.emptyArray,_.prototype.roomId="",_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&n.uint32(10).string(e.sdp),e.tracks!=null&&e.tracks.length)for(let O=0;O<e.tracks.length;++O)$root.com.quick.voice.proto.Track.encode(e.tracks[O],n.uint32(18).fork()).ldelim();return e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(26).string(e.roomId),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.CloseTrackReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.sdp=e.string();break}case 2:{$.tracks&&$.tracks.length||($.tracks=[]),$.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}case 3:{$.roomId=e.string();break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.tracks.length;++n){let O=$root.com.quick.voice.proto.Track.verify(e.tracks[n]);if(O)return"tracks."+O}}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 n=new $root.com.quick.voice.proto.CloseTrackReq;if(e.sdp!=null&&(n.sdp=String(e.sdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");n.tracks=[];for(let O=0;O<e.tracks.length;++O){if(typeof e.tracks[O]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");n.tracks[O]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[O])}}return e.roomId!=null&&(n.roomId=String(e.roomId)),n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.tracks=[]),n.defaults&&(O.sdp="",O.roomId=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(O.sdp=e.sdp),e.tracks&&e.tracks.length){O.tracks=[];for(let $=0;$<e.tracks.length;++$)O.tracks[$]=$root.com.quick.voice.proto.Track.toObject(e.tracks[$],n)}return e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),O},_.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"},_}(),E.CloseTrackRsp=function(){function _(k){if(this.tracks=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.remoteSdp="",_.prototype.tracks=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&n.uint32(10).string(e.remoteSdp),e.tracks!=null&&e.tracks.length)for(let O=0;O<e.tracks.length;++O)$root.com.quick.voice.proto.Track.encode(e.tracks[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.CloseTrackRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.remoteSdp=e.string();break}case 2:{$.tracks&&$.tracks.length||($.tracks=[]),$.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.tracks.length;++n){let O=$root.com.quick.voice.proto.Track.verify(e.tracks[n]);if(O)return"tracks."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackRsp)return e;let n=new $root.com.quick.voice.proto.CloseTrackRsp;if(e.remoteSdp!=null&&(n.remoteSdp=String(e.remoteSdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");n.tracks=[];for(let O=0;O<e.tracks.length;++O){if(typeof e.tracks[O]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");n.tracks[O]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.tracks=[]),n.defaults&&(O.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(O.remoteSdp=e.remoteSdp),e.tracks&&e.tracks.length){O.tracks=[];for(let $=0;$<e.tracks.length;++$)O.tracks[$]=$root.com.quick.voice.proto.Track.toObject(e.tracks[$],n)}return O},_.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"},_}(),E.CloseTrackNotify=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(10).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.CloseTrackNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.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 n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackNotify)return e;let n=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");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.user=null),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.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"},_}(),E.ToggleLiveRoomReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.ToggleLiveRoomReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.ToggleLiveRoomReq;return e.roomId!=null&&(n.roomId=String(e.roomId)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),O},_.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"},_}(),E.ToggleLiveRoomRsq=function(){function _(k){if(this.roomUsers=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.hash="",_.prototype.roomUsers=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.hash!=null&&Object.hasOwnProperty.call(e,"hash")&&n.uint32(18).string(e.hash),e.roomUsers!=null&&e.roomUsers.length)for(let O=0;O<e.roomUsers.length;++O)$root.com.quick.voice.proto.User.encode(e.roomUsers[O],n.uint32(26).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.hash=e.string();break}case 3:{$.roomUsers&&$.roomUsers.length||($.roomUsers=[]),$.roomUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.roomUsers.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.roomUsers[n]);if(O)return"roomUsers."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ToggleLiveRoomRsq)return e;let n=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.hash!=null&&(n.hash=String(e.hash)),e.roomUsers){if(!Array.isArray(e.roomUsers))throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: array expected");n.roomUsers=[];for(let O=0;O<e.roomUsers.length;++O){if(typeof e.roomUsers[O]!="object")throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: object expected");n.roomUsers[O]=$root.com.quick.voice.proto.User.fromObject(e.roomUsers[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.roomUsers=[]),n.defaults&&(O.roomId="",O.hash=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.hash!=null&&e.hasOwnProperty("hash")&&(O.hash=e.hash),e.roomUsers&&e.roomUsers.length){O.roomUsers=[];for(let $=0;$<e.roomUsers.length;++$)O.roomUsers[$]=$root.com.quick.voice.proto.User.toObject(e.roomUsers[$],n)}return O},_.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"},_}(),E.TrackType=function(){const _={},k=Object.create(_);return k[_[0]="Microphone"]=0,k[_[1]="Camera"]=1,k[_[2]="Screen"]=2,k[_[3]="SystemVoice"]=3,k}(),E.ReportInfoReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}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,n){return n||(n=$Writer.create()),e.actionEvent!=null&&Object.hasOwnProperty.call(e,"actionEvent")&&n.uint32(10).string(e.actionEvent),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(18).string(e.userId),e.platform!=null&&Object.hasOwnProperty.call(e,"platform")&&n.uint32(26).string(e.platform),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&n.uint32(32).int64(e.time),e.actionData!=null&&Object.hasOwnProperty.call(e,"actionData")&&n.uint32(42).string(e.actionData),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.ReportInfoReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.actionEvent=e.string();break}case 2:{$.userId=e.string();break}case 3:{$.platform=e.string();break}case 4:{$.time=e.int64();break}case 5:{$.actionData=e.string();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.ReportInfoReq;return e.actionEvent!=null&&(n.actionEvent=String(e.actionEvent)),e.userId!=null&&(n.userId=String(e.userId)),e.platform!=null&&(n.platform=String(e.platform)),e.time!=null&&($util.Long?(n.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?n.time=parseInt(e.time,10):typeof e.time=="number"?n.time=e.time:typeof e.time=="object"&&(n.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.actionData!=null&&(n.actionData=String(e.actionData)),n},_.toObject=function(e,n){n||(n={});let O={};if(n.defaults){if(O.actionEvent="",O.userId="",O.platform="",$util.Long){let $=new $util.Long(0,0,!1);O.time=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.time=n.longs===String?"0":0;O.actionData=""}return e.actionEvent!=null&&e.hasOwnProperty("actionEvent")&&(O.actionEvent=e.actionEvent),e.userId!=null&&e.hasOwnProperty("userId")&&(O.userId=e.userId),e.platform!=null&&e.hasOwnProperty("platform")&&(O.platform=e.platform),e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?O.time=n.longs===String?String(e.time):e.time:O.time=n.longs===String?$util.Long.prototype.toString.call(e.time):n.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),e.actionData!=null&&e.hasOwnProperty("actionData")&&(O.actionData=e.actionData),O},_.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"},_}(),E.UpdatePermissions=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.UpdatePermissions;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.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 n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdatePermissions)return e;let n=new $root.com.quick.voice.proto.UpdatePermissions;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.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"},_}(),E.CallType=function(){const _={},k=Object.create(_);return k[_[0]="Normal"]=0,k[_[1]="Meeting"]=1,k[_[2]="Live"]=2,k}(),E.QuitNotifyCode=function(){const _={},k=Object.create(_);return k[_[0]="NormalQuit"]=0,k[_[2021]="Timeout"]=2021,k[_[2011]="TokenExpired"]=2011,k[_[2022]="KickOut"]=2022,k[_[2023]="EndPk"]=2023,k[_[2024]="EndLive"]=2024,k}(),E.UserBehavior=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.type=0,_.prototype.behavior=!1,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&n.uint32(8).int32(e.type),e.behavior!=null&&Object.hasOwnProperty.call(e,"behavior")&&n.uint32(16).bool(e.behavior),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.UserBehavior;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.type=e.int32();break}case 2:{$.behavior=e.bool();break}default:e.skipType(N&7);break}}return $},_.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 n=new $root.com.quick.voice.proto.UserBehavior;switch(e.type){default:if(typeof e.type=="number"){n.type=e.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 e.behavior!=null&&(n.behavior=!!e.behavior),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.type=n.enums===String?"Microphone":0,O.behavior=!1),e.type!=null&&e.hasOwnProperty("type")&&(O.type=n.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")&&(O.behavior=e.behavior),O},_.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"},_}(),E.PreventUser=function(){function _(k){if(this.behaviors=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.id="",_.prototype.behaviors=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.id!=null&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),e.behaviors!=null&&e.behaviors.length)for(let O=0;O<e.behaviors.length;++O)$root.com.quick.voice.proto.UserBehavior.encode(e.behaviors[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.PreventUser;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.id=e.string();break}case 2:{$.behaviors&&$.behaviors.length||($.behaviors=[]),$.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.behaviors.length;++n){let O=$root.com.quick.voice.proto.UserBehavior.verify(e.behaviors[n]);if(O)return"behaviors."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUser)return e;let n=new $root.com.quick.voice.proto.PreventUser;if(e.id!=null&&(n.id=String(e.id)),e.behaviors){if(!Array.isArray(e.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");n.behaviors=[];for(let O=0;O<e.behaviors.length;++O){if(typeof e.behaviors[O]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");n.behaviors[O]=$root.com.quick.voice.proto.UserBehavior.fromObject(e.behaviors[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.behaviors=[]),n.defaults&&(O.id=""),e.id!=null&&e.hasOwnProperty("id")&&(O.id=e.id),e.behaviors&&e.behaviors.length){O.behaviors=[];for(let $=0;$<e.behaviors.length;++$)O.behaviors[$]=$root.com.quick.voice.proto.UserBehavior.toObject(e.behaviors[$],n)}return O},_.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"},_}(),E.PreventUsersBehaviorReq=function(){function _(k){if(this.users=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.users=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let O=0;O<e.users.length;++O)$root.com.quick.voice.proto.PreventUser.encode(e.users[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.users&&$.users.length||($.users=[]),$.users.push($root.com.quick.voice.proto.PreventUser.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.users.length;++n){let O=$root.com.quick.voice.proto.PreventUser.verify(e.users[n]);if(O)return"users."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return e;let n=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");n.users=[];for(let O=0;O<e.users.length;++O){if(typeof e.users[O]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");n.users[O]=$root.com.quick.voice.proto.PreventUser.fromObject(e.users[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.users=[]),n.defaults&&(O.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.users&&e.users.length){O.users=[];for(let $=0;$<e.users.length;++$)O.users[$]=$root.com.quick.voice.proto.PreventUser.toObject(e.users[$],n)}return O},_.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"},_}(),E.PreventUsersBehaviorNotify=function(){function _(k){if(this.users=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.users=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let O=0;O<e.users.length;++O)$root.com.quick.voice.proto.User.encode(e.users[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.users&&$.users.length||($.users=[]),$.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.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 n=0;n<e.users.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.users[n]);if(O)return"users."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return e;let n=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");n.users=[];for(let O=0;O<e.users.length;++O){if(typeof e.users[O]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");n.users[O]=$root.com.quick.voice.proto.User.fromObject(e.users[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.users=[]),n.defaults&&(O.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.users&&e.users.length){O.users=[];for(let $=0;$<e.users.length;++$)O.users[$]=$root.com.quick.voice.proto.User.toObject(e.users[$],n)}return O},_.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"},_}(),E.AccelerationAreas=function(){const _={},k=Object.create(_);return k[_[0]="chinaMainland"]=0,k[_[1]="global"]=1,k[_[2]="overseas"]=2,k}(),E.CountMethods=function(){const _={},k=Object.create(_);return k[_[0]="flow"]=0,k[_[1]="minutes"]=1,k}(),E.BaseCDNAddress=function(){function _(k){if(this.urlMap={},k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.area=0,_.prototype.countType=0,_.prototype.urlMap=$util.emptyObject,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.area!=null&&Object.hasOwnProperty.call(e,"area")&&n.uint32(8).int32(e.area),e.countType!=null&&Object.hasOwnProperty.call(e,"countType")&&n.uint32(16).int32(e.countType),e.urlMap!=null&&Object.hasOwnProperty.call(e,"urlMap"))for(let O=Object.keys(e.urlMap),$=0;$<O.length;++$)n.uint32(26).fork().uint32(10).string(O[$]).uint32(18).string(e.urlMap[O[$]]).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.BaseCDNAddress,N,D;for(;e.pos<O;){let q=e.uint32();switch(q>>>3){case 1:{$.area=e.int32();break}case 2:{$.countType=e.int32();break}case 3:{$.urlMap===$util.emptyObject&&($.urlMap={});let P=e.uint32()+e.pos;for(N="",D="";e.pos<P;){let j=e.uint32();switch(j>>>3){case 1:N=e.string();break;case 2:D=e.string();break;default:e.skipType(j&7);break}}$.urlMap[N]=D;break}default:e.skipType(q&7);break}}return $},_.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 n=Object.keys(e.urlMap);for(let O=0;O<n.length;++O)if(!$util.isString(e.urlMap[n[O]]))return"urlMap: string{k:string} expected"}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.BaseCDNAddress)return e;let n=new $root.com.quick.voice.proto.BaseCDNAddress;switch(e.area){default:if(typeof e.area=="number"){n.area=e.area;break}break;case"chinaMainland":case 0:n.area=0;break;case"global":case 1:n.area=1;break;case"overseas":case 2:n.area=2;break}switch(e.countType){default:if(typeof e.countType=="number"){n.countType=e.countType;break}break;case"flow":case 0:n.countType=0;break;case"minutes":case 1:n.countType=1;break}if(e.urlMap){if(typeof e.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");n.urlMap={};for(let O=Object.keys(e.urlMap),$=0;$<O.length;++$)n.urlMap[O[$]]=String(e.urlMap[O[$]])}return n},_.toObject=function(e,n){n||(n={});let O={};(n.objects||n.defaults)&&(O.urlMap={}),n.defaults&&(O.area=n.enums===String?"chinaMainland":0,O.countType=n.enums===String?"flow":0),e.area!=null&&e.hasOwnProperty("area")&&(O.area=n.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")&&(O.countType=n.enums===String?$root.com.quick.voice.proto.CountMethods[e.countType]===void 0?e.countType:$root.com.quick.voice.proto.CountMethods[e.countType]:e.countType);let $;if(e.urlMap&&($=Object.keys(e.urlMap)).length){O.urlMap={};for(let N=0;N<$.length;++N)O.urlMap[$[N]]=e.urlMap[$[N]]}return O},_.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"},_}(),E.CDNPlayAddressNotify=function(){function _(e){if(this.standLines=[],e)for(let n=Object.keys(e),O=0;O<n.length;++O)e[n[O]]!=null&&(this[n[O]]=e[n[O]])}_.prototype.roomId="",_.prototype.m3u8=null,_.prototype.rtmp=null,_.prototype.flv=null,_.prototype.rtmps=null,_.prototype.mainLine=null,_.prototype.standLines=$util.emptyArray;let k;return Object.defineProperty(_.prototype,"_m3u8",{get:$util.oneOfGetter(k=["m3u8"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_rtmp",{get:$util.oneOfGetter(k=["rtmp"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_flv",{get:$util.oneOfGetter(k=["flv"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_rtmps",{get:$util.oneOfGetter(k=["rtmps"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_mainLine",{get:$util.oneOfGetter(k=["mainLine"]),set:$util.oneOfSetter(k)}),_.create=function(n){return new _(n)},_.encode=function(n,O){if(O||(O=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&O.uint32(10).string(n.roomId),n.m3u8!=null&&Object.hasOwnProperty.call(n,"m3u8")&&O.uint32(18).string(n.m3u8),n.rtmp!=null&&Object.hasOwnProperty.call(n,"rtmp")&&O.uint32(26).string(n.rtmp),n.flv!=null&&Object.hasOwnProperty.call(n,"flv")&&O.uint32(34).string(n.flv),n.rtmps!=null&&Object.hasOwnProperty.call(n,"rtmps")&&O.uint32(42).string(n.rtmps),n.mainLine!=null&&Object.hasOwnProperty.call(n,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(n.mainLine,O.uint32(50).fork()).ldelim(),n.standLines!=null&&n.standLines.length)for(let $=0;$<n.standLines.length;++$)$root.com.quick.voice.proto.BaseCDNAddress.encode(n.standLines[$],O.uint32(58).fork()).ldelim();return O},_.encodeDelimited=function(n,O){return this.encode(n,O).ldelim()},_.decode=function(n,O){n instanceof $Reader||(n=$Reader.create(n));let $=O===void 0?n.len:n.pos+O,N=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;n.pos<$;){let D=n.uint32();switch(D>>>3){case 1:{N.roomId=n.string();break}case 2:{N.m3u8=n.string();break}case 3:{N.rtmp=n.string();break}case 4:{N.flv=n.string();break}case 5:{N.rtmps=n.string();break}case 6:{N.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(n,n.uint32());break}case 7:{N.standLines&&N.standLines.length||(N.standLines=[]),N.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(n,n.uint32()));break}default:n.skipType(D&7);break}}return N},_.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},_.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.m3u8!=null&&n.hasOwnProperty("m3u8")&&!$util.isString(n.m3u8))return"m3u8: string expected";if(n.rtmp!=null&&n.hasOwnProperty("rtmp")&&!$util.isString(n.rtmp))return"rtmp: string expected";if(n.flv!=null&&n.hasOwnProperty("flv")&&!$util.isString(n.flv))return"flv: string expected";if(n.rtmps!=null&&n.hasOwnProperty("rtmps")&&!$util.isString(n.rtmps))return"rtmps: string expected";if(n.mainLine!=null&&n.hasOwnProperty("mainLine")){let O=$root.com.quick.voice.proto.BaseCDNAddress.verify(n.mainLine);if(O)return"mainLine."+O}if(n.standLines!=null&&n.hasOwnProperty("standLines")){if(!Array.isArray(n.standLines))return"standLines: array expected";for(let O=0;O<n.standLines.length;++O){let $=$root.com.quick.voice.proto.BaseCDNAddress.verify(n.standLines[O]);if($)return"standLines."+$}}return null},_.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return n;let O=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(n.roomId!=null&&(O.roomId=String(n.roomId)),n.m3u8!=null&&(O.m3u8=String(n.m3u8)),n.rtmp!=null&&(O.rtmp=String(n.rtmp)),n.flv!=null&&(O.flv=String(n.flv)),n.rtmps!=null&&(O.rtmps=String(n.rtmps)),n.mainLine!=null){if(typeof n.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");O.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(n.mainLine)}if(n.standLines){if(!Array.isArray(n.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");O.standLines=[];for(let $=0;$<n.standLines.length;++$){if(typeof n.standLines[$]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");O.standLines[$]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(n.standLines[$])}}return O},_.toObject=function(n,O){O||(O={});let $={};if((O.arrays||O.defaults)&&($.standLines=[]),O.defaults&&($.roomId=""),n.roomId!=null&&n.hasOwnProperty("roomId")&&($.roomId=n.roomId),n.m3u8!=null&&n.hasOwnProperty("m3u8")&&($.m3u8=n.m3u8,O.oneofs&&($._m3u8="m3u8")),n.rtmp!=null&&n.hasOwnProperty("rtmp")&&($.rtmp=n.rtmp,O.oneofs&&($._rtmp="rtmp")),n.flv!=null&&n.hasOwnProperty("flv")&&($.flv=n.flv,O.oneofs&&($._flv="flv")),n.rtmps!=null&&n.hasOwnProperty("rtmps")&&($.rtmps=n.rtmps,O.oneofs&&($._rtmps="rtmps")),n.mainLine!=null&&n.hasOwnProperty("mainLine")&&($.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(n.mainLine,O),O.oneofs&&($._mainLine="mainLine")),n.standLines&&n.standLines.length){$.standLines=[];for(let N=0;N<n.standLines.length;++N)$.standLines[N]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(n.standLines[N],O)}return $},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.CDNPlayAddressNotify"},_}(),E}(),u}(),I}(),a})(),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销毁"};pt(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(a){let I=a.length;for(;--I>=0;)a[I]=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(a,I,u,E,_){this.static_tree=a,this.extra_bits=I,this.extra_base=u,this.elems=E,this.max_length=_,this.has_stree=a&&a.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(a,I){this.dyn_tree=a,this.max_code=0,this.stat_desc=I}const d_code=a=>a<256?_dist_code[a]:_dist_code[256+(a>>>7)],put_short=(a,I)=>{a.pending_buf[a.pending++]=I&255,a.pending_buf[a.pending++]=I>>>8&255},send_bits=(a,I,u)=>{a.bi_valid>Buf_size-u?(a.bi_buf|=I<<a.bi_valid&65535,put_short(a,a.bi_buf),a.bi_buf=I>>Buf_size-a.bi_valid,a.bi_valid+=u-Buf_size):(a.bi_buf|=I<<a.bi_valid&65535,a.bi_valid+=u)},send_code=(a,I,u)=>{send_bits(a,u[I*2],u[I*2+1])},bi_reverse=(a,I)=>{let u=0;do u|=a&1,a>>>=1,u<<=1;while(--I>0);return u>>>1},bi_flush=a=>{a.bi_valid===16?(put_short(a,a.bi_buf),a.bi_buf=0,a.bi_valid=0):a.bi_valid>=8&&(a.pending_buf[a.pending++]=a.bi_buf&255,a.bi_buf>>=8,a.bi_valid-=8)},gen_bitlen=(a,I)=>{const u=I.dyn_tree,E=I.max_code,_=I.stat_desc.static_tree,k=I.stat_desc.has_stree,e=I.stat_desc.extra_bits,n=I.stat_desc.extra_base,O=I.stat_desc.max_length;let $,N,D,q,P,j,Q=0;for(q=0;q<=MAX_BITS$1;q++)a.bl_count[q]=0;for(u[a.heap[a.heap_max]*2+1]=0,$=a.heap_max+1;$<HEAP_SIZE$1;$++)N=a.heap[$],q=u[u[N*2+1]*2+1]+1,q>O&&(q=O,Q++),u[N*2+1]=q,!(N>E)&&(a.bl_count[q]++,P=0,N>=n&&(P=e[N-n]),j=u[N*2],a.opt_len+=j*(q+P),k&&(a.static_len+=j*(_[N*2+1]+P)));if(Q!==0){do{for(q=O-1;a.bl_count[q]===0;)q--;a.bl_count[q]--,a.bl_count[q+1]+=2,a.bl_count[O]--,Q-=2}while(Q>0);for(q=O;q!==0;q--)for(N=a.bl_count[q];N!==0;)D=a.heap[--$],!(D>E)&&(u[D*2+1]!==q&&(a.opt_len+=(q-u[D*2+1])*u[D*2],u[D*2+1]=q),N--)}},gen_codes=(a,I,u)=>{const E=new Array(MAX_BITS$1+1);let _=0,k,e;for(k=1;k<=MAX_BITS$1;k++)_=_+u[k-1]<<1,E[k]=_;for(e=0;e<=I;e++){let n=a[e*2+1];n!==0&&(a[e*2]=bi_reverse(E[n]++,n))}},tr_static_init=()=>{let a,I,u,E,_;const k=new Array(MAX_BITS$1+1);for(u=0,E=0;E<LENGTH_CODES$1-1;E++)for(base_length[E]=u,a=0;a<1<<extra_lbits[E];a++)_length_code[u++]=E;for(_length_code[u-1]=E,_=0,E=0;E<16;E++)for(base_dist[E]=_,a=0;a<1<<extra_dbits[E];a++)_dist_code[_++]=E;for(_>>=7;E<D_CODES$1;E++)for(base_dist[E]=_<<7,a=0;a<1<<extra_dbits[E]-7;a++)_dist_code[256+_++]=E;for(I=0;I<=MAX_BITS$1;I++)k[I]=0;for(a=0;a<=143;)static_ltree[a*2+1]=8,a++,k[8]++;for(;a<=255;)static_ltree[a*2+1]=9,a++,k[9]++;for(;a<=279;)static_ltree[a*2+1]=7,a++,k[7]++;for(;a<=287;)static_ltree[a*2+1]=8,a++,k[8]++;for(gen_codes(static_ltree,L_CODES$1+1,k),a=0;a<D_CODES$1;a++)static_dtree[a*2+1]=5,static_dtree[a*2]=bi_reverse(a,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=a=>{let I;for(I=0;I<L_CODES$1;I++)a.dyn_ltree[I*2]=0;for(I=0;I<D_CODES$1;I++)a.dyn_dtree[I*2]=0;for(I=0;I<BL_CODES$1;I++)a.bl_tree[I*2]=0;a.dyn_ltree[END_BLOCK*2]=1,a.opt_len=a.static_len=0,a.sym_next=a.matches=0},bi_windup=a=>{a.bi_valid>8?put_short(a,a.bi_buf):a.bi_valid>0&&(a.pending_buf[a.pending++]=a.bi_buf),a.bi_buf=0,a.bi_valid=0},smaller=(a,I,u,E)=>{const _=I*2,k=u*2;return a[_]<a[k]||a[_]===a[k]&&E[I]<=E[u]},pqdownheap=(a,I,u)=>{const E=a.heap[u];let _=u<<1;for(;_<=a.heap_len&&(_<a.heap_len&&smaller(I,a.heap[_+1],a.heap[_],a.depth)&&_++,!smaller(I,E,a.heap[_],a.depth));)a.heap[u]=a.heap[_],u=_,_<<=1;a.heap[u]=E},compress_block=(a,I,u)=>{let E,_,k=0,e,n;if(a.sym_next!==0)do E=a.pending_buf[a.sym_buf+k++]&255,E+=(a.pending_buf[a.sym_buf+k++]&255)<<8,_=a.pending_buf[a.sym_buf+k++],E===0?send_code(a,_,I):(e=_length_code[_],send_code(a,e+LITERALS$1+1,I),n=extra_lbits[e],n!==0&&(_-=base_length[e],send_bits(a,_,n)),E--,e=d_code(E),send_code(a,e,u),n=extra_dbits[e],n!==0&&(E-=base_dist[e],send_bits(a,E,n)));while(k<a.sym_next);send_code(a,END_BLOCK,I)},build_tree=(a,I)=>{const u=I.dyn_tree,E=I.stat_desc.static_tree,_=I.stat_desc.has_stree,k=I.stat_desc.elems;let e,n,O=-1,$;for(a.heap_len=0,a.heap_max=HEAP_SIZE$1,e=0;e<k;e++)u[e*2]!==0?(a.heap[++a.heap_len]=O=e,a.depth[e]=0):u[e*2+1]=0;for(;a.heap_len<2;)$=a.heap[++a.heap_len]=O<2?++O:0,u[$*2]=1,a.depth[$]=0,a.opt_len--,_&&(a.static_len-=E[$*2+1]);for(I.max_code=O,e=a.heap_len>>1;e>=1;e--)pqdownheap(a,u,e);$=k;do e=a.heap[1],a.heap[1]=a.heap[a.heap_len--],pqdownheap(a,u,1),n=a.heap[1],a.heap[--a.heap_max]=e,a.heap[--a.heap_max]=n,u[$*2]=u[e*2]+u[n*2],a.depth[$]=(a.depth[e]>=a.depth[n]?a.depth[e]:a.depth[n])+1,u[e*2+1]=u[n*2+1]=$,a.heap[1]=$++,pqdownheap(a,u,1);while(a.heap_len>=2);a.heap[--a.heap_max]=a.heap[1],gen_bitlen(a,I),gen_codes(u,O,a.bl_count)},scan_tree=(a,I,u)=>{let E,_=-1,k,e=I[0*2+1],n=0,O=7,$=4;for(e===0&&(O=138,$=3),I[(u+1)*2+1]=65535,E=0;E<=u;E++)k=e,e=I[(E+1)*2+1],!(++n<O&&k===e)&&(n<$?a.bl_tree[k*2]+=n:k!==0?(k!==_&&a.bl_tree[k*2]++,a.bl_tree[REP_3_6*2]++):n<=10?a.bl_tree[REPZ_3_10*2]++:a.bl_tree[REPZ_11_138*2]++,n=0,_=k,e===0?(O=138,$=3):k===e?(O=6,$=3):(O=7,$=4))},send_tree=(a,I,u)=>{let E,_=-1,k,e=I[0*2+1],n=0,O=7,$=4;for(e===0&&(O=138,$=3),E=0;E<=u;E++)if(k=e,e=I[(E+1)*2+1],!(++n<O&&k===e)){if(n<$)do send_code(a,k,a.bl_tree);while(--n!==0);else k!==0?(k!==_&&(send_code(a,k,a.bl_tree),n--),send_code(a,REP_3_6,a.bl_tree),send_bits(a,n-3,2)):n<=10?(send_code(a,REPZ_3_10,a.bl_tree),send_bits(a,n-3,3)):(send_code(a,REPZ_11_138,a.bl_tree),send_bits(a,n-11,7));n=0,_=k,e===0?(O=138,$=3):k===e?(O=6,$=3):(O=7,$=4)}},build_bl_tree=a=>{let I;for(scan_tree(a,a.dyn_ltree,a.l_desc.max_code),scan_tree(a,a.dyn_dtree,a.d_desc.max_code),build_tree(a,a.bl_desc),I=BL_CODES$1-1;I>=3&&a.bl_tree[bl_order[I]*2+1]===0;I--);return a.opt_len+=3*(I+1)+5+5+4,I},send_all_trees=(a,I,u,E)=>{let _;for(send_bits(a,I-257,5),send_bits(a,u-1,5),send_bits(a,E-4,4),_=0;_<E;_++)send_bits(a,a.bl_tree[bl_order[_]*2+1],3);send_tree(a,a.dyn_ltree,I-1),send_tree(a,a.dyn_dtree,u-1)},detect_data_type=a=>{let I=4093624447,u;for(u=0;u<=31;u++,I>>>=1)if(I&1&&a.dyn_ltree[u*2]!==0)return Z_BINARY;if(a.dyn_ltree[9*2]!==0||a.dyn_ltree[10*2]!==0||a.dyn_ltree[13*2]!==0)return Z_TEXT;for(u=32;u<LITERALS$1;u++)if(a.dyn_ltree[u*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=a=>{static_init_done||(tr_static_init(),static_init_done=!0),a.l_desc=new TreeDesc(a.dyn_ltree,static_l_desc),a.d_desc=new TreeDesc(a.dyn_dtree,static_d_desc),a.bl_desc=new TreeDesc(a.bl_tree,static_bl_desc),a.bi_buf=0,a.bi_valid=0,init_block(a)},_tr_stored_block$1=(a,I,u,E)=>{send_bits(a,(STORED_BLOCK<<1)+(E?1:0),3),bi_windup(a),put_short(a,u),put_short(a,~u),u&&a.pending_buf.set(a.window.subarray(I,I+u),a.pending),a.pending+=u},_tr_align$1=a=>{send_bits(a,STATIC_TREES<<1,3),send_code(a,END_BLOCK,static_ltree),bi_flush(a)},_tr_flush_block$1=(a,I,u,E)=>{let _,k,e=0;a.level>0?(a.strm.data_type===Z_UNKNOWN$1&&(a.strm.data_type=detect_data_type(a)),build_tree(a,a.l_desc),build_tree(a,a.d_desc),e=build_bl_tree(a),_=a.opt_len+3+7>>>3,k=a.static_len+3+7>>>3,k<=_&&(_=k)):_=k=u+5,u+4<=_&&I!==-1?_tr_stored_block$1(a,I,u,E):a.strategy===Z_FIXED$1||k===_?(send_bits(a,(STATIC_TREES<<1)+(E?1:0),3),compress_block(a,static_ltree,static_dtree)):(send_bits(a,(DYN_TREES<<1)+(E?1:0),3),send_all_trees(a,a.l_desc.max_code+1,a.d_desc.max_code+1,e+1),compress_block(a,a.dyn_ltree,a.dyn_dtree)),init_block(a),E&&bi_windup(a)},_tr_tally$1=(a,I,u)=>(a.pending_buf[a.sym_buf+a.sym_next++]=I,a.pending_buf[a.sym_buf+a.sym_next++]=I>>8,a.pending_buf[a.sym_buf+a.sym_next++]=u,I===0?a.dyn_ltree[u*2]++:(a.matches++,I--,a.dyn_ltree[(_length_code[u]+LITERALS$1+1)*2]++,a.dyn_dtree[d_code(I)*2]++),a.sym_next===a.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=(a,I,u,E)=>{let _=a&65535|0,k=a>>>16&65535|0,e=0;for(;u!==0;){e=u>2e3?2e3:u,u-=e;do _=_+I[E++]|0,k=k+_|0;while(--e);_%=65521,k%=65521}return _|k<<16|0};var adler32_1=adler32;const makeTable=()=>{let a,I=[];for(var u=0;u<256;u++){a=u;for(var E=0;E<8;E++)a=a&1?3988292384^a>>>1:a>>>1;I[u]=a}return I},crcTable=new Uint32Array(makeTable()),crc32=(a,I,u,E)=>{const _=crcTable,k=E+u;a^=-1;for(let e=E;e<k;e++)a=a>>>8^_[(a^I[e])&255];return a^-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=(a,I)=>(a.msg=messages[I],I),rank=a=>a*2-(a>4?9:0),zero=a=>{let I=a.length;for(;--I>=0;)a[I]=0},slide_hash=a=>{let I,u,E,_=a.w_size;I=a.hash_size,E=I;do u=a.head[--E],a.head[E]=u>=_?u-_:0;while(--I);I=_,E=I;do u=a.prev[--E],a.prev[E]=u>=_?u-_:0;while(--I)};let HASH_ZLIB=(a,I,u)=>(I<<a.hash_shift^u)&a.hash_mask,HASH=HASH_ZLIB;const flush_pending=a=>{const I=a.state;let u=I.pending;u>a.avail_out&&(u=a.avail_out),u!==0&&(a.output.set(I.pending_buf.subarray(I.pending_out,I.pending_out+u),a.next_out),a.next_out+=u,I.pending_out+=u,a.total_out+=u,a.avail_out-=u,I.pending-=u,I.pending===0&&(I.pending_out=0))},flush_block_only=(a,I)=>{_tr_flush_block(a,a.block_start>=0?a.block_start:-1,a.strstart-a.block_start,I),a.block_start=a.strstart,flush_pending(a.strm)},put_byte=(a,I)=>{a.pending_buf[a.pending++]=I},putShortMSB=(a,I)=>{a.pending_buf[a.pending++]=I>>>8&255,a.pending_buf[a.pending++]=I&255},read_buf=(a,I,u,E)=>{let _=a.avail_in;return _>E&&(_=E),_===0?0:(a.avail_in-=_,I.set(a.input.subarray(a.next_in,a.next_in+_),u),a.state.wrap===1?a.adler=adler32_1(a.adler,I,_,u):a.state.wrap===2&&(a.adler=crc32_1(a.adler,I,_,u)),a.next_in+=_,a.total_in+=_,_)},longest_match=(a,I)=>{let u=a.max_chain_length,E=a.strstart,_,k,e=a.prev_length,n=a.nice_match;const O=a.strstart>a.w_size-MIN_LOOKAHEAD?a.strstart-(a.w_size-MIN_LOOKAHEAD):0,$=a.window,N=a.w_mask,D=a.prev,q=a.strstart+MAX_MATCH;let P=$[E+e-1],j=$[E+e];a.prev_length>=a.good_match&&(u>>=2),n>a.lookahead&&(n=a.lookahead);do if(_=I,!($[_+e]!==j||$[_+e-1]!==P||$[_]!==$[E]||$[++_]!==$[E+1])){E+=2,_++;do;while($[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&E<q);if(k=MAX_MATCH-(q-E),E=q-MAX_MATCH,k>e){if(a.match_start=I,e=k,k>=n)break;P=$[E+e-1],j=$[E+e]}}while((I=D[I&N])>O&&--u!==0);return e<=a.lookahead?e:a.lookahead},fill_window=a=>{const I=a.w_size;let u,E,_;do{if(E=a.window_size-a.lookahead-a.strstart,a.strstart>=I+(I-MIN_LOOKAHEAD)&&(a.window.set(a.window.subarray(I,I+I-E),0),a.match_start-=I,a.strstart-=I,a.block_start-=I,a.insert>a.strstart&&(a.insert=a.strstart),slide_hash(a),E+=I),a.strm.avail_in===0)break;if(u=read_buf(a.strm,a.window,a.strstart+a.lookahead,E),a.lookahead+=u,a.lookahead+a.insert>=MIN_MATCH)for(_=a.strstart-a.insert,a.ins_h=a.window[_],a.ins_h=HASH(a,a.ins_h,a.window[_+1]);a.insert&&(a.ins_h=HASH(a,a.ins_h,a.window[_+MIN_MATCH-1]),a.prev[_&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=_,_++,a.insert--,!(a.lookahead+a.insert<MIN_MATCH)););}while(a.lookahead<MIN_LOOKAHEAD&&a.strm.avail_in!==0)},deflate_stored=(a,I)=>{let u=a.pending_buf_size-5>a.w_size?a.w_size:a.pending_buf_size-5,E,_,k,e=0,n=a.strm.avail_in;do{if(E=65535,k=a.bi_valid+42>>3,a.strm.avail_out<k||(k=a.strm.avail_out-k,_=a.strstart-a.block_start,E>_+a.strm.avail_in&&(E=_+a.strm.avail_in),E>k&&(E=k),E<u&&(E===0&&I!==Z_FINISH$3||I===Z_NO_FLUSH$2||E!==_+a.strm.avail_in)))break;e=I===Z_FINISH$3&&E===_+a.strm.avail_in?1:0,_tr_stored_block(a,0,0,e),a.pending_buf[a.pending-4]=E,a.pending_buf[a.pending-3]=E>>8,a.pending_buf[a.pending-2]=~E,a.pending_buf[a.pending-1]=~E>>8,flush_pending(a.strm),_&&(_>E&&(_=E),a.strm.output.set(a.window.subarray(a.block_start,a.block_start+_),a.strm.next_out),a.strm.next_out+=_,a.strm.avail_out-=_,a.strm.total_out+=_,a.block_start+=_,E-=_),E&&(read_buf(a.strm,a.strm.output,a.strm.next_out,E),a.strm.next_out+=E,a.strm.avail_out-=E,a.strm.total_out+=E)}while(e===0);return n-=a.strm.avail_in,n&&(n>=a.w_size?(a.matches=2,a.window.set(a.strm.input.subarray(a.strm.next_in-a.w_size,a.strm.next_in),0),a.strstart=a.w_size,a.insert=a.strstart):(a.window_size-a.strstart<=n&&(a.strstart-=a.w_size,a.window.set(a.window.subarray(a.w_size,a.w_size+a.strstart),0),a.matches<2&&a.matches++,a.insert>a.strstart&&(a.insert=a.strstart)),a.window.set(a.strm.input.subarray(a.strm.next_in-n,a.strm.next_in),a.strstart),a.strstart+=n,a.insert+=n>a.w_size-a.insert?a.w_size-a.insert:n),a.block_start=a.strstart),a.high_water<a.strstart&&(a.high_water=a.strstart),e?BS_FINISH_DONE:I!==Z_NO_FLUSH$2&&I!==Z_FINISH$3&&a.strm.avail_in===0&&a.strstart===a.block_start?BS_BLOCK_DONE:(k=a.window_size-a.strstart,a.strm.avail_in>k&&a.block_start>=a.w_size&&(a.block_start-=a.w_size,a.strstart-=a.w_size,a.window.set(a.window.subarray(a.w_size,a.w_size+a.strstart),0),a.matches<2&&a.matches++,k+=a.w_size,a.insert>a.strstart&&(a.insert=a.strstart)),k>a.strm.avail_in&&(k=a.strm.avail_in),k&&(read_buf(a.strm,a.window,a.strstart,k),a.strstart+=k,a.insert+=k>a.w_size-a.insert?a.w_size-a.insert:k),a.high_water<a.strstart&&(a.high_water=a.strstart),k=a.bi_valid+42>>3,k=a.pending_buf_size-k>65535?65535:a.pending_buf_size-k,u=k>a.w_size?a.w_size:k,_=a.strstart-a.block_start,(_>=u||(_||I===Z_FINISH$3)&&I!==Z_NO_FLUSH$2&&a.strm.avail_in===0&&_<=k)&&(E=_>k?k:_,e=I===Z_FINISH$3&&a.strm.avail_in===0&&E===_?1:0,_tr_stored_block(a,a.block_start,E,e),a.block_start+=E,flush_pending(a.strm)),e?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(a,I)=>{let u,E;for(;;){if(a.lookahead<MIN_LOOKAHEAD){if(fill_window(a),a.lookahead<MIN_LOOKAHEAD&&I===Z_NO_FLUSH$2)return BS_NEED_MORE;if(a.lookahead===0)break}if(u=0,a.lookahead>=MIN_MATCH&&(a.ins_h=HASH(a,a.ins_h,a.window[a.strstart+MIN_MATCH-1]),u=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),u!==0&&a.strstart-u<=a.w_size-MIN_LOOKAHEAD&&(a.match_length=longest_match(a,u)),a.match_length>=MIN_MATCH)if(E=_tr_tally(a,a.strstart-a.match_start,a.match_length-MIN_MATCH),a.lookahead-=a.match_length,a.match_length<=a.max_lazy_match&&a.lookahead>=MIN_MATCH){a.match_length--;do a.strstart++,a.ins_h=HASH(a,a.ins_h,a.window[a.strstart+MIN_MATCH-1]),u=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart;while(--a.match_length!==0);a.strstart++}else a.strstart+=a.match_length,a.match_length=0,a.ins_h=a.window[a.strstart],a.ins_h=HASH(a,a.ins_h,a.window[a.strstart+1]);else E=_tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++;if(E&&(flush_block_only(a,!1),a.strm.avail_out===0))return BS_NEED_MORE}return a.insert=a.strstart<MIN_MATCH-1?a.strstart:MIN_MATCH-1,I===Z_FINISH$3?(flush_block_only(a,!0),a.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):a.sym_next&&(flush_block_only(a,!1),a.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(a,I)=>{let u,E,_;for(;;){if(a.lookahead<MIN_LOOKAHEAD){if(fill_window(a),a.lookahead<MIN_LOOKAHEAD&&I===Z_NO_FLUSH$2)return BS_NEED_MORE;if(a.lookahead===0)break}if(u=0,a.lookahead>=MIN_MATCH&&(a.ins_h=HASH(a,a.ins_h,a.window[a.strstart+MIN_MATCH-1]),u=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),a.prev_length=a.match_length,a.prev_match=a.match_start,a.match_length=MIN_MATCH-1,u!==0&&a.prev_length<a.max_lazy_match&&a.strstart-u<=a.w_size-MIN_LOOKAHEAD&&(a.match_length=longest_match(a,u),a.match_length<=5&&(a.strategy===Z_FILTERED||a.match_length===MIN_MATCH&&a.strstart-a.match_start>4096)&&(a.match_length=MIN_MATCH-1)),a.prev_length>=MIN_MATCH&&a.match_length<=a.prev_length){_=a.strstart+a.lookahead-MIN_MATCH,E=_tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-MIN_MATCH),a.lookahead-=a.prev_length-1,a.prev_length-=2;do++a.strstart<=_&&(a.ins_h=HASH(a,a.ins_h,a.window[a.strstart+MIN_MATCH-1]),u=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);while(--a.prev_length!==0);if(a.match_available=0,a.match_length=MIN_MATCH-1,a.strstart++,E&&(flush_block_only(a,!1),a.strm.avail_out===0))return BS_NEED_MORE}else if(a.match_available){if(E=_tr_tally(a,0,a.window[a.strstart-1]),E&&flush_block_only(a,!1),a.strstart++,a.lookahead--,a.strm.avail_out===0)return BS_NEED_MORE}else a.match_available=1,a.strstart++,a.lookahead--}return a.match_available&&(E=_tr_tally(a,0,a.window[a.strstart-1]),a.match_available=0),a.insert=a.strstart<MIN_MATCH-1?a.strstart:MIN_MATCH-1,I===Z_FINISH$3?(flush_block_only(a,!0),a.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):a.sym_next&&(flush_block_only(a,!1),a.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(a,I)=>{let u,E,_,k;const e=a.window;for(;;){if(a.lookahead<=MAX_MATCH){if(fill_window(a),a.lookahead<=MAX_MATCH&&I===Z_NO_FLUSH$2)return BS_NEED_MORE;if(a.lookahead===0)break}if(a.match_length=0,a.lookahead>=MIN_MATCH&&a.strstart>0&&(_=a.strstart-1,E=e[_],E===e[++_]&&E===e[++_]&&E===e[++_])){k=a.strstart+MAX_MATCH;do;while(E===e[++_]&&E===e[++_]&&E===e[++_]&&E===e[++_]&&E===e[++_]&&E===e[++_]&&E===e[++_]&&E===e[++_]&&_<k);a.match_length=MAX_MATCH-(k-_),a.match_length>a.lookahead&&(a.match_length=a.lookahead)}if(a.match_length>=MIN_MATCH?(u=_tr_tally(a,1,a.match_length-MIN_MATCH),a.lookahead-=a.match_length,a.strstart+=a.match_length,a.match_length=0):(u=_tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++),u&&(flush_block_only(a,!1),a.strm.avail_out===0))return BS_NEED_MORE}return a.insert=0,I===Z_FINISH$3?(flush_block_only(a,!0),a.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):a.sym_next&&(flush_block_only(a,!1),a.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(a,I)=>{let u;for(;;){if(a.lookahead===0&&(fill_window(a),a.lookahead===0)){if(I===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(a.match_length=0,u=_tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++,u&&(flush_block_only(a,!1),a.strm.avail_out===0))return BS_NEED_MORE}return a.insert=0,I===Z_FINISH$3?(flush_block_only(a,!0),a.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):a.sym_next&&(flush_block_only(a,!1),a.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(a,I,u,E,_){this.good_length=a,this.max_lazy=I,this.nice_length=u,this.max_chain=E,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=a=>{a.window_size=2*a.w_size,zero(a.head),a.max_lazy_match=configuration_table[a.level].max_lazy,a.good_match=configuration_table[a.level].good_length,a.nice_match=configuration_table[a.level].nice_length,a.max_chain_length=configuration_table[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=MIN_MATCH-1,a.match_available=0,a.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=a=>{if(!a)return 1;const I=a.state;return!I||I.strm!==a||I.status!==INIT_STATE&&I.status!==GZIP_STATE&&I.status!==EXTRA_STATE&&I.status!==NAME_STATE&&I.status!==COMMENT_STATE&&I.status!==HCRC_STATE&&I.status!==BUSY_STATE&&I.status!==FINISH_STATE?1:0},deflateResetKeep=a=>{if(deflateStateCheck(a))return err(a,Z_STREAM_ERROR$2);a.total_in=a.total_out=0,a.data_type=Z_UNKNOWN;const I=a.state;return I.pending=0,I.pending_out=0,I.wrap<0&&(I.wrap=-I.wrap),I.status=I.wrap===2?GZIP_STATE:I.wrap?INIT_STATE:BUSY_STATE,a.adler=I.wrap===2?0:1,I.last_flush=-2,_tr_init(I),Z_OK$3},deflateReset=a=>{const I=deflateResetKeep(a);return I===Z_OK$3&&lm_init(a.state),I},deflateSetHeader=(a,I)=>deflateStateCheck(a)||a.state.wrap!==2?Z_STREAM_ERROR$2:(a.state.gzhead=I,Z_OK$3),deflateInit2=(a,I,u,E,_,k)=>{if(!a)return Z_STREAM_ERROR$2;let e=1;if(I===Z_DEFAULT_COMPRESSION$1&&(I=6),E<0?(e=0,E=-E):E>15&&(e=2,E-=16),_<1||_>MAX_MEM_LEVEL||u!==Z_DEFLATED$2||E<8||E>15||I<0||I>9||k<0||k>Z_FIXED||E===8&&e!==1)return err(a,Z_STREAM_ERROR$2);E===8&&(E=9);const n=new DeflateState;return a.state=n,n.strm=a,n.status=INIT_STATE,n.wrap=e,n.gzhead=null,n.w_bits=E,n.w_size=1<<n.w_bits,n.w_mask=n.w_size-1,n.hash_bits=_+7,n.hash_size=1<<n.hash_bits,n.hash_mask=n.hash_size-1,n.hash_shift=~~((n.hash_bits+MIN_MATCH-1)/MIN_MATCH),n.window=new Uint8Array(n.w_size*2),n.head=new Uint16Array(n.hash_size),n.prev=new Uint16Array(n.w_size),n.lit_bufsize=1<<_+6,n.pending_buf_size=n.lit_bufsize*4,n.pending_buf=new Uint8Array(n.pending_buf_size),n.sym_buf=n.lit_bufsize,n.sym_end=(n.lit_bufsize-1)*3,n.level=I,n.strategy=k,n.method=u,deflateReset(a)},deflateInit=(a,I)=>deflateInit2(a,I,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(a,I)=>{if(deflateStateCheck(a)||I>Z_BLOCK$1||I<0)return a?err(a,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const u=a.state;if(!a.output||a.avail_in!==0&&!a.input||u.status===FINISH_STATE&&I!==Z_FINISH$3)return err(a,a.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const E=u.last_flush;if(u.last_flush=I,u.pending!==0){if(flush_pending(a),a.avail_out===0)return u.last_flush=-1,Z_OK$3}else if(a.avail_in===0&&rank(I)<=rank(E)&&I!==Z_FINISH$3)return err(a,Z_BUF_ERROR$1);if(u.status===FINISH_STATE&&a.avail_in!==0)return err(a,Z_BUF_ERROR$1);if(u.status===INIT_STATE&&u.wrap===0&&(u.status=BUSY_STATE),u.status===INIT_STATE){let _=Z_DEFLATED$2+(u.w_bits-8<<4)<<8,k=-1;if(u.strategy>=Z_HUFFMAN_ONLY||u.level<2?k=0:u.level<6?k=1:u.level===6?k=2:k=3,_|=k<<6,u.strstart!==0&&(_|=PRESET_DICT),_+=31-_%31,putShortMSB(u,_),u.strstart!==0&&(putShortMSB(u,a.adler>>>16),putShortMSB(u,a.adler&65535)),a.adler=1,u.status=BUSY_STATE,flush_pending(a),u.pending!==0)return u.last_flush=-1,Z_OK$3}if(u.status===GZIP_STATE){if(a.adler=0,put_byte(u,31),put_byte(u,139),put_byte(u,8),u.gzhead)put_byte(u,(u.gzhead.text?1:0)+(u.gzhead.hcrc?2:0)+(u.gzhead.extra?4:0)+(u.gzhead.name?8:0)+(u.gzhead.comment?16:0)),put_byte(u,u.gzhead.time&255),put_byte(u,u.gzhead.time>>8&255),put_byte(u,u.gzhead.time>>16&255),put_byte(u,u.gzhead.time>>24&255),put_byte(u,u.level===9?2:u.strategy>=Z_HUFFMAN_ONLY||u.level<2?4:0),put_byte(u,u.gzhead.os&255),u.gzhead.extra&&u.gzhead.extra.length&&(put_byte(u,u.gzhead.extra.length&255),put_byte(u,u.gzhead.extra.length>>8&255)),u.gzhead.hcrc&&(a.adler=crc32_1(a.adler,u.pending_buf,u.pending,0)),u.gzindex=0,u.status=EXTRA_STATE;else if(put_byte(u,0),put_byte(u,0),put_byte(u,0),put_byte(u,0),put_byte(u,0),put_byte(u,u.level===9?2:u.strategy>=Z_HUFFMAN_ONLY||u.level<2?4:0),put_byte(u,OS_CODE),u.status=BUSY_STATE,flush_pending(a),u.pending!==0)return u.last_flush=-1,Z_OK$3}if(u.status===EXTRA_STATE){if(u.gzhead.extra){let _=u.pending,k=(u.gzhead.extra.length&65535)-u.gzindex;for(;u.pending+k>u.pending_buf_size;){let n=u.pending_buf_size-u.pending;if(u.pending_buf.set(u.gzhead.extra.subarray(u.gzindex,u.gzindex+n),u.pending),u.pending=u.pending_buf_size,u.gzhead.hcrc&&u.pending>_&&(a.adler=crc32_1(a.adler,u.pending_buf,u.pending-_,_)),u.gzindex+=n,flush_pending(a),u.pending!==0)return u.last_flush=-1,Z_OK$3;_=0,k-=n}let e=new Uint8Array(u.gzhead.extra);u.pending_buf.set(e.subarray(u.gzindex,u.gzindex+k),u.pending),u.pending+=k,u.gzhead.hcrc&&u.pending>_&&(a.adler=crc32_1(a.adler,u.pending_buf,u.pending-_,_)),u.gzindex=0}u.status=NAME_STATE}if(u.status===NAME_STATE){if(u.gzhead.name){let _=u.pending,k;do{if(u.pending===u.pending_buf_size){if(u.gzhead.hcrc&&u.pending>_&&(a.adler=crc32_1(a.adler,u.pending_buf,u.pending-_,_)),flush_pending(a),u.pending!==0)return u.last_flush=-1,Z_OK$3;_=0}u.gzindex<u.gzhead.name.length?k=u.gzhead.name.charCodeAt(u.gzindex++)&255:k=0,put_byte(u,k)}while(k!==0);u.gzhead.hcrc&&u.pending>_&&(a.adler=crc32_1(a.adler,u.pending_buf,u.pending-_,_)),u.gzindex=0}u.status=COMMENT_STATE}if(u.status===COMMENT_STATE){if(u.gzhead.comment){let _=u.pending,k;do{if(u.pending===u.pending_buf_size){if(u.gzhead.hcrc&&u.pending>_&&(a.adler=crc32_1(a.adler,u.pending_buf,u.pending-_,_)),flush_pending(a),u.pending!==0)return u.last_flush=-1,Z_OK$3;_=0}u.gzindex<u.gzhead.comment.length?k=u.gzhead.comment.charCodeAt(u.gzindex++)&255:k=0,put_byte(u,k)}while(k!==0);u.gzhead.hcrc&&u.pending>_&&(a.adler=crc32_1(a.adler,u.pending_buf,u.pending-_,_))}u.status=HCRC_STATE}if(u.status===HCRC_STATE){if(u.gzhead.hcrc){if(u.pending+2>u.pending_buf_size&&(flush_pending(a),u.pending!==0))return u.last_flush=-1,Z_OK$3;put_byte(u,a.adler&255),put_byte(u,a.adler>>8&255),a.adler=0}if(u.status=BUSY_STATE,flush_pending(a),u.pending!==0)return u.last_flush=-1,Z_OK$3}if(a.avail_in!==0||u.lookahead!==0||I!==Z_NO_FLUSH$2&&u.status!==FINISH_STATE){let _=u.level===0?deflate_stored(u,I):u.strategy===Z_HUFFMAN_ONLY?deflate_huff(u,I):u.strategy===Z_RLE?deflate_rle(u,I):configuration_table[u.level].func(u,I);if((_===BS_FINISH_STARTED||_===BS_FINISH_DONE)&&(u.status=FINISH_STATE),_===BS_NEED_MORE||_===BS_FINISH_STARTED)return a.avail_out===0&&(u.last_flush=-1),Z_OK$3;if(_===BS_BLOCK_DONE&&(I===Z_PARTIAL_FLUSH?_tr_align(u):I!==Z_BLOCK$1&&(_tr_stored_block(u,0,0,!1),I===Z_FULL_FLUSH$1&&(zero(u.head),u.lookahead===0&&(u.strstart=0,u.block_start=0,u.insert=0))),flush_pending(a),a.avail_out===0))return u.last_flush=-1,Z_OK$3}return I!==Z_FINISH$3?Z_OK$3:u.wrap<=0?Z_STREAM_END$3:(u.wrap===2?(put_byte(u,a.adler&255),put_byte(u,a.adler>>8&255),put_byte(u,a.adler>>16&255),put_byte(u,a.adler>>24&255),put_byte(u,a.total_in&255),put_byte(u,a.total_in>>8&255),put_byte(u,a.total_in>>16&255),put_byte(u,a.total_in>>24&255)):(putShortMSB(u,a.adler>>>16),putShortMSB(u,a.adler&65535)),flush_pending(a),u.wrap>0&&(u.wrap=-u.wrap),u.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=a=>{if(deflateStateCheck(a))return Z_STREAM_ERROR$2;const I=a.state.status;return a.state=null,I===BUSY_STATE?err(a,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(a,I)=>{let u=I.length;if(deflateStateCheck(a))return Z_STREAM_ERROR$2;const E=a.state,_=E.wrap;if(_===2||_===1&&E.status!==INIT_STATE||E.lookahead)return Z_STREAM_ERROR$2;if(_===1&&(a.adler=adler32_1(a.adler,I,u,0)),E.wrap=0,u>=E.w_size){_===0&&(zero(E.head),E.strstart=0,E.block_start=0,E.insert=0);let O=new Uint8Array(E.w_size);O.set(I.subarray(u-E.w_size,u),0),I=O,u=E.w_size}const k=a.avail_in,e=a.next_in,n=a.input;for(a.avail_in=u,a.next_in=0,a.input=I,fill_window(E);E.lookahead>=MIN_MATCH;){let O=E.strstart,$=E.lookahead-(MIN_MATCH-1);do E.ins_h=HASH(E,E.ins_h,E.window[O+MIN_MATCH-1]),E.prev[O&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=O,O++;while(--$);E.strstart=O,E.lookahead=MIN_MATCH-1,fill_window(E)}return E.strstart+=E.lookahead,E.block_start=E.strstart,E.insert=E.lookahead,E.lookahead=0,E.match_length=E.prev_length=MIN_MATCH-1,E.match_available=0,a.next_in=e,a.input=n,a.avail_in=k,E.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=(a,I)=>Object.prototype.hasOwnProperty.call(a,I);var assign=function(a){const I=Array.prototype.slice.call(arguments,1);for(;I.length;){const u=I.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(const E in u)_has(u,E)&&(a[E]=u[E])}}return a},flattenChunks=a=>{let I=0;for(let E=0,_=a.length;E<_;E++)I+=a[E].length;const u=new Uint8Array(I);for(let E=0,_=0,k=a.length;E<k;E++){let e=a[E];u.set(e,_),_+=e.length}return u},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(a){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let a=0;a<256;a++)_utf8len[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=a=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(a);let I,u,E,_,k,e=a.length,n=0;for(_=0;_<e;_++)u=a.charCodeAt(_),(u&64512)===55296&&_+1<e&&(E=a.charCodeAt(_+1),(E&64512)===56320&&(u=65536+(u-55296<<10)+(E-56320),_++)),n+=u<128?1:u<2048?2:u<65536?3:4;for(I=new Uint8Array(n),k=0,_=0;k<n;_++)u=a.charCodeAt(_),(u&64512)===55296&&_+1<e&&(E=a.charCodeAt(_+1),(E&64512)===56320&&(u=65536+(u-55296<<10)+(E-56320),_++)),u<128?I[k++]=u:u<2048?(I[k++]=192|u>>>6,I[k++]=128|u&63):u<65536?(I[k++]=224|u>>>12,I[k++]=128|u>>>6&63,I[k++]=128|u&63):(I[k++]=240|u>>>18,I[k++]=128|u>>>12&63,I[k++]=128|u>>>6&63,I[k++]=128|u&63);return I};const buf2binstring=(a,I)=>{if(I<65534&&a.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,a.length===I?a:a.subarray(0,I));let u="";for(let E=0;E<I;E++)u+=String.fromCharCode(a[E]);return u};var buf2string=(a,I)=>{const u=I||a.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(a.subarray(0,I));let E,_;const k=new Array(u*2);for(_=0,E=0;E<u;){let e=a[E++];if(e<128){k[_++]=e;continue}let n=_utf8len[e];if(n>4){k[_++]=65533,E+=n-1;continue}for(e&=n===2?31:n===3?15:7;n>1&&E<u;)e=e<<6|a[E++]&63,n--;if(n>1){k[_++]=65533;continue}e<65536?k[_++]=e:(e-=65536,k[_++]=55296|e>>10&1023,k[_++]=56320|e&1023)}return buf2binstring(k,_)},utf8border=(a,I)=>{I=I||a.length,I>a.length&&(I=a.length);let u=I-1;for(;u>=0&&(a[u]&192)===128;)u--;return u<0||u===0?I:u+_utf8len[a[u]]>I?u:I},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(a){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},a||{});let I=this.options;I.raw&&I.windowBits>0?I.windowBits=-I.windowBits:I.gzip&&I.windowBits>0&&I.windowBits<16&&(I.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let u=deflate_1$2.deflateInit2(this.strm,I.level,I.method,I.windowBits,I.memLevel,I.strategy);if(u!==Z_OK$2)throw new Error(messages[u]);if(I.header&&deflate_1$2.deflateSetHeader(this.strm,I.header),I.dictionary){let E;if(typeof I.dictionary=="string"?E=strings.string2buf(I.dictionary):toString$1.call(I.dictionary)==="[object ArrayBuffer]"?E=new Uint8Array(I.dictionary):E=I.dictionary,u=deflate_1$2.deflateSetDictionary(this.strm,E),u!==Z_OK$2)throw new Error(messages[u]);this._dict_set=!0}}Deflate$1.prototype.push=function(a,I){const u=this.strm,E=this.options.chunkSize;let _,k;if(this.ended)return!1;for(I===~~I?k=I:k=I===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof a=="string"?u.input=strings.string2buf(a):toString$1.call(a)==="[object ArrayBuffer]"?u.input=new Uint8Array(a):u.input=a,u.next_in=0,u.avail_in=u.input.length;;){if(u.avail_out===0&&(u.output=new Uint8Array(E),u.next_out=0,u.avail_out=E),(k===Z_SYNC_FLUSH||k===Z_FULL_FLUSH)&&u.avail_out<=6){this.onData(u.output.subarray(0,u.next_out)),u.avail_out=0;continue}if(_=deflate_1$2.deflate(u,k),_===Z_STREAM_END$2)return u.next_out>0&&this.onData(u.output.subarray(0,u.next_out)),_=deflate_1$2.deflateEnd(this.strm),this.onEnd(_),this.ended=!0,_===Z_OK$2;if(u.avail_out===0){this.onData(u.output);continue}if(k>0&&u.next_out>0){this.onData(u.output.subarray(0,u.next_out)),u.avail_out=0;continue}if(u.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(a){this.chunks.push(a)},Deflate$1.prototype.onEnd=function(a){a===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg};function deflate$1(a,I){const u=new Deflate$1(I);if(u.push(a,!0),u.err)throw u.msg||messages[u.err];return u.result}function deflateRaw$1(a,I){return I=I||{},I.raw=!0,deflate$1(a,I)}function gzip$1(a,I){return I=I||{},I.gzip=!0,deflate$1(a,I)}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 a(I,u){let E,_,k,e,n,O,$,N,D,q,P,j,Q,J,z,Y,et,tt,nt,dt,it,at,ct,ot;const rt=I.state;E=I.next_in,ct=I.input,_=E+(I.avail_in-5),k=I.next_out,ot=I.output,e=k-(u-I.avail_out),n=k+(I.avail_out-257),O=rt.dmax,$=rt.wsize,N=rt.whave,D=rt.wnext,q=rt.window,P=rt.hold,j=rt.bits,Q=rt.lencode,J=rt.distcode,z=(1<<rt.lenbits)-1,Y=(1<<rt.distbits)-1;t:do{j<15&&(P+=ct[E++]<<j,j+=8,P+=ct[E++]<<j,j+=8),et=Q[P&z];e:for(;;){if(tt=et>>>24,P>>>=tt,j-=tt,tt=et>>>16&255,tt===0)ot[k++]=et&65535;else if(tt&16){nt=et&65535,tt&=15,tt&&(j<tt&&(P+=ct[E++]<<j,j+=8),nt+=P&(1<<tt)-1,P>>>=tt,j-=tt),j<15&&(P+=ct[E++]<<j,j+=8,P+=ct[E++]<<j,j+=8),et=J[P&Y];i:for(;;){if(tt=et>>>24,P>>>=tt,j-=tt,tt=et>>>16&255,tt&16){if(dt=et&65535,tt&=15,j<tt&&(P+=ct[E++]<<j,j+=8,j<tt&&(P+=ct[E++]<<j,j+=8)),dt+=P&(1<<tt)-1,dt>O){I.msg="invalid distance too far back",rt.mode=BAD$1;break t}if(P>>>=tt,j-=tt,tt=k-e,dt>tt){if(tt=dt-tt,tt>N&&rt.sane){I.msg="invalid distance too far back",rt.mode=BAD$1;break t}if(it=0,at=q,D===0){if(it+=$-tt,tt<nt){nt-=tt;do ot[k++]=q[it++];while(--tt);it=k-dt,at=ot}}else if(D<tt){if(it+=$+D-tt,tt-=D,tt<nt){nt-=tt;do ot[k++]=q[it++];while(--tt);if(it=0,D<nt){tt=D,nt-=tt;do ot[k++]=q[it++];while(--tt);it=k-dt,at=ot}}}else if(it+=D-tt,tt<nt){nt-=tt;do ot[k++]=q[it++];while(--tt);it=k-dt,at=ot}for(;nt>2;)ot[k++]=at[it++],ot[k++]=at[it++],ot[k++]=at[it++],nt-=3;nt&&(ot[k++]=at[it++],nt>1&&(ot[k++]=at[it++]))}else{it=k-dt;do ot[k++]=ot[it++],ot[k++]=ot[it++],ot[k++]=ot[it++],nt-=3;while(nt>2);nt&&(ot[k++]=ot[it++],nt>1&&(ot[k++]=ot[it++]))}}else if((tt&64)===0){et=J[(et&65535)+(P&(1<<tt)-1)];continue i}else{I.msg="invalid distance code",rt.mode=BAD$1;break t}break}}else if((tt&64)===0){et=Q[(et&65535)+(P&(1<<tt)-1)];continue e}else if(tt&32){rt.mode=TYPE$1;break t}else{I.msg="invalid literal/length code",rt.mode=BAD$1;break t}break}}while(E<_&&k<n);nt=j>>3,E-=nt,j-=nt<<3,P&=(1<<j)-1,I.next_in=E,I.next_out=k,I.avail_in=E<_?5+(_-E):5-(E-_),I.avail_out=k<n?257+(n-k):257-(k-n),rt.hold=P,rt.bits=j};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=(a,I,u,E,_,k,e,n)=>{const O=n.bits;let $=0,N=0,D=0,q=0,P=0,j=0,Q=0,J=0,z=0,Y=0,et,tt,nt,dt,it,at=null,ct;const ot=new Uint16Array(MAXBITS+1),rt=new Uint16Array(MAXBITS+1);let $t=null,Gt,Kt,Qt;for($=0;$<=MAXBITS;$++)ot[$]=0;for(N=0;N<E;N++)ot[I[u+N]]++;for(P=O,q=MAXBITS;q>=1&&ot[q]===0;q--);if(P>q&&(P=q),q===0)return _[k++]=1<<24|64<<16|0,_[k++]=1<<24|64<<16|0,n.bits=1,0;for(D=1;D<q&&ot[D]===0;D++);for(P<D&&(P=D),J=1,$=1;$<=MAXBITS;$++)if(J<<=1,J-=ot[$],J<0)return-1;if(J>0&&(a===CODES$1||q!==1))return-1;for(rt[1]=0,$=1;$<MAXBITS;$++)rt[$+1]=rt[$]+ot[$];for(N=0;N<E;N++)I[u+N]!==0&&(e[rt[I[u+N]]++]=N);if(a===CODES$1?(at=$t=e,ct=20):a===LENS$1?(at=lbase,$t=lext,ct=257):(at=dbase,$t=dext,ct=0),Y=0,N=0,$=D,it=k,j=P,Q=0,nt=-1,z=1<<P,dt=z-1,a===LENS$1&&z>ENOUGH_LENS$1||a===DISTS$1&&z>ENOUGH_DISTS$1)return 1;for(;;){Gt=$-Q,e[N]+1<ct?(Kt=0,Qt=e[N]):e[N]>=ct?(Kt=$t[e[N]-ct],Qt=at[e[N]-ct]):(Kt=96,Qt=0),et=1<<$-Q,tt=1<<j,D=tt;do tt-=et,_[it+(Y>>Q)+tt]=Gt<<24|Kt<<16|Qt|0;while(tt!==0);for(et=1<<$-1;Y&et;)et>>=1;if(et!==0?(Y&=et-1,Y+=et):Y=0,N++,--ot[$]===0){if($===q)break;$=I[u+e[N]]}if($>P&&(Y&dt)!==nt){for(Q===0&&(Q=P),it+=D,j=$-Q,J=1<<j;j+Q<q&&(J-=ot[j+Q],!(J<=0));)j++,J<<=1;if(z+=1<<j,a===LENS$1&&z>ENOUGH_LENS$1||a===DISTS$1&&z>ENOUGH_DISTS$1)return 1;nt=Y&dt,_[nt]=P<<24|j<<16|it-k|0}}return Y!==0&&(_[it+Y]=$-Q<<24|64<<16|0),n.bits=P,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=a=>(a>>>24&255)+(a>>>8&65280)+((a&65280)<<8)+((a&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=a=>{if(!a)return 1;const I=a.state;return!I||I.strm!==a||I.mode<HEAD||I.mode>SYNC?1:0},inflateResetKeep=a=>{if(inflateStateCheck(a))return Z_STREAM_ERROR$1;const I=a.state;return a.total_in=a.total_out=I.total=0,a.msg="",I.wrap&&(a.adler=I.wrap&1),I.mode=HEAD,I.last=0,I.havedict=0,I.flags=-1,I.dmax=32768,I.head=null,I.hold=0,I.bits=0,I.lencode=I.lendyn=new Int32Array(ENOUGH_LENS),I.distcode=I.distdyn=new Int32Array(ENOUGH_DISTS),I.sane=1,I.back=-1,Z_OK$1},inflateReset=a=>{if(inflateStateCheck(a))return Z_STREAM_ERROR$1;const I=a.state;return I.wsize=0,I.whave=0,I.wnext=0,inflateResetKeep(a)},inflateReset2=(a,I)=>{let u;if(inflateStateCheck(a))return Z_STREAM_ERROR$1;const E=a.state;return I<0?(u=0,I=-I):(u=(I>>4)+5,I<48&&(I&=15)),I&&(I<8||I>15)?Z_STREAM_ERROR$1:(E.window!==null&&E.wbits!==I&&(E.window=null),E.wrap=u,E.wbits=I,inflateReset(a))},inflateInit2=(a,I)=>{if(!a)return Z_STREAM_ERROR$1;const u=new InflateState;a.state=u,u.strm=a,u.window=null,u.mode=HEAD;const E=inflateReset2(a,I);return E!==Z_OK$1&&(a.state=null),E},inflateInit=a=>inflateInit2(a,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=a=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let I=0;for(;I<144;)a.lens[I++]=8;for(;I<256;)a.lens[I++]=9;for(;I<280;)a.lens[I++]=7;for(;I<288;)a.lens[I++]=8;for(inftrees(LENS,a.lens,0,288,lenfix,0,a.work,{bits:9}),I=0;I<32;)a.lens[I++]=5;inftrees(DISTS,a.lens,0,32,distfix,0,a.work,{bits:5}),virgin=!1}a.lencode=lenfix,a.lenbits=9,a.distcode=distfix,a.distbits=5},updatewindow=(a,I,u,E)=>{let _;const k=a.state;return k.window===null&&(k.wsize=1<<k.wbits,k.wnext=0,k.whave=0,k.window=new Uint8Array(k.wsize)),E>=k.wsize?(k.window.set(I.subarray(u-k.wsize,u),0),k.wnext=0,k.whave=k.wsize):(_=k.wsize-k.wnext,_>E&&(_=E),k.window.set(I.subarray(u-E,u-E+_),k.wnext),E-=_,E?(k.window.set(I.subarray(u-E,u),0),k.wnext=E,k.whave=k.wsize):(k.wnext+=_,k.wnext===k.wsize&&(k.wnext=0),k.whave<k.wsize&&(k.whave+=_))),0},inflate$2=(a,I)=>{let u,E,_,k,e,n,O,$,N,D,q,P,j,Q,J=0,z,Y,et,tt,nt,dt,it,at;const ct=new Uint8Array(4);let ot,rt;const $t=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(a)||!a.output||!a.input&&a.avail_in!==0)return Z_STREAM_ERROR$1;u=a.state,u.mode===TYPE&&(u.mode=TYPEDO),e=a.next_out,_=a.output,O=a.avail_out,k=a.next_in,E=a.input,n=a.avail_in,$=u.hold,N=u.bits,D=n,q=O,at=Z_OK$1;t:for(;;)switch(u.mode){case HEAD:if(u.wrap===0){u.mode=TYPEDO;break}for(;N<16;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(u.wrap&2&&$===35615){u.wbits===0&&(u.wbits=15),u.check=0,ct[0]=$&255,ct[1]=$>>>8&255,u.check=crc32_1(u.check,ct,2,0),$=0,N=0,u.mode=FLAGS;break}if(u.head&&(u.head.done=!1),!(u.wrap&1)||((($&255)<<8)+($>>8))%31){a.msg="incorrect header check",u.mode=BAD;break}if(($&15)!==Z_DEFLATED){a.msg="unknown compression method",u.mode=BAD;break}if($>>>=4,N-=4,it=($&15)+8,u.wbits===0&&(u.wbits=it),it>15||it>u.wbits){a.msg="invalid window size",u.mode=BAD;break}u.dmax=1<<u.wbits,u.flags=0,a.adler=u.check=1,u.mode=$&512?DICTID:TYPE,$=0,N=0;break;case FLAGS:for(;N<16;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(u.flags=$,(u.flags&255)!==Z_DEFLATED){a.msg="unknown compression method",u.mode=BAD;break}if(u.flags&57344){a.msg="unknown header flags set",u.mode=BAD;break}u.head&&(u.head.text=$>>8&1),u.flags&512&&u.wrap&4&&(ct[0]=$&255,ct[1]=$>>>8&255,u.check=crc32_1(u.check,ct,2,0)),$=0,N=0,u.mode=TIME;case TIME:for(;N<32;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}u.head&&(u.head.time=$),u.flags&512&&u.wrap&4&&(ct[0]=$&255,ct[1]=$>>>8&255,ct[2]=$>>>16&255,ct[3]=$>>>24&255,u.check=crc32_1(u.check,ct,4,0)),$=0,N=0,u.mode=OS;case OS:for(;N<16;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}u.head&&(u.head.xflags=$&255,u.head.os=$>>8),u.flags&512&&u.wrap&4&&(ct[0]=$&255,ct[1]=$>>>8&255,u.check=crc32_1(u.check,ct,2,0)),$=0,N=0,u.mode=EXLEN;case EXLEN:if(u.flags&1024){for(;N<16;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}u.length=$,u.head&&(u.head.extra_len=$),u.flags&512&&u.wrap&4&&(ct[0]=$&255,ct[1]=$>>>8&255,u.check=crc32_1(u.check,ct,2,0)),$=0,N=0}else u.head&&(u.head.extra=null);u.mode=EXTRA;case EXTRA:if(u.flags&1024&&(P=u.length,P>n&&(P=n),P&&(u.head&&(it=u.head.extra_len-u.length,u.head.extra||(u.head.extra=new Uint8Array(u.head.extra_len)),u.head.extra.set(E.subarray(k,k+P),it)),u.flags&512&&u.wrap&4&&(u.check=crc32_1(u.check,E,P,k)),n-=P,k+=P,u.length-=P),u.length))break t;u.length=0,u.mode=NAME;case NAME:if(u.flags&2048){if(n===0)break t;P=0;do it=E[k+P++],u.head&&it&&u.length<65536&&(u.head.name+=String.fromCharCode(it));while(it&&P<n);if(u.flags&512&&u.wrap&4&&(u.check=crc32_1(u.check,E,P,k)),n-=P,k+=P,it)break t}else u.head&&(u.head.name=null);u.length=0,u.mode=COMMENT;case COMMENT:if(u.flags&4096){if(n===0)break t;P=0;do it=E[k+P++],u.head&&it&&u.length<65536&&(u.head.comment+=String.fromCharCode(it));while(it&&P<n);if(u.flags&512&&u.wrap&4&&(u.check=crc32_1(u.check,E,P,k)),n-=P,k+=P,it)break t}else u.head&&(u.head.comment=null);u.mode=HCRC;case HCRC:if(u.flags&512){for(;N<16;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(u.wrap&4&&$!==(u.check&65535)){a.msg="header crc mismatch",u.mode=BAD;break}$=0,N=0}u.head&&(u.head.hcrc=u.flags>>9&1,u.head.done=!0),a.adler=u.check=0,u.mode=TYPE;break;case DICTID:for(;N<32;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}a.adler=u.check=zswap32($),$=0,N=0,u.mode=DICT;case DICT:if(u.havedict===0)return a.next_out=e,a.avail_out=O,a.next_in=k,a.avail_in=n,u.hold=$,u.bits=N,Z_NEED_DICT$1;a.adler=u.check=1,u.mode=TYPE;case TYPE:if(I===Z_BLOCK||I===Z_TREES)break t;case TYPEDO:if(u.last){$>>>=N&7,N-=N&7,u.mode=CHECK;break}for(;N<3;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}switch(u.last=$&1,$>>>=1,N-=1,$&3){case 0:u.mode=STORED;break;case 1:if(fixedtables(u),u.mode=LEN_,I===Z_TREES){$>>>=2,N-=2;break t}break;case 2:u.mode=TABLE;break;case 3:a.msg="invalid block type",u.mode=BAD}$>>>=2,N-=2;break;case STORED:for($>>>=N&7,N-=N&7;N<32;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(($&65535)!==($>>>16^65535)){a.msg="invalid stored block lengths",u.mode=BAD;break}if(u.length=$&65535,$=0,N=0,u.mode=COPY_,I===Z_TREES)break t;case COPY_:u.mode=COPY;case COPY:if(P=u.length,P){if(P>n&&(P=n),P>O&&(P=O),P===0)break t;_.set(E.subarray(k,k+P),e),n-=P,k+=P,O-=P,e+=P,u.length-=P;break}u.mode=TYPE;break;case TABLE:for(;N<14;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(u.nlen=($&31)+257,$>>>=5,N-=5,u.ndist=($&31)+1,$>>>=5,N-=5,u.ncode=($&15)+4,$>>>=4,N-=4,u.nlen>286||u.ndist>30){a.msg="too many length or distance symbols",u.mode=BAD;break}u.have=0,u.mode=LENLENS;case LENLENS:for(;u.have<u.ncode;){for(;N<3;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}u.lens[$t[u.have++]]=$&7,$>>>=3,N-=3}for(;u.have<19;)u.lens[$t[u.have++]]=0;if(u.lencode=u.lendyn,u.lenbits=7,ot={bits:u.lenbits},at=inftrees(CODES,u.lens,0,19,u.lencode,0,u.work,ot),u.lenbits=ot.bits,at){a.msg="invalid code lengths set",u.mode=BAD;break}u.have=0,u.mode=CODELENS;case CODELENS:for(;u.have<u.nlen+u.ndist;){for(;J=u.lencode[$&(1<<u.lenbits)-1],z=J>>>24,Y=J>>>16&255,et=J&65535,!(z<=N);){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(et<16)$>>>=z,N-=z,u.lens[u.have++]=et;else{if(et===16){for(rt=z+2;N<rt;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if($>>>=z,N-=z,u.have===0){a.msg="invalid bit length repeat",u.mode=BAD;break}it=u.lens[u.have-1],P=3+($&3),$>>>=2,N-=2}else if(et===17){for(rt=z+3;N<rt;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}$>>>=z,N-=z,it=0,P=3+($&7),$>>>=3,N-=3}else{for(rt=z+7;N<rt;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}$>>>=z,N-=z,it=0,P=11+($&127),$>>>=7,N-=7}if(u.have+P>u.nlen+u.ndist){a.msg="invalid bit length repeat",u.mode=BAD;break}for(;P--;)u.lens[u.have++]=it}}if(u.mode===BAD)break;if(u.lens[256]===0){a.msg="invalid code -- missing end-of-block",u.mode=BAD;break}if(u.lenbits=9,ot={bits:u.lenbits},at=inftrees(LENS,u.lens,0,u.nlen,u.lencode,0,u.work,ot),u.lenbits=ot.bits,at){a.msg="invalid literal/lengths set",u.mode=BAD;break}if(u.distbits=6,u.distcode=u.distdyn,ot={bits:u.distbits},at=inftrees(DISTS,u.lens,u.nlen,u.ndist,u.distcode,0,u.work,ot),u.distbits=ot.bits,at){a.msg="invalid distances set",u.mode=BAD;break}if(u.mode=LEN_,I===Z_TREES)break t;case LEN_:u.mode=LEN;case LEN:if(n>=6&&O>=258){a.next_out=e,a.avail_out=O,a.next_in=k,a.avail_in=n,u.hold=$,u.bits=N,inffast(a,q),e=a.next_out,_=a.output,O=a.avail_out,k=a.next_in,E=a.input,n=a.avail_in,$=u.hold,N=u.bits,u.mode===TYPE&&(u.back=-1);break}for(u.back=0;J=u.lencode[$&(1<<u.lenbits)-1],z=J>>>24,Y=J>>>16&255,et=J&65535,!(z<=N);){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(Y&&(Y&240)===0){for(tt=z,nt=Y,dt=et;J=u.lencode[dt+(($&(1<<tt+nt)-1)>>tt)],z=J>>>24,Y=J>>>16&255,et=J&65535,!(tt+z<=N);){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}$>>>=tt,N-=tt,u.back+=tt}if($>>>=z,N-=z,u.back+=z,u.length=et,Y===0){u.mode=LIT;break}if(Y&32){u.back=-1,u.mode=TYPE;break}if(Y&64){a.msg="invalid literal/length code",u.mode=BAD;break}u.extra=Y&15,u.mode=LENEXT;case LENEXT:if(u.extra){for(rt=u.extra;N<rt;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}u.length+=$&(1<<u.extra)-1,$>>>=u.extra,N-=u.extra,u.back+=u.extra}u.was=u.length,u.mode=DIST;case DIST:for(;J=u.distcode[$&(1<<u.distbits)-1],z=J>>>24,Y=J>>>16&255,et=J&65535,!(z<=N);){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if((Y&240)===0){for(tt=z,nt=Y,dt=et;J=u.distcode[dt+(($&(1<<tt+nt)-1)>>tt)],z=J>>>24,Y=J>>>16&255,et=J&65535,!(tt+z<=N);){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}$>>>=tt,N-=tt,u.back+=tt}if($>>>=z,N-=z,u.back+=z,Y&64){a.msg="invalid distance code",u.mode=BAD;break}u.offset=et,u.extra=Y&15,u.mode=DISTEXT;case DISTEXT:if(u.extra){for(rt=u.extra;N<rt;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}u.offset+=$&(1<<u.extra)-1,$>>>=u.extra,N-=u.extra,u.back+=u.extra}if(u.offset>u.dmax){a.msg="invalid distance too far back",u.mode=BAD;break}u.mode=MATCH;case MATCH:if(O===0)break t;if(P=q-O,u.offset>P){if(P=u.offset-P,P>u.whave&&u.sane){a.msg="invalid distance too far back",u.mode=BAD;break}P>u.wnext?(P-=u.wnext,j=u.wsize-P):j=u.wnext-P,P>u.length&&(P=u.length),Q=u.window}else Q=_,j=e-u.offset,P=u.length;P>O&&(P=O),O-=P,u.length-=P;do _[e++]=Q[j++];while(--P);u.length===0&&(u.mode=LEN);break;case LIT:if(O===0)break t;_[e++]=u.length,O--,u.mode=LEN;break;case CHECK:if(u.wrap){for(;N<32;){if(n===0)break t;n--,$|=E[k++]<<N,N+=8}if(q-=O,a.total_out+=q,u.total+=q,u.wrap&4&&q&&(a.adler=u.check=u.flags?crc32_1(u.check,_,q,e-q):adler32_1(u.check,_,q,e-q)),q=O,u.wrap&4&&(u.flags?$:zswap32($))!==u.check){a.msg="incorrect data check",u.mode=BAD;break}$=0,N=0}u.mode=LENGTH;case LENGTH:if(u.wrap&&u.flags){for(;N<32;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(u.wrap&4&&$!==(u.total&4294967295)){a.msg="incorrect length check",u.mode=BAD;break}$=0,N=0}u.mode=DONE;case DONE:at=Z_STREAM_END$1;break t;case BAD:at=Z_DATA_ERROR$1;break t;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return a.next_out=e,a.avail_out=O,a.next_in=k,a.avail_in=n,u.hold=$,u.bits=N,(u.wsize||q!==a.avail_out&&u.mode<BAD&&(u.mode<CHECK||I!==Z_FINISH$1))&&updatewindow(a,a.output,a.next_out,q-a.avail_out),D-=a.avail_in,q-=a.avail_out,a.total_in+=D,a.total_out+=q,u.total+=q,u.wrap&4&&q&&(a.adler=u.check=u.flags?crc32_1(u.check,_,q,a.next_out-q):adler32_1(u.check,_,q,a.next_out-q)),a.data_type=u.bits+(u.last?64:0)+(u.mode===TYPE?128:0)+(u.mode===LEN_||u.mode===COPY_?256:0),(D===0&&q===0||I===Z_FINISH$1)&&at===Z_OK$1&&(at=Z_BUF_ERROR),at},inflateEnd=a=>{if(inflateStateCheck(a))return Z_STREAM_ERROR$1;let I=a.state;return I.window&&(I.window=null),a.state=null,Z_OK$1},inflateGetHeader=(a,I)=>{if(inflateStateCheck(a))return Z_STREAM_ERROR$1;const u=a.state;return(u.wrap&2)===0?Z_STREAM_ERROR$1:(u.head=I,I.done=!1,Z_OK$1)},inflateSetDictionary=(a,I)=>{const u=I.length;let E,_,k;return inflateStateCheck(a)||(E=a.state,E.wrap!==0&&E.mode!==DICT)?Z_STREAM_ERROR$1:E.mode===DICT&&(_=1,_=adler32_1(_,I,u,0),_!==E.check)?Z_DATA_ERROR$1:(k=updatewindow(a,I,u,u),k?(E.mode=MEM,Z_MEM_ERROR$1):(E.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(a){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},a||{});const I=this.options;I.raw&&I.windowBits>=0&&I.windowBits<16&&(I.windowBits=-I.windowBits,I.windowBits===0&&(I.windowBits=-15)),I.windowBits>=0&&I.windowBits<16&&!(a&&a.windowBits)&&(I.windowBits+=32),I.windowBits>15&&I.windowBits<48&&(I.windowBits&15)===0&&(I.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let u=inflate_1$2.inflateInit2(this.strm,I.windowBits);if(u!==Z_OK)throw new Error(messages[u]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),I.dictionary&&(typeof I.dictionary=="string"?I.dictionary=strings.string2buf(I.dictionary):toString.call(I.dictionary)==="[object ArrayBuffer]"&&(I.dictionary=new Uint8Array(I.dictionary)),I.raw&&(u=inflate_1$2.inflateSetDictionary(this.strm,I.dictionary),u!==Z_OK)))throw new Error(messages[u])}Inflate$1.prototype.push=function(a,I){const u=this.strm,E=this.options.chunkSize,_=this.options.dictionary;let k,e,n;if(this.ended)return!1;for(I===~~I?e=I:e=I===!0?Z_FINISH:Z_NO_FLUSH,toString.call(a)==="[object ArrayBuffer]"?u.input=new Uint8Array(a):u.input=a,u.next_in=0,u.avail_in=u.input.length;;){for(u.avail_out===0&&(u.output=new Uint8Array(E),u.next_out=0,u.avail_out=E),k=inflate_1$2.inflate(u,e),k===Z_NEED_DICT&&_&&(k=inflate_1$2.inflateSetDictionary(u,_),k===Z_OK?k=inflate_1$2.inflate(u,e):k===Z_DATA_ERROR&&(k=Z_NEED_DICT));u.avail_in>0&&k===Z_STREAM_END&&u.state.wrap>0&&a[u.next_in]!==0;)inflate_1$2.inflateReset(u),k=inflate_1$2.inflate(u,e);switch(k){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(k),this.ended=!0,!1}if(n=u.avail_out,u.next_out&&(u.avail_out===0||k===Z_STREAM_END))if(this.options.to==="string"){let O=strings.utf8border(u.output,u.next_out),$=u.next_out-O,N=strings.buf2string(u.output,O);u.next_out=$,u.avail_out=E-$,$&&u.output.set(u.output.subarray(O,O+$),0),this.onData(N)}else this.onData(u.output.length===u.next_out?u.output:u.output.subarray(0,u.next_out));if(!(k===Z_OK&&n===0)){if(k===Z_STREAM_END)return k=inflate_1$2.inflateEnd(this.strm),this.onEnd(k),this.ended=!0,!0;if(u.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(a){this.chunks.push(a)},Inflate$1.prototype.onEnd=function(a){a===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg};function inflate$1(a,I){const u=new Inflate$1(I);if(u.push(a),u.err)throw u.msg||messages[u.err];return u.result}function inflateRaw$1(a,I){return I=I||{},I.raw=!0,inflate$1(a,I)}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=a=>{const I=new Uint8Array(a),u=pako.deflate(I,{gzip:!0});return new Uint8Array(u==null?void 0:u.buffer)},decompressArrayBuffer=a=>{const I=new Uint8Array(a),u=pako.inflate(I,{gzip:!0});return new Uint8Array(u==null?void 0:u.buffer)},sendMessageFormat=a=>{const{event:I}=a;switch(a.data_original=a.data,a.time&&(a.timeStr=U(a.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),I){case"login":a.data=com.quick.voice.proto.Login.encode(a.data).finish();break;case"joinRoom":case"joinRoomEx":a.data=com.quick.voice.proto.JoinReq.encode(a.data).finish();break;case"quitRoom":a.data=com.quick.voice.proto.QuitReq.encode(a.data).finish();break;case"connectCF":a.data=com.quick.voice.proto.ConnectCFReq.encode(a.data).finish(),a.data=compressArrayBuffer(a.data),a.compress=!0;break;case"publish":a.data=com.quick.voice.proto.PublishReq.encode(a.data).finish(),a.data=compressArrayBuffer(a.data),a.compress=!0;break;case"subscribe":a.data=com.quick.voice.proto.SubscribeReq.encode(a.data).finish();break;case"closeTrack":a.data=com.quick.voice.proto.CloseTrackReq.encode(a.data).finish(),a.data=compressArrayBuffer(a.data),a.compress=!0;break;case"renegotiate":a.data=com.quick.voice.proto.RenegotiateReq.encode(a.data).finish(),a.data=compressArrayBuffer(a.data),a.compress=!0;break;case"syncRoomInfo":a.data=com.quick.voice.proto.SyncRoomInfoReq.encode(a.data).finish();break;case"updateCall":a.data=com.quick.voice.proto.UpdateCall.encode(a.data).finish();break;case"networkQualityChange":a.data=com.quick.voice.proto.NetQualityChange.encode(a.data).finish();break;case"pubNotify":a.data=com.quick.voice.proto.PublishNotify.encode(a.data).finish();break;default:a.data=new Uint8Array;break}return a},onMessageFormat=a=>{const{event:I,compress:u=!1}=a;if(a.data_remote=a.data,a.time&&(a.timeStr=U(a.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),u)try{a.data=decompressArrayBuffer(a.data)}catch(E){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",E)}switch(I){case"login":a.data=com.quick.voice.proto.Login.decode(a.data);break;case"joinRoom":case"joinRoomEx":a.data=com.quick.voice.proto.JoinRsp.decode(a.data);break;case"onJoinRoom":a.data=com.quick.voice.proto.JoinNotify.decode(a.data);break;case"onQuitRoom":a.data=com.quick.voice.proto.QuitNotify.decode(a.data);break;case"connectCF":a.data=com.quick.voice.proto.ConnectCFRsp.decode(a.data);break;case"publish":a.data=com.quick.voice.proto.PublishRsp.decode(a.data);break;case"onPublish":a.data=com.quick.voice.proto.PublishNotify.decode(a.data);break;case"subscribe":a.data=com.quick.voice.proto.SubscribeRsp.decode(a.data);break;case"closeTrack":a.data=com.quick.voice.proto.CloseTrackRsp.decode(a.data);break;case"onCloseTrack":a.data=com.quick.voice.proto.CloseTrackNotify.decode(a.data);break;case"onUpdateCall":a.data=com.quick.voice.proto.UpdateCall.decode(a.data);break;case"onDestroyRoom":a.data=com.quick.voice.proto.QuitNotify.decode(a.data);break;case"onUpdatePermissions":a.data=com.quick.voice.proto.UpdatePermissions.decode(a.data);break;case"onNetQuality":a.data=com.quick.voice.proto.NetQualityNotify.decode(a.data);break;case"syncRoomInfo":a.data=com.quick.voice.proto.SyncRoomInfoRsp.decode(a.data);break;case"onCDNPlayUrlAdd":a.data=com.quick.voice.proto.CDNPlayAddressNotify.decode(a.data);break;case"debugger":a.data=JSON.parse(new TextDecoder().decode(a.data));break}return a};class CallsWebSocket{constructor(I){ut(this,lt);ut(this,st,{url:"wss://demo.putplay.cc/websocket",debug:!1,reconnectCount:10,timeout:30*1e3});ut(this,yt,"");ut(this,_t,{});ut(this,kt,{});Z(this,"state","closed");Z(this,"sendMessageBefore",async()=>{});Z(this,"onReconnectSuccess",I=>{});Z(this,"onReconnectStop",I=>{});ut(this,Et,I=>{let u=!0;const{code:E=1e3,reason:_=""}=I;return E===1e3&&(_==="quit success!"||_==="replace old connection!")&&(u=!1),u});ut(this,xt,async I=>{V(this,st).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连成功",I),this.state="connected",this.onReconnectSuccess(I)});ut(this,Nt,async I=>{V(this,st).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连停止",I),this.close(),this.state="closed",this.onReconnectStop(I)});ut(this,At,()=>{const I={event:"heartbeat",sn:+`${F(1e5,999999)}`};return com.quick.voice.proto.CommonReq.encode(I).finish()});ut(this,Rt,(I,u={})=>{try{const{time:E,event:_,data:k={},data_original:e={},data_remote:n,...O}=u,$=U(E,"YYYY-MM-DD hh:mm:ss",{offset:480});let N={};const D=(Y={})=>{const et=JSON.parse(JSON.stringify(Y)),tt=Object.keys(et);for(const nt of tt)(nt.includes("sdp")||nt.includes("Sdp"))&&(et[nt]="");return et};let q="res ↓";switch(I){case"res":q="res ↓",N=D(k);break;case"req":q="req ↑",N=D(e);break}let P="#quickvo.logs";ignoreEvent.includes(_)&&(P="#quickvo.ignoreEvents");const j={"#action":q,timeStr:$,event:_,data:N,time:E,...O},Q=localStorage.getItem(P)||JSON.stringify([]),J=JSON.parse(Q),z=[j,...J].slice(0,500);localStorage.setItem(P,JSON.stringify(z))}catch(E){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",E)}});ut(this,qt,(I,{resolve:u,reject:E})=>{const{sn:_}=I,k=()=>{const n=V(this,_t)[_];clearTimeout(n.destructionTimer),delete V(this,_t)[_]},e=setTimeout(()=>{const n=V(this,_t)[_];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:event is timeout",n.message),k(),E("event is timeout")},V(this,st).timeout);V(this,_t)[_]={message:I,resolve:u,reject:E,destruction:k,destructionTimer:e}});ut(this,Dt,I=>V(this,_t)[I]);ut(this,Ct,async I=>{const u=new Uint8Array(I),E=com.quick.voice.proto.CommonRsp.decode(u),{sn:_,event:k}=E,e=onMessageFormat(E);if(V(this,st).debug&&(noLogEvents.includes(k)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",e),ignoreEvent.includes(k)||V(this,Rt).call(this,"res",e)),notifyName_keys.includes(k))return this.emitNotify(k,L(e,["code","data","desc"]));const O=V(this,Dt).call(this,_);if(O){const{resolve:$=D=>{},destruction:N=()=>{}}=O;$(L(e,["code","data","desc"])),N()}});Z(this,"clearEvents",(I=[])=>{const u=Object.keys(V(this,_t));I.length===0&&(I=u);for(const E of u){if(!I.includes(E))continue;const _=V(this,_t)[E];clearTimeout(_.destructionTimer),delete V(this,_t)[E]}});Z(this,"connect",async(I="")=>new Promise(async u=>{I&&Ot(this,yt,I),V(this,lt)&&(await V(this,lt).close(),this.state="closed");const E=`${V(this,st).url}?s=${V(this,yt)}&t=${Date.now()}`;Ot(this,lt,new M({...V(this,st),url:E,binaryType:"arraybuffer",onMessage:V(this,Ct),checkReconnect:V(this,Et),getHeartbeatMsg:V(this,At),onReconnectSuccess:V(this,xt),onReconnectStop:V(this,Nt)})),this.state="connecting",await V(this,lt).connect(),this.state="connected",V(this,st).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 当前广播事件",V(this,kt)),u(V(this,lt))}));Z(this,"close",async()=>{var u;V(this,st).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.");const I=Object.keys(V(this,_t));for(const E of I){const{destructionTimer:_}=V(this,_t)[E];clearTimeout(_)}Ot(this,_t,{}),await((u=V(this,lt))==null?void 0:u.close()),Ot(this,lt,void 0),this.state="closed"});Z(this,"sendMessage",(I,u=!0)=>new Promise(async(E,_)=>{var N;await this.sendMessageBefore();const{event:k,...e}=I,n=Date.now(),O=sendMessageFormat({event:k,sn:+`${n}${F(1e3,9999)}`,time:n,valid:V(this,st).timeout,version:1,compress:!1,...e});V(this,st).debug&&(noLogEvents.includes(k)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",O),ignoreEvent.includes(k)||V(this,Rt).call(this,"req",O)),u&&V(this,qt).call(this,O,{resolve:E,reject:_});const $=com.quick.voice.proto.CommonReq.encode(O).finish();(N=V(this,lt))==null||N.sendMessage($)}));Z(this,"emitNotify",async(I,u)=>{const E=V(this,kt)[I]||[];for(const _ of E){const{callback:k=async()=>{}}=_;await k(u)}});Z(this,"addNotify",(I,u=!1)=>{const{event:E,sn:_=ht(32)}=I;V(this,kt)[E]||(V(this,kt)[E]=[]);const k=V(this,kt)[E],e=k.findIndex(n=>n.sn===_);return e!==-1&&k.splice(e,1),u?k.unshift(I):k.push(I),_});Z(this,"removeNotify",(I=[])=>{if(I.length===0)Ot(this,kt,{});else{const u=Object.keys(V(this,kt));for(const E of u)V(this,kt)[E]=V(this,kt)[E].filter(_=>!I.includes(_.sn||""))}V(this,st).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",V(this,kt))});Ot(this,st,{...V(this,st),...I})}}lt=new WeakMap,st=new WeakMap,yt=new WeakMap,_t=new WeakMap,kt=new WeakMap,Et=new WeakMap,xt=new WeakMap,Nt=new WeakMap,At=new WeakMap,Rt=new WeakMap,qt=new WeakMap,Dt=new WeakMap,Ct=new WeakMap;var y=Object.defineProperty,x=a=>{throw TypeError(a)},g=(a,I,u)=>I in a?y(a,I,{enumerable:!0,configurable:!0,writable:!0,value:u}):a[I]=u,h=(a,I,u)=>g(a,typeof I!="symbol"?I+"":I,u),b=(a,I,u)=>I.has(a)||x("Cannot "+u),o=(a,I,u)=>(b(a,I,"read from private field"),u?u.call(a):I.get(a)),f=(a,I,u)=>I.has(a)?x("Cannot add the same private member more than once"):I instanceof WeakSet?I.add(a):I.set(a,u),p=(a,I,u,E)=>(b(a,I,"write to private field"),I.set(a,u),u),d,c,l;class K{constructor(I){f(this,d,new Map),f(this,c,[]),h(this,"index"),h(this,"setCondition",(u,E)=>{o(this,d).set(u,E),E&&o(this,l).call(this)}),h(this,"addTask",(u,E,_={})=>{const k={key:"",strict:!1,describe:"",..._};let{key:e,strict:n,describe:O}=k;e?this.clear([e]):e=`${this.index++}`;const $={key:e,func:u,conditionKeys:E,describe:O,strict:n};return o(this,c).unshift($),this.checkConditions(E)&&(u(),n===!1&&this.clear([e])),e}),h(this,"clear",(u=[])=>{if(u.length===0){p(this,c,[]);return}for(const E of u){const _=o(this,c).findIndex(k=>k.key===E);_!==-1&&o(this,c).splice(_,1)}}),h(this,"getConditions",()=>Object.fromEntries(o(this,d))),h(this,"getTasks",()=>{const u=[];for(const E of o(this,c)){const{key:_,describe:k,conditionKeys:e}=E;u.push({key:_,describe:k,conditionKeys:e})}return u}),h(this,"checkConditions",u=>{let E=!0;for(const _ of u)if(o(this,d).get(_)===!1){E=!1;break}return E}),f(this,l,()=>{const u=o(this,c).length;for(let E=u;E>0;E--){const _=E-1,k=o(this,c)[_],{conditionKeys:e,func:n,strict:O}=k;this.checkConditions(e)&&(n(),O===!1&&o(this,c).splice(_,1))}}),this.index=0;for(const u of I)o(this,d).set(u,!0)}}d=new WeakMap,c=new WeakMap,l=new WeakMap;class RoomBase{constructor(){Z(this,"options",{appid:"",sdkToken:"",roomId:"",userId:"",callType:0,debug:!1,newPublishAutoSubscribe:!0});Z(this,"localStreamActiveMap",new Map);Z(this,"prohibitNotify",!1);Z(this,"isEarly",!1);Z(this,"taskQueue",new K(["createWs","createSession","ice","joinRoom","createTrack","subscribe","closeTrack"]));Z(this,"roomState","ready");Z(this,"createAt",Date.now());Z(this,"cwsIns",new CallsWebSocket);Z(this,"peerIns",new RTCPeerConnection({bundlePolicy:"max-bundle"}));Z(this,"transceiverMap",new Map);Z(this,"userMap",new Map);Z(this,"mediaDevicesErrInfo",{microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""});Z(this,"initAsyncQueue",()=>{this.taskQueue.clear(),this.taskQueue.setCondition("createWs",!0),this.taskQueue.setCondition("createSession",!1),this.taskQueue.setCondition("ice",!1)});Z(this,"getRoomInfo",()=>{const{options:I,roomState:u,createAt:E}=this;return{...I,roomState:u,createAt:E}});Z(this,"setRoomState",I=>{this.roomState=I;const u=enum_roomState[I],E={state:I,stateStr:u};this.cwsIns.emitNotify("onRoomState",{code:200,data:E,desc:"room state is change."})});Z(this,"setOptions",async I=>{const u={...this.options,...I};this.options=u});Z(this,"initCwsCall",()=>{this.cwsIns=new CallsWebSocket({...this.options})});Z(this,"getMediaDevicesErrInfo",async()=>{try{const I=await navigator.mediaDevices.enumerateDevices();I.find(E=>E.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),I.find(E=>E.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(I){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe:error",I)}return this.mediaDevicesErrInfo});Z(this,"getUserMediaKey",(I,u)=>`${I}-${u}`);Z(this,"getCallActionMap",(I=0)=>{const E=Number(I).toString(2).padStart(4,"0").split(""),[_,k,e,n]=E;return{microphoneCamera_audio:!!Number(n),microphoneCamera_video:!!Number(e),screenSharing_video:!!Number(k),screenSharing_audio:!!Number(_)}});Z(this,"getAverageVolume",(I,u)=>{I.getByteFrequencyData(u);let E=0;for(let k=0;k<u.length;k++)E+=u[k];return Math.ceil(E/u.length)});Z(this,"getCallAction",async I=>{let u="";const E=k=>I.findIndex(({type:n,enabled:O=!0})=>n===k&&O)===-1?"0":"1";return u=`${E(0)}${u}`,u=`${E(1)}${u}`,u=`${E(2)}${u}`,u=`${E(3)}${u}`,parseInt(u,2)});Z(this,"getTrackNamesFormTracks",(I,u=[],E="trackName")=>{const _=[];for(const k of I){const{type:e}=k;if(u.length===0||u.includes(e)){const n=k[E];n&&_.push(`${n}`)}}return _});Z(this,"usersFilter",I=>ft(I,["id","isSelf","joinTime","tracks","callAction","callActionStr","callActionMap","network","permissions","isPublished","updateStreams"]).sort((_,k)=>_.id.localeCompare(k.id,"en")));this.initAsyncQueue()}}const createMutedAudioStream=()=>{const a=new AudioContext,I=a.createOscillator();I.type="sine",I.frequency.setValueAtTime(0,a.currentTime);const u=a.createGain();u.gain.value=0,I.connect(u),u.connect(a.destination),I.start();const E=a.createMediaStreamDestination();return u.disconnect(),I.connect(E),E.stream},createFakeVideoStream=(a=10,I=10,u=30)=>{const E=document.createElement("canvas"),_=E.getContext("2d");E.width=a,E.height=I;let k=0;return setInterval(()=>{_.clearRect(0,0,E.width,E.height);const O=_.createLinearGradient(0,0,E.width,E.height);O.addColorStop(0,`hsla(${k}, 100%, 50%, 0)`),O.addColorStop(1,`hsla(${k+120}, 100%, 50%, 0)`),_.fillStyle=O,_.fillRect(0,0,E.width,E.height),k=(k+1)%360},100),E.captureStream(u)};class RoomMedias extends RoomBase{constructor(){super();Z(this,"mediaDevices",[]);ut(this,vt,new Map);ut(this,wt,new Map);ut(this,bt,new Map);ut(this,St,new Map);ut(this,Ut,()=>{for(const u of mediaType_keys)switch(u){case"microphoneCamera_audio":V(this,St).set("microphoneCamera_audio",createMutedAudioStream());break;case"microphoneCamera_video":V(this,St).set("microphoneCamera_video",createFakeVideoStream());break;case"screenSharing_audio":V(this,St).set("screenSharing_audio",createMutedAudioStream());break;case"screenSharing_video":V(this,St).set("screenSharing_video",createFakeVideoStream());break}});Z(this,"getPhoneyStreams",u=>V(this,St).get(u));ut(this,Mt,()=>{V(this,wt).set("microphoneCamera_audio",{}),V(this,wt).set("microphoneCamera_video",{width:{ideal:1920},height:{ideal:1080},frameRate:{min:10,ideal:30}}),V(this,wt).set("screenSharing_video",{width:{ideal:1920},height:{ideal:1080},frameRate:{min:10,ideal:30}}),V(this,wt).set("screenSharing_audio",{})});ut(this,Pt,()=>{V(this,vt).set("audioinput","default"),V(this,vt).set("videoinput","default"),V(this,vt).set("audiooutput","default")});Z(this,"emitNotifyUpdateUsersStreams",async u=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:u,desc:"users streams is change."})});Z(this,"initUserMediaStreamContext",async(u,E,_)=>{var O;const[k]=_.getTracks();if(!k){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: tracks.length is 0.",{userId:u,mediaType:E,stream:_});return}this.removeUserMediaStreamContext(u,E);const e=this.getUserMediaKey(u,E),{kind:n}=k;switch(n){case"audio":{const $=new AudioMediaContext(k);V(this,bt).set(e,$)}break;case"video":{const $=new VideoMediaContext(k);V(this,bt).set(e,$)}break}{const $=this.getUserMediaStreamContext(u,E);if($&&$.kind==="audio")try{const N=V(this,vt).get("audiooutput");(O=$.audioContext)==null||O.setSinkId(N)}catch(N){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error",N)}}});Z(this,"getUserMediaStreamContext",(u,E)=>{const _=this.getUserMediaKey(u,E);return V(this,bt).get(_)});Z(this,"getUserAudioMediaStreamContext",(u,E)=>{const _=this.getUserMediaKey(u,E);return V(this,bt).get(_)});Z(this,"removeUserMediaStreamContext",(u,E)=>{const _=this.getUserMediaKey(u,E),k=V(this,bt).get(_);k==null||k.stop(),V(this,bt).delete(_)});Z(this,"getUserStream",(u,E)=>{const _=this.getUserMediaStreamContext(u,E);return(_==null?void 0:_.getStream())||new MediaStream});Z(this,"getUserStreams",(u,E=[])=>{E.length===0&&(E=mediaType_keys);const _={};for(const k of E){const e=this.getUserStream(u,k);_[k]=e}return _});Z(this,"removeUserStreams",async(u,E=[])=>{E.length===0&&(E=mediaType_keys);for(const _ of E)this.removeUserMediaStreamContext(u,_)});Z(this,"clearUserStreams",()=>{const u=V(this,bt).values();for(const E of u)E.stop();Ot(this,bt,new Map)});Z(this,"setMediaTrackConstraints",async(u,E)=>{V(this,wt).set(u,E);const k=this.getUserStream(this.options.userId,u).getTracks();if(k.length!==0)for(const e of k){const O={...e.getConstraints(),...E};await e.applyConstraints(O)}});Z(this,"initLocalStream",async u=>{const{userId:E}=this.options,_=V(this,wt).get(u);switch(this.removeUserMediaStreamContext(E,u),u){case"microphoneCamera_audio":{const k=V(this,vt).get("audioinput"),e=await navigator.mediaDevices.getUserMedia({audio:{deviceId:k,..._},video:!1});await this.initUserMediaStreamContext(E,"microphoneCamera_audio",e)}break;case"microphoneCamera_video":{const k=V(this,vt).get("videoinput"),e=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:k,..._}});await this.initUserMediaStreamContext(E,"microphoneCamera_video",e)}break;case"screenSharing_audio":{const k=await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,..._}),e=k.getTracks();for(const n of e){const{kind:O}=n,$=new MediaStream;$.addTrack(n),k.removeTrack(n),O==="audio"&&await this.initUserMediaStreamContext(E,"screenSharing_audio",$),O==="video"&&await this.initUserMediaStreamContext(E,"screenSharing_video",$)}}break;case"screenSharing_video":{const k=await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,..._});await this.initUserMediaStreamContext(E,"screenSharing_video",k)}break}{const k=this.getUserStreams(E);this.cwsIns.emitNotify("onLocalStream",{code:200,data:k,desc:"local stream is change."}),this.emitNotifyUpdateUsersStreams([{userId:E,updateStreams:{[u]:!0}}])}});ut(this,Tt,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(u=>{this.mediaDevices=u}).catch(function(u){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",u)}),this.mediaDevices));ut(this,Bt,()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await V(this,Tt).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),V(this,Tt).call(this)});Z(this,"getMediaDeviceKind",u=>V(this,vt).get(u));Z(this,"setDeviceKind",async(u,E)=>{if(V(this,vt).set(u,E),u==="audiooutput"){const _=V(this,bt).values();for(const k of _)k.kind==="audio"&&"setSinkId"in HTMLMediaElement.prototype&&k.audioContext.setSinkId(E)}});Z(this,"setAudioOutputDevice",u=>this.setDeviceKind("audiooutput",u));Z(this,"getEnumerateDevices",async u=>(await V(this,Tt).call(this),this.mediaDevices.filter(_=>_.kind===u)));Z(this,"getEnumerateAudioinputDevices",()=>this.getEnumerateDevices("audioinput"));Z(this,"getEnumerateAudioOutputDevices",()=>this.getEnumerateDevices("audiooutput"));Z(this,"getEnumerateVideoinputDevices",()=>this.getEnumerateDevices("videoinput"));V(this,Bt).call(this),V(this,Pt).call(this),V(this,Mt).call(this),V(this,Ut).call(this)}}vt=new WeakMap,wt=new WeakMap,bt=new WeakMap,St=new WeakMap,Ut=new WeakMap,Mt=new WeakMap,Pt=new WeakMap,Tt=new WeakMap,Bt=new WeakMap;class RoomUsers extends RoomMedias{constructor(){super();Z(this,"getMaxVolumeUser",()=>{const u=Array.from(this.userMap.values(),({id:_})=>_);if(u.length===0)return;let E=[];for(const _ of u){const k=this.getUserMediaStreamContext(_,"microphoneCamera_audio");if(!k||k.kind!=="audio")continue;const e=k.getVolume();E.push({id:_,volume:e})}return E=E.sort((_,k)=>_.volume-k.volume>0?-1:1),E[0]});Z(this,"setAudioFilter",async(u={})=>{const E=await this.getUsersId();for(const _ of E){{const k=this.getUserMediaStreamContext(_,"microphoneCamera_audio");(k==null?void 0:k.kind)==="audio"&&(k==null||k.setFilter(u))}{const k=this.getUserMediaStreamContext(_,"screenSharing_audio");(k==null?void 0:k.kind)==="audio"&&(k==null||k.setFilter(u))}}});Z(this,"setEnhanceGain",async(u,E,_)=>{const k=this.getUserMediaStreamContext(u,E);(k==null?void 0:k.kind)==="audio"&&(k==null||k.setEnhanceGain(_))});Z(this,"setVolume",(u,E,_)=>{const k=this.getUserMediaStreamContext(u,E);(k==null?void 0:k.kind)==="audio"&&(k==null||k.setVolumeGain(_))});Z(this,"getVolume",(u,E)=>{const _=this.getUserMediaStreamContext(u,E);let k=0;return(_==null?void 0:_.kind)==="audio"&&(k=_==null?void 0:_.getVolume()),k});Z(this,"clearUsers",()=>{this.userMap=new Map});Z(this,"removeUsers",async u=>{for(const E of u)this.userMap.delete(E),await this.removeUserStreams(E)});Z(this,"createUser",async u=>{const E=Date.now(),_={id:u,permissions:0,callAction:0,callActionStr:"",callActionMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},callState:0,isSelf:u===this.options.userId,isPublished:!1,joinTime:E,updateAt:E,network:{egress:0,ingress:0},tracks:[],updateStreams:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1}};this.userMap.set(u,_)});Z(this,"getUser",async u=>(this.userMap.has(u)||await this.createUser(u),this.userMap.get(u)));Z(this,"getUsers",async(u=[])=>{u.length===0&&(u=[...this.userMap.keys()]);const E=[];for(const _ of u){const k=await this.getUser(_);E.push(k)}return E});Z(this,"getAllUserTrackMids",async()=>{const u=await this.getUsers(),E=[];for(const _ of u){const{tracks:k=[]}=_;for(const e of k)E.push(e.mid)}return E});Z(this,"getUserTrackByTrackName",async u=>{const E=await this.getUsers(),_=[];for(const k of E){const{tracks:e=[]}=k;for(const n of e){const{trackName:O}=n;u.includes(O)&&_.push(n)}}return _});Z(this,"getUserTrackFromMid",async u=>{const E=await this.getUsers();let _;for(const k of E){const{tracks:e=[]}=k;for(const n of e)if(n.mid===u){_=n;break}}return _});Z(this,"checkUserInRoom",u=>this.userMap.has(u));Z(this,"getUsersId",async()=>[...this.userMap.keys()]);Z(this,"getCaller",async()=>await this.getUser(this.options.userId));Z(this,"updateIsPublished",async(u,E=!1)=>{const _=await this.getUser(u);_.isPublished=E});Z(this,"setUserUpdateStreams",async(u,E,_=!0)=>{const k=await this.getUser(u),e={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};e[E]=_,k.updateStreams=e});Z(this,"updateUsertracks",async(u,E=[],_)=>{const k=await this.getUser(u);_&&(E=[...k.tracks,...E]),E=E.filter(({mid:O=""})=>O!==""),E=mt(E,["type"]),E=E.sort((O,$)=>O.type-$.type<0?-1:1);for(const O of E)O.userId=u,O.mediaType=mediaType_keys[O.type],O.enabled===void 0&&(O.enabled=!0);k.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const e=ft(k.tracks,["mediaType","enabled","mid","msid","trackName"]),n=ft(E,["mediaType","enabled","mid","msid","trackName"]);{const O="microphoneCamera_audio",$=n.find(q=>q.mediaType===O),N=e.find(q=>q.mediaType===O),D=JSON.stringify($)!==JSON.stringify(N);k.updateStreams[O]=D}{const O="microphoneCamera_video",$=n.find(q=>q.mediaType===O),N=e.find(q=>q.mediaType===O),D=JSON.stringify($)!==JSON.stringify(N);k.updateStreams[O]=D}{const O="screenSharing_audio",$=n.find(q=>q.mediaType===O),N=e.find(q=>q.mediaType===O),D=JSON.stringify($)!==JSON.stringify(N);k.updateStreams[O]=D}{const O="screenSharing_video",$=n.find(q=>q.mediaType===O),N=e.find(q=>q.mediaType===O),D=JSON.stringify($)!==JSON.stringify(N);k.updateStreams[O]=D}k.tracks=E});Z(this,"updateUserCallAction",async(u,E=0)=>{const _=await this.getUser(u);_.callAction=E,_.callActionStr=E.toString(2).padStart(4,"0"),_.callActionMap=this.getCallActionMap(E)});Z(this,"updateUserNetwork",async(u,E={egress:5,ingress:5})=>{const _=await this.getUser(u);_.network=E});Z(this,"updateUserPermissions",async(u,E)=>{if(E){const _=await this.getUser(u);_.permissions=E}});Z(this,"updateUserBase",async u=>{const E=await this.getUser(u);E.isSelf=u===this.options.userId,E.updateAt=Date.now()});Z(this,"updateUsers",async u=>{for(const E of u){const{id:_,tracks:k,callAction:e,permissions:n,isPublished:O}=E;await this.updateUserBase(_),await this.updateIsPublished(_,O),await this.updateUserPermissions(_,n),await this.updateUsertracks(_,k,!0),await this.updateUserCallAction(_,e),await this.updateUserNetwork(_)}});Z(this,"emitNotifyUpdateUser",async u=>{const E=await this.getUsers([u]),[_]=this.usersFilter(E);this.cwsIns.emitNotify("onRoomUser",{code:200,data:_,desc:"user info is change."})});Z(this,"emitNotifyUpdateUsers",async()=>{const u=await this.getUsers(),E=this.usersFilter(u);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:E,desc:"all users info is change."})})}}class RoomPeer extends RoomUsers{constructor(){super();Z(this,"getPeerStatsTimer",0);Z(this,"reports",[]);Z(this,"peerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});Z(this,"connectedResolveMap",new Map);Z(this,"initPeer",()=>{this.peerIns=new RTCPeerConnection({bundlePolicy:"max-bundle"}),this.transceiverMap=new Map,V(this,Lt).call(this),V(this,Zt).call(this)});Z(this,"setMediaDeviceKind",async(u,E)=>{await this.setDeviceKind(u,E);const _=await this.getCaller(),{tracks:k=[]}=_,e=async n=>{this.localStreamActiveMap.get(n)&&await this.initLocalStream(n),k.find($=>$.mediaType===n)&&await this.replaceSenderStream([n],!0)};u==="audioinput"&&await e("microphoneCamera_audio"),u==="videoinput"&&await e("microphoneCamera_video")});Z(this,"replaceSenderStream",async(u=[],E)=>{const{userId:_}=this.options;u.length===0&&(u=mediaType_keys);for(const k of u){const e=this.transceiverMap.get(k);let n;if(e){const{sender:O}=e;E?n=this.getUserStream(_,k):n=this.getPhoneyStreams(k);const[$]=n.getTracks();O.replaceTrack($)}}});Z(this,"getSenderTracks",(u=[])=>{const E=[];for(const _ of u){const k=this.transceiverMap.get(_);if(!k)continue;const{mid:e,sender:n}=k,{track:O}=n;if(!O)continue;const{id:$,enabled:N}=O,q={type:mediaType_keys.findIndex(P=>P===_),enabled:N,trackName:$,location:"local",mid:e};E.push(q)}return E});Z(this,"addSenders",async(u=[])=>{u.length===0&&this.peerIns.addTransceiver("audio",{direction:"sendonly"});const E=[];for(const _ of u){if(this.transceiverMap.has(_))continue;const k=this.getPhoneyStreams(_),[e]=k.getTracks(),n=this.peerIns.addTransceiver(e,{direction:"sendonly"});this.transceiverMap.set(_,n),E.push(_)}if(u.length===0||E.length){const _=await this.peerIns.createOffer();if(this.options.debug){const k=libExports.parse(_.sdp),e=ft(k.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->Breathe: setLocalDescription",{msidArr:e,sdpJson:k,description:_})}await this.peerIns.setLocalDescription(_)}return E});Z(this,"removeSenders",async(u=[])=>{for(const E of u)this.transceiverMap.has(E)&&this.transceiverMap.delete(E)});Z(this,"clearTransceivers",async()=>{const u=await this.getAllUserTrackMids(),E=this.peerIns.getTransceivers();for(const _ of E){const{mid:k}=_;Number(k)===0||u.includes(k)||(_.stop(),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->Breathe: clearTransceivers: ${k} is stop.`,_))}});Z(this,"onSubscribeUserTracks",u=>{let E=0;return new Promise(async _=>{const k=[];for(const e of u){const{tracks:n=[]}=e;for(const O of n){const{trackName:$,mid:N}=O,[D]=await this.getUserTrackByTrackName([$]);k.push({...D,mid:N})}}{let e=[];const n=async()=>{clearTimeout(E);const $=new Map;for(const D of e){const{userId:q,mediaType:P}=D;if(!q||!P)continue;$.has(q)||$.set(q,{userId:q,tracks:[],updateStreams:{}});const Q=$.get(q);Q.tracks.push(D),Q.updateStreams[P]=!0}const N=[...$.values()];for(const D of N){const{userId:q,tracks:P}=D;await this.updateUsertracks(q,P,!0)}await this.emitNotifyUpdateUsersStreams(N),this.peerIns.removeEventListener("track",O),_(!0)},O=async $=>{const{streams:N,transceiver:D}=$,[q]=N,{mid:P,receiver:j}=D,{track:Q}=j,{id:J,kind:z}=Q,Y=k.find(nt=>nt.mid===`${P}`);if(!Y)return;const{userId:et,mediaType:tt}=Y;if(!(!et||!tt)){if(await this.initUserMediaStreamContext(et,tt,q),z==="audio"){const nt=this.getUserMediaStreamContext(et,tt);(nt==null?void 0:nt.kind)==="audio"&&nt.setMute(!1)}{const nt={...Y,mid:P,msid:J};e.push(nt)}this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->Breathe: await subscribe ${e.length}/${k.length}`,{mediaType:tt,mid:P,userTrack:Y,e:$}),k.length===e.length&&n()}};this.peerIns.addEventListener("track",O),E=setTimeout(()=>n(),5*1e3)}})});ut(this,Lt,()=>{let u=0;const E=()=>{this.setRoomState("closed")};this.peerIns.onconnectionstatechange=()=>{const _=this.peerIns.connectionState;switch(clearTimeout(u),_){case"connected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${_}`),this.taskQueue.setCondition("ice",!0);break;case"disconnected":u=setTimeout(E,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":E(),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}}});Z(this,"closeUserTracks",async(u,E=[],_=!1)=>{const k=[];for(const $ of E){const{trackName:N,msid:D}=$;k.push(N),D&&k.push(D)}const e=$=>k.includes($),n=await this.getUser(u);if(!n)return;for(const $ of n.tracks){const{trackName:N,msid:D,userId:q,mediaType:P}=$;!q||!P||!e(N)||(this.removeUserMediaStreamContext(q,P),D&&delete $.msid)}if(_){const $=n.tracks.filter(({trackName:N})=>!e(N));await this.updateUsertracks(u,$,!1)}const O=this.peerIns.getTransceivers();for(const $ of O){const{sender:N,receiver:D}=$;N.track&&e(N.track.id)&&(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->Breathe: sender: ${N.track.id} is stop.`,$),N.track.enabled=!1,N.track.stop(),this.peerIns.removeTrack(N),$.stop()),D.track&&e(D.track.id)&&(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->Breathe: receiver: ${D.track.id} is stop.`,$),D.track.enabled=!1,D.track.stop(),$.stop())}});Z(this,"createOffer",async()=>{const u=await this.peerIns.createOffer();if(this.options.debug){const E=libExports.parse(u.sdp),_=ft(E.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->Breathe: createOffer",{msidArr:_,sdpJson:E,description:u})}await this.peerIns.setLocalDescription(u)});Z(this,"createAnswer",async()=>{const u=await this.peerIns.createAnswer();if(this.options.debug){const E=libExports.parse(u.sdp),_=ft(E.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->Breathe: createAnswer",{msidArr:_,sdpJson:E,description:u})}await this.peerIns.setLocalDescription(u)});Z(this,"getSdp",()=>{var u;return(u=this.peerIns.localDescription)==null?void 0:u.sdp});Z(this,"setRemoteDescription",async u=>{if(this.options.debug){const E=libExports.parse(u.sdp),_=ft(E.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->Breathe: setRemoteDescription",{msidArr:_,sdpJson:E,description:u})}return await this.peerIns.setRemoteDescription(u),u});Z(this,"getPeerNetwork",()=>this.peerNetwork);Z(this,"setCallStrategy",async(u,E=[])=>{E.length===0&&(E=mediaType_keys);let _="balanced";switch(u){case"qualityPriority":_="maintain-resolution";break;case"fluencyPriority":_="maintain-framerate";break;case"balancedDowngrade":_="balanced";break}const k=await this.getCaller(),e=Array.from(k.tracks,({trackName:O})=>O),n=this.peerIns.getSenders();for(const O of n){const{track:$}=O;if(!$||!e.includes($.id))continue;const N=O.getParameters();O.setParameters({...N,degradationPreference:_})}});Z(this,"setRTCRtpSenderParameters",u=>{try{const E=this.peerIns.getSenders();for(const _ of E){const k=_.getParameters();_.setParameters({...k,...u})}}catch(E){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",E)}});Z(this,"getReportsByMid",async(u=[])=>u.length===0?this.reports:this.reports.filter(E=>u.includes(E.mid)));Z(this,"getRoomNetwork",()=>this.peerNetwork);ut(this,jt,async()=>{try{const u=await this.peerIns.getStats(),E=["inbound-rtp","remote-inbound-rtp","outbound-rtp"],k=[...u.values()].filter(nt=>E.includes(nt.type));let e=0,n=0,O=0,$=0,N=0,D=0,q=[],P=[];for(const nt of this.reports){const{packetsSent:dt,packetsLost:it}=nt;dt&&(O+=dt),it&&($+=it)}this.reports=k;for(const nt of this.reports){const{bytesReceived:dt,bytesSent:it,packetsSent:at,packetsLost:ct,jitter:ot,roundTripTime:rt}=nt;dt&&(e=dt),it&&(n=it),at&&(N+=at),ct&&(D+=ct),rt&&q.push((rt*100).toFixed(2)),ot&&P.push(ot.toFixed(2))}P.sort().reverse(),q.sort().reverse();const j=N-O,Q=D-$,J=j===0?"0.00":(Q/j).toFixed(2),[z="0"]=q,[Y="0"]=P,et={inboundBytes:e,outboundBytes:n,lostRate:J,roundTripTime:z,jitter:Y};this.peerNetwork=et;const tt=(nt,dt,it)=>{const at=Number(nt),ct=Number(dt),ot=Number(it);let rt="0";return at<.03&&ct<100&&ot<.05?rt="5":at<.06&&ct<160&&ot<.1?rt="4":at<.1&&ct<250&&ot<.15?rt="3":at<.15&&ct<400&&ot<.2?rt="2":rt="1",Number(rt)};{const nt=tt(J,z,Y),dt=await this.getCaller(),{network:it}=dt,at={egress:nt,ingress:nt},ct=JSON.stringify(it)!==JSON.stringify(at);if(await this.updateUserNetwork(this.options.userId,at),ct){this.emitNotifyUpdateUsers();const{userId:ot,roomId:rt}=this.options;this.cwsIns.sendMessage({event:"networkQualityChange",data:{...at,userId:ot,roomId:rt}},!1)}}}catch(u){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: setNetQuality is err.",u)}});ut(this,Zt,()=>{const u=async()=>{this.peerIns.connectionState!=="connected"||!this.options.roomId||V(this,jt).call(this)};this.getPeerStatsTimer=setInterval(u,1*1e3)});Z(this,"stopGetPeerStats",()=>clearInterval(this.getPeerStatsTimer))}}Lt=new WeakMap,jt=new WeakMap,Zt=new WeakMap;class RoomCalls extends RoomPeer{constructor(){super();Z(this,"sdk_service_version","1.0.5");Z(this,"setLocalStream",(u,E)=>new Promise(async(_,k)=>{try{const{userId:e}=this.options;if(E?(this.localStreamActiveMap.set(u,!0),await this.initLocalStream(u)):(this.localStreamActiveMap.set(u,!1),this.removeUserMediaStreamContext(e,u)),u==="screenSharing_audio"||u==="screenSharing_video"){{const $=this.getUserStream(e,"screenSharing_audio").getTracks();for(const N of $)N.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}{const $=this.getUserStream(e,"screenSharing_video").getTracks();for(const N of $)N.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}const n=this.getUserStreams(e);_(n)}catch(e){k(e)}}));Z(this,"addNotify",u=>this.cwsIns.addNotify(u));ut(this,Ft,async u=>{const{roomId:E}=this.options;if(!E)return;const{id:_,tracks:k=[]}=await this.getCaller();if(k.length===0)return;const e=k.filter(n=>n.mediaType&&u.includes(n.mediaType));this.cwsIns.sendMessage({event:"pubNotify",data:{roomId:E,user:{id:_,tracks:e}}})});Z(this,"joinRoom",async u=>(this.setOptions(u),await this.createWs(),new Promise((E,_)=>{this.clearUsers();let k="";const e=async()=>{this.taskQueue.clear([k]),await this.emitNotifyUpdateUsers();const O=await this.getUsers();this.taskQueue.setCondition("joinRoom",!0),E(O)},n=async()=>{try{this.taskQueue.setCondition("joinRoom",!1);const{roomId:O,userId:$,callType:N}=this.options;this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:N,roomId:O,user:{id:$,tracks:[],callAction:0}}}).then(async D=>{const{code:q=0,desc:P="服务器繁忙",data:j}=D;if(q!==200)return _(P);const{roomId:Q="",roomUsers:J=[]}=j;if(Q!==O)return _("加入的房间不匹配");this.createSession(),await this.updateUsers(J),e()})}catch(O){this.taskQueue.setCondition("joinRoom",!0),_(`加入房间失败: ${O.message||O||"服务器繁忙"}`)}};k=this.taskQueue.addTask(n,["createWs","joinRoom"],{describe:"joinRoom",strict:!0})})));Z(this,"quitRoom",()=>new Promise(async u=>{const{roomId:E,userId:_}=this.options,k={roomId:E,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:k}),u(!0)}));Z(this,"quitRoomEx",()=>new Promise(async u=>{const{roomId:E,userId:_}=this.options,k={roomId:E,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:k}),u(!0)}));Z(this,"syncRoomInfo",()=>new Promise((u,E)=>{const _=async()=>{const{userId:k}=this.options,e=await this.getUser(k),{id:n=k,callAction:O=0}=e;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:n,callAction:O}}}).then(async $=>{if($.code!==200)return E($.desc);const N=$.data.users;this.clearUsers(),await this.updateUsers(N),await this.updateUsertracks(e.id,e.tracks,!1),await this.subscribe();{const D=await this.getUsers();u(D)}}).catch($=>E($))};this.taskQueue.addTask(_,["createWs"],{describe:"syncRoomInfo"})}));Z(this,"publish",u=>new Promise(async(E,_)=>{const k=async()=>{try{u.includes("screenSharing_audio")&&!u.includes("screenSharing_video")&&(u=[...u,"screenSharing_video"]);const e=await this.getCaller();for(const D of u)this.getUserStream(e.id,D).getTracks().length===0&&await this.setLocalStream(D,!0);const n=[];for(const D of u)this.getUserStream(e.id,D).getTracks().length!==0&&n.push(D);await this.createTrack(n),await this.replaceSenderStream(n,!0);const O=this.getSenderTracks(u),$=[...e.tracks,...O],N=await this.getCallAction($);await this.updateUsertracks(e.id,$,!0),V(this,Ft).call(this,u),await V(this,It).call(this,N);{await this.emitNotifyUpdateUsers();const D=await this.getCaller();E(D)}}catch(e){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: error",e);for(const n of u)await this.setLocalStream(n,!1);_(`publish is error: ${e.message||e}`)}};this.taskQueue.addTask(k,["createWs","createSession","ice","joinRoom","createTrack","subscribe"],{describe:"replaceSenderStream"})}));Z(this,"stopPublish",(u=[])=>new Promise((E,_)=>{const k=async()=>{try{this.taskQueue.setCondition("closeTrack",!1);const e=await this.getCaller();u.length===0&&(u=mediaType_keys);const n=e.tracks.filter(({mediaType:$})=>$&&u.includes($)),O=async()=>{this.taskQueue.setCondition("closeTrack",!0);const $=await this.getCaller();await this.emitNotifyUpdateUsers(),E($)};if(n.length===0)return O();await this.replaceSenderStream(u,!0),await this.removeSenders(u),await this.closeUserTracks(e.id,n,!0);{const $=await this.getCallAction(e.tracks);await V(this,It).call(this,$)}await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:n}}).then(async $=>{const{remoteSdp:N}=$.data;await this.setRemoteDescription({type:"answer",sdp:N})}),O()}catch(e){this.taskQueue.setCondition("closeTrack",!0),_(`stop publish is error: ${e.message||e}`)}};this.taskQueue.addTask(k,["createWs","createSession","ice","createTrack","subscribe"],{describe:"stopPublish"})}));Z(this,"subscribe",(u=[],E=3)=>new Promise((_,k)=>{const e=async()=>{try{this.taskQueue.setCondition("subscribe",!1);const n=await this.getUsers();let O=[];for(const q of n){const{isSelf:P,tracks:j=[]}=q;if(!P){const Q=j.filter(({trackName:J,mid:z=""})=>z!==""&&(u.includes(J)||u.length===0));Q.length!==0&&O.push({...q,tracks:Q})}}const $=async()=>{const q=Array.from(O,({id:j})=>j),P=await this.getUsers(q);await this.emitNotifyUpdateUsers(),this.taskQueue.setCondition("subscribe",!0),_(P)};if(O.length===0)return $();const N=[];for(const q of O){const{id:P,tracks:j}=q,Q=ft(j,["type","trackName"]),J={id:P,tracks:Q};N.push(J)}const D=async()=>{this.options.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: surplus subscribe count is ${E}`),await this.cwsIns.sendMessage({event:"subscribe",data:{users:N}}).then(async q=>{const{code:P=0,data:j,desc:Q}=q;if(P!==200){if(E>0)return await new Promise(Y=>setTimeout(()=>Y(!0),300)),E=E-1,D();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:u}),new Error(Q)}const{remoteSdp:J,users:z=[]}=j;this.onSubscribeUserTracks(z).then(async()=>{await this.renegotiate(),$()}),await this.setRemoteDescription({type:"offer",sdp:J})})};await D()}catch(n){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: error",n),this.taskQueue.setCondition("subscribe",!0),k(`subscribe is error: ${n.message||n}`)}};this.taskQueue.addTask(e,["createWs","createSession","ice","createTrack","closeTrack"],{describe:"subscribe"})}));Z(this,"stopSubscribe",(u=[])=>new Promise((E,_)=>{const k=async()=>{try{this.taskQueue.setCondition("closeTrack",!1);const e=await this.getUsers(),n=[];for(const $ of e){const{tracks:N=[]}=$;for(const D of N){const{type:q,mid:P,trackName:j,mediaType:Q,msid:J}=D;if(!(!Q||!J)&&(u.length===0||u.includes(j))){const z={type:q,mid:P,trackName:J};n.push(z),await this.closeUserTracks($.id,[D])}}}const O=async()=>{await this.emitNotifyUpdateUsers(),this.taskQueue.setCondition("closeTrack",!0),E(!0)};if(n.length===0)return O();await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:n}}).then(async $=>{const{remoteSdp:N}=$.data;await this.setRemoteDescription({type:"answer",sdp:N})}),O()}catch(e){this.taskQueue.setCondition("closeTrack",!0),_(`stop subscribe is error: ${e.message||e}`)}};this.taskQueue.addTask(k,["createWs","createSession","ice","createTrack","subscribe"],{describe:"closeTrack"})}));Z(this,"inactiveTracks",async(u,E)=>new Promise(async _=>{const k=await this.getCaller();if(!k)return;const{tracks:e=[]}=k,n=[...e];await this.replaceSenderStream(u,!0);for(let $ of n){const{mediaType:N}=$;if(N&&u.includes(N)){$.enabled=E;const q=this.getUserStream(k.id,N).getTracks();for(const P of q)P.enabled=E}}const O=await this.getCallAction(n);await V(this,It).call(this,O),await this.emitNotifyUpdateUsers(),_(!0)}));Z(this,"debugger",()=>new Promise(async(u,E)=>{await this.cwsIns.sendMessage({event:"debugger"},!1).then(async _=>{if(_.code!==200)return E(_.desc);u(!0)}).catch(_=>{E(_)})}));ut(this,It,async u=>new Promise(async(E,_)=>{const{roomId:k,userId:e}=this.options,n={roomId:k,user:{id:e,callAction:u}};await this.cwsIns.sendMessage({event:"updateCall",data:n}).then(async O=>{const{code:$=0}=O;if($!==200)return _(O);await this.updateUserCallAction(e,u),E(u)}).catch(O=>_(O))}));Z(this,"renegotiate",()=>new Promise(async(u,E)=>{await this.createAnswer(),await this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then(_=>{if(_.code!==200)return E("协商流错误");u(!0)}).catch(_=>{console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe:error",_),E(`协商流错误: ${_.message||_}`)})}));Z(this,"createWs",()=>new Promise(async(u,E)=>{try{if(["connecting","connected"].includes(this.cwsIns.state))return u(!0);this.taskQueue.setCondition("createWs",!1),this.cwsIns.clearEvents(),this.initPeer();const{appid:_}=this.options,{userId:k,sdkToken:e,roomId:n}=this.options;if(!_)return E("quickvo: createWs is error. You must first use QuickVO.setOptions to set the appid.");if(!k)return E("quickvo: createWs is error. You must first use QuickVO.setOptions to set the userId.");const O={a:e,b:k,c:_,r:n,v:this.sdk_service_version};this.isEarly&&(O.i=ht()),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs",O);const $=btoa(encodeURI(JSON.stringify(O)));await this.cwsIns.connect($),this.taskQueue.setCondition("createWs",!0),u(!0)}catch(_){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs is error.",_),E(_)}}));Z(this,"createSession",()=>{if(!["connecting","connected"].includes(this.roomState))return this.setRoomState("connecting"),new Promise(u=>{const E=async()=>{try{this.taskQueue.setCondition("createSession",!1),await this.addSenders(),await this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}).then(async _=>{const{code:k=0,desc:e,data:n}=_;if(k!==200)throw new Error(e);const{remoteSdp:O}=n;this.taskQueue.setCondition("ice",!1),await this.setRemoteDescription({type:"answer",sdp:O}),this.taskQueue.setCondition("createSession",!0),u(!0)})}catch(_){this.taskQueue.setCondition("createSession",!0),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo create session is error.",_)}};this.taskQueue.addTask(E,["createWs"],{key:"createSession",describe:"createSession"})})});Z(this,"createTrack",async u=>new Promise(E=>{const _=async()=>{try{this.taskQueue.setCondition("createTrack",!1);const k=await this.addSenders(u),e=this.getSenderTracks(k);if(e.length===0)return this.taskQueue.setCondition("createTrack",!0),E(!0);await this.cwsIns.sendMessage({event:"publish",data:{sdp:this.getSdp(),tracks:e,callAction:0}}).then(async n=>{const{code:O=0,desc:$,data:N}=n;if(O!==200)throw this.options.debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createTrack is error.",{mediaTypes:u}),new Error($);const{remoteSdp:D}=N;await this.setRemoteDescription({type:"answer",sdp:D}),this.taskQueue.setCondition("createTrack",!0),E(!0)})}catch{await this.removeSenders(u),this.taskQueue.setCondition("createTrack",!0),E(!0)}};this.taskQueue.addTask(_,["createWs","createSession","ice","subscribe","createTrack","closeTrack"],{describe:"createTrack"})}));Z(this,"earlyConnect",()=>{this.isEarly=!0,this.createWs(),this.createSession(),this.createTrack(["microphoneCamera_audio","microphoneCamera_video"])});this.setRoomState("ready")}}Ft=new WeakMap,It=new WeakMap;class Room extends RoomCalls{constructor(){super()}}class QuickVO extends Room{constructor(u){super();ut(this,gt,new Map);ut(this,Ht,()=>{{const u=async E=>{const{qualities:_=[]}=E.data,[k]=_;if(!(k&&k.userId===this.options.userId&&_.length===1)){for(const e of _){const{userId:n,egress:O,ingress:$}=e;this.checkUserInRoom(n)&&await this.updateUserNetwork(n,{egress:O,ingress:$})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:u},!0)}{const u=async E=>{const _=E.data.user;await this.updateUsers([_]),await this.updateUsertracks(_.id,_.track,!1),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:u},!0)}{const u=async E=>{await this.removeUsers([E.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:u},!0)}{const u=async E=>{const{user:_}=E.data,{id:k,tracks:e=[]}=_;await this.updateUserPermissions(k,3);const n=[];{const{tracks:O}=await this.getUser(k);for(const $ of e){const{mid:N,trackName:D}=$;if(O.find(P=>P.mid===N&&P.trackName===D))continue;n.push($)}}if(n.length!==0)if(await this.updateUsertracks(k,n,!0),this.options.newPublishAutoSubscribe){const O=this.getTrackNamesFormTracks(n);await this.subscribe(O)}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:u},!0)}{const u=async E=>{const{id:_,tracks:k}=E.data.user;_!==this.options.userId&&(await this.closeUserTracks(_,k,!0),await this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onCloseTrack",callback:u},!0)}{const u=async E=>{const{id:_,callAction:k}=E.data.user;this.checkUserInRoom(_)&&(await this.updateUserCallAction(_,k),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:u},!0)}{const u=async E=>{const{user:_}=E.data,{id:k,permissions:e=1}=_;e===1?await this.removeUsers([k]):e===3&&await this.updateUsers([_]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:u},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async u=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)});ut(this,zt,()=>{this.cwsIns.sendMessageBefore=async()=>{}});ut(this,Jt,()=>{this.cwsIns.onReconnectSuccess=async()=>{this.syncRoomInfo()}});ut(this,Wt,async()=>{});Z(this,"addRequestAnimationFrame",async(u,E)=>{{const k=V(this,gt).get(u);k&&cancelAnimationFrame(k)}const _=(k=Date.now())=>{E(k);const e=requestAnimationFrame(_);V(this,gt).set(u,e)};_()});Z(this,"clearRequestAnimationFrame",async(u=[])=>{u.length===0&&(u=[...V(this,gt).keys()]);const E=[];for(const _ of u){const k=V(this,gt).get(_);k&&(cancelAnimationFrame(k),E.push(k))}return E});Z(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(u),this.initCwsCall(),V(this,zt).call(this),V(this,Jt).call(this),V(this,Wt).call(this),V(this,Ht).call(this)}}gt=new WeakMap,Ht=new WeakMap,zt=new WeakMap,Jt=new WeakMap,Wt=new WeakMap,exports.QuickVO=QuickVO,exports.ignoreEvent=ignoreEvent,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
|