quickvo-sdk-js 0.4.8 → 0.4.9
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 +4618 -4608
- package/dist/index.umd.cjs +2 -2
- package/dist/room/RoomUsers.d.ts +8 -0
- package/dist/room/mediaStreams/AudioMediaContext.d.ts +4 -0
- package/package.json +2 -2
package/dist/index.umd.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(at,ct){typeof exports=="object"&&typeof module<"u"?ct(exports):typeof define=="function"&&define.amd?define(["exports"],ct):(at=typeof globalThis<"u"?globalThis:at||self,ct(at["snqu-calls-sdk-js"]={}))})(this,function(exports){"use strict";var Vt=Object.defineProperty;var Qt=at=>{throw TypeError(at)};var Yt=(at,ct,dt)=>ct in at?Vt(at,ct,{enumerable:!0,configurable:!0,writable:!0,value:dt}):at[ct]=dt;var H=(at,ct,dt)=>Yt(at,typeof ct!="symbol"?ct+"":ct,dt),Gt=(at,ct,dt)=>ct.has(at)||Qt("Cannot "+dt);var G=(at,ct,dt)=>(Gt(at,ct,"read from private field"),dt?dt.call(at):ct.get(at)),lt=(at,ct,dt)=>ct.has(at)?Qt("Cannot add the same private member more than once"):ct instanceof WeakSet?ct.add(at):ct.set(at,dt),vt=(at,ct,dt,ht)=>(Gt(at,ct,"write to private field"),ht?ht.call(at,dt):ct.set(at,dt),dt);var at,ct,dt,ht,yt,It,Rt,Et,xt,$t,Nt,At,qt,kt,bt,_t,Tt,Dt,Ct,Ut,Ot,Mt,Pt,Bt,Lt,jt,gt,wt,Zt,Ft,Ht,zt;const v$1=(_,q=[])=>{const k={..._},D=Object.keys(k);for(const $ of D)q.findIndex(I=>String(I)===$)===-1&&delete k[$];return k},it=(_,q=[],k=!0)=>{const D=new Map;for(const I of _){const e=[];for(const N of q)e.push(I[N]);const u=`map-${e.join("-")}`;if(!D.has(u)){D.set(u,I);continue}k&&D.set(u,I)}const $=D.entries();return Array.from($,([I,e])=>e)},mt=(_,q=[])=>{const k=[];for(const D of _){const $=v$1(D,q);k.push($)}return k},ut=(_,q="value",k="label")=>{const D=[],$=Object.entries(_);for(const[I,e]of $){const u={[k]:e,[q]:I};D.push(u)}return D},O=(_=0,q=1)=>{const k=Math.max(0,_),D=Math.max(1,q),$=Math.random()*(D-k+1)+k;return parseInt(`${$}`,10)},pt=(_=16,q=16)=>{const k="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),D=Math.min(k.length,q),$=Date.now().toString(D),I=$.split(""),e=Math.max(4,_-$.length);for(let u=0;u<e;u++){const N=O(0,D-1),A=k[N];I.push(A)}return I.join("").toUpperCase()},j=(_,q)=>{try{let k=Number(_);if(isNaN(k)){const D=new Date(`${_}`);if(`${D}`=="Invalid Date")return 0;k=D.getTime()}if(q!==void 0){const D=new Date().getTimezoneOffset();k+=(D+q)*60*1e3}return k}catch(k){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:_,_offset:q,error:k}),0}},Q={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6","00":"日","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六"},E=(_,q="YYYY-MM-DD hh:mm:ss",k={})=>{const D={empty_str:"-",...k},{empty_str:$,offset:I}=D,e=j(_,I);if(Number(_)!==0&&e===0)return $;const u=new Date(e),N=[{k:"Y+",v:`${u.getFullYear()}`},{k:"M+",v:`${u.getMonth()+1}`},{k:"D+",v:`${u.getDate()}`},{k:"W+",v:`${u.getDay()}`},{k:"h+",v:`${u.getHours()}`},{k:"m+",v:`${u.getMinutes()}`},{k:"s+",v:`${u.getSeconds()}`}];let A;for(let{k:U,v:L}of N)if(A=new RegExp(`(${U})`).exec(q),A){const P=A[1];let Z=L.padStart(P.length,"0");P.includes("W")&&(Z=Q[Z.slice(0,2)]),q=q.replace(P,Z)}return q},enum_mediaType={microphoneCamera_audio:"麦克风-默认轨道",microphoneCamera_video:"摄像头-默认轨道",screenSharing_video:"屏幕共享-视频轨道",screenSharing_audio:"屏幕共享-音频轨道"};ut(enum_mediaType);const mediaType_keys=Object.keys(enum_mediaType);var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},lib={},parser={},grammar={exports:{}},hasRequiredGrammar;function requireGrammar(){if(hasRequiredGrammar)return grammar.exports;hasRequiredGrammar=1;var _=grammar.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(q){return q.encoding?"rtpmap:%d %s/%s/%s":q.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(q){return q.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(q){return q.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(q){return"extmap:%d"+(q.direction?"/%s":"%v")+(q["encrypt-uri"]?" %s":"%v")+" %s"+(q.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(q){return q.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(q){var k="candidate:%s %d %s %d %s %d typ %s";return k+=q.raddr!=null?" raddr %s rport %d":"%v%v",k+=q.tcptype!=null?" tcptype %s":"%v",q.generation!=null&&(k+=" generation %d"),k+=q["network-id"]!=null?" network-id %d":"%v",k+=q["network-cost"]!=null?" network-cost %d":"%v",k}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(q){var k="ssrc:%d";return q.attribute!=null&&(k+=" %s",q.value!=null&&(k+=":%s")),k}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(q){return q.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(q){return q.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(q){return"imageattr:%s %s %s"+(q.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(q){return"simulcast:%s %s"+(q.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(q){return"ts-refclk:%s"+(q.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(q){var k="mediaclk:";return k+=q.id!=null?"id=%s %s":"%v%s",k+=q.mediaClockValue!=null?"=%s":"",k+=q.rateNumerator!=null?" rate=%s":"",k+=q.rateDenominator!=null?"/%s":"",k}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(_).forEach(function(q){var k=_[q];k.forEach(function(D){D.reg||(D.reg=/(.*)/),D.format||(D.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function(_){var q=function(u){return String(Number(u))===u?Number(u):u},k=function(u,N,A,U){if(U&&!A)N[U]=q(u[1]);else for(var L=0;L<A.length;L+=1)u[L+1]!=null&&(N[A[L]]=q(u[L+1]))},D=function(u,N,A){var U=u.name&&u.names;u.push&&!N[u.push]?N[u.push]=[]:U&&!N[u.name]&&(N[u.name]={});var L=u.push?{}:U?N[u.name]:N;k(A.match(u.reg),L,u.names,u.name),u.push&&N[u.push].push(L)},$=requireGrammar(),I=RegExp.prototype.test.bind(/^([a-z])=(.*)/);_.parse=function(u){var N={},A=[],U=N;return u.split(/(\r\n|\r|\n)/).filter(I).forEach(function(L){var P=L[0],Z=L.slice(2);P==="m"&&(A.push({rtp:[],fmtp:[]}),U=A[A.length-1]);for(var F=0;F<($[P]||[]).length;F+=1){var W=$[P][F];if(W.reg.test(Z))return D(W,U,Z)}}),N.media=A,N};var e=function(u,N){var A=N.split(/=(.+)/,2);return A.length===2?u[A[0]]=q(A[1]):A.length===1&&N.length>1&&(u[A[0]]=void 0),u};_.parseParams=function(u){return u.split(/;\s?/).reduce(e,{})},_.parseFmtpConfig=_.parseParams,_.parsePayloads=function(u){return u.toString().split(" ").map(Number)},_.parseRemoteCandidates=function(u){for(var N=[],A=u.split(" ").map(q),U=0;U<A.length;U+=3)N.push({component:A[U],ip:A[U+1],port:A[U+2]});return N},_.parseImageAttributes=function(u){return u.split(" ").map(function(N){return N.substring(1,N.length-1).split(",").reduce(e,{})})},_.parseSimulcastStreamList=function(u){return u.split(";").map(function(N){return N.split(",").map(function(A){var U,L=!1;return A[0]!=="~"?U=q(A):(U=q(A.substring(1,A.length)),L=!0),{scid:U,paused:L}})})}}(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var _=requireGrammar(),q=/%[sdv%]/g,k=function(e){var u=1,N=arguments,A=N.length;return e.replace(q,function(U){if(u>=A)return U;var L=N[u];switch(u+=1,U){case"%%":return"%";case"%s":return String(L);case"%d":return Number(L);case"%v":return""}})},D=function(e,u,N){var A=u.format instanceof Function?u.format(u.push?N:N[u.name]):u.format,U=[e+"="+A];if(u.names)for(var L=0;L<u.names.length;L+=1){var P=u.names[L];u.name?U.push(N[u.name][P]):U.push(N[u.names[L]])}else U.push(N[u.name]);return k.apply(null,U)},$=["v","o","s","i","u","e","p","c","b","t","r","z","a"],I=["i","c","b","a"];return writer$1=function(e,u){u=u||{},e.version==null&&(e.version=0),e.name==null&&(e.name=" "),e.media.forEach(function(L){L.payloads==null&&(L.payloads="")});var N=u.outerOrder||$,A=u.innerOrder||I,U=[];return N.forEach(function(L){_[L].forEach(function(P){P.name in e&&e[P.name]!=null?U.push(D(L,P,e)):P.push in e&&e[P.push]!=null&&e[P.push].forEach(function(Z){U.push(D(L,P,Z))})})}),e.media.forEach(function(L){U.push(D("m",_.m[0],L)),A.forEach(function(P){_[P].forEach(function(Z){Z.name in L&&L[Z.name]!=null?U.push(D(P,Z,L)):Z.push in L&&L[Z.push]!=null&&L[Z.push].forEach(function(F){U.push(D(P,Z,F))})})})}),U.join(`\r
|
|
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),St=(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,It,qt,Dt,Ct,vt,wt,bt,Rt,Ut,Mt,Pt,$t,Bt,Lt,jt,Zt,Ft,Tt,Ot,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 _=requireParser(),q=requireWriter$1(),k=requireGrammar();return lib.grammar=k,lib.write=q,lib.parse=_.parse,lib.parseParams=_.parseParams,lib.parseFmtpConfig=_.parseFmtpConfig,lib.parsePayloads=_.parsePayloads,lib.parseRemoteCandidates=_.parseRemoteCandidates,lib.parseImageAttributes=_.parseImageAttributes,lib.parseSimulcastStreamList=_.parseSimulcastStreamList,lib}var libExports=requireLib();class AudioMediaContext{constructor(q){H(this,"options",{autoGainControl:!1,noiseSuppression:!1,echoCancellation:!1});H(this,"kind","audio");H(this,"stream",new MediaStream);H(this,"audio",new Audio);H(this,"audioContext",new(window.AudioContext||window.webkitAudioContext));H(this,"mediaStreamAudioSourceNode");H(this,"autoGainNode");H(this,"biquadFilterNode");H(this,"delayNode");H(this,"gainNode");H(this,"analyserNode");H(this,"analyserArrayData");H(this,"stop",()=>{const q=this.stream.getTracks();for(const k of q)k.enabled=!1,k.stop(),this.stream.removeTrack(k)});H(this,"replaceStream",q=>{this.stop();const[k]=q.getAudioTracks();this.stream.addTrack(k)});H(this,"getStream",()=>this.mediaStreamAudioSourceNode.mediaStream);H(this,"setMute",(q=!0)=>{q?this.analyserNode.disconnect(this.audioContext.destination):this.analyserNode.connect(this.audioContext.destination)});H(this,"setVolumeGain",q=>{this.gainNode.gain.setValueAtTime(q,this.audioContext.currentTime)});H(this,"getVolume",()=>{const{analyserNode:q,analyserArrayData:k}=this;q.getByteFrequencyData(k);let D=0;for(let I=0;I<k.length;I++)D+=k[I];return Math.ceil(D/k.length)});H(this,"setFilter",(q={})=>{this.options={...this.options,...q};const{autoGainControl:k,noiseSuppression:D,echoCancellation:$}=this.options,{mediaStreamAudioSourceNode:I,autoGainNode:e,biquadFilterNode:u,delayNode:N,gainNode:A}=this,U=I;return k&&U.connect(e),D&&U.connect(u),$&&U.connect(N),U.connect(A),q});this.stream.addTrack(q),this.audio.srcObject=this.stream,this.audioContext=new(window.AudioContext||window.webkitAudioContext),this.mediaStreamAudioSourceNode=this.audioContext.createMediaStreamSource(this.stream),this.autoGainNode=this.audioContext.createGain(),this.autoGainNode.gain.setValueAtTime(.8,this.audioContext.currentTime),this.biquadFilterNode=this.audioContext.createBiquadFilter(),this.biquadFilterNode.type="lowpass",this.biquadFilterNode.frequency.value=1e3,this.delayNode=this.audioContext.createDelay(),this.delayNode.delayTime.value=.5,this.gainNode=this.audioContext.createGain(),this.gainNode.gain.setValueAtTime(1,this.audioContext.currentTime),this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=512,this.analyserArrayData=new Uint8Array(this.analyserNode.frequencyBinCount);const{gainNode:k,analyserNode:D}=this;k.connect(D),this.audioContext.state==="suspended"&&(this.audioContext.resume(),document.addEventListener("click",()=>this.audioContext.resume(),{once:!0})),this.setFilter()}}class VideoMediaContext{constructor(q){H(this,"kind","video");H(this,"stream",new MediaStream);H(this,"stop",()=>{const q=this.stream.getTracks();for(const k of q)k.enabled=!1,k.stop(),this.stream.removeTrack(k)});H(this,"replaceStream",q=>{this.stop();const[k]=q.getVideoTracks();this.stream.addTrack(k)});H(this,"getStream",()=>this.stream);H(this,"getTrack",()=>this.stream.getTracks()[0]);this.stream.addTrack(q)}}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",closed:"已关闭"};ut(enum_roomState);var C=Object.defineProperty,R=_=>{throw TypeError(_)},S=(_,q,k)=>q in _?C(_,q,{enumerable:!0,configurable:!0,writable:!0,value:k}):_[q]=k,l=(_,q,k)=>S(_,typeof q!="symbol"?q+"":q,k),v=(_,q,k)=>q.has(_)||R("Cannot "+k),t=(_,q,k)=>(v(_,q,"read from private field"),k?k.call(_):q.get(_)),c=(_,q,k)=>q.has(_)?R("Cannot add the same private member more than once"):q instanceof WeakSet?q.add(_):q.set(_,k),i=(_,q,k,D)=>(v(_,q,"write to private field"),q.set(_,k),k),s,r,h$1,p$1,m,f$1,w,x$1,g$1,b$1,B,y$1,T,d$1;class M{constructor(q){c(this,s,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,sendBeforAutoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4,checkReconnect:k=>!0,onReconnectSuccess:async k=>{},onReconnectStop:async k=>{},getHeartbeatMsg:()=>JSON.stringify({event:"heartbeat"}),onMessage:k=>{}}),l(this,"ws"),c(this,r,-1),c(this,h$1,-1),c(this,p$1,0),c(this,m,0),c(this,f$1,!1),c(this,w,k=>{}),l(this,"close",async(k=1e3,D="correctly close.")=>{var $;this.ws&&(i(this,f$1,!0),t(this,d$1).call(this),($=this.ws)==null||$.close(k,D))}),l(this,"connect",()=>new Promise(async k=>{i(this,w,k),this.ws=new WebSocket(t(this,s).url),this.ws.binaryType=t(this,s).binaryType,this.ws.onopen=t(this,b$1),this.ws.onmessage=t(this,g$1),this.ws.onerror=t(this,B),this.ws.onclose=t(this,y$1)})),l(this,"reconnect",async k=>new Promise(D=>{t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await reconnect.");const $=I=>{t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: ${I}`),t(this,s).onReconnectStop({msg:I}),D(I)};if(t(this,x$1).call(this)===!1)return $("stop reconnect. exceed maxReconnectionTime.");if(t(this,r)!==-1&&t(this,r)===0)return $("stop reconnect. surplusReconnectCount is 0.");if(!t(this,s).checkReconnect(k))return $("stop reconnect. checkReconnect is false.");t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: await ${t(this,s).reconnectIntervalTime}ms run reconnect. surplusReconnectCount is ${t(this,r)}`,k),i(this,p$1,setTimeout(async()=>{i(this,r,Math.max(-1,t(this,r)-1)),await this.connect();try{await t(this,s).onReconnectSuccess(this.ws)}catch(I){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->pr-ws: onReconnectSuccess is error",I)}D(!0)},t(this,s).reconnectIntervalTime))})),l(this,"sendMessage",async k=>{var D;(!this.ws||this.ws.readyState!==1)&&(t(this,s).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: ws is not ready."),t(this,s).sendBeforAutoConnect&&(t(this,s).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await ws connect."),await this.connect())),(D=this.ws)==null||D.send(k)}),c(this,x$1,()=>{const k=Date.now();return t(this,h$1)===-1&&i(this,h$1,k+t(this,s).reconnectTime),!(k>t(this,h$1))}),c(this,g$1,k=>{const{data:D}=k;t(this,s).onMessage(D)}),c(this,b$1,()=>{t(this,s).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is success.",this.ws),i(this,r,t(this,s).reconnectCount),i(this,h$1,-1),t(this,T).call(this),t(this,w).call(this,this.ws)}),c(this,B,k=>{t(this,s).debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is error.",k)}),c(this,y$1,k=>{if(t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: connect is close. code: ${k.code}, permanentClosed is ${t(this,f$1)}.`,k),t(this,d$1).call(this),!t(this,f$1))return this.reconnect(k);this.ws=void 0}),c(this,T,()=>{i(this,m,setInterval(()=>{const k=t(this,s).getHeartbeatMsg();k&&this.sendMessage(k)},t(this,s).heartbeatIntervalTime))}),c(this,d$1,()=>{clearInterval(t(this,p$1)),clearInterval(t(this,m))}),i(this,s,{...t(this,s),...q}),i(this,r,t(this,s).reconnectCount)}}s=new WeakMap,r=new WeakMap,h$1=new WeakMap,p$1=new WeakMap,m=new WeakMap,f$1=new WeakMap,w=new WeakMap,x$1=new WeakMap,g$1=new WeakMap,b$1=new WeakMap,B=new WeakMap,y$1=new WeakMap,T=new WeakMap,d$1=new WeakMap;var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=_;function _(q,k){for(var D=new Array(arguments.length-1),$=0,I=2,e=!0;I<arguments.length;)D[$++]=arguments[I++];return new Promise(function(N,A){D[$]=function(L){if(e)if(e=!1,L)A(L);else{for(var P=new Array(arguments.length-1),Z=0;Z<P.length;)P[Z++]=arguments[Z];N.apply(null,P)}};try{q.apply(k||null,D)}catch(U){e&&(e=!1,A(U))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(_){var q=_;q.length=function(u){var N=u.length;if(!N)return 0;for(var A=0;--N%4>1&&u.charAt(N)==="=";)++A;return Math.ceil(u.length*3)/4-A};for(var k=new Array(64),D=new Array(123),$=0;$<64;)D[k[$]=$<26?$+65:$<52?$+71:$<62?$-4:$-59|43]=$++;q.encode=function(u,N,A){for(var U=null,L=[],P=0,Z=0,F;N<A;){var W=u[N++];switch(Z){case 0:L[P++]=k[W>>2],F=(W&3)<<4,Z=1;break;case 1:L[P++]=k[F|W>>4],F=(W&15)<<2,Z=2;break;case 2:L[P++]=k[F|W>>6],L[P++]=k[W&63],Z=0;break}P>8191&&((U||(U=[])).push(String.fromCharCode.apply(String,L)),P=0)}return Z&&(L[P++]=k[F],L[P++]=61,Z===1&&(L[P++]=61)),U?(P&&U.push(String.fromCharCode.apply(String,L.slice(0,P))),U.join("")):String.fromCharCode.apply(String,L.slice(0,P))};var I="invalid encoding";q.decode=function(u,N,A){for(var U=A,L=0,P,Z=0;Z<u.length;){var F=u.charCodeAt(Z++);if(F===61&&L>1)break;if((F=D[F])===void 0)throw Error(I);switch(L){case 0:P=F,L=1;break;case 1:N[A++]=P<<2|(F&48)>>4,P=F,L=2;break;case 2:N[A++]=(P&15)<<4|(F&60)>>2,P=F,L=3;break;case 3:N[A++]=(P&3)<<6|F,L=0;break}}if(L===1)throw Error(I);return A-U},q.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=_;function _(){this._listeners={}}return _.prototype.on=function(k,D,$){return(this._listeners[k]||(this._listeners[k]=[])).push({fn:D,ctx:$||this}),this},_.prototype.off=function(k,D){if(k===void 0)this._listeners={};else if(D===void 0)this._listeners[k]=[];else for(var $=this._listeners[k],I=0;I<$.length;)$[I].fn===D?$.splice(I,1):++I;return this},_.prototype.emit=function(k){var D=this._listeners[k];if(D){for(var $=[],I=1;I<arguments.length;)$.push(arguments[I++]);for(I=0;I<D.length;)D[I].fn.apply(D[I++].ctx,$)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=_(_);function _(I){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),u=new Uint8Array(e.buffer),N=u[3]===128;function A(Z,F,W){e[0]=Z,F[W]=u[0],F[W+1]=u[1],F[W+2]=u[2],F[W+3]=u[3]}function U(Z,F,W){e[0]=Z,F[W]=u[3],F[W+1]=u[2],F[W+2]=u[1],F[W+3]=u[0]}I.writeFloatLE=N?A:U,I.writeFloatBE=N?U:A;function L(Z,F){return u[0]=Z[F],u[1]=Z[F+1],u[2]=Z[F+2],u[3]=Z[F+3],e[0]}function P(Z,F){return u[3]=Z[F],u[2]=Z[F+1],u[1]=Z[F+2],u[0]=Z[F+3],e[0]}I.readFloatLE=N?L:P,I.readFloatBE=N?P:L}():function(){function e(N,A,U,L){var P=A<0?1:0;if(P&&(A=-A),A===0)N(1/A>0?0:2147483648,U,L);else if(isNaN(A))N(2143289344,U,L);else if(A>34028234663852886e22)N((P<<31|2139095040)>>>0,U,L);else if(A<11754943508222875e-54)N((P<<31|Math.round(A/1401298464324817e-60))>>>0,U,L);else{var Z=Math.floor(Math.log(A)/Math.LN2),F=Math.round(A*Math.pow(2,-Z)*8388608)&8388607;N((P<<31|Z+127<<23|F)>>>0,U,L)}}I.writeFloatLE=e.bind(null,q),I.writeFloatBE=e.bind(null,k);function u(N,A,U){var L=N(A,U),P=(L>>31)*2+1,Z=L>>>23&255,F=L&8388607;return Z===255?F?NaN:P*(1/0):Z===0?P*1401298464324817e-60*F:P*Math.pow(2,Z-150)*(F+8388608)}I.readFloatLE=u.bind(null,D),I.readFloatBE=u.bind(null,$)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),u=new Uint8Array(e.buffer),N=u[7]===128;function A(Z,F,W){e[0]=Z,F[W]=u[0],F[W+1]=u[1],F[W+2]=u[2],F[W+3]=u[3],F[W+4]=u[4],F[W+5]=u[5],F[W+6]=u[6],F[W+7]=u[7]}function U(Z,F,W){e[0]=Z,F[W]=u[7],F[W+1]=u[6],F[W+2]=u[5],F[W+3]=u[4],F[W+4]=u[3],F[W+5]=u[2],F[W+6]=u[1],F[W+7]=u[0]}I.writeDoubleLE=N?A:U,I.writeDoubleBE=N?U:A;function L(Z,F){return u[0]=Z[F],u[1]=Z[F+1],u[2]=Z[F+2],u[3]=Z[F+3],u[4]=Z[F+4],u[5]=Z[F+5],u[6]=Z[F+6],u[7]=Z[F+7],e[0]}function P(Z,F){return u[7]=Z[F],u[6]=Z[F+1],u[5]=Z[F+2],u[4]=Z[F+3],u[3]=Z[F+4],u[2]=Z[F+5],u[1]=Z[F+6],u[0]=Z[F+7],e[0]}I.readDoubleLE=N?L:P,I.readDoubleBE=N?P:L}():function(){function e(N,A,U,L,P,Z){var F=L<0?1:0;if(F&&(L=-L),L===0)N(0,P,Z+A),N(1/L>0?0:2147483648,P,Z+U);else if(isNaN(L))N(0,P,Z+A),N(2146959360,P,Z+U);else if(L>17976931348623157e292)N(0,P,Z+A),N((F<<31|2146435072)>>>0,P,Z+U);else{var W;if(L<22250738585072014e-324)W=L/5e-324,N(W>>>0,P,Z+A),N((F<<31|W/4294967296)>>>0,P,Z+U);else{var J=Math.floor(Math.log(L)/Math.LN2);J===1024&&(J=1023),W=L*Math.pow(2,-J),N(W*4503599627370496>>>0,P,Z+A),N((F<<31|J+1023<<20|W*1048576&1048575)>>>0,P,Z+U)}}}I.writeDoubleLE=e.bind(null,q,0,4),I.writeDoubleBE=e.bind(null,k,4,0);function u(N,A,U,L,P){var Z=N(L,P+A),F=N(L,P+U),W=(F>>31)*2+1,J=F>>>20&2047,z=4294967296*(F&1048575)+Z;return J===2047?z?NaN:W*(1/0):J===0?W*5e-324*z:W*Math.pow(2,J-1075)*(z+4503599627370496)}I.readDoubleLE=u.bind(null,D,0,4),I.readDoubleBE=u.bind(null,$,4,0)}(),I}function q(I,e,u){e[u]=I&255,e[u+1]=I>>>8&255,e[u+2]=I>>>16&255,e[u+3]=I>>>24}function k(I,e,u){e[u]=I>>>24,e[u+1]=I>>>16&255,e[u+2]=I>>>8&255,e[u+3]=I&255}function D(I,e){return(I[e]|I[e+1]<<8|I[e+2]<<16|I[e+3]<<24)>>>0}function $(I,e){return(I[e]<<24|I[e+1]<<16|I[e+2]<<8|I[e+3])>>>0}return float}var inquire_1,hasRequiredInquire;function requireInquire(){if(hasRequiredInquire)return inquire_1;hasRequiredInquire=1,inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(_){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(_){var q=_;q.length=function(D){for(var $=0,I=0,e=0;e<D.length;++e)I=D.charCodeAt(e),I<128?$+=1:I<2048?$+=2:(I&64512)===55296&&(D.charCodeAt(e+1)&64512)===56320?(++e,$+=4):$+=3;return $},q.read=function(D,$,I){var e=I-$;if(e<1)return"";for(var u=null,N=[],A=0,U;$<I;)U=D[$++],U<128?N[A++]=U:U>191&&U<224?N[A++]=(U&31)<<6|D[$++]&63:U>239&&U<365?(U=((U&7)<<18|(D[$++]&63)<<12|(D[$++]&63)<<6|D[$++]&63)-65536,N[A++]=55296+(U>>10),N[A++]=56320+(U&1023)):N[A++]=(U&15)<<12|(D[$++]&63)<<6|D[$++]&63,A>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,N)),A=0);return u?(A&&u.push(String.fromCharCode.apply(String,N.slice(0,A))),u.join("")):String.fromCharCode.apply(String,N.slice(0,A))},q.write=function(D,$,I){for(var e=I,u,N,A=0;A<D.length;++A)u=D.charCodeAt(A),u<128?$[I++]=u:u<2048?($[I++]=u>>6|192,$[I++]=u&63|128):(u&64512)===55296&&((N=D.charCodeAt(A+1))&64512)===56320?(u=65536+((u&1023)<<10)+(N&1023),++A,$[I++]=u>>18|240,$[I++]=u>>12&63|128,$[I++]=u>>6&63|128,$[I++]=u&63|128):($[I++]=u>>12|224,$[I++]=u>>6&63|128,$[I++]=u&63|128);return I-e}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=_;function _(q,k,D){var $=D||8192,I=$>>>1,e=null,u=$;return function(A){if(A<1||A>I)return q(A);u+A>$&&(e=q($),u=0);var U=k.call(e,u,u+=A);return u&7&&(u=(u|7)+1),U}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=q;var _=requireMinimal$1();function q(I,e){this.lo=I>>>0,this.hi=e>>>0}var k=q.zero=new q(0,0);k.toNumber=function(){return 0},k.zzEncode=k.zzDecode=function(){return this},k.length=function(){return 1};var D=q.zeroHash="\0\0\0\0\0\0\0\0";q.fromNumber=function(e){if(e===0)return k;var u=e<0;u&&(e=-e);var N=e>>>0,A=(e-N)/4294967296>>>0;return u&&(A=~A>>>0,N=~N>>>0,++N>4294967295&&(N=0,++A>4294967295&&(A=0))),new q(N,A)},q.from=function(e){if(typeof e=="number")return q.fromNumber(e);if(_.isString(e))if(_.Long)e=_.Long.fromString(e);else return q.fromNumber(parseInt(e,10));return e.low||e.high?new q(e.low>>>0,e.high>>>0):k},q.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var u=~this.lo+1>>>0,N=~this.hi>>>0;return u||(N=N+1>>>0),-(u+N*4294967296)}return this.lo+this.hi*4294967296},q.prototype.toLong=function(e){return _.Long?new _.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var $=String.prototype.charCodeAt;return q.fromHash=function(e){return e===D?k:new q(($.call(e,0)|$.call(e,1)<<8|$.call(e,2)<<16|$.call(e,3)<<24)>>>0,($.call(e,4)|$.call(e,5)<<8|$.call(e,6)<<16|$.call(e,7)<<24)>>>0)},q.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},q.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},q.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},q.prototype.length=function(){var e=this.lo,u=(this.lo>>>28|this.hi<<4)>>>0,N=this.hi>>>24;return N===0?u===0?e<16384?e<128?1:2:e<2097152?3:4:u<16384?u<128?5:6:u<2097152?7:8:N<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(_){var q=_;q.asPromise=requireAspromise(),q.base64=requireBase64(),q.EventEmitter=requireEventemitter(),q.float=requireFloat(),q.inquire=requireInquire(),q.utf8=requireUtf8(),q.pool=requirePool(),q.LongBits=requireLongbits(),q.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),q.global=q.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,q.emptyArray=Object.freeze?Object.freeze([]):[],q.emptyObject=Object.freeze?Object.freeze({}):{},q.isInteger=Number.isInteger||function(I){return typeof I=="number"&&isFinite(I)&&Math.floor(I)===I},q.isString=function(I){return typeof I=="string"||I instanceof String},q.isObject=function(I){return I&&typeof I=="object"},q.isset=q.isSet=function(I,e){var u=I[e];return u!=null&&I.hasOwnProperty(e)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},q.Buffer=function(){try{var $=q.inquire("buffer").Buffer;return $.prototype.utf8Write?$:null}catch{return null}}(),q._Buffer_from=null,q._Buffer_allocUnsafe=null,q.newBuffer=function(I){return typeof I=="number"?q.Buffer?q._Buffer_allocUnsafe(I):new q.Array(I):q.Buffer?q._Buffer_from(I):typeof Uint8Array>"u"?I:new Uint8Array(I)},q.Array=typeof Uint8Array<"u"?Uint8Array:Array,q.Long=q.global.dcodeIO&&q.global.dcodeIO.Long||q.global.Long||q.inquire("long"),q.key2Re=/^true|false|0|1$/,q.key32Re=/^-?(?:0|[1-9][0-9]*)$/,q.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,q.longToHash=function(I){return I?q.LongBits.from(I).toHash():q.LongBits.zeroHash},q.longFromHash=function(I,e){var u=q.LongBits.fromHash(I);return q.Long?q.Long.fromBits(u.lo,u.hi,e):u.toNumber(!!e)};function k($,I,e){for(var u=Object.keys(I),N=0;N<u.length;++N)($[u[N]]===void 0||!e)&&($[u[N]]=I[u[N]]);return $}q.merge=k,q.lcFirst=function(I){return I.charAt(0).toLowerCase()+I.substring(1)};function D($){function I(e,u){if(!(this instanceof I))return new I(e,u);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,I):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&k(this,u)}return I.prototype=Object.create(Error.prototype,{constructor:{value:I,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return $},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),I}q.newError=D,q.ProtocolError=D("ProtocolError"),q.oneOfGetter=function(I){for(var e={},u=0;u<I.length;++u)e[I[u]]=1;return function(){for(var N=Object.keys(this),A=N.length-1;A>-1;--A)if(e[N[A]]===1&&this[N[A]]!==void 0&&this[N[A]]!==null)return N[A]}},q.oneOfSetter=function(I){return function(e){for(var u=0;u<I.length;++u)I[u]!==e&&delete this[I[u]]}},q.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},q._configure=function(){var $=q.Buffer;if(!$){q._Buffer_from=q._Buffer_allocUnsafe=null;return}q._Buffer_from=$.from!==Uint8Array.from&&$.from||function(e,u){return new $(e,u)},q._Buffer_allocUnsafe=$.allocUnsafe||function(e){return new $(e)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=N;var _=requireMinimal$1(),q,k=_.LongBits,D=_.base64,$=_.utf8;function I(J,z,V){this.fn=J,this.len=z,this.next=void 0,this.val=V}function e(){}function u(J){this.head=J.head,this.tail=J.tail,this.len=J.len,this.next=J.states}function N(){this.len=0,this.head=new I(e,0,0),this.tail=this.head,this.states=null}var A=function(){return _.Buffer?function(){return(N.create=function(){return new q})()}:function(){return new N}};N.create=A(),N.alloc=function(z){return new _.Array(z)},_.Array!==Array&&(N.alloc=_.pool(N.alloc,_.Array.prototype.subarray)),N.prototype._push=function(z,V,X){return this.tail=this.tail.next=new I(z,V,X),this.len+=V,this};function U(J,z,V){z[V]=J&255}function L(J,z,V){for(;J>127;)z[V++]=J&127|128,J>>>=7;z[V]=J}function P(J,z){this.len=J,this.next=void 0,this.val=z}P.prototype=Object.create(I.prototype),P.prototype.fn=L,N.prototype.uint32=function(z){return this.len+=(this.tail=this.tail.next=new P((z=z>>>0)<128?1:z<16384?2:z<2097152?3:z<268435456?4:5,z)).len,this},N.prototype.int32=function(z){return z<0?this._push(Z,10,k.fromNumber(z)):this.uint32(z)},N.prototype.sint32=function(z){return this.uint32((z<<1^z>>31)>>>0)};function Z(J,z,V){for(;J.hi;)z[V++]=J.lo&127|128,J.lo=(J.lo>>>7|J.hi<<25)>>>0,J.hi>>>=7;for(;J.lo>127;)z[V++]=J.lo&127|128,J.lo=J.lo>>>7;z[V++]=J.lo}N.prototype.uint64=function(z){var V=k.from(z);return this._push(Z,V.length(),V)},N.prototype.int64=N.prototype.uint64,N.prototype.sint64=function(z){var V=k.from(z).zzEncode();return this._push(Z,V.length(),V)},N.prototype.bool=function(z){return this._push(U,1,z?1:0)};function F(J,z,V){z[V]=J&255,z[V+1]=J>>>8&255,z[V+2]=J>>>16&255,z[V+3]=J>>>24}N.prototype.fixed32=function(z){return this._push(F,4,z>>>0)},N.prototype.sfixed32=N.prototype.fixed32,N.prototype.fixed64=function(z){var V=k.from(z);return this._push(F,4,V.lo)._push(F,4,V.hi)},N.prototype.sfixed64=N.prototype.fixed64,N.prototype.float=function(z){return this._push(_.float.writeFloatLE,4,z)},N.prototype.double=function(z){return this._push(_.float.writeDoubleLE,8,z)};var W=_.Array.prototype.set?function(z,V,X){V.set(z,X)}:function(z,V,X){for(var Y=0;Y<z.length;++Y)V[X+Y]=z[Y]};return N.prototype.bytes=function(z){var V=z.length>>>0;if(!V)return this._push(U,1,0);if(_.isString(z)){var X=N.alloc(V=D.length(z));D.decode(z,X,0),z=X}return this.uint32(V)._push(W,V,z)},N.prototype.string=function(z){var V=$.length(z);return V?this.uint32(V)._push($.write,V,z):this._push(U,1,0)},N.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new I(e,0,0),this.len=0,this},N.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new I(e,0,0),this.len=0),this},N.prototype.ldelim=function(){var z=this.head,V=this.tail,X=this.len;return this.reset().uint32(X),X&&(this.tail.next=z.next,this.tail=V,this.len+=X),this},N.prototype.finish=function(){for(var z=this.head.next,V=this.constructor.alloc(this.len),X=0;z;)z.fn(z.val,V,X),X+=z.len,z=z.next;return V},N._configure=function(J){q=J,N.create=A(),q._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=k;var _=requireWriter();(k.prototype=Object.create(_.prototype)).constructor=k;var q=requireMinimal$1();function k(){_.call(this)}k._configure=function(){k.alloc=q._Buffer_allocUnsafe,k.writeBytesBuffer=q.Buffer&&q.Buffer.prototype instanceof Uint8Array&&q.Buffer.prototype.set.name==="set"?function(I,e,u){e.set(I,u)}:function(I,e,u){if(I.copy)I.copy(e,u,0,I.length);else for(var N=0;N<I.length;)e[u++]=I[N++]}},k.prototype.bytes=function(I){q.isString(I)&&(I=q._Buffer_from(I,"base64"));var e=I.length>>>0;return this.uint32(e),e&&this._push(k.writeBytesBuffer,e,I),this};function D($,I,e){$.length<40?q.utf8.write($,I,e):I.utf8Write?I.utf8Write($,e):I.write($,e)}return k.prototype.string=function(I){var e=q.Buffer.byteLength(I);return this.uint32(e),e&&this._push(D,e,I),this},k._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=I;var _=requireMinimal$1(),q,k=_.LongBits,D=_.utf8;function $(L,P){return RangeError("index out of range: "+L.pos+" + "+(P||1)+" > "+L.len)}function I(L){this.buf=L,this.pos=0,this.len=L.length}var e=typeof Uint8Array<"u"?function(P){if(P instanceof Uint8Array||Array.isArray(P))return new I(P);throw Error("illegal buffer")}:function(P){if(Array.isArray(P))return new I(P);throw Error("illegal buffer")},u=function(){return _.Buffer?function(Z){return(I.create=function(W){return _.Buffer.isBuffer(W)?new q(W):e(W)})(Z)}:e};I.create=u(),I.prototype._slice=_.Array.prototype.subarray||_.Array.prototype.slice,I.prototype.uint32=function(){var P=4294967295;return function(){if(P=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(P=(P|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(P=(P|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(P=(P|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(P=(P|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return P;if((this.pos+=5)>this.len)throw this.pos=this.len,$(this,10);return P}}(),I.prototype.int32=function(){return this.uint32()|0},I.prototype.sint32=function(){var P=this.uint32();return P>>>1^-(P&1)|0};function N(){var L=new k(0,0),P=0;if(this.len-this.pos>4){for(;P<4;++P)if(L.lo=(L.lo|(this.buf[this.pos]&127)<<P*7)>>>0,this.buf[this.pos++]<128)return L;if(L.lo=(L.lo|(this.buf[this.pos]&127)<<28)>>>0,L.hi=(L.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return L;P=0}else{for(;P<3;++P){if(this.pos>=this.len)throw $(this);if(L.lo=(L.lo|(this.buf[this.pos]&127)<<P*7)>>>0,this.buf[this.pos++]<128)return L}return L.lo=(L.lo|(this.buf[this.pos++]&127)<<P*7)>>>0,L}if(this.len-this.pos>4){for(;P<5;++P)if(L.hi=(L.hi|(this.buf[this.pos]&127)<<P*7+3)>>>0,this.buf[this.pos++]<128)return L}else for(;P<5;++P){if(this.pos>=this.len)throw $(this);if(L.hi=(L.hi|(this.buf[this.pos]&127)<<P*7+3)>>>0,this.buf[this.pos++]<128)return L}throw Error("invalid varint encoding")}I.prototype.bool=function(){return this.uint32()!==0};function A(L,P){return(L[P-4]|L[P-3]<<8|L[P-2]<<16|L[P-1]<<24)>>>0}I.prototype.fixed32=function(){if(this.pos+4>this.len)throw $(this,4);return A(this.buf,this.pos+=4)},I.prototype.sfixed32=function(){if(this.pos+4>this.len)throw $(this,4);return A(this.buf,this.pos+=4)|0};function U(){if(this.pos+8>this.len)throw $(this,8);return new k(A(this.buf,this.pos+=4),A(this.buf,this.pos+=4))}return I.prototype.float=function(){if(this.pos+4>this.len)throw $(this,4);var P=_.float.readFloatLE(this.buf,this.pos);return this.pos+=4,P},I.prototype.double=function(){if(this.pos+8>this.len)throw $(this,4);var P=_.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,P},I.prototype.bytes=function(){var P=this.uint32(),Z=this.pos,F=this.pos+P;if(F>this.len)throw $(this,P);if(this.pos+=P,Array.isArray(this.buf))return this.buf.slice(Z,F);if(Z===F){var W=_.Buffer;return W?W.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,Z,F)},I.prototype.string=function(){var P=this.bytes();return D.read(P,0,P.length)},I.prototype.skip=function(P){if(typeof P=="number"){if(this.pos+P>this.len)throw $(this,P);this.pos+=P}else do if(this.pos>=this.len)throw $(this);while(this.buf[this.pos++]&128);return this},I.prototype.skipType=function(L){switch(L){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(L=this.uint32()&7)!==4;)this.skipType(L);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+L+" at offset "+this.pos)}return this},I._configure=function(L){q=L,I.create=u(),q._configure();var P=_.Long?"toLong":"toNumber";_.merge(I.prototype,{int64:function(){return N.call(this)[P](!1)},uint64:function(){return N.call(this)[P](!0)},sint64:function(){return N.call(this).zzDecode()[P](!1)},fixed64:function(){return U.call(this)[P](!0)},sfixed64:function(){return U.call(this)[P](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=k;var _=requireReader();(k.prototype=Object.create(_.prototype)).constructor=k;var q=requireMinimal$1();function k(D){_.call(this,D)}return k._configure=function(){q.Buffer&&(k.prototype._slice=q.Buffer.prototype.slice)},k.prototype.string=function(){var $=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+$,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+$,this.len))},k._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=q;var _=requireMinimal$1();(q.prototype=Object.create(_.EventEmitter.prototype)).constructor=q;function q(k,D,$){if(typeof k!="function")throw TypeError("rpcImpl must be a function");_.EventEmitter.call(this),this.rpcImpl=k,this.requestDelimited=!!D,this.responseDelimited=!!$}return q.prototype.rpcCall=function k(D,$,I,e,u){if(!e)throw TypeError("request must be specified");var N=this;if(!u)return _.asPromise(k,N,D,$,I,e);if(!N.rpcImpl){setTimeout(function(){u(Error("already ended"))},0);return}try{return N.rpcImpl(D,$[N.requestDelimited?"encodeDelimited":"encode"](e).finish(),function(U,L){if(U)return N.emit("error",U,D),u(U);if(L===null){N.end(!0);return}if(!(L instanceof I))try{L=I[N.responseDelimited?"decodeDelimited":"decode"](L)}catch(P){return N.emit("error",P,D),u(P)}return N.emit("data",L,D),u(null,L)})}catch(A){N.emit("error",A,D),setTimeout(function(){u(A)},0);return}},q.prototype.end=function(D){return this.rpcImpl&&(D||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,function(_){var q=_;q.Service=requireService()}(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(_){var q=_;q.build="minimal",q.Writer=requireWriter(),q.BufferWriter=requireWriter_buffer(),q.Reader=requireReader(),q.BufferReader=requireReader_buffer(),q.util=requireMinimal$1(),q.rpc=requireRpc(),q.roots=requireRoots(),q.configure=k;function k(){q.util._configure(),q.Writer._configure(q.BufferWriter),q.Reader._configure(q.BufferReader)}k()}(indexMinimal)),indexMinimal}var minimal,hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,minimal=requireIndexMinimal()),minimal}var minimalExports=requireMinimal();const $Reader=minimalExports.Reader,$Writer=minimalExports.Writer,$util=minimalExports.util,$root=minimalExports.roots.default||(minimalExports.roots.default={}),com=$root.com=(()=>{const _={};return _.quick=function(){const q={};return q.voice=function(){const k={};return k.proto=function(){const D={};return D.CommonReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.event="",$.prototype.data=$util.newBuffer([]),$.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.version=0,$.prototype.compress=!1,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&u.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&u.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&u.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&u.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&u.uint32(40).int64(e.valid),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&u.uint32(48).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&u.uint32(56).bool(e.compress),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.CommonReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.event=e.string();break}case 2:{A.data=e.bytes();break}case 3:{A.sn=e.int64();break}case 4:{A.time=e.int64();break}case 5:{A.valid=e.int64();break}case 6:{A.version=e.int32();break}case 7:{A.compress=e.bool();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){return typeof e!="object"||e===null?"object expected":e.event!=null&&e.hasOwnProperty("event")&&!$util.isString(e.event)?"event: string expected":e.data!=null&&e.hasOwnProperty("data")&&!(e.data&&typeof e.data.length=="number"||$util.isString(e.data))?"data: buffer expected":e.sn!=null&&e.hasOwnProperty("sn")&&!$util.isInteger(e.sn)&&!(e.sn&&$util.isInteger(e.sn.low)&&$util.isInteger(e.sn.high))?"sn: integer|Long expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":e.valid!=null&&e.hasOwnProperty("valid")&&!$util.isInteger(e.valid)&&!(e.valid&&$util.isInteger(e.valid.low)&&$util.isInteger(e.valid.high))?"valid: integer|Long expected":e.version!=null&&e.hasOwnProperty("version")&&!$util.isInteger(e.version)?"version: integer expected":e.compress!=null&&e.hasOwnProperty("compress")&&typeof e.compress!="boolean"?"compress: boolean expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CommonReq)return e;let u=new $root.com.quick.voice.proto.CommonReq;return e.event!=null&&(u.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,u.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(u.data=e.data)),e.sn!=null&&($util.Long?(u.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?u.sn=parseInt(e.sn,10):typeof e.sn=="number"?u.sn=e.sn:typeof e.sn=="object"&&(u.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(u.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?u.time=parseInt(e.time,10):typeof e.time=="number"?u.time=e.time:typeof e.time=="object"&&(u.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(u.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?u.valid=parseInt(e.valid,10):typeof e.valid=="number"?u.valid=e.valid:typeof e.valid=="object"&&(u.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.version!=null&&(u.version=e.version|0),e.compress!=null&&(u.compress=!!e.compress),u},$.toObject=function(e,u){u||(u={});let N={};if(u.defaults){if(N.event="",u.bytes===String?N.data="":(N.data=[],u.bytes!==Array&&(N.data=$util.newBuffer(N.data))),$util.Long){let A=new $util.Long(0,0,!1);N.sn=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.sn=u.longs===String?"0":0;if($util.Long){let A=new $util.Long(0,0,!1);N.time=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.time=u.longs===String?"0":0;if($util.Long){let A=new $util.Long(0,0,!1);N.valid=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.valid=u.longs===String?"0":0;N.version=0,N.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(N.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(N.data=u.bytes===String?$util.base64.encode(e.data,0,e.data.length):u.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?N.sn=u.longs===String?String(e.sn):e.sn:N.sn=u.longs===String?$util.Long.prototype.toString.call(e.sn):u.longs===Number?new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber():e.sn),e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?N.time=u.longs===String?String(e.time):e.time:N.time=u.longs===String?$util.Long.prototype.toString.call(e.time):u.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),e.valid!=null&&e.hasOwnProperty("valid")&&(typeof e.valid=="number"?N.valid=u.longs===String?String(e.valid):e.valid:N.valid=u.longs===String?$util.Long.prototype.toString.call(e.valid):u.longs===Number?new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber():e.valid),e.version!=null&&e.hasOwnProperty("version")&&(N.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(N.compress=e.compress),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CommonReq"},$}(),D.CommonRsp=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.event="",$.prototype.data=$util.newBuffer([]),$.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.code=0,$.prototype.desc="",$.prototype.version=0,$.prototype.compress=!1,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&u.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&u.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&u.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&u.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&u.uint32(40).int64(e.valid),e.code!=null&&Object.hasOwnProperty.call(e,"code")&&u.uint32(48).int32(e.code),e.desc!=null&&Object.hasOwnProperty.call(e,"desc")&&u.uint32(58).string(e.desc),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&u.uint32(64).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&u.uint32(72).bool(e.compress),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.CommonRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.event=e.string();break}case 2:{A.data=e.bytes();break}case 3:{A.sn=e.int64();break}case 4:{A.time=e.int64();break}case 5:{A.valid=e.int64();break}case 6:{A.code=e.int32();break}case 7:{A.desc=e.string();break}case 8:{A.version=e.int32();break}case 9:{A.compress=e.bool();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){return typeof e!="object"||e===null?"object expected":e.event!=null&&e.hasOwnProperty("event")&&!$util.isString(e.event)?"event: string expected":e.data!=null&&e.hasOwnProperty("data")&&!(e.data&&typeof e.data.length=="number"||$util.isString(e.data))?"data: buffer expected":e.sn!=null&&e.hasOwnProperty("sn")&&!$util.isInteger(e.sn)&&!(e.sn&&$util.isInteger(e.sn.low)&&$util.isInteger(e.sn.high))?"sn: integer|Long expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":e.valid!=null&&e.hasOwnProperty("valid")&&!$util.isInteger(e.valid)&&!(e.valid&&$util.isInteger(e.valid.low)&&$util.isInteger(e.valid.high))?"valid: integer|Long expected":e.code!=null&&e.hasOwnProperty("code")&&!$util.isInteger(e.code)?"code: integer expected":e.desc!=null&&e.hasOwnProperty("desc")&&!$util.isString(e.desc)?"desc: string expected":e.version!=null&&e.hasOwnProperty("version")&&!$util.isInteger(e.version)?"version: integer expected":e.compress!=null&&e.hasOwnProperty("compress")&&typeof e.compress!="boolean"?"compress: boolean expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CommonRsp)return e;let u=new $root.com.quick.voice.proto.CommonRsp;return e.event!=null&&(u.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,u.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(u.data=e.data)),e.sn!=null&&($util.Long?(u.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?u.sn=parseInt(e.sn,10):typeof e.sn=="number"?u.sn=e.sn:typeof e.sn=="object"&&(u.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(u.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?u.time=parseInt(e.time,10):typeof e.time=="number"?u.time=e.time:typeof e.time=="object"&&(u.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(u.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?u.valid=parseInt(e.valid,10):typeof e.valid=="number"?u.valid=e.valid:typeof e.valid=="object"&&(u.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.code!=null&&(u.code=e.code|0),e.desc!=null&&(u.desc=String(e.desc)),e.version!=null&&(u.version=e.version|0),e.compress!=null&&(u.compress=!!e.compress),u},$.toObject=function(e,u){u||(u={});let N={};if(u.defaults){if(N.event="",u.bytes===String?N.data="":(N.data=[],u.bytes!==Array&&(N.data=$util.newBuffer(N.data))),$util.Long){let A=new $util.Long(0,0,!1);N.sn=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.sn=u.longs===String?"0":0;if($util.Long){let A=new $util.Long(0,0,!1);N.time=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.time=u.longs===String?"0":0;if($util.Long){let A=new $util.Long(0,0,!1);N.valid=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.valid=u.longs===String?"0":0;N.code=0,N.desc="",N.version=0,N.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(N.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(N.data=u.bytes===String?$util.base64.encode(e.data,0,e.data.length):u.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?N.sn=u.longs===String?String(e.sn):e.sn:N.sn=u.longs===String?$util.Long.prototype.toString.call(e.sn):u.longs===Number?new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber():e.sn),e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?N.time=u.longs===String?String(e.time):e.time:N.time=u.longs===String?$util.Long.prototype.toString.call(e.time):u.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),e.valid!=null&&e.hasOwnProperty("valid")&&(typeof e.valid=="number"?N.valid=u.longs===String?String(e.valid):e.valid:N.valid=u.longs===String?$util.Long.prototype.toString.call(e.valid):u.longs===Number?new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber():e.valid),e.code!=null&&e.hasOwnProperty("code")&&(N.code=e.code),e.desc!=null&&e.hasOwnProperty("desc")&&(N.desc=e.desc),e.version!=null&&e.hasOwnProperty("version")&&(N.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(N.compress=e.compress),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CommonRsp"},$}(),D.User=function(){function $(e){if(this.tracks=[],e)for(let u=Object.keys(e),N=0;N<u.length;++N)e[u[N]]!=null&&(this[u[N]]=e[u[N]])}$.prototype.id="",$.prototype.callAction=null,$.prototype.callState=null,$.prototype.joinTime=null,$.prototype.tracks=$util.emptyArray,$.prototype.permissions=null,$.prototype.isPublished=null,$.prototype.behavior=null;let I;return Object.defineProperty($.prototype,"_callAction",{get:$util.oneOfGetter(I=["callAction"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_callState",{get:$util.oneOfGetter(I=["callState"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_joinTime",{get:$util.oneOfGetter(I=["joinTime"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_permissions",{get:$util.oneOfGetter(I=["permissions"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_isPublished",{get:$util.oneOfGetter(I=["isPublished"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_behavior",{get:$util.oneOfGetter(I=["behavior"]),set:$util.oneOfSetter(I)}),$.create=function(u){return new $(u)},$.encode=function(u,N){if(N||(N=$Writer.create()),u.id!=null&&Object.hasOwnProperty.call(u,"id")&&N.uint32(10).string(u.id),u.callAction!=null&&Object.hasOwnProperty.call(u,"callAction")&&N.uint32(16).int32(u.callAction),u.callState!=null&&Object.hasOwnProperty.call(u,"callState")&&N.uint32(24).int32(u.callState),u.joinTime!=null&&Object.hasOwnProperty.call(u,"joinTime")&&N.uint32(32).int64(u.joinTime),u.tracks!=null&&u.tracks.length)for(let A=0;A<u.tracks.length;++A)$root.com.quick.voice.proto.Track.encode(u.tracks[A],N.uint32(42).fork()).ldelim();return u.permissions!=null&&Object.hasOwnProperty.call(u,"permissions")&&N.uint32(48).int32(u.permissions),u.isPublished!=null&&Object.hasOwnProperty.call(u,"isPublished")&&N.uint32(56).bool(u.isPublished),u.behavior!=null&&Object.hasOwnProperty.call(u,"behavior")&&N.uint32(64).int32(u.behavior),N},$.encodeDelimited=function(u,N){return this.encode(u,N).ldelim()},$.decode=function(u,N){u instanceof $Reader||(u=$Reader.create(u));let A=N===void 0?u.len:u.pos+N,U=new $root.com.quick.voice.proto.User;for(;u.pos<A;){let L=u.uint32();switch(L>>>3){case 1:{U.id=u.string();break}case 2:{U.callAction=u.int32();break}case 3:{U.callState=u.int32();break}case 4:{U.joinTime=u.int64();break}case 5:{U.tracks&&U.tracks.length||(U.tracks=[]),U.tracks.push($root.com.quick.voice.proto.Track.decode(u,u.uint32()));break}case 6:{U.permissions=u.int32();break}case 7:{U.isPublished=u.bool();break}case 8:{U.behavior=u.int32();break}default:u.skipType(L&7);break}}return U},$.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},$.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.id!=null&&u.hasOwnProperty("id")&&!$util.isString(u.id))return"id: string expected";if(u.callAction!=null&&u.hasOwnProperty("callAction")&&!$util.isInteger(u.callAction))return"callAction: integer expected";if(u.callState!=null&&u.hasOwnProperty("callState")&&!$util.isInteger(u.callState))return"callState: integer expected";if(u.joinTime!=null&&u.hasOwnProperty("joinTime")&&!$util.isInteger(u.joinTime)&&!(u.joinTime&&$util.isInteger(u.joinTime.low)&&$util.isInteger(u.joinTime.high)))return"joinTime: integer|Long expected";if(u.tracks!=null&&u.hasOwnProperty("tracks")){if(!Array.isArray(u.tracks))return"tracks: array expected";for(let N=0;N<u.tracks.length;++N){let A=$root.com.quick.voice.proto.Track.verify(u.tracks[N]);if(A)return"tracks."+A}}return u.permissions!=null&&u.hasOwnProperty("permissions")&&!$util.isInteger(u.permissions)?"permissions: integer expected":u.isPublished!=null&&u.hasOwnProperty("isPublished")&&typeof u.isPublished!="boolean"?"isPublished: boolean expected":u.behavior!=null&&u.hasOwnProperty("behavior")&&!$util.isInteger(u.behavior)?"behavior: integer expected":null},$.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.User)return u;let N=new $root.com.quick.voice.proto.User;if(u.id!=null&&(N.id=String(u.id)),u.callAction!=null&&(N.callAction=u.callAction|0),u.callState!=null&&(N.callState=u.callState|0),u.joinTime!=null&&($util.Long?(N.joinTime=$util.Long.fromValue(u.joinTime)).unsigned=!1:typeof u.joinTime=="string"?N.joinTime=parseInt(u.joinTime,10):typeof u.joinTime=="number"?N.joinTime=u.joinTime:typeof u.joinTime=="object"&&(N.joinTime=new $util.LongBits(u.joinTime.low>>>0,u.joinTime.high>>>0).toNumber())),u.tracks){if(!Array.isArray(u.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");N.tracks=[];for(let A=0;A<u.tracks.length;++A){if(typeof u.tracks[A]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");N.tracks[A]=$root.com.quick.voice.proto.Track.fromObject(u.tracks[A])}}return u.permissions!=null&&(N.permissions=u.permissions|0),u.isPublished!=null&&(N.isPublished=!!u.isPublished),u.behavior!=null&&(N.behavior=u.behavior|0),N},$.toObject=function(u,N){N||(N={});let A={};if((N.arrays||N.defaults)&&(A.tracks=[]),N.defaults&&(A.id=""),u.id!=null&&u.hasOwnProperty("id")&&(A.id=u.id),u.callAction!=null&&u.hasOwnProperty("callAction")&&(A.callAction=u.callAction,N.oneofs&&(A._callAction="callAction")),u.callState!=null&&u.hasOwnProperty("callState")&&(A.callState=u.callState,N.oneofs&&(A._callState="callState")),u.joinTime!=null&&u.hasOwnProperty("joinTime")&&(typeof u.joinTime=="number"?A.joinTime=N.longs===String?String(u.joinTime):u.joinTime:A.joinTime=N.longs===String?$util.Long.prototype.toString.call(u.joinTime):N.longs===Number?new $util.LongBits(u.joinTime.low>>>0,u.joinTime.high>>>0).toNumber():u.joinTime,N.oneofs&&(A._joinTime="joinTime")),u.tracks&&u.tracks.length){A.tracks=[];for(let U=0;U<u.tracks.length;++U)A.tracks[U]=$root.com.quick.voice.proto.Track.toObject(u.tracks[U],N)}return u.permissions!=null&&u.hasOwnProperty("permissions")&&(A.permissions=u.permissions,N.oneofs&&(A._permissions="permissions")),u.isPublished!=null&&u.hasOwnProperty("isPublished")&&(A.isPublished=u.isPublished,N.oneofs&&(A._isPublished="isPublished")),u.behavior!=null&&u.hasOwnProperty("behavior")&&(A.behavior=u.behavior,N.oneofs&&(A._behavior="behavior")),A},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.User"},$}(),D.Login=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.appid="",$.prototype.userId="",$.prototype.sdkToken="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.appid!=null&&Object.hasOwnProperty.call(e,"appid")&&u.uint32(10).string(e.appid),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&u.uint32(18).string(e.userId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&u.uint32(26).string(e.sdkToken),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.Login;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.appid=e.string();break}case 2:{A.userId=e.string();break}case 3:{A.sdkToken=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){return typeof e!="object"||e===null?"object expected":e.appid!=null&&e.hasOwnProperty("appid")&&!$util.isString(e.appid)?"appid: string expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&!$util.isString(e.sdkToken)?"sdkToken: string expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.Login)return e;let u=new $root.com.quick.voice.proto.Login;return e.appid!=null&&(u.appid=String(e.appid)),e.userId!=null&&(u.userId=String(e.userId)),e.sdkToken!=null&&(u.sdkToken=String(e.sdkToken)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.appid="",N.userId="",N.sdkToken=""),e.appid!=null&&e.hasOwnProperty("appid")&&(N.appid=e.appid),e.userId!=null&&e.hasOwnProperty("userId")&&(N.userId=e.userId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(N.sdkToken=e.sdkToken),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.Login"},$}(),D.Track=function(){function $(e){if(e)for(let u=Object.keys(e),N=0;N<u.length;++N)e[u[N]]!=null&&(this[u[N]]=e[u[N]])}$.prototype.mid="",$.prototype.trackName=null,$.prototype.location=null,$.prototype.userId=null,$.prototype.code=null,$.prototype.desc=null,$.prototype.type=null,$.prototype.isValid=null;let I;return Object.defineProperty($.prototype,"_trackName",{get:$util.oneOfGetter(I=["trackName"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_location",{get:$util.oneOfGetter(I=["location"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_userId",{get:$util.oneOfGetter(I=["userId"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_code",{get:$util.oneOfGetter(I=["code"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_desc",{get:$util.oneOfGetter(I=["desc"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_type",{get:$util.oneOfGetter(I=["type"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_isValid",{get:$util.oneOfGetter(I=["isValid"]),set:$util.oneOfSetter(I)}),$.create=function(u){return new $(u)},$.encode=function(u,N){return N||(N=$Writer.create()),u.mid!=null&&Object.hasOwnProperty.call(u,"mid")&&N.uint32(10).string(u.mid),u.trackName!=null&&Object.hasOwnProperty.call(u,"trackName")&&N.uint32(18).string(u.trackName),u.location!=null&&Object.hasOwnProperty.call(u,"location")&&N.uint32(26).string(u.location),u.userId!=null&&Object.hasOwnProperty.call(u,"userId")&&N.uint32(34).string(u.userId),u.code!=null&&Object.hasOwnProperty.call(u,"code")&&N.uint32(40).int32(u.code),u.desc!=null&&Object.hasOwnProperty.call(u,"desc")&&N.uint32(50).string(u.desc),u.type!=null&&Object.hasOwnProperty.call(u,"type")&&N.uint32(56).int32(u.type),u.isValid!=null&&Object.hasOwnProperty.call(u,"isValid")&&N.uint32(64).bool(u.isValid),N},$.encodeDelimited=function(u,N){return this.encode(u,N).ldelim()},$.decode=function(u,N){u instanceof $Reader||(u=$Reader.create(u));let A=N===void 0?u.len:u.pos+N,U=new $root.com.quick.voice.proto.Track;for(;u.pos<A;){let L=u.uint32();switch(L>>>3){case 1:{U.mid=u.string();break}case 2:{U.trackName=u.string();break}case 3:{U.location=u.string();break}case 4:{U.userId=u.string();break}case 5:{U.code=u.int32();break}case 6:{U.desc=u.string();break}case 7:{U.type=u.int32();break}case 8:{U.isValid=u.bool();break}default:u.skipType(L&7);break}}return U},$.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},$.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.mid!=null&&u.hasOwnProperty("mid")&&!$util.isString(u.mid))return"mid: string expected";if(u.trackName!=null&&u.hasOwnProperty("trackName")&&!$util.isString(u.trackName))return"trackName: string expected";if(u.location!=null&&u.hasOwnProperty("location")&&!$util.isString(u.location))return"location: string expected";if(u.userId!=null&&u.hasOwnProperty("userId")&&!$util.isString(u.userId))return"userId: string expected";if(u.code!=null&&u.hasOwnProperty("code")&&!$util.isInteger(u.code))return"code: integer expected";if(u.desc!=null&&u.hasOwnProperty("desc")&&!$util.isString(u.desc))return"desc: string expected";if(u.type!=null&&u.hasOwnProperty("type"))switch(u.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return u.isValid!=null&&u.hasOwnProperty("isValid")&&typeof u.isValid!="boolean"?"isValid: boolean expected":null},$.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.Track)return u;let N=new $root.com.quick.voice.proto.Track;switch(u.mid!=null&&(N.mid=String(u.mid)),u.trackName!=null&&(N.trackName=String(u.trackName)),u.location!=null&&(N.location=String(u.location)),u.userId!=null&&(N.userId=String(u.userId)),u.code!=null&&(N.code=u.code|0),u.desc!=null&&(N.desc=String(u.desc)),u.type){default:if(typeof u.type=="number"){N.type=u.type;break}break;case"Microphone":case 0:N.type=0;break;case"Camera":case 1:N.type=1;break;case"Screen":case 2:N.type=2;break;case"SystemVoice":case 3:N.type=3;break}return u.isValid!=null&&(N.isValid=!!u.isValid),N},$.toObject=function(u,N){N||(N={});let A={};return N.defaults&&(A.mid=""),u.mid!=null&&u.hasOwnProperty("mid")&&(A.mid=u.mid),u.trackName!=null&&u.hasOwnProperty("trackName")&&(A.trackName=u.trackName,N.oneofs&&(A._trackName="trackName")),u.location!=null&&u.hasOwnProperty("location")&&(A.location=u.location,N.oneofs&&(A._location="location")),u.userId!=null&&u.hasOwnProperty("userId")&&(A.userId=u.userId,N.oneofs&&(A._userId="userId")),u.code!=null&&u.hasOwnProperty("code")&&(A.code=u.code,N.oneofs&&(A._code="code")),u.desc!=null&&u.hasOwnProperty("desc")&&(A.desc=u.desc,N.oneofs&&(A._desc="desc")),u.type!=null&&u.hasOwnProperty("type")&&(A.type=N.enums===String?$root.com.quick.voice.proto.TrackType[u.type]===void 0?u.type:$root.com.quick.voice.proto.TrackType[u.type]:u.type,N.oneofs&&(A._type="type")),u.isValid!=null&&u.hasOwnProperty("isValid")&&(A.isValid=u.isValid,N.oneofs&&(A._isValid="isValid")),A},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.Track"},$}(),D.JoinReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.user=null,$.prototype.callType=0,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(18).fork()).ldelim(),e.callType!=null&&Object.hasOwnProperty.call(e,"callType")&&u.uint32(24).int32(e.callType),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.JoinReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}case 3:{A.callType=e.int32();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}if(e.callType!=null&&e.hasOwnProperty("callType"))switch(e.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinReq)return e;let u=new $root.com.quick.voice.proto.JoinReq;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}switch(e.callType){default:if(typeof e.callType=="number"){u.callType=e.callType;break}break;case"Normal":case 0:u.callType=0;break;case"Meeting":case 1:u.callType=1;break;case"Live":case 2:u.callType=2;break}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.user=null,N.callType=u.enums===String?"Normal":0),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),e.callType!=null&&e.hasOwnProperty("callType")&&(N.callType=u.enums===String?$root.com.quick.voice.proto.CallType[e.callType]===void 0?e.callType:$root.com.quick.voice.proto.CallType[e.callType]:e.callType),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinReq"},$}(),D.JoinRsp=function(){function $(I){if(this.roomUsers=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.roomUsers=$util.emptyArray,$.prototype.callType=0,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.roomUsers!=null&&e.roomUsers.length)for(let N=0;N<e.roomUsers.length;++N)$root.com.quick.voice.proto.User.encode(e.roomUsers[N],u.uint32(18).fork()).ldelim();return e.callType!=null&&Object.hasOwnProperty.call(e,"callType")&&u.uint32(24).int32(e.callType),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.JoinRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.roomUsers&&A.roomUsers.length||(A.roomUsers=[]),A.roomUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 3:{A.callType=e.int32();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.roomUsers!=null&&e.hasOwnProperty("roomUsers")){if(!Array.isArray(e.roomUsers))return"roomUsers: array expected";for(let u=0;u<e.roomUsers.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.roomUsers[u]);if(N)return"roomUsers."+N}}if(e.callType!=null&&e.hasOwnProperty("callType"))switch(e.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinRsp)return e;let u=new $root.com.quick.voice.proto.JoinRsp;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.roomUsers){if(!Array.isArray(e.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");u.roomUsers=[];for(let N=0;N<e.roomUsers.length;++N){if(typeof e.roomUsers[N]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");u.roomUsers[N]=$root.com.quick.voice.proto.User.fromObject(e.roomUsers[N])}}switch(e.callType){default:if(typeof e.callType=="number"){u.callType=e.callType;break}break;case"Normal":case 0:u.callType=0;break;case"Meeting":case 1:u.callType=1;break;case"Live":case 2:u.callType=2;break}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.roomUsers=[]),u.defaults&&(N.roomId="",N.callType=u.enums===String?"Normal":0),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.roomUsers&&e.roomUsers.length){N.roomUsers=[];for(let A=0;A<e.roomUsers.length;++A)N.roomUsers[A]=$root.com.quick.voice.proto.User.toObject(e.roomUsers[A],u)}return e.callType!=null&&e.hasOwnProperty("callType")&&(N.callType=u.enums===String?$root.com.quick.voice.proto.CallType[e.callType]===void 0?e.callType:$root.com.quick.voice.proto.CallType[e.callType]:e.callType),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinRsp"},$}(),D.JoinNotify=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.user=null,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(18).fork()).ldelim(),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.JoinNotify;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinNotify)return e;let u=new $root.com.quick.voice.proto.JoinNotify;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinNotify"},$}(),D.ConnectCFReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.sdp="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&u.uint32(10).string(e.sdp),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.ConnectCFReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.sdp=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){return typeof e!="object"||e===null?"object expected":e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp)?"sdp: string expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ConnectCFReq)return e;let u=new $root.com.quick.voice.proto.ConnectCFReq;return e.sdp!=null&&(u.sdp=String(e.sdp)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.sdp=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(N.sdp=e.sdp),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ConnectCFReq"},$}(),D.ConnectCFRsp=function(){function $(I){if(this.subscribeUsers=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.remoteSdp="",$.prototype.subscribeUsers=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&u.uint32(10).string(e.remoteSdp),e.subscribeUsers!=null&&e.subscribeUsers.length)for(let N=0;N<e.subscribeUsers.length;++N)$root.com.quick.voice.proto.User.encode(e.subscribeUsers[N],u.uint32(18).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.ConnectCFRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.remoteSdp=e.string();break}case 2:{A.subscribeUsers&&A.subscribeUsers.length||(A.subscribeUsers=[]),A.subscribeUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&!$util.isString(e.remoteSdp))return"remoteSdp: string expected";if(e.subscribeUsers!=null&&e.hasOwnProperty("subscribeUsers")){if(!Array.isArray(e.subscribeUsers))return"subscribeUsers: array expected";for(let u=0;u<e.subscribeUsers.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.subscribeUsers[u]);if(N)return"subscribeUsers."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ConnectCFRsp)return e;let u=new $root.com.quick.voice.proto.ConnectCFRsp;if(e.remoteSdp!=null&&(u.remoteSdp=String(e.remoteSdp)),e.subscribeUsers){if(!Array.isArray(e.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");u.subscribeUsers=[];for(let N=0;N<e.subscribeUsers.length;++N){if(typeof e.subscribeUsers[N]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");u.subscribeUsers[N]=$root.com.quick.voice.proto.User.fromObject(e.subscribeUsers[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.subscribeUsers=[]),u.defaults&&(N.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(N.remoteSdp=e.remoteSdp),e.subscribeUsers&&e.subscribeUsers.length){N.subscribeUsers=[];for(let A=0;A<e.subscribeUsers.length;++A)N.subscribeUsers[A]=$root.com.quick.voice.proto.User.toObject(e.subscribeUsers[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ConnectCFRsp"},$}(),D.PublishReq=function(){function $(e){if(this.tracks=[],e)for(let u=Object.keys(e),N=0;N<u.length;++N)e[u[N]]!=null&&(this[u[N]]=e[u[N]])}$.prototype.sdp="",$.prototype.tracks=$util.emptyArray,$.prototype.callAction=0,$.prototype.recreate=null;let I;return Object.defineProperty($.prototype,"_recreate",{get:$util.oneOfGetter(I=["recreate"]),set:$util.oneOfSetter(I)}),$.create=function(u){return new $(u)},$.encode=function(u,N){if(N||(N=$Writer.create()),u.sdp!=null&&Object.hasOwnProperty.call(u,"sdp")&&N.uint32(10).string(u.sdp),u.tracks!=null&&u.tracks.length)for(let A=0;A<u.tracks.length;++A)$root.com.quick.voice.proto.Track.encode(u.tracks[A],N.uint32(18).fork()).ldelim();return u.callAction!=null&&Object.hasOwnProperty.call(u,"callAction")&&N.uint32(24).int32(u.callAction),u.recreate!=null&&Object.hasOwnProperty.call(u,"recreate")&&N.uint32(32).bool(u.recreate),N},$.encodeDelimited=function(u,N){return this.encode(u,N).ldelim()},$.decode=function(u,N){u instanceof $Reader||(u=$Reader.create(u));let A=N===void 0?u.len:u.pos+N,U=new $root.com.quick.voice.proto.PublishReq;for(;u.pos<A;){let L=u.uint32();switch(L>>>3){case 1:{U.sdp=u.string();break}case 2:{U.tracks&&U.tracks.length||(U.tracks=[]),U.tracks.push($root.com.quick.voice.proto.Track.decode(u,u.uint32()));break}case 3:{U.callAction=u.int32();break}case 4:{U.recreate=u.bool();break}default:u.skipType(L&7);break}}return U},$.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},$.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.sdp!=null&&u.hasOwnProperty("sdp")&&!$util.isString(u.sdp))return"sdp: string expected";if(u.tracks!=null&&u.hasOwnProperty("tracks")){if(!Array.isArray(u.tracks))return"tracks: array expected";for(let N=0;N<u.tracks.length;++N){let A=$root.com.quick.voice.proto.Track.verify(u.tracks[N]);if(A)return"tracks."+A}}return u.callAction!=null&&u.hasOwnProperty("callAction")&&!$util.isInteger(u.callAction)?"callAction: integer expected":u.recreate!=null&&u.hasOwnProperty("recreate")&&typeof u.recreate!="boolean"?"recreate: boolean expected":null},$.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.PublishReq)return u;let N=new $root.com.quick.voice.proto.PublishReq;if(u.sdp!=null&&(N.sdp=String(u.sdp)),u.tracks){if(!Array.isArray(u.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");N.tracks=[];for(let A=0;A<u.tracks.length;++A){if(typeof u.tracks[A]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");N.tracks[A]=$root.com.quick.voice.proto.Track.fromObject(u.tracks[A])}}return u.callAction!=null&&(N.callAction=u.callAction|0),u.recreate!=null&&(N.recreate=!!u.recreate),N},$.toObject=function(u,N){N||(N={});let A={};if((N.arrays||N.defaults)&&(A.tracks=[]),N.defaults&&(A.sdp="",A.callAction=0),u.sdp!=null&&u.hasOwnProperty("sdp")&&(A.sdp=u.sdp),u.tracks&&u.tracks.length){A.tracks=[];for(let U=0;U<u.tracks.length;++U)A.tracks[U]=$root.com.quick.voice.proto.Track.toObject(u.tracks[U],N)}return u.callAction!=null&&u.hasOwnProperty("callAction")&&(A.callAction=u.callAction),u.recreate!=null&&u.hasOwnProperty("recreate")&&(A.recreate=u.recreate,N.oneofs&&(A._recreate="recreate")),A},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.PublishReq"},$}(),D.PublishRsp=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.remoteSdp="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&u.uint32(10).string(e.remoteSdp),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.PublishRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.remoteSdp=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){return typeof e!="object"||e===null?"object expected":e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&!$util.isString(e.remoteSdp)?"remoteSdp: string expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PublishRsp)return e;let u=new $root.com.quick.voice.proto.PublishRsp;return e.remoteSdp!=null&&(u.remoteSdp=String(e.remoteSdp)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(N.remoteSdp=e.remoteSdp),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PublishRsp"},$}(),D.PublishNotify=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.user=null,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(18).fork()).ldelim(),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.PublishNotify;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PublishNotify)return e;let u=new $root.com.quick.voice.proto.PublishNotify;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PublishNotify"},$}(),D.SubscribeReq=function(){function $(I){if(this.users=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.users=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.users!=null&&e.users.length)for(let N=0;N<e.users.length;++N)$root.com.quick.voice.proto.User.encode(e.users[N],u.uint32(10).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.SubscribeReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.users&&A.users.length||(A.users=[]),A.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let u=0;u<e.users.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.users[u]);if(N)return"users."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SubscribeReq)return e;let u=new $root.com.quick.voice.proto.SubscribeReq;if(e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");u.users=[];for(let N=0;N<e.users.length;++N){if(typeof e.users[N]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");u.users[N]=$root.com.quick.voice.proto.User.fromObject(e.users[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.users=[]),e.users&&e.users.length){N.users=[];for(let A=0;A<e.users.length;++A)N.users[A]=$root.com.quick.voice.proto.User.toObject(e.users[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SubscribeReq"},$}(),D.SubscribeRsp=function(){function $(I){if(this.users=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.remoteSdp="",$.prototype.users=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&u.uint32(10).string(e.remoteSdp),e.users!=null&&e.users.length)for(let N=0;N<e.users.length;++N)$root.com.quick.voice.proto.User.encode(e.users[N],u.uint32(18).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.SubscribeRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.remoteSdp=e.string();break}case 2:{A.users&&A.users.length||(A.users=[]),A.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&!$util.isString(e.remoteSdp))return"remoteSdp: string expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let u=0;u<e.users.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.users[u]);if(N)return"users."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SubscribeRsp)return e;let u=new $root.com.quick.voice.proto.SubscribeRsp;if(e.remoteSdp!=null&&(u.remoteSdp=String(e.remoteSdp)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");u.users=[];for(let N=0;N<e.users.length;++N){if(typeof e.users[N]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");u.users[N]=$root.com.quick.voice.proto.User.fromObject(e.users[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.users=[]),u.defaults&&(N.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(N.remoteSdp=e.remoteSdp),e.users&&e.users.length){N.users=[];for(let A=0;A<e.users.length;++A)N.users[A]=$root.com.quick.voice.proto.User.toObject(e.users[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SubscribeRsp"},$}(),D.RenegotiateReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.userId="",$.prototype.sdp="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&u.uint32(10).string(e.userId),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&u.uint32(18).string(e.sdp),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.RenegotiateReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.userId=e.string();break}case 2:{A.sdp=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){return typeof e!="object"||e===null?"object expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp)?"sdp: string expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.RenegotiateReq)return e;let u=new $root.com.quick.voice.proto.RenegotiateReq;return e.userId!=null&&(u.userId=String(e.userId)),e.sdp!=null&&(u.sdp=String(e.sdp)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.userId="",N.sdp=""),e.userId!=null&&e.hasOwnProperty("userId")&&(N.userId=e.userId),e.sdp!=null&&e.hasOwnProperty("sdp")&&(N.sdp=e.sdp),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.RenegotiateReq"},$}(),D.QuitReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.userId="",$.prototype.roomId="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&u.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(18).string(e.roomId),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.QuitReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.userId=e.string();break}case 2:{A.roomId=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){return typeof e!="object"||e===null?"object expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.QuitReq)return e;let u=new $root.com.quick.voice.proto.QuitReq;return e.userId!=null&&(u.userId=String(e.userId)),e.roomId!=null&&(u.roomId=String(e.roomId)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.userId="",N.roomId=""),e.userId!=null&&e.hasOwnProperty("userId")&&(N.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.QuitReq"},$}(),D.QuitNotify=function(){function $(e){if(e)for(let u=Object.keys(e),N=0;N<u.length;++N)e[u[N]]!=null&&(this[u[N]]=e[u[N]])}$.prototype.roomId="",$.prototype.user=null,$.prototype.code=null,$.prototype.desc=null;let I;return Object.defineProperty($.prototype,"_code",{get:$util.oneOfGetter(I=["code"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_desc",{get:$util.oneOfGetter(I=["desc"]),set:$util.oneOfSetter(I)}),$.create=function(u){return new $(u)},$.encode=function(u,N){return N||(N=$Writer.create()),u.roomId!=null&&Object.hasOwnProperty.call(u,"roomId")&&N.uint32(10).string(u.roomId),u.user!=null&&Object.hasOwnProperty.call(u,"user")&&$root.com.quick.voice.proto.User.encode(u.user,N.uint32(18).fork()).ldelim(),u.code!=null&&Object.hasOwnProperty.call(u,"code")&&N.uint32(24).int32(u.code),u.desc!=null&&Object.hasOwnProperty.call(u,"desc")&&N.uint32(34).string(u.desc),N},$.encodeDelimited=function(u,N){return this.encode(u,N).ldelim()},$.decode=function(u,N){u instanceof $Reader||(u=$Reader.create(u));let A=N===void 0?u.len:u.pos+N,U=new $root.com.quick.voice.proto.QuitNotify;for(;u.pos<A;){let L=u.uint32();switch(L>>>3){case 1:{U.roomId=u.string();break}case 2:{U.user=$root.com.quick.voice.proto.User.decode(u,u.uint32());break}case 3:{U.code=u.int32();break}case 4:{U.desc=u.string();break}default:u.skipType(L&7);break}}return U},$.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},$.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.roomId!=null&&u.hasOwnProperty("roomId")&&!$util.isString(u.roomId))return"roomId: string expected";if(u.user!=null&&u.hasOwnProperty("user")){let N=$root.com.quick.voice.proto.User.verify(u.user);if(N)return"user."+N}return u.code!=null&&u.hasOwnProperty("code")&&!$util.isInteger(u.code)?"code: integer expected":u.desc!=null&&u.hasOwnProperty("desc")&&!$util.isString(u.desc)?"desc: string expected":null},$.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.QuitNotify)return u;let N=new $root.com.quick.voice.proto.QuitNotify;if(u.roomId!=null&&(N.roomId=String(u.roomId)),u.user!=null){if(typeof u.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");N.user=$root.com.quick.voice.proto.User.fromObject(u.user)}return u.code!=null&&(N.code=u.code|0),u.desc!=null&&(N.desc=String(u.desc)),N},$.toObject=function(u,N){N||(N={});let A={};return N.defaults&&(A.roomId="",A.user=null),u.roomId!=null&&u.hasOwnProperty("roomId")&&(A.roomId=u.roomId),u.user!=null&&u.hasOwnProperty("user")&&(A.user=$root.com.quick.voice.proto.User.toObject(u.user,N)),u.code!=null&&u.hasOwnProperty("code")&&(A.code=u.code,N.oneofs&&(A._code="code")),u.desc!=null&&u.hasOwnProperty("desc")&&(A.desc=u.desc,N.oneofs&&(A._desc="desc")),A},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.QuitNotify"},$}(),D.TokenExpireNotify=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.TokenExpireNotify;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){return typeof e!="object"||e===null?"object expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.TokenExpireNotify)return e;let u=new $root.com.quick.voice.proto.TokenExpireNotify;return e.roomId!=null&&(u.roomId=String(e.roomId)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.TokenExpireNotify"},$}(),D.UpdateTokenReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.sdkToken="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&u.uint32(18).string(e.sdkToken),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.UpdateTokenReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.sdkToken=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){return typeof e!="object"||e===null?"object expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&!$util.isString(e.sdkToken)?"sdkToken: string expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTokenReq)return e;let u=new $root.com.quick.voice.proto.UpdateTokenReq;return e.roomId!=null&&(u.roomId=String(e.roomId)),e.sdkToken!=null&&(u.sdkToken=String(e.sdkToken)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.sdkToken=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(N.sdkToken=e.sdkToken),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTokenReq"},$}(),D.NetQualityChange=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.userId="",$.prototype.roomId="",$.prototype.egress=0,$.prototype.ingress=0,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&u.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(18).string(e.roomId),e.egress!=null&&Object.hasOwnProperty.call(e,"egress")&&u.uint32(24).int32(e.egress),e.ingress!=null&&Object.hasOwnProperty.call(e,"ingress")&&u.uint32(32).int32(e.ingress),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.NetQualityChange;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.userId=e.string();break}case 2:{A.roomId=e.string();break}case 3:{A.egress=e.int32();break}case 4:{A.ingress=e.int32();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){return typeof e!="object"||e===null?"object expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":e.egress!=null&&e.hasOwnProperty("egress")&&!$util.isInteger(e.egress)?"egress: integer expected":e.ingress!=null&&e.hasOwnProperty("ingress")&&!$util.isInteger(e.ingress)?"ingress: integer expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.NetQualityChange)return e;let u=new $root.com.quick.voice.proto.NetQualityChange;return e.userId!=null&&(u.userId=String(e.userId)),e.roomId!=null&&(u.roomId=String(e.roomId)),e.egress!=null&&(u.egress=e.egress|0),e.ingress!=null&&(u.ingress=e.ingress|0),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.userId="",N.roomId="",N.egress=0,N.ingress=0),e.userId!=null&&e.hasOwnProperty("userId")&&(N.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.egress!=null&&e.hasOwnProperty("egress")&&(N.egress=e.egress),e.ingress!=null&&e.hasOwnProperty("ingress")&&(N.ingress=e.ingress),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.NetQualityChange"},$}(),D.NetQualityNotify=function(){function $(I){if(this.qualities=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.qualities=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.qualities!=null&&e.qualities.length)for(let N=0;N<e.qualities.length;++N)$root.com.quick.voice.proto.NetQualityChange.encode(e.qualities[N],u.uint32(10).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.NetQualityNotify;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.qualities&&A.qualities.length||(A.qualities=[]),A.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.qualities!=null&&e.hasOwnProperty("qualities")){if(!Array.isArray(e.qualities))return"qualities: array expected";for(let u=0;u<e.qualities.length;++u){let N=$root.com.quick.voice.proto.NetQualityChange.verify(e.qualities[u]);if(N)return"qualities."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.NetQualityNotify)return e;let u=new $root.com.quick.voice.proto.NetQualityNotify;if(e.qualities){if(!Array.isArray(e.qualities))throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: array expected");u.qualities=[];for(let N=0;N<e.qualities.length;++N){if(typeof e.qualities[N]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");u.qualities[N]=$root.com.quick.voice.proto.NetQualityChange.fromObject(e.qualities[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.qualities=[]),e.qualities&&e.qualities.length){N.qualities=[];for(let A=0;A<e.qualities.length;++A)N.qualities[A]=$root.com.quick.voice.proto.NetQualityChange.toObject(e.qualities[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.NetQualityNotify"},$}(),D.UpdateCall=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.user=null,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(18).fork()).ldelim(),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.UpdateCall;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateCall)return e;let u=new $root.com.quick.voice.proto.UpdateCall;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateCall"},$}(),D.SyncRoomInfoReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.user=null,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(18).fork()).ldelim(),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return e;let u=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SyncRoomInfoReq"},$}(),D.SyncRoomInfoRsp=function(){function $(I){if(this.users=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.isValid=!1,$.prototype.users=$util.emptyArray,$.prototype.isActive=!1,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.isValid!=null&&Object.hasOwnProperty.call(e,"isValid")&&u.uint32(16).bool(e.isValid),e.users!=null&&e.users.length)for(let N=0;N<e.users.length;++N)$root.com.quick.voice.proto.User.encode(e.users[N],u.uint32(26).fork()).ldelim();return e.isActive!=null&&Object.hasOwnProperty.call(e,"isActive")&&u.uint32(32).bool(e.isActive),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.isValid=e.bool();break}case 3:{A.users&&A.users.length||(A.users=[]),A.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 4:{A.isActive=e.bool();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.isValid!=null&&e.hasOwnProperty("isValid")&&typeof e.isValid!="boolean")return"isValid: boolean expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let u=0;u<e.users.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.users[u]);if(N)return"users."+N}}return e.isActive!=null&&e.hasOwnProperty("isActive")&&typeof e.isActive!="boolean"?"isActive: boolean expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return e;let u=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.isValid!=null&&(u.isValid=!!e.isValid),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");u.users=[];for(let N=0;N<e.users.length;++N){if(typeof e.users[N]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");u.users[N]=$root.com.quick.voice.proto.User.fromObject(e.users[N])}}return e.isActive!=null&&(u.isActive=!!e.isActive),u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.users=[]),u.defaults&&(N.roomId="",N.isValid=!1,N.isActive=!1),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.isValid!=null&&e.hasOwnProperty("isValid")&&(N.isValid=e.isValid),e.users&&e.users.length){N.users=[];for(let A=0;A<e.users.length;++A)N.users[A]=$root.com.quick.voice.proto.User.toObject(e.users[A],u)}return e.isActive!=null&&e.hasOwnProperty("isActive")&&(N.isActive=e.isActive),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SyncRoomInfoRsp"},$}(),D.UpdateTime=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&u.uint32(8).int64(e.time),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.UpdateTime;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.time=e.int64();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){return typeof e!="object"||e===null?"object expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTime)return e;let u=new $root.com.quick.voice.proto.UpdateTime;return e.time!=null&&($util.Long?(u.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?u.time=parseInt(e.time,10):typeof e.time=="number"?u.time=e.time:typeof e.time=="object"&&(u.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),u},$.toObject=function(e,u){u||(u={});let N={};if(u.defaults)if($util.Long){let A=new $util.Long(0,0,!1);N.time=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.time=u.longs===String?"0":0;return e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?N.time=u.longs===String?String(e.time):e.time:N.time=u.longs===String?$util.Long.prototype.toString.call(e.time):u.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTime"},$}(),D.CloseTrackReq=function(){function $(I){if(this.tracks=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.sdp="",$.prototype.tracks=$util.emptyArray,$.prototype.roomId="",$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&u.uint32(10).string(e.sdp),e.tracks!=null&&e.tracks.length)for(let N=0;N<e.tracks.length;++N)$root.com.quick.voice.proto.Track.encode(e.tracks[N],u.uint32(18).fork()).ldelim();return e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(26).string(e.roomId),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.CloseTrackReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.sdp=e.string();break}case 2:{A.tracks&&A.tracks.length||(A.tracks=[]),A.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}case 3:{A.roomId=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp))return"sdp: string expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let u=0;u<e.tracks.length;++u){let N=$root.com.quick.voice.proto.Track.verify(e.tracks[u]);if(N)return"tracks."+N}}return e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackReq)return e;let u=new $root.com.quick.voice.proto.CloseTrackReq;if(e.sdp!=null&&(u.sdp=String(e.sdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");u.tracks=[];for(let N=0;N<e.tracks.length;++N){if(typeof e.tracks[N]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");u.tracks[N]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[N])}}return e.roomId!=null&&(u.roomId=String(e.roomId)),u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.tracks=[]),u.defaults&&(N.sdp="",N.roomId=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(N.sdp=e.sdp),e.tracks&&e.tracks.length){N.tracks=[];for(let A=0;A<e.tracks.length;++A)N.tracks[A]=$root.com.quick.voice.proto.Track.toObject(e.tracks[A],u)}return e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackReq"},$}(),D.CloseTrackRsp=function(){function $(I){if(this.tracks=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.remoteSdp="",$.prototype.tracks=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&u.uint32(10).string(e.remoteSdp),e.tracks!=null&&e.tracks.length)for(let N=0;N<e.tracks.length;++N)$root.com.quick.voice.proto.Track.encode(e.tracks[N],u.uint32(18).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.CloseTrackRsp;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.remoteSdp=e.string();break}case 2:{A.tracks&&A.tracks.length||(A.tracks=[]),A.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&!$util.isString(e.remoteSdp))return"remoteSdp: string expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let u=0;u<e.tracks.length;++u){let N=$root.com.quick.voice.proto.Track.verify(e.tracks[u]);if(N)return"tracks."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackRsp)return e;let u=new $root.com.quick.voice.proto.CloseTrackRsp;if(e.remoteSdp!=null&&(u.remoteSdp=String(e.remoteSdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");u.tracks=[];for(let N=0;N<e.tracks.length;++N){if(typeof e.tracks[N]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");u.tracks[N]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.tracks=[]),u.defaults&&(N.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(N.remoteSdp=e.remoteSdp),e.tracks&&e.tracks.length){N.tracks=[];for(let A=0;A<e.tracks.length;++A)N.tracks[A]=$root.com.quick.voice.proto.Track.toObject(e.tracks[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackRsp"},$}(),D.CloseTrackNotify=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.user=null,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(10).fork()).ldelim(),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.CloseTrackNotify;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.user!=null&&e.hasOwnProperty("user")){let u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackNotify)return e;let u=new $root.com.quick.voice.proto.CloseTrackNotify;if(e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.CloseTrackNotify.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.user=null),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackNotify"},$}(),D.ToggleLiveRoomReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.ToggleLiveRoomReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){return typeof e!="object"||e===null?"object expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ToggleLiveRoomReq)return e;let u=new $root.com.quick.voice.proto.ToggleLiveRoomReq;return e.roomId!=null&&(u.roomId=String(e.roomId)),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ToggleLiveRoomReq"},$}(),D.ToggleLiveRoomRsq=function(){function $(I){if(this.roomUsers=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.hash="",$.prototype.roomUsers=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.hash!=null&&Object.hasOwnProperty.call(e,"hash")&&u.uint32(18).string(e.hash),e.roomUsers!=null&&e.roomUsers.length)for(let N=0;N<e.roomUsers.length;++N)$root.com.quick.voice.proto.User.encode(e.roomUsers[N],u.uint32(26).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.hash=e.string();break}case 3:{A.roomUsers&&A.roomUsers.length||(A.roomUsers=[]),A.roomUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.hash!=null&&e.hasOwnProperty("hash")&&!$util.isString(e.hash))return"hash: string expected";if(e.roomUsers!=null&&e.hasOwnProperty("roomUsers")){if(!Array.isArray(e.roomUsers))return"roomUsers: array expected";for(let u=0;u<e.roomUsers.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.roomUsers[u]);if(N)return"roomUsers."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ToggleLiveRoomRsq)return e;let u=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.hash!=null&&(u.hash=String(e.hash)),e.roomUsers){if(!Array.isArray(e.roomUsers))throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: array expected");u.roomUsers=[];for(let N=0;N<e.roomUsers.length;++N){if(typeof e.roomUsers[N]!="object")throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: object expected");u.roomUsers[N]=$root.com.quick.voice.proto.User.fromObject(e.roomUsers[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.roomUsers=[]),u.defaults&&(N.roomId="",N.hash=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.hash!=null&&e.hasOwnProperty("hash")&&(N.hash=e.hash),e.roomUsers&&e.roomUsers.length){N.roomUsers=[];for(let A=0;A<e.roomUsers.length;++A)N.roomUsers[A]=$root.com.quick.voice.proto.User.toObject(e.roomUsers[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ToggleLiveRoomRsq"},$}(),D.TrackType=function(){const $={},I=Object.create($);return I[$[0]="Microphone"]=0,I[$[1]="Camera"]=1,I[$[2]="Screen"]=2,I[$[3]="SystemVoice"]=3,I}(),D.ReportInfoReq=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.actionEvent="",$.prototype.userId="",$.prototype.platform="",$.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,$.prototype.actionData="",$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.actionEvent!=null&&Object.hasOwnProperty.call(e,"actionEvent")&&u.uint32(10).string(e.actionEvent),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&u.uint32(18).string(e.userId),e.platform!=null&&Object.hasOwnProperty.call(e,"platform")&&u.uint32(26).string(e.platform),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&u.uint32(32).int64(e.time),e.actionData!=null&&Object.hasOwnProperty.call(e,"actionData")&&u.uint32(42).string(e.actionData),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.ReportInfoReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.actionEvent=e.string();break}case 2:{A.userId=e.string();break}case 3:{A.platform=e.string();break}case 4:{A.time=e.int64();break}case 5:{A.actionData=e.string();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){return typeof e!="object"||e===null?"object expected":e.actionEvent!=null&&e.hasOwnProperty("actionEvent")&&!$util.isString(e.actionEvent)?"actionEvent: string expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.platform!=null&&e.hasOwnProperty("platform")&&!$util.isString(e.platform)?"platform: string expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":e.actionData!=null&&e.hasOwnProperty("actionData")&&!$util.isString(e.actionData)?"actionData: string expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ReportInfoReq)return e;let u=new $root.com.quick.voice.proto.ReportInfoReq;return e.actionEvent!=null&&(u.actionEvent=String(e.actionEvent)),e.userId!=null&&(u.userId=String(e.userId)),e.platform!=null&&(u.platform=String(e.platform)),e.time!=null&&($util.Long?(u.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?u.time=parseInt(e.time,10):typeof e.time=="number"?u.time=e.time:typeof e.time=="object"&&(u.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.actionData!=null&&(u.actionData=String(e.actionData)),u},$.toObject=function(e,u){u||(u={});let N={};if(u.defaults){if(N.actionEvent="",N.userId="",N.platform="",$util.Long){let A=new $util.Long(0,0,!1);N.time=u.longs===String?A.toString():u.longs===Number?A.toNumber():A}else N.time=u.longs===String?"0":0;N.actionData=""}return e.actionEvent!=null&&e.hasOwnProperty("actionEvent")&&(N.actionEvent=e.actionEvent),e.userId!=null&&e.hasOwnProperty("userId")&&(N.userId=e.userId),e.platform!=null&&e.hasOwnProperty("platform")&&(N.platform=e.platform),e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?N.time=u.longs===String?String(e.time):e.time:N.time=u.longs===String?$util.Long.prototype.toString.call(e.time):u.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),e.actionData!=null&&e.hasOwnProperty("actionData")&&(N.actionData=e.actionData),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ReportInfoReq"},$}(),D.UpdatePermissions=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.user=null,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,u.uint32(18).fork()).ldelim(),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.UpdatePermissions;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let u=$root.com.quick.voice.proto.User.verify(e.user);if(u)return"user."+u}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdatePermissions)return e;let u=new $root.com.quick.voice.proto.UpdatePermissions;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.roomId="",N.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,u)),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdatePermissions"},$}(),D.CallType=function(){const $={},I=Object.create($);return I[$[0]="Normal"]=0,I[$[1]="Meeting"]=1,I[$[2]="Live"]=2,I}(),D.QuitNotifyCode=function(){const $={},I=Object.create($);return I[$[0]="NormalQuit"]=0,I[$[2021]="Timeout"]=2021,I[$[2011]="TokenExpired"]=2011,I[$[2022]="KickOut"]=2022,I[$[2023]="EndPk"]=2023,I[$[2024]="EndLive"]=2024,I}(),D.UserBehavior=function(){function $(I){if(I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.type=0,$.prototype.behavior=!1,$.create=function(e){return new $(e)},$.encode=function(e,u){return u||(u=$Writer.create()),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&u.uint32(8).int32(e.type),e.behavior!=null&&Object.hasOwnProperty.call(e,"behavior")&&u.uint32(16).bool(e.behavior),u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.UserBehavior;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.type=e.int32();break}case 2:{A.behavior=e.bool();break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return e.behavior!=null&&e.hasOwnProperty("behavior")&&typeof e.behavior!="boolean"?"behavior: boolean expected":null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UserBehavior)return e;let u=new $root.com.quick.voice.proto.UserBehavior;switch(e.type){default:if(typeof e.type=="number"){u.type=e.type;break}break;case"Microphone":case 0:u.type=0;break;case"Camera":case 1:u.type=1;break;case"Screen":case 2:u.type=2;break;case"SystemVoice":case 3:u.type=3;break}return e.behavior!=null&&(u.behavior=!!e.behavior),u},$.toObject=function(e,u){u||(u={});let N={};return u.defaults&&(N.type=u.enums===String?"Microphone":0,N.behavior=!1),e.type!=null&&e.hasOwnProperty("type")&&(N.type=u.enums===String?$root.com.quick.voice.proto.TrackType[e.type]===void 0?e.type:$root.com.quick.voice.proto.TrackType[e.type]:e.type),e.behavior!=null&&e.hasOwnProperty("behavior")&&(N.behavior=e.behavior),N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UserBehavior"},$}(),D.PreventUser=function(){function $(I){if(this.behaviors=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.id="",$.prototype.behaviors=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.id!=null&&Object.hasOwnProperty.call(e,"id")&&u.uint32(10).string(e.id),e.behaviors!=null&&e.behaviors.length)for(let N=0;N<e.behaviors.length;++N)$root.com.quick.voice.proto.UserBehavior.encode(e.behaviors[N],u.uint32(18).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.PreventUser;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.id=e.string();break}case 2:{A.behaviors&&A.behaviors.length||(A.behaviors=[]),A.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.id!=null&&e.hasOwnProperty("id")&&!$util.isString(e.id))return"id: string expected";if(e.behaviors!=null&&e.hasOwnProperty("behaviors")){if(!Array.isArray(e.behaviors))return"behaviors: array expected";for(let u=0;u<e.behaviors.length;++u){let N=$root.com.quick.voice.proto.UserBehavior.verify(e.behaviors[u]);if(N)return"behaviors."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUser)return e;let u=new $root.com.quick.voice.proto.PreventUser;if(e.id!=null&&(u.id=String(e.id)),e.behaviors){if(!Array.isArray(e.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");u.behaviors=[];for(let N=0;N<e.behaviors.length;++N){if(typeof e.behaviors[N]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");u.behaviors[N]=$root.com.quick.voice.proto.UserBehavior.fromObject(e.behaviors[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.behaviors=[]),u.defaults&&(N.id=""),e.id!=null&&e.hasOwnProperty("id")&&(N.id=e.id),e.behaviors&&e.behaviors.length){N.behaviors=[];for(let A=0;A<e.behaviors.length;++A)N.behaviors[A]=$root.com.quick.voice.proto.UserBehavior.toObject(e.behaviors[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUser"},$}(),D.PreventUsersBehaviorReq=function(){function $(I){if(this.users=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.users=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let N=0;N<e.users.length;++N)$root.com.quick.voice.proto.PreventUser.encode(e.users[N],u.uint32(18).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.users&&A.users.length||(A.users=[]),A.users.push($root.com.quick.voice.proto.PreventUser.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let u=0;u<e.users.length;++u){let N=$root.com.quick.voice.proto.PreventUser.verify(e.users[u]);if(N)return"users."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return e;let u=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");u.users=[];for(let N=0;N<e.users.length;++N){if(typeof e.users[N]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");u.users[N]=$root.com.quick.voice.proto.PreventUser.fromObject(e.users[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.users=[]),u.defaults&&(N.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.users&&e.users.length){N.users=[];for(let A=0;A<e.users.length;++A)N.users[A]=$root.com.quick.voice.proto.PreventUser.toObject(e.users[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUsersBehaviorReq"},$}(),D.PreventUsersBehaviorNotify=function(){function $(I){if(this.users=[],I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.roomId="",$.prototype.users=$util.emptyArray,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&u.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let N=0;N<e.users.length;++N)$root.com.quick.voice.proto.User.encode(e.users[N],u.uint32(18).fork()).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;e.pos<N;){let U=e.uint32();switch(U>>>3){case 1:{A.roomId=e.string();break}case 2:{A.users&&A.users.length||(A.users=[]),A.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(U&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let u=0;u<e.users.length;++u){let N=$root.com.quick.voice.proto.User.verify(e.users[u]);if(N)return"users."+N}}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return e;let u=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(e.roomId!=null&&(u.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");u.users=[];for(let N=0;N<e.users.length;++N){if(typeof e.users[N]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");u.users[N]=$root.com.quick.voice.proto.User.fromObject(e.users[N])}}return u},$.toObject=function(e,u){u||(u={});let N={};if((u.arrays||u.defaults)&&(N.users=[]),u.defaults&&(N.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.users&&e.users.length){N.users=[];for(let A=0;A<e.users.length;++A)N.users[A]=$root.com.quick.voice.proto.User.toObject(e.users[A],u)}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},$}(),D.AccelerationAreas=function(){const $={},I=Object.create($);return I[$[0]="chinaMainland"]=0,I[$[1]="global"]=1,I[$[2]="overseas"]=2,I}(),D.CountMethods=function(){const $={},I=Object.create($);return I[$[0]="flow"]=0,I[$[1]="minutes"]=1,I}(),D.BaseCDNAddress=function(){function $(I){if(this.urlMap={},I)for(let e=Object.keys(I),u=0;u<e.length;++u)I[e[u]]!=null&&(this[e[u]]=I[e[u]])}return $.prototype.area=0,$.prototype.countType=0,$.prototype.urlMap=$util.emptyObject,$.create=function(e){return new $(e)},$.encode=function(e,u){if(u||(u=$Writer.create()),e.area!=null&&Object.hasOwnProperty.call(e,"area")&&u.uint32(8).int32(e.area),e.countType!=null&&Object.hasOwnProperty.call(e,"countType")&&u.uint32(16).int32(e.countType),e.urlMap!=null&&Object.hasOwnProperty.call(e,"urlMap"))for(let N=Object.keys(e.urlMap),A=0;A<N.length;++A)u.uint32(26).fork().uint32(10).string(N[A]).uint32(18).string(e.urlMap[N[A]]).ldelim();return u},$.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},$.decode=function(e,u){e instanceof $Reader||(e=$Reader.create(e));let N=u===void 0?e.len:e.pos+u,A=new $root.com.quick.voice.proto.BaseCDNAddress,U,L;for(;e.pos<N;){let P=e.uint32();switch(P>>>3){case 1:{A.area=e.int32();break}case 2:{A.countType=e.int32();break}case 3:{A.urlMap===$util.emptyObject&&(A.urlMap={});let Z=e.uint32()+e.pos;for(U="",L="";e.pos<Z;){let F=e.uint32();switch(F>>>3){case 1:U=e.string();break;case 2:L=e.string();break;default:e.skipType(F&7);break}}A.urlMap[U]=L;break}default:e.skipType(P&7);break}}return A},$.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},$.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.area!=null&&e.hasOwnProperty("area"))switch(e.area){default:return"area: enum value expected";case 0:case 1:case 2:break}if(e.countType!=null&&e.hasOwnProperty("countType"))switch(e.countType){default:return"countType: enum value expected";case 0:case 1:break}if(e.urlMap!=null&&e.hasOwnProperty("urlMap")){if(!$util.isObject(e.urlMap))return"urlMap: object expected";let u=Object.keys(e.urlMap);for(let N=0;N<u.length;++N)if(!$util.isString(e.urlMap[u[N]]))return"urlMap: string{k:string} expected"}return null},$.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.BaseCDNAddress)return e;let u=new $root.com.quick.voice.proto.BaseCDNAddress;switch(e.area){default:if(typeof e.area=="number"){u.area=e.area;break}break;case"chinaMainland":case 0:u.area=0;break;case"global":case 1:u.area=1;break;case"overseas":case 2:u.area=2;break}switch(e.countType){default:if(typeof e.countType=="number"){u.countType=e.countType;break}break;case"flow":case 0:u.countType=0;break;case"minutes":case 1:u.countType=1;break}if(e.urlMap){if(typeof e.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");u.urlMap={};for(let N=Object.keys(e.urlMap),A=0;A<N.length;++A)u.urlMap[N[A]]=String(e.urlMap[N[A]])}return u},$.toObject=function(e,u){u||(u={});let N={};(u.objects||u.defaults)&&(N.urlMap={}),u.defaults&&(N.area=u.enums===String?"chinaMainland":0,N.countType=u.enums===String?"flow":0),e.area!=null&&e.hasOwnProperty("area")&&(N.area=u.enums===String?$root.com.quick.voice.proto.AccelerationAreas[e.area]===void 0?e.area:$root.com.quick.voice.proto.AccelerationAreas[e.area]:e.area),e.countType!=null&&e.hasOwnProperty("countType")&&(N.countType=u.enums===String?$root.com.quick.voice.proto.CountMethods[e.countType]===void 0?e.countType:$root.com.quick.voice.proto.CountMethods[e.countType]:e.countType);let A;if(e.urlMap&&(A=Object.keys(e.urlMap)).length){N.urlMap={};for(let U=0;U<A.length;++U)N.urlMap[A[U]]=e.urlMap[A[U]]}return N},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.BaseCDNAddress"},$}(),D.CDNPlayAddressNotify=function(){function $(e){if(this.standLines=[],e)for(let u=Object.keys(e),N=0;N<u.length;++N)e[u[N]]!=null&&(this[u[N]]=e[u[N]])}$.prototype.roomId="",$.prototype.m3u8=null,$.prototype.rtmp=null,$.prototype.flv=null,$.prototype.rtmps=null,$.prototype.mainLine=null,$.prototype.standLines=$util.emptyArray;let I;return Object.defineProperty($.prototype,"_m3u8",{get:$util.oneOfGetter(I=["m3u8"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_rtmp",{get:$util.oneOfGetter(I=["rtmp"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_flv",{get:$util.oneOfGetter(I=["flv"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_rtmps",{get:$util.oneOfGetter(I=["rtmps"]),set:$util.oneOfSetter(I)}),Object.defineProperty($.prototype,"_mainLine",{get:$util.oneOfGetter(I=["mainLine"]),set:$util.oneOfSetter(I)}),$.create=function(u){return new $(u)},$.encode=function(u,N){if(N||(N=$Writer.create()),u.roomId!=null&&Object.hasOwnProperty.call(u,"roomId")&&N.uint32(10).string(u.roomId),u.m3u8!=null&&Object.hasOwnProperty.call(u,"m3u8")&&N.uint32(18).string(u.m3u8),u.rtmp!=null&&Object.hasOwnProperty.call(u,"rtmp")&&N.uint32(26).string(u.rtmp),u.flv!=null&&Object.hasOwnProperty.call(u,"flv")&&N.uint32(34).string(u.flv),u.rtmps!=null&&Object.hasOwnProperty.call(u,"rtmps")&&N.uint32(42).string(u.rtmps),u.mainLine!=null&&Object.hasOwnProperty.call(u,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(u.mainLine,N.uint32(50).fork()).ldelim(),u.standLines!=null&&u.standLines.length)for(let A=0;A<u.standLines.length;++A)$root.com.quick.voice.proto.BaseCDNAddress.encode(u.standLines[A],N.uint32(58).fork()).ldelim();return N},$.encodeDelimited=function(u,N){return this.encode(u,N).ldelim()},$.decode=function(u,N){u instanceof $Reader||(u=$Reader.create(u));let A=N===void 0?u.len:u.pos+N,U=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;u.pos<A;){let L=u.uint32();switch(L>>>3){case 1:{U.roomId=u.string();break}case 2:{U.m3u8=u.string();break}case 3:{U.rtmp=u.string();break}case 4:{U.flv=u.string();break}case 5:{U.rtmps=u.string();break}case 6:{U.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(u,u.uint32());break}case 7:{U.standLines&&U.standLines.length||(U.standLines=[]),U.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(u,u.uint32()));break}default:u.skipType(L&7);break}}return U},$.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},$.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.roomId!=null&&u.hasOwnProperty("roomId")&&!$util.isString(u.roomId))return"roomId: string expected";if(u.m3u8!=null&&u.hasOwnProperty("m3u8")&&!$util.isString(u.m3u8))return"m3u8: string expected";if(u.rtmp!=null&&u.hasOwnProperty("rtmp")&&!$util.isString(u.rtmp))return"rtmp: string expected";if(u.flv!=null&&u.hasOwnProperty("flv")&&!$util.isString(u.flv))return"flv: string expected";if(u.rtmps!=null&&u.hasOwnProperty("rtmps")&&!$util.isString(u.rtmps))return"rtmps: string expected";if(u.mainLine!=null&&u.hasOwnProperty("mainLine")){let N=$root.com.quick.voice.proto.BaseCDNAddress.verify(u.mainLine);if(N)return"mainLine."+N}if(u.standLines!=null&&u.hasOwnProperty("standLines")){if(!Array.isArray(u.standLines))return"standLines: array expected";for(let N=0;N<u.standLines.length;++N){let A=$root.com.quick.voice.proto.BaseCDNAddress.verify(u.standLines[N]);if(A)return"standLines."+A}}return null},$.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return u;let N=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(u.roomId!=null&&(N.roomId=String(u.roomId)),u.m3u8!=null&&(N.m3u8=String(u.m3u8)),u.rtmp!=null&&(N.rtmp=String(u.rtmp)),u.flv!=null&&(N.flv=String(u.flv)),u.rtmps!=null&&(N.rtmps=String(u.rtmps)),u.mainLine!=null){if(typeof u.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");N.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(u.mainLine)}if(u.standLines){if(!Array.isArray(u.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");N.standLines=[];for(let A=0;A<u.standLines.length;++A){if(typeof u.standLines[A]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");N.standLines[A]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(u.standLines[A])}}return N},$.toObject=function(u,N){N||(N={});let A={};if((N.arrays||N.defaults)&&(A.standLines=[]),N.defaults&&(A.roomId=""),u.roomId!=null&&u.hasOwnProperty("roomId")&&(A.roomId=u.roomId),u.m3u8!=null&&u.hasOwnProperty("m3u8")&&(A.m3u8=u.m3u8,N.oneofs&&(A._m3u8="m3u8")),u.rtmp!=null&&u.hasOwnProperty("rtmp")&&(A.rtmp=u.rtmp,N.oneofs&&(A._rtmp="rtmp")),u.flv!=null&&u.hasOwnProperty("flv")&&(A.flv=u.flv,N.oneofs&&(A._flv="flv")),u.rtmps!=null&&u.hasOwnProperty("rtmps")&&(A.rtmps=u.rtmps,N.oneofs&&(A._rtmps="rtmps")),u.mainLine!=null&&u.hasOwnProperty("mainLine")&&(A.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(u.mainLine,N),N.oneofs&&(A._mainLine="mainLine")),u.standLines&&u.standLines.length){A.standLines=[];for(let U=0;U<u.standLines.length;++U)A.standLines[U]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(u.standLines[U],N)}return A},$.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},$.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.CDNPlayAddressNotify"},$}(),D}(),k}(),q}(),_})(),ignoreEvent=["networkQualityChange","onNetQuality"],enum_notifyName={onChangeNetwork:"网络情况变更",healthCheck:"心跳检测",onNetQuality:"网络质量回调",onLogin:"登录回调",onLocalStream:"本地媒体流发生变化",onDevicechange:"媒体设备发生变化",onRoomUser:"房间用户变化",onRoomUsers:"房间所有用户所有变化",onRoomUsersStreams:"房间某些用户媒体流变化",onRoomState:"房间状态变化",onJoinRoom:"加入房间回调",onQuitRoom:"退出房间回调",onPublish:"监听到流发布",onCloseTrack:"关闭轨道",onUpdateCall:"更新通讯状态",onUpdateStreams:"更新媒体流",onUpdatePermissions:"更新推流权限通知",onTokenExpired:"Token已过期",onDestroyRoom:"直播模式房间销毁",destroyRoom:"服务器要求销毁房间",onCDNPlayUrlAdd:"cdn播放地址变化",onDestroy:"SDK销毁"};ut(enum_notifyName);const notifyName_keys=Object.keys(enum_notifyName);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Z_FIXED$1=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN$1=2;function zero$1(_){let q=_.length;for(;--q>=0;)_[q]=0}const STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,BL_CODES$1=19,HEAP_SIZE$1=2*L_CODES$1+1,MAX_BITS$1=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),extra_dbits=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),extra_blbits=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),bl_order=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DIST_CODE_LEN=512,static_ltree=new Array((L_CODES$1+2)*2);zero$1(static_ltree);const static_dtree=new Array(D_CODES$1*2);zero$1(static_dtree);const _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);const _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);const base_length=new Array(LENGTH_CODES$1);zero$1(base_length);const base_dist=new Array(D_CODES$1);zero$1(base_dist);function StaticTreeDesc(_,q,k,D,$){this.static_tree=_,this.extra_bits=q,this.extra_base=k,this.elems=D,this.max_length=$,this.has_stree=_&&_.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(_,q){this.dyn_tree=_,this.max_code=0,this.stat_desc=q}const d_code=_=>_<256?_dist_code[_]:_dist_code[256+(_>>>7)],put_short=(_,q)=>{_.pending_buf[_.pending++]=q&255,_.pending_buf[_.pending++]=q>>>8&255},send_bits=(_,q,k)=>{_.bi_valid>Buf_size-k?(_.bi_buf|=q<<_.bi_valid&65535,put_short(_,_.bi_buf),_.bi_buf=q>>Buf_size-_.bi_valid,_.bi_valid+=k-Buf_size):(_.bi_buf|=q<<_.bi_valid&65535,_.bi_valid+=k)},send_code=(_,q,k)=>{send_bits(_,k[q*2],k[q*2+1])},bi_reverse=(_,q)=>{let k=0;do k|=_&1,_>>>=1,k<<=1;while(--q>0);return k>>>1},bi_flush=_=>{_.bi_valid===16?(put_short(_,_.bi_buf),_.bi_buf=0,_.bi_valid=0):_.bi_valid>=8&&(_.pending_buf[_.pending++]=_.bi_buf&255,_.bi_buf>>=8,_.bi_valid-=8)},gen_bitlen=(_,q)=>{const k=q.dyn_tree,D=q.max_code,$=q.stat_desc.static_tree,I=q.stat_desc.has_stree,e=q.stat_desc.extra_bits,u=q.stat_desc.extra_base,N=q.stat_desc.max_length;let A,U,L,P,Z,F,W=0;for(P=0;P<=MAX_BITS$1;P++)_.bl_count[P]=0;for(k[_.heap[_.heap_max]*2+1]=0,A=_.heap_max+1;A<HEAP_SIZE$1;A++)U=_.heap[A],P=k[k[U*2+1]*2+1]+1,P>N&&(P=N,W++),k[U*2+1]=P,!(U>D)&&(_.bl_count[P]++,Z=0,U>=u&&(Z=e[U-u]),F=k[U*2],_.opt_len+=F*(P+Z),I&&(_.static_len+=F*($[U*2+1]+Z)));if(W!==0){do{for(P=N-1;_.bl_count[P]===0;)P--;_.bl_count[P]--,_.bl_count[P+1]+=2,_.bl_count[N]--,W-=2}while(W>0);for(P=N;P!==0;P--)for(U=_.bl_count[P];U!==0;)L=_.heap[--A],!(L>D)&&(k[L*2+1]!==P&&(_.opt_len+=(P-k[L*2+1])*k[L*2],k[L*2+1]=P),U--)}},gen_codes=(_,q,k)=>{const D=new Array(MAX_BITS$1+1);let $=0,I,e;for(I=1;I<=MAX_BITS$1;I++)$=$+k[I-1]<<1,D[I]=$;for(e=0;e<=q;e++){let u=_[e*2+1];u!==0&&(_[e*2]=bi_reverse(D[u]++,u))}},tr_static_init=()=>{let _,q,k,D,$;const I=new Array(MAX_BITS$1+1);for(k=0,D=0;D<LENGTH_CODES$1-1;D++)for(base_length[D]=k,_=0;_<1<<extra_lbits[D];_++)_length_code[k++]=D;for(_length_code[k-1]=D,$=0,D=0;D<16;D++)for(base_dist[D]=$,_=0;_<1<<extra_dbits[D];_++)_dist_code[$++]=D;for($>>=7;D<D_CODES$1;D++)for(base_dist[D]=$<<7,_=0;_<1<<extra_dbits[D]-7;_++)_dist_code[256+$++]=D;for(q=0;q<=MAX_BITS$1;q++)I[q]=0;for(_=0;_<=143;)static_ltree[_*2+1]=8,_++,I[8]++;for(;_<=255;)static_ltree[_*2+1]=9,_++,I[9]++;for(;_<=279;)static_ltree[_*2+1]=7,_++,I[7]++;for(;_<=287;)static_ltree[_*2+1]=8,_++,I[8]++;for(gen_codes(static_ltree,L_CODES$1+1,I),_=0;_<D_CODES$1;_++)static_dtree[_*2+1]=5,static_dtree[_*2]=bi_reverse(_,5);static_l_desc=new StaticTreeDesc(static_ltree,extra_lbits,LITERALS$1+1,L_CODES$1,MAX_BITS$1),static_d_desc=new StaticTreeDesc(static_dtree,extra_dbits,0,D_CODES$1,MAX_BITS$1),static_bl_desc=new StaticTreeDesc(new Array(0),extra_blbits,0,BL_CODES$1,MAX_BL_BITS)},init_block=_=>{let q;for(q=0;q<L_CODES$1;q++)_.dyn_ltree[q*2]=0;for(q=0;q<D_CODES$1;q++)_.dyn_dtree[q*2]=0;for(q=0;q<BL_CODES$1;q++)_.bl_tree[q*2]=0;_.dyn_ltree[END_BLOCK*2]=1,_.opt_len=_.static_len=0,_.sym_next=_.matches=0},bi_windup=_=>{_.bi_valid>8?put_short(_,_.bi_buf):_.bi_valid>0&&(_.pending_buf[_.pending++]=_.bi_buf),_.bi_buf=0,_.bi_valid=0},smaller=(_,q,k,D)=>{const $=q*2,I=k*2;return _[$]<_[I]||_[$]===_[I]&&D[q]<=D[k]},pqdownheap=(_,q,k)=>{const D=_.heap[k];let $=k<<1;for(;$<=_.heap_len&&($<_.heap_len&&smaller(q,_.heap[$+1],_.heap[$],_.depth)&&$++,!smaller(q,D,_.heap[$],_.depth));)_.heap[k]=_.heap[$],k=$,$<<=1;_.heap[k]=D},compress_block=(_,q,k)=>{let D,$,I=0,e,u;if(_.sym_next!==0)do D=_.pending_buf[_.sym_buf+I++]&255,D+=(_.pending_buf[_.sym_buf+I++]&255)<<8,$=_.pending_buf[_.sym_buf+I++],D===0?send_code(_,$,q):(e=_length_code[$],send_code(_,e+LITERALS$1+1,q),u=extra_lbits[e],u!==0&&($-=base_length[e],send_bits(_,$,u)),D--,e=d_code(D),send_code(_,e,k),u=extra_dbits[e],u!==0&&(D-=base_dist[e],send_bits(_,D,u)));while(I<_.sym_next);send_code(_,END_BLOCK,q)},build_tree=(_,q)=>{const k=q.dyn_tree,D=q.stat_desc.static_tree,$=q.stat_desc.has_stree,I=q.stat_desc.elems;let e,u,N=-1,A;for(_.heap_len=0,_.heap_max=HEAP_SIZE$1,e=0;e<I;e++)k[e*2]!==0?(_.heap[++_.heap_len]=N=e,_.depth[e]=0):k[e*2+1]=0;for(;_.heap_len<2;)A=_.heap[++_.heap_len]=N<2?++N:0,k[A*2]=1,_.depth[A]=0,_.opt_len--,$&&(_.static_len-=D[A*2+1]);for(q.max_code=N,e=_.heap_len>>1;e>=1;e--)pqdownheap(_,k,e);A=I;do e=_.heap[1],_.heap[1]=_.heap[_.heap_len--],pqdownheap(_,k,1),u=_.heap[1],_.heap[--_.heap_max]=e,_.heap[--_.heap_max]=u,k[A*2]=k[e*2]+k[u*2],_.depth[A]=(_.depth[e]>=_.depth[u]?_.depth[e]:_.depth[u])+1,k[e*2+1]=k[u*2+1]=A,_.heap[1]=A++,pqdownheap(_,k,1);while(_.heap_len>=2);_.heap[--_.heap_max]=_.heap[1],gen_bitlen(_,q),gen_codes(k,N,_.bl_count)},scan_tree=(_,q,k)=>{let D,$=-1,I,e=q[0*2+1],u=0,N=7,A=4;for(e===0&&(N=138,A=3),q[(k+1)*2+1]=65535,D=0;D<=k;D++)I=e,e=q[(D+1)*2+1],!(++u<N&&I===e)&&(u<A?_.bl_tree[I*2]+=u:I!==0?(I!==$&&_.bl_tree[I*2]++,_.bl_tree[REP_3_6*2]++):u<=10?_.bl_tree[REPZ_3_10*2]++:_.bl_tree[REPZ_11_138*2]++,u=0,$=I,e===0?(N=138,A=3):I===e?(N=6,A=3):(N=7,A=4))},send_tree=(_,q,k)=>{let D,$=-1,I,e=q[0*2+1],u=0,N=7,A=4;for(e===0&&(N=138,A=3),D=0;D<=k;D++)if(I=e,e=q[(D+1)*2+1],!(++u<N&&I===e)){if(u<A)do send_code(_,I,_.bl_tree);while(--u!==0);else I!==0?(I!==$&&(send_code(_,I,_.bl_tree),u--),send_code(_,REP_3_6,_.bl_tree),send_bits(_,u-3,2)):u<=10?(send_code(_,REPZ_3_10,_.bl_tree),send_bits(_,u-3,3)):(send_code(_,REPZ_11_138,_.bl_tree),send_bits(_,u-11,7));u=0,$=I,e===0?(N=138,A=3):I===e?(N=6,A=3):(N=7,A=4)}},build_bl_tree=_=>{let q;for(scan_tree(_,_.dyn_ltree,_.l_desc.max_code),scan_tree(_,_.dyn_dtree,_.d_desc.max_code),build_tree(_,_.bl_desc),q=BL_CODES$1-1;q>=3&&_.bl_tree[bl_order[q]*2+1]===0;q--);return _.opt_len+=3*(q+1)+5+5+4,q},send_all_trees=(_,q,k,D)=>{let $;for(send_bits(_,q-257,5),send_bits(_,k-1,5),send_bits(_,D-4,4),$=0;$<D;$++)send_bits(_,_.bl_tree[bl_order[$]*2+1],3);send_tree(_,_.dyn_ltree,q-1),send_tree(_,_.dyn_dtree,k-1)},detect_data_type=_=>{let q=4093624447,k;for(k=0;k<=31;k++,q>>>=1)if(q&1&&_.dyn_ltree[k*2]!==0)return Z_BINARY;if(_.dyn_ltree[9*2]!==0||_.dyn_ltree[10*2]!==0||_.dyn_ltree[13*2]!==0)return Z_TEXT;for(k=32;k<LITERALS$1;k++)if(_.dyn_ltree[k*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=_=>{static_init_done||(tr_static_init(),static_init_done=!0),_.l_desc=new TreeDesc(_.dyn_ltree,static_l_desc),_.d_desc=new TreeDesc(_.dyn_dtree,static_d_desc),_.bl_desc=new TreeDesc(_.bl_tree,static_bl_desc),_.bi_buf=0,_.bi_valid=0,init_block(_)},_tr_stored_block$1=(_,q,k,D)=>{send_bits(_,(STORED_BLOCK<<1)+(D?1:0),3),bi_windup(_),put_short(_,k),put_short(_,~k),k&&_.pending_buf.set(_.window.subarray(q,q+k),_.pending),_.pending+=k},_tr_align$1=_=>{send_bits(_,STATIC_TREES<<1,3),send_code(_,END_BLOCK,static_ltree),bi_flush(_)},_tr_flush_block$1=(_,q,k,D)=>{let $,I,e=0;_.level>0?(_.strm.data_type===Z_UNKNOWN$1&&(_.strm.data_type=detect_data_type(_)),build_tree(_,_.l_desc),build_tree(_,_.d_desc),e=build_bl_tree(_),$=_.opt_len+3+7>>>3,I=_.static_len+3+7>>>3,I<=$&&($=I)):$=I=k+5,k+4<=$&&q!==-1?_tr_stored_block$1(_,q,k,D):_.strategy===Z_FIXED$1||I===$?(send_bits(_,(STATIC_TREES<<1)+(D?1:0),3),compress_block(_,static_ltree,static_dtree)):(send_bits(_,(DYN_TREES<<1)+(D?1:0),3),send_all_trees(_,_.l_desc.max_code+1,_.d_desc.max_code+1,e+1),compress_block(_,_.dyn_ltree,_.dyn_dtree)),init_block(_),D&&bi_windup(_)},_tr_tally$1=(_,q,k)=>(_.pending_buf[_.sym_buf+_.sym_next++]=q,_.pending_buf[_.sym_buf+_.sym_next++]=q>>8,_.pending_buf[_.sym_buf+_.sym_next++]=k,q===0?_.dyn_ltree[k*2]++:(_.matches++,q--,_.dyn_ltree[(_length_code[k]+LITERALS$1+1)*2]++,_.dyn_dtree[d_code(q)*2]++),_.sym_next===_.sym_end);var _tr_init_1=_tr_init$1,_tr_stored_block_1=_tr_stored_block$1,_tr_flush_block_1=_tr_flush_block$1,_tr_tally_1=_tr_tally$1,_tr_align_1=_tr_align$1,trees={_tr_init:_tr_init_1,_tr_stored_block:_tr_stored_block_1,_tr_flush_block:_tr_flush_block_1,_tr_tally:_tr_tally_1,_tr_align:_tr_align_1};const adler32=(_,q,k,D)=>{let $=_&65535|0,I=_>>>16&65535|0,e=0;for(;k!==0;){e=k>2e3?2e3:k,k-=e;do $=$+q[D++]|0,I=I+$|0;while(--e);$%=65521,I%=65521}return $|I<<16|0};var adler32_1=adler32;const makeTable=()=>{let _,q=[];for(var k=0;k<256;k++){_=k;for(var D=0;D<8;D++)_=_&1?3988292384^_>>>1:_>>>1;q[k]=_}return q},crcTable=new Uint32Array(makeTable()),crc32=(_,q,k,D)=>{const $=crcTable,I=D+k;_^=-1;for(let e=D;e<I;e++)_=_>>>8^$[(_^q[e])&255];return _^-1};var crc32_1=crc32,messages={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},constants$2={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init,_tr_stored_block,_tr_flush_block,_tr_tally,_tr_align}=trees,{Z_NO_FLUSH:Z_NO_FLUSH$2,Z_PARTIAL_FLUSH,Z_FULL_FLUSH:Z_FULL_FLUSH$1,Z_FINISH:Z_FINISH$3,Z_BLOCK:Z_BLOCK$1,Z_OK:Z_OK$3,Z_STREAM_END:Z_STREAM_END$3,Z_STREAM_ERROR:Z_STREAM_ERROR$2,Z_DATA_ERROR:Z_DATA_ERROR$2,Z_BUF_ERROR:Z_BUF_ERROR$1,Z_DEFAULT_COMPRESSION:Z_DEFAULT_COMPRESSION$1,Z_FILTERED,Z_HUFFMAN_ONLY,Z_RLE,Z_FIXED,Z_DEFAULT_STRATEGY:Z_DEFAULT_STRATEGY$1,Z_UNKNOWN,Z_DEFLATED:Z_DEFLATED$2}=constants$2,MAX_MEM_LEVEL=9,MAX_WBITS$1=15,DEF_MEM_LEVEL=8,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,MIN_MATCH=3,MAX_MATCH=258,MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1,PRESET_DICT=32,INIT_STATE=42,GZIP_STATE=57,EXTRA_STATE=69,NAME_STATE=73,COMMENT_STATE=91,HCRC_STATE=103,BUSY_STATE=113,FINISH_STATE=666,BS_NEED_MORE=1,BS_BLOCK_DONE=2,BS_FINISH_STARTED=3,BS_FINISH_DONE=4,OS_CODE=3,err=(_,q)=>(_.msg=messages[q],q),rank=_=>_*2-(_>4?9:0),zero=_=>{let q=_.length;for(;--q>=0;)_[q]=0},slide_hash=_=>{let q,k,D,$=_.w_size;q=_.hash_size,D=q;do k=_.head[--D],_.head[D]=k>=$?k-$:0;while(--q);q=$,D=q;do k=_.prev[--D],_.prev[D]=k>=$?k-$:0;while(--q)};let HASH_ZLIB=(_,q,k)=>(q<<_.hash_shift^k)&_.hash_mask,HASH=HASH_ZLIB;const flush_pending=_=>{const q=_.state;let k=q.pending;k>_.avail_out&&(k=_.avail_out),k!==0&&(_.output.set(q.pending_buf.subarray(q.pending_out,q.pending_out+k),_.next_out),_.next_out+=k,q.pending_out+=k,_.total_out+=k,_.avail_out-=k,q.pending-=k,q.pending===0&&(q.pending_out=0))},flush_block_only=(_,q)=>{_tr_flush_block(_,_.block_start>=0?_.block_start:-1,_.strstart-_.block_start,q),_.block_start=_.strstart,flush_pending(_.strm)},put_byte=(_,q)=>{_.pending_buf[_.pending++]=q},putShortMSB=(_,q)=>{_.pending_buf[_.pending++]=q>>>8&255,_.pending_buf[_.pending++]=q&255},read_buf=(_,q,k,D)=>{let $=_.avail_in;return $>D&&($=D),$===0?0:(_.avail_in-=$,q.set(_.input.subarray(_.next_in,_.next_in+$),k),_.state.wrap===1?_.adler=adler32_1(_.adler,q,$,k):_.state.wrap===2&&(_.adler=crc32_1(_.adler,q,$,k)),_.next_in+=$,_.total_in+=$,$)},longest_match=(_,q)=>{let k=_.max_chain_length,D=_.strstart,$,I,e=_.prev_length,u=_.nice_match;const N=_.strstart>_.w_size-MIN_LOOKAHEAD?_.strstart-(_.w_size-MIN_LOOKAHEAD):0,A=_.window,U=_.w_mask,L=_.prev,P=_.strstart+MAX_MATCH;let Z=A[D+e-1],F=A[D+e];_.prev_length>=_.good_match&&(k>>=2),u>_.lookahead&&(u=_.lookahead);do if($=q,!(A[$+e]!==F||A[$+e-1]!==Z||A[$]!==A[D]||A[++$]!==A[D+1])){D+=2,$++;do;while(A[++D]===A[++$]&&A[++D]===A[++$]&&A[++D]===A[++$]&&A[++D]===A[++$]&&A[++D]===A[++$]&&A[++D]===A[++$]&&A[++D]===A[++$]&&A[++D]===A[++$]&&D<P);if(I=MAX_MATCH-(P-D),D=P-MAX_MATCH,I>e){if(_.match_start=q,e=I,I>=u)break;Z=A[D+e-1],F=A[D+e]}}while((q=L[q&U])>N&&--k!==0);return e<=_.lookahead?e:_.lookahead},fill_window=_=>{const q=_.w_size;let k,D,$;do{if(D=_.window_size-_.lookahead-_.strstart,_.strstart>=q+(q-MIN_LOOKAHEAD)&&(_.window.set(_.window.subarray(q,q+q-D),0),_.match_start-=q,_.strstart-=q,_.block_start-=q,_.insert>_.strstart&&(_.insert=_.strstart),slide_hash(_),D+=q),_.strm.avail_in===0)break;if(k=read_buf(_.strm,_.window,_.strstart+_.lookahead,D),_.lookahead+=k,_.lookahead+_.insert>=MIN_MATCH)for($=_.strstart-_.insert,_.ins_h=_.window[$],_.ins_h=HASH(_,_.ins_h,_.window[$+1]);_.insert&&(_.ins_h=HASH(_,_.ins_h,_.window[$+MIN_MATCH-1]),_.prev[$&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=$,$++,_.insert--,!(_.lookahead+_.insert<MIN_MATCH)););}while(_.lookahead<MIN_LOOKAHEAD&&_.strm.avail_in!==0)},deflate_stored=(_,q)=>{let k=_.pending_buf_size-5>_.w_size?_.w_size:_.pending_buf_size-5,D,$,I,e=0,u=_.strm.avail_in;do{if(D=65535,I=_.bi_valid+42>>3,_.strm.avail_out<I||(I=_.strm.avail_out-I,$=_.strstart-_.block_start,D>$+_.strm.avail_in&&(D=$+_.strm.avail_in),D>I&&(D=I),D<k&&(D===0&&q!==Z_FINISH$3||q===Z_NO_FLUSH$2||D!==$+_.strm.avail_in)))break;e=q===Z_FINISH$3&&D===$+_.strm.avail_in?1:0,_tr_stored_block(_,0,0,e),_.pending_buf[_.pending-4]=D,_.pending_buf[_.pending-3]=D>>8,_.pending_buf[_.pending-2]=~D,_.pending_buf[_.pending-1]=~D>>8,flush_pending(_.strm),$&&($>D&&($=D),_.strm.output.set(_.window.subarray(_.block_start,_.block_start+$),_.strm.next_out),_.strm.next_out+=$,_.strm.avail_out-=$,_.strm.total_out+=$,_.block_start+=$,D-=$),D&&(read_buf(_.strm,_.strm.output,_.strm.next_out,D),_.strm.next_out+=D,_.strm.avail_out-=D,_.strm.total_out+=D)}while(e===0);return u-=_.strm.avail_in,u&&(u>=_.w_size?(_.matches=2,_.window.set(_.strm.input.subarray(_.strm.next_in-_.w_size,_.strm.next_in),0),_.strstart=_.w_size,_.insert=_.strstart):(_.window_size-_.strstart<=u&&(_.strstart-=_.w_size,_.window.set(_.window.subarray(_.w_size,_.w_size+_.strstart),0),_.matches<2&&_.matches++,_.insert>_.strstart&&(_.insert=_.strstart)),_.window.set(_.strm.input.subarray(_.strm.next_in-u,_.strm.next_in),_.strstart),_.strstart+=u,_.insert+=u>_.w_size-_.insert?_.w_size-_.insert:u),_.block_start=_.strstart),_.high_water<_.strstart&&(_.high_water=_.strstart),e?BS_FINISH_DONE:q!==Z_NO_FLUSH$2&&q!==Z_FINISH$3&&_.strm.avail_in===0&&_.strstart===_.block_start?BS_BLOCK_DONE:(I=_.window_size-_.strstart,_.strm.avail_in>I&&_.block_start>=_.w_size&&(_.block_start-=_.w_size,_.strstart-=_.w_size,_.window.set(_.window.subarray(_.w_size,_.w_size+_.strstart),0),_.matches<2&&_.matches++,I+=_.w_size,_.insert>_.strstart&&(_.insert=_.strstart)),I>_.strm.avail_in&&(I=_.strm.avail_in),I&&(read_buf(_.strm,_.window,_.strstart,I),_.strstart+=I,_.insert+=I>_.w_size-_.insert?_.w_size-_.insert:I),_.high_water<_.strstart&&(_.high_water=_.strstart),I=_.bi_valid+42>>3,I=_.pending_buf_size-I>65535?65535:_.pending_buf_size-I,k=I>_.w_size?_.w_size:I,$=_.strstart-_.block_start,($>=k||($||q===Z_FINISH$3)&&q!==Z_NO_FLUSH$2&&_.strm.avail_in===0&&$<=I)&&(D=$>I?I:$,e=q===Z_FINISH$3&&_.strm.avail_in===0&&D===$?1:0,_tr_stored_block(_,_.block_start,D,e),_.block_start+=D,flush_pending(_.strm)),e?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(_,q)=>{let k,D;for(;;){if(_.lookahead<MIN_LOOKAHEAD){if(fill_window(_),_.lookahead<MIN_LOOKAHEAD&&q===Z_NO_FLUSH$2)return BS_NEED_MORE;if(_.lookahead===0)break}if(k=0,_.lookahead>=MIN_MATCH&&(_.ins_h=HASH(_,_.ins_h,_.window[_.strstart+MIN_MATCH-1]),k=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),k!==0&&_.strstart-k<=_.w_size-MIN_LOOKAHEAD&&(_.match_length=longest_match(_,k)),_.match_length>=MIN_MATCH)if(D=_tr_tally(_,_.strstart-_.match_start,_.match_length-MIN_MATCH),_.lookahead-=_.match_length,_.match_length<=_.max_lazy_match&&_.lookahead>=MIN_MATCH){_.match_length--;do _.strstart++,_.ins_h=HASH(_,_.ins_h,_.window[_.strstart+MIN_MATCH-1]),k=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart;while(--_.match_length!==0);_.strstart++}else _.strstart+=_.match_length,_.match_length=0,_.ins_h=_.window[_.strstart],_.ins_h=HASH(_,_.ins_h,_.window[_.strstart+1]);else D=_tr_tally(_,0,_.window[_.strstart]),_.lookahead--,_.strstart++;if(D&&(flush_block_only(_,!1),_.strm.avail_out===0))return BS_NEED_MORE}return _.insert=_.strstart<MIN_MATCH-1?_.strstart:MIN_MATCH-1,q===Z_FINISH$3?(flush_block_only(_,!0),_.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):_.sym_next&&(flush_block_only(_,!1),_.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(_,q)=>{let k,D,$;for(;;){if(_.lookahead<MIN_LOOKAHEAD){if(fill_window(_),_.lookahead<MIN_LOOKAHEAD&&q===Z_NO_FLUSH$2)return BS_NEED_MORE;if(_.lookahead===0)break}if(k=0,_.lookahead>=MIN_MATCH&&(_.ins_h=HASH(_,_.ins_h,_.window[_.strstart+MIN_MATCH-1]),k=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),_.prev_length=_.match_length,_.prev_match=_.match_start,_.match_length=MIN_MATCH-1,k!==0&&_.prev_length<_.max_lazy_match&&_.strstart-k<=_.w_size-MIN_LOOKAHEAD&&(_.match_length=longest_match(_,k),_.match_length<=5&&(_.strategy===Z_FILTERED||_.match_length===MIN_MATCH&&_.strstart-_.match_start>4096)&&(_.match_length=MIN_MATCH-1)),_.prev_length>=MIN_MATCH&&_.match_length<=_.prev_length){$=_.strstart+_.lookahead-MIN_MATCH,D=_tr_tally(_,_.strstart-1-_.prev_match,_.prev_length-MIN_MATCH),_.lookahead-=_.prev_length-1,_.prev_length-=2;do++_.strstart<=$&&(_.ins_h=HASH(_,_.ins_h,_.window[_.strstart+MIN_MATCH-1]),k=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart);while(--_.prev_length!==0);if(_.match_available=0,_.match_length=MIN_MATCH-1,_.strstart++,D&&(flush_block_only(_,!1),_.strm.avail_out===0))return BS_NEED_MORE}else if(_.match_available){if(D=_tr_tally(_,0,_.window[_.strstart-1]),D&&flush_block_only(_,!1),_.strstart++,_.lookahead--,_.strm.avail_out===0)return BS_NEED_MORE}else _.match_available=1,_.strstart++,_.lookahead--}return _.match_available&&(D=_tr_tally(_,0,_.window[_.strstart-1]),_.match_available=0),_.insert=_.strstart<MIN_MATCH-1?_.strstart:MIN_MATCH-1,q===Z_FINISH$3?(flush_block_only(_,!0),_.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):_.sym_next&&(flush_block_only(_,!1),_.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(_,q)=>{let k,D,$,I;const e=_.window;for(;;){if(_.lookahead<=MAX_MATCH){if(fill_window(_),_.lookahead<=MAX_MATCH&&q===Z_NO_FLUSH$2)return BS_NEED_MORE;if(_.lookahead===0)break}if(_.match_length=0,_.lookahead>=MIN_MATCH&&_.strstart>0&&($=_.strstart-1,D=e[$],D===e[++$]&&D===e[++$]&&D===e[++$])){I=_.strstart+MAX_MATCH;do;while(D===e[++$]&&D===e[++$]&&D===e[++$]&&D===e[++$]&&D===e[++$]&&D===e[++$]&&D===e[++$]&&D===e[++$]&&$<I);_.match_length=MAX_MATCH-(I-$),_.match_length>_.lookahead&&(_.match_length=_.lookahead)}if(_.match_length>=MIN_MATCH?(k=_tr_tally(_,1,_.match_length-MIN_MATCH),_.lookahead-=_.match_length,_.strstart+=_.match_length,_.match_length=0):(k=_tr_tally(_,0,_.window[_.strstart]),_.lookahead--,_.strstart++),k&&(flush_block_only(_,!1),_.strm.avail_out===0))return BS_NEED_MORE}return _.insert=0,q===Z_FINISH$3?(flush_block_only(_,!0),_.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):_.sym_next&&(flush_block_only(_,!1),_.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(_,q)=>{let k;for(;;){if(_.lookahead===0&&(fill_window(_),_.lookahead===0)){if(q===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(_.match_length=0,k=_tr_tally(_,0,_.window[_.strstart]),_.lookahead--,_.strstart++,k&&(flush_block_only(_,!1),_.strm.avail_out===0))return BS_NEED_MORE}return _.insert=0,q===Z_FINISH$3?(flush_block_only(_,!0),_.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):_.sym_next&&(flush_block_only(_,!1),_.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(_,q,k,D,$){this.good_length=_,this.max_lazy=q,this.nice_length=k,this.max_chain=D,this.func=$}const configuration_table=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)],lm_init=_=>{_.window_size=2*_.w_size,zero(_.head),_.max_lazy_match=configuration_table[_.level].max_lazy,_.good_match=configuration_table[_.level].good_length,_.nice_match=configuration_table[_.level].nice_length,_.max_chain_length=configuration_table[_.level].max_chain,_.strstart=0,_.block_start=0,_.lookahead=0,_.insert=0,_.match_length=_.prev_length=MIN_MATCH-1,_.match_available=0,_.ins_h=0};function DeflateState(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Z_DEFLATED$2,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(HEAP_SIZE*2),this.dyn_dtree=new Uint16Array((2*D_CODES+1)*2),this.bl_tree=new Uint16Array((2*BL_CODES+1)*2),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(MAX_BITS+1),this.heap=new Uint16Array(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*L_CODES+1),zero(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const deflateStateCheck=_=>{if(!_)return 1;const q=_.state;return!q||q.strm!==_||q.status!==INIT_STATE&&q.status!==GZIP_STATE&&q.status!==EXTRA_STATE&&q.status!==NAME_STATE&&q.status!==COMMENT_STATE&&q.status!==HCRC_STATE&&q.status!==BUSY_STATE&&q.status!==FINISH_STATE?1:0},deflateResetKeep=_=>{if(deflateStateCheck(_))return err(_,Z_STREAM_ERROR$2);_.total_in=_.total_out=0,_.data_type=Z_UNKNOWN;const q=_.state;return q.pending=0,q.pending_out=0,q.wrap<0&&(q.wrap=-q.wrap),q.status=q.wrap===2?GZIP_STATE:q.wrap?INIT_STATE:BUSY_STATE,_.adler=q.wrap===2?0:1,q.last_flush=-2,_tr_init(q),Z_OK$3},deflateReset=_=>{const q=deflateResetKeep(_);return q===Z_OK$3&&lm_init(_.state),q},deflateSetHeader=(_,q)=>deflateStateCheck(_)||_.state.wrap!==2?Z_STREAM_ERROR$2:(_.state.gzhead=q,Z_OK$3),deflateInit2=(_,q,k,D,$,I)=>{if(!_)return Z_STREAM_ERROR$2;let e=1;if(q===Z_DEFAULT_COMPRESSION$1&&(q=6),D<0?(e=0,D=-D):D>15&&(e=2,D-=16),$<1||$>MAX_MEM_LEVEL||k!==Z_DEFLATED$2||D<8||D>15||q<0||q>9||I<0||I>Z_FIXED||D===8&&e!==1)return err(_,Z_STREAM_ERROR$2);D===8&&(D=9);const u=new DeflateState;return _.state=u,u.strm=_,u.status=INIT_STATE,u.wrap=e,u.gzhead=null,u.w_bits=D,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=$+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+MIN_MATCH-1)/MIN_MATCH),u.window=new Uint8Array(u.w_size*2),u.head=new Uint16Array(u.hash_size),u.prev=new Uint16Array(u.w_size),u.lit_bufsize=1<<$+6,u.pending_buf_size=u.lit_bufsize*4,u.pending_buf=new Uint8Array(u.pending_buf_size),u.sym_buf=u.lit_bufsize,u.sym_end=(u.lit_bufsize-1)*3,u.level=q,u.strategy=I,u.method=k,deflateReset(_)},deflateInit=(_,q)=>deflateInit2(_,q,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(_,q)=>{if(deflateStateCheck(_)||q>Z_BLOCK$1||q<0)return _?err(_,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const k=_.state;if(!_.output||_.avail_in!==0&&!_.input||k.status===FINISH_STATE&&q!==Z_FINISH$3)return err(_,_.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const D=k.last_flush;if(k.last_flush=q,k.pending!==0){if(flush_pending(_),_.avail_out===0)return k.last_flush=-1,Z_OK$3}else if(_.avail_in===0&&rank(q)<=rank(D)&&q!==Z_FINISH$3)return err(_,Z_BUF_ERROR$1);if(k.status===FINISH_STATE&&_.avail_in!==0)return err(_,Z_BUF_ERROR$1);if(k.status===INIT_STATE&&k.wrap===0&&(k.status=BUSY_STATE),k.status===INIT_STATE){let $=Z_DEFLATED$2+(k.w_bits-8<<4)<<8,I=-1;if(k.strategy>=Z_HUFFMAN_ONLY||k.level<2?I=0:k.level<6?I=1:k.level===6?I=2:I=3,$|=I<<6,k.strstart!==0&&($|=PRESET_DICT),$+=31-$%31,putShortMSB(k,$),k.strstart!==0&&(putShortMSB(k,_.adler>>>16),putShortMSB(k,_.adler&65535)),_.adler=1,k.status=BUSY_STATE,flush_pending(_),k.pending!==0)return k.last_flush=-1,Z_OK$3}if(k.status===GZIP_STATE){if(_.adler=0,put_byte(k,31),put_byte(k,139),put_byte(k,8),k.gzhead)put_byte(k,(k.gzhead.text?1:0)+(k.gzhead.hcrc?2:0)+(k.gzhead.extra?4:0)+(k.gzhead.name?8:0)+(k.gzhead.comment?16:0)),put_byte(k,k.gzhead.time&255),put_byte(k,k.gzhead.time>>8&255),put_byte(k,k.gzhead.time>>16&255),put_byte(k,k.gzhead.time>>24&255),put_byte(k,k.level===9?2:k.strategy>=Z_HUFFMAN_ONLY||k.level<2?4:0),put_byte(k,k.gzhead.os&255),k.gzhead.extra&&k.gzhead.extra.length&&(put_byte(k,k.gzhead.extra.length&255),put_byte(k,k.gzhead.extra.length>>8&255)),k.gzhead.hcrc&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending,0)),k.gzindex=0,k.status=EXTRA_STATE;else if(put_byte(k,0),put_byte(k,0),put_byte(k,0),put_byte(k,0),put_byte(k,0),put_byte(k,k.level===9?2:k.strategy>=Z_HUFFMAN_ONLY||k.level<2?4:0),put_byte(k,OS_CODE),k.status=BUSY_STATE,flush_pending(_),k.pending!==0)return k.last_flush=-1,Z_OK$3}if(k.status===EXTRA_STATE){if(k.gzhead.extra){let $=k.pending,I=(k.gzhead.extra.length&65535)-k.gzindex;for(;k.pending+I>k.pending_buf_size;){let u=k.pending_buf_size-k.pending;if(k.pending_buf.set(k.gzhead.extra.subarray(k.gzindex,k.gzindex+u),k.pending),k.pending=k.pending_buf_size,k.gzhead.hcrc&&k.pending>$&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending-$,$)),k.gzindex+=u,flush_pending(_),k.pending!==0)return k.last_flush=-1,Z_OK$3;$=0,I-=u}let e=new Uint8Array(k.gzhead.extra);k.pending_buf.set(e.subarray(k.gzindex,k.gzindex+I),k.pending),k.pending+=I,k.gzhead.hcrc&&k.pending>$&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending-$,$)),k.gzindex=0}k.status=NAME_STATE}if(k.status===NAME_STATE){if(k.gzhead.name){let $=k.pending,I;do{if(k.pending===k.pending_buf_size){if(k.gzhead.hcrc&&k.pending>$&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending-$,$)),flush_pending(_),k.pending!==0)return k.last_flush=-1,Z_OK$3;$=0}k.gzindex<k.gzhead.name.length?I=k.gzhead.name.charCodeAt(k.gzindex++)&255:I=0,put_byte(k,I)}while(I!==0);k.gzhead.hcrc&&k.pending>$&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending-$,$)),k.gzindex=0}k.status=COMMENT_STATE}if(k.status===COMMENT_STATE){if(k.gzhead.comment){let $=k.pending,I;do{if(k.pending===k.pending_buf_size){if(k.gzhead.hcrc&&k.pending>$&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending-$,$)),flush_pending(_),k.pending!==0)return k.last_flush=-1,Z_OK$3;$=0}k.gzindex<k.gzhead.comment.length?I=k.gzhead.comment.charCodeAt(k.gzindex++)&255:I=0,put_byte(k,I)}while(I!==0);k.gzhead.hcrc&&k.pending>$&&(_.adler=crc32_1(_.adler,k.pending_buf,k.pending-$,$))}k.status=HCRC_STATE}if(k.status===HCRC_STATE){if(k.gzhead.hcrc){if(k.pending+2>k.pending_buf_size&&(flush_pending(_),k.pending!==0))return k.last_flush=-1,Z_OK$3;put_byte(k,_.adler&255),put_byte(k,_.adler>>8&255),_.adler=0}if(k.status=BUSY_STATE,flush_pending(_),k.pending!==0)return k.last_flush=-1,Z_OK$3}if(_.avail_in!==0||k.lookahead!==0||q!==Z_NO_FLUSH$2&&k.status!==FINISH_STATE){let $=k.level===0?deflate_stored(k,q):k.strategy===Z_HUFFMAN_ONLY?deflate_huff(k,q):k.strategy===Z_RLE?deflate_rle(k,q):configuration_table[k.level].func(k,q);if(($===BS_FINISH_STARTED||$===BS_FINISH_DONE)&&(k.status=FINISH_STATE),$===BS_NEED_MORE||$===BS_FINISH_STARTED)return _.avail_out===0&&(k.last_flush=-1),Z_OK$3;if($===BS_BLOCK_DONE&&(q===Z_PARTIAL_FLUSH?_tr_align(k):q!==Z_BLOCK$1&&(_tr_stored_block(k,0,0,!1),q===Z_FULL_FLUSH$1&&(zero(k.head),k.lookahead===0&&(k.strstart=0,k.block_start=0,k.insert=0))),flush_pending(_),_.avail_out===0))return k.last_flush=-1,Z_OK$3}return q!==Z_FINISH$3?Z_OK$3:k.wrap<=0?Z_STREAM_END$3:(k.wrap===2?(put_byte(k,_.adler&255),put_byte(k,_.adler>>8&255),put_byte(k,_.adler>>16&255),put_byte(k,_.adler>>24&255),put_byte(k,_.total_in&255),put_byte(k,_.total_in>>8&255),put_byte(k,_.total_in>>16&255),put_byte(k,_.total_in>>24&255)):(putShortMSB(k,_.adler>>>16),putShortMSB(k,_.adler&65535)),flush_pending(_),k.wrap>0&&(k.wrap=-k.wrap),k.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=_=>{if(deflateStateCheck(_))return Z_STREAM_ERROR$2;const q=_.state.status;return _.state=null,q===BUSY_STATE?err(_,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(_,q)=>{let k=q.length;if(deflateStateCheck(_))return Z_STREAM_ERROR$2;const D=_.state,$=D.wrap;if($===2||$===1&&D.status!==INIT_STATE||D.lookahead)return Z_STREAM_ERROR$2;if($===1&&(_.adler=adler32_1(_.adler,q,k,0)),D.wrap=0,k>=D.w_size){$===0&&(zero(D.head),D.strstart=0,D.block_start=0,D.insert=0);let N=new Uint8Array(D.w_size);N.set(q.subarray(k-D.w_size,k),0),q=N,k=D.w_size}const I=_.avail_in,e=_.next_in,u=_.input;for(_.avail_in=k,_.next_in=0,_.input=q,fill_window(D);D.lookahead>=MIN_MATCH;){let N=D.strstart,A=D.lookahead-(MIN_MATCH-1);do D.ins_h=HASH(D,D.ins_h,D.window[N+MIN_MATCH-1]),D.prev[N&D.w_mask]=D.head[D.ins_h],D.head[D.ins_h]=N,N++;while(--A);D.strstart=N,D.lookahead=MIN_MATCH-1,fill_window(D)}return D.strstart+=D.lookahead,D.block_start=D.strstart,D.insert=D.lookahead,D.lookahead=0,D.match_length=D.prev_length=MIN_MATCH-1,D.match_available=0,_.next_in=e,_.input=u,_.avail_in=I,D.wrap=$,Z_OK$3};var deflateInit_1=deflateInit,deflateInit2_1=deflateInit2,deflateReset_1=deflateReset,deflateResetKeep_1=deflateResetKeep,deflateSetHeader_1=deflateSetHeader,deflate_2$1=deflate$2,deflateEnd_1=deflateEnd,deflateSetDictionary_1=deflateSetDictionary,deflateInfo="pako deflate (from Nodeca project)",deflate_1$2={deflateInit:deflateInit_1,deflateInit2:deflateInit2_1,deflateReset:deflateReset_1,deflateResetKeep:deflateResetKeep_1,deflateSetHeader:deflateSetHeader_1,deflate:deflate_2$1,deflateEnd:deflateEnd_1,deflateSetDictionary:deflateSetDictionary_1,deflateInfo};const _has=(_,q)=>Object.prototype.hasOwnProperty.call(_,q);var assign=function(_){const q=Array.prototype.slice.call(arguments,1);for(;q.length;){const k=q.shift();if(k){if(typeof k!="object")throw new TypeError(k+"must be non-object");for(const D in k)_has(k,D)&&(_[D]=k[D])}}return _},flattenChunks=_=>{let q=0;for(let D=0,$=_.length;D<$;D++)q+=_[D].length;const k=new Uint8Array(q);for(let D=0,$=0,I=_.length;D<I;D++){let e=_[D];k.set(e,$),$+=e.length}return k},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(_){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let _=0;_<256;_++)_utf8len[_]=_>=252?6:_>=248?5:_>=240?4:_>=224?3:_>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=_=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(_);let q,k,D,$,I,e=_.length,u=0;for($=0;$<e;$++)k=_.charCodeAt($),(k&64512)===55296&&$+1<e&&(D=_.charCodeAt($+1),(D&64512)===56320&&(k=65536+(k-55296<<10)+(D-56320),$++)),u+=k<128?1:k<2048?2:k<65536?3:4;for(q=new Uint8Array(u),I=0,$=0;I<u;$++)k=_.charCodeAt($),(k&64512)===55296&&$+1<e&&(D=_.charCodeAt($+1),(D&64512)===56320&&(k=65536+(k-55296<<10)+(D-56320),$++)),k<128?q[I++]=k:k<2048?(q[I++]=192|k>>>6,q[I++]=128|k&63):k<65536?(q[I++]=224|k>>>12,q[I++]=128|k>>>6&63,q[I++]=128|k&63):(q[I++]=240|k>>>18,q[I++]=128|k>>>12&63,q[I++]=128|k>>>6&63,q[I++]=128|k&63);return q};const buf2binstring=(_,q)=>{if(q<65534&&_.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,_.length===q?_:_.subarray(0,q));let k="";for(let D=0;D<q;D++)k+=String.fromCharCode(_[D]);return k};var buf2string=(_,q)=>{const k=q||_.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(_.subarray(0,q));let D,$;const I=new Array(k*2);for($=0,D=0;D<k;){let e=_[D++];if(e<128){I[$++]=e;continue}let u=_utf8len[e];if(u>4){I[$++]=65533,D+=u-1;continue}for(e&=u===2?31:u===3?15:7;u>1&&D<k;)e=e<<6|_[D++]&63,u--;if(u>1){I[$++]=65533;continue}e<65536?I[$++]=e:(e-=65536,I[$++]=55296|e>>10&1023,I[$++]=56320|e&1023)}return buf2binstring(I,$)},utf8border=(_,q)=>{q=q||_.length,q>_.length&&(q=_.length);let k=q-1;for(;k>=0&&(_[k]&192)===128;)k--;return k<0||k===0?q:k+_utf8len[_[k]]>q?k:q},strings={string2buf,buf2string,utf8border};function ZStream(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var zstream=ZStream;const toString$1=Object.prototype.toString,{Z_NO_FLUSH:Z_NO_FLUSH$1,Z_SYNC_FLUSH,Z_FULL_FLUSH,Z_FINISH:Z_FINISH$2,Z_OK:Z_OK$2,Z_STREAM_END:Z_STREAM_END$2,Z_DEFAULT_COMPRESSION,Z_DEFAULT_STRATEGY,Z_DEFLATED:Z_DEFLATED$1}=constants$2;function Deflate$1(_){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},_||{});let q=this.options;q.raw&&q.windowBits>0?q.windowBits=-q.windowBits:q.gzip&&q.windowBits>0&&q.windowBits<16&&(q.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let k=deflate_1$2.deflateInit2(this.strm,q.level,q.method,q.windowBits,q.memLevel,q.strategy);if(k!==Z_OK$2)throw new Error(messages[k]);if(q.header&&deflate_1$2.deflateSetHeader(this.strm,q.header),q.dictionary){let D;if(typeof q.dictionary=="string"?D=strings.string2buf(q.dictionary):toString$1.call(q.dictionary)==="[object ArrayBuffer]"?D=new Uint8Array(q.dictionary):D=q.dictionary,k=deflate_1$2.deflateSetDictionary(this.strm,D),k!==Z_OK$2)throw new Error(messages[k]);this._dict_set=!0}}Deflate$1.prototype.push=function(_,q){const k=this.strm,D=this.options.chunkSize;let $,I;if(this.ended)return!1;for(q===~~q?I=q:I=q===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof _=="string"?k.input=strings.string2buf(_):toString$1.call(_)==="[object ArrayBuffer]"?k.input=new Uint8Array(_):k.input=_,k.next_in=0,k.avail_in=k.input.length;;){if(k.avail_out===0&&(k.output=new Uint8Array(D),k.next_out=0,k.avail_out=D),(I===Z_SYNC_FLUSH||I===Z_FULL_FLUSH)&&k.avail_out<=6){this.onData(k.output.subarray(0,k.next_out)),k.avail_out=0;continue}if($=deflate_1$2.deflate(k,I),$===Z_STREAM_END$2)return k.next_out>0&&this.onData(k.output.subarray(0,k.next_out)),$=deflate_1$2.deflateEnd(this.strm),this.onEnd($),this.ended=!0,$===Z_OK$2;if(k.avail_out===0){this.onData(k.output);continue}if(I>0&&k.next_out>0){this.onData(k.output.subarray(0,k.next_out)),k.avail_out=0;continue}if(k.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(_){this.chunks.push(_)},Deflate$1.prototype.onEnd=function(_){_===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=_,this.msg=this.strm.msg};function deflate$1(_,q){const k=new Deflate$1(q);if(k.push(_,!0),k.err)throw k.msg||messages[k.err];return k.result}function deflateRaw$1(_,q){return q=q||{},q.raw=!0,deflate$1(_,q)}function gzip$1(_,q){return q=q||{},q.gzip=!0,deflate$1(_,q)}var Deflate_1$1=Deflate$1,deflate_2=deflate$1,deflateRaw_1$1=deflateRaw$1,gzip_1$1=gzip$1,deflate_1$1={Deflate:Deflate_1$1,deflate:deflate_2,deflateRaw:deflateRaw_1$1,gzip:gzip_1$1};const BAD$1=16209,TYPE$1=16191;var inffast=function _(q,k){let D,$,I,e,u,N,A,U,L,P,Z,F,W,J,z,V,X,Y,et,ft,tt,st,rt,nt;const ot=q.state;D=q.next_in,rt=q.input,$=D+(q.avail_in-5),I=q.next_out,nt=q.output,e=I-(k-q.avail_out),u=I+(q.avail_out-257),N=ot.dmax,A=ot.wsize,U=ot.whave,L=ot.wnext,P=ot.window,Z=ot.hold,F=ot.bits,W=ot.lencode,J=ot.distcode,z=(1<<ot.lenbits)-1,V=(1<<ot.distbits)-1;t:do{F<15&&(Z+=rt[D++]<<F,F+=8,Z+=rt[D++]<<F,F+=8),X=W[Z&z];e:for(;;){if(Y=X>>>24,Z>>>=Y,F-=Y,Y=X>>>16&255,Y===0)nt[I++]=X&65535;else if(Y&16){et=X&65535,Y&=15,Y&&(F<Y&&(Z+=rt[D++]<<F,F+=8),et+=Z&(1<<Y)-1,Z>>>=Y,F-=Y),F<15&&(Z+=rt[D++]<<F,F+=8,Z+=rt[D++]<<F,F+=8),X=J[Z&V];i:for(;;){if(Y=X>>>24,Z>>>=Y,F-=Y,Y=X>>>16&255,Y&16){if(ft=X&65535,Y&=15,F<Y&&(Z+=rt[D++]<<F,F+=8,F<Y&&(Z+=rt[D++]<<F,F+=8)),ft+=Z&(1<<Y)-1,ft>N){q.msg="invalid distance too far back",ot.mode=BAD$1;break t}if(Z>>>=Y,F-=Y,Y=I-e,ft>Y){if(Y=ft-Y,Y>U&&ot.sane){q.msg="invalid distance too far back",ot.mode=BAD$1;break t}if(tt=0,st=P,L===0){if(tt+=A-Y,Y<et){et-=Y;do nt[I++]=P[tt++];while(--Y);tt=I-ft,st=nt}}else if(L<Y){if(tt+=A+L-Y,Y-=L,Y<et){et-=Y;do nt[I++]=P[tt++];while(--Y);if(tt=0,L<et){Y=L,et-=Y;do nt[I++]=P[tt++];while(--Y);tt=I-ft,st=nt}}}else if(tt+=L-Y,Y<et){et-=Y;do nt[I++]=P[tt++];while(--Y);tt=I-ft,st=nt}for(;et>2;)nt[I++]=st[tt++],nt[I++]=st[tt++],nt[I++]=st[tt++],et-=3;et&&(nt[I++]=st[tt++],et>1&&(nt[I++]=st[tt++]))}else{tt=I-ft;do nt[I++]=nt[tt++],nt[I++]=nt[tt++],nt[I++]=nt[tt++],et-=3;while(et>2);et&&(nt[I++]=nt[tt++],et>1&&(nt[I++]=nt[tt++]))}}else if((Y&64)===0){X=J[(X&65535)+(Z&(1<<Y)-1)];continue i}else{q.msg="invalid distance code",ot.mode=BAD$1;break t}break}}else if((Y&64)===0){X=W[(X&65535)+(Z&(1<<Y)-1)];continue e}else if(Y&32){ot.mode=TYPE$1;break t}else{q.msg="invalid literal/length code",ot.mode=BAD$1;break t}break}}while(D<$&&I<u);et=F>>3,D-=et,F-=et<<3,Z&=(1<<F)-1,q.next_in=D,q.next_out=I,q.avail_in=D<$?5+($-D):5-(D-$),q.avail_out=I<u?257+(u-I):257-(I-u),ot.hold=Z,ot.bits=F};const MAXBITS=15,ENOUGH_LENS$1=852,ENOUGH_DISTS$1=592,CODES$1=0,LENS$1=1,DISTS$1=2,lbase=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),lext=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),dbase=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),dext=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),inflate_table=(_,q,k,D,$,I,e,u)=>{const N=u.bits;let A=0,U=0,L=0,P=0,Z=0,F=0,W=0,J=0,z=0,V=0,X,Y,et,ft,tt,st=null,rt;const nt=new Uint16Array(MAXBITS+1),ot=new Uint16Array(MAXBITS+1);let St=null,Kt,Jt,Wt;for(A=0;A<=MAXBITS;A++)nt[A]=0;for(U=0;U<D;U++)nt[q[k+U]]++;for(Z=N,P=MAXBITS;P>=1&&nt[P]===0;P--);if(Z>P&&(Z=P),P===0)return $[I++]=1<<24|64<<16|0,$[I++]=1<<24|64<<16|0,u.bits=1,0;for(L=1;L<P&&nt[L]===0;L++);for(Z<L&&(Z=L),J=1,A=1;A<=MAXBITS;A++)if(J<<=1,J-=nt[A],J<0)return-1;if(J>0&&(_===CODES$1||P!==1))return-1;for(ot[1]=0,A=1;A<MAXBITS;A++)ot[A+1]=ot[A]+nt[A];for(U=0;U<D;U++)q[k+U]!==0&&(e[ot[q[k+U]]++]=U);if(_===CODES$1?(st=St=e,rt=20):_===LENS$1?(st=lbase,St=lext,rt=257):(st=dbase,St=dext,rt=0),V=0,U=0,A=L,tt=I,F=Z,W=0,et=-1,z=1<<Z,ft=z-1,_===LENS$1&&z>ENOUGH_LENS$1||_===DISTS$1&&z>ENOUGH_DISTS$1)return 1;for(;;){Kt=A-W,e[U]+1<rt?(Jt=0,Wt=e[U]):e[U]>=rt?(Jt=St[e[U]-rt],Wt=st[e[U]-rt]):(Jt=96,Wt=0),X=1<<A-W,Y=1<<F,L=Y;do Y-=X,$[tt+(V>>W)+Y]=Kt<<24|Jt<<16|Wt|0;while(Y!==0);for(X=1<<A-1;V&X;)X>>=1;if(X!==0?(V&=X-1,V+=X):V=0,U++,--nt[A]===0){if(A===P)break;A=q[k+e[U]]}if(A>Z&&(V&ft)!==et){for(W===0&&(W=Z),tt+=L,F=A-W,J=1<<F;F+W<P&&(J-=nt[F+W],!(J<=0));)F++,J<<=1;if(z+=1<<F,_===LENS$1&&z>ENOUGH_LENS$1||_===DISTS$1&&z>ENOUGH_DISTS$1)return 1;et=V&ft,$[et]=Z<<24|F<<16|tt-I|0}}return V!==0&&($[tt+V]=A-W<<24|64<<16|0),u.bits=Z,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK,Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR,Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=_=>(_>>>24&255)+(_>>>8&65280)+((_&65280)<<8)+((_&255)<<24);function InflateState(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const inflateStateCheck=_=>{if(!_)return 1;const q=_.state;return!q||q.strm!==_||q.mode<HEAD||q.mode>SYNC?1:0},inflateResetKeep=_=>{if(inflateStateCheck(_))return Z_STREAM_ERROR$1;const q=_.state;return _.total_in=_.total_out=q.total=0,_.msg="",q.wrap&&(_.adler=q.wrap&1),q.mode=HEAD,q.last=0,q.havedict=0,q.flags=-1,q.dmax=32768,q.head=null,q.hold=0,q.bits=0,q.lencode=q.lendyn=new Int32Array(ENOUGH_LENS),q.distcode=q.distdyn=new Int32Array(ENOUGH_DISTS),q.sane=1,q.back=-1,Z_OK$1},inflateReset=_=>{if(inflateStateCheck(_))return Z_STREAM_ERROR$1;const q=_.state;return q.wsize=0,q.whave=0,q.wnext=0,inflateResetKeep(_)},inflateReset2=(_,q)=>{let k;if(inflateStateCheck(_))return Z_STREAM_ERROR$1;const D=_.state;return q<0?(k=0,q=-q):(k=(q>>4)+5,q<48&&(q&=15)),q&&(q<8||q>15)?Z_STREAM_ERROR$1:(D.window!==null&&D.wbits!==q&&(D.window=null),D.wrap=k,D.wbits=q,inflateReset(_))},inflateInit2=(_,q)=>{if(!_)return Z_STREAM_ERROR$1;const k=new InflateState;_.state=k,k.strm=_,k.window=null,k.mode=HEAD;const D=inflateReset2(_,q);return D!==Z_OK$1&&(_.state=null),D},inflateInit=_=>inflateInit2(_,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=_=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let q=0;for(;q<144;)_.lens[q++]=8;for(;q<256;)_.lens[q++]=9;for(;q<280;)_.lens[q++]=7;for(;q<288;)_.lens[q++]=8;for(inftrees(LENS,_.lens,0,288,lenfix,0,_.work,{bits:9}),q=0;q<32;)_.lens[q++]=5;inftrees(DISTS,_.lens,0,32,distfix,0,_.work,{bits:5}),virgin=!1}_.lencode=lenfix,_.lenbits=9,_.distcode=distfix,_.distbits=5},updatewindow=(_,q,k,D)=>{let $;const I=_.state;return I.window===null&&(I.wsize=1<<I.wbits,I.wnext=0,I.whave=0,I.window=new Uint8Array(I.wsize)),D>=I.wsize?(I.window.set(q.subarray(k-I.wsize,k),0),I.wnext=0,I.whave=I.wsize):($=I.wsize-I.wnext,$>D&&($=D),I.window.set(q.subarray(k-D,k-D+$),I.wnext),D-=$,D?(I.window.set(q.subarray(k-D,k),0),I.wnext=D,I.whave=I.wsize):(I.wnext+=$,I.wnext===I.wsize&&(I.wnext=0),I.whave<I.wsize&&(I.whave+=$))),0},inflate$2=(_,q)=>{let k,D,$,I,e,u,N,A,U,L,P,Z,F,W,J=0,z,V,X,Y,et,ft,tt,st;const rt=new Uint8Array(4);let nt,ot;const St=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(_)||!_.output||!_.input&&_.avail_in!==0)return Z_STREAM_ERROR$1;k=_.state,k.mode===TYPE&&(k.mode=TYPEDO),e=_.next_out,$=_.output,N=_.avail_out,I=_.next_in,D=_.input,u=_.avail_in,A=k.hold,U=k.bits,L=u,P=N,st=Z_OK$1;t:for(;;)switch(k.mode){case HEAD:if(k.wrap===0){k.mode=TYPEDO;break}for(;U<16;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(k.wrap&2&&A===35615){k.wbits===0&&(k.wbits=15),k.check=0,rt[0]=A&255,rt[1]=A>>>8&255,k.check=crc32_1(k.check,rt,2,0),A=0,U=0,k.mode=FLAGS;break}if(k.head&&(k.head.done=!1),!(k.wrap&1)||(((A&255)<<8)+(A>>8))%31){_.msg="incorrect header check",k.mode=BAD;break}if((A&15)!==Z_DEFLATED){_.msg="unknown compression method",k.mode=BAD;break}if(A>>>=4,U-=4,tt=(A&15)+8,k.wbits===0&&(k.wbits=tt),tt>15||tt>k.wbits){_.msg="invalid window size",k.mode=BAD;break}k.dmax=1<<k.wbits,k.flags=0,_.adler=k.check=1,k.mode=A&512?DICTID:TYPE,A=0,U=0;break;case FLAGS:for(;U<16;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(k.flags=A,(k.flags&255)!==Z_DEFLATED){_.msg="unknown compression method",k.mode=BAD;break}if(k.flags&57344){_.msg="unknown header flags set",k.mode=BAD;break}k.head&&(k.head.text=A>>8&1),k.flags&512&&k.wrap&4&&(rt[0]=A&255,rt[1]=A>>>8&255,k.check=crc32_1(k.check,rt,2,0)),A=0,U=0,k.mode=TIME;case TIME:for(;U<32;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}k.head&&(k.head.time=A),k.flags&512&&k.wrap&4&&(rt[0]=A&255,rt[1]=A>>>8&255,rt[2]=A>>>16&255,rt[3]=A>>>24&255,k.check=crc32_1(k.check,rt,4,0)),A=0,U=0,k.mode=OS;case OS:for(;U<16;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}k.head&&(k.head.xflags=A&255,k.head.os=A>>8),k.flags&512&&k.wrap&4&&(rt[0]=A&255,rt[1]=A>>>8&255,k.check=crc32_1(k.check,rt,2,0)),A=0,U=0,k.mode=EXLEN;case EXLEN:if(k.flags&1024){for(;U<16;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}k.length=A,k.head&&(k.head.extra_len=A),k.flags&512&&k.wrap&4&&(rt[0]=A&255,rt[1]=A>>>8&255,k.check=crc32_1(k.check,rt,2,0)),A=0,U=0}else k.head&&(k.head.extra=null);k.mode=EXTRA;case EXTRA:if(k.flags&1024&&(Z=k.length,Z>u&&(Z=u),Z&&(k.head&&(tt=k.head.extra_len-k.length,k.head.extra||(k.head.extra=new Uint8Array(k.head.extra_len)),k.head.extra.set(D.subarray(I,I+Z),tt)),k.flags&512&&k.wrap&4&&(k.check=crc32_1(k.check,D,Z,I)),u-=Z,I+=Z,k.length-=Z),k.length))break t;k.length=0,k.mode=NAME;case NAME:if(k.flags&2048){if(u===0)break t;Z=0;do tt=D[I+Z++],k.head&&tt&&k.length<65536&&(k.head.name+=String.fromCharCode(tt));while(tt&&Z<u);if(k.flags&512&&k.wrap&4&&(k.check=crc32_1(k.check,D,Z,I)),u-=Z,I+=Z,tt)break t}else k.head&&(k.head.name=null);k.length=0,k.mode=COMMENT;case COMMENT:if(k.flags&4096){if(u===0)break t;Z=0;do tt=D[I+Z++],k.head&&tt&&k.length<65536&&(k.head.comment+=String.fromCharCode(tt));while(tt&&Z<u);if(k.flags&512&&k.wrap&4&&(k.check=crc32_1(k.check,D,Z,I)),u-=Z,I+=Z,tt)break t}else k.head&&(k.head.comment=null);k.mode=HCRC;case HCRC:if(k.flags&512){for(;U<16;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(k.wrap&4&&A!==(k.check&65535)){_.msg="header crc mismatch",k.mode=BAD;break}A=0,U=0}k.head&&(k.head.hcrc=k.flags>>9&1,k.head.done=!0),_.adler=k.check=0,k.mode=TYPE;break;case DICTID:for(;U<32;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}_.adler=k.check=zswap32(A),A=0,U=0,k.mode=DICT;case DICT:if(k.havedict===0)return _.next_out=e,_.avail_out=N,_.next_in=I,_.avail_in=u,k.hold=A,k.bits=U,Z_NEED_DICT$1;_.adler=k.check=1,k.mode=TYPE;case TYPE:if(q===Z_BLOCK||q===Z_TREES)break t;case TYPEDO:if(k.last){A>>>=U&7,U-=U&7,k.mode=CHECK;break}for(;U<3;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}switch(k.last=A&1,A>>>=1,U-=1,A&3){case 0:k.mode=STORED;break;case 1:if(fixedtables(k),k.mode=LEN_,q===Z_TREES){A>>>=2,U-=2;break t}break;case 2:k.mode=TABLE;break;case 3:_.msg="invalid block type",k.mode=BAD}A>>>=2,U-=2;break;case STORED:for(A>>>=U&7,U-=U&7;U<32;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if((A&65535)!==(A>>>16^65535)){_.msg="invalid stored block lengths",k.mode=BAD;break}if(k.length=A&65535,A=0,U=0,k.mode=COPY_,q===Z_TREES)break t;case COPY_:k.mode=COPY;case COPY:if(Z=k.length,Z){if(Z>u&&(Z=u),Z>N&&(Z=N),Z===0)break t;$.set(D.subarray(I,I+Z),e),u-=Z,I+=Z,N-=Z,e+=Z,k.length-=Z;break}k.mode=TYPE;break;case TABLE:for(;U<14;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(k.nlen=(A&31)+257,A>>>=5,U-=5,k.ndist=(A&31)+1,A>>>=5,U-=5,k.ncode=(A&15)+4,A>>>=4,U-=4,k.nlen>286||k.ndist>30){_.msg="too many length or distance symbols",k.mode=BAD;break}k.have=0,k.mode=LENLENS;case LENLENS:for(;k.have<k.ncode;){for(;U<3;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}k.lens[St[k.have++]]=A&7,A>>>=3,U-=3}for(;k.have<19;)k.lens[St[k.have++]]=0;if(k.lencode=k.lendyn,k.lenbits=7,nt={bits:k.lenbits},st=inftrees(CODES,k.lens,0,19,k.lencode,0,k.work,nt),k.lenbits=nt.bits,st){_.msg="invalid code lengths set",k.mode=BAD;break}k.have=0,k.mode=CODELENS;case CODELENS:for(;k.have<k.nlen+k.ndist;){for(;J=k.lencode[A&(1<<k.lenbits)-1],z=J>>>24,V=J>>>16&255,X=J&65535,!(z<=U);){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(X<16)A>>>=z,U-=z,k.lens[k.have++]=X;else{if(X===16){for(ot=z+2;U<ot;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(A>>>=z,U-=z,k.have===0){_.msg="invalid bit length repeat",k.mode=BAD;break}tt=k.lens[k.have-1],Z=3+(A&3),A>>>=2,U-=2}else if(X===17){for(ot=z+3;U<ot;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}A>>>=z,U-=z,tt=0,Z=3+(A&7),A>>>=3,U-=3}else{for(ot=z+7;U<ot;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}A>>>=z,U-=z,tt=0,Z=11+(A&127),A>>>=7,U-=7}if(k.have+Z>k.nlen+k.ndist){_.msg="invalid bit length repeat",k.mode=BAD;break}for(;Z--;)k.lens[k.have++]=tt}}if(k.mode===BAD)break;if(k.lens[256]===0){_.msg="invalid code -- missing end-of-block",k.mode=BAD;break}if(k.lenbits=9,nt={bits:k.lenbits},st=inftrees(LENS,k.lens,0,k.nlen,k.lencode,0,k.work,nt),k.lenbits=nt.bits,st){_.msg="invalid literal/lengths set",k.mode=BAD;break}if(k.distbits=6,k.distcode=k.distdyn,nt={bits:k.distbits},st=inftrees(DISTS,k.lens,k.nlen,k.ndist,k.distcode,0,k.work,nt),k.distbits=nt.bits,st){_.msg="invalid distances set",k.mode=BAD;break}if(k.mode=LEN_,q===Z_TREES)break t;case LEN_:k.mode=LEN;case LEN:if(u>=6&&N>=258){_.next_out=e,_.avail_out=N,_.next_in=I,_.avail_in=u,k.hold=A,k.bits=U,inffast(_,P),e=_.next_out,$=_.output,N=_.avail_out,I=_.next_in,D=_.input,u=_.avail_in,A=k.hold,U=k.bits,k.mode===TYPE&&(k.back=-1);break}for(k.back=0;J=k.lencode[A&(1<<k.lenbits)-1],z=J>>>24,V=J>>>16&255,X=J&65535,!(z<=U);){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(V&&(V&240)===0){for(Y=z,et=V,ft=X;J=k.lencode[ft+((A&(1<<Y+et)-1)>>Y)],z=J>>>24,V=J>>>16&255,X=J&65535,!(Y+z<=U);){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}A>>>=Y,U-=Y,k.back+=Y}if(A>>>=z,U-=z,k.back+=z,k.length=X,V===0){k.mode=LIT;break}if(V&32){k.back=-1,k.mode=TYPE;break}if(V&64){_.msg="invalid literal/length code",k.mode=BAD;break}k.extra=V&15,k.mode=LENEXT;case LENEXT:if(k.extra){for(ot=k.extra;U<ot;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}k.length+=A&(1<<k.extra)-1,A>>>=k.extra,U-=k.extra,k.back+=k.extra}k.was=k.length,k.mode=DIST;case DIST:for(;J=k.distcode[A&(1<<k.distbits)-1],z=J>>>24,V=J>>>16&255,X=J&65535,!(z<=U);){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if((V&240)===0){for(Y=z,et=V,ft=X;J=k.distcode[ft+((A&(1<<Y+et)-1)>>Y)],z=J>>>24,V=J>>>16&255,X=J&65535,!(Y+z<=U);){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}A>>>=Y,U-=Y,k.back+=Y}if(A>>>=z,U-=z,k.back+=z,V&64){_.msg="invalid distance code",k.mode=BAD;break}k.offset=X,k.extra=V&15,k.mode=DISTEXT;case DISTEXT:if(k.extra){for(ot=k.extra;U<ot;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}k.offset+=A&(1<<k.extra)-1,A>>>=k.extra,U-=k.extra,k.back+=k.extra}if(k.offset>k.dmax){_.msg="invalid distance too far back",k.mode=BAD;break}k.mode=MATCH;case MATCH:if(N===0)break t;if(Z=P-N,k.offset>Z){if(Z=k.offset-Z,Z>k.whave&&k.sane){_.msg="invalid distance too far back",k.mode=BAD;break}Z>k.wnext?(Z-=k.wnext,F=k.wsize-Z):F=k.wnext-Z,Z>k.length&&(Z=k.length),W=k.window}else W=$,F=e-k.offset,Z=k.length;Z>N&&(Z=N),N-=Z,k.length-=Z;do $[e++]=W[F++];while(--Z);k.length===0&&(k.mode=LEN);break;case LIT:if(N===0)break t;$[e++]=k.length,N--,k.mode=LEN;break;case CHECK:if(k.wrap){for(;U<32;){if(u===0)break t;u--,A|=D[I++]<<U,U+=8}if(P-=N,_.total_out+=P,k.total+=P,k.wrap&4&&P&&(_.adler=k.check=k.flags?crc32_1(k.check,$,P,e-P):adler32_1(k.check,$,P,e-P)),P=N,k.wrap&4&&(k.flags?A:zswap32(A))!==k.check){_.msg="incorrect data check",k.mode=BAD;break}A=0,U=0}k.mode=LENGTH;case LENGTH:if(k.wrap&&k.flags){for(;U<32;){if(u===0)break t;u--,A+=D[I++]<<U,U+=8}if(k.wrap&4&&A!==(k.total&4294967295)){_.msg="incorrect length check",k.mode=BAD;break}A=0,U=0}k.mode=DONE;case DONE:st=Z_STREAM_END$1;break t;case BAD:st=Z_DATA_ERROR$1;break t;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return _.next_out=e,_.avail_out=N,_.next_in=I,_.avail_in=u,k.hold=A,k.bits=U,(k.wsize||P!==_.avail_out&&k.mode<BAD&&(k.mode<CHECK||q!==Z_FINISH$1))&&updatewindow(_,_.output,_.next_out,P-_.avail_out),L-=_.avail_in,P-=_.avail_out,_.total_in+=L,_.total_out+=P,k.total+=P,k.wrap&4&&P&&(_.adler=k.check=k.flags?crc32_1(k.check,$,P,_.next_out-P):adler32_1(k.check,$,P,_.next_out-P)),_.data_type=k.bits+(k.last?64:0)+(k.mode===TYPE?128:0)+(k.mode===LEN_||k.mode===COPY_?256:0),(L===0&&P===0||q===Z_FINISH$1)&&st===Z_OK$1&&(st=Z_BUF_ERROR),st},inflateEnd=_=>{if(inflateStateCheck(_))return Z_STREAM_ERROR$1;let q=_.state;return q.window&&(q.window=null),_.state=null,Z_OK$1},inflateGetHeader=(_,q)=>{if(inflateStateCheck(_))return Z_STREAM_ERROR$1;const k=_.state;return(k.wrap&2)===0?Z_STREAM_ERROR$1:(k.head=q,q.done=!1,Z_OK$1)},inflateSetDictionary=(_,q)=>{const k=q.length;let D,$,I;return inflateStateCheck(_)||(D=_.state,D.wrap!==0&&D.mode!==DICT)?Z_STREAM_ERROR$1:D.mode===DICT&&($=1,$=adler32_1($,q,k,0),$!==D.check)?Z_DATA_ERROR$1:(I=updatewindow(_,q,k,k),I?(D.mode=MEM,Z_MEM_ERROR$1):(D.havedict=1,Z_OK$1))};var inflateReset_1=inflateReset,inflateReset2_1=inflateReset2,inflateResetKeep_1=inflateResetKeep,inflateInit_1=inflateInit,inflateInit2_1=inflateInit2,inflate_2$1=inflate$2,inflateEnd_1=inflateEnd,inflateGetHeader_1=inflateGetHeader,inflateSetDictionary_1=inflateSetDictionary,inflateInfo="pako inflate (from Nodeca project)",inflate_1$2={inflateReset:inflateReset_1,inflateReset2:inflateReset2_1,inflateResetKeep:inflateResetKeep_1,inflateInit:inflateInit_1,inflateInit2:inflateInit2_1,inflate:inflate_2$1,inflateEnd:inflateEnd_1,inflateGetHeader:inflateGetHeader_1,inflateSetDictionary:inflateSetDictionary_1,inflateInfo};function GZheader(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var gzheader=GZheader;const toString=Object.prototype.toString,{Z_NO_FLUSH,Z_FINISH,Z_OK,Z_STREAM_END,Z_NEED_DICT,Z_STREAM_ERROR,Z_DATA_ERROR,Z_MEM_ERROR}=constants$2;function Inflate$1(_){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},_||{});const q=this.options;q.raw&&q.windowBits>=0&&q.windowBits<16&&(q.windowBits=-q.windowBits,q.windowBits===0&&(q.windowBits=-15)),q.windowBits>=0&&q.windowBits<16&&!(_&&_.windowBits)&&(q.windowBits+=32),q.windowBits>15&&q.windowBits<48&&(q.windowBits&15)===0&&(q.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let k=inflate_1$2.inflateInit2(this.strm,q.windowBits);if(k!==Z_OK)throw new Error(messages[k]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),q.dictionary&&(typeof q.dictionary=="string"?q.dictionary=strings.string2buf(q.dictionary):toString.call(q.dictionary)==="[object ArrayBuffer]"&&(q.dictionary=new Uint8Array(q.dictionary)),q.raw&&(k=inflate_1$2.inflateSetDictionary(this.strm,q.dictionary),k!==Z_OK)))throw new Error(messages[k])}Inflate$1.prototype.push=function(_,q){const k=this.strm,D=this.options.chunkSize,$=this.options.dictionary;let I,e,u;if(this.ended)return!1;for(q===~~q?e=q:e=q===!0?Z_FINISH:Z_NO_FLUSH,toString.call(_)==="[object ArrayBuffer]"?k.input=new Uint8Array(_):k.input=_,k.next_in=0,k.avail_in=k.input.length;;){for(k.avail_out===0&&(k.output=new Uint8Array(D),k.next_out=0,k.avail_out=D),I=inflate_1$2.inflate(k,e),I===Z_NEED_DICT&&$&&(I=inflate_1$2.inflateSetDictionary(k,$),I===Z_OK?I=inflate_1$2.inflate(k,e):I===Z_DATA_ERROR&&(I=Z_NEED_DICT));k.avail_in>0&&I===Z_STREAM_END&&k.state.wrap>0&&_[k.next_in]!==0;)inflate_1$2.inflateReset(k),I=inflate_1$2.inflate(k,e);switch(I){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(I),this.ended=!0,!1}if(u=k.avail_out,k.next_out&&(k.avail_out===0||I===Z_STREAM_END))if(this.options.to==="string"){let N=strings.utf8border(k.output,k.next_out),A=k.next_out-N,U=strings.buf2string(k.output,N);k.next_out=A,k.avail_out=D-A,A&&k.output.set(k.output.subarray(N,N+A),0),this.onData(U)}else this.onData(k.output.length===k.next_out?k.output:k.output.subarray(0,k.next_out));if(!(I===Z_OK&&u===0)){if(I===Z_STREAM_END)return I=inflate_1$2.inflateEnd(this.strm),this.onEnd(I),this.ended=!0,!0;if(k.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(_){this.chunks.push(_)},Inflate$1.prototype.onEnd=function(_){_===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=_,this.msg=this.strm.msg};function inflate$1(_,q){const k=new Inflate$1(q);if(k.push(_),k.err)throw k.msg||messages[k.err];return k.result}function inflateRaw$1(_,q){return q=q||{},q.raw=!0,inflate$1(_,q)}var Inflate_1$1=Inflate$1,inflate_2=inflate$1,inflateRaw_1$1=inflateRaw$1,ungzip$1=inflate$1,inflate_1$1={Inflate:Inflate_1$1,inflate:inflate_2,inflateRaw:inflateRaw_1$1,ungzip:ungzip$1};const{Deflate,deflate,deflateRaw,gzip}=deflate_1$1,{Inflate,inflate,inflateRaw,ungzip}=inflate_1$1;var Deflate_1=Deflate,deflate_1=deflate,deflateRaw_1=deflateRaw,gzip_1=gzip,Inflate_1=Inflate,inflate_1=inflate,inflateRaw_1=inflateRaw,ungzip_1=ungzip,constants_1=constants$2,pako={Deflate:Deflate_1,deflate:deflate_1,deflateRaw:deflateRaw_1,gzip:gzip_1,Inflate:Inflate_1,inflate:inflate_1,inflateRaw:inflateRaw_1,ungzip:ungzip_1,constants:constants_1};const noLogEvents=["heartbeat","onNetQuality","networkQualityChange"],compressArrayBuffer=_=>{const q=new Uint8Array(_),k=pako.deflate(q,{gzip:!0});return new Uint8Array(k==null?void 0:k.buffer)},decompressArrayBuffer=_=>{const q=new Uint8Array(_),k=pako.inflate(q,{gzip:!0});return new Uint8Array(k==null?void 0:k.buffer)},sendMessageFormat=_=>{const{event:q}=_;switch(_.data_original=_.data,_.time&&(_.timeStr=E(_.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),q){case"login":_.data=com.quick.voice.proto.Login.encode(_.data).finish();break;case"joinRoom":case"joinRoomEx":_.data=com.quick.voice.proto.JoinReq.encode(_.data).finish();break;case"quitRoom":_.data=com.quick.voice.proto.QuitReq.encode(_.data).finish();break;case"connectCF":_.data=com.quick.voice.proto.ConnectCFReq.encode(_.data).finish(),_.data=compressArrayBuffer(_.data),_.compress=!0;break;case"publish":_.data=com.quick.voice.proto.PublishReq.encode(_.data).finish(),_.data=compressArrayBuffer(_.data),_.compress=!0;break;case"subscribe":_.data=com.quick.voice.proto.SubscribeReq.encode(_.data).finish();break;case"closeTrack":_.data=com.quick.voice.proto.CloseTrackReq.encode(_.data).finish(),_.data=compressArrayBuffer(_.data),_.compress=!0;break;case"renegotiate":_.data=com.quick.voice.proto.RenegotiateReq.encode(_.data).finish(),_.data=compressArrayBuffer(_.data),_.compress=!0;break;case"syncRoomInfo":_.data=com.quick.voice.proto.SyncRoomInfoReq.encode(_.data).finish();break;case"updateCall":_.data=com.quick.voice.proto.UpdateCall.encode(_.data).finish();break;case"networkQualityChange":_.data=com.quick.voice.proto.NetQualityChange.encode(_.data).finish();break;case"pubNotify":_.data=com.quick.voice.proto.PublishNotify.encode(_.data).finish();break;default:_.data=new Uint8Array;break}return _},onMessageFormat=_=>{const{event:q,compress:k=!1}=_;if(_.data_remote=_.data,_.time&&(_.timeStr=E(_.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),k)try{_.data=decompressArrayBuffer(_.data)}catch(D){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",D)}switch(q){case"login":_.data=com.quick.voice.proto.Login.decode(_.data);break;case"joinRoom":case"joinRoomEx":_.data=com.quick.voice.proto.JoinRsp.decode(_.data);break;case"onJoinRoom":_.data=com.quick.voice.proto.JoinNotify.decode(_.data);break;case"onQuitRoom":_.data=com.quick.voice.proto.QuitNotify.decode(_.data);break;case"connectCF":_.data=com.quick.voice.proto.ConnectCFRsp.decode(_.data);break;case"publish":_.data=com.quick.voice.proto.PublishRsp.decode(_.data);break;case"onPublish":_.data=com.quick.voice.proto.PublishNotify.decode(_.data);break;case"subscribe":_.data=com.quick.voice.proto.SubscribeRsp.decode(_.data);break;case"closeTrack":_.data=com.quick.voice.proto.CloseTrackRsp.decode(_.data);break;case"onCloseTrack":_.data=com.quick.voice.proto.CloseTrackNotify.decode(_.data);break;case"onUpdateCall":_.data=com.quick.voice.proto.UpdateCall.decode(_.data);break;case"onDestroyRoom":_.data=com.quick.voice.proto.QuitNotify.decode(_.data);break;case"onUpdatePermissions":_.data=com.quick.voice.proto.UpdatePermissions.decode(_.data);break;case"onNetQuality":_.data=com.quick.voice.proto.NetQualityNotify.decode(_.data);break;case"syncRoomInfo":_.data=com.quick.voice.proto.SyncRoomInfoRsp.decode(_.data);break;case"onCDNPlayUrlAdd":_.data=com.quick.voice.proto.CDNPlayAddressNotify.decode(_.data);break;case"debugger":_.data=JSON.parse(new TextDecoder().decode(_.data));break}return _};class CallsWebSocket{constructor(q){lt(this,at);lt(this,ct,{url:"wss://demo.putplay.cc/websocket",debug:!1,reconnectCount:10,timeout:30*1e3});lt(this,dt,"");lt(this,ht,{});lt(this,yt,{});H(this,"state","closed");H(this,"sendMessageBefore",async()=>{});H(this,"onReconnectSuccess",q=>{});H(this,"onReconnectStop",q=>{});lt(this,It,q=>{let k=!0;const{code:D=1e3,reason:$=""}=q;return D===1e3&&($==="quit success!"||$==="replace old connection!")&&(k=!1),k});lt(this,Rt,async q=>{G(this,ct).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连成功",q),this.state="connected",this.onReconnectSuccess(q)});lt(this,Et,async q=>{G(this,ct).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连停止",q),this.close(),this.state="closed",this.onReconnectStop(q)});lt(this,xt,()=>{const q={event:"heartbeat",sn:+`${O(1e5,999999)}`};return com.quick.voice.proto.CommonReq.encode(q).finish()});lt(this,$t,(q,k={})=>{try{const{time:D,event:$,data:I={},data_original:e={},data_remote:u,...N}=k,A=E(D,"YYYY-MM-DD hh:mm:ss",{offset:480});let U={};const L=(V={})=>{const X=JSON.parse(JSON.stringify(V)),Y=Object.keys(X);for(const et of Y)(et.includes("sdp")||et.includes("Sdp"))&&(X[et]="");return X};let P="res ↓";switch(q){case"res":P="res ↓",U=L(I);break;case"req":P="req ↑",U=L(e);break}let Z="#quickvo.logs";ignoreEvent.includes($)&&(Z="#quickvo.ignoreEvents");const F={"#action":P,timeStr:A,event:$,data:U,time:D,...N},W=localStorage.getItem(Z)||JSON.stringify([]),J=JSON.parse(W),z=[F,...J].slice(0,500);localStorage.setItem(Z,JSON.stringify(z))}catch(D){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",D)}});lt(this,Nt,(q,{resolve:k,reject:D})=>{const{sn:$}=q,I=()=>{const u=G(this,ht)[$];clearTimeout(u.destructionTimer),delete G(this,ht)[$]},e=setTimeout(()=>{const u=G(this,ht)[$];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:event is timeout",u.message),I(),D("event is timeout")},G(this,ct).timeout);G(this,ht)[$]={message:q,resolve:k,reject:D,destruction:I,destructionTimer:e}});lt(this,At,q=>G(this,ht)[q]);lt(this,qt,async q=>{const k=new Uint8Array(q),D=com.quick.voice.proto.CommonRsp.decode(k),{sn:$,event:I}=D,e=onMessageFormat(D);if(G(this,ct).debug&&(noLogEvents.includes(I)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",e),ignoreEvent.includes(I)||G(this,$t).call(this,"res",e)),notifyName_keys.includes(I))return this.emitNotify(I,v$1(e,["code","data","desc"]));const N=G(this,At).call(this,$);if(N){const{resolve:A=L=>{},destruction:U=()=>{}}=N;A(v$1(e,["code","data","desc"])),U()}});H(this,"clearEvents",(q=[])=>{const k=Object.keys(G(this,ht));q.length===0&&(q=k);for(const D of k){if(!q.includes(D))continue;const $=G(this,ht)[D];clearTimeout($.destructionTimer),delete G(this,ht)[D]}});H(this,"connect",async(q="")=>new Promise(async k=>{q&&vt(this,dt,q),G(this,at)&&(await G(this,at).close(),this.state="closed");const D=`${G(this,ct).url}?s=${G(this,dt)}&t=${Date.now()}`;vt(this,at,new M({...G(this,ct),url:D,binaryType:"arraybuffer",onMessage:G(this,qt),checkReconnect:G(this,It),getHeartbeatMsg:G(this,xt),onReconnectSuccess:G(this,Rt),onReconnectStop:G(this,Et)})),this.state="connecting",await G(this,at).connect(),this.state="connected",G(this,ct).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 当前广播事件",G(this,yt)),k(G(this,at))}));H(this,"close",async()=>{var k;G(this,ct).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.");const q=Object.keys(G(this,ht));for(const D of q){const{destructionTimer:$}=G(this,ht)[D];clearTimeout($)}vt(this,ht,{}),await((k=G(this,at))==null?void 0:k.close()),vt(this,at,void 0),this.state="closed"});H(this,"sendMessage",(q,k=!0)=>new Promise(async(D,$)=>{var U;await this.sendMessageBefore();const{event:I,...e}=q,u=Date.now(),N=sendMessageFormat({event:I,sn:+`${u}${O(1e3,9999)}`,time:u,valid:G(this,ct).timeout,version:1,compress:!1,...e});G(this,ct).debug&&(noLogEvents.includes(I)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",N),ignoreEvent.includes(I)||G(this,$t).call(this,"req",N)),k&&G(this,Nt).call(this,N,{resolve:D,reject:$});const A=com.quick.voice.proto.CommonReq.encode(N).finish();(U=G(this,at))==null||U.sendMessage(A)}));H(this,"emitNotify",async(q,k)=>{const D=G(this,yt)[q]||[];for(const $ of D){const{callback:I=async()=>{}}=$;await I(k)}});H(this,"addNotify",(q,k=!1)=>{const{event:D,sn:$=pt(32)}=q;G(this,yt)[D]||(G(this,yt)[D]=[]);const I=G(this,yt)[D],e=I.findIndex(u=>u.sn===$);return e!==-1&&I.splice(e,1),k?I.unshift(q):I.push(q),$});H(this,"removeNotify",(q=[])=>{if(q.length===0)vt(this,yt,{});else{const k=Object.keys(G(this,yt));for(const D of k)G(this,yt)[D]=G(this,yt)[D].filter($=>!q.includes($.sn||""))}G(this,ct).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",G(this,yt))});vt(this,ct,{...G(this,ct),...q})}}at=new WeakMap,ct=new WeakMap,dt=new WeakMap,ht=new WeakMap,yt=new WeakMap,It=new WeakMap,Rt=new WeakMap,Et=new WeakMap,xt=new WeakMap,$t=new WeakMap,Nt=new WeakMap,At=new WeakMap,qt=new WeakMap;var p=Object.defineProperty,x=_=>{throw TypeError(_)},g=(_,q,k)=>q in _?p(_,q,{enumerable:!0,configurable:!0,writable:!0,value:k}):_[q]=k,h=(_,q,k)=>g(_,typeof q!="symbol"?q+"":q,k),y=(_,q,k)=>q.has(_)||x("Cannot "+k),n=(_,q,k)=>(y(_,q,"read from private field"),k?k.call(_):q.get(_)),a=(_,q,k)=>q.has(_)?x("Cannot add the same private member more than once"):q instanceof WeakSet?q.add(_):q.set(_,k),b=(_,q,k,D)=>(y(_,q,"write to private field"),q.set(_,k),k),d,o,f;class K{constructor(q){a(this,d,new Map),a(this,o,[]),h(this,"index"),h(this,"setCondition",(k,D)=>{n(this,d).set(k,D),D&&n(this,f).call(this)}),h(this,"addTask",(k,D,$={})=>{const I={key:"",strict:!1,describe:"",...$};let{key:e,strict:u,describe:N}=I;e?this.clear([e]):e=`${this.index++}`;{const A={key:e,func:k,conditionKeys:D,describe:N,strict:u};n(this,o).unshift(A)}return n(this,f).call(this),e}),h(this,"clear",(k=[])=>{if(k.length===0){b(this,o,[]);return}for(const D of k){const $=n(this,o).findIndex(I=>I.key===D);$!==-1&&n(this,o).splice($,1)}}),h(this,"getConditions",()=>Object.fromEntries(n(this,d))),h(this,"getTasks",()=>{const k=[];for(const D of n(this,o)){const{key:$,describe:I,conditionKeys:e}=D;k.push({key:$,describe:I,conditionKeys:e})}return k}),h(this,"checkConditions",k=>{let D=!0;for(const $ of k)if(n(this,d).get($)===!1){D=!1;break}return D}),a(this,f,()=>{const k=n(this,o).length;for(let D=k;D>0;D--){const $=D-1,I=n(this,o)[$],{conditionKeys:e,func:u,strict:N}=I,A=this.checkConditions(e);{if(!A)return;u()}{if(N)return;n(this,o).splice($,1)}}}),this.index=0;for(const k of q)n(this,d).set(k,!1)}}d=new WeakMap,o=new WeakMap,f=new WeakMap;class RoomBase{constructor(){H(this,"options",{appid:"",sdkToken:"",roomId:"",userId:"",callType:0,debug:!1,newPublishAutoSubscribe:!0});H(this,"prohibitNotify",!1);H(this,"isEarly",!1);H(this,"taskQueue",new K(["createWs","createSession","ice","joinRoom","createTrack","subscribe","closeTrack"]));H(this,"roomState","ready");H(this,"createAt",Date.now());H(this,"cwsIns",new CallsWebSocket);H(this,"peerIns",new RTCPeerConnection({bundlePolicy:"max-bundle"}));H(this,"transceiverMap",new Map);H(this,"userMap",new Map);H(this,"mediaDevicesErrInfo",{microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""});H(this,"initAsyncQueue",()=>{this.taskQueue.clear(),this.taskQueue.setCondition("createSession",!0),this.taskQueue.setCondition("ice",!0),this.taskQueue.setCondition("joinRoom",!0),this.taskQueue.setCondition("createTrack",!0),this.taskQueue.setCondition("closeTrack",!0),this.taskQueue.setCondition("subscribe",!0)});H(this,"getRoomInfo",()=>{const{options:q,roomState:k,createAt:D}=this;return{...q,roomState:k,createAt:D}});H(this,"setRoomState",q=>{this.roomState=q;const k=enum_roomState[q],D={state:q,stateStr:k};this.cwsIns.emitNotify("onRoomState",{code:200,data:D,desc:"room state is change."})});H(this,"setOptions",async q=>{const k={...this.options,...q};this.options=k});H(this,"initCwsCall",()=>{this.cwsIns=new CallsWebSocket({...this.options})});H(this,"getMediaDevicesErrInfo",async()=>{try{const q=await navigator.mediaDevices.enumerateDevices();q.find(D=>D.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),q.find(D=>D.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(q){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe:error",q)}return this.mediaDevicesErrInfo});H(this,"getUserMediaKey",(q,k)=>`${q}-${k}`);H(this,"getCallActionMap",(q=0)=>{const D=Number(q).toString(2).padStart(4,"0").split(""),[$,I,e,u]=D;return{microphoneCamera_audio:!!Number(u),microphoneCamera_video:!!Number(e),screenSharing_video:!!Number(I),screenSharing_audio:!!Number($)}});H(this,"getAverageVolume",(q,k)=>{q.getByteFrequencyData(k);let D=0;for(let I=0;I<k.length;I++)D+=k[I];return Math.ceil(D/k.length)});H(this,"getCallAction",async q=>{let k="";const D=I=>q.findIndex(({type:u,enabled:N=!0})=>u===I&&N)===-1?"0":"1";return k=`${D(0)}${k}`,k=`${D(1)}${k}`,k=`${D(2)}${k}`,k=`${D(3)}${k}`,parseInt(k,2)});H(this,"getTrackNamesFormTracks",(q,k=[],D="trackName")=>{const $=[];for(const I of q){const{type:e}=I;if(k.length===0||k.includes(e)){const u=I[D];u&&$.push(`${u}`)}}return $});H(this,"usersFilter",q=>mt(q,["id","isSelf","joinTime","tracks","callAction","callActionStr","callActionMap","network","updateStreams","permissions","isPublished"]).sort(($,I)=>$.id.localeCompare(I.id,"en")));this.initAsyncQueue()}}const createMutedAudioStream=()=>{const _=new AudioContext,q=_.createOscillator();q.type="sine",q.frequency.setValueAtTime(0,_.currentTime);const k=_.createGain();k.gain.value=0,q.connect(k),k.connect(_.destination),q.start();const D=_.createMediaStreamDestination();return k.disconnect(),q.connect(D),D.stream},createFakeVideoStream=(_=10,q=10,k=30)=>{const D=document.createElement("canvas"),$=D.getContext("2d");D.width=_,D.height=q;let I=0;return setInterval(()=>{$.clearRect(0,0,D.width,D.height);const N=$.createLinearGradient(0,0,D.width,D.height);N.addColorStop(0,`hsla(${I}, 100%, 50%, 0)`),N.addColorStop(1,`hsla(${I+120}, 100%, 50%, 0)`),$.fillStyle=N,$.fillRect(0,0,D.width,D.height),I=(I+1)%360},100),D.captureStream(k)},phoneyStreams={microphoneCamera_audio:createMutedAudioStream(),microphoneCamera_video:createFakeVideoStream(),screenSharing_video:createFakeVideoStream(),screenSharing_audio:createMutedAudioStream()};class RoomMedias extends RoomBase{constructor(){super();H(this,"mediaDevices",[]);lt(this,kt,new Map);lt(this,bt,new Map);lt(this,_t,new Map);lt(this,Tt,new Map);lt(this,Dt,()=>{for(const k of mediaType_keys)G(this,Tt).set(k,phoneyStreams[k])});H(this,"getPhoneyStreams",k=>G(this,Tt).get(k));lt(this,Ct,()=>{G(this,bt).set("microphoneCamera_audio",{}),G(this,bt).set("microphoneCamera_video",{width:{ideal:1920},height:{ideal:1080},frameRate:{min:10,ideal:30}}),G(this,bt).set("screenSharing_video",{width:{ideal:1920},height:{ideal:1080},frameRate:{min:10,ideal:30}}),G(this,bt).set("screenSharing_audio",{})});lt(this,Ut,()=>{G(this,kt).set("audioinput","default"),G(this,kt).set("videoinput","default"),G(this,kt).set("audiooutput","default")});H(this,"emitNotifyUpdateUsersStreams",async k=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:k,desc:"users streams is change."})});H(this,"initUserMediaStreamContext",async(k,D,$)=>{var N;const[I]=$.getTracks();if(!I){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: tracks.length is 0.",{userId:k,mediaType:D,stream:$});return}this.removeUserMediaStreamContext(k,D);const e=this.getUserMediaKey(k,D),{kind:u}=I;switch(u){case"audio":{const A=new AudioMediaContext(I);G(this,_t).set(e,A)}break;case"video":{const A=new VideoMediaContext(I);G(this,_t).set(e,A)}break}{const A=this.getUserMediaStreamContext(k,D);if(A&&A.kind==="audio")try{const U=G(this,kt).get("audiooutput");(N=A.audioContext)==null||N.setSinkId(U)}catch(U){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error",U)}}});H(this,"getUserMediaStreamContext",(k,D)=>{const $=this.getUserMediaKey(k,D);return G(this,_t).get($)});H(this,"getUserAudioMediaStreamContext",(k,D)=>{const $=this.getUserMediaKey(k,D);return G(this,_t).get($)});H(this,"removeUserMediaStreamContext",(k,D)=>{const $=this.getUserMediaKey(k,D),I=G(this,_t).get($);I==null||I.stop(),G(this,_t).delete($)});H(this,"getUserStream",(k,D)=>{const $=this.getUserMediaStreamContext(k,D);return($==null?void 0:$.getStream())||new MediaStream});H(this,"getUserStreams",(k,D=[])=>{D.length===0&&(D=mediaType_keys);const $={};for(const I of D){const e=this.getUserStream(k,I);$[I]=e}return $});H(this,"removeUserStreams",async(k,D=[])=>{D.length===0&&(D=mediaType_keys);for(const $ of D)this.removeUserMediaStreamContext(k,$)});H(this,"clearUserStreams",()=>{const k=G(this,_t).values();for(const D of k)D.stop();vt(this,_t,new Map)});H(this,"setMediaTrackConstraints",async(k,D)=>{G(this,bt).set(k,D);const I=this.getUserStream(this.options.userId,k).getTracks();if(I.length!==0)for(const e of I){const N={...e.getConstraints(),...D};await e.applyConstraints(N)}});H(this,"initLocalStream",async k=>{const{userId:D}=this.options,$=G(this,bt).get(k);switch(k){case"microphoneCamera_audio":{const I=G(this,kt).get("audioinput"),e=await navigator.mediaDevices.getUserMedia({audio:{deviceId:I,...$},video:!1});await this.initUserMediaStreamContext(D,"microphoneCamera_audio",e)}break;case"microphoneCamera_video":{const I=G(this,kt).get("videoinput"),e=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:I,...$}});await this.initUserMediaStreamContext(D,"microphoneCamera_video",e)}break;case"screenSharing_audio":{const I=await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...$}),e=I.getTracks();for(const u of e){const{kind:N}=u,A=new MediaStream;A.addTrack(u),I.removeTrack(u),N==="audio"&&await this.initUserMediaStreamContext(D,"screenSharing_audio",A),N==="video"&&await this.initUserMediaStreamContext(D,"screenSharing_video",A)}}break;case"screenSharing_video":{const I=await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...$});await this.initUserMediaStreamContext(D,"screenSharing_video",I)}break}this.emitNotifyUpdateUsersStreams([{userId:D,updateStreams:{[k]:!0}}])});lt(this,Ot,async()=>!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices?(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 不支持 enumerateDevices"),[]):(await navigator.mediaDevices.enumerateDevices().then(k=>{this.mediaDevices=k}).catch(function(k){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",k)}),this.mediaDevices));lt(this,Mt,()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await G(this,Ot).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),G(this,Ot).call(this)});H(this,"getMediaDeviceKind",k=>G(this,kt).get(k));H(this,"replaceSenderStream",async(k=[],D)=>{const{userId:$}=this.options;k.length===0&&(k=mediaType_keys);for(const I of k){const e=this.transceiverMap.get(I);let u;if(e){const{sender:N}=e;D?u=this.getUserStream($,I):u=this.getPhoneyStreams(I);const[A]=u.getTracks();N.replaceTrack(A)}}});H(this,"setMediaDeviceKind",async(k,D)=>{G(this,kt).set(k,D);const{userId:$}=this.options;if(k==="audioinput"&&this.getUserMediaStreamContext($,"microphoneCamera_audio")&&(await this.initLocalStream("microphoneCamera_audio"),await this.replaceSenderStream(["microphoneCamera_audio"],!0)),k==="videoinput"&&this.getUserMediaStreamContext($,"microphoneCamera_video")&&(await this.initLocalStream("microphoneCamera_video"),await this.replaceSenderStream(["microphoneCamera_video"],!0)),k==="audiooutput"){const I=G(this,_t).values();for(const e of I)e.kind==="audio"&&"setSinkId"in HTMLMediaElement.prototype&&e.audioContext.setSinkId(D)}});H(this,"setAudioOutputDevice",k=>this.setMediaDeviceKind("audiooutput",k));H(this,"getEnumerateDevices",async k=>(await G(this,Ot).call(this),this.mediaDevices.filter($=>$.kind===k)));H(this,"getEnumerateAudioinputDevices",()=>this.getEnumerateDevices("audioinput"));H(this,"getEnumerateAudioOutputDevices",()=>this.getEnumerateDevices("audiooutput"));H(this,"getEnumerateVideoinputDevices",()=>this.getEnumerateDevices("videoinput"));G(this,Mt).call(this),G(this,Ut).call(this),G(this,Ct).call(this),G(this,Dt).call(this)}}kt=new WeakMap,bt=new WeakMap,_t=new WeakMap,Tt=new WeakMap,Dt=new WeakMap,Ct=new WeakMap,Ut=new WeakMap,Ot=new WeakMap,Mt=new WeakMap;class RoomUsers extends RoomMedias{constructor(){super();H(this,"getMaxVolumeUser",()=>{const k=Array.from(this.userMap.values(),({id:$})=>$);if(k.length===0)return;let D=[];for(const $ of k){const I=this.getUserMediaStreamContext($,"microphoneCamera_audio");if(!I||I.kind!=="audio")continue;const e=I.getVolume();D.push({id:$,volume:e})}return D=D.sort(($,I)=>$.volume-I.volume>0?-1:1),D[0]});H(this,"setAudioFilter",async(k={})=>{const D=await this.getUsersId();for(const $ of D){{const I=this.getUserMediaStreamContext($,"microphoneCamera_audio");(I==null?void 0:I.kind)==="audio"&&(I==null||I.setFilter(k))}{const I=this.getUserMediaStreamContext($,"screenSharing_audio");(I==null?void 0:I.kind)==="audio"&&(I==null||I.setFilter(k))}}});H(this,"setVolume",(k,D,$)=>{const I=this.getUserMediaStreamContext(k,D);(I==null?void 0:I.kind)==="audio"&&(I==null||I.setVolumeGain($))});H(this,"getVolume",(k,D)=>{const $=this.getUserMediaStreamContext(k,D);let I=0;return($==null?void 0:$.kind)==="audio"&&(I=$==null?void 0:$.getVolume()),I});H(this,"clearUsers",()=>{this.userMap=new Map});H(this,"removeUsers",async k=>{for(const D of k)this.userMap.delete(D),await this.removeUserStreams(D)});H(this,"createUser",async k=>{const D=Date.now(),$={id:k,permissions:0,callAction:0,callActionStr:"",callActionMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},callState:0,isSelf:k===this.options.userId,isPublished:!1,joinTime:D,updateAt:D,network:{egress:0,ingress:0},tracks:[],updateStreams:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1}};this.userMap.set(k,$)});H(this,"getUser",async k=>(this.userMap.has(k)||await this.createUser(k),this.userMap.get(k)));H(this,"getUsers",async(k=[])=>{k.length===0&&(k=[...this.userMap.keys()]);const D=[];for(const $ of k){const I=await this.getUser($);D.push(I)}return D});H(this,"getAllUserTrackMids",async()=>{const k=await this.getUsers(),D=[];for(const $ of k){const{tracks:I=[]}=$;for(const e of I)D.push(e.mid)}return D});H(this,"getUserTrackByTrackName",async k=>{const D=await this.getUsers(),$=[];for(const I of D){const{tracks:e=[]}=I;for(const u of e){const{trackName:N}=u;k.includes(N)&&$.push(u)}}return $});H(this,"getUserTrackFromMid",async k=>{const D=await this.getUsers();let $;for(const I of D){const{tracks:e=[]}=I;for(const u of e)if(u.mid===k){$=u;break}}return $});H(this,"checkUserInRoom",k=>this.userMap.has(k));H(this,"getUsersId",async()=>[...this.userMap.keys()]);H(this,"getCaller",async()=>await this.getUser(this.options.userId));H(this,"updateIsPublished",async(k,D=!1)=>{const $=await this.getUser(k);$.isPublished=D});H(this,"setUserUpdateStreams",async(k,D,$=!0)=>{const I=await this.getUser(k),e={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};e[D]=$,I.updateStreams=e});H(this,"updateUsertracks",async(k,D=[],$)=>{const I=await this.getUser(k);$&&(D=[...I.tracks,...D]),D=D.filter(({mid:N=""})=>N!==""),D=it(D,["type"]),D=D.sort((N,A)=>N.type-A.type<0?-1:1);for(const N of D)N.userId=k,N.mediaType=mediaType_keys[N.type],N.enabled===void 0&&(N.enabled=!0);I.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const e=mt(I.tracks,["mediaType","enabled","mid","msid","trackName"]),u=mt(D,["mediaType","enabled","mid","msid","trackName"]);{const N="microphoneCamera_audio",A=u.find(P=>P.mediaType===N),U=e.find(P=>P.mediaType===N),L=JSON.stringify(A)!==JSON.stringify(U);I.updateStreams[N]=L}{const N="microphoneCamera_video",A=u.find(P=>P.mediaType===N),U=e.find(P=>P.mediaType===N),L=JSON.stringify(A)!==JSON.stringify(U);I.updateStreams[N]=L}{const N="screenSharing_audio",A=u.find(P=>P.mediaType===N),U=e.find(P=>P.mediaType===N),L=JSON.stringify(A)!==JSON.stringify(U);I.updateStreams[N]=L}{const N="screenSharing_video",A=u.find(P=>P.mediaType===N),U=e.find(P=>P.mediaType===N),L=JSON.stringify(A)!==JSON.stringify(U);I.updateStreams[N]=L}I.tracks=D});H(this,"updateUserCallAction",async(k,D=0)=>{const $=await this.getUser(k);$.callAction=D,$.callActionStr=D.toString(2).padStart(4,"0"),$.callActionMap=this.getCallActionMap(D)});H(this,"updateUserNetwork",async(k,D={egress:5,ingress:5})=>{const $=await this.getUser(k);$.network=D});H(this,"updateUserPermissions",async(k,D)=>{if(D){const $=await this.getUser(k);$.permissions=D}});H(this,"updateUserBase",async k=>{const D=await this.getUser(k);D.isSelf=k===this.options.userId,D.updateAt=Date.now()});H(this,"updateUsers",async k=>{for(const D of k){const{id:$,tracks:I,callAction:e,permissions:u,isPublished:N}=D;await this.updateUserBase($),await this.updateIsPublished($,N),await this.updateUserPermissions($,u),await this.updateUsertracks($,I,!0),await this.updateUserCallAction($,e),await this.updateUserNetwork($)}});H(this,"emitNotifyUpdateUser",async k=>{const D=await this.getUsers([k]),[$]=this.usersFilter(D);this.cwsIns.emitNotify("onRoomUser",{code:200,data:$,desc:"user info is change."})});H(this,"emitNotifyUpdateUsers",async()=>{const k=await this.getUsers(),D=this.usersFilter(k);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:D,desc:"all users info is change."})})}}class RoomPeer extends RoomUsers{constructor(){super();H(this,"getPeerStatsTimer",0);H(this,"reports",[]);H(this,"peerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});H(this,"connectedResolveMap",new Map);H(this,"initPeer",()=>{this.peerIns=new RTCPeerConnection({bundlePolicy:"max-bundle"}),this.transceiverMap=new Map,G(this,Pt).call(this),G(this,Lt).call(this)});H(this,"getSenderTracks",(k=[])=>{const D=[];for(const $ of k){const I=this.transceiverMap.get($);if(!I)continue;const{mid:e,sender:u}=I,{track:N}=u;if(!N)continue;const{id:A,enabled:U}=N,P={type:mediaType_keys.findIndex(Z=>Z===$),enabled:U,trackName:A,location:"local",mid:e};D.push(P)}return D});H(this,"addSenders",async(k=[])=>{k.length===0&&this.peerIns.addTransceiver("audio",{direction:"sendonly"});const D=[];for(const $ of k){if(this.transceiverMap.has($))continue;const I=this.getPhoneyStreams($),[e]=I.getTracks(),u=this.peerIns.addTransceiver(e,{direction:"sendonly"});this.transceiverMap.set($,u),D.push($)}if(k.length===0||D.length){const $=await this.peerIns.createOffer();if(this.options.debug){const I=libExports.parse($.sdp),e=mt(I.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->Breathe: setLocalDescription",{msidArr:e,sdpJson:I,description:$})}await this.peerIns.setLocalDescription($)}return D});H(this,"removeSenders",async(k=[])=>{for(const D of k)this.transceiverMap.has(D)&&this.transceiverMap.delete(D)});H(this,"clearTransceivers",async()=>{const k=await this.getAllUserTrackMids(),D=this.peerIns.getTransceivers();for(const $ of D){const{mid:I}=$;Number(I)===0||k.includes(I)||($.stop(),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->Breathe: clearTransceivers: ${I} is stop.`,$))}});H(this,"onSubscribeUserTracks",k=>{let D=0;return new Promise(async $=>{const I=[];for(const e of k){const{tracks:u=[]}=e;for(const N of u){const{trackName:A,mid:U}=N,[L]=await this.getUserTrackByTrackName([A]);I.push({...L,mid:U})}}{let e=[];const u=async()=>{clearTimeout(D);const A=new Map;for(const L of e){const{userId:P,mediaType:Z}=L;if(!P||!Z)continue;A.has(P)||A.set(P,{userId:P,tracks:[],updateStreams:{}});const W=A.get(P);W.tracks.push(L),W.updateStreams[Z]=!0}const U=[...A.values()];for(const L of U){const{userId:P,tracks:Z}=L;await this.updateUsertracks(P,Z,!0)}await this.emitNotifyUpdateUsersStreams(U),this.peerIns.removeEventListener("track",N),$(!0)},N=async A=>{const{streams:U,transceiver:L}=A,[P]=U,{mid:Z,receiver:F}=L,{track:W}=F,{id:J,kind:z}=W,V=I.find(et=>et.mid===`${Z}`);if(!V)return;const{userId:X,mediaType:Y}=V;if(!(!X||!Y)){if(await this.initUserMediaStreamContext(X,Y,P),z==="audio"){const et=this.getUserMediaStreamContext(X,Y);(et==null?void 0:et.kind)==="audio"&&et.setMute(!1)}{const et={...V,mid:Z,msid:J};e.push(et)}this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->Breathe: await subscribe ${e.length}/${I.length}`,{mediaType:Y,mid:Z,userTrack:V,e:A}),I.length===e.length&&u()}};this.peerIns.addEventListener("track",N),D=setTimeout(()=>u(),5*1e3)}})});lt(this,Pt,()=>{let k=0;const D=()=>{this.setRoomState("closed")};this.peerIns.onconnectionstatechange=()=>{const $=this.peerIns.connectionState;switch(clearTimeout(k),$){case"connected":this.taskQueue.setCondition("ice",!0),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${$}`);break;case"disconnected":k=setTimeout(D,30*1e3),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${$}`);break;case"failed":this.peerIns.restartIce();break;case"closed":D(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${$}`);break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${$}`);break}}});H(this,"closeUserTracks",async(k,D=[],$=!1)=>{const I=[];for(const A of D){const{trackName:U,msid:L}=A;I.push(U),L&&I.push(L)}const e=A=>I.includes(A),u=await this.getUser(k);if(!u)return;for(const A of u.tracks){const{trackName:U,msid:L,userId:P,mediaType:Z}=A;!P||!Z||!e(U)||(this.removeUserMediaStreamContext(P,Z),L&&delete A.msid)}if($){const A=u.tracks.filter(({trackName:U})=>!e(U));await this.updateUsertracks(k,A,!1)}const N=this.peerIns.getTransceivers();for(const A of N){const{sender:U,receiver:L}=A;U.track&&e(U.track.id)&&(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->Breathe: sender: ${U.track.id} is stop.`,A),U.track.enabled=!1,U.track.stop(),this.peerIns.removeTrack(U),A.stop()),L.track&&e(L.track.id)&&(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->Breathe: receiver: ${L.track.id} is stop.`,A),L.track.enabled=!1,L.track.stop(),A.stop())}});H(this,"createOffer",async()=>{const k=await this.peerIns.createOffer();if(this.options.debug){const D=libExports.parse(k.sdp),$=mt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->Breathe: createOffer",{msidArr:$,sdpJson:D,description:k})}await this.peerIns.setLocalDescription(k)});H(this,"createAnswer",async()=>{const k=await this.peerIns.createAnswer();if(this.options.debug){const D=libExports.parse(k.sdp),$=mt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->Breathe: createAnswer",{msidArr:$,sdpJson:D,description:k})}await this.peerIns.setLocalDescription(k)});H(this,"getSdp",()=>{var k;return(k=this.peerIns.localDescription)==null?void 0:k.sdp});H(this,"setRemoteDescription",async k=>{if(this.options.debug){const D=libExports.parse(k.sdp),$=mt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->Breathe: setRemoteDescription",{msidArr:$,sdpJson:D,description:k})}return await this.peerIns.setRemoteDescription(k),k});H(this,"getPeerNetwork",()=>this.peerNetwork);H(this,"setCallStrategy",async(k,D=[])=>{D.length===0&&(D=mediaType_keys);let $="balanced";switch(k){case"qualityPriority":$="maintain-resolution";break;case"fluencyPriority":$="maintain-framerate";break;case"balancedDowngrade":$="balanced";break}const I=await this.getCaller(),e=Array.from(I.tracks,({trackName:N})=>N),u=this.peerIns.getSenders();for(const N of u){const{track:A}=N;if(!A||!e.includes(A.id))continue;const U=N.getParameters();N.setParameters({...U,degradationPreference:$})}});H(this,"setRTCRtpSenderParameters",k=>{try{const D=this.peerIns.getSenders();for(const $ of D){const I=$.getParameters();$.setParameters({...I,...k})}}catch(D){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",D)}});H(this,"getReportsByMid",async(k=[])=>k.length===0?this.reports:this.reports.filter(D=>k.includes(D.mid)));H(this,"getRoomNetwork",()=>this.peerNetwork);lt(this,Bt,async()=>{try{const k=await this.peerIns.getStats(),D=["inbound-rtp","remote-inbound-rtp","outbound-rtp"],I=[...k.values()].filter(et=>D.includes(et.type));let e=0,u=0,N=0,A=0,U=0,L=0,P=[],Z=[];for(const et of this.reports){const{packetsSent:ft,packetsLost:tt}=et;ft&&(N+=ft),tt&&(A+=tt)}this.reports=I;for(const et of this.reports){const{bytesReceived:ft,bytesSent:tt,packetsSent:st,packetsLost:rt,jitter:nt,roundTripTime:ot}=et;ft&&(e=ft),tt&&(u=tt),st&&(U+=st),rt&&(L+=rt),ot&&P.push((ot*100).toFixed(2)),nt&&Z.push(nt.toFixed(2))}Z.sort().reverse(),P.sort().reverse();const F=U-N,W=L-A,J=F===0?"0.00":(W/F).toFixed(2),[z="0"]=P,[V="0"]=Z,X={inboundBytes:e,outboundBytes:u,lostRate:J,roundTripTime:z,jitter:V};this.peerNetwork=X;const Y=(et,ft,tt)=>{const st=Number(et),rt=Number(ft),nt=Number(tt);let ot="0";return st<.03&&rt<100&&nt<.05?ot="5":st<.06&&rt<160&&nt<.1?ot="4":st<.1&&rt<250&&nt<.15?ot="3":st<.15&&rt<400&&nt<.2?ot="2":ot="1",Number(ot)};{const et=Y(J,z,V),ft=await this.getCaller(),{network:tt}=ft,st={egress:et,ingress:et},rt=JSON.stringify(tt)!==JSON.stringify(st);if(await this.updateUserNetwork(this.options.userId,st),rt){this.emitNotifyUpdateUsers();const{userId:nt,roomId:ot}=this.options;this.cwsIns.sendMessage({event:"networkQualityChange",data:{...st,userId:nt,roomId:ot}},!1)}}}catch(k){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: setNetQuality is err.",k)}});lt(this,Lt,()=>{const k=async()=>{this.peerIns.connectionState!=="connected"||!this.options.roomId||G(this,Bt).call(this)};this.getPeerStatsTimer=setInterval(k,1*1e3)});H(this,"stopGetPeerStats",()=>clearInterval(this.getPeerStatsTimer))}}Pt=new WeakMap,Bt=new WeakMap,Lt=new WeakMap;class RoomCalls extends RoomPeer{constructor(){super();H(this,"sdk_service_version","1.0.5");H(this,"setLocalStream",(k,D)=>new Promise(async($,I)=>{try{const{userId:e}=this.options;if(D?await this.initLocalStream(k):this.removeUserMediaStreamContext(e,k),k==="screenSharing_audio"||k==="screenSharing_video"){{const A=this.getUserStream(e,"screenSharing_audio").getTracks();for(const U of A)U.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}{const A=this.getUserStream(e,"screenSharing_video").getTracks();for(const U of A)U.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}const u=this.getUserStreams(e);this.cwsIns.emitNotify("onLocalStream",{code:200,data:u,desc:"local stream is change."}),$(u)}catch(e){I(e)}}));H(this,"addNotify",k=>this.cwsIns.addNotify(k));lt(this,jt,async k=>{const{roomId:D}=this.options;if(!D)return;const{id:$,tracks:I=[]}=await this.getCaller();if(I.length===0)return;const e=I.filter(u=>u.mediaType&&k.includes(u.mediaType));this.cwsIns.sendMessage({event:"pubNotify",data:{roomId:D,user:{id:$,tracks:e}}})});H(this,"joinRoom",async k=>(this.setOptions(k),await this.createWs(),new Promise((D,$)=>{this.clearUsers();let I="";const e=async()=>{this.taskQueue.clear([I]),await this.emitNotifyUpdateUsers();const N=await this.getUsers();this.taskQueue.setCondition("joinRoom",!0),D(N)},u=async()=>{try{this.taskQueue.setCondition("joinRoom",!1);const{roomId:N,userId:A,callType:U}=this.options;this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:U,roomId:N,user:{id:A,tracks:[],callAction:0}}}).then(async L=>{const{code:P=0,desc:Z="服务器繁忙",data:F}=L;if(P!==200)return $(Z);const{roomId:W="",roomUsers:J=[]}=F;if(W!==N)return $("加入的房间不匹配");this.createSession(),await this.updateUsers(J),e()})}catch(N){this.taskQueue.setCondition("joinRoom",!0),$(`加入房间失败: ${N.message||N||"服务器繁忙"}`)}};I=this.taskQueue.addTask(u,["createWs","joinRoom"],{describe:"joinRoom",strict:!0})})));H(this,"quitRoom",()=>new Promise(async k=>{const{roomId:D,userId:$}=this.options,I={roomId:D,user:{id:$}};try{this.stopSubscribe(),this.stopGetPeerStats(),this.initAsyncQueue(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.setRoomState("ready")}catch{}await new Promise(e=>setTimeout(()=>e(!0),300)),this.cwsIns.sendMessage({event:"quitRoom",data:I}),k(!0)}));H(this,"quitRoomEx",()=>new Promise(async k=>{const{roomId:D,userId:$}=this.options,I={roomId:D,user:{id:$}};try{this.stopSubscribe(),this.stopGetPeerStats(),this.initAsyncQueue(),this.clearUsers(),this.clearUserStreams(),await this.replaceSenderStream([],!1)}catch{}await new Promise(e=>setTimeout(()=>e(!0),300)),this.cwsIns.sendMessage({event:"quitRoomEx",data:I}),k(!0)}));H(this,"syncRoomInfo",()=>new Promise((k,D)=>{const $=async()=>{const{userId:I}=this.options,e=await this.getUser(I),{id:u=I,callAction:N=0}=e;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:u,callAction:N}}}).then(async A=>{if(A.code!==200)return D(A.desc);const U=A.data.users;this.clearUsers(),await this.updateUsers(U),await this.updateUsertracks(e.id,e.tracks,!1),await this.subscribe();{const L=await this.getUsers();k(L)}}).catch(A=>D(A))};this.taskQueue.addTask($,["createWs"],{describe:"syncRoomInfo"})}));H(this,"publish",k=>new Promise(async(D,$)=>{const I=async()=>{try{k.includes("screenSharing_audio")&&!k.includes("screenSharing_video")&&(k=[...k,"screenSharing_video"]),await this.replaceSenderStream(k,!1);const e=await this.getCaller();for(const L of k)this.getUserStream(e.id,L).getTracks().length===0&&await this.setLocalStream(L,!0);const u=[];for(const L of k)this.getUserStream(e.id,L).getTracks().length!==0&&u.push(L);await this.createTrack(u),await this.replaceSenderStream(u,!0);const N=this.getSenderTracks(k),A=[...e.tracks,...N],U=await this.getCallAction(A);await this.updateUsertracks(e.id,A,!0),G(this,jt).call(this,k),await G(this,gt).call(this,U);{await this.emitNotifyUpdateUsers();const L=await this.getCaller();D(L)}}catch(e){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: error",e);for(const u of k)await this.setLocalStream(u,!1);$(`publish is error: ${e.message||e}`)}};this.taskQueue.addTask(I,["createWs","createSession","ice","createTrack","subscribe"],{describe:"replaceSenderStream"})}));H(this,"stopPublish",(k=[])=>new Promise((D,$)=>{const I=async()=>{try{this.taskQueue.setCondition("closeTrack",!1);const e=await this.getCaller();k.length===0&&(k=mediaType_keys);const u=e.tracks.filter(({mediaType:A})=>A&&k.includes(A)),N=async()=>{this.taskQueue.setCondition("closeTrack",!0);const A=await this.getCaller();await this.emitNotifyUpdateUsers(),D(A)};if(u.length===0)return N();await this.replaceSenderStream(k,!0),await this.removeSenders(k),await this.closeUserTracks(e.id,u,!0);{const A=await this.getCallAction(e.tracks);await G(this,gt).call(this,A)}await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:u}}).then(async A=>{const{remoteSdp:U}=A.data;await this.setRemoteDescription({type:"answer",sdp:U})}),N()}catch(e){this.taskQueue.setCondition("closeTrack",!0),$(`stop publish is error: ${e.message||e}`)}};this.taskQueue.addTask(I,["createWs","createSession","ice","createTrack","subscribe"],{describe:"stopPublish"})}));H(this,"subscribe",(k=[],D=3)=>new Promise(($,I)=>{const e=async()=>{try{this.taskQueue.setCondition("subscribe",!1);const u=await this.getUsers();let N=[];for(const P of u){const{isSelf:Z,tracks:F=[]}=P;if(!Z){const W=F.filter(({trackName:J,mid:z=""})=>z!==""&&(k.includes(J)||k.length===0));W.length!==0&&N.push({...P,tracks:W})}}const A=async()=>{const P=Array.from(N,({id:F})=>F),Z=await this.getUsers(P);await this.emitNotifyUpdateUsers(),this.taskQueue.setCondition("subscribe",!0),$(Z)};if(N.length===0)return A();const U=[];for(const P of N){const{id:Z,tracks:F}=P,W=mt(F,["type","trackName"]),J={id:Z,tracks:W};U.push(J)}const L=async()=>{this.options.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: surplus subscribe count is ${D}`),await this.cwsIns.sendMessage({event:"subscribe",data:{users:U}}).then(async P=>{const{code:Z=0,data:F,desc:W}=P;if(Z!==200){if(D>0)return await new Promise(V=>setTimeout(()=>V(!0),300)),D=D-1,L();throw this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: subscribe is error. count 0",{trackNames:k}),new Error(W)}const{remoteSdp:J,users:z=[]}=F;this.onSubscribeUserTracks(z).then(async()=>{await this.renegotiate(),A()}),await this.setRemoteDescription({type:"offer",sdp:J})})};await L()}catch(u){this.taskQueue.setCondition("subscribe",!0),I(`subscribe is error: ${u.message||u}`)}};this.taskQueue.addTask(e,["createWs","createSession","ice","createTrack","closeTrack"],{describe:"subscribe"})}));H(this,"stopSubscribe",(k=[])=>new Promise((D,$)=>{const I=async()=>{try{this.taskQueue.setCondition("closeTrack",!1);const e=await this.getUsers(),u=[];for(const A of e){const{tracks:U=[]}=A;for(const L of U){const{type:P,mid:Z,trackName:F,mediaType:W,msid:J}=L;if(!(!W||!J)&&(k.length===0||k.includes(F))){const z={type:P,mid:Z,trackName:J};u.push(z),await this.closeUserTracks(A.id,[L])}}}const N=async()=>{await this.emitNotifyUpdateUsers(),this.taskQueue.setCondition("closeTrack",!0),D(!0)};if(u.length===0)return N();await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:u}}).then(async A=>{const{remoteSdp:U}=A.data;await this.setRemoteDescription({type:"answer",sdp:U})}),N()}catch(e){this.taskQueue.setCondition("closeTrack",!0),$(`stop subscribe is error: ${e.message||e}`)}};this.taskQueue.addTask(I,["createWs","createSession","ice","createTrack","subscribe"],{describe:"closeTrack"})}));H(this,"inactiveTracks",async(k,D)=>new Promise(async $=>{const I=await this.getCaller();if(!I)return;const{tracks:e=[]}=I,u=[...e];await this.replaceSenderStream(k,!0);for(let A of u){const{mediaType:U}=A;if(U&&k.includes(U)){A.enabled=D;const P=this.getUserStream(I.id,U).getTracks();for(const Z of P)Z.enabled=D}}const N=await this.getCallAction(u);await G(this,gt).call(this,N),await this.emitNotifyUpdateUsers(),$(!0)}));H(this,"debugger",()=>new Promise(async(k,D)=>{await this.cwsIns.sendMessage({event:"debugger"},!1).then(async $=>{if($.code!==200)return D($.desc);k(!0)}).catch($=>{D($)})}));lt(this,gt,async k=>new Promise(async(D,$)=>{const{roomId:I,userId:e}=this.options,u={roomId:I,user:{id:e,callAction:k}};await this.cwsIns.sendMessage({event:"updateCall",data:u}).then(async N=>{const{code:A=0}=N;if(A!==200)return $(N);await this.updateUserCallAction(e,k),D(k)}).catch(N=>$(N))}));H(this,"renegotiate",()=>new Promise(async(k,D)=>{await this.createAnswer(),await this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then($=>{if($.code!==200)return D("协商流错误");k(!0)}).catch($=>{console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe:error",$),D(`协商流错误: ${$.message||$}`)})}));H(this,"createWs",()=>new Promise(async(k,D)=>{try{if(["connecting","connected"].includes(this.cwsIns.state))return k(!0);this.taskQueue.setCondition("createWs",!1),this.cwsIns.clearEvents(),this.initPeer();const{appid:$}=this.options,{userId:I,sdkToken:e,roomId:u}=this.options;if(!I)return D("You must first use QuickVO.setOptions to set the userId.");const N={a:e,b:I,c:$,r:u,v:this.sdk_service_version};this.isEarly&&(N.i=pt()),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: createWs",N);const A=btoa(encodeURI(JSON.stringify(N)));await this.cwsIns.connect(A),this.taskQueue.setCondition("createWs",!0),k(!0)}catch($){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe:error",$),D($)}}));H(this,"createSession",()=>{if(!["connecting","connected"].includes(this.roomState))return this.setRoomState("connecting"),new Promise(k=>{const D=async()=>{try{this.taskQueue.setCondition("createSession",!1),await this.addSenders(),await this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}).then(async $=>{const{code:I=0,desc:e,data:u}=$;if(I!==200)throw new Error(e);const{remoteSdp:N}=u;this.taskQueue.setCondition("ice",!1),await this.setRemoteDescription({type:"answer",sdp:N}),this.taskQueue.setCondition("createSession",!0),k(!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(D,["createWs","createSession","ice"],{key:"createSession",describe:"createSession"})})});H(this,"createTrack",async k=>new Promise(D=>{const $=async()=>{try{this.taskQueue.setCondition("createTrack",!1);const I=await this.addSenders(k),e=this.getSenderTracks(I);if(e.length===0)return this.taskQueue.setCondition("createTrack",!0),D(!0);await this.cwsIns.sendMessage({event:"publish",data:{sdp:this.getSdp(),tracks:e,callAction:0}}).then(async u=>{const{code:N=0,desc:A,data:U}=u;if(N!==200)throw this.options.debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createTrack is error.",{mediaTypes:k}),new Error(A);const{remoteSdp:L}=U;await this.setRemoteDescription({type:"answer",sdp:L}),this.taskQueue.setCondition("createTrack",!0),D(!0)})}catch{await this.removeSenders(k),this.taskQueue.setCondition("createTrack",!0),D(!0)}};this.taskQueue.addTask($,["createWs","createSession","ice","subscribe","closeTrack"],{describe:"createTrack"})}));H(this,"earlyConnect",()=>{this.isEarly=!0,this.createWs(),this.createSession(),this.createTrack(["microphoneCamera_audio","microphoneCamera_video"])});this.setRoomState("ready")}}jt=new WeakMap,gt=new WeakMap;class Room extends RoomCalls{constructor(){super()}}class QuickVO extends Room{constructor(k){super();lt(this,wt,new Map);lt(this,Zt,()=>{{const k=async D=>{const{qualities:$=[]}=D.data,[I]=$;if(!(I&&I.userId===this.options.userId&&$.length===1)){for(const e of $){const{userId:u,egress:N,ingress:A}=e;this.checkUserInRoom(u)&&await this.updateUserNetwork(u,{egress:N,ingress:A})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:k},!0)}{const k=async D=>{const $=D.data.user;await this.updateUsers([$]),await this.updateUsertracks($.id,$.track,!1),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:k},!0)}{const k=async D=>{await this.removeUsers([D.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:k},!0)}{const k=async D=>{const{user:$}=D.data,{id:I,tracks:e=[]}=$;await this.updateUserPermissions(I,3);const u=[];{const{tracks:N}=await this.getUser(I);for(const A of e){const{mid:U,trackName:L}=A;if(N.find(Z=>Z.mid===U&&Z.trackName===L))continue;u.push(A)}}if(u.length!==0)if(await this.updateUsertracks(I,u,!0),this.options.newPublishAutoSubscribe){const N=this.getTrackNamesFormTracks(u);await this.subscribe(N)}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:k},!0)}{const k=async D=>{const{id:$,tracks:I}=D.data.user;$!==this.options.userId&&(await this.closeUserTracks($,I,!0),await this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onCloseTrack",callback:k},!0)}{const k=async D=>{const{id:$,callAction:I}=D.data.user;this.checkUserInRoom($)&&(await this.updateUserCallAction($,I),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:k},!0)}{const k=async D=>{const{user:$}=D.data,{id:I,permissions:e=1}=$;e===1?await this.removeUsers([I]):e===3&&await this.updateUsers([$]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:k},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async k=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)});lt(this,Ft,()=>{this.cwsIns.sendMessageBefore=async()=>{}});lt(this,Ht,()=>{this.cwsIns.onReconnectSuccess=async()=>{this.syncRoomInfo()}});lt(this,zt,async()=>{});H(this,"addRequestAnimationFrame",async(k,D)=>{{const I=G(this,wt).get(k);I&&cancelAnimationFrame(I)}const $=(I=Date.now())=>{D(I);const e=requestAnimationFrame($);G(this,wt).set(k,e)};$()});H(this,"clearRequestAnimationFrame",async(k=[])=>{k.length===0&&(k=[...G(this,wt).keys()]);const D=[];for(const $ of k){const I=G(this,wt).get($);I&&(cancelAnimationFrame(I),D.push(I))}return D});H(this,"destroy",async()=>{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 销毁SDK"),this.stopGetPeerStats(),this.initAsyncQueue(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.cwsIns.emitNotify("onDestroy",{code:200,data:{},desc:"sdk is destroy."}),await this.cwsIns.close()});this.setOptions(k),this.initCwsCall(),G(this,Ft).call(this),G(this,Ht).call(this),G(this,zt).call(this),G(this,Zt).call(this)}}wt=new WeakMap,Zt=new WeakMap,Ft=new WeakMap,Ht=new WeakMap,zt=new WeakMap,exports.QuickVO=QuickVO,exports.ignoreEvent=ignoreEvent,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
|
|
3
|
+
`},writer$1}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var 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 gt=null,Qt,Kt,Gt;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=gt=e,ct=20):a===LENS$1?(at=lbase,gt=lext,ct=257):(at=dbase,gt=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(;;){Qt=$-Q,e[N]+1<ct?(Kt=0,Gt=e[N]):e[N]>=ct?(Kt=gt[e[N]-ct],Gt=at[e[N]-ct]):(Kt=96,Gt=0),et=1<<$-Q,tt=1<<j,D=tt;do tt-=et,_[it+(Y>>Q)+tt]=Qt<<24|Kt<<16|Gt|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 gt=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[gt[u.have++]]=$&7,$>>>=3,N-=3}for(;u.have<19;)u.lens[gt[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,It,(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,It).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&&St(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()}`;St(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(_)}St(this,_t,{}),await((u=V(this,lt))==null?void 0:u.close()),St(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,It).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)St(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))});St(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,It=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)},phoneyStreams={microphoneCamera_audio:createMutedAudioStream(),microphoneCamera_video:createFakeVideoStream(),screenSharing_video:createFakeVideoStream(),screenSharing_audio:createMutedAudioStream()};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,Rt,new Map);ut(this,Ut,()=>{for(const u of mediaType_keys)V(this,Rt).set(u,phoneyStreams[u])});Z(this,"getPhoneyStreams",u=>V(this,Rt).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();St(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(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}}])});ut(this,$t,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,$t).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),V(this,$t).call(this)});Z(this,"getMediaDeviceKind",u=>V(this,vt).get(u));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,"setMediaDeviceKind",async(u,E)=>{V(this,vt).set(u,E);const{userId:_}=this.options;if(u==="audioinput"&&this.getUserMediaStreamContext(_,"microphoneCamera_audio")&&(await this.initLocalStream("microphoneCamera_audio"),await this.replaceSenderStream(["microphoneCamera_audio"],!0)),u==="videoinput"&&this.getUserMediaStreamContext(_,"microphoneCamera_video")&&(await this.initLocalStream("microphoneCamera_video"),await this.replaceSenderStream(["microphoneCamera_video"],!0)),u==="audiooutput"){const k=V(this,bt).values();for(const e of k)e.kind==="audio"&&"setSinkId"in HTMLMediaElement.prototype&&e.audioContext.setSinkId(E)}});Z(this,"setAudioOutputDevice",u=>this.setMediaDeviceKind("audiooutput",u));Z(this,"getEnumerateDevices",async u=>(await V(this,$t).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,Rt=new WeakMap,Ut=new WeakMap,Mt=new WeakMap,Pt=new WeakMap,$t=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,"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,Tt).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,Tt).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,Tt).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,Tt,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(!k)return E("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;","------->Breathe: createWs",O);const $=btoa(encodeURI(JSON.stringify(O)));await this.cwsIns.connect($),this.taskQueue.setCondition("createWs",!0),u(!0)}catch(_){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: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{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: createTrack",u),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,Tt=new WeakMap;class Room extends RoomCalls{constructor(){super()}}class QuickVO extends Room{constructor(u){super();ut(this,Ot,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,Ot).get(u);k&&cancelAnimationFrame(k)}const _=(k=Date.now())=>{E(k);const e=requestAnimationFrame(_);V(this,Ot).set(u,e)};_()});Z(this,"clearRequestAnimationFrame",async(u=[])=>{u.length===0&&(u=[...V(this,Ot).keys()]);const E=[];for(const _ of u){const k=V(this,Ot).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)}}Ot=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"})});
|