quickvo-sdk-js 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12899 -12536
- package/dist/index.umd.cjs +2 -2
- package/dist/room/RoomBase.d.ts +0 -1
- package/package.json +2 -2
- package/dist/room/PrTaskQueue.d.ts +0 -154
package/dist/index.umd.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(kt,yt){typeof exports=="object"&&typeof module<"u"?yt(exports):typeof define=="function"&&define.amd?define(["exports"],yt):(kt=typeof globalThis<"u"?globalThis:kt||self,yt(kt["snqu-calls-sdk-js"]={}))})(this,function(exports){"use strict";var le=Object.defineProperty;var ae=kt=>{throw TypeError(kt)};var ue=(kt,yt,vt)=>yt in kt?le(kt,yt,{enumerable:!0,configurable:!0,writable:!0,value:vt}):kt[yt]=vt;var Y=(kt,yt,vt)=>ue(kt,typeof yt!="symbol"?yt+"":yt,vt),se=(kt,yt,vt)=>yt.has(kt)||ae("Cannot "+vt);var et=(kt,yt,vt)=>(se(kt,yt,"read from private field"),vt?vt.call(kt):yt.get(kt)),bt=(kt,yt,vt)=>yt.has(kt)?ae("Cannot add the same private member more than once"):yt instanceof WeakSet?yt.add(kt):yt.set(kt,vt),It=(kt,yt,vt,wt)=>(se(kt,yt,"write to private field"),wt?wt.call(kt,vt):yt.set(kt,vt),vt);var kt,yt,vt,wt,gt,Bt,jt,Zt,Pt,Ft,Ht,zt,Jt,At,Ot,St,Tt,Et,Nt,Wt,Gt,Ct,Kt,Qt,Vt,Yt,Dt,Xt,Ut,Mt,Lt,qt,te,ee,ie,ne;const lt=(I,Z={})=>{const O={unit:"B",splitStr:" ",...Z};let{unit:D,splitStr:a}=O;const k=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],e=k.findIndex(q=>q===D),o=k.slice(e+1,k.length);let N=I;for(const q of o)if(D=q,N=N/1024,N<1024)break;return`${N.toFixed(2)}${a}${D}`},P=(I,Z=[])=>{const O={...I},D=Object.keys(O);for(const a of D)Z.findIndex(k=>String(k)===a)===-1&&delete O[a];return O},pt=(I,Z=[],O=!0)=>{const D=new Map;for(const k of I){const e=[];for(const N of Z)e.push(k[N]);const o=`map-${e.join("-")}`;if(!D.has(o)){D.set(o,k);continue}O&&D.set(o,k)}const a=D.entries();return Array.from(a,([k,e])=>e)},dt=(I,Z=[])=>{const O=[];for(const D of I){const a=P(D,Z);O.push(a)}return O},ht=(I,Z="value",O="label")=>{const D=[],a=Object.entries(I);for(const[k,e]of a){const o={[O]:e,[Z]:k};D.push(o)}return D},v$1=(I=0,Z=1)=>{const O=Math.max(0,I),D=Math.max(1,Z),a=Math.random()*(D-O+1)+O;return parseInt(`${a}`,10)},xt=(I=16,Z=16)=>{const O="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),D=Math.min(O.length,Z),a=Date.now().toString(D),k=a.split(""),e=Math.max(4,I-a.length);for(let o=0;o<e;o++){const N=v$1(0,D-1),q=O[N];k.push(q)}return k.join("").toUpperCase()},W=(I,Z)=>{try{let O=Number(I);if(isNaN(O)){const D=new Date(`${I}`);if(`${D}`=="Invalid Date")return 0;O=D.getTime()}if(Z!==void 0){const D=new Date().getTimezoneOffset();O+=(D+Z)*60*1e3}return O}catch(O){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:I,_offset:Z,error:O}),0}},H=1e3,R$1=6e4,U=36e5,A=864e5,_={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六","07":"日"},L=I=>W(I),E$1=(I,Z="YYYY-MM-DD hh:mm:ss",O={})=>{const D={empty_str:"-",...O},{empty_str:a,offset:k}=D,e=W(I,k);if(Number(I)!==0&&e===0)return a;const o=new Date(e),N=`${o.getFullYear()}`,q=`${o.getMonth()+1}`,F=`${o.getDate()}`,J=`${o.getDay()===0?7:o.getDay()}`,z=`${o.getHours()}`,G=`${o.getMinutes()}`,K=`${o.getSeconds()}`,it=`${Math.ceil((e-L(`${N}/01/01 00:00:00`)+1)/864e5)}`,tt=`${Math.ceil(((e-L(`${N}/01/01 00:00:00`))/864e5-Number(J))/7)+1}`,X=[{k:"Y+",v:N},{k:"M+",v:q},{k:"D+",v:F},{k:"W+",v:J},{k:"h+",v:z},{k:"m+",v:G},{k:"s+",v:K},{k:"d+",v:it},{k:"w+",v:tt}];let nt;for(let{k:rt,v:ot}of X)if(nt=new RegExp(`(${rt})`).exec(Z),nt){const ct=nt[1];let _t=ot.padStart(ct.length,"0");ct.includes("W")&&(_t=_[_t.slice(0,2)]),Z=Z.replace(ct,_t)}return Z},V=new Map,$t=(I,Z,O)=>{const D=new Date().getTime(),a=V.get(I)||0;D-O>a&&(Z(),V.set(I,D))},enum_mediaType={microphoneCamera_audio:"麦克风-默认轨道",microphoneCamera_video:"摄像头-默认轨道",screenSharing_video:"屏幕共享-视频轨道",screenSharing_audio:"屏幕共享-音频轨道"};ht(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 I=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(Z){return Z.encoding?"rtpmap:%d %s/%s/%s":Z.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(Z){return Z.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(Z){return Z.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(Z){return"extmap:%d"+(Z.direction?"/%s":"%v")+(Z["encrypt-uri"]?" %s":"%v")+" %s"+(Z.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(Z){return Z.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(Z){var O="candidate:%s %d %s %d %s %d typ %s";return O+=Z.raddr!=null?" raddr %s rport %d":"%v%v",O+=Z.tcptype!=null?" tcptype %s":"%v",Z.generation!=null&&(O+=" generation %d"),O+=Z["network-id"]!=null?" network-id %d":"%v",O+=Z["network-cost"]!=null?" network-cost %d":"%v",O}},{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(Z){var O="ssrc:%d";return Z.attribute!=null&&(O+=" %s",Z.value!=null&&(O+=":%s")),O}},{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(Z){return Z.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(Z){return Z.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(Z){return"imageattr:%s %s %s"+(Z.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(Z){return"simulcast:%s %s"+(Z.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(Z){return"ts-refclk:%s"+(Z.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(Z){var O="mediaclk:";return O+=Z.id!=null?"id=%s %s":"%v%s",O+=Z.mediaClockValue!=null?"=%s":"",O+=Z.rateNumerator!=null?" rate=%s":"",O+=Z.rateDenominator!=null?"/%s":"",O}},{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(I).forEach(function(Z){var O=I[Z];O.forEach(function(D){D.reg||(D.reg=/(.*)/),D.format||(D.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function(I){var Z=function(o){return String(Number(o))===o?Number(o):o},O=function(o,N,q,F){if(F&&!q)N[F]=Z(o[1]);else for(var J=0;J<q.length;J+=1)o[J+1]!=null&&(N[q[J]]=Z(o[J+1]))},D=function(o,N,q){var F=o.name&&o.names;o.push&&!N[o.push]?N[o.push]=[]:F&&!N[o.name]&&(N[o.name]={});var J=o.push?{}:F?N[o.name]:N;O(q.match(o.reg),J,o.names,o.name),o.push&&N[o.push].push(J)},a=requireGrammar(),k=RegExp.prototype.test.bind(/^([a-z])=(.*)/);I.parse=function(o){var N={},q=[],F=N;return o.split(/(\r\n|\r|\n)/).filter(k).forEach(function(J){var z=J[0],G=J.slice(2);z==="m"&&(q.push({rtp:[],fmtp:[]}),F=q[q.length-1]);for(var K=0;K<(a[z]||[]).length;K+=1){var it=a[z][K];if(it.reg.test(G))return D(it,F,G)}}),N.media=q,N};var e=function(o,N){var q=N.split(/=(.+)/,2);return q.length===2?o[q[0]]=Z(q[1]):q.length===1&&N.length>1&&(o[q[0]]=void 0),o};I.parseParams=function(o){return o.split(/;\s?/).reduce(e,{})},I.parseFmtpConfig=I.parseParams,I.parsePayloads=function(o){return o.toString().split(" ").map(Number)},I.parseRemoteCandidates=function(o){for(var N=[],q=o.split(" ").map(Z),F=0;F<q.length;F+=3)N.push({component:q[F],ip:q[F+1],port:q[F+2]});return N},I.parseImageAttributes=function(o){return o.split(" ").map(function(N){return N.substring(1,N.length-1).split(",").reduce(e,{})})},I.parseSimulcastStreamList=function(o){return o.split(";").map(function(N){return N.split(",").map(function(q){var F,J=!1;return q[0]!=="~"?F=Z(q):(F=Z(q.substring(1,q.length)),J=!0),{scid:F,paused:J}})})}}(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var I=requireGrammar(),Z=/%[sdv%]/g,O=function(e){var o=1,N=arguments,q=N.length;return e.replace(Z,function(F){if(o>=q)return F;var J=N[o];switch(o+=1,F){case"%%":return"%";case"%s":return String(J);case"%d":return Number(J);case"%v":return""}})},D=function(e,o,N){var q=o.format instanceof Function?o.format(o.push?N:N[o.name]):o.format,F=[e+"="+q];if(o.names)for(var J=0;J<o.names.length;J+=1){var z=o.names[J];o.name?F.push(N[o.name][z]):F.push(N[o.names[J]])}else F.push(N[o.name]);return O.apply(null,F)},a=["v","o","s","i","u","e","p","c","b","t","r","z","a"],k=["i","c","b","a"];return writer$1=function(e,o){o=o||{},e.version==null&&(e.version=0),e.name==null&&(e.name=" "),e.media.forEach(function(J){J.payloads==null&&(J.payloads="")});var N=o.outerOrder||a,q=o.innerOrder||k,F=[];return N.forEach(function(J){I[J].forEach(function(z){z.name in e&&e[z.name]!=null?F.push(D(J,z,e)):z.push in e&&e[z.push]!=null&&e[z.push].forEach(function(G){F.push(D(J,z,G))})})}),e.media.forEach(function(J){F.push(D("m",I.m[0],J)),q.forEach(function(z){I[z].forEach(function(G){G.name in J&&J[G.name]!=null?F.push(D(z,G,J)):G.push in J&&J[G.push]!=null&&J[G.push].forEach(function(K){F.push(D(z,G,K))})})})}),F.join(`\r
|
|
1
|
+
(function(bt,_t){typeof exports=="object"&&typeof module<"u"?_t(exports):typeof define=="function"&&define.amd?define(["exports"],_t):(bt=typeof globalThis<"u"?globalThis:bt||self,_t(bt["snqu-calls-sdk-js"]={}))})(this,function(exports){"use strict";var le=Object.defineProperty;var ae=bt=>{throw TypeError(bt)};var ue=(bt,_t,wt)=>_t in bt?le(bt,_t,{enumerable:!0,configurable:!0,writable:!0,value:wt}):bt[_t]=wt;var X=(bt,_t,wt)=>ue(bt,typeof _t!="symbol"?_t+"":_t,wt),se=(bt,_t,wt)=>_t.has(bt)||ae("Cannot "+wt);var it=(bt,_t,wt)=>(se(bt,_t,"read from private field"),wt?wt.call(bt):_t.get(bt)),vt=(bt,_t,wt)=>_t.has(bt)?ae("Cannot add the same private member more than once"):_t instanceof WeakSet?_t.add(bt):_t.set(bt,wt),Rt=(bt,_t,wt,St)=>(se(bt,_t,"write to private field"),St?St.call(bt,wt):_t.set(bt,wt),wt);var bt,_t,wt,St,Tt,jt,Zt,Ft,Mt,Ht,zt,Jt,Ct,gt,Ot,It,Nt,qt,Wt,Kt,Dt,Gt,Vt,Qt,Yt,Ut,Xt,Pt,Lt,Bt,At,te,ee,ie,ne;const lt=(N,F={})=>{const I={unit:"B",splitStr:" ",...F};let{unit:Z,splitStr:a}=I;const O=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],e=O.findIndex(D=>D===Z),n=O.slice(e+1,O.length);let q=N;for(const D of n)if(Z=D,q=q/1024,q<1024)break;return`${q.toFixed(2)}${a}${Z}`},P=(N,F=[])=>{const I={...N},Z=Object.keys(I);for(const a of Z)F.findIndex(O=>String(O)===a)===-1&&delete I[a];return I},pt=(N,F=[],I=!0)=>{const Z=new Map;for(const O of N){const e=[];for(const q of F)e.push(O[q]);const n=`map-${e.join("-")}`;if(!Z.has(n)){Z.set(n,O);continue}I&&Z.set(n,O)}const a=Z.entries();return Array.from(a,([O,e])=>e)},dt=(N,F=[])=>{const I=[];for(const Z of N){const a=P(Z,F);I.push(a)}return I},ht=(N,F="value",I="label")=>{const Z=[],a=Object.entries(N);for(const[O,e]of a){const n={[I]:e,[F]:O};Z.push(n)}return Z},v$1=(N=0,F=1)=>{const I=Math.max(0,N),Z=Math.max(1,F),a=Math.random()*(Z-I+1)+I;return parseInt(`${a}`,10)},xt=(N=16,F=16)=>{const I="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),Z=Math.min(I.length,F),a=Date.now().toString(Z),O=a.split(""),e=Math.max(4,N-a.length);for(let n=0;n<e;n++){const q=v$1(0,Z-1),D=I[q];O.push(D)}return O.join("").toUpperCase()},W=(N,F)=>{try{let I=Number(N);if(isNaN(I)){const Z=new Date(`${N}`);if(`${Z}`=="Invalid Date")return 0;I=Z.getTime()}if(F!==void 0){const Z=new Date().getTimezoneOffset();I+=(Z+F)*60*1e3}return I}catch(I){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:N,_offset:F,error:I}),0}},H=1e3,R$1=6e4,U=36e5,A=864e5,_={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六","07":"日"},L=N=>W(N),E$1=(N,F="YYYY-MM-DD hh:mm:ss",I={})=>{const Z={empty_str:"-",...I},{empty_str:a,offset:O}=Z,e=W(N,O);if(Number(N)!==0&&e===0)return a;const n=new Date(e),q=`${n.getFullYear()}`,D=`${n.getMonth()+1}`,z=`${n.getDate()}`,K=`${n.getDay()===0?7:n.getDay()}`,J=`${n.getHours()}`,G=`${n.getMinutes()}`,Q=`${n.getSeconds()}`,nt=`${Math.ceil((e-L(`${q}/01/01 00:00:00`)+1)/864e5)}`,et=`${Math.ceil(((e-L(`${q}/01/01 00:00:00`))/864e5-Number(K))/7)+1}`,tt=[{k:"Y+",v:q},{k:"M+",v:D},{k:"D+",v:z},{k:"W+",v:K},{k:"h+",v:J},{k:"m+",v:G},{k:"s+",v:Q},{k:"d+",v:nt},{k:"w+",v:et}];let ot;for(let{k:ct,v:rt}of tt)if(ot=new RegExp(`(${ct})`).exec(F),ot){const st=ot[1];let yt=rt.padStart(st.length,"0");st.includes("W")&&(yt=_[yt.slice(0,2)]),F=F.replace(st,yt)}return F},V=new Map,$t=(N,F,I)=>{const Z=new Date().getTime(),a=V.get(N)||0;Z-I>a&&(F(),V.set(N,Z))},enum_mediaType={microphoneCamera_audio:"麦克风-默认轨道",microphoneCamera_video:"摄像头-默认轨道",screenSharing_video:"屏幕共享-视频轨道",screenSharing_audio:"屏幕共享-音频轨道"};ht(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 N=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(F){return F.encoding?"rtpmap:%d %s/%s/%s":F.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(F){return F.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(F){return F.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(F){return"extmap:%d"+(F.direction?"/%s":"%v")+(F["encrypt-uri"]?" %s":"%v")+" %s"+(F.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(F){return F.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(F){var I="candidate:%s %d %s %d %s %d typ %s";return I+=F.raddr!=null?" raddr %s rport %d":"%v%v",I+=F.tcptype!=null?" tcptype %s":"%v",F.generation!=null&&(I+=" generation %d"),I+=F["network-id"]!=null?" network-id %d":"%v",I+=F["network-cost"]!=null?" network-cost %d":"%v",I}},{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(F){var I="ssrc:%d";return F.attribute!=null&&(I+=" %s",F.value!=null&&(I+=":%s")),I}},{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(F){return F.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(F){return F.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(F){return"imageattr:%s %s %s"+(F.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(F){return"simulcast:%s %s"+(F.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(F){return"ts-refclk:%s"+(F.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(F){var I="mediaclk:";return I+=F.id!=null?"id=%s %s":"%v%s",I+=F.mediaClockValue!=null?"=%s":"",I+=F.rateNumerator!=null?" rate=%s":"",I+=F.rateDenominator!=null?"/%s":"",I}},{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(N).forEach(function(F){var I=N[F];I.forEach(function(Z){Z.reg||(Z.reg=/(.*)/),Z.format||(Z.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function(N){var F=function(n){return String(Number(n))===n?Number(n):n},I=function(n,q,D,z){if(z&&!D)q[z]=F(n[1]);else for(var K=0;K<D.length;K+=1)n[K+1]!=null&&(q[D[K]]=F(n[K+1]))},Z=function(n,q,D){var z=n.name&&n.names;n.push&&!q[n.push]?q[n.push]=[]:z&&!q[n.name]&&(q[n.name]={});var K=n.push?{}:z?q[n.name]:q;I(D.match(n.reg),K,n.names,n.name),n.push&&q[n.push].push(K)},a=requireGrammar(),O=RegExp.prototype.test.bind(/^([a-z])=(.*)/);N.parse=function(n){var q={},D=[],z=q;return n.split(/(\r\n|\r|\n)/).filter(O).forEach(function(K){var J=K[0],G=K.slice(2);J==="m"&&(D.push({rtp:[],fmtp:[]}),z=D[D.length-1]);for(var Q=0;Q<(a[J]||[]).length;Q+=1){var nt=a[J][Q];if(nt.reg.test(G))return Z(nt,z,G)}}),q.media=D,q};var e=function(n,q){var D=q.split(/=(.+)/,2);return D.length===2?n[D[0]]=F(D[1]):D.length===1&&q.length>1&&(n[D[0]]=void 0),n};N.parseParams=function(n){return n.split(/;\s?/).reduce(e,{})},N.parseFmtpConfig=N.parseParams,N.parsePayloads=function(n){return n.toString().split(" ").map(Number)},N.parseRemoteCandidates=function(n){for(var q=[],D=n.split(" ").map(F),z=0;z<D.length;z+=3)q.push({component:D[z],ip:D[z+1],port:D[z+2]});return q},N.parseImageAttributes=function(n){return n.split(" ").map(function(q){return q.substring(1,q.length-1).split(",").reduce(e,{})})},N.parseSimulcastStreamList=function(n){return n.split(";").map(function(q){return q.split(",").map(function(D){var z,K=!1;return D[0]!=="~"?z=F(D):(z=F(D.substring(1,D.length)),K=!0),{scid:z,paused:K}})})}}(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var N=requireGrammar(),F=/%[sdv%]/g,I=function(e){var n=1,q=arguments,D=q.length;return e.replace(F,function(z){if(n>=D)return z;var K=q[n];switch(n+=1,z){case"%%":return"%";case"%s":return String(K);case"%d":return Number(K);case"%v":return""}})},Z=function(e,n,q){var D=n.format instanceof Function?n.format(n.push?q:q[n.name]):n.format,z=[e+"="+D];if(n.names)for(var K=0;K<n.names.length;K+=1){var J=n.names[K];n.name?z.push(q[n.name][J]):z.push(q[n.names[K]])}else z.push(q[n.name]);return I.apply(null,z)},a=["v","o","s","i","u","e","p","c","b","t","r","z","a"],O=["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(K){K.payloads==null&&(K.payloads="")});var q=n.outerOrder||a,D=n.innerOrder||O,z=[];return q.forEach(function(K){N[K].forEach(function(J){J.name in e&&e[J.name]!=null?z.push(Z(K,J,e)):J.push in e&&e[J.push]!=null&&e[J.push].forEach(function(G){z.push(Z(K,J,G))})})}),e.media.forEach(function(K){z.push(Z("m",N.m[0],K)),D.forEach(function(J){N[J].forEach(function(G){G.name in K&&K[G.name]!=null?z.push(Z(J,G,K)):G.push in K&&K[G.push]!=null&&K[G.push].forEach(function(Q){z.push(Z(J,G,Q))})})})}),z.join(`\r
|
|
2
2
|
`)+`\r
|
|
3
|
-
`},writer$1}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var I=requireParser(),Z=requireWriter$1(),O=requireGrammar();return lib.grammar=O,lib.write=Z,lib.parse=I.parse,lib.parseParams=I.parseParams,lib.parseFmtpConfig=I.parseFmtpConfig,lib.parsePayloads=I.parsePayloads,lib.parseRemoteCandidates=I.parseRemoteCandidates,lib.parseImageAttributes=I.parseImageAttributes,lib.parseSimulcastStreamList=I.parseSimulcastStreamList,lib}var libExports=requireLib();class AudioMediaContext{constructor(Z,O){Y(this,"options",{autoGainControl:!1,noiseSuppression:!1,echoCancellation:!1});Y(this,"kind","audio");Y(this,"stream",new MediaStream);Y(this,"inputGain",1);Y(this,"outputGain",1);Y(this,"enhanceGain",0);Y(this,"audio",new Audio);Y(this,"audioContext");Y(this,"sourceNode");Y(this,"inputGainNode");Y(this,"analyserNode");Y(this,"analyserArrayData");Y(this,"outputGainNode");Y(this,"destinationNode");Y(this,"initNodes",()=>{this.audio.srcObject=this.stream,this.sourceNode=this.audioContext.createMediaStreamSource(this.stream),this.inputGainNode=this.audioContext.createGain(),this.inputGainNode.gain.setValueAtTime(this.inputGain,this.audioContext.currentTime),this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=512,this.analyserArrayData=new Uint8Array(this.analyserNode.frequencyBinCount),this.outputGainNode=this.audioContext.createGain(),this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime),this.destinationNode=this.audioContext.createMediaStreamDestination();{const{sourceNode:Z,inputGainNode:O,analyserNode:D,outputGainNode:a}=this;Z.connect(O),O.connect(D),D.connect(a),a.connect(this.audioContext.destination)}this.setMute(!0)});Y(this,"stop",()=>{{const Z=this.stream.getTracks();for(const O of Z)O.stop(),this.stream.removeTrack(O)}});Y(this,"replaceStream",Z=>{const O=this.stream.getTracks();for(const a of O)this.stream.removeTrack(a);const[D]=Z.getAudioTracks();D&&this.stream.addTrack(D),this.initNodes()});Y(this,"getStream",()=>this.sourceNode.mediaStream);Y(this,"setMute",(Z=!0)=>{Z?this.analyserNode.disconnect(this.outputGainNode):this.analyserNode.connect(this.outputGainNode)});Y(this,"setEnhanceGain",async Z=>{this.enhanceGain=Z;const O=this.inputGain+this.enhanceGain;this.inputGainNode.gain.setValueAtTime(O,this.audioContext.currentTime)});Y(this,"setVolumeGain",Z=>{this.outputGain=Z,this.outputGainNode.gain.setValueAtTime(Z,this.audioContext.currentTime);const O=Z===0;this.setMute(O)});Y(this,"getVolume",()=>{const{analyserNode:Z,analyserArrayData:O}=this;Z.getByteFrequencyData(O);let D=0;for(let k=0;k<O.length;k++)D+=O[k];return Math.ceil(D/O.length)});Y(this,"setFilter",(Z={})=>(this.options={...this.options,...Z},Z));this.stream.addTrack(Z),this.audioContext=O,this.initNodes(),this.audioContext.resume()}}class VideoMediaContext{constructor(Z){Y(this,"kind","video");Y(this,"stream",new MediaStream);Y(this,"stop",()=>{const Z=this.stream.getTracks();for(const O of Z)O.stop(),this.stream.removeTrack(O)});Y(this,"replaceStream",Z=>{const O=this.stream,D=O.getTracks();for(const k of D)O.removeTrack(k);const[a]=Z.getVideoTracks();a&&O.addTrack(a)});Y(this,"getStream",()=>this.stream);Y(this,"getTrack",()=>this.stream.getTracks()[0]);this.stream.addTrack(Z)}}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};ht(enum_roomState);var C=Object.defineProperty,R=I=>{throw TypeError(I)},S=(I,Z,O)=>Z in I?C(I,Z,{enumerable:!0,configurable:!0,writable:!0,value:O}):I[Z]=O,l$1=(I,Z,O)=>S(I,typeof Z!="symbol"?Z+"":Z,O),v=(I,Z,O)=>Z.has(I)||R("Cannot "+O),t=(I,Z,O)=>(v(I,Z,"read from private field"),O?O.call(I):Z.get(I)),c$1=(I,Z,O)=>Z.has(I)?R("Cannot add the same private member more than once"):Z instanceof WeakSet?Z.add(I):Z.set(I,O),i=(I,Z,O,D)=>(v(I,Z,"write to private field"),Z.set(I,O),O),s,r$1,h,p,m$1,f,w,x,g$1,b,B$1,y,T,d$1;let M$1=class{constructor(Z){c$1(this,s,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,sendBeforAutoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4,checkReconnect:O=>!0,onReconnectSuccess:async O=>{},onReconnectStop:async O=>{},getHeartbeatMsg:()=>JSON.stringify({event:"heartbeat"}),onMessage:O=>{}}),l$1(this,"ws"),c$1(this,r$1,-1),c$1(this,h,-1),c$1(this,p,0),c$1(this,m$1,0),c$1(this,f,!1),c$1(this,w,O=>{}),l$1(this,"close",async(O=1e3,D="correctly close.")=>{var a;this.ws&&(i(this,f,!0),t(this,d$1).call(this),(a=this.ws)==null||a.close(O,D))}),l$1(this,"connect",()=>new Promise(async O=>{i(this,w,O),this.ws=new WebSocket(t(this,s).url),this.ws.binaryType=t(this,s).binaryType,this.ws.onopen=t(this,b),this.ws.onmessage=t(this,g$1),this.ws.onerror=t(this,B$1),this.ws.onclose=t(this,y)})),l$1(this,"reconnect",async O=>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 a=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}),D(k)};if(t(this,x).call(this)===!1)return a("stop reconnect. exceed maxReconnectionTime.");if(t(this,r$1)!==-1&&t(this,r$1)===0)return a("stop reconnect. surplusReconnectCount is 0.");if(!t(this,s).checkReconnect(O))return a("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$1)}`,O),i(this,p,setTimeout(async()=>{i(this,r$1,Math.max(-1,t(this,r$1)-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)}D(!0)},t(this,s).reconnectIntervalTime))})),l$1(this,"sendMessage",async O=>{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(O)}),c$1(this,x,()=>{const O=Date.now();return t(this,h)===-1&&i(this,h,O+t(this,s).reconnectTime),!(O>t(this,h))}),c$1(this,g$1,O=>{const{data:D}=O;t(this,s).onMessage(D)}),c$1(this,b,()=>{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$1,t(this,s).reconnectCount),i(this,h,-1),t(this,T).call(this),t(this,w).call(this,this.ws)}),c$1(this,B$1,O=>{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.",O)}),c$1(this,y,O=>{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: ${O.code}, permanentClosed is ${t(this,f)}.`,O),t(this,d$1).call(this),!t(this,f))return this.reconnect(O);this.ws=void 0}),c$1(this,T,()=>{i(this,m$1,setInterval(()=>{const O=t(this,s).getHeartbeatMsg();O&&this.sendMessage(O)},t(this,s).heartbeatIntervalTime))}),c$1(this,d$1,()=>{clearInterval(t(this,p)),clearInterval(t(this,m$1))}),i(this,s,{...t(this,s),...Z}),i(this,r$1,t(this,s).reconnectCount)}};s=new WeakMap,r$1=new WeakMap,h=new WeakMap,p=new WeakMap,m$1=new WeakMap,f=new WeakMap,w=new WeakMap,x=new WeakMap,g$1=new WeakMap,b=new WeakMap,B$1=new WeakMap,y=new WeakMap,T=new WeakMap,d$1=new WeakMap;var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=I;function I(Z,O){for(var D=new Array(arguments.length-1),a=0,k=2,e=!0;k<arguments.length;)D[a++]=arguments[k++];return new Promise(function(N,q){D[a]=function(J){if(e)if(e=!1,J)q(J);else{for(var z=new Array(arguments.length-1),G=0;G<z.length;)z[G++]=arguments[G];N.apply(null,z)}};try{Z.apply(O||null,D)}catch(F){e&&(e=!1,q(F))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(I){var Z=I;Z.length=function(o){var N=o.length;if(!N)return 0;for(var q=0;--N%4>1&&o.charAt(N)==="=";)++q;return Math.ceil(o.length*3)/4-q};for(var O=new Array(64),D=new Array(123),a=0;a<64;)D[O[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;Z.encode=function(o,N,q){for(var F=null,J=[],z=0,G=0,K;N<q;){var it=o[N++];switch(G){case 0:J[z++]=O[it>>2],K=(it&3)<<4,G=1;break;case 1:J[z++]=O[K|it>>4],K=(it&15)<<2,G=2;break;case 2:J[z++]=O[K|it>>6],J[z++]=O[it&63],G=0;break}z>8191&&((F||(F=[])).push(String.fromCharCode.apply(String,J)),z=0)}return G&&(J[z++]=O[K],J[z++]=61,G===1&&(J[z++]=61)),F?(z&&F.push(String.fromCharCode.apply(String,J.slice(0,z))),F.join("")):String.fromCharCode.apply(String,J.slice(0,z))};var k="invalid encoding";Z.decode=function(o,N,q){for(var F=q,J=0,z,G=0;G<o.length;){var K=o.charCodeAt(G++);if(K===61&&J>1)break;if((K=D[K])===void 0)throw Error(k);switch(J){case 0:z=K,J=1;break;case 1:N[q++]=z<<2|(K&48)>>4,z=K,J=2;break;case 2:N[q++]=(z&15)<<4|(K&60)>>2,z=K,J=3;break;case 3:N[q++]=(z&3)<<6|K,J=0;break}}if(J===1)throw Error(k);return q-F},Z.test=function(o){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(o)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=I;function I(){this._listeners={}}return I.prototype.on=function(O,D,a){return(this._listeners[O]||(this._listeners[O]=[])).push({fn:D,ctx:a||this}),this},I.prototype.off=function(O,D){if(O===void 0)this._listeners={};else if(D===void 0)this._listeners[O]=[];else for(var a=this._listeners[O],k=0;k<a.length;)a[k].fn===D?a.splice(k,1):++k;return this},I.prototype.emit=function(O){var D=this._listeners[O];if(D){for(var a=[],k=1;k<arguments.length;)a.push(arguments[k++]);for(k=0;k<D.length;)D[k].fn.apply(D[k++].ctx,a)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=I(I);function I(k){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),o=new Uint8Array(e.buffer),N=o[3]===128;function q(G,K,it){e[0]=G,K[it]=o[0],K[it+1]=o[1],K[it+2]=o[2],K[it+3]=o[3]}function F(G,K,it){e[0]=G,K[it]=o[3],K[it+1]=o[2],K[it+2]=o[1],K[it+3]=o[0]}k.writeFloatLE=N?q:F,k.writeFloatBE=N?F:q;function J(G,K){return o[0]=G[K],o[1]=G[K+1],o[2]=G[K+2],o[3]=G[K+3],e[0]}function z(G,K){return o[3]=G[K],o[2]=G[K+1],o[1]=G[K+2],o[0]=G[K+3],e[0]}k.readFloatLE=N?J:z,k.readFloatBE=N?z:J}():function(){function e(N,q,F,J){var z=q<0?1:0;if(z&&(q=-q),q===0)N(1/q>0?0:2147483648,F,J);else if(isNaN(q))N(2143289344,F,J);else if(q>34028234663852886e22)N((z<<31|2139095040)>>>0,F,J);else if(q<11754943508222875e-54)N((z<<31|Math.round(q/1401298464324817e-60))>>>0,F,J);else{var G=Math.floor(Math.log(q)/Math.LN2),K=Math.round(q*Math.pow(2,-G)*8388608)&8388607;N((z<<31|G+127<<23|K)>>>0,F,J)}}k.writeFloatLE=e.bind(null,Z),k.writeFloatBE=e.bind(null,O);function o(N,q,F){var J=N(q,F),z=(J>>31)*2+1,G=J>>>23&255,K=J&8388607;return G===255?K?NaN:z*(1/0):G===0?z*1401298464324817e-60*K:z*Math.pow(2,G-150)*(K+8388608)}k.readFloatLE=o.bind(null,D),k.readFloatBE=o.bind(null,a)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),o=new Uint8Array(e.buffer),N=o[7]===128;function q(G,K,it){e[0]=G,K[it]=o[0],K[it+1]=o[1],K[it+2]=o[2],K[it+3]=o[3],K[it+4]=o[4],K[it+5]=o[5],K[it+6]=o[6],K[it+7]=o[7]}function F(G,K,it){e[0]=G,K[it]=o[7],K[it+1]=o[6],K[it+2]=o[5],K[it+3]=o[4],K[it+4]=o[3],K[it+5]=o[2],K[it+6]=o[1],K[it+7]=o[0]}k.writeDoubleLE=N?q:F,k.writeDoubleBE=N?F:q;function J(G,K){return o[0]=G[K],o[1]=G[K+1],o[2]=G[K+2],o[3]=G[K+3],o[4]=G[K+4],o[5]=G[K+5],o[6]=G[K+6],o[7]=G[K+7],e[0]}function z(G,K){return o[7]=G[K],o[6]=G[K+1],o[5]=G[K+2],o[4]=G[K+3],o[3]=G[K+4],o[2]=G[K+5],o[1]=G[K+6],o[0]=G[K+7],e[0]}k.readDoubleLE=N?J:z,k.readDoubleBE=N?z:J}():function(){function e(N,q,F,J,z,G){var K=J<0?1:0;if(K&&(J=-J),J===0)N(0,z,G+q),N(1/J>0?0:2147483648,z,G+F);else if(isNaN(J))N(0,z,G+q),N(2146959360,z,G+F);else if(J>17976931348623157e292)N(0,z,G+q),N((K<<31|2146435072)>>>0,z,G+F);else{var it;if(J<22250738585072014e-324)it=J/5e-324,N(it>>>0,z,G+q),N((K<<31|it/4294967296)>>>0,z,G+F);else{var tt=Math.floor(Math.log(J)/Math.LN2);tt===1024&&(tt=1023),it=J*Math.pow(2,-tt),N(it*4503599627370496>>>0,z,G+q),N((K<<31|tt+1023<<20|it*1048576&1048575)>>>0,z,G+F)}}}k.writeDoubleLE=e.bind(null,Z,0,4),k.writeDoubleBE=e.bind(null,O,4,0);function o(N,q,F,J,z){var G=N(J,z+q),K=N(J,z+F),it=(K>>31)*2+1,tt=K>>>20&2047,X=4294967296*(K&1048575)+G;return tt===2047?X?NaN:it*(1/0):tt===0?it*5e-324*X:it*Math.pow(2,tt-1075)*(X+4503599627370496)}k.readDoubleLE=o.bind(null,D,0,4),k.readDoubleBE=o.bind(null,a,4,0)}(),k}function Z(k,e,o){e[o]=k&255,e[o+1]=k>>>8&255,e[o+2]=k>>>16&255,e[o+3]=k>>>24}function O(k,e,o){e[o]=k>>>24,e[o+1]=k>>>16&255,e[o+2]=k>>>8&255,e[o+3]=k&255}function D(k,e){return(k[e]|k[e+1]<<8|k[e+2]<<16|k[e+3]<<24)>>>0}function a(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(I){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(I){var Z=I;Z.length=function(D){for(var a=0,k=0,e=0;e<D.length;++e)k=D.charCodeAt(e),k<128?a+=1:k<2048?a+=2:(k&64512)===55296&&(D.charCodeAt(e+1)&64512)===56320?(++e,a+=4):a+=3;return a},Z.read=function(D,a,k){var e=k-a;if(e<1)return"";for(var o=null,N=[],q=0,F;a<k;)F=D[a++],F<128?N[q++]=F:F>191&&F<224?N[q++]=(F&31)<<6|D[a++]&63:F>239&&F<365?(F=((F&7)<<18|(D[a++]&63)<<12|(D[a++]&63)<<6|D[a++]&63)-65536,N[q++]=55296+(F>>10),N[q++]=56320+(F&1023)):N[q++]=(F&15)<<12|(D[a++]&63)<<6|D[a++]&63,q>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,N)),q=0);return o?(q&&o.push(String.fromCharCode.apply(String,N.slice(0,q))),o.join("")):String.fromCharCode.apply(String,N.slice(0,q))},Z.write=function(D,a,k){for(var e=k,o,N,q=0;q<D.length;++q)o=D.charCodeAt(q),o<128?a[k++]=o:o<2048?(a[k++]=o>>6|192,a[k++]=o&63|128):(o&64512)===55296&&((N=D.charCodeAt(q+1))&64512)===56320?(o=65536+((o&1023)<<10)+(N&1023),++q,a[k++]=o>>18|240,a[k++]=o>>12&63|128,a[k++]=o>>6&63|128,a[k++]=o&63|128):(a[k++]=o>>12|224,a[k++]=o>>6&63|128,a[k++]=o&63|128);return k-e}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=I;function I(Z,O,D){var a=D||8192,k=a>>>1,e=null,o=a;return function(q){if(q<1||q>k)return Z(q);o+q>a&&(e=Z(a),o=0);var F=O.call(e,o,o+=q);return o&7&&(o=(o|7)+1),F}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=Z;var I=requireMinimal$1();function Z(k,e){this.lo=k>>>0,this.hi=e>>>0}var O=Z.zero=new Z(0,0);O.toNumber=function(){return 0},O.zzEncode=O.zzDecode=function(){return this},O.length=function(){return 1};var D=Z.zeroHash="\0\0\0\0\0\0\0\0";Z.fromNumber=function(e){if(e===0)return O;var o=e<0;o&&(e=-e);var N=e>>>0,q=(e-N)/4294967296>>>0;return o&&(q=~q>>>0,N=~N>>>0,++N>4294967295&&(N=0,++q>4294967295&&(q=0))),new Z(N,q)},Z.from=function(e){if(typeof e=="number")return Z.fromNumber(e);if(I.isString(e))if(I.Long)e=I.Long.fromString(e);else return Z.fromNumber(parseInt(e,10));return e.low||e.high?new Z(e.low>>>0,e.high>>>0):O},Z.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var o=~this.lo+1>>>0,N=~this.hi>>>0;return o||(N=N+1>>>0),-(o+N*4294967296)}return this.lo+this.hi*4294967296},Z.prototype.toLong=function(e){return I.Long?new I.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var a=String.prototype.charCodeAt;return Z.fromHash=function(e){return e===D?O:new Z((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},Z.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)},Z.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},Z.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},Z.prototype.length=function(){var e=this.lo,o=(this.lo>>>28|this.hi<<4)>>>0,N=this.hi>>>24;return N===0?o===0?e<16384?e<128?1:2:e<2097152?3:4:o<16384?o<128?5:6:o<2097152?7:8:N<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(I){var Z=I;Z.asPromise=requireAspromise(),Z.base64=requireBase64(),Z.EventEmitter=requireEventemitter(),Z.float=requireFloat(),Z.inquire=requireInquire(),Z.utf8=requireUtf8(),Z.pool=requirePool(),Z.LongBits=requireLongbits(),Z.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),Z.global=Z.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,Z.emptyArray=Object.freeze?Object.freeze([]):[],Z.emptyObject=Object.freeze?Object.freeze({}):{},Z.isInteger=Number.isInteger||function(k){return typeof k=="number"&&isFinite(k)&&Math.floor(k)===k},Z.isString=function(k){return typeof k=="string"||k instanceof String},Z.isObject=function(k){return k&&typeof k=="object"},Z.isset=Z.isSet=function(k,e){var o=k[e];return o!=null&&k.hasOwnProperty(e)?typeof o!="object"||(Array.isArray(o)?o.length:Object.keys(o).length)>0:!1},Z.Buffer=function(){try{var a=Z.inquire("buffer").Buffer;return a.prototype.utf8Write?a:null}catch{return null}}(),Z._Buffer_from=null,Z._Buffer_allocUnsafe=null,Z.newBuffer=function(k){return typeof k=="number"?Z.Buffer?Z._Buffer_allocUnsafe(k):new Z.Array(k):Z.Buffer?Z._Buffer_from(k):typeof Uint8Array>"u"?k:new Uint8Array(k)},Z.Array=typeof Uint8Array<"u"?Uint8Array:Array,Z.Long=Z.global.dcodeIO&&Z.global.dcodeIO.Long||Z.global.Long||Z.inquire("long"),Z.key2Re=/^true|false|0|1$/,Z.key32Re=/^-?(?:0|[1-9][0-9]*)$/,Z.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,Z.longToHash=function(k){return k?Z.LongBits.from(k).toHash():Z.LongBits.zeroHash},Z.longFromHash=function(k,e){var o=Z.LongBits.fromHash(k);return Z.Long?Z.Long.fromBits(o.lo,o.hi,e):o.toNumber(!!e)};function O(a,k,e){for(var o=Object.keys(k),N=0;N<o.length;++N)(a[o[N]]===void 0||!e)&&(a[o[N]]=k[o[N]]);return a}Z.merge=O,Z.lcFirst=function(k){return k.charAt(0).toLowerCase()+k.substring(1)};function D(a){function k(e,o){if(!(this instanceof k))return new k(e,o);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,k):Object.defineProperty(this,"stack",{value:new Error().stack||""}),o&&O(this,o)}return k.prototype=Object.create(Error.prototype,{constructor:{value:k,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return a},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),k}Z.newError=D,Z.ProtocolError=D("ProtocolError"),Z.oneOfGetter=function(k){for(var e={},o=0;o<k.length;++o)e[k[o]]=1;return function(){for(var N=Object.keys(this),q=N.length-1;q>-1;--q)if(e[N[q]]===1&&this[N[q]]!==void 0&&this[N[q]]!==null)return N[q]}},Z.oneOfSetter=function(k){return function(e){for(var o=0;o<k.length;++o)k[o]!==e&&delete this[k[o]]}},Z.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},Z._configure=function(){var a=Z.Buffer;if(!a){Z._Buffer_from=Z._Buffer_allocUnsafe=null;return}Z._Buffer_from=a.from!==Uint8Array.from&&a.from||function(e,o){return new a(e,o)},Z._Buffer_allocUnsafe=a.allocUnsafe||function(e){return new a(e)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=N;var I=requireMinimal$1(),Z,O=I.LongBits,D=I.base64,a=I.utf8;function k(tt,X,nt){this.fn=tt,this.len=X,this.next=void 0,this.val=nt}function e(){}function o(tt){this.head=tt.head,this.tail=tt.tail,this.len=tt.len,this.next=tt.states}function N(){this.len=0,this.head=new k(e,0,0),this.tail=this.head,this.states=null}var q=function(){return I.Buffer?function(){return(N.create=function(){return new Z})()}:function(){return new N}};N.create=q(),N.alloc=function(X){return new I.Array(X)},I.Array!==Array&&(N.alloc=I.pool(N.alloc,I.Array.prototype.subarray)),N.prototype._push=function(X,nt,rt){return this.tail=this.tail.next=new k(X,nt,rt),this.len+=nt,this};function F(tt,X,nt){X[nt]=tt&255}function J(tt,X,nt){for(;tt>127;)X[nt++]=tt&127|128,tt>>>=7;X[nt]=tt}function z(tt,X){this.len=tt,this.next=void 0,this.val=X}z.prototype=Object.create(k.prototype),z.prototype.fn=J,N.prototype.uint32=function(X){return this.len+=(this.tail=this.tail.next=new z((X=X>>>0)<128?1:X<16384?2:X<2097152?3:X<268435456?4:5,X)).len,this},N.prototype.int32=function(X){return X<0?this._push(G,10,O.fromNumber(X)):this.uint32(X)},N.prototype.sint32=function(X){return this.uint32((X<<1^X>>31)>>>0)};function G(tt,X,nt){for(;tt.hi;)X[nt++]=tt.lo&127|128,tt.lo=(tt.lo>>>7|tt.hi<<25)>>>0,tt.hi>>>=7;for(;tt.lo>127;)X[nt++]=tt.lo&127|128,tt.lo=tt.lo>>>7;X[nt++]=tt.lo}N.prototype.uint64=function(X){var nt=O.from(X);return this._push(G,nt.length(),nt)},N.prototype.int64=N.prototype.uint64,N.prototype.sint64=function(X){var nt=O.from(X).zzEncode();return this._push(G,nt.length(),nt)},N.prototype.bool=function(X){return this._push(F,1,X?1:0)};function K(tt,X,nt){X[nt]=tt&255,X[nt+1]=tt>>>8&255,X[nt+2]=tt>>>16&255,X[nt+3]=tt>>>24}N.prototype.fixed32=function(X){return this._push(K,4,X>>>0)},N.prototype.sfixed32=N.prototype.fixed32,N.prototype.fixed64=function(X){var nt=O.from(X);return this._push(K,4,nt.lo)._push(K,4,nt.hi)},N.prototype.sfixed64=N.prototype.fixed64,N.prototype.float=function(X){return this._push(I.float.writeFloatLE,4,X)},N.prototype.double=function(X){return this._push(I.float.writeDoubleLE,8,X)};var it=I.Array.prototype.set?function(X,nt,rt){nt.set(X,rt)}:function(X,nt,rt){for(var ot=0;ot<X.length;++ot)nt[rt+ot]=X[ot]};return N.prototype.bytes=function(X){var nt=X.length>>>0;if(!nt)return this._push(F,1,0);if(I.isString(X)){var rt=N.alloc(nt=D.length(X));D.decode(X,rt,0),X=rt}return this.uint32(nt)._push(it,nt,X)},N.prototype.string=function(X){var nt=a.length(X);return nt?this.uint32(nt)._push(a.write,nt,X):this._push(F,1,0)},N.prototype.fork=function(){return this.states=new o(this),this.head=this.tail=new k(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 k(e,0,0),this.len=0),this},N.prototype.ldelim=function(){var X=this.head,nt=this.tail,rt=this.len;return this.reset().uint32(rt),rt&&(this.tail.next=X.next,this.tail=nt,this.len+=rt),this},N.prototype.finish=function(){for(var X=this.head.next,nt=this.constructor.alloc(this.len),rt=0;X;)X.fn(X.val,nt,rt),rt+=X.len,X=X.next;return nt},N._configure=function(tt){Z=tt,N.create=q(),Z._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=O;var I=requireWriter();(O.prototype=Object.create(I.prototype)).constructor=O;var Z=requireMinimal$1();function O(){I.call(this)}O._configure=function(){O.alloc=Z._Buffer_allocUnsafe,O.writeBytesBuffer=Z.Buffer&&Z.Buffer.prototype instanceof Uint8Array&&Z.Buffer.prototype.set.name==="set"?function(k,e,o){e.set(k,o)}:function(k,e,o){if(k.copy)k.copy(e,o,0,k.length);else for(var N=0;N<k.length;)e[o++]=k[N++]}},O.prototype.bytes=function(k){Z.isString(k)&&(k=Z._Buffer_from(k,"base64"));var e=k.length>>>0;return this.uint32(e),e&&this._push(O.writeBytesBuffer,e,k),this};function D(a,k,e){a.length<40?Z.utf8.write(a,k,e):k.utf8Write?k.utf8Write(a,e):k.write(a,e)}return O.prototype.string=function(k){var e=Z.Buffer.byteLength(k);return this.uint32(e),e&&this._push(D,e,k),this},O._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=k;var I=requireMinimal$1(),Z,O=I.LongBits,D=I.utf8;function a(J,z){return RangeError("index out of range: "+J.pos+" + "+(z||1)+" > "+J.len)}function k(J){this.buf=J,this.pos=0,this.len=J.length}var e=typeof Uint8Array<"u"?function(z){if(z instanceof Uint8Array||Array.isArray(z))return new k(z);throw Error("illegal buffer")}:function(z){if(Array.isArray(z))return new k(z);throw Error("illegal buffer")},o=function(){return I.Buffer?function(G){return(k.create=function(it){return I.Buffer.isBuffer(it)?new Z(it):e(it)})(G)}:e};k.create=o(),k.prototype._slice=I.Array.prototype.subarray||I.Array.prototype.slice,k.prototype.uint32=function(){var z=4294967295;return function(){if(z=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(z=(z|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(z=(z|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(z=(z|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(z=(z|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return z;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return z}}(),k.prototype.int32=function(){return this.uint32()|0},k.prototype.sint32=function(){var z=this.uint32();return z>>>1^-(z&1)|0};function N(){var J=new O(0,0),z=0;if(this.len-this.pos>4){for(;z<4;++z)if(J.lo=(J.lo|(this.buf[this.pos]&127)<<z*7)>>>0,this.buf[this.pos++]<128)return J;if(J.lo=(J.lo|(this.buf[this.pos]&127)<<28)>>>0,J.hi=(J.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return J;z=0}else{for(;z<3;++z){if(this.pos>=this.len)throw a(this);if(J.lo=(J.lo|(this.buf[this.pos]&127)<<z*7)>>>0,this.buf[this.pos++]<128)return J}return J.lo=(J.lo|(this.buf[this.pos++]&127)<<z*7)>>>0,J}if(this.len-this.pos>4){for(;z<5;++z)if(J.hi=(J.hi|(this.buf[this.pos]&127)<<z*7+3)>>>0,this.buf[this.pos++]<128)return J}else for(;z<5;++z){if(this.pos>=this.len)throw a(this);if(J.hi=(J.hi|(this.buf[this.pos]&127)<<z*7+3)>>>0,this.buf[this.pos++]<128)return J}throw Error("invalid varint encoding")}k.prototype.bool=function(){return this.uint32()!==0};function q(J,z){return(J[z-4]|J[z-3]<<8|J[z-2]<<16|J[z-1]<<24)>>>0}k.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return q(this.buf,this.pos+=4)},k.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return q(this.buf,this.pos+=4)|0};function F(){if(this.pos+8>this.len)throw a(this,8);return new O(q(this.buf,this.pos+=4),q(this.buf,this.pos+=4))}return k.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var z=I.float.readFloatLE(this.buf,this.pos);return this.pos+=4,z},k.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var z=I.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,z},k.prototype.bytes=function(){var z=this.uint32(),G=this.pos,K=this.pos+z;if(K>this.len)throw a(this,z);if(this.pos+=z,Array.isArray(this.buf))return this.buf.slice(G,K);if(G===K){var it=I.Buffer;return it?it.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,G,K)},k.prototype.string=function(){var z=this.bytes();return D.read(z,0,z.length)},k.prototype.skip=function(z){if(typeof z=="number"){if(this.pos+z>this.len)throw a(this,z);this.pos+=z}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},k.prototype.skipType=function(J){switch(J){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(J=this.uint32()&7)!==4;)this.skipType(J);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+J+" at offset "+this.pos)}return this},k._configure=function(J){Z=J,k.create=o(),Z._configure();var z=I.Long?"toLong":"toNumber";I.merge(k.prototype,{int64:function(){return N.call(this)[z](!1)},uint64:function(){return N.call(this)[z](!0)},sint64:function(){return N.call(this).zzDecode()[z](!1)},fixed64:function(){return F.call(this)[z](!0)},sfixed64:function(){return F.call(this)[z](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=O;var I=requireReader();(O.prototype=Object.create(I.prototype)).constructor=O;var Z=requireMinimal$1();function O(D){I.call(this,D)}return O._configure=function(){Z.Buffer&&(O.prototype._slice=Z.Buffer.prototype.slice)},O.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},O._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=Z;var I=requireMinimal$1();(Z.prototype=Object.create(I.EventEmitter.prototype)).constructor=Z;function Z(O,D,a){if(typeof O!="function")throw TypeError("rpcImpl must be a function");I.EventEmitter.call(this),this.rpcImpl=O,this.requestDelimited=!!D,this.responseDelimited=!!a}return Z.prototype.rpcCall=function O(D,a,k,e,o){if(!e)throw TypeError("request must be specified");var N=this;if(!o)return I.asPromise(O,N,D,a,k,e);if(!N.rpcImpl){setTimeout(function(){o(Error("already ended"))},0);return}try{return N.rpcImpl(D,a[N.requestDelimited?"encodeDelimited":"encode"](e).finish(),function(F,J){if(F)return N.emit("error",F,D),o(F);if(J===null){N.end(!0);return}if(!(J instanceof k))try{J=k[N.responseDelimited?"decodeDelimited":"decode"](J)}catch(z){return N.emit("error",z,D),o(z)}return N.emit("data",J,D),o(null,J)})}catch(q){N.emit("error",q,D),setTimeout(function(){o(q)},0);return}},Z.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(I){var Z=I;Z.Service=requireService()}(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(I){var Z=I;Z.build="minimal",Z.Writer=requireWriter(),Z.BufferWriter=requireWriter_buffer(),Z.Reader=requireReader(),Z.BufferReader=requireReader_buffer(),Z.util=requireMinimal$1(),Z.rpc=requireRpc(),Z.roots=requireRoots(),Z.configure=O;function O(){Z.util._configure(),Z.Writer._configure(Z.BufferWriter),Z.Reader._configure(Z.BufferReader)}O()}(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 I={};return I.quick=function(){const Z={};return Z.voice=function(){const O={};return O.proto=function(){const D={};return D.CommonReq=function(){function a(k){if(k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.event="",a.prototype.data=$util.newBuffer([]),a.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,a.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,a.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,a.prototype.version=0,a.prototype.compress=!1,a.create=function(e){return new a(e)},a.encode=function(e,o){return o||(o=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&o.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&o.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&o.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&o.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&o.uint32(40).int64(e.valid),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&o.uint32(48).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&o.uint32(56).bool(e.compress),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.CommonReq;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.event=e.string();break}case 2:{q.data=e.bytes();break}case 3:{q.sn=e.int64();break}case 4:{q.time=e.int64();break}case 5:{q.valid=e.int64();break}case 6:{q.version=e.int32();break}case 7:{q.compress=e.bool();break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CommonReq)return e;let o=new $root.com.quick.voice.proto.CommonReq;return e.event!=null&&(o.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,o.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(o.data=e.data)),e.sn!=null&&($util.Long?(o.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?o.sn=parseInt(e.sn,10):typeof e.sn=="number"?o.sn=e.sn:typeof e.sn=="object"&&(o.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(o.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?o.time=parseInt(e.time,10):typeof e.time=="number"?o.time=e.time:typeof e.time=="object"&&(o.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(o.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?o.valid=parseInt(e.valid,10):typeof e.valid=="number"?o.valid=e.valid:typeof e.valid=="object"&&(o.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.version!=null&&(o.version=e.version|0),e.compress!=null&&(o.compress=!!e.compress),o},a.toObject=function(e,o){o||(o={});let N={};if(o.defaults){if(N.event="",o.bytes===String?N.data="":(N.data=[],o.bytes!==Array&&(N.data=$util.newBuffer(N.data))),$util.Long){let q=new $util.Long(0,0,!1);N.sn=o.longs===String?q.toString():o.longs===Number?q.toNumber():q}else N.sn=o.longs===String?"0":0;if($util.Long){let q=new $util.Long(0,0,!1);N.time=o.longs===String?q.toString():o.longs===Number?q.toNumber():q}else N.time=o.longs===String?"0":0;if($util.Long){let q=new $util.Long(0,0,!1);N.valid=o.longs===String?q.toString():o.longs===Number?q.toNumber():q}else N.valid=o.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=o.bytes===String?$util.base64.encode(e.data,0,e.data.length):o.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?N.sn=o.longs===String?String(e.sn):e.sn:N.sn=o.longs===String?$util.Long.prototype.toString.call(e.sn):o.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=o.longs===String?String(e.time):e.time:N.time=o.longs===String?$util.Long.prototype.toString.call(e.time):o.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=o.longs===String?String(e.valid):e.valid:N.valid=o.longs===String?$util.Long.prototype.toString.call(e.valid):o.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},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CommonReq"},a}(),D.CommonRsp=function(){function a(k){if(k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.event="",a.prototype.data=$util.newBuffer([]),a.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,a.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,a.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,a.prototype.code=0,a.prototype.desc="",a.prototype.version=0,a.prototype.compress=!1,a.create=function(e){return new a(e)},a.encode=function(e,o){return o||(o=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&o.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&o.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&o.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&o.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&o.uint32(40).int64(e.valid),e.code!=null&&Object.hasOwnProperty.call(e,"code")&&o.uint32(48).int32(e.code),e.desc!=null&&Object.hasOwnProperty.call(e,"desc")&&o.uint32(58).string(e.desc),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&o.uint32(64).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&o.uint32(72).bool(e.compress),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.CommonRsp;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.event=e.string();break}case 2:{q.data=e.bytes();break}case 3:{q.sn=e.int64();break}case 4:{q.time=e.int64();break}case 5:{q.valid=e.int64();break}case 6:{q.code=e.int32();break}case 7:{q.desc=e.string();break}case 8:{q.version=e.int32();break}case 9:{q.compress=e.bool();break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CommonRsp)return e;let o=new $root.com.quick.voice.proto.CommonRsp;return e.event!=null&&(o.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,o.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(o.data=e.data)),e.sn!=null&&($util.Long?(o.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?o.sn=parseInt(e.sn,10):typeof e.sn=="number"?o.sn=e.sn:typeof e.sn=="object"&&(o.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(o.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?o.time=parseInt(e.time,10):typeof e.time=="number"?o.time=e.time:typeof e.time=="object"&&(o.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(o.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?o.valid=parseInt(e.valid,10):typeof e.valid=="number"?o.valid=e.valid:typeof e.valid=="object"&&(o.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.code!=null&&(o.code=e.code|0),e.desc!=null&&(o.desc=String(e.desc)),e.version!=null&&(o.version=e.version|0),e.compress!=null&&(o.compress=!!e.compress),o},a.toObject=function(e,o){o||(o={});let N={};if(o.defaults){if(N.event="",o.bytes===String?N.data="":(N.data=[],o.bytes!==Array&&(N.data=$util.newBuffer(N.data))),$util.Long){let q=new $util.Long(0,0,!1);N.sn=o.longs===String?q.toString():o.longs===Number?q.toNumber():q}else N.sn=o.longs===String?"0":0;if($util.Long){let q=new $util.Long(0,0,!1);N.time=o.longs===String?q.toString():o.longs===Number?q.toNumber():q}else N.time=o.longs===String?"0":0;if($util.Long){let q=new $util.Long(0,0,!1);N.valid=o.longs===String?q.toString():o.longs===Number?q.toNumber():q}else N.valid=o.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=o.bytes===String?$util.base64.encode(e.data,0,e.data.length):o.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?N.sn=o.longs===String?String(e.sn):e.sn:N.sn=o.longs===String?$util.Long.prototype.toString.call(e.sn):o.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=o.longs===String?String(e.time):e.time:N.time=o.longs===String?$util.Long.prototype.toString.call(e.time):o.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=o.longs===String?String(e.valid):e.valid:N.valid=o.longs===String?$util.Long.prototype.toString.call(e.valid):o.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},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CommonRsp"},a}(),D.User=function(){function a(e){if(this.tracks=[],e)for(let o=Object.keys(e),N=0;N<o.length;++N)e[o[N]]!=null&&(this[o[N]]=e[o[N]])}a.prototype.id="",a.prototype.callAction=null,a.prototype.callState=null,a.prototype.joinTime=null,a.prototype.tracks=$util.emptyArray,a.prototype.permissions=null,a.prototype.isPublished=null,a.prototype.behavior=null,a.prototype.channelCache=null;let k;return Object.defineProperty(a.prototype,"_callAction",{get:$util.oneOfGetter(k=["callAction"]),set:$util.oneOfSetter(k)}),Object.defineProperty(a.prototype,"_callState",{get:$util.oneOfGetter(k=["callState"]),set:$util.oneOfSetter(k)}),Object.defineProperty(a.prototype,"_joinTime",{get:$util.oneOfGetter(k=["joinTime"]),set:$util.oneOfSetter(k)}),Object.defineProperty(a.prototype,"_permissions",{get:$util.oneOfGetter(k=["permissions"]),set:$util.oneOfSetter(k)}),Object.defineProperty(a.prototype,"_isPublished",{get:$util.oneOfGetter(k=["isPublished"]),set:$util.oneOfSetter(k)}),Object.defineProperty(a.prototype,"_behavior",{get:$util.oneOfGetter(k=["behavior"]),set:$util.oneOfSetter(k)}),Object.defineProperty(a.prototype,"_channelCache",{get:$util.oneOfGetter(k=["channelCache"]),set:$util.oneOfSetter(k)}),a.create=function(o){return new a(o)},a.encode=function(o,N){if(N||(N=$Writer.create()),o.id!=null&&Object.hasOwnProperty.call(o,"id")&&N.uint32(10).string(o.id),o.callAction!=null&&Object.hasOwnProperty.call(o,"callAction")&&N.uint32(16).int32(o.callAction),o.callState!=null&&Object.hasOwnProperty.call(o,"callState")&&N.uint32(24).int32(o.callState),o.joinTime!=null&&Object.hasOwnProperty.call(o,"joinTime")&&N.uint32(32).int64(o.joinTime),o.tracks!=null&&o.tracks.length)for(let q=0;q<o.tracks.length;++q)$root.com.quick.voice.proto.Track.encode(o.tracks[q],N.uint32(42).fork()).ldelim();return o.permissions!=null&&Object.hasOwnProperty.call(o,"permissions")&&N.uint32(48).int32(o.permissions),o.isPublished!=null&&Object.hasOwnProperty.call(o,"isPublished")&&N.uint32(56).bool(o.isPublished),o.behavior!=null&&Object.hasOwnProperty.call(o,"behavior")&&N.uint32(64).int32(o.behavior),o.channelCache!=null&&Object.hasOwnProperty.call(o,"channelCache")&&$root.com.quick.voice.proto.DataChannelCacheInfo.encode(o.channelCache,N.uint32(74).fork()).ldelim(),N},a.encodeDelimited=function(o,N){return this.encode(o,N).ldelim()},a.decode=function(o,N){o instanceof $Reader||(o=$Reader.create(o));let q=N===void 0?o.len:o.pos+N,F=new $root.com.quick.voice.proto.User;for(;o.pos<q;){let J=o.uint32();switch(J>>>3){case 1:{F.id=o.string();break}case 2:{F.callAction=o.int32();break}case 3:{F.callState=o.int32();break}case 4:{F.joinTime=o.int64();break}case 5:{F.tracks&&F.tracks.length||(F.tracks=[]),F.tracks.push($root.com.quick.voice.proto.Track.decode(o,o.uint32()));break}case 6:{F.permissions=o.int32();break}case 7:{F.isPublished=o.bool();break}case 8:{F.behavior=o.int32();break}case 9:{F.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.decode(o,o.uint32());break}default:o.skipType(J&7);break}}return F},a.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.id!=null&&o.hasOwnProperty("id")&&!$util.isString(o.id))return"id: string expected";if(o.callAction!=null&&o.hasOwnProperty("callAction")&&!$util.isInteger(o.callAction))return"callAction: integer expected";if(o.callState!=null&&o.hasOwnProperty("callState")&&!$util.isInteger(o.callState))return"callState: integer expected";if(o.joinTime!=null&&o.hasOwnProperty("joinTime")&&!$util.isInteger(o.joinTime)&&!(o.joinTime&&$util.isInteger(o.joinTime.low)&&$util.isInteger(o.joinTime.high)))return"joinTime: integer|Long expected";if(o.tracks!=null&&o.hasOwnProperty("tracks")){if(!Array.isArray(o.tracks))return"tracks: array expected";for(let N=0;N<o.tracks.length;++N){let q=$root.com.quick.voice.proto.Track.verify(o.tracks[N]);if(q)return"tracks."+q}}if(o.permissions!=null&&o.hasOwnProperty("permissions")&&!$util.isInteger(o.permissions))return"permissions: integer expected";if(o.isPublished!=null&&o.hasOwnProperty("isPublished")&&typeof o.isPublished!="boolean")return"isPublished: boolean expected";if(o.behavior!=null&&o.hasOwnProperty("behavior")&&!$util.isInteger(o.behavior))return"behavior: integer expected";if(o.channelCache!=null&&o.hasOwnProperty("channelCache")){let N=$root.com.quick.voice.proto.DataChannelCacheInfo.verify(o.channelCache);if(N)return"channelCache."+N}return null},a.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.User)return o;let N=new $root.com.quick.voice.proto.User;if(o.id!=null&&(N.id=String(o.id)),o.callAction!=null&&(N.callAction=o.callAction|0),o.callState!=null&&(N.callState=o.callState|0),o.joinTime!=null&&($util.Long?(N.joinTime=$util.Long.fromValue(o.joinTime)).unsigned=!1:typeof o.joinTime=="string"?N.joinTime=parseInt(o.joinTime,10):typeof o.joinTime=="number"?N.joinTime=o.joinTime:typeof o.joinTime=="object"&&(N.joinTime=new $util.LongBits(o.joinTime.low>>>0,o.joinTime.high>>>0).toNumber())),o.tracks){if(!Array.isArray(o.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");N.tracks=[];for(let q=0;q<o.tracks.length;++q){if(typeof o.tracks[q]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");N.tracks[q]=$root.com.quick.voice.proto.Track.fromObject(o.tracks[q])}}if(o.permissions!=null&&(N.permissions=o.permissions|0),o.isPublished!=null&&(N.isPublished=!!o.isPublished),o.behavior!=null&&(N.behavior=o.behavior|0),o.channelCache!=null){if(typeof o.channelCache!="object")throw TypeError(".com.quick.voice.proto.User.channelCache: object expected");N.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.fromObject(o.channelCache)}return N},a.toObject=function(o,N){N||(N={});let q={};if((N.arrays||N.defaults)&&(q.tracks=[]),N.defaults&&(q.id=""),o.id!=null&&o.hasOwnProperty("id")&&(q.id=o.id),o.callAction!=null&&o.hasOwnProperty("callAction")&&(q.callAction=o.callAction,N.oneofs&&(q._callAction="callAction")),o.callState!=null&&o.hasOwnProperty("callState")&&(q.callState=o.callState,N.oneofs&&(q._callState="callState")),o.joinTime!=null&&o.hasOwnProperty("joinTime")&&(typeof o.joinTime=="number"?q.joinTime=N.longs===String?String(o.joinTime):o.joinTime:q.joinTime=N.longs===String?$util.Long.prototype.toString.call(o.joinTime):N.longs===Number?new $util.LongBits(o.joinTime.low>>>0,o.joinTime.high>>>0).toNumber():o.joinTime,N.oneofs&&(q._joinTime="joinTime")),o.tracks&&o.tracks.length){q.tracks=[];for(let F=0;F<o.tracks.length;++F)q.tracks[F]=$root.com.quick.voice.proto.Track.toObject(o.tracks[F],N)}return o.permissions!=null&&o.hasOwnProperty("permissions")&&(q.permissions=o.permissions,N.oneofs&&(q._permissions="permissions")),o.isPublished!=null&&o.hasOwnProperty("isPublished")&&(q.isPublished=o.isPublished,N.oneofs&&(q._isPublished="isPublished")),o.behavior!=null&&o.hasOwnProperty("behavior")&&(q.behavior=o.behavior,N.oneofs&&(q._behavior="behavior")),o.channelCache!=null&&o.hasOwnProperty("channelCache")&&(q.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.toObject(o.channelCache,N),N.oneofs&&(q._channelCache="channelCache")),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.User"},a}(),D.DataChannelCacheInfo=function(){function a(k){if(this.channels=[],k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.channels=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,o){if(o||(o=$Writer.create()),e.channels!=null&&e.channels.length)for(let N=0;N<e.channels.length;++N)$root.com.quick.voice.proto.DataChannel.encode(e.channels[N],o.uint32(10).fork()).ldelim();return o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.DataChannelCacheInfo;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.channels&&q.channels.length||(q.channels=[]),q.channels.push($root.com.quick.voice.proto.DataChannel.decode(e,e.uint32()));break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let o=0;o<e.channels.length;++o){let N=$root.com.quick.voice.proto.DataChannel.verify(e.channels[o]);if(N)return"channels."+N}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.DataChannelCacheInfo)return e;let o=new $root.com.quick.voice.proto.DataChannelCacheInfo;if(e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: array expected");o.channels=[];for(let N=0;N<e.channels.length;++N){if(typeof e.channels[N]!="object")throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: object expected");o.channels[N]=$root.com.quick.voice.proto.DataChannel.fromObject(e.channels[N])}}return o},a.toObject=function(e,o){o||(o={});let N={};if((o.arrays||o.defaults)&&(N.channels=[]),e.channels&&e.channels.length){N.channels=[];for(let q=0;q<e.channels.length;++q)N.channels[q]=$root.com.quick.voice.proto.DataChannel.toObject(e.channels[q],o)}return N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.DataChannelCacheInfo"},a}(),D.DataChannel=function(){function a(e){if(e)for(let o=Object.keys(e),N=0;N<o.length;++N)e[o[N]]!=null&&(this[o[N]]=e[o[N]])}a.prototype.dataChannelName="",a.prototype.id=null;let k;return Object.defineProperty(a.prototype,"_id",{get:$util.oneOfGetter(k=["id"]),set:$util.oneOfSetter(k)}),a.create=function(o){return new a(o)},a.encode=function(o,N){return N||(N=$Writer.create()),o.dataChannelName!=null&&Object.hasOwnProperty.call(o,"dataChannelName")&&N.uint32(10).string(o.dataChannelName),o.id!=null&&Object.hasOwnProperty.call(o,"id")&&N.uint32(16).int32(o.id),N},a.encodeDelimited=function(o,N){return this.encode(o,N).ldelim()},a.decode=function(o,N){o instanceof $Reader||(o=$Reader.create(o));let q=N===void 0?o.len:o.pos+N,F=new $root.com.quick.voice.proto.DataChannel;for(;o.pos<q;){let J=o.uint32();switch(J>>>3){case 1:{F.dataChannelName=o.string();break}case 2:{F.id=o.int32();break}default:o.skipType(J&7);break}}return F},a.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},a.verify=function(o){return typeof o!="object"||o===null?"object expected":o.dataChannelName!=null&&o.hasOwnProperty("dataChannelName")&&!$util.isString(o.dataChannelName)?"dataChannelName: string expected":o.id!=null&&o.hasOwnProperty("id")&&!$util.isInteger(o.id)?"id: integer expected":null},a.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.DataChannel)return o;let N=new $root.com.quick.voice.proto.DataChannel;return o.dataChannelName!=null&&(N.dataChannelName=String(o.dataChannelName)),o.id!=null&&(N.id=o.id|0),N},a.toObject=function(o,N){N||(N={});let q={};return N.defaults&&(q.dataChannelName=""),o.dataChannelName!=null&&o.hasOwnProperty("dataChannelName")&&(q.dataChannelName=o.dataChannelName),o.id!=null&&o.hasOwnProperty("id")&&(q.id=o.id,N.oneofs&&(q._id="id")),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.DataChannel"},a}(),D.Login=function(){function a(k){if(k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.appid="",a.prototype.userId="",a.prototype.sdkToken="",a.create=function(e){return new a(e)},a.encode=function(e,o){return o||(o=$Writer.create()),e.appid!=null&&Object.hasOwnProperty.call(e,"appid")&&o.uint32(10).string(e.appid),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&o.uint32(18).string(e.userId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&o.uint32(26).string(e.sdkToken),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.Login;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.appid=e.string();break}case 2:{q.userId=e.string();break}case 3:{q.sdkToken=e.string();break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.Login)return e;let o=new $root.com.quick.voice.proto.Login;return e.appid!=null&&(o.appid=String(e.appid)),e.userId!=null&&(o.userId=String(e.userId)),e.sdkToken!=null&&(o.sdkToken=String(e.sdkToken)),o},a.toObject=function(e,o){o||(o={});let N={};return o.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},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.Login"},a}(),D.Track=function(){function a(e){if(e)for(let o=Object.keys(e),N=0;N<o.length;++N)e[o[N]]!=null&&(this[o[N]]=e[o[N]])}a.prototype.mid="",a.prototype.trackName=null,a.prototype.location=null,a.prototype.userId=null,a.prototype.code=null,a.prototype.desc=null,a.prototype.type=null,a.prototype.isValid=null,a.prototype.simulcast=null;let k;return Object.defineProperty(a.prototype,"_trackName",{get:$util.oneOfGetter(k=["trackName"]),set:$util.oneOfSetter(k)}),Object.defineProperty(a.prototype,"_location",{get:$util.oneOfGetter(k=["location"]),set:$util.oneOfSetter(k)}),Object.defineProperty(a.prototype,"_userId",{get:$util.oneOfGetter(k=["userId"]),set:$util.oneOfSetter(k)}),Object.defineProperty(a.prototype,"_code",{get:$util.oneOfGetter(k=["code"]),set:$util.oneOfSetter(k)}),Object.defineProperty(a.prototype,"_desc",{get:$util.oneOfGetter(k=["desc"]),set:$util.oneOfSetter(k)}),Object.defineProperty(a.prototype,"_type",{get:$util.oneOfGetter(k=["type"]),set:$util.oneOfSetter(k)}),Object.defineProperty(a.prototype,"_isValid",{get:$util.oneOfGetter(k=["isValid"]),set:$util.oneOfSetter(k)}),Object.defineProperty(a.prototype,"_simulcast",{get:$util.oneOfGetter(k=["simulcast"]),set:$util.oneOfSetter(k)}),a.create=function(o){return new a(o)},a.encode=function(o,N){return N||(N=$Writer.create()),o.mid!=null&&Object.hasOwnProperty.call(o,"mid")&&N.uint32(10).string(o.mid),o.trackName!=null&&Object.hasOwnProperty.call(o,"trackName")&&N.uint32(18).string(o.trackName),o.location!=null&&Object.hasOwnProperty.call(o,"location")&&N.uint32(26).string(o.location),o.userId!=null&&Object.hasOwnProperty.call(o,"userId")&&N.uint32(34).string(o.userId),o.code!=null&&Object.hasOwnProperty.call(o,"code")&&N.uint32(40).int32(o.code),o.desc!=null&&Object.hasOwnProperty.call(o,"desc")&&N.uint32(50).string(o.desc),o.type!=null&&Object.hasOwnProperty.call(o,"type")&&N.uint32(56).int32(o.type),o.isValid!=null&&Object.hasOwnProperty.call(o,"isValid")&&N.uint32(64).bool(o.isValid),o.simulcast!=null&&Object.hasOwnProperty.call(o,"simulcast")&&N.uint32(74).string(o.simulcast),N},a.encodeDelimited=function(o,N){return this.encode(o,N).ldelim()},a.decode=function(o,N){o instanceof $Reader||(o=$Reader.create(o));let q=N===void 0?o.len:o.pos+N,F=new $root.com.quick.voice.proto.Track;for(;o.pos<q;){let J=o.uint32();switch(J>>>3){case 1:{F.mid=o.string();break}case 2:{F.trackName=o.string();break}case 3:{F.location=o.string();break}case 4:{F.userId=o.string();break}case 5:{F.code=o.int32();break}case 6:{F.desc=o.string();break}case 7:{F.type=o.int32();break}case 8:{F.isValid=o.bool();break}case 9:{F.simulcast=o.string();break}default:o.skipType(J&7);break}}return F},a.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.mid!=null&&o.hasOwnProperty("mid")&&!$util.isString(o.mid))return"mid: string expected";if(o.trackName!=null&&o.hasOwnProperty("trackName")&&!$util.isString(o.trackName))return"trackName: string expected";if(o.location!=null&&o.hasOwnProperty("location")&&!$util.isString(o.location))return"location: string expected";if(o.userId!=null&&o.hasOwnProperty("userId")&&!$util.isString(o.userId))return"userId: string expected";if(o.code!=null&&o.hasOwnProperty("code")&&!$util.isInteger(o.code))return"code: integer expected";if(o.desc!=null&&o.hasOwnProperty("desc")&&!$util.isString(o.desc))return"desc: string expected";if(o.type!=null&&o.hasOwnProperty("type"))switch(o.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return o.isValid!=null&&o.hasOwnProperty("isValid")&&typeof o.isValid!="boolean"?"isValid: boolean expected":o.simulcast!=null&&o.hasOwnProperty("simulcast")&&!$util.isString(o.simulcast)?"simulcast: string expected":null},a.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.Track)return o;let N=new $root.com.quick.voice.proto.Track;switch(o.mid!=null&&(N.mid=String(o.mid)),o.trackName!=null&&(N.trackName=String(o.trackName)),o.location!=null&&(N.location=String(o.location)),o.userId!=null&&(N.userId=String(o.userId)),o.code!=null&&(N.code=o.code|0),o.desc!=null&&(N.desc=String(o.desc)),o.type){default:if(typeof o.type=="number"){N.type=o.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 o.isValid!=null&&(N.isValid=!!o.isValid),o.simulcast!=null&&(N.simulcast=String(o.simulcast)),N},a.toObject=function(o,N){N||(N={});let q={};return N.defaults&&(q.mid=""),o.mid!=null&&o.hasOwnProperty("mid")&&(q.mid=o.mid),o.trackName!=null&&o.hasOwnProperty("trackName")&&(q.trackName=o.trackName,N.oneofs&&(q._trackName="trackName")),o.location!=null&&o.hasOwnProperty("location")&&(q.location=o.location,N.oneofs&&(q._location="location")),o.userId!=null&&o.hasOwnProperty("userId")&&(q.userId=o.userId,N.oneofs&&(q._userId="userId")),o.code!=null&&o.hasOwnProperty("code")&&(q.code=o.code,N.oneofs&&(q._code="code")),o.desc!=null&&o.hasOwnProperty("desc")&&(q.desc=o.desc,N.oneofs&&(q._desc="desc")),o.type!=null&&o.hasOwnProperty("type")&&(q.type=N.enums===String?$root.com.quick.voice.proto.TrackType[o.type]===void 0?o.type:$root.com.quick.voice.proto.TrackType[o.type]:o.type,N.oneofs&&(q._type="type")),o.isValid!=null&&o.hasOwnProperty("isValid")&&(q.isValid=o.isValid,N.oneofs&&(q._isValid="isValid")),o.simulcast!=null&&o.hasOwnProperty("simulcast")&&(q.simulcast=o.simulcast,N.oneofs&&(q._simulcast="simulcast")),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.Track"},a}(),D.JoinReq=function(){function a(e){if(e)for(let o=Object.keys(e),N=0;N<o.length;++N)e[o[N]]!=null&&(this[o[N]]=e[o[N]])}a.prototype.roomId="",a.prototype.user=null,a.prototype.callType=0,a.prototype.token=null;let k;return Object.defineProperty(a.prototype,"_token",{get:$util.oneOfGetter(k=["token"]),set:$util.oneOfSetter(k)}),a.create=function(o){return new a(o)},a.encode=function(o,N){return N||(N=$Writer.create()),o.roomId!=null&&Object.hasOwnProperty.call(o,"roomId")&&N.uint32(10).string(o.roomId),o.user!=null&&Object.hasOwnProperty.call(o,"user")&&$root.com.quick.voice.proto.User.encode(o.user,N.uint32(18).fork()).ldelim(),o.callType!=null&&Object.hasOwnProperty.call(o,"callType")&&N.uint32(24).int32(o.callType),o.token!=null&&Object.hasOwnProperty.call(o,"token")&&N.uint32(34).string(o.token),N},a.encodeDelimited=function(o,N){return this.encode(o,N).ldelim()},a.decode=function(o,N){o instanceof $Reader||(o=$Reader.create(o));let q=N===void 0?o.len:o.pos+N,F=new $root.com.quick.voice.proto.JoinReq;for(;o.pos<q;){let J=o.uint32();switch(J>>>3){case 1:{F.roomId=o.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(o,o.uint32());break}case 3:{F.callType=o.int32();break}case 4:{F.token=o.string();break}default:o.skipType(J&7);break}}return F},a.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.roomId!=null&&o.hasOwnProperty("roomId")&&!$util.isString(o.roomId))return"roomId: string expected";if(o.user!=null&&o.hasOwnProperty("user")){let N=$root.com.quick.voice.proto.User.verify(o.user);if(N)return"user."+N}if(o.callType!=null&&o.hasOwnProperty("callType"))switch(o.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return o.token!=null&&o.hasOwnProperty("token")&&!$util.isString(o.token)?"token: string expected":null},a.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.JoinReq)return o;let N=new $root.com.quick.voice.proto.JoinReq;if(o.roomId!=null&&(N.roomId=String(o.roomId)),o.user!=null){if(typeof o.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");N.user=$root.com.quick.voice.proto.User.fromObject(o.user)}switch(o.callType){default:if(typeof o.callType=="number"){N.callType=o.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 o.token!=null&&(N.token=String(o.token)),N},a.toObject=function(o,N){N||(N={});let q={};return N.defaults&&(q.roomId="",q.user=null,q.callType=N.enums===String?"Normal":0),o.roomId!=null&&o.hasOwnProperty("roomId")&&(q.roomId=o.roomId),o.user!=null&&o.hasOwnProperty("user")&&(q.user=$root.com.quick.voice.proto.User.toObject(o.user,N)),o.callType!=null&&o.hasOwnProperty("callType")&&(q.callType=N.enums===String?$root.com.quick.voice.proto.CallType[o.callType]===void 0?o.callType:$root.com.quick.voice.proto.CallType[o.callType]:o.callType),o.token!=null&&o.hasOwnProperty("token")&&(q.token=o.token,N.oneofs&&(q._token="token")),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.JoinReq"},a}(),D.JoinRsp=function(){function a(k){if(this.roomUsers=[],k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.roomId="",a.prototype.roomUsers=$util.emptyArray,a.prototype.callType=0,a.create=function(e){return new a(e)},a.encode=function(e,o){if(o||(o=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&o.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],o.uint32(18).fork()).ldelim();return e.callType!=null&&Object.hasOwnProperty.call(e,"callType")&&o.uint32(24).int32(e.callType),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.JoinRsp;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.roomId=e.string();break}case 2:{q.roomUsers&&q.roomUsers.length||(q.roomUsers=[]),q.roomUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 3:{q.callType=e.int32();break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 o=0;o<e.roomUsers.length;++o){let N=$root.com.quick.voice.proto.User.verify(e.roomUsers[o]);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},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinRsp)return e;let o=new $root.com.quick.voice.proto.JoinRsp;if(e.roomId!=null&&(o.roomId=String(e.roomId)),e.roomUsers){if(!Array.isArray(e.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");o.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");o.roomUsers[N]=$root.com.quick.voice.proto.User.fromObject(e.roomUsers[N])}}switch(e.callType){default:if(typeof e.callType=="number"){o.callType=e.callType;break}break;case"Normal":case 0:o.callType=0;break;case"Meeting":case 1:o.callType=1;break;case"Live":case 2:o.callType=2;break}return o},a.toObject=function(e,o){o||(o={});let N={};if((o.arrays||o.defaults)&&(N.roomUsers=[]),o.defaults&&(N.roomId="",N.callType=o.enums===String?"Normal":0),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.roomUsers&&e.roomUsers.length){N.roomUsers=[];for(let q=0;q<e.roomUsers.length;++q)N.roomUsers[q]=$root.com.quick.voice.proto.User.toObject(e.roomUsers[q],o)}return e.callType!=null&&e.hasOwnProperty("callType")&&(N.callType=o.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},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinRsp"},a}(),D.JoinNotify=function(){function a(k){if(k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.roomId="",a.prototype.user=null,a.create=function(e){return new a(e)},a.encode=function(e,o){return o||(o=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&o.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,o.uint32(18).fork()).ldelim(),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.JoinNotify;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.roomId=e.string();break}case 2:{q.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 o=$root.com.quick.voice.proto.User.verify(e.user);if(o)return"user."+o}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinNotify)return e;let o=new $root.com.quick.voice.proto.JoinNotify;if(e.roomId!=null&&(o.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");o.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return o},a.toObject=function(e,o){o||(o={});let N={};return o.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,o)),N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinNotify"},a}(),D.ConnectCFReq=function(){function a(k){if(k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.sdp="",a.create=function(e){return new a(e)},a.encode=function(e,o){return o||(o=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&o.uint32(10).string(e.sdp),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.ConnectCFReq;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.sdp=e.string();break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ConnectCFReq)return e;let o=new $root.com.quick.voice.proto.ConnectCFReq;return e.sdp!=null&&(o.sdp=String(e.sdp)),o},a.toObject=function(e,o){o||(o={});let N={};return o.defaults&&(N.sdp=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(N.sdp=e.sdp),N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ConnectCFReq"},a}(),D.ConnectCFRsp=function(){function a(k){if(this.subscribeUsers=[],k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.remoteSdp="",a.prototype.subscribeUsers=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,o){if(o||(o=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&o.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],o.uint32(18).fork()).ldelim();return o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.ConnectCFRsp;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.remoteSdp=e.string();break}case 2:{q.subscribeUsers&&q.subscribeUsers.length||(q.subscribeUsers=[]),q.subscribeUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 o=0;o<e.subscribeUsers.length;++o){let N=$root.com.quick.voice.proto.User.verify(e.subscribeUsers[o]);if(N)return"subscribeUsers."+N}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ConnectCFRsp)return e;let o=new $root.com.quick.voice.proto.ConnectCFRsp;if(e.remoteSdp!=null&&(o.remoteSdp=String(e.remoteSdp)),e.subscribeUsers){if(!Array.isArray(e.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");o.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");o.subscribeUsers[N]=$root.com.quick.voice.proto.User.fromObject(e.subscribeUsers[N])}}return o},a.toObject=function(e,o){o||(o={});let N={};if((o.arrays||o.defaults)&&(N.subscribeUsers=[]),o.defaults&&(N.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(N.remoteSdp=e.remoteSdp),e.subscribeUsers&&e.subscribeUsers.length){N.subscribeUsers=[];for(let q=0;q<e.subscribeUsers.length;++q)N.subscribeUsers[q]=$root.com.quick.voice.proto.User.toObject(e.subscribeUsers[q],o)}return N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ConnectCFRsp"},a}(),D.PublishReq=function(){function a(e){if(this.tracks=[],e)for(let o=Object.keys(e),N=0;N<o.length;++N)e[o[N]]!=null&&(this[o[N]]=e[o[N]])}a.prototype.sdp="",a.prototype.tracks=$util.emptyArray,a.prototype.callAction=0,a.prototype.recreate=null;let k;return Object.defineProperty(a.prototype,"_recreate",{get:$util.oneOfGetter(k=["recreate"]),set:$util.oneOfSetter(k)}),a.create=function(o){return new a(o)},a.encode=function(o,N){if(N||(N=$Writer.create()),o.sdp!=null&&Object.hasOwnProperty.call(o,"sdp")&&N.uint32(10).string(o.sdp),o.tracks!=null&&o.tracks.length)for(let q=0;q<o.tracks.length;++q)$root.com.quick.voice.proto.Track.encode(o.tracks[q],N.uint32(18).fork()).ldelim();return o.callAction!=null&&Object.hasOwnProperty.call(o,"callAction")&&N.uint32(24).int32(o.callAction),o.recreate!=null&&Object.hasOwnProperty.call(o,"recreate")&&N.uint32(32).bool(o.recreate),N},a.encodeDelimited=function(o,N){return this.encode(o,N).ldelim()},a.decode=function(o,N){o instanceof $Reader||(o=$Reader.create(o));let q=N===void 0?o.len:o.pos+N,F=new $root.com.quick.voice.proto.PublishReq;for(;o.pos<q;){let J=o.uint32();switch(J>>>3){case 1:{F.sdp=o.string();break}case 2:{F.tracks&&F.tracks.length||(F.tracks=[]),F.tracks.push($root.com.quick.voice.proto.Track.decode(o,o.uint32()));break}case 3:{F.callAction=o.int32();break}case 4:{F.recreate=o.bool();break}default:o.skipType(J&7);break}}return F},a.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.sdp!=null&&o.hasOwnProperty("sdp")&&!$util.isString(o.sdp))return"sdp: string expected";if(o.tracks!=null&&o.hasOwnProperty("tracks")){if(!Array.isArray(o.tracks))return"tracks: array expected";for(let N=0;N<o.tracks.length;++N){let q=$root.com.quick.voice.proto.Track.verify(o.tracks[N]);if(q)return"tracks."+q}}return o.callAction!=null&&o.hasOwnProperty("callAction")&&!$util.isInteger(o.callAction)?"callAction: integer expected":o.recreate!=null&&o.hasOwnProperty("recreate")&&typeof o.recreate!="boolean"?"recreate: boolean expected":null},a.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.PublishReq)return o;let N=new $root.com.quick.voice.proto.PublishReq;if(o.sdp!=null&&(N.sdp=String(o.sdp)),o.tracks){if(!Array.isArray(o.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");N.tracks=[];for(let q=0;q<o.tracks.length;++q){if(typeof o.tracks[q]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");N.tracks[q]=$root.com.quick.voice.proto.Track.fromObject(o.tracks[q])}}return o.callAction!=null&&(N.callAction=o.callAction|0),o.recreate!=null&&(N.recreate=!!o.recreate),N},a.toObject=function(o,N){N||(N={});let q={};if((N.arrays||N.defaults)&&(q.tracks=[]),N.defaults&&(q.sdp="",q.callAction=0),o.sdp!=null&&o.hasOwnProperty("sdp")&&(q.sdp=o.sdp),o.tracks&&o.tracks.length){q.tracks=[];for(let F=0;F<o.tracks.length;++F)q.tracks[F]=$root.com.quick.voice.proto.Track.toObject(o.tracks[F],N)}return o.callAction!=null&&o.hasOwnProperty("callAction")&&(q.callAction=o.callAction),o.recreate!=null&&o.hasOwnProperty("recreate")&&(q.recreate=o.recreate,N.oneofs&&(q._recreate="recreate")),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.PublishReq"},a}(),D.PublishRsp=function(){function a(k){if(k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.remoteSdp="",a.create=function(e){return new a(e)},a.encode=function(e,o){return o||(o=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&o.uint32(10).string(e.remoteSdp),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.PublishRsp;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.remoteSdp=e.string();break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PublishRsp)return e;let o=new $root.com.quick.voice.proto.PublishRsp;return e.remoteSdp!=null&&(o.remoteSdp=String(e.remoteSdp)),o},a.toObject=function(e,o){o||(o={});let N={};return o.defaults&&(N.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(N.remoteSdp=e.remoteSdp),N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PublishRsp"},a}(),D.PublishNotify=function(){function a(k){if(k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.roomId="",a.prototype.user=null,a.create=function(e){return new a(e)},a.encode=function(e,o){return o||(o=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&o.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,o.uint32(18).fork()).ldelim(),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.PublishNotify;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.roomId=e.string();break}case 2:{q.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 o=$root.com.quick.voice.proto.User.verify(e.user);if(o)return"user."+o}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PublishNotify)return e;let o=new $root.com.quick.voice.proto.PublishNotify;if(e.roomId!=null&&(o.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");o.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return o},a.toObject=function(e,o){o||(o={});let N={};return o.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,o)),N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PublishNotify"},a}(),D.SubscribeReq=function(){function a(k){if(this.users=[],k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.users=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,o){if(o||(o=$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],o.uint32(10).fork()).ldelim();return o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.SubscribeReq;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.users&&q.users.length||(q.users=[]),q.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 o=0;o<e.users.length;++o){let N=$root.com.quick.voice.proto.User.verify(e.users[o]);if(N)return"users."+N}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SubscribeReq)return e;let o=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");o.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");o.users[N]=$root.com.quick.voice.proto.User.fromObject(e.users[N])}}return o},a.toObject=function(e,o){o||(o={});let N={};if((o.arrays||o.defaults)&&(N.users=[]),e.users&&e.users.length){N.users=[];for(let q=0;q<e.users.length;++q)N.users[q]=$root.com.quick.voice.proto.User.toObject(e.users[q],o)}return N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SubscribeReq"},a}(),D.SubscribeRsp=function(){function a(k){if(this.users=[],k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.remoteSdp="",a.prototype.users=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,o){if(o||(o=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&o.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],o.uint32(18).fork()).ldelim();return o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.SubscribeRsp;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.remoteSdp=e.string();break}case 2:{q.users&&q.users.length||(q.users=[]),q.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 o=0;o<e.users.length;++o){let N=$root.com.quick.voice.proto.User.verify(e.users[o]);if(N)return"users."+N}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SubscribeRsp)return e;let o=new $root.com.quick.voice.proto.SubscribeRsp;if(e.remoteSdp!=null&&(o.remoteSdp=String(e.remoteSdp)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");o.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");o.users[N]=$root.com.quick.voice.proto.User.fromObject(e.users[N])}}return o},a.toObject=function(e,o){o||(o={});let N={};if((o.arrays||o.defaults)&&(N.users=[]),o.defaults&&(N.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(N.remoteSdp=e.remoteSdp),e.users&&e.users.length){N.users=[];for(let q=0;q<e.users.length;++q)N.users[q]=$root.com.quick.voice.proto.User.toObject(e.users[q],o)}return N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SubscribeRsp"},a}(),D.RenegotiateReq=function(){function a(k){if(k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.userId="",a.prototype.sdp="",a.create=function(e){return new a(e)},a.encode=function(e,o){return o||(o=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&o.uint32(10).string(e.userId),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&o.uint32(18).string(e.sdp),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.RenegotiateReq;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.userId=e.string();break}case 2:{q.sdp=e.string();break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.RenegotiateReq)return e;let o=new $root.com.quick.voice.proto.RenegotiateReq;return e.userId!=null&&(o.userId=String(e.userId)),e.sdp!=null&&(o.sdp=String(e.sdp)),o},a.toObject=function(e,o){o||(o={});let N={};return o.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},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.RenegotiateReq"},a}(),D.QuitReq=function(){function a(k){if(k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.userId="",a.prototype.roomId="",a.create=function(e){return new a(e)},a.encode=function(e,o){return o||(o=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&o.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&o.uint32(18).string(e.roomId),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.QuitReq;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.userId=e.string();break}case 2:{q.roomId=e.string();break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.QuitReq)return e;let o=new $root.com.quick.voice.proto.QuitReq;return e.userId!=null&&(o.userId=String(e.userId)),e.roomId!=null&&(o.roomId=String(e.roomId)),o},a.toObject=function(e,o){o||(o={});let N={};return o.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},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.QuitReq"},a}(),D.QuitNotify=function(){function a(e){if(e)for(let o=Object.keys(e),N=0;N<o.length;++N)e[o[N]]!=null&&(this[o[N]]=e[o[N]])}a.prototype.roomId="",a.prototype.user=null,a.prototype.code=null,a.prototype.desc=null;let k;return Object.defineProperty(a.prototype,"_code",{get:$util.oneOfGetter(k=["code"]),set:$util.oneOfSetter(k)}),Object.defineProperty(a.prototype,"_desc",{get:$util.oneOfGetter(k=["desc"]),set:$util.oneOfSetter(k)}),a.create=function(o){return new a(o)},a.encode=function(o,N){return N||(N=$Writer.create()),o.roomId!=null&&Object.hasOwnProperty.call(o,"roomId")&&N.uint32(10).string(o.roomId),o.user!=null&&Object.hasOwnProperty.call(o,"user")&&$root.com.quick.voice.proto.User.encode(o.user,N.uint32(18).fork()).ldelim(),o.code!=null&&Object.hasOwnProperty.call(o,"code")&&N.uint32(24).int32(o.code),o.desc!=null&&Object.hasOwnProperty.call(o,"desc")&&N.uint32(34).string(o.desc),N},a.encodeDelimited=function(o,N){return this.encode(o,N).ldelim()},a.decode=function(o,N){o instanceof $Reader||(o=$Reader.create(o));let q=N===void 0?o.len:o.pos+N,F=new $root.com.quick.voice.proto.QuitNotify;for(;o.pos<q;){let J=o.uint32();switch(J>>>3){case 1:{F.roomId=o.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(o,o.uint32());break}case 3:{F.code=o.int32();break}case 4:{F.desc=o.string();break}default:o.skipType(J&7);break}}return F},a.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.roomId!=null&&o.hasOwnProperty("roomId")&&!$util.isString(o.roomId))return"roomId: string expected";if(o.user!=null&&o.hasOwnProperty("user")){let N=$root.com.quick.voice.proto.User.verify(o.user);if(N)return"user."+N}return o.code!=null&&o.hasOwnProperty("code")&&!$util.isInteger(o.code)?"code: integer expected":o.desc!=null&&o.hasOwnProperty("desc")&&!$util.isString(o.desc)?"desc: string expected":null},a.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.QuitNotify)return o;let N=new $root.com.quick.voice.proto.QuitNotify;if(o.roomId!=null&&(N.roomId=String(o.roomId)),o.user!=null){if(typeof o.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");N.user=$root.com.quick.voice.proto.User.fromObject(o.user)}return o.code!=null&&(N.code=o.code|0),o.desc!=null&&(N.desc=String(o.desc)),N},a.toObject=function(o,N){N||(N={});let q={};return N.defaults&&(q.roomId="",q.user=null),o.roomId!=null&&o.hasOwnProperty("roomId")&&(q.roomId=o.roomId),o.user!=null&&o.hasOwnProperty("user")&&(q.user=$root.com.quick.voice.proto.User.toObject(o.user,N)),o.code!=null&&o.hasOwnProperty("code")&&(q.code=o.code,N.oneofs&&(q._code="code")),o.desc!=null&&o.hasOwnProperty("desc")&&(q.desc=o.desc,N.oneofs&&(q._desc="desc")),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.QuitNotify"},a}(),D.TokenExpireNotify=function(){function a(k){if(k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.roomId="",a.create=function(e){return new a(e)},a.encode=function(e,o){return o||(o=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&o.uint32(10).string(e.roomId),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.TokenExpireNotify;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.roomId=e.string();break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.TokenExpireNotify)return e;let o=new $root.com.quick.voice.proto.TokenExpireNotify;return e.roomId!=null&&(o.roomId=String(e.roomId)),o},a.toObject=function(e,o){o||(o={});let N={};return o.defaults&&(N.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.TokenExpireNotify"},a}(),D.UpdateTokenReq=function(){function a(k){if(k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.roomId="",a.prototype.sdkToken="",a.create=function(e){return new a(e)},a.encode=function(e,o){return o||(o=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&o.uint32(10).string(e.roomId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&o.uint32(18).string(e.sdkToken),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.UpdateTokenReq;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.roomId=e.string();break}case 2:{q.sdkToken=e.string();break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTokenReq)return e;let o=new $root.com.quick.voice.proto.UpdateTokenReq;return e.roomId!=null&&(o.roomId=String(e.roomId)),e.sdkToken!=null&&(o.sdkToken=String(e.sdkToken)),o},a.toObject=function(e,o){o||(o={});let N={};return o.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},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTokenReq"},a}(),D.NetQualityChange=function(){function a(k){if(k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.userId="",a.prototype.roomId="",a.prototype.egress=0,a.prototype.ingress=0,a.create=function(e){return new a(e)},a.encode=function(e,o){return o||(o=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&o.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&o.uint32(18).string(e.roomId),e.egress!=null&&Object.hasOwnProperty.call(e,"egress")&&o.uint32(24).int32(e.egress),e.ingress!=null&&Object.hasOwnProperty.call(e,"ingress")&&o.uint32(32).int32(e.ingress),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.NetQualityChange;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.userId=e.string();break}case 2:{q.roomId=e.string();break}case 3:{q.egress=e.int32();break}case 4:{q.ingress=e.int32();break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.NetQualityChange)return e;let o=new $root.com.quick.voice.proto.NetQualityChange;return e.userId!=null&&(o.userId=String(e.userId)),e.roomId!=null&&(o.roomId=String(e.roomId)),e.egress!=null&&(o.egress=e.egress|0),e.ingress!=null&&(o.ingress=e.ingress|0),o},a.toObject=function(e,o){o||(o={});let N={};return o.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},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.NetQualityChange"},a}(),D.NetQualityNotify=function(){function a(k){if(this.qualities=[],k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.qualities=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,o){if(o||(o=$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],o.uint32(10).fork()).ldelim();return o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.NetQualityNotify;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.qualities&&q.qualities.length||(q.qualities=[]),q.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(e,e.uint32()));break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 o=0;o<e.qualities.length;++o){let N=$root.com.quick.voice.proto.NetQualityChange.verify(e.qualities[o]);if(N)return"qualities."+N}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.NetQualityNotify)return e;let o=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");o.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");o.qualities[N]=$root.com.quick.voice.proto.NetQualityChange.fromObject(e.qualities[N])}}return o},a.toObject=function(e,o){o||(o={});let N={};if((o.arrays||o.defaults)&&(N.qualities=[]),e.qualities&&e.qualities.length){N.qualities=[];for(let q=0;q<e.qualities.length;++q)N.qualities[q]=$root.com.quick.voice.proto.NetQualityChange.toObject(e.qualities[q],o)}return N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.NetQualityNotify"},a}(),D.UpdateCall=function(){function a(k){if(k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.roomId="",a.prototype.user=null,a.create=function(e){return new a(e)},a.encode=function(e,o){return o||(o=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&o.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,o.uint32(18).fork()).ldelim(),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.UpdateCall;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.roomId=e.string();break}case 2:{q.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 o=$root.com.quick.voice.proto.User.verify(e.user);if(o)return"user."+o}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateCall)return e;let o=new $root.com.quick.voice.proto.UpdateCall;if(e.roomId!=null&&(o.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");o.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return o},a.toObject=function(e,o){o||(o={});let N={};return o.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,o)),N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateCall"},a}(),D.SyncRoomInfoReq=function(){function a(k){if(k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.roomId="",a.prototype.user=null,a.create=function(e){return new a(e)},a.encode=function(e,o){return o||(o=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&o.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,o.uint32(18).fork()).ldelim(),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.roomId=e.string();break}case 2:{q.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 o=$root.com.quick.voice.proto.User.verify(e.user);if(o)return"user."+o}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return e;let o=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(e.roomId!=null&&(o.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");o.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return o},a.toObject=function(e,o){o||(o={});let N={};return o.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,o)),N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SyncRoomInfoReq"},a}(),D.SyncRoomInfoRsp=function(){function a(k){if(this.users=[],k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.roomId="",a.prototype.isValid=!1,a.prototype.users=$util.emptyArray,a.prototype.isActive=!1,a.create=function(e){return new a(e)},a.encode=function(e,o){if(o||(o=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&o.uint32(10).string(e.roomId),e.isValid!=null&&Object.hasOwnProperty.call(e,"isValid")&&o.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],o.uint32(26).fork()).ldelim();return e.isActive!=null&&Object.hasOwnProperty.call(e,"isActive")&&o.uint32(32).bool(e.isActive),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.roomId=e.string();break}case 2:{q.isValid=e.bool();break}case 3:{q.users&&q.users.length||(q.users=[]),q.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 4:{q.isActive=e.bool();break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 o=0;o<e.users.length;++o){let N=$root.com.quick.voice.proto.User.verify(e.users[o]);if(N)return"users."+N}}return e.isActive!=null&&e.hasOwnProperty("isActive")&&typeof e.isActive!="boolean"?"isActive: boolean expected":null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return e;let o=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(e.roomId!=null&&(o.roomId=String(e.roomId)),e.isValid!=null&&(o.isValid=!!e.isValid),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");o.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");o.users[N]=$root.com.quick.voice.proto.User.fromObject(e.users[N])}}return e.isActive!=null&&(o.isActive=!!e.isActive),o},a.toObject=function(e,o){o||(o={});let N={};if((o.arrays||o.defaults)&&(N.users=[]),o.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 q=0;q<e.users.length;++q)N.users[q]=$root.com.quick.voice.proto.User.toObject(e.users[q],o)}return e.isActive!=null&&e.hasOwnProperty("isActive")&&(N.isActive=e.isActive),N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SyncRoomInfoRsp"},a}(),D.UpdateTime=function(){function a(k){if(k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,a.create=function(e){return new a(e)},a.encode=function(e,o){return o||(o=$Writer.create()),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&o.uint32(8).int64(e.time),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.UpdateTime;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.time=e.int64();break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTime)return e;let o=new $root.com.quick.voice.proto.UpdateTime;return e.time!=null&&($util.Long?(o.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?o.time=parseInt(e.time,10):typeof e.time=="number"?o.time=e.time:typeof e.time=="object"&&(o.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),o},a.toObject=function(e,o){o||(o={});let N={};if(o.defaults)if($util.Long){let q=new $util.Long(0,0,!1);N.time=o.longs===String?q.toString():o.longs===Number?q.toNumber():q}else N.time=o.longs===String?"0":0;return e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?N.time=o.longs===String?String(e.time):e.time:N.time=o.longs===String?$util.Long.prototype.toString.call(e.time):o.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTime"},a}(),D.CloseTrackReq=function(){function a(k){if(this.tracks=[],k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.sdp="",a.prototype.tracks=$util.emptyArray,a.prototype.roomId="",a.create=function(e){return new a(e)},a.encode=function(e,o){if(o||(o=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&o.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],o.uint32(18).fork()).ldelim();return e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&o.uint32(26).string(e.roomId),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.CloseTrackReq;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.sdp=e.string();break}case 2:{q.tracks&&q.tracks.length||(q.tracks=[]),q.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}case 3:{q.roomId=e.string();break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 o=0;o<e.tracks.length;++o){let N=$root.com.quick.voice.proto.Track.verify(e.tracks[o]);if(N)return"tracks."+N}}return e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackReq)return e;let o=new $root.com.quick.voice.proto.CloseTrackReq;if(e.sdp!=null&&(o.sdp=String(e.sdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");o.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");o.tracks[N]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[N])}}return e.roomId!=null&&(o.roomId=String(e.roomId)),o},a.toObject=function(e,o){o||(o={});let N={};if((o.arrays||o.defaults)&&(N.tracks=[]),o.defaults&&(N.sdp="",N.roomId=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(N.sdp=e.sdp),e.tracks&&e.tracks.length){N.tracks=[];for(let q=0;q<e.tracks.length;++q)N.tracks[q]=$root.com.quick.voice.proto.Track.toObject(e.tracks[q],o)}return e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackReq"},a}(),D.CloseTrackRsp=function(){function a(k){if(this.tracks=[],k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.remoteSdp="",a.prototype.tracks=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,o){if(o||(o=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&o.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],o.uint32(18).fork()).ldelim();return o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.CloseTrackRsp;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.remoteSdp=e.string();break}case 2:{q.tracks&&q.tracks.length||(q.tracks=[]),q.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 o=0;o<e.tracks.length;++o){let N=$root.com.quick.voice.proto.Track.verify(e.tracks[o]);if(N)return"tracks."+N}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackRsp)return e;let o=new $root.com.quick.voice.proto.CloseTrackRsp;if(e.remoteSdp!=null&&(o.remoteSdp=String(e.remoteSdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");o.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");o.tracks[N]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[N])}}return o},a.toObject=function(e,o){o||(o={});let N={};if((o.arrays||o.defaults)&&(N.tracks=[]),o.defaults&&(N.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(N.remoteSdp=e.remoteSdp),e.tracks&&e.tracks.length){N.tracks=[];for(let q=0;q<e.tracks.length;++q)N.tracks[q]=$root.com.quick.voice.proto.Track.toObject(e.tracks[q],o)}return N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackRsp"},a}(),D.CloseTrackNotify=function(){function a(k){if(k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.user=null,a.create=function(e){return new a(e)},a.encode=function(e,o){return o||(o=$Writer.create()),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,o.uint32(10).fork()).ldelim(),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.CloseTrackNotify;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.user!=null&&e.hasOwnProperty("user")){let o=$root.com.quick.voice.proto.User.verify(e.user);if(o)return"user."+o}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackNotify)return e;let o=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");o.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return o},a.toObject=function(e,o){o||(o={});let N={};return o.defaults&&(N.user=null),e.user!=null&&e.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(e.user,o)),N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackNotify"},a}(),D.ToggleLiveRoomReq=function(){function a(k){if(k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.roomId="",a.create=function(e){return new a(e)},a.encode=function(e,o){return o||(o=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&o.uint32(10).string(e.roomId),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.ToggleLiveRoomReq;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.roomId=e.string();break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ToggleLiveRoomReq)return e;let o=new $root.com.quick.voice.proto.ToggleLiveRoomReq;return e.roomId!=null&&(o.roomId=String(e.roomId)),o},a.toObject=function(e,o){o||(o={});let N={};return o.defaults&&(N.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ToggleLiveRoomReq"},a}(),D.ToggleLiveRoomRsq=function(){function a(k){if(this.roomUsers=[],k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.roomId="",a.prototype.hash="",a.prototype.roomUsers=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,o){if(o||(o=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&o.uint32(10).string(e.roomId),e.hash!=null&&Object.hasOwnProperty.call(e,"hash")&&o.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],o.uint32(26).fork()).ldelim();return o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.roomId=e.string();break}case 2:{q.hash=e.string();break}case 3:{q.roomUsers&&q.roomUsers.length||(q.roomUsers=[]),q.roomUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 o=0;o<e.roomUsers.length;++o){let N=$root.com.quick.voice.proto.User.verify(e.roomUsers[o]);if(N)return"roomUsers."+N}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ToggleLiveRoomRsq)return e;let o=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;if(e.roomId!=null&&(o.roomId=String(e.roomId)),e.hash!=null&&(o.hash=String(e.hash)),e.roomUsers){if(!Array.isArray(e.roomUsers))throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: array expected");o.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");o.roomUsers[N]=$root.com.quick.voice.proto.User.fromObject(e.roomUsers[N])}}return o},a.toObject=function(e,o){o||(o={});let N={};if((o.arrays||o.defaults)&&(N.roomUsers=[]),o.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 q=0;q<e.roomUsers.length;++q)N.roomUsers[q]=$root.com.quick.voice.proto.User.toObject(e.roomUsers[q],o)}return N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ToggleLiveRoomRsq"},a}(),D.TrackType=function(){const a={},k=Object.create(a);return k[a[0]="Microphone"]=0,k[a[1]="Camera"]=1,k[a[2]="Screen"]=2,k[a[3]="SystemVoice"]=3,k}(),D.ReportInfoReq=function(){function a(k){if(k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.actionEvent="",a.prototype.userId="",a.prototype.platform="",a.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,a.prototype.actionData="",a.create=function(e){return new a(e)},a.encode=function(e,o){return o||(o=$Writer.create()),e.actionEvent!=null&&Object.hasOwnProperty.call(e,"actionEvent")&&o.uint32(10).string(e.actionEvent),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&o.uint32(18).string(e.userId),e.platform!=null&&Object.hasOwnProperty.call(e,"platform")&&o.uint32(26).string(e.platform),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&o.uint32(32).int64(e.time),e.actionData!=null&&Object.hasOwnProperty.call(e,"actionData")&&o.uint32(42).string(e.actionData),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.ReportInfoReq;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.actionEvent=e.string();break}case 2:{q.userId=e.string();break}case 3:{q.platform=e.string();break}case 4:{q.time=e.int64();break}case 5:{q.actionData=e.string();break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ReportInfoReq)return e;let o=new $root.com.quick.voice.proto.ReportInfoReq;return e.actionEvent!=null&&(o.actionEvent=String(e.actionEvent)),e.userId!=null&&(o.userId=String(e.userId)),e.platform!=null&&(o.platform=String(e.platform)),e.time!=null&&($util.Long?(o.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?o.time=parseInt(e.time,10):typeof e.time=="number"?o.time=e.time:typeof e.time=="object"&&(o.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.actionData!=null&&(o.actionData=String(e.actionData)),o},a.toObject=function(e,o){o||(o={});let N={};if(o.defaults){if(N.actionEvent="",N.userId="",N.platform="",$util.Long){let q=new $util.Long(0,0,!1);N.time=o.longs===String?q.toString():o.longs===Number?q.toNumber():q}else N.time=o.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=o.longs===String?String(e.time):e.time:N.time=o.longs===String?$util.Long.prototype.toString.call(e.time):o.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},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ReportInfoReq"},a}(),D.UpdatePermissions=function(){function a(k){if(k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.roomId="",a.prototype.user=null,a.create=function(e){return new a(e)},a.encode=function(e,o){return o||(o=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&o.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,o.uint32(18).fork()).ldelim(),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.UpdatePermissions;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.roomId=e.string();break}case 2:{q.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 o=$root.com.quick.voice.proto.User.verify(e.user);if(o)return"user."+o}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdatePermissions)return e;let o=new $root.com.quick.voice.proto.UpdatePermissions;if(e.roomId!=null&&(o.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");o.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return o},a.toObject=function(e,o){o||(o={});let N={};return o.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,o)),N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdatePermissions"},a}(),D.CallType=function(){const a={},k=Object.create(a);return k[a[0]="Normal"]=0,k[a[1]="Meeting"]=1,k[a[2]="Live"]=2,k}(),D.QuitNotifyCode=function(){const a={},k=Object.create(a);return k[a[0]="NormalQuit"]=0,k[a[2021]="Timeout"]=2021,k[a[2011]="TokenExpired"]=2011,k[a[2022]="KickOut"]=2022,k[a[2023]="EndPk"]=2023,k[a[2024]="EndLive"]=2024,k}(),D.UserBehavior=function(){function a(k){if(k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.type=0,a.prototype.behavior=!1,a.create=function(e){return new a(e)},a.encode=function(e,o){return o||(o=$Writer.create()),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&o.uint32(8).int32(e.type),e.behavior!=null&&Object.hasOwnProperty.call(e,"behavior")&&o.uint32(16).bool(e.behavior),o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.UserBehavior;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.type=e.int32();break}case 2:{q.behavior=e.bool();break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UserBehavior)return e;let o=new $root.com.quick.voice.proto.UserBehavior;switch(e.type){default:if(typeof e.type=="number"){o.type=e.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 e.behavior!=null&&(o.behavior=!!e.behavior),o},a.toObject=function(e,o){o||(o={});let N={};return o.defaults&&(N.type=o.enums===String?"Microphone":0,N.behavior=!1),e.type!=null&&e.hasOwnProperty("type")&&(N.type=o.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},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UserBehavior"},a}(),D.PreventUser=function(){function a(k){if(this.behaviors=[],k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.id="",a.prototype.behaviors=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,o){if(o||(o=$Writer.create()),e.id!=null&&Object.hasOwnProperty.call(e,"id")&&o.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],o.uint32(18).fork()).ldelim();return o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.PreventUser;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.id=e.string();break}case 2:{q.behaviors&&q.behaviors.length||(q.behaviors=[]),q.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(e,e.uint32()));break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 o=0;o<e.behaviors.length;++o){let N=$root.com.quick.voice.proto.UserBehavior.verify(e.behaviors[o]);if(N)return"behaviors."+N}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUser)return e;let o=new $root.com.quick.voice.proto.PreventUser;if(e.id!=null&&(o.id=String(e.id)),e.behaviors){if(!Array.isArray(e.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");o.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");o.behaviors[N]=$root.com.quick.voice.proto.UserBehavior.fromObject(e.behaviors[N])}}return o},a.toObject=function(e,o){o||(o={});let N={};if((o.arrays||o.defaults)&&(N.behaviors=[]),o.defaults&&(N.id=""),e.id!=null&&e.hasOwnProperty("id")&&(N.id=e.id),e.behaviors&&e.behaviors.length){N.behaviors=[];for(let q=0;q<e.behaviors.length;++q)N.behaviors[q]=$root.com.quick.voice.proto.UserBehavior.toObject(e.behaviors[q],o)}return N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUser"},a}(),D.PreventUsersBehaviorReq=function(){function a(k){if(this.users=[],k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.roomId="",a.prototype.users=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,o){if(o||(o=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&o.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],o.uint32(18).fork()).ldelim();return o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.roomId=e.string();break}case 2:{q.users&&q.users.length||(q.users=[]),q.users.push($root.com.quick.voice.proto.PreventUser.decode(e,e.uint32()));break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 o=0;o<e.users.length;++o){let N=$root.com.quick.voice.proto.PreventUser.verify(e.users[o]);if(N)return"users."+N}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return e;let o=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(e.roomId!=null&&(o.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");o.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");o.users[N]=$root.com.quick.voice.proto.PreventUser.fromObject(e.users[N])}}return o},a.toObject=function(e,o){o||(o={});let N={};if((o.arrays||o.defaults)&&(N.users=[]),o.defaults&&(N.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.users&&e.users.length){N.users=[];for(let q=0;q<e.users.length;++q)N.users[q]=$root.com.quick.voice.proto.PreventUser.toObject(e.users[q],o)}return N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUsersBehaviorReq"},a}(),D.PreventUsersBehaviorNotify=function(){function a(k){if(this.users=[],k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.roomId="",a.prototype.users=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,o){if(o||(o=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&o.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],o.uint32(18).fork()).ldelim();return o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.roomId=e.string();break}case 2:{q.users&&q.users.length||(q.users=[]),q.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 o=0;o<e.users.length;++o){let N=$root.com.quick.voice.proto.User.verify(e.users[o]);if(N)return"users."+N}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return e;let o=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(e.roomId!=null&&(o.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");o.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");o.users[N]=$root.com.quick.voice.proto.User.fromObject(e.users[N])}}return o},a.toObject=function(e,o){o||(o={});let N={};if((o.arrays||o.defaults)&&(N.users=[]),o.defaults&&(N.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(N.roomId=e.roomId),e.users&&e.users.length){N.users=[];for(let q=0;q<e.users.length;++q)N.users[q]=$root.com.quick.voice.proto.User.toObject(e.users[q],o)}return N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},a}(),D.AccelerationAreas=function(){const a={},k=Object.create(a);return k[a[0]="chinaMainland"]=0,k[a[1]="global"]=1,k[a[2]="overseas"]=2,k}(),D.CountMethods=function(){const a={},k=Object.create(a);return k[a[0]="flow"]=0,k[a[1]="minutes"]=1,k}(),D.BaseCDNAddress=function(){function a(k){if(this.urlMap={},k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.area=0,a.prototype.countType=0,a.prototype.urlMap=$util.emptyObject,a.create=function(e){return new a(e)},a.encode=function(e,o){if(o||(o=$Writer.create()),e.area!=null&&Object.hasOwnProperty.call(e,"area")&&o.uint32(8).int32(e.area),e.countType!=null&&Object.hasOwnProperty.call(e,"countType")&&o.uint32(16).int32(e.countType),e.urlMap!=null&&Object.hasOwnProperty.call(e,"urlMap"))for(let N=Object.keys(e.urlMap),q=0;q<N.length;++q)o.uint32(26).fork().uint32(10).string(N[q]).uint32(18).string(e.urlMap[N[q]]).ldelim();return o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.BaseCDNAddress,F,J;for(;e.pos<N;){let z=e.uint32();switch(z>>>3){case 1:{q.area=e.int32();break}case 2:{q.countType=e.int32();break}case 3:{q.urlMap===$util.emptyObject&&(q.urlMap={});let G=e.uint32()+e.pos;for(F="",J="";e.pos<G;){let K=e.uint32();switch(K>>>3){case 1:F=e.string();break;case 2:J=e.string();break;default:e.skipType(K&7);break}}q.urlMap[F]=J;break}default:e.skipType(z&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 o=Object.keys(e.urlMap);for(let N=0;N<o.length;++N)if(!$util.isString(e.urlMap[o[N]]))return"urlMap: string{k:string} expected"}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.BaseCDNAddress)return e;let o=new $root.com.quick.voice.proto.BaseCDNAddress;switch(e.area){default:if(typeof e.area=="number"){o.area=e.area;break}break;case"chinaMainland":case 0:o.area=0;break;case"global":case 1:o.area=1;break;case"overseas":case 2:o.area=2;break}switch(e.countType){default:if(typeof e.countType=="number"){o.countType=e.countType;break}break;case"flow":case 0:o.countType=0;break;case"minutes":case 1:o.countType=1;break}if(e.urlMap){if(typeof e.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");o.urlMap={};for(let N=Object.keys(e.urlMap),q=0;q<N.length;++q)o.urlMap[N[q]]=String(e.urlMap[N[q]])}return o},a.toObject=function(e,o){o||(o={});let N={};(o.objects||o.defaults)&&(N.urlMap={}),o.defaults&&(N.area=o.enums===String?"chinaMainland":0,N.countType=o.enums===String?"flow":0),e.area!=null&&e.hasOwnProperty("area")&&(N.area=o.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=o.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 q;if(e.urlMap&&(q=Object.keys(e.urlMap)).length){N.urlMap={};for(let F=0;F<q.length;++F)N.urlMap[q[F]]=e.urlMap[q[F]]}return N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.BaseCDNAddress"},a}(),D.CDNPlayAddressNotify=function(){function a(e){if(this.standLines=[],e)for(let o=Object.keys(e),N=0;N<o.length;++N)e[o[N]]!=null&&(this[o[N]]=e[o[N]])}a.prototype.roomId="",a.prototype.m3u8=null,a.prototype.rtmp=null,a.prototype.flv=null,a.prototype.rtmps=null,a.prototype.mainLine=null,a.prototype.standLines=$util.emptyArray;let k;return Object.defineProperty(a.prototype,"_m3u8",{get:$util.oneOfGetter(k=["m3u8"]),set:$util.oneOfSetter(k)}),Object.defineProperty(a.prototype,"_rtmp",{get:$util.oneOfGetter(k=["rtmp"]),set:$util.oneOfSetter(k)}),Object.defineProperty(a.prototype,"_flv",{get:$util.oneOfGetter(k=["flv"]),set:$util.oneOfSetter(k)}),Object.defineProperty(a.prototype,"_rtmps",{get:$util.oneOfGetter(k=["rtmps"]),set:$util.oneOfSetter(k)}),Object.defineProperty(a.prototype,"_mainLine",{get:$util.oneOfGetter(k=["mainLine"]),set:$util.oneOfSetter(k)}),a.create=function(o){return new a(o)},a.encode=function(o,N){if(N||(N=$Writer.create()),o.roomId!=null&&Object.hasOwnProperty.call(o,"roomId")&&N.uint32(10).string(o.roomId),o.m3u8!=null&&Object.hasOwnProperty.call(o,"m3u8")&&N.uint32(18).string(o.m3u8),o.rtmp!=null&&Object.hasOwnProperty.call(o,"rtmp")&&N.uint32(26).string(o.rtmp),o.flv!=null&&Object.hasOwnProperty.call(o,"flv")&&N.uint32(34).string(o.flv),o.rtmps!=null&&Object.hasOwnProperty.call(o,"rtmps")&&N.uint32(42).string(o.rtmps),o.mainLine!=null&&Object.hasOwnProperty.call(o,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(o.mainLine,N.uint32(50).fork()).ldelim(),o.standLines!=null&&o.standLines.length)for(let q=0;q<o.standLines.length;++q)$root.com.quick.voice.proto.BaseCDNAddress.encode(o.standLines[q],N.uint32(58).fork()).ldelim();return N},a.encodeDelimited=function(o,N){return this.encode(o,N).ldelim()},a.decode=function(o,N){o instanceof $Reader||(o=$Reader.create(o));let q=N===void 0?o.len:o.pos+N,F=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;o.pos<q;){let J=o.uint32();switch(J>>>3){case 1:{F.roomId=o.string();break}case 2:{F.m3u8=o.string();break}case 3:{F.rtmp=o.string();break}case 4:{F.flv=o.string();break}case 5:{F.rtmps=o.string();break}case 6:{F.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(o,o.uint32());break}case 7:{F.standLines&&F.standLines.length||(F.standLines=[]),F.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(o,o.uint32()));break}default:o.skipType(J&7);break}}return F},a.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},a.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.roomId!=null&&o.hasOwnProperty("roomId")&&!$util.isString(o.roomId))return"roomId: string expected";if(o.m3u8!=null&&o.hasOwnProperty("m3u8")&&!$util.isString(o.m3u8))return"m3u8: string expected";if(o.rtmp!=null&&o.hasOwnProperty("rtmp")&&!$util.isString(o.rtmp))return"rtmp: string expected";if(o.flv!=null&&o.hasOwnProperty("flv")&&!$util.isString(o.flv))return"flv: string expected";if(o.rtmps!=null&&o.hasOwnProperty("rtmps")&&!$util.isString(o.rtmps))return"rtmps: string expected";if(o.mainLine!=null&&o.hasOwnProperty("mainLine")){let N=$root.com.quick.voice.proto.BaseCDNAddress.verify(o.mainLine);if(N)return"mainLine."+N}if(o.standLines!=null&&o.hasOwnProperty("standLines")){if(!Array.isArray(o.standLines))return"standLines: array expected";for(let N=0;N<o.standLines.length;++N){let q=$root.com.quick.voice.proto.BaseCDNAddress.verify(o.standLines[N]);if(q)return"standLines."+q}}return null},a.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return o;let N=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(o.roomId!=null&&(N.roomId=String(o.roomId)),o.m3u8!=null&&(N.m3u8=String(o.m3u8)),o.rtmp!=null&&(N.rtmp=String(o.rtmp)),o.flv!=null&&(N.flv=String(o.flv)),o.rtmps!=null&&(N.rtmps=String(o.rtmps)),o.mainLine!=null){if(typeof o.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");N.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(o.mainLine)}if(o.standLines){if(!Array.isArray(o.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");N.standLines=[];for(let q=0;q<o.standLines.length;++q){if(typeof o.standLines[q]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");N.standLines[q]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(o.standLines[q])}}return N},a.toObject=function(o,N){N||(N={});let q={};if((N.arrays||N.defaults)&&(q.standLines=[]),N.defaults&&(q.roomId=""),o.roomId!=null&&o.hasOwnProperty("roomId")&&(q.roomId=o.roomId),o.m3u8!=null&&o.hasOwnProperty("m3u8")&&(q.m3u8=o.m3u8,N.oneofs&&(q._m3u8="m3u8")),o.rtmp!=null&&o.hasOwnProperty("rtmp")&&(q.rtmp=o.rtmp,N.oneofs&&(q._rtmp="rtmp")),o.flv!=null&&o.hasOwnProperty("flv")&&(q.flv=o.flv,N.oneofs&&(q._flv="flv")),o.rtmps!=null&&o.hasOwnProperty("rtmps")&&(q.rtmps=o.rtmps,N.oneofs&&(q._rtmps="rtmps")),o.mainLine!=null&&o.hasOwnProperty("mainLine")&&(q.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(o.mainLine,N),N.oneofs&&(q._mainLine="mainLine")),o.standLines&&o.standLines.length){q.standLines=[];for(let F=0;F<o.standLines.length;++F)q.standLines[F]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(o.standLines[F],N)}return q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.CDNPlayAddressNotify"},a}(),D.UserChannel=function(){function a(k){if(this.channels=[],k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.userId="",a.prototype.channels=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,o){if(o||(o=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&o.uint32(10).string(e.userId),e.channels!=null&&e.channels.length)for(let N=0;N<e.channels.length;++N)$root.com.quick.voice.proto.DataChannel.encode(e.channels[N],o.uint32(18).fork()).ldelim();return o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.UserChannel;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.userId=e.string();break}case 2:{q.channels&&q.channels.length||(q.channels=[]),q.channels.push($root.com.quick.voice.proto.DataChannel.decode(e,e.uint32()));break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId))return"userId: string expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let o=0;o<e.channels.length;++o){let N=$root.com.quick.voice.proto.DataChannel.verify(e.channels[o]);if(N)return"channels."+N}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UserChannel)return e;let o=new $root.com.quick.voice.proto.UserChannel;if(e.userId!=null&&(o.userId=String(e.userId)),e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.UserChannel.channels: array expected");o.channels=[];for(let N=0;N<e.channels.length;++N){if(typeof e.channels[N]!="object")throw TypeError(".com.quick.voice.proto.UserChannel.channels: object expected");o.channels[N]=$root.com.quick.voice.proto.DataChannel.fromObject(e.channels[N])}}return o},a.toObject=function(e,o){o||(o={});let N={};if((o.arrays||o.defaults)&&(N.channels=[]),o.defaults&&(N.userId=""),e.userId!=null&&e.hasOwnProperty("userId")&&(N.userId=e.userId),e.channels&&e.channels.length){N.channels=[];for(let q=0;q<e.channels.length;++q)N.channels[q]=$root.com.quick.voice.proto.DataChannel.toObject(e.channels[q],o)}return N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UserChannel"},a}(),D.ChannelPublishReq=function(){function a(k){if(this.channels=[],k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.channels=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,o){if(o||(o=$Writer.create()),e.channels!=null&&e.channels.length)for(let N=0;N<e.channels.length;++N)$root.com.quick.voice.proto.DataChannel.encode(e.channels[N],o.uint32(10).fork()).ldelim();return o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.ChannelPublishReq;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.channels&&q.channels.length||(q.channels=[]),q.channels.push($root.com.quick.voice.proto.DataChannel.decode(e,e.uint32()));break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let o=0;o<e.channels.length;++o){let N=$root.com.quick.voice.proto.DataChannel.verify(e.channels[o]);if(N)return"channels."+N}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ChannelPublishReq)return e;let o=new $root.com.quick.voice.proto.ChannelPublishReq;if(e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: array expected");o.channels=[];for(let N=0;N<e.channels.length;++N){if(typeof e.channels[N]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: object expected");o.channels[N]=$root.com.quick.voice.proto.DataChannel.fromObject(e.channels[N])}}return o},a.toObject=function(e,o){o||(o={});let N={};if((o.arrays||o.defaults)&&(N.channels=[]),e.channels&&e.channels.length){N.channels=[];for(let q=0;q<e.channels.length;++q)N.channels[q]=$root.com.quick.voice.proto.DataChannel.toObject(e.channels[q],o)}return N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ChannelPublishReq"},a}(),D.ChannelPublishRsq=function(){function a(k){if(this.channels=[],k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.channels=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,o){if(o||(o=$Writer.create()),e.channels!=null&&e.channels.length)for(let N=0;N<e.channels.length;++N)$root.com.quick.voice.proto.UserChannel.encode(e.channels[N],o.uint32(10).fork()).ldelim();return o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.ChannelPublishRsq;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.channels&&q.channels.length||(q.channels=[]),q.channels.push($root.com.quick.voice.proto.UserChannel.decode(e,e.uint32()));break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let o=0;o<e.channels.length;++o){let N=$root.com.quick.voice.proto.UserChannel.verify(e.channels[o]);if(N)return"channels."+N}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ChannelPublishRsq)return e;let o=new $root.com.quick.voice.proto.ChannelPublishRsq;if(e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: array expected");o.channels=[];for(let N=0;N<e.channels.length;++N){if(typeof e.channels[N]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: object expected");o.channels[N]=$root.com.quick.voice.proto.UserChannel.fromObject(e.channels[N])}}return o},a.toObject=function(e,o){o||(o={});let N={};if((o.arrays||o.defaults)&&(N.channels=[]),e.channels&&e.channels.length){N.channels=[];for(let q=0;q<e.channels.length;++q)N.channels[q]=$root.com.quick.voice.proto.UserChannel.toObject(e.channels[q],o)}return N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ChannelPublishRsq"},a}(),D.ChannelSubscribeReq=function(){function a(k){if(this.users=[],k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.users=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,o){if(o||(o=$Writer.create()),e.users!=null&&e.users.length)for(let N=0;N<e.users.length;++N)$root.com.quick.voice.proto.UserChannel.encode(e.users[N],o.uint32(10).fork()).ldelim();return o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.ChannelSubscribeReq;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.users&&q.users.length||(q.users=[]),q.users.push($root.com.quick.voice.proto.UserChannel.decode(e,e.uint32()));break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 o=0;o<e.users.length;++o){let N=$root.com.quick.voice.proto.UserChannel.verify(e.users[o]);if(N)return"users."+N}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ChannelSubscribeReq)return e;let o=new $root.com.quick.voice.proto.ChannelSubscribeReq;if(e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: array expected");o.users=[];for(let N=0;N<e.users.length;++N){if(typeof e.users[N]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: object expected");o.users[N]=$root.com.quick.voice.proto.UserChannel.fromObject(e.users[N])}}return o},a.toObject=function(e,o){o||(o={});let N={};if((o.arrays||o.defaults)&&(N.users=[]),e.users&&e.users.length){N.users=[];for(let q=0;q<e.users.length;++q)N.users[q]=$root.com.quick.voice.proto.UserChannel.toObject(e.users[q],o)}return N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ChannelSubscribeReq"},a}(),D.ChannelSubscribeRsq=function(){function a(k){if(this.channels=[],k)for(let e=Object.keys(k),o=0;o<e.length;++o)k[e[o]]!=null&&(this[e[o]]=k[e[o]])}return a.prototype.channels=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,o){if(o||(o=$Writer.create()),e.channels!=null&&e.channels.length)for(let N=0;N<e.channels.length;++N)$root.com.quick.voice.proto.UserChannel.encode(e.channels[N],o.uint32(10).fork()).ldelim();return o},a.encodeDelimited=function(e,o){return this.encode(e,o).ldelim()},a.decode=function(e,o){e instanceof $Reader||(e=$Reader.create(e));let N=o===void 0?e.len:e.pos+o,q=new $root.com.quick.voice.proto.ChannelSubscribeRsq;for(;e.pos<N;){let F=e.uint32();switch(F>>>3){case 1:{q.channels&&q.channels.length||(q.channels=[]),q.channels.push($root.com.quick.voice.proto.UserChannel.decode(e,e.uint32()));break}default:e.skipType(F&7);break}}return q},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let o=0;o<e.channels.length;++o){let N=$root.com.quick.voice.proto.UserChannel.verify(e.channels[o]);if(N)return"channels."+N}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ChannelSubscribeRsq)return e;let o=new $root.com.quick.voice.proto.ChannelSubscribeRsq;if(e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: array expected");o.channels=[];for(let N=0;N<e.channels.length;++N){if(typeof e.channels[N]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: object expected");o.channels[N]=$root.com.quick.voice.proto.UserChannel.fromObject(e.channels[N])}}return o},a.toObject=function(e,o){o||(o={});let N={};if((o.arrays||o.defaults)&&(N.channels=[]),e.channels&&e.channels.length){N.channels=[];for(let q=0;q<e.channels.length;++q)N.channels[q]=$root.com.quick.voice.proto.UserChannel.toObject(e.channels[q],o)}return N},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ChannelSubscribeRsq"},a}(),D}(),O}(),Z}(),I})(),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销毁"};ht(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(I){let Z=I.length;for(;--Z>=0;)I[Z]=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(I,Z,O,D,a){this.static_tree=I,this.extra_bits=Z,this.extra_base=O,this.elems=D,this.max_length=a,this.has_stree=I&&I.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(I,Z){this.dyn_tree=I,this.max_code=0,this.stat_desc=Z}const d_code=I=>I<256?_dist_code[I]:_dist_code[256+(I>>>7)],put_short=(I,Z)=>{I.pending_buf[I.pending++]=Z&255,I.pending_buf[I.pending++]=Z>>>8&255},send_bits=(I,Z,O)=>{I.bi_valid>Buf_size-O?(I.bi_buf|=Z<<I.bi_valid&65535,put_short(I,I.bi_buf),I.bi_buf=Z>>Buf_size-I.bi_valid,I.bi_valid+=O-Buf_size):(I.bi_buf|=Z<<I.bi_valid&65535,I.bi_valid+=O)},send_code=(I,Z,O)=>{send_bits(I,O[Z*2],O[Z*2+1])},bi_reverse=(I,Z)=>{let O=0;do O|=I&1,I>>>=1,O<<=1;while(--Z>0);return O>>>1},bi_flush=I=>{I.bi_valid===16?(put_short(I,I.bi_buf),I.bi_buf=0,I.bi_valid=0):I.bi_valid>=8&&(I.pending_buf[I.pending++]=I.bi_buf&255,I.bi_buf>>=8,I.bi_valid-=8)},gen_bitlen=(I,Z)=>{const O=Z.dyn_tree,D=Z.max_code,a=Z.stat_desc.static_tree,k=Z.stat_desc.has_stree,e=Z.stat_desc.extra_bits,o=Z.stat_desc.extra_base,N=Z.stat_desc.max_length;let q,F,J,z,G,K,it=0;for(z=0;z<=MAX_BITS$1;z++)I.bl_count[z]=0;for(O[I.heap[I.heap_max]*2+1]=0,q=I.heap_max+1;q<HEAP_SIZE$1;q++)F=I.heap[q],z=O[O[F*2+1]*2+1]+1,z>N&&(z=N,it++),O[F*2+1]=z,!(F>D)&&(I.bl_count[z]++,G=0,F>=o&&(G=e[F-o]),K=O[F*2],I.opt_len+=K*(z+G),k&&(I.static_len+=K*(a[F*2+1]+G)));if(it!==0){do{for(z=N-1;I.bl_count[z]===0;)z--;I.bl_count[z]--,I.bl_count[z+1]+=2,I.bl_count[N]--,it-=2}while(it>0);for(z=N;z!==0;z--)for(F=I.bl_count[z];F!==0;)J=I.heap[--q],!(J>D)&&(O[J*2+1]!==z&&(I.opt_len+=(z-O[J*2+1])*O[J*2],O[J*2+1]=z),F--)}},gen_codes=(I,Z,O)=>{const D=new Array(MAX_BITS$1+1);let a=0,k,e;for(k=1;k<=MAX_BITS$1;k++)a=a+O[k-1]<<1,D[k]=a;for(e=0;e<=Z;e++){let o=I[e*2+1];o!==0&&(I[e*2]=bi_reverse(D[o]++,o))}},tr_static_init=()=>{let I,Z,O,D,a;const k=new Array(MAX_BITS$1+1);for(O=0,D=0;D<LENGTH_CODES$1-1;D++)for(base_length[D]=O,I=0;I<1<<extra_lbits[D];I++)_length_code[O++]=D;for(_length_code[O-1]=D,a=0,D=0;D<16;D++)for(base_dist[D]=a,I=0;I<1<<extra_dbits[D];I++)_dist_code[a++]=D;for(a>>=7;D<D_CODES$1;D++)for(base_dist[D]=a<<7,I=0;I<1<<extra_dbits[D]-7;I++)_dist_code[256+a++]=D;for(Z=0;Z<=MAX_BITS$1;Z++)k[Z]=0;for(I=0;I<=143;)static_ltree[I*2+1]=8,I++,k[8]++;for(;I<=255;)static_ltree[I*2+1]=9,I++,k[9]++;for(;I<=279;)static_ltree[I*2+1]=7,I++,k[7]++;for(;I<=287;)static_ltree[I*2+1]=8,I++,k[8]++;for(gen_codes(static_ltree,L_CODES$1+1,k),I=0;I<D_CODES$1;I++)static_dtree[I*2+1]=5,static_dtree[I*2]=bi_reverse(I,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=I=>{let Z;for(Z=0;Z<L_CODES$1;Z++)I.dyn_ltree[Z*2]=0;for(Z=0;Z<D_CODES$1;Z++)I.dyn_dtree[Z*2]=0;for(Z=0;Z<BL_CODES$1;Z++)I.bl_tree[Z*2]=0;I.dyn_ltree[END_BLOCK*2]=1,I.opt_len=I.static_len=0,I.sym_next=I.matches=0},bi_windup=I=>{I.bi_valid>8?put_short(I,I.bi_buf):I.bi_valid>0&&(I.pending_buf[I.pending++]=I.bi_buf),I.bi_buf=0,I.bi_valid=0},smaller=(I,Z,O,D)=>{const a=Z*2,k=O*2;return I[a]<I[k]||I[a]===I[k]&&D[Z]<=D[O]},pqdownheap=(I,Z,O)=>{const D=I.heap[O];let a=O<<1;for(;a<=I.heap_len&&(a<I.heap_len&&smaller(Z,I.heap[a+1],I.heap[a],I.depth)&&a++,!smaller(Z,D,I.heap[a],I.depth));)I.heap[O]=I.heap[a],O=a,a<<=1;I.heap[O]=D},compress_block=(I,Z,O)=>{let D,a,k=0,e,o;if(I.sym_next!==0)do D=I.pending_buf[I.sym_buf+k++]&255,D+=(I.pending_buf[I.sym_buf+k++]&255)<<8,a=I.pending_buf[I.sym_buf+k++],D===0?send_code(I,a,Z):(e=_length_code[a],send_code(I,e+LITERALS$1+1,Z),o=extra_lbits[e],o!==0&&(a-=base_length[e],send_bits(I,a,o)),D--,e=d_code(D),send_code(I,e,O),o=extra_dbits[e],o!==0&&(D-=base_dist[e],send_bits(I,D,o)));while(k<I.sym_next);send_code(I,END_BLOCK,Z)},build_tree=(I,Z)=>{const O=Z.dyn_tree,D=Z.stat_desc.static_tree,a=Z.stat_desc.has_stree,k=Z.stat_desc.elems;let e,o,N=-1,q;for(I.heap_len=0,I.heap_max=HEAP_SIZE$1,e=0;e<k;e++)O[e*2]!==0?(I.heap[++I.heap_len]=N=e,I.depth[e]=0):O[e*2+1]=0;for(;I.heap_len<2;)q=I.heap[++I.heap_len]=N<2?++N:0,O[q*2]=1,I.depth[q]=0,I.opt_len--,a&&(I.static_len-=D[q*2+1]);for(Z.max_code=N,e=I.heap_len>>1;e>=1;e--)pqdownheap(I,O,e);q=k;do e=I.heap[1],I.heap[1]=I.heap[I.heap_len--],pqdownheap(I,O,1),o=I.heap[1],I.heap[--I.heap_max]=e,I.heap[--I.heap_max]=o,O[q*2]=O[e*2]+O[o*2],I.depth[q]=(I.depth[e]>=I.depth[o]?I.depth[e]:I.depth[o])+1,O[e*2+1]=O[o*2+1]=q,I.heap[1]=q++,pqdownheap(I,O,1);while(I.heap_len>=2);I.heap[--I.heap_max]=I.heap[1],gen_bitlen(I,Z),gen_codes(O,N,I.bl_count)},scan_tree=(I,Z,O)=>{let D,a=-1,k,e=Z[0*2+1],o=0,N=7,q=4;for(e===0&&(N=138,q=3),Z[(O+1)*2+1]=65535,D=0;D<=O;D++)k=e,e=Z[(D+1)*2+1],!(++o<N&&k===e)&&(o<q?I.bl_tree[k*2]+=o:k!==0?(k!==a&&I.bl_tree[k*2]++,I.bl_tree[REP_3_6*2]++):o<=10?I.bl_tree[REPZ_3_10*2]++:I.bl_tree[REPZ_11_138*2]++,o=0,a=k,e===0?(N=138,q=3):k===e?(N=6,q=3):(N=7,q=4))},send_tree=(I,Z,O)=>{let D,a=-1,k,e=Z[0*2+1],o=0,N=7,q=4;for(e===0&&(N=138,q=3),D=0;D<=O;D++)if(k=e,e=Z[(D+1)*2+1],!(++o<N&&k===e)){if(o<q)do send_code(I,k,I.bl_tree);while(--o!==0);else k!==0?(k!==a&&(send_code(I,k,I.bl_tree),o--),send_code(I,REP_3_6,I.bl_tree),send_bits(I,o-3,2)):o<=10?(send_code(I,REPZ_3_10,I.bl_tree),send_bits(I,o-3,3)):(send_code(I,REPZ_11_138,I.bl_tree),send_bits(I,o-11,7));o=0,a=k,e===0?(N=138,q=3):k===e?(N=6,q=3):(N=7,q=4)}},build_bl_tree=I=>{let Z;for(scan_tree(I,I.dyn_ltree,I.l_desc.max_code),scan_tree(I,I.dyn_dtree,I.d_desc.max_code),build_tree(I,I.bl_desc),Z=BL_CODES$1-1;Z>=3&&I.bl_tree[bl_order[Z]*2+1]===0;Z--);return I.opt_len+=3*(Z+1)+5+5+4,Z},send_all_trees=(I,Z,O,D)=>{let a;for(send_bits(I,Z-257,5),send_bits(I,O-1,5),send_bits(I,D-4,4),a=0;a<D;a++)send_bits(I,I.bl_tree[bl_order[a]*2+1],3);send_tree(I,I.dyn_ltree,Z-1),send_tree(I,I.dyn_dtree,O-1)},detect_data_type=I=>{let Z=4093624447,O;for(O=0;O<=31;O++,Z>>>=1)if(Z&1&&I.dyn_ltree[O*2]!==0)return Z_BINARY;if(I.dyn_ltree[9*2]!==0||I.dyn_ltree[10*2]!==0||I.dyn_ltree[13*2]!==0)return Z_TEXT;for(O=32;O<LITERALS$1;O++)if(I.dyn_ltree[O*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=I=>{static_init_done||(tr_static_init(),static_init_done=!0),I.l_desc=new TreeDesc(I.dyn_ltree,static_l_desc),I.d_desc=new TreeDesc(I.dyn_dtree,static_d_desc),I.bl_desc=new TreeDesc(I.bl_tree,static_bl_desc),I.bi_buf=0,I.bi_valid=0,init_block(I)},_tr_stored_block$1=(I,Z,O,D)=>{send_bits(I,(STORED_BLOCK<<1)+(D?1:0),3),bi_windup(I),put_short(I,O),put_short(I,~O),O&&I.pending_buf.set(I.window.subarray(Z,Z+O),I.pending),I.pending+=O},_tr_align$1=I=>{send_bits(I,STATIC_TREES<<1,3),send_code(I,END_BLOCK,static_ltree),bi_flush(I)},_tr_flush_block$1=(I,Z,O,D)=>{let a,k,e=0;I.level>0?(I.strm.data_type===Z_UNKNOWN$1&&(I.strm.data_type=detect_data_type(I)),build_tree(I,I.l_desc),build_tree(I,I.d_desc),e=build_bl_tree(I),a=I.opt_len+3+7>>>3,k=I.static_len+3+7>>>3,k<=a&&(a=k)):a=k=O+5,O+4<=a&&Z!==-1?_tr_stored_block$1(I,Z,O,D):I.strategy===Z_FIXED$1||k===a?(send_bits(I,(STATIC_TREES<<1)+(D?1:0),3),compress_block(I,static_ltree,static_dtree)):(send_bits(I,(DYN_TREES<<1)+(D?1:0),3),send_all_trees(I,I.l_desc.max_code+1,I.d_desc.max_code+1,e+1),compress_block(I,I.dyn_ltree,I.dyn_dtree)),init_block(I),D&&bi_windup(I)},_tr_tally$1=(I,Z,O)=>(I.pending_buf[I.sym_buf+I.sym_next++]=Z,I.pending_buf[I.sym_buf+I.sym_next++]=Z>>8,I.pending_buf[I.sym_buf+I.sym_next++]=O,Z===0?I.dyn_ltree[O*2]++:(I.matches++,Z--,I.dyn_ltree[(_length_code[O]+LITERALS$1+1)*2]++,I.dyn_dtree[d_code(Z)*2]++),I.sym_next===I.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=(I,Z,O,D)=>{let a=I&65535|0,k=I>>>16&65535|0,e=0;for(;O!==0;){e=O>2e3?2e3:O,O-=e;do a=a+Z[D++]|0,k=k+a|0;while(--e);a%=65521,k%=65521}return a|k<<16|0};var adler32_1=adler32;const makeTable=()=>{let I,Z=[];for(var O=0;O<256;O++){I=O;for(var D=0;D<8;D++)I=I&1?3988292384^I>>>1:I>>>1;Z[O]=I}return Z},crcTable=new Uint32Array(makeTable()),crc32=(I,Z,O,D)=>{const a=crcTable,k=D+O;I^=-1;for(let e=D;e<k;e++)I=I>>>8^a[(I^Z[e])&255];return I^-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=(I,Z)=>(I.msg=messages[Z],Z),rank=I=>I*2-(I>4?9:0),zero=I=>{let Z=I.length;for(;--Z>=0;)I[Z]=0},slide_hash=I=>{let Z,O,D,a=I.w_size;Z=I.hash_size,D=Z;do O=I.head[--D],I.head[D]=O>=a?O-a:0;while(--Z);Z=a,D=Z;do O=I.prev[--D],I.prev[D]=O>=a?O-a:0;while(--Z)};let HASH_ZLIB=(I,Z,O)=>(Z<<I.hash_shift^O)&I.hash_mask,HASH=HASH_ZLIB;const flush_pending=I=>{const Z=I.state;let O=Z.pending;O>I.avail_out&&(O=I.avail_out),O!==0&&(I.output.set(Z.pending_buf.subarray(Z.pending_out,Z.pending_out+O),I.next_out),I.next_out+=O,Z.pending_out+=O,I.total_out+=O,I.avail_out-=O,Z.pending-=O,Z.pending===0&&(Z.pending_out=0))},flush_block_only=(I,Z)=>{_tr_flush_block(I,I.block_start>=0?I.block_start:-1,I.strstart-I.block_start,Z),I.block_start=I.strstart,flush_pending(I.strm)},put_byte=(I,Z)=>{I.pending_buf[I.pending++]=Z},putShortMSB=(I,Z)=>{I.pending_buf[I.pending++]=Z>>>8&255,I.pending_buf[I.pending++]=Z&255},read_buf=(I,Z,O,D)=>{let a=I.avail_in;return a>D&&(a=D),a===0?0:(I.avail_in-=a,Z.set(I.input.subarray(I.next_in,I.next_in+a),O),I.state.wrap===1?I.adler=adler32_1(I.adler,Z,a,O):I.state.wrap===2&&(I.adler=crc32_1(I.adler,Z,a,O)),I.next_in+=a,I.total_in+=a,a)},longest_match=(I,Z)=>{let O=I.max_chain_length,D=I.strstart,a,k,e=I.prev_length,o=I.nice_match;const N=I.strstart>I.w_size-MIN_LOOKAHEAD?I.strstart-(I.w_size-MIN_LOOKAHEAD):0,q=I.window,F=I.w_mask,J=I.prev,z=I.strstart+MAX_MATCH;let G=q[D+e-1],K=q[D+e];I.prev_length>=I.good_match&&(O>>=2),o>I.lookahead&&(o=I.lookahead);do if(a=Z,!(q[a+e]!==K||q[a+e-1]!==G||q[a]!==q[D]||q[++a]!==q[D+1])){D+=2,a++;do;while(q[++D]===q[++a]&&q[++D]===q[++a]&&q[++D]===q[++a]&&q[++D]===q[++a]&&q[++D]===q[++a]&&q[++D]===q[++a]&&q[++D]===q[++a]&&q[++D]===q[++a]&&D<z);if(k=MAX_MATCH-(z-D),D=z-MAX_MATCH,k>e){if(I.match_start=Z,e=k,k>=o)break;G=q[D+e-1],K=q[D+e]}}while((Z=J[Z&F])>N&&--O!==0);return e<=I.lookahead?e:I.lookahead},fill_window=I=>{const Z=I.w_size;let O,D,a;do{if(D=I.window_size-I.lookahead-I.strstart,I.strstart>=Z+(Z-MIN_LOOKAHEAD)&&(I.window.set(I.window.subarray(Z,Z+Z-D),0),I.match_start-=Z,I.strstart-=Z,I.block_start-=Z,I.insert>I.strstart&&(I.insert=I.strstart),slide_hash(I),D+=Z),I.strm.avail_in===0)break;if(O=read_buf(I.strm,I.window,I.strstart+I.lookahead,D),I.lookahead+=O,I.lookahead+I.insert>=MIN_MATCH)for(a=I.strstart-I.insert,I.ins_h=I.window[a],I.ins_h=HASH(I,I.ins_h,I.window[a+1]);I.insert&&(I.ins_h=HASH(I,I.ins_h,I.window[a+MIN_MATCH-1]),I.prev[a&I.w_mask]=I.head[I.ins_h],I.head[I.ins_h]=a,a++,I.insert--,!(I.lookahead+I.insert<MIN_MATCH)););}while(I.lookahead<MIN_LOOKAHEAD&&I.strm.avail_in!==0)},deflate_stored=(I,Z)=>{let O=I.pending_buf_size-5>I.w_size?I.w_size:I.pending_buf_size-5,D,a,k,e=0,o=I.strm.avail_in;do{if(D=65535,k=I.bi_valid+42>>3,I.strm.avail_out<k||(k=I.strm.avail_out-k,a=I.strstart-I.block_start,D>a+I.strm.avail_in&&(D=a+I.strm.avail_in),D>k&&(D=k),D<O&&(D===0&&Z!==Z_FINISH$3||Z===Z_NO_FLUSH$2||D!==a+I.strm.avail_in)))break;e=Z===Z_FINISH$3&&D===a+I.strm.avail_in?1:0,_tr_stored_block(I,0,0,e),I.pending_buf[I.pending-4]=D,I.pending_buf[I.pending-3]=D>>8,I.pending_buf[I.pending-2]=~D,I.pending_buf[I.pending-1]=~D>>8,flush_pending(I.strm),a&&(a>D&&(a=D),I.strm.output.set(I.window.subarray(I.block_start,I.block_start+a),I.strm.next_out),I.strm.next_out+=a,I.strm.avail_out-=a,I.strm.total_out+=a,I.block_start+=a,D-=a),D&&(read_buf(I.strm,I.strm.output,I.strm.next_out,D),I.strm.next_out+=D,I.strm.avail_out-=D,I.strm.total_out+=D)}while(e===0);return o-=I.strm.avail_in,o&&(o>=I.w_size?(I.matches=2,I.window.set(I.strm.input.subarray(I.strm.next_in-I.w_size,I.strm.next_in),0),I.strstart=I.w_size,I.insert=I.strstart):(I.window_size-I.strstart<=o&&(I.strstart-=I.w_size,I.window.set(I.window.subarray(I.w_size,I.w_size+I.strstart),0),I.matches<2&&I.matches++,I.insert>I.strstart&&(I.insert=I.strstart)),I.window.set(I.strm.input.subarray(I.strm.next_in-o,I.strm.next_in),I.strstart),I.strstart+=o,I.insert+=o>I.w_size-I.insert?I.w_size-I.insert:o),I.block_start=I.strstart),I.high_water<I.strstart&&(I.high_water=I.strstart),e?BS_FINISH_DONE:Z!==Z_NO_FLUSH$2&&Z!==Z_FINISH$3&&I.strm.avail_in===0&&I.strstart===I.block_start?BS_BLOCK_DONE:(k=I.window_size-I.strstart,I.strm.avail_in>k&&I.block_start>=I.w_size&&(I.block_start-=I.w_size,I.strstart-=I.w_size,I.window.set(I.window.subarray(I.w_size,I.w_size+I.strstart),0),I.matches<2&&I.matches++,k+=I.w_size,I.insert>I.strstart&&(I.insert=I.strstart)),k>I.strm.avail_in&&(k=I.strm.avail_in),k&&(read_buf(I.strm,I.window,I.strstart,k),I.strstart+=k,I.insert+=k>I.w_size-I.insert?I.w_size-I.insert:k),I.high_water<I.strstart&&(I.high_water=I.strstart),k=I.bi_valid+42>>3,k=I.pending_buf_size-k>65535?65535:I.pending_buf_size-k,O=k>I.w_size?I.w_size:k,a=I.strstart-I.block_start,(a>=O||(a||Z===Z_FINISH$3)&&Z!==Z_NO_FLUSH$2&&I.strm.avail_in===0&&a<=k)&&(D=a>k?k:a,e=Z===Z_FINISH$3&&I.strm.avail_in===0&&D===a?1:0,_tr_stored_block(I,I.block_start,D,e),I.block_start+=D,flush_pending(I.strm)),e?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(I,Z)=>{let O,D;for(;;){if(I.lookahead<MIN_LOOKAHEAD){if(fill_window(I),I.lookahead<MIN_LOOKAHEAD&&Z===Z_NO_FLUSH$2)return BS_NEED_MORE;if(I.lookahead===0)break}if(O=0,I.lookahead>=MIN_MATCH&&(I.ins_h=HASH(I,I.ins_h,I.window[I.strstart+MIN_MATCH-1]),O=I.prev[I.strstart&I.w_mask]=I.head[I.ins_h],I.head[I.ins_h]=I.strstart),O!==0&&I.strstart-O<=I.w_size-MIN_LOOKAHEAD&&(I.match_length=longest_match(I,O)),I.match_length>=MIN_MATCH)if(D=_tr_tally(I,I.strstart-I.match_start,I.match_length-MIN_MATCH),I.lookahead-=I.match_length,I.match_length<=I.max_lazy_match&&I.lookahead>=MIN_MATCH){I.match_length--;do I.strstart++,I.ins_h=HASH(I,I.ins_h,I.window[I.strstart+MIN_MATCH-1]),O=I.prev[I.strstart&I.w_mask]=I.head[I.ins_h],I.head[I.ins_h]=I.strstart;while(--I.match_length!==0);I.strstart++}else I.strstart+=I.match_length,I.match_length=0,I.ins_h=I.window[I.strstart],I.ins_h=HASH(I,I.ins_h,I.window[I.strstart+1]);else D=_tr_tally(I,0,I.window[I.strstart]),I.lookahead--,I.strstart++;if(D&&(flush_block_only(I,!1),I.strm.avail_out===0))return BS_NEED_MORE}return I.insert=I.strstart<MIN_MATCH-1?I.strstart:MIN_MATCH-1,Z===Z_FINISH$3?(flush_block_only(I,!0),I.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):I.sym_next&&(flush_block_only(I,!1),I.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(I,Z)=>{let O,D,a;for(;;){if(I.lookahead<MIN_LOOKAHEAD){if(fill_window(I),I.lookahead<MIN_LOOKAHEAD&&Z===Z_NO_FLUSH$2)return BS_NEED_MORE;if(I.lookahead===0)break}if(O=0,I.lookahead>=MIN_MATCH&&(I.ins_h=HASH(I,I.ins_h,I.window[I.strstart+MIN_MATCH-1]),O=I.prev[I.strstart&I.w_mask]=I.head[I.ins_h],I.head[I.ins_h]=I.strstart),I.prev_length=I.match_length,I.prev_match=I.match_start,I.match_length=MIN_MATCH-1,O!==0&&I.prev_length<I.max_lazy_match&&I.strstart-O<=I.w_size-MIN_LOOKAHEAD&&(I.match_length=longest_match(I,O),I.match_length<=5&&(I.strategy===Z_FILTERED||I.match_length===MIN_MATCH&&I.strstart-I.match_start>4096)&&(I.match_length=MIN_MATCH-1)),I.prev_length>=MIN_MATCH&&I.match_length<=I.prev_length){a=I.strstart+I.lookahead-MIN_MATCH,D=_tr_tally(I,I.strstart-1-I.prev_match,I.prev_length-MIN_MATCH),I.lookahead-=I.prev_length-1,I.prev_length-=2;do++I.strstart<=a&&(I.ins_h=HASH(I,I.ins_h,I.window[I.strstart+MIN_MATCH-1]),O=I.prev[I.strstart&I.w_mask]=I.head[I.ins_h],I.head[I.ins_h]=I.strstart);while(--I.prev_length!==0);if(I.match_available=0,I.match_length=MIN_MATCH-1,I.strstart++,D&&(flush_block_only(I,!1),I.strm.avail_out===0))return BS_NEED_MORE}else if(I.match_available){if(D=_tr_tally(I,0,I.window[I.strstart-1]),D&&flush_block_only(I,!1),I.strstart++,I.lookahead--,I.strm.avail_out===0)return BS_NEED_MORE}else I.match_available=1,I.strstart++,I.lookahead--}return I.match_available&&(D=_tr_tally(I,0,I.window[I.strstart-1]),I.match_available=0),I.insert=I.strstart<MIN_MATCH-1?I.strstart:MIN_MATCH-1,Z===Z_FINISH$3?(flush_block_only(I,!0),I.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):I.sym_next&&(flush_block_only(I,!1),I.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(I,Z)=>{let O,D,a,k;const e=I.window;for(;;){if(I.lookahead<=MAX_MATCH){if(fill_window(I),I.lookahead<=MAX_MATCH&&Z===Z_NO_FLUSH$2)return BS_NEED_MORE;if(I.lookahead===0)break}if(I.match_length=0,I.lookahead>=MIN_MATCH&&I.strstart>0&&(a=I.strstart-1,D=e[a],D===e[++a]&&D===e[++a]&&D===e[++a])){k=I.strstart+MAX_MATCH;do;while(D===e[++a]&&D===e[++a]&&D===e[++a]&&D===e[++a]&&D===e[++a]&&D===e[++a]&&D===e[++a]&&D===e[++a]&&a<k);I.match_length=MAX_MATCH-(k-a),I.match_length>I.lookahead&&(I.match_length=I.lookahead)}if(I.match_length>=MIN_MATCH?(O=_tr_tally(I,1,I.match_length-MIN_MATCH),I.lookahead-=I.match_length,I.strstart+=I.match_length,I.match_length=0):(O=_tr_tally(I,0,I.window[I.strstart]),I.lookahead--,I.strstart++),O&&(flush_block_only(I,!1),I.strm.avail_out===0))return BS_NEED_MORE}return I.insert=0,Z===Z_FINISH$3?(flush_block_only(I,!0),I.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):I.sym_next&&(flush_block_only(I,!1),I.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(I,Z)=>{let O;for(;;){if(I.lookahead===0&&(fill_window(I),I.lookahead===0)){if(Z===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(I.match_length=0,O=_tr_tally(I,0,I.window[I.strstart]),I.lookahead--,I.strstart++,O&&(flush_block_only(I,!1),I.strm.avail_out===0))return BS_NEED_MORE}return I.insert=0,Z===Z_FINISH$3?(flush_block_only(I,!0),I.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):I.sym_next&&(flush_block_only(I,!1),I.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(I,Z,O,D,a){this.good_length=I,this.max_lazy=Z,this.nice_length=O,this.max_chain=D,this.func=a}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=I=>{I.window_size=2*I.w_size,zero(I.head),I.max_lazy_match=configuration_table[I.level].max_lazy,I.good_match=configuration_table[I.level].good_length,I.nice_match=configuration_table[I.level].nice_length,I.max_chain_length=configuration_table[I.level].max_chain,I.strstart=0,I.block_start=0,I.lookahead=0,I.insert=0,I.match_length=I.prev_length=MIN_MATCH-1,I.match_available=0,I.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=I=>{if(!I)return 1;const Z=I.state;return!Z||Z.strm!==I||Z.status!==INIT_STATE&&Z.status!==GZIP_STATE&&Z.status!==EXTRA_STATE&&Z.status!==NAME_STATE&&Z.status!==COMMENT_STATE&&Z.status!==HCRC_STATE&&Z.status!==BUSY_STATE&&Z.status!==FINISH_STATE?1:0},deflateResetKeep=I=>{if(deflateStateCheck(I))return err(I,Z_STREAM_ERROR$2);I.total_in=I.total_out=0,I.data_type=Z_UNKNOWN;const Z=I.state;return Z.pending=0,Z.pending_out=0,Z.wrap<0&&(Z.wrap=-Z.wrap),Z.status=Z.wrap===2?GZIP_STATE:Z.wrap?INIT_STATE:BUSY_STATE,I.adler=Z.wrap===2?0:1,Z.last_flush=-2,_tr_init(Z),Z_OK$3},deflateReset=I=>{const Z=deflateResetKeep(I);return Z===Z_OK$3&&lm_init(I.state),Z},deflateSetHeader=(I,Z)=>deflateStateCheck(I)||I.state.wrap!==2?Z_STREAM_ERROR$2:(I.state.gzhead=Z,Z_OK$3),deflateInit2=(I,Z,O,D,a,k)=>{if(!I)return Z_STREAM_ERROR$2;let e=1;if(Z===Z_DEFAULT_COMPRESSION$1&&(Z=6),D<0?(e=0,D=-D):D>15&&(e=2,D-=16),a<1||a>MAX_MEM_LEVEL||O!==Z_DEFLATED$2||D<8||D>15||Z<0||Z>9||k<0||k>Z_FIXED||D===8&&e!==1)return err(I,Z_STREAM_ERROR$2);D===8&&(D=9);const o=new DeflateState;return I.state=o,o.strm=I,o.status=INIT_STATE,o.wrap=e,o.gzhead=null,o.w_bits=D,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=a+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+MIN_MATCH-1)/MIN_MATCH),o.window=new Uint8Array(o.w_size*2),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<a+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=(o.lit_bufsize-1)*3,o.level=Z,o.strategy=k,o.method=O,deflateReset(I)},deflateInit=(I,Z)=>deflateInit2(I,Z,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(I,Z)=>{if(deflateStateCheck(I)||Z>Z_BLOCK$1||Z<0)return I?err(I,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const O=I.state;if(!I.output||I.avail_in!==0&&!I.input||O.status===FINISH_STATE&&Z!==Z_FINISH$3)return err(I,I.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const D=O.last_flush;if(O.last_flush=Z,O.pending!==0){if(flush_pending(I),I.avail_out===0)return O.last_flush=-1,Z_OK$3}else if(I.avail_in===0&&rank(Z)<=rank(D)&&Z!==Z_FINISH$3)return err(I,Z_BUF_ERROR$1);if(O.status===FINISH_STATE&&I.avail_in!==0)return err(I,Z_BUF_ERROR$1);if(O.status===INIT_STATE&&O.wrap===0&&(O.status=BUSY_STATE),O.status===INIT_STATE){let a=Z_DEFLATED$2+(O.w_bits-8<<4)<<8,k=-1;if(O.strategy>=Z_HUFFMAN_ONLY||O.level<2?k=0:O.level<6?k=1:O.level===6?k=2:k=3,a|=k<<6,O.strstart!==0&&(a|=PRESET_DICT),a+=31-a%31,putShortMSB(O,a),O.strstart!==0&&(putShortMSB(O,I.adler>>>16),putShortMSB(O,I.adler&65535)),I.adler=1,O.status=BUSY_STATE,flush_pending(I),O.pending!==0)return O.last_flush=-1,Z_OK$3}if(O.status===GZIP_STATE){if(I.adler=0,put_byte(O,31),put_byte(O,139),put_byte(O,8),O.gzhead)put_byte(O,(O.gzhead.text?1:0)+(O.gzhead.hcrc?2:0)+(O.gzhead.extra?4:0)+(O.gzhead.name?8:0)+(O.gzhead.comment?16:0)),put_byte(O,O.gzhead.time&255),put_byte(O,O.gzhead.time>>8&255),put_byte(O,O.gzhead.time>>16&255),put_byte(O,O.gzhead.time>>24&255),put_byte(O,O.level===9?2:O.strategy>=Z_HUFFMAN_ONLY||O.level<2?4:0),put_byte(O,O.gzhead.os&255),O.gzhead.extra&&O.gzhead.extra.length&&(put_byte(O,O.gzhead.extra.length&255),put_byte(O,O.gzhead.extra.length>>8&255)),O.gzhead.hcrc&&(I.adler=crc32_1(I.adler,O.pending_buf,O.pending,0)),O.gzindex=0,O.status=EXTRA_STATE;else if(put_byte(O,0),put_byte(O,0),put_byte(O,0),put_byte(O,0),put_byte(O,0),put_byte(O,O.level===9?2:O.strategy>=Z_HUFFMAN_ONLY||O.level<2?4:0),put_byte(O,OS_CODE),O.status=BUSY_STATE,flush_pending(I),O.pending!==0)return O.last_flush=-1,Z_OK$3}if(O.status===EXTRA_STATE){if(O.gzhead.extra){let a=O.pending,k=(O.gzhead.extra.length&65535)-O.gzindex;for(;O.pending+k>O.pending_buf_size;){let o=O.pending_buf_size-O.pending;if(O.pending_buf.set(O.gzhead.extra.subarray(O.gzindex,O.gzindex+o),O.pending),O.pending=O.pending_buf_size,O.gzhead.hcrc&&O.pending>a&&(I.adler=crc32_1(I.adler,O.pending_buf,O.pending-a,a)),O.gzindex+=o,flush_pending(I),O.pending!==0)return O.last_flush=-1,Z_OK$3;a=0,k-=o}let e=new Uint8Array(O.gzhead.extra);O.pending_buf.set(e.subarray(O.gzindex,O.gzindex+k),O.pending),O.pending+=k,O.gzhead.hcrc&&O.pending>a&&(I.adler=crc32_1(I.adler,O.pending_buf,O.pending-a,a)),O.gzindex=0}O.status=NAME_STATE}if(O.status===NAME_STATE){if(O.gzhead.name){let a=O.pending,k;do{if(O.pending===O.pending_buf_size){if(O.gzhead.hcrc&&O.pending>a&&(I.adler=crc32_1(I.adler,O.pending_buf,O.pending-a,a)),flush_pending(I),O.pending!==0)return O.last_flush=-1,Z_OK$3;a=0}O.gzindex<O.gzhead.name.length?k=O.gzhead.name.charCodeAt(O.gzindex++)&255:k=0,put_byte(O,k)}while(k!==0);O.gzhead.hcrc&&O.pending>a&&(I.adler=crc32_1(I.adler,O.pending_buf,O.pending-a,a)),O.gzindex=0}O.status=COMMENT_STATE}if(O.status===COMMENT_STATE){if(O.gzhead.comment){let a=O.pending,k;do{if(O.pending===O.pending_buf_size){if(O.gzhead.hcrc&&O.pending>a&&(I.adler=crc32_1(I.adler,O.pending_buf,O.pending-a,a)),flush_pending(I),O.pending!==0)return O.last_flush=-1,Z_OK$3;a=0}O.gzindex<O.gzhead.comment.length?k=O.gzhead.comment.charCodeAt(O.gzindex++)&255:k=0,put_byte(O,k)}while(k!==0);O.gzhead.hcrc&&O.pending>a&&(I.adler=crc32_1(I.adler,O.pending_buf,O.pending-a,a))}O.status=HCRC_STATE}if(O.status===HCRC_STATE){if(O.gzhead.hcrc){if(O.pending+2>O.pending_buf_size&&(flush_pending(I),O.pending!==0))return O.last_flush=-1,Z_OK$3;put_byte(O,I.adler&255),put_byte(O,I.adler>>8&255),I.adler=0}if(O.status=BUSY_STATE,flush_pending(I),O.pending!==0)return O.last_flush=-1,Z_OK$3}if(I.avail_in!==0||O.lookahead!==0||Z!==Z_NO_FLUSH$2&&O.status!==FINISH_STATE){let a=O.level===0?deflate_stored(O,Z):O.strategy===Z_HUFFMAN_ONLY?deflate_huff(O,Z):O.strategy===Z_RLE?deflate_rle(O,Z):configuration_table[O.level].func(O,Z);if((a===BS_FINISH_STARTED||a===BS_FINISH_DONE)&&(O.status=FINISH_STATE),a===BS_NEED_MORE||a===BS_FINISH_STARTED)return I.avail_out===0&&(O.last_flush=-1),Z_OK$3;if(a===BS_BLOCK_DONE&&(Z===Z_PARTIAL_FLUSH?_tr_align(O):Z!==Z_BLOCK$1&&(_tr_stored_block(O,0,0,!1),Z===Z_FULL_FLUSH$1&&(zero(O.head),O.lookahead===0&&(O.strstart=0,O.block_start=0,O.insert=0))),flush_pending(I),I.avail_out===0))return O.last_flush=-1,Z_OK$3}return Z!==Z_FINISH$3?Z_OK$3:O.wrap<=0?Z_STREAM_END$3:(O.wrap===2?(put_byte(O,I.adler&255),put_byte(O,I.adler>>8&255),put_byte(O,I.adler>>16&255),put_byte(O,I.adler>>24&255),put_byte(O,I.total_in&255),put_byte(O,I.total_in>>8&255),put_byte(O,I.total_in>>16&255),put_byte(O,I.total_in>>24&255)):(putShortMSB(O,I.adler>>>16),putShortMSB(O,I.adler&65535)),flush_pending(I),O.wrap>0&&(O.wrap=-O.wrap),O.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=I=>{if(deflateStateCheck(I))return Z_STREAM_ERROR$2;const Z=I.state.status;return I.state=null,Z===BUSY_STATE?err(I,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(I,Z)=>{let O=Z.length;if(deflateStateCheck(I))return Z_STREAM_ERROR$2;const D=I.state,a=D.wrap;if(a===2||a===1&&D.status!==INIT_STATE||D.lookahead)return Z_STREAM_ERROR$2;if(a===1&&(I.adler=adler32_1(I.adler,Z,O,0)),D.wrap=0,O>=D.w_size){a===0&&(zero(D.head),D.strstart=0,D.block_start=0,D.insert=0);let N=new Uint8Array(D.w_size);N.set(Z.subarray(O-D.w_size,O),0),Z=N,O=D.w_size}const k=I.avail_in,e=I.next_in,o=I.input;for(I.avail_in=O,I.next_in=0,I.input=Z,fill_window(D);D.lookahead>=MIN_MATCH;){let N=D.strstart,q=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(--q);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,I.next_in=e,I.input=o,I.avail_in=k,D.wrap=a,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=(I,Z)=>Object.prototype.hasOwnProperty.call(I,Z);var assign=function(I){const Z=Array.prototype.slice.call(arguments,1);for(;Z.length;){const O=Z.shift();if(O){if(typeof O!="object")throw new TypeError(O+"must be non-object");for(const D in O)_has(O,D)&&(I[D]=O[D])}}return I},flattenChunks=I=>{let Z=0;for(let D=0,a=I.length;D<a;D++)Z+=I[D].length;const O=new Uint8Array(Z);for(let D=0,a=0,k=I.length;D<k;D++){let e=I[D];O.set(e,a),a+=e.length}return O},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(I){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let I=0;I<256;I++)_utf8len[I]=I>=252?6:I>=248?5:I>=240?4:I>=224?3:I>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=I=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(I);let Z,O,D,a,k,e=I.length,o=0;for(a=0;a<e;a++)O=I.charCodeAt(a),(O&64512)===55296&&a+1<e&&(D=I.charCodeAt(a+1),(D&64512)===56320&&(O=65536+(O-55296<<10)+(D-56320),a++)),o+=O<128?1:O<2048?2:O<65536?3:4;for(Z=new Uint8Array(o),k=0,a=0;k<o;a++)O=I.charCodeAt(a),(O&64512)===55296&&a+1<e&&(D=I.charCodeAt(a+1),(D&64512)===56320&&(O=65536+(O-55296<<10)+(D-56320),a++)),O<128?Z[k++]=O:O<2048?(Z[k++]=192|O>>>6,Z[k++]=128|O&63):O<65536?(Z[k++]=224|O>>>12,Z[k++]=128|O>>>6&63,Z[k++]=128|O&63):(Z[k++]=240|O>>>18,Z[k++]=128|O>>>12&63,Z[k++]=128|O>>>6&63,Z[k++]=128|O&63);return Z};const buf2binstring=(I,Z)=>{if(Z<65534&&I.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,I.length===Z?I:I.subarray(0,Z));let O="";for(let D=0;D<Z;D++)O+=String.fromCharCode(I[D]);return O};var buf2string=(I,Z)=>{const O=Z||I.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(I.subarray(0,Z));let D,a;const k=new Array(O*2);for(a=0,D=0;D<O;){let e=I[D++];if(e<128){k[a++]=e;continue}let o=_utf8len[e];if(o>4){k[a++]=65533,D+=o-1;continue}for(e&=o===2?31:o===3?15:7;o>1&&D<O;)e=e<<6|I[D++]&63,o--;if(o>1){k[a++]=65533;continue}e<65536?k[a++]=e:(e-=65536,k[a++]=55296|e>>10&1023,k[a++]=56320|e&1023)}return buf2binstring(k,a)},utf8border=(I,Z)=>{Z=Z||I.length,Z>I.length&&(Z=I.length);let O=Z-1;for(;O>=0&&(I[O]&192)===128;)O--;return O<0||O===0?Z:O+_utf8len[I[O]]>Z?O:Z},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(I){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},I||{});let Z=this.options;Z.raw&&Z.windowBits>0?Z.windowBits=-Z.windowBits:Z.gzip&&Z.windowBits>0&&Z.windowBits<16&&(Z.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let O=deflate_1$2.deflateInit2(this.strm,Z.level,Z.method,Z.windowBits,Z.memLevel,Z.strategy);if(O!==Z_OK$2)throw new Error(messages[O]);if(Z.header&&deflate_1$2.deflateSetHeader(this.strm,Z.header),Z.dictionary){let D;if(typeof Z.dictionary=="string"?D=strings.string2buf(Z.dictionary):toString$1.call(Z.dictionary)==="[object ArrayBuffer]"?D=new Uint8Array(Z.dictionary):D=Z.dictionary,O=deflate_1$2.deflateSetDictionary(this.strm,D),O!==Z_OK$2)throw new Error(messages[O]);this._dict_set=!0}}Deflate$1.prototype.push=function(I,Z){const O=this.strm,D=this.options.chunkSize;let a,k;if(this.ended)return!1;for(Z===~~Z?k=Z:k=Z===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof I=="string"?O.input=strings.string2buf(I):toString$1.call(I)==="[object ArrayBuffer]"?O.input=new Uint8Array(I):O.input=I,O.next_in=0,O.avail_in=O.input.length;;){if(O.avail_out===0&&(O.output=new Uint8Array(D),O.next_out=0,O.avail_out=D),(k===Z_SYNC_FLUSH||k===Z_FULL_FLUSH)&&O.avail_out<=6){this.onData(O.output.subarray(0,O.next_out)),O.avail_out=0;continue}if(a=deflate_1$2.deflate(O,k),a===Z_STREAM_END$2)return O.next_out>0&&this.onData(O.output.subarray(0,O.next_out)),a=deflate_1$2.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Z_OK$2;if(O.avail_out===0){this.onData(O.output);continue}if(k>0&&O.next_out>0){this.onData(O.output.subarray(0,O.next_out)),O.avail_out=0;continue}if(O.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(I){this.chunks.push(I)},Deflate$1.prototype.onEnd=function(I){I===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=I,this.msg=this.strm.msg};function deflate$1(I,Z){const O=new Deflate$1(Z);if(O.push(I,!0),O.err)throw O.msg||messages[O.err];return O.result}function deflateRaw$1(I,Z){return Z=Z||{},Z.raw=!0,deflate$1(I,Z)}function gzip$1(I,Z){return Z=Z||{},Z.gzip=!0,deflate$1(I,Z)}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 I(Z,O){let D,a,k,e,o,N,q,F,J,z,G,K,it,tt,X,nt,rt,ot,ct,_t,at,mt,ft,st;const ut=Z.state;D=Z.next_in,ft=Z.input,a=D+(Z.avail_in-5),k=Z.next_out,st=Z.output,e=k-(O-Z.avail_out),o=k+(Z.avail_out-257),N=ut.dmax,q=ut.wsize,F=ut.whave,J=ut.wnext,z=ut.window,G=ut.hold,K=ut.bits,it=ut.lencode,tt=ut.distcode,X=(1<<ut.lenbits)-1,nt=(1<<ut.distbits)-1;t:do{K<15&&(G+=ft[D++]<<K,K+=8,G+=ft[D++]<<K,K+=8),rt=it[G&X];e:for(;;){if(ot=rt>>>24,G>>>=ot,K-=ot,ot=rt>>>16&255,ot===0)st[k++]=rt&65535;else if(ot&16){ct=rt&65535,ot&=15,ot&&(K<ot&&(G+=ft[D++]<<K,K+=8),ct+=G&(1<<ot)-1,G>>>=ot,K-=ot),K<15&&(G+=ft[D++]<<K,K+=8,G+=ft[D++]<<K,K+=8),rt=tt[G&nt];i:for(;;){if(ot=rt>>>24,G>>>=ot,K-=ot,ot=rt>>>16&255,ot&16){if(_t=rt&65535,ot&=15,K<ot&&(G+=ft[D++]<<K,K+=8,K<ot&&(G+=ft[D++]<<K,K+=8)),_t+=G&(1<<ot)-1,_t>N){Z.msg="invalid distance too far back",ut.mode=BAD$1;break t}if(G>>>=ot,K-=ot,ot=k-e,_t>ot){if(ot=_t-ot,ot>F&&ut.sane){Z.msg="invalid distance too far back",ut.mode=BAD$1;break t}if(at=0,mt=z,J===0){if(at+=q-ot,ot<ct){ct-=ot;do st[k++]=z[at++];while(--ot);at=k-_t,mt=st}}else if(J<ot){if(at+=q+J-ot,ot-=J,ot<ct){ct-=ot;do st[k++]=z[at++];while(--ot);if(at=0,J<ct){ot=J,ct-=ot;do st[k++]=z[at++];while(--ot);at=k-_t,mt=st}}}else if(at+=J-ot,ot<ct){ct-=ot;do st[k++]=z[at++];while(--ot);at=k-_t,mt=st}for(;ct>2;)st[k++]=mt[at++],st[k++]=mt[at++],st[k++]=mt[at++],ct-=3;ct&&(st[k++]=mt[at++],ct>1&&(st[k++]=mt[at++]))}else{at=k-_t;do st[k++]=st[at++],st[k++]=st[at++],st[k++]=st[at++],ct-=3;while(ct>2);ct&&(st[k++]=st[at++],ct>1&&(st[k++]=st[at++]))}}else if((ot&64)===0){rt=tt[(rt&65535)+(G&(1<<ot)-1)];continue i}else{Z.msg="invalid distance code",ut.mode=BAD$1;break t}break}}else if((ot&64)===0){rt=it[(rt&65535)+(G&(1<<ot)-1)];continue e}else if(ot&32){ut.mode=TYPE$1;break t}else{Z.msg="invalid literal/length code",ut.mode=BAD$1;break t}break}}while(D<a&&k<o);ct=K>>3,D-=ct,K-=ct<<3,G&=(1<<K)-1,Z.next_in=D,Z.next_out=k,Z.avail_in=D<a?5+(a-D):5-(D-a),Z.avail_out=k<o?257+(o-k):257-(k-o),ut.hold=G,ut.bits=K};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=(I,Z,O,D,a,k,e,o)=>{const N=o.bits;let q=0,F=0,J=0,z=0,G=0,K=0,it=0,tt=0,X=0,nt=0,rt,ot,ct,_t,at,mt=null,ft;const st=new Uint16Array(MAXBITS+1),ut=new Uint16Array(MAXBITS+1);let Rt=null,ce,oe,re;for(q=0;q<=MAXBITS;q++)st[q]=0;for(F=0;F<D;F++)st[Z[O+F]]++;for(G=N,z=MAXBITS;z>=1&&st[z]===0;z--);if(G>z&&(G=z),z===0)return a[k++]=1<<24|64<<16|0,a[k++]=1<<24|64<<16|0,o.bits=1,0;for(J=1;J<z&&st[J]===0;J++);for(G<J&&(G=J),tt=1,q=1;q<=MAXBITS;q++)if(tt<<=1,tt-=st[q],tt<0)return-1;if(tt>0&&(I===CODES$1||z!==1))return-1;for(ut[1]=0,q=1;q<MAXBITS;q++)ut[q+1]=ut[q]+st[q];for(F=0;F<D;F++)Z[O+F]!==0&&(e[ut[Z[O+F]]++]=F);if(I===CODES$1?(mt=Rt=e,ft=20):I===LENS$1?(mt=lbase,Rt=lext,ft=257):(mt=dbase,Rt=dext,ft=0),nt=0,F=0,q=J,at=k,K=G,it=0,ct=-1,X=1<<G,_t=X-1,I===LENS$1&&X>ENOUGH_LENS$1||I===DISTS$1&&X>ENOUGH_DISTS$1)return 1;for(;;){ce=q-it,e[F]+1<ft?(oe=0,re=e[F]):e[F]>=ft?(oe=Rt[e[F]-ft],re=mt[e[F]-ft]):(oe=96,re=0),rt=1<<q-it,ot=1<<K,J=ot;do ot-=rt,a[at+(nt>>it)+ot]=ce<<24|oe<<16|re|0;while(ot!==0);for(rt=1<<q-1;nt&rt;)rt>>=1;if(rt!==0?(nt&=rt-1,nt+=rt):nt=0,F++,--st[q]===0){if(q===z)break;q=Z[O+e[F]]}if(q>G&&(nt&_t)!==ct){for(it===0&&(it=G),at+=J,K=q-it,tt=1<<K;K+it<z&&(tt-=st[K+it],!(tt<=0));)K++,tt<<=1;if(X+=1<<K,I===LENS$1&&X>ENOUGH_LENS$1||I===DISTS$1&&X>ENOUGH_DISTS$1)return 1;ct=nt&_t,a[ct]=G<<24|K<<16|at-k|0}}return nt!==0&&(a[at+nt]=q-it<<24|64<<16|0),o.bits=G,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=I=>(I>>>24&255)+(I>>>8&65280)+((I&65280)<<8)+((I&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=I=>{if(!I)return 1;const Z=I.state;return!Z||Z.strm!==I||Z.mode<HEAD||Z.mode>SYNC?1:0},inflateResetKeep=I=>{if(inflateStateCheck(I))return Z_STREAM_ERROR$1;const Z=I.state;return I.total_in=I.total_out=Z.total=0,I.msg="",Z.wrap&&(I.adler=Z.wrap&1),Z.mode=HEAD,Z.last=0,Z.havedict=0,Z.flags=-1,Z.dmax=32768,Z.head=null,Z.hold=0,Z.bits=0,Z.lencode=Z.lendyn=new Int32Array(ENOUGH_LENS),Z.distcode=Z.distdyn=new Int32Array(ENOUGH_DISTS),Z.sane=1,Z.back=-1,Z_OK$1},inflateReset=I=>{if(inflateStateCheck(I))return Z_STREAM_ERROR$1;const Z=I.state;return Z.wsize=0,Z.whave=0,Z.wnext=0,inflateResetKeep(I)},inflateReset2=(I,Z)=>{let O;if(inflateStateCheck(I))return Z_STREAM_ERROR$1;const D=I.state;return Z<0?(O=0,Z=-Z):(O=(Z>>4)+5,Z<48&&(Z&=15)),Z&&(Z<8||Z>15)?Z_STREAM_ERROR$1:(D.window!==null&&D.wbits!==Z&&(D.window=null),D.wrap=O,D.wbits=Z,inflateReset(I))},inflateInit2=(I,Z)=>{if(!I)return Z_STREAM_ERROR$1;const O=new InflateState;I.state=O,O.strm=I,O.window=null,O.mode=HEAD;const D=inflateReset2(I,Z);return D!==Z_OK$1&&(I.state=null),D},inflateInit=I=>inflateInit2(I,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=I=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let Z=0;for(;Z<144;)I.lens[Z++]=8;for(;Z<256;)I.lens[Z++]=9;for(;Z<280;)I.lens[Z++]=7;for(;Z<288;)I.lens[Z++]=8;for(inftrees(LENS,I.lens,0,288,lenfix,0,I.work,{bits:9}),Z=0;Z<32;)I.lens[Z++]=5;inftrees(DISTS,I.lens,0,32,distfix,0,I.work,{bits:5}),virgin=!1}I.lencode=lenfix,I.lenbits=9,I.distcode=distfix,I.distbits=5},updatewindow=(I,Z,O,D)=>{let a;const k=I.state;return k.window===null&&(k.wsize=1<<k.wbits,k.wnext=0,k.whave=0,k.window=new Uint8Array(k.wsize)),D>=k.wsize?(k.window.set(Z.subarray(O-k.wsize,O),0),k.wnext=0,k.whave=k.wsize):(a=k.wsize-k.wnext,a>D&&(a=D),k.window.set(Z.subarray(O-D,O-D+a),k.wnext),D-=a,D?(k.window.set(Z.subarray(O-D,O),0),k.wnext=D,k.whave=k.wsize):(k.wnext+=a,k.wnext===k.wsize&&(k.wnext=0),k.whave<k.wsize&&(k.whave+=a))),0},inflate$2=(I,Z)=>{let O,D,a,k,e,o,N,q,F,J,z,G,K,it,tt=0,X,nt,rt,ot,ct,_t,at,mt;const ft=new Uint8Array(4);let st,ut;const Rt=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(I)||!I.output||!I.input&&I.avail_in!==0)return Z_STREAM_ERROR$1;O=I.state,O.mode===TYPE&&(O.mode=TYPEDO),e=I.next_out,a=I.output,N=I.avail_out,k=I.next_in,D=I.input,o=I.avail_in,q=O.hold,F=O.bits,J=o,z=N,mt=Z_OK$1;t:for(;;)switch(O.mode){case HEAD:if(O.wrap===0){O.mode=TYPEDO;break}for(;F<16;){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}if(O.wrap&2&&q===35615){O.wbits===0&&(O.wbits=15),O.check=0,ft[0]=q&255,ft[1]=q>>>8&255,O.check=crc32_1(O.check,ft,2,0),q=0,F=0,O.mode=FLAGS;break}if(O.head&&(O.head.done=!1),!(O.wrap&1)||(((q&255)<<8)+(q>>8))%31){I.msg="incorrect header check",O.mode=BAD;break}if((q&15)!==Z_DEFLATED){I.msg="unknown compression method",O.mode=BAD;break}if(q>>>=4,F-=4,at=(q&15)+8,O.wbits===0&&(O.wbits=at),at>15||at>O.wbits){I.msg="invalid window size",O.mode=BAD;break}O.dmax=1<<O.wbits,O.flags=0,I.adler=O.check=1,O.mode=q&512?DICTID:TYPE,q=0,F=0;break;case FLAGS:for(;F<16;){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}if(O.flags=q,(O.flags&255)!==Z_DEFLATED){I.msg="unknown compression method",O.mode=BAD;break}if(O.flags&57344){I.msg="unknown header flags set",O.mode=BAD;break}O.head&&(O.head.text=q>>8&1),O.flags&512&&O.wrap&4&&(ft[0]=q&255,ft[1]=q>>>8&255,O.check=crc32_1(O.check,ft,2,0)),q=0,F=0,O.mode=TIME;case TIME:for(;F<32;){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}O.head&&(O.head.time=q),O.flags&512&&O.wrap&4&&(ft[0]=q&255,ft[1]=q>>>8&255,ft[2]=q>>>16&255,ft[3]=q>>>24&255,O.check=crc32_1(O.check,ft,4,0)),q=0,F=0,O.mode=OS;case OS:for(;F<16;){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}O.head&&(O.head.xflags=q&255,O.head.os=q>>8),O.flags&512&&O.wrap&4&&(ft[0]=q&255,ft[1]=q>>>8&255,O.check=crc32_1(O.check,ft,2,0)),q=0,F=0,O.mode=EXLEN;case EXLEN:if(O.flags&1024){for(;F<16;){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}O.length=q,O.head&&(O.head.extra_len=q),O.flags&512&&O.wrap&4&&(ft[0]=q&255,ft[1]=q>>>8&255,O.check=crc32_1(O.check,ft,2,0)),q=0,F=0}else O.head&&(O.head.extra=null);O.mode=EXTRA;case EXTRA:if(O.flags&1024&&(G=O.length,G>o&&(G=o),G&&(O.head&&(at=O.head.extra_len-O.length,O.head.extra||(O.head.extra=new Uint8Array(O.head.extra_len)),O.head.extra.set(D.subarray(k,k+G),at)),O.flags&512&&O.wrap&4&&(O.check=crc32_1(O.check,D,G,k)),o-=G,k+=G,O.length-=G),O.length))break t;O.length=0,O.mode=NAME;case NAME:if(O.flags&2048){if(o===0)break t;G=0;do at=D[k+G++],O.head&&at&&O.length<65536&&(O.head.name+=String.fromCharCode(at));while(at&&G<o);if(O.flags&512&&O.wrap&4&&(O.check=crc32_1(O.check,D,G,k)),o-=G,k+=G,at)break t}else O.head&&(O.head.name=null);O.length=0,O.mode=COMMENT;case COMMENT:if(O.flags&4096){if(o===0)break t;G=0;do at=D[k+G++],O.head&&at&&O.length<65536&&(O.head.comment+=String.fromCharCode(at));while(at&&G<o);if(O.flags&512&&O.wrap&4&&(O.check=crc32_1(O.check,D,G,k)),o-=G,k+=G,at)break t}else O.head&&(O.head.comment=null);O.mode=HCRC;case HCRC:if(O.flags&512){for(;F<16;){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}if(O.wrap&4&&q!==(O.check&65535)){I.msg="header crc mismatch",O.mode=BAD;break}q=0,F=0}O.head&&(O.head.hcrc=O.flags>>9&1,O.head.done=!0),I.adler=O.check=0,O.mode=TYPE;break;case DICTID:for(;F<32;){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}I.adler=O.check=zswap32(q),q=0,F=0,O.mode=DICT;case DICT:if(O.havedict===0)return I.next_out=e,I.avail_out=N,I.next_in=k,I.avail_in=o,O.hold=q,O.bits=F,Z_NEED_DICT$1;I.adler=O.check=1,O.mode=TYPE;case TYPE:if(Z===Z_BLOCK||Z===Z_TREES)break t;case TYPEDO:if(O.last){q>>>=F&7,F-=F&7,O.mode=CHECK;break}for(;F<3;){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}switch(O.last=q&1,q>>>=1,F-=1,q&3){case 0:O.mode=STORED;break;case 1:if(fixedtables(O),O.mode=LEN_,Z===Z_TREES){q>>>=2,F-=2;break t}break;case 2:O.mode=TABLE;break;case 3:I.msg="invalid block type",O.mode=BAD}q>>>=2,F-=2;break;case STORED:for(q>>>=F&7,F-=F&7;F<32;){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}if((q&65535)!==(q>>>16^65535)){I.msg="invalid stored block lengths",O.mode=BAD;break}if(O.length=q&65535,q=0,F=0,O.mode=COPY_,Z===Z_TREES)break t;case COPY_:O.mode=COPY;case COPY:if(G=O.length,G){if(G>o&&(G=o),G>N&&(G=N),G===0)break t;a.set(D.subarray(k,k+G),e),o-=G,k+=G,N-=G,e+=G,O.length-=G;break}O.mode=TYPE;break;case TABLE:for(;F<14;){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}if(O.nlen=(q&31)+257,q>>>=5,F-=5,O.ndist=(q&31)+1,q>>>=5,F-=5,O.ncode=(q&15)+4,q>>>=4,F-=4,O.nlen>286||O.ndist>30){I.msg="too many length or distance symbols",O.mode=BAD;break}O.have=0,O.mode=LENLENS;case LENLENS:for(;O.have<O.ncode;){for(;F<3;){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}O.lens[Rt[O.have++]]=q&7,q>>>=3,F-=3}for(;O.have<19;)O.lens[Rt[O.have++]]=0;if(O.lencode=O.lendyn,O.lenbits=7,st={bits:O.lenbits},mt=inftrees(CODES,O.lens,0,19,O.lencode,0,O.work,st),O.lenbits=st.bits,mt){I.msg="invalid code lengths set",O.mode=BAD;break}O.have=0,O.mode=CODELENS;case CODELENS:for(;O.have<O.nlen+O.ndist;){for(;tt=O.lencode[q&(1<<O.lenbits)-1],X=tt>>>24,nt=tt>>>16&255,rt=tt&65535,!(X<=F);){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}if(rt<16)q>>>=X,F-=X,O.lens[O.have++]=rt;else{if(rt===16){for(ut=X+2;F<ut;){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}if(q>>>=X,F-=X,O.have===0){I.msg="invalid bit length repeat",O.mode=BAD;break}at=O.lens[O.have-1],G=3+(q&3),q>>>=2,F-=2}else if(rt===17){for(ut=X+3;F<ut;){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}q>>>=X,F-=X,at=0,G=3+(q&7),q>>>=3,F-=3}else{for(ut=X+7;F<ut;){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}q>>>=X,F-=X,at=0,G=11+(q&127),q>>>=7,F-=7}if(O.have+G>O.nlen+O.ndist){I.msg="invalid bit length repeat",O.mode=BAD;break}for(;G--;)O.lens[O.have++]=at}}if(O.mode===BAD)break;if(O.lens[256]===0){I.msg="invalid code -- missing end-of-block",O.mode=BAD;break}if(O.lenbits=9,st={bits:O.lenbits},mt=inftrees(LENS,O.lens,0,O.nlen,O.lencode,0,O.work,st),O.lenbits=st.bits,mt){I.msg="invalid literal/lengths set",O.mode=BAD;break}if(O.distbits=6,O.distcode=O.distdyn,st={bits:O.distbits},mt=inftrees(DISTS,O.lens,O.nlen,O.ndist,O.distcode,0,O.work,st),O.distbits=st.bits,mt){I.msg="invalid distances set",O.mode=BAD;break}if(O.mode=LEN_,Z===Z_TREES)break t;case LEN_:O.mode=LEN;case LEN:if(o>=6&&N>=258){I.next_out=e,I.avail_out=N,I.next_in=k,I.avail_in=o,O.hold=q,O.bits=F,inffast(I,z),e=I.next_out,a=I.output,N=I.avail_out,k=I.next_in,D=I.input,o=I.avail_in,q=O.hold,F=O.bits,O.mode===TYPE&&(O.back=-1);break}for(O.back=0;tt=O.lencode[q&(1<<O.lenbits)-1],X=tt>>>24,nt=tt>>>16&255,rt=tt&65535,!(X<=F);){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}if(nt&&(nt&240)===0){for(ot=X,ct=nt,_t=rt;tt=O.lencode[_t+((q&(1<<ot+ct)-1)>>ot)],X=tt>>>24,nt=tt>>>16&255,rt=tt&65535,!(ot+X<=F);){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}q>>>=ot,F-=ot,O.back+=ot}if(q>>>=X,F-=X,O.back+=X,O.length=rt,nt===0){O.mode=LIT;break}if(nt&32){O.back=-1,O.mode=TYPE;break}if(nt&64){I.msg="invalid literal/length code",O.mode=BAD;break}O.extra=nt&15,O.mode=LENEXT;case LENEXT:if(O.extra){for(ut=O.extra;F<ut;){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}O.length+=q&(1<<O.extra)-1,q>>>=O.extra,F-=O.extra,O.back+=O.extra}O.was=O.length,O.mode=DIST;case DIST:for(;tt=O.distcode[q&(1<<O.distbits)-1],X=tt>>>24,nt=tt>>>16&255,rt=tt&65535,!(X<=F);){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}if((nt&240)===0){for(ot=X,ct=nt,_t=rt;tt=O.distcode[_t+((q&(1<<ot+ct)-1)>>ot)],X=tt>>>24,nt=tt>>>16&255,rt=tt&65535,!(ot+X<=F);){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}q>>>=ot,F-=ot,O.back+=ot}if(q>>>=X,F-=X,O.back+=X,nt&64){I.msg="invalid distance code",O.mode=BAD;break}O.offset=rt,O.extra=nt&15,O.mode=DISTEXT;case DISTEXT:if(O.extra){for(ut=O.extra;F<ut;){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}O.offset+=q&(1<<O.extra)-1,q>>>=O.extra,F-=O.extra,O.back+=O.extra}if(O.offset>O.dmax){I.msg="invalid distance too far back",O.mode=BAD;break}O.mode=MATCH;case MATCH:if(N===0)break t;if(G=z-N,O.offset>G){if(G=O.offset-G,G>O.whave&&O.sane){I.msg="invalid distance too far back",O.mode=BAD;break}G>O.wnext?(G-=O.wnext,K=O.wsize-G):K=O.wnext-G,G>O.length&&(G=O.length),it=O.window}else it=a,K=e-O.offset,G=O.length;G>N&&(G=N),N-=G,O.length-=G;do a[e++]=it[K++];while(--G);O.length===0&&(O.mode=LEN);break;case LIT:if(N===0)break t;a[e++]=O.length,N--,O.mode=LEN;break;case CHECK:if(O.wrap){for(;F<32;){if(o===0)break t;o--,q|=D[k++]<<F,F+=8}if(z-=N,I.total_out+=z,O.total+=z,O.wrap&4&&z&&(I.adler=O.check=O.flags?crc32_1(O.check,a,z,e-z):adler32_1(O.check,a,z,e-z)),z=N,O.wrap&4&&(O.flags?q:zswap32(q))!==O.check){I.msg="incorrect data check",O.mode=BAD;break}q=0,F=0}O.mode=LENGTH;case LENGTH:if(O.wrap&&O.flags){for(;F<32;){if(o===0)break t;o--,q+=D[k++]<<F,F+=8}if(O.wrap&4&&q!==(O.total&4294967295)){I.msg="incorrect length check",O.mode=BAD;break}q=0,F=0}O.mode=DONE;case DONE:mt=Z_STREAM_END$1;break t;case BAD:mt=Z_DATA_ERROR$1;break t;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return I.next_out=e,I.avail_out=N,I.next_in=k,I.avail_in=o,O.hold=q,O.bits=F,(O.wsize||z!==I.avail_out&&O.mode<BAD&&(O.mode<CHECK||Z!==Z_FINISH$1))&&updatewindow(I,I.output,I.next_out,z-I.avail_out),J-=I.avail_in,z-=I.avail_out,I.total_in+=J,I.total_out+=z,O.total+=z,O.wrap&4&&z&&(I.adler=O.check=O.flags?crc32_1(O.check,a,z,I.next_out-z):adler32_1(O.check,a,z,I.next_out-z)),I.data_type=O.bits+(O.last?64:0)+(O.mode===TYPE?128:0)+(O.mode===LEN_||O.mode===COPY_?256:0),(J===0&&z===0||Z===Z_FINISH$1)&&mt===Z_OK$1&&(mt=Z_BUF_ERROR),mt},inflateEnd=I=>{if(inflateStateCheck(I))return Z_STREAM_ERROR$1;let Z=I.state;return Z.window&&(Z.window=null),I.state=null,Z_OK$1},inflateGetHeader=(I,Z)=>{if(inflateStateCheck(I))return Z_STREAM_ERROR$1;const O=I.state;return(O.wrap&2)===0?Z_STREAM_ERROR$1:(O.head=Z,Z.done=!1,Z_OK$1)},inflateSetDictionary=(I,Z)=>{const O=Z.length;let D,a,k;return inflateStateCheck(I)||(D=I.state,D.wrap!==0&&D.mode!==DICT)?Z_STREAM_ERROR$1:D.mode===DICT&&(a=1,a=adler32_1(a,Z,O,0),a!==D.check)?Z_DATA_ERROR$1:(k=updatewindow(I,Z,O,O),k?(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(I){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},I||{});const Z=this.options;Z.raw&&Z.windowBits>=0&&Z.windowBits<16&&(Z.windowBits=-Z.windowBits,Z.windowBits===0&&(Z.windowBits=-15)),Z.windowBits>=0&&Z.windowBits<16&&!(I&&I.windowBits)&&(Z.windowBits+=32),Z.windowBits>15&&Z.windowBits<48&&(Z.windowBits&15)===0&&(Z.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let O=inflate_1$2.inflateInit2(this.strm,Z.windowBits);if(O!==Z_OK)throw new Error(messages[O]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),Z.dictionary&&(typeof Z.dictionary=="string"?Z.dictionary=strings.string2buf(Z.dictionary):toString.call(Z.dictionary)==="[object ArrayBuffer]"&&(Z.dictionary=new Uint8Array(Z.dictionary)),Z.raw&&(O=inflate_1$2.inflateSetDictionary(this.strm,Z.dictionary),O!==Z_OK)))throw new Error(messages[O])}Inflate$1.prototype.push=function(I,Z){const O=this.strm,D=this.options.chunkSize,a=this.options.dictionary;let k,e,o;if(this.ended)return!1;for(Z===~~Z?e=Z:e=Z===!0?Z_FINISH:Z_NO_FLUSH,toString.call(I)==="[object ArrayBuffer]"?O.input=new Uint8Array(I):O.input=I,O.next_in=0,O.avail_in=O.input.length;;){for(O.avail_out===0&&(O.output=new Uint8Array(D),O.next_out=0,O.avail_out=D),k=inflate_1$2.inflate(O,e),k===Z_NEED_DICT&&a&&(k=inflate_1$2.inflateSetDictionary(O,a),k===Z_OK?k=inflate_1$2.inflate(O,e):k===Z_DATA_ERROR&&(k=Z_NEED_DICT));O.avail_in>0&&k===Z_STREAM_END&&O.state.wrap>0&&I[O.next_in]!==0;)inflate_1$2.inflateReset(O),k=inflate_1$2.inflate(O,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(o=O.avail_out,O.next_out&&(O.avail_out===0||k===Z_STREAM_END))if(this.options.to==="string"){let N=strings.utf8border(O.output,O.next_out),q=O.next_out-N,F=strings.buf2string(O.output,N);O.next_out=q,O.avail_out=D-q,q&&O.output.set(O.output.subarray(N,N+q),0),this.onData(F)}else this.onData(O.output.length===O.next_out?O.output:O.output.subarray(0,O.next_out));if(!(k===Z_OK&&o===0)){if(k===Z_STREAM_END)return k=inflate_1$2.inflateEnd(this.strm),this.onEnd(k),this.ended=!0,!0;if(O.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(I){this.chunks.push(I)},Inflate$1.prototype.onEnd=function(I){I===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=I,this.msg=this.strm.msg};function inflate$1(I,Z){const O=new Inflate$1(Z);if(O.push(I),O.err)throw O.msg||messages[O.err];return O.result}function inflateRaw$1(I,Z){return Z=Z||{},Z.raw=!0,inflate$1(I,Z)}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=["updateSeverTime"];noLogEvents.push("heartbeat"),noLogEvents.push("heartbeatEx"),noLogEvents.push("networkQualityChange"),noLogEvents.push("onNetQuality"),noLogEvents.push("updateCall"),noLogEvents.push("pubNotify");const compressArrayBuffer=I=>{const Z=new Uint8Array(I),O=pako.deflate(Z,{gzip:!0});return new Uint8Array(O==null?void 0:O.buffer)},decompressArrayBuffer=I=>{const Z=new Uint8Array(I),O=pako.inflate(Z,{gzip:!0});return new Uint8Array(O==null?void 0:O.buffer)},sendMessageFormat=I=>{const{event:Z}=I;switch(I.data_original=I.data,I.time&&(I.timeStr=E$1(I.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),Z){case"login":I.data=com.quick.voice.proto.Login.encode(I.data).finish();break;case"joinRoom":case"joinRoomEx":I.data=com.quick.voice.proto.JoinReq.encode(I.data).finish();break;case"quitRoom":I.data=com.quick.voice.proto.QuitReq.encode(I.data).finish();break;case"connectCF":I.data=com.quick.voice.proto.ConnectCFReq.encode(I.data).finish(),I.data=compressArrayBuffer(I.data),I.compress=!0;break;case"publish":I.data=com.quick.voice.proto.PublishReq.encode(I.data).finish(),I.data=compressArrayBuffer(I.data),I.compress=!0;break;case"subscribe":I.data=com.quick.voice.proto.SubscribeReq.encode(I.data).finish();break;case"closeTrack":I.data=com.quick.voice.proto.CloseTrackReq.encode(I.data).finish(),I.data=compressArrayBuffer(I.data),I.compress=!0;break;case"renegotiate":I.data=com.quick.voice.proto.RenegotiateReq.encode(I.data).finish(),I.data=compressArrayBuffer(I.data),I.compress=!0;break;case"syncRoomInfo":I.data=com.quick.voice.proto.SyncRoomInfoReq.encode(I.data).finish();break;case"updateCall":I.data=com.quick.voice.proto.UpdateCall.encode(I.data).finish();break;case"networkQualityChange":I.data=com.quick.voice.proto.NetQualityChange.encode(I.data).finish();break;case"pubNotify":I.data=com.quick.voice.proto.PublishNotify.encode(I.data).finish();break;default:I.data=new Uint8Array;break}return I},onMessageFormat=I=>{const{event:Z,compress:O=!1}=I;if(I.data_remote=I.data,I.time&&(I.timeStr=E$1(I.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),O)try{I.data=decompressArrayBuffer(I.data)}catch(D){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",D)}switch(Z){case"login":I.data=com.quick.voice.proto.Login.decode(I.data);break;case"joinRoom":case"joinRoomEx":I.data=com.quick.voice.proto.JoinRsp.decode(I.data);break;case"onJoinRoom":I.data=com.quick.voice.proto.JoinNotify.decode(I.data);break;case"onQuitRoom":I.data=com.quick.voice.proto.QuitNotify.decode(I.data);break;case"connectCF":I.data=com.quick.voice.proto.ConnectCFRsp.decode(I.data);break;case"publish":I.data=com.quick.voice.proto.PublishRsp.decode(I.data);break;case"onPublish":I.data=com.quick.voice.proto.PublishNotify.decode(I.data);break;case"subscribe":I.data=com.quick.voice.proto.SubscribeRsp.decode(I.data);break;case"closeTrack":I.data=com.quick.voice.proto.CloseTrackRsp.decode(I.data);break;case"onCloseTrack":I.data=com.quick.voice.proto.CloseTrackNotify.decode(I.data);break;case"onUpdateCall":I.data=com.quick.voice.proto.UpdateCall.decode(I.data);break;case"onDestroyRoom":I.data=com.quick.voice.proto.QuitNotify.decode(I.data);break;case"onUpdatePermissions":I.data=com.quick.voice.proto.UpdatePermissions.decode(I.data);break;case"onNetQuality":I.data=com.quick.voice.proto.NetQualityNotify.decode(I.data);break;case"syncRoomInfo":I.data=com.quick.voice.proto.SyncRoomInfoRsp.decode(I.data);break;case"onCDNPlayUrlAdd":I.data=com.quick.voice.proto.CDNPlayAddressNotify.decode(I.data);break;case"debugger":I.data=JSON.parse(new TextDecoder().decode(I.data));break}return I};class CallsWebSocket{constructor(Z){bt(this,kt);bt(this,yt,{url:"wss://demo.putplay.cc/websocket",debug:!1,reconnectCount:10,timeout:20*1e3});bt(this,vt,"");bt(this,wt,{});bt(this,gt,{});Y(this,"state","closed");Y(this,"sendMessageBefore",async()=>{});Y(this,"onReconnectSuccess",Z=>{});Y(this,"onReconnectStop",Z=>{});bt(this,Bt,Z=>{let O=!0;const{code:D=1e3}=Z;return D===1e3&&(O=!1),O});bt(this,jt,async Z=>{et(this,yt).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连成功",Z),this.state="connected",this.onReconnectSuccess(Z)});bt(this,Zt,async Z=>{et(this,yt).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连停止",Z),this.close(),this.state="closed",this.onReconnectStop(Z)});bt(this,Pt,(Z,O={})=>{try{const{time:D,event:a,data:k={},data_original:e={},data_remote:o,...N}=O,q=E$1(D,"YYYY-MM-DD hh:mm:ss",{offset:480});let F={};const J=(rt={})=>{const ot=JSON.parse(JSON.stringify(rt)),ct=Object.keys(ot);for(const _t of ct)(_t.includes("sdp")||_t.includes("Sdp"))&&(ot[_t]="");return ot};let z="res ↓";switch(Z){case"res":z="res ↓",F=J(k);break;case"req":z="req ↑",F=J(e);break}let G="#quickvo.logs";ignoreEvent.includes(a)&&(G="#quickvo.ignoreEvents");const K={"#action":z,timeStr:q,event:a,data:F,time:D,...N},it=localStorage.getItem(G)||JSON.stringify([]),tt=JSON.parse(it);let X=a==="heartbeat";const nt=[K];for(const rt of tt){const{event:ot}=rt;if(ot==="heartbeat"){if(X)continue;X=!0}if(nt.length===200)break;nt.push(rt)}localStorage.setItem(G,JSON.stringify(nt))}catch(D){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",D)}});bt(this,Ft,(Z,{resolve:O,reject:D})=>{const{sn:a}=Z,k=()=>{const o=et(this,wt)[a];clearTimeout(o.destructionTimer),delete et(this,wt)[a]},e=setTimeout(()=>{const o=et(this,wt)[a];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:event is timeout",o.message),k(),D("event is timeout")},et(this,yt).timeout);et(this,wt)[a]={message:Z,resolve:O,reject:D,destruction:k,destructionTimer:e}});bt(this,Ht,Z=>et(this,wt)[Z]);bt(this,zt,async Z=>{const O=new Uint8Array(Z),D=com.quick.voice.proto.CommonRsp.decode(O),{sn:a,event:k}=D,e=onMessageFormat(D);if(et(this,yt).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)||et(this,Pt).call(this,"res",e)),notifyName_keys.includes(k))return this.emitNotify(k,P(e,["code","data","desc"]));const N=et(this,Ht).call(this,a);if(N){const{resolve:q=J=>{},destruction:F=()=>{}}=N;q(P(e,["code","data","desc"])),F()}});Y(this,"clearEvents",(Z=[])=>{const O=Object.keys(et(this,wt));Z.length===0&&(Z=O);for(const D of O){if(!Z.includes(D))continue;const a=et(this,wt)[D];if(a){const{destruction:k}=a;k()}}});Y(this,"connect",async(Z="")=>new Promise(async O=>{Z&&It(this,vt,Z),et(this,kt)&&(await et(this,kt).close(),this.state="closed");const D=`${et(this,yt).url}?s=${et(this,vt)}&t=${Date.now()}`;It(this,kt,new M$1({...et(this,yt),debug:!1,url:D,binaryType:"arraybuffer",onMessage:et(this,zt),checkReconnect:et(this,Bt),getHeartbeatMsg:()=>"",onReconnectSuccess:et(this,jt),onReconnectStop:et(this,Zt)})),this.state="connecting",await et(this,kt).connect(),this.state="connected",et(this,yt).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 当前广播事件",et(this,gt)),O(et(this,kt))}));Y(this,"close",async()=>{var O;et(this,yt).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.");const Z=Object.keys(et(this,wt));for(const D of Z){const{destructionTimer:a}=et(this,wt)[D];clearTimeout(a)}It(this,wt,{}),await((O=et(this,kt))==null?void 0:O.close()),It(this,kt,void 0),this.state="closed"});Y(this,"sendMessage",(Z,O=!0)=>new Promise(async(D,a)=>{var F;await this.sendMessageBefore();const{event:k,...e}=Z,o=Date.now(),N=sendMessageFormat({event:k,sn:+`${o}${v$1(1e3,9999)}`,time:o,valid:et(this,yt).timeout,version:1,compress:!1,...e});et(this,yt).debug&&(noLogEvents.includes(k)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",N),ignoreEvent.includes(k)||et(this,Pt).call(this,"req",N)),O&&et(this,Ft).call(this,N,{resolve:D,reject:a});const q=com.quick.voice.proto.CommonReq.encode(N).finish();(F=et(this,kt))==null||F.sendMessage(q)}));Y(this,"emitNotify",async(Z,O)=>{const D=et(this,gt)[Z]||[];for(const a of D){const{callback:k=async()=>{}}=a;await k(O)}});Y(this,"addNotify",(Z,O=!1)=>{const{event:D,sn:a=xt(32)}=Z;et(this,gt)[D]||(et(this,gt)[D]=[]);const k=et(this,gt)[D],e=k.findIndex(o=>o.sn===a);return e!==-1&&k.splice(e,1),O?k.unshift(Z):k.push(Z),a});Y(this,"removeNotify",(Z=[])=>{if(Z.length===0)It(this,gt,{});else{const O=Object.keys(et(this,gt));for(const D of O)et(this,gt)[D]=et(this,gt)[D].filter(a=>!Z.includes(a.sn||""))}et(this,yt).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",et(this,gt))});It(this,yt,{...et(this,yt),...Z})}}kt=new WeakMap,yt=new WeakMap,vt=new WeakMap,wt=new WeakMap,gt=new WeakMap,Bt=new WeakMap,jt=new WeakMap,Zt=new WeakMap,Pt=new WeakMap,Ft=new WeakMap,Ht=new WeakMap,zt=new WeakMap;const createMutedAudioStream=I=>{const Z=I.createOscillator();Z.type="sine",Z.frequency.setValueAtTime(0,I.currentTime);const O=I.createGain();O.gain.value=0,Z.connect(O),O.connect(I.destination),Z.start();const D=I.createMediaStreamDestination();return O.disconnect(),Z.connect(D),D.stream},createFakeVideoStream=(I=10,Z=10,O=30)=>{const D=document.createElement("canvas"),a=D.getContext("2d");D.width=I,D.height=Z;let k=0;return setInterval(()=>{a.clearRect(0,0,D.width,D.height);const N=a.createLinearGradient(0,0,D.width,D.height);N.addColorStop(0,`hsla(${k}, 100%, 50%, 0)`),N.addColorStop(1,`hsla(${k+120}, 100%, 50%, 0)`),a.fillStyle=N,a.fillRect(0,0,D.width,D.height),k=(k+1)%360},100),D.captureStream(O)};var E=Object.defineProperty,$=I=>{throw TypeError(I)},j=(I,Z,O)=>Z in I?E(I,Z,{enumerable:!0,configurable:!0,writable:!0,value:O}):I[Z]=O,u=(I,Z,O)=>j(I,typeof Z!="symbol"?Z+"":Z,O),B=(I,Z,O)=>Z.has(I)||$("Cannot "+O),c=(I,Z,O)=>(B(I,Z,"read from private field"),O?O.call(I):Z.get(I)),d=(I,Z,O)=>Z.has(I)?$("Cannot add the same private member more than once"):Z instanceof WeakSet?Z.add(I):Z.set(I,O),m=(I,Z,O,D)=>(B(I,Z,"write to private field"),Z.set(I,O),O),M=(I,Z,O,D)=>({set _(a){m(I,Z,a)},get _(){return c(I,Z,D)}}),l,r,n,g;class Q{constructor(Z,O={}){d(this,l,{debug:!1}),d(this,r,new Map),d(this,n,new Map),d(this,g,0),u(this,"setCondition",async(D,a)=>{if(!c(this,r).has(D))throw new Error("You have set an incorrect condition. If this is necessary, you need to define it first during instantiation.");const k=c(this,r).get(D);c(this,r).set(D,a),k===!1&&a&&await this.executeTasks()}),u(this,"createTask",async D=>{const a={describe:"",strict:!1,timeout:0,success:async rt=>{},fail:async rt=>{},complete:async()=>{},...D},{describe:k,strict:e,timeout:o,conditionKeys:N,func:q,success:F,fail:J,complete:z}=a,G=`${M(this,g)._++}`,K=()=>{let rt=!0;for(const ot of N)if(!c(this,r).get(ot)){rt=!1;break}return rt};let it=0;const tt=()=>{c(this,l).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->pr-task-queue: task ${k} (${G}) delete`),c(this,n).delete(G)},X=async()=>{if(!c(this,n).get(G)||nt.runing)return;nt.runing=!0,c(this,l).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->pr-task-queue: task ${k} (${G}) run`);const rt=nt.func(),ot=new Promise((ct,_t)=>{o&&(it=setTimeout(()=>{_t(`task: ${G} (${k}) is timeout.`)},o))});return Promise.race([rt,ot]).finally(()=>{nt.strict===!1&&nt.clear(),clearTimeout(it),nt.runing=!1,z()}).then(ct=>{F(ct)}).catch(ct=>{J(ct)})},nt={key:G,describe:k,strict:e,conditionKeys:N,runing:!1,func:q,checkAccord:K,success:F,fail:J,complete:z,run:X,retry:()=>(nt.runing=!1,X()),clear:tt};return c(this,n).set(G,nt),nt.checkAccord()&&setTimeout(()=>nt.run(),0),nt}),u(this,"executeTasks",async()=>{const D=[...c(this,n).values()];for(const a of D)a.checkAccord()&&a.run()}),u(this,"clear",(D=[])=>{if(D.length===0){m(this,n,new Map);return}for(const a of D)c(this,n).delete(a)}),u(this,"getConditions",()=>Object.fromEntries(c(this,r))),u(this,"getTasks",()=>c(this,n));for(const D of Z)c(this,r).set(D,!0);m(this,l,{debug:!1,...O})}}l=new WeakMap,r=new WeakMap,n=new WeakMap,g=new WeakMap;class RoomBase{constructor(Z){Y(this,"options",{appid:"",sdkToken:"",roomId:"",userId:"",earlyId:"",callType:0,debug:!1,reportErr:!1,logUrl:"https://logs.putplay.cc",newPublishAutoSubscribe:!0});Y(this,"sdk_service_version","1.0.6");Y(this,"prohibitNotify",!1);Y(this,"isEarly",!1);Y(this,"isInRoom",!1);Y(this,"taskQueue",new Q(["createWs","createSession","ice","joinRoom","createTrack","publish","subscribe","renegotiate","closeTrack"],{debug:!1}));Y(this,"roomState","ready");Y(this,"createAt",Date.now());Y(this,"cwsIns");Y(this,"peerIns");Y(this,"transceiverMap",new Map);Y(this,"userMap",new Map);Y(this,"setLocalStreamActiveMap",new Map);Y(this,"phoneyStreams",new Map);Y(this,"mediaDevicesErrInfo",{microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""});Y(this,"reportLogs",(Z,O="未知错误")=>{const{appid:D,userId:a,earlyId:k="",logUrl:e,reportErr:o}=this.options;if(!o)return;const N="web",q=F=>({ws_c_timeout:0,webrtc_c_timeout:1,join_room_error:2,publish_error:3,subscribe_error:4,close_track_error:5,heartbeat_e_timeout:6,heartbeat_i_timeout:7,quit_room_error:8})[F].toString();{const F=q(Z),J={origin:N,type:F,app_id:D,user_id:a,ins_id:k,desc:O},z=btoa(encodeURI(JSON.stringify(J))),G=`${e}/upload/log?log_key=${z}`;{const K=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),tt=new TextEncoder().encode(K),X=pako.deflate(tt,{gzip:!0});this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLogs",{obj:J,url:G,size:lt(X.byteLength)}),fetch(G,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:X})}}});Y(this,"initPhoneyStreams",Z=>{for(const O of mediaType_keys){const D=this.phoneyStreams.get(O);if(D){const a=D.getTracks();for(const k of a)k.stop()}switch(O){case"microphoneCamera_audio":this.phoneyStreams.set("microphoneCamera_audio",createMutedAudioStream(Z));break;case"microphoneCamera_video":this.phoneyStreams.set("microphoneCamera_video",createFakeVideoStream());break;case"screenSharing_audio":this.phoneyStreams.set("screenSharing_audio",createMutedAudioStream(Z));break;case"screenSharing_video":this.phoneyStreams.set("screenSharing_video",createFakeVideoStream());break}}});Y(this,"getPhoneyStreams",Z=>this.phoneyStreams.get(Z));bt(this,Jt,()=>{this.taskQueue.setCondition("createSession",!1),this.taskQueue.setCondition("ice",!1)});Y(this,"getRoomInfo",()=>{const{options:Z,roomState:O,createAt:D}=this;return{...Z,roomState:O,createAt:D}});Y(this,"setRoomState",Z=>{this.roomState=Z;const O=enum_roomState[Z],D={state:Z,stateStr:O};this.cwsIns.emitNotify("onRoomState",{code:200,data:D,desc:"room state is change."})});Y(this,"setOptions",async Z=>{const O={...this.options,...Z};this.options=O});Y(this,"stopStream",async Z=>{const O=Z.getTracks();for(const D of O)D.stop()});Y(this,"getMediaDevicesErrInfo",async()=>{try{const Z=await navigator.mediaDevices.enumerateDevices();Z.find(D=>D.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),Z.find(D=>D.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(Z){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getMediaDevicesErrInfo is error.",Z)}return this.mediaDevicesErrInfo});Y(this,"getUserMediaKey",(Z,O)=>`${Z}-${O}`);Y(this,"getCallActionMap",(Z=0)=>{const D=Number(Z).toString(2).padStart(4,"0").split(""),[a,k,e,o]=D;return{microphoneCamera_audio:!!Number(o),microphoneCamera_video:!!Number(e),screenSharing_video:!!Number(k),screenSharing_audio:!!Number(a)}});Y(this,"getAverageVolume",(Z,O)=>{Z.getByteFrequencyData(O);let D=0;for(let k=0;k<O.length;k++)D+=O[k];return Math.ceil(D/O.length)});Y(this,"getCallAction",async Z=>{let O="";const D=k=>Z.findIndex(({type:o,enabled:N=!0})=>o===k&&N)===-1?"0":"1";return O=`${D(0)}${O}`,O=`${D(1)}${O}`,O=`${D(2)}${O}`,O=`${D(3)}${O}`,parseInt(O,2)});Y(this,"getTrackNamesFormTracks",(Z,O=[],D="trackName")=>{const a=[];for(const k of Z){const{type:e}=k;if(O.length===0||O.includes(e)){const o=k[D];o&&a.push(`${o}`)}}return a});Y(this,"usersFilter",Z=>dt(Z,["id","isSelf","joinTime","tracks","callAction","callActionStr","callActionMap","network","permissions","isPublished","updateStreams"]).sort((a,k)=>a.id.localeCompare(k.id,"en")));this.setOptions(Z),this.cwsIns=new CallsWebSocket({...Z}),et(this,Jt).call(this)}}Jt=new WeakMap;class RoomMedias extends RoomBase{constructor(O){super(O);bt(this,At,[]);bt(this,Ot,new Map);bt(this,St,new Map);bt(this,Tt,new Map);bt(this,Et,new Map);Y(this,"localStreamsActionMap",new Map);bt(this,Nt,new(window.AudioContext||window.webkitAudioContext));Y(this,"resume",()=>{et(this,Nt).resume()});bt(this,Wt,()=>{et(this,St).set("microphoneCamera_audio",{autoGainControl:!1,echoCancellation:!1,noiseSuppression:!1}),et(this,St).set("microphoneCamera_video",{frameRate:{min:10,ideal:30}}),et(this,St).set("screenSharing_video",{frameRate:{min:10,ideal:30}}),et(this,St).set("screenSharing_audio",{autoGainControl:!1,echoCancellation:!1,noiseSuppression:!1})});bt(this,Gt,()=>{et(this,Ot).set("audioinput","default"),et(this,Ot).set("videoinput","default"),et(this,Ot).set("audiooutput","default")});Y(this,"emitNotifyUpdateUsersStreams",async O=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:O,desc:"users streams is change."})});Y(this,"initUserMediaStreamContext",async(O,D,a)=>{var N;const[k]=a.getTracks();if(!k){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: tracks.length is 0.",{userId:O,mediaType:D,stream:a});return}this.removeUserMediaStreamContext(O,D);const e=this.getUserMediaKey(O,D),{kind:o}=k;switch(o){case"audio":{const q=new AudioMediaContext(k,et(this,Nt));et(this,Tt).set(e,q)}break;case"video":{const q=new VideoMediaContext(k);et(this,Tt).set(e,q)}break}{const q=this.getUserMediaStreamContext(O,D);if(q&&q.kind==="audio")try{const F=et(this,Ot).get("audiooutput");(N=q.audioContext)==null||N.setSinkId(F)}catch(F){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error",F)}}});Y(this,"getUserMediaStreamContext",(O,D)=>{const a=this.getUserMediaKey(O,D);return et(this,Tt).get(a)});Y(this,"getUserAudioMediaStreamContext",(O,D)=>{const a=this.getUserMediaKey(O,D);return et(this,Tt).get(a)});Y(this,"removeUserMediaStreamContext",(O,D)=>{const a=this.getUserMediaKey(O,D),k=et(this,Tt).get(a);k==null||k.stop(),et(this,Tt).delete(a)});Y(this,"getUserStream",(O,D)=>{const a=this.getUserMediaStreamContext(O,D);return(a==null?void 0:a.getStream())||new MediaStream});Y(this,"getUserStreams",(O,D=[])=>{D.length===0&&(D=mediaType_keys);const a={};for(const k of D){const e=this.getUserStream(O,k);a[k]=e}return a});Y(this,"removeUserStreams",async(O,D=[])=>{D.length===0&&(D=mediaType_keys);for(const a of D)this.removeUserMediaStreamContext(O,a)});Y(this,"clearUserStreams",()=>{const O=et(this,Tt).values();for(const D of O)D.stop();It(this,Tt,new Map)});Y(this,"setMediaTrackConstraints",async(O,D)=>{et(this,St).set(O,D);const k=this.getUserStream(this.options.userId,O).getTracks();if(k.length!==0)for(const e of k){const N={echoCancellation:!1,noiseSuppression:!1,autoGainControl:!1,...e.getConstraints(),...D};await e.applyConstraints(N)}});Y(this,"stopLocalStreams",async(O=[])=>{O.length===0&&(O=mediaType_keys);for(const D of O){const a=et(this,Et).get(D);a&&await this.stopStream(a),et(this,Et).delete(D)}});Y(this,"addLocalStream",(O,D)=>{const a=et(this,Et).get(O);a&&this.stopStream(a),et(this,Et).set(O,D)});Y(this,"initLocalStream",async O=>{switch(O){case"microphoneCamera_audio":{const D=et(this,Ot).get("audioinput"),a=et(this,St).get("microphoneCamera_audio"),k=await navigator.mediaDevices.getUserMedia({audio:{deviceId:D,...a},video:!1});this.addLocalStream("microphoneCamera_audio",k)}break;case"microphoneCamera_video":{const D=et(this,Ot).get("videoinput"),a=et(this,St).get("microphoneCamera_video"),k=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:D,...a}});this.addLocalStream("microphoneCamera_video",k)}break;case"microphoneCamera":{const D=et(this,Ot).get("audioinput"),a=et(this,Ot).get("videoinput"),k=et(this,St).get("microphoneCamera_audio"),e=et(this,St).get("microphoneCamera_video"),N=(await navigator.mediaDevices.getUserMedia({audio:{deviceId:D,...k},video:{deviceId:a,...e}})).getTracks();for(const q of N){const{kind:F}=q;if(F==="audio"){const J=new MediaStream;J.addTrack(q),this.addLocalStream("microphoneCamera_audio",J)}if(F==="video"){const J=new MediaStream;J.addTrack(q),this.addLocalStream("microphoneCamera_video",J)}}}break;case"screenSharing_audio":{const D=et(this,St).get("screenSharing_audio"),k=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...D})).getTracks();for(const e of k){const{kind:o}=e;if(o==="audio"){const N=new MediaStream;N.addTrack(e),this.addLocalStream("screenSharing_audio",N)}}}break;case"screenSharing_video":{const D=et(this,St).get(O),k=(await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...D})).getTracks();for(const e of k){const{kind:o}=e;if(o==="video"){const N=new MediaStream;N.addTrack(e),this.addLocalStream("screenSharing_video",N)}}}break;case"screenSharing":{const D=et(this,St).get("screenSharing_audio"),a=et(this,St).get("screenSharing_video"),e=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...D,...a})).getTracks();for(const o of e){const{kind:N}=o;if(N==="audio"){const q=new MediaStream;q.addTrack(o),this.addLocalStream("screenSharing_audio",q)}if(N==="video"){const q=new MediaStream;q.addTrack(o),this.addLocalStream("screenSharing_video",q)}}}break}});Y(this,"getLocalStream",O=>et(this,Et).get(O));Y(this,"getLocalStreams",(O=[])=>{O.length===0&&(O=mediaType_keys);const D={};for(const a of O)D[a]=this.getLocalStream(a);return D});bt(this,Ct,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(O=>{It(this,At,O.sort((D,a)=>D.label.localeCompare(a.label,"zh-Hans-CN",{sensitivity:"accent"})))}).catch(function(O){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",O)}),et(this,At)));bt(this,Kt,()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await et(this,Ct).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),et(this,Ct).call(this)});Y(this,"getMediaDeviceKind",O=>et(this,Ot).get(O));Y(this,"changeAudiooutput",()=>{const O=et(this,Ot).get("audiooutput"),D=et(this,Tt).values();for(const a of D)if(a.kind==="audio"&&"setSinkId"in HTMLMediaElement.prototype)try{a.audioContext.setSinkId(O)}catch(k){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",k)}});Y(this,"setDeviceKind",(O,D)=>{et(this,Ot).set(O,D)});Y(this,"setAudioOutputDevice",O=>this.setDeviceKind("audiooutput",O));Y(this,"getEnumerateDevices",async O=>(await et(this,Ct).call(this),et(this,At).filter(a=>a.kind===O)));Y(this,"getEnumerateAudioinputDevices",()=>this.getEnumerateDevices("audioinput"));Y(this,"getEnumerateAudioOutputDevices",()=>this.getEnumerateDevices("audiooutput"));Y(this,"getEnumerateVideoinputDevices",()=>this.getEnumerateDevices("videoinput"));et(this,Kt).call(this),et(this,Gt).call(this),et(this,Wt).call(this),this.initPhoneyStreams(et(this,Nt)),document.addEventListener("click",()=>{var D;((D=et(this,Nt))==null?void 0:D.state)==="suspended"&&et(this,Nt).resume()})}}At=new WeakMap,Ot=new WeakMap,St=new WeakMap,Tt=new WeakMap,Et=new WeakMap,Nt=new WeakMap,Wt=new WeakMap,Gt=new WeakMap,Ct=new WeakMap,Kt=new WeakMap;class RoomUsers extends RoomMedias{constructor(O){super(O);Y(this,"getMaxVolumeUser",()=>{const O=Array.from(this.userMap.values(),({id:a})=>a);if(O.length===0)return;let D=[];for(const a of O){const k=this.getUserMediaStreamContext(a,"microphoneCamera_audio");if(!k||k.kind!=="audio")continue;const e=k.getVolume();D.push({id:a,volume:e})}return D=D.sort((a,k)=>a.volume-k.volume>0?-1:1),D[0]});Y(this,"setAudioFilter",async(O={})=>{const D=await this.getUsersId();for(const a of D){{const k=this.getUserMediaStreamContext(a,"microphoneCamera_audio");(k==null?void 0:k.kind)==="audio"&&(k==null||k.setFilter(O))}{const k=this.getUserMediaStreamContext(a,"screenSharing_audio");(k==null?void 0:k.kind)==="audio"&&(k==null||k.setFilter(O))}}});Y(this,"setEnhanceGain",async(O,D,a)=>{const k=this.getUserMediaStreamContext(O,D);(k==null?void 0:k.kind)==="audio"&&(k==null||k.setEnhanceGain(a))});Y(this,"setVolume",(O,D,a)=>{const k=this.getUserMediaStreamContext(O,D);(k==null?void 0:k.kind)==="audio"&&(k==null||k.setVolumeGain(a))});Y(this,"getVolume",(O,D)=>{const a=this.getUserMediaStreamContext(O,D);let k=0;return(a==null?void 0:a.kind)==="audio"&&(k=a==null?void 0:a.getVolume()),k});Y(this,"clearUsers",()=>{this.userMap=new Map});Y(this,"removeUsers",async O=>{for(const D of O)this.userMap.delete(D),await this.removeUserStreams(D)});Y(this,"createUser",async O=>{const D=Date.now(),a={id:O,permissions:0,callAction:0,callActionStr:"",callActionMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},callState:0,isSelf:O===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(O,a)});Y(this,"getUser",async O=>(this.userMap.has(O)||await this.createUser(O),this.userMap.get(O)));Y(this,"getUsers",async(O=[])=>{O.length===0&&(O=[...this.userMap.keys()]);const D=[];for(const a of O){const k=await this.getUser(a);D.push(k)}return D});Y(this,"getAllUserTrackMids",async()=>{const O=await this.getUsers(),D=[];for(const a of O){const{tracks:k=[]}=a;for(const e of k)D.push(e.mid)}return D});Y(this,"getUserTrackByTrackName",async O=>{const D=await this.getUsers(),a=[];for(const k of D){const{tracks:e=[]}=k;for(const o of e){const{trackName:N}=o;O.includes(N)&&a.push(o)}}return a});Y(this,"getUserTrackFromMid",async O=>{const D=await this.getUsers();let a;for(const k of D){const{tracks:e=[]}=k;for(const o of e)if(o.mid===O){a=o;break}}return a});Y(this,"checkUserInRoom",O=>this.userMap.has(O));Y(this,"getUsersId",async()=>[...this.userMap.keys()]);Y(this,"getCaller",async()=>await this.getUser(this.options.userId));Y(this,"updateIsPublished",async(O,D=!1)=>{const a=await this.getUser(O);a.isPublished=D});Y(this,"setUserUpdateStreams",async(O,D,a=!0)=>{const k=await this.getUser(O),e={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};e[D]=a,k.updateStreams=e});Y(this,"updateUsertracks",async(O,D=[],a)=>{const k=await this.getUser(O);a&&(D=[...k.tracks,...D]),D=D.filter(({mid:N=""})=>N!==""),D=pt(D,["type"]),D=D.sort((N,q)=>N.type-q.type<0?-1:1);for(const N of D)N.userId=O,N.mediaType=mediaType_keys[N.type],N.enabled===void 0&&(N.enabled=!0);k.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const e=dt(k.tracks,["mediaType","enabled","mid","msid","trackName"]),o=dt(D,["mediaType","enabled","mid","msid","trackName"]);{const N="microphoneCamera_audio",q=o.find(z=>z.mediaType===N),F=e.find(z=>z.mediaType===N),J=JSON.stringify(q)!==JSON.stringify(F);k.updateStreams[N]=J}{const N="microphoneCamera_video",q=o.find(z=>z.mediaType===N),F=e.find(z=>z.mediaType===N),J=JSON.stringify(q)!==JSON.stringify(F);k.updateStreams[N]=J}{const N="screenSharing_audio",q=o.find(z=>z.mediaType===N),F=e.find(z=>z.mediaType===N),J=JSON.stringify(q)!==JSON.stringify(F);k.updateStreams[N]=J}{const N="screenSharing_video",q=o.find(z=>z.mediaType===N),F=e.find(z=>z.mediaType===N),J=JSON.stringify(q)!==JSON.stringify(F);k.updateStreams[N]=J}k.tracks=D});Y(this,"updateUserCallAction",async(O,D=0)=>{const a=await this.getUser(O);a.callAction=D,a.callActionStr=D.toString(2).padStart(4,"0"),a.callActionMap=this.getCallActionMap(D)});Y(this,"updateUserNetwork",async(O,D={egress:5,ingress:5})=>{const a=await this.getUser(O);a.network=D});Y(this,"updateUserPermissions",async(O,D)=>{if(D){const a=await this.getUser(O);a.permissions=D}});Y(this,"updateUserBase",async O=>{const D=await this.getUser(O);D.isSelf=O===this.options.userId,D.updateAt=Date.now()});Y(this,"updateUsers",async O=>{for(const D of O){const{id:a,tracks:k,callAction:e,permissions:o,isPublished:N}=D;await this.updateUserBase(a),await this.updateIsPublished(a,N),await this.updateUserPermissions(a,o),await this.updateUsertracks(a,k,!0),await this.updateUserCallAction(a,e),await this.updateUserNetwork(a)}});Y(this,"emitNotifyUpdateUser",async O=>{const D=await this.getUsers([O]),[a]=this.usersFilter(D);this.cwsIns.emitNotify("onRoomUser",{code:200,data:a,desc:"user info is change."})});Y(this,"emitNotifyUpdateUsers",async()=>{const O=await this.getUsers(),D=this.usersFilter(O);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:D,desc:"all users info is change."})})}}class RoomPeer extends RoomUsers{constructor(O){super(O);Y(this,"getPeerStatsTimer",0);Y(this,"reports",[]);Y(this,"peerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});Y(this,"initPeer",()=>{var O;(O=this.peerIns)==null||O.close(),this.peerIns=new RTCPeerConnection({bundlePolicy:"max-bundle"}),et(this,Qt).call(this),this.transceiverMap=new Map,et(this,Yt).call(this)});Y(this,"replaceSenderStream",async(O=[],D)=>{const{userId:a}=this.options;O.length===0&&(O=mediaType_keys);for(const k of O){const e=this.transceiverMap.get(k);let o;if(e){const{sender:N}=e;D?o=this.getUserStream(a,k):o=this.getPhoneyStreams(k);const[q]=o.getTracks();q&&await N.replaceTrack(q)}}});Y(this,"getSenderTracks",async(O=[])=>{const D=[];for(const a of O){const k=this.transceiverMap.get(a);if(!k)continue;const{mid:e,sender:o}=k,{track:N}=o;if(!N)continue;const{id:q,enabled:F}=N,J=mediaType_keys.findIndex(G=>G===a),z={type:J,enabled:F,trackName:`web-${J}-${q}`,location:"local",mid:e};D.push(z)}return D});Y(this,"addSenders",async(O=[])=>{O.length===0&&(this.peerIns.addTransceiver("audio",{direction:"sendonly"}),this.peerIns.addTransceiver("video",{direction:"sendonly"}));const D=[];for(const a of O){if(this.transceiverMap.get(a))continue;const e=this.getPhoneyStreams(a),[o]=e.getTracks(),N=this.peerIns.addTransceiver(o,{direction:"sendonly"});this.transceiverMap.set(a,N),D.push(a)}if(O.length===0||D.length!==0){const a=await this.peerIns.createOffer();if(this.options.debug){const k=libExports.parse(a.sdp),e=dt(k.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:e,sdpJson:k,description:a})}await this.peerIns.setLocalDescription(a)}return D});Y(this,"removeSenders",async(O=[])=>{O.length===0&&(O=mediaType_keys);for(const D of O)this.transceiverMap.has(D)&&this.transceiverMap.delete(D)});Y(this,"onSubscribeUserTracks",O=>{let D=0;return new Promise(async a=>{const k=[];for(const e of O){const{tracks:o=[]}=e;for(const N of o){const{trackName:q,mid:F}=N,[J]=await this.getUserTrackByTrackName([q]);k.push({...J,mid:F})}}{let e=[];const o=async()=>{clearTimeout(D);const q=new Map;for(const J of e){const{userId:z,mediaType:G}=J;if(!z||!G)continue;q.has(z)||q.set(z,{userId:z,tracks:[],updateStreams:{}});const it=q.get(z);it.tracks.push(J),it.updateStreams[G]=!0}const F=[...q.values()];for(const J of F){const{userId:z,tracks:G}=J;await this.updateUsertracks(z,G,!0)}await this.emitNotifyUpdateUsersStreams(F),this.peerIns.removeEventListener("track",N);{const J=Array.from(k,K=>K.trackName),z=Array.from(e,K=>K.trackName),G=J.filter(K=>!z.includes(K));a({target:J,success:z,fail:G})}},N=async q=>{const{streams:F,transceiver:J}=q,[z]=F,{mid:G,receiver:K}=J,{track:it}=K,{id:tt,kind:X}=it,nt=k.find(ct=>ct.mid===`${G}`);if(!nt)return;const{userId:rt,mediaType:ot}=nt;if(!(!rt||!ot)){{const ct={...nt,mid:G,msid:tt};e.push(ct)}if(this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: await subscribe ${e.length}/${k.length}`,{mediaType:ot,mid:G,userTrack:nt,e:q}),await this.initUserMediaStreamContext(rt,ot,z),X==="audio"){const ct=this.getUserMediaStreamContext(rt,ot);(ct==null?void 0:ct.kind)==="audio"&&ct.setMute(!1)}k.length===e.length&&o()}};this.peerIns.addEventListener("track",N),D=setTimeout(()=>{this.reportLogs("subscribe_error",`incomplete subscription. (${e.length}/${k.length})`),o()},5*1e3)}})});bt(this,Qt,()=>{let O=0;const D=()=>{this.peerIns.close(),this.setRoomState("closed")};this.peerIns.onconnectionstatechange=async a=>{const k=a.target.connectionState;switch(await this.taskQueue.setCondition("ice",!1),clearTimeout(O),k){case"connected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${k}`),await this.taskQueue.setCondition("ice",!0);break;case"disconnected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${k}`),O=setTimeout(D,30*1e3);break;case"failed":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${k}`),this.setRoomState("failed");break;case"closed":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${k}`),D();break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${k}`);break}}});Y(this,"closeUserTracks",async(O,D=[],a=!1)=>{const k=[];for(const q of D){const{trackName:F,msid:J}=q;k.push(F),J&&k.push(J)}const e=q=>k.includes(q),o=this.peerIns.getTransceivers();for(const q of o){const{mid:F,sender:J,receiver:z}=q;J.track&&e(J.track.id)&&(q.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.sender: ${F} is stop.`,q)),z.track&&e(z.track.id)&&(q.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.receiver: ${F} is stop.`,q))}const N=await this.getUser(O);if(N){for(const q of N.tracks){const{trackName:F,msid:J,userId:z,mediaType:G}=q;!z||!G||!e(F)||(this.removeUserMediaStreamContext(z,G),J&&delete q.msid)}if(a){const q=N.tracks.filter(({trackName:F})=>!e(F));await this.updateUsertracks(O,q,!1)}}});Y(this,"createOffer",async()=>{const O=await this.peerIns.createOffer();if(this.options.debug){const D=libExports.parse(O.sdp),a=dt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:a,sdpJson:D,description:O})}await this.peerIns.setLocalDescription(O)});Y(this,"createAnswer",async()=>{const O=await this.peerIns.createAnswer();if(this.options.debug){const D=libExports.parse(O.sdp),a=dt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:a,sdpJson:D,description:O})}await this.peerIns.setLocalDescription(O)});Y(this,"getSdp",()=>{var O;return(O=this.peerIns.localDescription)==null?void 0:O.sdp});Y(this,"setRemoteDescription",async O=>{if(this.options.debug){const D=libExports.parse(O.sdp),a=dt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:a,sdpJson:D,description:O})}return await this.peerIns.setRemoteDescription(O),O});Y(this,"setCallStrategy",async(O,D=[])=>{D.length===0&&(D=mediaType_keys);let a="balanced";switch(O){case"qualityPriority":a="maintain-resolution";break;case"fluencyPriority":a="maintain-framerate";break;case"balancedDowngrade":a="balanced";break}const k=await this.getCaller(),e=Array.from(k.tracks,({trackName:N})=>N),o=this.peerIns.getSenders();for(const N of o){const{track:q}=N;if(!q||!e.includes(q.id))continue;const F=N.getParameters();N.setParameters({...F,degradationPreference:a})}});Y(this,"setRTCRtpSenderParameters",O=>{try{const D=this.peerIns.getSenders();for(const a of D){const k=a.getParameters();a.setParameters({...k,...O})}}catch(D){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",D)}});Y(this,"getReportsByMid",async(O=[])=>O.length===0?this.reports:this.reports.filter(D=>O.includes(D.mid)));Y(this,"getRoomNetwork",()=>this.peerNetwork);Y(this,"getPeerNetwork",()=>this.peerNetwork);bt(this,Vt,async()=>{try{const O=await this.peerIns.getStats(),D=["inbound-rtp","remote-inbound-rtp","outbound-rtp","transport"],k=[...O.values()].filter(ct=>D.includes(ct.type));let e=0,o=0,N=0,q=0,F=0,J=0,z=[],G=[];for(const ct of this.reports){const{packetsSent:_t,packetsLost:at}=ct;_t&&(N+=_t),at&&(q+=at)}this.reports=k;for(const ct of this.reports){const{bytesSent:_t,bytesReceived:at,packetsSent:mt,packetsLost:ft,roundTripTime:st,jitter:ut}=ct;_t&&(o=_t),at&&(e=at),mt&&(F+=mt),ft&&(J+=ft),st&&z.push((st*100).toFixed(2)),ut&&G.push(ut.toFixed(2))}G.sort().reverse(),z.sort().reverse();const K=F-N,it=J-q,tt=K===0?"0.00":(it/K).toFixed(2),[X="0"]=z,[nt="0"]=G,rt={outboundBytes:o,inboundBytes:e,lostRate:tt,roundTripTime:X,jitter:nt};this.peerNetwork=rt;const ot=(ct,_t,at)=>{const mt=Number(ct),ft=Number(_t),st=Number(at);let ut="0";return mt<.03&&ft<100&&st<.05?ut="5":mt<.06&&ft<160&&st<.1?ut="4":mt<.1&&ft<250&&st<.15?ut="3":mt<.15&&ft<400&&st<.2?ut="2":ut="1",Number(ut)};{const ct=ot(tt,X,nt),_t=await this.getCaller(),{network:at}=_t,mt={egress:ct,ingress:ct};$t("updateUserNetwork",async()=>{if(await this.updateUserNetwork(this.options.userId,mt),JSON.stringify(at)!==JSON.stringify(mt)){this.emitNotifyUpdateUsers();const{userId:ut,roomId:Rt}=this.options;this.cwsIns.sendMessage({event:"networkQualityChange",data:{...mt,userId:ut,roomId:Rt}},!1)}},3*1e3)}}catch(O){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setNetQuality is err.",O)}});bt(this,Yt,()=>{const O=async()=>{this.peerIns.connectionState!=="connected"||!this.options.roomId||et(this,Vt).call(this)};this.getPeerStatsTimer=setInterval(O,1*1e3)});Y(this,"stopGetPeerStats",()=>clearInterval(this.getPeerStatsTimer))}}Qt=new WeakMap,Vt=new WeakMap,Yt=new WeakMap;class RoomCalls extends RoomPeer{constructor(O){super(O);bt(this,Dt,0);Y(this,"setLocalStream",(O,D)=>new Promise(async(a,k)=>{try{typeof O=="string"&&(O=[O]);for(const o of O)this.localStreamsActionMap.set(o,D);if(D){if(O.includes("microphoneCamera_audio")&&O.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera"):O.includes("microphoneCamera_audio")?await this.initLocalStream("microphoneCamera_audio"):O.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera_video"):O.includes("screenSharing_audio")&&O.includes("screenSharing_video")?await this.initLocalStream("screenSharing"):O.includes("screenSharing_audio")&&!O.includes("screenSharing_video")?await this.initLocalStream("screenSharing_audio"):O.includes("screenSharing_video")&&!O.includes("screenSharing_audio")&&await this.initLocalStream("screenSharing_video"),O.includes("screenSharing_audio")){const o=this.getLocalStream("screenSharing_audio");if(o){const N=o.getTracks();for(const q of N)q.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}if(O.includes("screenSharing_video")){const o=this.getLocalStream("screenSharing_video");if(o){const N=o.getTracks();for(const q of N)q.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}}else await this.stopLocalStreams(O);const e=this.getLocalStreams(O);this.cwsIns.emitNotify("onLocalStream",{code:200,data:e,desc:"local stream is change."}),a(e)}catch(e){k(e)}}));Y(this,"setMediaDeviceKind",(O,D)=>new Promise(async(a,k)=>{this.setDeviceKind(O,D);const e=await this.getCaller(),{id:o,tracks:N=[],callActionMap:q}=e,F=[],J=async z=>{const G=this.localStreamsActionMap.get(z),K=N.find(tt=>tt.mediaType===z),it=q[z];if(G){F.push(z),await this.stopLocalStreams([z]);try{await this.initLocalStream(z)}catch(tt){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initLocalStream is error.",tt),await this.inactiveTracks([z],!1),k(tt)}}if(K){const tt=this.getLocalStream(z);if(tt){const X=this.getUserMediaStreamContext(o,z);X==null||X.replaceStream(tt),it&&await this.replaceSenderStream([z],!0)}}{const tt=this.getLocalStreams(F);this.cwsIns.emitNotify("onLocalStream",{code:200,data:tt,desc:"local stream is change."}),a(!0)}};O==="audioinput"&&J("microphoneCamera_audio"),O==="videoinput"&&J("microphoneCamera_video"),O==="audiooutput"&&(this.changeAudiooutput(),a(!0))}));Y(this,"changeScreenSharing",async O=>{const D=await this.getCaller(),{tracks:a=[],callActionMap:k}=D;try{await this.setLocalStream(O,!0);for(const e of O)a.find(N=>N.mediaType===e&&k[e])&&await this.replaceSenderStream([e],!0)}catch(e){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: changeScreenSharing is error.",e)}});Y(this,"createSession",()=>new Promise(async(O,D)=>{if(["connecting","connected"].includes(this.roomState))return O(!0);this.setRoomState("connecting"),await this.taskQueue.createTask({describe:"createSession",conditionKeys:["createWs","createSession"],func:()=>new Promise(async(a,k)=>{try{await this.taskQueue.setCondition("createSession",!1),await this.addSenders(),this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}).then(async e=>{const{code:o=0,desc:N,data:q}=e;if(o!==200)return k(N);const{remoteSdp:F}=q;await this.taskQueue.setCondition("ice",!1),await this.taskQueue.createTask({describe:"ice",timeout:30*1e3,conditionKeys:["ice"],func:()=>new Promise(J=>setTimeout(()=>J(!0),300)),success:async()=>{a(!0)},fail:async J=>{throw new Error(`ice connection failed: ${J}`)}}),await this.setRemoteDescription({type:"answer",sdp:F})})}catch(e){k(e)}}),success:async a=>{this.taskQueue.setCondition("createSession",!0),O(a)},fail:async a=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: create session is error.",a),this.reportLogs("ws_c_timeout",a.message||a),D(a)},complete:()=>{}})}));Y(this,"earlyConnect",(O=[])=>{this.isEarly=!0,et(this,Mt).call(this),this.createSession(),O.length===0&&(O=["microphoneCamera_audio","microphoneCamera_video"]),et(this,Lt).call(this,O)});Y(this,"joinRoom",async O=>new Promise(async(D,a)=>{await this.taskQueue.createTask({describe:"joinRoom",conditionKeys:["createWs"],func:()=>new Promise(async(k,e)=>{try{await this.taskQueue.setCondition("joinRoom",!1),this.setOptions(O),await et(this,Mt).call(this),this.clearUsers();const{roomId:o,userId:N,callType:q,sdkToken:F}=this.options;this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:q,roomId:o,user:{id:N,tracks:[],callAction:0},token:F},version:2}).then(async J=>{const{code:z=0,desc:G="服务器繁忙",data:K}=J;if(z!==200)return e(G);const{roomId:it="",roomUsers:tt=[]}=K;if(it!==o)return e("加入的房间不匹配");this.isInRoom=!0,this.initHeartbeat(),this.createSession(),await this.updateUsers(tt),await this.emitNotifyUpdateUsers();const X=await this.getUsers();k(X)})}catch(o){e(o)}}),success:async k=>{await this.taskQueue.setCondition("joinRoom",!0),D(k)},fail:async k=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: joinRoom is error.",k),this.reportLogs("join_room_error",k.message||k),a(k)}})}));Y(this,"quitRoom",()=>new Promise(async O=>{const{roomId:D,userId:a}=this.options,k={roomId:D,user:{id:a}};try{this.isInRoom=!1,clearInterval(et(this,Dt)),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.setRoomState("ready")}catch(e){this.reportLogs("quit_room_error",e.message||e)}await new Promise(e=>setTimeout(()=>e(!0),300)),await this.taskQueue.setCondition("closeTrack",!0),this.cwsIns.sendMessage({event:"quitRoom",data:k}),O(!0)}));Y(this,"quitRoomEx",()=>new Promise(async O=>{const{roomId:D,userId:a}=this.options,k={roomId:D,user:{id:a}};try{this.isInRoom=!1,this.initHeartbeat(),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams()}catch(e){this.reportLogs("quit_room_error",e.message||e)}await new Promise(e=>setTimeout(()=>e(!0),300)),this.cwsIns.sendMessage({event:"quitRoomEx",data:k}),O(!0)}));Y(this,"syncRoomInfo",()=>new Promise(async(O,D)=>{const{userId:a}=this.options,k=await this.getUser(a),{id:e=a,callAction:o=0}=k;this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:e,callAction:o}}}).then(async N=>{if(N.code!==200)return D(N.desc);const q=N.data.users;this.clearUsers(),await this.updateUsers(q),await this.updateUsertracks(k.id,k.tracks,!1);{const F=await this.getUsers();O(F)}}).catch(N=>D(N))}));Y(this,"publish",O=>new Promise(async(D,a)=>{try{await this.setLocalStream(O,!0)}catch(k){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setLocalStream is error.",k)}await this.taskQueue.createTask({describe:"publish",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],func:()=>new Promise(async(k,e)=>{try{await this.taskQueue.setCondition("publish",!1);const o=await this.getCaller(),N=[];for(const G of O){{const K=this.getPhoneyStreams(G);await this.initUserMediaStreamContext(o.id,G,K)}{const K=this.getLocalStream(G);if(K){const it=this.getUserMediaStreamContext(o.id,G);it==null||it.replaceStream(K)}else N.push(G)}}const q=O.filter(G=>!N.includes(G)||["microphoneCamera_audio","microphoneCamera_video"].includes(G));await this.replaceSenderStream(O,!1),await et(this,Lt).call(this,q);const F=await this.getSenderTracks(q),J=[...o.tracks,...F];await this.updateUsertracks(o.id,J,!0);const z=await this.getCallAction(J);await et(this,Ut).call(this,z),N.length!==0&&await this.inactiveTracks(N,!1),q.length!==0&&await this.replaceSenderStream(q,!0),et(this,Xt).call(this,O);{await this.emitNotifyUpdateUsers();const G=await this.getCaller();k(G)}}catch(o){e(o)}}),success:async k=>{D(k)},fail:async k=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: publish is error.",k),this.reportLogs("publish_error",k.message||k),a(k)},complete:async()=>{await this.taskQueue.setCondition("publish",!0)}})}));Y(this,"stopPublish",(O=[])=>new Promise(async(D,a)=>{await this.taskQueue.createTask({describe:"stopPublish",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],func:()=>new Promise(async(k,e)=>{try{await this.taskQueue.setCondition("closeTrack",!1);const o=await this.getCaller();O.length===0&&(O=mediaType_keys);const N=o.tracks.filter(({mediaType:F})=>F&&O.includes(F)),q=async()=>{const F=await this.getCaller();await this.emitNotifyUpdateUsers(),k(F)};if(N.length===0)return q();await this.replaceSenderStream(O,!0),await this.closeUserTracks(o.id,N,!0),await this.removeSenders(O);{const F=await this.getCallAction(o.tracks);await et(this,Ut).call(this,F)}await this.createOffer(),this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:N}}).then(async F=>{const{code:J,desc:z,remoteSdp:G}=F.data;if(J!==200)return e(z);await this.setRemoteDescription({type:"answer",sdp:G})}),q()}catch(o){e(o)}}),success:async k=>{D(k)},fail:async k=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: stopPublish is error.",k),this.reportLogs("close_track_error",k.message||k),a(k)},complete:async()=>{await this.taskQueue.setCondition("closeTrack",!0)}})}));Y(this,"subscribe",(O=[],D=3)=>new Promise(async(a,k)=>{const e=await this.taskQueue.createTask({describe:"subscribe",strict:!0,conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],func:()=>new Promise(async(o,N)=>{try{const q=await this.getUsers();let F=[];for(const G of q){const{isSelf:K,tracks:it=[]}=G;if(!K){const tt=it.filter(({trackName:X,mid:nt=""})=>nt!==""&&(O.includes(X)||O.length===0));tt.length!==0&&F.push({...G,tracks:tt})}}const J=async(G={})=>{const K=Array.from(F,({id:tt})=>tt),it=await this.getUsers(K);await this.emitNotifyUpdateUsers(),o({users:it,detail:G})};if(F.length===0)return J();await this.taskQueue.setCondition("subscribe",!1);const z=[];for(const G of F){const{id:K,tracks:it}=G,tt=dt(it,["type","trackName"]),X={id:K,tracks:tt};z.push(X)}this.cwsIns.sendMessage({event:"subscribe",data:{users:z}}).then(async G=>{const{code:K=0,data:it,desc:tt}=G;if(K!==200)return N(tt);const{remoteSdp:X,users:nt=[]}=it;this.onSubscribeUserTracks(nt).then(async rt=>{await this.renegotiate().then(()=>J(rt)).catch(ot=>N(ot)),this.taskQueue.setCondition("subscribe",!0)}).catch(rt=>{N(rt)}),await this.setRemoteDescription({type:"offer",sdp:X})})}catch(q){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: error",q),N(q)}}),success:async o=>{e.clear(),a(o)},fail:async o=>{if(this.options.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: subscribe error. surplus count is ${D}`),D>0)return await new Promise(N=>setTimeout(()=>N(!0),(3-D)*1e3)),D=D-1,e.retry();e.clear(),this.reportLogs("subscribe_error",o.message||o),this.taskQueue.setCondition("subscribe",!0),k(o)},complete:async()=>{}})}));Y(this,"renegotiate",()=>new Promise(async(O,D)=>{try{await this.taskQueue.setCondition("renegotiate",!1),await this.createAnswer(),this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then(a=>{const{code:k=0,desc:e}=a;if(k!==200)return D(e);O(a)}).finally(()=>{this.taskQueue.setCondition("renegotiate",!0)})}catch(a){D(a)}}));Y(this,"stopSubscribe",(O=[])=>new Promise(async(D,a)=>{await this.taskQueue.createTask({describe:"closeTrack",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe"],func:()=>new Promise(async(k,e)=>{try{await this.taskQueue.setCondition("closeTrack",!1);const o=await this.getUsers(),N=[];for(const F of o){const{tracks:J=[]}=F;for(const z of J){const{type:G,mid:K,trackName:it,mediaType:tt,msid:X}=z;if(!(!tt||!X)&&(O.length===0||O.includes(it))){const nt={type:G,mid:K,trackName:X};N.push(nt),await this.closeUserTracks(F.id,[z])}}}const q=async()=>{await this.emitNotifyUpdateUsers(),k(!0)};if(N.length===0)return q();await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:N}}).then(async F=>{const{remoteSdp:J}=F.data;await this.setRemoteDescription({type:"answer",sdp:J})}),q()}catch(o){e(o)}}),success:async k=>{D(k)},fail:async k=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: stopPublish is error.",k),this.reportLogs("close_track_error",k.message||k),a(k)},complete:async()=>{await this.taskQueue.setCondition("closeTrack",!0)}})}));Y(this,"inactiveTracks",async(O,D)=>new Promise(async a=>{const k=await this.getCaller();if(!k||!k.id)return a(!0);const{tracks:e=[]}=k,o=[...e];for(let q of o){const{mediaType:F}=q;if(F&&O.includes(F)){q.enabled=D;const J=this.getLocalStream(F);if(!J)continue;const z=J.getTracks();for(const G of z)G.enabled=D}}const N=await this.getCallAction(o);await et(this,Ut).call(this,N),await this.replaceSenderStream(O,D),await this.emitNotifyUpdateUsers(),a(!0)}));Y(this,"debugger",()=>new Promise(async(O,D)=>{await this.cwsIns.sendMessage({event:"debugger"},!1).then(async a=>{if(a.code!==200)return D(a.desc);O(!0)}).catch(a=>{D(a)})}));Y(this,"shutdown",()=>new Promise(async(O,D)=>{await this.cwsIns.sendMessage({event:"shutdown"},!1).then(async a=>{if(a.code!==200)return D(a.desc);O(!0)}).catch(a=>{D(a)})}));Y(this,"initHeartbeat",()=>{this.stopHeartbeat();const O=()=>this.cwsIns.sendMessage({event:this.isInRoom?"heartbeat":"heartbeatEx"},!1),D=this.isInRoom?5*1e3:30*1e3;It(this,Dt,setInterval(O,D)),O()});Y(this,"stopHeartbeat",()=>{clearInterval(et(this,Dt))});bt(this,Xt,async O=>{const{roomId:D}=this.options;if(!D)return;const{id:a,tracks:k=[]}=await this.getCaller(),e=k.filter(o=>o.mediaType&&O.includes(o.mediaType));e.length!==0&&this.cwsIns.sendMessage({event:"pubNotify",data:{roomId:D,user:{id:a,tracks:e}}})});bt(this,Ut,async O=>new Promise(async(D,a)=>{const{roomId:k,userId:e}=this.options,o={roomId:k,user:{id:e,callAction:O}};await this.cwsIns.sendMessage({event:"updateCall",data:o}).then(async N=>{const{code:q=0}=N;if(q!==200)return a(N);await this.updateUserCallAction(e,O),D(O)}).catch(N=>a(N))}));bt(this,Mt,()=>new Promise(async(O,D)=>{try{if(["connecting","connected"].includes(this.cwsIns.state))return O(!0);await this.taskQueue.setCondition("createWs",!1),this.cwsIns.clearEvents(),this.initPeer();const{appid:a,roomId:k,userId:e}=this.options;if(!a)return D("quickvo: createWs is error. You must first use QuickVO.setOptions to set the appid.");const o={c:a,r:k,v:this.sdk_service_version};if(this.isEarly){const q=xt();o.i=q,this.setOptions({earlyId:q})}else o.b=e;this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs",o);const N=btoa(encodeURI(JSON.stringify(o)));await this.cwsIns.connect(N),this.initHeartbeat(),await this.taskQueue.setCondition("createWs",!0),await this.taskQueue.setCondition("createSession",!0),O(!0)}catch(a){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs is error.",a),this.reportLogs("ws_c_timeout",a.message||a),D(a)}}));bt(this,Lt,async O=>new Promise(async(D,a)=>{await this.taskQueue.createTask({describe:"createTrack",conditionKeys:["createWs","createSession","ice","createTrack","subscribe","renegotiate","closeTrack"],func:()=>new Promise(async(k,e)=>{try{await this.taskQueue.setCondition("createTrack",!1);const o=await this.addSenders(O),N=await this.getSenderTracks(o);if(N.length===0)return await this.taskQueue.setCondition("createTrack",!0),k(!0);this.cwsIns.sendMessage({event:"publish",data:{sdp:this.getSdp(),tracks:N,callAction:0}}).then(async q=>{const{code:F=0,desc:J,data:z}=q;if(F!==200)return e(J);const{remoteSdp:G}=z;await this.setRemoteDescription({type:"answer",sdp:G}),k(!0)})}catch(o){await this.removeSenders(O),e(o)}}),success:async k=>{D(k)},fail:async k=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createTrack is error.",k),this.reportLogs("publish_error",k.message||k),a(k)},complete:async()=>{await this.taskQueue.setCondition("createTrack",!0)}})}))}}Dt=new WeakMap,Xt=new WeakMap,Ut=new WeakMap,Mt=new WeakMap,Lt=new WeakMap;class Room extends RoomCalls{constructor(Z){super(Z)}}class QuickVO extends Room{constructor(O){super(O);bt(this,qt,new Map);Y(this,"reconstruct",async()=>{this.setRoomState("ready"),this.taskQueue.setCondition("createSession",!0),this.taskQueue.setCondition("ice",!0),this.taskQueue.clear(),await this.syncRoomInfo(),this.initPeer(),await this.createSession();const O=[],D=[],a=await this.getUsers();for(const k of a){const{isSelf:e,callActionMap:o,tracks:N=[]}=k;if(e)for(const q of mediaType_keys)o[q]&&O.push(q);for(const q of N)q.msid&&D.push(q.trackName)}await this.subscribe(D),await this.publish(O)});bt(this,te,()=>{{const O=async D=>{const{state:a}=D.data;if(a==="closed"){const{roomId:k,userId:e}=this.options,o={roomId:k,user:{id:e}};this.stopHeartbeat(),this.cwsIns.sendMessage({event:"quitRoom",data:o}),this.cwsIns.close(),this.reportLogs("webrtc_c_timeout","webrtc state is closed.")}a==="failed"&&this.reconstruct()};this.cwsIns.addNotify({event:"onRoomState",callback:O},!0)}{const O=async D=>{const{qualities:a=[]}=D.data,[k]=a;if(!(k&&k.userId===this.options.userId&&a.length===1)){for(const e of a){const{userId:o,egress:N,ingress:q}=e;this.checkUserInRoom(o)&&await this.updateUserNetwork(o,{egress:N,ingress:q})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:O},!0)}{const O=async D=>{const a=D.data.user;await this.updateUsers([a]),await this.updateUsertracks(a.id,a.track,!1),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:O},!0)}{const O=async D=>{await this.removeUsers([D.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:O},!0)}{const O=async D=>{const{user:a}=D.data,{id:k,tracks:e=[],callAction:o=0}=a;await this.updateUserCallAction(k,o),await this.updateUserPermissions(k,3);const N=[];{const{tracks:q}=await this.getUser(k);for(const F of e){const{mid:J,trackName:z}=F;if(q.find(K=>K.mid===J&&K.trackName===z))continue;N.push(F)}}if(N.length!==0)if(await this.updateUsertracks(k,N,!0),this.options.newPublishAutoSubscribe){const q=this.getTrackNamesFormTracks(N);await this.subscribe(q)}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:O},!0)}{const O=async D=>{const{id:a,tracks:k}=D.data.user;a!==this.options.userId&&(await this.closeUserTracks(a,k,!0),await this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onCloseTrack",callback:O},!0)}{const O=async D=>{const{id:a,callAction:k}=D.data.user;this.checkUserInRoom(a)&&(await this.updateUserCallAction(a,k),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:O},!0)}{const O=async D=>{const{user:a}=D.data,{id:k,permissions:e=1}=a;e===1?await this.removeUsers([k]):e===3&&await this.updateUsers([a]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:O},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async O=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)});Y(this,"addNotify",O=>this.cwsIns.addNotify(O));bt(this,ee,()=>{});bt(this,ie,()=>{this.cwsIns.onReconnectSuccess=async()=>{this.reconstruct()}});bt(this,ne,async()=>{this.setRoomState("closed")});Y(this,"addRequestAnimationFrame",async(O,D)=>{{const k=et(this,qt).get(O);k&&cancelAnimationFrame(k)}const a=(k=Date.now())=>{D(k);const e=requestAnimationFrame(a);et(this,qt).set(O,e)};a()});Y(this,"clearRequestAnimationFrame",async(O=[])=>{O.length===0&&(O=[...et(this,qt).keys()]);const D=[];for(const a of O){const k=et(this,qt).get(a);k&&(cancelAnimationFrame(k),D.push(k))}return D});Y(this,"destroy",async()=>{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 销毁SDK"),this.cwsIns.emitNotify("onDestroy",{code:200,data:{},desc:"sdk is destroy."}),this.stopLocalStreams(),await new Promise(O=>setTimeout(()=>O(!0),300)),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.cwsIns.close()});et(this,ee).call(this),et(this,ie).call(this),et(this,ne).call(this),et(this,te).call(this)}}qt=new WeakMap,te=new WeakMap,ee=new WeakMap,ie=new WeakMap,ne=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 N=requireParser(),F=requireWriter$1(),I=requireGrammar();return lib.grammar=I,lib.write=F,lib.parse=N.parse,lib.parseParams=N.parseParams,lib.parseFmtpConfig=N.parseFmtpConfig,lib.parsePayloads=N.parsePayloads,lib.parseRemoteCandidates=N.parseRemoteCandidates,lib.parseImageAttributes=N.parseImageAttributes,lib.parseSimulcastStreamList=N.parseSimulcastStreamList,lib}var libExports=requireLib();class AudioMediaContext{constructor(F,I){X(this,"options",{autoGainControl:!1,noiseSuppression:!1,echoCancellation:!1});X(this,"kind","audio");X(this,"stream",new MediaStream);X(this,"inputGain",1);X(this,"outputGain",1);X(this,"enhanceGain",0);X(this,"audio",new Audio);X(this,"audioContext");X(this,"sourceNode");X(this,"inputGainNode");X(this,"analyserNode");X(this,"analyserArrayData");X(this,"outputGainNode");X(this,"destinationNode");X(this,"initNodes",()=>{this.audio.srcObject=this.stream,this.sourceNode=this.audioContext.createMediaStreamSource(this.stream),this.inputGainNode=this.audioContext.createGain(),this.inputGainNode.gain.setValueAtTime(this.inputGain,this.audioContext.currentTime),this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=512,this.analyserArrayData=new Uint8Array(this.analyserNode.frequencyBinCount),this.outputGainNode=this.audioContext.createGain(),this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime),this.destinationNode=this.audioContext.createMediaStreamDestination();{const{sourceNode:F,inputGainNode:I,analyserNode:Z,outputGainNode:a}=this;F.connect(I),I.connect(Z),Z.connect(a),a.connect(this.audioContext.destination)}this.setMute(!0)});X(this,"stop",()=>{{const F=this.stream.getTracks();for(const I of F)I.stop(),this.stream.removeTrack(I)}});X(this,"replaceStream",F=>{const I=this.stream.getTracks();for(const a of I)this.stream.removeTrack(a);const[Z]=F.getAudioTracks();Z&&this.stream.addTrack(Z),this.initNodes()});X(this,"getStream",()=>this.sourceNode.mediaStream);X(this,"setMute",(F=!0)=>{F?this.analyserNode.disconnect(this.outputGainNode):this.analyserNode.connect(this.outputGainNode)});X(this,"setEnhanceGain",async F=>{this.enhanceGain=F;const I=this.inputGain+this.enhanceGain;this.inputGainNode.gain.setValueAtTime(I,this.audioContext.currentTime)});X(this,"setVolumeGain",F=>{this.outputGain=F,this.outputGainNode.gain.setValueAtTime(F,this.audioContext.currentTime);const I=F===0;this.setMute(I)});X(this,"getVolume",()=>{const{analyserNode:F,analyserArrayData:I}=this;F.getByteFrequencyData(I);let Z=0;for(let O=0;O<I.length;O++)Z+=I[O];return Math.ceil(Z/I.length)});X(this,"setFilter",(F={})=>(this.options={...this.options,...F},F));this.stream.addTrack(F),this.audioContext=I,this.initNodes(),this.audioContext.resume()}}class VideoMediaContext{constructor(F){X(this,"kind","video");X(this,"stream",new MediaStream);X(this,"stop",()=>{const F=this.stream.getTracks();for(const I of F)I.stop(),this.stream.removeTrack(I)});X(this,"replaceStream",F=>{const I=this.stream,Z=I.getTracks();for(const O of Z)I.removeTrack(O);const[a]=F.getVideoTracks();a&&I.addTrack(a)});X(this,"getStream",()=>this.stream);X(this,"getTrack",()=>this.stream.getTracks()[0]);this.stream.addTrack(F)}}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};ht(enum_roomState);var C$1=Object.defineProperty,R=N=>{throw TypeError(N)},S=(N,F,I)=>F in N?C$1(N,F,{enumerable:!0,configurable:!0,writable:!0,value:I}):N[F]=I,l=(N,F,I)=>S(N,typeof F!="symbol"?F+"":F,I),v=(N,F,I)=>F.has(N)||R("Cannot "+I),t=(N,F,I)=>(v(N,F,"read from private field"),I?I.call(N):F.get(N)),c$1=(N,F,I)=>F.has(N)?R("Cannot add the same private member more than once"):F instanceof WeakSet?F.add(N):F.set(N,I),i=(N,F,I,Z)=>(v(N,F,"write to private field"),F.set(N,I),I),s,r$1,h,p,m$1,f,w,x,g$1,b,B$1,y,T,d$1;class M{constructor(F){c$1(this,s,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,sendBeforAutoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4,checkReconnect:I=>!0,onReconnectSuccess:async I=>{},onReconnectStop:async I=>{},getHeartbeatMsg:()=>JSON.stringify({event:"heartbeat"}),onMessage:I=>{}}),l(this,"ws"),c$1(this,r$1,-1),c$1(this,h,-1),c$1(this,p,0),c$1(this,m$1,0),c$1(this,f,!1),c$1(this,w,I=>{}),l(this,"close",async(I=1e3,Z="correctly close.")=>{var a;this.ws&&(i(this,f,!0),t(this,d$1).call(this),(a=this.ws)==null||a.close(I,Z))}),l(this,"connect",()=>new Promise(async I=>{i(this,w,I),this.ws=new WebSocket(t(this,s).url),this.ws.binaryType=t(this,s).binaryType,this.ws.onopen=t(this,b),this.ws.onmessage=t(this,g$1),this.ws.onerror=t(this,B$1),this.ws.onclose=t(this,y)})),l(this,"reconnect",async I=>new Promise(Z=>{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 a=O=>{t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: ${O}`),t(this,s).onReconnectStop({msg:O}),Z(O)};if(t(this,x).call(this)===!1)return a("stop reconnect. exceed maxReconnectionTime.");if(t(this,r$1)!==-1&&t(this,r$1)===0)return a("stop reconnect. surplusReconnectCount is 0.");if(!t(this,s).checkReconnect(I))return a("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$1)}`,I),i(this,p,setTimeout(async()=>{i(this,r$1,Math.max(-1,t(this,r$1)-1)),await this.connect();try{await t(this,s).onReconnectSuccess(this.ws)}catch(O){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->pr-ws: onReconnectSuccess is error",O)}Z(!0)},t(this,s).reconnectIntervalTime))})),l(this,"sendMessage",async I=>{var Z;(!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())),(Z=this.ws)==null||Z.send(I)}),c$1(this,x,()=>{const I=Date.now();return t(this,h)===-1&&i(this,h,I+t(this,s).reconnectTime),!(I>t(this,h))}),c$1(this,g$1,I=>{const{data:Z}=I;t(this,s).onMessage(Z)}),c$1(this,b,()=>{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$1,t(this,s).reconnectCount),i(this,h,-1),t(this,T).call(this),t(this,w).call(this,this.ws)}),c$1(this,B$1,I=>{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.",I)}),c$1(this,y,I=>{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: ${I.code}, permanentClosed is ${t(this,f)}.`,I),t(this,d$1).call(this),!t(this,f))return this.reconnect(I);this.ws=void 0}),c$1(this,T,()=>{i(this,m$1,setInterval(()=>{const I=t(this,s).getHeartbeatMsg();I&&this.sendMessage(I)},t(this,s).heartbeatIntervalTime))}),c$1(this,d$1,()=>{clearInterval(t(this,p)),clearInterval(t(this,m$1))}),i(this,s,{...t(this,s),...F}),i(this,r$1,t(this,s).reconnectCount)}}s=new WeakMap,r$1=new WeakMap,h=new WeakMap,p=new WeakMap,m$1=new WeakMap,f=new WeakMap,w=new WeakMap,x=new WeakMap,g$1=new WeakMap,b=new WeakMap,B$1=new WeakMap,y=new WeakMap,T=new WeakMap,d$1=new WeakMap;var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=N;function N(F,I){for(var Z=new Array(arguments.length-1),a=0,O=2,e=!0;O<arguments.length;)Z[a++]=arguments[O++];return new Promise(function(q,D){Z[a]=function(K){if(e)if(e=!1,K)D(K);else{for(var J=new Array(arguments.length-1),G=0;G<J.length;)J[G++]=arguments[G];q.apply(null,J)}};try{F.apply(I||null,Z)}catch(z){e&&(e=!1,D(z))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(N){var F=N;F.length=function(n){var q=n.length;if(!q)return 0;for(var D=0;--q%4>1&&n.charAt(q)==="=";)++D;return Math.ceil(n.length*3)/4-D};for(var I=new Array(64),Z=new Array(123),a=0;a<64;)Z[I[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;F.encode=function(n,q,D){for(var z=null,K=[],J=0,G=0,Q;q<D;){var nt=n[q++];switch(G){case 0:K[J++]=I[nt>>2],Q=(nt&3)<<4,G=1;break;case 1:K[J++]=I[Q|nt>>4],Q=(nt&15)<<2,G=2;break;case 2:K[J++]=I[Q|nt>>6],K[J++]=I[nt&63],G=0;break}J>8191&&((z||(z=[])).push(String.fromCharCode.apply(String,K)),J=0)}return G&&(K[J++]=I[Q],K[J++]=61,G===1&&(K[J++]=61)),z?(J&&z.push(String.fromCharCode.apply(String,K.slice(0,J))),z.join("")):String.fromCharCode.apply(String,K.slice(0,J))};var O="invalid encoding";F.decode=function(n,q,D){for(var z=D,K=0,J,G=0;G<n.length;){var Q=n.charCodeAt(G++);if(Q===61&&K>1)break;if((Q=Z[Q])===void 0)throw Error(O);switch(K){case 0:J=Q,K=1;break;case 1:q[D++]=J<<2|(Q&48)>>4,J=Q,K=2;break;case 2:q[D++]=(J&15)<<4|(Q&60)>>2,J=Q,K=3;break;case 3:q[D++]=(J&3)<<6|Q,K=0;break}}if(K===1)throw Error(O);return D-z},F.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=N;function N(){this._listeners={}}return N.prototype.on=function(I,Z,a){return(this._listeners[I]||(this._listeners[I]=[])).push({fn:Z,ctx:a||this}),this},N.prototype.off=function(I,Z){if(I===void 0)this._listeners={};else if(Z===void 0)this._listeners[I]=[];else for(var a=this._listeners[I],O=0;O<a.length;)a[O].fn===Z?a.splice(O,1):++O;return this},N.prototype.emit=function(I){var Z=this._listeners[I];if(Z){for(var a=[],O=1;O<arguments.length;)a.push(arguments[O++]);for(O=0;O<Z.length;)Z[O].fn.apply(Z[O++].ctx,a)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=N(N);function N(O){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),n=new Uint8Array(e.buffer),q=n[3]===128;function D(G,Q,nt){e[0]=G,Q[nt]=n[0],Q[nt+1]=n[1],Q[nt+2]=n[2],Q[nt+3]=n[3]}function z(G,Q,nt){e[0]=G,Q[nt]=n[3],Q[nt+1]=n[2],Q[nt+2]=n[1],Q[nt+3]=n[0]}O.writeFloatLE=q?D:z,O.writeFloatBE=q?z:D;function K(G,Q){return n[0]=G[Q],n[1]=G[Q+1],n[2]=G[Q+2],n[3]=G[Q+3],e[0]}function J(G,Q){return n[3]=G[Q],n[2]=G[Q+1],n[1]=G[Q+2],n[0]=G[Q+3],e[0]}O.readFloatLE=q?K:J,O.readFloatBE=q?J:K}():function(){function e(q,D,z,K){var J=D<0?1:0;if(J&&(D=-D),D===0)q(1/D>0?0:2147483648,z,K);else if(isNaN(D))q(2143289344,z,K);else if(D>34028234663852886e22)q((J<<31|2139095040)>>>0,z,K);else if(D<11754943508222875e-54)q((J<<31|Math.round(D/1401298464324817e-60))>>>0,z,K);else{var G=Math.floor(Math.log(D)/Math.LN2),Q=Math.round(D*Math.pow(2,-G)*8388608)&8388607;q((J<<31|G+127<<23|Q)>>>0,z,K)}}O.writeFloatLE=e.bind(null,F),O.writeFloatBE=e.bind(null,I);function n(q,D,z){var K=q(D,z),J=(K>>31)*2+1,G=K>>>23&255,Q=K&8388607;return G===255?Q?NaN:J*(1/0):G===0?J*1401298464324817e-60*Q:J*Math.pow(2,G-150)*(Q+8388608)}O.readFloatLE=n.bind(null,Z),O.readFloatBE=n.bind(null,a)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),n=new Uint8Array(e.buffer),q=n[7]===128;function D(G,Q,nt){e[0]=G,Q[nt]=n[0],Q[nt+1]=n[1],Q[nt+2]=n[2],Q[nt+3]=n[3],Q[nt+4]=n[4],Q[nt+5]=n[5],Q[nt+6]=n[6],Q[nt+7]=n[7]}function z(G,Q,nt){e[0]=G,Q[nt]=n[7],Q[nt+1]=n[6],Q[nt+2]=n[5],Q[nt+3]=n[4],Q[nt+4]=n[3],Q[nt+5]=n[2],Q[nt+6]=n[1],Q[nt+7]=n[0]}O.writeDoubleLE=q?D:z,O.writeDoubleBE=q?z:D;function K(G,Q){return n[0]=G[Q],n[1]=G[Q+1],n[2]=G[Q+2],n[3]=G[Q+3],n[4]=G[Q+4],n[5]=G[Q+5],n[6]=G[Q+6],n[7]=G[Q+7],e[0]}function J(G,Q){return n[7]=G[Q],n[6]=G[Q+1],n[5]=G[Q+2],n[4]=G[Q+3],n[3]=G[Q+4],n[2]=G[Q+5],n[1]=G[Q+6],n[0]=G[Q+7],e[0]}O.readDoubleLE=q?K:J,O.readDoubleBE=q?J:K}():function(){function e(q,D,z,K,J,G){var Q=K<0?1:0;if(Q&&(K=-K),K===0)q(0,J,G+D),q(1/K>0?0:2147483648,J,G+z);else if(isNaN(K))q(0,J,G+D),q(2146959360,J,G+z);else if(K>17976931348623157e292)q(0,J,G+D),q((Q<<31|2146435072)>>>0,J,G+z);else{var nt;if(K<22250738585072014e-324)nt=K/5e-324,q(nt>>>0,J,G+D),q((Q<<31|nt/4294967296)>>>0,J,G+z);else{var et=Math.floor(Math.log(K)/Math.LN2);et===1024&&(et=1023),nt=K*Math.pow(2,-et),q(nt*4503599627370496>>>0,J,G+D),q((Q<<31|et+1023<<20|nt*1048576&1048575)>>>0,J,G+z)}}}O.writeDoubleLE=e.bind(null,F,0,4),O.writeDoubleBE=e.bind(null,I,4,0);function n(q,D,z,K,J){var G=q(K,J+D),Q=q(K,J+z),nt=(Q>>31)*2+1,et=Q>>>20&2047,tt=4294967296*(Q&1048575)+G;return et===2047?tt?NaN:nt*(1/0):et===0?nt*5e-324*tt:nt*Math.pow(2,et-1075)*(tt+4503599627370496)}O.readDoubleLE=n.bind(null,Z,0,4),O.readDoubleBE=n.bind(null,a,4,0)}(),O}function F(O,e,n){e[n]=O&255,e[n+1]=O>>>8&255,e[n+2]=O>>>16&255,e[n+3]=O>>>24}function I(O,e,n){e[n]=O>>>24,e[n+1]=O>>>16&255,e[n+2]=O>>>8&255,e[n+3]=O&255}function Z(O,e){return(O[e]|O[e+1]<<8|O[e+2]<<16|O[e+3]<<24)>>>0}function a(O,e){return(O[e]<<24|O[e+1]<<16|O[e+2]<<8|O[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(N){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(N){var F=N;F.length=function(Z){for(var a=0,O=0,e=0;e<Z.length;++e)O=Z.charCodeAt(e),O<128?a+=1:O<2048?a+=2:(O&64512)===55296&&(Z.charCodeAt(e+1)&64512)===56320?(++e,a+=4):a+=3;return a},F.read=function(Z,a,O){var e=O-a;if(e<1)return"";for(var n=null,q=[],D=0,z;a<O;)z=Z[a++],z<128?q[D++]=z:z>191&&z<224?q[D++]=(z&31)<<6|Z[a++]&63:z>239&&z<365?(z=((z&7)<<18|(Z[a++]&63)<<12|(Z[a++]&63)<<6|Z[a++]&63)-65536,q[D++]=55296+(z>>10),q[D++]=56320+(z&1023)):q[D++]=(z&15)<<12|(Z[a++]&63)<<6|Z[a++]&63,D>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,q)),D=0);return n?(D&&n.push(String.fromCharCode.apply(String,q.slice(0,D))),n.join("")):String.fromCharCode.apply(String,q.slice(0,D))},F.write=function(Z,a,O){for(var e=O,n,q,D=0;D<Z.length;++D)n=Z.charCodeAt(D),n<128?a[O++]=n:n<2048?(a[O++]=n>>6|192,a[O++]=n&63|128):(n&64512)===55296&&((q=Z.charCodeAt(D+1))&64512)===56320?(n=65536+((n&1023)<<10)+(q&1023),++D,a[O++]=n>>18|240,a[O++]=n>>12&63|128,a[O++]=n>>6&63|128,a[O++]=n&63|128):(a[O++]=n>>12|224,a[O++]=n>>6&63|128,a[O++]=n&63|128);return O-e}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=N;function N(F,I,Z){var a=Z||8192,O=a>>>1,e=null,n=a;return function(D){if(D<1||D>O)return F(D);n+D>a&&(e=F(a),n=0);var z=I.call(e,n,n+=D);return n&7&&(n=(n|7)+1),z}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=F;var N=requireMinimal$1();function F(O,e){this.lo=O>>>0,this.hi=e>>>0}var I=F.zero=new F(0,0);I.toNumber=function(){return 0},I.zzEncode=I.zzDecode=function(){return this},I.length=function(){return 1};var Z=F.zeroHash="\0\0\0\0\0\0\0\0";F.fromNumber=function(e){if(e===0)return I;var n=e<0;n&&(e=-e);var q=e>>>0,D=(e-q)/4294967296>>>0;return n&&(D=~D>>>0,q=~q>>>0,++q>4294967295&&(q=0,++D>4294967295&&(D=0))),new F(q,D)},F.from=function(e){if(typeof e=="number")return F.fromNumber(e);if(N.isString(e))if(N.Long)e=N.Long.fromString(e);else return F.fromNumber(parseInt(e,10));return e.low||e.high?new F(e.low>>>0,e.high>>>0):I},F.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var n=~this.lo+1>>>0,q=~this.hi>>>0;return n||(q=q+1>>>0),-(n+q*4294967296)}return this.lo+this.hi*4294967296},F.prototype.toLong=function(e){return N.Long?new N.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var a=String.prototype.charCodeAt;return F.fromHash=function(e){return e===Z?I:new F((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},F.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)},F.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},F.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},F.prototype.length=function(){var e=this.lo,n=(this.lo>>>28|this.hi<<4)>>>0,q=this.hi>>>24;return q===0?n===0?e<16384?e<128?1:2:e<2097152?3:4:n<16384?n<128?5:6:n<2097152?7:8:q<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(N){var F=N;F.asPromise=requireAspromise(),F.base64=requireBase64(),F.EventEmitter=requireEventemitter(),F.float=requireFloat(),F.inquire=requireInquire(),F.utf8=requireUtf8(),F.pool=requirePool(),F.LongBits=requireLongbits(),F.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),F.global=F.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,F.emptyArray=Object.freeze?Object.freeze([]):[],F.emptyObject=Object.freeze?Object.freeze({}):{},F.isInteger=Number.isInteger||function(O){return typeof O=="number"&&isFinite(O)&&Math.floor(O)===O},F.isString=function(O){return typeof O=="string"||O instanceof String},F.isObject=function(O){return O&&typeof O=="object"},F.isset=F.isSet=function(O,e){var n=O[e];return n!=null&&O.hasOwnProperty(e)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1},F.Buffer=function(){try{var a=F.inquire("buffer").Buffer;return a.prototype.utf8Write?a:null}catch{return null}}(),F._Buffer_from=null,F._Buffer_allocUnsafe=null,F.newBuffer=function(O){return typeof O=="number"?F.Buffer?F._Buffer_allocUnsafe(O):new F.Array(O):F.Buffer?F._Buffer_from(O):typeof Uint8Array>"u"?O:new Uint8Array(O)},F.Array=typeof Uint8Array<"u"?Uint8Array:Array,F.Long=F.global.dcodeIO&&F.global.dcodeIO.Long||F.global.Long||F.inquire("long"),F.key2Re=/^true|false|0|1$/,F.key32Re=/^-?(?:0|[1-9][0-9]*)$/,F.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,F.longToHash=function(O){return O?F.LongBits.from(O).toHash():F.LongBits.zeroHash},F.longFromHash=function(O,e){var n=F.LongBits.fromHash(O);return F.Long?F.Long.fromBits(n.lo,n.hi,e):n.toNumber(!!e)};function I(a,O,e){for(var n=Object.keys(O),q=0;q<n.length;++q)(a[n[q]]===void 0||!e)&&(a[n[q]]=O[n[q]]);return a}F.merge=I,F.lcFirst=function(O){return O.charAt(0).toLowerCase()+O.substring(1)};function Z(a){function O(e,n){if(!(this instanceof O))return new O(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,O):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&I(this,n)}return O.prototype=Object.create(Error.prototype,{constructor:{value:O,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return a},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),O}F.newError=Z,F.ProtocolError=Z("ProtocolError"),F.oneOfGetter=function(O){for(var e={},n=0;n<O.length;++n)e[O[n]]=1;return function(){for(var q=Object.keys(this),D=q.length-1;D>-1;--D)if(e[q[D]]===1&&this[q[D]]!==void 0&&this[q[D]]!==null)return q[D]}},F.oneOfSetter=function(O){return function(e){for(var n=0;n<O.length;++n)O[n]!==e&&delete this[O[n]]}},F.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},F._configure=function(){var a=F.Buffer;if(!a){F._Buffer_from=F._Buffer_allocUnsafe=null;return}F._Buffer_from=a.from!==Uint8Array.from&&a.from||function(e,n){return new a(e,n)},F._Buffer_allocUnsafe=a.allocUnsafe||function(e){return new a(e)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=q;var N=requireMinimal$1(),F,I=N.LongBits,Z=N.base64,a=N.utf8;function O(et,tt,ot){this.fn=et,this.len=tt,this.next=void 0,this.val=ot}function e(){}function n(et){this.head=et.head,this.tail=et.tail,this.len=et.len,this.next=et.states}function q(){this.len=0,this.head=new O(e,0,0),this.tail=this.head,this.states=null}var D=function(){return N.Buffer?function(){return(q.create=function(){return new F})()}:function(){return new q}};q.create=D(),q.alloc=function(tt){return new N.Array(tt)},N.Array!==Array&&(q.alloc=N.pool(q.alloc,N.Array.prototype.subarray)),q.prototype._push=function(tt,ot,ct){return this.tail=this.tail.next=new O(tt,ot,ct),this.len+=ot,this};function z(et,tt,ot){tt[ot]=et&255}function K(et,tt,ot){for(;et>127;)tt[ot++]=et&127|128,et>>>=7;tt[ot]=et}function J(et,tt){this.len=et,this.next=void 0,this.val=tt}J.prototype=Object.create(O.prototype),J.prototype.fn=K,q.prototype.uint32=function(tt){return this.len+=(this.tail=this.tail.next=new J((tt=tt>>>0)<128?1:tt<16384?2:tt<2097152?3:tt<268435456?4:5,tt)).len,this},q.prototype.int32=function(tt){return tt<0?this._push(G,10,I.fromNumber(tt)):this.uint32(tt)},q.prototype.sint32=function(tt){return this.uint32((tt<<1^tt>>31)>>>0)};function G(et,tt,ot){for(;et.hi;)tt[ot++]=et.lo&127|128,et.lo=(et.lo>>>7|et.hi<<25)>>>0,et.hi>>>=7;for(;et.lo>127;)tt[ot++]=et.lo&127|128,et.lo=et.lo>>>7;tt[ot++]=et.lo}q.prototype.uint64=function(tt){var ot=I.from(tt);return this._push(G,ot.length(),ot)},q.prototype.int64=q.prototype.uint64,q.prototype.sint64=function(tt){var ot=I.from(tt).zzEncode();return this._push(G,ot.length(),ot)},q.prototype.bool=function(tt){return this._push(z,1,tt?1:0)};function Q(et,tt,ot){tt[ot]=et&255,tt[ot+1]=et>>>8&255,tt[ot+2]=et>>>16&255,tt[ot+3]=et>>>24}q.prototype.fixed32=function(tt){return this._push(Q,4,tt>>>0)},q.prototype.sfixed32=q.prototype.fixed32,q.prototype.fixed64=function(tt){var ot=I.from(tt);return this._push(Q,4,ot.lo)._push(Q,4,ot.hi)},q.prototype.sfixed64=q.prototype.fixed64,q.prototype.float=function(tt){return this._push(N.float.writeFloatLE,4,tt)},q.prototype.double=function(tt){return this._push(N.float.writeDoubleLE,8,tt)};var nt=N.Array.prototype.set?function(tt,ot,ct){ot.set(tt,ct)}:function(tt,ot,ct){for(var rt=0;rt<tt.length;++rt)ot[ct+rt]=tt[rt]};return q.prototype.bytes=function(tt){var ot=tt.length>>>0;if(!ot)return this._push(z,1,0);if(N.isString(tt)){var ct=q.alloc(ot=Z.length(tt));Z.decode(tt,ct,0),tt=ct}return this.uint32(ot)._push(nt,ot,tt)},q.prototype.string=function(tt){var ot=a.length(tt);return ot?this.uint32(ot)._push(a.write,ot,tt):this._push(z,1,0)},q.prototype.fork=function(){return this.states=new n(this),this.head=this.tail=new O(e,0,0),this.len=0,this},q.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 O(e,0,0),this.len=0),this},q.prototype.ldelim=function(){var tt=this.head,ot=this.tail,ct=this.len;return this.reset().uint32(ct),ct&&(this.tail.next=tt.next,this.tail=ot,this.len+=ct),this},q.prototype.finish=function(){for(var tt=this.head.next,ot=this.constructor.alloc(this.len),ct=0;tt;)tt.fn(tt.val,ot,ct),ct+=tt.len,tt=tt.next;return ot},q._configure=function(et){F=et,q.create=D(),F._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=I;var N=requireWriter();(I.prototype=Object.create(N.prototype)).constructor=I;var F=requireMinimal$1();function I(){N.call(this)}I._configure=function(){I.alloc=F._Buffer_allocUnsafe,I.writeBytesBuffer=F.Buffer&&F.Buffer.prototype instanceof Uint8Array&&F.Buffer.prototype.set.name==="set"?function(O,e,n){e.set(O,n)}:function(O,e,n){if(O.copy)O.copy(e,n,0,O.length);else for(var q=0;q<O.length;)e[n++]=O[q++]}},I.prototype.bytes=function(O){F.isString(O)&&(O=F._Buffer_from(O,"base64"));var e=O.length>>>0;return this.uint32(e),e&&this._push(I.writeBytesBuffer,e,O),this};function Z(a,O,e){a.length<40?F.utf8.write(a,O,e):O.utf8Write?O.utf8Write(a,e):O.write(a,e)}return I.prototype.string=function(O){var e=F.Buffer.byteLength(O);return this.uint32(e),e&&this._push(Z,e,O),this},I._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=O;var N=requireMinimal$1(),F,I=N.LongBits,Z=N.utf8;function a(K,J){return RangeError("index out of range: "+K.pos+" + "+(J||1)+" > "+K.len)}function O(K){this.buf=K,this.pos=0,this.len=K.length}var e=typeof Uint8Array<"u"?function(J){if(J instanceof Uint8Array||Array.isArray(J))return new O(J);throw Error("illegal buffer")}:function(J){if(Array.isArray(J))return new O(J);throw Error("illegal buffer")},n=function(){return N.Buffer?function(G){return(O.create=function(nt){return N.Buffer.isBuffer(nt)?new F(nt):e(nt)})(G)}:e};O.create=n(),O.prototype._slice=N.Array.prototype.subarray||N.Array.prototype.slice,O.prototype.uint32=function(){var J=4294967295;return function(){if(J=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(J=(J|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(J=(J|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(J=(J|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(J=(J|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return J;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return J}}(),O.prototype.int32=function(){return this.uint32()|0},O.prototype.sint32=function(){var J=this.uint32();return J>>>1^-(J&1)|0};function q(){var K=new I(0,0),J=0;if(this.len-this.pos>4){for(;J<4;++J)if(K.lo=(K.lo|(this.buf[this.pos]&127)<<J*7)>>>0,this.buf[this.pos++]<128)return K;if(K.lo=(K.lo|(this.buf[this.pos]&127)<<28)>>>0,K.hi=(K.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return K;J=0}else{for(;J<3;++J){if(this.pos>=this.len)throw a(this);if(K.lo=(K.lo|(this.buf[this.pos]&127)<<J*7)>>>0,this.buf[this.pos++]<128)return K}return K.lo=(K.lo|(this.buf[this.pos++]&127)<<J*7)>>>0,K}if(this.len-this.pos>4){for(;J<5;++J)if(K.hi=(K.hi|(this.buf[this.pos]&127)<<J*7+3)>>>0,this.buf[this.pos++]<128)return K}else for(;J<5;++J){if(this.pos>=this.len)throw a(this);if(K.hi=(K.hi|(this.buf[this.pos]&127)<<J*7+3)>>>0,this.buf[this.pos++]<128)return K}throw Error("invalid varint encoding")}O.prototype.bool=function(){return this.uint32()!==0};function D(K,J){return(K[J-4]|K[J-3]<<8|K[J-2]<<16|K[J-1]<<24)>>>0}O.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return D(this.buf,this.pos+=4)},O.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return D(this.buf,this.pos+=4)|0};function z(){if(this.pos+8>this.len)throw a(this,8);return new I(D(this.buf,this.pos+=4),D(this.buf,this.pos+=4))}return O.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var J=N.float.readFloatLE(this.buf,this.pos);return this.pos+=4,J},O.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var J=N.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,J},O.prototype.bytes=function(){var J=this.uint32(),G=this.pos,Q=this.pos+J;if(Q>this.len)throw a(this,J);if(this.pos+=J,Array.isArray(this.buf))return this.buf.slice(G,Q);if(G===Q){var nt=N.Buffer;return nt?nt.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,G,Q)},O.prototype.string=function(){var J=this.bytes();return Z.read(J,0,J.length)},O.prototype.skip=function(J){if(typeof J=="number"){if(this.pos+J>this.len)throw a(this,J);this.pos+=J}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},O.prototype.skipType=function(K){switch(K){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(K=this.uint32()&7)!==4;)this.skipType(K);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+K+" at offset "+this.pos)}return this},O._configure=function(K){F=K,O.create=n(),F._configure();var J=N.Long?"toLong":"toNumber";N.merge(O.prototype,{int64:function(){return q.call(this)[J](!1)},uint64:function(){return q.call(this)[J](!0)},sint64:function(){return q.call(this).zzDecode()[J](!1)},fixed64:function(){return z.call(this)[J](!0)},sfixed64:function(){return z.call(this)[J](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=I;var N=requireReader();(I.prototype=Object.create(N.prototype)).constructor=I;var F=requireMinimal$1();function I(Z){N.call(this,Z)}return I._configure=function(){F.Buffer&&(I.prototype._slice=F.Buffer.prototype.slice)},I.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},I._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=F;var N=requireMinimal$1();(F.prototype=Object.create(N.EventEmitter.prototype)).constructor=F;function F(I,Z,a){if(typeof I!="function")throw TypeError("rpcImpl must be a function");N.EventEmitter.call(this),this.rpcImpl=I,this.requestDelimited=!!Z,this.responseDelimited=!!a}return F.prototype.rpcCall=function I(Z,a,O,e,n){if(!e)throw TypeError("request must be specified");var q=this;if(!n)return N.asPromise(I,q,Z,a,O,e);if(!q.rpcImpl){setTimeout(function(){n(Error("already ended"))},0);return}try{return q.rpcImpl(Z,a[q.requestDelimited?"encodeDelimited":"encode"](e).finish(),function(z,K){if(z)return q.emit("error",z,Z),n(z);if(K===null){q.end(!0);return}if(!(K instanceof O))try{K=O[q.responseDelimited?"decodeDelimited":"decode"](K)}catch(J){return q.emit("error",J,Z),n(J)}return q.emit("data",K,Z),n(null,K)})}catch(D){q.emit("error",D,Z),setTimeout(function(){n(D)},0);return}},F.prototype.end=function(Z){return this.rpcImpl&&(Z||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,function(N){var F=N;F.Service=requireService()}(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(N){var F=N;F.build="minimal",F.Writer=requireWriter(),F.BufferWriter=requireWriter_buffer(),F.Reader=requireReader(),F.BufferReader=requireReader_buffer(),F.util=requireMinimal$1(),F.rpc=requireRpc(),F.roots=requireRoots(),F.configure=I;function I(){F.util._configure(),F.Writer._configure(F.BufferWriter),F.Reader._configure(F.BufferReader)}I()}(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 N={};return N.quick=function(){const F={};return F.voice=function(){const I={};return I.proto=function(){const Z={};return Z.CommonReq=function(){function a(O){if(O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.event="",a.prototype.data=$util.newBuffer([]),a.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,a.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,a.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,a.prototype.version=0,a.prototype.compress=!1,a.create=function(e){return new a(e)},a.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},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.CommonReq;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.event=e.string();break}case 2:{D.data=e.bytes();break}case 3:{D.sn=e.int64();break}case 4:{D.time=e.int64();break}case 5:{D.valid=e.int64();break}case 6:{D.version=e.int32();break}case 7:{D.compress=e.bool();break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.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},a.toObject=function(e,n){n||(n={});let q={};if(n.defaults){if(q.event="",n.bytes===String?q.data="":(q.data=[],n.bytes!==Array&&(q.data=$util.newBuffer(q.data))),$util.Long){let D=new $util.Long(0,0,!1);q.sn=n.longs===String?D.toString():n.longs===Number?D.toNumber():D}else q.sn=n.longs===String?"0":0;if($util.Long){let D=new $util.Long(0,0,!1);q.time=n.longs===String?D.toString():n.longs===Number?D.toNumber():D}else q.time=n.longs===String?"0":0;if($util.Long){let D=new $util.Long(0,0,!1);q.valid=n.longs===String?D.toString():n.longs===Number?D.toNumber():D}else q.valid=n.longs===String?"0":0;q.version=0,q.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(q.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(q.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"?q.sn=n.longs===String?String(e.sn):e.sn:q.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"?q.time=n.longs===String?String(e.time):e.time:q.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"?q.valid=n.longs===String?String(e.valid):e.valid:q.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")&&(q.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(q.compress=e.compress),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CommonReq"},a}(),Z.CommonRsp=function(){function a(O){if(O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.event="",a.prototype.data=$util.newBuffer([]),a.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,a.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,a.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,a.prototype.code=0,a.prototype.desc="",a.prototype.version=0,a.prototype.compress=!1,a.create=function(e){return new a(e)},a.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},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.CommonRsp;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.event=e.string();break}case 2:{D.data=e.bytes();break}case 3:{D.sn=e.int64();break}case 4:{D.time=e.int64();break}case 5:{D.valid=e.int64();break}case 6:{D.code=e.int32();break}case 7:{D.desc=e.string();break}case 8:{D.version=e.int32();break}case 9:{D.compress=e.bool();break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.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},a.toObject=function(e,n){n||(n={});let q={};if(n.defaults){if(q.event="",n.bytes===String?q.data="":(q.data=[],n.bytes!==Array&&(q.data=$util.newBuffer(q.data))),$util.Long){let D=new $util.Long(0,0,!1);q.sn=n.longs===String?D.toString():n.longs===Number?D.toNumber():D}else q.sn=n.longs===String?"0":0;if($util.Long){let D=new $util.Long(0,0,!1);q.time=n.longs===String?D.toString():n.longs===Number?D.toNumber():D}else q.time=n.longs===String?"0":0;if($util.Long){let D=new $util.Long(0,0,!1);q.valid=n.longs===String?D.toString():n.longs===Number?D.toNumber():D}else q.valid=n.longs===String?"0":0;q.code=0,q.desc="",q.version=0,q.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(q.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(q.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"?q.sn=n.longs===String?String(e.sn):e.sn:q.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"?q.time=n.longs===String?String(e.time):e.time:q.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"?q.valid=n.longs===String?String(e.valid):e.valid:q.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")&&(q.code=e.code),e.desc!=null&&e.hasOwnProperty("desc")&&(q.desc=e.desc),e.version!=null&&e.hasOwnProperty("version")&&(q.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(q.compress=e.compress),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CommonRsp"},a}(),Z.User=function(){function a(e){if(this.tracks=[],e)for(let n=Object.keys(e),q=0;q<n.length;++q)e[n[q]]!=null&&(this[n[q]]=e[n[q]])}a.prototype.id="",a.prototype.callAction=null,a.prototype.callState=null,a.prototype.joinTime=null,a.prototype.tracks=$util.emptyArray,a.prototype.permissions=null,a.prototype.isPublished=null,a.prototype.behavior=null,a.prototype.channelCache=null;let O;return Object.defineProperty(a.prototype,"_callAction",{get:$util.oneOfGetter(O=["callAction"]),set:$util.oneOfSetter(O)}),Object.defineProperty(a.prototype,"_callState",{get:$util.oneOfGetter(O=["callState"]),set:$util.oneOfSetter(O)}),Object.defineProperty(a.prototype,"_joinTime",{get:$util.oneOfGetter(O=["joinTime"]),set:$util.oneOfSetter(O)}),Object.defineProperty(a.prototype,"_permissions",{get:$util.oneOfGetter(O=["permissions"]),set:$util.oneOfSetter(O)}),Object.defineProperty(a.prototype,"_isPublished",{get:$util.oneOfGetter(O=["isPublished"]),set:$util.oneOfSetter(O)}),Object.defineProperty(a.prototype,"_behavior",{get:$util.oneOfGetter(O=["behavior"]),set:$util.oneOfSetter(O)}),Object.defineProperty(a.prototype,"_channelCache",{get:$util.oneOfGetter(O=["channelCache"]),set:$util.oneOfSetter(O)}),a.create=function(n){return new a(n)},a.encode=function(n,q){if(q||(q=$Writer.create()),n.id!=null&&Object.hasOwnProperty.call(n,"id")&&q.uint32(10).string(n.id),n.callAction!=null&&Object.hasOwnProperty.call(n,"callAction")&&q.uint32(16).int32(n.callAction),n.callState!=null&&Object.hasOwnProperty.call(n,"callState")&&q.uint32(24).int32(n.callState),n.joinTime!=null&&Object.hasOwnProperty.call(n,"joinTime")&&q.uint32(32).int64(n.joinTime),n.tracks!=null&&n.tracks.length)for(let D=0;D<n.tracks.length;++D)$root.com.quick.voice.proto.Track.encode(n.tracks[D],q.uint32(42).fork()).ldelim();return n.permissions!=null&&Object.hasOwnProperty.call(n,"permissions")&&q.uint32(48).int32(n.permissions),n.isPublished!=null&&Object.hasOwnProperty.call(n,"isPublished")&&q.uint32(56).bool(n.isPublished),n.behavior!=null&&Object.hasOwnProperty.call(n,"behavior")&&q.uint32(64).int32(n.behavior),n.channelCache!=null&&Object.hasOwnProperty.call(n,"channelCache")&&$root.com.quick.voice.proto.DataChannelCacheInfo.encode(n.channelCache,q.uint32(74).fork()).ldelim(),q},a.encodeDelimited=function(n,q){return this.encode(n,q).ldelim()},a.decode=function(n,q){n instanceof $Reader||(n=$Reader.create(n));let D=q===void 0?n.len:n.pos+q,z=new $root.com.quick.voice.proto.User;for(;n.pos<D;){let K=n.uint32();switch(K>>>3){case 1:{z.id=n.string();break}case 2:{z.callAction=n.int32();break}case 3:{z.callState=n.int32();break}case 4:{z.joinTime=n.int64();break}case 5:{z.tracks&&z.tracks.length||(z.tracks=[]),z.tracks.push($root.com.quick.voice.proto.Track.decode(n,n.uint32()));break}case 6:{z.permissions=n.int32();break}case 7:{z.isPublished=n.bool();break}case 8:{z.behavior=n.int32();break}case 9:{z.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.decode(n,n.uint32());break}default:n.skipType(K&7);break}}return z},a.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},a.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 q=0;q<n.tracks.length;++q){let D=$root.com.quick.voice.proto.Track.verify(n.tracks[q]);if(D)return"tracks."+D}}if(n.permissions!=null&&n.hasOwnProperty("permissions")&&!$util.isInteger(n.permissions))return"permissions: integer expected";if(n.isPublished!=null&&n.hasOwnProperty("isPublished")&&typeof n.isPublished!="boolean")return"isPublished: boolean expected";if(n.behavior!=null&&n.hasOwnProperty("behavior")&&!$util.isInteger(n.behavior))return"behavior: integer expected";if(n.channelCache!=null&&n.hasOwnProperty("channelCache")){let q=$root.com.quick.voice.proto.DataChannelCacheInfo.verify(n.channelCache);if(q)return"channelCache."+q}return null},a.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.User)return n;let q=new $root.com.quick.voice.proto.User;if(n.id!=null&&(q.id=String(n.id)),n.callAction!=null&&(q.callAction=n.callAction|0),n.callState!=null&&(q.callState=n.callState|0),n.joinTime!=null&&($util.Long?(q.joinTime=$util.Long.fromValue(n.joinTime)).unsigned=!1:typeof n.joinTime=="string"?q.joinTime=parseInt(n.joinTime,10):typeof n.joinTime=="number"?q.joinTime=n.joinTime:typeof n.joinTime=="object"&&(q.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");q.tracks=[];for(let D=0;D<n.tracks.length;++D){if(typeof n.tracks[D]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");q.tracks[D]=$root.com.quick.voice.proto.Track.fromObject(n.tracks[D])}}if(n.permissions!=null&&(q.permissions=n.permissions|0),n.isPublished!=null&&(q.isPublished=!!n.isPublished),n.behavior!=null&&(q.behavior=n.behavior|0),n.channelCache!=null){if(typeof n.channelCache!="object")throw TypeError(".com.quick.voice.proto.User.channelCache: object expected");q.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.fromObject(n.channelCache)}return q},a.toObject=function(n,q){q||(q={});let D={};if((q.arrays||q.defaults)&&(D.tracks=[]),q.defaults&&(D.id=""),n.id!=null&&n.hasOwnProperty("id")&&(D.id=n.id),n.callAction!=null&&n.hasOwnProperty("callAction")&&(D.callAction=n.callAction,q.oneofs&&(D._callAction="callAction")),n.callState!=null&&n.hasOwnProperty("callState")&&(D.callState=n.callState,q.oneofs&&(D._callState="callState")),n.joinTime!=null&&n.hasOwnProperty("joinTime")&&(typeof n.joinTime=="number"?D.joinTime=q.longs===String?String(n.joinTime):n.joinTime:D.joinTime=q.longs===String?$util.Long.prototype.toString.call(n.joinTime):q.longs===Number?new $util.LongBits(n.joinTime.low>>>0,n.joinTime.high>>>0).toNumber():n.joinTime,q.oneofs&&(D._joinTime="joinTime")),n.tracks&&n.tracks.length){D.tracks=[];for(let z=0;z<n.tracks.length;++z)D.tracks[z]=$root.com.quick.voice.proto.Track.toObject(n.tracks[z],q)}return n.permissions!=null&&n.hasOwnProperty("permissions")&&(D.permissions=n.permissions,q.oneofs&&(D._permissions="permissions")),n.isPublished!=null&&n.hasOwnProperty("isPublished")&&(D.isPublished=n.isPublished,q.oneofs&&(D._isPublished="isPublished")),n.behavior!=null&&n.hasOwnProperty("behavior")&&(D.behavior=n.behavior,q.oneofs&&(D._behavior="behavior")),n.channelCache!=null&&n.hasOwnProperty("channelCache")&&(D.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.toObject(n.channelCache,q),q.oneofs&&(D._channelCache="channelCache")),D},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.User"},a}(),Z.DataChannelCacheInfo=function(){function a(O){if(this.channels=[],O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.channels=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,n){if(n||(n=$Writer.create()),e.channels!=null&&e.channels.length)for(let q=0;q<e.channels.length;++q)$root.com.quick.voice.proto.DataChannel.encode(e.channels[q],n.uint32(10).fork()).ldelim();return n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.DataChannelCacheInfo;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.channels&&D.channels.length||(D.channels=[]),D.channels.push($root.com.quick.voice.proto.DataChannel.decode(e,e.uint32()));break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let n=0;n<e.channels.length;++n){let q=$root.com.quick.voice.proto.DataChannel.verify(e.channels[n]);if(q)return"channels."+q}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.DataChannelCacheInfo)return e;let n=new $root.com.quick.voice.proto.DataChannelCacheInfo;if(e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: array expected");n.channels=[];for(let q=0;q<e.channels.length;++q){if(typeof e.channels[q]!="object")throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: object expected");n.channels[q]=$root.com.quick.voice.proto.DataChannel.fromObject(e.channels[q])}}return n},a.toObject=function(e,n){n||(n={});let q={};if((n.arrays||n.defaults)&&(q.channels=[]),e.channels&&e.channels.length){q.channels=[];for(let D=0;D<e.channels.length;++D)q.channels[D]=$root.com.quick.voice.proto.DataChannel.toObject(e.channels[D],n)}return q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.DataChannelCacheInfo"},a}(),Z.DataChannel=function(){function a(e){if(e)for(let n=Object.keys(e),q=0;q<n.length;++q)e[n[q]]!=null&&(this[n[q]]=e[n[q]])}a.prototype.dataChannelName="",a.prototype.id=null;let O;return Object.defineProperty(a.prototype,"_id",{get:$util.oneOfGetter(O=["id"]),set:$util.oneOfSetter(O)}),a.create=function(n){return new a(n)},a.encode=function(n,q){return q||(q=$Writer.create()),n.dataChannelName!=null&&Object.hasOwnProperty.call(n,"dataChannelName")&&q.uint32(10).string(n.dataChannelName),n.id!=null&&Object.hasOwnProperty.call(n,"id")&&q.uint32(16).int32(n.id),q},a.encodeDelimited=function(n,q){return this.encode(n,q).ldelim()},a.decode=function(n,q){n instanceof $Reader||(n=$Reader.create(n));let D=q===void 0?n.len:n.pos+q,z=new $root.com.quick.voice.proto.DataChannel;for(;n.pos<D;){let K=n.uint32();switch(K>>>3){case 1:{z.dataChannelName=n.string();break}case 2:{z.id=n.int32();break}default:n.skipType(K&7);break}}return z},a.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!="object"||n===null?"object expected":n.dataChannelName!=null&&n.hasOwnProperty("dataChannelName")&&!$util.isString(n.dataChannelName)?"dataChannelName: string expected":n.id!=null&&n.hasOwnProperty("id")&&!$util.isInteger(n.id)?"id: integer expected":null},a.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.DataChannel)return n;let q=new $root.com.quick.voice.proto.DataChannel;return n.dataChannelName!=null&&(q.dataChannelName=String(n.dataChannelName)),n.id!=null&&(q.id=n.id|0),q},a.toObject=function(n,q){q||(q={});let D={};return q.defaults&&(D.dataChannelName=""),n.dataChannelName!=null&&n.hasOwnProperty("dataChannelName")&&(D.dataChannelName=n.dataChannelName),n.id!=null&&n.hasOwnProperty("id")&&(D.id=n.id,q.oneofs&&(D._id="id")),D},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.DataChannel"},a}(),Z.Login=function(){function a(O){if(O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.appid="",a.prototype.userId="",a.prototype.sdkToken="",a.create=function(e){return new a(e)},a.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},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.Login;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.appid=e.string();break}case 2:{D.userId=e.string();break}case 3:{D.sdkToken=e.string();break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.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},a.toObject=function(e,n){n||(n={});let q={};return n.defaults&&(q.appid="",q.userId="",q.sdkToken=""),e.appid!=null&&e.hasOwnProperty("appid")&&(q.appid=e.appid),e.userId!=null&&e.hasOwnProperty("userId")&&(q.userId=e.userId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(q.sdkToken=e.sdkToken),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.Login"},a}(),Z.Track=function(){function a(e){if(e)for(let n=Object.keys(e),q=0;q<n.length;++q)e[n[q]]!=null&&(this[n[q]]=e[n[q]])}a.prototype.mid="",a.prototype.trackName=null,a.prototype.location=null,a.prototype.userId=null,a.prototype.code=null,a.prototype.desc=null,a.prototype.type=null,a.prototype.isValid=null,a.prototype.simulcast=null;let O;return Object.defineProperty(a.prototype,"_trackName",{get:$util.oneOfGetter(O=["trackName"]),set:$util.oneOfSetter(O)}),Object.defineProperty(a.prototype,"_location",{get:$util.oneOfGetter(O=["location"]),set:$util.oneOfSetter(O)}),Object.defineProperty(a.prototype,"_userId",{get:$util.oneOfGetter(O=["userId"]),set:$util.oneOfSetter(O)}),Object.defineProperty(a.prototype,"_code",{get:$util.oneOfGetter(O=["code"]),set:$util.oneOfSetter(O)}),Object.defineProperty(a.prototype,"_desc",{get:$util.oneOfGetter(O=["desc"]),set:$util.oneOfSetter(O)}),Object.defineProperty(a.prototype,"_type",{get:$util.oneOfGetter(O=["type"]),set:$util.oneOfSetter(O)}),Object.defineProperty(a.prototype,"_isValid",{get:$util.oneOfGetter(O=["isValid"]),set:$util.oneOfSetter(O)}),Object.defineProperty(a.prototype,"_simulcast",{get:$util.oneOfGetter(O=["simulcast"]),set:$util.oneOfSetter(O)}),a.create=function(n){return new a(n)},a.encode=function(n,q){return q||(q=$Writer.create()),n.mid!=null&&Object.hasOwnProperty.call(n,"mid")&&q.uint32(10).string(n.mid),n.trackName!=null&&Object.hasOwnProperty.call(n,"trackName")&&q.uint32(18).string(n.trackName),n.location!=null&&Object.hasOwnProperty.call(n,"location")&&q.uint32(26).string(n.location),n.userId!=null&&Object.hasOwnProperty.call(n,"userId")&&q.uint32(34).string(n.userId),n.code!=null&&Object.hasOwnProperty.call(n,"code")&&q.uint32(40).int32(n.code),n.desc!=null&&Object.hasOwnProperty.call(n,"desc")&&q.uint32(50).string(n.desc),n.type!=null&&Object.hasOwnProperty.call(n,"type")&&q.uint32(56).int32(n.type),n.isValid!=null&&Object.hasOwnProperty.call(n,"isValid")&&q.uint32(64).bool(n.isValid),n.simulcast!=null&&Object.hasOwnProperty.call(n,"simulcast")&&q.uint32(74).string(n.simulcast),q},a.encodeDelimited=function(n,q){return this.encode(n,q).ldelim()},a.decode=function(n,q){n instanceof $Reader||(n=$Reader.create(n));let D=q===void 0?n.len:n.pos+q,z=new $root.com.quick.voice.proto.Track;for(;n.pos<D;){let K=n.uint32();switch(K>>>3){case 1:{z.mid=n.string();break}case 2:{z.trackName=n.string();break}case 3:{z.location=n.string();break}case 4:{z.userId=n.string();break}case 5:{z.code=n.int32();break}case 6:{z.desc=n.string();break}case 7:{z.type=n.int32();break}case 8:{z.isValid=n.bool();break}case 9:{z.simulcast=n.string();break}default:n.skipType(K&7);break}}return z},a.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},a.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":n.simulcast!=null&&n.hasOwnProperty("simulcast")&&!$util.isString(n.simulcast)?"simulcast: string expected":null},a.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.Track)return n;let q=new $root.com.quick.voice.proto.Track;switch(n.mid!=null&&(q.mid=String(n.mid)),n.trackName!=null&&(q.trackName=String(n.trackName)),n.location!=null&&(q.location=String(n.location)),n.userId!=null&&(q.userId=String(n.userId)),n.code!=null&&(q.code=n.code|0),n.desc!=null&&(q.desc=String(n.desc)),n.type){default:if(typeof n.type=="number"){q.type=n.type;break}break;case"Microphone":case 0:q.type=0;break;case"Camera":case 1:q.type=1;break;case"Screen":case 2:q.type=2;break;case"SystemVoice":case 3:q.type=3;break}return n.isValid!=null&&(q.isValid=!!n.isValid),n.simulcast!=null&&(q.simulcast=String(n.simulcast)),q},a.toObject=function(n,q){q||(q={});let D={};return q.defaults&&(D.mid=""),n.mid!=null&&n.hasOwnProperty("mid")&&(D.mid=n.mid),n.trackName!=null&&n.hasOwnProperty("trackName")&&(D.trackName=n.trackName,q.oneofs&&(D._trackName="trackName")),n.location!=null&&n.hasOwnProperty("location")&&(D.location=n.location,q.oneofs&&(D._location="location")),n.userId!=null&&n.hasOwnProperty("userId")&&(D.userId=n.userId,q.oneofs&&(D._userId="userId")),n.code!=null&&n.hasOwnProperty("code")&&(D.code=n.code,q.oneofs&&(D._code="code")),n.desc!=null&&n.hasOwnProperty("desc")&&(D.desc=n.desc,q.oneofs&&(D._desc="desc")),n.type!=null&&n.hasOwnProperty("type")&&(D.type=q.enums===String?$root.com.quick.voice.proto.TrackType[n.type]===void 0?n.type:$root.com.quick.voice.proto.TrackType[n.type]:n.type,q.oneofs&&(D._type="type")),n.isValid!=null&&n.hasOwnProperty("isValid")&&(D.isValid=n.isValid,q.oneofs&&(D._isValid="isValid")),n.simulcast!=null&&n.hasOwnProperty("simulcast")&&(D.simulcast=n.simulcast,q.oneofs&&(D._simulcast="simulcast")),D},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.Track"},a}(),Z.JoinReq=function(){function a(e){if(e)for(let n=Object.keys(e),q=0;q<n.length;++q)e[n[q]]!=null&&(this[n[q]]=e[n[q]])}a.prototype.roomId="",a.prototype.user=null,a.prototype.callType=0,a.prototype.token=null;let O;return Object.defineProperty(a.prototype,"_token",{get:$util.oneOfGetter(O=["token"]),set:$util.oneOfSetter(O)}),a.create=function(n){return new a(n)},a.encode=function(n,q){return q||(q=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&q.uint32(10).string(n.roomId),n.user!=null&&Object.hasOwnProperty.call(n,"user")&&$root.com.quick.voice.proto.User.encode(n.user,q.uint32(18).fork()).ldelim(),n.callType!=null&&Object.hasOwnProperty.call(n,"callType")&&q.uint32(24).int32(n.callType),n.token!=null&&Object.hasOwnProperty.call(n,"token")&&q.uint32(34).string(n.token),q},a.encodeDelimited=function(n,q){return this.encode(n,q).ldelim()},a.decode=function(n,q){n instanceof $Reader||(n=$Reader.create(n));let D=q===void 0?n.len:n.pos+q,z=new $root.com.quick.voice.proto.JoinReq;for(;n.pos<D;){let K=n.uint32();switch(K>>>3){case 1:{z.roomId=n.string();break}case 2:{z.user=$root.com.quick.voice.proto.User.decode(n,n.uint32());break}case 3:{z.callType=n.int32();break}case 4:{z.token=n.string();break}default:n.skipType(K&7);break}}return z},a.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},a.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 q=$root.com.quick.voice.proto.User.verify(n.user);if(q)return"user."+q}if(n.callType!=null&&n.hasOwnProperty("callType"))switch(n.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return n.token!=null&&n.hasOwnProperty("token")&&!$util.isString(n.token)?"token: string expected":null},a.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.JoinReq)return n;let q=new $root.com.quick.voice.proto.JoinReq;if(n.roomId!=null&&(q.roomId=String(n.roomId)),n.user!=null){if(typeof n.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");q.user=$root.com.quick.voice.proto.User.fromObject(n.user)}switch(n.callType){default:if(typeof n.callType=="number"){q.callType=n.callType;break}break;case"Normal":case 0:q.callType=0;break;case"Meeting":case 1:q.callType=1;break;case"Live":case 2:q.callType=2;break}return n.token!=null&&(q.token=String(n.token)),q},a.toObject=function(n,q){q||(q={});let D={};return q.defaults&&(D.roomId="",D.user=null,D.callType=q.enums===String?"Normal":0),n.roomId!=null&&n.hasOwnProperty("roomId")&&(D.roomId=n.roomId),n.user!=null&&n.hasOwnProperty("user")&&(D.user=$root.com.quick.voice.proto.User.toObject(n.user,q)),n.callType!=null&&n.hasOwnProperty("callType")&&(D.callType=q.enums===String?$root.com.quick.voice.proto.CallType[n.callType]===void 0?n.callType:$root.com.quick.voice.proto.CallType[n.callType]:n.callType),n.token!=null&&n.hasOwnProperty("token")&&(D.token=n.token,q.oneofs&&(D._token="token")),D},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.JoinReq"},a}(),Z.JoinRsp=function(){function a(O){if(this.roomUsers=[],O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.roomId="",a.prototype.roomUsers=$util.emptyArray,a.prototype.callType=0,a.create=function(e){return new a(e)},a.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 q=0;q<e.roomUsers.length;++q)$root.com.quick.voice.proto.User.encode(e.roomUsers[q],n.uint32(18).fork()).ldelim();return e.callType!=null&&Object.hasOwnProperty.call(e,"callType")&&n.uint32(24).int32(e.callType),n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.JoinRsp;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.roomId=e.string();break}case 2:{D.roomUsers&&D.roomUsers.length||(D.roomUsers=[]),D.roomUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 3:{D.callType=e.int32();break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 q=$root.com.quick.voice.proto.User.verify(e.roomUsers[n]);if(q)return"roomUsers."+q}}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},a.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 q=0;q<e.roomUsers.length;++q){if(typeof e.roomUsers[q]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");n.roomUsers[q]=$root.com.quick.voice.proto.User.fromObject(e.roomUsers[q])}}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},a.toObject=function(e,n){n||(n={});let q={};if((n.arrays||n.defaults)&&(q.roomUsers=[]),n.defaults&&(q.roomId="",q.callType=n.enums===String?"Normal":0),e.roomId!=null&&e.hasOwnProperty("roomId")&&(q.roomId=e.roomId),e.roomUsers&&e.roomUsers.length){q.roomUsers=[];for(let D=0;D<e.roomUsers.length;++D)q.roomUsers[D]=$root.com.quick.voice.proto.User.toObject(e.roomUsers[D],n)}return e.callType!=null&&e.hasOwnProperty("callType")&&(q.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),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinRsp"},a}(),Z.JoinNotify=function(){function a(O){if(O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.roomId="",a.prototype.user=null,a.create=function(e){return new a(e)},a.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},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.JoinNotify;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.roomId=e.string();break}case 2:{D.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.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},a.toObject=function(e,n){n||(n={});let q={};return n.defaults&&(q.roomId="",q.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(q.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(q.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinNotify"},a}(),Z.ConnectCFReq=function(){function a(O){if(O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.sdp="",a.create=function(e){return new a(e)},a.encode=function(e,n){return n||(n=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&n.uint32(10).string(e.sdp),n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.ConnectCFReq;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.sdp=e.string();break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.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},a.toObject=function(e,n){n||(n={});let q={};return n.defaults&&(q.sdp=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(q.sdp=e.sdp),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ConnectCFReq"},a}(),Z.ConnectCFRsp=function(){function a(O){if(this.subscribeUsers=[],O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.remoteSdp="",a.prototype.subscribeUsers=$util.emptyArray,a.create=function(e){return new a(e)},a.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 q=0;q<e.subscribeUsers.length;++q)$root.com.quick.voice.proto.User.encode(e.subscribeUsers[q],n.uint32(18).fork()).ldelim();return n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.ConnectCFRsp;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.remoteSdp=e.string();break}case 2:{D.subscribeUsers&&D.subscribeUsers.length||(D.subscribeUsers=[]),D.subscribeUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 q=$root.com.quick.voice.proto.User.verify(e.subscribeUsers[n]);if(q)return"subscribeUsers."+q}}return null},a.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 q=0;q<e.subscribeUsers.length;++q){if(typeof e.subscribeUsers[q]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");n.subscribeUsers[q]=$root.com.quick.voice.proto.User.fromObject(e.subscribeUsers[q])}}return n},a.toObject=function(e,n){n||(n={});let q={};if((n.arrays||n.defaults)&&(q.subscribeUsers=[]),n.defaults&&(q.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(q.remoteSdp=e.remoteSdp),e.subscribeUsers&&e.subscribeUsers.length){q.subscribeUsers=[];for(let D=0;D<e.subscribeUsers.length;++D)q.subscribeUsers[D]=$root.com.quick.voice.proto.User.toObject(e.subscribeUsers[D],n)}return q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ConnectCFRsp"},a}(),Z.PublishReq=function(){function a(e){if(this.tracks=[],e)for(let n=Object.keys(e),q=0;q<n.length;++q)e[n[q]]!=null&&(this[n[q]]=e[n[q]])}a.prototype.sdp="",a.prototype.tracks=$util.emptyArray,a.prototype.callAction=0,a.prototype.recreate=null;let O;return Object.defineProperty(a.prototype,"_recreate",{get:$util.oneOfGetter(O=["recreate"]),set:$util.oneOfSetter(O)}),a.create=function(n){return new a(n)},a.encode=function(n,q){if(q||(q=$Writer.create()),n.sdp!=null&&Object.hasOwnProperty.call(n,"sdp")&&q.uint32(10).string(n.sdp),n.tracks!=null&&n.tracks.length)for(let D=0;D<n.tracks.length;++D)$root.com.quick.voice.proto.Track.encode(n.tracks[D],q.uint32(18).fork()).ldelim();return n.callAction!=null&&Object.hasOwnProperty.call(n,"callAction")&&q.uint32(24).int32(n.callAction),n.recreate!=null&&Object.hasOwnProperty.call(n,"recreate")&&q.uint32(32).bool(n.recreate),q},a.encodeDelimited=function(n,q){return this.encode(n,q).ldelim()},a.decode=function(n,q){n instanceof $Reader||(n=$Reader.create(n));let D=q===void 0?n.len:n.pos+q,z=new $root.com.quick.voice.proto.PublishReq;for(;n.pos<D;){let K=n.uint32();switch(K>>>3){case 1:{z.sdp=n.string();break}case 2:{z.tracks&&z.tracks.length||(z.tracks=[]),z.tracks.push($root.com.quick.voice.proto.Track.decode(n,n.uint32()));break}case 3:{z.callAction=n.int32();break}case 4:{z.recreate=n.bool();break}default:n.skipType(K&7);break}}return z},a.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},a.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 q=0;q<n.tracks.length;++q){let D=$root.com.quick.voice.proto.Track.verify(n.tracks[q]);if(D)return"tracks."+D}}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},a.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.PublishReq)return n;let q=new $root.com.quick.voice.proto.PublishReq;if(n.sdp!=null&&(q.sdp=String(n.sdp)),n.tracks){if(!Array.isArray(n.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");q.tracks=[];for(let D=0;D<n.tracks.length;++D){if(typeof n.tracks[D]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");q.tracks[D]=$root.com.quick.voice.proto.Track.fromObject(n.tracks[D])}}return n.callAction!=null&&(q.callAction=n.callAction|0),n.recreate!=null&&(q.recreate=!!n.recreate),q},a.toObject=function(n,q){q||(q={});let D={};if((q.arrays||q.defaults)&&(D.tracks=[]),q.defaults&&(D.sdp="",D.callAction=0),n.sdp!=null&&n.hasOwnProperty("sdp")&&(D.sdp=n.sdp),n.tracks&&n.tracks.length){D.tracks=[];for(let z=0;z<n.tracks.length;++z)D.tracks[z]=$root.com.quick.voice.proto.Track.toObject(n.tracks[z],q)}return n.callAction!=null&&n.hasOwnProperty("callAction")&&(D.callAction=n.callAction),n.recreate!=null&&n.hasOwnProperty("recreate")&&(D.recreate=n.recreate,q.oneofs&&(D._recreate="recreate")),D},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.PublishReq"},a}(),Z.PublishRsp=function(){function a(O){if(O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.remoteSdp="",a.create=function(e){return new a(e)},a.encode=function(e,n){return n||(n=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&n.uint32(10).string(e.remoteSdp),n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.PublishRsp;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.remoteSdp=e.string();break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.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},a.toObject=function(e,n){n||(n={});let q={};return n.defaults&&(q.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(q.remoteSdp=e.remoteSdp),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PublishRsp"},a}(),Z.PublishNotify=function(){function a(O){if(O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.roomId="",a.prototype.user=null,a.create=function(e){return new a(e)},a.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},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.PublishNotify;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.roomId=e.string();break}case 2:{D.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.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},a.toObject=function(e,n){n||(n={});let q={};return n.defaults&&(q.roomId="",q.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(q.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(q.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PublishNotify"},a}(),Z.SubscribeReq=function(){function a(O){if(this.users=[],O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.users=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,n){if(n||(n=$Writer.create()),e.users!=null&&e.users.length)for(let q=0;q<e.users.length;++q)$root.com.quick.voice.proto.User.encode(e.users[q],n.uint32(10).fork()).ldelim();return n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.SubscribeReq;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.users&&D.users.length||(D.users=[]),D.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 q=$root.com.quick.voice.proto.User.verify(e.users[n]);if(q)return"users."+q}}return null},a.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 q=0;q<e.users.length;++q){if(typeof e.users[q]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");n.users[q]=$root.com.quick.voice.proto.User.fromObject(e.users[q])}}return n},a.toObject=function(e,n){n||(n={});let q={};if((n.arrays||n.defaults)&&(q.users=[]),e.users&&e.users.length){q.users=[];for(let D=0;D<e.users.length;++D)q.users[D]=$root.com.quick.voice.proto.User.toObject(e.users[D],n)}return q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SubscribeReq"},a}(),Z.SubscribeRsp=function(){function a(O){if(this.users=[],O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.remoteSdp="",a.prototype.users=$util.emptyArray,a.create=function(e){return new a(e)},a.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 q=0;q<e.users.length;++q)$root.com.quick.voice.proto.User.encode(e.users[q],n.uint32(18).fork()).ldelim();return n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.SubscribeRsp;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.remoteSdp=e.string();break}case 2:{D.users&&D.users.length||(D.users=[]),D.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 q=$root.com.quick.voice.proto.User.verify(e.users[n]);if(q)return"users."+q}}return null},a.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 q=0;q<e.users.length;++q){if(typeof e.users[q]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");n.users[q]=$root.com.quick.voice.proto.User.fromObject(e.users[q])}}return n},a.toObject=function(e,n){n||(n={});let q={};if((n.arrays||n.defaults)&&(q.users=[]),n.defaults&&(q.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(q.remoteSdp=e.remoteSdp),e.users&&e.users.length){q.users=[];for(let D=0;D<e.users.length;++D)q.users[D]=$root.com.quick.voice.proto.User.toObject(e.users[D],n)}return q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SubscribeRsp"},a}(),Z.RenegotiateReq=function(){function a(O){if(O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.userId="",a.prototype.sdp="",a.create=function(e){return new a(e)},a.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},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.RenegotiateReq;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.userId=e.string();break}case 2:{D.sdp=e.string();break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.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},a.toObject=function(e,n){n||(n={});let q={};return n.defaults&&(q.userId="",q.sdp=""),e.userId!=null&&e.hasOwnProperty("userId")&&(q.userId=e.userId),e.sdp!=null&&e.hasOwnProperty("sdp")&&(q.sdp=e.sdp),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.RenegotiateReq"},a}(),Z.QuitReq=function(){function a(O){if(O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.userId="",a.prototype.roomId="",a.create=function(e){return new a(e)},a.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},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.QuitReq;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.userId=e.string();break}case 2:{D.roomId=e.string();break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.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},a.toObject=function(e,n){n||(n={});let q={};return n.defaults&&(q.userId="",q.roomId=""),e.userId!=null&&e.hasOwnProperty("userId")&&(q.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(q.roomId=e.roomId),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.QuitReq"},a}(),Z.QuitNotify=function(){function a(e){if(e)for(let n=Object.keys(e),q=0;q<n.length;++q)e[n[q]]!=null&&(this[n[q]]=e[n[q]])}a.prototype.roomId="",a.prototype.user=null,a.prototype.code=null,a.prototype.desc=null;let O;return Object.defineProperty(a.prototype,"_code",{get:$util.oneOfGetter(O=["code"]),set:$util.oneOfSetter(O)}),Object.defineProperty(a.prototype,"_desc",{get:$util.oneOfGetter(O=["desc"]),set:$util.oneOfSetter(O)}),a.create=function(n){return new a(n)},a.encode=function(n,q){return q||(q=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&q.uint32(10).string(n.roomId),n.user!=null&&Object.hasOwnProperty.call(n,"user")&&$root.com.quick.voice.proto.User.encode(n.user,q.uint32(18).fork()).ldelim(),n.code!=null&&Object.hasOwnProperty.call(n,"code")&&q.uint32(24).int32(n.code),n.desc!=null&&Object.hasOwnProperty.call(n,"desc")&&q.uint32(34).string(n.desc),q},a.encodeDelimited=function(n,q){return this.encode(n,q).ldelim()},a.decode=function(n,q){n instanceof $Reader||(n=$Reader.create(n));let D=q===void 0?n.len:n.pos+q,z=new $root.com.quick.voice.proto.QuitNotify;for(;n.pos<D;){let K=n.uint32();switch(K>>>3){case 1:{z.roomId=n.string();break}case 2:{z.user=$root.com.quick.voice.proto.User.decode(n,n.uint32());break}case 3:{z.code=n.int32();break}case 4:{z.desc=n.string();break}default:n.skipType(K&7);break}}return z},a.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},a.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 q=$root.com.quick.voice.proto.User.verify(n.user);if(q)return"user."+q}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},a.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.QuitNotify)return n;let q=new $root.com.quick.voice.proto.QuitNotify;if(n.roomId!=null&&(q.roomId=String(n.roomId)),n.user!=null){if(typeof n.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");q.user=$root.com.quick.voice.proto.User.fromObject(n.user)}return n.code!=null&&(q.code=n.code|0),n.desc!=null&&(q.desc=String(n.desc)),q},a.toObject=function(n,q){q||(q={});let D={};return q.defaults&&(D.roomId="",D.user=null),n.roomId!=null&&n.hasOwnProperty("roomId")&&(D.roomId=n.roomId),n.user!=null&&n.hasOwnProperty("user")&&(D.user=$root.com.quick.voice.proto.User.toObject(n.user,q)),n.code!=null&&n.hasOwnProperty("code")&&(D.code=n.code,q.oneofs&&(D._code="code")),n.desc!=null&&n.hasOwnProperty("desc")&&(D.desc=n.desc,q.oneofs&&(D._desc="desc")),D},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.QuitNotify"},a}(),Z.TokenExpireNotify=function(){function a(O){if(O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.roomId="",a.create=function(e){return new a(e)},a.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.TokenExpireNotify;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.roomId=e.string();break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.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},a.toObject=function(e,n){n||(n={});let q={};return n.defaults&&(q.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(q.roomId=e.roomId),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.TokenExpireNotify"},a}(),Z.UpdateTokenReq=function(){function a(O){if(O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.roomId="",a.prototype.sdkToken="",a.create=function(e){return new a(e)},a.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},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.UpdateTokenReq;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.roomId=e.string();break}case 2:{D.sdkToken=e.string();break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.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},a.toObject=function(e,n){n||(n={});let q={};return n.defaults&&(q.roomId="",q.sdkToken=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(q.roomId=e.roomId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(q.sdkToken=e.sdkToken),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTokenReq"},a}(),Z.NetQualityChange=function(){function a(O){if(O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.userId="",a.prototype.roomId="",a.prototype.egress=0,a.prototype.ingress=0,a.create=function(e){return new a(e)},a.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},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.NetQualityChange;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.userId=e.string();break}case 2:{D.roomId=e.string();break}case 3:{D.egress=e.int32();break}case 4:{D.ingress=e.int32();break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.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},a.toObject=function(e,n){n||(n={});let q={};return n.defaults&&(q.userId="",q.roomId="",q.egress=0,q.ingress=0),e.userId!=null&&e.hasOwnProperty("userId")&&(q.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(q.roomId=e.roomId),e.egress!=null&&e.hasOwnProperty("egress")&&(q.egress=e.egress),e.ingress!=null&&e.hasOwnProperty("ingress")&&(q.ingress=e.ingress),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.NetQualityChange"},a}(),Z.NetQualityNotify=function(){function a(O){if(this.qualities=[],O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.qualities=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,n){if(n||(n=$Writer.create()),e.qualities!=null&&e.qualities.length)for(let q=0;q<e.qualities.length;++q)$root.com.quick.voice.proto.NetQualityChange.encode(e.qualities[q],n.uint32(10).fork()).ldelim();return n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.NetQualityNotify;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.qualities&&D.qualities.length||(D.qualities=[]),D.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(e,e.uint32()));break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 q=$root.com.quick.voice.proto.NetQualityChange.verify(e.qualities[n]);if(q)return"qualities."+q}}return null},a.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 q=0;q<e.qualities.length;++q){if(typeof e.qualities[q]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");n.qualities[q]=$root.com.quick.voice.proto.NetQualityChange.fromObject(e.qualities[q])}}return n},a.toObject=function(e,n){n||(n={});let q={};if((n.arrays||n.defaults)&&(q.qualities=[]),e.qualities&&e.qualities.length){q.qualities=[];for(let D=0;D<e.qualities.length;++D)q.qualities[D]=$root.com.quick.voice.proto.NetQualityChange.toObject(e.qualities[D],n)}return q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.NetQualityNotify"},a}(),Z.UpdateCall=function(){function a(O){if(O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.roomId="",a.prototype.user=null,a.create=function(e){return new a(e)},a.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},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.UpdateCall;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.roomId=e.string();break}case 2:{D.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.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},a.toObject=function(e,n){n||(n={});let q={};return n.defaults&&(q.roomId="",q.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(q.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(q.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateCall"},a}(),Z.SyncRoomInfoReq=function(){function a(O){if(O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.roomId="",a.prototype.user=null,a.create=function(e){return new a(e)},a.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},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.roomId=e.string();break}case 2:{D.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.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},a.toObject=function(e,n){n||(n={});let q={};return n.defaults&&(q.roomId="",q.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(q.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(q.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SyncRoomInfoReq"},a}(),Z.SyncRoomInfoRsp=function(){function a(O){if(this.users=[],O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.roomId="",a.prototype.isValid=!1,a.prototype.users=$util.emptyArray,a.prototype.isActive=!1,a.create=function(e){return new a(e)},a.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 q=0;q<e.users.length;++q)$root.com.quick.voice.proto.User.encode(e.users[q],n.uint32(26).fork()).ldelim();return e.isActive!=null&&Object.hasOwnProperty.call(e,"isActive")&&n.uint32(32).bool(e.isActive),n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.roomId=e.string();break}case 2:{D.isValid=e.bool();break}case 3:{D.users&&D.users.length||(D.users=[]),D.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 4:{D.isActive=e.bool();break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 q=$root.com.quick.voice.proto.User.verify(e.users[n]);if(q)return"users."+q}}return e.isActive!=null&&e.hasOwnProperty("isActive")&&typeof e.isActive!="boolean"?"isActive: boolean expected":null},a.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 q=0;q<e.users.length;++q){if(typeof e.users[q]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");n.users[q]=$root.com.quick.voice.proto.User.fromObject(e.users[q])}}return e.isActive!=null&&(n.isActive=!!e.isActive),n},a.toObject=function(e,n){n||(n={});let q={};if((n.arrays||n.defaults)&&(q.users=[]),n.defaults&&(q.roomId="",q.isValid=!1,q.isActive=!1),e.roomId!=null&&e.hasOwnProperty("roomId")&&(q.roomId=e.roomId),e.isValid!=null&&e.hasOwnProperty("isValid")&&(q.isValid=e.isValid),e.users&&e.users.length){q.users=[];for(let D=0;D<e.users.length;++D)q.users[D]=$root.com.quick.voice.proto.User.toObject(e.users[D],n)}return e.isActive!=null&&e.hasOwnProperty("isActive")&&(q.isActive=e.isActive),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SyncRoomInfoRsp"},a}(),Z.UpdateTime=function(){function a(O){if(O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,a.create=function(e){return new a(e)},a.encode=function(e,n){return n||(n=$Writer.create()),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&n.uint32(8).int64(e.time),n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.UpdateTime;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.time=e.int64();break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.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},a.toObject=function(e,n){n||(n={});let q={};if(n.defaults)if($util.Long){let D=new $util.Long(0,0,!1);q.time=n.longs===String?D.toString():n.longs===Number?D.toNumber():D}else q.time=n.longs===String?"0":0;return e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?q.time=n.longs===String?String(e.time):e.time:q.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),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTime"},a}(),Z.CloseTrackReq=function(){function a(O){if(this.tracks=[],O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.sdp="",a.prototype.tracks=$util.emptyArray,a.prototype.roomId="",a.create=function(e){return new a(e)},a.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 q=0;q<e.tracks.length;++q)$root.com.quick.voice.proto.Track.encode(e.tracks[q],n.uint32(18).fork()).ldelim();return e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(26).string(e.roomId),n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.CloseTrackReq;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.sdp=e.string();break}case 2:{D.tracks&&D.tracks.length||(D.tracks=[]),D.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}case 3:{D.roomId=e.string();break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 q=$root.com.quick.voice.proto.Track.verify(e.tracks[n]);if(q)return"tracks."+q}}return e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},a.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 q=0;q<e.tracks.length;++q){if(typeof e.tracks[q]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");n.tracks[q]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[q])}}return e.roomId!=null&&(n.roomId=String(e.roomId)),n},a.toObject=function(e,n){n||(n={});let q={};if((n.arrays||n.defaults)&&(q.tracks=[]),n.defaults&&(q.sdp="",q.roomId=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(q.sdp=e.sdp),e.tracks&&e.tracks.length){q.tracks=[];for(let D=0;D<e.tracks.length;++D)q.tracks[D]=$root.com.quick.voice.proto.Track.toObject(e.tracks[D],n)}return e.roomId!=null&&e.hasOwnProperty("roomId")&&(q.roomId=e.roomId),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackReq"},a}(),Z.CloseTrackRsp=function(){function a(O){if(this.tracks=[],O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.remoteSdp="",a.prototype.tracks=$util.emptyArray,a.create=function(e){return new a(e)},a.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 q=0;q<e.tracks.length;++q)$root.com.quick.voice.proto.Track.encode(e.tracks[q],n.uint32(18).fork()).ldelim();return n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.CloseTrackRsp;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.remoteSdp=e.string();break}case 2:{D.tracks&&D.tracks.length||(D.tracks=[]),D.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 q=$root.com.quick.voice.proto.Track.verify(e.tracks[n]);if(q)return"tracks."+q}}return null},a.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 q=0;q<e.tracks.length;++q){if(typeof e.tracks[q]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");n.tracks[q]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[q])}}return n},a.toObject=function(e,n){n||(n={});let q={};if((n.arrays||n.defaults)&&(q.tracks=[]),n.defaults&&(q.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(q.remoteSdp=e.remoteSdp),e.tracks&&e.tracks.length){q.tracks=[];for(let D=0;D<e.tracks.length;++D)q.tracks[D]=$root.com.quick.voice.proto.Track.toObject(e.tracks[D],n)}return q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackRsp"},a}(),Z.CloseTrackNotify=function(){function a(O){if(O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.user=null,a.create=function(e){return new a(e)},a.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},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.CloseTrackNotify;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.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},a.toObject=function(e,n){n||(n={});let q={};return n.defaults&&(q.user=null),e.user!=null&&e.hasOwnProperty("user")&&(q.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackNotify"},a}(),Z.ToggleLiveRoomReq=function(){function a(O){if(O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.roomId="",a.create=function(e){return new a(e)},a.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.ToggleLiveRoomReq;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.roomId=e.string();break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.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},a.toObject=function(e,n){n||(n={});let q={};return n.defaults&&(q.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(q.roomId=e.roomId),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ToggleLiveRoomReq"},a}(),Z.ToggleLiveRoomRsq=function(){function a(O){if(this.roomUsers=[],O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.roomId="",a.prototype.hash="",a.prototype.roomUsers=$util.emptyArray,a.create=function(e){return new a(e)},a.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 q=0;q<e.roomUsers.length;++q)$root.com.quick.voice.proto.User.encode(e.roomUsers[q],n.uint32(26).fork()).ldelim();return n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.roomId=e.string();break}case 2:{D.hash=e.string();break}case 3:{D.roomUsers&&D.roomUsers.length||(D.roomUsers=[]),D.roomUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 q=$root.com.quick.voice.proto.User.verify(e.roomUsers[n]);if(q)return"roomUsers."+q}}return null},a.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 q=0;q<e.roomUsers.length;++q){if(typeof e.roomUsers[q]!="object")throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: object expected");n.roomUsers[q]=$root.com.quick.voice.proto.User.fromObject(e.roomUsers[q])}}return n},a.toObject=function(e,n){n||(n={});let q={};if((n.arrays||n.defaults)&&(q.roomUsers=[]),n.defaults&&(q.roomId="",q.hash=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(q.roomId=e.roomId),e.hash!=null&&e.hasOwnProperty("hash")&&(q.hash=e.hash),e.roomUsers&&e.roomUsers.length){q.roomUsers=[];for(let D=0;D<e.roomUsers.length;++D)q.roomUsers[D]=$root.com.quick.voice.proto.User.toObject(e.roomUsers[D],n)}return q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ToggleLiveRoomRsq"},a}(),Z.TrackType=function(){const a={},O=Object.create(a);return O[a[0]="Microphone"]=0,O[a[1]="Camera"]=1,O[a[2]="Screen"]=2,O[a[3]="SystemVoice"]=3,O}(),Z.ReportInfoReq=function(){function a(O){if(O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.actionEvent="",a.prototype.userId="",a.prototype.platform="",a.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,a.prototype.actionData="",a.create=function(e){return new a(e)},a.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},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.ReportInfoReq;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.actionEvent=e.string();break}case 2:{D.userId=e.string();break}case 3:{D.platform=e.string();break}case 4:{D.time=e.int64();break}case 5:{D.actionData=e.string();break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.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},a.toObject=function(e,n){n||(n={});let q={};if(n.defaults){if(q.actionEvent="",q.userId="",q.platform="",$util.Long){let D=new $util.Long(0,0,!1);q.time=n.longs===String?D.toString():n.longs===Number?D.toNumber():D}else q.time=n.longs===String?"0":0;q.actionData=""}return e.actionEvent!=null&&e.hasOwnProperty("actionEvent")&&(q.actionEvent=e.actionEvent),e.userId!=null&&e.hasOwnProperty("userId")&&(q.userId=e.userId),e.platform!=null&&e.hasOwnProperty("platform")&&(q.platform=e.platform),e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?q.time=n.longs===String?String(e.time):e.time:q.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")&&(q.actionData=e.actionData),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ReportInfoReq"},a}(),Z.UpdatePermissions=function(){function a(O){if(O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.roomId="",a.prototype.user=null,a.create=function(e){return new a(e)},a.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},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.UpdatePermissions;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.roomId=e.string();break}case 2:{D.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.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},a.toObject=function(e,n){n||(n={});let q={};return n.defaults&&(q.roomId="",q.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(q.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(q.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdatePermissions"},a}(),Z.CallType=function(){const a={},O=Object.create(a);return O[a[0]="Normal"]=0,O[a[1]="Meeting"]=1,O[a[2]="Live"]=2,O}(),Z.QuitNotifyCode=function(){const a={},O=Object.create(a);return O[a[0]="NormalQuit"]=0,O[a[2021]="Timeout"]=2021,O[a[2011]="TokenExpired"]=2011,O[a[2022]="KickOut"]=2022,O[a[2023]="EndPk"]=2023,O[a[2024]="EndLive"]=2024,O}(),Z.UserBehavior=function(){function a(O){if(O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.type=0,a.prototype.behavior=!1,a.create=function(e){return new a(e)},a.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},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.UserBehavior;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.type=e.int32();break}case 2:{D.behavior=e.bool();break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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},a.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},a.toObject=function(e,n){n||(n={});let q={};return n.defaults&&(q.type=n.enums===String?"Microphone":0,q.behavior=!1),e.type!=null&&e.hasOwnProperty("type")&&(q.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")&&(q.behavior=e.behavior),q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UserBehavior"},a}(),Z.PreventUser=function(){function a(O){if(this.behaviors=[],O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.id="",a.prototype.behaviors=$util.emptyArray,a.create=function(e){return new a(e)},a.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 q=0;q<e.behaviors.length;++q)$root.com.quick.voice.proto.UserBehavior.encode(e.behaviors[q],n.uint32(18).fork()).ldelim();return n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.PreventUser;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.id=e.string();break}case 2:{D.behaviors&&D.behaviors.length||(D.behaviors=[]),D.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(e,e.uint32()));break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 q=$root.com.quick.voice.proto.UserBehavior.verify(e.behaviors[n]);if(q)return"behaviors."+q}}return null},a.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 q=0;q<e.behaviors.length;++q){if(typeof e.behaviors[q]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");n.behaviors[q]=$root.com.quick.voice.proto.UserBehavior.fromObject(e.behaviors[q])}}return n},a.toObject=function(e,n){n||(n={});let q={};if((n.arrays||n.defaults)&&(q.behaviors=[]),n.defaults&&(q.id=""),e.id!=null&&e.hasOwnProperty("id")&&(q.id=e.id),e.behaviors&&e.behaviors.length){q.behaviors=[];for(let D=0;D<e.behaviors.length;++D)q.behaviors[D]=$root.com.quick.voice.proto.UserBehavior.toObject(e.behaviors[D],n)}return q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUser"},a}(),Z.PreventUsersBehaviorReq=function(){function a(O){if(this.users=[],O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.roomId="",a.prototype.users=$util.emptyArray,a.create=function(e){return new a(e)},a.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 q=0;q<e.users.length;++q)$root.com.quick.voice.proto.PreventUser.encode(e.users[q],n.uint32(18).fork()).ldelim();return n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.roomId=e.string();break}case 2:{D.users&&D.users.length||(D.users=[]),D.users.push($root.com.quick.voice.proto.PreventUser.decode(e,e.uint32()));break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 q=$root.com.quick.voice.proto.PreventUser.verify(e.users[n]);if(q)return"users."+q}}return null},a.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 q=0;q<e.users.length;++q){if(typeof e.users[q]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");n.users[q]=$root.com.quick.voice.proto.PreventUser.fromObject(e.users[q])}}return n},a.toObject=function(e,n){n||(n={});let q={};if((n.arrays||n.defaults)&&(q.users=[]),n.defaults&&(q.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(q.roomId=e.roomId),e.users&&e.users.length){q.users=[];for(let D=0;D<e.users.length;++D)q.users[D]=$root.com.quick.voice.proto.PreventUser.toObject(e.users[D],n)}return q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUsersBehaviorReq"},a}(),Z.PreventUsersBehaviorNotify=function(){function a(O){if(this.users=[],O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.roomId="",a.prototype.users=$util.emptyArray,a.create=function(e){return new a(e)},a.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 q=0;q<e.users.length;++q)$root.com.quick.voice.proto.User.encode(e.users[q],n.uint32(18).fork()).ldelim();return n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.roomId=e.string();break}case 2:{D.users&&D.users.length||(D.users=[]),D.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 q=$root.com.quick.voice.proto.User.verify(e.users[n]);if(q)return"users."+q}}return null},a.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 q=0;q<e.users.length;++q){if(typeof e.users[q]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");n.users[q]=$root.com.quick.voice.proto.User.fromObject(e.users[q])}}return n},a.toObject=function(e,n){n||(n={});let q={};if((n.arrays||n.defaults)&&(q.users=[]),n.defaults&&(q.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(q.roomId=e.roomId),e.users&&e.users.length){q.users=[];for(let D=0;D<e.users.length;++D)q.users[D]=$root.com.quick.voice.proto.User.toObject(e.users[D],n)}return q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},a}(),Z.AccelerationAreas=function(){const a={},O=Object.create(a);return O[a[0]="chinaMainland"]=0,O[a[1]="global"]=1,O[a[2]="overseas"]=2,O}(),Z.CountMethods=function(){const a={},O=Object.create(a);return O[a[0]="flow"]=0,O[a[1]="minutes"]=1,O}(),Z.BaseCDNAddress=function(){function a(O){if(this.urlMap={},O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.area=0,a.prototype.countType=0,a.prototype.urlMap=$util.emptyObject,a.create=function(e){return new a(e)},a.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 q=Object.keys(e.urlMap),D=0;D<q.length;++D)n.uint32(26).fork().uint32(10).string(q[D]).uint32(18).string(e.urlMap[q[D]]).ldelim();return n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.BaseCDNAddress,z,K;for(;e.pos<q;){let J=e.uint32();switch(J>>>3){case 1:{D.area=e.int32();break}case 2:{D.countType=e.int32();break}case 3:{D.urlMap===$util.emptyObject&&(D.urlMap={});let G=e.uint32()+e.pos;for(z="",K="";e.pos<G;){let Q=e.uint32();switch(Q>>>3){case 1:z=e.string();break;case 2:K=e.string();break;default:e.skipType(Q&7);break}}D.urlMap[z]=K;break}default:e.skipType(J&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 q=0;q<n.length;++q)if(!$util.isString(e.urlMap[n[q]]))return"urlMap: string{k:string} expected"}return null},a.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 q=Object.keys(e.urlMap),D=0;D<q.length;++D)n.urlMap[q[D]]=String(e.urlMap[q[D]])}return n},a.toObject=function(e,n){n||(n={});let q={};(n.objects||n.defaults)&&(q.urlMap={}),n.defaults&&(q.area=n.enums===String?"chinaMainland":0,q.countType=n.enums===String?"flow":0),e.area!=null&&e.hasOwnProperty("area")&&(q.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")&&(q.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 D;if(e.urlMap&&(D=Object.keys(e.urlMap)).length){q.urlMap={};for(let z=0;z<D.length;++z)q.urlMap[D[z]]=e.urlMap[D[z]]}return q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.BaseCDNAddress"},a}(),Z.CDNPlayAddressNotify=function(){function a(e){if(this.standLines=[],e)for(let n=Object.keys(e),q=0;q<n.length;++q)e[n[q]]!=null&&(this[n[q]]=e[n[q]])}a.prototype.roomId="",a.prototype.m3u8=null,a.prototype.rtmp=null,a.prototype.flv=null,a.prototype.rtmps=null,a.prototype.mainLine=null,a.prototype.standLines=$util.emptyArray;let O;return Object.defineProperty(a.prototype,"_m3u8",{get:$util.oneOfGetter(O=["m3u8"]),set:$util.oneOfSetter(O)}),Object.defineProperty(a.prototype,"_rtmp",{get:$util.oneOfGetter(O=["rtmp"]),set:$util.oneOfSetter(O)}),Object.defineProperty(a.prototype,"_flv",{get:$util.oneOfGetter(O=["flv"]),set:$util.oneOfSetter(O)}),Object.defineProperty(a.prototype,"_rtmps",{get:$util.oneOfGetter(O=["rtmps"]),set:$util.oneOfSetter(O)}),Object.defineProperty(a.prototype,"_mainLine",{get:$util.oneOfGetter(O=["mainLine"]),set:$util.oneOfSetter(O)}),a.create=function(n){return new a(n)},a.encode=function(n,q){if(q||(q=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&q.uint32(10).string(n.roomId),n.m3u8!=null&&Object.hasOwnProperty.call(n,"m3u8")&&q.uint32(18).string(n.m3u8),n.rtmp!=null&&Object.hasOwnProperty.call(n,"rtmp")&&q.uint32(26).string(n.rtmp),n.flv!=null&&Object.hasOwnProperty.call(n,"flv")&&q.uint32(34).string(n.flv),n.rtmps!=null&&Object.hasOwnProperty.call(n,"rtmps")&&q.uint32(42).string(n.rtmps),n.mainLine!=null&&Object.hasOwnProperty.call(n,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(n.mainLine,q.uint32(50).fork()).ldelim(),n.standLines!=null&&n.standLines.length)for(let D=0;D<n.standLines.length;++D)$root.com.quick.voice.proto.BaseCDNAddress.encode(n.standLines[D],q.uint32(58).fork()).ldelim();return q},a.encodeDelimited=function(n,q){return this.encode(n,q).ldelim()},a.decode=function(n,q){n instanceof $Reader||(n=$Reader.create(n));let D=q===void 0?n.len:n.pos+q,z=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;n.pos<D;){let K=n.uint32();switch(K>>>3){case 1:{z.roomId=n.string();break}case 2:{z.m3u8=n.string();break}case 3:{z.rtmp=n.string();break}case 4:{z.flv=n.string();break}case 5:{z.rtmps=n.string();break}case 6:{z.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(n,n.uint32());break}case 7:{z.standLines&&z.standLines.length||(z.standLines=[]),z.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(n,n.uint32()));break}default:n.skipType(K&7);break}}return z},a.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},a.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 q=$root.com.quick.voice.proto.BaseCDNAddress.verify(n.mainLine);if(q)return"mainLine."+q}if(n.standLines!=null&&n.hasOwnProperty("standLines")){if(!Array.isArray(n.standLines))return"standLines: array expected";for(let q=0;q<n.standLines.length;++q){let D=$root.com.quick.voice.proto.BaseCDNAddress.verify(n.standLines[q]);if(D)return"standLines."+D}}return null},a.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return n;let q=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(n.roomId!=null&&(q.roomId=String(n.roomId)),n.m3u8!=null&&(q.m3u8=String(n.m3u8)),n.rtmp!=null&&(q.rtmp=String(n.rtmp)),n.flv!=null&&(q.flv=String(n.flv)),n.rtmps!=null&&(q.rtmps=String(n.rtmps)),n.mainLine!=null){if(typeof n.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");q.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");q.standLines=[];for(let D=0;D<n.standLines.length;++D){if(typeof n.standLines[D]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");q.standLines[D]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(n.standLines[D])}}return q},a.toObject=function(n,q){q||(q={});let D={};if((q.arrays||q.defaults)&&(D.standLines=[]),q.defaults&&(D.roomId=""),n.roomId!=null&&n.hasOwnProperty("roomId")&&(D.roomId=n.roomId),n.m3u8!=null&&n.hasOwnProperty("m3u8")&&(D.m3u8=n.m3u8,q.oneofs&&(D._m3u8="m3u8")),n.rtmp!=null&&n.hasOwnProperty("rtmp")&&(D.rtmp=n.rtmp,q.oneofs&&(D._rtmp="rtmp")),n.flv!=null&&n.hasOwnProperty("flv")&&(D.flv=n.flv,q.oneofs&&(D._flv="flv")),n.rtmps!=null&&n.hasOwnProperty("rtmps")&&(D.rtmps=n.rtmps,q.oneofs&&(D._rtmps="rtmps")),n.mainLine!=null&&n.hasOwnProperty("mainLine")&&(D.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(n.mainLine,q),q.oneofs&&(D._mainLine="mainLine")),n.standLines&&n.standLines.length){D.standLines=[];for(let z=0;z<n.standLines.length;++z)D.standLines[z]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(n.standLines[z],q)}return D},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.CDNPlayAddressNotify"},a}(),Z.UserChannel=function(){function a(O){if(this.channels=[],O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.userId="",a.prototype.channels=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,n){if(n||(n=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(10).string(e.userId),e.channels!=null&&e.channels.length)for(let q=0;q<e.channels.length;++q)$root.com.quick.voice.proto.DataChannel.encode(e.channels[q],n.uint32(18).fork()).ldelim();return n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.UserChannel;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.userId=e.string();break}case 2:{D.channels&&D.channels.length||(D.channels=[]),D.channels.push($root.com.quick.voice.proto.DataChannel.decode(e,e.uint32()));break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId))return"userId: string expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let n=0;n<e.channels.length;++n){let q=$root.com.quick.voice.proto.DataChannel.verify(e.channels[n]);if(q)return"channels."+q}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UserChannel)return e;let n=new $root.com.quick.voice.proto.UserChannel;if(e.userId!=null&&(n.userId=String(e.userId)),e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.UserChannel.channels: array expected");n.channels=[];for(let q=0;q<e.channels.length;++q){if(typeof e.channels[q]!="object")throw TypeError(".com.quick.voice.proto.UserChannel.channels: object expected");n.channels[q]=$root.com.quick.voice.proto.DataChannel.fromObject(e.channels[q])}}return n},a.toObject=function(e,n){n||(n={});let q={};if((n.arrays||n.defaults)&&(q.channels=[]),n.defaults&&(q.userId=""),e.userId!=null&&e.hasOwnProperty("userId")&&(q.userId=e.userId),e.channels&&e.channels.length){q.channels=[];for(let D=0;D<e.channels.length;++D)q.channels[D]=$root.com.quick.voice.proto.DataChannel.toObject(e.channels[D],n)}return q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UserChannel"},a}(),Z.ChannelPublishReq=function(){function a(O){if(this.channels=[],O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.channels=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,n){if(n||(n=$Writer.create()),e.channels!=null&&e.channels.length)for(let q=0;q<e.channels.length;++q)$root.com.quick.voice.proto.DataChannel.encode(e.channels[q],n.uint32(10).fork()).ldelim();return n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.ChannelPublishReq;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.channels&&D.channels.length||(D.channels=[]),D.channels.push($root.com.quick.voice.proto.DataChannel.decode(e,e.uint32()));break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let n=0;n<e.channels.length;++n){let q=$root.com.quick.voice.proto.DataChannel.verify(e.channels[n]);if(q)return"channels."+q}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ChannelPublishReq)return e;let n=new $root.com.quick.voice.proto.ChannelPublishReq;if(e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: array expected");n.channels=[];for(let q=0;q<e.channels.length;++q){if(typeof e.channels[q]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: object expected");n.channels[q]=$root.com.quick.voice.proto.DataChannel.fromObject(e.channels[q])}}return n},a.toObject=function(e,n){n||(n={});let q={};if((n.arrays||n.defaults)&&(q.channels=[]),e.channels&&e.channels.length){q.channels=[];for(let D=0;D<e.channels.length;++D)q.channels[D]=$root.com.quick.voice.proto.DataChannel.toObject(e.channels[D],n)}return q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ChannelPublishReq"},a}(),Z.ChannelPublishRsq=function(){function a(O){if(this.channels=[],O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.channels=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,n){if(n||(n=$Writer.create()),e.channels!=null&&e.channels.length)for(let q=0;q<e.channels.length;++q)$root.com.quick.voice.proto.UserChannel.encode(e.channels[q],n.uint32(10).fork()).ldelim();return n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.ChannelPublishRsq;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.channels&&D.channels.length||(D.channels=[]),D.channels.push($root.com.quick.voice.proto.UserChannel.decode(e,e.uint32()));break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let n=0;n<e.channels.length;++n){let q=$root.com.quick.voice.proto.UserChannel.verify(e.channels[n]);if(q)return"channels."+q}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ChannelPublishRsq)return e;let n=new $root.com.quick.voice.proto.ChannelPublishRsq;if(e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: array expected");n.channels=[];for(let q=0;q<e.channels.length;++q){if(typeof e.channels[q]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: object expected");n.channels[q]=$root.com.quick.voice.proto.UserChannel.fromObject(e.channels[q])}}return n},a.toObject=function(e,n){n||(n={});let q={};if((n.arrays||n.defaults)&&(q.channels=[]),e.channels&&e.channels.length){q.channels=[];for(let D=0;D<e.channels.length;++D)q.channels[D]=$root.com.quick.voice.proto.UserChannel.toObject(e.channels[D],n)}return q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ChannelPublishRsq"},a}(),Z.ChannelSubscribeReq=function(){function a(O){if(this.users=[],O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.users=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,n){if(n||(n=$Writer.create()),e.users!=null&&e.users.length)for(let q=0;q<e.users.length;++q)$root.com.quick.voice.proto.UserChannel.encode(e.users[q],n.uint32(10).fork()).ldelim();return n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.ChannelSubscribeReq;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.users&&D.users.length||(D.users=[]),D.users.push($root.com.quick.voice.proto.UserChannel.decode(e,e.uint32()));break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.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 q=$root.com.quick.voice.proto.UserChannel.verify(e.users[n]);if(q)return"users."+q}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ChannelSubscribeReq)return e;let n=new $root.com.quick.voice.proto.ChannelSubscribeReq;if(e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: array expected");n.users=[];for(let q=0;q<e.users.length;++q){if(typeof e.users[q]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: object expected");n.users[q]=$root.com.quick.voice.proto.UserChannel.fromObject(e.users[q])}}return n},a.toObject=function(e,n){n||(n={});let q={};if((n.arrays||n.defaults)&&(q.users=[]),e.users&&e.users.length){q.users=[];for(let D=0;D<e.users.length;++D)q.users[D]=$root.com.quick.voice.proto.UserChannel.toObject(e.users[D],n)}return q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ChannelSubscribeReq"},a}(),Z.ChannelSubscribeRsq=function(){function a(O){if(this.channels=[],O)for(let e=Object.keys(O),n=0;n<e.length;++n)O[e[n]]!=null&&(this[e[n]]=O[e[n]])}return a.prototype.channels=$util.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,n){if(n||(n=$Writer.create()),e.channels!=null&&e.channels.length)for(let q=0;q<e.channels.length;++q)$root.com.quick.voice.proto.UserChannel.encode(e.channels[q],n.uint32(10).fork()).ldelim();return n},a.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},a.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let q=n===void 0?e.len:e.pos+n,D=new $root.com.quick.voice.proto.ChannelSubscribeRsq;for(;e.pos<q;){let z=e.uint32();switch(z>>>3){case 1:{D.channels&&D.channels.length||(D.channels=[]),D.channels.push($root.com.quick.voice.proto.UserChannel.decode(e,e.uint32()));break}default:e.skipType(z&7);break}}return D},a.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let n=0;n<e.channels.length;++n){let q=$root.com.quick.voice.proto.UserChannel.verify(e.channels[n]);if(q)return"channels."+q}}return null},a.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ChannelSubscribeRsq)return e;let n=new $root.com.quick.voice.proto.ChannelSubscribeRsq;if(e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: array expected");n.channels=[];for(let q=0;q<e.channels.length;++q){if(typeof e.channels[q]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: object expected");n.channels[q]=$root.com.quick.voice.proto.UserChannel.fromObject(e.channels[q])}}return n},a.toObject=function(e,n){n||(n={});let q={};if((n.arrays||n.defaults)&&(q.channels=[]),e.channels&&e.channels.length){q.channels=[];for(let D=0;D<e.channels.length;++D)q.channels[D]=$root.com.quick.voice.proto.UserChannel.toObject(e.channels[D],n)}return q},a.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ChannelSubscribeRsq"},a}(),Z}(),I}(),F}(),N})(),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销毁"};ht(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(N){let F=N.length;for(;--F>=0;)N[F]=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(N,F,I,Z,a){this.static_tree=N,this.extra_bits=F,this.extra_base=I,this.elems=Z,this.max_length=a,this.has_stree=N&&N.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(N,F){this.dyn_tree=N,this.max_code=0,this.stat_desc=F}const d_code=N=>N<256?_dist_code[N]:_dist_code[256+(N>>>7)],put_short=(N,F)=>{N.pending_buf[N.pending++]=F&255,N.pending_buf[N.pending++]=F>>>8&255},send_bits=(N,F,I)=>{N.bi_valid>Buf_size-I?(N.bi_buf|=F<<N.bi_valid&65535,put_short(N,N.bi_buf),N.bi_buf=F>>Buf_size-N.bi_valid,N.bi_valid+=I-Buf_size):(N.bi_buf|=F<<N.bi_valid&65535,N.bi_valid+=I)},send_code=(N,F,I)=>{send_bits(N,I[F*2],I[F*2+1])},bi_reverse=(N,F)=>{let I=0;do I|=N&1,N>>>=1,I<<=1;while(--F>0);return I>>>1},bi_flush=N=>{N.bi_valid===16?(put_short(N,N.bi_buf),N.bi_buf=0,N.bi_valid=0):N.bi_valid>=8&&(N.pending_buf[N.pending++]=N.bi_buf&255,N.bi_buf>>=8,N.bi_valid-=8)},gen_bitlen=(N,F)=>{const I=F.dyn_tree,Z=F.max_code,a=F.stat_desc.static_tree,O=F.stat_desc.has_stree,e=F.stat_desc.extra_bits,n=F.stat_desc.extra_base,q=F.stat_desc.max_length;let D,z,K,J,G,Q,nt=0;for(J=0;J<=MAX_BITS$1;J++)N.bl_count[J]=0;for(I[N.heap[N.heap_max]*2+1]=0,D=N.heap_max+1;D<HEAP_SIZE$1;D++)z=N.heap[D],J=I[I[z*2+1]*2+1]+1,J>q&&(J=q,nt++),I[z*2+1]=J,!(z>Z)&&(N.bl_count[J]++,G=0,z>=n&&(G=e[z-n]),Q=I[z*2],N.opt_len+=Q*(J+G),O&&(N.static_len+=Q*(a[z*2+1]+G)));if(nt!==0){do{for(J=q-1;N.bl_count[J]===0;)J--;N.bl_count[J]--,N.bl_count[J+1]+=2,N.bl_count[q]--,nt-=2}while(nt>0);for(J=q;J!==0;J--)for(z=N.bl_count[J];z!==0;)K=N.heap[--D],!(K>Z)&&(I[K*2+1]!==J&&(N.opt_len+=(J-I[K*2+1])*I[K*2],I[K*2+1]=J),z--)}},gen_codes=(N,F,I)=>{const Z=new Array(MAX_BITS$1+1);let a=0,O,e;for(O=1;O<=MAX_BITS$1;O++)a=a+I[O-1]<<1,Z[O]=a;for(e=0;e<=F;e++){let n=N[e*2+1];n!==0&&(N[e*2]=bi_reverse(Z[n]++,n))}},tr_static_init=()=>{let N,F,I,Z,a;const O=new Array(MAX_BITS$1+1);for(I=0,Z=0;Z<LENGTH_CODES$1-1;Z++)for(base_length[Z]=I,N=0;N<1<<extra_lbits[Z];N++)_length_code[I++]=Z;for(_length_code[I-1]=Z,a=0,Z=0;Z<16;Z++)for(base_dist[Z]=a,N=0;N<1<<extra_dbits[Z];N++)_dist_code[a++]=Z;for(a>>=7;Z<D_CODES$1;Z++)for(base_dist[Z]=a<<7,N=0;N<1<<extra_dbits[Z]-7;N++)_dist_code[256+a++]=Z;for(F=0;F<=MAX_BITS$1;F++)O[F]=0;for(N=0;N<=143;)static_ltree[N*2+1]=8,N++,O[8]++;for(;N<=255;)static_ltree[N*2+1]=9,N++,O[9]++;for(;N<=279;)static_ltree[N*2+1]=7,N++,O[7]++;for(;N<=287;)static_ltree[N*2+1]=8,N++,O[8]++;for(gen_codes(static_ltree,L_CODES$1+1,O),N=0;N<D_CODES$1;N++)static_dtree[N*2+1]=5,static_dtree[N*2]=bi_reverse(N,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=N=>{let F;for(F=0;F<L_CODES$1;F++)N.dyn_ltree[F*2]=0;for(F=0;F<D_CODES$1;F++)N.dyn_dtree[F*2]=0;for(F=0;F<BL_CODES$1;F++)N.bl_tree[F*2]=0;N.dyn_ltree[END_BLOCK*2]=1,N.opt_len=N.static_len=0,N.sym_next=N.matches=0},bi_windup=N=>{N.bi_valid>8?put_short(N,N.bi_buf):N.bi_valid>0&&(N.pending_buf[N.pending++]=N.bi_buf),N.bi_buf=0,N.bi_valid=0},smaller=(N,F,I,Z)=>{const a=F*2,O=I*2;return N[a]<N[O]||N[a]===N[O]&&Z[F]<=Z[I]},pqdownheap=(N,F,I)=>{const Z=N.heap[I];let a=I<<1;for(;a<=N.heap_len&&(a<N.heap_len&&smaller(F,N.heap[a+1],N.heap[a],N.depth)&&a++,!smaller(F,Z,N.heap[a],N.depth));)N.heap[I]=N.heap[a],I=a,a<<=1;N.heap[I]=Z},compress_block=(N,F,I)=>{let Z,a,O=0,e,n;if(N.sym_next!==0)do Z=N.pending_buf[N.sym_buf+O++]&255,Z+=(N.pending_buf[N.sym_buf+O++]&255)<<8,a=N.pending_buf[N.sym_buf+O++],Z===0?send_code(N,a,F):(e=_length_code[a],send_code(N,e+LITERALS$1+1,F),n=extra_lbits[e],n!==0&&(a-=base_length[e],send_bits(N,a,n)),Z--,e=d_code(Z),send_code(N,e,I),n=extra_dbits[e],n!==0&&(Z-=base_dist[e],send_bits(N,Z,n)));while(O<N.sym_next);send_code(N,END_BLOCK,F)},build_tree=(N,F)=>{const I=F.dyn_tree,Z=F.stat_desc.static_tree,a=F.stat_desc.has_stree,O=F.stat_desc.elems;let e,n,q=-1,D;for(N.heap_len=0,N.heap_max=HEAP_SIZE$1,e=0;e<O;e++)I[e*2]!==0?(N.heap[++N.heap_len]=q=e,N.depth[e]=0):I[e*2+1]=0;for(;N.heap_len<2;)D=N.heap[++N.heap_len]=q<2?++q:0,I[D*2]=1,N.depth[D]=0,N.opt_len--,a&&(N.static_len-=Z[D*2+1]);for(F.max_code=q,e=N.heap_len>>1;e>=1;e--)pqdownheap(N,I,e);D=O;do e=N.heap[1],N.heap[1]=N.heap[N.heap_len--],pqdownheap(N,I,1),n=N.heap[1],N.heap[--N.heap_max]=e,N.heap[--N.heap_max]=n,I[D*2]=I[e*2]+I[n*2],N.depth[D]=(N.depth[e]>=N.depth[n]?N.depth[e]:N.depth[n])+1,I[e*2+1]=I[n*2+1]=D,N.heap[1]=D++,pqdownheap(N,I,1);while(N.heap_len>=2);N.heap[--N.heap_max]=N.heap[1],gen_bitlen(N,F),gen_codes(I,q,N.bl_count)},scan_tree=(N,F,I)=>{let Z,a=-1,O,e=F[0*2+1],n=0,q=7,D=4;for(e===0&&(q=138,D=3),F[(I+1)*2+1]=65535,Z=0;Z<=I;Z++)O=e,e=F[(Z+1)*2+1],!(++n<q&&O===e)&&(n<D?N.bl_tree[O*2]+=n:O!==0?(O!==a&&N.bl_tree[O*2]++,N.bl_tree[REP_3_6*2]++):n<=10?N.bl_tree[REPZ_3_10*2]++:N.bl_tree[REPZ_11_138*2]++,n=0,a=O,e===0?(q=138,D=3):O===e?(q=6,D=3):(q=7,D=4))},send_tree=(N,F,I)=>{let Z,a=-1,O,e=F[0*2+1],n=0,q=7,D=4;for(e===0&&(q=138,D=3),Z=0;Z<=I;Z++)if(O=e,e=F[(Z+1)*2+1],!(++n<q&&O===e)){if(n<D)do send_code(N,O,N.bl_tree);while(--n!==0);else O!==0?(O!==a&&(send_code(N,O,N.bl_tree),n--),send_code(N,REP_3_6,N.bl_tree),send_bits(N,n-3,2)):n<=10?(send_code(N,REPZ_3_10,N.bl_tree),send_bits(N,n-3,3)):(send_code(N,REPZ_11_138,N.bl_tree),send_bits(N,n-11,7));n=0,a=O,e===0?(q=138,D=3):O===e?(q=6,D=3):(q=7,D=4)}},build_bl_tree=N=>{let F;for(scan_tree(N,N.dyn_ltree,N.l_desc.max_code),scan_tree(N,N.dyn_dtree,N.d_desc.max_code),build_tree(N,N.bl_desc),F=BL_CODES$1-1;F>=3&&N.bl_tree[bl_order[F]*2+1]===0;F--);return N.opt_len+=3*(F+1)+5+5+4,F},send_all_trees=(N,F,I,Z)=>{let a;for(send_bits(N,F-257,5),send_bits(N,I-1,5),send_bits(N,Z-4,4),a=0;a<Z;a++)send_bits(N,N.bl_tree[bl_order[a]*2+1],3);send_tree(N,N.dyn_ltree,F-1),send_tree(N,N.dyn_dtree,I-1)},detect_data_type=N=>{let F=4093624447,I;for(I=0;I<=31;I++,F>>>=1)if(F&1&&N.dyn_ltree[I*2]!==0)return Z_BINARY;if(N.dyn_ltree[9*2]!==0||N.dyn_ltree[10*2]!==0||N.dyn_ltree[13*2]!==0)return Z_TEXT;for(I=32;I<LITERALS$1;I++)if(N.dyn_ltree[I*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=N=>{static_init_done||(tr_static_init(),static_init_done=!0),N.l_desc=new TreeDesc(N.dyn_ltree,static_l_desc),N.d_desc=new TreeDesc(N.dyn_dtree,static_d_desc),N.bl_desc=new TreeDesc(N.bl_tree,static_bl_desc),N.bi_buf=0,N.bi_valid=0,init_block(N)},_tr_stored_block$1=(N,F,I,Z)=>{send_bits(N,(STORED_BLOCK<<1)+(Z?1:0),3),bi_windup(N),put_short(N,I),put_short(N,~I),I&&N.pending_buf.set(N.window.subarray(F,F+I),N.pending),N.pending+=I},_tr_align$1=N=>{send_bits(N,STATIC_TREES<<1,3),send_code(N,END_BLOCK,static_ltree),bi_flush(N)},_tr_flush_block$1=(N,F,I,Z)=>{let a,O,e=0;N.level>0?(N.strm.data_type===Z_UNKNOWN$1&&(N.strm.data_type=detect_data_type(N)),build_tree(N,N.l_desc),build_tree(N,N.d_desc),e=build_bl_tree(N),a=N.opt_len+3+7>>>3,O=N.static_len+3+7>>>3,O<=a&&(a=O)):a=O=I+5,I+4<=a&&F!==-1?_tr_stored_block$1(N,F,I,Z):N.strategy===Z_FIXED$1||O===a?(send_bits(N,(STATIC_TREES<<1)+(Z?1:0),3),compress_block(N,static_ltree,static_dtree)):(send_bits(N,(DYN_TREES<<1)+(Z?1:0),3),send_all_trees(N,N.l_desc.max_code+1,N.d_desc.max_code+1,e+1),compress_block(N,N.dyn_ltree,N.dyn_dtree)),init_block(N),Z&&bi_windup(N)},_tr_tally$1=(N,F,I)=>(N.pending_buf[N.sym_buf+N.sym_next++]=F,N.pending_buf[N.sym_buf+N.sym_next++]=F>>8,N.pending_buf[N.sym_buf+N.sym_next++]=I,F===0?N.dyn_ltree[I*2]++:(N.matches++,F--,N.dyn_ltree[(_length_code[I]+LITERALS$1+1)*2]++,N.dyn_dtree[d_code(F)*2]++),N.sym_next===N.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=(N,F,I,Z)=>{let a=N&65535|0,O=N>>>16&65535|0,e=0;for(;I!==0;){e=I>2e3?2e3:I,I-=e;do a=a+F[Z++]|0,O=O+a|0;while(--e);a%=65521,O%=65521}return a|O<<16|0};var adler32_1=adler32;const makeTable=()=>{let N,F=[];for(var I=0;I<256;I++){N=I;for(var Z=0;Z<8;Z++)N=N&1?3988292384^N>>>1:N>>>1;F[I]=N}return F},crcTable=new Uint32Array(makeTable()),crc32=(N,F,I,Z)=>{const a=crcTable,O=Z+I;N^=-1;for(let e=Z;e<O;e++)N=N>>>8^a[(N^F[e])&255];return N^-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=(N,F)=>(N.msg=messages[F],F),rank=N=>N*2-(N>4?9:0),zero=N=>{let F=N.length;for(;--F>=0;)N[F]=0},slide_hash=N=>{let F,I,Z,a=N.w_size;F=N.hash_size,Z=F;do I=N.head[--Z],N.head[Z]=I>=a?I-a:0;while(--F);F=a,Z=F;do I=N.prev[--Z],N.prev[Z]=I>=a?I-a:0;while(--F)};let HASH_ZLIB=(N,F,I)=>(F<<N.hash_shift^I)&N.hash_mask,HASH=HASH_ZLIB;const flush_pending=N=>{const F=N.state;let I=F.pending;I>N.avail_out&&(I=N.avail_out),I!==0&&(N.output.set(F.pending_buf.subarray(F.pending_out,F.pending_out+I),N.next_out),N.next_out+=I,F.pending_out+=I,N.total_out+=I,N.avail_out-=I,F.pending-=I,F.pending===0&&(F.pending_out=0))},flush_block_only=(N,F)=>{_tr_flush_block(N,N.block_start>=0?N.block_start:-1,N.strstart-N.block_start,F),N.block_start=N.strstart,flush_pending(N.strm)},put_byte=(N,F)=>{N.pending_buf[N.pending++]=F},putShortMSB=(N,F)=>{N.pending_buf[N.pending++]=F>>>8&255,N.pending_buf[N.pending++]=F&255},read_buf=(N,F,I,Z)=>{let a=N.avail_in;return a>Z&&(a=Z),a===0?0:(N.avail_in-=a,F.set(N.input.subarray(N.next_in,N.next_in+a),I),N.state.wrap===1?N.adler=adler32_1(N.adler,F,a,I):N.state.wrap===2&&(N.adler=crc32_1(N.adler,F,a,I)),N.next_in+=a,N.total_in+=a,a)},longest_match=(N,F)=>{let I=N.max_chain_length,Z=N.strstart,a,O,e=N.prev_length,n=N.nice_match;const q=N.strstart>N.w_size-MIN_LOOKAHEAD?N.strstart-(N.w_size-MIN_LOOKAHEAD):0,D=N.window,z=N.w_mask,K=N.prev,J=N.strstart+MAX_MATCH;let G=D[Z+e-1],Q=D[Z+e];N.prev_length>=N.good_match&&(I>>=2),n>N.lookahead&&(n=N.lookahead);do if(a=F,!(D[a+e]!==Q||D[a+e-1]!==G||D[a]!==D[Z]||D[++a]!==D[Z+1])){Z+=2,a++;do;while(D[++Z]===D[++a]&&D[++Z]===D[++a]&&D[++Z]===D[++a]&&D[++Z]===D[++a]&&D[++Z]===D[++a]&&D[++Z]===D[++a]&&D[++Z]===D[++a]&&D[++Z]===D[++a]&&Z<J);if(O=MAX_MATCH-(J-Z),Z=J-MAX_MATCH,O>e){if(N.match_start=F,e=O,O>=n)break;G=D[Z+e-1],Q=D[Z+e]}}while((F=K[F&z])>q&&--I!==0);return e<=N.lookahead?e:N.lookahead},fill_window=N=>{const F=N.w_size;let I,Z,a;do{if(Z=N.window_size-N.lookahead-N.strstart,N.strstart>=F+(F-MIN_LOOKAHEAD)&&(N.window.set(N.window.subarray(F,F+F-Z),0),N.match_start-=F,N.strstart-=F,N.block_start-=F,N.insert>N.strstart&&(N.insert=N.strstart),slide_hash(N),Z+=F),N.strm.avail_in===0)break;if(I=read_buf(N.strm,N.window,N.strstart+N.lookahead,Z),N.lookahead+=I,N.lookahead+N.insert>=MIN_MATCH)for(a=N.strstart-N.insert,N.ins_h=N.window[a],N.ins_h=HASH(N,N.ins_h,N.window[a+1]);N.insert&&(N.ins_h=HASH(N,N.ins_h,N.window[a+MIN_MATCH-1]),N.prev[a&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=a,a++,N.insert--,!(N.lookahead+N.insert<MIN_MATCH)););}while(N.lookahead<MIN_LOOKAHEAD&&N.strm.avail_in!==0)},deflate_stored=(N,F)=>{let I=N.pending_buf_size-5>N.w_size?N.w_size:N.pending_buf_size-5,Z,a,O,e=0,n=N.strm.avail_in;do{if(Z=65535,O=N.bi_valid+42>>3,N.strm.avail_out<O||(O=N.strm.avail_out-O,a=N.strstart-N.block_start,Z>a+N.strm.avail_in&&(Z=a+N.strm.avail_in),Z>O&&(Z=O),Z<I&&(Z===0&&F!==Z_FINISH$3||F===Z_NO_FLUSH$2||Z!==a+N.strm.avail_in)))break;e=F===Z_FINISH$3&&Z===a+N.strm.avail_in?1:0,_tr_stored_block(N,0,0,e),N.pending_buf[N.pending-4]=Z,N.pending_buf[N.pending-3]=Z>>8,N.pending_buf[N.pending-2]=~Z,N.pending_buf[N.pending-1]=~Z>>8,flush_pending(N.strm),a&&(a>Z&&(a=Z),N.strm.output.set(N.window.subarray(N.block_start,N.block_start+a),N.strm.next_out),N.strm.next_out+=a,N.strm.avail_out-=a,N.strm.total_out+=a,N.block_start+=a,Z-=a),Z&&(read_buf(N.strm,N.strm.output,N.strm.next_out,Z),N.strm.next_out+=Z,N.strm.avail_out-=Z,N.strm.total_out+=Z)}while(e===0);return n-=N.strm.avail_in,n&&(n>=N.w_size?(N.matches=2,N.window.set(N.strm.input.subarray(N.strm.next_in-N.w_size,N.strm.next_in),0),N.strstart=N.w_size,N.insert=N.strstart):(N.window_size-N.strstart<=n&&(N.strstart-=N.w_size,N.window.set(N.window.subarray(N.w_size,N.w_size+N.strstart),0),N.matches<2&&N.matches++,N.insert>N.strstart&&(N.insert=N.strstart)),N.window.set(N.strm.input.subarray(N.strm.next_in-n,N.strm.next_in),N.strstart),N.strstart+=n,N.insert+=n>N.w_size-N.insert?N.w_size-N.insert:n),N.block_start=N.strstart),N.high_water<N.strstart&&(N.high_water=N.strstart),e?BS_FINISH_DONE:F!==Z_NO_FLUSH$2&&F!==Z_FINISH$3&&N.strm.avail_in===0&&N.strstart===N.block_start?BS_BLOCK_DONE:(O=N.window_size-N.strstart,N.strm.avail_in>O&&N.block_start>=N.w_size&&(N.block_start-=N.w_size,N.strstart-=N.w_size,N.window.set(N.window.subarray(N.w_size,N.w_size+N.strstart),0),N.matches<2&&N.matches++,O+=N.w_size,N.insert>N.strstart&&(N.insert=N.strstart)),O>N.strm.avail_in&&(O=N.strm.avail_in),O&&(read_buf(N.strm,N.window,N.strstart,O),N.strstart+=O,N.insert+=O>N.w_size-N.insert?N.w_size-N.insert:O),N.high_water<N.strstart&&(N.high_water=N.strstart),O=N.bi_valid+42>>3,O=N.pending_buf_size-O>65535?65535:N.pending_buf_size-O,I=O>N.w_size?N.w_size:O,a=N.strstart-N.block_start,(a>=I||(a||F===Z_FINISH$3)&&F!==Z_NO_FLUSH$2&&N.strm.avail_in===0&&a<=O)&&(Z=a>O?O:a,e=F===Z_FINISH$3&&N.strm.avail_in===0&&Z===a?1:0,_tr_stored_block(N,N.block_start,Z,e),N.block_start+=Z,flush_pending(N.strm)),e?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(N,F)=>{let I,Z;for(;;){if(N.lookahead<MIN_LOOKAHEAD){if(fill_window(N),N.lookahead<MIN_LOOKAHEAD&&F===Z_NO_FLUSH$2)return BS_NEED_MORE;if(N.lookahead===0)break}if(I=0,N.lookahead>=MIN_MATCH&&(N.ins_h=HASH(N,N.ins_h,N.window[N.strstart+MIN_MATCH-1]),I=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart),I!==0&&N.strstart-I<=N.w_size-MIN_LOOKAHEAD&&(N.match_length=longest_match(N,I)),N.match_length>=MIN_MATCH)if(Z=_tr_tally(N,N.strstart-N.match_start,N.match_length-MIN_MATCH),N.lookahead-=N.match_length,N.match_length<=N.max_lazy_match&&N.lookahead>=MIN_MATCH){N.match_length--;do N.strstart++,N.ins_h=HASH(N,N.ins_h,N.window[N.strstart+MIN_MATCH-1]),I=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart;while(--N.match_length!==0);N.strstart++}else N.strstart+=N.match_length,N.match_length=0,N.ins_h=N.window[N.strstart],N.ins_h=HASH(N,N.ins_h,N.window[N.strstart+1]);else Z=_tr_tally(N,0,N.window[N.strstart]),N.lookahead--,N.strstart++;if(Z&&(flush_block_only(N,!1),N.strm.avail_out===0))return BS_NEED_MORE}return N.insert=N.strstart<MIN_MATCH-1?N.strstart:MIN_MATCH-1,F===Z_FINISH$3?(flush_block_only(N,!0),N.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):N.sym_next&&(flush_block_only(N,!1),N.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(N,F)=>{let I,Z,a;for(;;){if(N.lookahead<MIN_LOOKAHEAD){if(fill_window(N),N.lookahead<MIN_LOOKAHEAD&&F===Z_NO_FLUSH$2)return BS_NEED_MORE;if(N.lookahead===0)break}if(I=0,N.lookahead>=MIN_MATCH&&(N.ins_h=HASH(N,N.ins_h,N.window[N.strstart+MIN_MATCH-1]),I=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart),N.prev_length=N.match_length,N.prev_match=N.match_start,N.match_length=MIN_MATCH-1,I!==0&&N.prev_length<N.max_lazy_match&&N.strstart-I<=N.w_size-MIN_LOOKAHEAD&&(N.match_length=longest_match(N,I),N.match_length<=5&&(N.strategy===Z_FILTERED||N.match_length===MIN_MATCH&&N.strstart-N.match_start>4096)&&(N.match_length=MIN_MATCH-1)),N.prev_length>=MIN_MATCH&&N.match_length<=N.prev_length){a=N.strstart+N.lookahead-MIN_MATCH,Z=_tr_tally(N,N.strstart-1-N.prev_match,N.prev_length-MIN_MATCH),N.lookahead-=N.prev_length-1,N.prev_length-=2;do++N.strstart<=a&&(N.ins_h=HASH(N,N.ins_h,N.window[N.strstart+MIN_MATCH-1]),I=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart);while(--N.prev_length!==0);if(N.match_available=0,N.match_length=MIN_MATCH-1,N.strstart++,Z&&(flush_block_only(N,!1),N.strm.avail_out===0))return BS_NEED_MORE}else if(N.match_available){if(Z=_tr_tally(N,0,N.window[N.strstart-1]),Z&&flush_block_only(N,!1),N.strstart++,N.lookahead--,N.strm.avail_out===0)return BS_NEED_MORE}else N.match_available=1,N.strstart++,N.lookahead--}return N.match_available&&(Z=_tr_tally(N,0,N.window[N.strstart-1]),N.match_available=0),N.insert=N.strstart<MIN_MATCH-1?N.strstart:MIN_MATCH-1,F===Z_FINISH$3?(flush_block_only(N,!0),N.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):N.sym_next&&(flush_block_only(N,!1),N.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(N,F)=>{let I,Z,a,O;const e=N.window;for(;;){if(N.lookahead<=MAX_MATCH){if(fill_window(N),N.lookahead<=MAX_MATCH&&F===Z_NO_FLUSH$2)return BS_NEED_MORE;if(N.lookahead===0)break}if(N.match_length=0,N.lookahead>=MIN_MATCH&&N.strstart>0&&(a=N.strstart-1,Z=e[a],Z===e[++a]&&Z===e[++a]&&Z===e[++a])){O=N.strstart+MAX_MATCH;do;while(Z===e[++a]&&Z===e[++a]&&Z===e[++a]&&Z===e[++a]&&Z===e[++a]&&Z===e[++a]&&Z===e[++a]&&Z===e[++a]&&a<O);N.match_length=MAX_MATCH-(O-a),N.match_length>N.lookahead&&(N.match_length=N.lookahead)}if(N.match_length>=MIN_MATCH?(I=_tr_tally(N,1,N.match_length-MIN_MATCH),N.lookahead-=N.match_length,N.strstart+=N.match_length,N.match_length=0):(I=_tr_tally(N,0,N.window[N.strstart]),N.lookahead--,N.strstart++),I&&(flush_block_only(N,!1),N.strm.avail_out===0))return BS_NEED_MORE}return N.insert=0,F===Z_FINISH$3?(flush_block_only(N,!0),N.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):N.sym_next&&(flush_block_only(N,!1),N.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(N,F)=>{let I;for(;;){if(N.lookahead===0&&(fill_window(N),N.lookahead===0)){if(F===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(N.match_length=0,I=_tr_tally(N,0,N.window[N.strstart]),N.lookahead--,N.strstart++,I&&(flush_block_only(N,!1),N.strm.avail_out===0))return BS_NEED_MORE}return N.insert=0,F===Z_FINISH$3?(flush_block_only(N,!0),N.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):N.sym_next&&(flush_block_only(N,!1),N.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(N,F,I,Z,a){this.good_length=N,this.max_lazy=F,this.nice_length=I,this.max_chain=Z,this.func=a}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=N=>{N.window_size=2*N.w_size,zero(N.head),N.max_lazy_match=configuration_table[N.level].max_lazy,N.good_match=configuration_table[N.level].good_length,N.nice_match=configuration_table[N.level].nice_length,N.max_chain_length=configuration_table[N.level].max_chain,N.strstart=0,N.block_start=0,N.lookahead=0,N.insert=0,N.match_length=N.prev_length=MIN_MATCH-1,N.match_available=0,N.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=N=>{if(!N)return 1;const F=N.state;return!F||F.strm!==N||F.status!==INIT_STATE&&F.status!==GZIP_STATE&&F.status!==EXTRA_STATE&&F.status!==NAME_STATE&&F.status!==COMMENT_STATE&&F.status!==HCRC_STATE&&F.status!==BUSY_STATE&&F.status!==FINISH_STATE?1:0},deflateResetKeep=N=>{if(deflateStateCheck(N))return err(N,Z_STREAM_ERROR$2);N.total_in=N.total_out=0,N.data_type=Z_UNKNOWN;const F=N.state;return F.pending=0,F.pending_out=0,F.wrap<0&&(F.wrap=-F.wrap),F.status=F.wrap===2?GZIP_STATE:F.wrap?INIT_STATE:BUSY_STATE,N.adler=F.wrap===2?0:1,F.last_flush=-2,_tr_init(F),Z_OK$3},deflateReset=N=>{const F=deflateResetKeep(N);return F===Z_OK$3&&lm_init(N.state),F},deflateSetHeader=(N,F)=>deflateStateCheck(N)||N.state.wrap!==2?Z_STREAM_ERROR$2:(N.state.gzhead=F,Z_OK$3),deflateInit2=(N,F,I,Z,a,O)=>{if(!N)return Z_STREAM_ERROR$2;let e=1;if(F===Z_DEFAULT_COMPRESSION$1&&(F=6),Z<0?(e=0,Z=-Z):Z>15&&(e=2,Z-=16),a<1||a>MAX_MEM_LEVEL||I!==Z_DEFLATED$2||Z<8||Z>15||F<0||F>9||O<0||O>Z_FIXED||Z===8&&e!==1)return err(N,Z_STREAM_ERROR$2);Z===8&&(Z=9);const n=new DeflateState;return N.state=n,n.strm=N,n.status=INIT_STATE,n.wrap=e,n.gzhead=null,n.w_bits=Z,n.w_size=1<<n.w_bits,n.w_mask=n.w_size-1,n.hash_bits=a+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<<a+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=F,n.strategy=O,n.method=I,deflateReset(N)},deflateInit=(N,F)=>deflateInit2(N,F,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(N,F)=>{if(deflateStateCheck(N)||F>Z_BLOCK$1||F<0)return N?err(N,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const I=N.state;if(!N.output||N.avail_in!==0&&!N.input||I.status===FINISH_STATE&&F!==Z_FINISH$3)return err(N,N.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const Z=I.last_flush;if(I.last_flush=F,I.pending!==0){if(flush_pending(N),N.avail_out===0)return I.last_flush=-1,Z_OK$3}else if(N.avail_in===0&&rank(F)<=rank(Z)&&F!==Z_FINISH$3)return err(N,Z_BUF_ERROR$1);if(I.status===FINISH_STATE&&N.avail_in!==0)return err(N,Z_BUF_ERROR$1);if(I.status===INIT_STATE&&I.wrap===0&&(I.status=BUSY_STATE),I.status===INIT_STATE){let a=Z_DEFLATED$2+(I.w_bits-8<<4)<<8,O=-1;if(I.strategy>=Z_HUFFMAN_ONLY||I.level<2?O=0:I.level<6?O=1:I.level===6?O=2:O=3,a|=O<<6,I.strstart!==0&&(a|=PRESET_DICT),a+=31-a%31,putShortMSB(I,a),I.strstart!==0&&(putShortMSB(I,N.adler>>>16),putShortMSB(I,N.adler&65535)),N.adler=1,I.status=BUSY_STATE,flush_pending(N),I.pending!==0)return I.last_flush=-1,Z_OK$3}if(I.status===GZIP_STATE){if(N.adler=0,put_byte(I,31),put_byte(I,139),put_byte(I,8),I.gzhead)put_byte(I,(I.gzhead.text?1:0)+(I.gzhead.hcrc?2:0)+(I.gzhead.extra?4:0)+(I.gzhead.name?8:0)+(I.gzhead.comment?16:0)),put_byte(I,I.gzhead.time&255),put_byte(I,I.gzhead.time>>8&255),put_byte(I,I.gzhead.time>>16&255),put_byte(I,I.gzhead.time>>24&255),put_byte(I,I.level===9?2:I.strategy>=Z_HUFFMAN_ONLY||I.level<2?4:0),put_byte(I,I.gzhead.os&255),I.gzhead.extra&&I.gzhead.extra.length&&(put_byte(I,I.gzhead.extra.length&255),put_byte(I,I.gzhead.extra.length>>8&255)),I.gzhead.hcrc&&(N.adler=crc32_1(N.adler,I.pending_buf,I.pending,0)),I.gzindex=0,I.status=EXTRA_STATE;else if(put_byte(I,0),put_byte(I,0),put_byte(I,0),put_byte(I,0),put_byte(I,0),put_byte(I,I.level===9?2:I.strategy>=Z_HUFFMAN_ONLY||I.level<2?4:0),put_byte(I,OS_CODE),I.status=BUSY_STATE,flush_pending(N),I.pending!==0)return I.last_flush=-1,Z_OK$3}if(I.status===EXTRA_STATE){if(I.gzhead.extra){let a=I.pending,O=(I.gzhead.extra.length&65535)-I.gzindex;for(;I.pending+O>I.pending_buf_size;){let n=I.pending_buf_size-I.pending;if(I.pending_buf.set(I.gzhead.extra.subarray(I.gzindex,I.gzindex+n),I.pending),I.pending=I.pending_buf_size,I.gzhead.hcrc&&I.pending>a&&(N.adler=crc32_1(N.adler,I.pending_buf,I.pending-a,a)),I.gzindex+=n,flush_pending(N),I.pending!==0)return I.last_flush=-1,Z_OK$3;a=0,O-=n}let e=new Uint8Array(I.gzhead.extra);I.pending_buf.set(e.subarray(I.gzindex,I.gzindex+O),I.pending),I.pending+=O,I.gzhead.hcrc&&I.pending>a&&(N.adler=crc32_1(N.adler,I.pending_buf,I.pending-a,a)),I.gzindex=0}I.status=NAME_STATE}if(I.status===NAME_STATE){if(I.gzhead.name){let a=I.pending,O;do{if(I.pending===I.pending_buf_size){if(I.gzhead.hcrc&&I.pending>a&&(N.adler=crc32_1(N.adler,I.pending_buf,I.pending-a,a)),flush_pending(N),I.pending!==0)return I.last_flush=-1,Z_OK$3;a=0}I.gzindex<I.gzhead.name.length?O=I.gzhead.name.charCodeAt(I.gzindex++)&255:O=0,put_byte(I,O)}while(O!==0);I.gzhead.hcrc&&I.pending>a&&(N.adler=crc32_1(N.adler,I.pending_buf,I.pending-a,a)),I.gzindex=0}I.status=COMMENT_STATE}if(I.status===COMMENT_STATE){if(I.gzhead.comment){let a=I.pending,O;do{if(I.pending===I.pending_buf_size){if(I.gzhead.hcrc&&I.pending>a&&(N.adler=crc32_1(N.adler,I.pending_buf,I.pending-a,a)),flush_pending(N),I.pending!==0)return I.last_flush=-1,Z_OK$3;a=0}I.gzindex<I.gzhead.comment.length?O=I.gzhead.comment.charCodeAt(I.gzindex++)&255:O=0,put_byte(I,O)}while(O!==0);I.gzhead.hcrc&&I.pending>a&&(N.adler=crc32_1(N.adler,I.pending_buf,I.pending-a,a))}I.status=HCRC_STATE}if(I.status===HCRC_STATE){if(I.gzhead.hcrc){if(I.pending+2>I.pending_buf_size&&(flush_pending(N),I.pending!==0))return I.last_flush=-1,Z_OK$3;put_byte(I,N.adler&255),put_byte(I,N.adler>>8&255),N.adler=0}if(I.status=BUSY_STATE,flush_pending(N),I.pending!==0)return I.last_flush=-1,Z_OK$3}if(N.avail_in!==0||I.lookahead!==0||F!==Z_NO_FLUSH$2&&I.status!==FINISH_STATE){let a=I.level===0?deflate_stored(I,F):I.strategy===Z_HUFFMAN_ONLY?deflate_huff(I,F):I.strategy===Z_RLE?deflate_rle(I,F):configuration_table[I.level].func(I,F);if((a===BS_FINISH_STARTED||a===BS_FINISH_DONE)&&(I.status=FINISH_STATE),a===BS_NEED_MORE||a===BS_FINISH_STARTED)return N.avail_out===0&&(I.last_flush=-1),Z_OK$3;if(a===BS_BLOCK_DONE&&(F===Z_PARTIAL_FLUSH?_tr_align(I):F!==Z_BLOCK$1&&(_tr_stored_block(I,0,0,!1),F===Z_FULL_FLUSH$1&&(zero(I.head),I.lookahead===0&&(I.strstart=0,I.block_start=0,I.insert=0))),flush_pending(N),N.avail_out===0))return I.last_flush=-1,Z_OK$3}return F!==Z_FINISH$3?Z_OK$3:I.wrap<=0?Z_STREAM_END$3:(I.wrap===2?(put_byte(I,N.adler&255),put_byte(I,N.adler>>8&255),put_byte(I,N.adler>>16&255),put_byte(I,N.adler>>24&255),put_byte(I,N.total_in&255),put_byte(I,N.total_in>>8&255),put_byte(I,N.total_in>>16&255),put_byte(I,N.total_in>>24&255)):(putShortMSB(I,N.adler>>>16),putShortMSB(I,N.adler&65535)),flush_pending(N),I.wrap>0&&(I.wrap=-I.wrap),I.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=N=>{if(deflateStateCheck(N))return Z_STREAM_ERROR$2;const F=N.state.status;return N.state=null,F===BUSY_STATE?err(N,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(N,F)=>{let I=F.length;if(deflateStateCheck(N))return Z_STREAM_ERROR$2;const Z=N.state,a=Z.wrap;if(a===2||a===1&&Z.status!==INIT_STATE||Z.lookahead)return Z_STREAM_ERROR$2;if(a===1&&(N.adler=adler32_1(N.adler,F,I,0)),Z.wrap=0,I>=Z.w_size){a===0&&(zero(Z.head),Z.strstart=0,Z.block_start=0,Z.insert=0);let q=new Uint8Array(Z.w_size);q.set(F.subarray(I-Z.w_size,I),0),F=q,I=Z.w_size}const O=N.avail_in,e=N.next_in,n=N.input;for(N.avail_in=I,N.next_in=0,N.input=F,fill_window(Z);Z.lookahead>=MIN_MATCH;){let q=Z.strstart,D=Z.lookahead-(MIN_MATCH-1);do Z.ins_h=HASH(Z,Z.ins_h,Z.window[q+MIN_MATCH-1]),Z.prev[q&Z.w_mask]=Z.head[Z.ins_h],Z.head[Z.ins_h]=q,q++;while(--D);Z.strstart=q,Z.lookahead=MIN_MATCH-1,fill_window(Z)}return Z.strstart+=Z.lookahead,Z.block_start=Z.strstart,Z.insert=Z.lookahead,Z.lookahead=0,Z.match_length=Z.prev_length=MIN_MATCH-1,Z.match_available=0,N.next_in=e,N.input=n,N.avail_in=O,Z.wrap=a,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=(N,F)=>Object.prototype.hasOwnProperty.call(N,F);var assign=function(N){const F=Array.prototype.slice.call(arguments,1);for(;F.length;){const I=F.shift();if(I){if(typeof I!="object")throw new TypeError(I+"must be non-object");for(const Z in I)_has(I,Z)&&(N[Z]=I[Z])}}return N},flattenChunks=N=>{let F=0;for(let Z=0,a=N.length;Z<a;Z++)F+=N[Z].length;const I=new Uint8Array(F);for(let Z=0,a=0,O=N.length;Z<O;Z++){let e=N[Z];I.set(e,a),a+=e.length}return I},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(N){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let N=0;N<256;N++)_utf8len[N]=N>=252?6:N>=248?5:N>=240?4:N>=224?3:N>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=N=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(N);let F,I,Z,a,O,e=N.length,n=0;for(a=0;a<e;a++)I=N.charCodeAt(a),(I&64512)===55296&&a+1<e&&(Z=N.charCodeAt(a+1),(Z&64512)===56320&&(I=65536+(I-55296<<10)+(Z-56320),a++)),n+=I<128?1:I<2048?2:I<65536?3:4;for(F=new Uint8Array(n),O=0,a=0;O<n;a++)I=N.charCodeAt(a),(I&64512)===55296&&a+1<e&&(Z=N.charCodeAt(a+1),(Z&64512)===56320&&(I=65536+(I-55296<<10)+(Z-56320),a++)),I<128?F[O++]=I:I<2048?(F[O++]=192|I>>>6,F[O++]=128|I&63):I<65536?(F[O++]=224|I>>>12,F[O++]=128|I>>>6&63,F[O++]=128|I&63):(F[O++]=240|I>>>18,F[O++]=128|I>>>12&63,F[O++]=128|I>>>6&63,F[O++]=128|I&63);return F};const buf2binstring=(N,F)=>{if(F<65534&&N.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,N.length===F?N:N.subarray(0,F));let I="";for(let Z=0;Z<F;Z++)I+=String.fromCharCode(N[Z]);return I};var buf2string=(N,F)=>{const I=F||N.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(N.subarray(0,F));let Z,a;const O=new Array(I*2);for(a=0,Z=0;Z<I;){let e=N[Z++];if(e<128){O[a++]=e;continue}let n=_utf8len[e];if(n>4){O[a++]=65533,Z+=n-1;continue}for(e&=n===2?31:n===3?15:7;n>1&&Z<I;)e=e<<6|N[Z++]&63,n--;if(n>1){O[a++]=65533;continue}e<65536?O[a++]=e:(e-=65536,O[a++]=55296|e>>10&1023,O[a++]=56320|e&1023)}return buf2binstring(O,a)},utf8border=(N,F)=>{F=F||N.length,F>N.length&&(F=N.length);let I=F-1;for(;I>=0&&(N[I]&192)===128;)I--;return I<0||I===0?F:I+_utf8len[N[I]]>F?I:F},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(N){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},N||{});let F=this.options;F.raw&&F.windowBits>0?F.windowBits=-F.windowBits:F.gzip&&F.windowBits>0&&F.windowBits<16&&(F.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let I=deflate_1$2.deflateInit2(this.strm,F.level,F.method,F.windowBits,F.memLevel,F.strategy);if(I!==Z_OK$2)throw new Error(messages[I]);if(F.header&&deflate_1$2.deflateSetHeader(this.strm,F.header),F.dictionary){let Z;if(typeof F.dictionary=="string"?Z=strings.string2buf(F.dictionary):toString$1.call(F.dictionary)==="[object ArrayBuffer]"?Z=new Uint8Array(F.dictionary):Z=F.dictionary,I=deflate_1$2.deflateSetDictionary(this.strm,Z),I!==Z_OK$2)throw new Error(messages[I]);this._dict_set=!0}}Deflate$1.prototype.push=function(N,F){const I=this.strm,Z=this.options.chunkSize;let a,O;if(this.ended)return!1;for(F===~~F?O=F:O=F===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof N=="string"?I.input=strings.string2buf(N):toString$1.call(N)==="[object ArrayBuffer]"?I.input=new Uint8Array(N):I.input=N,I.next_in=0,I.avail_in=I.input.length;;){if(I.avail_out===0&&(I.output=new Uint8Array(Z),I.next_out=0,I.avail_out=Z),(O===Z_SYNC_FLUSH||O===Z_FULL_FLUSH)&&I.avail_out<=6){this.onData(I.output.subarray(0,I.next_out)),I.avail_out=0;continue}if(a=deflate_1$2.deflate(I,O),a===Z_STREAM_END$2)return I.next_out>0&&this.onData(I.output.subarray(0,I.next_out)),a=deflate_1$2.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Z_OK$2;if(I.avail_out===0){this.onData(I.output);continue}if(O>0&&I.next_out>0){this.onData(I.output.subarray(0,I.next_out)),I.avail_out=0;continue}if(I.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(N){this.chunks.push(N)},Deflate$1.prototype.onEnd=function(N){N===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=N,this.msg=this.strm.msg};function deflate$1(N,F){const I=new Deflate$1(F);if(I.push(N,!0),I.err)throw I.msg||messages[I.err];return I.result}function deflateRaw$1(N,F){return F=F||{},F.raw=!0,deflate$1(N,F)}function gzip$1(N,F){return F=F||{},F.gzip=!0,deflate$1(N,F)}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 N(F,I){let Z,a,O,e,n,q,D,z,K,J,G,Q,nt,et,tt,ot,ct,rt,st,yt,at,kt,mt,ut;const ft=F.state;Z=F.next_in,mt=F.input,a=Z+(F.avail_in-5),O=F.next_out,ut=F.output,e=O-(I-F.avail_out),n=O+(F.avail_out-257),q=ft.dmax,D=ft.wsize,z=ft.whave,K=ft.wnext,J=ft.window,G=ft.hold,Q=ft.bits,nt=ft.lencode,et=ft.distcode,tt=(1<<ft.lenbits)-1,ot=(1<<ft.distbits)-1;t:do{Q<15&&(G+=mt[Z++]<<Q,Q+=8,G+=mt[Z++]<<Q,Q+=8),ct=nt[G&tt];e:for(;;){if(rt=ct>>>24,G>>>=rt,Q-=rt,rt=ct>>>16&255,rt===0)ut[O++]=ct&65535;else if(rt&16){st=ct&65535,rt&=15,rt&&(Q<rt&&(G+=mt[Z++]<<Q,Q+=8),st+=G&(1<<rt)-1,G>>>=rt,Q-=rt),Q<15&&(G+=mt[Z++]<<Q,Q+=8,G+=mt[Z++]<<Q,Q+=8),ct=et[G&ot];i:for(;;){if(rt=ct>>>24,G>>>=rt,Q-=rt,rt=ct>>>16&255,rt&16){if(yt=ct&65535,rt&=15,Q<rt&&(G+=mt[Z++]<<Q,Q+=8,Q<rt&&(G+=mt[Z++]<<Q,Q+=8)),yt+=G&(1<<rt)-1,yt>q){F.msg="invalid distance too far back",ft.mode=BAD$1;break t}if(G>>>=rt,Q-=rt,rt=O-e,yt>rt){if(rt=yt-rt,rt>z&&ft.sane){F.msg="invalid distance too far back",ft.mode=BAD$1;break t}if(at=0,kt=J,K===0){if(at+=D-rt,rt<st){st-=rt;do ut[O++]=J[at++];while(--rt);at=O-yt,kt=ut}}else if(K<rt){if(at+=D+K-rt,rt-=K,rt<st){st-=rt;do ut[O++]=J[at++];while(--rt);if(at=0,K<st){rt=K,st-=rt;do ut[O++]=J[at++];while(--rt);at=O-yt,kt=ut}}}else if(at+=K-rt,rt<st){st-=rt;do ut[O++]=J[at++];while(--rt);at=O-yt,kt=ut}for(;st>2;)ut[O++]=kt[at++],ut[O++]=kt[at++],ut[O++]=kt[at++],st-=3;st&&(ut[O++]=kt[at++],st>1&&(ut[O++]=kt[at++]))}else{at=O-yt;do ut[O++]=ut[at++],ut[O++]=ut[at++],ut[O++]=ut[at++],st-=3;while(st>2);st&&(ut[O++]=ut[at++],st>1&&(ut[O++]=ut[at++]))}}else if((rt&64)===0){ct=et[(ct&65535)+(G&(1<<rt)-1)];continue i}else{F.msg="invalid distance code",ft.mode=BAD$1;break t}break}}else if((rt&64)===0){ct=nt[(ct&65535)+(G&(1<<rt)-1)];continue e}else if(rt&32){ft.mode=TYPE$1;break t}else{F.msg="invalid literal/length code",ft.mode=BAD$1;break t}break}}while(Z<a&&O<n);st=Q>>3,Z-=st,Q-=st<<3,G&=(1<<Q)-1,F.next_in=Z,F.next_out=O,F.avail_in=Z<a?5+(a-Z):5-(Z-a),F.avail_out=O<n?257+(n-O):257-(O-n),ft.hold=G,ft.bits=Q};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=(N,F,I,Z,a,O,e,n)=>{const q=n.bits;let D=0,z=0,K=0,J=0,G=0,Q=0,nt=0,et=0,tt=0,ot=0,ct,rt,st,yt,at,kt=null,mt;const ut=new Uint16Array(MAXBITS+1),ft=new Uint16Array(MAXBITS+1);let Et=null,ce,oe,re;for(D=0;D<=MAXBITS;D++)ut[D]=0;for(z=0;z<Z;z++)ut[F[I+z]]++;for(G=q,J=MAXBITS;J>=1&&ut[J]===0;J--);if(G>J&&(G=J),J===0)return a[O++]=1<<24|64<<16|0,a[O++]=1<<24|64<<16|0,n.bits=1,0;for(K=1;K<J&&ut[K]===0;K++);for(G<K&&(G=K),et=1,D=1;D<=MAXBITS;D++)if(et<<=1,et-=ut[D],et<0)return-1;if(et>0&&(N===CODES$1||J!==1))return-1;for(ft[1]=0,D=1;D<MAXBITS;D++)ft[D+1]=ft[D]+ut[D];for(z=0;z<Z;z++)F[I+z]!==0&&(e[ft[F[I+z]]++]=z);if(N===CODES$1?(kt=Et=e,mt=20):N===LENS$1?(kt=lbase,Et=lext,mt=257):(kt=dbase,Et=dext,mt=0),ot=0,z=0,D=K,at=O,Q=G,nt=0,st=-1,tt=1<<G,yt=tt-1,N===LENS$1&&tt>ENOUGH_LENS$1||N===DISTS$1&&tt>ENOUGH_DISTS$1)return 1;for(;;){ce=D-nt,e[z]+1<mt?(oe=0,re=e[z]):e[z]>=mt?(oe=Et[e[z]-mt],re=kt[e[z]-mt]):(oe=96,re=0),ct=1<<D-nt,rt=1<<Q,K=rt;do rt-=ct,a[at+(ot>>nt)+rt]=ce<<24|oe<<16|re|0;while(rt!==0);for(ct=1<<D-1;ot&ct;)ct>>=1;if(ct!==0?(ot&=ct-1,ot+=ct):ot=0,z++,--ut[D]===0){if(D===J)break;D=F[I+e[z]]}if(D>G&&(ot&yt)!==st){for(nt===0&&(nt=G),at+=K,Q=D-nt,et=1<<Q;Q+nt<J&&(et-=ut[Q+nt],!(et<=0));)Q++,et<<=1;if(tt+=1<<Q,N===LENS$1&&tt>ENOUGH_LENS$1||N===DISTS$1&&tt>ENOUGH_DISTS$1)return 1;st=ot&yt,a[st]=G<<24|Q<<16|at-O|0}}return ot!==0&&(a[at+ot]=D-nt<<24|64<<16|0),n.bits=G,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=N=>(N>>>24&255)+(N>>>8&65280)+((N&65280)<<8)+((N&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=N=>{if(!N)return 1;const F=N.state;return!F||F.strm!==N||F.mode<HEAD||F.mode>SYNC?1:0},inflateResetKeep=N=>{if(inflateStateCheck(N))return Z_STREAM_ERROR$1;const F=N.state;return N.total_in=N.total_out=F.total=0,N.msg="",F.wrap&&(N.adler=F.wrap&1),F.mode=HEAD,F.last=0,F.havedict=0,F.flags=-1,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new Int32Array(ENOUGH_LENS),F.distcode=F.distdyn=new Int32Array(ENOUGH_DISTS),F.sane=1,F.back=-1,Z_OK$1},inflateReset=N=>{if(inflateStateCheck(N))return Z_STREAM_ERROR$1;const F=N.state;return F.wsize=0,F.whave=0,F.wnext=0,inflateResetKeep(N)},inflateReset2=(N,F)=>{let I;if(inflateStateCheck(N))return Z_STREAM_ERROR$1;const Z=N.state;return F<0?(I=0,F=-F):(I=(F>>4)+5,F<48&&(F&=15)),F&&(F<8||F>15)?Z_STREAM_ERROR$1:(Z.window!==null&&Z.wbits!==F&&(Z.window=null),Z.wrap=I,Z.wbits=F,inflateReset(N))},inflateInit2=(N,F)=>{if(!N)return Z_STREAM_ERROR$1;const I=new InflateState;N.state=I,I.strm=N,I.window=null,I.mode=HEAD;const Z=inflateReset2(N,F);return Z!==Z_OK$1&&(N.state=null),Z},inflateInit=N=>inflateInit2(N,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=N=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let F=0;for(;F<144;)N.lens[F++]=8;for(;F<256;)N.lens[F++]=9;for(;F<280;)N.lens[F++]=7;for(;F<288;)N.lens[F++]=8;for(inftrees(LENS,N.lens,0,288,lenfix,0,N.work,{bits:9}),F=0;F<32;)N.lens[F++]=5;inftrees(DISTS,N.lens,0,32,distfix,0,N.work,{bits:5}),virgin=!1}N.lencode=lenfix,N.lenbits=9,N.distcode=distfix,N.distbits=5},updatewindow=(N,F,I,Z)=>{let a;const O=N.state;return O.window===null&&(O.wsize=1<<O.wbits,O.wnext=0,O.whave=0,O.window=new Uint8Array(O.wsize)),Z>=O.wsize?(O.window.set(F.subarray(I-O.wsize,I),0),O.wnext=0,O.whave=O.wsize):(a=O.wsize-O.wnext,a>Z&&(a=Z),O.window.set(F.subarray(I-Z,I-Z+a),O.wnext),Z-=a,Z?(O.window.set(F.subarray(I-Z,I),0),O.wnext=Z,O.whave=O.wsize):(O.wnext+=a,O.wnext===O.wsize&&(O.wnext=0),O.whave<O.wsize&&(O.whave+=a))),0},inflate$2=(N,F)=>{let I,Z,a,O,e,n,q,D,z,K,J,G,Q,nt,et=0,tt,ot,ct,rt,st,yt,at,kt;const mt=new Uint8Array(4);let ut,ft;const Et=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(N)||!N.output||!N.input&&N.avail_in!==0)return Z_STREAM_ERROR$1;I=N.state,I.mode===TYPE&&(I.mode=TYPEDO),e=N.next_out,a=N.output,q=N.avail_out,O=N.next_in,Z=N.input,n=N.avail_in,D=I.hold,z=I.bits,K=n,J=q,kt=Z_OK$1;t:for(;;)switch(I.mode){case HEAD:if(I.wrap===0){I.mode=TYPEDO;break}for(;z<16;){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}if(I.wrap&2&&D===35615){I.wbits===0&&(I.wbits=15),I.check=0,mt[0]=D&255,mt[1]=D>>>8&255,I.check=crc32_1(I.check,mt,2,0),D=0,z=0,I.mode=FLAGS;break}if(I.head&&(I.head.done=!1),!(I.wrap&1)||(((D&255)<<8)+(D>>8))%31){N.msg="incorrect header check",I.mode=BAD;break}if((D&15)!==Z_DEFLATED){N.msg="unknown compression method",I.mode=BAD;break}if(D>>>=4,z-=4,at=(D&15)+8,I.wbits===0&&(I.wbits=at),at>15||at>I.wbits){N.msg="invalid window size",I.mode=BAD;break}I.dmax=1<<I.wbits,I.flags=0,N.adler=I.check=1,I.mode=D&512?DICTID:TYPE,D=0,z=0;break;case FLAGS:for(;z<16;){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}if(I.flags=D,(I.flags&255)!==Z_DEFLATED){N.msg="unknown compression method",I.mode=BAD;break}if(I.flags&57344){N.msg="unknown header flags set",I.mode=BAD;break}I.head&&(I.head.text=D>>8&1),I.flags&512&&I.wrap&4&&(mt[0]=D&255,mt[1]=D>>>8&255,I.check=crc32_1(I.check,mt,2,0)),D=0,z=0,I.mode=TIME;case TIME:for(;z<32;){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}I.head&&(I.head.time=D),I.flags&512&&I.wrap&4&&(mt[0]=D&255,mt[1]=D>>>8&255,mt[2]=D>>>16&255,mt[3]=D>>>24&255,I.check=crc32_1(I.check,mt,4,0)),D=0,z=0,I.mode=OS;case OS:for(;z<16;){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}I.head&&(I.head.xflags=D&255,I.head.os=D>>8),I.flags&512&&I.wrap&4&&(mt[0]=D&255,mt[1]=D>>>8&255,I.check=crc32_1(I.check,mt,2,0)),D=0,z=0,I.mode=EXLEN;case EXLEN:if(I.flags&1024){for(;z<16;){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}I.length=D,I.head&&(I.head.extra_len=D),I.flags&512&&I.wrap&4&&(mt[0]=D&255,mt[1]=D>>>8&255,I.check=crc32_1(I.check,mt,2,0)),D=0,z=0}else I.head&&(I.head.extra=null);I.mode=EXTRA;case EXTRA:if(I.flags&1024&&(G=I.length,G>n&&(G=n),G&&(I.head&&(at=I.head.extra_len-I.length,I.head.extra||(I.head.extra=new Uint8Array(I.head.extra_len)),I.head.extra.set(Z.subarray(O,O+G),at)),I.flags&512&&I.wrap&4&&(I.check=crc32_1(I.check,Z,G,O)),n-=G,O+=G,I.length-=G),I.length))break t;I.length=0,I.mode=NAME;case NAME:if(I.flags&2048){if(n===0)break t;G=0;do at=Z[O+G++],I.head&&at&&I.length<65536&&(I.head.name+=String.fromCharCode(at));while(at&&G<n);if(I.flags&512&&I.wrap&4&&(I.check=crc32_1(I.check,Z,G,O)),n-=G,O+=G,at)break t}else I.head&&(I.head.name=null);I.length=0,I.mode=COMMENT;case COMMENT:if(I.flags&4096){if(n===0)break t;G=0;do at=Z[O+G++],I.head&&at&&I.length<65536&&(I.head.comment+=String.fromCharCode(at));while(at&&G<n);if(I.flags&512&&I.wrap&4&&(I.check=crc32_1(I.check,Z,G,O)),n-=G,O+=G,at)break t}else I.head&&(I.head.comment=null);I.mode=HCRC;case HCRC:if(I.flags&512){for(;z<16;){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}if(I.wrap&4&&D!==(I.check&65535)){N.msg="header crc mismatch",I.mode=BAD;break}D=0,z=0}I.head&&(I.head.hcrc=I.flags>>9&1,I.head.done=!0),N.adler=I.check=0,I.mode=TYPE;break;case DICTID:for(;z<32;){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}N.adler=I.check=zswap32(D),D=0,z=0,I.mode=DICT;case DICT:if(I.havedict===0)return N.next_out=e,N.avail_out=q,N.next_in=O,N.avail_in=n,I.hold=D,I.bits=z,Z_NEED_DICT$1;N.adler=I.check=1,I.mode=TYPE;case TYPE:if(F===Z_BLOCK||F===Z_TREES)break t;case TYPEDO:if(I.last){D>>>=z&7,z-=z&7,I.mode=CHECK;break}for(;z<3;){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}switch(I.last=D&1,D>>>=1,z-=1,D&3){case 0:I.mode=STORED;break;case 1:if(fixedtables(I),I.mode=LEN_,F===Z_TREES){D>>>=2,z-=2;break t}break;case 2:I.mode=TABLE;break;case 3:N.msg="invalid block type",I.mode=BAD}D>>>=2,z-=2;break;case STORED:for(D>>>=z&7,z-=z&7;z<32;){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}if((D&65535)!==(D>>>16^65535)){N.msg="invalid stored block lengths",I.mode=BAD;break}if(I.length=D&65535,D=0,z=0,I.mode=COPY_,F===Z_TREES)break t;case COPY_:I.mode=COPY;case COPY:if(G=I.length,G){if(G>n&&(G=n),G>q&&(G=q),G===0)break t;a.set(Z.subarray(O,O+G),e),n-=G,O+=G,q-=G,e+=G,I.length-=G;break}I.mode=TYPE;break;case TABLE:for(;z<14;){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}if(I.nlen=(D&31)+257,D>>>=5,z-=5,I.ndist=(D&31)+1,D>>>=5,z-=5,I.ncode=(D&15)+4,D>>>=4,z-=4,I.nlen>286||I.ndist>30){N.msg="too many length or distance symbols",I.mode=BAD;break}I.have=0,I.mode=LENLENS;case LENLENS:for(;I.have<I.ncode;){for(;z<3;){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}I.lens[Et[I.have++]]=D&7,D>>>=3,z-=3}for(;I.have<19;)I.lens[Et[I.have++]]=0;if(I.lencode=I.lendyn,I.lenbits=7,ut={bits:I.lenbits},kt=inftrees(CODES,I.lens,0,19,I.lencode,0,I.work,ut),I.lenbits=ut.bits,kt){N.msg="invalid code lengths set",I.mode=BAD;break}I.have=0,I.mode=CODELENS;case CODELENS:for(;I.have<I.nlen+I.ndist;){for(;et=I.lencode[D&(1<<I.lenbits)-1],tt=et>>>24,ot=et>>>16&255,ct=et&65535,!(tt<=z);){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}if(ct<16)D>>>=tt,z-=tt,I.lens[I.have++]=ct;else{if(ct===16){for(ft=tt+2;z<ft;){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}if(D>>>=tt,z-=tt,I.have===0){N.msg="invalid bit length repeat",I.mode=BAD;break}at=I.lens[I.have-1],G=3+(D&3),D>>>=2,z-=2}else if(ct===17){for(ft=tt+3;z<ft;){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}D>>>=tt,z-=tt,at=0,G=3+(D&7),D>>>=3,z-=3}else{for(ft=tt+7;z<ft;){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}D>>>=tt,z-=tt,at=0,G=11+(D&127),D>>>=7,z-=7}if(I.have+G>I.nlen+I.ndist){N.msg="invalid bit length repeat",I.mode=BAD;break}for(;G--;)I.lens[I.have++]=at}}if(I.mode===BAD)break;if(I.lens[256]===0){N.msg="invalid code -- missing end-of-block",I.mode=BAD;break}if(I.lenbits=9,ut={bits:I.lenbits},kt=inftrees(LENS,I.lens,0,I.nlen,I.lencode,0,I.work,ut),I.lenbits=ut.bits,kt){N.msg="invalid literal/lengths set",I.mode=BAD;break}if(I.distbits=6,I.distcode=I.distdyn,ut={bits:I.distbits},kt=inftrees(DISTS,I.lens,I.nlen,I.ndist,I.distcode,0,I.work,ut),I.distbits=ut.bits,kt){N.msg="invalid distances set",I.mode=BAD;break}if(I.mode=LEN_,F===Z_TREES)break t;case LEN_:I.mode=LEN;case LEN:if(n>=6&&q>=258){N.next_out=e,N.avail_out=q,N.next_in=O,N.avail_in=n,I.hold=D,I.bits=z,inffast(N,J),e=N.next_out,a=N.output,q=N.avail_out,O=N.next_in,Z=N.input,n=N.avail_in,D=I.hold,z=I.bits,I.mode===TYPE&&(I.back=-1);break}for(I.back=0;et=I.lencode[D&(1<<I.lenbits)-1],tt=et>>>24,ot=et>>>16&255,ct=et&65535,!(tt<=z);){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}if(ot&&(ot&240)===0){for(rt=tt,st=ot,yt=ct;et=I.lencode[yt+((D&(1<<rt+st)-1)>>rt)],tt=et>>>24,ot=et>>>16&255,ct=et&65535,!(rt+tt<=z);){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}D>>>=rt,z-=rt,I.back+=rt}if(D>>>=tt,z-=tt,I.back+=tt,I.length=ct,ot===0){I.mode=LIT;break}if(ot&32){I.back=-1,I.mode=TYPE;break}if(ot&64){N.msg="invalid literal/length code",I.mode=BAD;break}I.extra=ot&15,I.mode=LENEXT;case LENEXT:if(I.extra){for(ft=I.extra;z<ft;){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}I.length+=D&(1<<I.extra)-1,D>>>=I.extra,z-=I.extra,I.back+=I.extra}I.was=I.length,I.mode=DIST;case DIST:for(;et=I.distcode[D&(1<<I.distbits)-1],tt=et>>>24,ot=et>>>16&255,ct=et&65535,!(tt<=z);){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}if((ot&240)===0){for(rt=tt,st=ot,yt=ct;et=I.distcode[yt+((D&(1<<rt+st)-1)>>rt)],tt=et>>>24,ot=et>>>16&255,ct=et&65535,!(rt+tt<=z);){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}D>>>=rt,z-=rt,I.back+=rt}if(D>>>=tt,z-=tt,I.back+=tt,ot&64){N.msg="invalid distance code",I.mode=BAD;break}I.offset=ct,I.extra=ot&15,I.mode=DISTEXT;case DISTEXT:if(I.extra){for(ft=I.extra;z<ft;){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}I.offset+=D&(1<<I.extra)-1,D>>>=I.extra,z-=I.extra,I.back+=I.extra}if(I.offset>I.dmax){N.msg="invalid distance too far back",I.mode=BAD;break}I.mode=MATCH;case MATCH:if(q===0)break t;if(G=J-q,I.offset>G){if(G=I.offset-G,G>I.whave&&I.sane){N.msg="invalid distance too far back",I.mode=BAD;break}G>I.wnext?(G-=I.wnext,Q=I.wsize-G):Q=I.wnext-G,G>I.length&&(G=I.length),nt=I.window}else nt=a,Q=e-I.offset,G=I.length;G>q&&(G=q),q-=G,I.length-=G;do a[e++]=nt[Q++];while(--G);I.length===0&&(I.mode=LEN);break;case LIT:if(q===0)break t;a[e++]=I.length,q--,I.mode=LEN;break;case CHECK:if(I.wrap){for(;z<32;){if(n===0)break t;n--,D|=Z[O++]<<z,z+=8}if(J-=q,N.total_out+=J,I.total+=J,I.wrap&4&&J&&(N.adler=I.check=I.flags?crc32_1(I.check,a,J,e-J):adler32_1(I.check,a,J,e-J)),J=q,I.wrap&4&&(I.flags?D:zswap32(D))!==I.check){N.msg="incorrect data check",I.mode=BAD;break}D=0,z=0}I.mode=LENGTH;case LENGTH:if(I.wrap&&I.flags){for(;z<32;){if(n===0)break t;n--,D+=Z[O++]<<z,z+=8}if(I.wrap&4&&D!==(I.total&4294967295)){N.msg="incorrect length check",I.mode=BAD;break}D=0,z=0}I.mode=DONE;case DONE:kt=Z_STREAM_END$1;break t;case BAD:kt=Z_DATA_ERROR$1;break t;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return N.next_out=e,N.avail_out=q,N.next_in=O,N.avail_in=n,I.hold=D,I.bits=z,(I.wsize||J!==N.avail_out&&I.mode<BAD&&(I.mode<CHECK||F!==Z_FINISH$1))&&updatewindow(N,N.output,N.next_out,J-N.avail_out),K-=N.avail_in,J-=N.avail_out,N.total_in+=K,N.total_out+=J,I.total+=J,I.wrap&4&&J&&(N.adler=I.check=I.flags?crc32_1(I.check,a,J,N.next_out-J):adler32_1(I.check,a,J,N.next_out-J)),N.data_type=I.bits+(I.last?64:0)+(I.mode===TYPE?128:0)+(I.mode===LEN_||I.mode===COPY_?256:0),(K===0&&J===0||F===Z_FINISH$1)&&kt===Z_OK$1&&(kt=Z_BUF_ERROR),kt},inflateEnd=N=>{if(inflateStateCheck(N))return Z_STREAM_ERROR$1;let F=N.state;return F.window&&(F.window=null),N.state=null,Z_OK$1},inflateGetHeader=(N,F)=>{if(inflateStateCheck(N))return Z_STREAM_ERROR$1;const I=N.state;return(I.wrap&2)===0?Z_STREAM_ERROR$1:(I.head=F,F.done=!1,Z_OK$1)},inflateSetDictionary=(N,F)=>{const I=F.length;let Z,a,O;return inflateStateCheck(N)||(Z=N.state,Z.wrap!==0&&Z.mode!==DICT)?Z_STREAM_ERROR$1:Z.mode===DICT&&(a=1,a=adler32_1(a,F,I,0),a!==Z.check)?Z_DATA_ERROR$1:(O=updatewindow(N,F,I,I),O?(Z.mode=MEM,Z_MEM_ERROR$1):(Z.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(N){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},N||{});const F=this.options;F.raw&&F.windowBits>=0&&F.windowBits<16&&(F.windowBits=-F.windowBits,F.windowBits===0&&(F.windowBits=-15)),F.windowBits>=0&&F.windowBits<16&&!(N&&N.windowBits)&&(F.windowBits+=32),F.windowBits>15&&F.windowBits<48&&(F.windowBits&15)===0&&(F.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let I=inflate_1$2.inflateInit2(this.strm,F.windowBits);if(I!==Z_OK)throw new Error(messages[I]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),F.dictionary&&(typeof F.dictionary=="string"?F.dictionary=strings.string2buf(F.dictionary):toString.call(F.dictionary)==="[object ArrayBuffer]"&&(F.dictionary=new Uint8Array(F.dictionary)),F.raw&&(I=inflate_1$2.inflateSetDictionary(this.strm,F.dictionary),I!==Z_OK)))throw new Error(messages[I])}Inflate$1.prototype.push=function(N,F){const I=this.strm,Z=this.options.chunkSize,a=this.options.dictionary;let O,e,n;if(this.ended)return!1;for(F===~~F?e=F:e=F===!0?Z_FINISH:Z_NO_FLUSH,toString.call(N)==="[object ArrayBuffer]"?I.input=new Uint8Array(N):I.input=N,I.next_in=0,I.avail_in=I.input.length;;){for(I.avail_out===0&&(I.output=new Uint8Array(Z),I.next_out=0,I.avail_out=Z),O=inflate_1$2.inflate(I,e),O===Z_NEED_DICT&&a&&(O=inflate_1$2.inflateSetDictionary(I,a),O===Z_OK?O=inflate_1$2.inflate(I,e):O===Z_DATA_ERROR&&(O=Z_NEED_DICT));I.avail_in>0&&O===Z_STREAM_END&&I.state.wrap>0&&N[I.next_in]!==0;)inflate_1$2.inflateReset(I),O=inflate_1$2.inflate(I,e);switch(O){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(O),this.ended=!0,!1}if(n=I.avail_out,I.next_out&&(I.avail_out===0||O===Z_STREAM_END))if(this.options.to==="string"){let q=strings.utf8border(I.output,I.next_out),D=I.next_out-q,z=strings.buf2string(I.output,q);I.next_out=D,I.avail_out=Z-D,D&&I.output.set(I.output.subarray(q,q+D),0),this.onData(z)}else this.onData(I.output.length===I.next_out?I.output:I.output.subarray(0,I.next_out));if(!(O===Z_OK&&n===0)){if(O===Z_STREAM_END)return O=inflate_1$2.inflateEnd(this.strm),this.onEnd(O),this.ended=!0,!0;if(I.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(N){this.chunks.push(N)},Inflate$1.prototype.onEnd=function(N){N===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=N,this.msg=this.strm.msg};function inflate$1(N,F){const I=new Inflate$1(F);if(I.push(N),I.err)throw I.msg||messages[I.err];return I.result}function inflateRaw$1(N,F){return F=F||{},F.raw=!0,inflate$1(N,F)}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=["updateSeverTime"];noLogEvents.push("heartbeat"),noLogEvents.push("heartbeatEx"),noLogEvents.push("networkQualityChange"),noLogEvents.push("onNetQuality"),noLogEvents.push("updateCall"),noLogEvents.push("pubNotify");const compressArrayBuffer=N=>{const F=new Uint8Array(N),I=pako.deflate(F,{gzip:!0});return new Uint8Array(I==null?void 0:I.buffer)},decompressArrayBuffer=N=>{const F=new Uint8Array(N),I=pako.inflate(F,{gzip:!0});return new Uint8Array(I==null?void 0:I.buffer)},sendMessageFormat=N=>{const{event:F}=N;switch(N.data_original=N.data,N.time&&(N.timeStr=E$1(N.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),F){case"login":N.data=com.quick.voice.proto.Login.encode(N.data).finish();break;case"joinRoom":case"joinRoomEx":N.data=com.quick.voice.proto.JoinReq.encode(N.data).finish();break;case"quitRoom":N.data=com.quick.voice.proto.QuitReq.encode(N.data).finish();break;case"connectCF":N.data=com.quick.voice.proto.ConnectCFReq.encode(N.data).finish(),N.data=compressArrayBuffer(N.data),N.compress=!0;break;case"publish":N.data=com.quick.voice.proto.PublishReq.encode(N.data).finish(),N.data=compressArrayBuffer(N.data),N.compress=!0;break;case"subscribe":N.data=com.quick.voice.proto.SubscribeReq.encode(N.data).finish();break;case"closeTrack":N.data=com.quick.voice.proto.CloseTrackReq.encode(N.data).finish(),N.data=compressArrayBuffer(N.data),N.compress=!0;break;case"renegotiate":N.data=com.quick.voice.proto.RenegotiateReq.encode(N.data).finish(),N.data=compressArrayBuffer(N.data),N.compress=!0;break;case"syncRoomInfo":N.data=com.quick.voice.proto.SyncRoomInfoReq.encode(N.data).finish();break;case"updateCall":N.data=com.quick.voice.proto.UpdateCall.encode(N.data).finish();break;case"networkQualityChange":N.data=com.quick.voice.proto.NetQualityChange.encode(N.data).finish();break;case"pubNotify":N.data=com.quick.voice.proto.PublishNotify.encode(N.data).finish();break;default:N.data=new Uint8Array;break}return N},onMessageFormat=N=>{const{event:F,compress:I=!1}=N;if(N.data_remote=N.data,N.time&&(N.timeStr=E$1(N.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),I)try{N.data=decompressArrayBuffer(N.data)}catch(Z){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",Z)}switch(F){case"login":N.data=com.quick.voice.proto.Login.decode(N.data);break;case"joinRoom":case"joinRoomEx":N.data=com.quick.voice.proto.JoinRsp.decode(N.data);break;case"onJoinRoom":N.data=com.quick.voice.proto.JoinNotify.decode(N.data);break;case"onQuitRoom":N.data=com.quick.voice.proto.QuitNotify.decode(N.data);break;case"connectCF":N.data=com.quick.voice.proto.ConnectCFRsp.decode(N.data);break;case"publish":N.data=com.quick.voice.proto.PublishRsp.decode(N.data);break;case"onPublish":N.data=com.quick.voice.proto.PublishNotify.decode(N.data);break;case"subscribe":N.data=com.quick.voice.proto.SubscribeRsp.decode(N.data);break;case"closeTrack":N.data=com.quick.voice.proto.CloseTrackRsp.decode(N.data);break;case"onCloseTrack":N.data=com.quick.voice.proto.CloseTrackNotify.decode(N.data);break;case"onUpdateCall":N.data=com.quick.voice.proto.UpdateCall.decode(N.data);break;case"onDestroyRoom":N.data=com.quick.voice.proto.QuitNotify.decode(N.data);break;case"onUpdatePermissions":N.data=com.quick.voice.proto.UpdatePermissions.decode(N.data);break;case"onNetQuality":N.data=com.quick.voice.proto.NetQualityNotify.decode(N.data);break;case"syncRoomInfo":N.data=com.quick.voice.proto.SyncRoomInfoRsp.decode(N.data);break;case"onCDNPlayUrlAdd":N.data=com.quick.voice.proto.CDNPlayAddressNotify.decode(N.data);break;case"debugger":N.data=JSON.parse(new TextDecoder().decode(N.data));break}return N};class CallsWebSocket{constructor(F){vt(this,bt);vt(this,_t,{url:"wss://demo.putplay.cc/websocket",debug:!1,reconnectCount:10,timeout:20*1e3});vt(this,wt,"");vt(this,St,{});vt(this,Tt,{});X(this,"state","closed");X(this,"sendMessageBefore",async()=>{});X(this,"onReconnectSuccess",F=>{});X(this,"onReconnectStop",F=>{});vt(this,jt,F=>{let I=!0;const{code:Z=1e3}=F;return Z===1e3&&(I=!1),I});vt(this,Zt,async F=>{it(this,_t).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连成功",F),this.state="connected",this.onReconnectSuccess(F)});vt(this,Ft,async F=>{it(this,_t).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连停止",F),this.close(),this.state="closed",this.onReconnectStop(F)});vt(this,Mt,(F,I={})=>{try{const{time:Z,event:a,data:O={},data_original:e={},data_remote:n,...q}=I,D=E$1(Z,"YYYY-MM-DD hh:mm:ss",{offset:480});let z={};const K=(ct={})=>{const rt=JSON.parse(JSON.stringify(ct)),st=Object.keys(rt);for(const yt of st)(yt.includes("sdp")||yt.includes("Sdp"))&&(rt[yt]="");return rt};let J="res ↓";switch(F){case"res":J="res ↓",z=K(O);break;case"req":J="req ↑",z=K(e);break}let G="#quickvo.logs";ignoreEvent.includes(a)&&(G="#quickvo.ignoreEvents");const Q={"#action":J,timeStr:D,event:a,data:z,time:Z,...q},nt=localStorage.getItem(G)||JSON.stringify([]),et=JSON.parse(nt);let tt=a==="heartbeat";const ot=[Q];for(const ct of et){const{event:rt}=ct;if(rt==="heartbeat"){if(tt)continue;tt=!0}if(ot.length===200)break;ot.push(ct)}localStorage.setItem(G,JSON.stringify(ot))}catch(Z){it(this,_t).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",Z)}});vt(this,Ht,(F,{resolve:I,reject:Z})=>{const{sn:a}=F,O=()=>{const n=it(this,St)[a];clearTimeout(n.destructionTimer),delete it(this,St)[a]},e=setTimeout(()=>{const n=it(this,St)[a];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:event is timeout",n.message),O(),Z("event is timeout")},it(this,_t).timeout);it(this,St)[a]={message:F,resolve:I,reject:Z,destruction:O,destructionTimer:e}});vt(this,zt,F=>it(this,St)[F]);vt(this,Jt,async F=>{const I=new Uint8Array(F),Z=com.quick.voice.proto.CommonRsp.decode(I),{sn:a,event:O}=Z,e=onMessageFormat(Z);if(it(this,_t).debug&&(noLogEvents.includes(O)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",e),ignoreEvent.includes(O)||it(this,Mt).call(this,"res",e)),notifyName_keys.includes(O))return this.emitNotify(O,P(e,["code","data","desc"]));const q=it(this,zt).call(this,a);if(q){const{resolve:D=K=>{},destruction:z=()=>{}}=q;D(P(e,["code","data","desc"])),z()}});X(this,"clearEvents",(F=[])=>{const I=Object.keys(it(this,St));F.length===0&&(F=I);for(const Z of I){if(!F.includes(Z))continue;const a=it(this,St)[Z];if(a){const{destruction:O}=a;O()}}});X(this,"connect",async(F="")=>new Promise(async I=>{F&&Rt(this,wt,F),it(this,bt)&&(await it(this,bt).close(),this.state="closed");const Z=`${it(this,_t).url}?s=${it(this,wt)}&t=${Date.now()}`;Rt(this,bt,new M({...it(this,_t),debug:!1,url:Z,binaryType:"arraybuffer",onMessage:it(this,Jt),checkReconnect:it(this,jt),getHeartbeatMsg:()=>"",onReconnectSuccess:it(this,Zt),onReconnectStop:it(this,Ft)})),this.state="connecting",await it(this,bt).connect(),this.state="connected",it(this,_t).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 当前广播事件",it(this,Tt)),I(it(this,bt))}));X(this,"close",async()=>{var I;it(this,_t).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.");const F=Object.keys(it(this,St));for(const Z of F){const{destructionTimer:a}=it(this,St)[Z];clearTimeout(a)}Rt(this,St,{}),await((I=it(this,bt))==null?void 0:I.close()),Rt(this,bt,void 0),this.state="closed"});X(this,"sendMessage",(F,I=!0)=>new Promise(async(Z,a)=>{var z;await this.sendMessageBefore();const{event:O,...e}=F,n=Date.now(),q=sendMessageFormat({event:O,sn:+`${n}${v$1(1e3,9999)}`,time:n,valid:it(this,_t).timeout,version:1,compress:!1,...e});it(this,_t).debug&&(noLogEvents.includes(O)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",q),ignoreEvent.includes(O)||it(this,Mt).call(this,"req",q)),I&&it(this,Ht).call(this,q,{resolve:Z,reject:a});const D=com.quick.voice.proto.CommonReq.encode(q).finish();(z=it(this,bt))==null||z.sendMessage(D)}));X(this,"emitNotify",async(F,I)=>{const Z=it(this,Tt)[F]||[];for(const a of Z){const{callback:O=async()=>{}}=a;await O(I)}});X(this,"addNotify",(F,I=!1)=>{const{event:Z,sn:a=xt(32)}=F;it(this,Tt)[Z]||(it(this,Tt)[Z]=[]);const O=it(this,Tt)[Z],e=O.findIndex(n=>n.sn===a);return e!==-1&&O.splice(e,1),I?O.unshift(F):O.push(F),a});X(this,"removeNotify",(F=[])=>{if(F.length===0)Rt(this,Tt,{});else{const I=Object.keys(it(this,Tt));for(const Z of I)it(this,Tt)[Z]=it(this,Tt)[Z].filter(a=>!F.includes(a.sn||""))}it(this,_t).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",it(this,Tt))});Rt(this,_t,{...it(this,_t),...F})}}bt=new WeakMap,_t=new WeakMap,wt=new WeakMap,St=new WeakMap,Tt=new WeakMap,jt=new WeakMap,Zt=new WeakMap,Ft=new WeakMap,Mt=new WeakMap,Ht=new WeakMap,zt=new WeakMap,Jt=new WeakMap;const createMutedAudioStream=N=>{const F=N.createOscillator();F.type="sine",F.frequency.setValueAtTime(0,N.currentTime);const I=N.createGain();I.gain.value=0,F.connect(I),I.connect(N.destination),F.start();const Z=N.createMediaStreamDestination();return I.disconnect(),F.connect(Z),Z.stream},createFakeVideoStream=(N=10,F=10,I=30)=>{const Z=document.createElement("canvas"),a=Z.getContext("2d");Z.width=N,Z.height=F;let O=0;return setInterval(()=>{a.clearRect(0,0,Z.width,Z.height);const q=a.createLinearGradient(0,0,Z.width,Z.height);q.addColorStop(0,`hsla(${O}, 100%, 50%, 0)`),q.addColorStop(1,`hsla(${O+120}, 100%, 50%, 0)`),a.fillStyle=q,a.fillRect(0,0,Z.width,Z.height),O=(O+1)%360},100),Z.captureStream(I)};var E=Object.defineProperty,$=N=>{throw TypeError(N)},j=(N,F,I)=>F in N?E(N,F,{enumerable:!0,configurable:!0,writable:!0,value:I}):N[F]=I,u=(N,F,I)=>j(N,typeof F!="symbol"?F+"":F,I),B=(N,F,I)=>F.has(N)||$("Cannot "+I),o=(N,F,I)=>(B(N,F,"read from private field"),I?I.call(N):F.get(N)),k=(N,F,I)=>F.has(N)?$("Cannot add the same private member more than once"):F instanceof WeakSet?F.add(N):F.set(N,I),g=(N,F,I,Z)=>(B(N,F,"write to private field"),F.set(N,I),I),C=(N,F,I,Z)=>({set _(a){g(N,F,a)},get _(){return o(N,F,Z)}}),d,r,c,m;class Y{constructor(F,I={}){k(this,d,{debug:!1}),k(this,r,new Map),k(this,c,new Map),k(this,m,0),u(this,"setCondition",async(Z,a)=>{if(!o(this,r).has(Z))throw new Error("You have set an incorrect condition. If this is necessary, you need to define it first during instantiation.");const O=o(this,r).get(Z);o(this,r).set(Z,a),O===!1&&a&&await this.executeTasks()}),u(this,"createTask",async Z=>{const a={describe:"",strict:!1,timeout:0,success:async rt=>{},fail:async rt=>{},complete:async()=>{},...Z},{describe:O,strict:e,timeout:n,conditionKeys:q,changeConditionKeys:D=[],func:z,success:K,fail:J,complete:G}=a,Q=`${C(this,m)._++}`,nt=()=>{let rt=!0;for(const st of q)if(!o(this,r).get(st)){rt=!1;break}return rt};let et=0;const tt=()=>{o(this,d).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->pr-task-queue: task ${O} (${Q}) end`),o(this,c).delete(Q)},ot=async()=>{if(!o(this,c).get(Q)||ct.runing)return;ct.runing=!0;for(const yt of D)this.setCondition(yt,!1);o(this,d).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->pr-task-queue: task ${O} (${Q}) run`);const rt=ct.func(),st=new Promise((yt,at)=>{n&&(et=setTimeout(()=>{at(`task: ${Q} (${O}) is timeout.`)},n))});return Promise.race([rt,st]).finally(()=>{ct.strict===!1&&ct.clear(),clearTimeout(et),ct.runing=!1,G()}).then(yt=>{K(yt)}).catch(yt=>{J(yt)})},ct={key:Q,describe:O,strict:e,conditionKeys:q,runing:!1,func:z,checkAccord:nt,success:K,fail:J,complete:G,run:ot,retry:()=>(ct.runing=!1,ot()),clear:tt};return o(this,c).set(Q,ct),ct.checkAccord()&&setTimeout(()=>ct.run(),0),ct}),u(this,"executeTasks",async()=>{const Z=[...o(this,c).values()];for(const a of Z)a.checkAccord()&&a.run()}),u(this,"clear",(Z=[])=>{if(Z.length===0){g(this,c,new Map);return}for(const a of Z)o(this,c).delete(a)}),u(this,"getConditions",()=>Object.fromEntries(o(this,r))),u(this,"getTasks",()=>o(this,c));for(const Z of F)o(this,r).set(Z,!0);g(this,d,{debug:!1,...I})}}d=new WeakMap,r=new WeakMap,c=new WeakMap,m=new WeakMap;class RoomBase{constructor(F){X(this,"options",{appid:"",sdkToken:"",roomId:"",userId:"",earlyId:"",callType:0,debug:!1,reportErr:!1,logUrl:"https://logs.putplay.cc",newPublishAutoSubscribe:!0});X(this,"sdk_service_version","1.0.6");X(this,"prohibitNotify",!1);X(this,"isEarly",!1);X(this,"isInRoom",!1);X(this,"taskQueue");X(this,"roomState","ready");X(this,"createAt",Date.now());X(this,"cwsIns");X(this,"peerIns");X(this,"transceiverMap",new Map);X(this,"userMap",new Map);X(this,"setLocalStreamActiveMap",new Map);X(this,"phoneyStreams",new Map);X(this,"mediaDevicesErrInfo",{microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""});X(this,"reportLogs",(F,I="未知错误")=>{const{appid:Z,userId:a,earlyId:O="",logUrl:e,reportErr:n}=this.options;if(!n)return;const q="web",D=z=>({ws_c_timeout:0,webrtc_c_timeout:1,join_room_error:2,publish_error:3,subscribe_error:4,close_track_error:5,heartbeat_e_timeout:6,heartbeat_i_timeout:7,quit_room_error:8})[z].toString();{const z=D(F),K={origin:q,type:z,app_id:Z,user_id:a,ins_id:O,desc:I},J=btoa(encodeURI(JSON.stringify(K))),G=`${e}/upload/log?log_key=${J}`;{const Q=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),et=new TextEncoder().encode(Q),tt=pako.deflate(et,{gzip:!0});this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLogs",{obj:K,url:G,size:lt(tt.byteLength)}),fetch(G,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:tt})}}});X(this,"initPhoneyStreams",F=>{for(const I of mediaType_keys){const Z=this.phoneyStreams.get(I);if(Z){const a=Z.getTracks();for(const O of a)O.stop()}switch(I){case"microphoneCamera_audio":this.phoneyStreams.set("microphoneCamera_audio",createMutedAudioStream(F));break;case"microphoneCamera_video":this.phoneyStreams.set("microphoneCamera_video",createFakeVideoStream());break;case"screenSharing_audio":this.phoneyStreams.set("screenSharing_audio",createMutedAudioStream(F));break;case"screenSharing_video":this.phoneyStreams.set("screenSharing_video",createFakeVideoStream());break}}});X(this,"getPhoneyStreams",F=>this.phoneyStreams.get(F));X(this,"getRoomInfo",()=>{const{options:F,roomState:I,createAt:Z}=this;return{...F,roomState:I,createAt:Z}});X(this,"setRoomState",F=>{this.roomState=F;const I=enum_roomState[F],Z={state:F,stateStr:I};this.cwsIns.emitNotify("onRoomState",{code:200,data:Z,desc:"room state is change."})});X(this,"setOptions",async F=>{const I={...this.options,...F};this.options=I});X(this,"stopStream",async F=>{const I=F.getTracks();for(const Z of I)Z.stop()});X(this,"getMediaDevicesErrInfo",async()=>{try{const F=await navigator.mediaDevices.enumerateDevices();F.find(Z=>Z.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),F.find(Z=>Z.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(F){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getMediaDevicesErrInfo is error.",F)}return this.mediaDevicesErrInfo});X(this,"getUserMediaKey",(F,I)=>`${F}-${I}`);X(this,"getCallActionMap",(F=0)=>{const Z=Number(F).toString(2).padStart(4,"0").split(""),[a,O,e,n]=Z;return{microphoneCamera_audio:!!Number(n),microphoneCamera_video:!!Number(e),screenSharing_video:!!Number(O),screenSharing_audio:!!Number(a)}});X(this,"getAverageVolume",(F,I)=>{F.getByteFrequencyData(I);let Z=0;for(let O=0;O<I.length;O++)Z+=I[O];return Math.ceil(Z/I.length)});X(this,"getCallAction",async F=>{let I="";const Z=O=>F.findIndex(({type:n,enabled:q=!0})=>n===O&&q)===-1?"0":"1";return I=`${Z(0)}${I}`,I=`${Z(1)}${I}`,I=`${Z(2)}${I}`,I=`${Z(3)}${I}`,parseInt(I,2)});X(this,"getTrackNamesFormTracks",(F,I=[],Z="trackName")=>{const a=[];for(const O of F){const{type:e}=O;if(I.length===0||I.includes(e)){const n=O[Z];n&&a.push(`${n}`)}}return a});X(this,"usersFilter",F=>dt(F,["id","isSelf","joinTime","tracks","callAction","callActionStr","callActionMap","network","permissions","isPublished","updateStreams"]).sort((a,O)=>a.id.localeCompare(O.id,"en")));this.setOptions(F),this.cwsIns=new CallsWebSocket({...F}),this.taskQueue=new Y(["createWs","createSession","ice","joinRoom","createTrack","publish","subscribe","renegotiate","closeTrack"],{debug:F.debug}),this.taskQueue.setCondition("createSession",!1),this.taskQueue.setCondition("ice",!1)}}class RoomMedias extends RoomBase{constructor(I){super(I);vt(this,Ct,[]);vt(this,gt,new Map);vt(this,Ot,new Map);vt(this,It,new Map);vt(this,Nt,new Map);X(this,"localStreamsActionMap",new Map);vt(this,qt,new(window.AudioContext||window.webkitAudioContext));X(this,"resume",()=>{it(this,qt).resume()});vt(this,Wt,()=>{it(this,Ot).set("microphoneCamera_audio",{autoGainControl:!1,echoCancellation:!1,noiseSuppression:!1}),it(this,Ot).set("microphoneCamera_video",{frameRate:{min:10,ideal:30}}),it(this,Ot).set("screenSharing_video",{frameRate:{min:10,ideal:30}}),it(this,Ot).set("screenSharing_audio",{autoGainControl:!1,echoCancellation:!1,noiseSuppression:!1})});vt(this,Kt,()=>{it(this,gt).set("audioinput","default"),it(this,gt).set("videoinput","default"),it(this,gt).set("audiooutput","default")});X(this,"emitNotifyUpdateUsersStreams",async I=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:I,desc:"users streams is change."})});X(this,"initUserMediaStreamContext",async(I,Z,a)=>{var q;const[O]=a.getTracks();if(!O){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: tracks.length is 0.",{userId:I,mediaType:Z,stream:a});return}this.removeUserMediaStreamContext(I,Z);const e=this.getUserMediaKey(I,Z),{kind:n}=O;switch(n){case"audio":{const D=new AudioMediaContext(O,it(this,qt));it(this,It).set(e,D)}break;case"video":{const D=new VideoMediaContext(O);it(this,It).set(e,D)}break}{const D=this.getUserMediaStreamContext(I,Z);if(D&&D.kind==="audio")try{const z=it(this,gt).get("audiooutput");(q=D.audioContext)==null||q.setSinkId(z)}catch(z){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error",z)}}});X(this,"getUserMediaStreamContext",(I,Z)=>{const a=this.getUserMediaKey(I,Z);return it(this,It).get(a)});X(this,"getUserAudioMediaStreamContext",(I,Z)=>{const a=this.getUserMediaKey(I,Z);return it(this,It).get(a)});X(this,"removeUserMediaStreamContext",(I,Z)=>{const a=this.getUserMediaKey(I,Z),O=it(this,It).get(a);O==null||O.stop(),it(this,It).delete(a)});X(this,"getUserStream",(I,Z)=>{const a=this.getUserMediaStreamContext(I,Z);return(a==null?void 0:a.getStream())||new MediaStream});X(this,"getUserStreams",(I,Z=[])=>{Z.length===0&&(Z=mediaType_keys);const a={};for(const O of Z){const e=this.getUserStream(I,O);a[O]=e}return a});X(this,"removeUserStreams",async(I,Z=[])=>{Z.length===0&&(Z=mediaType_keys);for(const a of Z)this.removeUserMediaStreamContext(I,a)});X(this,"clearUserStreams",()=>{const I=it(this,It).values();for(const Z of I)Z.stop();Rt(this,It,new Map)});X(this,"setMediaTrackConstraints",async(I,Z)=>{it(this,Ot).set(I,Z);const O=this.getUserStream(this.options.userId,I).getTracks();if(O.length!==0)for(const e of O){const q={echoCancellation:!1,noiseSuppression:!1,autoGainControl:!1,...e.getConstraints(),...Z};await e.applyConstraints(q)}});X(this,"stopLocalStreams",async(I=[])=>{I.length===0&&(I=mediaType_keys);for(const Z of I){const a=it(this,Nt).get(Z);a&&await this.stopStream(a),it(this,Nt).delete(Z)}});X(this,"addLocalStream",(I,Z)=>{const a=it(this,Nt).get(I);a&&this.stopStream(a),it(this,Nt).set(I,Z)});X(this,"initLocalStream",async I=>{switch(I){case"microphoneCamera_audio":{const Z=it(this,gt).get("audioinput"),a=it(this,Ot).get("microphoneCamera_audio"),O=await navigator.mediaDevices.getUserMedia({audio:{deviceId:Z,...a},video:!1});this.addLocalStream("microphoneCamera_audio",O)}break;case"microphoneCamera_video":{const Z=it(this,gt).get("videoinput"),a=it(this,Ot).get("microphoneCamera_video"),O=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:Z,...a}});this.addLocalStream("microphoneCamera_video",O)}break;case"microphoneCamera":{const Z=it(this,gt).get("audioinput"),a=it(this,gt).get("videoinput"),O=it(this,Ot).get("microphoneCamera_audio"),e=it(this,Ot).get("microphoneCamera_video"),q=(await navigator.mediaDevices.getUserMedia({audio:{deviceId:Z,...O},video:{deviceId:a,...e}})).getTracks();for(const D of q){const{kind:z}=D;if(z==="audio"){const K=new MediaStream;K.addTrack(D),this.addLocalStream("microphoneCamera_audio",K)}if(z==="video"){const K=new MediaStream;K.addTrack(D),this.addLocalStream("microphoneCamera_video",K)}}}break;case"screenSharing_audio":{const Z=it(this,Ot).get("screenSharing_audio"),O=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...Z})).getTracks();for(const e of O){const{kind:n}=e;if(n==="audio"){const q=new MediaStream;q.addTrack(e),this.addLocalStream("screenSharing_audio",q)}}}break;case"screenSharing_video":{const Z=it(this,Ot).get(I),O=(await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...Z})).getTracks();for(const e of O){const{kind:n}=e;if(n==="video"){const q=new MediaStream;q.addTrack(e),this.addLocalStream("screenSharing_video",q)}}}break;case"screenSharing":{const Z=it(this,Ot).get("screenSharing_audio"),a=it(this,Ot).get("screenSharing_video"),e=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...Z,...a})).getTracks();for(const n of e){const{kind:q}=n;if(q==="audio"){const D=new MediaStream;D.addTrack(n),this.addLocalStream("screenSharing_audio",D)}if(q==="video"){const D=new MediaStream;D.addTrack(n),this.addLocalStream("screenSharing_video",D)}}}break}});X(this,"getLocalStream",I=>it(this,Nt).get(I));X(this,"getLocalStreams",(I=[])=>{I.length===0&&(I=mediaType_keys);const Z={};for(const a of I)Z[a]=this.getLocalStream(a);return Z});vt(this,Dt,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(I=>{Rt(this,Ct,I.sort((Z,a)=>Z.label.localeCompare(a.label,"zh-Hans-CN",{sensitivity:"accent"})))}).catch(function(I){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",I)}),it(this,Ct)));vt(this,Gt,()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await it(this,Dt).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),it(this,Dt).call(this)});X(this,"getMediaDeviceKind",I=>it(this,gt).get(I));X(this,"changeAudiooutput",()=>{const I=it(this,gt).get("audiooutput"),Z=it(this,It).values();for(const a of Z)if(a.kind==="audio"&&"setSinkId"in HTMLMediaElement.prototype)try{a.audioContext.setSinkId(I)}catch(O){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",O)}});X(this,"setDeviceKind",(I,Z)=>{it(this,gt).set(I,Z)});X(this,"setAudioOutputDevice",I=>this.setDeviceKind("audiooutput",I));X(this,"getEnumerateDevices",async I=>(await it(this,Dt).call(this),it(this,Ct).filter(a=>a.kind===I)));X(this,"getEnumerateAudioinputDevices",()=>this.getEnumerateDevices("audioinput"));X(this,"getEnumerateAudioOutputDevices",()=>this.getEnumerateDevices("audiooutput"));X(this,"getEnumerateVideoinputDevices",()=>this.getEnumerateDevices("videoinput"));it(this,Gt).call(this),it(this,Kt).call(this),it(this,Wt).call(this),this.initPhoneyStreams(it(this,qt)),document.addEventListener("click",()=>{var Z;((Z=it(this,qt))==null?void 0:Z.state)==="suspended"&&it(this,qt).resume()})}}Ct=new WeakMap,gt=new WeakMap,Ot=new WeakMap,It=new WeakMap,Nt=new WeakMap,qt=new WeakMap,Wt=new WeakMap,Kt=new WeakMap,Dt=new WeakMap,Gt=new WeakMap;class RoomUsers extends RoomMedias{constructor(I){super(I);X(this,"getMaxVolumeUser",()=>{const I=Array.from(this.userMap.values(),({id:a})=>a);if(I.length===0)return;let Z=[];for(const a of I){const O=this.getUserMediaStreamContext(a,"microphoneCamera_audio");if(!O||O.kind!=="audio")continue;const e=O.getVolume();Z.push({id:a,volume:e})}return Z=Z.sort((a,O)=>a.volume-O.volume>0?-1:1),Z[0]});X(this,"setAudioFilter",async(I={})=>{const Z=await this.getUsersId();for(const a of Z){{const O=this.getUserMediaStreamContext(a,"microphoneCamera_audio");(O==null?void 0:O.kind)==="audio"&&(O==null||O.setFilter(I))}{const O=this.getUserMediaStreamContext(a,"screenSharing_audio");(O==null?void 0:O.kind)==="audio"&&(O==null||O.setFilter(I))}}});X(this,"setEnhanceGain",async(I,Z,a)=>{const O=this.getUserMediaStreamContext(I,Z);(O==null?void 0:O.kind)==="audio"&&(O==null||O.setEnhanceGain(a))});X(this,"setVolume",(I,Z,a)=>{const O=this.getUserMediaStreamContext(I,Z);(O==null?void 0:O.kind)==="audio"&&(O==null||O.setVolumeGain(a))});X(this,"getVolume",(I,Z)=>{const a=this.getUserMediaStreamContext(I,Z);let O=0;return(a==null?void 0:a.kind)==="audio"&&(O=a==null?void 0:a.getVolume()),O});X(this,"clearUsers",()=>{this.userMap=new Map});X(this,"removeUsers",async I=>{for(const Z of I)this.userMap.delete(Z),await this.removeUserStreams(Z)});X(this,"createUser",async I=>{const Z=Date.now(),a={id:I,permissions:0,callAction:0,callActionStr:"",callActionMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},callState:0,isSelf:I===this.options.userId,isPublished:!1,joinTime:Z,updateAt:Z,network:{egress:0,ingress:0},tracks:[],updateStreams:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1}};this.userMap.set(I,a)});X(this,"getUser",async I=>(this.userMap.has(I)||await this.createUser(I),this.userMap.get(I)));X(this,"getUsers",async(I=[])=>{I.length===0&&(I=[...this.userMap.keys()]);const Z=[];for(const a of I){const O=await this.getUser(a);Z.push(O)}return Z});X(this,"getAllUserTrackMids",async()=>{const I=await this.getUsers(),Z=[];for(const a of I){const{tracks:O=[]}=a;for(const e of O)Z.push(e.mid)}return Z});X(this,"getUserTrackByTrackName",async I=>{const Z=await this.getUsers(),a=[];for(const O of Z){const{tracks:e=[]}=O;for(const n of e){const{trackName:q}=n;I.includes(q)&&a.push(n)}}return a});X(this,"getUserTrackFromMid",async I=>{const Z=await this.getUsers();let a;for(const O of Z){const{tracks:e=[]}=O;for(const n of e)if(n.mid===I){a=n;break}}return a});X(this,"checkUserInRoom",I=>this.userMap.has(I));X(this,"getUsersId",async()=>[...this.userMap.keys()]);X(this,"getCaller",async()=>await this.getUser(this.options.userId));X(this,"updateIsPublished",async(I,Z=!1)=>{const a=await this.getUser(I);a.isPublished=Z});X(this,"setUserUpdateStreams",async(I,Z,a=!0)=>{const O=await this.getUser(I),e={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};e[Z]=a,O.updateStreams=e});X(this,"updateUsertracks",async(I,Z=[],a)=>{const O=await this.getUser(I);a&&(Z=[...O.tracks,...Z]),Z=Z.filter(({mid:q=""})=>q!==""),Z=pt(Z,["type"]),Z=Z.sort((q,D)=>q.type-D.type<0?-1:1);for(const q of Z)q.userId=I,q.mediaType=mediaType_keys[q.type],q.enabled===void 0&&(q.enabled=!0);O.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const e=dt(O.tracks,["mediaType","enabled","mid","msid","trackName"]),n=dt(Z,["mediaType","enabled","mid","msid","trackName"]);{const q="microphoneCamera_audio",D=n.find(J=>J.mediaType===q),z=e.find(J=>J.mediaType===q),K=JSON.stringify(D)!==JSON.stringify(z);O.updateStreams[q]=K}{const q="microphoneCamera_video",D=n.find(J=>J.mediaType===q),z=e.find(J=>J.mediaType===q),K=JSON.stringify(D)!==JSON.stringify(z);O.updateStreams[q]=K}{const q="screenSharing_audio",D=n.find(J=>J.mediaType===q),z=e.find(J=>J.mediaType===q),K=JSON.stringify(D)!==JSON.stringify(z);O.updateStreams[q]=K}{const q="screenSharing_video",D=n.find(J=>J.mediaType===q),z=e.find(J=>J.mediaType===q),K=JSON.stringify(D)!==JSON.stringify(z);O.updateStreams[q]=K}O.tracks=Z});X(this,"updateUserCallAction",async(I,Z=0)=>{const a=await this.getUser(I);a.callAction=Z,a.callActionStr=Z.toString(2).padStart(4,"0"),a.callActionMap=this.getCallActionMap(Z)});X(this,"updateUserNetwork",async(I,Z={egress:5,ingress:5})=>{const a=await this.getUser(I);a.network=Z});X(this,"updateUserPermissions",async(I,Z)=>{if(Z){const a=await this.getUser(I);a.permissions=Z}});X(this,"updateUserBase",async I=>{const Z=await this.getUser(I);Z.isSelf=I===this.options.userId,Z.updateAt=Date.now()});X(this,"updateUsers",async I=>{for(const Z of I){const{id:a,tracks:O,callAction:e,permissions:n,isPublished:q}=Z;await this.updateUserBase(a),await this.updateIsPublished(a,q),await this.updateUserPermissions(a,n),await this.updateUsertracks(a,O,!0),await this.updateUserCallAction(a,e),await this.updateUserNetwork(a)}});X(this,"emitNotifyUpdateUser",async I=>{const Z=await this.getUsers([I]),[a]=this.usersFilter(Z);this.cwsIns.emitNotify("onRoomUser",{code:200,data:a,desc:"user info is change."})});X(this,"emitNotifyUpdateUsers",async()=>{const I=await this.getUsers(),Z=this.usersFilter(I);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:Z,desc:"all users info is change."})})}}class RoomPeer extends RoomUsers{constructor(I){super(I);X(this,"getPeerStatsTimer",0);X(this,"reports",[]);X(this,"peerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});X(this,"initPeer",()=>{var I;(I=this.peerIns)==null||I.close(),this.peerIns=new RTCPeerConnection({bundlePolicy:"max-bundle"}),it(this,Vt).call(this),this.transceiverMap=new Map,it(this,Yt).call(this)});X(this,"replaceSenderStream",async(I=[],Z)=>{const{userId:a}=this.options;I.length===0&&(I=mediaType_keys);for(const O of I){const e=this.transceiverMap.get(O);let n;if(e){const{sender:q}=e;Z?n=this.getUserStream(a,O):n=this.getPhoneyStreams(O);const[D]=n.getTracks();D&&await q.replaceTrack(D)}}});X(this,"getSenderTracks",async(I=[])=>{const Z=[];for(const a of I){const O=this.transceiverMap.get(a);if(!O)continue;const{mid:e,sender:n}=O,{track:q}=n;if(!q)continue;const{id:D,enabled:z}=q,K=mediaType_keys.findIndex(G=>G===a),J={type:K,enabled:z,trackName:`web-${K}-${D}`,location:"local",mid:e};Z.push(J)}return Z});X(this,"addSenders",async(I=[])=>{I.length===0&&(this.peerIns.addTransceiver("audio",{direction:"sendonly"}),this.peerIns.addTransceiver("video",{direction:"sendonly"}));const Z=[];for(const a of I){if(this.transceiverMap.get(a))continue;const e=this.getPhoneyStreams(a),[n]=e.getTracks(),q=this.peerIns.addTransceiver(n,{direction:"sendonly"});this.transceiverMap.set(a,q),Z.push(a)}if(I.length===0||Z.length!==0){const a=await this.peerIns.createOffer();if(this.options.debug){const O=libExports.parse(a.sdp),e=dt(O.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:e,sdpJson:O,description:a})}await this.peerIns.setLocalDescription(a)}return Z});X(this,"removeSenders",async(I=[])=>{I.length===0&&(I=mediaType_keys);for(const Z of I)this.transceiverMap.has(Z)&&this.transceiverMap.delete(Z)});X(this,"onSubscribeUserTracks",I=>{let Z=0;return new Promise(async a=>{const O=[];for(const e of I){const{tracks:n=[]}=e;for(const q of n){const{trackName:D,mid:z}=q,[K]=await this.getUserTrackByTrackName([D]);O.push({...K,mid:z})}}{let e=[];const n=async()=>{clearTimeout(Z);const D=new Map;for(const K of e){const{userId:J,mediaType:G}=K;if(!J||!G)continue;D.has(J)||D.set(J,{userId:J,tracks:[],updateStreams:{}});const nt=D.get(J);nt.tracks.push(K),nt.updateStreams[G]=!0}const z=[...D.values()];for(const K of z){const{userId:J,tracks:G}=K;await this.updateUsertracks(J,G,!0)}await this.emitNotifyUpdateUsersStreams(z),this.peerIns.removeEventListener("track",q);{const K=Array.from(O,Q=>Q.trackName),J=Array.from(e,Q=>Q.trackName),G=K.filter(Q=>!J.includes(Q));a({target:K,success:J,fail:G})}},q=async D=>{const{streams:z,transceiver:K}=D,[J]=z,{mid:G,receiver:Q}=K,{track:nt}=Q,{id:et,kind:tt}=nt,ot=O.find(st=>st.mid===`${G}`);if(!ot)return;const{userId:ct,mediaType:rt}=ot;if(!(!ct||!rt)){{const st={...ot,mid:G,msid:et};e.push(st)}if(this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: await subscribe ${e.length}/${O.length}`,{mediaType:rt,mid:G,userTrack:ot,e:D}),await this.initUserMediaStreamContext(ct,rt,J),tt==="audio"){const st=this.getUserMediaStreamContext(ct,rt);(st==null?void 0:st.kind)==="audio"&&st.setMute(!1)}O.length===e.length&&n()}};this.peerIns.addEventListener("track",q),Z=setTimeout(()=>{this.reportLogs("subscribe_error",`incomplete subscription. (${e.length}/${O.length})`),n()},5*1e3)}})});vt(this,Vt,()=>{let I=0;const Z=()=>{this.peerIns.close(),this.setRoomState("closed")};this.peerIns.onconnectionstatechange=async a=>{const O=a.target.connectionState;switch(await this.taskQueue.setCondition("ice",!1),clearTimeout(I),O){case"connected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${O}`),await this.taskQueue.setCondition("ice",!0);break;case"disconnected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${O}`),I=setTimeout(Z,30*1e3);break;case"failed":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${O}`),this.setRoomState("failed");break;case"closed":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${O}`),Z();break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${O}`);break}}});X(this,"closeUserTracks",async(I,Z=[],a=!1)=>{const O=[];for(const D of Z){const{trackName:z,msid:K}=D;O.push(z),K&&O.push(K)}const e=D=>O.includes(D),n=this.peerIns.getTransceivers();for(const D of n){const{mid:z,sender:K,receiver:J}=D;K.track&&e(K.track.id)&&(D.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.sender: ${z} is stop.`,D)),J.track&&e(J.track.id)&&(D.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.receiver: ${z} is stop.`,D))}const q=await this.getUser(I);if(q){for(const D of q.tracks){const{trackName:z,msid:K,userId:J,mediaType:G}=D;!J||!G||!e(z)||(this.removeUserMediaStreamContext(J,G),K&&delete D.msid)}if(a){const D=q.tracks.filter(({trackName:z})=>!e(z));await this.updateUsertracks(I,D,!1)}}});X(this,"createOffer",async()=>{const I=await this.peerIns.createOffer();if(this.options.debug){const Z=libExports.parse(I.sdp),a=dt(Z.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:a,sdpJson:Z,description:I})}await this.peerIns.setLocalDescription(I)});X(this,"createAnswer",async()=>{const I=await this.peerIns.createAnswer();if(this.options.debug){const Z=libExports.parse(I.sdp),a=dt(Z.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:a,sdpJson:Z,description:I})}await this.peerIns.setLocalDescription(I)});X(this,"getSdp",()=>{var I;return(I=this.peerIns.localDescription)==null?void 0:I.sdp});X(this,"setRemoteDescription",async I=>{if(this.options.debug){const Z=libExports.parse(I.sdp),a=dt(Z.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:a,sdpJson:Z,description:I})}return await this.peerIns.setRemoteDescription(I),I});X(this,"setCallStrategy",async(I,Z=[])=>{Z.length===0&&(Z=mediaType_keys);let a="balanced";switch(I){case"qualityPriority":a="maintain-resolution";break;case"fluencyPriority":a="maintain-framerate";break;case"balancedDowngrade":a="balanced";break}const O=await this.getCaller(),e=Array.from(O.tracks,({trackName:q})=>q),n=this.peerIns.getSenders();for(const q of n){const{track:D}=q;if(!D||!e.includes(D.id))continue;const z=q.getParameters();q.setParameters({...z,degradationPreference:a})}});X(this,"setRTCRtpSenderParameters",I=>{try{const Z=this.peerIns.getSenders();for(const a of Z){const O=a.getParameters();a.setParameters({...O,...I})}}catch(Z){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",Z)}});X(this,"getReportsByMid",async(I=[])=>I.length===0?this.reports:this.reports.filter(Z=>I.includes(Z.mid)));X(this,"getRoomNetwork",()=>this.peerNetwork);X(this,"getPeerNetwork",()=>this.peerNetwork);vt(this,Qt,async()=>{try{const I=await this.peerIns.getStats(),Z=["inbound-rtp","remote-inbound-rtp","outbound-rtp","transport"],O=[...I.values()].filter(st=>Z.includes(st.type));let e=0,n=0,q=0,D=0,z=0,K=0,J=[],G=[];for(const st of this.reports){const{packetsSent:yt,packetsLost:at}=st;yt&&(q+=yt),at&&(D+=at)}this.reports=O;for(const st of this.reports){const{bytesSent:yt,bytesReceived:at,packetsSent:kt,packetsLost:mt,roundTripTime:ut,jitter:ft}=st;yt&&(n=yt),at&&(e=at),kt&&(z+=kt),mt&&(K+=mt),ut&&J.push((ut*100).toFixed(2)),ft&&G.push(ft.toFixed(2))}G.sort().reverse(),J.sort().reverse();const Q=z-q,nt=K-D,et=Q===0?"0.00":(nt/Q).toFixed(2),[tt="0"]=J,[ot="0"]=G,ct={outboundBytes:n,inboundBytes:e,lostRate:et,roundTripTime:tt,jitter:ot};this.peerNetwork=ct;const rt=(st,yt,at)=>{const kt=Number(st),mt=Number(yt),ut=Number(at);let ft="0";return kt<.03&&mt<100&&ut<.05?ft="5":kt<.06&&mt<160&&ut<.1?ft="4":kt<.1&&mt<250&&ut<.15?ft="3":kt<.15&&mt<400&&ut<.2?ft="2":ft="1",Number(ft)};{const st=rt(et,tt,ot),yt=await this.getCaller(),{network:at}=yt,kt={egress:st,ingress:st};$t("updateUserNetwork",async()=>{if(await this.updateUserNetwork(this.options.userId,kt),JSON.stringify(at)!==JSON.stringify(kt)){this.emitNotifyUpdateUsers();const{userId:ft,roomId:Et}=this.options;this.cwsIns.sendMessage({event:"networkQualityChange",data:{...kt,userId:ft,roomId:Et}},!1)}},3*1e3)}}catch(I){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setNetQuality is err.",I)}});vt(this,Yt,()=>{const I=async()=>{this.peerIns.connectionState!=="connected"||!this.options.roomId||it(this,Qt).call(this)};this.getPeerStatsTimer=setInterval(I,1*1e3)});X(this,"stopGetPeerStats",()=>clearInterval(this.getPeerStatsTimer))}}Vt=new WeakMap,Qt=new WeakMap,Yt=new WeakMap;class RoomCalls extends RoomPeer{constructor(I){super(I);vt(this,Ut,0);X(this,"setLocalStream",(I,Z)=>new Promise(async(a,O)=>{try{typeof I=="string"&&(I=[I]);for(const n of I)this.localStreamsActionMap.set(n,Z);if(Z){if(I.includes("microphoneCamera_audio")&&I.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera"):I.includes("microphoneCamera_audio")?await this.initLocalStream("microphoneCamera_audio"):I.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera_video"):I.includes("screenSharing_audio")&&I.includes("screenSharing_video")?await this.initLocalStream("screenSharing"):I.includes("screenSharing_audio")&&!I.includes("screenSharing_video")?await this.initLocalStream("screenSharing_audio"):I.includes("screenSharing_video")&&!I.includes("screenSharing_audio")&&await this.initLocalStream("screenSharing_video"),I.includes("screenSharing_audio")){const n=this.getLocalStream("screenSharing_audio");if(n){const q=n.getTracks();for(const D of q)D.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}if(I.includes("screenSharing_video")){const n=this.getLocalStream("screenSharing_video");if(n){const q=n.getTracks();for(const D of q)D.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}}else await this.stopLocalStreams(I);const e=this.getLocalStreams(I);this.cwsIns.emitNotify("onLocalStream",{code:200,data:e,desc:"local stream is change."}),a(e)}catch(e){O(e)}}));X(this,"setMediaDeviceKind",(I,Z)=>new Promise(async(a,O)=>{this.setDeviceKind(I,Z);const e=await this.getCaller(),{id:n,tracks:q=[],callActionMap:D}=e,z=[],K=async J=>{const G=this.localStreamsActionMap.get(J),Q=q.find(et=>et.mediaType===J),nt=D[J];if(G){z.push(J),await this.stopLocalStreams([J]);try{await this.initLocalStream(J)}catch(et){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initLocalStream is error.",et),await this.inactiveTracks([J],!1),O(et)}}if(Q){const et=this.getLocalStream(J);if(et){const tt=this.getUserMediaStreamContext(n,J);tt==null||tt.replaceStream(et),nt&&await this.replaceSenderStream([J],!0)}}{const et=this.getLocalStreams(z);this.cwsIns.emitNotify("onLocalStream",{code:200,data:et,desc:"local stream is change."}),a(!0)}};I==="audioinput"&&K("microphoneCamera_audio"),I==="videoinput"&&K("microphoneCamera_video"),I==="audiooutput"&&(this.changeAudiooutput(),a(!0))}));X(this,"changeScreenSharing",async I=>{const Z=await this.getCaller(),{tracks:a=[],callActionMap:O}=Z;try{await this.setLocalStream(I,!0);for(const e of I)a.find(q=>q.mediaType===e&&O[e])&&await this.replaceSenderStream([e],!0)}catch(e){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: changeScreenSharing is error.",e)}});X(this,"createSession",()=>new Promise(async(I,Z)=>{if(["connecting","connected"].includes(this.roomState))return I(!0);this.setRoomState("connecting"),await this.taskQueue.createTask({describe:"createSession",conditionKeys:["createWs","createSession"],changeConditionKeys:["createSession"],func:()=>new Promise(async(a,O)=>{try{await this.addSenders(),this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}).then(async e=>{const{code:n=0,desc:q,data:D}=e;if(n!==200)return O(q);const{remoteSdp:z}=D;await this.taskQueue.setCondition("ice",!1),await this.taskQueue.createTask({describe:"ice",timeout:30*1e3,conditionKeys:["ice"],func:()=>new Promise(K=>setTimeout(()=>K(!0),300)),success:async()=>{a(!0)},fail:async K=>{throw new Error(`ice connection failed: ${K}`)}}),await this.setRemoteDescription({type:"answer",sdp:z})})}catch(e){O(e)}}),success:async a=>{I(a)},fail:async a=>{this.reportLogs("ws_c_timeout",a.message||a),Z(a)},complete:()=>{this.taskQueue.setCondition("createSession",!0)}})}));X(this,"earlyConnect",(I=[])=>{this.isEarly=!0,it(this,Lt).call(this),this.createSession(),I.length===0&&(I=["microphoneCamera_audio","microphoneCamera_video"]),it(this,Bt).call(this,I)});X(this,"joinRoom",async I=>new Promise(async(Z,a)=>{await this.taskQueue.createTask({describe:"joinRoom",conditionKeys:["createWs"],changeConditionKeys:["joinRoom"],func:()=>new Promise(async(O,e)=>{try{this.setOptions(I),await it(this,Lt).call(this),this.clearUsers();const{roomId:n,userId:q,callType:D,sdkToken:z}=this.options;this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:D,roomId:n,user:{id:q,tracks:[],callAction:0},token:z},version:2}).then(async K=>{const{code:J=0,desc:G="服务器繁忙",data:Q}=K;if(J!==200)return e(G);const{roomId:nt="",roomUsers:et=[]}=Q;if(nt!==n)return e("加入的房间不匹配");this.isInRoom=!0,this.initHeartbeat(),this.createSession(),await this.updateUsers(et),await this.emitNotifyUpdateUsers();const tt=await this.getUsers();O(tt)})}catch(n){e(n)}}),success:async O=>{Z(O)},fail:async O=>{this.reportLogs("join_room_error",O.message||O),a(O)},complete:()=>{this.taskQueue.setCondition("joinRoom",!0)}})}));X(this,"quitRoom",()=>new Promise(async I=>{const{roomId:Z,userId:a}=this.options,O={roomId:Z,user:{id:a}};try{this.isInRoom=!1,clearInterval(it(this,Ut)),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.setRoomState("ready")}catch(e){this.reportLogs("quit_room_error",e.message||e)}await new Promise(e=>setTimeout(()=>e(!0),300)),await this.taskQueue.setCondition("closeTrack",!0),this.cwsIns.sendMessage({event:"quitRoom",data:O}),I(!0)}));X(this,"quitRoomEx",()=>new Promise(async I=>{const{roomId:Z,userId:a}=this.options,O={roomId:Z,user:{id:a}};try{this.isInRoom=!1,this.initHeartbeat(),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams()}catch(e){this.reportLogs("quit_room_error",e.message||e)}await new Promise(e=>setTimeout(()=>e(!0),300)),this.cwsIns.sendMessage({event:"quitRoomEx",data:O}),I(!0)}));X(this,"syncRoomInfo",()=>new Promise(async(I,Z)=>{const{userId:a}=this.options,O=await this.getUser(a),{id:e=a,callAction:n=0}=O;this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:e,callAction:n}}}).then(async q=>{if(q.code!==200)return Z(q.desc);const D=q.data.users;this.clearUsers(),await this.updateUsers(D),await this.updateUsertracks(O.id,O.tracks,!1);{const z=await this.getUsers();I(z)}}).catch(q=>Z(q))}));X(this,"publish",I=>new Promise(async(Z,a)=>{try{await this.setLocalStream(I,!0)}catch(O){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setLocalStream is error.",O)}await this.taskQueue.createTask({describe:"publish",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],changeConditionKeys:["publish"],func:()=>new Promise(async(O,e)=>{try{const n=await this.getCaller(),q=[];for(const G of I){{const Q=this.getPhoneyStreams(G);await this.initUserMediaStreamContext(n.id,G,Q)}{const Q=this.getLocalStream(G);if(Q){const nt=this.getUserMediaStreamContext(n.id,G);nt==null||nt.replaceStream(Q)}else q.push(G)}}const D=I.filter(G=>!q.includes(G)||["microphoneCamera_audio","microphoneCamera_video"].includes(G));await this.replaceSenderStream(I,!1),await it(this,Bt).call(this,D);const z=await this.getSenderTracks(D),K=[...n.tracks,...z];await this.updateUsertracks(n.id,K,!0);const J=await this.getCallAction(K);await it(this,Pt).call(this,J),q.length!==0&&await this.inactiveTracks(q,!1),D.length!==0&&await this.replaceSenderStream(D,!0),it(this,Xt).call(this,I);{await this.emitNotifyUpdateUsers();const G=await this.getCaller();O(G)}}catch(n){e(n)}}),success:async O=>{Z(O)},fail:async O=>{this.reportLogs("publish_error",O.message||O),a(O)},complete:async()=>{await this.taskQueue.setCondition("publish",!0)}})}));X(this,"stopPublish",(I=[])=>new Promise(async(Z,a)=>{await this.taskQueue.createTask({describe:"stopPublish",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],changeConditionKeys:["closeTrack"],func:()=>new Promise(async(O,e)=>{try{const n=await this.getCaller();I.length===0&&(I=mediaType_keys);const q=n.tracks.filter(({mediaType:z})=>z&&I.includes(z)),D=async()=>{const z=await this.getCaller();await this.emitNotifyUpdateUsers(),O(z)};if(q.length===0)return D();await this.replaceSenderStream(I,!0),await this.closeUserTracks(n.id,q,!0),await this.removeSenders(I);{const z=await this.getCallAction(n.tracks);await it(this,Pt).call(this,z)}await this.createOffer(),this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:q}}).then(async z=>{const{code:K,desc:J,remoteSdp:G}=z.data;if(K!==200)return e(J);await this.setRemoteDescription({type:"answer",sdp:G})}),D()}catch(n){e(n)}}),success:async O=>{Z(O)},fail:async O=>{this.reportLogs("close_track_error",O.message||O),a(O)},complete:async()=>{await this.taskQueue.setCondition("closeTrack",!0)}})}));X(this,"subscribe",(I=[],Z=3)=>new Promise(async(a,O)=>{const e=await this.taskQueue.createTask({describe:"subscribe",strict:!0,conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],changeConditionKeys:["subscribe"],func:()=>new Promise(async(n,q)=>{try{const D=await this.getUsers();let z=[];for(const G of D){const{isSelf:Q,tracks:nt=[]}=G;if(!Q){const et=nt.filter(({trackName:tt,mid:ot=""})=>ot!==""&&(I.includes(tt)||I.length===0));et.length!==0&&z.push({...G,tracks:et})}}const K=async(G={})=>{const Q=Array.from(z,({id:et})=>et),nt=await this.getUsers(Q);await this.emitNotifyUpdateUsers(),n({users:nt,detail:G})};if(z.length===0)return K();const J=[];for(const G of z){const{id:Q,tracks:nt}=G,et=dt(nt,["type","trackName"]),tt={id:Q,tracks:et};J.push(tt)}this.cwsIns.sendMessage({event:"subscribe",data:{users:J}}).then(async G=>{const{code:Q=0,data:nt,desc:et}=G;if(Q!==200)return q(et);const{remoteSdp:tt,users:ot=[]}=nt;this.onSubscribeUserTracks(ot).then(async ct=>{await this.renegotiate().then(()=>K(ct)).catch(rt=>q(rt))}).catch(ct=>{q(ct)}),await this.setRemoteDescription({type:"offer",sdp:tt})})}catch(D){q(D)}}),success:async n=>{e.clear(),this.taskQueue.setCondition("subscribe",!0),a(n)},fail:async n=>{if(this.options.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: subscribe error. surplus count is ${Z}`),Z>0)return await new Promise(q=>setTimeout(()=>q(!0),(3-Z)*1e3)),Z=Z-1,e.retry();e.clear(),this.reportLogs("subscribe_error",n.message||n),this.taskQueue.setCondition("subscribe",!0),O(n)},complete:async()=>{}})}));X(this,"renegotiate",()=>new Promise(async(I,Z)=>{try{await this.taskQueue.setCondition("renegotiate",!1),await this.createAnswer(),this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then(a=>{const{code:O=0,desc:e}=a;if(O!==200)return Z(e);I(a)}).finally(()=>{this.taskQueue.setCondition("renegotiate",!0)})}catch(a){Z(a)}}));X(this,"stopSubscribe",(I=[])=>new Promise(async(Z,a)=>{await this.taskQueue.createTask({describe:"closeTrack",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe"],changeConditionKeys:["closeTrack"],func:()=>new Promise(async(O,e)=>{try{const n=await this.getUsers(),q=[];for(const z of n){const{tracks:K=[]}=z;for(const J of K){const{type:G,mid:Q,trackName:nt,mediaType:et,msid:tt}=J;if(!(!et||!tt)&&(I.length===0||I.includes(nt))){const ot={type:G,mid:Q,trackName:tt};q.push(ot),await this.closeUserTracks(z.id,[J])}}}const D=async()=>{await this.emitNotifyUpdateUsers(),O(!0)};if(q.length===0)return D();await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:q}}).then(async z=>{const{remoteSdp:K}=z.data;await this.setRemoteDescription({type:"answer",sdp:K})}),D()}catch(n){e(n)}}),success:async O=>{Z(O)},fail:async O=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: stopPublish is error.",O),this.reportLogs("close_track_error",O.message||O),a(O)},complete:async()=>{await this.taskQueue.setCondition("closeTrack",!0)}})}));X(this,"inactiveTracks",async(I,Z)=>new Promise(async a=>{const O=await this.getCaller();if(!O||!O.id)return a(!0);const{tracks:e=[]}=O,n=[...e];for(let D of n){const{mediaType:z}=D;if(z&&I.includes(z)){D.enabled=Z;const K=this.getLocalStream(z);if(!K)continue;const J=K.getTracks();for(const G of J)G.enabled=Z}}const q=await this.getCallAction(n);await it(this,Pt).call(this,q),await this.replaceSenderStream(I,Z),await this.emitNotifyUpdateUsers(),a(!0)}));X(this,"debugger",()=>new Promise(async(I,Z)=>{await this.cwsIns.sendMessage({event:"debugger"},!1).then(async a=>{if(a.code!==200)return Z(a.desc);I(!0)}).catch(a=>{Z(a)})}));X(this,"shutdown",()=>new Promise(async(I,Z)=>{await this.cwsIns.sendMessage({event:"shutdown"},!1).then(async a=>{if(a.code!==200)return Z(a.desc);I(!0)}).catch(a=>{Z(a)})}));X(this,"initHeartbeat",()=>{this.stopHeartbeat();const I=()=>this.cwsIns.sendMessage({event:this.isInRoom?"heartbeat":"heartbeatEx"},!1),Z=this.isInRoom?5*1e3:30*1e3;Rt(this,Ut,setInterval(I,Z)),I()});X(this,"stopHeartbeat",()=>{clearInterval(it(this,Ut))});vt(this,Xt,async I=>{const{roomId:Z}=this.options;if(!Z)return;const{id:a,tracks:O=[]}=await this.getCaller(),e=O.filter(n=>n.mediaType&&I.includes(n.mediaType));e.length!==0&&this.cwsIns.sendMessage({event:"pubNotify",data:{roomId:Z,user:{id:a,tracks:e}}})});vt(this,Pt,async I=>new Promise(async(Z,a)=>{const{roomId:O,userId:e}=this.options,n={roomId:O,user:{id:e,callAction:I}};await this.cwsIns.sendMessage({event:"updateCall",data:n}).then(async q=>{const{code:D=0}=q;if(D!==200)return a(q);await this.updateUserCallAction(e,I),Z(I)}).catch(q=>a(q))}));vt(this,Lt,()=>new Promise(async(I,Z)=>{try{if(["connecting","connected"].includes(this.cwsIns.state))return I(!0);await this.taskQueue.setCondition("createWs",!1),this.cwsIns.clearEvents(),this.initPeer();const{appid:a,roomId:O,userId:e}=this.options;if(!a)return Z("quickvo: createWs is error. You must first use QuickVO.setOptions to set the appid.");const n={c:a,r:O,v:this.sdk_service_version};if(this.isEarly){const D=xt();n.i=D,this.setOptions({earlyId:D})}else n.b=e;this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs",n);const q=btoa(encodeURI(JSON.stringify(n)));await this.cwsIns.connect(q),this.initHeartbeat(),await this.taskQueue.setCondition("createWs",!0),await this.taskQueue.setCondition("createSession",!0),I(!0)}catch(a){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs is error.",a),this.reportLogs("ws_c_timeout",a.message||a),Z(a)}}));vt(this,Bt,async I=>new Promise(async(Z,a)=>{await this.taskQueue.createTask({describe:"createTrack",conditionKeys:["createWs","createSession","ice","createTrack","subscribe","renegotiate","closeTrack"],func:()=>new Promise(async(O,e)=>{try{await this.taskQueue.setCondition("createTrack",!1);const n=await this.addSenders(I),q=await this.getSenderTracks(n);if(q.length===0)return await this.taskQueue.setCondition("createTrack",!0),O(!0);this.cwsIns.sendMessage({event:"publish",data:{sdp:this.getSdp(),tracks:q,callAction:0}}).then(async D=>{const{code:z=0,desc:K,data:J}=D;if(z!==200)return e(K);const{remoteSdp:G}=J;await this.setRemoteDescription({type:"answer",sdp:G}),O(!0)})}catch(n){await this.removeSenders(I),e(n)}}),success:async O=>{Z(O)},fail:async O=>{this.reportLogs("publish_error",O.message||O),a(O)},complete:async()=>{await this.taskQueue.setCondition("createTrack",!0)}})}))}}Ut=new WeakMap,Xt=new WeakMap,Pt=new WeakMap,Lt=new WeakMap,Bt=new WeakMap;class Room extends RoomCalls{constructor(F){super(F)}}class QuickVO extends Room{constructor(I){super(I);vt(this,At,new Map);X(this,"reconstruct",async()=>{this.setRoomState("ready"),this.taskQueue.clear(),this.peerIns.close(),await this.syncRoomInfo(),this.initPeer(),this.taskQueue.setCondition("createSession",!0),this.taskQueue.setCondition("ice",!0),await this.createSession();const I=[],Z=[],a=await this.getUsers();for(const O of a){const{isSelf:e,callActionMap:n,tracks:q=[]}=O;if(e)for(const D of mediaType_keys)n[D]&&I.push(D);for(const D of q)D.msid&&Z.push(D.trackName)}await this.subscribe(Z),await this.publish(I)});vt(this,te,()=>{{const I=async Z=>{const{state:a}=Z.data;if(a==="closed"){const{roomId:O,userId:e}=this.options,n={roomId:O,user:{id:e}};this.stopHeartbeat(),this.cwsIns.sendMessage({event:"quitRoom",data:n}),this.cwsIns.close(),this.reportLogs("webrtc_c_timeout","webrtc state is closed.")}a==="failed"&&this.reconstruct()};this.cwsIns.addNotify({event:"onRoomState",callback:I},!0)}{const I=async Z=>{const{qualities:a=[]}=Z.data,[O]=a;if(!(O&&O.userId===this.options.userId&&a.length===1)){for(const e of a){const{userId:n,egress:q,ingress:D}=e;this.checkUserInRoom(n)&&await this.updateUserNetwork(n,{egress:q,ingress:D})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:I},!0)}{const I=async Z=>{const a=Z.data.user;await this.updateUsers([a]),await this.updateUsertracks(a.id,a.track,!1),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:I},!0)}{const I=async Z=>{await this.removeUsers([Z.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:I},!0)}{const I=async Z=>{const{user:a}=Z.data,{id:O,tracks:e=[],callAction:n=0}=a;await this.updateUserCallAction(O,n),await this.updateUserPermissions(O,3);const q=[];{const{tracks:D}=await this.getUser(O);for(const z of e){const{mid:K,trackName:J}=z;if(D.find(Q=>Q.mid===K&&Q.trackName===J))continue;q.push(z)}}if(q.length!==0)if(await this.updateUsertracks(O,q,!0),this.options.newPublishAutoSubscribe){const D=this.getTrackNamesFormTracks(q);await this.subscribe(D)}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:I},!0)}{const I=async Z=>{const{id:a,tracks:O}=Z.data.user;a!==this.options.userId&&(await this.closeUserTracks(a,O,!0),await this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onCloseTrack",callback:I},!0)}{const I=async Z=>{const{id:a,callAction:O}=Z.data.user;this.checkUserInRoom(a)&&(await this.updateUserCallAction(a,O),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:I},!0)}{const I=async Z=>{const{user:a}=Z.data,{id:O,permissions:e=1}=a;e===1?await this.removeUsers([O]):e===3&&await this.updateUsers([a]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:I},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async I=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)});X(this,"addNotify",I=>this.cwsIns.addNotify(I));vt(this,ee,()=>{});vt(this,ie,()=>{this.cwsIns.onReconnectSuccess=async()=>{this.reconstruct()}});vt(this,ne,async()=>{this.setRoomState("closed")});X(this,"addRequestAnimationFrame",async(I,Z)=>{{const O=it(this,At).get(I);O&&cancelAnimationFrame(O)}const a=(O=Date.now())=>{Z(O);const e=requestAnimationFrame(a);it(this,At).set(I,e)};a()});X(this,"clearRequestAnimationFrame",async(I=[])=>{I.length===0&&(I=[...it(this,At).keys()]);const Z=[];for(const a of I){const O=it(this,At).get(a);O&&(cancelAnimationFrame(O),Z.push(O))}return Z});X(this,"destroy",async()=>{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 销毁SDK"),this.cwsIns.emitNotify("onDestroy",{code:200,data:{},desc:"sdk is destroy."}),this.stopLocalStreams(),await new Promise(I=>setTimeout(()=>I(!0),300)),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.cwsIns.close()});it(this,ee).call(this),it(this,ie).call(this),it(this,ne).call(this),it(this,te).call(this)}}At=new WeakMap,te=new WeakMap,ee=new WeakMap,ie=new WeakMap,ne=new WeakMap,exports.QuickVO=QuickVO,exports.ignoreEvent=ignoreEvent,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
|